@unicom-cloud/ui 0.8.81 → 0.8.83
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/Affix.js +1 -1
- package/Alert.js +1 -1
- package/AutoComplete.js +2 -2
- package/BackTop.js +2 -2
- package/Badge.js +1 -1
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +2 -2
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +2 -2
- package/Comment.js +1 -1
- package/ConfigProvider.js +5 -4
- package/Copy.js +1 -1
- package/DatePicker.js +7 -7
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/Input.js +11 -10
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/List.js +2 -2
- package/Mentions.js +2 -2
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +1 -1
- package/Notification.js +5 -5
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +1 -1
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +1 -1
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/Select.js +1 -1
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +1 -1
- package/SpeechSynthesis.js +1 -1
- package/Spin.js +1 -1
- package/Statistic.js +2 -2
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +1 -1
- package/Transfer.js +2 -2
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +1 -1
- package/Typography.js +1 -1
- package/affix/index.js +60 -57
- package/alert/index.js +53 -53
- package/anchor/Anchor.js +72 -72
- package/anchor/Link.js +27 -27
- package/anchor/util.js +1 -1
- package/auto-complete/index.js +2 -2
- package/avatar/Avatar.js +31 -31
- package/avatar/Group.js +25 -25
- package/back-top/index.js +30 -30
- package/badge/index.js +37 -37
- package/breadcrumb/index.js +26 -26
- package/button/Group.js +7 -7
- package/button/index.js +29 -29
- package/calendar/index.js +2 -2
- package/card/Grid.js +12 -12
- package/card/Meta.js +17 -17
- package/card/index.js +44 -44
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +25 -25
- package/carousel/index.js +77 -77
- package/cascader/Cascader.js +2 -2
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Group.js +2 -2
- package/checkbox/GroupBlock.js +2 -2
- package/checkbox/index.js +2 -2
- package/chunk/B6r8jPCd.js +6 -0
- package/chunk/{DLBfXSnU.js → BmulTYLW.js} +2880 -2878
- package/chunk/C9oo3EJI.js +692 -0
- package/chunk/{C5X4hOkx.js → CVSWh4ZZ.js} +80 -80
- package/chunk/DILUZgXW.js +1464 -0
- package/chunk/DSRHFFrc.js +53 -0
- package/chunk/{yLRv5RIK.js → DdJVL_4g.js} +181 -181
- package/chunk/{DYspELhF.js → DlHiTTJO.js} +223 -223
- package/chunk/{BG7YGUsx.js → R-uQJib2.js} +119 -119
- package/chunk/{DEiyXzBZ.js → ev6oHWqY.js} +63 -63
- package/chunk/{BNevupAU.js → uKZyjtff.js} +5 -4
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +2 -2
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +36 -36
- package/color-picker/InputAlpha.js +11 -11
- package/color-picker/InputHex.js +24 -24
- package/color-picker/InputRgb.js +23 -23
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +2 -2
- package/color-picker/index.js +2 -2
- package/comment/index.js +31 -31
- package/config-provider/ConfigProvider.js +5 -3
- package/config-provider/context.js +2 -2
- package/config-provider/index.js +4 -3
- package/copy/index.js +28 -28
- package/date-picker/Picker.js +276 -276
- package/date-picker/{PickerRange.js → RangePicker.js} +2 -2
- package/date-picker/index.js +26 -27
- package/descriptions/index.js +33 -33
- package/divider/index.js +12 -12
- package/draggable/index.js +23 -23
- package/drawer/Drawer.js +81 -81
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +56 -56
- package/empty/index.js +1 -1
- package/form/Form.js +76 -76
- package/form/FormItem.js +64 -64
- package/form/context.js +1 -1
- package/grid/Col.js +53 -53
- package/grid/Row.js +34 -34
- package/grid/grid-item.js +29 -29
- package/grid/grid.js +50 -50
- package/icon/index.js +20 -19
- package/icon-hover/index.js +1 -1
- package/image/Image.js +86 -86
- package/image/ImagePreview.js +2 -2
- package/image/ImagePreviewArrow.js +22 -22
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +498 -493
- package/input/Button.js +11 -0
- package/input/Group.js +8 -8
- package/input/Input.js +488 -434
- package/input/InputElement.js +1 -1
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +1 -1
- package/input/index.js +9 -8
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +40 -40
- package/layout/Content.js +7 -7
- package/layout/Footer.js +9 -9
- package/layout/Header.js +7 -7
- package/layout/Sider.js +55 -55
- package/layout/index.js +32 -32
- package/link/index.js +35 -35
- package/list/Item.js +29 -29
- package/list/Meta.js +12 -12
- package/list/index.js +2 -2
- package/mentions/index.js +2 -2
- package/menu/Menu.js +2 -2
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +1 -1
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +2 -2
- package/modal/index.js +1 -1
- package/notice/index.js +1 -1
- package/notification/index.js +5 -5
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +12 -12
- package/overflow-ellipsis/index.js +24 -24
- package/package.json +1 -1
- package/page-header/index.js +38 -38
- package/pagination/PageItem.js +16 -16
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +2 -2
- package/pagination/Pagination.js +2 -2
- package/pagination/index.js +1 -1
- package/picker/Input.js +69 -69
- package/picker/InputRange.js +111 -111
- package/popconfirm/index.js +61 -61
- package/popover/index.js +35 -35
- package/progress/index.js +22 -22
- package/radio/Group.js +2 -2
- package/radio/GroupBlock.js +2 -2
- package/radio/Radio.js +2 -2
- package/radio/index.js +2 -2
- package/rate/index.js +49 -49
- package/resize-box/ResizeTrigger.js +34 -34
- package/resize-box/Split.js +56 -56
- package/resize-box/SplitGroup.js +55 -55
- package/resize-box/index.js +51 -51
- package/result/index.js +41 -41
- package/select/Option.js +1 -1
- package/select/Select.js +2 -2
- package/select/index.js +2 -2
- package/select/util.js +1 -1
- package/select-view/Core.js +125 -125
- package/skeleton/index.js +20 -20
- package/slider/Button.js +57 -57
- package/slider/index.js +116 -116
- package/space/index.js +46 -44
- package/speech-synthesis/index.js +1 -1
- package/spin/DotLoading.js +10 -10
- package/spin/index.js +44 -44
- package/statistic/Countdown.js +34 -34
- package/statistic/index.js +67 -67
- package/steps/index.js +55 -55
- package/style.css +1 -1
- package/switch/index.js +54 -54
- package/table/Table.js +3 -3
- package/table/index.js +1 -1
- package/tabs/Tab.js +2 -2
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +12 -12
- package/tabs/index.js +2 -2
- package/tag/index.js +45 -45
- package/time-picker/Picker.js +76 -76
- package/time-picker/TimePicker.js +136 -136
- package/time-picker/index.js +8 -8
- package/time-picker/util.js +5 -5
- package/timeline/Item.js +47 -47
- package/timeline/Timeline.js +41 -41
- package/tooltip/index.js +29 -29
- package/transfer/Item.js +2 -2
- package/transfer/List.js +2 -2
- package/transfer/index.js +2 -2
- package/tree/Animation.js +2 -2
- package/tree/Node.js +2 -2
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +2 -2
- package/tree/index.js +1 -1
- package/tree-select/List.js +1 -1
- package/tree-select/Select.js +2 -2
- package/tree-select/index.js +2 -2
- package/trigger/index.js +60 -60
- package/types/config-provider/ConfigProvider.d.ts +2 -2
- package/types/config-provider/context.d.ts +1 -1
- package/types/date-picker/index.d.ts +8 -9
- package/types/date-picker/interface.d.ts +9 -9
- package/types/index.d.ts +2 -2
- package/types/input/Button.d.ts +5 -0
- package/types/input/Input.d.ts +4 -1
- package/types/input/interface.d.ts +7 -0
- package/types/picker/Input.d.ts +2 -2
- package/types/space/index.d.ts +2 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/names.d.ts +1 -1
- package/types/utils/setTheme.d.ts +2 -0
- package/typography/Base.js +53 -53
- package/typography/Ellipsis.js +10 -8
- package/typography/Operations.js +28 -28
- package/typography/Paragraph.js +8 -8
- package/typography/Typography.js +7 -7
- package/typography/index.js +1 -1
- package/upload/TriggerNode.js +47 -47
- package/upload/Upload.js +184 -184
- package/upload/request.js +1 -1
- package/upload/request_.js +1 -1
- package/utils/constant.js +1 -1
- package/utils/contextHolder.js +3 -3
- package/utils/dom.js +1 -1
- package/utils/index.js +116 -114
- package/utils/names.js +1 -1
- package/utils/setDarkTheme.js +23 -22
- package/utils/setPrimaryColor.js +22 -16
- package/utils/setTheme.js +9 -0
- package/utils/tween.js +1 -1
- package/verification-code/VerificationCode.js +49 -49
- package/version/index.js +1 -1
- package/watermark/Watermark.js +24 -24
- package/chunk/CQvM33Vg.js +0 -724
- package/chunk/D0ZWT7db.js +0 -5
- package/chunk/yhU2zeeu.js +0 -1461
- /package/types/date-picker/{PickerRange.d.ts → RangePicker.d.ts} +0 -0
package/form/FormItem.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsx as i, jsxs as q, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
-
import L, { forwardRef as ue, useContext as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { a as Ce } from "../chunk/
|
|
2
|
+
import L, { forwardRef as ue, useContext as N, useState as W, useRef as fe, useEffect as be, useMemo as G, createElement as K, cloneElement as B } from "react";
|
|
3
|
+
import he from "lodash/isArray";
|
|
4
|
+
import ge from "lodash/isFunction";
|
|
5
|
+
import v from "lodash/isPlainObject";
|
|
6
|
+
import F from "lodash/isUndefined";
|
|
7
|
+
import { a as Ce } from "../chunk/C9oo3EJI.js";
|
|
8
8
|
import Y from "../grid/index.js";
|
|
9
9
|
import { u as ye } from "../chunk/BFTV6myl.js";
|
|
10
10
|
import { P as ve } from "../chunk/NPajzdOv.js";
|
|
11
|
-
import
|
|
11
|
+
import w from "@unicom-cloud/utils/class-name";
|
|
12
12
|
import { o as we } from "../chunk/BKKEev13.js";
|
|
13
|
-
import
|
|
13
|
+
import S from "./Control.js";
|
|
14
14
|
import Fe from "./FormLabel.js";
|
|
15
15
|
import { FormItemContext as J, FormListContext as $e, FormContext as Q } from "./context.js";
|
|
16
16
|
import { VALIDATE_STATUS as T } from "./interface.js";
|
|
17
|
-
import { formatValidateMsg as
|
|
18
|
-
const
|
|
19
|
-
prefixCls:
|
|
20
|
-
help:
|
|
17
|
+
import { formatValidateMsg as Ie } from "./util.js";
|
|
18
|
+
const Ne = Y.Row, X = Y.Col, Se = ({
|
|
19
|
+
prefixCls: h,
|
|
20
|
+
help: g,
|
|
21
21
|
errors: e,
|
|
22
|
-
warnings:
|
|
22
|
+
warnings: C
|
|
23
23
|
}) => {
|
|
24
|
-
const
|
|
24
|
+
const y = e.map((p, d) => {
|
|
25
25
|
if (p)
|
|
26
26
|
return /* @__PURE__ */ i("div", { role: "alert", children: p.message }, d);
|
|
27
27
|
}), c = [];
|
|
28
|
-
|
|
28
|
+
C.map((p, d) => {
|
|
29
29
|
c.push(
|
|
30
|
-
/* @__PURE__ */ i("div", { role: "alert", className: `${
|
|
30
|
+
/* @__PURE__ */ i("div", { role: "alert", className: `${h}-message-help-warning`, children: p }, d)
|
|
31
31
|
);
|
|
32
32
|
});
|
|
33
|
-
const m = !
|
|
33
|
+
const m = !F(g) || !!c.length, u = m || !!y.length;
|
|
34
34
|
return u && /* @__PURE__ */ i(
|
|
35
35
|
ve,
|
|
36
36
|
{
|
|
@@ -42,24 +42,24 @@ const Ie = Y.Row, X = Y.Col, Ne = ({
|
|
|
42
42
|
children: /* @__PURE__ */ i(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
|
-
className:
|
|
46
|
-
[`${
|
|
45
|
+
className: w(`${h}-message`, {
|
|
46
|
+
[`${h}-message-help`]: m
|
|
47
47
|
}),
|
|
48
|
-
children:
|
|
49
|
-
|
|
48
|
+
children: F(g) ? /* @__PURE__ */ q(pe, { children: [
|
|
49
|
+
y.length > 0 && y,
|
|
50
50
|
c.length > 0 && c
|
|
51
|
-
] }) :
|
|
51
|
+
] }) : g
|
|
52
52
|
}
|
|
53
53
|
)
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
|
-
},
|
|
56
|
+
}, xe = {
|
|
57
57
|
trigger: "onChange",
|
|
58
58
|
triggerPropName: "value"
|
|
59
|
-
},
|
|
59
|
+
}, ke = (h, g) => {
|
|
60
60
|
var U, _, z;
|
|
61
|
-
const e = ye(
|
|
62
|
-
if (
|
|
61
|
+
const e = ye(h, xe), { getPrefixCls: C, prefixCls: y } = N(Ce), c = N(J), m = N($e), [u, p] = W(null), [d, A] = W(null), r = N(Q), l = r.prefixCls || (C == null ? void 0 : C("form")), D = e.layout || r.layout, Z = e.labelAlign || r.labelAlign, x = fe(!1), ee = (s, t = {}) => {
|
|
62
|
+
if (x.current)
|
|
63
63
|
return;
|
|
64
64
|
const { errors: a, warnings: f } = t || {};
|
|
65
65
|
p((b) => {
|
|
@@ -69,83 +69,83 @@ const Ie = Y.Row, X = Y.Col, Ne = ({
|
|
|
69
69
|
const o = { ...b || {} };
|
|
70
70
|
return f && f.length ? o[s] = f : delete o[s], o;
|
|
71
71
|
});
|
|
72
|
-
}, re =
|
|
73
|
-
be(() => (
|
|
74
|
-
|
|
72
|
+
}, re = v(e.noStyle) && e.noStyle.showErrorTip && c.updateFormItem ? c.updateFormItem : ee;
|
|
73
|
+
be(() => (x.current = !1, () => {
|
|
74
|
+
x.current = !0, p(null), A(null);
|
|
75
75
|
}), []);
|
|
76
76
|
const te = {
|
|
77
77
|
...r,
|
|
78
|
-
validateMessages: r.validateMessages &&
|
|
78
|
+
validateMessages: r.validateMessages && Ie(r.validateMessages, {
|
|
79
79
|
label: e.label
|
|
80
80
|
}),
|
|
81
81
|
prefixCls: l,
|
|
82
82
|
updateFormItem: re,
|
|
83
83
|
disabled: "disabled" in e ? e.disabled : r.disabled
|
|
84
|
-
}, { label: M, extra: j, className: oe, style: le, validateStatus:
|
|
84
|
+
}, { label: M, extra: j, className: oe, style: le, validateStatus: $, hidden: se, ...ne } = e, ie = w(`${l}-label-item`, {
|
|
85
85
|
[`${l}-label-item-left`]: Z === "left"
|
|
86
|
-
}), R = u ? Object.values(u) : [],
|
|
87
|
-
if (
|
|
88
|
-
return
|
|
86
|
+
}), R = u ? Object.values(u) : [], k = d ? Object.values(d).reduce((s, t) => s.concat(t), []) : [], I = G(() => {
|
|
87
|
+
if ($)
|
|
88
|
+
return $;
|
|
89
89
|
if (R.length)
|
|
90
90
|
return T.error;
|
|
91
|
-
if (
|
|
91
|
+
if (k.length)
|
|
92
92
|
return T.warning;
|
|
93
|
-
}, [u, d,
|
|
93
|
+
}, [u, d, $]), V = G(() => !F(e.help) || k.length > 0, [e.help, d]), ae = w(
|
|
94
94
|
`${l}-item`,
|
|
95
95
|
{
|
|
96
|
-
[`${l}-item-error`]: V ||
|
|
97
|
-
[`${l}-item-status-${
|
|
96
|
+
[`${l}-item-error`]: V || !$ && I === T.error,
|
|
97
|
+
[`${l}-item-status-${I}`]: I,
|
|
98
98
|
[`${l}-item-has-help`]: V,
|
|
99
99
|
[`${l}-item-hidden`]: se,
|
|
100
|
-
[`${l}-item-has-feedback`]:
|
|
100
|
+
[`${l}-item-has-feedback`]: I && e.hasFeedback
|
|
101
101
|
},
|
|
102
102
|
`${l}-layout-${D}`,
|
|
103
103
|
oe
|
|
104
104
|
), O = () => {
|
|
105
105
|
var f, b;
|
|
106
106
|
const { field: s, children: t } = e, a = "disabled" in e ? e.disabled : r.disabled;
|
|
107
|
-
if (
|
|
107
|
+
if (ge(t)) {
|
|
108
108
|
const { key: o, ...n } = e ?? {};
|
|
109
109
|
return /* @__PURE__ */ K(
|
|
110
|
-
|
|
110
|
+
S,
|
|
111
111
|
{
|
|
112
112
|
disabled: a,
|
|
113
113
|
...n,
|
|
114
114
|
key: s || o,
|
|
115
115
|
_key: s || o
|
|
116
116
|
},
|
|
117
|
-
(...
|
|
118
|
-
...
|
|
117
|
+
(...P) => t(
|
|
118
|
+
...P
|
|
119
119
|
)
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
if (
|
|
123
|
-
const o = L.Children.map(t, (n,
|
|
124
|
-
const H =
|
|
125
|
-
return
|
|
122
|
+
if (he(t)) {
|
|
123
|
+
const o = L.Children.map(t, (n, P) => {
|
|
124
|
+
const H = v(n) && n.key || P, de = v(n) && "disabled" in n.props, ce = !F(a) && !de ? { key: H, disabled: a } : { key: H };
|
|
125
|
+
return v(n) ? B(n, ce) : n;
|
|
126
126
|
});
|
|
127
|
-
return /* @__PURE__ */ i(
|
|
127
|
+
return /* @__PURE__ */ i(S, { ...e, field: void 0, children: o });
|
|
128
128
|
}
|
|
129
129
|
if (L.Children.count(t) == 1) {
|
|
130
130
|
if (s) {
|
|
131
131
|
const o = ((f = m == null ? void 0 : m.getItemKey) == null ? void 0 : f.call(m, s)) || s;
|
|
132
|
-
return /* @__PURE__ */ K(
|
|
132
|
+
return /* @__PURE__ */ K(S, { disabled: a, ...e, key: o, _key: o }, t);
|
|
133
133
|
}
|
|
134
|
-
if (
|
|
134
|
+
if (v(t)) {
|
|
135
135
|
if ((b = t.type) != null && b.isFormControl)
|
|
136
136
|
return t;
|
|
137
|
-
const n = !("disabled" in t.props) && !
|
|
138
|
-
return /* @__PURE__ */ i(
|
|
137
|
+
const n = !("disabled" in t.props) && !F(a) ? { disabled: a } : null;
|
|
138
|
+
return /* @__PURE__ */ i(S, { ...e, field: void 0, children: n ? B(t, n) : t });
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
return t;
|
|
142
|
-
}, me = J,
|
|
142
|
+
}, me = J, E = {
|
|
143
143
|
...r
|
|
144
144
|
};
|
|
145
|
-
return e.noStyle || (
|
|
146
|
-
|
|
145
|
+
return e.noStyle || (E.wrapperCol = void 0, E.labelCol = void 0), /* @__PURE__ */ i(Q.Provider, { value: E, children: /* @__PURE__ */ i(me.Provider, { value: te, children: e.noStyle ? O() : /* @__PURE__ */ q(
|
|
146
|
+
Ne,
|
|
147
147
|
{
|
|
148
|
-
ref:
|
|
148
|
+
ref: g,
|
|
149
149
|
...we(ne, [
|
|
150
150
|
"tooltip",
|
|
151
151
|
"children",
|
|
@@ -184,7 +184,7 @@ const Ie = Y.Row, X = Y.Col, Ne = ({
|
|
|
184
184
|
X,
|
|
185
185
|
{
|
|
186
186
|
...e.labelCol || r.labelCol,
|
|
187
|
-
className:
|
|
187
|
+
className: w(
|
|
188
188
|
ie,
|
|
189
189
|
(U = e.labelCol) == null ? void 0 : U.className,
|
|
190
190
|
(_ = r.labelCol) == null ? void 0 : _.className,
|
|
@@ -198,7 +198,7 @@ const Ie = Y.Row, X = Y.Col, Ne = ({
|
|
|
198
198
|
tooltip: e.tooltip,
|
|
199
199
|
htmlFor: e.field && ((z = r == null ? void 0 : r.getFormElementId) == null ? void 0 : z.call(r, e.field)),
|
|
200
200
|
label: M,
|
|
201
|
-
prefix:
|
|
201
|
+
prefix: y,
|
|
202
202
|
requiredSymbol: "requiredSymbol" in e ? e.requiredSymbol : r.requiredSymbol,
|
|
203
203
|
required: e.required,
|
|
204
204
|
rules: e.rules,
|
|
@@ -210,19 +210,19 @@ const Ie = Y.Row, X = Y.Col, Ne = ({
|
|
|
210
210
|
/* @__PURE__ */ q(
|
|
211
211
|
X,
|
|
212
212
|
{
|
|
213
|
-
className:
|
|
213
|
+
className: w(`${l}-item-wrapper`, {
|
|
214
214
|
[`${l}-item-wrapper-flex`]: !e.wrapperCol && !r.wrapperCol
|
|
215
215
|
}),
|
|
216
216
|
...e.wrapperCol || r.wrapperCol,
|
|
217
217
|
children: [
|
|
218
218
|
O(),
|
|
219
219
|
/* @__PURE__ */ i(
|
|
220
|
-
|
|
220
|
+
Se,
|
|
221
221
|
{
|
|
222
222
|
prefixCls: l,
|
|
223
223
|
help: e.help,
|
|
224
224
|
errors: R,
|
|
225
|
-
warnings:
|
|
225
|
+
warnings: k
|
|
226
226
|
}
|
|
227
227
|
),
|
|
228
228
|
j && /* @__PURE__ */ i("div", { className: `${l}-extra`, children: j })
|
|
@@ -232,8 +232,8 @@ const Ie = Y.Row, X = Y.Col, Ne = ({
|
|
|
232
232
|
]
|
|
233
233
|
}
|
|
234
234
|
) }) });
|
|
235
|
-
},
|
|
236
|
-
|
|
235
|
+
}, Ee = ue(ke);
|
|
236
|
+
Ee.displayName = "FormItem";
|
|
237
237
|
export {
|
|
238
|
-
|
|
238
|
+
Ee as default
|
|
239
239
|
};
|
package/form/context.js
CHANGED
package/grid/Col.js
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
import { jsx as F } from "react/jsx-runtime";
|
|
2
2
|
import H from "lodash/isNumber";
|
|
3
3
|
import T from "lodash/isPlainObject";
|
|
4
|
-
import { forwardRef as q, useContext as
|
|
5
|
-
import { a as
|
|
6
|
-
import { u as
|
|
7
|
-
import
|
|
8
|
-
import { RowContext as
|
|
9
|
-
const
|
|
4
|
+
import { forwardRef as q, useContext as w, useMemo as D } from "react";
|
|
5
|
+
import { a as I } from "../chunk/C9oo3EJI.js";
|
|
6
|
+
import { u as J } from "../chunk/BFTV6myl.js";
|
|
7
|
+
import K from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import { RowContext as Q } from "./context.js";
|
|
9
|
+
const U = {
|
|
10
10
|
span: 24
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function A(i) {
|
|
13
13
|
return typeof i == "string" && /\d+[px|%|em|rem|]{1}/.test(i) ? `0 0 ${i}` : i;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const { getPrefixCls:
|
|
15
|
+
function W(i, G) {
|
|
16
|
+
const { getPrefixCls: l, componentConfig: a, rtl: L } = w(I), M = J(
|
|
17
17
|
i,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
), { gutter: p, div:
|
|
21
|
-
className:
|
|
22
|
-
style:
|
|
23
|
-
children:
|
|
18
|
+
U,
|
|
19
|
+
a == null ? void 0 : a["Grid.Col"]
|
|
20
|
+
), { gutter: p, div: f } = w(Q), {
|
|
21
|
+
className: N,
|
|
22
|
+
style: O,
|
|
23
|
+
children: P,
|
|
24
24
|
span: V,
|
|
25
|
-
offset:
|
|
26
|
-
order:
|
|
27
|
-
pull:
|
|
28
|
-
push:
|
|
29
|
-
xs:
|
|
25
|
+
offset: u,
|
|
26
|
+
order: c,
|
|
27
|
+
pull: m,
|
|
28
|
+
push: x,
|
|
29
|
+
xs: y,
|
|
30
30
|
sm: g,
|
|
31
|
-
md:
|
|
32
|
-
lg:
|
|
33
|
-
xl:
|
|
34
|
-
xxl:
|
|
35
|
-
xxxl:
|
|
36
|
-
flex:
|
|
31
|
+
md: h,
|
|
32
|
+
lg: b,
|
|
33
|
+
xl: j,
|
|
34
|
+
xxl: R,
|
|
35
|
+
xxxl: S,
|
|
36
|
+
flex: d,
|
|
37
37
|
...k
|
|
38
|
-
} =
|
|
38
|
+
} = M;
|
|
39
39
|
function z(r, o) {
|
|
40
|
-
const
|
|
41
|
-
return Object.keys(
|
|
42
|
-
const t =
|
|
40
|
+
const v = { xs: y, sm: g, md: h, lg: b, xl: j, xxl: R, xxxl: S };
|
|
41
|
+
return Object.keys(v).forEach((n) => {
|
|
42
|
+
const t = v[n];
|
|
43
43
|
H(t) ? t >= 0 && (o[`${r}-${n}-${t}`] = !0) : T(t) && (o[`${r}-${n}-${t.span}`] = t.span, o[`${r}-${n}-offset-${t.offset}`] = t.offset, o[`${r}-${n}-order-${t.order}`] = t.order, o[`${r}-${n}-pull-${t.pull}`] = t.pull, o[`${r}-${n}-push-${t.push}`] = t.push);
|
|
44
44
|
}), o;
|
|
45
45
|
}
|
|
46
|
-
const s =
|
|
47
|
-
let
|
|
48
|
-
[`${s}`]:
|
|
49
|
-
[`${s}-order-${
|
|
50
|
-
[`${s}-${V}`]:
|
|
51
|
-
[`${s}-offset-${
|
|
52
|
-
[`${s}-pull-${
|
|
53
|
-
[`${s}-push-${
|
|
54
|
-
[`${s}-rtl`]:
|
|
46
|
+
const s = l == null ? void 0 : l("col");
|
|
47
|
+
let e = {
|
|
48
|
+
[`${s}`]: !f,
|
|
49
|
+
[`${s}-order-${c}`]: c,
|
|
50
|
+
[`${s}-${V}`]: !f && !y && !g && !h && !b && !j && !R && !S,
|
|
51
|
+
[`${s}-offset-${u}`]: u,
|
|
52
|
+
[`${s}-pull-${m}`]: m,
|
|
53
|
+
[`${s}-push-${x}`]: x,
|
|
54
|
+
[`${s}-rtl`]: L
|
|
55
55
|
};
|
|
56
|
-
|
|
57
|
-
const B =
|
|
58
|
-
if (Array.isArray(p) &&
|
|
56
|
+
e = z(s, e);
|
|
57
|
+
const B = K(d ? s : e, N), $ = {};
|
|
58
|
+
if (Array.isArray(p) && !f) {
|
|
59
59
|
const r = p[0] && p[0] / 2 || 0, o = p[1] && p[1] / 2 || 0;
|
|
60
|
-
r && (
|
|
60
|
+
r && ($.paddingLeft = r, $.paddingRight = r), o && ($.paddingTop = o, $.paddingBottom = o);
|
|
61
61
|
}
|
|
62
|
-
const E =
|
|
63
|
-
() =>
|
|
64
|
-
[
|
|
62
|
+
const E = D(
|
|
63
|
+
() => A(d) ? { flex: A(d) } : {},
|
|
64
|
+
[d]
|
|
65
65
|
);
|
|
66
66
|
return /* @__PURE__ */ F(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
|
-
ref:
|
|
69
|
+
ref: G,
|
|
70
70
|
...k,
|
|
71
71
|
style: {
|
|
72
|
-
...
|
|
73
|
-
|
|
72
|
+
...O,
|
|
73
|
+
...$,
|
|
74
74
|
...E
|
|
75
75
|
},
|
|
76
76
|
className: B,
|
|
77
|
-
children:
|
|
77
|
+
children: P
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const X = q(W);
|
|
82
|
+
X.displayName = "Col";
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
X as default
|
|
85
85
|
};
|
package/grid/Row.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { a as B } from "../chunk/
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useContext as G, useState as H, useRef as P, useEffect as V } from "react";
|
|
3
|
+
import { a as B } from "../chunk/C9oo3EJI.js";
|
|
4
4
|
import { u as E } from "../chunk/BFTV6myl.js";
|
|
5
5
|
import L from "@unicom-cloud/utils/class-name";
|
|
6
6
|
import { o as M } from "../chunk/BKKEev13.js";
|
|
7
|
-
import { responsiveObserve as x, responsiveArray as
|
|
7
|
+
import { responsiveObserve as x, responsiveArray as b } from "../utils/responsiveObserve.js";
|
|
8
8
|
import { RowContext as O } from "./context.js";
|
|
9
9
|
const T = {
|
|
10
10
|
gutter: 0,
|
|
11
11
|
align: "start",
|
|
12
12
|
justify: "start"
|
|
13
13
|
};
|
|
14
|
-
function q(
|
|
15
|
-
const { getPrefixCls:
|
|
16
|
-
|
|
14
|
+
function q(A, j) {
|
|
15
|
+
const { getPrefixCls: i, componentConfig: a, rtl: v } = G(B), R = E(
|
|
16
|
+
A,
|
|
17
17
|
T,
|
|
18
|
-
|
|
19
|
-
), { className: w, style: $, children:
|
|
18
|
+
a == null ? void 0 : a["Grid.Row"]
|
|
19
|
+
), { className: w, style: $, children: N, div: n, align: l, justify: p, gutter: r, ...h } = R, [C, k] = H({
|
|
20
20
|
xs: !0,
|
|
21
21
|
sm: !0,
|
|
22
22
|
md: !0,
|
|
@@ -24,19 +24,19 @@ function q(b, A) {
|
|
|
24
24
|
xl: !0,
|
|
25
25
|
xxl: !0,
|
|
26
26
|
xxxl: !0
|
|
27
|
-
}),
|
|
28
|
-
V(() => (
|
|
29
|
-
(!Array.isArray(r) && typeof r == "object" || Array.isArray(r) && (typeof r[0] == "object" || typeof r[1] == "object")) &&
|
|
27
|
+
}), y = P();
|
|
28
|
+
V(() => (y.current = x.subscribe((t) => {
|
|
29
|
+
(!Array.isArray(r) && typeof r == "object" || Array.isArray(r) && (typeof r[0] == "object" || typeof r[1] == "object")) && k(t);
|
|
30
30
|
}), () => {
|
|
31
|
-
x.unsubscribe(
|
|
31
|
+
x.unsubscribe(y.current);
|
|
32
32
|
}), []);
|
|
33
|
-
function
|
|
33
|
+
function g(t) {
|
|
34
34
|
let e = 0;
|
|
35
35
|
if (typeof t == "object")
|
|
36
|
-
for (let
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
e = t[
|
|
36
|
+
for (let m = 0; m < b.length; m++) {
|
|
37
|
+
const f = b[m];
|
|
38
|
+
if (C[f] && t[f] !== void 0) {
|
|
39
|
+
e = t[f];
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -44,42 +44,42 @@ function q(b, A) {
|
|
|
44
44
|
e = t;
|
|
45
45
|
return e;
|
|
46
46
|
}
|
|
47
|
-
const s =
|
|
47
|
+
const s = i == null ? void 0 : i("row"), S = L(
|
|
48
48
|
{
|
|
49
|
-
[`${s}`]: !
|
|
50
|
-
[`${s}-align-${
|
|
51
|
-
[`${s}-justify-${
|
|
49
|
+
[`${s}`]: !n,
|
|
50
|
+
[`${s}-align-${l}`]: l,
|
|
51
|
+
[`${s}-justify-${p}`]: p,
|
|
52
52
|
[`${s}-rtl`]: v
|
|
53
53
|
},
|
|
54
54
|
w
|
|
55
|
-
), o = {},
|
|
55
|
+
), o = {}, c = g(
|
|
56
56
|
Array.isArray(r) ? r[0] : r
|
|
57
|
-
),
|
|
58
|
-
if ((
|
|
59
|
-
const t = -
|
|
57
|
+
), u = g(Array.isArray(r) ? r[1] : 0);
|
|
58
|
+
if ((c || u) && !n) {
|
|
59
|
+
const t = -c / 2, e = -u / 2;
|
|
60
60
|
t && (o.marginLeft = t, o.marginRight = t), e && (o.marginTop = e, o.marginBottom = e);
|
|
61
61
|
}
|
|
62
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ d(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
ref:
|
|
66
|
-
...M(
|
|
65
|
+
ref: j,
|
|
66
|
+
...M(h, ["gutter"]),
|
|
67
67
|
style: {
|
|
68
68
|
...$,
|
|
69
69
|
...o
|
|
70
70
|
},
|
|
71
|
-
className:
|
|
72
|
-
children: /* @__PURE__ */
|
|
71
|
+
className: S,
|
|
72
|
+
children: /* @__PURE__ */ d(
|
|
73
73
|
O.Provider,
|
|
74
74
|
{
|
|
75
|
-
value: { gutter: [
|
|
76
|
-
children:
|
|
75
|
+
value: { gutter: [c, u], div: n },
|
|
76
|
+
children: N
|
|
77
77
|
}
|
|
78
78
|
)
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
const D =
|
|
82
|
+
const D = z(q);
|
|
83
83
|
D.displayName = "Row";
|
|
84
84
|
export {
|
|
85
85
|
D as default
|
package/grid/grid-item.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as Q } from "react/jsx-runtime";
|
|
2
2
|
import T from "lodash/isFunction";
|
|
3
3
|
import V from "lodash/isString";
|
|
4
|
-
import
|
|
5
|
-
import { a as z } from "../chunk/
|
|
4
|
+
import l, { forwardRef as k, useContext as u, useMemo as d, useEffect as q } from "react";
|
|
5
|
+
import { a as z } from "../chunk/C9oo3EJI.js";
|
|
6
6
|
import { u as A } from "../chunk/BFTV6myl.js";
|
|
7
7
|
import H from "@unicom-cloud/utils/class-name";
|
|
8
8
|
import { GridContext as J, GridDataCollectorContext as K } from "./context.js";
|
|
9
|
-
import { u as
|
|
9
|
+
import { u as G } from "../chunk/xAb6ZgqS.js";
|
|
10
10
|
import { resolveItemData as L } from "./util.js";
|
|
11
11
|
const U = {
|
|
12
12
|
suffix: !1,
|
|
13
13
|
offset: 0,
|
|
14
14
|
span: 1
|
|
15
15
|
};
|
|
16
|
-
function W(
|
|
17
|
-
const { getPrefixCls:
|
|
18
|
-
|
|
16
|
+
function W(S, g) {
|
|
17
|
+
const { getPrefixCls: a, componentConfig: f, rtl: v } = u(z), m = A(
|
|
18
|
+
S,
|
|
19
19
|
U,
|
|
20
|
-
|
|
20
|
+
f == null ? void 0 : f["Grid.GridItem"]
|
|
21
21
|
), {
|
|
22
22
|
children: i,
|
|
23
23
|
className: y,
|
|
@@ -25,51 +25,51 @@ function W(_, g) {
|
|
|
25
25
|
offset: D,
|
|
26
26
|
span: R,
|
|
27
27
|
__index__: o
|
|
28
|
-
} =
|
|
28
|
+
} = m, r = u(J), { collectItemData: E, removeItemData: w } = u(
|
|
29
29
|
K
|
|
30
|
-
), { colGap:
|
|
31
|
-
[`${
|
|
32
|
-
[`${
|
|
33
|
-
},
|
|
34
|
-
suffix: !!
|
|
30
|
+
), { colGap: p, cols: x, displayIndexList: c, overflow: $ } = r, I = G(D, 0), n = G(R, 1), C = a == null ? void 0 : a("grid-item"), M = c == null ? void 0 : c.includes(o), b = {
|
|
31
|
+
[`${C}`]: !0,
|
|
32
|
+
[`${C}-rtl`]: v
|
|
33
|
+
}, F = H(b, y), e = d(() => L(r.cols, {
|
|
34
|
+
suffix: !!m.suffix,
|
|
35
35
|
span: n,
|
|
36
|
-
offset:
|
|
37
|
-
}), [r.cols,
|
|
36
|
+
offset: I
|
|
37
|
+
}), [r.cols, m.suffix, n, I]);
|
|
38
38
|
q(() => (E(o, e), () => {
|
|
39
|
-
|
|
39
|
+
w(o);
|
|
40
40
|
}), [o, e]);
|
|
41
|
-
const
|
|
41
|
+
const P = d(() => {
|
|
42
42
|
const { offset: t, span: s } = e;
|
|
43
43
|
return t > 0 ? {
|
|
44
|
-
marginLeft: `calc((${`(100% - ${
|
|
44
|
+
marginLeft: `calc((${`(100% - ${p * (s - 1)}px) / ${s}`} * ${t}) + ${p * t}px)`
|
|
45
45
|
} : {};
|
|
46
|
-
}, [e,
|
|
46
|
+
}, [e, p]), j = d(() => {
|
|
47
47
|
const { suffix: t, span: s } = e;
|
|
48
|
-
return t ? `${
|
|
49
|
-
}, [e,
|
|
48
|
+
return t ? `${x - s + 1}` : `span ${s}`;
|
|
49
|
+
}, [e, x]), B = !M || n === 0 ? { display: "none" } : {}, O = {
|
|
50
50
|
gridColumn: `${j} / span ${n}`,
|
|
51
|
-
...
|
|
51
|
+
...P,
|
|
52
52
|
...B
|
|
53
53
|
};
|
|
54
54
|
return /* @__PURE__ */ Q(
|
|
55
55
|
"div",
|
|
56
56
|
{
|
|
57
57
|
ref: g,
|
|
58
|
-
className:
|
|
58
|
+
className: F,
|
|
59
59
|
style: {
|
|
60
60
|
...O,
|
|
61
61
|
...N
|
|
62
62
|
},
|
|
63
|
-
children: T(i) ? i({ overflow:
|
|
64
|
-
overflow:
|
|
63
|
+
children: T(i) ? i({ overflow: $ }) : l.Children.map(i, (t) => t && r.collapsed && l.isValidElement(t) && !V(t.type) ? l.cloneElement(t, {
|
|
64
|
+
overflow: $,
|
|
65
65
|
...t.props
|
|
66
66
|
}) : t)
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
|
-
const X = k(W),
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
const X = k(W), _ = X;
|
|
71
|
+
_.displayName = "GridItem";
|
|
72
|
+
_.__PQB_GRID_ITEM__ = !0;
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
_ as default
|
|
75
75
|
};
|