@unicom-cloud/ui 0.8.98 → 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 +54 -7
- package/Copy.js +49 -2
- package/Flex.js +12 -0
- package/Grid.js +1 -1
- package/LiquidFill.js +60 -2
- package/Marquee.js +62 -0
- package/QrCode.js +14 -9
- package/Segmented.js +11 -0
- package/Space.js +14 -6
- package/Splitter.js +6 -0
- package/Tag.js +3 -2
- package/Tour.js +14 -9
- package/alert/index.js +38 -39
- package/anchor/index.js +5 -3
- package/badge/index.js +174 -80
- package/collapse/Collapse.js +54 -48
- package/components/common/space/index.js +90 -106
- 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 +490 -477
- package/input/Button.js +39 -34
- package/input/Textarea.js +108 -104
- package/liquid-fill/index.js +256 -2
- package/marquee/index.js +283 -0
- package/menu/Item.js +17 -16
- package/package.json +1 -1
- package/qr-code/index.js +54 -36
- package/rate/index.js +8 -8
- package/segmented/index.js +225 -0
- package/space/index.js +28 -29
- 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 +7 -0
- package/splitter/interface.js +1 -0
- 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 +110 -89
- package/types/common/hooks/useMergeProps.d.ts +1 -1
- package/types/common/space/index.d.ts +7 -5
- package/types/common/space/interface.d.ts +29 -16
- 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/badge/index.d.ts +4 -4
- package/types/pc/badge/interface.d.ts +26 -0
- 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 +4 -2
- package/types/pc/color-picker/interface.d.ts +0 -2
- package/types/pc/config-provider/interface.d.ts +16 -14
- package/types/pc/copy/interface.d.ts +2 -1
- package/types/pc/date-picker/RangePicker.d.ts +1 -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 +16 -6
- 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/liquid-fill/index.d.ts +114 -1
- package/types/pc/list/interface.d.ts +0 -4
- package/types/pc/marquee/index.d.ts +61 -0
- package/types/pc/menu/context.d.ts +1 -1
- 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/qr-code/index.d.ts +1 -1
- package/types/pc/rate/index.d.ts +2 -2
- package/types/pc/resize-box/interface.d.ts +1 -7
- package/types/pc/segmented/index.d.ts +8 -0
- package/types/pc/segmented/interface.d.ts +88 -0
- 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 +4 -1
- package/types/pc/space/interface.d.ts +6 -10
- 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 -0
- package/types/pc/splitter/interface.d.ts +213 -0
- 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/tour/index.d.ts +6 -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 +24 -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 +16 -0
- package/utils/toArray.js +12 -0
- package/version/index.js +1 -1
- package/_virtual/_commonjsHelpers.js +0 -6
- package/_virtual/index.js +0 -7
- package/_virtual/index2.js +0 -4
- package/liquid-fill/LiquidFill.js +0 -226
- package/liquid-fill/LiquidFill2.js +0 -3
- package/space-/index.js +0 -93
- package/types/common/utils/color.d.ts +0 -1
- package/types/common/utils/computeScrollIntoView.d.ts +0 -1
- package/types/common/utils/index.d.ts +0 -45
- package/types/common/utils/math.d.ts +0 -1
- package/types/common/utils/reactTransitionGroup.d.ts +0 -1
- package/types/common/utils/tree.d.ts +0 -1
- package/types/common/utils/tween.d.ts +0 -1
- package/types/common/utils/uuid.d.ts +0 -1
- package/types/common/utils/validate.d.ts +0 -1
- package/types/pc/liquid-fill/LiquidFill.d.ts +0 -115
- package/types/pc/liquid-fill/LiquidFill2.d.ts +0 -1
- package/types/pc/space-/index.d.ts +0 -6
- package/types/pc/space-/interface.d.ts +0 -38
- /package/{space- → components/common/space}/toArray.js +0 -0
- /package/{space- → segmented}/interface.js +0 -0
- /package/types/{pc/space- → common/space}/toArray.d.ts +0 -0
- /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
package/badge/index.js
CHANGED
|
@@ -1,13 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import q from "lodash/isPlainObject";
|
|
3
|
+
import { forwardRef as z, useContext as H, useRef as O, useImperativeHandle as L } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import M from "../components/common/hooks/useMergeProps.js";
|
|
6
|
+
import "@unicom-cloud/utils/case-name";
|
|
7
7
|
import n from "@unicom-cloud/utils/class-name";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
8
|
+
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
9
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
10
|
+
import "../utils/contextHolder.js";
|
|
11
|
+
import "@unicom-cloud/utils/dayjs";
|
|
12
|
+
import "@unicom-cloud/utils/clipboard-copy";
|
|
13
|
+
import "../components/common/utils/dayjs.js";
|
|
14
|
+
import "../components/common/utils/dom.js";
|
|
15
|
+
import "@unicom-cloud/utils/file/fileToURL";
|
|
16
|
+
import "lodash/escapeRegExp";
|
|
17
|
+
import "lodash/isArray";
|
|
18
|
+
import "lodash/isNumber";
|
|
19
|
+
import "lodash/isString";
|
|
20
|
+
import "lodash/isFunction";
|
|
21
|
+
import "lodash/throttle";
|
|
22
|
+
import "../components/common/utils/is.js";
|
|
23
|
+
import "lodash/camelCase";
|
|
24
|
+
import "lodash/capitalize";
|
|
25
|
+
import "lodash/cloneDeep";
|
|
26
|
+
import "lodash/debounce";
|
|
27
|
+
import "lodash/get";
|
|
28
|
+
import "lodash/has";
|
|
29
|
+
import "lodash/kebabCase";
|
|
30
|
+
import "lodash/merge";
|
|
31
|
+
import "lodash/mergeWith";
|
|
32
|
+
import "lodash/set";
|
|
33
|
+
import "lodash/setWith";
|
|
34
|
+
import "lodash/snakeCase";
|
|
35
|
+
import "lodash/startCase";
|
|
36
|
+
import "lodash/uniq";
|
|
37
|
+
import "lodash/upperFirst";
|
|
38
|
+
import "@unicom-cloud/utils/math";
|
|
39
|
+
import { PqbCSSTransition as U } from "../components/common/utils/PqbCSSTransition.js";
|
|
40
|
+
import "../components/common/utils/reactDOM.js";
|
|
41
|
+
import "../dist/react-transition-group/src/CSSTransition.js";
|
|
42
|
+
import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
43
|
+
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
44
|
+
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
45
|
+
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
46
|
+
import "@unicom-cloud/utils/file/saveAs";
|
|
47
|
+
import "@unicom-cloud/utils/screenfull";
|
|
48
|
+
import "@unicom-cloud/utils/constant/ui.js";
|
|
49
|
+
import "react-is";
|
|
50
|
+
import "@unicom-cloud/utils/tree";
|
|
51
|
+
import "@unicom-cloud/utils/is";
|
|
52
|
+
import { v4 as F } from "uuid";
|
|
53
|
+
import "../dist/validate/src/index.js";
|
|
54
|
+
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
55
|
+
import B from "./Count.js";
|
|
56
|
+
import J from "../config-provider/context.js";
|
|
57
|
+
const f = [
|
|
11
58
|
"red",
|
|
12
59
|
"orangered",
|
|
13
60
|
"orange",
|
|
@@ -19,132 +66,179 @@ const x = [
|
|
|
19
66
|
"purple",
|
|
20
67
|
"magenta",
|
|
21
68
|
"gray"
|
|
22
|
-
],
|
|
69
|
+
], K = {
|
|
23
70
|
count: 0,
|
|
24
|
-
maxCount: 99
|
|
71
|
+
maxCount: 99,
|
|
72
|
+
dotAnimation: !0
|
|
73
|
+
// 默认开启 dot 动画
|
|
25
74
|
};
|
|
26
|
-
function
|
|
27
|
-
const { getPrefixCls:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
75
|
+
function Q(P, v) {
|
|
76
|
+
const { getPrefixCls: A, componentConfig: R, rtl: $ } = H(J), T = M(
|
|
77
|
+
P,
|
|
78
|
+
K,
|
|
79
|
+
R?.Badge
|
|
31
80
|
), {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
81
|
+
ribbon: o,
|
|
82
|
+
count: s,
|
|
83
|
+
prefixText: g,
|
|
84
|
+
text: l,
|
|
85
|
+
className: w,
|
|
86
|
+
dotClassName: m,
|
|
87
|
+
dot: b,
|
|
88
|
+
dotAnimation: x,
|
|
89
|
+
maxCount: E,
|
|
90
|
+
color: r,
|
|
91
|
+
dotStyle: j,
|
|
92
|
+
offset: I,
|
|
93
|
+
style: N,
|
|
94
|
+
status: p,
|
|
45
95
|
children: u,
|
|
46
|
-
...
|
|
47
|
-
} = O, t =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
96
|
+
...y
|
|
97
|
+
} = T, d = O(null), C = O(F()), t = A?.("badge"), i = { ...j || {} }, [h, S] = I || [];
|
|
98
|
+
h && (i.marginRight = -h), S && (i.marginTop = S), L(v, () => ({
|
|
99
|
+
dom: d.current
|
|
100
|
+
}));
|
|
101
|
+
const k = () => {
|
|
102
|
+
if (q(s))
|
|
103
|
+
return /* @__PURE__ */ e(
|
|
52
104
|
"span",
|
|
53
105
|
{
|
|
54
|
-
className: n(`${t}-custom-dot`,
|
|
55
|
-
style:
|
|
56
|
-
children:
|
|
106
|
+
className: n(`${t}-custom-dot`, m),
|
|
107
|
+
style: i,
|
|
108
|
+
children: s
|
|
57
109
|
}
|
|
58
110
|
);
|
|
59
|
-
const
|
|
60
|
-
return
|
|
111
|
+
const a = !r || f.indexOf(r) > -1 ? {} : { backgroundColor: r };
|
|
112
|
+
return l && !r && !p ? /* @__PURE__ */ e(
|
|
61
113
|
"span",
|
|
62
114
|
{
|
|
63
|
-
className: n(`${t}-text`,
|
|
64
|
-
style:
|
|
65
|
-
children:
|
|
115
|
+
className: n(`${t}-text`, m),
|
|
116
|
+
style: i,
|
|
117
|
+
children: l
|
|
66
118
|
}
|
|
67
|
-
) :
|
|
68
|
-
!!
|
|
69
|
-
/* @__PURE__ */
|
|
119
|
+
) : p || r && typeof s == "number" && s <= 0 ? /* @__PURE__ */ c("span", { className: `${t}-status-wrapper`, children: [
|
|
120
|
+
!!g && /* @__PURE__ */ e("span", { className: `${t}-status-prefix-text`, children: g }),
|
|
121
|
+
/* @__PURE__ */ e(
|
|
70
122
|
"span",
|
|
71
123
|
{
|
|
72
124
|
className: n(
|
|
73
125
|
`${t}-status-dot`,
|
|
74
126
|
{
|
|
75
|
-
[`${t}-
|
|
76
|
-
[`${t}-status-${
|
|
77
|
-
[`${t}-color-${
|
|
127
|
+
[`${t}-dot-pulse`]: x,
|
|
128
|
+
[`${t}-status-${p}`]: p,
|
|
129
|
+
[`${t}-color-${r}`]: r
|
|
78
130
|
},
|
|
79
|
-
|
|
131
|
+
m
|
|
80
132
|
),
|
|
81
|
-
style: { ...
|
|
133
|
+
style: { ...a, ...i }
|
|
82
134
|
}
|
|
83
135
|
),
|
|
84
|
-
!!
|
|
85
|
-
] }) : (
|
|
86
|
-
|
|
136
|
+
!!l && /* @__PURE__ */ e("span", { className: `${t}-status-text`, children: l })
|
|
137
|
+
] }) : (b || r) && typeof s == "number" && s > 0 ? /* @__PURE__ */ e(
|
|
138
|
+
U,
|
|
87
139
|
{
|
|
88
140
|
classNames: "badge-zoom",
|
|
89
|
-
in:
|
|
141
|
+
in: b || !!r,
|
|
90
142
|
timeout: 200,
|
|
91
143
|
appear: !0,
|
|
92
144
|
mountOnEnter: !0,
|
|
93
145
|
unmountOnExit: !0,
|
|
94
|
-
children: /* @__PURE__ */
|
|
146
|
+
children: /* @__PURE__ */ e(
|
|
95
147
|
"span",
|
|
96
148
|
{
|
|
97
149
|
className: n(
|
|
98
150
|
`${t}-dot`,
|
|
99
151
|
{
|
|
100
|
-
[`${t}-
|
|
152
|
+
[`${t}-dot-pulse`]: x,
|
|
153
|
+
[`${t}-color-${r}`]: r
|
|
101
154
|
},
|
|
102
|
-
|
|
155
|
+
m
|
|
103
156
|
),
|
|
104
|
-
style: { ...
|
|
157
|
+
style: { ...a, ...i }
|
|
105
158
|
}
|
|
106
159
|
)
|
|
107
160
|
}
|
|
108
|
-
) : /* @__PURE__ */
|
|
109
|
-
|
|
161
|
+
) : /* @__PURE__ */ e(
|
|
162
|
+
B,
|
|
110
163
|
{
|
|
111
164
|
prefixCls: t,
|
|
112
|
-
className: n(`${t}-number`,
|
|
113
|
-
style: { ...
|
|
114
|
-
maxCount:
|
|
115
|
-
count:
|
|
165
|
+
className: n(`${t}-number`, m),
|
|
166
|
+
style: { ...a, ...i },
|
|
167
|
+
maxCount: E,
|
|
168
|
+
count: s
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}, G = () => {
|
|
172
|
+
if (!o || !o.text) return null;
|
|
173
|
+
const a = o.color ? { backgroundColor: o.color } : {}, _ = o.placement || "end";
|
|
174
|
+
return /* @__PURE__ */ c(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: n(
|
|
178
|
+
`${t}-ribbon`,
|
|
179
|
+
`${t}-ribbon-${_}`,
|
|
180
|
+
{
|
|
181
|
+
[`${t}-rtl`]: $,
|
|
182
|
+
[`${t}-color-${o.color}`]: o.color && f.includes(o.color)
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
style: a,
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ e("span", { className: `${t}-ribbon-text`, children: o.text }),
|
|
188
|
+
/* @__PURE__ */ e("div", { className: `${t}-ribbon-corner` })
|
|
189
|
+
]
|
|
116
190
|
}
|
|
117
191
|
);
|
|
118
192
|
};
|
|
119
|
-
return /* @__PURE__ */
|
|
193
|
+
return o ? /* @__PURE__ */ c(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
className: `${t}-ribbon-wrapper`,
|
|
197
|
+
ref: d,
|
|
198
|
+
style: N,
|
|
199
|
+
id: C.current,
|
|
200
|
+
...y,
|
|
201
|
+
children: [
|
|
202
|
+
u,
|
|
203
|
+
G()
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
) : /* @__PURE__ */ c(
|
|
120
207
|
"span",
|
|
121
208
|
{
|
|
122
209
|
className: n(
|
|
123
210
|
t,
|
|
124
211
|
{
|
|
125
|
-
[`${t}-status`]:
|
|
212
|
+
[`${t}-status`]: p,
|
|
126
213
|
[`${t}-no-children`]: !u,
|
|
127
|
-
[`${t}-rtl`]:
|
|
214
|
+
[`${t}-rtl`]: $
|
|
128
215
|
},
|
|
129
|
-
|
|
216
|
+
w
|
|
130
217
|
),
|
|
131
|
-
ref:
|
|
132
|
-
style:
|
|
133
|
-
|
|
218
|
+
ref: d,
|
|
219
|
+
style: N,
|
|
220
|
+
id: C.current,
|
|
221
|
+
...y,
|
|
134
222
|
children: [
|
|
135
223
|
u,
|
|
136
|
-
|
|
224
|
+
k()
|
|
137
225
|
]
|
|
138
226
|
}
|
|
139
227
|
);
|
|
140
228
|
}
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
229
|
+
const D = z(Q);
|
|
230
|
+
D.displayName = "Badge";
|
|
231
|
+
D.Count = B;
|
|
232
|
+
const Xt = f, Yt = [
|
|
233
|
+
"default",
|
|
234
|
+
"processing",
|
|
235
|
+
"success",
|
|
236
|
+
"warning",
|
|
237
|
+
"error"
|
|
238
|
+
];
|
|
145
239
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
240
|
+
Xt as BADGE_COLORS,
|
|
241
|
+
Yt as BADGE_STATUS,
|
|
242
|
+
B as BadgeCount,
|
|
243
|
+
D as default
|
|
150
244
|
};
|
package/collapse/Collapse.js
CHANGED
|
@@ -1,90 +1,96 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import z from "@unicom-cloud/icons/IconUiCaretLeft";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import m from "@unicom-cloud/icons/IconUiCaretRight";
|
|
4
|
+
import B from "lodash/isFunction";
|
|
5
|
+
import F, { createContext as M, useContext as O } from "react";
|
|
6
6
|
import "../config-provider/ConfigProvider.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { omit as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
const n = [].concat(
|
|
15
|
-
return
|
|
16
|
-
},
|
|
7
|
+
import T from "../components/common/hooks/useMergeProps.js";
|
|
8
|
+
import U from "../components/common/hooks/useMergeValue.js";
|
|
9
|
+
import V from "@unicom-cloud/utils/class-name";
|
|
10
|
+
import { omit as j } from "../components/common/utils/omit.js";
|
|
11
|
+
import k from "./Item.js";
|
|
12
|
+
import L from "../config-provider/context.js";
|
|
13
|
+
const f = (s, a) => {
|
|
14
|
+
const n = [].concat(s);
|
|
15
|
+
return a ? n.slice(0, 1) : n;
|
|
16
|
+
}, q = {
|
|
17
17
|
bordered: !0,
|
|
18
18
|
lazyload: !0,
|
|
19
|
-
expandIconPosition: "left"
|
|
20
|
-
}, D = O({
|
|
21
19
|
expandIconPosition: "left",
|
|
22
|
-
|
|
20
|
+
invertHeaderContentBackgrounds: !1
|
|
21
|
+
// 潘启宝添加
|
|
22
|
+
}, D = M({
|
|
23
|
+
expandIconPosition: "left",
|
|
24
|
+
expandIcon: /* @__PURE__ */ t(m, {}),
|
|
23
25
|
activeKeys: [],
|
|
24
26
|
onToggle: () => {
|
|
25
27
|
}
|
|
26
28
|
});
|
|
27
|
-
function E(
|
|
28
|
-
const { getPrefixCls: n, componentConfig: C, rtl: v } =
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
function E(s, a) {
|
|
30
|
+
const { getPrefixCls: n, componentConfig: C, rtl: v } = O(L), e = T(
|
|
31
|
+
s,
|
|
32
|
+
q,
|
|
31
33
|
C?.Collapse
|
|
32
|
-
), [
|
|
33
|
-
defaultValue: "defaultActiveKey" in e ?
|
|
34
|
-
value: "activeKey" in e ?
|
|
34
|
+
), [c, g] = U([], {
|
|
35
|
+
defaultValue: "defaultActiveKey" in e ? f(e.defaultActiveKey, e.accordion) : void 0,
|
|
36
|
+
value: "activeKey" in e ? f(e.activeKey, e.accordion) : void 0
|
|
35
37
|
}), {
|
|
36
|
-
children:
|
|
38
|
+
children: x,
|
|
37
39
|
className: y,
|
|
38
40
|
style: I,
|
|
39
41
|
bordered: K,
|
|
40
|
-
lazyload:
|
|
41
|
-
expandIcon:
|
|
42
|
+
lazyload: h,
|
|
43
|
+
expandIcon: P,
|
|
42
44
|
expandIconPosition: l,
|
|
43
45
|
destroyOnHide: A,
|
|
44
46
|
accordion: R,
|
|
45
|
-
triggerRegion:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
triggerRegion: b,
|
|
48
|
+
invertHeaderContentBackgrounds: N,
|
|
49
|
+
// 潘启宝添加
|
|
50
|
+
onChange: d,
|
|
51
|
+
...$
|
|
52
|
+
} = e, r = n?.("collapse"), w = (i, H) => {
|
|
53
|
+
let o = [...c || []];
|
|
54
|
+
const p = c?.indexOf(i);
|
|
55
|
+
p > -1 ? o.splice(p, 1) : R ? o = [i] : o.push(i), "activeKey" in e || g(o), B(d) && d(i, o, H);
|
|
52
56
|
};
|
|
53
57
|
return /* @__PURE__ */ t(
|
|
54
58
|
D.Provider,
|
|
55
59
|
{
|
|
56
60
|
value: {
|
|
57
|
-
activeKeys:
|
|
58
|
-
triggerRegion:
|
|
59
|
-
lazyload:
|
|
61
|
+
activeKeys: c,
|
|
62
|
+
triggerRegion: b,
|
|
63
|
+
lazyload: h,
|
|
60
64
|
destroyOnHide: A,
|
|
61
65
|
expandIconPosition: l,
|
|
62
|
-
onToggle:
|
|
63
|
-
expandIcon: "expandIcon" in e ?
|
|
66
|
+
onToggle: w,
|
|
67
|
+
expandIcon: "expandIcon" in e ? P : l === "right" ? /* @__PURE__ */ t(z, {}) : /* @__PURE__ */ t(m, {})
|
|
64
68
|
},
|
|
65
69
|
children: /* @__PURE__ */ t(
|
|
66
70
|
"div",
|
|
67
71
|
{
|
|
68
|
-
ref:
|
|
69
|
-
...
|
|
70
|
-
className:
|
|
71
|
-
|
|
72
|
-
`${
|
|
73
|
-
{ [`${
|
|
72
|
+
ref: a,
|
|
73
|
+
...j($, ["activeKey", "defaultActiveKey"]),
|
|
74
|
+
className: V(
|
|
75
|
+
r,
|
|
76
|
+
`${r}-${K ? "border" : "borderless"}`,
|
|
77
|
+
{ [`${r}-rtl`]: v },
|
|
78
|
+
N && `${r}-invert-header-content-backgrounds`,
|
|
79
|
+
// 潘启宝添加
|
|
74
80
|
y
|
|
75
81
|
),
|
|
76
82
|
style: I,
|
|
77
|
-
children:
|
|
83
|
+
children: x
|
|
78
84
|
}
|
|
79
85
|
)
|
|
80
86
|
}
|
|
81
87
|
);
|
|
82
88
|
}
|
|
83
|
-
const G =
|
|
89
|
+
const G = F.forwardRef(E), u = G;
|
|
84
90
|
u.displayName = "Collapse";
|
|
85
|
-
u.Item =
|
|
91
|
+
u.Item = k;
|
|
86
92
|
export {
|
|
87
93
|
D as CollapseContext,
|
|
88
|
-
|
|
94
|
+
k as CollapseItem,
|
|
89
95
|
u as default
|
|
90
96
|
};
|
|
@@ -1,112 +1,96 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { UI_COMMON_PREFIX as
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import
|
|
6
|
-
import "
|
|
7
|
-
import "@unicom-cloud/utils/
|
|
8
|
-
import "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
import "lodash/snakeCase";
|
|
31
|
-
import "lodash/startCase";
|
|
32
|
-
import "lodash/uniq";
|
|
33
|
-
import "lodash/upperFirst";
|
|
34
|
-
import "@unicom-cloud/utils/math";
|
|
35
|
-
import "lodash/isPlainObject";
|
|
36
|
-
import "../../../dist/react-transition-group/src/CSSTransition.js";
|
|
37
|
-
import "../../../dist/react-transition-group/src/ReplaceTransition.js";
|
|
38
|
-
import "../../../dist/react-transition-group/src/SwitchTransition.js";
|
|
39
|
-
import "../../../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
40
|
-
import "../../../dist/react-transition-group/src/TransitionGroup.js";
|
|
41
|
-
import "../utils/reactDOM.js";
|
|
42
|
-
import "@unicom-cloud/utils/file/saveAs";
|
|
43
|
-
import "@unicom-cloud/utils/screenfull";
|
|
44
|
-
import "@unicom-cloud/utils/tree";
|
|
45
|
-
import { isArray as l, isNumber as I } from "@unicom-cloud/utils/is";
|
|
46
|
-
import "uuid";
|
|
47
|
-
import "../../../dist/validate/src/index.js";
|
|
48
|
-
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
49
|
-
function f(t = 8) {
|
|
50
|
-
if (I(t))
|
|
51
|
-
return t;
|
|
52
|
-
if (l(t))
|
|
53
|
-
return t.map((i, r, e) => f(i));
|
|
54
|
-
switch (t) {
|
|
55
|
-
case "mini":
|
|
56
|
-
return 4;
|
|
57
|
-
case "small":
|
|
58
|
-
return 8;
|
|
59
|
-
case "medium":
|
|
60
|
-
return 16;
|
|
61
|
-
case "large":
|
|
62
|
-
return 24;
|
|
63
|
-
default:
|
|
64
|
-
return 8;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function S(t, i) {
|
|
68
|
-
const r = `${C}-space`, {
|
|
69
|
-
className: e,
|
|
70
|
-
style: d,
|
|
71
|
-
children: $,
|
|
72
|
-
inline: y,
|
|
73
|
-
gap: N = "small",
|
|
74
|
-
direction: n = "horizontal",
|
|
75
|
-
wrap: h,
|
|
76
|
-
justifyContent: a,
|
|
77
|
-
alignItems: g,
|
|
78
|
-
...w
|
|
79
|
-
} = t;
|
|
80
|
-
let p = g;
|
|
81
|
-
n === "horizontal" && (p ||= "center");
|
|
82
|
-
const o = f(N), m = { ...d };
|
|
83
|
-
return l(o) ? (m.rowGap = o[0], m.columnGap = o[1]) : m.gap = o, /* @__PURE__ */ s(
|
|
84
|
-
"div",
|
|
1
|
+
import { jsx as c, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { UI_COMMON_PREFIX as O } from "@unicom-cloud/utils/constant/ui";
|
|
3
|
+
import P from "lodash/isArray";
|
|
4
|
+
import _ from "lodash/isNumber";
|
|
5
|
+
import { forwardRef as N, Fragment as b } from "react";
|
|
6
|
+
import k from "../hooks/useMergeProps.js";
|
|
7
|
+
import x from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import F from "./toArray.js";
|
|
9
|
+
const D = {
|
|
10
|
+
size: "small",
|
|
11
|
+
direction: "horizontal"
|
|
12
|
+
};
|
|
13
|
+
function E(a, m) {
|
|
14
|
+
const S = k(a, D, {}), {
|
|
15
|
+
className: z,
|
|
16
|
+
style: C,
|
|
17
|
+
children: M,
|
|
18
|
+
gap: j,
|
|
19
|
+
size: w,
|
|
20
|
+
direction: s,
|
|
21
|
+
align: B,
|
|
22
|
+
alignItems: R,
|
|
23
|
+
justifyContent: d,
|
|
24
|
+
wrap: l,
|
|
25
|
+
split: p,
|
|
26
|
+
rtl: $,
|
|
27
|
+
...V
|
|
28
|
+
} = S, r = `${O}-space`, h = R ?? (B || (s === "horizontal" ? "center" : "")), i = j ?? w, A = x(
|
|
29
|
+
r,
|
|
85
30
|
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
p && `${r}-align-items-${p}`,
|
|
94
|
-
e
|
|
95
|
-
),
|
|
96
|
-
style: m,
|
|
97
|
-
...w,
|
|
98
|
-
children: $
|
|
99
|
-
}
|
|
31
|
+
[`${r}-${s}`]: s,
|
|
32
|
+
[`${r}-justify-content-${d}`]: d,
|
|
33
|
+
[`${r}-align-items-${h}`]: h,
|
|
34
|
+
[`${r}-wrap`]: l,
|
|
35
|
+
[`${r}-rtl`]: $
|
|
36
|
+
},
|
|
37
|
+
z
|
|
100
38
|
);
|
|
39
|
+
function f(e) {
|
|
40
|
+
if (_(e))
|
|
41
|
+
return e;
|
|
42
|
+
switch (e) {
|
|
43
|
+
case "mini":
|
|
44
|
+
return 4;
|
|
45
|
+
case "small":
|
|
46
|
+
return 8;
|
|
47
|
+
case "medium":
|
|
48
|
+
return 16;
|
|
49
|
+
case "large":
|
|
50
|
+
return 24;
|
|
51
|
+
default:
|
|
52
|
+
return 8;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const y = F(M);
|
|
56
|
+
function I(e) {
|
|
57
|
+
const n = y.length === e + 1, o = $ ? "marginLeft" : "marginRight";
|
|
58
|
+
if (typeof i == "string" || typeof i == "number") {
|
|
59
|
+
const t = f(i);
|
|
60
|
+
return l ? n ? { marginBottom: t } : {
|
|
61
|
+
[`${o}`]: t,
|
|
62
|
+
marginBottom: t
|
|
63
|
+
} : n ? {} : {
|
|
64
|
+
[s === "vertical" ? "marginBottom" : o]: t
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (P(i)) {
|
|
68
|
+
const t = f(i[0]), u = f(i[1]);
|
|
69
|
+
return l ? n ? { marginBottom: u } : {
|
|
70
|
+
[`${o}`]: t,
|
|
71
|
+
marginBottom: u
|
|
72
|
+
} : s === "vertical" ? { marginBottom: u } : { [`${o}`]: t };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return /* @__PURE__ */ c("div", { ref: m, className: A, style: C, ...V, children: y.map((e, n) => {
|
|
76
|
+
const o = e?.key || n, t = p != null && n > 0;
|
|
77
|
+
return /* @__PURE__ */ L(b, { children: [
|
|
78
|
+
t && /* @__PURE__ */ c("div", { className: `${r}-item-split`, children: p }),
|
|
79
|
+
/* @__PURE__ */ c("div", { className: `${r}-item`, style: I(n), children: e })
|
|
80
|
+
] }, o);
|
|
81
|
+
}) });
|
|
101
82
|
}
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
83
|
+
const g = N(
|
|
84
|
+
E
|
|
85
|
+
);
|
|
86
|
+
g.displayName = "Space";
|
|
87
|
+
function H(a, m) {
|
|
88
|
+
return /* @__PURE__ */ c(g, { ref: m, ...a, direction: "vertical", children: a.children });
|
|
106
89
|
}
|
|
107
|
-
const
|
|
108
|
-
|
|
90
|
+
const v = N(H);
|
|
91
|
+
v.displayName = "SpaceVertical";
|
|
92
|
+
g.Vertical = v;
|
|
109
93
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
94
|
+
v as SpaceVertical,
|
|
95
|
+
g as default
|
|
112
96
|
};
|