@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 CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/ui","version":"0.8.85","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"}}
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 u } from "react/jsx-runtime";
2
- import { forwardRef as f, useContext as S } from "react";
3
- import { UI_COMMON_PREFIX as g } from "@unicom-cloud/utils/constant/ui";
4
- import { u as N } from "../chunk/BFTV6myl.js";
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 w from "@unicom-cloud/utils/class-name";
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 y, isNumber as h } from "@unicom-cloud/utils/is";
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 x } from "../chunk/B44Hj5ad.js";
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 M = {
48
+ const _ = {
49
49
  gap: "small",
50
50
  direction: "horizontal"
51
51
  };
52
- function C(r = 8) {
53
- if (h(r))
54
- return r;
55
- if (y(r))
56
- return r.map((i, t, p) => C(i));
57
- switch (r) {
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 _(r, i) {
71
- const t = `${g}-space`, p = N(r, M), {
72
- className: $,
73
- style: s,
74
- children: c,
75
- gap: e,
76
- direction: n,
77
- wrap: l = !0,
78
- ...a
79
- } = p, m = C(e), o = { ...s };
80
- return y(m) ? (o.rowGap = m[0], o.columnGap = m[1]) : o.gap = m, /* @__PURE__ */ u(
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: i,
84
- className: w(
85
- `${t}`,
86
- l && `${t}-wrap`,
87
- `${t}-${n}`,
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: o,
91
- ...a,
92
- children: c
94
+ style: l,
95
+ ...e,
96
+ children: f
93
97
  }
94
98
  );
95
99
  }
96
- const d = f(_);
97
- d.displayName = "Space";
98
- function z(r, i) {
99
- return /* @__PURE__ */ u(d, { ref: i, ...r, direction: "vertical", children: r.children });
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 = f(z);
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(r, i) {
108
- const { getPrefixCls: t, componentConfig: p, rtl: $ } = S(x), s = N(
109
- r,
111
+ function v(t, o) {
112
+ const { getPrefixCls: r, componentConfig: i, rtl: g } = h(M), u = y(
113
+ t,
110
114
  V,
111
- p == null ? void 0 : p.Space
112
- ), {
113
- className: c,
114
- direction: e,
115
- size: n,
116
- // 向上兼容,请用 gap 属性
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: i,
125
- className: w(
126
- `${o}`,
127
- a && `${o}-wrap`,
128
- `${o}-${e}`,
129
- c
122
+ ref: o,
123
+ className: C(
124
+ `${e}`,
125
+ s && `${e}-wrap`,
126
+ `${e}-${a}`,
127
+ f
130
128
  ),
131
- direction: e,
132
- wrap: a,
133
- gap: n || // 向上兼容,请用 gap 属性
134
- l,
129
+ direction: a,
130
+ wrap: s,
135
131
  ...m
136
132
  }
137
133
  );
138
134
  }
139
- const G = f(v);
135
+ const G = $(v);
140
136
  G.displayName = "Space";
141
137
  export {
142
138
  P as SpaceVertical,