@blueking/date-picker 0.0.29 → 0.0.30
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/components/common-submit.vue.d.ts +15 -10
- package/dist/components/date-panel.vue.d.ts +30 -31
- package/dist/components/date-picker.vue.d.ts +16 -12
- package/dist/components/natural-picker.vue.d.ts +16 -11
- package/dist/components/panel-wrapper.vue.d.ts +20 -24
- package/dist/components/recent-picker.vue.d.ts +29 -21
- package/dist/components/timezone-picker.vue.d.ts +15 -10
- package/dist/date-picker.vue.d.ts +36 -65
- package/dist/lang/lang.d.ts +39 -32
- package/dist/typings/constant.d.ts +28 -16
- package/dist/typings/date.d.ts +35 -0
- package/dist/typings/index.d.ts +2 -0
- package/dist/typings/store.d.ts +1 -1
- package/dist/typings/types.d.ts +11 -1
- package/dist/typings/utils.d.ts +0 -31
- package/dist/vue2-full.es.js +11511 -11448
- package/dist/vue2-light.es.js +11172 -11111
- package/dist/vue3-full.es.js +10564 -10506
- package/dist/vue3-light.es.js +1345 -1287
- package/package.json +25 -21
package/dist/vue3-light.es.js
CHANGED
|
@@ -1,62 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
var Ba = Object.defineProperty;
|
|
2
|
+
var Na = (i, e, a) => e in i ? Ba(i, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : i[e] = a;
|
|
3
|
+
var O = (i, e, a) => (Na(i, typeof e != "symbol" ? e + "" : e, a), a);
|
|
4
|
+
import A from "dayjs";
|
|
5
|
+
import { Dayjs as qt, default as Ft } from "dayjs";
|
|
6
|
+
import wa from "dayjs/plugin/customParseFormat";
|
|
7
|
+
import $a from "dayjs/plugin/localizedFormat";
|
|
8
|
+
import Da from "dayjs/plugin/timezone";
|
|
9
|
+
import Ma from "dayjs/plugin/utc";
|
|
10
|
+
import { provide as Ra, inject as Ha, defineComponent as F, openBlock as p, createElementBlock as D, createVNode as w, unref as t, withCtx as P, Fragment as B, renderList as $, createBlock as N, createTextVNode as L, toDisplayString as I, createCommentVNode as na, shallowRef as J, watch as sa, createElementVNode as s, normalizeClass as ta, withModifiers as za, ref as j, withDirectives as ia, withKeys as Aa, computed as W, vShow as ga, KeepAlive as La, resolveDynamicComponent as Ua, onBeforeUnmount as Ka, normalizeStyle as qa } from "vue";
|
|
8
11
|
import aa from "bkui-vue/lib/popover";
|
|
9
12
|
import "bkui-vue/lib/popover/popover.css";
|
|
10
|
-
import { provideGlobalConfig as
|
|
11
|
-
import { clickoutside as
|
|
12
|
-
import { AngleDoubleLeft as
|
|
13
|
+
import { provideGlobalConfig as Fa } from "bkui-vue/lib/config-provider";
|
|
14
|
+
import { clickoutside as ua } from "bkui-vue/lib/directives";
|
|
15
|
+
import { AngleDoubleLeft as Ga, AngleLeft as Ea, AngleRight as Sa, AngleDoubleRight as Oa, Close as Ja } from "bkui-vue/lib/icon";
|
|
13
16
|
import "bkui-vue/lib/styles/reset.css";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
+
import Wa from "dayjs/locale/en";
|
|
18
|
+
import Za from "dayjs/locale/zh-cn";
|
|
19
|
+
import va from "bkui-vue/lib/button";
|
|
17
20
|
import "bkui-vue/lib/button/button.css";
|
|
18
|
-
import
|
|
21
|
+
import Qa from "bkui-vue/lib/exception";
|
|
19
22
|
import "bkui-vue/lib/exception/exception.css";
|
|
20
|
-
import
|
|
23
|
+
import xa from "bkui-vue/lib/tab";
|
|
21
24
|
import "bkui-vue/lib/tab/tab.css";
|
|
22
|
-
import
|
|
25
|
+
import Xa from "bkui-vue/lib/checkbox";
|
|
23
26
|
import "bkui-vue/lib/checkbox/checkbox.css";
|
|
24
|
-
import
|
|
27
|
+
import Pa from "bkui-vue/lib/input";
|
|
25
28
|
import "bkui-vue/lib/input/input.css";
|
|
26
|
-
import
|
|
29
|
+
import K from "bkui-vue/lib/select";
|
|
27
30
|
import "bkui-vue/lib/select/select.css";
|
|
28
|
-
const
|
|
31
|
+
const ae = (i) => {
|
|
29
32
|
const e = document.cookie.match(new RegExp(`(^| )${i}=([^;]*)(;|$)`));
|
|
30
33
|
return e ? e[2] : "";
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"option-前天": "now-2d/d",
|
|
37
|
-
"option-周": "weeks",
|
|
38
|
-
"option-天": "days",
|
|
39
|
-
"option-小时": "hours",
|
|
40
|
-
"option-年": "years",
|
|
41
|
-
"option-昨天": "Yesterday",
|
|
42
|
-
"option-月": "Months",
|
|
43
|
-
"option-本周": "This week",
|
|
44
|
-
"option-本月": "This month",
|
|
45
|
-
"option-秒": "Seconds",
|
|
46
|
-
上周: "now-1w/w",
|
|
47
|
-
上月: "now-1M/M",
|
|
48
|
-
今天: "now/d",
|
|
49
|
-
分钟: "m",
|
|
50
|
-
前: "Previous",
|
|
34
|
+
}, ee = {
|
|
35
|
+
上周: "Last week",
|
|
36
|
+
上月: "Last month",
|
|
37
|
+
今天: "Today",
|
|
38
|
+
今年: "This year",
|
|
51
39
|
"前 N 周": "Previous N weeks",
|
|
52
40
|
"前 N 天": "Previous N days",
|
|
53
41
|
前天: "The day before yesterday",
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
前年: "The year before last",
|
|
43
|
+
去年: "Last year",
|
|
44
|
+
昨天: "Yesterday",
|
|
45
|
+
本周: "This week",
|
|
46
|
+
本月: "This month"
|
|
47
|
+
}, te = {
|
|
48
|
+
分钟: "minute",
|
|
49
|
+
周: "week",
|
|
50
|
+
天: "day",
|
|
51
|
+
小时: "hour",
|
|
52
|
+
年: "year",
|
|
53
|
+
月: "month",
|
|
54
|
+
毫秒: "millisecond",
|
|
55
|
+
秒: "second"
|
|
56
|
+
}, Z = {
|
|
57
|
+
M: "月",
|
|
58
|
+
d: "天",
|
|
59
|
+
h: "小时",
|
|
60
|
+
m: "分钟",
|
|
61
|
+
ms: "毫秒",
|
|
62
|
+
s: "秒",
|
|
63
|
+
w: "周",
|
|
64
|
+
y: "年"
|
|
65
|
+
}, oa = {
|
|
66
|
+
前: "Previous",
|
|
56
67
|
将来: "Future",
|
|
57
|
-
小时: "h",
|
|
58
68
|
常用时间: "Common",
|
|
59
|
-
年: "y",
|
|
60
69
|
开始时间: "Start Time",
|
|
61
70
|
支持多种时间格式自动转换: "Support multiple time formats for automatic conversion",
|
|
62
71
|
整: "whole",
|
|
@@ -64,1035 +73,192 @@ const ee = (i) => {
|
|
|
64
73
|
日期选择: "Time Range",
|
|
65
74
|
时区设置: "Timezone setting",
|
|
66
75
|
时间格式支持: "Time format support",
|
|
67
|
-
昨天: "now-1d/d",
|
|
68
76
|
暂无最近使用记录: "No recent records",
|
|
69
77
|
最近: "Last",
|
|
70
78
|
最近使用: "Recently",
|
|
71
|
-
月: "M",
|
|
72
79
|
未来: "Future",
|
|
73
|
-
本周: "now/w",
|
|
74
|
-
本月: "now/M",
|
|
75
80
|
查看支持格式: "View supported formats",
|
|
76
81
|
格式: "Format",
|
|
77
82
|
此刻: "now",
|
|
78
83
|
浏览器时间: "Browser time",
|
|
79
84
|
确定: "Confirm",
|
|
80
85
|
示例: "Example",
|
|
81
|
-
秒: "s",
|
|
82
86
|
结束时间: "End Time",
|
|
83
87
|
自然日期: "Natural",
|
|
84
88
|
至今: "so far",
|
|
85
89
|
请输入: "Please enter",
|
|
86
90
|
"请输入搜索(国家,城市,简称)": "Please enter search (country, city, abbreviation)",
|
|
87
|
-
近: "Last
|
|
91
|
+
近: "Last",
|
|
88
92
|
"(至今)": "(so far)"
|
|
89
|
-
}, Q = Object.keys(J).reduce((i, e) => (i[J[e]] = e, i), {}), ta = ee("blueking_language") || "zh-cn", s = (i, e = !0) => {
|
|
90
|
-
if (J[i] || console.info(`[i18n] ${i}: ${J[i]}`), ta !== "en")
|
|
91
|
-
return i;
|
|
92
|
-
if (e) {
|
|
93
|
-
const a = J[`option-${i}`];
|
|
94
|
-
return a != null && a.includes("now") ? J[i] : a || J[i];
|
|
95
|
-
}
|
|
96
|
-
return J[i];
|
|
97
93
|
};
|
|
98
|
-
|
|
99
|
-
const
|
|
94
|
+
Object.keys(oa).reduce((i, e) => (i[oa[e]] = e, i), {});
|
|
95
|
+
const ca = ae("blueking_language") || "zh-cn", l = (i) => ca !== "en" ? Z[i] || i : Z[i] || te[i] || ee[i] || oa[i] || i;
|
|
96
|
+
var _ = /* @__PURE__ */ ((i) => (i.Date = "date", i.FUTURE = "now+", i.NATURAL = "natural", i.RECENT = "now-", i))(_ || {});
|
|
97
|
+
const Ca = [
|
|
100
98
|
{
|
|
101
99
|
id: "s",
|
|
102
|
-
name:
|
|
100
|
+
name: l("秒")
|
|
103
101
|
},
|
|
104
102
|
{
|
|
105
103
|
id: "m",
|
|
106
|
-
name:
|
|
104
|
+
name: l("分钟")
|
|
107
105
|
},
|
|
108
106
|
{
|
|
109
107
|
id: "h",
|
|
110
|
-
name:
|
|
108
|
+
name: l("小时")
|
|
111
109
|
},
|
|
112
110
|
{
|
|
113
111
|
id: "d",
|
|
114
|
-
name:
|
|
112
|
+
name: l("天")
|
|
115
113
|
},
|
|
116
114
|
{
|
|
117
115
|
id: "w",
|
|
118
|
-
name:
|
|
116
|
+
name: l("周")
|
|
119
117
|
},
|
|
120
118
|
{
|
|
121
119
|
id: "M",
|
|
122
|
-
name:
|
|
120
|
+
name: l("月")
|
|
123
121
|
},
|
|
124
122
|
{
|
|
125
123
|
id: "y",
|
|
126
|
-
name:
|
|
124
|
+
name: l("年")
|
|
127
125
|
}
|
|
128
|
-
],
|
|
126
|
+
], Q = Ca.map((i) => i.id).join("");
|
|
129
127
|
var X = /* @__PURE__ */ ((i) => (i.custom = "custom", i.default = "default", i.edit = "edit", i))(X || {});
|
|
130
|
-
const
|
|
128
|
+
const da = [
|
|
131
129
|
{
|
|
132
130
|
id: "now/d",
|
|
133
|
-
name:
|
|
131
|
+
name: l("今天"),
|
|
134
132
|
type: "default"
|
|
135
133
|
/* default */
|
|
136
134
|
},
|
|
137
135
|
{
|
|
138
136
|
id: "now-1d/d",
|
|
139
|
-
name:
|
|
137
|
+
name: l("昨天"),
|
|
140
138
|
type: "default"
|
|
141
139
|
/* default */
|
|
142
140
|
},
|
|
143
141
|
{
|
|
144
142
|
id: "now-2d/d",
|
|
145
|
-
name:
|
|
143
|
+
name: l("前天"),
|
|
146
144
|
type: "default"
|
|
147
145
|
/* default */
|
|
148
146
|
},
|
|
149
147
|
{
|
|
150
148
|
id: "now/w",
|
|
151
|
-
name:
|
|
149
|
+
name: l("本周"),
|
|
152
150
|
type: "default"
|
|
153
151
|
/* default */
|
|
154
152
|
},
|
|
155
153
|
{
|
|
156
154
|
id: "now-1w/w",
|
|
157
|
-
name:
|
|
155
|
+
name: l("上周"),
|
|
158
156
|
type: "default"
|
|
159
157
|
/* default */
|
|
160
158
|
},
|
|
161
159
|
{
|
|
162
160
|
id: "now/M",
|
|
163
|
-
name:
|
|
161
|
+
name: l("本月"),
|
|
164
162
|
type: "default"
|
|
165
163
|
/* default */
|
|
166
164
|
},
|
|
167
165
|
{
|
|
168
166
|
id: "now-1M/M",
|
|
169
|
-
name:
|
|
167
|
+
name: l("上月"),
|
|
170
168
|
type: "default"
|
|
171
169
|
/* default */
|
|
172
170
|
},
|
|
173
171
|
{
|
|
174
172
|
id: "now-nd/d",
|
|
175
|
-
name:
|
|
176
|
-
prefix:
|
|
177
|
-
suffix:
|
|
173
|
+
name: l("前 N 天"),
|
|
174
|
+
prefix: l("前"),
|
|
175
|
+
suffix: l("天"),
|
|
178
176
|
type: "edit",
|
|
179
177
|
unit: "d"
|
|
180
178
|
},
|
|
181
179
|
{
|
|
182
180
|
id: "now-nw/w",
|
|
183
|
-
name:
|
|
184
|
-
prefix:
|
|
185
|
-
suffix:
|
|
181
|
+
name: l("前 N 周"),
|
|
182
|
+
prefix: l("前"),
|
|
183
|
+
suffix: l("周"),
|
|
186
184
|
type: "edit",
|
|
187
185
|
unit: "w"
|
|
188
186
|
}
|
|
189
187
|
];
|
|
190
|
-
var
|
|
188
|
+
var la = /* @__PURE__ */ ((i) => (i.ALL = "all", i.NOW = "now", i))(la || {});
|
|
191
189
|
const Ia = [
|
|
192
190
|
{
|
|
193
191
|
id: "all",
|
|
194
|
-
name:
|
|
192
|
+
name: l("整")
|
|
195
193
|
},
|
|
196
194
|
{
|
|
197
195
|
id: "now",
|
|
198
|
-
name:
|
|
196
|
+
name: l("至今")
|
|
199
197
|
}
|
|
200
198
|
], ie = [
|
|
201
|
-
{
|
|
202
|
-
id: "common",
|
|
203
|
-
name:
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
id: "recent",
|
|
207
|
-
name:
|
|
208
|
-
}
|
|
209
|
-
], te = [
|
|
210
|
-
{
|
|
211
|
-
id: D.RECENT,
|
|
212
|
-
name: s("最近")
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
id: D.FUTURE,
|
|
216
|
-
name: s("未来")
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
id: D.NATURAL,
|
|
220
|
-
name: s("自然日期")
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
id: D.Date,
|
|
224
|
-
name: s("日期选择")
|
|
225
|
-
}
|
|
226
|
-
], ne = "__bk_time_picker_store__", re = (i = 1) => `${ne}_${i}`, le = [
|
|
227
|
-
"YYYY-MM-DD HH:mm:ss",
|
|
228
|
-
"YYYY-MM-DD HH:mm:ss,SSS",
|
|
229
|
-
"YYYY-MM-DD HH:mm:ss.SSS",
|
|
230
|
-
"YYYY-MM-DD+HH:mm:ss",
|
|
231
|
-
"MM/DD/YYYY HH:mm:ss",
|
|
232
|
-
"YYYYMMDDHHmmss",
|
|
233
|
-
"YYYYMMDD HHmmss",
|
|
234
|
-
"YYYYMMDD HHmmss.SSS",
|
|
235
|
-
"DD/MMM/YYYY:HH:mm:ss",
|
|
236
|
-
"DD/MMM/YYYY:HH:mm:ssZ",
|
|
237
|
-
"DD/MMM/YYYY:HH:mm:ss Z",
|
|
238
|
-
"DD/MMM/YYYY:HH:mm:ssZZ",
|
|
239
|
-
"DD/MMM/YYYY:HH:mm:ss ZZ",
|
|
240
|
-
"YYYY-MM-DDTHH:mm:ss",
|
|
241
|
-
"YYYY-MM-DDTHH:mm:ss.SSS",
|
|
242
|
-
"YYYYMMDDTHHmmssZ",
|
|
243
|
-
"YYYYMMDDTHHmmss.SSSSSSZ",
|
|
244
|
-
"YYYY-MM-DDTHH:mm:ss.SSSZ",
|
|
245
|
-
"YYYY-MM-DDTHH:mm:ssZ",
|
|
246
|
-
"YYYY-MM-DDTHH:mm:ss.SSSSSSZ"
|
|
247
|
-
], ra = new RegExp(`now[+-](\\d+)([${na}]{1})`), q = new RegExp(`now[+-]?(\\d*)([${na}]?)\\/([${na}]?)`), Va = new RegExp(`now([+-]?\\d*)([${na}]?)\\/?([${na}]?)`), Ba = Symbol("DATE_PICKER_PROVIDER_KEY"), ce = (i) => {
|
|
248
|
-
Ra(Ba, i);
|
|
249
|
-
}, Ya = () => La(Ba), $a = (i, e) => {
|
|
250
|
-
if (!oa(i))
|
|
251
|
-
return (i == null ? void 0 : i[0]) || "";
|
|
252
|
-
const [a, o] = i;
|
|
253
|
-
let l = p(a, e);
|
|
254
|
-
l = l.isValid() ? l : p(a);
|
|
255
|
-
let r = p(o, e);
|
|
256
|
-
if (r = r.isValid() ? r : p(o), l.isValid() || r.isValid()) {
|
|
257
|
-
let n = e;
|
|
258
|
-
if (o === "now")
|
|
259
|
-
return `${l.format(e)} ~ ${s("此刻")}`;
|
|
260
|
-
const h = ["Y", "M", "D", "H", "m", "s"].reduce(
|
|
261
|
-
(d, b, g, P) => (g < 1 || (e.indexOf(b) > e.indexOf(P[g - 1]) ? d.push(b) : d = []), d),
|
|
262
|
-
["Y"]
|
|
263
|
-
);
|
|
264
|
-
if (h.length > 1 && h.includes("D") && l.isSame(r, "year")) {
|
|
265
|
-
const [, d] = e.match(/(Y+)/);
|
|
266
|
-
let b = e.replace(d, l.format(d));
|
|
267
|
-
if (n = n.replace(/Y+[-/\\\s]/, ""), l.isSame(r, "month")) {
|
|
268
|
-
const [, g] = e.match(/(M+)/);
|
|
269
|
-
if (b = b.replace(g, l.format(g)), n = n.replace(/M+[-/\\\s]/, ""), l.isSame(r, "day")) {
|
|
270
|
-
const [, P] = e.match(/(d+|D+)/);
|
|
271
|
-
if (b = b.replace(P, l.format(P)), n = n.replace(/(d|D)+[-/\\\s]/, ""), l.isSame(r, "hour")) {
|
|
272
|
-
const [, $] = e.match(/(H+|h+)/);
|
|
273
|
-
if (b = b.replace($, l.format($)), n = n.replace(/[Hh]+[-/\\\s:]/, ""), l.isSame(r, "minute")) {
|
|
274
|
-
const [, N] = e.match(/(m+)/);
|
|
275
|
-
b = b.replace(N, l.format(N)), n = n.replace(/m+[-/\\\s:]/, "");
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return b.replace(
|
|
281
|
-
n,
|
|
282
|
-
`(${l.format(n)} ~ ${r.format(n)})`
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
return `${l.format(e)} ~ ${r.format(e)}`;
|
|
286
|
-
}
|
|
287
|
-
if (!a.includes("/") && o === "now" || a === "now") {
|
|
288
|
-
const [, n, h] = (a === "now" ? o : a).match(ra) || [];
|
|
289
|
-
return !n || !h ? "" : `${s(a === "now" ? "未来" : "近")}${n}${ta === "en" ? " " : ""}${s(
|
|
290
|
-
Q[h],
|
|
291
|
-
!0
|
|
292
|
-
)}`;
|
|
293
|
-
}
|
|
294
|
-
const y = o !== "now" ? "" : s("(至今)");
|
|
295
|
-
if (Q[a])
|
|
296
|
-
return s(Q[a].replace("option-", ""), !0) + y;
|
|
297
|
-
const [, m, c] = a.match(q) || [];
|
|
298
|
-
return !m || !c ? "" : `${`${s("前")} ${m} ${s(Q[c], !0)}`}${y}`;
|
|
299
|
-
}, ha = (i) => {
|
|
300
|
-
if (!oa(i))
|
|
301
|
-
return D.RECENT;
|
|
302
|
-
const [e, a] = i, o = p(e), l = p(a);
|
|
303
|
-
return o.isValid() || l.isValid() ? D.Date : !e.includes("/") && a === "now" ? D.RECENT : e === "now" ? D.FUTURE : (e === a || a === "now") && q.test(e) || q.test(e) && q.test(a) ? D.NATURAL : D.Date;
|
|
304
|
-
}, ka = (i) => {
|
|
305
|
-
if (!oa(i))
|
|
306
|
-
return [];
|
|
307
|
-
const [e, a] = i, o = p(e), l = p(a);
|
|
308
|
-
if (o.isValid() || l.isValid())
|
|
309
|
-
return [o, a === "now" ? p() : l];
|
|
310
|
-
if (!e.includes("/") && a === "now") {
|
|
311
|
-
const [, b, g] = e.match(ra) || [];
|
|
312
|
-
return !b || !g ? [] : [p().add(-b, g), p()];
|
|
313
|
-
}
|
|
314
|
-
if (e === "now") {
|
|
315
|
-
const [, b, g] = a.match(ra) || [];
|
|
316
|
-
return !b || !g ? [] : [p(), p().add(+b, g)];
|
|
317
|
-
}
|
|
318
|
-
const [, r, y, m] = e.match(q) || [];
|
|
319
|
-
if ((!r || !y) && !m)
|
|
320
|
-
return [];
|
|
321
|
-
const c = y || m, n = p().startOf(c).subtract(+r, y || m);
|
|
322
|
-
if (a === "now")
|
|
323
|
-
return [n, p()];
|
|
324
|
-
if (e === a)
|
|
325
|
-
return [n, n.endOf(c)];
|
|
326
|
-
const [, h] = a.match(q) || [], d = p().subtract(+h, c).endOf(c);
|
|
327
|
-
return [n, d];
|
|
328
|
-
}, se = (i, e = "start") => {
|
|
329
|
-
const [, a, o, l] = i.match(Va) || [];
|
|
330
|
-
let r;
|
|
331
|
-
return a && (r = p(r).add(+a, o || l)), l && (r = e === "start" ? p(r).startOf(l) : p(r).endOf(l)), r;
|
|
332
|
-
}, oa = (i) => {
|
|
333
|
-
if (!Array.isArray(i) || i.length < 2)
|
|
334
|
-
return !1;
|
|
335
|
-
const [e, a] = i, o = p(e), l = p(a);
|
|
336
|
-
if (o.isValid() || l.isValid())
|
|
337
|
-
return a === "now" ? o.isValid() : o.isValid() && l.isValid();
|
|
338
|
-
if (!e.includes("/") && a === "now" || e === "now") {
|
|
339
|
-
const r = e === "now" ? a : e;
|
|
340
|
-
return ra.test(r);
|
|
341
|
-
}
|
|
342
|
-
return a === "now" || e === a ? q.test(e) : q.test(e) && q.test(a);
|
|
343
|
-
}, ue = (i) => {
|
|
344
|
-
const e = localStorage.getItem(i);
|
|
345
|
-
let a = [];
|
|
346
|
-
if (e)
|
|
347
|
-
try {
|
|
348
|
-
a = JSON.parse(e);
|
|
349
|
-
} catch {
|
|
350
|
-
a = [];
|
|
351
|
-
}
|
|
352
|
-
return Array.isArray(a) || (a = []), a;
|
|
353
|
-
}, oe = (i, e) => {
|
|
354
|
-
if (!oa(i))
|
|
355
|
-
return;
|
|
356
|
-
let a = [];
|
|
357
|
-
const o = localStorage.getItem(e);
|
|
358
|
-
if (o)
|
|
359
|
-
try {
|
|
360
|
-
a = JSON.parse(o);
|
|
361
|
-
} catch {
|
|
362
|
-
a = [];
|
|
363
|
-
}
|
|
364
|
-
Array.isArray(a) || (a = []), !a.some((l) => l[0] === i[0] && l[1] === i[1]) && (a.unshift(i), localStorage.setItem(e, JSON.stringify(a.slice(0, 10))));
|
|
365
|
-
}, de = { class: "common-panel-tab" }, _a = /* @__PURE__ */ G({
|
|
366
|
-
__name: "common-tab",
|
|
367
|
-
props: {
|
|
368
|
-
modelValue: {
|
|
369
|
-
required: !0,
|
|
370
|
-
type: String
|
|
371
|
-
},
|
|
372
|
-
/** panels */
|
|
373
|
-
panels: {
|
|
374
|
-
required: !0,
|
|
375
|
-
type: Array
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
setup(i) {
|
|
379
|
-
return (e, a) => (f(), z("div", de, [
|
|
380
|
-
M(t(ga), {
|
|
381
|
-
active: i.modelValue,
|
|
382
|
-
type: "unborder-card",
|
|
383
|
-
"onUpdate:active": a[0] || (a[0] = (o) => e.$emit("update:modelValue", o))
|
|
384
|
-
}, {
|
|
385
|
-
default: C(() => [
|
|
386
|
-
(f(!0), z(
|
|
387
|
-
j,
|
|
388
|
-
null,
|
|
389
|
-
L(i.panels, (o) => (f(), R(t(ga).TabPanel, {
|
|
390
|
-
key: o.id,
|
|
391
|
-
name: o.id,
|
|
392
|
-
label: o.name
|
|
393
|
-
}, null, 8, ["name", "label"]))),
|
|
394
|
-
128
|
|
395
|
-
/* KEYED_FRAGMENT */
|
|
396
|
-
))
|
|
397
|
-
]),
|
|
398
|
-
_: 1
|
|
399
|
-
/* STABLE */
|
|
400
|
-
}, 8, ["active"])
|
|
401
|
-
]));
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
const ba = /* @__PURE__ */ G({
|
|
405
|
-
__name: "common-submit",
|
|
406
|
-
props: {
|
|
407
|
-
disabled: { type: Boolean }
|
|
408
|
-
},
|
|
409
|
-
emits: ["submit"],
|
|
410
|
-
setup(i) {
|
|
411
|
-
return (e, a) => (f(), z(
|
|
412
|
-
j,
|
|
413
|
-
null,
|
|
414
|
-
[
|
|
415
|
-
M(t(ma), {
|
|
416
|
-
class: "common-submit",
|
|
417
|
-
outline: !0,
|
|
418
|
-
theme: "primary",
|
|
419
|
-
disabled: e.disabled,
|
|
420
|
-
onClick: a[0] || (a[0] = (o) => e.$emit("submit"))
|
|
421
|
-
}, {
|
|
422
|
-
default: C(() => [
|
|
423
|
-
U(
|
|
424
|
-
k(t(s)("确定")),
|
|
425
|
-
1
|
|
426
|
-
/* TEXT */
|
|
427
|
-
)
|
|
428
|
-
]),
|
|
429
|
-
_: 1
|
|
430
|
-
/* STABLE */
|
|
431
|
-
}, 8, ["disabled"]),
|
|
432
|
-
la("v-if", !0)
|
|
433
|
-
],
|
|
434
|
-
64
|
|
435
|
-
/* STABLE_FRAGMENT */
|
|
436
|
-
));
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
const me = { class: "date-panel" }, he = { class: "date-panel-title" }, be = { class: "date-panel-main" }, ve = { class: "date-header" }, pe = { class: "date-header-left" }, Ae = { class: "date-header-center" }, fe = /* @__PURE__ */ u(
|
|
440
|
-
"span",
|
|
441
|
-
{ class: "date-split" },
|
|
442
|
-
null,
|
|
443
|
-
-1
|
|
444
|
-
/* HOISTED */
|
|
445
|
-
), ge = { class: "date-header-right" }, xe = { class: "date-content" }, Ie = { class: "date-grid" }, ke = ["onClick"], ya = 6, ca = 7, wa = /* @__PURE__ */ G({
|
|
446
|
-
__name: "date-panel",
|
|
447
|
-
props: {
|
|
448
|
-
format: { default: "YYYY-MM-DD HH:mm:ss" },
|
|
449
|
-
isNow: { type: Boolean },
|
|
450
|
-
minDate: {},
|
|
451
|
-
modelValue: {}
|
|
452
|
-
},
|
|
453
|
-
emits: ["update:isNow", "update:modelValue"],
|
|
454
|
-
setup(i, { emit: e }) {
|
|
455
|
-
const a = i, o = e, l = ta === "en" ? ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] : ["日", "一", "二", "三", "四", "五", "六"], r = W([]), y = p(), m = W(a.modelValue || y);
|
|
456
|
-
ua(m, () => {
|
|
457
|
-
const d = m.value.startOf("month").startOf("week"), b = [];
|
|
458
|
-
for (let g = 0; g < ya * ca; g++)
|
|
459
|
-
b.push(d.add(g, "day"));
|
|
460
|
-
r.value = b;
|
|
461
|
-
}, {
|
|
462
|
-
immediate: !0
|
|
463
|
-
});
|
|
464
|
-
const c = (d) => {
|
|
465
|
-
m.value = m.value.add(d, "month");
|
|
466
|
-
}, n = (d) => {
|
|
467
|
-
m.value = m.value.add(d, "year");
|
|
468
|
-
}, h = (d) => {
|
|
469
|
-
a.minDate && d.isBefore(a.minDate, "day") || o("update:modelValue", d);
|
|
470
|
-
};
|
|
471
|
-
return (d, b) => (f(), z("div", me, [
|
|
472
|
-
u("div", he, [
|
|
473
|
-
U(
|
|
474
|
-
k(t(s)("结束时间")) + " ",
|
|
475
|
-
1
|
|
476
|
-
/* TEXT */
|
|
477
|
-
),
|
|
478
|
-
M(t(ae), {
|
|
479
|
-
size: "small",
|
|
480
|
-
class: "title-check",
|
|
481
|
-
"model-value": a.isNow,
|
|
482
|
-
"onUpdate:modelValue": b[0] || (b[0] = (g) => d.$emit("update:isNow", !g))
|
|
483
|
-
}, {
|
|
484
|
-
default: C(() => [
|
|
485
|
-
U(" now ")
|
|
486
|
-
]),
|
|
487
|
-
_: 1
|
|
488
|
-
/* STABLE */
|
|
489
|
-
}, 8, ["model-value"])
|
|
490
|
-
]),
|
|
491
|
-
u("div", be, [
|
|
492
|
-
u("div", ve, [
|
|
493
|
-
u("div", pe, [
|
|
494
|
-
M(t(Oa), {
|
|
495
|
-
class: "hand-icon",
|
|
496
|
-
onClick: b[1] || (b[1] = (g) => n(-1))
|
|
497
|
-
}),
|
|
498
|
-
M(t(Pa), {
|
|
499
|
-
class: "hand-icon",
|
|
500
|
-
onClick: b[2] || (b[2] = (g) => c(-1))
|
|
501
|
-
})
|
|
502
|
-
]),
|
|
503
|
-
u("div", Ae, [
|
|
504
|
-
U(
|
|
505
|
-
k(m.value.year()),
|
|
506
|
-
1
|
|
507
|
-
/* TEXT */
|
|
508
|
-
),
|
|
509
|
-
fe,
|
|
510
|
-
U(
|
|
511
|
-
k(m.value.month() + 1),
|
|
512
|
-
1
|
|
513
|
-
/* TEXT */
|
|
514
|
-
)
|
|
515
|
-
]),
|
|
516
|
-
u("div", ge, [
|
|
517
|
-
M(t(Da), {
|
|
518
|
-
class: "hand-icon",
|
|
519
|
-
onClick: b[3] || (b[3] = (g) => c(1))
|
|
520
|
-
}),
|
|
521
|
-
M(t(Ja), {
|
|
522
|
-
class: "hand-icon",
|
|
523
|
-
onClick: b[4] || (b[4] = (g) => n(1))
|
|
524
|
-
})
|
|
525
|
-
])
|
|
526
|
-
]),
|
|
527
|
-
u("div", xe, [
|
|
528
|
-
u("ul", Ie, [
|
|
529
|
-
(f(!0), z(
|
|
530
|
-
j,
|
|
531
|
-
null,
|
|
532
|
-
L(t(l), (g, P) => (f(), z(
|
|
533
|
-
"li",
|
|
534
|
-
{
|
|
535
|
-
class: "date-grid-item not-click",
|
|
536
|
-
key: P
|
|
537
|
-
},
|
|
538
|
-
k(g),
|
|
539
|
-
1
|
|
540
|
-
/* TEXT */
|
|
541
|
-
))),
|
|
542
|
-
128
|
|
543
|
-
/* KEYED_FRAGMENT */
|
|
544
|
-
))
|
|
545
|
-
]),
|
|
546
|
-
(f(), z(
|
|
547
|
-
j,
|
|
548
|
-
null,
|
|
549
|
-
L(ya, (g) => u("ul", {
|
|
550
|
-
class: "date-grid",
|
|
551
|
-
key: g
|
|
552
|
-
}, [
|
|
553
|
-
(f(!0), z(
|
|
554
|
-
j,
|
|
555
|
-
null,
|
|
556
|
-
L(r.value.slice((g - 1) * ca, (g - 1) * ca + ca), (P) => (f(), z("li", {
|
|
557
|
-
class: ea(["date-grid-item", {
|
|
558
|
-
"is-last-month": P.isBefore(m.value, "month"),
|
|
559
|
-
"is-next-month": P.isAfter(m.value, "month"),
|
|
560
|
-
"is-today": P.isSame(t(y), "day"),
|
|
561
|
-
"is-disabled": d.minDate && P.isBefore(d.minDate, "day"),
|
|
562
|
-
"is-selected": a.modelValue && P.isSame(a.modelValue, "day")
|
|
563
|
-
}]),
|
|
564
|
-
key: P.unix(),
|
|
565
|
-
onClick: Sa(($) => h(P), ["prevent"])
|
|
566
|
-
}, k(P.date()), 11, ke))),
|
|
567
|
-
128
|
|
568
|
-
/* KEYED_FRAGMENT */
|
|
569
|
-
))
|
|
570
|
-
])),
|
|
571
|
-
64
|
|
572
|
-
/* STABLE_FRAGMENT */
|
|
573
|
-
))
|
|
574
|
-
])
|
|
575
|
-
])
|
|
576
|
-
]));
|
|
577
|
-
}
|
|
578
|
-
});
|
|
579
|
-
const _e = { class: "date-wrapper" }, ye = { class: "date-input" }, we = { class: "date-picker" }, Me = /* @__PURE__ */ u(
|
|
580
|
-
"span",
|
|
581
|
-
{ class: "date-picker-icon" },
|
|
582
|
-
[
|
|
583
|
-
/* @__PURE__ */ u("svg", {
|
|
584
|
-
class: "date-content-icon",
|
|
585
|
-
viewBox: "0 0 1024 1024",
|
|
586
|
-
version: "1.1",
|
|
587
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
588
|
-
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
589
|
-
width: "14",
|
|
590
|
-
height: "14"
|
|
591
|
-
}, [
|
|
592
|
-
/* @__PURE__ */ u("path", {
|
|
593
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
594
|
-
d: "M558.933 465.067h-93.866v93.866h93.866v-93.866z m0 162.133h-93.866v93.867h93.866V627.2z m371.2-533.333h-93.866V21.333c0-12.8-8.534-21.333-21.334-21.333S793.6 8.533 793.6 21.333V89.6H234.667V21.333c0-12.8-12.8-21.333-25.6-21.333s-21.334 8.533-21.334 21.333V89.6H93.867C42.667 93.867 0 136.533 0 187.733V934.4c0 46.933 42.667 89.6 93.867 89.6h836.266c51.2 0 93.867-42.667 93.867-93.867v-742.4c0-51.2-42.667-93.866-93.867-93.866z m46.934 836.266c0 25.6-21.334 46.934-46.934 46.934H93.867c-25.6 0-46.934-21.334-46.934-46.934V371.2h930.134v558.933z m0-605.866H46.933V187.733c0-25.6 21.334-46.933 46.934-46.933h93.866v68.267c0 12.8 8.534 21.333 21.334 21.333s21.333-8.533 21.333-21.333V140.8h558.933v68.267c0 12.8 8.534 21.333 21.334 21.333S832 221.867 832 209.067V140.8h93.867c25.6 0 46.933 21.333 46.933 46.933v136.534h4.267zM789.333 627.2h-93.866v93.867h93.866V627.2z m0-162.133h-93.866v93.866h93.866v-93.866z m-230.4 324.266h-93.866V883.2h93.866v-93.867z m-234.666 0h-89.6V883.2h93.866v-93.867h-4.266z m0-324.266h-89.6v93.866h93.866v-93.866h-4.266z m0 162.133h-89.6v93.867h93.866V627.2h-4.266z",
|
|
595
|
-
fill: "#C4C6CC"
|
|
596
|
-
})
|
|
597
|
-
])
|
|
598
|
-
],
|
|
599
|
-
-1
|
|
600
|
-
/* HOISTED */
|
|
601
|
-
), ze = ["placeholder", "value"], Ee = /* @__PURE__ */ u(
|
|
602
|
-
"span",
|
|
603
|
-
{ class: "date-picker-split" },
|
|
604
|
-
"~",
|
|
605
|
-
-1
|
|
606
|
-
/* HOISTED */
|
|
607
|
-
), Se = ["placeholder", "value"], Pe = { class: "show-format" }, De = { class: "date-format-wrapper" }, Ce = { class: "content-title" }, Te = { class: "content-table" }, Ve = /* @__PURE__ */ G({
|
|
608
|
-
__name: "date-picker",
|
|
609
|
-
props: {
|
|
610
|
-
value: {}
|
|
611
|
-
},
|
|
612
|
-
emits: ["change"],
|
|
613
|
-
setup(i, { emit: e }) {
|
|
614
|
-
p.extend(Ma);
|
|
615
|
-
const a = i, o = e, l = B(null), r = B(null), y = B(!1), m = B(!1), c = W(), n = W(), h = B(!1), { format: d } = Ya(), b = p();
|
|
616
|
-
ua(() => a.value, (x) => {
|
|
617
|
-
if (!Array.isArray(x) || x.length < 2)
|
|
618
|
-
return;
|
|
619
|
-
const [I, w] = x, Y = p(I), H = p(w);
|
|
620
|
-
if (!(!Y.isValid() && !H.isValid())) {
|
|
621
|
-
if (Y.isValid()) {
|
|
622
|
-
const O = p(I, d.value);
|
|
623
|
-
c.value = O.isValid() ? O : Y;
|
|
624
|
-
}
|
|
625
|
-
if (w === "now") {
|
|
626
|
-
h.value = !0, n.value = p();
|
|
627
|
-
return;
|
|
628
|
-
}
|
|
629
|
-
if (H.isValid()) {
|
|
630
|
-
const O = p(w, d.value);
|
|
631
|
-
n.value = O.isValid() ? O : H;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
}, {
|
|
635
|
-
immediate: !0
|
|
636
|
-
});
|
|
637
|
-
const g = async (x, I) => {
|
|
638
|
-
var O, va, pa;
|
|
639
|
-
const w = x.target.value.toString().trim();
|
|
640
|
-
if (!w || I === "end" && w === "now" && h.value)
|
|
641
|
-
return;
|
|
642
|
-
if (w === "now" && I === "end") {
|
|
643
|
-
h.value || (h.value = !0, A(p(), !1));
|
|
644
|
-
return;
|
|
645
|
-
}
|
|
646
|
-
const Y = I === "start" ? c.value : n.value;
|
|
647
|
-
let H;
|
|
648
|
-
Va.test(w) && (H = se(w, I)), H || (H = p(w)), H.isValid() && (Y != null && Y.isSame(H) || (I === "start" ? E(H) : (h.value = w === "now", A(H, !!((O = c.value) != null && O.isSame(H)))))), x.target.value = I === "start" ? ((va = c.value) == null ? void 0 : va.format(d.value)) || "" : ((pa = n.value) == null ? void 0 : pa.format(d.value)) || "";
|
|
649
|
-
}, P = () => {
|
|
650
|
-
y.value = !0;
|
|
651
|
-
}, $ = () => {
|
|
652
|
-
m.value = !0;
|
|
653
|
-
}, N = (x = 32) => {
|
|
654
|
-
setTimeout(() => y.value = !1, x);
|
|
655
|
-
}, K = (x = 32) => {
|
|
656
|
-
setTimeout(() => m.value = !1, x);
|
|
657
|
-
}, E = (x) => {
|
|
658
|
-
var I;
|
|
659
|
-
c.value = x, n.value || ((I = r.value) == null || I.focus(), $()), N();
|
|
660
|
-
}, A = (x, I = !0) => {
|
|
661
|
-
var w;
|
|
662
|
-
n.value = I ? p(x.endOf("day")) : x, h.value = I ? !1 : h.value, c.value || ((w = l.value) == null || w.focus(), P()), K();
|
|
663
|
-
}, v = () => {
|
|
664
|
-
h.value = !h.value, A(p(), !1), c.value && (y.value = !1);
|
|
665
|
-
}, S = () => {
|
|
666
|
-
c.value = void 0, n.value = void 0, h.value = !1, N(), K();
|
|
667
|
-
}, _ = () => {
|
|
668
|
-
var x, I;
|
|
669
|
-
c.value && n.value && o("change", [
|
|
670
|
-
((x = c.value) == null ? void 0 : x.format(d.value)) || "",
|
|
671
|
-
h.value ? "now" : ((I = n.value) == null ? void 0 : I.format(d.value)) || ""
|
|
672
|
-
]);
|
|
673
|
-
}, V = (x) => {
|
|
674
|
-
var I;
|
|
675
|
-
y.value && ((I = document.querySelector(".__date-picker-popover-start__")) != null && I.contains(x.target) || N());
|
|
676
|
-
}, T = (x) => {
|
|
677
|
-
var I;
|
|
678
|
-
m.value && ((I = document.querySelector(".__date-picker-popover-end__")) != null && I.contains(x.target) || K());
|
|
679
|
-
};
|
|
680
|
-
return (x, I) => (f(), z("div", _e, [
|
|
681
|
-
u("div", ye, [
|
|
682
|
-
u("div", we, [
|
|
683
|
-
Me,
|
|
684
|
-
M(t(aa), {
|
|
685
|
-
trigger: "manual",
|
|
686
|
-
theme: "light",
|
|
687
|
-
placement: "bottom-start",
|
|
688
|
-
boundary: "parent",
|
|
689
|
-
"ext-cls": "__bk-date-picker-popover__ __date-picker-popover-start__",
|
|
690
|
-
arrow: !1,
|
|
691
|
-
"is-show": y.value
|
|
692
|
-
}, {
|
|
693
|
-
content: C(() => [
|
|
694
|
-
M(wa, {
|
|
695
|
-
format: t(d),
|
|
696
|
-
"is-now": h.value,
|
|
697
|
-
key: "start",
|
|
698
|
-
"model-value": c.value,
|
|
699
|
-
"onUpdate:modelValue": E,
|
|
700
|
-
"onUpdate:isNow": v
|
|
701
|
-
}, null, 8, ["format", "is-now", "model-value"])
|
|
702
|
-
]),
|
|
703
|
-
default: C(() => {
|
|
704
|
-
var w;
|
|
705
|
-
return [
|
|
706
|
-
ia(u("input", {
|
|
707
|
-
ref_key: "startInput",
|
|
708
|
-
ref: l,
|
|
709
|
-
class: "date-picker-start",
|
|
710
|
-
spellcheck: "false",
|
|
711
|
-
placeholder: t(s)("开始时间"),
|
|
712
|
-
value: (w = c.value) == null ? void 0 : w.format(t(d)),
|
|
713
|
-
onClick: P,
|
|
714
|
-
onBlur: I[0] || (I[0] = (Y) => g(Y, "start")),
|
|
715
|
-
onKeypress: I[1] || (I[1] = Aa((Y) => g(Y, "start"), ["enter"]))
|
|
716
|
-
}, null, 40, ze), [
|
|
717
|
-
[t(da), V]
|
|
718
|
-
])
|
|
719
|
-
];
|
|
720
|
-
}),
|
|
721
|
-
_: 1
|
|
722
|
-
/* STABLE */
|
|
723
|
-
}, 8, ["is-show"]),
|
|
724
|
-
Ee,
|
|
725
|
-
M(t(aa), {
|
|
726
|
-
trigger: "manual",
|
|
727
|
-
theme: "light",
|
|
728
|
-
placement: "bottom-start",
|
|
729
|
-
boundary: "parent",
|
|
730
|
-
"ext-cls": "__bk-date-picker-popover__ __date-picker-popover-end__",
|
|
731
|
-
arrow: !1,
|
|
732
|
-
"is-show": m.value
|
|
733
|
-
}, {
|
|
734
|
-
content: C(() => [
|
|
735
|
-
M(wa, {
|
|
736
|
-
format: t(d),
|
|
737
|
-
"is-now": h.value,
|
|
738
|
-
"min-date": c.value,
|
|
739
|
-
"model-value": n.value,
|
|
740
|
-
key: "end",
|
|
741
|
-
"onUpdate:modelValue": A,
|
|
742
|
-
"onUpdate:isNow": v
|
|
743
|
-
}, null, 8, ["format", "is-now", "min-date", "model-value"])
|
|
744
|
-
]),
|
|
745
|
-
default: C(() => {
|
|
746
|
-
var w;
|
|
747
|
-
return [
|
|
748
|
-
ia(u("input", {
|
|
749
|
-
ref_key: "endInput",
|
|
750
|
-
ref: r,
|
|
751
|
-
class: "date-picker-end",
|
|
752
|
-
placeholder: t(s)("结束时间"),
|
|
753
|
-
value: h.value ? "now" : (w = n.value) == null ? void 0 : w.format(t(d)),
|
|
754
|
-
onClick: $,
|
|
755
|
-
onBlur: I[2] || (I[2] = (Y) => g(Y, "end")),
|
|
756
|
-
onKeypress: I[3] || (I[3] = Aa((Y) => g(Y, "end"), ["enter"]))
|
|
757
|
-
}, null, 40, Se), [
|
|
758
|
-
[t(da), T]
|
|
759
|
-
])
|
|
760
|
-
];
|
|
761
|
-
}),
|
|
762
|
-
_: 1
|
|
763
|
-
/* STABLE */
|
|
764
|
-
}, 8, ["is-show"]),
|
|
765
|
-
c.value || n.value ? (f(), R(t(Wa), {
|
|
766
|
-
key: 0,
|
|
767
|
-
class: "date-picker-clear",
|
|
768
|
-
onClick: S
|
|
769
|
-
})) : la("v-if", !0)
|
|
770
|
-
]),
|
|
771
|
-
M(ba, {
|
|
772
|
-
disabled: !(c.value && n.value),
|
|
773
|
-
onSubmit: _
|
|
774
|
-
}, null, 8, ["disabled"])
|
|
775
|
-
]),
|
|
776
|
-
u("div", Pe, [
|
|
777
|
-
U(
|
|
778
|
-
k(t(s)("支持多种时间格式自动转换")) + " ",
|
|
779
|
-
1
|
|
780
|
-
/* TEXT */
|
|
781
|
-
),
|
|
782
|
-
M(t(aa), {
|
|
783
|
-
trigger: "click",
|
|
784
|
-
placement: "bottom",
|
|
785
|
-
theme: "light"
|
|
786
|
-
}, {
|
|
787
|
-
content: C(() => [
|
|
788
|
-
u("div", De, [
|
|
789
|
-
u(
|
|
790
|
-
"div",
|
|
791
|
-
Ce,
|
|
792
|
-
k(t(s)("时间格式支持")),
|
|
793
|
-
1
|
|
794
|
-
/* TEXT */
|
|
795
|
-
),
|
|
796
|
-
u("table", Te, [
|
|
797
|
-
u("thead", null, [
|
|
798
|
-
u("tr", null, [
|
|
799
|
-
u(
|
|
800
|
-
"th",
|
|
801
|
-
null,
|
|
802
|
-
k(t(s)("格式")),
|
|
803
|
-
1
|
|
804
|
-
/* TEXT */
|
|
805
|
-
),
|
|
806
|
-
u(
|
|
807
|
-
"th",
|
|
808
|
-
null,
|
|
809
|
-
k(t(s)("示例")),
|
|
810
|
-
1
|
|
811
|
-
/* TEXT */
|
|
812
|
-
)
|
|
813
|
-
])
|
|
814
|
-
]),
|
|
815
|
-
u("tbody", null, [
|
|
816
|
-
(f(!0), z(
|
|
817
|
-
j,
|
|
818
|
-
null,
|
|
819
|
-
L(t(le), (w) => (f(), z("tr", { key: w }, [
|
|
820
|
-
u(
|
|
821
|
-
"td",
|
|
822
|
-
null,
|
|
823
|
-
k(w),
|
|
824
|
-
1
|
|
825
|
-
/* TEXT */
|
|
826
|
-
),
|
|
827
|
-
u(
|
|
828
|
-
"td",
|
|
829
|
-
null,
|
|
830
|
-
k(t(b).format(w)),
|
|
831
|
-
1
|
|
832
|
-
/* TEXT */
|
|
833
|
-
)
|
|
834
|
-
]))),
|
|
835
|
-
128
|
|
836
|
-
/* KEYED_FRAGMENT */
|
|
837
|
-
))
|
|
838
|
-
])
|
|
839
|
-
])
|
|
840
|
-
])
|
|
841
|
-
]),
|
|
842
|
-
default: C(() => [
|
|
843
|
-
M(t(ma), {
|
|
844
|
-
text: "",
|
|
845
|
-
theme: "primary",
|
|
846
|
-
class: "format-button"
|
|
847
|
-
}, {
|
|
848
|
-
default: C(() => [
|
|
849
|
-
U(
|
|
850
|
-
k(t(s)("查看支持格式")),
|
|
851
|
-
1
|
|
852
|
-
/* TEXT */
|
|
853
|
-
)
|
|
854
|
-
]),
|
|
855
|
-
_: 1
|
|
856
|
-
/* STABLE */
|
|
857
|
-
})
|
|
858
|
-
]),
|
|
859
|
-
_: 1
|
|
860
|
-
/* STABLE */
|
|
861
|
-
})
|
|
862
|
-
])
|
|
863
|
-
]));
|
|
864
|
-
}
|
|
865
|
-
});
|
|
866
|
-
const Be = { class: "natural-picker" }, Ye = ["onClick"], $e = "__", je = /* @__PURE__ */ G({
|
|
867
|
-
__name: "natural-picker",
|
|
868
|
-
props: {
|
|
869
|
-
value: {}
|
|
870
|
-
},
|
|
871
|
-
emits: ["change"],
|
|
872
|
-
setup(i, { emit: e }) {
|
|
873
|
-
const a = e, o = i, l = B(), r = W(xa.slice()), y = B(Ia[0].id), m = B(""), c = B(), n = B(r.value[0]);
|
|
874
|
-
ua(() => o.value, (E) => {
|
|
875
|
-
if (![D.NATURAL].includes(ha(E)))
|
|
876
|
-
return;
|
|
877
|
-
const [A, v] = E;
|
|
878
|
-
y.value = v === "now" ? sa.NOW : sa.ALL;
|
|
879
|
-
const [, S, _, V] = A.match(q) || [];
|
|
880
|
-
if ((!S || !_) && !V)
|
|
881
|
-
return;
|
|
882
|
-
const T = xa.find((x) => x.id === A && x.type === X.default);
|
|
883
|
-
if (v !== "now" && A !== v && T || !T) {
|
|
884
|
-
const x = `${`${s("前")} ${S} ${s(Q[_], !0)}`}`;
|
|
885
|
-
r.value.unshift({
|
|
886
|
-
id: A,
|
|
887
|
-
name: x,
|
|
888
|
-
type: X.custom
|
|
889
|
-
}), [n.value] = r.value;
|
|
890
|
-
return;
|
|
891
|
-
}
|
|
892
|
-
T && (n.value = T);
|
|
893
|
-
}, {
|
|
894
|
-
immediate: !0
|
|
895
|
-
});
|
|
896
|
-
const h = (E) => `${E.id}${$e}${E.type}`, d = (E) => {
|
|
897
|
-
const A = E.id;
|
|
898
|
-
if (y.value === sa.ALL) {
|
|
899
|
-
const [, v, S, _] = A.match(q) || [];
|
|
900
|
-
return +v > 1 ? +v == 2 && S === "d" ? [A, A] : [A, `now-1${S}/${_}`] : [A, A];
|
|
901
|
-
}
|
|
902
|
-
return [A, "now"];
|
|
903
|
-
}, b = (E) => {
|
|
904
|
-
var A;
|
|
905
|
-
if (E.type === X.edit) {
|
|
906
|
-
c.value = "", m.value = E.id, setTimeout(() => {
|
|
907
|
-
var v, S;
|
|
908
|
-
(S = (v = l.value) == null ? void 0 : v.inputRef) == null || S.focus();
|
|
909
|
-
}, 20);
|
|
910
|
-
return;
|
|
911
|
-
}
|
|
912
|
-
n.value = E, m.value = "", (A = l.value) == null || A.hidePopover();
|
|
913
|
-
}, g = (E) => {
|
|
914
|
-
y.value = E;
|
|
915
|
-
}, P = (E, A) => {
|
|
916
|
-
var _, V;
|
|
917
|
-
m.value = "";
|
|
918
|
-
const v = `now-${+E}${A.unit}/${A.unit}`, S = r.value.find((T) => T.id === v);
|
|
919
|
-
if (S) {
|
|
920
|
-
n.value = S, (_ = l.value) == null || _.hidePopover();
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
r.value.unshift({
|
|
924
|
-
id: v,
|
|
925
|
-
name: A.name.replace("N", E.toString()),
|
|
926
|
-
type: X.custom
|
|
927
|
-
}), [n.value] = r.value, (V = l.value) == null || V.hidePopover();
|
|
928
|
-
}, $ = (E, A) => {
|
|
929
|
-
const v = E.target.value;
|
|
930
|
-
!v || !m.value || P(+v, A);
|
|
931
|
-
}, N = (E, A, v) => {
|
|
932
|
-
E.key !== "Enter" || !m.value || P(A, v);
|
|
933
|
-
}, K = () => {
|
|
934
|
-
a("change", d(n.value));
|
|
935
|
-
};
|
|
936
|
-
return (E, A) => (f(), z("div", Be, [
|
|
937
|
-
M(t(F), {
|
|
938
|
-
ref_key: "naturalSelectRef",
|
|
939
|
-
ref: l,
|
|
940
|
-
"model-value": h(n.value),
|
|
941
|
-
filterable: "",
|
|
942
|
-
"input-search": !1,
|
|
943
|
-
prefix: t(s)("自然日期"),
|
|
944
|
-
clearable: !1,
|
|
945
|
-
"popover-options": { boundary: "parent" },
|
|
946
|
-
"search-placeholder": t(s)("请输入"),
|
|
947
|
-
"no-match-text": t(s)("无匹配数据")
|
|
948
|
-
}, {
|
|
949
|
-
default: C(() => [
|
|
950
|
-
(f(!0), z(
|
|
951
|
-
j,
|
|
952
|
-
null,
|
|
953
|
-
L(r.value, (v) => (f(), R(t(F).Option, {
|
|
954
|
-
id: h(v),
|
|
955
|
-
key: h(v),
|
|
956
|
-
name: v.name
|
|
957
|
-
}, {
|
|
958
|
-
default: C(() => [
|
|
959
|
-
u("div", {
|
|
960
|
-
onClick: A[1] || (A[1] = Sa(() => {
|
|
961
|
-
}, ["prevent", "stop"])),
|
|
962
|
-
style: { width: "100%", padding: "0 12px", margin: "0 -12px" }
|
|
963
|
-
}, [
|
|
964
|
-
m.value === v.id ? (f(), R(t(Ca), {
|
|
965
|
-
key: 0,
|
|
966
|
-
style: { width: "100%" },
|
|
967
|
-
type: "number",
|
|
968
|
-
size: "small",
|
|
969
|
-
prefix: v.prefix,
|
|
970
|
-
suffix: v.suffix,
|
|
971
|
-
clearable: !1,
|
|
972
|
-
autofocus: !0,
|
|
973
|
-
"show-control": !1,
|
|
974
|
-
placeholder: t(s)("请输入"),
|
|
975
|
-
modelValue: c.value,
|
|
976
|
-
"onUpdate:modelValue": A[0] || (A[0] = (S) => c.value = S),
|
|
977
|
-
onBlur: (S) => $(S, v),
|
|
978
|
-
onKeypress: (S, _) => N(_, S, v)
|
|
979
|
-
}, null, 8, ["prefix", "suffix", "placeholder", "modelValue", "onBlur", "onKeypress"])) : (f(), z("div", {
|
|
980
|
-
key: 1,
|
|
981
|
-
onClick: (S) => b(v),
|
|
982
|
-
style: { width: "100%" }
|
|
983
|
-
}, k(v.name), 9, Ye))
|
|
984
|
-
])
|
|
985
|
-
]),
|
|
986
|
-
_: 2
|
|
987
|
-
/* DYNAMIC */
|
|
988
|
-
}, 1032, ["id", "name"]))),
|
|
989
|
-
128
|
|
990
|
-
/* KEYED_FRAGMENT */
|
|
991
|
-
))
|
|
992
|
-
]),
|
|
993
|
-
_: 1
|
|
994
|
-
/* STABLE */
|
|
995
|
-
}, 8, ["model-value", "prefix", "search-placeholder", "no-match-text"]),
|
|
996
|
-
M(t(F), {
|
|
997
|
-
class: "natural-unit",
|
|
998
|
-
"model-value": y.value,
|
|
999
|
-
clearable: !1,
|
|
1000
|
-
"popover-options": { boundary: "parent" },
|
|
1001
|
-
onChange: g
|
|
1002
|
-
}, {
|
|
1003
|
-
default: C(() => [
|
|
1004
|
-
(f(!0), z(
|
|
1005
|
-
j,
|
|
1006
|
-
null,
|
|
1007
|
-
L(t(Ia), (v) => (f(), R(t(F).Option, {
|
|
1008
|
-
id: v.id,
|
|
1009
|
-
key: v.id,
|
|
1010
|
-
name: v.name
|
|
1011
|
-
}, null, 8, ["id", "name"]))),
|
|
1012
|
-
128
|
|
1013
|
-
/* KEYED_FRAGMENT */
|
|
1014
|
-
))
|
|
1015
|
-
]),
|
|
1016
|
-
_: 1
|
|
1017
|
-
/* STABLE */
|
|
1018
|
-
}, 8, ["model-value"]),
|
|
1019
|
-
M(ba, { onSubmit: K })
|
|
1020
|
-
]));
|
|
1021
|
-
}
|
|
1022
|
-
});
|
|
1023
|
-
const Ne = { class: "recent-picker" }, He = /* @__PURE__ */ G({
|
|
1024
|
-
__name: "recent-picker",
|
|
1025
|
-
props: {
|
|
1026
|
-
type: { default: D.RECENT },
|
|
1027
|
-
value: {}
|
|
1028
|
-
},
|
|
1029
|
-
emits: ["change"],
|
|
1030
|
-
setup(i, { emit: e }) {
|
|
1031
|
-
const a = e, o = i, l = B("m"), r = B();
|
|
1032
|
-
ua(() => o.value, (c) => {
|
|
1033
|
-
if (![D.FUTURE, D.RECENT].includes(ha(c)))
|
|
1034
|
-
return;
|
|
1035
|
-
const [n, h] = c, d = o.type === D.FUTURE ? h : n, [, b, g] = d.match(ra) || [];
|
|
1036
|
-
l.value = g || "m", r.value = Number(b) || void 0;
|
|
1037
|
-
}, {
|
|
1038
|
-
immediate: !0
|
|
1039
|
-
});
|
|
1040
|
-
const y = Z(() => !!r.value && !!l.value), m = () => {
|
|
1041
|
-
if (r.value) {
|
|
1042
|
-
if (o.type === D.FUTURE) {
|
|
1043
|
-
a("change", ["now", `${D.FUTURE}${r.value}${l.value}`]);
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
a("change", [`${D.RECENT}${r.value}${l.value}`, "now"]);
|
|
1047
|
-
}
|
|
1048
|
-
};
|
|
1049
|
-
return (c, n) => (f(), z("div", Ne, [
|
|
1050
|
-
M(t(Ca), {
|
|
1051
|
-
modelValue: r.value,
|
|
1052
|
-
"onUpdate:modelValue": n[1] || (n[1] = (h) => r.value = h),
|
|
1053
|
-
type: "number",
|
|
1054
|
-
prefix: c.type === "now-" ? t(s)("最近") : t(s)("将来"),
|
|
1055
|
-
placeholder: t(s)("请输入")
|
|
1056
|
-
}, {
|
|
1057
|
-
suffix: C(() => [
|
|
1058
|
-
M(t(F), {
|
|
1059
|
-
class: "recent-unit",
|
|
1060
|
-
modelValue: l.value,
|
|
1061
|
-
"onUpdate:modelValue": n[0] || (n[0] = (h) => l.value = h),
|
|
1062
|
-
filterable: "",
|
|
1063
|
-
clearable: !1,
|
|
1064
|
-
"popover-options": { boundary: "parent" }
|
|
1065
|
-
}, {
|
|
1066
|
-
default: C(() => [
|
|
1067
|
-
(f(!0), z(
|
|
1068
|
-
j,
|
|
1069
|
-
null,
|
|
1070
|
-
L(t(Ta), (h) => (f(), R(t(F).Option, {
|
|
1071
|
-
id: h.id,
|
|
1072
|
-
key: h.id,
|
|
1073
|
-
name: h.name
|
|
1074
|
-
}, null, 8, ["id", "name"]))),
|
|
1075
|
-
128
|
|
1076
|
-
/* KEYED_FRAGMENT */
|
|
1077
|
-
))
|
|
1078
|
-
]),
|
|
1079
|
-
_: 1
|
|
1080
|
-
/* STABLE */
|
|
1081
|
-
}, 8, ["modelValue"])
|
|
1082
|
-
]),
|
|
1083
|
-
_: 1
|
|
1084
|
-
/* STABLE */
|
|
1085
|
-
}, 8, ["modelValue", "prefix", "placeholder"]),
|
|
1086
|
-
M(ba, {
|
|
1087
|
-
disabled: !y.value,
|
|
1088
|
-
onSubmit: m
|
|
1089
|
-
}, null, 8, ["disabled"])
|
|
1090
|
-
]));
|
|
199
|
+
{
|
|
200
|
+
id: "common",
|
|
201
|
+
name: l("常用时间")
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "recent",
|
|
205
|
+
name: l("最近使用")
|
|
1091
206
|
}
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
207
|
+
], ne = [
|
|
208
|
+
{
|
|
209
|
+
id: _.RECENT,
|
|
210
|
+
name: l("最近")
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: _.FUTURE,
|
|
214
|
+
name: l("未来")
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: _.NATURAL,
|
|
218
|
+
name: l("自然日期")
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
id: _.Date,
|
|
222
|
+
name: l("日期选择")
|
|
223
|
+
}
|
|
224
|
+
], re = "__bk_time_picker_store__", le = (i = 1) => `${re}_${i}`, ce = [
|
|
225
|
+
"YYYY-MM-DD HH:mm:ss",
|
|
226
|
+
"YYYY-MM-DD HH:mm:ss,SSS",
|
|
227
|
+
"YYYY-MM-DD HH:mm:ss.SSS",
|
|
228
|
+
"YYYY-MM-DD+HH:mm:ss",
|
|
229
|
+
"MM/DD/YYYY HH:mm:ss",
|
|
230
|
+
"YYYYMMDDHHmmss",
|
|
231
|
+
"YYYYMMDD HHmmss",
|
|
232
|
+
"YYYYMMDD HHmmss.SSS",
|
|
233
|
+
"DD/MMM/YYYY:HH:mm:ss",
|
|
234
|
+
"DD/MMM/YYYY:HH:mm:ssZ",
|
|
235
|
+
"DD/MMM/YYYY:HH:mm:ss Z",
|
|
236
|
+
"DD/MMM/YYYY:HH:mm:ssZZ",
|
|
237
|
+
"DD/MMM/YYYY:HH:mm:ss ZZ",
|
|
238
|
+
"YYYY-MM-DDTHH:mm:ss",
|
|
239
|
+
"YYYY-MM-DDTHH:mm:ss.SSS",
|
|
240
|
+
"YYYYMMDDTHHmmssZ",
|
|
241
|
+
"YYYYMMDDTHHmmss.SSSSSSZ",
|
|
242
|
+
"YYYY-MM-DDTHH:mm:ss.SSSZ",
|
|
243
|
+
"YYYY-MM-DDTHH:mm:ssZ",
|
|
244
|
+
"YYYY-MM-DDTHH:mm:ss.SSSSSSZ"
|
|
245
|
+
], se = {
|
|
246
|
+
"now/M~now/M": l("本月"),
|
|
247
|
+
"now/d~now/d": l("今天"),
|
|
248
|
+
"now/w~now/w": l("本周"),
|
|
249
|
+
"now/y~now/y": l("今年"),
|
|
250
|
+
"now-1M/M~now-1M/M": l("上月"),
|
|
251
|
+
"now-1d/d~now-1d/d": l("昨天"),
|
|
252
|
+
"now-1w/w~now-1w/w": l("上周"),
|
|
253
|
+
"now-1y/y~now-1y/y": l("去年"),
|
|
254
|
+
"now-2d/d~now-2d/d": l("前天"),
|
|
255
|
+
"now-2y/y~now-2y/y": l("前年")
|
|
256
|
+
}, Ta = Symbol("DATE_PICKER_PROVIDER_KEY"), ue = (i) => {
|
|
257
|
+
Ra(Ta, i);
|
|
258
|
+
}, Va = () => Ha(Ta);
|
|
259
|
+
A.extend(Ma);
|
|
260
|
+
A.extend(Da);
|
|
261
|
+
const oe = [
|
|
1096
262
|
// {
|
|
1097
263
|
// label: '',
|
|
1098
264
|
// options: [
|
|
@@ -2418,116 +1584,1016 @@ const Re = [
|
|
|
2418
1584
|
value: "Pacific/Tahiti"
|
|
2419
1585
|
},
|
|
2420
1586
|
{
|
|
2421
|
-
label: "Pacific/Tarawa",
|
|
2422
|
-
searchIndex: "pacific/tarawa||utc+12:00|kiribati|ki|marshall islands|mh|tuvalu|tv|united states outlying islands|um|wallis and futuna|wf",
|
|
2423
|
-
value: "Pacific/Tarawa"
|
|
1587
|
+
label: "Pacific/Tarawa",
|
|
1588
|
+
searchIndex: "pacific/tarawa||utc+12:00|kiribati|ki|marshall islands|mh|tuvalu|tv|united states outlying islands|um|wallis and futuna|wf",
|
|
1589
|
+
value: "Pacific/Tarawa"
|
|
1590
|
+
},
|
|
1591
|
+
{ label: "Pacific/Tongatapu", searchIndex: "pacific/tongatapu||utc+13:00|tonga|to", value: "Pacific/Tongatapu" },
|
|
1592
|
+
{
|
|
1593
|
+
label: "Pacific/Wake",
|
|
1594
|
+
searchIndex: "pacific/wake||utc+12:00|united states outlying islands|um",
|
|
1595
|
+
value: "Pacific/Wake"
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
label: "Pacific/Wallis",
|
|
1599
|
+
searchIndex: "pacific/wallis||utc+12:00|wallis and futuna|wf",
|
|
1600
|
+
value: "Pacific/Wallis"
|
|
1601
|
+
}
|
|
1602
|
+
]
|
|
1603
|
+
}
|
|
1604
|
+
], de = () => {
|
|
1605
|
+
const i = A.tz.guess(), e = [], a = oe.map((r) => ({
|
|
1606
|
+
label: r.label,
|
|
1607
|
+
options: r.options.map((d) => {
|
|
1608
|
+
const u = {
|
|
1609
|
+
...d,
|
|
1610
|
+
...me(d.searchIndex)
|
|
1611
|
+
};
|
|
1612
|
+
return d.value === i && e.push({
|
|
1613
|
+
...d,
|
|
1614
|
+
...u,
|
|
1615
|
+
label: u.label
|
|
1616
|
+
}), u;
|
|
1617
|
+
})
|
|
1618
|
+
}));
|
|
1619
|
+
return a.unshift({
|
|
1620
|
+
label: "",
|
|
1621
|
+
options: e
|
|
1622
|
+
}), a;
|
|
1623
|
+
}, me = (i) => {
|
|
1624
|
+
const e = i.split("|");
|
|
1625
|
+
return {
|
|
1626
|
+
abbreviation: e[1].toLocaleUpperCase(),
|
|
1627
|
+
country: (e[3] || "").replace(/(\b\w)/g, (a) => a.toLocaleUpperCase()),
|
|
1628
|
+
countryCode: e[4] || "",
|
|
1629
|
+
utc: e[2].toLocaleUpperCase()
|
|
1630
|
+
};
|
|
1631
|
+
}, ja = de(), Ya = (i) => ja.reduce((e, a) => (e == null ? void 0 : e.label) === i ? e : a.options.find((r) => r.label === i), {}), ea = new RegExp(`now([+-]?\\d*)([${Q}]?)\\/?([${Q}]?)`), he = new RegExp(`now[-](\\d+)([${Q}]{1})$`), ve = new RegExp(`now[+](\\d+)([${Q}]{1})$`), ma = new RegExp(`now([+-]?\\d*)([${Q}]?)\\/([${Q}])$`);
|
|
1632
|
+
class ha {
|
|
1633
|
+
constructor(e = ["", ""], a = "YYYY-MM-DD HH:mm:ss") {
|
|
1634
|
+
O(this, "endDate");
|
|
1635
|
+
O(this, "endNum");
|
|
1636
|
+
O(this, "endUnit");
|
|
1637
|
+
O(this, "startDate");
|
|
1638
|
+
O(this, "startNum");
|
|
1639
|
+
O(this, "startUnit");
|
|
1640
|
+
this.dateValue = e, this.format = a;
|
|
1641
|
+
const [r, d] = e;
|
|
1642
|
+
this.startDate = r ? this.transformValue2Dayjs(r) : null, this.endDate = d ? this.transformValue2Dayjs(d, "end") : null;
|
|
1643
|
+
}
|
|
1644
|
+
dateDuration() {
|
|
1645
|
+
if (!this.startDate || !this.endDate || !this.isValidate)
|
|
1646
|
+
return;
|
|
1647
|
+
let e = this.endDate.diff(this.startDate);
|
|
1648
|
+
const a = 24 * 60 * 60 * 1e3;
|
|
1649
|
+
return e % a === a - 1e3 && (e += 1e3), e;
|
|
1650
|
+
}
|
|
1651
|
+
toDisplayString() {
|
|
1652
|
+
var u, x;
|
|
1653
|
+
if (!this.startDate || !this.endDate || !this.isValidate)
|
|
1654
|
+
return ((u = this.dateValue) == null ? void 0 : u.join(" ~ ")) || "";
|
|
1655
|
+
if (this.dateMode === _.RECENT)
|
|
1656
|
+
return `${l("近")} ${Math.abs(this.startNum)} ${l(
|
|
1657
|
+
Z[this.startUnit]
|
|
1658
|
+
)}`;
|
|
1659
|
+
if (this.dateMode === _.FUTURE)
|
|
1660
|
+
return `${l("未来")} ${Math.abs(this.endNum)} ${l(
|
|
1661
|
+
Z[this.endUnit]
|
|
1662
|
+
)}`;
|
|
1663
|
+
const [e, a] = this.dateValue;
|
|
1664
|
+
if (this.dateMode === _.NATURAL) {
|
|
1665
|
+
const c = a !== "now" ? "" : l("(至今)"), n = da.find((o) => o.id === e);
|
|
1666
|
+
return n ? l(n.name) + c : `${`${l("前")} ${this.startNum} ${l(
|
|
1667
|
+
Z[this.startUnit]
|
|
1668
|
+
)}`}${c}`;
|
|
1669
|
+
}
|
|
1670
|
+
let r = this.format;
|
|
1671
|
+
if (a === "now")
|
|
1672
|
+
return `${(x = this.startDate) == null ? void 0 : x.format(this.format)} ~ ${l("此刻")}`;
|
|
1673
|
+
const d = ["Y", "M", "D", "H", "m", "s"].reduce(
|
|
1674
|
+
(c, n, o, h) => (o < 1 || (this.format.indexOf(n) > this.format.indexOf(h[o - 1]) ? c.push(n) : c = []), c),
|
|
1675
|
+
["Y"]
|
|
1676
|
+
);
|
|
1677
|
+
if (d.length > 1 && d.includes("D") && this.startDate.isSame(this.endDate, "year")) {
|
|
1678
|
+
const [, c] = this.format.match(/(Y+)/);
|
|
1679
|
+
let n = this.format.replace(c, this.startDate.format(c));
|
|
1680
|
+
if (r = r.replace(/Y+[-/\\\s]/, ""), this.startDate.isSame(this.endDate, "month")) {
|
|
1681
|
+
const [, o] = this.format.match(/(M+)/);
|
|
1682
|
+
if (n = n.replace(o, this.startDate.format(o)), r = r.replace(/M+[-/\\\s]/, ""), this.startDate.isSame(this.endDate, "day")) {
|
|
1683
|
+
const [, h] = this.format.match(/(d+|D+)/);
|
|
1684
|
+
if (n = n.replace(h, this.startDate.format(h)), r = r.replace(/(d|D)+[-/\\\s]/, ""), this.startDate.isSame(this.endDate, "hour")) {
|
|
1685
|
+
const [, v] = this.format.match(/(H+|h+)/);
|
|
1686
|
+
if (n = n.replace(v, this.startDate.format(v)), r = r.replace(/[Hh]+[-/\\\s:]/, ""), this.startDate.isSame(this.endDate, "minute")) {
|
|
1687
|
+
const [, M] = this.format.match(/(m+)/);
|
|
1688
|
+
n = n.replace(M, this.startDate.format(M)), r = r.replace(/m+[-/\\\s:]/, "");
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
return n.replace(
|
|
1694
|
+
r,
|
|
1695
|
+
`(${this.startDate.format(r)} ~ ${this.endDate.format(r)})`
|
|
1696
|
+
);
|
|
1697
|
+
}
|
|
1698
|
+
return `${this.startDate.format(this.format)} ~ ${this.endDate.format(this.format)}`;
|
|
1699
|
+
}
|
|
1700
|
+
toEmitValue() {
|
|
1701
|
+
var e, a, r, d;
|
|
1702
|
+
return [
|
|
1703
|
+
this.dateMode === _.Date ? [(e = this.startDate) == null ? void 0 : e.valueOf(), (a = this.endDate) == null ? void 0 : a.valueOf()] : [...this.dateValue],
|
|
1704
|
+
[
|
|
1705
|
+
{
|
|
1706
|
+
dayjs: this.startDate,
|
|
1707
|
+
formatText: (r = this.startDate) == null ? void 0 : r.format(this.format)
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
dayjs: this.endDate,
|
|
1711
|
+
formatText: (d = this.endDate) == null ? void 0 : d.format(this.format)
|
|
1712
|
+
}
|
|
1713
|
+
]
|
|
1714
|
+
];
|
|
1715
|
+
}
|
|
1716
|
+
transformValue2Dayjs(e, a = "start") {
|
|
1717
|
+
let r = A(e);
|
|
1718
|
+
if (typeof e == "number" || A.isDayjs(e) || r.isValid())
|
|
1719
|
+
return r;
|
|
1720
|
+
const [, d, u, x] = e.match(ea) || [];
|
|
1721
|
+
return a === "start" ? (this.startNum = Math.abs(+d), this.startUnit = u || x) : a === "end" && (this.endNum = Math.abs(+d), this.endUnit = u || x), d ? r = A().add(+d, u || x) : e === "now" && (r = A()), x && (r = a === "start" ? A(r.isValid() ? r : void 0).startOf(x) : A(r.isValid() ? r : void 0).endOf(x)), r;
|
|
1722
|
+
}
|
|
1723
|
+
updateDateValue(e) {
|
|
1724
|
+
this.dateValue = e;
|
|
1725
|
+
const [a, r] = e;
|
|
1726
|
+
this.startDate = a ? this.transformValue2Dayjs(a) : null, this.endDate = r ? this.transformValue2Dayjs(r, "end") : null;
|
|
1727
|
+
}
|
|
1728
|
+
updateFormat(e) {
|
|
1729
|
+
this.format = e;
|
|
1730
|
+
}
|
|
1731
|
+
get dateMode() {
|
|
1732
|
+
const [e, a] = this.dateValue;
|
|
1733
|
+
if (typeof e == "number" || typeof a == "number" || A.isDayjs(e) || A.isDayjs(a) || A(e).isValid() || A(a).isValid())
|
|
1734
|
+
return _.Date;
|
|
1735
|
+
if (e === "now" && ve.test(a))
|
|
1736
|
+
return _.FUTURE;
|
|
1737
|
+
if (a === "now" && he.test(e))
|
|
1738
|
+
return _.RECENT;
|
|
1739
|
+
if (se[this.dateValue.join("~")])
|
|
1740
|
+
return _.NATURAL;
|
|
1741
|
+
if (ma.test(e) && (ma.test(a) || a === "now")) {
|
|
1742
|
+
const [, r, d, u] = e.match(ea) || [], [, x, c, n] = a.match(ea) || [];
|
|
1743
|
+
if (u && (a === "now" || r && +x == -1 && d === u && c === n && d === c))
|
|
1744
|
+
return _.NATURAL;
|
|
1745
|
+
}
|
|
1746
|
+
return _.Date;
|
|
1747
|
+
}
|
|
1748
|
+
get isValidate() {
|
|
1749
|
+
var e, a;
|
|
1750
|
+
return ((e = this.startDate) == null ? void 0 : e.isValid()) && ((a = this.endDate) == null ? void 0 : a.isValid());
|
|
1751
|
+
}
|
|
1752
|
+
get recentOrFuturedateNum() {
|
|
1753
|
+
if (this.dateMode === _.RECENT)
|
|
1754
|
+
return this.startNum;
|
|
1755
|
+
if (this.dateMode === _.FUTURE)
|
|
1756
|
+
return this.endNum;
|
|
1757
|
+
}
|
|
1758
|
+
get recentOrFuturedateUnit() {
|
|
1759
|
+
return this.dateMode === _.RECENT ? this.startUnit : this.dateMode === _.FUTURE ? this.endUnit : "m";
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
const be = (i, e = "start") => {
|
|
1763
|
+
let a = A(i);
|
|
1764
|
+
if (typeof i == "number" || A.isDayjs(i) || a.isValid())
|
|
1765
|
+
return a;
|
|
1766
|
+
const [, r, d, u] = i.match(ea) || [];
|
|
1767
|
+
return r ? a = A().add(+r, d || u || "d") : i === "now" && (a = A()), u && (a = e === "start" ? A(a.isValid() ? a : void 0).startOf(u) : A(a.isValid() ? a : void 0).endOf(u)), a.isValid() ? a : void 0;
|
|
1768
|
+
}, pe = (i) => {
|
|
1769
|
+
const e = localStorage.getItem(i);
|
|
1770
|
+
let a = [];
|
|
1771
|
+
if (e)
|
|
1772
|
+
try {
|
|
1773
|
+
a = JSON.parse(e);
|
|
1774
|
+
} catch {
|
|
1775
|
+
a = [];
|
|
1776
|
+
}
|
|
1777
|
+
return Array.isArray(a) || (a = []), a;
|
|
1778
|
+
}, fe = (i, e) => {
|
|
1779
|
+
let a = [];
|
|
1780
|
+
const r = localStorage.getItem(e);
|
|
1781
|
+
if (r)
|
|
1782
|
+
try {
|
|
1783
|
+
a = JSON.parse(r);
|
|
1784
|
+
} catch {
|
|
1785
|
+
a = [];
|
|
1786
|
+
}
|
|
1787
|
+
Array.isArray(a) || (a = []), !a.some((d) => d[0] === i[0] && d[1] === i[1]) && (a.unshift(i), localStorage.setItem(e, JSON.stringify(a.slice(0, 10))));
|
|
1788
|
+
}, Ae = { class: "common-panel-tab" }, ka = /* @__PURE__ */ F({
|
|
1789
|
+
__name: "common-tab",
|
|
1790
|
+
props: {
|
|
1791
|
+
modelValue: {
|
|
1792
|
+
required: !0,
|
|
1793
|
+
type: String
|
|
1794
|
+
},
|
|
1795
|
+
/** panels */
|
|
1796
|
+
panels: {
|
|
1797
|
+
required: !0,
|
|
1798
|
+
type: Array
|
|
1799
|
+
}
|
|
1800
|
+
},
|
|
1801
|
+
setup(i) {
|
|
1802
|
+
return (e, a) => (p(), D("div", Ae, [
|
|
1803
|
+
w(t(xa), {
|
|
1804
|
+
active: i.modelValue,
|
|
1805
|
+
"onUpdate:active": a[0] || (a[0] = (r) => e.$emit("update:modelValue", r)),
|
|
1806
|
+
type: "unborder-card"
|
|
1807
|
+
}, {
|
|
1808
|
+
default: P(() => [
|
|
1809
|
+
(p(!0), D(
|
|
1810
|
+
B,
|
|
1811
|
+
null,
|
|
1812
|
+
$(i.panels, (r) => (p(), N(t(xa).TabPanel, {
|
|
1813
|
+
key: r.id,
|
|
1814
|
+
label: r.name,
|
|
1815
|
+
name: r.id
|
|
1816
|
+
}, null, 8, ["label", "name"]))),
|
|
1817
|
+
128
|
|
1818
|
+
/* KEYED_FRAGMENT */
|
|
1819
|
+
))
|
|
1820
|
+
]),
|
|
1821
|
+
_: 1
|
|
1822
|
+
/* STABLE */
|
|
1823
|
+
}, 8, ["active"])
|
|
1824
|
+
]));
|
|
1825
|
+
}
|
|
1826
|
+
});
|
|
1827
|
+
const ba = /* @__PURE__ */ F({
|
|
1828
|
+
__name: "common-submit",
|
|
1829
|
+
props: {
|
|
1830
|
+
disabled: { type: Boolean }
|
|
1831
|
+
},
|
|
1832
|
+
emits: ["submit"],
|
|
1833
|
+
setup(i) {
|
|
1834
|
+
return (e, a) => (p(), D(
|
|
1835
|
+
B,
|
|
1836
|
+
null,
|
|
1837
|
+
[
|
|
1838
|
+
w(t(va), {
|
|
1839
|
+
disabled: e.disabled,
|
|
1840
|
+
outline: !0,
|
|
1841
|
+
onClick: a[0] || (a[0] = (r) => e.$emit("submit")),
|
|
1842
|
+
class: "common-submit",
|
|
1843
|
+
theme: "primary"
|
|
1844
|
+
}, {
|
|
1845
|
+
default: P(() => [
|
|
1846
|
+
L(
|
|
1847
|
+
I(t(l)("确定")),
|
|
1848
|
+
1
|
|
1849
|
+
/* TEXT */
|
|
1850
|
+
)
|
|
1851
|
+
]),
|
|
1852
|
+
_: 1
|
|
1853
|
+
/* STABLE */
|
|
1854
|
+
}, 8, ["disabled"]),
|
|
1855
|
+
na("v-if", !0)
|
|
1856
|
+
],
|
|
1857
|
+
64
|
|
1858
|
+
/* STABLE_FRAGMENT */
|
|
1859
|
+
));
|
|
1860
|
+
}
|
|
1861
|
+
});
|
|
1862
|
+
const ge = { class: "date-panel" }, xe = { class: "date-panel-title" }, Ie = { class: "date-panel-main" }, ke = { class: "date-header" }, _e = { class: "date-header-left" }, ye = { class: "date-header-center" }, we = /* @__PURE__ */ s(
|
|
1863
|
+
"span",
|
|
1864
|
+
{ class: "date-split" },
|
|
1865
|
+
null,
|
|
1866
|
+
-1
|
|
1867
|
+
/* HOISTED */
|
|
1868
|
+
), De = { class: "date-header-right" }, Me = { class: "date-content" }, ze = { class: "date-grid" }, Ee = ["onClick"], _a = 6, ra = 7, ya = /* @__PURE__ */ F({
|
|
1869
|
+
__name: "date-panel",
|
|
1870
|
+
props: {
|
|
1871
|
+
format: { default: "YYYY-MM-DD HH:mm:ss" },
|
|
1872
|
+
isNow: { type: Boolean },
|
|
1873
|
+
minDate: {},
|
|
1874
|
+
modelValue: {}
|
|
1875
|
+
},
|
|
1876
|
+
emits: ["update:isNow", "update:modelValue"],
|
|
1877
|
+
setup(i, { emit: e }) {
|
|
1878
|
+
const a = i, r = e, d = ca === "en" ? ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] : ["日", "一", "二", "三", "四", "五", "六"], u = J([]), x = A(), c = J(a.modelValue || x);
|
|
1879
|
+
sa(
|
|
1880
|
+
c,
|
|
1881
|
+
() => {
|
|
1882
|
+
const v = c.value.startOf("month").startOf("week"), M = [];
|
|
1883
|
+
for (let z = 0; z < _a * ra; z++)
|
|
1884
|
+
M.push(v.add(z, "day"));
|
|
1885
|
+
u.value = M;
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
immediate: !0
|
|
1889
|
+
}
|
|
1890
|
+
);
|
|
1891
|
+
const n = (v) => {
|
|
1892
|
+
c.value = c.value.add(v, "month");
|
|
1893
|
+
}, o = (v) => {
|
|
1894
|
+
c.value = c.value.add(v, "year");
|
|
1895
|
+
}, h = (v) => {
|
|
1896
|
+
a.minDate && v.isBefore(a.minDate, "day") || r("update:modelValue", v);
|
|
1897
|
+
};
|
|
1898
|
+
return (v, M) => (p(), D("div", ge, [
|
|
1899
|
+
s("div", xe, [
|
|
1900
|
+
L(
|
|
1901
|
+
I(t(l)("结束时间")) + " ",
|
|
1902
|
+
1
|
|
1903
|
+
/* TEXT */
|
|
1904
|
+
),
|
|
1905
|
+
w(t(Xa), {
|
|
1906
|
+
"model-value": a.isNow,
|
|
1907
|
+
"onUpdate:modelValue": M[0] || (M[0] = (z) => v.$emit("update:isNow", !z)),
|
|
1908
|
+
class: "title-check",
|
|
1909
|
+
size: "small"
|
|
1910
|
+
}, {
|
|
1911
|
+
default: P(() => [
|
|
1912
|
+
L(" now ")
|
|
1913
|
+
]),
|
|
1914
|
+
_: 1
|
|
1915
|
+
/* STABLE */
|
|
1916
|
+
}, 8, ["model-value"])
|
|
1917
|
+
]),
|
|
1918
|
+
s("div", Ie, [
|
|
1919
|
+
s("div", ke, [
|
|
1920
|
+
s("div", _e, [
|
|
1921
|
+
w(t(Ga), {
|
|
1922
|
+
onClick: M[1] || (M[1] = (z) => o(-1)),
|
|
1923
|
+
class: "hand-icon"
|
|
1924
|
+
}),
|
|
1925
|
+
w(t(Ea), {
|
|
1926
|
+
onClick: M[2] || (M[2] = (z) => n(-1)),
|
|
1927
|
+
class: "hand-icon"
|
|
1928
|
+
})
|
|
1929
|
+
]),
|
|
1930
|
+
s("div", ye, [
|
|
1931
|
+
L(
|
|
1932
|
+
I(c.value.year()),
|
|
1933
|
+
1
|
|
1934
|
+
/* TEXT */
|
|
1935
|
+
),
|
|
1936
|
+
we,
|
|
1937
|
+
L(
|
|
1938
|
+
I(c.value.month() + 1),
|
|
1939
|
+
1
|
|
1940
|
+
/* TEXT */
|
|
1941
|
+
)
|
|
1942
|
+
]),
|
|
1943
|
+
s("div", De, [
|
|
1944
|
+
w(t(Sa), {
|
|
1945
|
+
onClick: M[3] || (M[3] = (z) => n(1)),
|
|
1946
|
+
class: "hand-icon"
|
|
1947
|
+
}),
|
|
1948
|
+
w(t(Oa), {
|
|
1949
|
+
onClick: M[4] || (M[4] = (z) => o(1)),
|
|
1950
|
+
class: "hand-icon"
|
|
1951
|
+
})
|
|
1952
|
+
])
|
|
1953
|
+
]),
|
|
1954
|
+
s("div", Me, [
|
|
1955
|
+
s("ul", ze, [
|
|
1956
|
+
(p(!0), D(
|
|
1957
|
+
B,
|
|
1958
|
+
null,
|
|
1959
|
+
$(t(d), (z, C) => (p(), D(
|
|
1960
|
+
"li",
|
|
1961
|
+
{
|
|
1962
|
+
key: C,
|
|
1963
|
+
class: "date-grid-item not-click"
|
|
1964
|
+
},
|
|
1965
|
+
I(z),
|
|
1966
|
+
1
|
|
1967
|
+
/* TEXT */
|
|
1968
|
+
))),
|
|
1969
|
+
128
|
|
1970
|
+
/* KEYED_FRAGMENT */
|
|
1971
|
+
))
|
|
1972
|
+
]),
|
|
1973
|
+
(p(), D(
|
|
1974
|
+
B,
|
|
1975
|
+
null,
|
|
1976
|
+
$(_a, (z) => s("ul", {
|
|
1977
|
+
key: z,
|
|
1978
|
+
class: "date-grid"
|
|
1979
|
+
}, [
|
|
1980
|
+
(p(!0), D(
|
|
1981
|
+
B,
|
|
1982
|
+
null,
|
|
1983
|
+
$(u.value.slice((z - 1) * ra, (z - 1) * ra + ra), (C) => (p(), D("li", {
|
|
1984
|
+
class: ta([{
|
|
1985
|
+
"is-last-month": C.isBefore(c.value, "month"),
|
|
1986
|
+
"is-next-month": C.isAfter(c.value, "month"),
|
|
1987
|
+
"is-today": C.isSame(t(x), "day"),
|
|
1988
|
+
"is-disabled": v.minDate && C.isBefore(v.minDate, "day"),
|
|
1989
|
+
"is-selected": a.modelValue && C.isSame(a.modelValue, "day")
|
|
1990
|
+
}, "date-grid-item"]),
|
|
1991
|
+
key: C.unix(),
|
|
1992
|
+
onClick: za((U) => h(C), ["prevent"])
|
|
1993
|
+
}, I(C.date()), 11, Ee))),
|
|
1994
|
+
128
|
|
1995
|
+
/* KEYED_FRAGMENT */
|
|
1996
|
+
))
|
|
1997
|
+
])),
|
|
1998
|
+
64
|
|
1999
|
+
/* STABLE_FRAGMENT */
|
|
2000
|
+
))
|
|
2001
|
+
])
|
|
2002
|
+
])
|
|
2003
|
+
]));
|
|
2004
|
+
}
|
|
2005
|
+
});
|
|
2006
|
+
const Se = { class: "date-wrapper" }, Pe = { class: "date-input" }, Ce = { class: "date-picker" }, Te = /* @__PURE__ */ s(
|
|
2007
|
+
"span",
|
|
2008
|
+
{ class: "date-picker-icon" },
|
|
2009
|
+
[
|
|
2010
|
+
/* @__PURE__ */ s("svg", {
|
|
2011
|
+
class: "date-content-icon",
|
|
2012
|
+
height: "14",
|
|
2013
|
+
version: "1.1",
|
|
2014
|
+
viewBox: "0 0 1024 1024",
|
|
2015
|
+
width: "14",
|
|
2016
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2017
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
2018
|
+
}, [
|
|
2019
|
+
/* @__PURE__ */ s("path", {
|
|
2020
|
+
d: "M558.933 465.067h-93.866v93.866h93.866v-93.866z m0 162.133h-93.866v93.867h93.866V627.2z m371.2-533.333h-93.866V21.333c0-12.8-8.534-21.333-21.334-21.333S793.6 8.533 793.6 21.333V89.6H234.667V21.333c0-12.8-12.8-21.333-25.6-21.333s-21.334 8.533-21.334 21.333V89.6H93.867C42.667 93.867 0 136.533 0 187.733V934.4c0 46.933 42.667 89.6 93.867 89.6h836.266c51.2 0 93.867-42.667 93.867-93.867v-742.4c0-51.2-42.667-93.866-93.867-93.866z m46.934 836.266c0 25.6-21.334 46.934-46.934 46.934H93.867c-25.6 0-46.934-21.334-46.934-46.934V371.2h930.134v558.933z m0-605.866H46.933V187.733c0-25.6 21.334-46.933 46.934-46.933h93.866v68.267c0 12.8 8.534 21.333 21.334 21.333s21.333-8.533 21.333-21.333V140.8h558.933v68.267c0 12.8 8.534 21.333 21.334 21.333S832 221.867 832 209.067V140.8h93.867c25.6 0 46.933 21.333 46.933 46.933v136.534h4.267zM789.333 627.2h-93.866v93.867h93.866V627.2z m0-162.133h-93.866v93.866h93.866v-93.866z m-230.4 324.266h-93.866V883.2h93.866v-93.867z m-234.666 0h-89.6V883.2h93.866v-93.867h-4.266z m0-324.266h-89.6v93.866h93.866v-93.866h-4.266z m0 162.133h-89.6v93.867h93.866V627.2h-4.266z",
|
|
2021
|
+
fill: "#C4C6CC",
|
|
2022
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2023
|
+
})
|
|
2024
|
+
])
|
|
2025
|
+
],
|
|
2026
|
+
-1
|
|
2027
|
+
/* HOISTED */
|
|
2028
|
+
), Ve = ["placeholder", "value"], je = /* @__PURE__ */ s(
|
|
2029
|
+
"span",
|
|
2030
|
+
{ class: "date-picker-split" },
|
|
2031
|
+
"~",
|
|
2032
|
+
-1
|
|
2033
|
+
/* HOISTED */
|
|
2034
|
+
), Ye = ["placeholder", "value"], Be = { class: "show-format" }, Ne = { class: "date-format-wrapper" }, $e = { class: "content-title" }, Re = { class: "content-table" }, He = /* @__PURE__ */ F({
|
|
2035
|
+
__name: "date-picker",
|
|
2036
|
+
props: {
|
|
2037
|
+
value: {}
|
|
2038
|
+
},
|
|
2039
|
+
emits: ["change"],
|
|
2040
|
+
setup(i, { emit: e }) {
|
|
2041
|
+
A.extend(wa);
|
|
2042
|
+
const a = i, r = e, d = j(null), u = j(null), x = j(!1), c = j(!1), n = J(), o = J(), h = j(!1), { format: v } = Va(), M = A();
|
|
2043
|
+
sa(
|
|
2044
|
+
() => a.value,
|
|
2045
|
+
(y) => {
|
|
2046
|
+
if (y.dateMode !== _.Date)
|
|
2047
|
+
return;
|
|
2048
|
+
const { dateValue: g, endDate: k, startDate: V } = y, [, H] = g;
|
|
2049
|
+
if (!(!(V != null && V.isValid()) && !(k != null && k.isValid()))) {
|
|
2050
|
+
if (V != null && V.isValid()) {
|
|
2051
|
+
const G = A(V, v.value);
|
|
2052
|
+
n.value = G.isValid() ? G : V;
|
|
2053
|
+
}
|
|
2054
|
+
if (H === "now") {
|
|
2055
|
+
h.value = !0, o.value = A();
|
|
2056
|
+
return;
|
|
2057
|
+
}
|
|
2058
|
+
if (k != null && k.isValid()) {
|
|
2059
|
+
const G = A(H, v.value);
|
|
2060
|
+
o.value = G.isValid() ? G : k;
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
immediate: !0
|
|
2066
|
+
}
|
|
2067
|
+
);
|
|
2068
|
+
const z = async (y, g) => {
|
|
2069
|
+
var G, pa, fa;
|
|
2070
|
+
const k = y.target.value.toString().trim();
|
|
2071
|
+
if (!k || g === "end" && k === "now" && h.value)
|
|
2072
|
+
return;
|
|
2073
|
+
if (k === "now" && g === "end") {
|
|
2074
|
+
h.value || (h.value = !0, b(A(), !1));
|
|
2075
|
+
return;
|
|
2076
|
+
}
|
|
2077
|
+
const V = g === "start" ? n.value : o.value;
|
|
2078
|
+
let H;
|
|
2079
|
+
ea.test(k) && (H = be(k, g)), H || (H = A(k)), H.isValid() && (V != null && V.isSame(H) || (g === "start" ? f(H) : (h.value = k === "now", b(H, !!((G = n.value) != null && G.isSame(H)))))), y.target.value = g === "start" ? ((pa = n.value) == null ? void 0 : pa.format(v.value)) || "" : ((fa = o.value) == null ? void 0 : fa.format(v.value)) || "";
|
|
2080
|
+
}, C = () => {
|
|
2081
|
+
x.value = !0;
|
|
2082
|
+
}, U = () => {
|
|
2083
|
+
c.value = !0;
|
|
2084
|
+
}, q = (y = 32) => {
|
|
2085
|
+
setTimeout(() => x.value = !1, y);
|
|
2086
|
+
}, R = (y = 32) => {
|
|
2087
|
+
setTimeout(() => c.value = !1, y);
|
|
2088
|
+
}, f = (y) => {
|
|
2089
|
+
var g;
|
|
2090
|
+
n.value = y, o.value || ((g = u.value) == null || g.focus(), U()), q();
|
|
2091
|
+
}, b = (y, g = !0) => {
|
|
2092
|
+
var k;
|
|
2093
|
+
o.value = g ? A(y.endOf("day")) : y, h.value = g ? !1 : h.value, n.value || ((k = d.value) == null || k.focus(), C()), R();
|
|
2094
|
+
}, m = () => {
|
|
2095
|
+
h.value = !h.value, b(A(), !1), n.value && (x.value = !1);
|
|
2096
|
+
}, S = () => {
|
|
2097
|
+
n.value = void 0, o.value = void 0, h.value = !1, q(), R();
|
|
2098
|
+
}, E = () => {
|
|
2099
|
+
var y, g;
|
|
2100
|
+
n.value && o.value && r("change", [
|
|
2101
|
+
((y = n.value) == null ? void 0 : y.format(v.value)) || "",
|
|
2102
|
+
h.value ? "now" : ((g = o.value) == null ? void 0 : g.format(v.value)) || ""
|
|
2103
|
+
]);
|
|
2104
|
+
}, T = (y) => {
|
|
2105
|
+
var g;
|
|
2106
|
+
x.value && ((g = document.querySelector(".__date-picker-popover-start__")) != null && g.contains(y.target) || q());
|
|
2107
|
+
}, Y = (y) => {
|
|
2108
|
+
var g;
|
|
2109
|
+
c.value && ((g = document.querySelector(".__date-picker-popover-end__")) != null && g.contains(y.target) || R());
|
|
2110
|
+
};
|
|
2111
|
+
return (y, g) => (p(), D("div", Se, [
|
|
2112
|
+
s("div", Pe, [
|
|
2113
|
+
s("div", Ce, [
|
|
2114
|
+
Te,
|
|
2115
|
+
w(t(aa), {
|
|
2116
|
+
arrow: !1,
|
|
2117
|
+
"is-show": x.value,
|
|
2118
|
+
boundary: "parent",
|
|
2119
|
+
"ext-cls": "__bk-date-picker-popover__ __date-picker-popover-start__",
|
|
2120
|
+
placement: "bottom-start",
|
|
2121
|
+
theme: "light",
|
|
2122
|
+
trigger: "manual"
|
|
2123
|
+
}, {
|
|
2124
|
+
content: P(() => [
|
|
2125
|
+
w(ya, {
|
|
2126
|
+
format: t(v),
|
|
2127
|
+
"is-now": h.value,
|
|
2128
|
+
"model-value": n.value,
|
|
2129
|
+
"onUpdate:isNow": m,
|
|
2130
|
+
"onUpdate:modelValue": f,
|
|
2131
|
+
key: "start"
|
|
2132
|
+
}, null, 8, ["format", "is-now", "model-value"])
|
|
2133
|
+
]),
|
|
2134
|
+
default: P(() => {
|
|
2135
|
+
var k;
|
|
2136
|
+
return [
|
|
2137
|
+
ia(s("input", {
|
|
2138
|
+
placeholder: t(l)("开始时间"),
|
|
2139
|
+
value: (k = n.value) == null ? void 0 : k.format(t(v)),
|
|
2140
|
+
onBlur: g[0] || (g[0] = (V) => z(V, "start")),
|
|
2141
|
+
onClick: C,
|
|
2142
|
+
onKeypress: g[1] || (g[1] = Aa((V) => z(V, "start"), ["enter"])),
|
|
2143
|
+
class: "date-picker-start",
|
|
2144
|
+
ref_key: "startInput",
|
|
2145
|
+
ref: d,
|
|
2146
|
+
spellcheck: "false"
|
|
2147
|
+
}, null, 40, Ve), [
|
|
2148
|
+
[t(ua), T]
|
|
2149
|
+
])
|
|
2150
|
+
];
|
|
2151
|
+
}),
|
|
2152
|
+
_: 1
|
|
2153
|
+
/* STABLE */
|
|
2154
|
+
}, 8, ["is-show"]),
|
|
2155
|
+
je,
|
|
2156
|
+
w(t(aa), {
|
|
2157
|
+
arrow: !1,
|
|
2158
|
+
"is-show": c.value,
|
|
2159
|
+
boundary: "parent",
|
|
2160
|
+
"ext-cls": "__bk-date-picker-popover__ __date-picker-popover-end__",
|
|
2161
|
+
placement: "bottom-start",
|
|
2162
|
+
theme: "light",
|
|
2163
|
+
trigger: "manual"
|
|
2164
|
+
}, {
|
|
2165
|
+
content: P(() => [
|
|
2166
|
+
w(ya, {
|
|
2167
|
+
format: t(v),
|
|
2168
|
+
"is-now": h.value,
|
|
2169
|
+
"min-date": n.value,
|
|
2170
|
+
"model-value": o.value,
|
|
2171
|
+
"onUpdate:isNow": m,
|
|
2172
|
+
"onUpdate:modelValue": b,
|
|
2173
|
+
key: "end"
|
|
2174
|
+
}, null, 8, ["format", "is-now", "min-date", "model-value"])
|
|
2175
|
+
]),
|
|
2176
|
+
default: P(() => {
|
|
2177
|
+
var k;
|
|
2178
|
+
return [
|
|
2179
|
+
ia(s("input", {
|
|
2180
|
+
placeholder: t(l)("结束时间"),
|
|
2181
|
+
value: h.value ? "now" : (k = o.value) == null ? void 0 : k.format(t(v)),
|
|
2182
|
+
onBlur: g[2] || (g[2] = (V) => z(V, "end")),
|
|
2183
|
+
onClick: U,
|
|
2184
|
+
onKeypress: g[3] || (g[3] = Aa((V) => z(V, "end"), ["enter"])),
|
|
2185
|
+
class: "date-picker-end",
|
|
2186
|
+
ref_key: "endInput",
|
|
2187
|
+
ref: u
|
|
2188
|
+
}, null, 40, Ye), [
|
|
2189
|
+
[t(ua), Y]
|
|
2190
|
+
])
|
|
2191
|
+
];
|
|
2192
|
+
}),
|
|
2193
|
+
_: 1
|
|
2194
|
+
/* STABLE */
|
|
2195
|
+
}, 8, ["is-show"]),
|
|
2196
|
+
n.value || o.value ? (p(), N(t(Ja), {
|
|
2197
|
+
key: 0,
|
|
2198
|
+
onClick: S,
|
|
2199
|
+
class: "date-picker-clear"
|
|
2200
|
+
})) : na("v-if", !0)
|
|
2201
|
+
]),
|
|
2202
|
+
w(ba, {
|
|
2203
|
+
disabled: !(n.value && o.value),
|
|
2204
|
+
onSubmit: E
|
|
2205
|
+
}, null, 8, ["disabled"])
|
|
2206
|
+
]),
|
|
2207
|
+
s("div", Be, [
|
|
2208
|
+
L(
|
|
2209
|
+
I(t(l)("支持多种时间格式自动转换")) + " ",
|
|
2210
|
+
1
|
|
2211
|
+
/* TEXT */
|
|
2212
|
+
),
|
|
2213
|
+
w(t(aa), {
|
|
2214
|
+
trigger: "click",
|
|
2215
|
+
placement: "bottom",
|
|
2216
|
+
theme: "light"
|
|
2217
|
+
}, {
|
|
2218
|
+
content: P(() => [
|
|
2219
|
+
s("div", Ne, [
|
|
2220
|
+
s(
|
|
2221
|
+
"div",
|
|
2222
|
+
$e,
|
|
2223
|
+
I(t(l)("时间格式支持")),
|
|
2224
|
+
1
|
|
2225
|
+
/* TEXT */
|
|
2226
|
+
),
|
|
2227
|
+
s("table", Re, [
|
|
2228
|
+
s("thead", null, [
|
|
2229
|
+
s("tr", null, [
|
|
2230
|
+
s(
|
|
2231
|
+
"th",
|
|
2232
|
+
null,
|
|
2233
|
+
I(t(l)("格式")),
|
|
2234
|
+
1
|
|
2235
|
+
/* TEXT */
|
|
2236
|
+
),
|
|
2237
|
+
s(
|
|
2238
|
+
"th",
|
|
2239
|
+
null,
|
|
2240
|
+
I(t(l)("示例")),
|
|
2241
|
+
1
|
|
2242
|
+
/* TEXT */
|
|
2243
|
+
)
|
|
2244
|
+
])
|
|
2245
|
+
]),
|
|
2246
|
+
s("tbody", null, [
|
|
2247
|
+
(p(!0), D(
|
|
2248
|
+
B,
|
|
2249
|
+
null,
|
|
2250
|
+
$(t(ce), (k) => (p(), D("tr", { key: k }, [
|
|
2251
|
+
s(
|
|
2252
|
+
"td",
|
|
2253
|
+
null,
|
|
2254
|
+
I(k),
|
|
2255
|
+
1
|
|
2256
|
+
/* TEXT */
|
|
2257
|
+
),
|
|
2258
|
+
s(
|
|
2259
|
+
"td",
|
|
2260
|
+
null,
|
|
2261
|
+
I(t(M).format(k)),
|
|
2262
|
+
1
|
|
2263
|
+
/* TEXT */
|
|
2264
|
+
)
|
|
2265
|
+
]))),
|
|
2266
|
+
128
|
|
2267
|
+
/* KEYED_FRAGMENT */
|
|
2268
|
+
))
|
|
2269
|
+
])
|
|
2270
|
+
])
|
|
2271
|
+
])
|
|
2272
|
+
]),
|
|
2273
|
+
default: P(() => [
|
|
2274
|
+
w(t(va), {
|
|
2275
|
+
class: "format-button",
|
|
2276
|
+
text: "",
|
|
2277
|
+
theme: "primary"
|
|
2278
|
+
}, {
|
|
2279
|
+
default: P(() => [
|
|
2280
|
+
L(
|
|
2281
|
+
I(t(l)("查看支持格式")),
|
|
2282
|
+
1
|
|
2283
|
+
/* TEXT */
|
|
2284
|
+
)
|
|
2285
|
+
]),
|
|
2286
|
+
_: 1
|
|
2287
|
+
/* STABLE */
|
|
2288
|
+
})
|
|
2289
|
+
]),
|
|
2290
|
+
_: 1
|
|
2291
|
+
/* STABLE */
|
|
2292
|
+
})
|
|
2293
|
+
])
|
|
2294
|
+
]));
|
|
2295
|
+
}
|
|
2296
|
+
});
|
|
2297
|
+
const Le = { class: "natural-picker" }, Ue = ["onClick"], Ke = "__", qe = /* @__PURE__ */ F({
|
|
2298
|
+
__name: "natural-picker",
|
|
2299
|
+
props: {
|
|
2300
|
+
value: {}
|
|
2301
|
+
},
|
|
2302
|
+
emits: ["change"],
|
|
2303
|
+
setup(i, { emit: e }) {
|
|
2304
|
+
const a = e, r = i, d = j(), u = J(da.slice()), x = j(Ia[0].id), c = j(""), n = j(), o = j(u.value[0]);
|
|
2305
|
+
sa(
|
|
2306
|
+
() => r.value,
|
|
2307
|
+
(f) => {
|
|
2308
|
+
if (!f || f.dateMode !== _.NATURAL)
|
|
2309
|
+
return;
|
|
2310
|
+
const [b, m] = f.dateValue;
|
|
2311
|
+
if (A.isDayjs(b) || A.isDayjs(m))
|
|
2312
|
+
return;
|
|
2313
|
+
const { startNum: S, startUnit: E } = f;
|
|
2314
|
+
x.value = m === "now" ? la.NOW : la.ALL;
|
|
2315
|
+
const T = da.find((Y) => Y.id === b && Y.type === X.default);
|
|
2316
|
+
if (m !== "now" && b !== m && T || !T) {
|
|
2317
|
+
const Y = `${`${l("前")} ${S} ${l(
|
|
2318
|
+
Z[E]
|
|
2319
|
+
)}`}`;
|
|
2320
|
+
u.value.unshift({
|
|
2321
|
+
id: b,
|
|
2322
|
+
name: Y,
|
|
2323
|
+
type: X.custom
|
|
2324
|
+
}), [o.value] = u.value;
|
|
2325
|
+
return;
|
|
2326
|
+
}
|
|
2327
|
+
T && (o.value = T);
|
|
2424
2328
|
},
|
|
2425
|
-
{ label: "Pacific/Tongatapu", searchIndex: "pacific/tongatapu||utc+13:00|tonga|to", value: "Pacific/Tongatapu" },
|
|
2426
2329
|
{
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2330
|
+
immediate: !0
|
|
2331
|
+
}
|
|
2332
|
+
);
|
|
2333
|
+
const h = (f) => `${f.id}${Ke}${f.type}`, v = (f) => {
|
|
2334
|
+
const b = f.id;
|
|
2335
|
+
if (x.value === la.ALL) {
|
|
2336
|
+
const [, m, S, E] = b.match(ma) || [];
|
|
2337
|
+
return +m > 1 ? +m == 2 && S === "d" ? [b, b] : [b, `now-1${S}/${E}`] : [b, b];
|
|
2338
|
+
}
|
|
2339
|
+
return [b, "now"];
|
|
2340
|
+
}, M = (f) => {
|
|
2341
|
+
var b;
|
|
2342
|
+
if (f.type === X.edit) {
|
|
2343
|
+
n.value = "", c.value = f.id, setTimeout(() => {
|
|
2344
|
+
var m, S;
|
|
2345
|
+
(S = (m = d.value) == null ? void 0 : m.inputRef) == null || S.focus();
|
|
2346
|
+
}, 20);
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
o.value = f, c.value = "", (b = d.value) == null || b.hidePopover();
|
|
2350
|
+
}, z = (f) => {
|
|
2351
|
+
x.value = f;
|
|
2352
|
+
}, C = (f, b) => {
|
|
2353
|
+
var E, T;
|
|
2354
|
+
c.value = "";
|
|
2355
|
+
const m = `now-${+f}${b.unit}/${b.unit}`, S = u.value.find((Y) => Y.id === m);
|
|
2356
|
+
if (S) {
|
|
2357
|
+
o.value = S, (E = d.value) == null || E.hidePopover();
|
|
2358
|
+
return;
|
|
2359
|
+
}
|
|
2360
|
+
u.value.unshift({
|
|
2361
|
+
id: m,
|
|
2362
|
+
name: b.name.replace("N", f.toString()),
|
|
2363
|
+
type: X.custom
|
|
2364
|
+
}), [o.value] = u.value, (T = d.value) == null || T.hidePopover();
|
|
2365
|
+
}, U = (f, b) => {
|
|
2366
|
+
const m = f.target.value;
|
|
2367
|
+
!m || !c.value || C(+m, b);
|
|
2368
|
+
}, q = (f, b, m) => {
|
|
2369
|
+
f.key !== "Enter" || !c.value || C(b, m);
|
|
2370
|
+
}, R = () => {
|
|
2371
|
+
a("change", v(o.value));
|
|
2372
|
+
};
|
|
2373
|
+
return (f, b) => (p(), D("div", Le, [
|
|
2374
|
+
w(t(K), {
|
|
2375
|
+
clearable: !1,
|
|
2376
|
+
"input-search": !1,
|
|
2377
|
+
"model-value": h(o.value),
|
|
2378
|
+
"no-match-text": t(l)("无匹配数据"),
|
|
2379
|
+
"popover-options": { boundary: "parent" },
|
|
2380
|
+
prefix: t(l)("自然日期"),
|
|
2381
|
+
"search-placeholder": t(l)("请输入"),
|
|
2382
|
+
filterable: "",
|
|
2383
|
+
ref_key: "naturalSelectRef",
|
|
2384
|
+
ref: d
|
|
2385
|
+
}, {
|
|
2386
|
+
default: P(() => [
|
|
2387
|
+
(p(!0), D(
|
|
2388
|
+
B,
|
|
2389
|
+
null,
|
|
2390
|
+
$(u.value, (m) => (p(), N(t(K).Option, {
|
|
2391
|
+
id: h(m),
|
|
2392
|
+
key: h(m),
|
|
2393
|
+
name: m.name
|
|
2394
|
+
}, {
|
|
2395
|
+
default: P(() => [
|
|
2396
|
+
s("div", {
|
|
2397
|
+
onClick: b[1] || (b[1] = za(() => {
|
|
2398
|
+
}, ["prevent", "stop"])),
|
|
2399
|
+
style: { width: "100%", padding: "0 12px", margin: "0 -12px" }
|
|
2400
|
+
}, [
|
|
2401
|
+
c.value === m.id ? (p(), N(t(Pa), {
|
|
2402
|
+
key: 0,
|
|
2403
|
+
autofocus: !0,
|
|
2404
|
+
clearable: !1,
|
|
2405
|
+
placeholder: t(l)("请输入"),
|
|
2406
|
+
prefix: m.prefix,
|
|
2407
|
+
"show-control": !1,
|
|
2408
|
+
suffix: m.suffix,
|
|
2409
|
+
onBlur: (S) => U(S, m),
|
|
2410
|
+
onKeypress: (S, E) => q(E, S, m),
|
|
2411
|
+
size: "small",
|
|
2412
|
+
style: { width: "100%" },
|
|
2413
|
+
type: "number",
|
|
2414
|
+
modelValue: n.value,
|
|
2415
|
+
"onUpdate:modelValue": b[0] || (b[0] = (S) => n.value = S)
|
|
2416
|
+
}, null, 8, ["placeholder", "prefix", "suffix", "onBlur", "onKeypress", "modelValue"])) : (p(), D("div", {
|
|
2417
|
+
key: 1,
|
|
2418
|
+
onClick: (S) => M(m),
|
|
2419
|
+
style: { width: "100%" }
|
|
2420
|
+
}, I(m.name), 9, Ue))
|
|
2421
|
+
])
|
|
2422
|
+
]),
|
|
2423
|
+
_: 2
|
|
2424
|
+
/* DYNAMIC */
|
|
2425
|
+
}, 1032, ["id", "name"]))),
|
|
2426
|
+
128
|
|
2427
|
+
/* KEYED_FRAGMENT */
|
|
2428
|
+
))
|
|
2429
|
+
]),
|
|
2430
|
+
_: 1
|
|
2431
|
+
/* STABLE */
|
|
2432
|
+
}, 8, ["model-value", "no-match-text", "prefix", "search-placeholder"]),
|
|
2433
|
+
w(t(K), {
|
|
2434
|
+
clearable: !1,
|
|
2435
|
+
"model-value": x.value,
|
|
2436
|
+
"popover-options": { boundary: "parent" },
|
|
2437
|
+
onChange: z,
|
|
2438
|
+
class: "natural-unit"
|
|
2439
|
+
}, {
|
|
2440
|
+
default: P(() => [
|
|
2441
|
+
(p(!0), D(
|
|
2442
|
+
B,
|
|
2443
|
+
null,
|
|
2444
|
+
$(t(Ia), (m) => (p(), N(t(K).Option, {
|
|
2445
|
+
id: m.id,
|
|
2446
|
+
key: m.id,
|
|
2447
|
+
name: m.name
|
|
2448
|
+
}, null, 8, ["id", "name"]))),
|
|
2449
|
+
128
|
|
2450
|
+
/* KEYED_FRAGMENT */
|
|
2451
|
+
))
|
|
2452
|
+
]),
|
|
2453
|
+
_: 1
|
|
2454
|
+
/* STABLE */
|
|
2455
|
+
}, 8, ["model-value"]),
|
|
2456
|
+
w(ba, { onSubmit: R })
|
|
2457
|
+
]));
|
|
2458
|
+
}
|
|
2459
|
+
});
|
|
2460
|
+
const Fe = { class: "recent-picker" }, Ge = /* @__PURE__ */ F({
|
|
2461
|
+
__name: "recent-picker",
|
|
2462
|
+
props: {
|
|
2463
|
+
type: { default: _.RECENT },
|
|
2464
|
+
value: {}
|
|
2465
|
+
},
|
|
2466
|
+
emits: ["change"],
|
|
2467
|
+
setup(i, { emit: e }) {
|
|
2468
|
+
const a = e, r = i, d = j("m"), u = j();
|
|
2469
|
+
sa(
|
|
2470
|
+
() => r.value,
|
|
2471
|
+
(n) => {
|
|
2472
|
+
n && r.type === n.dateMode && (d.value = n.recentOrFuturedateUnit, u.value = n.recentOrFuturedateNum || void 0);
|
|
2430
2473
|
},
|
|
2431
2474
|
{
|
|
2432
|
-
|
|
2433
|
-
searchIndex: "pacific/wallis||utc+12:00|wallis and futuna|wf",
|
|
2434
|
-
value: "Pacific/Wallis"
|
|
2475
|
+
immediate: !0
|
|
2435
2476
|
}
|
|
2436
|
-
|
|
2477
|
+
);
|
|
2478
|
+
const x = W(() => !!u.value && !!d.value), c = () => {
|
|
2479
|
+
if (u.value) {
|
|
2480
|
+
if (r.type === _.FUTURE) {
|
|
2481
|
+
a("change", ["now", `${_.FUTURE}${u.value}${d.value}`]);
|
|
2482
|
+
return;
|
|
2483
|
+
}
|
|
2484
|
+
a("change", [`${_.RECENT}${u.value}${d.value}`, "now"]);
|
|
2485
|
+
}
|
|
2486
|
+
};
|
|
2487
|
+
return (n, o) => (p(), D("div", Fe, [
|
|
2488
|
+
w(t(Pa), {
|
|
2489
|
+
placeholder: t(l)("请输入"),
|
|
2490
|
+
prefix: n.type === "now-" ? t(l)("最近") : t(l)("将来"),
|
|
2491
|
+
type: "number",
|
|
2492
|
+
modelValue: u.value,
|
|
2493
|
+
"onUpdate:modelValue": o[1] || (o[1] = (h) => u.value = h)
|
|
2494
|
+
}, {
|
|
2495
|
+
suffix: P(() => [
|
|
2496
|
+
w(t(K), {
|
|
2497
|
+
clearable: !1,
|
|
2498
|
+
"popover-options": { boundary: "parent" },
|
|
2499
|
+
class: "recent-unit",
|
|
2500
|
+
filterable: "",
|
|
2501
|
+
modelValue: d.value,
|
|
2502
|
+
"onUpdate:modelValue": o[0] || (o[0] = (h) => d.value = h)
|
|
2503
|
+
}, {
|
|
2504
|
+
default: P(() => [
|
|
2505
|
+
(p(!0), D(
|
|
2506
|
+
B,
|
|
2507
|
+
null,
|
|
2508
|
+
$(t(Ca), (h) => (p(), N(t(K).Option, {
|
|
2509
|
+
id: h.id,
|
|
2510
|
+
key: h.id,
|
|
2511
|
+
name: h.name
|
|
2512
|
+
}, null, 8, ["id", "name"]))),
|
|
2513
|
+
128
|
|
2514
|
+
/* KEYED_FRAGMENT */
|
|
2515
|
+
))
|
|
2516
|
+
]),
|
|
2517
|
+
_: 1
|
|
2518
|
+
/* STABLE */
|
|
2519
|
+
}, 8, ["modelValue"])
|
|
2520
|
+
]),
|
|
2521
|
+
_: 1
|
|
2522
|
+
/* STABLE */
|
|
2523
|
+
}, 8, ["placeholder", "prefix", "modelValue"]),
|
|
2524
|
+
w(ba, {
|
|
2525
|
+
disabled: !x.value,
|
|
2526
|
+
onSubmit: c
|
|
2527
|
+
}, null, 8, ["disabled"])
|
|
2528
|
+
]));
|
|
2437
2529
|
}
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
label: o.label,
|
|
2441
|
-
options: o.options.map((l) => {
|
|
2442
|
-
const r = {
|
|
2443
|
-
...l,
|
|
2444
|
-
...Ke(l.searchIndex)
|
|
2445
|
-
};
|
|
2446
|
-
return l.value === i && e.push({
|
|
2447
|
-
...l,
|
|
2448
|
-
...r,
|
|
2449
|
-
label: r.label
|
|
2450
|
-
}), r;
|
|
2451
|
-
})
|
|
2452
|
-
}));
|
|
2453
|
-
return a.unshift({
|
|
2454
|
-
label: "",
|
|
2455
|
-
options: e
|
|
2456
|
-
}), a;
|
|
2457
|
-
}, Ke = (i) => {
|
|
2458
|
-
const e = i.split("|");
|
|
2459
|
-
return {
|
|
2460
|
-
abbreviation: e[1].toLocaleUpperCase(),
|
|
2461
|
-
country: (e[3] || "").replace(/(\b\w)/g, (a) => a.toLocaleUpperCase()),
|
|
2462
|
-
countryCode: e[4] || "",
|
|
2463
|
-
utc: e[2].toLocaleUpperCase()
|
|
2464
|
-
};
|
|
2465
|
-
}, ja = Le(), Na = (i) => ja.reduce((e, a) => (e == null ? void 0 : e.label) === i ? e : a.options.find((o) => o.label === i), {}), Ue = { class: "option-name" }, qe = { class: "option-country" }, Fe = { class: "option-utc" }, Ge = { class: "option-name" }, Oe = { class: "option-country" }, Je = { class: "option-utc" }, We = /* @__PURE__ */ G({
|
|
2530
|
+
});
|
|
2531
|
+
const Oe = { class: "option-name" }, Je = { class: "option-country" }, We = { class: "option-utc" }, Ze = { class: "option-name" }, Qe = { class: "option-country" }, Xe = { class: "option-utc" }, at = /* @__PURE__ */ F({
|
|
2466
2532
|
__name: "timezone-picker",
|
|
2467
2533
|
props: {
|
|
2468
2534
|
value: {}
|
|
2469
2535
|
},
|
|
2470
2536
|
emits: ["change"],
|
|
2471
2537
|
setup(i, { emit: e }) {
|
|
2472
|
-
const a = e,
|
|
2473
|
-
const
|
|
2474
|
-
a("change",
|
|
2538
|
+
const a = e, r = J(ja), d = (u) => {
|
|
2539
|
+
const x = Ya(u);
|
|
2540
|
+
a("change", u, x);
|
|
2475
2541
|
};
|
|
2476
|
-
return (
|
|
2477
|
-
"model-value": r.value,
|
|
2478
|
-
class: "timezone-picker",
|
|
2479
|
-
filterable: "",
|
|
2480
|
-
"input-search": "",
|
|
2542
|
+
return (u, x) => (p(), N(t(K), {
|
|
2481
2543
|
clearable: !1,
|
|
2482
|
-
|
|
2483
|
-
"no-match-text": t(
|
|
2544
|
+
"model-value": u.value,
|
|
2545
|
+
"no-match-text": t(l)("无匹配数据"),
|
|
2546
|
+
placeholder: t(l)("请输入搜索(国家,城市,简称)"),
|
|
2484
2547
|
"popover-options": { "ext-cls": "__bk-date-picker-popover__" },
|
|
2485
|
-
onChange:
|
|
2548
|
+
onChange: d,
|
|
2549
|
+
class: "timezone-picker",
|
|
2550
|
+
filterable: "",
|
|
2551
|
+
"input-search": ""
|
|
2486
2552
|
}, {
|
|
2487
|
-
default:
|
|
2488
|
-
(
|
|
2489
|
-
|
|
2553
|
+
default: P(() => [
|
|
2554
|
+
(p(!0), D(
|
|
2555
|
+
B,
|
|
2490
2556
|
null,
|
|
2491
|
-
|
|
2492
|
-
|
|
2557
|
+
$(r.value, (c) => (p(), D(
|
|
2558
|
+
B,
|
|
2493
2559
|
null,
|
|
2494
2560
|
[
|
|
2495
|
-
|
|
2496
|
-
|
|
2561
|
+
c.label.length < 1 ? (p(!0), D(
|
|
2562
|
+
B,
|
|
2497
2563
|
{ key: 0 },
|
|
2498
|
-
|
|
2499
|
-
id:
|
|
2500
|
-
|
|
2501
|
-
|
|
2564
|
+
$(c.options, (n) => (p(), N(t(K).Option, {
|
|
2565
|
+
id: n.label,
|
|
2566
|
+
key: n.label,
|
|
2567
|
+
name: n.label
|
|
2502
2568
|
}, {
|
|
2503
|
-
default:
|
|
2504
|
-
|
|
2569
|
+
default: P(() => [
|
|
2570
|
+
s(
|
|
2505
2571
|
"div",
|
|
2506
2572
|
{
|
|
2507
|
-
class:
|
|
2573
|
+
class: ta({
|
|
2508
2574
|
"timezone-picker-option": !0,
|
|
2509
|
-
"is-selected":
|
|
2575
|
+
"is-selected": n.label === u.value
|
|
2510
2576
|
})
|
|
2511
2577
|
},
|
|
2512
2578
|
[
|
|
2513
|
-
|
|
2579
|
+
s(
|
|
2514
2580
|
"span",
|
|
2515
|
-
|
|
2516
|
-
|
|
2581
|
+
Oe,
|
|
2582
|
+
I(t(l)("浏览器时间")) + " " + I(n.label),
|
|
2517
2583
|
1
|
|
2518
2584
|
/* TEXT */
|
|
2519
2585
|
),
|
|
2520
|
-
|
|
2586
|
+
s(
|
|
2521
2587
|
"span",
|
|
2522
|
-
|
|
2523
|
-
|
|
2588
|
+
Je,
|
|
2589
|
+
I(n.country) + ", " + I(n.abbreviation),
|
|
2524
2590
|
1
|
|
2525
2591
|
/* TEXT */
|
|
2526
2592
|
),
|
|
2527
|
-
|
|
2593
|
+
s(
|
|
2528
2594
|
"span",
|
|
2529
|
-
|
|
2530
|
-
|
|
2595
|
+
We,
|
|
2596
|
+
I(n.utc),
|
|
2531
2597
|
1
|
|
2532
2598
|
/* TEXT */
|
|
2533
2599
|
)
|
|
@@ -2541,51 +2607,51 @@ const Re = [
|
|
|
2541
2607
|
}, 1032, ["id", "name"]))),
|
|
2542
2608
|
128
|
|
2543
2609
|
/* KEYED_FRAGMENT */
|
|
2544
|
-
)) : (
|
|
2545
|
-
|
|
2610
|
+
)) : (p(), D(
|
|
2611
|
+
B,
|
|
2546
2612
|
{ key: 1 },
|
|
2547
2613
|
[
|
|
2548
|
-
|
|
2549
|
-
key:
|
|
2550
|
-
label:
|
|
2614
|
+
c.options.length ? (p(), N(t(K).Group, {
|
|
2615
|
+
key: c.label,
|
|
2616
|
+
label: c.label
|
|
2551
2617
|
}, {
|
|
2552
|
-
default:
|
|
2553
|
-
(
|
|
2554
|
-
|
|
2618
|
+
default: P(() => [
|
|
2619
|
+
(p(!0), D(
|
|
2620
|
+
B,
|
|
2555
2621
|
null,
|
|
2556
|
-
|
|
2557
|
-
id:
|
|
2558
|
-
|
|
2559
|
-
|
|
2622
|
+
$(c.options, (n) => (p(), N(t(K).Option, {
|
|
2623
|
+
id: n.label,
|
|
2624
|
+
key: n.label,
|
|
2625
|
+
name: n.label
|
|
2560
2626
|
}, {
|
|
2561
|
-
default:
|
|
2562
|
-
|
|
2627
|
+
default: P(() => [
|
|
2628
|
+
s(
|
|
2563
2629
|
"div",
|
|
2564
2630
|
{
|
|
2565
|
-
class:
|
|
2631
|
+
class: ta({
|
|
2566
2632
|
"timezone-picker-option": !0,
|
|
2567
|
-
"is-selected":
|
|
2633
|
+
"is-selected": n.label === u.value
|
|
2568
2634
|
})
|
|
2569
2635
|
},
|
|
2570
2636
|
[
|
|
2571
|
-
|
|
2637
|
+
s(
|
|
2572
2638
|
"span",
|
|
2573
|
-
|
|
2574
|
-
|
|
2639
|
+
Ze,
|
|
2640
|
+
I(n.label),
|
|
2575
2641
|
1
|
|
2576
2642
|
/* TEXT */
|
|
2577
2643
|
),
|
|
2578
|
-
|
|
2644
|
+
s(
|
|
2579
2645
|
"span",
|
|
2580
|
-
|
|
2581
|
-
|
|
2646
|
+
Qe,
|
|
2647
|
+
I(n.country) + ", " + I(n.abbreviation),
|
|
2582
2648
|
1
|
|
2583
2649
|
/* TEXT */
|
|
2584
2650
|
),
|
|
2585
|
-
|
|
2651
|
+
s(
|
|
2586
2652
|
"span",
|
|
2587
|
-
|
|
2588
|
-
|
|
2653
|
+
Xe,
|
|
2654
|
+
I(n.utc),
|
|
2589
2655
|
1
|
|
2590
2656
|
/* TEXT */
|
|
2591
2657
|
)
|
|
@@ -2603,7 +2669,7 @@ const Re = [
|
|
|
2603
2669
|
]),
|
|
2604
2670
|
_: 2
|
|
2605
2671
|
/* DYNAMIC */
|
|
2606
|
-
}, 1032, ["label"])) :
|
|
2672
|
+
}, 1032, ["label"])) : na("v-if", !0)
|
|
2607
2673
|
],
|
|
2608
2674
|
64
|
|
2609
2675
|
/* STABLE_FRAGMENT */
|
|
@@ -2618,22 +2684,22 @@ const Re = [
|
|
|
2618
2684
|
]),
|
|
2619
2685
|
_: 1
|
|
2620
2686
|
/* STABLE */
|
|
2621
|
-
}, 8, ["model-value", "
|
|
2687
|
+
}, 8, ["model-value", "no-match-text", "placeholder"]));
|
|
2622
2688
|
}
|
|
2623
2689
|
});
|
|
2624
|
-
const
|
|
2690
|
+
const et = { class: "panel-wrapper" }, tt = { class: "common-date-list" }, it = ["onClick"], nt = { class: "common-wrapper" }, rt = { class: "empty-tips" }, lt = {
|
|
2625
2691
|
key: 0,
|
|
2626
2692
|
class: "time-zone-panel"
|
|
2627
|
-
},
|
|
2693
|
+
}, ct = { class: "time-zone" }, st = { class: "time-zone-area" }, ut = { class: "time-zone-tag" }, ot = { class: "time-zone-picker" }, dt = /* @__PURE__ */ F({
|
|
2628
2694
|
__name: "panel-wrapper",
|
|
2629
2695
|
props: {
|
|
2630
|
-
|
|
2696
|
+
defaultDate: {},
|
|
2631
2697
|
needTimezone: { type: Boolean },
|
|
2632
2698
|
timezone: {}
|
|
2633
2699
|
},
|
|
2634
2700
|
emits: ["change", "update:timezone"],
|
|
2635
2701
|
setup(i, { emit: e }) {
|
|
2636
|
-
const a = i, { format:
|
|
2702
|
+
const a = i, { format: r, storeKey: d, timezoneInfo: u } = Va(), x = e, c = j(!1), n = [
|
|
2637
2703
|
["now-5m", "now"],
|
|
2638
2704
|
["now-15m", "now"],
|
|
2639
2705
|
["now-30m", "now"],
|
|
@@ -2657,61 +2723,61 @@ const Ze = { class: "panel-wrapper" }, Qe = { class: "common-date-list" }, Xe =
|
|
|
2657
2723
|
["now/M", "now"],
|
|
2658
2724
|
["now-1M/M", "now-1M/M"],
|
|
2659
2725
|
["now-1M/M", "now"]
|
|
2660
|
-
],
|
|
2661
|
-
|
|
2662
|
-
},
|
|
2726
|
+
], o = j("common"), h = j(a.defaultDate.dateMode), v = A.tz.guess(), M = W(() => pe(d.value)), z = W(() => (o.value === "common" ? n : M.value).map((f) => new ha(f, r.value))), C = (f) => {
|
|
2727
|
+
x("change", f);
|
|
2728
|
+
}, U = () => {
|
|
2663
2729
|
switch (h.value) {
|
|
2664
|
-
case
|
|
2665
|
-
case
|
|
2666
|
-
return
|
|
2667
|
-
case
|
|
2668
|
-
return
|
|
2669
|
-
case
|
|
2730
|
+
case _.RECENT:
|
|
2731
|
+
case _.FUTURE:
|
|
2732
|
+
return Ge;
|
|
2733
|
+
case _.NATURAL:
|
|
2734
|
+
return qe;
|
|
2735
|
+
case _.Date:
|
|
2670
2736
|
default:
|
|
2671
|
-
return
|
|
2737
|
+
return He;
|
|
2672
2738
|
}
|
|
2673
|
-
},
|
|
2674
|
-
|
|
2675
|
-
},
|
|
2676
|
-
|
|
2739
|
+
}, q = () => {
|
|
2740
|
+
c.value = !c.value;
|
|
2741
|
+
}, R = (f, b) => {
|
|
2742
|
+
x("update:timezone", f, b);
|
|
2677
2743
|
};
|
|
2678
|
-
return (
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
}, null, 8, ["
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
(
|
|
2687
|
-
|
|
2744
|
+
return (f, b) => (p(), D("div", et, [
|
|
2745
|
+
w(ka, {
|
|
2746
|
+
panels: t(ie),
|
|
2747
|
+
modelValue: o.value,
|
|
2748
|
+
"onUpdate:modelValue": b[0] || (b[0] = (m) => o.value = m)
|
|
2749
|
+
}, null, 8, ["panels", "modelValue"]),
|
|
2750
|
+
s("div", null, [
|
|
2751
|
+
s("ul", tt, [
|
|
2752
|
+
(p(!0), D(
|
|
2753
|
+
B,
|
|
2688
2754
|
null,
|
|
2689
|
-
|
|
2690
|
-
class:
|
|
2755
|
+
$(z.value, (m, S) => (p(), D("li", {
|
|
2756
|
+
class: ta({
|
|
2691
2757
|
"list-item": !0,
|
|
2692
|
-
"is-recent-item":
|
|
2758
|
+
"is-recent-item": o.value === "recent"
|
|
2693
2759
|
}),
|
|
2694
|
-
key:
|
|
2695
|
-
onClick: (
|
|
2696
|
-
},
|
|
2760
|
+
key: S,
|
|
2761
|
+
onClick: (E) => C(m.dateValue)
|
|
2762
|
+
}, I(m.toDisplayString()), 11, it))),
|
|
2697
2763
|
128
|
|
2698
2764
|
/* KEYED_FRAGMENT */
|
|
2699
2765
|
))
|
|
2700
2766
|
])
|
|
2701
2767
|
]),
|
|
2702
|
-
ia(
|
|
2768
|
+
ia(s(
|
|
2703
2769
|
"div",
|
|
2704
|
-
|
|
2770
|
+
nt,
|
|
2705
2771
|
[
|
|
2706
|
-
|
|
2707
|
-
|
|
2772
|
+
w(t(Qa), {
|
|
2773
|
+
class: "empty-content",
|
|
2708
2774
|
scene: "part",
|
|
2709
|
-
|
|
2775
|
+
type: "empty"
|
|
2710
2776
|
}),
|
|
2711
|
-
|
|
2777
|
+
s(
|
|
2712
2778
|
"div",
|
|
2713
|
-
|
|
2714
|
-
|
|
2779
|
+
rt,
|
|
2780
|
+
I(t(l)("暂无最近使用记录")),
|
|
2715
2781
|
1
|
|
2716
2782
|
/* TEXT */
|
|
2717
2783
|
)
|
|
@@ -2719,64 +2785,64 @@ const Ze = { class: "panel-wrapper" }, Qe = { class: "common-date-list" }, Xe =
|
|
|
2719
2785
|
512
|
|
2720
2786
|
/* NEED_PATCH */
|
|
2721
2787
|
), [
|
|
2722
|
-
[
|
|
2788
|
+
[ga, z.value.length < 1]
|
|
2723
2789
|
]),
|
|
2724
|
-
|
|
2790
|
+
w(ka, {
|
|
2791
|
+
panels: t(ne),
|
|
2725
2792
|
class: "date-pick-tab",
|
|
2726
2793
|
modelValue: h.value,
|
|
2727
|
-
"onUpdate:modelValue":
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
Ka,
|
|
2794
|
+
"onUpdate:modelValue": b[1] || (b[1] = (m) => h.value = m)
|
|
2795
|
+
}, null, 8, ["panels", "modelValue"]),
|
|
2796
|
+
(p(), N(
|
|
2797
|
+
La,
|
|
2732
2798
|
null,
|
|
2733
2799
|
[
|
|
2734
|
-
(
|
|
2800
|
+
(p(), N(Ua(U()), {
|
|
2735
2801
|
key: h.value,
|
|
2736
2802
|
type: h.value,
|
|
2737
|
-
value:
|
|
2738
|
-
onChange:
|
|
2803
|
+
value: f.defaultDate,
|
|
2804
|
+
onChange: C
|
|
2739
2805
|
}, null, 40, ["type", "value"]))
|
|
2740
2806
|
],
|
|
2741
2807
|
1024
|
|
2742
2808
|
/* DYNAMIC_SLOTS */
|
|
2743
2809
|
)),
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2810
|
+
f.needTimezone ? (p(), D("div", lt, [
|
|
2811
|
+
L(
|
|
2812
|
+
I(t(u).label === t(v) ? t(l)("浏览器时间") : "") + " ",
|
|
2747
2813
|
1
|
|
2748
2814
|
/* TEXT */
|
|
2749
2815
|
),
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2816
|
+
s("span", ct, [
|
|
2817
|
+
L(
|
|
2818
|
+
I(t(u).label) + " ",
|
|
2753
2819
|
1
|
|
2754
2820
|
/* TEXT */
|
|
2755
2821
|
),
|
|
2756
|
-
|
|
2822
|
+
s(
|
|
2757
2823
|
"span",
|
|
2758
|
-
|
|
2759
|
-
|
|
2824
|
+
st,
|
|
2825
|
+
I(t(u).country) + ", " + I(t(u).abbreviation),
|
|
2760
2826
|
1
|
|
2761
2827
|
/* TEXT */
|
|
2762
2828
|
)
|
|
2763
2829
|
]),
|
|
2764
|
-
|
|
2830
|
+
s(
|
|
2765
2831
|
"span",
|
|
2766
|
-
|
|
2767
|
-
|
|
2832
|
+
ut,
|
|
2833
|
+
I(t(u).utc),
|
|
2768
2834
|
1
|
|
2769
2835
|
/* TEXT */
|
|
2770
2836
|
),
|
|
2771
|
-
|
|
2772
|
-
theme: "primary",
|
|
2773
|
-
size: "small",
|
|
2837
|
+
w(t(va), {
|
|
2774
2838
|
text: !0,
|
|
2775
|
-
onClick:
|
|
2839
|
+
onClick: q,
|
|
2840
|
+
size: "small",
|
|
2841
|
+
theme: "primary"
|
|
2776
2842
|
}, {
|
|
2777
|
-
default:
|
|
2778
|
-
|
|
2779
|
-
|
|
2843
|
+
default: P(() => [
|
|
2844
|
+
L(
|
|
2845
|
+
I(t(l)("时区设置")),
|
|
2780
2846
|
1
|
|
2781
2847
|
/* TEXT */
|
|
2782
2848
|
)
|
|
@@ -2784,51 +2850,51 @@ const Ze = { class: "panel-wrapper" }, Qe = { class: "common-date-list" }, Xe =
|
|
|
2784
2850
|
_: 1
|
|
2785
2851
|
/* STABLE */
|
|
2786
2852
|
})
|
|
2787
|
-
])) :
|
|
2788
|
-
ia(
|
|
2853
|
+
])) : na("v-if", !0),
|
|
2854
|
+
ia(s(
|
|
2789
2855
|
"div",
|
|
2790
|
-
|
|
2856
|
+
ot,
|
|
2791
2857
|
[
|
|
2792
|
-
|
|
2793
|
-
value:
|
|
2794
|
-
onChange:
|
|
2858
|
+
w(at, {
|
|
2859
|
+
value: f.timezone || t(v),
|
|
2860
|
+
onChange: R
|
|
2795
2861
|
}, null, 8, ["value"])
|
|
2796
2862
|
],
|
|
2797
2863
|
512
|
|
2798
2864
|
/* NEED_PATCH */
|
|
2799
2865
|
), [
|
|
2800
|
-
[
|
|
2866
|
+
[ga, c.value]
|
|
2801
2867
|
])
|
|
2802
2868
|
]));
|
|
2803
2869
|
}
|
|
2804
2870
|
});
|
|
2805
|
-
const
|
|
2871
|
+
const mt = /* @__PURE__ */ s(
|
|
2806
2872
|
"svg",
|
|
2807
2873
|
{
|
|
2808
2874
|
class: "date-content-icon",
|
|
2809
|
-
|
|
2875
|
+
height: "14",
|
|
2810
2876
|
version: "1.1",
|
|
2811
|
-
|
|
2812
|
-
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
2877
|
+
viewBox: "0 0 1024 1024",
|
|
2813
2878
|
width: "14",
|
|
2814
|
-
|
|
2879
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2880
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
2815
2881
|
},
|
|
2816
2882
|
[
|
|
2817
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ s("path", {
|
|
2818
2884
|
d: "M486.656 997.312c-268.288 0-486.656-218.304-486.656-486.656 0-268.288 218.304-486.656 486.656-486.656 268.352 0 486.656 218.304 486.656 486.656C973.376 779.008 755.008 997.312 486.656 997.312zM486.656 88c-233.088 0-422.656 189.568-422.656 422.656 0 233.088 189.568 422.656 422.656 422.656s422.656-189.632 422.656-422.656C909.376 277.568 719.744 88 486.656 88z",
|
|
2819
2885
|
fill: "#979BA5"
|
|
2820
2886
|
}),
|
|
2821
|
-
/* @__PURE__ */
|
|
2887
|
+
/* @__PURE__ */ s("path", {
|
|
2822
2888
|
d: "M816.064 544 432.064 544 432.064 160 496.064 160 496.064 480 816.064 480Z",
|
|
2823
2889
|
fill: "#979BA5"
|
|
2824
2890
|
})
|
|
2825
2891
|
],
|
|
2826
2892
|
-1
|
|
2827
2893
|
/* HOISTED */
|
|
2828
|
-
),
|
|
2894
|
+
), ht = {
|
|
2829
2895
|
key: 0,
|
|
2830
2896
|
class: "date-content-utc"
|
|
2831
|
-
},
|
|
2897
|
+
}, vt = { class: "date-tooltips-timezone" }, Lt = /* @__PURE__ */ F({
|
|
2832
2898
|
name: "DatePicker",
|
|
2833
2899
|
__name: "date-picker",
|
|
2834
2900
|
props: {
|
|
@@ -2836,185 +2902,185 @@ const si = /* @__PURE__ */ u(
|
|
|
2836
2902
|
disabled: { type: Boolean },
|
|
2837
2903
|
format: { default: "YYYY-MM-DD HH:mm:ss" },
|
|
2838
2904
|
modelValue: {},
|
|
2839
|
-
needTimezone: { type: Boolean, default: !
|
|
2905
|
+
needTimezone: { type: Boolean, default: !0 },
|
|
2840
2906
|
timezone: {},
|
|
2841
2907
|
version: { default: "1.0" }
|
|
2842
2908
|
},
|
|
2843
2909
|
emits: ["update:modelValue", "update:timezone"],
|
|
2844
2910
|
setup(i, { expose: e, emit: a }) {
|
|
2845
|
-
|
|
2846
|
-
...
|
|
2911
|
+
A.locale({
|
|
2912
|
+
...ca === "en" ? Wa : Za,
|
|
2847
2913
|
weekStart: 1
|
|
2848
|
-
}),
|
|
2914
|
+
}), Fa({
|
|
2849
2915
|
prefix: "bk"
|
|
2850
2916
|
});
|
|
2851
|
-
const
|
|
2852
|
-
|
|
2853
|
-
format:
|
|
2917
|
+
const r = i, d = a, u = j(), x = j(), c = W(() => r.format), n = W(() => Ya(r.timezone || A.tz.guess())), o = J(new ha(r.modelValue, r.format)), h = W(() => le(r.version)), v = j(!1), M = j(!1);
|
|
2918
|
+
ue({
|
|
2919
|
+
format: c,
|
|
2854
2920
|
storeKey: h,
|
|
2855
|
-
t:
|
|
2856
|
-
timezoneInfo:
|
|
2857
|
-
}),
|
|
2858
|
-
|
|
2921
|
+
t: l,
|
|
2922
|
+
timezoneInfo: n
|
|
2923
|
+
}), Ka(() => {
|
|
2924
|
+
M.value = !1, v.value = !1;
|
|
2859
2925
|
});
|
|
2860
|
-
const
|
|
2861
|
-
|
|
2862
|
-
},
|
|
2926
|
+
const z = () => {
|
|
2927
|
+
M.value = !0;
|
|
2928
|
+
}, C = () => {
|
|
2863
2929
|
setTimeout(() => {
|
|
2864
|
-
|
|
2930
|
+
M.value = !1;
|
|
2865
2931
|
}, 100);
|
|
2866
|
-
},
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
},
|
|
2874
|
-
|
|
2875
|
-
},
|
|
2876
|
-
|
|
2877
|
-
},
|
|
2878
|
-
var
|
|
2879
|
-
if (((
|
|
2932
|
+
}, U = (E) => {
|
|
2933
|
+
v.value = !1, o.value = new ha(E, c.value);
|
|
2934
|
+
const T = o.value.toEmitValue();
|
|
2935
|
+
d(
|
|
2936
|
+
"update:modelValue",
|
|
2937
|
+
...T
|
|
2938
|
+
), o.value.isValidate && fe(E, h.value);
|
|
2939
|
+
}, q = (E, T) => {
|
|
2940
|
+
d("update:timezone", E, { ...T }), R();
|
|
2941
|
+
}, R = () => {
|
|
2942
|
+
v.value = !1;
|
|
2943
|
+
}, f = (E) => {
|
|
2944
|
+
var k;
|
|
2945
|
+
if (((k = o.value.dateValue) == null ? void 0 : k.length) < 2)
|
|
2880
2946
|
return;
|
|
2881
|
-
const [
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
},
|
|
2886
|
-
|
|
2887
|
-
},
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2947
|
+
const { endDate: T, startDate: Y } = o.value, y = o.value.dateDuration(), g = E === "left" ? [Y.subtract(y).format(c.value), T.subtract(y).format(c.value)] : [Y.add(y).format(c.value), T.add(y).format(c.value)];
|
|
2948
|
+
U(g);
|
|
2949
|
+
}, b = () => {
|
|
2950
|
+
f("left");
|
|
2951
|
+
}, m = () => {
|
|
2952
|
+
f("right");
|
|
2953
|
+
}, S = (E) => {
|
|
2954
|
+
v.value && (Array.from(document.querySelectorAll(".__bk-date-picker-popover__")).some(
|
|
2955
|
+
(T) => T.contains(E.target)
|
|
2956
|
+
) || R());
|
|
2891
2957
|
};
|
|
2892
2958
|
return e({
|
|
2893
2959
|
handleHidePanel: () => {
|
|
2894
|
-
|
|
2960
|
+
v.value = !1;
|
|
2895
2961
|
},
|
|
2896
2962
|
handleShowPanel: () => {
|
|
2897
|
-
|
|
2963
|
+
v.value = !0;
|
|
2898
2964
|
}
|
|
2899
|
-
}), (
|
|
2965
|
+
}), (E, T) => (p(), D(
|
|
2900
2966
|
"div",
|
|
2901
2967
|
{
|
|
2902
|
-
class:
|
|
2968
|
+
class: ta({
|
|
2903
2969
|
__bk_date_picker__: !0,
|
|
2904
|
-
"is-simplicity":
|
|
2905
|
-
"is-disabled":
|
|
2970
|
+
"is-simplicity": E.behavior === "simplicity",
|
|
2971
|
+
"is-disabled": E.disabled
|
|
2906
2972
|
})
|
|
2907
2973
|
},
|
|
2908
2974
|
[
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2975
|
+
s("span", {
|
|
2976
|
+
onClick: b,
|
|
2977
|
+
class: "date-icon"
|
|
2912
2978
|
}, [
|
|
2913
|
-
|
|
2979
|
+
w(t(Ea), { class: "date-icon-left" })
|
|
2914
2980
|
]),
|
|
2915
|
-
|
|
2916
|
-
trigger: "manual",
|
|
2917
|
-
"is-show": d.value,
|
|
2918
|
-
placement: "bottom-start",
|
|
2919
|
-
theme: "light",
|
|
2981
|
+
w(t(aa), {
|
|
2920
2982
|
arrow: !1,
|
|
2921
|
-
"
|
|
2983
|
+
"is-show": v.value,
|
|
2922
2984
|
offset: { mainAxis: 10, crossAxis: 10, alignmentAxis: -32 },
|
|
2923
|
-
onAfterHidden:
|
|
2985
|
+
onAfterHidden: R,
|
|
2986
|
+
"ext-cls": "bk-date-picker-popover __bk-date-picker-popover__",
|
|
2987
|
+
placement: "bottom-start",
|
|
2988
|
+
theme: "light",
|
|
2989
|
+
trigger: "manual"
|
|
2924
2990
|
}, {
|
|
2925
|
-
content:
|
|
2926
|
-
|
|
2927
|
-
"default-
|
|
2928
|
-
timezone:
|
|
2929
|
-
|
|
2930
|
-
onChange:
|
|
2931
|
-
"onUpdate:timezone":
|
|
2932
|
-
}, null, 8, ["default-
|
|
2991
|
+
content: P(() => [
|
|
2992
|
+
w(dt, {
|
|
2993
|
+
"default-date": o.value,
|
|
2994
|
+
"need-timezone": E.needTimezone,
|
|
2995
|
+
timezone: E.timezone,
|
|
2996
|
+
onChange: U,
|
|
2997
|
+
"onUpdate:timezone": q
|
|
2998
|
+
}, null, 8, ["default-date", "need-timezone", "timezone"])
|
|
2933
2999
|
]),
|
|
2934
|
-
default:
|
|
2935
|
-
var
|
|
3000
|
+
default: P(() => {
|
|
3001
|
+
var Y;
|
|
2936
3002
|
return [
|
|
2937
|
-
ia((
|
|
3003
|
+
ia((p(), D(
|
|
2938
3004
|
"span",
|
|
2939
3005
|
{
|
|
3006
|
+
onClick: T[0] || (T[0] = (y) => v.value = !v.value),
|
|
3007
|
+
onMouseenter: z,
|
|
3008
|
+
onMouseleave: C,
|
|
2940
3009
|
class: "date-content",
|
|
2941
|
-
onClick: V[0] || (V[0] = (x) => d.value = !d.value),
|
|
2942
3010
|
ref_key: "dateContentRef",
|
|
2943
|
-
ref:
|
|
2944
|
-
onMouseenter: g,
|
|
2945
|
-
onMouseleave: P
|
|
3011
|
+
ref: x
|
|
2946
3012
|
},
|
|
2947
3013
|
[
|
|
2948
|
-
|
|
2949
|
-
|
|
3014
|
+
mt,
|
|
3015
|
+
s(
|
|
2950
3016
|
"span",
|
|
2951
3017
|
null,
|
|
2952
|
-
|
|
3018
|
+
I(o.value.toDisplayString()),
|
|
2953
3019
|
1
|
|
2954
3020
|
/* TEXT */
|
|
2955
3021
|
),
|
|
2956
|
-
|
|
3022
|
+
E.needTimezone ? (p(), D(
|
|
2957
3023
|
"span",
|
|
2958
|
-
|
|
2959
|
-
|
|
3024
|
+
ht,
|
|
3025
|
+
I(n.value.abbreviation || ((Y = n.value.utc) == null ? void 0 : Y.replace("UTC", "").replace(":00", ""))),
|
|
2960
3026
|
1
|
|
2961
3027
|
/* TEXT */
|
|
2962
|
-
)) :
|
|
3028
|
+
)) : na("v-if", !0)
|
|
2963
3029
|
],
|
|
2964
3030
|
32
|
|
2965
3031
|
/* HYDRATE_EVENTS */
|
|
2966
3032
|
)), [
|
|
2967
|
-
[t(
|
|
3033
|
+
[t(ua), S]
|
|
2968
3034
|
])
|
|
2969
3035
|
];
|
|
2970
3036
|
}),
|
|
2971
3037
|
_: 1
|
|
2972
3038
|
/* STABLE */
|
|
2973
3039
|
}, 8, ["is-show"]),
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
3040
|
+
s("span", {
|
|
3041
|
+
onClick: m,
|
|
3042
|
+
class: "date-icon"
|
|
2977
3043
|
}, [
|
|
2978
|
-
|
|
3044
|
+
w(t(Sa), { class: "date-icon-right" })
|
|
2979
3045
|
]),
|
|
2980
|
-
|
|
2981
|
-
"is-show":
|
|
2982
|
-
trigger: "manual",
|
|
2983
|
-
target: y.value,
|
|
3046
|
+
w(t(aa), {
|
|
3047
|
+
"is-show": M.value,
|
|
2984
3048
|
offset: 12,
|
|
2985
|
-
|
|
3049
|
+
target: x.value,
|
|
3050
|
+
placement: "top",
|
|
3051
|
+
trigger: "manual"
|
|
2986
3052
|
}, {
|
|
2987
|
-
content:
|
|
2988
|
-
var
|
|
3053
|
+
content: P(() => {
|
|
3054
|
+
var Y, y, g, k;
|
|
2989
3055
|
return [
|
|
2990
|
-
|
|
3056
|
+
s(
|
|
2991
3057
|
"div",
|
|
2992
3058
|
{
|
|
2993
|
-
|
|
2994
|
-
ref: r,
|
|
3059
|
+
style: qa({ maxWidth: t(ca) === "en" ? "180px" : "156px" }),
|
|
2995
3060
|
class: "__date-tooltips__",
|
|
2996
|
-
|
|
3061
|
+
ref_key: "dateTooltipsRef",
|
|
3062
|
+
ref: u
|
|
2997
3063
|
},
|
|
2998
3064
|
[
|
|
2999
|
-
|
|
3065
|
+
s(
|
|
3000
3066
|
"div",
|
|
3001
3067
|
null,
|
|
3002
|
-
|
|
3068
|
+
I((y = (Y = o.value) == null ? void 0 : Y.startDate) == null ? void 0 : y.format(c.value)),
|
|
3003
3069
|
1
|
|
3004
3070
|
/* TEXT */
|
|
3005
3071
|
),
|
|
3006
|
-
|
|
3007
|
-
|
|
3072
|
+
L(" to "),
|
|
3073
|
+
s(
|
|
3008
3074
|
"div",
|
|
3009
3075
|
null,
|
|
3010
|
-
|
|
3076
|
+
I((k = (g = o.value) == null ? void 0 : g.endDate) == null ? void 0 : k.format(c.value)),
|
|
3011
3077
|
1
|
|
3012
3078
|
/* TEXT */
|
|
3013
3079
|
),
|
|
3014
|
-
|
|
3080
|
+
s(
|
|
3015
3081
|
"div",
|
|
3016
|
-
|
|
3017
|
-
|
|
3082
|
+
vt,
|
|
3083
|
+
I(n.value.label === t(A).tz.guess() ? `${t(l)("浏览器时间")} (${n.value.label})` : n.value.label),
|
|
3018
3084
|
1
|
|
3019
3085
|
/* TEXT */
|
|
3020
3086
|
)
|
|
@@ -3033,24 +3099,16 @@ const si = /* @__PURE__ */ u(
|
|
|
3033
3099
|
));
|
|
3034
3100
|
}
|
|
3035
3101
|
});
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3102
|
+
A.extend(wa);
|
|
3103
|
+
A.extend($a);
|
|
3104
|
+
A.extend(Da);
|
|
3105
|
+
A.extend(Ma);
|
|
3040
3106
|
export {
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
$a as getDateValueToString,
|
|
3049
|
-
oa as isValidDateValue,
|
|
3050
|
-
q as naturalDateRegexp,
|
|
3051
|
-
ra as recentDateRegexp,
|
|
3052
|
-
se as transformDateToDayjs,
|
|
3053
|
-
ka as transformDateValueToDayjs,
|
|
3054
|
-
ce as useDatePickerProvider,
|
|
3055
|
-
Ya as useDatePickertInject
|
|
3107
|
+
Ta as DATE_PICKER_PROVIDER_KEY,
|
|
3108
|
+
Lt as DatePicker,
|
|
3109
|
+
qt as Dayjs,
|
|
3110
|
+
Ft as dayjs,
|
|
3111
|
+
Lt as default,
|
|
3112
|
+
ue as useDatePickerProvider,
|
|
3113
|
+
Va as useDatePickertInject
|
|
3056
3114
|
};
|