@unicom-cloud/ui 0.8.106 → 0.8.108
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/App.js +7 -0
- package/BackTop.js +2 -4
- package/Calendar.js +2 -2
- package/ColorPicker.js +15 -14
- package/Constant.js +4 -0
- package/Copy.js +4 -3
- package/Countdown.js +25 -0
- package/Grid.js +8 -10
- package/LiquidFill.js +4 -3
- package/List.js +7 -6
- package/Marquee.js +4 -3
- package/Modal.js +4 -2
- package/PageHeader.js +3 -2
- package/QrCode.js +4 -3
- package/RowCol.js +8 -0
- package/Segmented.js +14 -4
- package/Statistic.js +5 -4
- package/Tour.js +4 -3
- package/Transfer.js +4 -2
- package/anchor/Link.js +1 -1
- package/app/App.js +26 -0
- package/app/context.js +9 -0
- package/app/index.js +9 -0
- package/app/interface.js +1 -0
- package/app/useApp.js +8 -0
- package/avatar/Group.js +1 -1
- package/back-top/index.js +44 -56
- package/button/index.js +52 -51
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/cascader/base/node.js +22 -20
- package/cascader/base/store.js +10 -10
- package/cascader/util.js +29 -27
- package/color-picker/Mode.js +8 -7
- package/color-picker/hooks/useColorPicker.js +56 -55
- package/color-picker/index.js +49 -48
- package/color-picker/utils.js +58 -57
- package/components/common/empty/index.js +2 -2
- package/components/common/flex/index.js +64 -55
- package/components/common/flex/interface.js +6 -6
- package/components/common/hooks/useInterval.js +6 -6
- package/components/common/icons/file/index.js +13 -11
- package/components/common/space/index.js +53 -53
- package/components/common/utils/dayjs.js +114 -126
- package/components/common/utils/is.js +98 -104
- package/components/common/utils/setDir.js +12 -0
- package/components/common/utils/setTheme.js +13 -13
- package/components/common/utils/toArray.js +7 -5
- package/config-provider/ConfigProvider.js +32 -30
- package/constant/index.js +4 -0
- package/copy/index.js +2 -1
- package/countdown/index.js +113 -0
- package/countdown/interface.js +1 -0
- package/countdown/util.js +29 -0
- package/descriptions/index.js +45 -45
- package/divider/index.js +28 -20
- package/dropdown/Button.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +30 -29
- package/form/FormItem.js +126 -122
- package/grid/Grid.js +56 -90
- package/grid/Item.js +44 -65
- package/grid/context.js +2 -6
- package/grid/index.js +6 -8
- package/grid/util.js +6 -44
- package/hooks/useResponsiveState.js +54 -0
- package/index.js +614 -605
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/InputElement.js +25 -24
- package/input/Search.js +24 -24
- package/layout/Sider.js +1 -1
- package/liquid-fill/index.js +4 -3
- package/list/Item.js +21 -21
- package/list/index.js +53 -52
- package/marquee/index.js +20 -19
- package/marquee-/index.js +4 -3
- package/mentions/util.js +9 -8
- package/modal/Confirm.js +17 -17
- package/modal/Modal.js +247 -237
- package/modal/index.js +4 -2
- package/modal/use-modal/index.js +2 -2
- package/package.json +1 -1
- package/page-header/index.js +57 -56
- package/pagination/Pagination.js +89 -92
- package/qr-code/index.js +4 -3
- package/radio/Group.js +1 -1
- package/row-col/Col-.js +88 -0
- package/row-col/Col.js +159 -0
- package/row-col/Row.js +73 -0
- package/row-col/context.js +5 -0
- package/row-col/index.js +11 -0
- package/row-col/interface.js +1 -0
- package/segmented/index.js +257 -206
- package/select/Select.js +191 -191
- package/select/util.js +50 -50
- package/select-view/Core.js +31 -28
- package/space/index.js +15 -13
- package/splitter/SplitBar.js +44 -46
- package/statistic/index.js +56 -55
- package/statistic/interface.js +4 -1
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/hook/useColumns.js +27 -26
- package/table/hook/useStickyClassNames.js +9 -8
- package/table/hook/useThResizable.js +4 -3
- package/table/th-resizable/index.js +2 -2
- package/table/thead/index.js +18 -16
- package/time-picker/util.js +20 -30
- package/timeline/Item.js +1 -1
- package/tour/index.js +4 -3
- package/transfer/index.js +93 -91
- package/trigger/index.js +66 -66
- package/types/common/development/interface.d.ts +3 -3
- package/types/common/flex/index.d.ts +3 -9
- package/types/common/flex/interface.d.ts +15 -4
- package/types/common/space/index.d.ts +3 -5
- package/types/common/space/interface.d.ts +2 -0
- package/types/common/utils/dayjs.d.ts +3 -1
- package/types/common/utils/is.d.ts +3 -4
- package/types/common/utils/setDir.d.ts +2 -0
- package/types/pc/app/App.d.ts +6 -0
- package/types/pc/app/context.d.ts +4 -0
- package/types/pc/app/index.d.ts +5 -0
- package/types/pc/app/interface.d.ts +17 -0
- package/types/pc/app/useApp.d.ts +3 -0
- package/types/pc/back-top/interface.d.ts +4 -17
- package/types/pc/button/interface.d.ts +2 -2
- package/types/pc/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +17 -12
- package/types/pc/constant/index.d.ts +1 -0
- package/types/pc/countdown/interface.d.ts +65 -0
- package/types/pc/countdown/util.d.ts +7 -0
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/flex/index.d.ts +8 -6
- package/types/pc/flex/interface.d.ts +3 -10
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/form/interface.d.ts +1 -1
- package/types/pc/grid/Grid.d.ts +2 -4
- package/types/pc/grid/Item.d.ts +1 -5
- package/types/pc/grid/context.d.ts +4 -15
- package/types/pc/grid/index.d.ts +4 -6
- package/types/pc/grid/interface.d.ts +14 -142
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/hooks/useResponsiveState.d.ts +3 -0
- package/types/pc/index.d.ts +10 -4
- package/types/pc/input/Button.d.ts +2 -2
- package/types/pc/list/interface.d.ts +2 -1
- package/types/pc/message/index.d.ts +1 -9
- package/types/pc/message/interface.d.ts +8 -0
- package/types/pc/message/useMessage.d.ts +1 -2
- package/types/pc/modal/Modal.d.ts +1 -0
- package/types/pc/modal/config.d.ts +1 -2
- package/types/pc/modal/index.d.ts +2 -1
- package/types/pc/modal/interface.d.ts +17 -5
- package/types/pc/notification/index.d.ts +2 -9
- package/types/pc/notification/interface.d.ts +7 -0
- package/types/pc/notification/useNotification.d.ts +1 -2
- package/types/pc/pagination/PageOption.d.ts +0 -1
- package/types/pc/pagination/interface.d.ts +5 -6
- package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
- package/types/pc/{grid → row-col}/Col.d.ts +1 -2
- package/types/pc/{grid → row-col}/Row.d.ts +1 -2
- package/types/pc/row-col/context.d.ts +6 -0
- package/types/pc/row-col/index.d.ts +7 -0
- package/types/pc/row-col/interface.d.ts +112 -0
- package/types/pc/segmented/index.d.ts +3 -7
- package/types/pc/segmented/interface.d.ts +38 -5
- package/types/pc/select-view/Core.d.ts +1 -8
- package/types/pc/select-view/index.d.ts +1 -8
- package/types/pc/select-view/interface.d.ts +9 -2
- package/types/pc/space/index.d.ts +5 -7
- package/types/pc/space/interface.d.ts +3 -10
- package/types/pc/statistic/index.d.ts +1 -1
- package/types/pc/statistic/interface.d.ts +1 -49
- package/types/pc/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +422 -111
- package/types/pc/utils/responsiveObserve.d.ts +8 -8
- package/typography/Ellipsis.js +5 -4
- package/typography/Operations.js +4 -3
- package/utils/dayjs.js +13 -11
- package/utils/index.js +245 -244
- package/utils/is.js +65 -66
- package/utils/names.js +309 -150
- package/utils/responsiveObserve.js +43 -36
- package/version/index.js +1 -1
- package/grid/Col-.js +0 -86
- package/grid/Col.js +0 -169
- package/grid/Row.js +0 -96
- package/grid/hook/useResponsiveState.js +0 -38
- package/statistic/Countdown.js +0 -56
- package/statistic/util.js +0 -33
- package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
- package/types/pc/statistic/util.d.ts +0 -1
- /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useRef as l, useEffect as s } from "react";
|
|
2
|
-
function
|
|
2
|
+
function f(t, e) {
|
|
3
3
|
const r = l(null), n = l(), u = () => {
|
|
4
|
-
e !== null && (r.current = setInterval(() => {
|
|
4
|
+
e !== null && (r.current = window.setInterval(() => {
|
|
5
5
|
n.current();
|
|
6
6
|
}, e));
|
|
7
7
|
}, c = () => {
|
|
8
|
-
r.current && clearInterval(r.current);
|
|
9
|
-
},
|
|
8
|
+
r.current && window.clearInterval(r.current);
|
|
9
|
+
}, o = () => {
|
|
10
10
|
c(), u();
|
|
11
11
|
};
|
|
12
12
|
return s(() => {
|
|
13
13
|
n.current = t;
|
|
14
|
-
}, [t]), s(() => (u(), c), [e]),
|
|
14
|
+
}, [t]), s(() => (u(), c), [e]), o;
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
f as default
|
|
18
18
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { UI_COMMON_PREFIX as d } from "@unicom-cloud/utils/constant/ui";
|
|
3
3
|
import { forwardRef as f } from "react";
|
|
4
4
|
import p from "@unicom-cloud/utils/class-name";
|
|
5
|
-
function x(
|
|
6
|
-
const { style: o, className:
|
|
7
|
-
return /* @__PURE__ */
|
|
5
|
+
function x(s, t) {
|
|
6
|
+
const { style: o, className: c, backgroundColor: a, color: i, text: r, ...m } = s, l = `${d}-icons-file`;
|
|
7
|
+
return /* @__PURE__ */ e("div", { className: p(l, c), children: /* @__PURE__ */ n(
|
|
8
8
|
"svg",
|
|
9
9
|
{
|
|
10
|
-
ref:
|
|
10
|
+
ref: t,
|
|
11
11
|
className: `${l}-svg`,
|
|
12
12
|
style: o,
|
|
13
13
|
...m,
|
|
@@ -16,7 +16,7 @@ function x(e, c) {
|
|
|
16
16
|
viewBox: "0 0 166 200",
|
|
17
17
|
version: "1.1",
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ e(
|
|
20
20
|
"path",
|
|
21
21
|
{
|
|
22
22
|
className: `${l}-svg-bg`,
|
|
@@ -26,23 +26,25 @@ function x(e, c) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
),
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
30
|
"path",
|
|
31
31
|
{
|
|
32
32
|
className: `${l}-svg-tr`,
|
|
33
33
|
d: "M165.174,55.97l-46.193,0c-5.379,-0.13 -9.768,-4.505 -9.904,-9.872l0,-46.098l56.088,55.97l0.009,0Z"
|
|
34
34
|
}
|
|
35
35
|
),
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ e(
|
|
37
37
|
"text",
|
|
38
38
|
{
|
|
39
39
|
className: `${l}-svg-text`,
|
|
40
|
-
x: "
|
|
40
|
+
x: "50%",
|
|
41
41
|
y: "142.967px",
|
|
42
|
+
textAnchor: "middle",
|
|
43
|
+
dominantBaseline: "middle",
|
|
42
44
|
style: {
|
|
43
|
-
fill:
|
|
45
|
+
fill: i
|
|
44
46
|
},
|
|
45
|
-
children:
|
|
47
|
+
children: r ?? "doc"
|
|
46
48
|
}
|
|
47
49
|
)
|
|
48
50
|
]
|
|
@@ -1,53 +1,49 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { UI_COMMON_PREFIX as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
small: 8,
|
|
12
|
-
medium: 16,
|
|
13
|
-
large: 24
|
|
14
|
-
}, U = {
|
|
1
|
+
import { jsx as s, jsxs as M } from "react/jsx-runtime";
|
|
2
|
+
import { UI_COMMON_PREFIX as _ } from "@unicom-cloud/utils/constant/ui";
|
|
3
|
+
import b from "lodash/isArray";
|
|
4
|
+
import O from "lodash/isNumber";
|
|
5
|
+
import { forwardRef as d, Fragment as R } from "react";
|
|
6
|
+
import { GAP_SIZE_MAP as f } from "../flex/interface.js";
|
|
7
|
+
import k from "../hooks/useMergeProps.js";
|
|
8
|
+
import E from "@unicom-cloud/utils/class-name";
|
|
9
|
+
import { toArray as F } from "../utils/toArray.js";
|
|
10
|
+
const L = {
|
|
15
11
|
size: "small",
|
|
16
12
|
direction: "horizontal"
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
className:
|
|
21
|
-
style:
|
|
22
|
-
children:
|
|
23
|
-
gap:
|
|
24
|
-
size:
|
|
25
|
-
direction:
|
|
26
|
-
align:
|
|
27
|
-
alignItems:
|
|
28
|
-
justifyContent:
|
|
29
|
-
wrap:
|
|
30
|
-
split:
|
|
31
|
-
rtl:
|
|
32
|
-
...
|
|
33
|
-
} =
|
|
13
|
+
}, l = d(
|
|
14
|
+
(a, n) => {
|
|
15
|
+
const g = k(a, L, {}), {
|
|
16
|
+
className: y,
|
|
17
|
+
style: N,
|
|
18
|
+
children: S,
|
|
19
|
+
gap: h,
|
|
20
|
+
size: G,
|
|
21
|
+
direction: i = "horizontal",
|
|
22
|
+
align: w,
|
|
23
|
+
alignItems: x,
|
|
24
|
+
justifyContent: p,
|
|
25
|
+
wrap: P,
|
|
26
|
+
split: m,
|
|
27
|
+
rtl: V,
|
|
28
|
+
...j
|
|
29
|
+
} = g, t = `${_}-space`, r = h ?? G, u = x ?? w ?? (i === "horizontal" ? "center" : ""), z = E(
|
|
34
30
|
t,
|
|
35
31
|
{
|
|
36
|
-
[`${t}-${
|
|
37
|
-
[`${t}-justify-content-${
|
|
38
|
-
[`${t}-align-items-${
|
|
39
|
-
[`${t}-rtl`]:
|
|
32
|
+
[`${t}-${i}`]: i,
|
|
33
|
+
[`${t}-justify-content-${p}`]: p,
|
|
34
|
+
[`${t}-align-items-${u}`]: u,
|
|
35
|
+
[`${t}-rtl`]: V
|
|
40
36
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
),
|
|
37
|
+
P ? `${t}-wrap` : `${t}-no-wrap`,
|
|
38
|
+
y
|
|
39
|
+
), c = (e) => O(e) ? e : f[e] ?? f.small, A = {
|
|
44
40
|
...(() => {
|
|
45
41
|
if (typeof r == "string" || typeof r == "number")
|
|
46
42
|
return {
|
|
47
|
-
gap: `${
|
|
43
|
+
gap: `${c(r)}px`
|
|
48
44
|
};
|
|
49
|
-
if (
|
|
50
|
-
const e =
|
|
45
|
+
if (b(r)) {
|
|
46
|
+
const e = c(r[1]), o = c(r[0]);
|
|
51
47
|
return {
|
|
52
48
|
rowGap: `${e}px`,
|
|
53
49
|
columnGap: `${o}px`
|
|
@@ -55,22 +51,26 @@ const u = {
|
|
|
55
51
|
}
|
|
56
52
|
return {};
|
|
57
53
|
})(),
|
|
58
|
-
...
|
|
59
|
-
}, v =
|
|
60
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
61
|
-
const
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
|
|
54
|
+
...N
|
|
55
|
+
}, v = F(S);
|
|
56
|
+
return /* @__PURE__ */ s("div", { ref: n, className: z, style: A, ...j, children: v.map((e, o) => {
|
|
57
|
+
const C = e?.key ?? o, I = m != null && o > 0;
|
|
58
|
+
return /* @__PURE__ */ M(R, { children: [
|
|
59
|
+
I && /* @__PURE__ */ s("div", { className: `${t}-item-split`, children: m }),
|
|
64
60
|
/* @__PURE__ */ s("div", { className: `${t}-item`, children: e })
|
|
65
|
-
] },
|
|
61
|
+
] }, C);
|
|
66
62
|
}) });
|
|
67
63
|
}
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
);
|
|
65
|
+
l.displayName = "Space";
|
|
66
|
+
const $ = d(
|
|
67
|
+
(a, n) => /* @__PURE__ */ s(l, { ...a, ref: n, direction: "vertical" })
|
|
68
|
+
);
|
|
69
|
+
$.displayName = "SpaceVertical";
|
|
70
|
+
const T = Object.assign(l, {
|
|
71
|
+
Vertical: $
|
|
71
72
|
});
|
|
72
|
-
g.displayName = "Space.Vertical";
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
$ as SpaceVertical,
|
|
75
75
|
T as default
|
|
76
76
|
};
|
|
@@ -1,76 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
const r = e.prototype, s = r.$utils;
|
|
23
|
-
r.$utils = function() {
|
|
24
|
-
const o = s();
|
|
25
|
-
return o.i = l, o;
|
|
26
|
-
}, n.isDayjs = l;
|
|
27
|
-
};
|
|
28
|
-
a.extend(C);
|
|
29
|
-
a.extend(b);
|
|
30
|
-
a.extend(v);
|
|
31
|
-
a.extend(W);
|
|
32
|
-
a.extend($);
|
|
33
|
-
a.extend(U);
|
|
34
|
-
a.extend(F);
|
|
35
|
-
a.extend(A);
|
|
36
|
-
a.extend(Y);
|
|
37
|
-
const f = a;
|
|
38
|
-
function T(t, e) {
|
|
39
|
-
const n = (t.day() - e + 7) % 7;
|
|
40
|
-
return t.clone().startOf("day").subtract(n, "day").valueOf();
|
|
41
|
-
}
|
|
42
|
-
function H(t, e, n) {
|
|
43
|
-
return T(t, n) === T(e, n);
|
|
44
|
-
}
|
|
45
|
-
const h = {
|
|
1
|
+
import i, { isDayjs as p } from "dayjs";
|
|
2
|
+
import v from "dayjs/plugin/advancedFormat";
|
|
3
|
+
import j from "dayjs/plugin/customParseFormat";
|
|
4
|
+
import M from "dayjs/plugin/isBetween";
|
|
5
|
+
import k from "dayjs/plugin/quarterOfYear";
|
|
6
|
+
import A from "dayjs/plugin/timezone";
|
|
7
|
+
import H from "dayjs/plugin/utc";
|
|
8
|
+
import S from "dayjs/plugin/weekOfYear";
|
|
9
|
+
import $ from "dayjs/plugin/weekYear";
|
|
10
|
+
import "./is.js";
|
|
11
|
+
import { isArray as d, isUndefined as m } from "@unicom-cloud/utils/is";
|
|
12
|
+
i.extend(j);
|
|
13
|
+
i.extend(M);
|
|
14
|
+
i.extend(S);
|
|
15
|
+
i.extend(v);
|
|
16
|
+
i.extend($);
|
|
17
|
+
i.extend(k);
|
|
18
|
+
i.extend(H);
|
|
19
|
+
i.extend(A);
|
|
20
|
+
const s = i, y = {
|
|
46
21
|
add(t, e, n) {
|
|
47
|
-
return
|
|
22
|
+
return t.add(e, n);
|
|
48
23
|
},
|
|
49
24
|
subtract(t, e, n) {
|
|
50
|
-
return
|
|
25
|
+
return t.subtract(e, n);
|
|
51
26
|
},
|
|
52
27
|
startOf(t, e) {
|
|
53
|
-
return
|
|
28
|
+
return t.startOf(e);
|
|
54
29
|
},
|
|
55
30
|
endOf(t, e) {
|
|
56
|
-
return
|
|
31
|
+
return t.endOf(e);
|
|
57
32
|
},
|
|
58
33
|
set(t, e, n) {
|
|
59
|
-
return
|
|
34
|
+
return t.set(e, n);
|
|
60
35
|
},
|
|
61
36
|
isSameWeek(t, e, n, r) {
|
|
62
|
-
return
|
|
37
|
+
return t.locale({ ...s.Ls[r], weekStart: n }).isSame(e, "week");
|
|
63
38
|
}
|
|
64
|
-
},
|
|
39
|
+
}, C = {
|
|
65
40
|
year: 0,
|
|
66
41
|
month: 1,
|
|
67
42
|
day: 2,
|
|
68
43
|
hour: 3,
|
|
69
44
|
minute: 4,
|
|
70
45
|
second: 5
|
|
71
|
-
},
|
|
46
|
+
}, x = {}, P = (t, e) => {
|
|
72
47
|
const n = `${t}|short`;
|
|
73
|
-
let r =
|
|
48
|
+
let r = x[n];
|
|
74
49
|
return r || (r = new Intl.DateTimeFormat("en-US", {
|
|
75
50
|
hour12: !1,
|
|
76
51
|
timeZone: t,
|
|
@@ -80,114 +55,127 @@ const h = {
|
|
|
80
55
|
hour: "2-digit",
|
|
81
56
|
minute: "2-digit",
|
|
82
57
|
second: "2-digit"
|
|
83
|
-
}),
|
|
84
|
-
},
|
|
58
|
+
}), x[n] = r), r;
|
|
59
|
+
}, b = (t, e) => {
|
|
85
60
|
const n = new Date(t);
|
|
86
|
-
return
|
|
87
|
-
},
|
|
88
|
-
const n =
|
|
89
|
-
for (let
|
|
90
|
-
const { type:
|
|
91
|
-
|
|
61
|
+
return P(e).formatToParts(n);
|
|
62
|
+
}, g = (t, e) => {
|
|
63
|
+
const n = b(t, e), r = [];
|
|
64
|
+
for (let c = 0; c < n.length; c += 1) {
|
|
65
|
+
const { type: O, value: F } = n[c], T = C[O];
|
|
66
|
+
T >= 0 && (r[T] = parseInt(F, 10));
|
|
92
67
|
}
|
|
93
|
-
const
|
|
68
|
+
const o = r[3], f = o === 24 ? 0 : o, u = Date.UTC(
|
|
94
69
|
r[0],
|
|
95
70
|
r[1] - 1,
|
|
96
71
|
r[2],
|
|
97
|
-
|
|
72
|
+
f,
|
|
98
73
|
r[4],
|
|
99
74
|
r[5],
|
|
100
75
|
0
|
|
101
76
|
);
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
return
|
|
105
|
-
},
|
|
77
|
+
let a = +t;
|
|
78
|
+
const l = a % 1e3;
|
|
79
|
+
return a -= l, (u - a) / (60 * 1e3);
|
|
80
|
+
}, U = (t, e, n) => {
|
|
106
81
|
let r = t - e * 60 * 1e3;
|
|
107
|
-
const
|
|
108
|
-
if (e ===
|
|
82
|
+
const o = g(r, n);
|
|
83
|
+
if (e === o)
|
|
109
84
|
return [r, e];
|
|
110
|
-
r -= (
|
|
111
|
-
const
|
|
112
|
-
return
|
|
85
|
+
r -= (o - e) * 60 * 1e3;
|
|
86
|
+
const f = g(r, n);
|
|
87
|
+
return o === f ? [r, o] : [t - Math.min(o, f) * 60 * 1e3, Math.max(o, f)];
|
|
113
88
|
};
|
|
114
|
-
function
|
|
115
|
-
const n =
|
|
116
|
-
return
|
|
89
|
+
function Y(t, e) {
|
|
90
|
+
const n = g(t, e);
|
|
91
|
+
return U(t, n, e)[1];
|
|
117
92
|
}
|
|
118
|
-
function
|
|
119
|
-
return
|
|
93
|
+
function K(t, e) {
|
|
94
|
+
return m(t) && !e ? s() : D(s(), t, e);
|
|
120
95
|
}
|
|
121
|
-
function
|
|
122
|
-
if (!t ||
|
|
96
|
+
function D(t, e, n, r) {
|
|
97
|
+
if (!t || m(e) && !n)
|
|
123
98
|
return t;
|
|
124
|
-
const
|
|
125
|
-
return
|
|
99
|
+
const o = -t.toDate().getTimezoneOffset(), f = m(e) ? n ? Y(t.valueOf(), n) : o : e, u = Math.abs(f) <= 16 ? f * 60 : f, a = r ? o - u : u - o, l = n ? Y(s(t).valueOf() + a * 60 * 1e3, n) : f, c = a - (f - l), O = r || !m(e) ? a : c;
|
|
100
|
+
return s(s(t).valueOf() + O * 60 * 1e3);
|
|
126
101
|
}
|
|
127
|
-
function
|
|
128
|
-
return
|
|
102
|
+
function X(t, e, n) {
|
|
103
|
+
return D(t, e, n, !0);
|
|
129
104
|
}
|
|
130
|
-
function
|
|
105
|
+
function _(t) {
|
|
131
106
|
const e = ["H", "h", "m", "s", "A", "a"];
|
|
132
107
|
let n = "";
|
|
133
108
|
return e.some((r) => t.indexOf(r) !== -1 ? (n = `${r}${t.split(` ${r}`)[1]}`, !0) : !1), n || "HH:mm:ss";
|
|
134
109
|
}
|
|
135
|
-
function
|
|
136
|
-
if (
|
|
137
|
-
return
|
|
110
|
+
function I(t, e = "YYYY-MM-DD HH:mm:ss") {
|
|
111
|
+
if (p(t))
|
|
112
|
+
return s(t.valueOf());
|
|
138
113
|
if (typeof t == "string") {
|
|
139
|
-
const n =
|
|
140
|
-
return n.isValid() ? n :
|
|
114
|
+
const n = s(t, e);
|
|
115
|
+
return n.isValid() ? n : s(t, "YYYY-MM-DD");
|
|
141
116
|
}
|
|
142
|
-
return
|
|
117
|
+
return s(t);
|
|
143
118
|
}
|
|
144
|
-
function
|
|
145
|
-
let
|
|
146
|
-
return (n !== void 0 || r) && (
|
|
119
|
+
function w(t, e, n, r) {
|
|
120
|
+
let o = I(t, e);
|
|
121
|
+
return (n !== void 0 || r) && (o = D(o, n, r)), o;
|
|
147
122
|
}
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
123
|
+
function z(t, e, n, r) {
|
|
124
|
+
if (t)
|
|
125
|
+
return d(t) ? t.map((o, f, u) => {
|
|
126
|
+
if (o)
|
|
127
|
+
return w(
|
|
128
|
+
o,
|
|
129
|
+
h(e, f),
|
|
130
|
+
n,
|
|
131
|
+
r
|
|
132
|
+
);
|
|
133
|
+
}) : w(t, h(e, 0), n, r);
|
|
155
134
|
}
|
|
156
|
-
function
|
|
157
|
-
const n = t
|
|
135
|
+
function h(t = [], e = 0) {
|
|
136
|
+
const n = d(t) ? t : [t];
|
|
137
|
+
let r = n[e];
|
|
138
|
+
for (; !r && n.length > 0 && e > 0; )
|
|
139
|
+
r = n[--e];
|
|
140
|
+
return r;
|
|
141
|
+
}
|
|
142
|
+
function V(t, e) {
|
|
143
|
+
const n = t.year(), r = t.month(), o = t.date();
|
|
158
144
|
if (e) {
|
|
159
|
-
let
|
|
160
|
-
return
|
|
145
|
+
let f = e;
|
|
146
|
+
return f = y.set(f, "year", n), f = y.set(f, "month", r), f = y.set(f, "date", o), f;
|
|
161
147
|
}
|
|
162
148
|
return t;
|
|
163
149
|
}
|
|
164
|
-
function
|
|
150
|
+
function tt(t) {
|
|
165
151
|
if (!d(t) || !(t[0] && t[1]) || !(t[0].valueOf() > t[1].valueOf())) return t;
|
|
166
152
|
const e = [...t];
|
|
167
153
|
return e.sort((n, r) => n.valueOf() - r.valueOf()), e;
|
|
168
154
|
}
|
|
169
|
-
function
|
|
170
|
-
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t ||
|
|
155
|
+
function et(t, e) {
|
|
156
|
+
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || s(e).valueOf() !== s(t).valueOf();
|
|
171
157
|
}
|
|
172
|
-
function
|
|
173
|
-
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || d(e) && d(t) &&
|
|
158
|
+
function nt(t, e) {
|
|
159
|
+
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || d(e) && d(t) && s(e[0]).valueOf() !== s(t[0]).valueOf() || s(e?.[1]).valueOf() !== s(t?.[1]).valueOf();
|
|
174
160
|
}
|
|
175
|
-
function
|
|
176
|
-
return typeof t == "string" &&
|
|
161
|
+
function rt(t, e, n) {
|
|
162
|
+
return typeof t == "string" && s(t, e).format(h(e, n ?? 0)) === t;
|
|
177
163
|
}
|
|
178
164
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
z as
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
165
|
+
s as dayjs,
|
|
166
|
+
s as default,
|
|
167
|
+
I as formatValue,
|
|
168
|
+
z as getDayjsValue,
|
|
169
|
+
K as getNow,
|
|
170
|
+
w as getRealTime,
|
|
171
|
+
tt as getSortedDayjsArray,
|
|
172
|
+
_ as getTimeFormat,
|
|
173
|
+
V as getValueWithTime,
|
|
174
|
+
nt as isDayjsArrayChange,
|
|
175
|
+
et as isDayjsChange,
|
|
176
|
+
rt as isValidTimeString,
|
|
177
|
+
y as methods,
|
|
178
|
+
Y as timezoneToOffset,
|
|
179
|
+
X as toLocal,
|
|
180
|
+
D as toTimezone
|
|
193
181
|
};
|