@unicom-cloud/ui 0.8.105 → 0.8.107
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/Modal.js +4 -2
- package/Segmented.js +4 -2
- 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/back-top/index.js +44 -56
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/color-picker/index.js +34 -34
- package/components/common/flex/index.js +4 -4
- package/components/common/icons/file/index.js +13 -11
- package/components/common/utils/dayjs.js +99 -124
- 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/config-provider/ConfigProvider.js +32 -30
- package/descriptions/index.js +32 -32
- package/divider/index.js +28 -20
- package/empty/index.js +1 -1
- package/grid/Grid.js +55 -88
- package/grid/Item.js +40 -61
- package/grid/context.js +1 -4
- package/grid/hook/useResponsiveState.js +22 -25
- package/grid/util.js +6 -44
- package/index.js +462 -457
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/Search.js +24 -24
- 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/segmented/index.js +93 -90
- package/select-view/Core.js +31 -28
- package/splitter/SplitBar.js +44 -46
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/th-resizable/index.js +9 -10
- package/time-picker/util.js +20 -30
- package/types/common/development/interface.d.ts +3 -3
- 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/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +1 -1
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/grid/Grid.d.ts +1 -2
- package/types/pc/grid/Item.d.ts +2 -5
- package/types/pc/grid/context.d.ts +4 -10
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +9 -19
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/index.d.ts +3 -1
- package/types/pc/input/Button.d.ts +2 -2
- 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/segmented/interface.d.ts +6 -0
- 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/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +303 -0
- package/utils/index.js +58 -59
- package/utils/is.js +65 -66
- package/utils/names.js +298 -144
- package/version/index.js +1 -1
package/splitter/SplitBar.js
CHANGED
|
@@ -3,68 +3,66 @@ import H from "@unicom-cloud/icons/IconUiDown";
|
|
|
3
3
|
import J from "@unicom-cloud/icons/IconUiLeft";
|
|
4
4
|
import K from "@unicom-cloud/icons/IconUiRight";
|
|
5
5
|
import Q from "@unicom-cloud/icons/IconUiUp";
|
|
6
|
-
import
|
|
6
|
+
import { useContext as W, useState as X, useEffect as Z } from "react";
|
|
7
7
|
import "../config-provider/ConfigProvider.js";
|
|
8
8
|
import f from "@unicom-cloud/utils/class-name";
|
|
9
9
|
import Y from "./hooks/useEvent.js";
|
|
10
|
-
import
|
|
11
|
-
function
|
|
10
|
+
import _ from "../config-provider/context.js";
|
|
11
|
+
function b(d) {
|
|
12
12
|
return typeof d == "number" && !Number.isNaN(d) ? Math.round(d) : 0;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
const { getPrefixCls: y } =
|
|
14
|
+
const fe = (d) => {
|
|
15
|
+
const { getPrefixCls: y } = W(_), {
|
|
16
16
|
prefixCls: I,
|
|
17
17
|
vertical: s,
|
|
18
18
|
index: n,
|
|
19
19
|
active: z,
|
|
20
|
-
ariaNow:
|
|
21
|
-
ariaMin:
|
|
22
|
-
ariaMax:
|
|
20
|
+
ariaNow: E,
|
|
21
|
+
ariaMin: $,
|
|
22
|
+
ariaMax: M,
|
|
23
23
|
startCollapsible: T,
|
|
24
24
|
endCollapsible: j,
|
|
25
|
-
onOffsetStart:
|
|
25
|
+
onOffsetStart: O,
|
|
26
26
|
onOffsetUpdate: v,
|
|
27
27
|
onOffsetEnd: h,
|
|
28
28
|
onCollapse: P,
|
|
29
29
|
lazy: a,
|
|
30
30
|
containerSize: m
|
|
31
|
-
} = d, e = y?.("bar", I), [r, w] =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const o = t.touches[0];
|
|
38
|
-
w([o.pageX, o.pageY]), S(n);
|
|
31
|
+
} = d, e = y?.("bar", I), [r, w] = X(null), [g, S] = X(0), k = s ? 0 : g, A = s ? g : 0, D = (o) => {
|
|
32
|
+
o.currentTarget && (w([o.pageX, o.pageY]), O(n));
|
|
33
|
+
}, V = (o) => {
|
|
34
|
+
if (o.touches.length === 1) {
|
|
35
|
+
const t = o.touches[0];
|
|
36
|
+
w([t.pageX, t.pageY]), O(n);
|
|
39
37
|
}
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
return Math.max(x, Math.min(i, c)) -
|
|
43
|
-
},
|
|
44
|
-
const c =
|
|
45
|
-
s ?
|
|
38
|
+
}, B = (o) => {
|
|
39
|
+
const t = m * E / 100, c = t + o, x = Math.max(0, m * $ / 100), i = Math.min(m, m * M / 100);
|
|
40
|
+
return Math.max(x, Math.min(i, c)) - t;
|
|
41
|
+
}, N = Y((o, t) => {
|
|
42
|
+
const c = B(
|
|
43
|
+
s ? t : o
|
|
46
44
|
);
|
|
47
|
-
|
|
48
|
-
}),
|
|
49
|
-
v(n, k, A, !0),
|
|
45
|
+
S(c);
|
|
46
|
+
}), L = Y(() => {
|
|
47
|
+
v(n, k, A, !0), S(0), h(!0);
|
|
50
48
|
});
|
|
51
|
-
|
|
49
|
+
Z(() => {
|
|
52
50
|
if (r) {
|
|
53
|
-
const
|
|
54
|
-
const { pageX:
|
|
55
|
-
a ?
|
|
56
|
-
},
|
|
57
|
-
a ?
|
|
51
|
+
const o = (i) => {
|
|
52
|
+
const { pageX: p, pageY: C } = i, u = p - r[0], U = C - r[1];
|
|
53
|
+
a ? N(u, U) : v(n, u, U);
|
|
54
|
+
}, t = () => {
|
|
55
|
+
a ? L() : h(), w(null);
|
|
58
56
|
}, c = (i) => {
|
|
59
57
|
if (i.touches.length === 1) {
|
|
60
|
-
const
|
|
61
|
-
a ?
|
|
58
|
+
const p = i.touches[0], C = p.pageX - r[0], u = p.pageY - r[1];
|
|
59
|
+
a ? N(C, u) : v(n, C, u);
|
|
62
60
|
}
|
|
63
61
|
}, x = () => {
|
|
64
|
-
a ?
|
|
62
|
+
a ? L() : h(), w(null);
|
|
65
63
|
};
|
|
66
|
-
return window.addEventListener("touchmove", c), window.addEventListener("touchend", x), window.addEventListener("mousemove",
|
|
67
|
-
window.removeEventListener("mousemove",
|
|
64
|
+
return window.addEventListener("touchmove", c), window.addEventListener("touchend", x), window.addEventListener("mousemove", o), window.addEventListener("mouseup", t), () => {
|
|
65
|
+
window.removeEventListener("mousemove", o), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", x);
|
|
68
66
|
};
|
|
69
67
|
}
|
|
70
68
|
}, [
|
|
@@ -73,15 +71,15 @@ const ie = (d) => {
|
|
|
73
71
|
s,
|
|
74
72
|
n,
|
|
75
73
|
m,
|
|
74
|
+
E,
|
|
76
75
|
$,
|
|
77
76
|
M,
|
|
78
77
|
N,
|
|
79
|
-
L,
|
|
80
78
|
v,
|
|
81
|
-
|
|
79
|
+
L,
|
|
82
80
|
h
|
|
83
81
|
]);
|
|
84
|
-
const
|
|
82
|
+
const R = {
|
|
85
83
|
[`--${e}-preview-offset`]: `${g}px`
|
|
86
84
|
}, q = s ? Q : J, F = s ? H : K;
|
|
87
85
|
return /* @__PURE__ */ G(
|
|
@@ -89,9 +87,9 @@ const ie = (d) => {
|
|
|
89
87
|
{
|
|
90
88
|
className: e,
|
|
91
89
|
role: "separator",
|
|
92
|
-
"aria-valuenow":
|
|
93
|
-
"aria-valuemin":
|
|
94
|
-
"aria-valuemax":
|
|
90
|
+
"aria-valuenow": b(E),
|
|
91
|
+
"aria-valuemin": b($),
|
|
92
|
+
"aria-valuemax": b(M),
|
|
95
93
|
children: [
|
|
96
94
|
a && /* @__PURE__ */ l(
|
|
97
95
|
"div",
|
|
@@ -99,7 +97,7 @@ const ie = (d) => {
|
|
|
99
97
|
className: f(`${e}-preview`, {
|
|
100
98
|
[`${e}-preview-active`]: !!g
|
|
101
99
|
}),
|
|
102
|
-
style:
|
|
100
|
+
style: R
|
|
103
101
|
}
|
|
104
102
|
),
|
|
105
103
|
/* @__PURE__ */ l(
|
|
@@ -109,7 +107,7 @@ const ie = (d) => {
|
|
|
109
107
|
[`${e}-dragger-active`]: z
|
|
110
108
|
}),
|
|
111
109
|
onMouseDown: D,
|
|
112
|
-
onTouchStart:
|
|
110
|
+
onTouchStart: V
|
|
113
111
|
}
|
|
114
112
|
),
|
|
115
113
|
T && /* @__PURE__ */ l(
|
|
@@ -155,5 +153,5 @@ const ie = (d) => {
|
|
|
155
153
|
);
|
|
156
154
|
};
|
|
157
155
|
export {
|
|
158
|
-
|
|
156
|
+
fe as default
|
|
159
157
|
};
|