@unicom-cloud/ui 0.8.66 → 0.8.67
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 +79 -79
- package/Alert.js +46 -46
- package/Anchor.js +1 -1
- package/AutoComplete.js +74 -74
- package/Avatar.js +36 -36
- package/BackTop.js +35 -35
- package/Badge.js +55 -55
- package/Breadcrumb.js +42 -42
- package/Button.js +24 -24
- package/Calendar.js +230 -230
- package/Card.js +18 -18
- package/Carousel.js +165 -165
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +26 -26
- package/Comment.js +18 -18
- package/ConfigProvider.js +2 -2
- package/Copy.js +28 -27
- package/DatePicker.js +872 -871
- package/Descriptions.js +34 -34
- package/Divider.js +19 -19
- package/Draggable.js +27 -26
- package/Drawer.js +1 -1
- package/Dropdown.js +110 -110
- package/Empty.js +3 -3
- package/Form.js +984 -945
- package/Grid.js +34 -34
- package/Icon.js +16 -16
- package/IconHover.js +2 -2
- package/Image.js +2 -2
- package/Input.js +7 -6
- package/InputNumber.js +6 -6
- package/InputTag.js +1 -1
- package/Layout.js +24 -24
- package/Link.js +30 -30
- package/List.js +95 -95
- package/Mentions.js +85 -84
- package/Menu.js +2 -2
- package/Message.js +7 -6
- package/Modal.js +1 -1
- package/Notice.js +14 -3
- package/Notification.js +9 -7
- package/OverflowEllipsis.js +64 -62
- package/PageHeader.js +73 -73
- package/Pagination.js +1 -1
- package/Picker.js +1 -1
- package/Popconfirm.js +60 -60
- package/Popover.js +31 -31
- package/Portal.js +23 -31
- package/Progress.js +22 -22
- package/Radio.js +2 -2
- package/Rate.js +24 -24
- package/ResizeBox.js +274 -271
- package/Result.js +3 -3
- package/Select.js +4 -4
- package/SelectView.js +257 -238
- package/Skeleton.js +46 -46
- package/Slider.js +286 -283
- package/Space.js +28 -28
- package/SpeechSynthesis.js +62 -55
- package/Spin.js +23 -23
- package/Statistic.js +80 -80
- package/Steps.js +67 -67
- package/Switch.js +47 -47
- package/Table.js +1445 -1380
- package/Tabs.js +5 -5
- package/Tag.js +45 -45
- package/TimePicker.js +154 -154
- package/Timeline.js +2 -2
- package/Tooltip.js +80 -79
- package/Transfer.js +103 -102
- package/Tree.js +3 -2
- package/TreeSelect.js +2 -2
- package/Trigger.js +699 -772
- package/Typography.js +756 -6
- package/Upload.js +2 -2
- package/VerificationCode.js +1 -1
- package/Version.js +1 -1
- package/VirtualList.js +1 -1
- package/Watermark.js +1 -1
- package/chunk/{BHgJ5Y3T.js → -UuKKT0Z.js} +29 -29
- package/chunk/{B8QV6E2b.js → AwZqeapI.js} +5 -5
- package/chunk/B5gK1Idp.js +19 -0
- package/chunk/B7FlazNB.js +24 -0
- package/chunk/{DTBtQQ2H.js → BBvWDeuZ.js} +67 -67
- package/chunk/BCftTxEy.js +626 -0
- package/chunk/{CZOP_ZHJ.js → BGny4zSb.js} +60 -60
- package/chunk/BHF15Dog.js +98 -0
- package/chunk/BJQ5UNa-.js +1585 -0
- package/chunk/BP9sYyk9.js +8 -0
- package/chunk/BUdtVdnv.js +38 -0
- package/chunk/BVQlOzTS.js +11 -0
- package/chunk/B__a_gb_.js +519 -0
- package/chunk/BbEYToV1.js +10 -0
- package/chunk/BbdDQAnm.js +15 -0
- package/chunk/BdUcgWdu.js +11 -0
- package/chunk/BfbXSG70.js +26 -0
- package/chunk/BndfNLK4.js +186 -0
- package/chunk/BoMCZV6K.js +1098 -0
- package/chunk/Br0B6y1T.js +18 -0
- package/chunk/BrOW642m.js +130 -0
- package/chunk/BxUs8_Cr.js +9 -0
- package/chunk/{CcV4wQB1.js → C42LIMP9.js} +244 -242
- package/chunk/C4YkFMzC.js +778 -0
- package/chunk/{Bh23P4l7.js → C9Wcraj7.js} +21 -21
- package/chunk/{4-gvEY5y.js → CANgSlh3.js} +10 -10
- package/chunk/CJ_o9tZM.js +5 -0
- package/chunk/{DNAigumg.js → CK5m7rLl.js} +36 -36
- package/chunk/{CANaGbGR.js → CKNyIitu.js} +57 -56
- package/chunk/CLiqJm_T.js +10 -0
- package/chunk/{BnSVm1YC.js → CNmmhbCn.js} +32 -32
- package/chunk/{BFipyA67.js → CP0odX99.js} +51 -51
- package/chunk/CPT-OZH2.js +14 -0
- package/chunk/CVSF8p0O.js +698 -0
- package/chunk/C_agcwLN.js +31 -0
- package/chunk/{jhQQCFMn.js → C_gJWGGh.js} +201 -201
- package/chunk/{Bc7t9jkb.js → CaasmWg_.js} +11 -11
- package/chunk/Ce1j9KTi.js +6 -0
- package/chunk/{D_-UD4vO.js → Cf5QNhkG.js} +18 -18
- package/chunk/CkNSv2U7.js +56 -0
- package/chunk/Cp2f70gB.js +9 -0
- package/chunk/CpegYjdC.js +16 -0
- package/chunk/CucI3KZr.js +20 -0
- package/chunk/CwoFBTYz.js +11 -0
- package/chunk/D2KPqPhV.js +17 -0
- package/chunk/D7NyvE5f.js +17 -0
- package/chunk/D8oTPQ2H.js +384 -0
- package/chunk/{CLBavO5c.js → DC1iHEiy.js} +87 -87
- package/chunk/{DnvO8A0Z.js → DFrfrmfK.js} +120 -119
- package/chunk/DGTIZ_0O.js +6 -0
- package/chunk/DJfpiZn_.js +25 -0
- package/chunk/DKr2_PYd.js +34 -0
- package/chunk/DNUz6zgo.js +11 -0
- package/chunk/DRtM649q.js +11 -0
- package/chunk/DS_mUWn6.js +41 -0
- package/chunk/DU6bs_19.js +10 -0
- package/chunk/DWdbwz22.js +10 -0
- package/chunk/DcveZuqd.js +6 -0
- package/chunk/DdVFknul.js +24 -0
- package/chunk/DgRfikwe.js +16 -0
- package/chunk/{znkyQ-HR.js → DkyR2EfG.js} +66 -66
- package/chunk/{DUeHQKtx.js → DleQ5HwG.js} +42 -42
- package/chunk/DnrZEnQ_.js +27 -0
- package/chunk/DsRSHWtX.js +1025 -0
- package/chunk/Dz5BdmXo.js +270 -0
- package/chunk/EANe01DF.js +1030 -0
- package/chunk/{CwhPMMWy.js → Ey4YJCkX.js} +7 -7
- package/chunk/GoNx5R4F.js +873 -0
- package/chunk/HDUQku8d.js +20 -0
- package/chunk/HrAP__Hi.js +25 -0
- package/chunk/JPPo5nY_.js +9 -0
- package/chunk/{Du-bw6qA.js → SLWP34OR.js} +90 -85
- package/chunk/VVKtwaGf.js +278 -0
- package/chunk/WPNpLxSI.js +16 -0
- package/chunk/{CPvvjMwZ.js → WpO_DsK4.js} +49 -48
- package/chunk/fdU3ang6.js +14 -0
- package/chunk/{DQAot004.js → fkclKOAL.js} +298 -292
- package/chunk/flvYlqx3.js +22 -0
- package/chunk/kTDayEpF.js +288 -0
- package/chunk/{CssIjN1g.js → pZoNQ75H.js} +31 -31
- package/chunk/qFf1w_Jq.js +8 -0
- package/chunk/{CHnFKgbk.js → w-kM1L5W.js} +155 -155
- package/hooks/index.js +53 -49
- package/hooks/useComputedState.js +2 -10
- package/hooks/useCreate.js +2 -7
- package/hooks/useForceUpdate.js +2 -7
- package/hooks/useId.js +2 -10
- package/hooks/useInView.js +2 -30
- package/hooks/useIntersectionObserver.js +2 -23
- package/hooks/useInterval.js +2 -17
- package/hooks/useIsFirstRender.js +2 -9
- package/hooks/useIsomorphicLayoutEffect.js +2 -5
- package/hooks/useKeyboardEvent.js +2 -16
- package/hooks/useMedia.js +2 -15
- package/hooks/useMergeProps.js +2 -18
- package/hooks/useMergeValue.js +2 -19
- package/hooks/useOnlineStatus.js +4 -0
- package/hooks/useOverflowHidden.js +2 -25
- package/hooks/useOverrideRef.js +2 -13
- package/hooks/usePersistCallback.js +2 -13
- package/hooks/usePrefersColorSchemeDark.js +4 -0
- package/hooks/usePrevious.js +2 -9
- package/hooks/useRefs.js +2 -9
- package/hooks/useResizeObserver.js +2 -15
- package/hooks/useStateCallback.js +2 -15
- package/hooks/useStateWithPromise.js +2 -24
- package/hooks/useUpdateEffect.js +2 -9
- package/hooks/useVerificationCode.js +73 -0
- package/hooks/useWatch.js +2 -10
- package/hooks/{use-watermark.js → useWatermark.js} +27 -26
- package/hooks/useWindowSize.js +2 -20
- package/index.js +571 -584
- package/locale/en-US.js +4 -2
- package/locale/interface.js +1 -4
- package/locale/ja-JP.js +3 -1
- package/locale/tr-TR.js +1 -1
- package/locale/zh-CN.js +3 -1
- package/locale/zh-HK.js +3 -1
- package/locale/zh-TW.js +3 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/anchor/util.d.ts +1 -1
- package/types/button/index.d.ts +2 -2
- package/types/color-picker/hooks/useColorPicker.d.ts +2 -2
- package/types/form/Control-old.d.ts +56 -0
- package/types/form/Control.d.ts +6 -54
- package/types/form/FormItem.d.ts +1 -1
- package/types/form/store.d.ts +0 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/useComputedState.d.ts +1 -4
- package/types/hooks/useCreate.d.ts +1 -2
- package/types/hooks/useForceUpdate.d.ts +1 -2
- package/types/hooks/useId.d.ts +1 -2
- package/types/hooks/useInView.d.ts +1 -11
- package/types/hooks/useIntersectionObserver.d.ts +1 -7
- package/types/hooks/useInterval.d.ts +1 -2
- package/types/hooks/useIsFirstRender.d.ts +1 -2
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +1 -3
- package/types/hooks/useKeyboardEvent.d.ts +1 -8
- package/types/hooks/useMedia.d.ts +1 -2
- package/types/hooks/useMergeProps.d.ts +1 -5
- package/types/hooks/useMergeValue.d.ts +1 -6
- package/types/hooks/useOnlineStatus.d.ts +1 -0
- package/types/hooks/useOverflowHidden.d.ts +1 -5
- package/types/hooks/useOverrideRef.d.ts +1 -6
- package/types/hooks/usePersistCallback.d.ts +1 -2
- package/types/hooks/usePrefersColorSchemeDark.d.ts +1 -0
- package/types/hooks/usePrevious.d.ts +1 -3
- package/types/hooks/useRefs.d.ts +1 -2
- package/types/hooks/useResizeObserver.d.ts +1 -6
- package/types/hooks/useStateCallback.d.ts +1 -5
- package/types/hooks/useStateWithPromise.d.ts +1 -2
- package/types/hooks/useUpdateEffect.d.ts +1 -3
- package/types/hooks/useWatch.d.ts +1 -3
- package/types/hooks/useWindowSize.d.ts +1 -5
- package/types/image/interface.d.ts +1 -0
- package/types/index.d.ts +157 -86
- package/types/input/Input.d.ts +1 -1
- package/types/input/Textarea.d.ts +2 -2
- package/types/locale/en-US.d.ts +2 -0
- package/types/locale/interface.d.ts +1 -2
- package/types/locale/ja-JP.d.ts +2 -0
- package/types/locale/zh-CN.d.ts +2 -0
- package/types/locale/zh-HK.d.ts +2 -0
- package/types/locale/zh-TW.d.ts +2 -0
- package/types/menu/context.d.ts +1 -1
- package/types/message/index.d.ts +14 -14
- package/types/message/interface.d.ts +2 -0
- package/types/modal/config.d.ts +0 -1
- package/types/modal/interface.d.ts +0 -1
- package/types/notice/index.d.ts +2 -27
- package/types/notification/index.d.ts +15 -16
- package/types/notification/interface.d.ts +2 -0
- package/types/notification/withNotification.d.ts +2 -0
- package/types/select/util.d.ts +1 -2
- package/types/select-view/interface.d.ts +2 -1
- package/types/speech-synthesis/index.d.ts +1 -1
- package/types/table/constant.d.ts +2 -0
- package/types/table/hook/useThResizable.d.ts +7 -0
- package/types/table/index.d.ts +10 -1
- package/types/table/style/index.d.ts +1 -0
- package/types/table/th-resizable/index.d.ts +2 -0
- package/types/table/thead/Column.d.ts +1 -2
- package/types/tree/Tree.d.ts +12 -67
- package/types/tree-select/Select.d.ts +2 -2
- package/types/trigger/index.d.ts +2 -120
- package/types/trigger/interface.d.ts +2 -1
- package/types/utils/CSSTransition.d.ts +2 -3
- package/types/utils/caseName.d.ts +1 -1
- package/types/utils/className.d.ts +1 -1
- package/types/utils/constant.d.ts +2 -2
- package/types/utils/copy.d.ts +1 -1
- package/types/utils/dayjs.d.ts +1 -21
- package/types/utils/dom.d.ts +1 -6
- package/types/utils/fileToURL.d.ts +1 -1
- package/types/utils/fillNBSP.d.ts +1 -1
- package/types/utils/getHighlightText.d.ts +1 -5
- package/types/utils/getHotkeyHandler.d.ts +1 -8
- package/types/utils/getStringLength.d.ts +1 -1
- package/types/utils/include.d.ts +1 -1
- package/types/utils/index.d.ts +3 -4
- package/types/utils/is.d.ts +1 -16
- package/types/utils/keyboardCode.d.ts +3 -0
- package/types/utils/lodash.d.ts +1 -17
- package/types/utils/mergeProps.d.ts +1 -1
- package/types/utils/mergedToString.d.ts +1 -1
- package/types/utils/omit.d.ts +1 -1
- package/types/utils/pad.d.ts +1 -2
- package/types/utils/pick.d.ts +2 -4
- package/types/utils/reactDOM.d.ts +1 -7
- package/types/utils/resizeObserverEffect.d.ts +2 -0
- package/types/utils/saveAs.d.ts +1 -1
- package/types/utils/screenfull.d.ts +2 -0
- package/types/utils/scrollIntoView.d.ts +1 -2
- package/types/utils/style.d.ts +1 -3
- package/types/utils/throttleByRaf.d.ts +1 -5
- package/types/utils/throttleByRaf2.d.ts +1 -0
- package/types/utils/warning.d.ts +1 -2
- package/types/version/index.d.ts +1 -1
- package/utils/CSSTransition.js +2 -6
- package/utils/className.js +2 -2
- package/utils/constant.js +8 -9
- package/utils/contextHolder.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/dayjs.js +14 -173
- package/utils/dom.js +33 -29
- package/utils/fillNBSP.js +2 -4
- package/utils/getHighlightText.js +2 -38
- package/utils/getHotkeyHandler.js +2 -25
- package/utils/getStringLength.js +2 -7
- package/utils/include.js +2 -7
- package/utils/index.js +237 -240
- package/utils/is.js +116 -156
- package/utils/keyboardCode.js +27 -0
- package/utils/mergeProps.js +2 -9
- package/utils/mergedToString.js +2 -13
- package/utils/omit.js +2 -9
- package/utils/pad.js +12 -12
- package/utils/pick.js +4 -15
- package/utils/reactDOM.js +3 -54
- package/utils/resizeObserverEffect.js +4 -0
- package/utils/saveAs.js +1 -1
- package/utils/screenfull.js +4 -0
- package/utils/scrollIntoView.js +2 -21
- package/utils/style.js +12 -11
- package/utils/throttleByRaf.js +13 -12
- package/utils/throttleByRaf2.js +5 -0
- package/utils/warning.js +5 -4
- package/NotificationBase.js +0 -53
- package/chunk/-zpSUpGE.js +0 -1501
- package/chunk/BAWsPQBM.js +0 -11
- package/chunk/BIT0j3HT.js +0 -269
- package/chunk/BbLKnaNO.js +0 -871
- package/chunk/Bfhv56O2.js +0 -638
- package/chunk/C2lIz2F9.js +0 -60
- package/chunk/C6QWSzsM.js +0 -376
- package/chunk/CVkHTbic.js +0 -995
- package/chunk/CeGEvXby.js +0 -278
- package/chunk/D3NFxdmG.js +0 -518
- package/chunk/DApXtulb.js +0 -1102
- package/chunk/DPByB1ab.js +0 -698
- package/chunk/DV1Ab_cG.js +0 -284
- package/chunk/dBnNCOIU.js +0 -778
- package/chunk/it8qlDZ3.js +0 -1032
- package/chunk/l0sNRNKZ.js +0 -1
- package/chunk/te_43YrB.js +0 -776
- package/hooks/use-verification-code.js +0 -73
- package/types/notification-base/index.d.ts +0 -15
- package/types/notification-base/style/index.d.ts +0 -2
- package/types/trigger/Portal.d.ts +0 -7
- package/types/utils/keyCode.d.ts +0 -45
- package/types/utils/raf.d.ts +0 -3
- package/types/utils/throttleByRafV2.d.ts +0 -5
- package/utils/keyCode.js +0 -12
- package/utils/raf.js +0 -19
- package/utils/throttleByRafV2.js +0 -16
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
var He = Object.defineProperty;
|
|
2
2
|
var Be = (t, e, n) => e in t ? He(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
-
var
|
|
3
|
+
var o = (t, e, n) => Be(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
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
8
|
import ze from "@unicom-cloud/icons/IconUiRight";
|
|
9
9
|
import { H as Ke, z as qe } from "./CSC_V_25.js";
|
|
10
|
-
import
|
|
10
|
+
import _e from "lodash/isArray";
|
|
11
11
|
import W from "lodash/isFunction";
|
|
12
|
-
import
|
|
12
|
+
import de from "lodash/isPlainObject";
|
|
13
13
|
import Y from "lodash/isString";
|
|
14
14
|
import Je, { useRef as K, useState as le, useCallback as ae, useEffect as Z, forwardRef as Ge, useContext as Qe, useImperativeHandle as Xe } from "react";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
15
|
+
import { a as Ye } from "./BJQ5UNa-.js";
|
|
16
|
+
import { c as ue } from "./BP9sYyk9.js";
|
|
17
|
+
import { a as Ze } from "./DRtM649q.js";
|
|
18
|
+
import { c as et } from "./B5gK1Idp.js";
|
|
19
|
+
import { R as ye } from "./HDUQku8d.js";
|
|
20
|
+
import { c as re } from "./BbEYToV1.js";
|
|
21
21
|
import tt from "../SelectView.js";
|
|
22
22
|
import nt from "../Trigger.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { _ as st,
|
|
23
|
+
import { m as q } from "./JPPo5nY_.js";
|
|
24
|
+
import { e as he, y as rt, n as lt, d as we, r as se, o as fe, c as at } from "./BrOW642m.js";
|
|
25
|
+
import { _ as st, N as it } from "./DC1iHEiy.js";
|
|
26
26
|
import me from "lodash/isEqualWith";
|
|
27
27
|
import ee from "lodash/get";
|
|
28
|
-
import { p as ct } from "./
|
|
29
|
-
import { C as Oe } from "./
|
|
30
|
-
import {
|
|
31
|
-
import { on as Le, off as
|
|
32
|
-
import "
|
|
33
|
-
import { V as Pe } from "./
|
|
28
|
+
import { p as ct } from "./CKNyIitu.js";
|
|
29
|
+
import { C as Oe } from "./DkyR2EfG.js";
|
|
30
|
+
import { u as dt } from "./CLiqJm_T.js";
|
|
31
|
+
import { on as Le, off as oe } from "../utils/dom.js";
|
|
32
|
+
import "./CkNSv2U7.js";
|
|
33
|
+
import { V as Pe } from "./B__a_gb_.js";
|
|
34
34
|
import xe from "lodash/isPlainObject.js";
|
|
35
|
-
import {
|
|
35
|
+
import { c as ot } from "./DWdbwz22.js";
|
|
36
36
|
function ut(t, e) {
|
|
37
37
|
const n = K(null), l = ue();
|
|
38
38
|
return n.current || (n.current = t()), re(() => {
|
|
@@ -41,33 +41,33 @@ function ut(t, e) {
|
|
|
41
41
|
}
|
|
42
42
|
class ge {
|
|
43
43
|
constructor(e, n, l) {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
o(this, "value");
|
|
45
|
+
o(this, "label");
|
|
46
46
|
// 是否禁用
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
o(this, "disabled");
|
|
48
|
+
o(this, "_level");
|
|
49
|
+
o(this, "_index");
|
|
50
|
+
o(this, "isLeaf");
|
|
51
|
+
o(this, "disableCheckbox");
|
|
52
52
|
// 是否选中
|
|
53
|
-
|
|
53
|
+
o(this, "_checked");
|
|
54
54
|
/** 是否半选 */
|
|
55
|
-
|
|
55
|
+
o(this, "_halfChecked");
|
|
56
56
|
/** 当前选项节点的父节点 */
|
|
57
|
-
|
|
57
|
+
o(this, "parent");
|
|
58
58
|
/** 当前选项节点路径的所有节点的值 */
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
o(this, "pathValue", []);
|
|
60
|
+
o(this, "pathLabel", []);
|
|
61
61
|
/** 下一级选项 */
|
|
62
|
-
|
|
62
|
+
o(this, "children");
|
|
63
63
|
/** 是否在加载中 */
|
|
64
|
-
|
|
64
|
+
o(this, "loading");
|
|
65
65
|
/** 是否加载完成 */
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
o(this, "loaded");
|
|
67
|
+
o(this, "config", {});
|
|
68
68
|
// 保存暴露给外部的属性
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
o(this, "_data");
|
|
70
|
+
o(this, "_initNode", (e, n = null) => {
|
|
71
71
|
const { showEmptyChildren: l, lazyload: s } = this.config, c = { ...Ae, ...this.config.fieldNames }, r = ee(e, c.children) || e[c.children];
|
|
72
72
|
let k = Array.isArray(r) ? l ? !1 : r.length === 0 : !0;
|
|
73
73
|
s && (c.isLeaf in e ? k = !!ee(e, c.isLeaf) || !!e[c.isLeaf] : k = !1);
|
|
@@ -98,7 +98,7 @@ class ge {
|
|
|
98
98
|
* 假设半选是 0.5,全选是1,不选是0。
|
|
99
99
|
* 那么只有当前节点的所有children加起来等于children.length,才是全选,否则和大于0,就是半选。
|
|
100
100
|
*/
|
|
101
|
-
|
|
101
|
+
o(this, "_isHalfChecked", () => {
|
|
102
102
|
const e = this.children.reduce((n, l) => {
|
|
103
103
|
const s = l._halfChecked ? 0.5 : l._checked ? 1 : 0;
|
|
104
104
|
return n + s;
|
|
@@ -110,12 +110,12 @@ class ge {
|
|
|
110
110
|
* @param checked 选中状态
|
|
111
111
|
* @param ignoreDisabled 是否忽略节点禁用设置选中状态,一般在初始化设置选中状态时传参为true
|
|
112
112
|
*/
|
|
113
|
-
|
|
113
|
+
o(this, "_setNodeChildrenChecked", (e, n) => {
|
|
114
114
|
!n && this.disabled || this.children && this.children.length && (this.children.forEach((l) => {
|
|
115
115
|
l.disabled ? n && l.setCheckedStateIgnoreDisabled(e) : l.setCheckedState(e);
|
|
116
116
|
}), this.updateHalfState(e));
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
o(this, "getSelfChildrenValue", () => {
|
|
119
119
|
const e = [], n = (l, s) => {
|
|
120
120
|
if (!s || !s.length) {
|
|
121
121
|
e.push(l);
|
|
@@ -127,15 +127,15 @@ class ge {
|
|
|
127
127
|
};
|
|
128
128
|
return n(this.pathValue, this.children), e;
|
|
129
129
|
});
|
|
130
|
-
|
|
130
|
+
o(this, "updateHalfState", (e) => {
|
|
131
131
|
this._halfChecked = this._isHalfChecked(), this._checked = this._halfChecked ? !1 : e;
|
|
132
132
|
});
|
|
133
133
|
// 直接设置选中状态
|
|
134
|
-
|
|
134
|
+
o(this, "setCheckedProperty", (e) => {
|
|
135
135
|
this._checked = e, this._halfChecked = !1;
|
|
136
136
|
});
|
|
137
137
|
// 设置当前节点选中状态
|
|
138
|
-
|
|
138
|
+
o(this, "setCheckedState", (e) => {
|
|
139
139
|
const n = e ? this._checked : !this._checked && !this._halfChecked;
|
|
140
140
|
if (!(this.disabled || n) && (this.setCheckedProperty(e), !this.config.changeOnSelect)) {
|
|
141
141
|
this._setNodeChildrenChecked(e);
|
|
@@ -145,7 +145,7 @@ class ge {
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
// 忽略禁用设置选中状态
|
|
148
|
-
|
|
148
|
+
o(this, "setCheckedStateIgnoreDisabled", (e) => {
|
|
149
149
|
if (e !== !!this._checked && (this.setCheckedProperty(e), !this.config.changeOnSelect)) {
|
|
150
150
|
this._setNodeChildrenChecked(e, !0);
|
|
151
151
|
let n = this.parent;
|
|
@@ -159,15 +159,15 @@ class ge {
|
|
|
159
159
|
* @return [node.parent.parent, node.parent, node]
|
|
160
160
|
* @memberof Store
|
|
161
161
|
*/
|
|
162
|
-
|
|
162
|
+
o(this, "getPathNodes", () => {
|
|
163
163
|
const e = [this];
|
|
164
164
|
let n = this.parent;
|
|
165
165
|
for (; n; )
|
|
166
166
|
e.unshift(n), n = n.parent;
|
|
167
167
|
return e;
|
|
168
168
|
});
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
o(this, "getChildren", () => this.children);
|
|
170
|
+
o(this, "setLoading", (e) => {
|
|
171
171
|
this.loading = e, (e || e === void 0) && (this.loaded = !1), e === !1 && (this.loaded = !0);
|
|
172
172
|
});
|
|
173
173
|
this.config = n || {}, this._initNode(e, l || null);
|
|
@@ -175,17 +175,17 @@ class ge {
|
|
|
175
175
|
}
|
|
176
176
|
class ht {
|
|
177
177
|
constructor(e, n, l) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
o(this, "nodes", []);
|
|
179
|
+
o(this, "flatNodes", []);
|
|
180
|
+
o(this, "config", {});
|
|
181
181
|
// 初始化节点状态,附加状态信息字段: _checked,_halfChecked,parent,disabled
|
|
182
|
-
|
|
182
|
+
o(this, "_calcNodes", (e, n) => e ? e.map((l, s) => new ge({ ...l, _index: s }, this.config, n)) : []);
|
|
183
183
|
// this.flatNodes 保存所有可能的选中项
|
|
184
|
-
|
|
184
|
+
o(this, "_updateFlatNodes", () => {
|
|
185
185
|
const e = !this.config.changeOnSelect;
|
|
186
186
|
this.flatNodes = [];
|
|
187
187
|
const n = (l) => {
|
|
188
|
-
l && ((!e || l.isLeaf) && this.flatNodes.push(l),
|
|
188
|
+
l && ((!e || l.isLeaf) && this.flatNodes.push(l), _e(l.children) && l.children.forEach((s) => {
|
|
189
189
|
n(s);
|
|
190
190
|
}));
|
|
191
191
|
};
|
|
@@ -198,7 +198,7 @@ class ht {
|
|
|
198
198
|
* 根据values更新节点状态。不包含在values的节点都设置为未选中状态
|
|
199
199
|
* @memberof Store
|
|
200
200
|
*/
|
|
201
|
-
|
|
201
|
+
o(this, "setNodeCheckedByValue", (e) => {
|
|
202
202
|
const n = ie(e);
|
|
203
203
|
this.flatNodes.forEach((l) => {
|
|
204
204
|
let s = !1;
|
|
@@ -210,7 +210,7 @@ class ht {
|
|
|
210
210
|
/**
|
|
211
211
|
* 为当前节点插入子节点。动态加载时候用到
|
|
212
212
|
*/
|
|
213
|
-
|
|
213
|
+
o(this, "appendOptionChildren", (e, n) => {
|
|
214
214
|
if (n && e) {
|
|
215
215
|
const l = this._calcNodes(n, e);
|
|
216
216
|
e.children = l, this._updateFlatNodes(), this.config.changeOnSelect || e.setCheckedState(!1);
|
|
@@ -220,7 +220,7 @@ class ht {
|
|
|
220
220
|
* 通过 value 查找对应的node节点。
|
|
221
221
|
* value: 是路径节点的value组成的数组
|
|
222
222
|
*/
|
|
223
|
-
|
|
223
|
+
o(this, "findNodeByValue", (e) => {
|
|
224
224
|
let n = null;
|
|
225
225
|
return !e || !e.length || this.flatNodes.some((l) => {
|
|
226
226
|
me(l.pathValue, e) && (n = l);
|
|
@@ -229,18 +229,18 @@ class ht {
|
|
|
229
229
|
/**
|
|
230
230
|
* 搜索所有label含有关键字的节点
|
|
231
231
|
*/
|
|
232
|
-
|
|
232
|
+
o(this, "searchNodeByLabel", (e) => {
|
|
233
233
|
if (!e)
|
|
234
234
|
return this.flatNodes;
|
|
235
235
|
const { filterOption: n } = this.config, l = W(n) ? n : (s, c) => Y(c.label) && c.label.indexOf(s) > -1;
|
|
236
236
|
return this.flatNodes.filter((s) => s.getPathNodes().some((r) => l(e, r._data)));
|
|
237
237
|
});
|
|
238
238
|
/** 获取所有节点 */
|
|
239
|
-
|
|
239
|
+
o(this, "getOptions", () => this.nodes);
|
|
240
240
|
/** 获取所有选中状态的节点。 aggregation: 是否聚合节点 */
|
|
241
|
-
|
|
241
|
+
o(this, "getCheckedNodes", () => this.config.showParent ? this.getCheckedParentNodes() : this.flatNodes.filter((e) => e._checked));
|
|
242
242
|
// 按照父节点纬度聚合当前所有选中节点。
|
|
243
|
-
|
|
243
|
+
o(this, "getCheckedParentNodes", () => {
|
|
244
244
|
const e = /* @__PURE__ */ new Set();
|
|
245
245
|
return this.flatNodes.forEach((n) => {
|
|
246
246
|
n._checked && n.getPathNodes().some((s) => {
|
|
@@ -254,7 +254,7 @@ class ht {
|
|
|
254
254
|
this.nodes = this._calcNodes(e, null), this._updateFlatNodes(), this.setNodeCheckedByValue(s);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
const G = "__pqb_cascader__", ft = "parent", mt = "child",
|
|
257
|
+
const G = "__pqb_cascader__", ft = "parent", mt = "child", ve = {
|
|
258
258
|
cascader: "cascader",
|
|
259
259
|
select: "select"
|
|
260
260
|
};
|
|
@@ -295,7 +295,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
295
295
|
}, Ct = (t) => {
|
|
296
296
|
const e = (n) => Array.isArray(n) ? n.every((l) => l._checked || l.disabled ? !0 : e(l.children)) : !1;
|
|
297
297
|
return t._halfChecked && e(t == null ? void 0 : t.children);
|
|
298
|
-
},
|
|
298
|
+
}, Me = (t, e, n, l) => {
|
|
299
299
|
const s = l && Ct(n) ? !1 : l, c = e.getCheckedNodes().reduce((b, x) => (b.add(x.pathValue.join(G)), b), /* @__PURE__ */ new Set());
|
|
300
300
|
n.setCheckedState(s);
|
|
301
301
|
const k = e.getCheckedNodes().map((b) => b.pathValue), O = ie(k), I = /* @__PURE__ */ new Set();
|
|
@@ -344,9 +344,9 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
344
344
|
return e;
|
|
345
345
|
}
|
|
346
346
|
return t;
|
|
347
|
-
}, Ve = (t, e) => t < 0 ? e : t > e ? 0 : t,
|
|
348
|
-
var
|
|
349
|
-
const [e, n] =
|
|
347
|
+
}, Ve = (t, e) => t < 0 ? e : t > e ? 0 : t, yt = (t) => {
|
|
348
|
+
var M;
|
|
349
|
+
const [e, n] = ot(), l = ue(), {
|
|
350
350
|
store: s,
|
|
351
351
|
prefixCls: c,
|
|
352
352
|
value: r,
|
|
@@ -357,7 +357,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
357
357
|
loadMore: x,
|
|
358
358
|
renderEmpty: N,
|
|
359
359
|
rtl: E,
|
|
360
|
-
icons:
|
|
360
|
+
icons: T
|
|
361
361
|
} = t, [h, V] = le(
|
|
362
362
|
s.findNodeByValue(r && r[r.length - 1]) || null
|
|
363
363
|
), L = s.getOptions(), j = (a) => {
|
|
@@ -380,9 +380,9 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
380
380
|
}, f = async (a, u = !0) => {
|
|
381
381
|
!a || a.disabled || (V(a), S(a), !k && u && (t.changeOnSelect || a.isLeaf) && j([a.pathValue]));
|
|
382
382
|
}, P = (a, u) => {
|
|
383
|
-
const g =
|
|
383
|
+
const g = Me(t.value, s, a, u);
|
|
384
384
|
a === h && l(), V(a), t.changeOnSelect || S(a), j(g);
|
|
385
|
-
},
|
|
385
|
+
}, w = ae(
|
|
386
386
|
(a = h) => {
|
|
387
387
|
var g;
|
|
388
388
|
let u = a;
|
|
@@ -395,16 +395,16 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
395
395
|
[h]
|
|
396
396
|
), C = ae(
|
|
397
397
|
(a) => {
|
|
398
|
-
var
|
|
398
|
+
var d;
|
|
399
399
|
const u = a.key;
|
|
400
400
|
let g;
|
|
401
401
|
switch (u) {
|
|
402
402
|
case fe.key: {
|
|
403
|
-
a.preventDefault(), (
|
|
403
|
+
a.preventDefault(), (d = t.onEsc) == null || d.call(t);
|
|
404
404
|
break;
|
|
405
405
|
}
|
|
406
406
|
case se.key:
|
|
407
|
-
case
|
|
407
|
+
case we.key: {
|
|
408
408
|
if (!h)
|
|
409
409
|
g = bt(L);
|
|
410
410
|
else {
|
|
@@ -416,7 +416,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
416
416
|
for (; z !== A._index && (g = U[z], g.disabled); )
|
|
417
417
|
z = Ve(z + F, U.length - 1);
|
|
418
418
|
}
|
|
419
|
-
return
|
|
419
|
+
return w(g), f(g, !1), a.preventDefault(), !1;
|
|
420
420
|
}
|
|
421
421
|
case lt.key:
|
|
422
422
|
return h && !h.disabled && (g = (h.children || [])[0] || h, f(g, !1)), a.preventDefault(), !1;
|
|
@@ -438,21 +438,21 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
438
438
|
let u;
|
|
439
439
|
if (a && a.pathValue && a.pathValue.length) {
|
|
440
440
|
const g = a.pathValue;
|
|
441
|
-
let
|
|
441
|
+
let d = { children: L };
|
|
442
442
|
g.map((A) => {
|
|
443
|
-
const F = (
|
|
444
|
-
F && (
|
|
443
|
+
const F = (d.children || []).find((z) => z.value === A);
|
|
444
|
+
F && (d = F, u = F);
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
447
|
return u;
|
|
448
448
|
});
|
|
449
449
|
}, [s]), Z(() => {
|
|
450
|
-
t.popupVisible && L.length && setTimeout(
|
|
450
|
+
t.popupVisible && L.length && setTimeout(w);
|
|
451
451
|
}, [t.popupVisible]), Z(() => {
|
|
452
452
|
const a = t.getTriggerElement();
|
|
453
453
|
if (a)
|
|
454
|
-
return t.popupVisible ? Le(a, "keydown", C) :
|
|
455
|
-
|
|
454
|
+
return t.popupVisible ? Le(a, "keydown", C) : oe(a, "keydown", C), () => {
|
|
455
|
+
oe(a, "keydown", C);
|
|
456
456
|
};
|
|
457
457
|
}, [t.popupVisible, C]);
|
|
458
458
|
const D = (() => {
|
|
@@ -460,8 +460,8 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
460
460
|
return (h ? h.getPathNodes() : []).forEach((g) => {
|
|
461
461
|
g && g.children && a.push(g.children);
|
|
462
462
|
}), a;
|
|
463
|
-
})(),
|
|
464
|
-
return !D.length || !((
|
|
463
|
+
})(), _ = W(t.dropdownColumnRender) ? t.dropdownColumnRender : (a) => a;
|
|
464
|
+
return !D.length || !((M = D[0]) != null && M.length) ? /* @__PURE__ */ p(ne, { children: N() }) : /* @__PURE__ */ p(st, { component: Je.Fragment, children: D.map((a, u) => {
|
|
465
465
|
const g = O ? O(u, h || null) : null;
|
|
466
466
|
return a.length === 0 && !b ? null : /* @__PURE__ */ p(
|
|
467
467
|
it,
|
|
@@ -471,14 +471,14 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
471
471
|
exit: 0
|
|
472
472
|
},
|
|
473
473
|
classNames: "cascaderSlide",
|
|
474
|
-
onEnter: (
|
|
475
|
-
|
|
474
|
+
onEnter: (d) => {
|
|
475
|
+
d && (d.style.marginLeft = `-${d.scrollWidth}px`);
|
|
476
476
|
},
|
|
477
|
-
onEntering: (
|
|
478
|
-
|
|
477
|
+
onEntering: (d) => {
|
|
478
|
+
d && (d.style.marginLeft = "0px");
|
|
479
479
|
},
|
|
480
|
-
onEntered: (
|
|
481
|
-
|
|
480
|
+
onEntered: (d) => {
|
|
481
|
+
d && (d.style.marginLeft = "");
|
|
482
482
|
},
|
|
483
483
|
children: /* @__PURE__ */ p(
|
|
484
484
|
"div",
|
|
@@ -491,7 +491,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
491
491
|
zIndex: D.length - u,
|
|
492
492
|
...t.dropdownMenuColumnStyle
|
|
493
493
|
},
|
|
494
|
-
children:
|
|
494
|
+
children: _(
|
|
495
495
|
/* @__PURE__ */ X(
|
|
496
496
|
"div",
|
|
497
497
|
{
|
|
@@ -510,7 +510,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
510
510
|
...xe(t.virtualListProps) ? t.virtualListProps : {},
|
|
511
511
|
wrapper: "ul",
|
|
512
512
|
role: "menu",
|
|
513
|
-
ref: (
|
|
513
|
+
ref: (d) => n(d, u),
|
|
514
514
|
className: q(
|
|
515
515
|
`${c}-list`,
|
|
516
516
|
`${c}-list-select`,
|
|
@@ -519,20 +519,20 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
519
519
|
[`${c}-list-rtl`]: E
|
|
520
520
|
}
|
|
521
521
|
),
|
|
522
|
-
children: (
|
|
522
|
+
children: (d) => {
|
|
523
523
|
let A = !1;
|
|
524
|
-
return h && (A = h.pathValue[u] ===
|
|
524
|
+
return h && (A = h.pathValue[u] === d.value), /* @__PURE__ */ p(
|
|
525
525
|
"li",
|
|
526
526
|
{
|
|
527
527
|
tabIndex: 0,
|
|
528
528
|
role: "menuitem",
|
|
529
|
-
"aria-haspopup": !
|
|
530
|
-
"aria-expanded": A && !
|
|
531
|
-
"aria-disabled":
|
|
532
|
-
title: Y(
|
|
529
|
+
"aria-haspopup": !d.isLeaf,
|
|
530
|
+
"aria-expanded": A && !d.isLeaf,
|
|
531
|
+
"aria-disabled": d.disabled,
|
|
532
|
+
title: Y(d.label) ? d.label : void 0,
|
|
533
533
|
className: q(`${c}-list-item`, {
|
|
534
534
|
[`${c}-list-item-active`]: A,
|
|
535
|
-
[`${c}-list-item-disabled`]:
|
|
535
|
+
[`${c}-list-item-disabled`]: d.disabled
|
|
536
536
|
}),
|
|
537
537
|
children: /* @__PURE__ */ p(
|
|
538
538
|
kt,
|
|
@@ -540,24 +540,24 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
540
540
|
prefixCls: c,
|
|
541
541
|
rtl: E,
|
|
542
542
|
multiple: k,
|
|
543
|
-
option:
|
|
544
|
-
selected: !k &&
|
|
545
|
-
icons:
|
|
543
|
+
option: d,
|
|
544
|
+
selected: !k && d.isLeaf && me(t.value, d.pathValue),
|
|
545
|
+
icons: T,
|
|
546
546
|
onMouseEnter: () => {
|
|
547
|
-
|
|
547
|
+
d.disabled || t.expandTrigger === "hover" && (V(d), !d.isLeaf && S(d));
|
|
548
548
|
},
|
|
549
|
-
renderOption: I && (() => I(
|
|
549
|
+
renderOption: I && (() => I(d._data, u)),
|
|
550
550
|
onClickOption: () => {
|
|
551
|
-
|
|
551
|
+
d.isLeaf && k && !d.disableCheckbox ? P(d, !d._checked) : f(d);
|
|
552
552
|
},
|
|
553
553
|
onMultipleChecked: (U) => {
|
|
554
|
-
P(
|
|
554
|
+
P(d, U);
|
|
555
555
|
},
|
|
556
556
|
onDoubleClickOption: t.onDoubleClickOption
|
|
557
557
|
}
|
|
558
558
|
)
|
|
559
559
|
},
|
|
560
|
-
|
|
560
|
+
d.value
|
|
561
561
|
);
|
|
562
562
|
}
|
|
563
563
|
}
|
|
@@ -566,8 +566,8 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
566
566
|
"div",
|
|
567
567
|
{
|
|
568
568
|
className: `${c}-list-footer`,
|
|
569
|
-
onMouseDown: (
|
|
570
|
-
|
|
569
|
+
onMouseDown: (d) => {
|
|
570
|
+
d.stopPropagation();
|
|
571
571
|
},
|
|
572
572
|
children: g
|
|
573
573
|
}
|
|
@@ -583,7 +583,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
583
583
|
u
|
|
584
584
|
);
|
|
585
585
|
}) });
|
|
586
|
-
}, Se = (t, e) => t < 0 ? e : t > e ? 0 : t,
|
|
586
|
+
}, Se = (t, e) => t < 0 ? e : t > e ? 0 : t, vt = (t, e, n) => {
|
|
587
587
|
let l = e;
|
|
588
588
|
if (Y(e)) {
|
|
589
589
|
const s = e.toUpperCase().indexOf(t.toUpperCase());
|
|
@@ -611,12 +611,12 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
611
611
|
icons: b
|
|
612
612
|
} = t, x = t.value || [], [N, E] = le(
|
|
613
613
|
e.searchNodeByLabel(c) || []
|
|
614
|
-
),
|
|
614
|
+
), T = K(), h = K(), V = dt(), [L, j] = le(
|
|
615
615
|
O ? 0 : -1
|
|
616
|
-
), S = (f, P,
|
|
617
|
-
if (
|
|
616
|
+
), S = (f, P, w) => {
|
|
617
|
+
if (w.stopPropagation(), !f.disabled)
|
|
618
618
|
if (l) {
|
|
619
|
-
const C =
|
|
619
|
+
const C = Me(
|
|
620
620
|
t.value,
|
|
621
621
|
e,
|
|
622
622
|
f,
|
|
@@ -634,48 +634,48 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
634
634
|
const f = t.getTriggerElement();
|
|
635
635
|
if (!f)
|
|
636
636
|
return;
|
|
637
|
-
const P = (
|
|
637
|
+
const P = (w) => {
|
|
638
638
|
var D;
|
|
639
|
-
|
|
640
|
-
const C =
|
|
639
|
+
w.stopPropagation();
|
|
640
|
+
const C = w.key;
|
|
641
641
|
switch (C) {
|
|
642
642
|
case fe.key:
|
|
643
643
|
return (D = t.onEsc) == null || D.call(t), !1;
|
|
644
644
|
case se.key:
|
|
645
|
-
case
|
|
645
|
+
case we.key: {
|
|
646
646
|
h.current = !0;
|
|
647
|
-
const
|
|
648
|
-
let
|
|
649
|
-
L +
|
|
647
|
+
const _ = se.key === C ? 1 : -1;
|
|
648
|
+
let M = Se(
|
|
649
|
+
L + _,
|
|
650
650
|
N.length - 1
|
|
651
651
|
);
|
|
652
|
-
for (;
|
|
653
|
-
|
|
654
|
-
return j(
|
|
652
|
+
for (; M !== L && N[M].disabled; )
|
|
653
|
+
M = Se(M + _, N.length - 1);
|
|
654
|
+
return j(M), !1;
|
|
655
655
|
}
|
|
656
656
|
case he.key: {
|
|
657
|
-
const
|
|
658
|
-
if (
|
|
659
|
-
const
|
|
660
|
-
S(
|
|
657
|
+
const _ = N[L];
|
|
658
|
+
if (_) {
|
|
659
|
+
const M = x.some((a) => me(a, _.pathValue));
|
|
660
|
+
S(_, !M, w);
|
|
661
661
|
}
|
|
662
662
|
return !1;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
return Le(f, "keydown", P), () => {
|
|
667
|
-
|
|
667
|
+
oe(f, "keydown", P);
|
|
668
668
|
};
|
|
669
669
|
}, [N, L, x]), Z(() => {
|
|
670
670
|
var P;
|
|
671
|
-
const f =
|
|
671
|
+
const f = T.current;
|
|
672
672
|
f && (h.current || V) && ct(f, {
|
|
673
673
|
behavior: "auto",
|
|
674
674
|
block: "nearest",
|
|
675
675
|
scrollMode: "if-needed",
|
|
676
676
|
boundary: (P = f.parentNode) == null ? void 0 : P.parentNode
|
|
677
677
|
});
|
|
678
|
-
}, [L, N]),
|
|
678
|
+
}, [L, N]), T.current = null, N.length ? /* @__PURE__ */ p("div", { className: `${n}-list-wrapper`, children: /* @__PURE__ */ p(
|
|
679
679
|
Pe,
|
|
680
680
|
{
|
|
681
681
|
needFiller: !1,
|
|
@@ -694,18 +694,18 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
694
694
|
[`${n}-list-rtl`]: I
|
|
695
695
|
}),
|
|
696
696
|
children: (f, P) => {
|
|
697
|
-
const
|
|
697
|
+
const w = f.getPathNodes(), C = w.map((a, u, g) => /* @__PURE__ */ X("span", { children: [
|
|
698
698
|
a.label,
|
|
699
|
-
|
|
700
|
-
] }, `${a.label}_${a._level}`)), D = f._checked,
|
|
699
|
+
w.length === u + 1 ? "" : " / "
|
|
700
|
+
] }, `${a.label}_${a._level}`)), D = f._checked, _ = { checked: D }, M = W(t.renderOption) ? t.renderOption(c, f._data, _) : vt(c, C, n);
|
|
701
701
|
return /* @__PURE__ */ p(
|
|
702
702
|
"li",
|
|
703
703
|
{
|
|
704
|
-
title: Y(
|
|
704
|
+
title: Y(M) ? M : Y(C) ? C : void 0,
|
|
705
705
|
role: "menuitem",
|
|
706
706
|
"aria-disabled": f.disabled,
|
|
707
707
|
ref: (a) => {
|
|
708
|
-
P === L && (
|
|
708
|
+
P === L && (T.current = a), D && !T.current && (T.current = a);
|
|
709
709
|
},
|
|
710
710
|
className: q(`${n}-list-search-item`, {
|
|
711
711
|
[`${n}-list-search-item-active`]: D,
|
|
@@ -721,8 +721,8 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
721
721
|
onMouseLeave: () => {
|
|
722
722
|
!h.current && !f.disabled && j(O ? 0 : -1);
|
|
723
723
|
},
|
|
724
|
-
children: /* @__PURE__ */ p("div", { className: `${n}-list-item-label`, children: W(t.renderOption) ?
|
|
725
|
-
|
|
724
|
+
children: /* @__PURE__ */ p("div", { className: `${n}-list-item-label`, children: W(t.renderOption) ? M : l ? /* @__PURE__ */ p(Oe, { checked: D, disabled: f.disabled, children: M }) : /* @__PURE__ */ X(ne, { children: [
|
|
725
|
+
M,
|
|
726
726
|
D && /* @__PURE__ */ p("span", { className: `${n}-check-icon`, children: b.checked })
|
|
727
727
|
] }) })
|
|
728
728
|
},
|
|
@@ -746,7 +746,7 @@ const ie = (t) => (t || []).reduce((l, s) => (l.add([].concat(s).join(G)), l), /
|
|
|
746
746
|
checkedStrategy: mt,
|
|
747
747
|
defaultActiveFirstOption: !0
|
|
748
748
|
}, St = { bottom: 4 };
|
|
749
|
-
function
|
|
749
|
+
function _t(t, e) {
|
|
750
750
|
const { getPrefixCls: n, renderEmpty: l, componentConfig: s, rtl: c } = Qe(Ye), r = et(
|
|
751
751
|
t,
|
|
752
752
|
Vt,
|
|
@@ -759,7 +759,7 @@ function wt(t, e) {
|
|
|
759
759
|
triggerProps: x,
|
|
760
760
|
expandTrigger: N,
|
|
761
761
|
icons: E
|
|
762
|
-
} = r,
|
|
762
|
+
} = r, T = {
|
|
763
763
|
loading: (E == null ? void 0 : E.loading) || /* @__PURE__ */ p(We, {}),
|
|
764
764
|
checked: (E == null ? void 0 : E.checked) || /* @__PURE__ */ p(je, {}),
|
|
765
765
|
next: (E == null ? void 0 : E.next) || (c ? /* @__PURE__ */ p(Ue, {}) : /* @__PURE__ */ p(ze, {}))
|
|
@@ -769,14 +769,14 @@ function wt(t, e) {
|
|
|
769
769
|
"value" in r ? r.value : r.defaultValue,
|
|
770
770
|
V
|
|
771
771
|
)
|
|
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) : []),
|
|
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, [C, D] = ye(!1, {
|
|
773
773
|
value: r.popupVisible,
|
|
774
774
|
defaultValue: r.defaultPopupVisible
|
|
775
|
-
}), [
|
|
775
|
+
}), [_, M, a] = ye("", {
|
|
776
776
|
value: "inputValue" in r ? r.inputValue || "" : void 0
|
|
777
|
-
}), u = K(
|
|
778
|
-
var
|
|
779
|
-
i !== u.current && (
|
|
777
|
+
}), u = K(_), g = K(null), d = K(null), A = K((S == null ? void 0 : S.getCheckedNodes()) || []), U = Ze(`${h}-popup-`), F = (i, m) => {
|
|
778
|
+
var y;
|
|
779
|
+
i !== u.current && (M(i), u.current = i, g.current = m, (y = r.onInputValueChange) == null || y.call(r, i, m));
|
|
780
780
|
};
|
|
781
781
|
function z(i) {
|
|
782
782
|
return Ke(i) || qe(i);
|
|
@@ -784,12 +784,12 @@ function wt(t, e) {
|
|
|
784
784
|
Z(() => {
|
|
785
785
|
var m;
|
|
786
786
|
const { current: i } = g;
|
|
787
|
-
a ===
|
|
788
|
-
}, [
|
|
787
|
+
a === _ && (i === "manual" || i === "optionListHide") && ((m = r.onSearch) == null || m.call(r, _, i)), _ !== u.current && (u.current = _);
|
|
788
|
+
}, [_]), Z(() => {
|
|
789
789
|
const i = () => {
|
|
790
790
|
clearTimeout(L.current), L.current = null;
|
|
791
791
|
};
|
|
792
|
-
return !C &&
|
|
792
|
+
return !C && _ && (L.current && i(), L.current = setTimeout(() => {
|
|
793
793
|
F("", "optionListHide"), L.current = null;
|
|
794
794
|
}, 200)), () => {
|
|
795
795
|
i();
|
|
@@ -799,19 +799,19 @@ function wt(t, e) {
|
|
|
799
799
|
const i = te(r.value, V);
|
|
800
800
|
S.setNodeCheckedByValue(i), P(i);
|
|
801
801
|
}
|
|
802
|
-
}, [r.value, V]), Xe(e, () =>
|
|
803
|
-
const
|
|
802
|
+
}, [r.value, V]), Xe(e, () => d.current, []);
|
|
803
|
+
const $e = (i) => {
|
|
804
804
|
A.current = Array.from(
|
|
805
805
|
new Set([].concat(i, A.current))
|
|
806
806
|
);
|
|
807
807
|
}, pe = (i) => {
|
|
808
|
-
const m = [],
|
|
809
|
-
|
|
810
|
-
if (J(
|
|
808
|
+
const m = [], y = ie(i), $ = (v) => {
|
|
809
|
+
v.some((R) => {
|
|
810
|
+
if (J(y, R.pathValue) && (m.push(R.getPathNodes().map((B) => B._data)), pt(y, R.pathValue)), !y.size)
|
|
811
811
|
return !0;
|
|
812
812
|
});
|
|
813
813
|
};
|
|
814
|
-
return
|
|
814
|
+
return $(S.getCheckedNodes()), y.size && $(A.current), m;
|
|
815
815
|
}, H = ae(
|
|
816
816
|
(i) => {
|
|
817
817
|
var m;
|
|
@@ -820,33 +820,33 @@ function wt(t, e) {
|
|
|
820
820
|
[r.onVisibleChange, C]
|
|
821
821
|
), De = ae(
|
|
822
822
|
(i) => {
|
|
823
|
-
var
|
|
823
|
+
var v;
|
|
824
824
|
const m = pe([i])[0] || [];
|
|
825
|
-
let
|
|
826
|
-
return m.length && (
|
|
827
|
-
text:
|
|
828
|
-
disabled: (
|
|
825
|
+
let y, $ = _e(i) ? i.map((R) => String(R)) : [];
|
|
826
|
+
return m.length && ($ = m.map((R) => R.label)), W(O) ? y = O($) : $.every((R) => Y(R)) ? y = $.join(" / ") : y = $.reduce((R, B, ce) => R.concat(ce === 0 ? [B] : [" / ", B]), []), {
|
|
827
|
+
text: y || "",
|
|
828
|
+
disabled: (v = m[m.length - 1]) == null ? void 0 : v.disabled
|
|
829
829
|
};
|
|
830
830
|
},
|
|
831
831
|
[S, O]
|
|
832
832
|
), Q = (i, m) => {
|
|
833
833
|
var be;
|
|
834
|
-
m === "panel" &&
|
|
835
|
-
const { onChange:
|
|
836
|
-
if (
|
|
834
|
+
m === "panel" && de(r.showSearch) && !r.showSearch.retainInputValueWhileSelect && V && F("", "optionChecked");
|
|
835
|
+
const { onChange: y, changeOnSelect: $, expandTrigger: v } = r;
|
|
836
|
+
if (w === i)
|
|
837
837
|
return;
|
|
838
|
-
V || S.setNodeCheckedByValue(i),
|
|
838
|
+
V || S.setNodeCheckedByValue(i), $e(S.getCheckedNodes());
|
|
839
839
|
const B = pe(i), ce = V ? i : i[0], Fe = V ? B : B[0];
|
|
840
|
-
V || (
|
|
840
|
+
V || (_ || B[0] && ((be = B[0][B[0].length - 1]) != null && be.isLeaf) || $ && v === "hover") && H(!1), "value" in r ? (S.setNodeCheckedByValue(w), j()) : P(i), y == null || y(ce, Fe, {
|
|
841
841
|
dropdownVisible: C
|
|
842
842
|
});
|
|
843
|
-
}, Ie = (i, m,
|
|
844
|
-
if (
|
|
843
|
+
}, Ie = (i, m, y) => {
|
|
844
|
+
if (y.stopPropagation(), i.disabled)
|
|
845
845
|
return;
|
|
846
|
-
const
|
|
847
|
-
S.setNodeCheckedByValue(
|
|
846
|
+
const $ = w.filter((v, R) => R !== m);
|
|
847
|
+
S.setNodeCheckedByValue($), Q($);
|
|
848
848
|
}, Ce = (i) => {
|
|
849
|
-
const m = i ||
|
|
849
|
+
const m = i || d.current && d.current.getWidth();
|
|
850
850
|
return /* @__PURE__ */ p(
|
|
851
851
|
"div",
|
|
852
852
|
{
|
|
@@ -855,8 +855,8 @@ function wt(t, e) {
|
|
|
855
855
|
children: r.notFoundContent || l("Cascader")
|
|
856
856
|
}
|
|
857
857
|
);
|
|
858
|
-
},
|
|
859
|
-
const i =
|
|
858
|
+
}, Re = () => {
|
|
859
|
+
const i = de(r.showSearch) ? r.showSearch.panelMode : void 0, m = i === ve.select ? !0 : i === ve.cascader ? !1 : !W(r.onSearch) && !!_, y = d.current && d.current.getWidth(), $ = W(r.dropdownRender) ? r.dropdownRender : (v) => v;
|
|
860
860
|
return /* @__PURE__ */ p(
|
|
861
861
|
"div",
|
|
862
862
|
{
|
|
@@ -864,40 +864,40 @@ function wt(t, e) {
|
|
|
864
864
|
className: q(`${h}-popup`, r.dropdownMenuClassName, {
|
|
865
865
|
[`${h}-popup-trigger-hover`]: r.expandTrigger === "hover"
|
|
866
866
|
}),
|
|
867
|
-
children:
|
|
867
|
+
children: $(
|
|
868
868
|
/* @__PURE__ */ p(
|
|
869
869
|
"div",
|
|
870
870
|
{
|
|
871
871
|
className: `${h}-popup-inner`,
|
|
872
|
-
onMouseDown: (
|
|
872
|
+
onMouseDown: (v) => v.preventDefault(),
|
|
873
873
|
children: m ? /* @__PURE__ */ p(
|
|
874
874
|
Nt,
|
|
875
875
|
{
|
|
876
|
-
style: { minWidth:
|
|
876
|
+
style: { minWidth: y },
|
|
877
877
|
store: S,
|
|
878
|
-
inputValue:
|
|
879
|
-
renderEmpty: () => Ce(
|
|
878
|
+
inputValue: _,
|
|
879
|
+
renderEmpty: () => Ce(y),
|
|
880
880
|
multiple: V,
|
|
881
|
-
onChange: (
|
|
882
|
-
Q(
|
|
881
|
+
onChange: (v) => {
|
|
882
|
+
Q(v, "panel");
|
|
883
883
|
},
|
|
884
884
|
prefixCls: h,
|
|
885
885
|
rtl: c,
|
|
886
886
|
onEsc: () => {
|
|
887
887
|
H(!1);
|
|
888
888
|
},
|
|
889
|
-
renderOption:
|
|
889
|
+
renderOption: de(r.showSearch) && r.showSearch.renderOption || void 0,
|
|
890
890
|
getTriggerElement: () => {
|
|
891
|
-
var
|
|
892
|
-
return (
|
|
891
|
+
var v;
|
|
892
|
+
return (v = d.current) == null ? void 0 : v.dom;
|
|
893
893
|
},
|
|
894
|
-
value:
|
|
894
|
+
value: w,
|
|
895
895
|
virtualListProps: r.virtualListProps,
|
|
896
896
|
defaultActiveFirstOption: r.defaultActiveFirstOption,
|
|
897
|
-
icons:
|
|
897
|
+
icons: T
|
|
898
898
|
}
|
|
899
899
|
) : /* @__PURE__ */ p(
|
|
900
|
-
|
|
900
|
+
yt,
|
|
901
901
|
{
|
|
902
902
|
dropdownMenuColumnStyle: r.dropdownMenuColumnStyle,
|
|
903
903
|
virtualListProps: r.virtualListProps,
|
|
@@ -908,21 +908,21 @@ function wt(t, e) {
|
|
|
908
908
|
changeOnSelect: r.changeOnSelect,
|
|
909
909
|
showEmptyChildren: r.showEmptyChildren || !!r.loadMore,
|
|
910
910
|
multiple: V,
|
|
911
|
-
onChange: (
|
|
912
|
-
Q(
|
|
911
|
+
onChange: (v) => {
|
|
912
|
+
Q(v, "panel");
|
|
913
913
|
},
|
|
914
914
|
loadMore: r.loadMore,
|
|
915
915
|
prefixCls: h,
|
|
916
916
|
rtl: c,
|
|
917
917
|
getTriggerElement: () => {
|
|
918
|
-
var
|
|
919
|
-
return (
|
|
918
|
+
var v;
|
|
919
|
+
return (v = d.current) == null ? void 0 : v.dom;
|
|
920
920
|
},
|
|
921
921
|
renderEmpty: Ce,
|
|
922
922
|
popupVisible: C,
|
|
923
|
-
value:
|
|
923
|
+
value: w,
|
|
924
924
|
renderFooter: r.renderFooter,
|
|
925
|
-
icons:
|
|
925
|
+
icons: T,
|
|
926
926
|
onEsc: () => {
|
|
927
927
|
H(!1);
|
|
928
928
|
},
|
|
@@ -936,12 +936,12 @@ function wt(t, e) {
|
|
|
936
936
|
)
|
|
937
937
|
}
|
|
938
938
|
);
|
|
939
|
-
},
|
|
939
|
+
}, Te = (i) => {
|
|
940
940
|
Q(i);
|
|
941
941
|
}, ke = (i) => /* @__PURE__ */ p(
|
|
942
942
|
nt,
|
|
943
943
|
{
|
|
944
|
-
popup:
|
|
944
|
+
popup: Re,
|
|
945
945
|
trigger: r.trigger,
|
|
946
946
|
disabled: k,
|
|
947
947
|
getPopupContainer: I,
|
|
@@ -959,36 +959,36 @@ function wt(t, e) {
|
|
|
959
959
|
tt,
|
|
960
960
|
{
|
|
961
961
|
...r,
|
|
962
|
-
ref:
|
|
962
|
+
ref: d,
|
|
963
963
|
ariaControls: U,
|
|
964
964
|
popupVisible: C,
|
|
965
|
-
value: V ?
|
|
966
|
-
inputValue:
|
|
965
|
+
value: V ? w : w && w[0],
|
|
966
|
+
inputValue: _,
|
|
967
967
|
rtl: c,
|
|
968
|
-
isEmptyValue: z(
|
|
968
|
+
isEmptyValue: z(w),
|
|
969
969
|
prefixCls: h,
|
|
970
970
|
isMultiple: V,
|
|
971
971
|
renderText: De,
|
|
972
972
|
onRemoveCheckedItem: Ie,
|
|
973
|
-
onSort:
|
|
973
|
+
onSort: Te,
|
|
974
974
|
renderView: ke,
|
|
975
975
|
onClear: (i) => {
|
|
976
976
|
var m;
|
|
977
977
|
if (i.stopPropagation(), !V)
|
|
978
978
|
Q([]);
|
|
979
979
|
else {
|
|
980
|
-
const
|
|
981
|
-
S.setNodeCheckedByValue(
|
|
980
|
+
const $ = S.getCheckedNodes().filter((v) => v.disabled).map((v) => v.pathValue);
|
|
981
|
+
S.setNodeCheckedByValue($), Q($);
|
|
982
982
|
}
|
|
983
983
|
(m = r.onClear) == null || m.call(r, !!C);
|
|
984
984
|
},
|
|
985
985
|
onKeyDown: (i) => {
|
|
986
|
-
var
|
|
986
|
+
var y;
|
|
987
987
|
if (k)
|
|
988
988
|
return;
|
|
989
989
|
i.stopPropagation();
|
|
990
990
|
const m = i.key;
|
|
991
|
-
m === fe.key && C && (H(!1), i.preventDefault()), m === he.key && !C && (H(!0), i.preventDefault()), m === at.key && C && H(!1), (
|
|
991
|
+
m === fe.key && C && (H(!1), i.preventDefault()), m === he.key && !C && (H(!0), i.preventDefault()), m === at.key && C && H(!1), (y = r.onKeyDown) == null || y.call(r, i);
|
|
992
992
|
},
|
|
993
993
|
onChangeInputValue: (i) => {
|
|
994
994
|
F(i, "manual"), C || H(!0);
|
|
@@ -996,10 +996,10 @@ function wt(t, e) {
|
|
|
996
996
|
}
|
|
997
997
|
);
|
|
998
998
|
}
|
|
999
|
-
const
|
|
1000
|
-
|
|
999
|
+
const wt = Ge(
|
|
1000
|
+
_t
|
|
1001
1001
|
);
|
|
1002
|
-
|
|
1002
|
+
wt.displayName = "Cascader";
|
|
1003
1003
|
export {
|
|
1004
|
-
|
|
1004
|
+
wt as C
|
|
1005
1005
|
};
|