@unicom-cloud/ui 0.8.99 → 0.8.100
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/Anchor.js +3 -1
- package/Badge.js +7 -6
- package/Copy.js +49 -2
- package/Flex.js +12 -0
- package/Grid.js +1 -1
- package/LiquidFill.js +3 -2
- package/Marquee.js +3 -2
- package/QrCode.js +3 -2
- package/Splitter.js +4 -5
- package/Tag.js +3 -2
- package/Tour.js +3 -2
- package/alert/index.js +38 -39
- package/anchor/index.js +5 -3
- package/badge/index.js +19 -18
- package/copy/index.js +83 -35
- package/flex/index.js +59 -0
- package/flex/interface.js +34 -0
- package/flex/utils.js +13 -0
- package/grid/{GridItem.js → Item.js} +15 -15
- package/grid/index.js +1 -1
- package/index.js +503 -493
- package/input/Button.js +39 -34
- package/input/Textarea.js +108 -104
- package/liquid-fill/index.js +3 -2
- package/marquee/index.js +3 -2
- package/package.json +1 -1
- package/qr-code/index.js +3 -2
- package/segmented/index.js +112 -104
- package/spin/index.js +75 -62
- package/splitter/Panel.js +39 -0
- package/splitter/SplitBar.js +157 -0
- package/splitter/Splitter.js +139 -0
- package/splitter/hooks/useEvent.js +12 -0
- package/splitter/hooks/useItems.js +26 -0
- package/splitter/hooks/useResizable.js +26 -0
- package/splitter/hooks/useResize.js +68 -0
- package/splitter/hooks/useSizes.js +60 -0
- package/splitter/index.js +5 -115
- package/style.css +1 -1
- package/table/Table.js +1 -1
- package/table/hook/useThResizable.js +72 -26
- package/table/tbody/Td.js +80 -77
- package/table/th-resizable/index.js +92 -35
- package/tag/index.js +42 -41
- package/tooltip/index.js +89 -82
- package/tour/index.js +5 -6
- package/types/common/space/index.d.ts +2 -1
- package/types/pc/affix/interface.d.ts +0 -2
- package/types/pc/alert/index.d.ts +2 -2
- package/types/pc/anchor/index.d.ts +2 -1
- package/types/pc/anchor/interface.d.ts +0 -2
- package/types/pc/auto-complete/interface.d.ts +0 -6
- package/types/pc/avatar/interface.d.ts +0 -4
- package/types/pc/breadcrumb/interface.d.ts +0 -3
- package/types/pc/carousel/interface.d.ts +2 -6
- package/types/pc/cascader/interface.d.ts +6 -18
- package/types/pc/checkbox/interface.d.ts +0 -1
- package/types/pc/collapse/interface.d.ts +0 -2
- package/types/pc/color-picker/interface.d.ts +0 -2
- package/types/pc/config-provider/interface.d.ts +13 -17
- package/types/pc/copy/interface.d.ts +2 -1
- package/types/pc/date-picker/interface.d.ts +0 -17
- package/types/pc/descriptions/interface.d.ts +0 -1
- package/types/pc/drawer/interface.d.ts +0 -7
- package/types/pc/dropdown/interface.d.ts +0 -1
- package/types/pc/flex/index.d.ts +9 -0
- package/types/pc/flex/interface.d.ts +61 -0
- package/types/pc/flex/utils.d.ts +9 -0
- package/types/pc/form/interface.d.ts +9 -22
- package/types/pc/form/util.d.ts +1 -1
- package/types/pc/grid/index.d.ts +3 -3
- package/types/pc/grid/interface.d.ts +1 -6
- package/types/pc/image/interface.d.ts +0 -13
- package/types/pc/index.d.ts +6 -2
- package/types/pc/input/Textarea.d.ts +2 -6
- package/types/pc/input/interface.d.ts +5 -13
- package/types/pc/input-number/interface.d.ts +0 -4
- package/types/pc/input-tag/interface.d.ts +0 -13
- package/types/pc/layout/interface.d.ts +0 -1
- package/types/pc/link/interface.d.ts +0 -1
- package/types/pc/list/interface.d.ts +0 -4
- package/types/pc/menu/interface.d.ts +0 -8
- package/types/pc/message/interface.d.ts +0 -2
- package/types/pc/modal/interface.d.ts +0 -5
- package/types/pc/notification/interface.d.ts +0 -1
- package/types/pc/pagination/interface.d.ts +0 -2
- package/types/pc/popconfirm/interface.d.ts +8 -10
- package/types/pc/popover/interface.d.ts +0 -1
- package/types/pc/progress/interface.d.ts +0 -3
- package/types/pc/resize-box/interface.d.ts +1 -7
- package/types/pc/select/interface.d.ts +0 -12
- package/types/pc/select-view/interface.d.ts +0 -7
- package/types/pc/slider/interface.d.ts +0 -4
- package/types/pc/space/index.d.ts +1 -0
- package/types/pc/spin/interface.d.ts +4 -1
- package/types/pc/splitter/Panel.d.ts +8 -0
- package/types/pc/splitter/SplitBar.d.ts +21 -0
- package/types/pc/splitter/Splitter.d.ts +4 -0
- package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
- package/types/pc/splitter/hooks/useItems.d.ts +10 -0
- package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
- package/types/pc/splitter/hooks/useResize.d.ts +4 -0
- package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
- package/types/pc/splitter/index.d.ts +8 -4
- package/types/pc/splitter/interface.d.ts +181 -38
- package/types/pc/statistic/interface.d.ts +0 -4
- package/types/pc/steps/interface.d.ts +0 -3
- package/types/pc/table/hook/useThResizable.d.ts +2 -2
- package/types/pc/table/interface.d.ts +4 -15
- package/types/pc/tabs/interface.d.ts +0 -7
- package/types/pc/tag/index.d.ts +2 -0
- package/types/pc/tag/interface.d.ts +0 -1
- package/types/pc/time-picker/interface.d.ts +0 -7
- package/types/pc/tooltip/interface.d.ts +4 -1
- package/types/pc/transfer/interface.d.ts +2 -9
- package/types/pc/tree/interface.d.ts +2 -8
- package/types/pc/tree-select/interface.d.ts +0 -8
- package/types/pc/trigger/interface.d.ts +0 -5
- package/types/pc/typography/EditContent.d.ts +2 -1
- package/types/pc/typography/interface.d.ts +45 -30
- package/types/pc/upload/interface.d.ts +6 -11
- package/types/pc/utils/index.d.ts +1 -0
- package/types/pc/utils/names.d.ts +6 -0
- package/types/pc/utils/toArray.d.ts +7 -0
- package/types/pc/verification-code/interface.d.ts +0 -2
- package/types/pc/watermark/interface.d.ts +0 -2
- package/typography/Base.js +73 -73
- package/typography/EditContent.js +43 -33
- package/typography/Ellipsis.js +117 -184
- package/typography/Operations.js +97 -49
- package/typography/useCssEllipsis.js +7 -6
- package/utils/index.js +117 -115
- package/utils/names.js +4 -0
- package/utils/toArray.js +12 -0
- package/version/index.js +1 -1
- /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
package/flex/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import V, { forwardRef as n } from "react";
|
|
3
|
+
import "../config-provider/ConfigProvider.js";
|
|
4
|
+
import h from "../components/common/hooks/useMergeProps.js";
|
|
5
|
+
import w from "@unicom-cloud/utils/class-name";
|
|
6
|
+
import { isPresetSize as i, createFlexClassNames as z } from "./utils.js";
|
|
7
|
+
import R from "../config-provider/context.js";
|
|
8
|
+
const S = {
|
|
9
|
+
component: "div",
|
|
10
|
+
vertical: !1
|
|
11
|
+
};
|
|
12
|
+
function j(r, o) {
|
|
13
|
+
const { getPrefixCls: p, rtl: f, componentConfig: x } = V.useContext(R), l = h(
|
|
14
|
+
r,
|
|
15
|
+
S,
|
|
16
|
+
x?.Flex
|
|
17
|
+
), {
|
|
18
|
+
prefixCls: C,
|
|
19
|
+
rootClassName: d,
|
|
20
|
+
className: u,
|
|
21
|
+
style: g,
|
|
22
|
+
flex: a,
|
|
23
|
+
gap: e,
|
|
24
|
+
children: N,
|
|
25
|
+
vertical: v,
|
|
26
|
+
component: F = "div",
|
|
27
|
+
wrap: b,
|
|
28
|
+
...P
|
|
29
|
+
} = l, t = p?.("flex", C), y = w(
|
|
30
|
+
t,
|
|
31
|
+
u,
|
|
32
|
+
d,
|
|
33
|
+
{
|
|
34
|
+
[`${t}-rtl`]: f,
|
|
35
|
+
[`${t}-gap-${e}`]: i(e),
|
|
36
|
+
[`${t}-vertical`]: v
|
|
37
|
+
},
|
|
38
|
+
z(t, l)
|
|
39
|
+
), $ = {
|
|
40
|
+
...g,
|
|
41
|
+
...a ? { flex: a } : {},
|
|
42
|
+
...e && !i(e) ? { gap: e } : {}
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ c(F, { ref: o, className: y, style: $, ...P, children: N });
|
|
45
|
+
}
|
|
46
|
+
const s = n(
|
|
47
|
+
j
|
|
48
|
+
);
|
|
49
|
+
s.displayName = "Flex";
|
|
50
|
+
function M(r, o) {
|
|
51
|
+
return /* @__PURE__ */ c(s, { ref: o, ...r, vertical: !0, children: r.children });
|
|
52
|
+
}
|
|
53
|
+
const m = n(M);
|
|
54
|
+
m.displayName = "FlexVertical";
|
|
55
|
+
s.Vertical = m;
|
|
56
|
+
export {
|
|
57
|
+
m as FlexVertical,
|
|
58
|
+
s as default
|
|
59
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const e = [
|
|
2
|
+
"wrap",
|
|
3
|
+
"nowrap",
|
|
4
|
+
"wrap-reverse"
|
|
5
|
+
], t = [
|
|
6
|
+
"flex-start",
|
|
7
|
+
"flex-end",
|
|
8
|
+
"start",
|
|
9
|
+
"end",
|
|
10
|
+
"center",
|
|
11
|
+
"space-between",
|
|
12
|
+
"space-around",
|
|
13
|
+
"space-evenly",
|
|
14
|
+
"stretch",
|
|
15
|
+
"normal",
|
|
16
|
+
"left",
|
|
17
|
+
"right"
|
|
18
|
+
], s = [
|
|
19
|
+
"center",
|
|
20
|
+
"start",
|
|
21
|
+
"end",
|
|
22
|
+
"flex-start",
|
|
23
|
+
"flex-end",
|
|
24
|
+
"self-start",
|
|
25
|
+
"self-end",
|
|
26
|
+
"baseline",
|
|
27
|
+
"normal",
|
|
28
|
+
"stretch"
|
|
29
|
+
];
|
|
30
|
+
export {
|
|
31
|
+
s as alignItemsValues,
|
|
32
|
+
e as flexWrapValues,
|
|
33
|
+
t as justifyContentValues
|
|
34
|
+
};
|
package/flex/utils.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import s from "@unicom-cloud/utils/class-name";
|
|
2
|
+
import { alignItemsValues as u, justifyContentValues as c, flexWrapValues as m } from "./interface.js";
|
|
3
|
+
function g(t, i) {
|
|
4
|
+
const n = i.wrap === !0 ? "wrap" : i.wrap, a = n && m.includes(n) ? `${t}-wrap-${n}` : void 0, e = i.align && u.includes(i.align) ? `${t}-align-${i.align}` : !i.align && i.vertical ? `${t}-align-stretch` : void 0, l = i.justify && c.includes(i.justify) ? `${t}-justify-${i.justify}` : void 0;
|
|
5
|
+
return s(a, e, l);
|
|
6
|
+
}
|
|
7
|
+
function d(t) {
|
|
8
|
+
return typeof t == "string" && ["mini", "small", "medium", "large"].includes(t);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
g as createFlexClassNames,
|
|
12
|
+
d as isPresetSize
|
|
13
|
+
};
|
|
@@ -15,27 +15,27 @@ const U = {
|
|
|
15
15
|
span: 1
|
|
16
16
|
};
|
|
17
17
|
function W($, g) {
|
|
18
|
-
const { getPrefixCls:
|
|
18
|
+
const { getPrefixCls: _, componentConfig: y, rtl: S } = p(K), a = q(
|
|
19
19
|
$,
|
|
20
20
|
U,
|
|
21
|
-
|
|
21
|
+
y?.["Grid.Item"]
|
|
22
22
|
), {
|
|
23
|
-
children:
|
|
24
|
-
className:
|
|
23
|
+
children: i,
|
|
24
|
+
className: G,
|
|
25
25
|
style: v,
|
|
26
26
|
offset: N,
|
|
27
27
|
span: D,
|
|
28
28
|
__index__: s
|
|
29
|
-
} =
|
|
29
|
+
} = a, n = p(A), { collectItemData: R, removeItemData: E } = p(
|
|
30
30
|
H
|
|
31
|
-
), { colGap: f, cols: l, displayIndexList: P, overflow: u } =
|
|
31
|
+
), { colGap: f, cols: l, displayIndexList: P, overflow: u } = n, d = C(N, 0), r = C(D, 1), x = _?.("grid-item"), w = P?.includes(s), M = {
|
|
32
32
|
[`${x}`]: !0,
|
|
33
|
-
[`${x}-rtl`]:
|
|
34
|
-
}, b = z(M,
|
|
35
|
-
suffix: !!
|
|
36
|
-
span:
|
|
33
|
+
[`${x}-rtl`]: S
|
|
34
|
+
}, b = z(M, G), e = c(() => J(n.cols, {
|
|
35
|
+
suffix: !!a.suffix,
|
|
36
|
+
span: r,
|
|
37
37
|
offset: d
|
|
38
|
-
}), [
|
|
38
|
+
}), [n.cols, a.suffix, r, d]);
|
|
39
39
|
k(() => (R(s, e), () => {
|
|
40
40
|
E(s);
|
|
41
41
|
}), [s, e]);
|
|
@@ -47,8 +47,8 @@ function W($, g) {
|
|
|
47
47
|
}, [e, f]), L = c(() => {
|
|
48
48
|
const { suffix: t, span: o } = e;
|
|
49
49
|
return t ? `${l - o + 1}` : `span ${o}`;
|
|
50
|
-
}, [e, l]), j = !w ||
|
|
51
|
-
gridColumn: `${L} / span ${
|
|
50
|
+
}, [e, l]), j = !w || r === 0 ? { display: "none" } : {}, B = {
|
|
51
|
+
gridColumn: `${L} / span ${r}`,
|
|
52
52
|
...F,
|
|
53
53
|
...j
|
|
54
54
|
};
|
|
@@ -61,7 +61,7 @@ function W($, g) {
|
|
|
61
61
|
...B,
|
|
62
62
|
...v
|
|
63
63
|
},
|
|
64
|
-
children: Q(
|
|
64
|
+
children: Q(i) ? i({ overflow: u }) : m.Children.map(i, (t) => t && n.collapsed && m.isValidElement(t) && !T(t.type) ? m.cloneElement(t, {
|
|
65
65
|
overflow: u,
|
|
66
66
|
...t.props
|
|
67
67
|
}) : t)
|
|
@@ -69,7 +69,7 @@ function W($, g) {
|
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
const X = V(W), I = X;
|
|
72
|
-
I.displayName = "
|
|
72
|
+
I.displayName = "Grid.Item";
|
|
73
73
|
I.__PQB_GRID_ITEM__ = !0;
|
|
74
74
|
export {
|
|
75
75
|
I as default
|