@alicloud/appflow-chat 0.0.4-beta.2 → 0.0.4-beta.3
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/appflow-chat.cjs.js +2032 -1
- package/dist/appflow-chat.esm.js +37871 -23
- package/package.json +1 -1
- package/src/components/HumanVerify/CustomParamsRenderer/TimeField.tsx +27 -82
- package/dist/dayjs.min-DWSn5QqA.js +0 -301
- package/dist/dayjs.min-QTCa-wyv.cjs +0 -1
- package/dist/index-CtMPAAIm.js +0 -37886
- package/dist/index-cl42IZ0C.cjs +0 -2033
- package/dist/moment-BOHN1eRP.js +0 -2578
- package/dist/moment-BdH06dpW.cjs +0 -10
package/package.json
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
import React, { useCallback, useMemo
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { DatePicker, version } from 'antd';
|
|
3
3
|
import { TimeFieldProps, TimeSubType } from './types';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
|
|
6
|
-
// ==================== Styled Components ====================
|
|
7
|
-
|
|
8
|
-
// 时间选择器容器
|
|
9
6
|
const TimeFieldContainer = styled.div`
|
|
10
7
|
width: 100%;
|
|
11
|
-
|
|
12
8
|
.ant-picker {
|
|
13
9
|
width: 100%;
|
|
14
10
|
}
|
|
15
11
|
`;
|
|
16
12
|
|
|
17
|
-
// ==================== 版本检测 ====================
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 检测 antd 版本是否为 5.x 或更高
|
|
21
|
-
* antd 5.x 使用 dayjs,antd 4.x 使用 moment
|
|
22
|
-
*/
|
|
23
13
|
const getAntdMajorVersion = (): number => {
|
|
24
14
|
try {
|
|
25
15
|
return parseInt(version.split('.')[0], 10);
|
|
26
16
|
} catch {
|
|
27
|
-
return 5;
|
|
17
|
+
return 5;
|
|
28
18
|
}
|
|
29
19
|
};
|
|
30
20
|
|
|
31
21
|
const isAntd5OrAbove = getAntdMajorVersion() >= 5;
|
|
32
22
|
|
|
33
|
-
//
|
|
23
|
+
// 同步加载时间库
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
let timeLib: any = null;
|
|
26
|
+
|
|
27
|
+
if (isAntd5OrAbove) {
|
|
28
|
+
try {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30
|
+
timeLib = require('dayjs');
|
|
31
|
+
} catch {
|
|
32
|
+
console.warn('dayjs not found');
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
try {
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
37
|
+
timeLib = require('moment');
|
|
38
|
+
} catch {
|
|
39
|
+
console.warn('moment not found');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
34
42
|
|
|
35
|
-
/**
|
|
36
|
-
* 根据时间子类型获取日期格式
|
|
37
|
-
*/
|
|
38
43
|
const getDateFormat = (subType?: TimeSubType): string => {
|
|
39
44
|
switch (subType) {
|
|
40
45
|
case 'year-month':
|
|
@@ -48,76 +53,21 @@ const getDateFormat = (subType?: TimeSubType): string => {
|
|
|
48
53
|
}
|
|
49
54
|
};
|
|
50
55
|
|
|
51
|
-
/**
|
|
52
|
-
* 根据时间子类型获取 picker 类型
|
|
53
|
-
*/
|
|
54
56
|
const getPickerType = (subType?: TimeSubType): 'date' | 'month' | undefined => {
|
|
55
57
|
switch (subType) {
|
|
56
58
|
case 'year-month':
|
|
57
59
|
return 'month';
|
|
58
|
-
case 'year-month-day':
|
|
59
|
-
case 'datetime':
|
|
60
60
|
default:
|
|
61
61
|
return 'date';
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
// ==================== 时间库加载器 ====================
|
|
66
|
-
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
-
type TimeLibrary = any;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* 异步加载时间库
|
|
72
|
-
* antd 5.x 使用 dayjs,antd 4.x 使用 moment
|
|
73
|
-
*/
|
|
74
|
-
const loadTimeLibrary = async (): Promise<TimeLibrary | null> => {
|
|
75
|
-
if (isAntd5OrAbove) {
|
|
76
|
-
try {
|
|
77
|
-
const dayjs = await import('dayjs');
|
|
78
|
-
return dayjs.default || dayjs;
|
|
79
|
-
} catch {
|
|
80
|
-
console.warn('dayjs not found, TimeField may not work correctly with antd 5.x');
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
try {
|
|
85
|
-
const moment = await import('moment');
|
|
86
|
-
return moment.default || moment;
|
|
87
|
-
} catch {
|
|
88
|
-
console.warn('moment not found, TimeField may not work correctly with antd 4.x');
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* 时间字段组件
|
|
96
|
-
* 根据 SubType 渲染不同的时间选择器
|
|
97
|
-
* 优先从 AssociationPropertyMetadata.SubType 读取,兼容旧的 TimeSubType 字段
|
|
98
|
-
*
|
|
99
|
-
* 兼容性说明:
|
|
100
|
-
* - antd 5.x: 使用 dayjs
|
|
101
|
-
* - antd 4.x: 使用 moment
|
|
102
|
-
*/
|
|
103
65
|
export const TimeField: React.FC<TimeFieldProps> = ({
|
|
104
66
|
schema,
|
|
105
67
|
value,
|
|
106
68
|
onChange,
|
|
107
69
|
disabled = false,
|
|
108
70
|
}) => {
|
|
109
|
-
// 时间库状态
|
|
110
|
-
const [timeLib, setTimeLib] = useState<TimeLibrary | null>(null);
|
|
111
|
-
|
|
112
|
-
// 异步加载时间库
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
loadTimeLibrary().then(lib => {
|
|
115
|
-
setTimeLib(lib);
|
|
116
|
-
});
|
|
117
|
-
}, []);
|
|
118
|
-
|
|
119
|
-
// 优先从 AssociationPropertyMetadata.SubType 读取,取数组第一个元素
|
|
120
|
-
// 兼容旧的 TimeSubType 字段
|
|
121
71
|
const subType = useMemo((): TimeSubType | undefined => {
|
|
122
72
|
const subTypeArray = schema.AssociationPropertyMetadata?.SubType;
|
|
123
73
|
if (Array.isArray(subTypeArray) && subTypeArray.length > 0) {
|
|
@@ -130,29 +80,24 @@ export const TimeField: React.FC<TimeFieldProps> = ({
|
|
|
130
80
|
const picker = getPickerType(subType);
|
|
131
81
|
const showTime = subType === 'datetime';
|
|
132
82
|
|
|
133
|
-
// 将字符串值转换为时间对象
|
|
83
|
+
// 将字符串值转换为时间对象 - 同步方式
|
|
134
84
|
const dateValue = useMemo(() => {
|
|
135
85
|
if (!value || !timeLib) return null;
|
|
136
86
|
|
|
137
87
|
try {
|
|
138
88
|
const parsed = timeLib(value, format);
|
|
139
|
-
// 检查解析是否有效
|
|
140
89
|
if (parsed && typeof parsed.isValid === 'function' && !parsed.isValid()) {
|
|
141
|
-
|
|
90
|
+
// 如果严格解析失败,尝试宽松解析
|
|
91
|
+
return timeLib(value);
|
|
142
92
|
}
|
|
143
93
|
return parsed;
|
|
144
94
|
} catch {
|
|
145
95
|
return null;
|
|
146
96
|
}
|
|
147
|
-
}, [value, format
|
|
97
|
+
}, [value, format]);
|
|
148
98
|
|
|
149
|
-
// 处理值变化
|
|
150
|
-
// antd DatePicker onChange 签名: (date: Moment | Dayjs | null, dateString: string) => void
|
|
151
99
|
const handleChange = useCallback(
|
|
152
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
100
|
(_date: any, dateString: string | string[]) => {
|
|
154
|
-
// 直接使用 antd 提供的 dateString,这是已经格式化好的字符串
|
|
155
|
-
// 这样可以避免手动调用 format 方法,更加可靠
|
|
156
101
|
const stringValue = Array.isArray(dateString) ? dateString[0] : dateString;
|
|
157
102
|
onChange?.(stringValue || null);
|
|
158
103
|
},
|
|
@@ -169,10 +114,10 @@ export const TimeField: React.FC<TimeFieldProps> = ({
|
|
|
169
114
|
showTime={showTime ? { format: 'HH:mm:ss' } : false}
|
|
170
115
|
disabled={disabled}
|
|
171
116
|
style={{ width: '100%' }}
|
|
172
|
-
placeholder=
|
|
117
|
+
placeholder="请选择"
|
|
173
118
|
/>
|
|
174
119
|
</TimeFieldContainer>
|
|
175
120
|
);
|
|
176
121
|
};
|
|
177
122
|
|
|
178
|
-
export default TimeField;
|
|
123
|
+
export default TimeField;
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import { g as R, c as X } from "./index-CtMPAAIm.js";
|
|
2
|
-
function tt(Y, F) {
|
|
3
|
-
for (var D = 0; D < F.length; D++) {
|
|
4
|
-
const m = F[D];
|
|
5
|
-
if (typeof m != "string" && !Array.isArray(m)) {
|
|
6
|
-
for (const M in m)
|
|
7
|
-
if (M !== "default" && !(M in Y)) {
|
|
8
|
-
const S = Object.getOwnPropertyDescriptor(m, M);
|
|
9
|
-
S && Object.defineProperty(Y, M, S.get ? S : {
|
|
10
|
-
enumerable: !0,
|
|
11
|
-
get: () => m[M]
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return Object.freeze(Object.defineProperty(Y, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
-
}
|
|
18
|
-
var V = { exports: {} };
|
|
19
|
-
(function(Y, F) {
|
|
20
|
-
(function(D, m) {
|
|
21
|
-
Y.exports = m();
|
|
22
|
-
})(X, function() {
|
|
23
|
-
var D = 1e3, m = 6e4, M = 36e5, S = "millisecond", b = "second", k = "minute", j = "hour", g = "day", L = "week", y = "month", J = "quarter", v = "year", x = "date", P = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, G = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, Q = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
|
|
24
|
-
var r = ["th", "st", "nd", "rd"], t = s % 100;
|
|
25
|
-
return "[" + s + (r[(t - 20) % 10] || r[t] || r[0]) + "]";
|
|
26
|
-
} }, U = function(s, r, t) {
|
|
27
|
-
var n = String(s);
|
|
28
|
-
return !n || n.length >= r ? s : "" + Array(r + 1 - n.length).join(t) + s;
|
|
29
|
-
}, K = { s: U, z: function(s) {
|
|
30
|
-
var r = -s.utcOffset(), t = Math.abs(r), n = Math.floor(t / 60), e = t % 60;
|
|
31
|
-
return (r <= 0 ? "+" : "-") + U(n, 2, "0") + ":" + U(e, 2, "0");
|
|
32
|
-
}, m: function s(r, t) {
|
|
33
|
-
if (r.date() < t.date()) return -s(t, r);
|
|
34
|
-
var n = 12 * (t.year() - r.year()) + (t.month() - r.month()), e = r.clone().add(n, y), i = t - e < 0, u = r.clone().add(n + (i ? -1 : 1), y);
|
|
35
|
-
return +(-(n + (t - e) / (i ? e - u : u - e)) || 0);
|
|
36
|
-
}, a: function(s) {
|
|
37
|
-
return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
|
|
38
|
-
}, p: function(s) {
|
|
39
|
-
return { M: y, y: v, w: L, d: g, D: x, h: j, m: k, s: b, ms: S, Q: J }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
|
40
|
-
}, u: function(s) {
|
|
41
|
-
return s === void 0;
|
|
42
|
-
} }, H = "en", w = {};
|
|
43
|
-
w[H] = Q;
|
|
44
|
-
var Z = "$isDayjsObject", z = function(s) {
|
|
45
|
-
return s instanceof I || !(!s || !s[Z]);
|
|
46
|
-
}, W = function s(r, t, n) {
|
|
47
|
-
var e;
|
|
48
|
-
if (!r) return H;
|
|
49
|
-
if (typeof r == "string") {
|
|
50
|
-
var i = r.toLowerCase();
|
|
51
|
-
w[i] && (e = i), t && (w[i] = t, e = i);
|
|
52
|
-
var u = r.split("-");
|
|
53
|
-
if (!e && u.length > 1) return s(u[0]);
|
|
54
|
-
} else {
|
|
55
|
-
var o = r.name;
|
|
56
|
-
w[o] = r, e = o;
|
|
57
|
-
}
|
|
58
|
-
return !n && e && (H = e), e || !n && H;
|
|
59
|
-
}, f = function(s, r) {
|
|
60
|
-
if (z(s)) return s.clone();
|
|
61
|
-
var t = typeof r == "object" ? r : {};
|
|
62
|
-
return t.date = s, t.args = arguments, new I(t);
|
|
63
|
-
}, a = K;
|
|
64
|
-
a.l = W, a.i = z, a.w = function(s, r) {
|
|
65
|
-
return f(s, { locale: r.$L, utc: r.$u, x: r.$x, $offset: r.$offset });
|
|
66
|
-
};
|
|
67
|
-
var I = function() {
|
|
68
|
-
function s(t) {
|
|
69
|
-
this.$L = W(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[Z] = !0;
|
|
70
|
-
}
|
|
71
|
-
var r = s.prototype;
|
|
72
|
-
return r.parse = function(t) {
|
|
73
|
-
this.$d = function(n) {
|
|
74
|
-
var e = n.date, i = n.utc;
|
|
75
|
-
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
76
|
-
if (a.u(e)) return /* @__PURE__ */ new Date();
|
|
77
|
-
if (e instanceof Date) return new Date(e);
|
|
78
|
-
if (typeof e == "string" && !/Z$/i.test(e)) {
|
|
79
|
-
var u = e.match(B);
|
|
80
|
-
if (u) {
|
|
81
|
-
var o = u[2] - 1 || 0, c = (u[7] || "0").substring(0, 3);
|
|
82
|
-
return i ? new Date(Date.UTC(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c)) : new Date(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return new Date(e);
|
|
86
|
-
}(t), this.init();
|
|
87
|
-
}, r.init = function() {
|
|
88
|
-
var t = this.$d;
|
|
89
|
-
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
90
|
-
}, r.$utils = function() {
|
|
91
|
-
return a;
|
|
92
|
-
}, r.isValid = function() {
|
|
93
|
-
return this.$d.toString() !== P;
|
|
94
|
-
}, r.isSame = function(t, n) {
|
|
95
|
-
var e = f(t);
|
|
96
|
-
return this.startOf(n) <= e && e <= this.endOf(n);
|
|
97
|
-
}, r.isAfter = function(t, n) {
|
|
98
|
-
return f(t) < this.startOf(n);
|
|
99
|
-
}, r.isBefore = function(t, n) {
|
|
100
|
-
return this.endOf(n) < f(t);
|
|
101
|
-
}, r.$g = function(t, n, e) {
|
|
102
|
-
return a.u(t) ? this[n] : this.set(e, t);
|
|
103
|
-
}, r.unix = function() {
|
|
104
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
105
|
-
}, r.valueOf = function() {
|
|
106
|
-
return this.$d.getTime();
|
|
107
|
-
}, r.startOf = function(t, n) {
|
|
108
|
-
var e = this, i = !!a.u(n) || n, u = a.p(t), o = function(O, l) {
|
|
109
|
-
var p = a.w(e.$u ? Date.UTC(e.$y, l, O) : new Date(e.$y, l, O), e);
|
|
110
|
-
return i ? p : p.endOf(g);
|
|
111
|
-
}, c = function(O, l) {
|
|
112
|
-
return a.w(e.toDate()[O].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(l)), e);
|
|
113
|
-
}, h = this.$W, d = this.$M, $ = this.$D, T = "set" + (this.$u ? "UTC" : "");
|
|
114
|
-
switch (u) {
|
|
115
|
-
case v:
|
|
116
|
-
return i ? o(1, 0) : o(31, 11);
|
|
117
|
-
case y:
|
|
118
|
-
return i ? o(1, d) : o(0, d + 1);
|
|
119
|
-
case L:
|
|
120
|
-
var _ = this.$locale().weekStart || 0, A = (h < _ ? h + 7 : h) - _;
|
|
121
|
-
return o(i ? $ - A : $ + (6 - A), d);
|
|
122
|
-
case g:
|
|
123
|
-
case x:
|
|
124
|
-
return c(T + "Hours", 0);
|
|
125
|
-
case j:
|
|
126
|
-
return c(T + "Minutes", 1);
|
|
127
|
-
case k:
|
|
128
|
-
return c(T + "Seconds", 2);
|
|
129
|
-
case b:
|
|
130
|
-
return c(T + "Milliseconds", 3);
|
|
131
|
-
default:
|
|
132
|
-
return this.clone();
|
|
133
|
-
}
|
|
134
|
-
}, r.endOf = function(t) {
|
|
135
|
-
return this.startOf(t, !1);
|
|
136
|
-
}, r.$set = function(t, n) {
|
|
137
|
-
var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[g] = u + "Date", e[x] = u + "Date", e[y] = u + "Month", e[v] = u + "FullYear", e[j] = u + "Hours", e[k] = u + "Minutes", e[b] = u + "Seconds", e[S] = u + "Milliseconds", e)[i], c = i === g ? this.$D + (n - this.$W) : n;
|
|
138
|
-
if (i === y || i === v) {
|
|
139
|
-
var h = this.clone().set(x, 1);
|
|
140
|
-
h.$d[o](c), h.init(), this.$d = h.set(x, Math.min(this.$D, h.daysInMonth())).$d;
|
|
141
|
-
} else o && this.$d[o](c);
|
|
142
|
-
return this.init(), this;
|
|
143
|
-
}, r.set = function(t, n) {
|
|
144
|
-
return this.clone().$set(t, n);
|
|
145
|
-
}, r.get = function(t) {
|
|
146
|
-
return this[a.p(t)]();
|
|
147
|
-
}, r.add = function(t, n) {
|
|
148
|
-
var e, i = this;
|
|
149
|
-
t = Number(t);
|
|
150
|
-
var u = a.p(n), o = function(d) {
|
|
151
|
-
var $ = f(i);
|
|
152
|
-
return a.w($.date($.date() + Math.round(d * t)), i);
|
|
153
|
-
};
|
|
154
|
-
if (u === y) return this.set(y, this.$M + t);
|
|
155
|
-
if (u === v) return this.set(v, this.$y + t);
|
|
156
|
-
if (u === g) return o(1);
|
|
157
|
-
if (u === L) return o(7);
|
|
158
|
-
var c = (e = {}, e[k] = m, e[j] = M, e[b] = D, e)[u] || 1, h = this.$d.getTime() + t * c;
|
|
159
|
-
return a.w(h, this);
|
|
160
|
-
}, r.subtract = function(t, n) {
|
|
161
|
-
return this.add(-1 * t, n);
|
|
162
|
-
}, r.format = function(t) {
|
|
163
|
-
var n = this, e = this.$locale();
|
|
164
|
-
if (!this.isValid()) return e.invalidDate || P;
|
|
165
|
-
var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, $ = e.months, T = e.meridiem, _ = function(l, p, C, N) {
|
|
166
|
-
return l && (l[p] || l(n, i)) || C[p].slice(0, N);
|
|
167
|
-
}, A = function(l) {
|
|
168
|
-
return a.s(o % 12 || 12, l, "0");
|
|
169
|
-
}, O = T || function(l, p, C) {
|
|
170
|
-
var N = l < 12 ? "AM" : "PM";
|
|
171
|
-
return C ? N.toLowerCase() : N;
|
|
172
|
-
};
|
|
173
|
-
return i.replace(G, function(l, p) {
|
|
174
|
-
return p || function(C) {
|
|
175
|
-
switch (C) {
|
|
176
|
-
case "YY":
|
|
177
|
-
return String(n.$y).slice(-2);
|
|
178
|
-
case "YYYY":
|
|
179
|
-
return a.s(n.$y, 4, "0");
|
|
180
|
-
case "M":
|
|
181
|
-
return h + 1;
|
|
182
|
-
case "MM":
|
|
183
|
-
return a.s(h + 1, 2, "0");
|
|
184
|
-
case "MMM":
|
|
185
|
-
return _(e.monthsShort, h, $, 3);
|
|
186
|
-
case "MMMM":
|
|
187
|
-
return _($, h);
|
|
188
|
-
case "D":
|
|
189
|
-
return n.$D;
|
|
190
|
-
case "DD":
|
|
191
|
-
return a.s(n.$D, 2, "0");
|
|
192
|
-
case "d":
|
|
193
|
-
return String(n.$W);
|
|
194
|
-
case "dd":
|
|
195
|
-
return _(e.weekdaysMin, n.$W, d, 2);
|
|
196
|
-
case "ddd":
|
|
197
|
-
return _(e.weekdaysShort, n.$W, d, 3);
|
|
198
|
-
case "dddd":
|
|
199
|
-
return d[n.$W];
|
|
200
|
-
case "H":
|
|
201
|
-
return String(o);
|
|
202
|
-
case "HH":
|
|
203
|
-
return a.s(o, 2, "0");
|
|
204
|
-
case "h":
|
|
205
|
-
return A(1);
|
|
206
|
-
case "hh":
|
|
207
|
-
return A(2);
|
|
208
|
-
case "a":
|
|
209
|
-
return O(o, c, !0);
|
|
210
|
-
case "A":
|
|
211
|
-
return O(o, c, !1);
|
|
212
|
-
case "m":
|
|
213
|
-
return String(c);
|
|
214
|
-
case "mm":
|
|
215
|
-
return a.s(c, 2, "0");
|
|
216
|
-
case "s":
|
|
217
|
-
return String(n.$s);
|
|
218
|
-
case "ss":
|
|
219
|
-
return a.s(n.$s, 2, "0");
|
|
220
|
-
case "SSS":
|
|
221
|
-
return a.s(n.$ms, 3, "0");
|
|
222
|
-
case "Z":
|
|
223
|
-
return u;
|
|
224
|
-
}
|
|
225
|
-
return null;
|
|
226
|
-
}(l) || u.replace(":", "");
|
|
227
|
-
});
|
|
228
|
-
}, r.utcOffset = function() {
|
|
229
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
230
|
-
}, r.diff = function(t, n, e) {
|
|
231
|
-
var i, u = this, o = a.p(n), c = f(t), h = (c.utcOffset() - this.utcOffset()) * m, d = this - c, $ = function() {
|
|
232
|
-
return a.m(u, c);
|
|
233
|
-
};
|
|
234
|
-
switch (o) {
|
|
235
|
-
case v:
|
|
236
|
-
i = $() / 12;
|
|
237
|
-
break;
|
|
238
|
-
case y:
|
|
239
|
-
i = $();
|
|
240
|
-
break;
|
|
241
|
-
case J:
|
|
242
|
-
i = $() / 3;
|
|
243
|
-
break;
|
|
244
|
-
case L:
|
|
245
|
-
i = (d - h) / 6048e5;
|
|
246
|
-
break;
|
|
247
|
-
case g:
|
|
248
|
-
i = (d - h) / 864e5;
|
|
249
|
-
break;
|
|
250
|
-
case j:
|
|
251
|
-
i = d / M;
|
|
252
|
-
break;
|
|
253
|
-
case k:
|
|
254
|
-
i = d / m;
|
|
255
|
-
break;
|
|
256
|
-
case b:
|
|
257
|
-
i = d / D;
|
|
258
|
-
break;
|
|
259
|
-
default:
|
|
260
|
-
i = d;
|
|
261
|
-
}
|
|
262
|
-
return e ? i : a.a(i);
|
|
263
|
-
}, r.daysInMonth = function() {
|
|
264
|
-
return this.endOf(y).$D;
|
|
265
|
-
}, r.$locale = function() {
|
|
266
|
-
return w[this.$L];
|
|
267
|
-
}, r.locale = function(t, n) {
|
|
268
|
-
if (!t) return this.$L;
|
|
269
|
-
var e = this.clone(), i = W(t, n, !0);
|
|
270
|
-
return i && (e.$L = i), e;
|
|
271
|
-
}, r.clone = function() {
|
|
272
|
-
return a.w(this.$d, this);
|
|
273
|
-
}, r.toDate = function() {
|
|
274
|
-
return new Date(this.valueOf());
|
|
275
|
-
}, r.toJSON = function() {
|
|
276
|
-
return this.isValid() ? this.toISOString() : null;
|
|
277
|
-
}, r.toISOString = function() {
|
|
278
|
-
return this.$d.toISOString();
|
|
279
|
-
}, r.toString = function() {
|
|
280
|
-
return this.$d.toUTCString();
|
|
281
|
-
}, s;
|
|
282
|
-
}(), E = I.prototype;
|
|
283
|
-
return f.prototype = E, [["$ms", S], ["$s", b], ["$m", k], ["$H", j], ["$W", g], ["$M", y], ["$y", v], ["$D", x]].forEach(function(s) {
|
|
284
|
-
E[s[1]] = function(r) {
|
|
285
|
-
return this.$g(r, s[0], s[1]);
|
|
286
|
-
};
|
|
287
|
-
}), f.extend = function(s, r) {
|
|
288
|
-
return s.$i || (s(r, I, f), s.$i = !0), f;
|
|
289
|
-
}, f.locale = W, f.isDayjs = z, f.unix = function(s) {
|
|
290
|
-
return f(1e3 * s);
|
|
291
|
-
}, f.en = w[H], f.Ls = w, f.p = {}, f;
|
|
292
|
-
});
|
|
293
|
-
})(V);
|
|
294
|
-
var q = V.exports;
|
|
295
|
-
const et = /* @__PURE__ */ R(q), nt = /* @__PURE__ */ tt({
|
|
296
|
-
__proto__: null,
|
|
297
|
-
default: et
|
|
298
|
-
}, [q]);
|
|
299
|
-
export {
|
|
300
|
-
nt as d
|
|
301
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const V=require("./index-cl42IZ0C.cjs");function X(Y,F){for(var D=0;D<F.length;D++){const m=F[D];if(typeof m!="string"&&!Array.isArray(m)){for(const M in m)if(M!=="default"&&!(M in Y)){const S=Object.getOwnPropertyDescriptor(m,M);S&&Object.defineProperty(Y,M,S.get?S:{enumerable:!0,get:()=>m[M]})}}}return Object.freeze(Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}))}var q={exports:{}};(function(Y,F){(function(D,m){Y.exports=m()})(V.commonjsGlobal,function(){var D=1e3,m=6e4,M=36e5,S="millisecond",b="second",j="minute",k="hour",g="day",L="week",y="month",J="quarter",v="year",x="date",P="Invalid Date",G=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,K={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},U=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},R={s:U,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+U(r,2,"0")+":"+U(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,y),i=t-e<0,u=n.clone().add(r+(i?-1:1),y);return+(-(r+(t-e)/(i?e-u:u-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:y,y:v,w:L,d:g,D:x,h:k,m:j,s:b,ms:S,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},H="en",_={};_[H]=K;var Z="$isDayjsObject",z=function(s){return s instanceof I||!(!s||!s[Z])},W=function s(n,t,r){var e;if(!n)return H;if(typeof n=="string"){var i=n.toLowerCase();_[i]&&(e=i),t&&(_[i]=t,e=i);var u=n.split("-");if(!e&&u.length>1)return s(u[0])}else{var o=n.name;_[o]=n,e=o}return!r&&e&&(H=e),e||!r&&H},f=function(s,n){if(z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new I(t)},a=R;a.l=W,a.i=z,a.w=function(s,n){return f(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var I=function(){function s(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[Z]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,i=r.utc;if(e===null)return new Date(NaN);if(a.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var u=e.match(G);if(u){var o=u[2]-1||0,c=(u[7]||"0").substring(0,3);return i?new Date(Date.UTC(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)):new Date(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return a},n.isValid=function(){return this.$d.toString()!==P},n.isSame=function(t,r){var e=f(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return f(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<f(t)},n.$g=function(t,r,e){return a.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,i=!!a.u(r)||r,u=a.p(t),o=function(O,l){var p=a.w(e.$u?Date.UTC(e.$y,l,O):new Date(e.$y,l,O),e);return i?p:p.endOf(g)},c=function(O,l){return a.w(e.toDate()[O].apply(e.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(l)),e)},h=this.$W,d=this.$M,$=this.$D,T="set"+(this.$u?"UTC":"");switch(u){case v:return i?o(1,0):o(31,11);case y:return i?o(1,d):o(0,d+1);case L:var w=this.$locale().weekStart||0,A=(h<w?h+7:h)-w;return o(i?$-A:$+(6-A),d);case g:case x:return c(T+"Hours",0);case k:return c(T+"Minutes",1);case j:return c(T+"Seconds",2);case b:return c(T+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,i=a.p(t),u="set"+(this.$u?"UTC":""),o=(e={},e[g]=u+"Date",e[x]=u+"Date",e[y]=u+"Month",e[v]=u+"FullYear",e[k]=u+"Hours",e[j]=u+"Minutes",e[b]=u+"Seconds",e[S]=u+"Milliseconds",e)[i],c=i===g?this.$D+(r-this.$W):r;if(i===y||i===v){var h=this.clone().set(x,1);h.$d[o](c),h.init(),this.$d=h.set(x,Math.min(this.$D,h.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[a.p(t)]()},n.add=function(t,r){var e,i=this;t=Number(t);var u=a.p(r),o=function(d){var $=f(i);return a.w($.date($.date()+Math.round(d*t)),i)};if(u===y)return this.set(y,this.$M+t);if(u===v)return this.set(v,this.$y+t);if(u===g)return o(1);if(u===L)return o(7);var c=(e={},e[j]=m,e[k]=M,e[b]=D,e)[u]||1,h=this.$d.getTime()+t*c;return a.w(h,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||P;var i=t||"YYYY-MM-DDTHH:mm:ssZ",u=a.z(this),o=this.$H,c=this.$m,h=this.$M,d=e.weekdays,$=e.months,T=e.meridiem,w=function(l,p,C,N){return l&&(l[p]||l(r,i))||C[p].slice(0,N)},A=function(l){return a.s(o%12||12,l,"0")},O=T||function(l,p,C){var N=l<12?"AM":"PM";return C?N.toLowerCase():N};return i.replace(Q,function(l,p){return p||function(C){switch(C){case"YY":return String(r.$y).slice(-2);case"YYYY":return a.s(r.$y,4,"0");case"M":return h+1;case"MM":return a.s(h+1,2,"0");case"MMM":return w(e.monthsShort,h,$,3);case"MMMM":return w($,h);case"D":return r.$D;case"DD":return a.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return w(e.weekdaysMin,r.$W,d,2);case"ddd":return w(e.weekdaysShort,r.$W,d,3);case"dddd":return d[r.$W];case"H":return String(o);case"HH":return a.s(o,2,"0");case"h":return A(1);case"hh":return A(2);case"a":return O(o,c,!0);case"A":return O(o,c,!1);case"m":return String(c);case"mm":return a.s(c,2,"0");case"s":return String(r.$s);case"ss":return a.s(r.$s,2,"0");case"SSS":return a.s(r.$ms,3,"0");case"Z":return u}return null}(l)||u.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var i,u=this,o=a.p(r),c=f(t),h=(c.utcOffset()-this.utcOffset())*m,d=this-c,$=function(){return a.m(u,c)};switch(o){case v:i=$()/12;break;case y:i=$();break;case J:i=$()/3;break;case L:i=(d-h)/6048e5;break;case g:i=(d-h)/864e5;break;case k:i=d/M;break;case j:i=d/m;break;case b:i=d/D;break;default:i=d}return e?i:a.a(i)},n.daysInMonth=function(){return this.endOf(y).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),i=W(t,r,!0);return i&&(e.$L=i),e},n.clone=function(){return a.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),E=I.prototype;return f.prototype=E,[["$ms",S],["$s",b],["$m",j],["$H",k],["$W",g],["$M",y],["$y",v],["$D",x]].forEach(function(s){E[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),f.extend=function(s,n){return s.$i||(s(n,I,f),s.$i=!0),f},f.locale=W,f.isDayjs=z,f.unix=function(s){return f(1e3*s)},f.en=_[H],f.Ls=_,f.p={},f})})(q);var B=q.exports;const tt=V.getDefaultExportFromCjs(B),et=X({__proto__:null,default:tt},[B]);exports.dayjs_min=et;
|