@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/cascader/util.js
CHANGED
|
@@ -17,7 +17,7 @@ function A(e, t) {
|
|
|
17
17
|
const n = t ? Array.isArray(t[0]) ? t : [t] : [];
|
|
18
18
|
return new k(e.options || [], n, C(e));
|
|
19
19
|
}
|
|
20
|
-
const V = (e) => (e || []).reduce((c,
|
|
20
|
+
const V = (e) => (e || []).reduce((c, o) => (c.add([].concat(o).join(a)), c), /* @__PURE__ */ new Set()), i = (e, t) => {
|
|
21
21
|
const n = t || [];
|
|
22
22
|
return e.has(n.join(a));
|
|
23
23
|
}, v = (e, t) => {
|
|
@@ -26,29 +26,29 @@ const V = (e) => (e || []).reduce((c, s) => (c.add([].concat(s).join(a)), c), /*
|
|
|
26
26
|
}, E = (e, t, n) => {
|
|
27
27
|
let c = [];
|
|
28
28
|
if (e === void 0 ? c = [] : t ? c = e : c = [e], n && n.config.showParent) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
), f = [],
|
|
32
|
-
return c.map((
|
|
33
|
-
|
|
29
|
+
const o = n.getCheckedNodes(), h = V(
|
|
30
|
+
o.map((l) => l.pathValue)
|
|
31
|
+
), f = [], s = {};
|
|
32
|
+
return c.map((l, S, r) => {
|
|
33
|
+
l.some((u, m, g) => {
|
|
34
34
|
const d = g.slice(0, m + 1), _ = i(h, d);
|
|
35
|
-
return _ && !
|
|
35
|
+
return _ && !s[d.join(a)] && (f.push(d), s[d.join(a)] = 1), _;
|
|
36
36
|
});
|
|
37
37
|
}), f;
|
|
38
38
|
}
|
|
39
39
|
return c;
|
|
40
40
|
}, N = (e) => {
|
|
41
41
|
const t = (n) => Array.isArray(n) ? n.every((c) => c._checked || c.disabled ? !0 : t(c.children)) : !1;
|
|
42
|
-
return e._halfChecked && t(e
|
|
42
|
+
return e._halfChecked && t(e?.children);
|
|
43
43
|
}, P = (e, t, n, c) => {
|
|
44
|
-
const
|
|
45
|
-
n.setCheckedState(
|
|
46
|
-
const
|
|
44
|
+
const o = c && N(n) ? !1 : c, h = t.getCheckedNodes().reduce((r, u) => (r.add(u.pathValue.join(a)), r), /* @__PURE__ */ new Set());
|
|
45
|
+
n.setCheckedState(o);
|
|
46
|
+
const s = t.getCheckedNodes().map((r) => r.pathValue), l = V(s), S = /* @__PURE__ */ new Set();
|
|
47
47
|
return e.filter((r, u, m) => {
|
|
48
|
-
if (!i(h, r) || i(
|
|
48
|
+
if (!i(h, r) || i(l, r))
|
|
49
49
|
return S.add(r.join(a)), !0;
|
|
50
50
|
}).concat(
|
|
51
|
-
|
|
51
|
+
s.filter((r, u, m) => !i(S, r))
|
|
52
52
|
);
|
|
53
53
|
};
|
|
54
54
|
export {
|
package/checkbox/Checkbox.js
CHANGED
|
@@ -1,127 +1,125 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as b, jsx as t, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import B from "@unicom-cloud/icons/IconUiCheck";
|
|
3
|
+
import F from "@unicom-cloud/icons/IconUiMinus";
|
|
4
|
+
import x from "lodash/isFunction";
|
|
5
|
+
import U from "lodash/isNil";
|
|
6
|
+
import d, { useRef as D, useContext as g, useEffect as H, useCallback as L } from "react";
|
|
7
7
|
import "../config-provider/ConfigProvider.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { omit as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
|
|
8
|
+
import O from "../components/common/hooks/useMergeProps.js";
|
|
9
|
+
import S from "../components/common/hooks/useMergeValue.js";
|
|
10
|
+
import W from "../icon-hover/index.js";
|
|
11
|
+
import q from "@unicom-cloud/utils/class-name";
|
|
12
|
+
import { omit as z } from "../components/common/utils/omit.js";
|
|
13
|
+
import A, { CheckboxGroupContext as J } from "./Group.js";
|
|
14
|
+
import K from "./GroupBlock.js";
|
|
15
|
+
import Q from "./useCheckbox.js";
|
|
16
|
+
import T from "../config-provider/context.js";
|
|
17
|
+
function X(N, G) {
|
|
18
|
+
const k = D(null), { getPrefixCls: $, componentConfig: v, rtl: y } = g(T), c = O(
|
|
19
|
+
N,
|
|
20
20
|
{},
|
|
21
|
-
|
|
22
|
-
),
|
|
23
|
-
|
|
21
|
+
v?.Checkbox
|
|
22
|
+
), s = g(J), e = $?.("checkbox"), { onGroupChange: C } = s, r = { ...c };
|
|
23
|
+
s.isCheckboxGroup && (r.checked = s.checkboxGroupValue.indexOf(c.value) !== -1, r.disabled = "disabled" in c ? c.disabled : s.disabled);
|
|
24
24
|
const {
|
|
25
|
-
disabled:
|
|
26
|
-
children:
|
|
27
|
-
className:
|
|
28
|
-
value:
|
|
29
|
-
style:
|
|
30
|
-
indeterminate:
|
|
31
|
-
error:
|
|
32
|
-
...
|
|
33
|
-
} =
|
|
34
|
-
value:
|
|
35
|
-
defaultValue:
|
|
36
|
-
}),
|
|
37
|
-
|
|
25
|
+
disabled: i,
|
|
26
|
+
children: n,
|
|
27
|
+
className: V,
|
|
28
|
+
value: a,
|
|
29
|
+
style: P,
|
|
30
|
+
indeterminate: l,
|
|
31
|
+
error: R,
|
|
32
|
+
...f
|
|
33
|
+
} = r, [m, E] = S(!1, {
|
|
34
|
+
value: r.checked,
|
|
35
|
+
defaultValue: r.defaultChecked
|
|
36
|
+
}), I = q(
|
|
37
|
+
e,
|
|
38
38
|
{
|
|
39
|
-
[`${
|
|
40
|
-
[`${
|
|
41
|
-
[`${
|
|
42
|
-
[`${
|
|
43
|
-
error:
|
|
39
|
+
[`${e}-disabled`]: !!i,
|
|
40
|
+
[`${e}-indeterminate`]: !!l,
|
|
41
|
+
[`${e}-checked`]: m,
|
|
42
|
+
[`${e}-rtl`]: y,
|
|
43
|
+
error: R
|
|
44
44
|
},
|
|
45
|
-
|
|
45
|
+
V
|
|
46
46
|
);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}), [
|
|
50
|
-
const
|
|
51
|
-
(
|
|
52
|
-
|
|
53
|
-
c.persist(), c.stopPropagation(), M(c.target.checked), t.isCheckboxGroup && (n == null || n(e.value, c.target.checked, c)), (a = e.onChange) == null || a.call(e, c.target.checked, c);
|
|
47
|
+
H(() => (s.registerValue(a), () => {
|
|
48
|
+
s.unRegisterValue(a);
|
|
49
|
+
}), [a]);
|
|
50
|
+
const M = L(
|
|
51
|
+
(o) => {
|
|
52
|
+
o.persist(), o.stopPropagation(), E(o.target.checked), s.isCheckboxGroup && C?.(c.value, o.target.checked, o), c.onChange?.(o.target.checked, o);
|
|
54
53
|
},
|
|
55
|
-
[
|
|
56
|
-
),
|
|
57
|
-
(
|
|
58
|
-
|
|
59
|
-
$(e.children) && (c.preventDefault(), C.current && C.current.click()), (a = i.onClick) == null || a.call(i, c);
|
|
54
|
+
[C, s.isCheckboxGroup, c.onChange, c.value]
|
|
55
|
+
), j = d.useCallback(
|
|
56
|
+
(o) => {
|
|
57
|
+
x(c.children) && (o.preventDefault(), k.current && k.current.click()), f.onClick?.(o);
|
|
60
58
|
},
|
|
61
|
-
[
|
|
62
|
-
),
|
|
63
|
-
let p = /* @__PURE__ */
|
|
64
|
-
|
|
59
|
+
[c.children, f.onClick]
|
|
60
|
+
), h = { strokeWidth: 10 };
|
|
61
|
+
let p = /* @__PURE__ */ t(
|
|
62
|
+
B,
|
|
65
63
|
{
|
|
66
|
-
className: `${
|
|
67
|
-
style: { ...
|
|
64
|
+
className: `${e}-mask-icon`,
|
|
65
|
+
style: { ...h }
|
|
68
66
|
}
|
|
69
67
|
);
|
|
70
|
-
return
|
|
71
|
-
className: `${
|
|
72
|
-
style: { ...
|
|
73
|
-
}) : p =
|
|
74
|
-
|
|
68
|
+
return r.icon && (d.isValidElement(r.icon) ? p = d.cloneElement(r.icon, {
|
|
69
|
+
className: `${e}-mask-icon`,
|
|
70
|
+
style: { ...h }
|
|
71
|
+
}) : p = r.icon), l && (p = /* @__PURE__ */ t(
|
|
72
|
+
F,
|
|
75
73
|
{
|
|
76
|
-
className: `${
|
|
77
|
-
style: { ...
|
|
74
|
+
className: `${e}-mask-icon`,
|
|
75
|
+
style: { ...h }
|
|
78
76
|
}
|
|
79
|
-
)), /* @__PURE__ */
|
|
77
|
+
)), /* @__PURE__ */ b(
|
|
80
78
|
"label",
|
|
81
79
|
{
|
|
82
|
-
ref:
|
|
83
|
-
"aria-disabled":
|
|
84
|
-
...
|
|
85
|
-
onClick:
|
|
86
|
-
className:
|
|
87
|
-
style:
|
|
80
|
+
ref: G,
|
|
81
|
+
"aria-disabled": i,
|
|
82
|
+
...z(f, ["onChange"]),
|
|
83
|
+
onClick: j,
|
|
84
|
+
className: I,
|
|
85
|
+
style: P,
|
|
88
86
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ t(
|
|
90
88
|
"input",
|
|
91
89
|
{
|
|
92
|
-
value:
|
|
93
|
-
disabled: !!
|
|
94
|
-
ref:
|
|
95
|
-
checked: !!
|
|
96
|
-
onChange:
|
|
97
|
-
onClick: (
|
|
90
|
+
value: a,
|
|
91
|
+
disabled: !!i,
|
|
92
|
+
ref: k,
|
|
93
|
+
checked: !!m,
|
|
94
|
+
onChange: M,
|
|
95
|
+
onClick: (o) => o.stopPropagation(),
|
|
98
96
|
type: "checkbox"
|
|
99
97
|
}
|
|
100
98
|
),
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
99
|
+
x(n) ? n({ checked: m, indeterminate: l }) : /* @__PURE__ */ b(w, { children: [
|
|
100
|
+
/* @__PURE__ */ t(
|
|
101
|
+
W,
|
|
104
102
|
{
|
|
105
|
-
prefix:
|
|
106
|
-
className: `${
|
|
107
|
-
disabled:
|
|
108
|
-
children: /* @__PURE__ */
|
|
103
|
+
prefix: e,
|
|
104
|
+
className: `${e}-mask-wrapper`,
|
|
105
|
+
disabled: m || i || l,
|
|
106
|
+
children: /* @__PURE__ */ t("div", { className: `${e}-mask`, children: p })
|
|
109
107
|
}
|
|
110
108
|
),
|
|
111
|
-
!
|
|
109
|
+
!U(n) && /* @__PURE__ */ t("span", { className: `${e}-text`, children: n })
|
|
112
110
|
] })
|
|
113
111
|
]
|
|
114
112
|
}
|
|
115
113
|
);
|
|
116
114
|
}
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
const u = d.forwardRef(X);
|
|
116
|
+
u.displayName = "Checkbox";
|
|
117
|
+
u.Group = A;
|
|
118
|
+
u.GroupBlock = K;
|
|
119
|
+
u.useCheckbox = Q;
|
|
122
120
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
A as CheckboxGroup,
|
|
122
|
+
K as CheckboxGroupBlock,
|
|
123
|
+
u as default,
|
|
124
|
+
Q as useCheckbox
|
|
127
125
|
};
|
package/checkbox/Group.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { createContext as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import O from "lodash/isArray";
|
|
3
|
+
import s from "lodash/isPlainObject";
|
|
4
|
+
import { createContext as P, useState as y, useContext as A, useCallback as R } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { pickTriggerPropsFromRest as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
6
|
+
import j from "../components/common/hooks/useMergeValue.js";
|
|
7
|
+
import w from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import { pickTriggerPropsFromRest as S } from "../utils/constant.js";
|
|
9
|
+
import z from "./Checkbox.js";
|
|
10
|
+
import F from "../config-provider/context.js";
|
|
11
|
+
const C = {
|
|
12
12
|
isCheckboxGroup: !1,
|
|
13
13
|
checkboxGroupValue: [],
|
|
14
14
|
onGroupChange: () => {
|
|
@@ -17,83 +17,81 @@ const x = {
|
|
|
17
17
|
},
|
|
18
18
|
unRegisterValue: () => {
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, h = P(C), W = ({
|
|
21
21
|
children: r
|
|
22
|
-
}) => /* @__PURE__ */
|
|
23
|
-
function
|
|
24
|
-
const [
|
|
22
|
+
}) => /* @__PURE__ */ n(h.Provider, { value: C, children: r });
|
|
23
|
+
function M(r) {
|
|
24
|
+
const [t, x] = j([], {
|
|
25
25
|
defaultValue: "defaultValue" in r ? r.defaultValue || [] : void 0,
|
|
26
26
|
value: "value" in r ? r.value || [] : void 0
|
|
27
|
-
}), [
|
|
28
|
-
disabled:
|
|
29
|
-
options:
|
|
30
|
-
style:
|
|
31
|
-
className:
|
|
32
|
-
error:
|
|
33
|
-
children:
|
|
34
|
-
direction:
|
|
35
|
-
} = r, u =
|
|
27
|
+
}), [i, c] = y([]), { getPrefixCls: g, rtl: b } = A(F), {
|
|
28
|
+
disabled: m,
|
|
29
|
+
options: d,
|
|
30
|
+
style: V,
|
|
31
|
+
className: p,
|
|
32
|
+
error: v,
|
|
33
|
+
children: k,
|
|
34
|
+
direction: f = "horizontal"
|
|
35
|
+
} = r, u = g?.("checkbox"), G = w(
|
|
36
36
|
`${u}-group`,
|
|
37
37
|
{
|
|
38
|
-
[`${u}-group-is-error`]:
|
|
39
|
-
[`${u}-group-direction-${
|
|
40
|
-
[`${u}-group-rtl`]:
|
|
38
|
+
[`${u}-group-is-error`]: v,
|
|
39
|
+
[`${u}-group-direction-${f}`]: f,
|
|
40
|
+
[`${u}-group-rtl`]: b
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
),
|
|
42
|
+
p
|
|
43
|
+
), N = R(
|
|
44
44
|
(e, a, l) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
r,
|
|
49
|
-
t.filter((O, q, B) => s.indexOf(O) > -1),
|
|
45
|
+
const o = t.slice();
|
|
46
|
+
a ? o.push(e) : o.splice(t.indexOf(e), 1), x(o), r.onChange?.(
|
|
47
|
+
o.filter(($, T, q) => i.indexOf($) > -1),
|
|
50
48
|
l
|
|
51
49
|
);
|
|
52
50
|
},
|
|
53
|
-
[
|
|
51
|
+
[t, r.onChange, i]
|
|
54
52
|
);
|
|
55
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ n(
|
|
56
54
|
"span",
|
|
57
55
|
{
|
|
58
|
-
className:
|
|
59
|
-
style:
|
|
60
|
-
...
|
|
61
|
-
children: /* @__PURE__ */
|
|
62
|
-
|
|
56
|
+
className: G,
|
|
57
|
+
style: V,
|
|
58
|
+
...S(r),
|
|
59
|
+
children: /* @__PURE__ */ n(
|
|
60
|
+
h.Provider,
|
|
63
61
|
{
|
|
64
62
|
value: {
|
|
65
63
|
isCheckboxGroup: !0,
|
|
66
|
-
checkboxGroupValue:
|
|
67
|
-
onGroupChange:
|
|
68
|
-
disabled:
|
|
64
|
+
checkboxGroupValue: t,
|
|
65
|
+
onGroupChange: N,
|
|
66
|
+
disabled: m,
|
|
69
67
|
registerValue: (e) => {
|
|
70
|
-
|
|
68
|
+
c((a) => Array.from(/* @__PURE__ */ new Set([...a, e])));
|
|
71
69
|
},
|
|
72
70
|
unRegisterValue: (e) => {
|
|
73
|
-
|
|
71
|
+
c((a) => a.filter((l) => l !== e));
|
|
74
72
|
}
|
|
75
73
|
},
|
|
76
|
-
children:
|
|
77
|
-
const a =
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
|
|
74
|
+
children: O(d) ? d.map((e) => {
|
|
75
|
+
const a = s(e) ? e.label : e, l = s(e) ? e.value : e, o = s(e) ? e.icon : void 0;
|
|
76
|
+
return /* @__PURE__ */ n(
|
|
77
|
+
z,
|
|
80
78
|
{
|
|
81
|
-
disabled:
|
|
79
|
+
disabled: m || s(e) && e.disabled,
|
|
82
80
|
value: l,
|
|
83
|
-
icon:
|
|
81
|
+
icon: o,
|
|
84
82
|
children: a
|
|
85
83
|
},
|
|
86
84
|
l
|
|
87
85
|
);
|
|
88
|
-
}) :
|
|
86
|
+
}) : k
|
|
89
87
|
}
|
|
90
88
|
)
|
|
91
89
|
}
|
|
92
90
|
);
|
|
93
91
|
}
|
|
94
|
-
|
|
92
|
+
M.displayName = "CheckboxGroup";
|
|
95
93
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
h as CheckboxGroupContext,
|
|
95
|
+
W as ClearCheckboxGroupContext,
|
|
96
|
+
M as default
|
|
99
97
|
};
|
package/checkbox/GroupBlock.js
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
1
|
+
import { jsx as a, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as u } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
function
|
|
9
|
-
const { getPrefixCls:
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
4
|
+
import c from "../typography/index.js";
|
|
5
|
+
import l from "@unicom-cloud/utils/class-name";
|
|
6
|
+
import n from "./Checkbox.js";
|
|
7
|
+
import f from "../config-provider/context.js";
|
|
8
|
+
function C(s) {
|
|
9
|
+
const { getPrefixCls: i, rtl: N } = u(f), { className: d, options: m, ...p } = s, e = i?.("checkbox-group-block");
|
|
10
|
+
return /* @__PURE__ */ a(
|
|
11
|
+
n.Group,
|
|
12
12
|
{
|
|
13
|
-
className:
|
|
13
|
+
className: l(`${e}`, d),
|
|
14
14
|
...p,
|
|
15
|
-
onChange: (
|
|
16
|
-
|
|
17
|
-
(s = c.onChange) == null || s.call(c, a, r);
|
|
15
|
+
onChange: (o, r) => {
|
|
16
|
+
s.onChange?.(o, r);
|
|
18
17
|
},
|
|
19
|
-
children:
|
|
18
|
+
children: m.map((o, r, k) => /* @__PURE__ */ a(n, { value: o.value, children: ({ checked: h }) => /* @__PURE__ */ t(
|
|
20
19
|
"div",
|
|
21
20
|
{
|
|
22
|
-
style: { width:
|
|
23
|
-
className:
|
|
21
|
+
style: { width: o.width },
|
|
22
|
+
className: l(
|
|
24
23
|
`${e}-card`,
|
|
25
|
-
|
|
24
|
+
h && `${e}-card-checked`
|
|
26
25
|
),
|
|
27
26
|
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
27
|
+
/* @__PURE__ */ a("div", { className: `${e}-card-mask`, children: /* @__PURE__ */ a("div", { className: `${e}-card-mask-dot` }) }),
|
|
28
|
+
/* @__PURE__ */ t("div", { className: `${e}-card-content`, children: [
|
|
29
|
+
/* @__PURE__ */ a(
|
|
30
|
+
c.Ellipsis,
|
|
32
31
|
{
|
|
33
32
|
className: `${e}-card-content-title`,
|
|
34
33
|
rows: 1,
|
|
@@ -36,11 +35,11 @@ function k(c) {
|
|
|
36
35
|
expandable: !1,
|
|
37
36
|
onExpand: (x) => {
|
|
38
37
|
},
|
|
39
|
-
children:
|
|
38
|
+
children: o.title
|
|
40
39
|
}
|
|
41
40
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
41
|
+
/* @__PURE__ */ a(
|
|
42
|
+
c.Ellipsis,
|
|
44
43
|
{
|
|
45
44
|
className: `${e}-card-content-desc`,
|
|
46
45
|
rows: 1,
|
|
@@ -48,17 +47,17 @@ function k(c) {
|
|
|
48
47
|
expandable: !1,
|
|
49
48
|
onExpand: (x) => {
|
|
50
49
|
},
|
|
51
|
-
children:
|
|
50
|
+
children: o.desc
|
|
52
51
|
}
|
|
53
52
|
)
|
|
54
53
|
] })
|
|
55
54
|
]
|
|
56
55
|
}
|
|
57
|
-
) },
|
|
56
|
+
) }, o.title))
|
|
58
57
|
}
|
|
59
58
|
);
|
|
60
59
|
}
|
|
61
|
-
|
|
60
|
+
C.displayName = "CheckboxGroupBlock";
|
|
62
61
|
export {
|
|
63
|
-
|
|
62
|
+
C as default
|
|
64
63
|
};
|
package/collapse/Collapse.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import z from "@unicom-cloud/icons/IconUiCaretLeft";
|
|
3
|
-
import
|
|
3
|
+
import f from "@unicom-cloud/icons/IconUiCaretRight";
|
|
4
4
|
import F from "lodash/isFunction";
|
|
5
5
|
import M, { createContext as O, useContext as T } from "react";
|
|
6
6
|
import "../config-provider/ConfigProvider.js";
|
|
@@ -10,81 +10,81 @@ import j from "@unicom-cloud/utils/class-name";
|
|
|
10
10
|
import { omit as H } from "../components/common/utils/omit.js";
|
|
11
11
|
import L from "./Item.js";
|
|
12
12
|
import q from "../config-provider/context.js";
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
return
|
|
13
|
+
const m = (i, s) => {
|
|
14
|
+
const n = [].concat(i);
|
|
15
|
+
return s ? n.slice(0, 1) : n;
|
|
16
16
|
}, B = {
|
|
17
17
|
bordered: !0,
|
|
18
18
|
lazyload: !0,
|
|
19
19
|
expandIconPosition: "left"
|
|
20
20
|
}, D = O({
|
|
21
21
|
expandIconPosition: "left",
|
|
22
|
-
expandIcon: /* @__PURE__ */
|
|
22
|
+
expandIcon: /* @__PURE__ */ t(f, {}),
|
|
23
23
|
activeKeys: [],
|
|
24
24
|
onToggle: () => {
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
function E(
|
|
28
|
-
const { getPrefixCls:
|
|
29
|
-
|
|
27
|
+
function E(i, s) {
|
|
28
|
+
const { getPrefixCls: n, componentConfig: C, rtl: v } = T(q), e = U(
|
|
29
|
+
i,
|
|
30
30
|
B,
|
|
31
|
-
|
|
32
|
-
), [
|
|
33
|
-
defaultValue: "defaultActiveKey" in e ?
|
|
34
|
-
value: "activeKey" in e ?
|
|
31
|
+
C?.Collapse
|
|
32
|
+
), [a, x] = V([], {
|
|
33
|
+
defaultValue: "defaultActiveKey" in e ? m(e.defaultActiveKey, e.accordion) : void 0,
|
|
34
|
+
value: "activeKey" in e ? m(e.activeKey, e.accordion) : void 0
|
|
35
35
|
}), {
|
|
36
|
-
children:
|
|
37
|
-
className:
|
|
38
|
-
style:
|
|
36
|
+
children: g,
|
|
37
|
+
className: y,
|
|
38
|
+
style: I,
|
|
39
39
|
bordered: K,
|
|
40
|
-
lazyload:
|
|
41
|
-
expandIcon:
|
|
42
|
-
expandIconPosition:
|
|
43
|
-
destroyOnHide:
|
|
44
|
-
accordion:
|
|
45
|
-
triggerRegion:
|
|
40
|
+
lazyload: P,
|
|
41
|
+
expandIcon: h,
|
|
42
|
+
expandIconPosition: l,
|
|
43
|
+
destroyOnHide: A,
|
|
44
|
+
accordion: R,
|
|
45
|
+
triggerRegion: N,
|
|
46
46
|
onChange: p,
|
|
47
47
|
...b
|
|
48
|
-
} = e,
|
|
49
|
-
let
|
|
50
|
-
const
|
|
51
|
-
|
|
48
|
+
} = e, c = n?.("collapse"), $ = (r, w) => {
|
|
49
|
+
let o = [...a || []];
|
|
50
|
+
const d = a?.indexOf(r);
|
|
51
|
+
d > -1 ? o.splice(d, 1) : R ? o = [r] : o.push(r), "activeKey" in e || x(o), F(p) && p(r, o, w);
|
|
52
52
|
};
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ t(
|
|
54
54
|
D.Provider,
|
|
55
55
|
{
|
|
56
56
|
value: {
|
|
57
|
-
activeKeys:
|
|
58
|
-
triggerRegion:
|
|
59
|
-
lazyload:
|
|
60
|
-
destroyOnHide:
|
|
61
|
-
expandIconPosition:
|
|
57
|
+
activeKeys: a,
|
|
58
|
+
triggerRegion: N,
|
|
59
|
+
lazyload: P,
|
|
60
|
+
destroyOnHide: A,
|
|
61
|
+
expandIconPosition: l,
|
|
62
62
|
onToggle: $,
|
|
63
|
-
expandIcon: "expandIcon" in e ?
|
|
63
|
+
expandIcon: "expandIcon" in e ? h : l === "right" ? /* @__PURE__ */ t(z, {}) : /* @__PURE__ */ t(f, {})
|
|
64
64
|
},
|
|
65
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ t(
|
|
66
66
|
"div",
|
|
67
67
|
{
|
|
68
|
-
ref:
|
|
68
|
+
ref: s,
|
|
69
69
|
...H(b, ["activeKey", "defaultActiveKey"]),
|
|
70
70
|
className: j(
|
|
71
|
-
|
|
72
|
-
`${
|
|
73
|
-
{ [`${
|
|
74
|
-
|
|
71
|
+
c,
|
|
72
|
+
`${c}-${K ? "border" : "borderless"}`,
|
|
73
|
+
{ [`${c}-rtl`]: v },
|
|
74
|
+
y
|
|
75
75
|
),
|
|
76
|
-
style:
|
|
77
|
-
children:
|
|
76
|
+
style: I,
|
|
77
|
+
children: g
|
|
78
78
|
}
|
|
79
79
|
)
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
|
-
const G = M.forwardRef(E),
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
const G = M.forwardRef(E), u = G;
|
|
84
|
+
u.displayName = "Collapse";
|
|
85
|
+
u.Item = L;
|
|
86
86
|
export {
|
|
87
87
|
D as CollapseContext,
|
|
88
88
|
L as CollapseItem,
|
|
89
|
-
|
|
89
|
+
u as default
|
|
90
90
|
};
|