@unicom-cloud/ui 0.8.95 → 0.8.97
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/Message.js +1 -1
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Switch.js +1 -1
- package/Tour.js +63 -0
- package/Trigger.js +2 -2
- 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 +52 -51
- 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 +126 -130
- 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/useForceUpdate.js +6 -2
- package/components/common/hooks/useId.js +4 -4
- 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 +11 -10
- package/components/common/utils/PqbCSSTransition.js +1 -1
- 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 +55 -56
- package/development/index.js +9 -9
- package/dist/react-transition-group/src/CSSTransition.js +1 -1
- package/dist/react-transition-group/src/SwitchTransition.js +1 -1
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/tween/src/tween.js +24 -25
- 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/index.js +50 -52
- 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 +682 -679
- 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 +223 -231
- 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 +189 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/liquid-fill/interface.js +1 -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 +97 -100
- 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 +61 -66
- 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 +108 -108
- package/slider/util.js +1 -1
- 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 +61 -61
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +78 -79
- 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/time-picker/util.js +4 -4
- 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 +338 -347
- 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/math.d.ts +1 -1
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/alert/interface.d.ts +2 -2
- package/types/pc/details/interface.d.ts +2 -2
- package/types/pc/hooks/index.d.ts +0 -1
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +30 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +4 -0
- package/types/pc/liquid-fill/interface.d.ts +0 -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/math.d.ts +1 -1
- 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 +78 -75
- 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 +49 -50
- 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 +274 -275
- package/utils/intersectionObserver.js +4 -0
- package/utils/math.js +7 -11
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/reactTransitionGroup.js +1 -1
- 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/hooks/useComputedState.js +0 -11
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/hooks/useComputedState.js +0 -4
- package/types/common/hooks/useComputedState.d.ts +0 -4
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/hooks/useComputedState.d.ts +0 -1
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
- /package/dist/react-transition-group/chunk/{C6QwjD4L.js → CPfP7aNL.js} +0 -0
package/cascader/Cascader.js
CHANGED
|
@@ -1,228 +1,217 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import ue from "@unicom-cloud/icons/IconUiCheck";
|
|
3
|
+
import ce from "@unicom-cloud/icons/IconUiLeft";
|
|
4
4
|
import pe from "@unicom-cloud/icons/IconUiLoading";
|
|
5
|
-
import
|
|
6
|
-
import { isEmptyValue as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { forwardRef as
|
|
5
|
+
import de from "@unicom-cloud/icons/IconUiRight";
|
|
6
|
+
import { isEmptyValue as me, isEmptyArray as fe } from "@unicom-cloud/utils/is";
|
|
7
|
+
import he from "lodash/isArray";
|
|
8
|
+
import k from "lodash/isFunction";
|
|
9
|
+
import x from "lodash/isPlainObject";
|
|
10
|
+
import ge from "lodash/isString";
|
|
11
|
+
import { forwardRef as Ce, useContext as Ve, useRef as y, useState as ve, useEffect as B, useImperativeHandle as ye, useCallback as _ } from "react";
|
|
12
12
|
import "../config-provider/ConfigProvider.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { Esc as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import { SHOW_CHILD as
|
|
26
|
-
import
|
|
27
|
-
const
|
|
13
|
+
import Se from "../components/common/hooks/useForceUpdate.js";
|
|
14
|
+
import be from "../components/common/hooks/useId.js";
|
|
15
|
+
import ke from "../components/common/hooks/useMergeProps.js";
|
|
16
|
+
import H from "../components/common/hooks/useMergeValue.js";
|
|
17
|
+
import we from "../components/common/hooks/useUpdateEffect.js";
|
|
18
|
+
import Oe from "../select-view/index.js";
|
|
19
|
+
import Ee from "../trigger/index.js";
|
|
20
|
+
import Ne from "@unicom-cloud/utils/class-name";
|
|
21
|
+
import { Esc as Pe, Tab as xe, Enter as Ie } from "@unicom-cloud/utils/constant/keyboardCode";
|
|
22
|
+
import Me from "./hook/useRefCurrent.js";
|
|
23
|
+
import Le from "./panel/List.js";
|
|
24
|
+
import Te from "./panel/Search.js";
|
|
25
|
+
import { SHOW_CHILD as Re, getConfig as De, getStore as Fe, formatValue as S, transformValuesToSet as Ae, valueInSet as Ue, removeValueFromSet as Be, PANEL_MODE as W } from "./util.js";
|
|
26
|
+
import _e from "../config-provider/context.js";
|
|
27
|
+
const He = {
|
|
28
28
|
label: "label",
|
|
29
29
|
value: "value",
|
|
30
30
|
isLeaf: "isLeaf",
|
|
31
31
|
children: "children",
|
|
32
32
|
disabled: "disabled"
|
|
33
|
-
},
|
|
33
|
+
}, We = {
|
|
34
34
|
options: [],
|
|
35
35
|
bordered: !0,
|
|
36
|
-
fieldNames:
|
|
36
|
+
fieldNames: He,
|
|
37
37
|
trigger: "click",
|
|
38
38
|
expandTrigger: "click",
|
|
39
|
-
checkedStrategy:
|
|
39
|
+
checkedStrategy: Re,
|
|
40
40
|
defaultActiveFirstOption: !0
|
|
41
|
-
},
|
|
42
|
-
function
|
|
43
|
-
const { getPrefixCls:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
}, $e = { bottom: 4 };
|
|
42
|
+
function je($, j) {
|
|
43
|
+
const { getPrefixCls: z, renderEmpty: K, componentConfig: J, rtl: V } = Ve(_e), e = ke(
|
|
44
|
+
$,
|
|
45
|
+
We,
|
|
46
|
+
J?.Cascader
|
|
47
47
|
), {
|
|
48
|
-
disabled:
|
|
49
|
-
renderFormat:
|
|
50
|
-
getPopupContainer:
|
|
51
|
-
children:
|
|
52
|
-
triggerProps:
|
|
53
|
-
expandTrigger:
|
|
54
|
-
icons:
|
|
55
|
-
} = e,
|
|
56
|
-
loading:
|
|
57
|
-
checked:
|
|
58
|
-
next:
|
|
59
|
-
},
|
|
48
|
+
disabled: I,
|
|
49
|
+
renderFormat: w,
|
|
50
|
+
getPopupContainer: q,
|
|
51
|
+
children: M,
|
|
52
|
+
triggerProps: G,
|
|
53
|
+
expandTrigger: Q,
|
|
54
|
+
icons: O
|
|
55
|
+
} = e, L = {
|
|
56
|
+
loading: O?.loading || /* @__PURE__ */ c(pe, {}),
|
|
57
|
+
checked: O?.checked || /* @__PURE__ */ c(ue, {}),
|
|
58
|
+
next: O?.next || (V ? /* @__PURE__ */ c(ce, {}) : /* @__PURE__ */ c(de, {}))
|
|
59
|
+
}, h = z?.("cascader"), a = e.mode === "multiple", v = y(null), X = Se(), s = Me(() => Fe(
|
|
60
60
|
e,
|
|
61
|
-
|
|
61
|
+
S(
|
|
62
62
|
"value" in e ? e.value : e.defaultValue,
|
|
63
63
|
a
|
|
64
64
|
)
|
|
65
|
-
), [JSON.stringify(
|
|
65
|
+
), [JSON.stringify(De(e)), e.options]), [E, T] = ve(() => "value" in e ? S(e.value, a, s) : "defaultValue" in e ? S(e.defaultValue, a, s) : []), f = "value" in e ? S(e.value, a, s) : E, [l, Y] = H(!1, {
|
|
66
66
|
value: e.popupVisible,
|
|
67
67
|
defaultValue: e.defaultPopupVisible
|
|
68
|
-
}), [
|
|
68
|
+
}), [u, Z, ee] = H("", {
|
|
69
69
|
value: "inputValue" in e ? e.inputValue || "" : void 0
|
|
70
|
-
}),
|
|
71
|
-
|
|
72
|
-
t !== k.current && (te(t), k.current = t, A.current = n, (r = e.onInputValueChange) == null || r.call(e, t, n));
|
|
70
|
+
}), b = y(u), R = y(null), g = y(null), N = y(s?.getCheckedNodes() || []), D = be(`${h}-popup-`), P = (t, n) => {
|
|
71
|
+
t !== b.current && (Z(t), b.current = t, R.current = n, e.onInputValueChange?.(t, n));
|
|
73
72
|
};
|
|
74
|
-
function
|
|
75
|
-
return
|
|
73
|
+
function te(t) {
|
|
74
|
+
return me(t) || fe(t);
|
|
76
75
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, [c]), $(() => {
|
|
76
|
+
B(() => {
|
|
77
|
+
const { current: t } = R;
|
|
78
|
+
ee === u && (t === "manual" || t === "optionListHide") && e.onSearch?.(u, t), u !== b.current && (b.current = u);
|
|
79
|
+
}, [u]), B(() => {
|
|
82
80
|
const t = () => {
|
|
83
|
-
clearTimeout(
|
|
81
|
+
clearTimeout(v.current), v.current = null;
|
|
84
82
|
};
|
|
85
|
-
return !
|
|
86
|
-
|
|
83
|
+
return !l && u && (v.current && t(), v.current = setTimeout(() => {
|
|
84
|
+
P("", "optionListHide"), v.current = null;
|
|
87
85
|
}, 200)), () => {
|
|
88
86
|
t();
|
|
89
87
|
};
|
|
90
|
-
}, [
|
|
91
|
-
if ("value" in e && e.value !==
|
|
92
|
-
const t =
|
|
93
|
-
|
|
88
|
+
}, [l]), we(() => {
|
|
89
|
+
if ("value" in e && e.value !== E) {
|
|
90
|
+
const t = S(e.value, a);
|
|
91
|
+
s.setNodeCheckedByValue(t), T(t);
|
|
94
92
|
}
|
|
95
|
-
}, [e.value, a]),
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
new Set([].concat(t,
|
|
93
|
+
}, [e.value, a]), ye(j, () => g.current, []);
|
|
94
|
+
const ne = (t) => {
|
|
95
|
+
N.current = Array.from(
|
|
96
|
+
new Set([].concat(t, N.current))
|
|
99
97
|
);
|
|
100
|
-
},
|
|
101
|
-
const n = [],
|
|
102
|
-
|
|
103
|
-
if (
|
|
98
|
+
}, F = (t) => {
|
|
99
|
+
const n = [], o = Ae(t), i = (r) => {
|
|
100
|
+
r.some((d) => {
|
|
101
|
+
if (Ue(o, d.pathValue) && (n.push(d.getPathNodes().map((m) => m._data)), Be(o, d.pathValue)), !o.size)
|
|
104
102
|
return !0;
|
|
105
103
|
});
|
|
106
104
|
};
|
|
107
|
-
return i(
|
|
108
|
-
},
|
|
105
|
+
return i(s.getCheckedNodes()), o.size && i(N.current), n;
|
|
106
|
+
}, p = _(
|
|
109
107
|
(t) => {
|
|
110
|
-
|
|
111
|
-
t !== u && ((n = e.onVisibleChange) == null || n.call(e, t), "popupVisible" in e || ee(t));
|
|
108
|
+
t !== l && (e.onVisibleChange?.(t), "popupVisible" in e || Y(t));
|
|
112
109
|
},
|
|
113
|
-
[e.onVisibleChange,
|
|
114
|
-
),
|
|
110
|
+
[e.onVisibleChange, l]
|
|
111
|
+
), re = _(
|
|
115
112
|
(t) => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
disabled: (o = n[n.length - 1]) == null ? void 0 : o.disabled
|
|
113
|
+
const n = F([t])[0] || [];
|
|
114
|
+
let o, i = he(t) ? t.map((r) => String(r)) : [];
|
|
115
|
+
return n.length && (i = n.map((r) => r.label)), k(w) ? o = w(i) : i.every((r, d, m) => ge(r)) ? o = i.join(" / ") : o = i.reduce((r, d, m) => r.concat(m === 0 ? [d] : [" / ", d]), []), {
|
|
116
|
+
text: o || "",
|
|
117
|
+
disabled: n[n.length - 1]?.disabled
|
|
122
118
|
};
|
|
123
119
|
},
|
|
124
|
-
[
|
|
120
|
+
[s, E, w]
|
|
125
121
|
// 这里把 stateValue 放到依赖里面,是因为当受控时props.value改变或非受控时内部stateValue改变,都会需要出发节点选中状态的更新
|
|
126
122
|
// 此时需要重新渲染已选中值的展示
|
|
127
|
-
),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (h === t)
|
|
123
|
+
), C = (t, n) => {
|
|
124
|
+
n === "panel" && x(e.showSearch) && !e.showSearch.retainInputValueWhileSelect && a && P("", "optionChecked");
|
|
125
|
+
const { onChange: o, changeOnSelect: i, expandTrigger: r } = e;
|
|
126
|
+
if (f === t)
|
|
132
127
|
return;
|
|
133
|
-
a ||
|
|
134
|
-
const
|
|
135
|
-
a || (
|
|
136
|
-
dropdownVisible:
|
|
128
|
+
a || s.setNodeCheckedByValue(t), ne(s.getCheckedNodes());
|
|
129
|
+
const m = F(t), se = a ? t : t[0], le = a ? m : m[0];
|
|
130
|
+
a || (u || m[0] && m[0][m[0].length - 1]?.isLeaf || i && r === "hover") && p(!1), "value" in e ? (s.setNodeCheckedByValue(f), X()) : T(t), o?.(se, le, {
|
|
131
|
+
dropdownVisible: l
|
|
137
132
|
});
|
|
138
|
-
},
|
|
139
|
-
if (
|
|
133
|
+
}, oe = (t, n, o) => {
|
|
134
|
+
if (o.stopPropagation(), t.disabled)
|
|
140
135
|
return;
|
|
141
|
-
const i =
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
const n = t ||
|
|
145
|
-
return /* @__PURE__ */
|
|
136
|
+
const i = f.filter((r, d) => d !== n);
|
|
137
|
+
s.setNodeCheckedByValue(i), C(i);
|
|
138
|
+
}, A = (t) => {
|
|
139
|
+
const n = t || g.current && g.current.getWidth();
|
|
140
|
+
return /* @__PURE__ */ c(
|
|
146
141
|
"div",
|
|
147
142
|
{
|
|
148
|
-
className: `${
|
|
143
|
+
className: `${h}-list-empty`,
|
|
149
144
|
style: { width: n },
|
|
150
|
-
children: e.notFoundContent ||
|
|
145
|
+
children: e.notFoundContent || K("Cascader")
|
|
151
146
|
}
|
|
152
147
|
);
|
|
153
|
-
},
|
|
154
|
-
const t =
|
|
155
|
-
return /* @__PURE__ */
|
|
148
|
+
}, ie = () => {
|
|
149
|
+
const t = x(e.showSearch) ? e.showSearch.panelMode : void 0, n = t === W.select ? !0 : t === W.cascader ? !1 : !k(e.onSearch) && !!u, o = g.current && g.current.getWidth(), i = k(e.dropdownRender) ? e.dropdownRender : (r) => r;
|
|
150
|
+
return /* @__PURE__ */ c(
|
|
156
151
|
"div",
|
|
157
152
|
{
|
|
158
|
-
id:
|
|
159
|
-
className:
|
|
160
|
-
[`${
|
|
153
|
+
id: D,
|
|
154
|
+
className: Ne(`${h}-popup`, e.dropdownMenuClassName, {
|
|
155
|
+
[`${h}-popup-trigger-hover`]: e.expandTrigger === "hover"
|
|
161
156
|
}),
|
|
162
157
|
children: i(
|
|
163
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ c(
|
|
164
159
|
"div",
|
|
165
160
|
{
|
|
166
|
-
className: `${
|
|
167
|
-
onMouseDown: (
|
|
168
|
-
children: n ? /* @__PURE__ */
|
|
169
|
-
|
|
161
|
+
className: `${h}-popup-inner`,
|
|
162
|
+
onMouseDown: (r) => r.preventDefault(),
|
|
163
|
+
children: n ? /* @__PURE__ */ c(
|
|
164
|
+
Te,
|
|
170
165
|
{
|
|
171
|
-
style: { minWidth:
|
|
172
|
-
store:
|
|
173
|
-
inputValue:
|
|
174
|
-
renderEmpty: () =>
|
|
166
|
+
style: { minWidth: o },
|
|
167
|
+
store: s,
|
|
168
|
+
inputValue: u,
|
|
169
|
+
renderEmpty: () => A(o),
|
|
175
170
|
multiple: a,
|
|
176
|
-
onChange: (
|
|
177
|
-
|
|
171
|
+
onChange: (r) => {
|
|
172
|
+
C(r, "panel");
|
|
178
173
|
},
|
|
179
|
-
prefixCls:
|
|
180
|
-
rtl:
|
|
174
|
+
prefixCls: h,
|
|
175
|
+
rtl: V,
|
|
181
176
|
onEsc: () => {
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
renderOption: L(e.showSearch) && e.showSearch.renderOption || void 0,
|
|
185
|
-
getTriggerElement: () => {
|
|
186
|
-
var o;
|
|
187
|
-
return (o = C.current) == null ? void 0 : o.dom;
|
|
177
|
+
p(!1);
|
|
188
178
|
},
|
|
189
|
-
|
|
179
|
+
renderOption: x(e.showSearch) && e.showSearch.renderOption || void 0,
|
|
180
|
+
getTriggerElement: () => g.current?.dom,
|
|
181
|
+
value: f,
|
|
190
182
|
virtualListProps: e.virtualListProps,
|
|
191
183
|
defaultActiveFirstOption: e.defaultActiveFirstOption,
|
|
192
|
-
icons:
|
|
184
|
+
icons: L
|
|
193
185
|
}
|
|
194
|
-
) : /* @__PURE__ */
|
|
195
|
-
|
|
186
|
+
) : /* @__PURE__ */ c(
|
|
187
|
+
Le,
|
|
196
188
|
{
|
|
197
189
|
dropdownMenuColumnStyle: e.dropdownMenuColumnStyle,
|
|
198
190
|
virtualListProps: e.virtualListProps,
|
|
199
|
-
expandTrigger:
|
|
200
|
-
store:
|
|
191
|
+
expandTrigger: Q,
|
|
192
|
+
store: s,
|
|
201
193
|
dropdownColumnRender: e.dropdownColumnRender,
|
|
202
194
|
renderOption: e.renderOption,
|
|
203
195
|
changeOnSelect: e.changeOnSelect,
|
|
204
196
|
showEmptyChildren: e.showEmptyChildren || !!e.loadMore,
|
|
205
197
|
multiple: a,
|
|
206
|
-
onChange: (
|
|
207
|
-
|
|
198
|
+
onChange: (r) => {
|
|
199
|
+
C(r, "panel");
|
|
208
200
|
},
|
|
209
201
|
loadMore: e.loadMore,
|
|
210
|
-
prefixCls:
|
|
211
|
-
rtl:
|
|
212
|
-
getTriggerElement: () =>
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
renderEmpty: _,
|
|
217
|
-
popupVisible: u,
|
|
218
|
-
value: h,
|
|
202
|
+
prefixCls: h,
|
|
203
|
+
rtl: V,
|
|
204
|
+
getTriggerElement: () => g.current?.dom,
|
|
205
|
+
renderEmpty: A,
|
|
206
|
+
popupVisible: l,
|
|
207
|
+
value: f,
|
|
219
208
|
renderFooter: e.renderFooter,
|
|
220
|
-
icons:
|
|
209
|
+
icons: L,
|
|
221
210
|
onEsc: () => {
|
|
222
|
-
|
|
211
|
+
p(!1);
|
|
223
212
|
},
|
|
224
213
|
onDoubleClickOption: () => {
|
|
225
|
-
e.changeOnSelect && !a &&
|
|
214
|
+
e.changeOnSelect && !a && p(!1);
|
|
226
215
|
}
|
|
227
216
|
}
|
|
228
217
|
)
|
|
@@ -231,71 +220,69 @@ function ze(J, q) {
|
|
|
231
220
|
)
|
|
232
221
|
}
|
|
233
222
|
);
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
|
|
223
|
+
}, ae = (t) => {
|
|
224
|
+
C(t);
|
|
225
|
+
}, U = (t) => /* @__PURE__ */ c(
|
|
226
|
+
Ee,
|
|
238
227
|
{
|
|
239
|
-
popup:
|
|
228
|
+
popup: ie,
|
|
240
229
|
trigger: e.trigger,
|
|
241
|
-
disabled:
|
|
242
|
-
getPopupContainer:
|
|
243
|
-
position:
|
|
230
|
+
disabled: I,
|
|
231
|
+
getPopupContainer: q,
|
|
232
|
+
position: V ? "br" : "bl",
|
|
244
233
|
classNames: "slideDynamicOrigin",
|
|
245
|
-
popupAlign:
|
|
246
|
-
unmountOnExit: "unmountOnExit" in e ? e.unmountOnExit : !
|
|
247
|
-
popupVisible:
|
|
248
|
-
...
|
|
249
|
-
onVisibleChange:
|
|
234
|
+
popupAlign: $e,
|
|
235
|
+
unmountOnExit: "unmountOnExit" in e ? e.unmountOnExit : !k(e.loadMore),
|
|
236
|
+
popupVisible: l,
|
|
237
|
+
...G,
|
|
238
|
+
onVisibleChange: p,
|
|
250
239
|
children: t
|
|
251
240
|
}
|
|
252
241
|
);
|
|
253
|
-
return
|
|
254
|
-
|
|
242
|
+
return M ? U(M) : /* @__PURE__ */ c(
|
|
243
|
+
Oe,
|
|
255
244
|
{
|
|
256
245
|
...e,
|
|
257
|
-
ref:
|
|
258
|
-
ariaControls:
|
|
259
|
-
popupVisible:
|
|
260
|
-
value: a ?
|
|
261
|
-
inputValue:
|
|
262
|
-
rtl:
|
|
263
|
-
isEmptyValue:
|
|
264
|
-
prefixCls:
|
|
246
|
+
ref: g,
|
|
247
|
+
ariaControls: D,
|
|
248
|
+
popupVisible: l,
|
|
249
|
+
value: a ? f : f && f[0],
|
|
250
|
+
inputValue: u,
|
|
251
|
+
rtl: V,
|
|
252
|
+
isEmptyValue: te(f),
|
|
253
|
+
prefixCls: h,
|
|
265
254
|
isMultiple: a,
|
|
266
|
-
renderText:
|
|
267
|
-
onRemoveCheckedItem:
|
|
268
|
-
onSort:
|
|
269
|
-
renderView:
|
|
255
|
+
renderText: re,
|
|
256
|
+
onRemoveCheckedItem: oe,
|
|
257
|
+
onSort: ae,
|
|
258
|
+
renderView: U,
|
|
270
259
|
onClear: (t) => {
|
|
271
|
-
var n;
|
|
272
260
|
if (t.stopPropagation(), !a)
|
|
273
|
-
|
|
261
|
+
C([]);
|
|
274
262
|
else {
|
|
275
|
-
const
|
|
276
|
-
|
|
263
|
+
const o = s.getCheckedNodes().filter((i) => i.disabled).map((i) => i.pathValue);
|
|
264
|
+
s.setNodeCheckedByValue(o), C(o);
|
|
277
265
|
}
|
|
278
|
-
|
|
266
|
+
e.onClear?.(!!l);
|
|
279
267
|
},
|
|
280
268
|
onKeyDown: (t) => {
|
|
281
|
-
|
|
282
|
-
if (T)
|
|
269
|
+
if (I)
|
|
283
270
|
return;
|
|
284
271
|
t.stopPropagation();
|
|
285
272
|
const n = t.key;
|
|
286
|
-
|
|
273
|
+
l ? (n === Pe.key && (p(!1), t.preventDefault()), n === xe.key && p(!1)) : n === Ie.key && (p(!0), t.preventDefault()), e.onKeyDown?.(t);
|
|
287
274
|
},
|
|
288
275
|
onChangeInputValue: (t) => {
|
|
289
|
-
|
|
276
|
+
P(t, "manual"), l || p(!0);
|
|
290
277
|
}
|
|
291
278
|
}
|
|
292
279
|
);
|
|
293
280
|
}
|
|
294
|
-
const
|
|
295
|
-
|
|
281
|
+
const ze = Ce(
|
|
282
|
+
je
|
|
296
283
|
);
|
|
297
|
-
|
|
284
|
+
ze.displayName = "Cascader";
|
|
298
285
|
export {
|
|
299
|
-
|
|
300
|
-
|
|
286
|
+
He as DefaultFieldNames,
|
|
287
|
+
ze as default
|
|
301
288
|
};
|