@unicom-cloud/ui 0.8.71 → 0.8.73
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 +2 -2
- package/Alert.js +2 -2
- package/AutoComplete.js +2 -2
- package/BackTop.js +2 -2
- package/Badge.js +2 -2
- package/Breadcrumb.js +3 -3
- package/Button.js +1 -1
- package/Calendar.js +1 -1
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +1 -1
- package/Comment.js +1 -1
- package/ConfigProvider.js +1 -1
- package/Copy.js +1 -1
- package/DatePicker.js +1 -1
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +4 -4
- package/Empty.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/List.js +2 -2
- package/Mentions.js +2 -2
- package/Menu.js +1 -1
- package/Message.js +6 -5
- package/Modal.js +1 -1
- package/Notice.js +4 -4
- package/Notification.js +7 -6
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Popconfirm.js +2 -2
- package/Popover.js +2 -2
- package/Progress.js +1 -1
- package/Radio.js +1 -1
- package/Rate.js +2 -2
- package/ResizeBox.js +2 -2
- package/Result.js +1 -1
- package/SelectView.js +4 -3
- package/Skeleton.js +1 -1
- package/Slider.js +3 -3
- package/Space.js +1 -1
- package/SpeechSynthesis.js +20 -20
- package/Spin.js +2 -2
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +7 -5
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +3 -3
- package/Transfer.js +2 -2
- package/Tree.js +1 -1
- package/Trigger.js +8 -7
- package/affix/index.js +2 -2
- package/alert/index.js +2 -2
- package/anchor/Anchor.js +53 -50
- package/anchor/Link.js +1 -1
- package/anchor/util.js +1 -1
- package/auto-complete/index.js +2 -2
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +1 -1
- package/back-top/index.js +2 -2
- package/badge/Count.js +1 -1
- package/badge/index.js +50 -48
- package/breadcrumb/index.js +3 -3
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +2 -2
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +1 -1
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +1 -1
- package/cascader/Cascader.js +4 -4
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +3 -3
- package/checkbox/Group.js +3 -3
- package/checkbox/index.js +1 -1
- package/chunk/{C5X9bDyX.js → 7HDzVe32.js} +7 -7
- package/chunk/{BlElSWJg.js → B0UZ1Ee2.js} +3 -3
- package/chunk/{b1e8awfs.js → B0n0iRhF.js} +1 -1
- package/chunk/{BzPNDYAX.js → B7hulkj9.js} +2 -2
- package/chunk/Bj4EV0eG.js +27 -0
- package/chunk/{Bfq4YEcr.js → Bmvhjhzq.js} +9 -8
- package/chunk/Byd0ztYY.js +724 -0
- package/chunk/{URXCKjXr.js → C0pRaDCf.js} +23 -23
- package/chunk/{B4JiMp8I.js → CCVU-Kst.js} +8 -2
- package/chunk/{ClaNycDy.js → Cc_-i0o_.js} +2 -2
- package/chunk/CiY7w1ZO.js +647 -0
- package/chunk/{fFjj2KuF.js → Cj2SQJiO.js} +392 -414
- package/chunk/Coz3rCng.js +33 -0
- package/chunk/{BHL-PzAD.js → CplLA01W.js} +17 -17
- package/chunk/{8V534cS3.js → D2LLXZQX.js} +5 -7
- package/chunk/DAAff-FT.js +59 -0
- package/chunk/{CQTxhsUk.js → DJDOFlqC.js} +2 -2
- package/chunk/DU1RCDfh.js +29 -0
- package/chunk/{CdaT1b_F.js → DeV0v__J.js} +2 -2
- package/chunk/{I1dqAgn_.js → DejjIa3N.js} +176 -173
- package/chunk/{C6AJxF7d.js → Dg0M2OmF.js} +125 -125
- package/chunk/{DV7ywe_q.js → RS6OAxzv.js} +2 -2
- package/chunk/{CUs1AOCZ.js → UDX9U6M7.js} +3 -3
- package/chunk/{Biupwn8l.js → ZrBrCzQX.js} +6 -5
- package/chunk/{pEI3aB9Z.js → oHDWCJnz.js} +3 -3
- package/chunk/{D2DSUGNT.js → uH6uxyao.js} +1 -1
- package/chunk/{D090jlwP.js → xAb6ZgqS.js} +1 -1
- package/collapse/Collapse.js +3 -3
- package/collapse/Item.js +3 -3
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +8 -8
- package/color-picker/InputRgb.js +6 -6
- package/color-picker/Palette.js +2 -2
- package/color-picker/Panel.js +16 -16
- package/color-picker/colors.js +4 -4
- package/color-picker/index.js +3 -3
- package/color-picker/utils.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +2 -2
- package/config-provider/context.js +1 -1
- package/config-provider/index.js +2 -2
- package/copy/index.js +1 -1
- package/date-picker/Picker.js +1 -1
- package/date-picker/PickerRange.js +2 -2
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +2 -2
- package/divider/index.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +121 -111
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +4 -4
- package/empty/index.js +1 -1
- package/form/Form.js +2 -2
- package/form/FormItem.js +2 -2
- package/form/promisify.js +9 -8
- package/form/store.js +1 -1
- package/form/util.js +1 -1
- package/grid/Col.js +1 -1
- package/grid/Row.js +2 -2
- package/grid/grid-item.js +2 -2
- package/grid/grid.js +2 -2
- package/hooks/index.js +5 -5
- package/hooks/useInView.js +1 -1
- package/hooks/useIntersectionObserver.js +1 -1
- package/hooks/useMergeValue.js +1 -1
- package/hooks/useOverflowHidden.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/hooks/useVerificationCode.js +2 -2
- package/icon/index.js +1 -1
- package/icon-hover/index.js +1 -1
- package/image/Image.js +4 -4
- package/image/ImagePreview.js +8 -8
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +2 -2
- package/image/index.js +1 -1
- package/index.js +591 -571
- package/input/Group.js +1 -1
- package/input/Input.js +47 -46
- package/input/InputElement.js +3 -3
- package/input/Password.js +2 -2
- package/input/Search.js +2 -2
- package/input/Textarea.js +6 -5
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +52 -50
- package/layout/Content.js +1 -1
- package/layout/Footer.js +1 -1
- package/layout/Header.js +1 -1
- package/layout/Sider.js +3 -3
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +2 -2
- package/locale/en-US.js +1 -1
- package/locale/tr-TR.js +1 -1
- package/mentions/index.js +2 -2
- package/menu/Item.js +1 -1
- package/menu/Menu.js +3 -3
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +6 -5
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +8 -7
- package/modal/index.js +1 -1
- package/notice/index.js +4 -4
- package/notification/index.js +7 -6
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +1 -1
- package/overflow-ellipsis/index.js +1 -1
- package/package.json +1 -1
- package/page-header/index.js +1 -1
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +1 -1
- package/pagination/Pagination.js +2 -2
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/popconfirm/index.js +2 -2
- package/popover/index.js +2 -2
- package/progress/index.js +1 -1
- package/radio/Group.js +3 -3
- package/radio/Radio.js +3 -3
- package/radio/index.js +2 -2
- package/rate/index.js +26 -26
- package/resize-box/ResizeTrigger.js +21 -20
- package/resize-box/Split.js +1 -1
- package/resize-box/SplitGroup.js +1 -1
- package/resize-box/index.js +2 -2
- package/result/index.js +1 -1
- package/select/Option.js +1 -1
- package/select/Select.js +5 -4
- package/select/util.js +12 -12
- package/select-view/Core.js +3 -3
- package/select-view/index.js +2 -1
- package/skeleton/index.js +1 -1
- package/slider/Button.js +2 -2
- package/slider/Tick.js +1 -1
- package/slider/index.js +19 -19
- package/slider/util.js +8 -8
- package/space/index.js +1 -1
- package/speech-synthesis/index.js +20 -20
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +2 -2
- package/statistic/Countdown.js +1 -1
- package/statistic/index.js +1 -1
- package/steps/index.js +1 -1
- package/style/variables.less +1 -1
- package/style.css +1 -1
- package/switch/index.js +16 -14
- package/table/Table.js +2 -2
- package/table/index.js +3 -3
- package/tabs/Tab.js +3 -3
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +1 -1
- package/tabs/index.js +2 -2
- package/tag/index.js +1 -1
- package/time-picker/Picker.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/tooltip/index.js +3 -3
- package/transfer/Item.js +2 -2
- package/transfer/List.js +2 -2
- package/transfer/index.js +2 -2
- package/tree/Animation.js +3 -3
- package/tree/Node.js +3 -3
- package/tree/NodeList.js +2 -2
- package/tree/Tree.js +3 -3
- package/tree/index.js +1 -1
- package/tree-select/Select.js +25 -25
- package/trigger/getPopupStyle.js +2 -2
- package/trigger/index.js +7 -6
- package/types/badge/interface.d.ts +1 -0
- package/types/color-picker/colors.d.ts +1 -1
- package/types/date-picker/util.d.ts +1 -1
- package/types/drawer/interface.d.ts +10 -0
- package/types/index.d.ts +0 -7
- package/types/modal/Confirm.d.ts +1 -0
- package/types/utils/PqbCSSTransition.d.ts +3 -0
- package/types/utils/caseName.d.ts +1 -0
- package/types/utils/className.d.ts +1 -0
- package/types/utils/color.d.ts +1 -0
- package/types/utils/computeScrollIntoView.d.ts +1 -0
- package/types/utils/contextHolder.d.ts +1 -0
- package/types/utils/copy.d.ts +1 -0
- package/types/utils/fileToURL.d.ts +1 -0
- package/types/utils/fillNBSP.d.ts +1 -0
- package/types/utils/getHighlightText.d.ts +1 -0
- package/types/utils/getHotkeyHandler.d.ts +1 -0
- package/types/utils/getStringLength.d.ts +1 -0
- package/types/utils/include.d.ts +1 -0
- package/types/utils/index.d.ts +29 -25
- package/types/utils/is.d.ts +1 -1
- package/types/utils/keyboardCode.d.ts +1 -0
- package/types/utils/math.d.ts +1 -0
- package/types/utils/mergeProps.d.ts +1 -0
- package/types/utils/mergedToString.d.ts +1 -0
- package/types/utils/names.d.ts +497 -81
- package/types/utils/omit.d.ts +1 -0
- package/types/utils/pick.d.ts +1 -1
- package/types/utils/reactTransitionGroup.d.ts +1 -0
- package/types/utils/responsiveObserve.d.ts +1 -0
- package/types/utils/saveAs.d.ts +1 -0
- package/types/utils/screenfull.d.ts +1 -0
- package/types/utils/scrollIntoView.d.ts +1 -0
- package/types/utils/tinycolor.d.ts +1 -0
- package/types/utils/tree.d.ts +1 -0
- package/types/utils/tween.d.ts +1 -0
- package/types/utils/uuid.d.ts +1 -0
- package/types/utils/validate.d.ts +1 -0
- package/types/version/index.d.ts +1 -1
- package/typography/Base.js +6 -5
- package/typography/Ellipsis.js +30 -29
- package/typography/Paragraph.js +1 -1
- package/typography/Typography.js +1 -1
- package/typography/index.js +28 -27
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +60 -58
- package/upload/Uploader.js +21 -21
- package/upload/request_.js +4 -3
- package/utils/PqbCSSTransition.js +5 -0
- package/utils/caseName.js +3 -2
- package/utils/className.js +3 -2
- package/{chunk/B6X4lnd0.js → utils/color.js} +55 -53
- package/utils/computeScrollIntoView.js +128 -0
- package/utils/contextHolder.js +3 -2
- package/utils/copy.js +4 -2
- package/utils/fileToURL.js +3 -2
- package/utils/fillNBSP.js +2 -1
- package/utils/getHighlightText.js +2 -1
- package/utils/getHotkeyHandler.js +2 -1
- package/utils/getStringLength.js +2 -1
- package/utils/include.js +2 -1
- package/utils/index.js +302 -249
- package/utils/is.js +104 -101
- package/utils/keyboardCode.js +2 -1
- package/utils/math.js +35 -0
- package/utils/mergeProps.js +2 -1
- package/utils/mergedToString.js +2 -1
- package/utils/names.js +332 -81
- package/utils/omit.js +2 -1
- package/utils/pick.js +1 -0
- package/utils/react19Adapter.js +1 -1
- package/utils/reactDOM.js +1 -1
- package/utils/reactTransitionGroup.js +10 -0
- package/utils/responsiveObserve.js +2 -1
- package/utils/saveAs.js +3 -2
- package/utils/screenfull.js +2 -1
- package/utils/scrollIntoView.js +4 -2
- package/utils/tinycolor.js +30 -0
- package/utils/tree.js +87 -0
- package/utils/tween.js +6 -0
- package/utils/uuid.js +5 -0
- package/utils/validate.js +7 -0
- package/verification-code/VerificationCode.js +1 -1
- package/version/index.js +3 -3
- package/virtual-list/VirtualList.js +1 -1
- package/watermark/Watermark.js +1 -1
- package/chunk/BibHFOCF.js +0 -34
- package/chunk/CVYWxu00.js +0 -155
- package/chunk/CZWGeRVA.js +0 -715
- package/chunk/CbLaCJmG.js +0 -26
- package/chunk/D-TPB2Do.js +0 -56
- package/chunk/Dm1NCTkX.js +0 -629
- package/chunk/EHx6bIK_.js +0 -98
- package/types/utils/CSSTransition.d.ts +0 -2
- package/utils/CSSTransition.js +0 -4
|
@@ -5,36 +5,37 @@ import { jsxs as X, Fragment as ne, jsx as p } from "react/jsx-runtime";
|
|
|
5
5
|
import je from "@unicom-cloud/icons/IconUiCheck";
|
|
6
6
|
import Ue from "@unicom-cloud/icons/IconUiLeft";
|
|
7
7
|
import We from "@unicom-cloud/icons/IconUiLoading";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
8
|
+
import Ke from "@unicom-cloud/icons/IconUiRight";
|
|
9
|
+
import { g as ze, y as qe } from "./C0pRaDCf.js";
|
|
10
10
|
import _e from "lodash/isArray";
|
|
11
11
|
import W from "lodash/isFunction";
|
|
12
12
|
import oe from "lodash/isPlainObject";
|
|
13
13
|
import Y from "lodash/isString";
|
|
14
|
-
import Je, { useRef as
|
|
15
|
-
import { a as Ye } from "./
|
|
14
|
+
import Je, { useRef as z, useState as le, useCallback as se, useEffect as Z, forwardRef as Ge, useContext as Qe, useImperativeHandle as Xe } from "react";
|
|
15
|
+
import { a as Ye } from "./Byd0ztYY.js";
|
|
16
16
|
import { u as ue } from "./CQ_WOOmf.js";
|
|
17
17
|
import { u as Ze } from "./B4YRLi8r.js";
|
|
18
18
|
import { u as et } from "./BFTV6myl.js";
|
|
19
|
-
import { u as ve } from "./
|
|
19
|
+
import { u as ve } from "./DeV0v__J.js";
|
|
20
20
|
import { u as re } from "./a3hR6zLw.js";
|
|
21
21
|
import tt from "../select-view/index.js";
|
|
22
22
|
import nt from "../trigger/index.js";
|
|
23
23
|
import { m as q } from "./JPPo5nY_.js";
|
|
24
|
-
import { e as he, y as rt, n as lt, d as we, r as
|
|
25
|
-
import { b as
|
|
24
|
+
import { e as he, y as rt, n as lt, d as we, r as ae, o as fe, c as st } from "./BrOW642m.js";
|
|
25
|
+
import { b as at } from "./Cj2SQJiO.js";
|
|
26
26
|
import me from "lodash/isEqualWith";
|
|
27
27
|
import ee from "lodash/get";
|
|
28
|
-
import { p as
|
|
29
|
-
import { C as Oe } from "./
|
|
30
|
-
import { u as
|
|
28
|
+
import { p as it } from "./Coz3rCng.js";
|
|
29
|
+
import { C as Oe } from "./B7hulkj9.js";
|
|
30
|
+
import { u as ct } from "./oopARUrq.js";
|
|
31
31
|
import { on as Le, off as de } from "../utils/dom.js";
|
|
32
|
-
import "./
|
|
32
|
+
import "./DAAff-FT.js";
|
|
33
33
|
import Pe from "../virtual-list/VirtualList.js";
|
|
34
34
|
import xe from "lodash/isPlainObject.js";
|
|
35
|
-
import { u as
|
|
35
|
+
import { u as ot } from "./Bg3uJGPu.js";
|
|
36
|
+
import { P as dt } from "./Bj4EV0eG.js";
|
|
36
37
|
function ut(t, e) {
|
|
37
|
-
const n =
|
|
38
|
+
const n = z(null), l = ue();
|
|
38
39
|
return n.current || (n.current = t()), re(() => {
|
|
39
40
|
n.current = t(), l();
|
|
40
41
|
}, [...e]), n.current;
|
|
@@ -68,14 +69,14 @@ class ge {
|
|
|
68
69
|
// 保存暴露给外部的属性
|
|
69
70
|
d(this, "_data");
|
|
70
71
|
d(this, "_initNode", (e, n = null) => {
|
|
71
|
-
const { showEmptyChildren: l, lazyload:
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
const O = ee(e, c.value) || e[c.value], $ = ee(e, c.label) || e[c.label],
|
|
72
|
+
const { showEmptyChildren: l, lazyload: a } = this.config, c = { ...Ae, ...this.config.fieldNames }, r = ee(e, c.children) || e[c.children];
|
|
73
|
+
let C = Array.isArray(r) ? l ? !1 : r.length === 0 : !0;
|
|
74
|
+
a && (c.isLeaf in e ? C = !!ee(e, c.isLeaf) || !!e[c.isLeaf] : C = !1);
|
|
75
|
+
const O = ee(e, c.value) || e[c.value], $ = ee(e, c.label) || e[c.label], k = {
|
|
75
76
|
...e,
|
|
76
77
|
value: O,
|
|
77
78
|
label: $,
|
|
78
|
-
isLeaf:
|
|
79
|
+
isLeaf: C,
|
|
79
80
|
loading: !1,
|
|
80
81
|
loaded: !1,
|
|
81
82
|
disabled: n && n.disabled || ee(e, c.disabled) || e[c.disabled],
|
|
@@ -87,10 +88,10 @@ class ge {
|
|
|
87
88
|
_halfChecked: !1
|
|
88
89
|
};
|
|
89
90
|
this._data = {
|
|
90
|
-
...
|
|
91
|
-
parent:
|
|
92
|
-
}, Object.keys(
|
|
93
|
-
this[x] =
|
|
91
|
+
...k,
|
|
92
|
+
parent: k.parent && k.parent._data
|
|
93
|
+
}, Object.keys(k).forEach((x) => {
|
|
94
|
+
this[x] = k[x];
|
|
94
95
|
}), r && r.length && (this.children = r.map((x, N) => new ge({ ...x, _index: N }, this.config, this)), this._data.children = this.children.map((x) => x._data));
|
|
95
96
|
});
|
|
96
97
|
/**
|
|
@@ -100,8 +101,8 @@ class ge {
|
|
|
100
101
|
*/
|
|
101
102
|
d(this, "_isHalfChecked", () => {
|
|
102
103
|
const e = this.children.reduce((n, l) => {
|
|
103
|
-
const
|
|
104
|
-
return n +
|
|
104
|
+
const a = l._halfChecked ? 0.5 : l._checked ? 1 : 0;
|
|
105
|
+
return n + a;
|
|
105
106
|
}, 0);
|
|
106
107
|
return e !== this.children.length && e > 0;
|
|
107
108
|
});
|
|
@@ -116,12 +117,12 @@ class ge {
|
|
|
116
117
|
}), this.updateHalfState(e));
|
|
117
118
|
});
|
|
118
119
|
d(this, "getSelfChildrenValue", () => {
|
|
119
|
-
const e = [], n = (l,
|
|
120
|
-
if (!
|
|
120
|
+
const e = [], n = (l, a) => {
|
|
121
|
+
if (!a || !a.length) {
|
|
121
122
|
e.push(l);
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
|
-
(
|
|
125
|
+
(a || []).forEach((c) => {
|
|
125
126
|
n(c.pathValue, c.children);
|
|
126
127
|
});
|
|
127
128
|
};
|
|
@@ -179,14 +180,14 @@ class ht {
|
|
|
179
180
|
d(this, "flatNodes", []);
|
|
180
181
|
d(this, "config", {});
|
|
181
182
|
// 初始化节点状态,附加状态信息字段: _checked,_halfChecked,parent,disabled
|
|
182
|
-
d(this, "_calcNodes", (e, n) => e ? e.map((l,
|
|
183
|
+
d(this, "_calcNodes", (e, n) => e ? e.map((l, a) => new ge({ ...l, _index: a }, this.config, n)) : []);
|
|
183
184
|
// this.flatNodes 保存所有可能的选中项
|
|
184
185
|
d(this, "_updateFlatNodes", () => {
|
|
185
186
|
const e = !this.config.changeOnSelect;
|
|
186
187
|
this.flatNodes = [];
|
|
187
188
|
const n = (l) => {
|
|
188
|
-
l && ((!e || l.isLeaf) && this.flatNodes.push(l), _e(l.children) && l.children.forEach((
|
|
189
|
-
n(
|
|
189
|
+
l && ((!e || l.isLeaf) && this.flatNodes.push(l), _e(l.children) && l.children.forEach((a) => {
|
|
190
|
+
n(a);
|
|
190
191
|
}));
|
|
191
192
|
};
|
|
192
193
|
this.nodes.forEach((l) => {
|
|
@@ -201,10 +202,10 @@ class ht {
|
|
|
201
202
|
d(this, "setNodeCheckedByValue", (e) => {
|
|
202
203
|
const n = ie(e);
|
|
203
204
|
this.flatNodes.forEach((l) => {
|
|
204
|
-
let
|
|
205
|
+
let a = !1;
|
|
205
206
|
this.config.showParent ? l.pathValue.some(
|
|
206
|
-
(c, r,
|
|
207
|
-
) && (
|
|
207
|
+
(c, r, C) => J(n, C.slice(0, r + 1))
|
|
208
|
+
) && (a = !0) : J(n, l.pathValue) && (a = !0), l.setCheckedStateIgnoreDisabled(a);
|
|
208
209
|
});
|
|
209
210
|
});
|
|
210
211
|
/**
|
|
@@ -232,8 +233,8 @@ class ht {
|
|
|
232
233
|
d(this, "searchNodeByLabel", (e) => {
|
|
233
234
|
if (!e)
|
|
234
235
|
return this.flatNodes;
|
|
235
|
-
const { filterOption: n } = this.config, l = W(n) ? n : (
|
|
236
|
-
return this.flatNodes.filter((
|
|
236
|
+
const { filterOption: n } = this.config, l = W(n) ? n : (a, c) => Y(c.label) && c.label.indexOf(a) > -1;
|
|
237
|
+
return this.flatNodes.filter((a) => a.getPathNodes().some((r) => l(e, r._data)));
|
|
237
238
|
});
|
|
238
239
|
/** 获取所有节点 */
|
|
239
240
|
d(this, "getOptions", () => this.nodes);
|
|
@@ -243,15 +244,15 @@ class ht {
|
|
|
243
244
|
d(this, "getCheckedParentNodes", () => {
|
|
244
245
|
const e = /* @__PURE__ */ new Set();
|
|
245
246
|
return this.flatNodes.forEach((n) => {
|
|
246
|
-
n._checked && n.getPathNodes().some((
|
|
247
|
-
if (
|
|
248
|
-
return e.has(
|
|
247
|
+
n._checked && n.getPathNodes().some((a) => {
|
|
248
|
+
if (a._checked)
|
|
249
|
+
return e.has(a) || e.add(a), !0;
|
|
249
250
|
});
|
|
250
251
|
}), Array.from(e);
|
|
251
252
|
});
|
|
252
253
|
this.config = { ...l };
|
|
253
|
-
const
|
|
254
|
-
this.nodes = this._calcNodes(e, null), this._updateFlatNodes(), this.setNodeCheckedByValue(
|
|
254
|
+
const a = Array.isArray(n) ? n : [];
|
|
255
|
+
this.nodes = this._calcNodes(e, null), this._updateFlatNodes(), this.setNodeCheckedByValue(a);
|
|
255
256
|
}
|
|
256
257
|
}
|
|
257
258
|
const G = "__pqb_cascader__", ft = "parent", mt = "child", ye = {
|
|
@@ -272,7 +273,7 @@ function gt(t, e) {
|
|
|
272
273
|
const n = e ? Array.isArray(e[0]) ? e : [e] : [];
|
|
273
274
|
return new ht(t.options || [], n, Ee(t));
|
|
274
275
|
}
|
|
275
|
-
const ie = (t) => (t || []).reduce((l,
|
|
276
|
+
const ie = (t) => (t || []).reduce((l, a) => (l.add([].concat(a).join(G)), l), /* @__PURE__ */ new Set()), J = (t, e) => {
|
|
276
277
|
const n = e || [];
|
|
277
278
|
return t.has(n.join(G));
|
|
278
279
|
}, pt = (t, e) => {
|
|
@@ -281,13 +282,13 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
281
282
|
}, te = (t, e, n) => {
|
|
282
283
|
let l = [];
|
|
283
284
|
if (t === void 0 ? l = [] : e ? l = t : l = [t], n && n.config.showParent) {
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
), r = [],
|
|
285
|
+
const a = n.getCheckedNodes(), c = ie(
|
|
286
|
+
a.map((O) => O.pathValue)
|
|
287
|
+
), r = [], C = {};
|
|
287
288
|
return l.map((O) => {
|
|
288
|
-
O.some(($,
|
|
289
|
-
const N = x.slice(0,
|
|
290
|
-
return E && !
|
|
289
|
+
O.some(($, k, x) => {
|
|
290
|
+
const N = x.slice(0, k + 1), E = J(c, N);
|
|
291
|
+
return E && !C[N.join(G)] && (r.push(N), C[N.join(G)] = 1), E;
|
|
291
292
|
});
|
|
292
293
|
}), r;
|
|
293
294
|
}
|
|
@@ -296,22 +297,22 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
296
297
|
const e = (n) => Array.isArray(n) ? n.every((l) => l._checked || l.disabled ? !0 : e(l.children)) : !1;
|
|
297
298
|
return t._halfChecked && e(t == null ? void 0 : t.children);
|
|
298
299
|
}, Me = (t, e, n, l) => {
|
|
299
|
-
const
|
|
300
|
-
n.setCheckedState(
|
|
301
|
-
const
|
|
302
|
-
return t.filter((
|
|
303
|
-
if (!J(c,
|
|
304
|
-
return $.add(
|
|
300
|
+
const a = l && Ct(n) ? !1 : l, c = e.getCheckedNodes().reduce((k, x) => (k.add(x.pathValue.join(G)), k), /* @__PURE__ */ new Set());
|
|
301
|
+
n.setCheckedState(a);
|
|
302
|
+
const C = e.getCheckedNodes().map((k) => k.pathValue), O = ie(C), $ = /* @__PURE__ */ new Set();
|
|
303
|
+
return t.filter((k) => {
|
|
304
|
+
if (!J(c, k) || J(O, k))
|
|
305
|
+
return $.add(k.join(G)), !0;
|
|
305
306
|
}).concat(
|
|
306
|
-
|
|
307
|
+
C.filter((k) => !J($, k))
|
|
307
308
|
);
|
|
308
309
|
}, kt = (t) => {
|
|
309
|
-
const { prefixCls: e, multiple: n, option: l, renderOption:
|
|
310
|
+
const { prefixCls: e, multiple: n, option: l, renderOption: a, selected: c, icons: r } = t, C = l.disabled || n && l.disableCheckbox;
|
|
310
311
|
return /* @__PURE__ */ X(ne, { children: [
|
|
311
312
|
n ? /* @__PURE__ */ p(
|
|
312
313
|
Oe,
|
|
313
314
|
{
|
|
314
|
-
disabled:
|
|
315
|
+
disabled: C,
|
|
315
316
|
checked: l._checked,
|
|
316
317
|
indeterminate: l._halfChecked,
|
|
317
318
|
onChange: t.onMultipleChecked,
|
|
@@ -324,9 +325,9 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
324
325
|
className: `${e}-list-item-label`,
|
|
325
326
|
onClick: l.disabled ? void 0 : t.onClickOption,
|
|
326
327
|
onMouseEnter: t.onMouseEnter,
|
|
327
|
-
onDoubleClick:
|
|
328
|
+
onDoubleClick: C ? void 0 : t.onDoubleClickOption,
|
|
328
329
|
children: [
|
|
329
|
-
|
|
330
|
+
a ? a() : l.label,
|
|
330
331
|
l.isLeaf ? c && r.checked : l.loading ? r.loading : r.next
|
|
331
332
|
]
|
|
332
333
|
}
|
|
@@ -346,46 +347,46 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
346
347
|
return t;
|
|
347
348
|
}, Ve = (t, e) => t < 0 ? e : t > e ? 0 : t, vt = (t) => {
|
|
348
349
|
var M;
|
|
349
|
-
const [e, n] =
|
|
350
|
-
store:
|
|
350
|
+
const [e, n] = ot(), l = ue(), {
|
|
351
|
+
store: a,
|
|
351
352
|
prefixCls: c,
|
|
352
353
|
value: r,
|
|
353
|
-
multiple:
|
|
354
|
+
multiple: C,
|
|
354
355
|
renderFooter: O,
|
|
355
356
|
renderOption: $,
|
|
356
|
-
showEmptyChildren:
|
|
357
|
+
showEmptyChildren: k,
|
|
357
358
|
loadMore: x,
|
|
358
359
|
renderEmpty: N,
|
|
359
360
|
rtl: E,
|
|
360
361
|
icons: T
|
|
361
362
|
} = t, [h, V] = le(
|
|
362
|
-
|
|
363
|
-
), L =
|
|
363
|
+
a.findNodeByValue(r && r[r.length - 1]) || null
|
|
364
|
+
), L = a.getOptions(), j = (s) => {
|
|
364
365
|
var u;
|
|
365
|
-
(u = t.onChange) == null || u.call(t,
|
|
366
|
-
}, S = async (
|
|
367
|
-
if (!
|
|
368
|
-
|
|
366
|
+
(u = t.onChange) == null || u.call(t, s);
|
|
367
|
+
}, S = async (s) => {
|
|
368
|
+
if (!s.isLeaf && W(x) && !s.children) {
|
|
369
|
+
s.setLoading(!0), l();
|
|
369
370
|
try {
|
|
370
371
|
const u = await x(
|
|
371
|
-
|
|
372
|
-
|
|
372
|
+
s.pathValue,
|
|
373
|
+
s.pathValue.length
|
|
373
374
|
);
|
|
374
|
-
|
|
375
|
+
a.appendOptionChildren(s, u), a.setNodeCheckedByValue(t.value);
|
|
375
376
|
} catch (u) {
|
|
376
377
|
console.error(u);
|
|
377
378
|
}
|
|
378
|
-
|
|
379
|
+
s.setLoading(!1), l();
|
|
379
380
|
}
|
|
380
|
-
}, f = async (
|
|
381
|
-
!
|
|
382
|
-
}, P = (
|
|
383
|
-
const g = Me(t.value,
|
|
384
|
-
|
|
385
|
-
}, w =
|
|
386
|
-
(
|
|
381
|
+
}, f = async (s, u = !0) => {
|
|
382
|
+
!s || s.disabled || (V(s), S(s), !C && u && (t.changeOnSelect || s.isLeaf) && j([s.pathValue]));
|
|
383
|
+
}, P = (s, u) => {
|
|
384
|
+
const g = Me(t.value, a, s, u);
|
|
385
|
+
s === h && l(), V(s), t.changeOnSelect || S(s), j(g);
|
|
386
|
+
}, w = se(
|
|
387
|
+
(s = h) => {
|
|
387
388
|
var g;
|
|
388
|
-
let u =
|
|
389
|
+
let u = s;
|
|
389
390
|
for (; u; )
|
|
390
391
|
(g = e[u._level]) == null || g.scrollTo({
|
|
391
392
|
index: u._index,
|
|
@@ -393,78 +394,78 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
393
394
|
}), u = u._level < 1 ? null : u.parent;
|
|
394
395
|
},
|
|
395
396
|
[h]
|
|
396
|
-
),
|
|
397
|
-
(
|
|
397
|
+
), b = se(
|
|
398
|
+
(s) => {
|
|
398
399
|
var o;
|
|
399
|
-
const u =
|
|
400
|
+
const u = s.key;
|
|
400
401
|
let g;
|
|
401
402
|
switch (u) {
|
|
402
403
|
case fe.key: {
|
|
403
|
-
|
|
404
|
+
s.preventDefault(), (o = t.onEsc) == null || o.call(t);
|
|
404
405
|
break;
|
|
405
406
|
}
|
|
406
|
-
case
|
|
407
|
+
case ae.key:
|
|
407
408
|
case we.key: {
|
|
408
409
|
if (!h)
|
|
409
410
|
g = bt(L);
|
|
410
411
|
else {
|
|
411
|
-
const A = Ne(h), U = A.parent && A.parent.children || L, F = u ===
|
|
412
|
-
let
|
|
412
|
+
const A = Ne(h), U = A.parent && A.parent.children || L, F = u === ae.key ? 1 : -1;
|
|
413
|
+
let K = Ve(
|
|
413
414
|
A._index + F,
|
|
414
415
|
U.length - 1
|
|
415
416
|
);
|
|
416
|
-
for (;
|
|
417
|
-
|
|
417
|
+
for (; K !== A._index && (g = U[K], g.disabled); )
|
|
418
|
+
K = Ve(K + F, U.length - 1);
|
|
418
419
|
}
|
|
419
|
-
return w(g), f(g, !1),
|
|
420
|
+
return w(g), f(g, !1), s.preventDefault(), !1;
|
|
420
421
|
}
|
|
421
422
|
case lt.key:
|
|
422
|
-
return h && !h.disabled && (g = (h.children || [])[0] || h, f(g, !1)),
|
|
423
|
+
return h && !h.disabled && (g = (h.children || [])[0] || h, f(g, !1)), s.preventDefault(), !1;
|
|
423
424
|
case rt.key: {
|
|
424
425
|
if (h) {
|
|
425
426
|
const A = Ne(h);
|
|
426
427
|
g = A.parent || A;
|
|
427
428
|
}
|
|
428
|
-
return f(g, !1),
|
|
429
|
+
return f(g, !1), s.preventDefault(), !1;
|
|
429
430
|
}
|
|
430
431
|
case he.key:
|
|
431
|
-
return h && (
|
|
432
|
+
return h && (C ? P(h, !h._checked) : f(h)), s.preventDefault(), !1;
|
|
432
433
|
}
|
|
433
434
|
},
|
|
434
435
|
[h]
|
|
435
436
|
);
|
|
436
437
|
re(() => {
|
|
437
|
-
V((
|
|
438
|
+
V((s) => {
|
|
438
439
|
let u;
|
|
439
|
-
if (
|
|
440
|
-
const g =
|
|
440
|
+
if (s && s.pathValue && s.pathValue.length) {
|
|
441
|
+
const g = s.pathValue;
|
|
441
442
|
let o = { children: L };
|
|
442
443
|
g.map((A) => {
|
|
443
|
-
const F = (o.children || []).find((
|
|
444
|
+
const F = (o.children || []).find((K) => K.value === A);
|
|
444
445
|
F && (o = F, u = F);
|
|
445
446
|
});
|
|
446
447
|
}
|
|
447
448
|
return u;
|
|
448
449
|
});
|
|
449
|
-
}, [
|
|
450
|
+
}, [a]), Z(() => {
|
|
450
451
|
t.popupVisible && L.length && setTimeout(w);
|
|
451
452
|
}, [t.popupVisible]), Z(() => {
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
454
|
-
return t.popupVisible ? Le(
|
|
455
|
-
de(
|
|
453
|
+
const s = t.getTriggerElement();
|
|
454
|
+
if (s)
|
|
455
|
+
return t.popupVisible ? Le(s, "keydown", b) : de(s, "keydown", b), () => {
|
|
456
|
+
de(s, "keydown", b);
|
|
456
457
|
};
|
|
457
|
-
}, [t.popupVisible,
|
|
458
|
+
}, [t.popupVisible, b]);
|
|
458
459
|
const I = (() => {
|
|
459
|
-
const
|
|
460
|
+
const s = [L];
|
|
460
461
|
return (h ? h.getPathNodes() : []).forEach((g) => {
|
|
461
|
-
g && g.children &&
|
|
462
|
-
}),
|
|
463
|
-
})(), _ = W(t.dropdownColumnRender) ? t.dropdownColumnRender : (
|
|
464
|
-
return !I.length || !((M = I[0]) != null && M.length) ? /* @__PURE__ */ p(ne, { children: N() }) : /* @__PURE__ */ p(
|
|
462
|
+
g && g.children && s.push(g.children);
|
|
463
|
+
}), s;
|
|
464
|
+
})(), _ = W(t.dropdownColumnRender) ? t.dropdownColumnRender : (s) => s;
|
|
465
|
+
return !I.length || !((M = I[0]) != null && M.length) ? /* @__PURE__ */ p(ne, { children: N() }) : /* @__PURE__ */ p(at, { component: Je.Fragment, children: I.map((s, u) => {
|
|
465
466
|
const g = O ? O(u, h || null) : null;
|
|
466
|
-
return
|
|
467
|
-
|
|
467
|
+
return s.length === 0 && !k ? null : /* @__PURE__ */ p(
|
|
468
|
+
dt,
|
|
468
469
|
{
|
|
469
470
|
timeout: {
|
|
470
471
|
enter: 300,
|
|
@@ -499,12 +500,12 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
499
500
|
[`${c}-list-wrapper-with-footer`]: g !== null
|
|
500
501
|
}),
|
|
501
502
|
children: [
|
|
502
|
-
|
|
503
|
+
s.length === 0 ? N == null ? void 0 : N(t.virtualListProps ? "100%" : 120) : /* @__PURE__ */ p(
|
|
503
504
|
Pe,
|
|
504
505
|
{
|
|
505
506
|
needFiller: !1,
|
|
506
507
|
threshold: t.virtualListProps ? 100 : null,
|
|
507
|
-
data:
|
|
508
|
+
data: s,
|
|
508
509
|
isStaticItemHeight: !0,
|
|
509
510
|
itemKey: "value",
|
|
510
511
|
...xe(t.virtualListProps) ? t.virtualListProps : {},
|
|
@@ -515,7 +516,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
515
516
|
`${c}-list`,
|
|
516
517
|
`${c}-list-select`,
|
|
517
518
|
{
|
|
518
|
-
[`${c}-list-multiple`]:
|
|
519
|
+
[`${c}-list-multiple`]: C,
|
|
519
520
|
[`${c}-list-rtl`]: E
|
|
520
521
|
}
|
|
521
522
|
),
|
|
@@ -539,16 +540,16 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
539
540
|
{
|
|
540
541
|
prefixCls: c,
|
|
541
542
|
rtl: E,
|
|
542
|
-
multiple:
|
|
543
|
+
multiple: C,
|
|
543
544
|
option: o,
|
|
544
|
-
selected: !
|
|
545
|
+
selected: !C && o.isLeaf && me(t.value, o.pathValue),
|
|
545
546
|
icons: T,
|
|
546
547
|
onMouseEnter: () => {
|
|
547
548
|
o.disabled || t.expandTrigger === "hover" && (V(o), !o.isLeaf && S(o));
|
|
548
549
|
},
|
|
549
550
|
renderOption: $ && (() => $(o._data, u)),
|
|
550
551
|
onClickOption: () => {
|
|
551
|
-
o.isLeaf &&
|
|
552
|
+
o.isLeaf && C && !o.disableCheckbox ? P(o, !o._checked) : f(o);
|
|
552
553
|
},
|
|
553
554
|
onMultipleChecked: (U) => {
|
|
554
555
|
P(o, U);
|
|
@@ -586,12 +587,12 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
586
587
|
}, Se = (t, e) => t < 0 ? e : t > e ? 0 : t, yt = (t, e, n) => {
|
|
587
588
|
let l = e;
|
|
588
589
|
if (Y(e)) {
|
|
589
|
-
const
|
|
590
|
-
if (
|
|
591
|
-
const c = e.substring(0,
|
|
590
|
+
const a = e.toUpperCase().indexOf(t.toUpperCase());
|
|
591
|
+
if (a > -1) {
|
|
592
|
+
const c = e.substring(0, a + 1), r = e.substring(a + t.length);
|
|
592
593
|
l = /* @__PURE__ */ X(ne, { children: [
|
|
593
594
|
c,
|
|
594
|
-
/* @__PURE__ */ p("span", { className: `${n}-highlight`, children: e.substring(
|
|
595
|
+
/* @__PURE__ */ p("span", { className: `${n}-highlight`, children: e.substring(a, t.length + 1) }),
|
|
595
596
|
r
|
|
596
597
|
] });
|
|
597
598
|
}
|
|
@@ -602,29 +603,29 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
602
603
|
store: e,
|
|
603
604
|
prefixCls: n,
|
|
604
605
|
multiple: l,
|
|
605
|
-
onChange:
|
|
606
|
+
onChange: a,
|
|
606
607
|
inputValue: c,
|
|
607
608
|
renderEmpty: r,
|
|
608
|
-
style:
|
|
609
|
+
style: C,
|
|
609
610
|
defaultActiveFirstOption: O,
|
|
610
611
|
rtl: $,
|
|
611
|
-
icons:
|
|
612
|
+
icons: k
|
|
612
613
|
} = t, x = t.value || [], [N, E] = le(
|
|
613
614
|
e.searchNodeByLabel(c) || []
|
|
614
|
-
), T =
|
|
615
|
+
), T = z(), h = z(), V = ct(), [L, j] = le(
|
|
615
616
|
O ? 0 : -1
|
|
616
617
|
), S = (f, P, w) => {
|
|
617
618
|
if (w.stopPropagation(), !f.disabled)
|
|
618
619
|
if (l) {
|
|
619
|
-
const
|
|
620
|
+
const b = Me(
|
|
620
621
|
t.value,
|
|
621
622
|
e,
|
|
622
623
|
f,
|
|
623
624
|
P
|
|
624
625
|
);
|
|
625
|
-
|
|
626
|
+
a == null || a(b);
|
|
626
627
|
} else
|
|
627
|
-
|
|
628
|
+
a == null || a([f.pathValue]);
|
|
628
629
|
};
|
|
629
630
|
return re(() => {
|
|
630
631
|
E(e.searchNodeByLabel(c));
|
|
@@ -637,14 +638,14 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
637
638
|
const P = (w) => {
|
|
638
639
|
var I;
|
|
639
640
|
w.stopPropagation();
|
|
640
|
-
const
|
|
641
|
-
switch (
|
|
641
|
+
const b = w.key;
|
|
642
|
+
switch (b) {
|
|
642
643
|
case fe.key:
|
|
643
644
|
return (I = t.onEsc) == null || I.call(t), !1;
|
|
644
|
-
case
|
|
645
|
+
case ae.key:
|
|
645
646
|
case we.key: {
|
|
646
647
|
h.current = !0;
|
|
647
|
-
const _ =
|
|
648
|
+
const _ = ae.key === b ? 1 : -1;
|
|
648
649
|
let M = Se(
|
|
649
650
|
L + _,
|
|
650
651
|
N.length - 1
|
|
@@ -656,7 +657,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
656
657
|
case he.key: {
|
|
657
658
|
const _ = N[L];
|
|
658
659
|
if (_) {
|
|
659
|
-
const M = x.some((
|
|
660
|
+
const M = x.some((s) => me(s, _.pathValue));
|
|
660
661
|
S(_, !M, w);
|
|
661
662
|
}
|
|
662
663
|
return !1;
|
|
@@ -669,7 +670,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
669
670
|
}, [N, L, x]), Z(() => {
|
|
670
671
|
var P;
|
|
671
672
|
const f = T.current;
|
|
672
|
-
f && (h.current || V) &&
|
|
673
|
+
f && (h.current || V) && it(f, {
|
|
673
674
|
behavior: "auto",
|
|
674
675
|
block: "nearest",
|
|
675
676
|
scrollMode: "if-needed",
|
|
@@ -681,7 +682,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
681
682
|
needFiller: !1,
|
|
682
683
|
wrapper: "ul",
|
|
683
684
|
role: "menu",
|
|
684
|
-
style:
|
|
685
|
+
style: C,
|
|
685
686
|
data: N,
|
|
686
687
|
isStaticItemHeight: !0,
|
|
687
688
|
threshold: t.virtualListProps ? 100 : null,
|
|
@@ -694,26 +695,26 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
694
695
|
[`${n}-list-rtl`]: $
|
|
695
696
|
}),
|
|
696
697
|
children: (f, P) => {
|
|
697
|
-
const w = f.getPathNodes(),
|
|
698
|
-
|
|
698
|
+
const w = f.getPathNodes(), b = w.map((s, u, g) => /* @__PURE__ */ X("span", { children: [
|
|
699
|
+
s.label,
|
|
699
700
|
w.length === u + 1 ? "" : " / "
|
|
700
|
-
] }, `${
|
|
701
|
+
] }, `${s.label}_${s._level}`)), I = f._checked, _ = { checked: I }, M = W(t.renderOption) ? t.renderOption(c, f._data, _) : yt(c, b, n);
|
|
701
702
|
return /* @__PURE__ */ p(
|
|
702
703
|
"li",
|
|
703
704
|
{
|
|
704
|
-
title: Y(M) ? M : Y(
|
|
705
|
+
title: Y(M) ? M : Y(b) ? b : void 0,
|
|
705
706
|
role: "menuitem",
|
|
706
707
|
"aria-disabled": f.disabled,
|
|
707
|
-
ref: (
|
|
708
|
-
P === L && (T.current =
|
|
708
|
+
ref: (s) => {
|
|
709
|
+
P === L && (T.current = s), I && !T.current && (T.current = s);
|
|
709
710
|
},
|
|
710
711
|
className: q(`${n}-list-search-item`, {
|
|
711
712
|
[`${n}-list-search-item-active`]: I,
|
|
712
713
|
[`${n}-list-search-item-hover`]: P === L,
|
|
713
714
|
[`${n}-list-search-item-disabled`]: f.disabled
|
|
714
715
|
}),
|
|
715
|
-
onClick: (
|
|
716
|
-
S(f, !I,
|
|
716
|
+
onClick: (s) => {
|
|
717
|
+
S(f, !I, s);
|
|
717
718
|
},
|
|
718
719
|
onMouseEnter: () => {
|
|
719
720
|
!h.current && !f.disabled && j(P);
|
|
@@ -723,7 +724,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
723
724
|
},
|
|
724
725
|
children: /* @__PURE__ */ p("div", { className: `${n}-list-item-label`, children: W(t.renderOption) ? M : l ? /* @__PURE__ */ p(Oe, { checked: I, disabled: f.disabled, children: M }) : /* @__PURE__ */ X(ne, { children: [
|
|
725
726
|
M,
|
|
726
|
-
I && /* @__PURE__ */ p("span", { className: `${n}-check-icon`, children:
|
|
727
|
+
I && /* @__PURE__ */ p("span", { className: `${n}-check-icon`, children: k.checked })
|
|
727
728
|
] }) })
|
|
728
729
|
},
|
|
729
730
|
P
|
|
@@ -747,54 +748,54 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
747
748
|
defaultActiveFirstOption: !0
|
|
748
749
|
}, St = { bottom: 4 };
|
|
749
750
|
function _t(t, e) {
|
|
750
|
-
const { getPrefixCls: n, renderEmpty: l, componentConfig:
|
|
751
|
+
const { getPrefixCls: n, renderEmpty: l, componentConfig: a, rtl: c } = Qe(Ye), r = et(
|
|
751
752
|
t,
|
|
752
753
|
Vt,
|
|
753
|
-
|
|
754
|
+
a == null ? void 0 : a.Cascader
|
|
754
755
|
), {
|
|
755
|
-
disabled:
|
|
756
|
+
disabled: C,
|
|
756
757
|
renderFormat: O,
|
|
757
758
|
getPopupContainer: $,
|
|
758
|
-
children:
|
|
759
|
+
children: k,
|
|
759
760
|
triggerProps: x,
|
|
760
761
|
expandTrigger: N,
|
|
761
762
|
icons: E
|
|
762
763
|
} = r, T = {
|
|
763
764
|
loading: (E == null ? void 0 : E.loading) || /* @__PURE__ */ p(We, {}),
|
|
764
765
|
checked: (E == null ? void 0 : E.checked) || /* @__PURE__ */ p(je, {}),
|
|
765
|
-
next: (E == null ? void 0 : E.next) || (c ? /* @__PURE__ */ p(Ue, {}) : /* @__PURE__ */ p(
|
|
766
|
-
}, h = n("cascader"), V = r.mode === "multiple", L =
|
|
766
|
+
next: (E == null ? void 0 : E.next) || (c ? /* @__PURE__ */ p(Ue, {}) : /* @__PURE__ */ p(Ke, {}))
|
|
767
|
+
}, h = n("cascader"), V = r.mode === "multiple", L = z(null), j = ue(), S = ut(() => gt(
|
|
767
768
|
r,
|
|
768
769
|
te(
|
|
769
770
|
"value" in r ? r.value : r.defaultValue,
|
|
770
771
|
V
|
|
771
772
|
)
|
|
772
|
-
), [JSON.stringify(Ee(r)), r.options]), [f, P] = le(() => "value" in r ? te(r.value, V, S) : "defaultValue" in r ? te(r.defaultValue, V, S) : []), w = "value" in r ? te(r.value, V, S) : f, [
|
|
773
|
+
), [JSON.stringify(Ee(r)), r.options]), [f, P] = le(() => "value" in r ? te(r.value, V, S) : "defaultValue" in r ? te(r.defaultValue, V, S) : []), w = "value" in r ? te(r.value, V, S) : f, [b, I] = ve(!1, {
|
|
773
774
|
value: r.popupVisible,
|
|
774
775
|
defaultValue: r.defaultPopupVisible
|
|
775
|
-
}), [_, M,
|
|
776
|
+
}), [_, M, s] = ve("", {
|
|
776
777
|
value: "inputValue" in r ? r.inputValue || "" : void 0
|
|
777
|
-
}), u =
|
|
778
|
+
}), u = z(_), g = z(null), o = z(null), A = z((S == null ? void 0 : S.getCheckedNodes()) || []), U = Ze(`${h}-popup-`), F = (i, m) => {
|
|
778
779
|
var v;
|
|
779
780
|
i !== u.current && (M(i), u.current = i, g.current = m, (v = r.onInputValueChange) == null || v.call(r, i, m));
|
|
780
781
|
};
|
|
781
|
-
function
|
|
782
|
-
return
|
|
782
|
+
function K(i) {
|
|
783
|
+
return ze(i) || qe(i);
|
|
783
784
|
}
|
|
784
785
|
Z(() => {
|
|
785
786
|
var m;
|
|
786
787
|
const { current: i } = g;
|
|
787
|
-
|
|
788
|
+
s === _ && (i === "manual" || i === "optionListHide") && ((m = r.onSearch) == null || m.call(r, _, i)), _ !== u.current && (u.current = _);
|
|
788
789
|
}, [_]), Z(() => {
|
|
789
790
|
const i = () => {
|
|
790
791
|
clearTimeout(L.current), L.current = null;
|
|
791
792
|
};
|
|
792
|
-
return !
|
|
793
|
+
return !b && _ && (L.current && i(), L.current = setTimeout(() => {
|
|
793
794
|
F("", "optionListHide"), L.current = null;
|
|
794
795
|
}, 200)), () => {
|
|
795
796
|
i();
|
|
796
797
|
};
|
|
797
|
-
}, [
|
|
798
|
+
}, [b]), re(() => {
|
|
798
799
|
if ("value" in r && r.value !== f) {
|
|
799
800
|
const i = te(r.value, V);
|
|
800
801
|
S.setNodeCheckedByValue(i), P(i);
|
|
@@ -812,13 +813,13 @@ function _t(t, e) {
|
|
|
812
813
|
});
|
|
813
814
|
};
|
|
814
815
|
return D(S.getCheckedNodes()), v.size && D(A.current), m;
|
|
815
|
-
}, H =
|
|
816
|
+
}, H = se(
|
|
816
817
|
(i) => {
|
|
817
818
|
var m;
|
|
818
|
-
i !==
|
|
819
|
+
i !== b && ((m = r.onVisibleChange) == null || m.call(r, i), "popupVisible" in r || I(i));
|
|
819
820
|
},
|
|
820
|
-
[r.onVisibleChange,
|
|
821
|
-
), Ie =
|
|
821
|
+
[r.onVisibleChange, b]
|
|
822
|
+
), Ie = se(
|
|
822
823
|
(i) => {
|
|
823
824
|
var y;
|
|
824
825
|
const m = pe([i])[0] || [];
|
|
@@ -828,7 +829,9 @@ function _t(t, e) {
|
|
|
828
829
|
disabled: (y = m[m.length - 1]) == null ? void 0 : y.disabled
|
|
829
830
|
};
|
|
830
831
|
},
|
|
831
|
-
[S, O]
|
|
832
|
+
[S, f, O]
|
|
833
|
+
// 这里把 stateValue 放到依赖里面,是因为当受控时props.value改变或非受控时内部stateValue改变,都会需要出发节点选中状态的更新
|
|
834
|
+
// 此时需要重新渲染已选中值的展示
|
|
832
835
|
), Q = (i, m) => {
|
|
833
836
|
var be;
|
|
834
837
|
m === "panel" && oe(r.showSearch) && !r.showSearch.retainInputValueWhileSelect && V && F("", "optionChecked");
|
|
@@ -838,7 +841,7 @@ function _t(t, e) {
|
|
|
838
841
|
V || S.setNodeCheckedByValue(i), De(S.getCheckedNodes());
|
|
839
842
|
const B = pe(i), ce = V ? i : i[0], Fe = V ? B : B[0];
|
|
840
843
|
V || (_ || B[0] && ((be = B[0][B[0].length - 1]) != null && be.isLeaf) || D && y === "hover") && H(!1), "value" in r ? (S.setNodeCheckedByValue(w), j()) : P(i), v == null || v(ce, Fe, {
|
|
841
|
-
dropdownVisible:
|
|
844
|
+
dropdownVisible: b
|
|
842
845
|
});
|
|
843
846
|
}, $e = (i, m, v) => {
|
|
844
847
|
if (v.stopPropagation(), i.disabled)
|
|
@@ -919,7 +922,7 @@ function _t(t, e) {
|
|
|
919
922
|
return (y = o.current) == null ? void 0 : y.dom;
|
|
920
923
|
},
|
|
921
924
|
renderEmpty: Ce,
|
|
922
|
-
popupVisible:
|
|
925
|
+
popupVisible: b,
|
|
923
926
|
value: w,
|
|
924
927
|
renderFooter: r.renderFooter,
|
|
925
928
|
icons: T,
|
|
@@ -943,29 +946,29 @@ function _t(t, e) {
|
|
|
943
946
|
{
|
|
944
947
|
popup: Re,
|
|
945
948
|
trigger: r.trigger,
|
|
946
|
-
disabled:
|
|
949
|
+
disabled: C,
|
|
947
950
|
getPopupContainer: $,
|
|
948
951
|
position: c ? "br" : "bl",
|
|
949
952
|
classNames: "slideDynamicOrigin",
|
|
950
953
|
popupAlign: St,
|
|
951
954
|
unmountOnExit: "unmountOnExit" in r ? r.unmountOnExit : !W(r.loadMore),
|
|
952
|
-
popupVisible:
|
|
955
|
+
popupVisible: b,
|
|
953
956
|
...x,
|
|
954
957
|
onVisibleChange: H,
|
|
955
958
|
children: i
|
|
956
959
|
}
|
|
957
960
|
);
|
|
958
|
-
return
|
|
961
|
+
return k ? ke(k) : /* @__PURE__ */ p(
|
|
959
962
|
tt,
|
|
960
963
|
{
|
|
961
964
|
...r,
|
|
962
965
|
ref: o,
|
|
963
966
|
ariaControls: U,
|
|
964
|
-
popupVisible:
|
|
967
|
+
popupVisible: b,
|
|
965
968
|
value: V ? w : w && w[0],
|
|
966
969
|
inputValue: _,
|
|
967
970
|
rtl: c,
|
|
968
|
-
isEmptyValue:
|
|
971
|
+
isEmptyValue: K(w),
|
|
969
972
|
prefixCls: h,
|
|
970
973
|
isMultiple: V,
|
|
971
974
|
renderText: Ie,
|
|
@@ -980,18 +983,18 @@ function _t(t, e) {
|
|
|
980
983
|
const D = S.getCheckedNodes().filter((y) => y.disabled).map((y) => y.pathValue);
|
|
981
984
|
S.setNodeCheckedByValue(D), Q(D);
|
|
982
985
|
}
|
|
983
|
-
(m = r.onClear) == null || m.call(r, !!
|
|
986
|
+
(m = r.onClear) == null || m.call(r, !!b);
|
|
984
987
|
},
|
|
985
988
|
onKeyDown: (i) => {
|
|
986
989
|
var v;
|
|
987
|
-
if (
|
|
990
|
+
if (C)
|
|
988
991
|
return;
|
|
989
992
|
i.stopPropagation();
|
|
990
993
|
const m = i.key;
|
|
991
|
-
m === fe.key &&
|
|
994
|
+
b ? (m === fe.key && (H(!1), i.preventDefault()), m === st.key && H(!1)) : m === he.key && (H(!0), i.preventDefault()), (v = r.onKeyDown) == null || v.call(r, i);
|
|
992
995
|
},
|
|
993
996
|
onChangeInputValue: (i) => {
|
|
994
|
-
F(i, "manual"),
|
|
997
|
+
F(i, "manual"), b || H(!0);
|
|
995
998
|
}
|
|
996
999
|
}
|
|
997
1000
|
);
|