@unicom-cloud/ui 0.8.85 → 0.8.87
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/package.json +1 -1
- package/space/index.js +61 -65
- package/style.css +1 -1
- package/types/common/space/index.d.ts +4 -2
- package/types/common/space/interface.d.ts +10 -0
- package/types/pc/space/index.d.ts +1 -1
- package/types/pc/space/interface.d.ts +10 -0
- package/version/index.js +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui","version":"0.8.
|
|
1
|
+
{"name":"@unicom-cloud/ui","version":"0.8.87","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
|
package/space/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { UI_COMMON_PREFIX as
|
|
4
|
-
import { u as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $, useContext as h } from "react";
|
|
3
|
+
import { UI_COMMON_PREFIX as x } from "@unicom-cloud/utils/constant/ui";
|
|
4
|
+
import { u as y } from "../chunk/BFTV6myl.js";
|
|
5
5
|
import "@unicom-cloud/utils/case-name";
|
|
6
|
-
import
|
|
6
|
+
import C from "@unicom-cloud/utils/class-name";
|
|
7
7
|
import "../chunk/9TSjT7x_.js";
|
|
8
8
|
import "@unicom-cloud/utils/clipboard-copy";
|
|
9
9
|
import "../chunk/C7bohPVD.js";
|
|
@@ -37,24 +37,24 @@ import "../chunk/BZ3igxQN.js";
|
|
|
37
37
|
import "@unicom-cloud/utils/file/saveAs";
|
|
38
38
|
import "@unicom-cloud/utils/screenfull";
|
|
39
39
|
import "@unicom-cloud/utils/tree";
|
|
40
|
-
import { isArray as
|
|
40
|
+
import { isArray as w, isNumber as I } from "@unicom-cloud/utils/is";
|
|
41
41
|
import "uuid";
|
|
42
42
|
import "../chunk/DEuVgCzp.js";
|
|
43
43
|
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
44
|
-
import { a as
|
|
44
|
+
import { a as M } from "../chunk/B44Hj5ad.js";
|
|
45
45
|
import "lodash/isEqualWith";
|
|
46
46
|
import "../chunk/B4WG1mhs.js";
|
|
47
47
|
import "@unicom-cloud/utils/constant";
|
|
48
|
-
const
|
|
48
|
+
const _ = {
|
|
49
49
|
gap: "small",
|
|
50
50
|
direction: "horizontal"
|
|
51
51
|
};
|
|
52
|
-
function
|
|
53
|
-
if (
|
|
54
|
-
return
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
57
|
-
switch (
|
|
52
|
+
function S(t = 8) {
|
|
53
|
+
if (I(t))
|
|
54
|
+
return t;
|
|
55
|
+
if (w(t))
|
|
56
|
+
return t.map((o, r, i) => S(o));
|
|
57
|
+
switch (t) {
|
|
58
58
|
case "mini":
|
|
59
59
|
return 4;
|
|
60
60
|
case "small":
|
|
@@ -67,76 +67,72 @@ function C(r = 8) {
|
|
|
67
67
|
return 8;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
className:
|
|
73
|
-
style:
|
|
74
|
-
children:
|
|
75
|
-
gap:
|
|
76
|
-
direction:
|
|
77
|
-
wrap:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
function j(t, o) {
|
|
71
|
+
const r = `${x}-space`, i = y(t, _), {
|
|
72
|
+
className: g,
|
|
73
|
+
style: u,
|
|
74
|
+
children: f,
|
|
75
|
+
gap: a,
|
|
76
|
+
direction: s,
|
|
77
|
+
wrap: n,
|
|
78
|
+
justifyContent: p,
|
|
79
|
+
alignItems: m,
|
|
80
|
+
...e
|
|
81
|
+
} = i, c = S(a), l = { ...u };
|
|
82
|
+
return w(c) ? (l.rowGap = c[0], l.columnGap = c[1]) : l.gap = c, /* @__PURE__ */ d(
|
|
81
83
|
"div",
|
|
82
84
|
{
|
|
83
|
-
ref:
|
|
84
|
-
className:
|
|
85
|
-
`${
|
|
86
|
-
|
|
87
|
-
`${
|
|
88
|
-
|
|
85
|
+
ref: o,
|
|
86
|
+
className: C(
|
|
87
|
+
`${r}`,
|
|
88
|
+
n && `${r}-wrap`,
|
|
89
|
+
`${r}-${s}`,
|
|
90
|
+
p && `${r}-justify-content-${p}`,
|
|
91
|
+
m && `${r}-align-items-${m}`,
|
|
92
|
+
g
|
|
89
93
|
),
|
|
90
|
-
style:
|
|
91
|
-
...
|
|
92
|
-
children:
|
|
94
|
+
style: l,
|
|
95
|
+
...e,
|
|
96
|
+
children: f
|
|
93
97
|
}
|
|
94
98
|
);
|
|
95
99
|
}
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
function z(
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
+
const N = $(j);
|
|
101
|
+
N.displayName = "Space";
|
|
102
|
+
function z(t, o) {
|
|
103
|
+
return /* @__PURE__ */ d(N, { ref: o, ...t, direction: "vertical", children: t.children });
|
|
100
104
|
}
|
|
101
|
-
const P =
|
|
105
|
+
const P = $(z);
|
|
102
106
|
P.displayName = "SpaceVertical";
|
|
103
107
|
const V = {
|
|
104
108
|
gap: "small",
|
|
105
109
|
direction: "horizontal"
|
|
106
110
|
};
|
|
107
|
-
function v(
|
|
108
|
-
const { getPrefixCls:
|
|
109
|
-
|
|
111
|
+
function v(t, o) {
|
|
112
|
+
const { getPrefixCls: r, componentConfig: i, rtl: g } = h(M), u = y(
|
|
113
|
+
t,
|
|
110
114
|
V,
|
|
111
|
-
|
|
112
|
-
), {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
gap: l,
|
|
118
|
-
wrap: a,
|
|
119
|
-
...m
|
|
120
|
-
} = s, o = t == null ? void 0 : t("space");
|
|
121
|
-
return /* @__PURE__ */ u(
|
|
122
|
-
d,
|
|
115
|
+
i == null ? void 0 : i.Space
|
|
116
|
+
), { className: f, direction: a, wrap: s, size: n, align: p, ...m } = u;
|
|
117
|
+
n && (m.gap = n), p && (m.alignItems = p);
|
|
118
|
+
const e = r == null ? void 0 : r("space");
|
|
119
|
+
return /* @__PURE__ */ d(
|
|
120
|
+
N,
|
|
123
121
|
{
|
|
124
|
-
ref:
|
|
125
|
-
className:
|
|
126
|
-
`${
|
|
127
|
-
|
|
128
|
-
`${
|
|
129
|
-
|
|
122
|
+
ref: o,
|
|
123
|
+
className: C(
|
|
124
|
+
`${e}`,
|
|
125
|
+
s && `${e}-wrap`,
|
|
126
|
+
`${e}-${a}`,
|
|
127
|
+
f
|
|
130
128
|
),
|
|
131
|
-
direction:
|
|
132
|
-
wrap:
|
|
133
|
-
gap: n || // 向上兼容,请用 gap 属性
|
|
134
|
-
l,
|
|
129
|
+
direction: a,
|
|
130
|
+
wrap: s,
|
|
135
131
|
...m
|
|
136
132
|
}
|
|
137
133
|
);
|
|
138
134
|
}
|
|
139
|
-
const G =
|
|
135
|
+
const G = $(v);
|
|
140
136
|
G.displayName = "Space";
|
|
141
137
|
export {
|
|
142
138
|
P as SpaceVertical,
|