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