@unicom-cloud/ui 0.8.96 → 0.8.98
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/Carousel.js +1 -1
- package/LiquidFill.js +4 -0
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Tour.js +63 -0
- package/Trigger.js +1 -1
- package/_virtual/_commonjsHelpers.js +6 -0
- package/_virtual/index.js +7 -0
- package/_virtual/index2.js +4 -0
- package/affix/index.js +70 -72
- package/alert/index.js +56 -56
- package/anchor/Anchor.js +55 -55
- package/anchor/Link.js +34 -34
- package/anchor/util.js +5 -5
- package/auto-complete/index.js +116 -122
- package/avatar/Avatar.js +33 -33
- package/avatar/Group.js +26 -26
- package/back-top/index.js +58 -61
- package/badge/index.js +46 -46
- package/breadcrumb/Item.js +42 -43
- package/breadcrumb/index.js +47 -47
- package/button/Group.js +6 -6
- package/button/index.js +91 -91
- package/calendar/Month.js +75 -75
- package/calendar/Year.js +35 -35
- package/calendar/header/index.js +25 -25
- package/calendar/index.js +103 -103
- package/card/Grid.js +8 -8
- package/card/Meta.js +16 -16
- package/card/index.js +49 -49
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +26 -26
- package/carousel/index.js +108 -108
- package/cascader/Cascader.js +178 -191
- package/cascader/base/node.js +133 -136
- package/cascader/base/store.js +82 -85
- package/cascader/panel/List.js +125 -129
- package/cascader/panel/Search.js +79 -81
- package/cascader/util.js +13 -13
- package/checkbox/Checkbox.js +94 -96
- package/checkbox/Group.js +54 -56
- package/checkbox/GroupBlock.js +28 -29
- package/collapse/Collapse.js +45 -45
- package/collapse/Item.js +53 -55
- package/color-picker/ControlBar.js +43 -43
- package/color-picker/InputAlpha.js +12 -12
- package/color-picker/InputHex.js +30 -31
- package/color-picker/InputRgb.js +24 -24
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +122 -125
- package/color-picker/hooks/useColorPicker.js +85 -88
- package/color-picker/hooks/useControlBlock.js +38 -40
- package/color-picker/index.js +47 -47
- package/comment/index.js +29 -29
- package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
- package/components/common/hooks/useId.js +8 -8
- package/components/common/hooks/useInView.js +16 -16
- package/components/common/hooks/useIntersectionObserver.js +1 -1
- package/components/common/hooks/useKeyboardEvent.js +9 -10
- package/components/common/hooks/useOverflowHidden.js +1 -4
- package/components/common/hooks/usePersistCallback.js +7 -7
- package/components/common/hooks/useStateCallback.js +9 -10
- package/components/common/hooks/useWindowSize.js +8 -8
- package/components/common/space/index.js +9 -7
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/components/common/utils/dom.js +27 -29
- package/components/common/utils/findScrollParent.js +17 -0
- package/components/common/utils/intersectionObserver.js +21 -0
- package/components/common/utils/is.js +99 -109
- package/components/common/utils/mutationObserver.js +19 -0
- package/components/common/utils/reactDOM.js +34 -34
- package/components/common/utils/resizeObserver.js +21 -0
- package/copy/index.js +38 -40
- package/date-picker/Picker.js +290 -295
- package/date-picker/RangePicker.js +367 -372
- package/date-picker/index.js +33 -35
- package/date-picker/panel/Body.js +46 -47
- package/date-picker/panel/Header.js +33 -33
- package/date-picker/panel/Shortcut.js +31 -31
- package/date-picker/panel/date/index.js +85 -85
- package/date-picker/panel/month/index.js +59 -59
- package/date-picker/panel/quarter/index.js +67 -70
- package/date-picker/panel/range/index.js +101 -101
- package/date-picker/panel/year/index.js +39 -39
- package/date-picker/util.js +17 -18
- package/descriptions/index.js +62 -62
- package/details/index.js +53 -55
- package/development/index.js +9 -9
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/validate/src/index.js +5 -5
- package/dist/validate/src/util.js +1 -1
- package/divider/index.js +21 -21
- package/draggable/Item.js +35 -35
- package/draggable/index.js +22 -22
- package/drawer/Drawer.js +142 -147
- package/dropdown/Button.js +48 -48
- package/dropdown/index.js +88 -92
- package/empty/index.js +16 -16
- package/form/Control.js +211 -225
- package/form/Form.js +109 -113
- package/form/FormItem.js +118 -120
- package/form/FormList.js +60 -66
- package/form/FormProvider.js +31 -34
- package/form/hook/useContext.js +17 -19
- package/form/hook/useState.js +22 -23
- package/form/hook/useWatch.js +26 -27
- package/form/promisify.js +14 -18
- package/form/store.js +304 -316
- package/form/util.js +14 -15
- package/grid/Col.js +64 -64
- package/grid/Grid.js +51 -51
- package/grid/GridItem.js +48 -48
- package/grid/Row.js +39 -39
- package/hooks/useVerificationCode.js +41 -43
- package/hooks/useWatermark.js +89 -92
- package/icon/index.js +23 -24
- package/icon-hover/index.js +16 -16
- package/icons/file.js +11 -11
- package/image/Image.js +140 -141
- package/image/ImagePreview.js +252 -255
- package/image/ImagePreviewArrow.js +25 -25
- package/image/ImagePreviewGroup.js +62 -62
- package/image/util/getScale.js +25 -28
- package/index.js +684 -675
- package/input/Button.js +48 -50
- package/input/Group.js +9 -9
- package/input/Input.js +145 -154
- package/input/InputElement.js +108 -115
- package/input/Password.js +38 -38
- package/input/Search.js +51 -55
- package/input/Textarea.js +80 -81
- package/input/useComposition.js +23 -23
- package/input-number/decimal.js +59 -62
- package/input-number/index.js +139 -141
- package/input-tag/InputTag.js +222 -230
- package/layout/Content.js +6 -6
- package/layout/Footer.js +8 -8
- package/layout/Header.js +7 -7
- package/layout/Sider.js +88 -90
- package/layout/index.js +30 -30
- package/link/index.js +45 -46
- package/liquid-fill/LiquidFill.js +226 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/list/Item.js +28 -28
- package/list/Meta.js +12 -12
- package/list/index.js +146 -148
- package/mentions/index.js +75 -76
- package/menu/Item.js +58 -58
- package/menu/Menu.js +125 -127
- package/menu/OverflowWrap.js +39 -40
- package/menu/sub-menu/Inline.js +45 -45
- package/menu/util.js +26 -28
- package/message/index.js +96 -99
- package/message/useMessage.js +26 -27
- package/modal/Confirm.js +47 -49
- package/modal/Modal.js +250 -257
- package/modal/use-modal/Hook.js +26 -28
- package/modal/use-modal/index.js +46 -49
- package/notice/index.js +89 -90
- package/notification/index.js +60 -65
- package/notification/withNotification.js +35 -35
- package/overflow-ellipsis/OverflowItem.js +19 -20
- package/overflow-ellipsis/index.js +45 -46
- package/package.json +1 -1
- package/page-header/index.js +45 -45
- package/pagination/PageItem.js +87 -91
- package/pagination/PageJumper.js +40 -41
- package/pagination/PageOption.js +31 -35
- package/pagination/Pagination.js +162 -163
- package/picker/Input.js +90 -96
- package/picker/InputRange.js +115 -122
- package/popconfirm/index.js +98 -100
- package/popover/index.js +28 -28
- package/portal/Portal.js +10 -11
- package/progress/index.js +36 -36
- package/qr-code/index.js +99 -0
- package/qr-code/interface.js +1 -0
- package/radio/Group.js +48 -48
- package/radio/GroupBlock.js +32 -33
- package/radio/Radio.js +62 -64
- package/rate/index.js +88 -88
- package/resize-box/ResizeTrigger.js +39 -39
- package/resize-box/Split.js +92 -96
- package/resize-box/SplitGroup.js +116 -122
- package/resize-box/index.js +112 -115
- package/result/index.js +44 -44
- package/select/Option.js +53 -56
- package/select/Select.js +365 -381
- package/select/util.js +95 -99
- package/select-view/Core.js +159 -160
- package/skeleton/index.js +23 -23
- package/slider/Button.js +84 -92
- package/slider/Input.js +47 -49
- package/slider/Tick.js +28 -31
- package/slider/index.js +107 -107
- package/space/index.js +26 -26
- package/space-/index.js +51 -51
- package/spin/DotLoading.js +8 -8
- package/spin/index.js +47 -47
- package/statistic/Countdown.js +37 -37
- package/statistic/index.js +58 -58
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +77 -78
- package/table/ColGroup.js +36 -37
- package/table/Table.js +447 -450
- package/table/hook/useExpand.js +24 -24
- package/table/hook/useRowSelection.js +62 -62
- package/table/summary/Row.js +16 -17
- package/table/tbody/Td.js +119 -118
- package/table/tbody/Tr.js +119 -121
- package/table/tbody/index.js +62 -63
- package/table/th-resizable/index.js +30 -30
- package/table/thead/Column.js +148 -148
- package/table/thead/index.js +87 -88
- package/tabs/Tab.js +55 -55
- package/tabs/TabContent.js +8 -8
- package/tabs/TabPane.js +15 -15
- package/tabs/hook/useHeaderScroll.js +36 -36
- package/tabs/tab-header/TabInk.js +31 -33
- package/tabs/tab-header/TabNavIcon.js +34 -35
- package/tabs/tab-header/index.js +192 -195
- package/tag/index.js +94 -97
- package/time-picker/Picker.js +167 -172
- package/time-picker/RangePicker.js +28 -28
- package/time-picker/TimePicker.js +146 -146
- package/timeline/Item.js +46 -46
- package/timeline/Timeline.js +52 -52
- package/tooltip/index.js +89 -95
- package/tour/index.js +289 -0
- package/transfer/Item.js +54 -54
- package/transfer/List.js +134 -136
- package/transfer/index.js +91 -91
- package/tree/Animation.js +49 -52
- package/tree/Node.js +114 -122
- package/tree/NodeList.js +51 -51
- package/tree/Tree.js +386 -393
- package/tree-select/List.js +71 -72
- package/tree-select/Select.js +135 -143
- package/tree-select/hook/useKeyCache.js +39 -39
- package/tree-select/hook/useStateValue.js +12 -12
- package/trigger/getPopupStyle.js +60 -61
- package/trigger/index.js +337 -346
- package/types/common/space/interface.d.ts +1 -1
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/common/utils/findScrollParent.d.ts +2 -0
- package/types/common/utils/index.d.ts +5 -0
- package/types/common/utils/intersectionObserver.d.ts +2 -0
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/config-provider/interface.d.ts +6 -0
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +2 -0
- package/types/pc/qr-code/index.d.ts +34 -0
- package/types/pc/qr-code/interface.d.ts +39 -0
- package/types/pc/table/interface.d.ts +2 -2
- package/types/pc/tour/index.d.ts +42 -0
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/pc/utils/findScrollParent.d.ts +2 -0
- package/types/pc/utils/index.d.ts +5 -0
- package/types/pc/utils/intersectionObserver.d.ts +2 -0
- package/types/pc/utils/mutationObserver.d.ts +2 -0
- package/types/pc/utils/names.d.ts +18 -0
- package/types/pc/utils/resizeObserver.d.ts +2 -0
- package/typography/Base.js +79 -81
- package/typography/EditContent.js +30 -33
- package/typography/Ellipsis.js +77 -73
- package/typography/Operations.js +50 -52
- package/typography/Paragraph.js +7 -7
- package/typography/Typography.js +7 -7
- package/typography/useEllipsis.js +105 -106
- package/upload/TriggerNode.js +69 -76
- package/upload/Upload.js +84 -87
- package/upload/Uploader.js +115 -118
- package/upload/list/PictureItem.js +61 -71
- package/upload/list/TextItem.js +61 -67
- package/upload/list/UploadProgress.js +42 -49
- package/upload/list/index.js +48 -49
- package/upload/request_.js +37 -38
- package/upload/util.js +39 -39
- package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/utils/findScrollParent.js +4 -0
- package/utils/index.js +281 -278
- package/utils/intersectionObserver.js +4 -0
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/resizeObserver.js +4 -0
- package/verification-code/VerificationCode.js +50 -51
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +243 -244
- package/virtual-list/util/item.js +3 -4
- package/watermark/Watermark.js +27 -31
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
package/radio/Group.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import A from "lodash/isArray";
|
|
3
3
|
import M from "lodash/isPlainObject";
|
|
4
4
|
import { createContext as D, useContext as F } from "react";
|
|
@@ -8,89 +8,89 @@ import S from "../components/common/hooks/useMergeValue.js";
|
|
|
8
8
|
import T from "@unicom-cloud/utils/class-name";
|
|
9
9
|
import { pickTriggerPropsFromRest as _ } from "../utils/constant.js";
|
|
10
10
|
import { pickDataAttributes as q } from "../components/common/utils/pick.js";
|
|
11
|
-
import
|
|
11
|
+
import f from "./Radio.js";
|
|
12
12
|
import w from "../config-provider/context.js";
|
|
13
|
-
const
|
|
13
|
+
const g = {
|
|
14
14
|
type: "radio"
|
|
15
15
|
}, B = {
|
|
16
16
|
type: "radio",
|
|
17
17
|
mode: "outline",
|
|
18
18
|
direction: "horizontal"
|
|
19
|
-
},
|
|
19
|
+
}, v = D(g), re = ({ children: s }) => /* @__PURE__ */ t(v.Provider, { value: g, children: s });
|
|
20
20
|
function E(s) {
|
|
21
21
|
const {
|
|
22
|
-
getPrefixCls:
|
|
23
|
-
size:
|
|
24
|
-
componentConfig:
|
|
25
|
-
rtl:
|
|
22
|
+
getPrefixCls: C,
|
|
23
|
+
size: x,
|
|
24
|
+
componentConfig: h,
|
|
25
|
+
rtl: $
|
|
26
26
|
} = F(w), e = O(
|
|
27
27
|
s,
|
|
28
28
|
B,
|
|
29
|
-
|
|
29
|
+
h?.["Radio.Group"]
|
|
30
30
|
), {
|
|
31
|
-
style:
|
|
32
|
-
className:
|
|
33
|
-
name:
|
|
34
|
-
children:
|
|
35
|
-
direction:
|
|
36
|
-
type:
|
|
37
|
-
mode:
|
|
38
|
-
options:
|
|
39
|
-
disabled:
|
|
40
|
-
} = e, [
|
|
31
|
+
style: b,
|
|
32
|
+
className: z,
|
|
33
|
+
name: P,
|
|
34
|
+
children: y,
|
|
35
|
+
direction: u,
|
|
36
|
+
type: d,
|
|
37
|
+
mode: p,
|
|
38
|
+
options: l,
|
|
39
|
+
disabled: i
|
|
40
|
+
} = e, [c, V] = S(void 0, {
|
|
41
41
|
defaultValue: e.defaultValue,
|
|
42
42
|
value: e.value
|
|
43
|
-
}),
|
|
43
|
+
}), m = e.size || x, o = C?.("radio"), N = T(
|
|
44
44
|
`${o}-group`,
|
|
45
45
|
{
|
|
46
|
-
[`${o}-group-type-button`]:
|
|
47
|
-
[`${o}-size-${
|
|
48
|
-
[`${o}-mode-${
|
|
49
|
-
[`${o}-group-disabled`]:
|
|
50
|
-
[`${o}-group-direction-horizontal`]:
|
|
46
|
+
[`${o}-group-type-button`]: d !== "radio",
|
|
47
|
+
[`${o}-size-${m}`]: !!m,
|
|
48
|
+
[`${o}-mode-${p}`]: !!p,
|
|
49
|
+
[`${o}-group-disabled`]: i,
|
|
50
|
+
[`${o}-group-direction-horizontal`]: u === "horizontal",
|
|
51
51
|
// 潘启宝添加
|
|
52
|
-
[`${o}-group-direction-vertical`]:
|
|
53
|
-
[`${o}-group-rtl`]:
|
|
52
|
+
[`${o}-group-direction-vertical`]: u === "vertical",
|
|
53
|
+
[`${o}-group-rtl`]: $
|
|
54
54
|
},
|
|
55
|
-
|
|
55
|
+
z
|
|
56
56
|
), R = {
|
|
57
|
-
onChangeValue: (r,
|
|
58
|
-
const { onChange:
|
|
59
|
-
r !==
|
|
57
|
+
onChangeValue: (r, n) => {
|
|
58
|
+
const { onChange: a } = e;
|
|
59
|
+
r !== c && ("value" in e || V(r), a?.(r, n));
|
|
60
60
|
},
|
|
61
|
-
type:
|
|
62
|
-
value:
|
|
63
|
-
disabled:
|
|
61
|
+
type: d,
|
|
62
|
+
value: c,
|
|
63
|
+
disabled: i,
|
|
64
64
|
group: !0,
|
|
65
|
-
name:
|
|
65
|
+
name: P
|
|
66
66
|
};
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ t(v.Provider, { value: R, children: /* @__PURE__ */ t(
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
70
|
-
className:
|
|
70
|
+
className: N,
|
|
71
71
|
role: "radiogroup",
|
|
72
|
-
style:
|
|
72
|
+
style: b,
|
|
73
73
|
..._(e),
|
|
74
74
|
...q(e),
|
|
75
|
-
children:
|
|
76
|
-
const { value:
|
|
77
|
-
return M(r) ? /* @__PURE__ */
|
|
78
|
-
|
|
75
|
+
children: l && A(l) ? l.map((r, n) => {
|
|
76
|
+
const { value: a, label: G, disabled: j, ...k } = r;
|
|
77
|
+
return M(r) ? /* @__PURE__ */ t(
|
|
78
|
+
f,
|
|
79
79
|
{
|
|
80
80
|
...k,
|
|
81
|
-
disabled:
|
|
82
|
-
value:
|
|
81
|
+
disabled: i || j,
|
|
82
|
+
value: a,
|
|
83
83
|
children: G
|
|
84
84
|
},
|
|
85
|
-
|
|
86
|
-
) : /* @__PURE__ */
|
|
87
|
-
}) :
|
|
85
|
+
a
|
|
86
|
+
) : /* @__PURE__ */ t(f, { value: r, disabled: i, children: r }, n);
|
|
87
|
+
}) : y
|
|
88
88
|
}
|
|
89
89
|
) });
|
|
90
90
|
}
|
|
91
91
|
E.displayName = "RadioGroup";
|
|
92
92
|
export {
|
|
93
93
|
re as ClearRadioGroupContext,
|
|
94
|
-
|
|
94
|
+
v as RadioGroupContext,
|
|
95
95
|
E as default
|
|
96
96
|
};
|
package/radio/GroupBlock.js
CHANGED
|
@@ -1,70 +1,69 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useContext as
|
|
1
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as x } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import N from "../components/common/hooks/useMergeProps.js";
|
|
5
|
+
import l from "../typography/index.js";
|
|
6
|
+
import c from "@unicom-cloud/utils/class-name";
|
|
7
|
+
import n from "./Radio.js";
|
|
8
8
|
import $ from "../config-provider/context.js";
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
const { getPrefixCls:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
), { className:
|
|
9
|
+
const g = {};
|
|
10
|
+
function v(i) {
|
|
11
|
+
const { getPrefixCls: d, componentConfig: p, rtl: C } = x($), a = N(
|
|
12
|
+
i,
|
|
13
|
+
g,
|
|
14
|
+
p?.["Radio.Block"]
|
|
15
|
+
), { className: m, options: f, ...u } = a, o = d?.("radio-group-block");
|
|
16
16
|
return /* @__PURE__ */ r(
|
|
17
|
-
|
|
17
|
+
n.Group,
|
|
18
18
|
{
|
|
19
|
-
className:
|
|
20
|
-
...
|
|
21
|
-
onChange: (
|
|
22
|
-
|
|
23
|
-
(e = s.onChange) == null || e.call(s, a, c);
|
|
19
|
+
className: c(`${o}`, m),
|
|
20
|
+
...u,
|
|
21
|
+
onChange: (e, s) => {
|
|
22
|
+
a.onChange?.(e, s);
|
|
24
23
|
},
|
|
25
|
-
children:
|
|
24
|
+
children: f.map((e) => /* @__PURE__ */ r(n, { value: e.value, children: ({ checked: s }) => /* @__PURE__ */ t(
|
|
26
25
|
"div",
|
|
27
26
|
{
|
|
28
|
-
style: { width:
|
|
29
|
-
className:
|
|
27
|
+
style: { width: e.width },
|
|
28
|
+
className: c(
|
|
30
29
|
`${o}-card`,
|
|
31
|
-
|
|
30
|
+
s && `${o}-card-checked`
|
|
32
31
|
),
|
|
33
32
|
children: [
|
|
34
33
|
/* @__PURE__ */ r("div", { className: `${o}-card-mask`, children: /* @__PURE__ */ r("div", { className: `${o}-card-mask-dot` }) }),
|
|
35
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ t("div", { className: `${o}-card-content`, children: [
|
|
36
35
|
/* @__PURE__ */ r(
|
|
37
|
-
|
|
36
|
+
l.Ellipsis,
|
|
38
37
|
{
|
|
39
38
|
className: `${o}-card-content-title`,
|
|
40
39
|
rows: 1,
|
|
41
40
|
showTooltip: !0,
|
|
42
41
|
expandable: !1,
|
|
43
|
-
onExpand: (
|
|
42
|
+
onExpand: (h) => {
|
|
44
43
|
},
|
|
45
|
-
children:
|
|
44
|
+
children: e.title
|
|
46
45
|
}
|
|
47
46
|
),
|
|
48
47
|
/* @__PURE__ */ r(
|
|
49
|
-
|
|
48
|
+
l.Ellipsis,
|
|
50
49
|
{
|
|
51
50
|
className: `${o}-card-content-desc`,
|
|
52
51
|
rows: 1,
|
|
53
52
|
showTooltip: !0,
|
|
54
53
|
expandable: !1,
|
|
55
|
-
onExpand: (
|
|
54
|
+
onExpand: (h) => {
|
|
56
55
|
},
|
|
57
|
-
children:
|
|
56
|
+
children: e.desc
|
|
58
57
|
}
|
|
59
58
|
)
|
|
60
59
|
] })
|
|
61
60
|
]
|
|
62
61
|
}
|
|
63
|
-
) },
|
|
62
|
+
) }, e.title))
|
|
64
63
|
}
|
|
65
64
|
);
|
|
66
65
|
}
|
|
67
|
-
|
|
66
|
+
v.displayName = "RadioGroupBlock";
|
|
68
67
|
export {
|
|
69
|
-
|
|
68
|
+
v as default
|
|
70
69
|
};
|
package/radio/Radio.js
CHANGED
|
@@ -1,94 +1,92 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as u, jsx as i, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import d from "lodash/isFunction";
|
|
3
|
+
import _ from "lodash/isNil";
|
|
4
|
+
import j, { useRef as D, useContext as f } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { omit as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
|
|
6
|
+
import F from "../components/common/hooks/useMergeProps.js";
|
|
7
|
+
import I from "../components/common/hooks/useMergeValue.js";
|
|
8
|
+
import M from "../icon-hover/index.js";
|
|
9
|
+
import w from "@unicom-cloud/utils/class-name";
|
|
10
|
+
import { omit as A } from "../components/common/utils/omit.js";
|
|
11
|
+
import H, { RadioGroupContext as C } from "./Group.js";
|
|
12
|
+
import L from "./GroupBlock.js";
|
|
13
|
+
import O from "../config-provider/context.js";
|
|
14
|
+
function l(h) {
|
|
15
|
+
const p = D(null), { getPrefixCls: k, componentConfig: g, rtl: b } = f(O), r = F(
|
|
16
|
+
h,
|
|
17
17
|
{},
|
|
18
|
-
|
|
19
|
-
), e =
|
|
20
|
-
e.group && (
|
|
21
|
-
const { disabled:
|
|
22
|
-
value:
|
|
23
|
-
defaultValue:
|
|
24
|
-
}),
|
|
25
|
-
`${
|
|
18
|
+
g?.Radio
|
|
19
|
+
), e = f(C), t = k?.("radio"), a = { ...r };
|
|
20
|
+
e.group && (a.checked = e.value === r.value, a.disabled = "disabled" in r ? r.disabled : e.disabled);
|
|
21
|
+
const { disabled: c, children: s, value: x, style: N, className: R, ...m } = a, [n, $] = I(!1, {
|
|
22
|
+
value: a.checked,
|
|
23
|
+
defaultValue: a.defaultChecked
|
|
24
|
+
}), v = w(
|
|
25
|
+
`${t}${e.type === "button" ? "-button" : ""}`,
|
|
26
26
|
{
|
|
27
|
-
[`${
|
|
28
|
-
[`${
|
|
29
|
-
[`${
|
|
27
|
+
[`${t}-checked`]: n,
|
|
28
|
+
[`${t}-disabled`]: c,
|
|
29
|
+
[`${t}-rtl`]: b
|
|
30
30
|
},
|
|
31
|
-
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, P = D.useCallback(
|
|
31
|
+
R
|
|
32
|
+
), G = (o) => {
|
|
33
|
+
const { onChange: P, value: B } = a;
|
|
34
|
+
c || (e.group ? e.onChangeValue?.(B, o) : !("checked" in r) && !n && $(!0), !n && P?.(!0, o));
|
|
35
|
+
}, y = j.useCallback(
|
|
37
36
|
(o) => {
|
|
38
|
-
|
|
39
|
-
C(r.children) && (o.preventDefault(), d.current && d.current.click()), (i = n.onClick) == null || i.call(n, o);
|
|
37
|
+
d(r.children) && (o.preventDefault(), p.current && p.current.click()), m.onClick?.(o);
|
|
40
38
|
},
|
|
41
|
-
[r.children,
|
|
39
|
+
[r.children, m.onClick]
|
|
42
40
|
);
|
|
43
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ u(
|
|
44
42
|
"label",
|
|
45
43
|
{
|
|
46
|
-
...
|
|
47
|
-
onClick:
|
|
48
|
-
style:
|
|
49
|
-
className:
|
|
44
|
+
...A(m, ["checked", "onChange"]),
|
|
45
|
+
onClick: y,
|
|
46
|
+
style: N,
|
|
47
|
+
className: v,
|
|
50
48
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ i(
|
|
52
50
|
"input",
|
|
53
51
|
{
|
|
54
|
-
ref:
|
|
55
|
-
disabled:
|
|
56
|
-
value:
|
|
52
|
+
ref: p,
|
|
53
|
+
disabled: c,
|
|
54
|
+
value: x || "",
|
|
57
55
|
type: "radio",
|
|
58
56
|
...e.name ? { name: e.name } : {},
|
|
59
|
-
checked:
|
|
57
|
+
checked: n,
|
|
60
58
|
onChange: (o) => {
|
|
61
|
-
o.persist(),
|
|
59
|
+
o.persist(), G(o);
|
|
62
60
|
},
|
|
63
61
|
onClick: (o) => {
|
|
64
62
|
o.stopPropagation();
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
65
|
),
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
66
|
+
d(s) ? s({ checked: n }) : e.type === "radio" ? /* @__PURE__ */ u(V, { children: [
|
|
67
|
+
/* @__PURE__ */ i(
|
|
68
|
+
M,
|
|
71
69
|
{
|
|
72
|
-
prefix:
|
|
73
|
-
className: `${
|
|
74
|
-
disabled:
|
|
75
|
-
children: /* @__PURE__ */
|
|
70
|
+
prefix: t,
|
|
71
|
+
className: `${t}-mask-wrapper`,
|
|
72
|
+
disabled: n || c,
|
|
73
|
+
children: /* @__PURE__ */ i("div", { className: `${t}-mask` })
|
|
76
74
|
}
|
|
77
75
|
),
|
|
78
|
-
!
|
|
79
|
-
] }) : e.type === "button" && /* @__PURE__ */
|
|
76
|
+
!_(s) && /* @__PURE__ */ i("span", { className: `${t}-text`, children: s })
|
|
77
|
+
] }) : e.type === "button" && /* @__PURE__ */ i("span", { className: `${t}-button-inner`, children: s })
|
|
80
78
|
]
|
|
81
79
|
}
|
|
82
80
|
);
|
|
83
81
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
l.__PQB_RADIO = !0;
|
|
83
|
+
l.displayName = "Radio";
|
|
84
|
+
l.Group = H;
|
|
85
|
+
l.GroupBlock = L;
|
|
86
|
+
l.GroupContext = C;
|
|
89
87
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
H as RadioGroup,
|
|
89
|
+
L as RadioGroupBlock,
|
|
90
|
+
C as RadioGroupContext,
|
|
91
|
+
l as default
|
|
94
92
|
};
|
package/rate/index.js
CHANGED
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as Y } from "react/jsx-runtime";
|
|
2
2
|
import Z from "@unicom-cloud/icons/IconUiFaceFrownFill";
|
|
3
|
-
import
|
|
3
|
+
import A from "@unicom-cloud/icons/IconUiFaceMehFill";
|
|
4
4
|
import x from "@unicom-cloud/icons/IconUiFaceSmileFill";
|
|
5
|
-
import
|
|
6
|
-
import { times as
|
|
7
|
-
import
|
|
5
|
+
import ee from "@unicom-cloud/icons/IconUiStarFill";
|
|
6
|
+
import { times as oe, div as te } from "@unicom-cloud/utils/math";
|
|
7
|
+
import E, { useContext as re, useState as d } from "react";
|
|
8
8
|
import "../config-provider/ConfigProvider.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { omit as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
character: /* @__PURE__ */
|
|
9
|
+
import ae from "../components/common/hooks/useMergeProps.js";
|
|
10
|
+
import se from "../tooltip/index.js";
|
|
11
|
+
import k from "@unicom-cloud/utils/class-name";
|
|
12
|
+
import { omit as ne } from "../components/common/utils/omit.js";
|
|
13
|
+
import ce from "../config-provider/context.js";
|
|
14
|
+
const le = {
|
|
15
|
+
character: /* @__PURE__ */ r(ee, {}),
|
|
16
16
|
count: 5
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
const { getPrefixCls:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
function ie(H, U) {
|
|
19
|
+
const { getPrefixCls: S, componentConfig: _, rtl: j } = re(ce), C = ae(
|
|
20
|
+
H,
|
|
21
|
+
le,
|
|
22
|
+
_?.Rate
|
|
23
23
|
), {
|
|
24
|
-
style:
|
|
25
|
-
className:
|
|
26
|
-
defaultValue:
|
|
27
|
-
character:
|
|
28
|
-
count:
|
|
29
|
-
value:
|
|
30
|
-
tooltips:
|
|
24
|
+
style: z = {},
|
|
25
|
+
className: D,
|
|
26
|
+
defaultValue: L,
|
|
27
|
+
character: l,
|
|
28
|
+
count: v,
|
|
29
|
+
value: g,
|
|
30
|
+
tooltips: $,
|
|
31
31
|
allowHalf: a,
|
|
32
|
-
allowClear:
|
|
33
|
-
readonly:
|
|
34
|
-
disabled:
|
|
35
|
-
grading:
|
|
36
|
-
onChange:
|
|
37
|
-
onHoverChange:
|
|
38
|
-
...
|
|
39
|
-
} =
|
|
40
|
-
|
|
32
|
+
allowClear: T,
|
|
33
|
+
readonly: i,
|
|
34
|
+
disabled: m,
|
|
35
|
+
grading: N,
|
|
36
|
+
onChange: y,
|
|
37
|
+
onHoverChange: F,
|
|
38
|
+
...W
|
|
39
|
+
} = C, [q, I] = d(L || g || 0), [f, P] = d(0), [p, M] = d(), t = S?.("rate"), B = k(
|
|
40
|
+
t,
|
|
41
41
|
{
|
|
42
|
-
[`${
|
|
43
|
-
[`${
|
|
44
|
-
[`${
|
|
42
|
+
[`${t}-readonly`]: i,
|
|
43
|
+
[`${t}-disabled`]: m,
|
|
44
|
+
[`${t}-rtl`]: j
|
|
45
45
|
},
|
|
46
|
-
|
|
47
|
-
),
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
const s = a ?
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
const J =
|
|
60
|
-
[`${
|
|
61
|
-
[`${
|
|
62
|
-
[`${
|
|
63
|
-
}), K =
|
|
64
|
-
onMouseEnter:
|
|
65
|
-
onClick:
|
|
66
|
-
}, O =
|
|
67
|
-
onMouseEnter:
|
|
68
|
-
onClick:
|
|
69
|
-
},
|
|
70
|
-
function
|
|
46
|
+
D
|
|
47
|
+
), c = "value" in C ? g : q, b = () => {
|
|
48
|
+
f && (P(0), F?.(0));
|
|
49
|
+
}, w = (e, s) => {
|
|
50
|
+
const o = s && a ? e + 0.5 : e + 1;
|
|
51
|
+
o !== f && (P(o), F?.(o));
|
|
52
|
+
}, R = (e, s) => {
|
|
53
|
+
const o = s && a ? e + 0.5 : e + 1;
|
|
54
|
+
M(!0), o !== c ? (I(o), y?.(o)) : T && (I(0), y?.(0), b());
|
|
55
|
+
}, G = (e) => {
|
|
56
|
+
const s = a ? oe(+te(c || 0, 0.5).toFixed(0), 0.5) : Math.round(c), o = f || s;
|
|
57
|
+
let n = typeof l == "function" ? l(e) : l;
|
|
58
|
+
N && (o <= 2 ? n = /* @__PURE__ */ r(Z, {}) : o <= 3 ? n = /* @__PURE__ */ r(A, {}) : n = /* @__PURE__ */ r(x, {}), o <= e && (n = /* @__PURE__ */ r(A, {})));
|
|
59
|
+
const J = k(`${t}-character`, {
|
|
60
|
+
[`${t}-character-half`]: a && e + 0.5 === o,
|
|
61
|
+
[`${t}-character-full`]: e + 1 <= o,
|
|
62
|
+
[`${t}-character-scale`]: p && e + 1 < c
|
|
63
|
+
}), K = i || m ? {} : {
|
|
64
|
+
onMouseEnter: w.bind(this, e, !0),
|
|
65
|
+
onClick: R.bind(this, e, !0)
|
|
66
|
+
}, O = i || m ? {} : {
|
|
67
|
+
onMouseEnter: w.bind(this, e, !1),
|
|
68
|
+
onClick: R.bind(this, e, !1)
|
|
69
|
+
}, u = $ && $[e], Q = u ? se : E.Fragment, X = u ? { content: u } : {};
|
|
70
|
+
function h(V) {
|
|
71
71
|
return {
|
|
72
72
|
role: "radio",
|
|
73
|
-
"aria-checked":
|
|
74
|
-
"aria-setsize":
|
|
75
|
-
"aria-posinset":
|
|
73
|
+
"aria-checked": e + (V ? 0.5 : 1) <= o,
|
|
74
|
+
"aria-setsize": v,
|
|
75
|
+
"aria-posinset": e + (V ? 0.5 : 1)
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ r(Q, { ...X, children: /* @__PURE__ */ Y(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
81
|
className: J,
|
|
82
|
-
style:
|
|
82
|
+
style: p ? { animationDelay: `${50 * e}ms` } : {},
|
|
83
83
|
onAnimationEnd: () => {
|
|
84
|
-
|
|
84
|
+
p && e + 1 >= c - 1 && M(!1);
|
|
85
85
|
},
|
|
86
|
-
...a ? {} :
|
|
86
|
+
...a ? {} : h(),
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ r(
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
91
|
-
className: `${
|
|
91
|
+
className: `${t}-character-left`,
|
|
92
92
|
...K,
|
|
93
|
-
...a ?
|
|
94
|
-
children:
|
|
93
|
+
...a ? h(!0) : {},
|
|
94
|
+
children: n
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ r(
|
|
98
98
|
"div",
|
|
99
99
|
{
|
|
100
|
-
className: `${
|
|
100
|
+
className: `${t}-character-right`,
|
|
101
101
|
...O,
|
|
102
|
-
...a ?
|
|
103
|
-
children:
|
|
102
|
+
...a ? h() : {},
|
|
103
|
+
children: n
|
|
104
104
|
}
|
|
105
105
|
)
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
|
-
) },
|
|
108
|
+
) }, e);
|
|
109
109
|
};
|
|
110
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ r(
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
|
-
ref:
|
|
114
|
-
...
|
|
115
|
-
style:
|
|
116
|
-
className:
|
|
117
|
-
onMouseLeave:
|
|
118
|
-
children: /* @__PURE__ */
|
|
119
|
-
(
|
|
113
|
+
ref: U,
|
|
114
|
+
...ne(W, ["error"]),
|
|
115
|
+
style: z,
|
|
116
|
+
className: B,
|
|
117
|
+
onMouseLeave: b,
|
|
118
|
+
children: /* @__PURE__ */ r("div", { className: `${t}-inner`, children: Array.apply(null, Array(N ? 5 : v)).map(
|
|
119
|
+
(e, s) => G(s)
|
|
120
120
|
) })
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
|
-
const
|
|
125
|
-
|
|
124
|
+
const me = E.forwardRef(ie);
|
|
125
|
+
me.displayName = "Rate";
|
|
126
126
|
export {
|
|
127
|
-
|
|
127
|
+
me as default
|
|
128
128
|
};
|