@unicom-cloud/ui 0.8.96 → 0.8.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Affix.js +1 -1
- package/Carousel.js +1 -1
- package/LiquidFill.js +4 -0
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Tour.js +63 -0
- package/Trigger.js +1 -1
- package/_virtual/_commonjsHelpers.js +6 -0
- package/_virtual/index.js +7 -0
- package/_virtual/index2.js +4 -0
- package/affix/index.js +70 -72
- package/alert/index.js +56 -56
- package/anchor/Anchor.js +55 -55
- package/anchor/Link.js +34 -34
- package/anchor/util.js +5 -5
- package/auto-complete/index.js +116 -122
- package/avatar/Avatar.js +33 -33
- package/avatar/Group.js +26 -26
- package/back-top/index.js +58 -61
- package/badge/index.js +46 -46
- package/breadcrumb/Item.js +42 -43
- package/breadcrumb/index.js +47 -47
- package/button/Group.js +6 -6
- package/button/index.js +91 -91
- package/calendar/Month.js +75 -75
- package/calendar/Year.js +35 -35
- package/calendar/header/index.js +25 -25
- package/calendar/index.js +103 -103
- package/card/Grid.js +8 -8
- package/card/Meta.js +16 -16
- package/card/index.js +49 -49
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +26 -26
- package/carousel/index.js +108 -108
- package/cascader/Cascader.js +178 -191
- package/cascader/base/node.js +133 -136
- package/cascader/base/store.js +82 -85
- package/cascader/panel/List.js +125 -129
- package/cascader/panel/Search.js +79 -81
- package/cascader/util.js +13 -13
- package/checkbox/Checkbox.js +94 -96
- package/checkbox/Group.js +54 -56
- package/checkbox/GroupBlock.js +28 -29
- package/collapse/Collapse.js +45 -45
- package/collapse/Item.js +53 -55
- package/color-picker/ControlBar.js +43 -43
- package/color-picker/InputAlpha.js +12 -12
- package/color-picker/InputHex.js +30 -31
- package/color-picker/InputRgb.js +24 -24
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +122 -125
- package/color-picker/hooks/useColorPicker.js +85 -88
- package/color-picker/hooks/useControlBlock.js +38 -40
- package/color-picker/index.js +47 -47
- package/comment/index.js +29 -29
- package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
- package/components/common/hooks/useId.js +8 -8
- package/components/common/hooks/useInView.js +16 -16
- package/components/common/hooks/useIntersectionObserver.js +1 -1
- package/components/common/hooks/useKeyboardEvent.js +9 -10
- package/components/common/hooks/useOverflowHidden.js +1 -4
- package/components/common/hooks/usePersistCallback.js +7 -7
- package/components/common/hooks/useStateCallback.js +9 -10
- package/components/common/hooks/useWindowSize.js +8 -8
- package/components/common/space/index.js +9 -7
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/components/common/utils/dom.js +27 -29
- package/components/common/utils/findScrollParent.js +17 -0
- package/components/common/utils/intersectionObserver.js +21 -0
- package/components/common/utils/is.js +99 -109
- package/components/common/utils/mutationObserver.js +19 -0
- package/components/common/utils/reactDOM.js +34 -34
- package/components/common/utils/resizeObserver.js +21 -0
- package/copy/index.js +38 -40
- package/date-picker/Picker.js +290 -295
- package/date-picker/RangePicker.js +367 -372
- package/date-picker/index.js +33 -35
- package/date-picker/panel/Body.js +46 -47
- package/date-picker/panel/Header.js +33 -33
- package/date-picker/panel/Shortcut.js +31 -31
- package/date-picker/panel/date/index.js +85 -85
- package/date-picker/panel/month/index.js +59 -59
- package/date-picker/panel/quarter/index.js +67 -70
- package/date-picker/panel/range/index.js +101 -101
- package/date-picker/panel/year/index.js +39 -39
- package/date-picker/util.js +17 -18
- package/descriptions/index.js +62 -62
- package/details/index.js +53 -55
- package/development/index.js +9 -9
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/validate/src/index.js +5 -5
- package/dist/validate/src/util.js +1 -1
- package/divider/index.js +21 -21
- package/draggable/Item.js +35 -35
- package/draggable/index.js +22 -22
- package/drawer/Drawer.js +142 -147
- package/dropdown/Button.js +48 -48
- package/dropdown/index.js +88 -92
- package/empty/index.js +16 -16
- package/form/Control.js +211 -225
- package/form/Form.js +109 -113
- package/form/FormItem.js +118 -120
- package/form/FormList.js +60 -66
- package/form/FormProvider.js +31 -34
- package/form/hook/useContext.js +17 -19
- package/form/hook/useState.js +22 -23
- package/form/hook/useWatch.js +26 -27
- package/form/promisify.js +14 -18
- package/form/store.js +304 -316
- package/form/util.js +14 -15
- package/grid/Col.js +64 -64
- package/grid/Grid.js +51 -51
- package/grid/GridItem.js +48 -48
- package/grid/Row.js +39 -39
- package/hooks/useVerificationCode.js +41 -43
- package/hooks/useWatermark.js +89 -92
- package/icon/index.js +23 -24
- package/icon-hover/index.js +16 -16
- package/icons/file.js +11 -11
- package/image/Image.js +140 -141
- package/image/ImagePreview.js +252 -255
- package/image/ImagePreviewArrow.js +25 -25
- package/image/ImagePreviewGroup.js +62 -62
- package/image/util/getScale.js +25 -28
- package/index.js +684 -675
- package/input/Button.js +48 -50
- package/input/Group.js +9 -9
- package/input/Input.js +145 -154
- package/input/InputElement.js +108 -115
- package/input/Password.js +38 -38
- package/input/Search.js +51 -55
- package/input/Textarea.js +80 -81
- package/input/useComposition.js +23 -23
- package/input-number/decimal.js +59 -62
- package/input-number/index.js +139 -141
- package/input-tag/InputTag.js +222 -230
- package/layout/Content.js +6 -6
- package/layout/Footer.js +8 -8
- package/layout/Header.js +7 -7
- package/layout/Sider.js +88 -90
- package/layout/index.js +30 -30
- package/link/index.js +45 -46
- package/liquid-fill/LiquidFill.js +226 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/list/Item.js +28 -28
- package/list/Meta.js +12 -12
- package/list/index.js +146 -148
- package/mentions/index.js +75 -76
- package/menu/Item.js +58 -58
- package/menu/Menu.js +125 -127
- package/menu/OverflowWrap.js +39 -40
- package/menu/sub-menu/Inline.js +45 -45
- package/menu/util.js +26 -28
- package/message/index.js +96 -99
- package/message/useMessage.js +26 -27
- package/modal/Confirm.js +47 -49
- package/modal/Modal.js +250 -257
- package/modal/use-modal/Hook.js +26 -28
- package/modal/use-modal/index.js +46 -49
- package/notice/index.js +89 -90
- package/notification/index.js +60 -65
- package/notification/withNotification.js +35 -35
- package/overflow-ellipsis/OverflowItem.js +19 -20
- package/overflow-ellipsis/index.js +45 -46
- package/package.json +1 -1
- package/page-header/index.js +45 -45
- package/pagination/PageItem.js +87 -91
- package/pagination/PageJumper.js +40 -41
- package/pagination/PageOption.js +31 -35
- package/pagination/Pagination.js +162 -163
- package/picker/Input.js +90 -96
- package/picker/InputRange.js +115 -122
- package/popconfirm/index.js +98 -100
- package/popover/index.js +28 -28
- package/portal/Portal.js +10 -11
- package/progress/index.js +36 -36
- package/qr-code/index.js +99 -0
- package/qr-code/interface.js +1 -0
- package/radio/Group.js +48 -48
- package/radio/GroupBlock.js +32 -33
- package/radio/Radio.js +62 -64
- package/rate/index.js +88 -88
- package/resize-box/ResizeTrigger.js +39 -39
- package/resize-box/Split.js +92 -96
- package/resize-box/SplitGroup.js +116 -122
- package/resize-box/index.js +112 -115
- package/result/index.js +44 -44
- package/select/Option.js +53 -56
- package/select/Select.js +365 -381
- package/select/util.js +95 -99
- package/select-view/Core.js +159 -160
- package/skeleton/index.js +23 -23
- package/slider/Button.js +84 -92
- package/slider/Input.js +47 -49
- package/slider/Tick.js +28 -31
- package/slider/index.js +107 -107
- package/space/index.js +26 -26
- package/space-/index.js +51 -51
- package/spin/DotLoading.js +8 -8
- package/spin/index.js +47 -47
- package/statistic/Countdown.js +37 -37
- package/statistic/index.js +58 -58
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +77 -78
- package/table/ColGroup.js +36 -37
- package/table/Table.js +447 -450
- package/table/hook/useExpand.js +24 -24
- package/table/hook/useRowSelection.js +62 -62
- package/table/summary/Row.js +16 -17
- package/table/tbody/Td.js +119 -118
- package/table/tbody/Tr.js +119 -121
- package/table/tbody/index.js +62 -63
- package/table/th-resizable/index.js +30 -30
- package/table/thead/Column.js +148 -148
- package/table/thead/index.js +87 -88
- package/tabs/Tab.js +55 -55
- package/tabs/TabContent.js +8 -8
- package/tabs/TabPane.js +15 -15
- package/tabs/hook/useHeaderScroll.js +36 -36
- package/tabs/tab-header/TabInk.js +31 -33
- package/tabs/tab-header/TabNavIcon.js +34 -35
- package/tabs/tab-header/index.js +192 -195
- package/tag/index.js +94 -97
- package/time-picker/Picker.js +167 -172
- package/time-picker/RangePicker.js +28 -28
- package/time-picker/TimePicker.js +146 -146
- package/timeline/Item.js +46 -46
- package/timeline/Timeline.js +52 -52
- package/tooltip/index.js +89 -95
- package/tour/index.js +289 -0
- package/transfer/Item.js +54 -54
- package/transfer/List.js +134 -136
- package/transfer/index.js +91 -91
- package/tree/Animation.js +49 -52
- package/tree/Node.js +114 -122
- package/tree/NodeList.js +51 -51
- package/tree/Tree.js +386 -393
- package/tree-select/List.js +71 -72
- package/tree-select/Select.js +135 -143
- package/tree-select/hook/useKeyCache.js +39 -39
- package/tree-select/hook/useStateValue.js +12 -12
- package/trigger/getPopupStyle.js +60 -61
- package/trigger/index.js +337 -346
- package/types/common/space/interface.d.ts +1 -1
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/common/utils/findScrollParent.d.ts +2 -0
- package/types/common/utils/index.d.ts +5 -0
- package/types/common/utils/intersectionObserver.d.ts +2 -0
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/config-provider/interface.d.ts +6 -0
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +2 -0
- package/types/pc/qr-code/index.d.ts +34 -0
- package/types/pc/qr-code/interface.d.ts +39 -0
- package/types/pc/table/interface.d.ts +2 -2
- package/types/pc/tour/index.d.ts +42 -0
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/pc/utils/findScrollParent.d.ts +2 -0
- package/types/pc/utils/index.d.ts +5 -0
- package/types/pc/utils/intersectionObserver.d.ts +2 -0
- package/types/pc/utils/mutationObserver.d.ts +2 -0
- package/types/pc/utils/names.d.ts +18 -0
- package/types/pc/utils/resizeObserver.d.ts +2 -0
- package/typography/Base.js +79 -81
- package/typography/EditContent.js +30 -33
- package/typography/Ellipsis.js +77 -73
- package/typography/Operations.js +50 -52
- package/typography/Paragraph.js +7 -7
- package/typography/Typography.js +7 -7
- package/typography/useEllipsis.js +105 -106
- package/upload/TriggerNode.js +69 -76
- package/upload/Upload.js +84 -87
- package/upload/Uploader.js +115 -118
- package/upload/list/PictureItem.js +61 -71
- package/upload/list/TextItem.js +61 -67
- package/upload/list/UploadProgress.js +42 -49
- package/upload/list/index.js +48 -49
- package/upload/request_.js +37 -38
- package/upload/util.js +39 -39
- package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/utils/findScrollParent.js +4 -0
- package/utils/index.js +281 -278
- package/utils/intersectionObserver.js +4 -0
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/resizeObserver.js +4 -0
- package/verification-code/VerificationCode.js +50 -51
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +243 -244
- package/virtual-list/util/item.js +3 -4
- package/watermark/Watermark.js +27 -31
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
package/input-tag/InputTag.js
CHANGED
|
@@ -1,391 +1,383 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as i, jsxs as S, Fragment as Ke } from "react/jsx-runtime";
|
|
2
|
+
import Ue from "@unicom-cloud/icons/IconUiClose";
|
|
3
3
|
import "../dist/react-transition-group/src/CSSTransition.js";
|
|
4
4
|
import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
5
5
|
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
6
6
|
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import Ge from "../dist/react-transition-group/src/TransitionGroup.js";
|
|
8
|
+
import me from "lodash/isArray";
|
|
9
|
+
import de, { useContext as qe, useRef as $, useState as Xe, useImperativeHandle as Ye, useMemo as Je, useEffect as Qe } from "react";
|
|
10
10
|
import "../config-provider/ConfigProvider.js";
|
|
11
11
|
import Ze from "../draggable/index.js";
|
|
12
12
|
import et from "../components/common/hooks/useMergeProps.js";
|
|
13
|
-
import
|
|
13
|
+
import ie from "../components/common/hooks/useMergeValue.js";
|
|
14
14
|
import tt from "../icon-hover/index.js";
|
|
15
15
|
import ot from "../input/InputElement.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
16
|
+
import nt from "../overflow-ellipsis/index.js";
|
|
17
|
+
import at from "../popover/index.js";
|
|
18
|
+
import rt from "../tag/index.js";
|
|
19
|
+
import _ from "@unicom-cloud/utils/class-name";
|
|
20
20
|
import { fillNBSP as st } from "../components/common/utils/fillNBSP.js";
|
|
21
21
|
import { getHotkeyHandler as lt } from "../components/common/utils/getHotkeyHandler.js";
|
|
22
22
|
import "../components/common/utils/is.js";
|
|
23
23
|
import { Backspace as ct } from "@unicom-cloud/utils/constant/keyboardCode";
|
|
24
24
|
import { omit as it } from "../components/common/utils/omit.js";
|
|
25
|
-
import { PqbCSSTransition as
|
|
25
|
+
import { PqbCSSTransition as ue } from "../components/common/utils/PqbCSSTransition.js";
|
|
26
26
|
import ut from "../config-provider/context.js";
|
|
27
|
-
import { isPlainObject as
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
...
|
|
32
|
-
label: "label" in
|
|
33
|
-
value:
|
|
34
|
-
closable:
|
|
27
|
+
import { isPlainObject as ge } from "@unicom-cloud/utils/is";
|
|
28
|
+
const O = 300, pt = "responsive", ft = `__input_${Math.random().toFixed(10).slice(2)}`, I = (r) => r == null, x = (r) => {
|
|
29
|
+
r.target.tagName !== "INPUT" && r.preventDefault();
|
|
30
|
+
}, pe = (r) => me(r) ? r.map((l) => ge(l) ? {
|
|
31
|
+
...l,
|
|
32
|
+
label: "label" in l ? l.label : l.value,
|
|
33
|
+
value: l.value,
|
|
34
|
+
closable: l.closable
|
|
35
35
|
} : {
|
|
36
|
-
label:
|
|
37
|
-
value:
|
|
38
|
-
}) : [], mt = (
|
|
39
|
-
const
|
|
36
|
+
label: l,
|
|
37
|
+
value: l
|
|
38
|
+
}) : [], mt = (r) => {
|
|
39
|
+
const l = $(0), m = $(r.length);
|
|
40
40
|
return Qe(() => {
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
},
|
|
44
|
-
prefixCls:
|
|
45
|
-
children:
|
|
46
|
-
animation:
|
|
47
|
-
}) => /* @__PURE__ */ i("div", { className: `${
|
|
41
|
+
l.current = r.length === 0 && m.current > 0 ? O : 0, m.current = r.length;
|
|
42
|
+
}, [r]), l;
|
|
43
|
+
}, fe = ({
|
|
44
|
+
prefixCls: r,
|
|
45
|
+
children: l,
|
|
46
|
+
animation: m
|
|
47
|
+
}) => /* @__PURE__ */ i("div", { className: `${r}-inner`, children: m ? /* @__PURE__ */ i(Ge, { component: null, children: l }) : l }), dt = {
|
|
48
48
|
animation: !0,
|
|
49
|
-
validate: (
|
|
49
|
+
validate: (r, l) => r && l.every((m) => m.value !== r)
|
|
50
50
|
};
|
|
51
|
-
function gt(
|
|
51
|
+
function gt(r, l) {
|
|
52
52
|
const {
|
|
53
|
-
getPrefixCls:
|
|
54
|
-
size:
|
|
55
|
-
componentConfig:
|
|
56
|
-
rtl:
|
|
57
|
-
} = qe(ut),
|
|
58
|
-
|
|
53
|
+
getPrefixCls: m,
|
|
54
|
+
size: he,
|
|
55
|
+
componentConfig: ve,
|
|
56
|
+
rtl: j
|
|
57
|
+
} = qe(ut), p = et(
|
|
58
|
+
r,
|
|
59
59
|
dt,
|
|
60
|
-
|
|
60
|
+
ve?.InputTag
|
|
61
61
|
), {
|
|
62
|
-
className:
|
|
63
|
-
style:
|
|
64
|
-
placeholder:
|
|
65
|
-
error:
|
|
66
|
-
disabled:
|
|
62
|
+
className: ye,
|
|
63
|
+
style: Ne,
|
|
64
|
+
placeholder: be,
|
|
65
|
+
error: Ce,
|
|
66
|
+
disabled: v,
|
|
67
67
|
readOnly: g,
|
|
68
|
-
allowClear:
|
|
69
|
-
autoFocus:
|
|
70
|
-
labelInValue:
|
|
71
|
-
disableInput:
|
|
72
|
-
animation:
|
|
73
|
-
saveOnBlur:
|
|
74
|
-
dragToSort:
|
|
75
|
-
icon:
|
|
76
|
-
prefix:
|
|
77
|
-
suffix:
|
|
78
|
-
addBefore:
|
|
79
|
-
addAfter:
|
|
80
|
-
tokenSeparators:
|
|
81
|
-
validate:
|
|
82
|
-
renderTag:
|
|
83
|
-
tagClassName:
|
|
68
|
+
allowClear: Ie,
|
|
69
|
+
autoFocus: $e,
|
|
70
|
+
labelInValue: Te,
|
|
71
|
+
disableInput: Pe,
|
|
72
|
+
animation: B,
|
|
73
|
+
saveOnBlur: we,
|
|
74
|
+
dragToSort: Ve,
|
|
75
|
+
icon: A,
|
|
76
|
+
prefix: H,
|
|
77
|
+
suffix: W,
|
|
78
|
+
addBefore: L,
|
|
79
|
+
addAfter: K,
|
|
80
|
+
tokenSeparators: E,
|
|
81
|
+
validate: T,
|
|
82
|
+
renderTag: U,
|
|
83
|
+
tagClassName: G,
|
|
84
84
|
maxTagCount: d,
|
|
85
|
-
onInputChange:
|
|
86
|
-
onKeyDown:
|
|
87
|
-
onPaste:
|
|
88
|
-
onChange:
|
|
89
|
-
onFocus:
|
|
90
|
-
onBlur:
|
|
91
|
-
onPressEnter:
|
|
92
|
-
onRemove:
|
|
93
|
-
onClear:
|
|
94
|
-
onClick:
|
|
95
|
-
...
|
|
96
|
-
} =
|
|
97
|
-
defaultValue: "defaultValue" in
|
|
98
|
-
value: "value" in
|
|
99
|
-
}), [
|
|
100
|
-
value:
|
|
101
|
-
}),
|
|
102
|
-
Ye(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}, se = (e, t, r) => {
|
|
113
|
-
L == null || L(e, t, r), $(
|
|
114
|
-
[...a.slice(0, t), ...a.slice(t + 1)],
|
|
85
|
+
onInputChange: De,
|
|
86
|
+
onKeyDown: Re,
|
|
87
|
+
onPaste: Se,
|
|
88
|
+
onChange: _e,
|
|
89
|
+
onFocus: xe,
|
|
90
|
+
onBlur: Ae,
|
|
91
|
+
onPressEnter: Ee,
|
|
92
|
+
onRemove: Me,
|
|
93
|
+
onClear: ke,
|
|
94
|
+
onClick: q,
|
|
95
|
+
...ze
|
|
96
|
+
} = p, o = m?.("input-tag"), P = "size" in p ? p.size : he, y = typeof d == "object" ? d.count : d, N = $(), M = $(null), k = $(), [w, X] = Xe(!1), [n, Fe] = ie([], {
|
|
97
|
+
defaultValue: "defaultValue" in p ? pe(p.defaultValue) : void 0,
|
|
98
|
+
value: "value" in p ? pe(p.value) : void 0
|
|
99
|
+
}), [b, V] = ie("", {
|
|
100
|
+
value: p.inputValue
|
|
101
|
+
}), Oe = mt(n), je = !!(Ve && !g && !v);
|
|
102
|
+
Ye(l, () => ({
|
|
103
|
+
blur: N.current?.blur,
|
|
104
|
+
focus: N.current?.focus,
|
|
105
|
+
getRootDOMNode: () => k.current
|
|
106
|
+
}), []);
|
|
107
|
+
const C = (e, t) => {
|
|
108
|
+
v || g || ("value" in p || Fe(e), _e?.(Te ? e : e.map((c) => c?.value), t));
|
|
109
|
+
}, Y = (e, t, c) => {
|
|
110
|
+
Me?.(e, t, c), C(
|
|
111
|
+
[...n.slice(0, t), ...n.slice(t + 1)],
|
|
115
112
|
"remove"
|
|
116
113
|
);
|
|
117
|
-
},
|
|
114
|
+
}, Be = lt(
|
|
118
115
|
/* @__PURE__ */ new Map([
|
|
119
116
|
[
|
|
120
117
|
ct.key,
|
|
121
118
|
(e) => {
|
|
122
|
-
if (!e.target.value &&
|
|
123
|
-
for (let t =
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
|
|
119
|
+
if (!e.target.value && n.length)
|
|
120
|
+
for (let t = n.length - 1; t >= 0; t--) {
|
|
121
|
+
const c = n[t];
|
|
122
|
+
if (c.closable !== !1) {
|
|
123
|
+
Y(c, t, e);
|
|
127
124
|
return;
|
|
128
125
|
}
|
|
129
126
|
}
|
|
130
127
|
}
|
|
131
128
|
]
|
|
132
129
|
])
|
|
133
|
-
),
|
|
130
|
+
), J = async () => {
|
|
134
131
|
try {
|
|
135
|
-
const e = typeof
|
|
136
|
-
e && (
|
|
137
|
-
|
|
138
|
-
value: e === !0 ?
|
|
139
|
-
label:
|
|
132
|
+
const e = typeof T == "function" ? await T(b, n) : !0;
|
|
133
|
+
e && (C(
|
|
134
|
+
n.concat({
|
|
135
|
+
value: e === !0 ? b : e,
|
|
136
|
+
label: b
|
|
140
137
|
}),
|
|
141
138
|
"add"
|
|
142
|
-
),
|
|
139
|
+
), V(""));
|
|
143
140
|
} catch (e) {
|
|
144
141
|
console.error(e);
|
|
145
142
|
}
|
|
146
|
-
},
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
const
|
|
150
|
-
|
|
143
|
+
}, Q = (e, t, c = !1) => {
|
|
144
|
+
const a = e.value;
|
|
145
|
+
let s = e.label, f = !g && !v && e.closable !== !1;
|
|
146
|
+
const u = typeof a == "object" ? t : a, h = (Le) => {
|
|
147
|
+
Y(e, t, Le);
|
|
151
148
|
};
|
|
152
|
-
if (!
|
|
153
|
-
return t ===
|
|
154
|
-
if (
|
|
149
|
+
if (!c && typeof y == "number" && t >= y)
|
|
150
|
+
return t === n.length - 1 ? (s = Z(n.length - Number(y)), f = !1, { valueKey: u, dom: s }) : { valueKey: u, dom: null };
|
|
151
|
+
if (U)
|
|
155
152
|
return {
|
|
156
|
-
valueKey:
|
|
157
|
-
dom:
|
|
153
|
+
valueKey: u,
|
|
154
|
+
dom: U(
|
|
158
155
|
{
|
|
159
|
-
value:
|
|
160
|
-
label:
|
|
161
|
-
closable:
|
|
162
|
-
onClose:
|
|
156
|
+
value: a,
|
|
157
|
+
label: s,
|
|
158
|
+
closable: f,
|
|
159
|
+
onClose: h
|
|
163
160
|
},
|
|
164
161
|
t,
|
|
165
|
-
|
|
162
|
+
n
|
|
166
163
|
)
|
|
167
164
|
};
|
|
168
|
-
const
|
|
169
|
-
closable:
|
|
170
|
-
onClose:
|
|
165
|
+
const We = {
|
|
166
|
+
closable: f,
|
|
167
|
+
onClose: h,
|
|
171
168
|
visible: !0,
|
|
172
|
-
children: st(
|
|
173
|
-
closeIcon:
|
|
169
|
+
children: st(s),
|
|
170
|
+
closeIcon: A?.removeIcon,
|
|
174
171
|
__closeIconProps: {
|
|
175
|
-
onMouseDown:
|
|
172
|
+
onMouseDown: x
|
|
176
173
|
},
|
|
177
|
-
className:
|
|
178
|
-
[
|
|
174
|
+
className: _(`${o}-tag`, {
|
|
175
|
+
[G]: G
|
|
179
176
|
}),
|
|
180
|
-
title: typeof
|
|
177
|
+
title: typeof s == "string" ? s : void 0
|
|
181
178
|
};
|
|
182
|
-
return { valueKey:
|
|
179
|
+
return { valueKey: u, dom: /* @__PURE__ */ i(rt, { ...We }, `${u}-tag`) };
|
|
183
180
|
};
|
|
184
|
-
function
|
|
185
|
-
const t = typeof d == "object" && d.render ? d.render : () => /* @__PURE__ */
|
|
181
|
+
function Z(e) {
|
|
182
|
+
const t = typeof d == "object" && d.render ? d.render : () => /* @__PURE__ */ S("span", { className: `${o}-tag-ellipsis`, children: [
|
|
186
183
|
"+",
|
|
187
184
|
e
|
|
188
|
-
] }),
|
|
185
|
+
] }), c = ge(d) && d.popoverProps;
|
|
189
186
|
return /* @__PURE__ */ i(
|
|
190
|
-
|
|
187
|
+
at,
|
|
191
188
|
{
|
|
192
|
-
content: /* @__PURE__ */ i(
|
|
193
|
-
({ tagValue:
|
|
194
|
-
var u;
|
|
195
|
-
return (u = ce(n, l, !0)) == null ? void 0 : u.dom;
|
|
196
|
-
}
|
|
189
|
+
content: /* @__PURE__ */ i(Ke, { children: n.map((a, s) => ({ tagValue: a, tagIndex: s })).slice(-e).map(
|
|
190
|
+
({ tagValue: a, tagIndex: s }) => Q(a, s, !0)?.dom
|
|
197
191
|
) }),
|
|
198
|
-
...
|
|
199
|
-
children: t(e,
|
|
192
|
+
...c || {},
|
|
193
|
+
children: t(e, n)
|
|
200
194
|
}
|
|
201
195
|
);
|
|
202
196
|
}
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
197
|
+
const ee = async (e) => {
|
|
198
|
+
if (M.current = null, me(E) && E.length) {
|
|
205
199
|
const t = e.split(
|
|
206
|
-
new RegExp(`[${
|
|
200
|
+
new RegExp(`[${E.join("")}]`)
|
|
207
201
|
);
|
|
208
202
|
if (t.length > 1) {
|
|
209
|
-
|
|
210
|
-
const
|
|
203
|
+
M.current = Date.now();
|
|
204
|
+
const c = [];
|
|
211
205
|
await Promise.all(
|
|
212
|
-
t.map(async (
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
value:
|
|
216
|
-
label:
|
|
206
|
+
t.map(async (a) => {
|
|
207
|
+
const s = a ? typeof T == "function" ? await T(a, n) : !0 : !1;
|
|
208
|
+
s && c.push({
|
|
209
|
+
value: s === !0 ? a : s,
|
|
210
|
+
label: a
|
|
217
211
|
});
|
|
218
212
|
})
|
|
219
|
-
),
|
|
213
|
+
), c.length && C(n.concat(c), "add");
|
|
220
214
|
}
|
|
221
215
|
}
|
|
222
|
-
},
|
|
216
|
+
}, te = Ie && !v && !g && n.length ? /* @__PURE__ */ i(
|
|
223
217
|
tt,
|
|
224
218
|
{
|
|
225
|
-
size:
|
|
219
|
+
size: P,
|
|
226
220
|
className: `${o}-clear-icon`,
|
|
227
221
|
onClick: (e) => {
|
|
228
|
-
|
|
229
|
-
e.stopPropagation(), $([], "clear"), P || (t = y.current) == null || t.focus(), B == null || B();
|
|
222
|
+
e.stopPropagation(), C([], "clear"), w || N.current?.focus(), ke?.();
|
|
230
223
|
},
|
|
231
|
-
children:
|
|
224
|
+
children: A && A.clearIcon || /* @__PURE__ */ i(Ue, {})
|
|
232
225
|
},
|
|
233
226
|
"clearIcon"
|
|
234
|
-
) : null,
|
|
227
|
+
) : null, oe = v || Pe, z = Je(() => {
|
|
235
228
|
const e = {};
|
|
236
|
-
return
|
|
237
|
-
const
|
|
238
|
-
e[
|
|
239
|
-
const { dom:
|
|
240
|
-
return
|
|
241
|
-
|
|
229
|
+
return n.map((c, a) => {
|
|
230
|
+
const s = e[c.value] || 0, f = s >= 1;
|
|
231
|
+
e[c.value] = s + 1;
|
|
232
|
+
const { dom: u, valueKey: h } = Q(c, a);
|
|
233
|
+
return de.isValidElement(u) ? /* @__PURE__ */ i(
|
|
234
|
+
ue,
|
|
242
235
|
{
|
|
243
|
-
timeout:
|
|
236
|
+
timeout: O,
|
|
244
237
|
classNames: "zoomIn",
|
|
245
|
-
children:
|
|
238
|
+
children: u
|
|
246
239
|
},
|
|
247
|
-
|
|
248
|
-
) :
|
|
240
|
+
f ? `${h}-${a}` : h
|
|
241
|
+
) : u;
|
|
249
242
|
});
|
|
250
|
-
}, [
|
|
243
|
+
}, [n]), F = [
|
|
251
244
|
/* @__PURE__ */ i(
|
|
252
|
-
|
|
245
|
+
ue,
|
|
253
246
|
{
|
|
254
|
-
timeout:
|
|
247
|
+
timeout: O,
|
|
255
248
|
classNames: "zoomIn",
|
|
256
249
|
children: /* @__PURE__ */ i(
|
|
257
250
|
ot,
|
|
258
251
|
{
|
|
259
252
|
autoComplete: "off",
|
|
260
|
-
size:
|
|
261
|
-
disabled:
|
|
253
|
+
size: P,
|
|
254
|
+
disabled: oe,
|
|
262
255
|
readOnly: g,
|
|
263
|
-
ref:
|
|
264
|
-
autoFocus:
|
|
265
|
-
placeholder:
|
|
256
|
+
ref: N,
|
|
257
|
+
autoFocus: $e,
|
|
258
|
+
placeholder: n.length ? "" : be,
|
|
266
259
|
prefixCls: `${o}-input`,
|
|
267
260
|
autoFitWidth: {
|
|
268
|
-
delay: () =>
|
|
261
|
+
delay: () => Oe.current,
|
|
269
262
|
pure: !0
|
|
270
263
|
},
|
|
271
264
|
onPressEnter: async (e) => {
|
|
272
|
-
|
|
265
|
+
b && e.preventDefault(), Ee?.(e), await J();
|
|
273
266
|
},
|
|
274
267
|
onFocus: (e) => {
|
|
275
|
-
!
|
|
268
|
+
!oe && !g && (X(!0), xe?.(e));
|
|
276
269
|
},
|
|
277
270
|
onBlur: async (e) => {
|
|
278
|
-
|
|
271
|
+
X(!1), Ae?.(e), we && await J(), V("");
|
|
279
272
|
},
|
|
280
|
-
value:
|
|
273
|
+
value: b,
|
|
281
274
|
onChange: (e, t) => {
|
|
282
|
-
|
|
275
|
+
De?.(e, t), t.nativeEvent.inputType !== "insertFromPaste" && ee(e), M.current ? V("") : V(e);
|
|
283
276
|
},
|
|
284
277
|
onKeyDown: (e) => {
|
|
285
|
-
|
|
278
|
+
Be(e), Re?.(e);
|
|
286
279
|
},
|
|
287
280
|
onPaste: (e) => {
|
|
288
|
-
|
|
281
|
+
Se?.(e), ee(e.clipboardData.getData("text"));
|
|
289
282
|
}
|
|
290
283
|
}
|
|
291
284
|
)
|
|
292
285
|
},
|
|
293
286
|
ft
|
|
294
287
|
)
|
|
295
|
-
],
|
|
296
|
-
[`${o}-size-${
|
|
297
|
-
[`${o}-disabled`]:
|
|
298
|
-
[`${o}-${
|
|
299
|
-
[`${o}-focus`]:
|
|
288
|
+
], He = !I(H), ne = !I(W) || !I(te), ae = !I(L), re = !I(K), D = ae || re, se = p.status || (Ce ? "error" : void 0), le = _(o, {
|
|
289
|
+
[`${o}-size-${P}`]: P,
|
|
290
|
+
[`${o}-disabled`]: v,
|
|
291
|
+
[`${o}-${se}`]: se,
|
|
292
|
+
[`${o}-focus`]: w,
|
|
300
293
|
[`${o}-readonly`]: g,
|
|
301
|
-
[`${o}-has-suffix`]:
|
|
302
|
-
[`${o}-has-placeholder`]: !
|
|
303
|
-
[`${o}-rtl`]:
|
|
304
|
-
}), R = { style:
|
|
294
|
+
[`${o}-has-suffix`]: ne,
|
|
295
|
+
[`${o}-has-placeholder`]: !n.length,
|
|
296
|
+
[`${o}-rtl`]: j
|
|
297
|
+
}), R = { style: Ne, className: ye }, ce = /* @__PURE__ */ i(
|
|
305
298
|
"div",
|
|
306
299
|
{
|
|
307
|
-
...it(
|
|
300
|
+
...it(ze, ["status", "size", "defaultValue", "value", "inputValue"]),
|
|
308
301
|
...D ? {} : R,
|
|
309
|
-
className: D ?
|
|
302
|
+
className: D ? le : _(le, R.className),
|
|
310
303
|
onMouseDown: (e) => {
|
|
311
|
-
|
|
304
|
+
w && x(e);
|
|
312
305
|
},
|
|
313
306
|
onClick: (e) => {
|
|
314
|
-
|
|
315
|
-
!P && ((t = y.current) == null || t.focus()), re && re(e);
|
|
307
|
+
!w && N.current?.focus(), q && q(e);
|
|
316
308
|
},
|
|
317
|
-
ref: D ? void 0 :
|
|
318
|
-
children: /* @__PURE__ */
|
|
319
|
-
|
|
309
|
+
ref: D ? void 0 : k,
|
|
310
|
+
children: /* @__PURE__ */ S("div", { className: `${o}-view`, children: [
|
|
311
|
+
He && /* @__PURE__ */ i("div", { className: `${o}-prefix`, onMouseDown: x, children: H }),
|
|
320
312
|
je ? /* @__PURE__ */ i(
|
|
321
|
-
|
|
313
|
+
fe,
|
|
322
314
|
{
|
|
323
315
|
prefixCls: o,
|
|
324
|
-
animation:
|
|
316
|
+
animation: B,
|
|
325
317
|
children: /* @__PURE__ */ i(
|
|
326
318
|
Ze,
|
|
327
319
|
{
|
|
328
320
|
itemWrapperStyle: { display: "inline-block" },
|
|
329
321
|
direction: "horizontal",
|
|
330
322
|
onIndexChange: (e, t) => {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
const
|
|
334
|
-
return
|
|
335
|
-
}(
|
|
323
|
+
C(function(a, s, f) {
|
|
324
|
+
a = a.slice();
|
|
325
|
+
const u = s > f, [h] = a.splice(s, 1);
|
|
326
|
+
return a.splice(u ? f : f - 1, 0, h), a;
|
|
327
|
+
}(n, t, e), "sort");
|
|
336
328
|
},
|
|
337
|
-
children:
|
|
329
|
+
children: z.concat(F)
|
|
338
330
|
}
|
|
339
331
|
)
|
|
340
332
|
},
|
|
341
333
|
"transitionGroupWithDrag"
|
|
342
334
|
) : /* @__PURE__ */ i(
|
|
343
|
-
|
|
335
|
+
fe,
|
|
344
336
|
{
|
|
345
337
|
prefixCls: o,
|
|
346
|
-
animation:
|
|
347
|
-
children:
|
|
348
|
-
|
|
338
|
+
animation: B,
|
|
339
|
+
children: y === pt ? /* @__PURE__ */ i(
|
|
340
|
+
nt,
|
|
349
341
|
{
|
|
350
|
-
items:
|
|
351
|
-
suffixItems:
|
|
352
|
-
ellipsisNode: ({ ellipsisCount: e }) =>
|
|
342
|
+
items: z,
|
|
343
|
+
suffixItems: F,
|
|
344
|
+
ellipsisNode: ({ ellipsisCount: e }) => Z(e)
|
|
353
345
|
}
|
|
354
|
-
) :
|
|
346
|
+
) : z.concat(F)
|
|
355
347
|
},
|
|
356
|
-
`max_tag_group_${
|
|
348
|
+
`max_tag_group_${y}`
|
|
357
349
|
),
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
350
|
+
ne && /* @__PURE__ */ S("div", { className: `${o}-suffix`, onMouseDown: x, children: [
|
|
351
|
+
te,
|
|
352
|
+
W
|
|
361
353
|
] })
|
|
362
354
|
] })
|
|
363
355
|
}
|
|
364
356
|
);
|
|
365
|
-
return D ? /* @__PURE__ */
|
|
357
|
+
return D ? /* @__PURE__ */ S(
|
|
366
358
|
"div",
|
|
367
359
|
{
|
|
368
360
|
...R,
|
|
369
|
-
className:
|
|
361
|
+
className: _(
|
|
370
362
|
`${o}-wrapper`,
|
|
371
363
|
{
|
|
372
|
-
[`${o}-wrapper-rtl`]:
|
|
364
|
+
[`${o}-wrapper-rtl`]: j
|
|
373
365
|
},
|
|
374
366
|
R.className
|
|
375
367
|
),
|
|
376
|
-
ref:
|
|
368
|
+
ref: k,
|
|
377
369
|
children: [
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
370
|
+
ae && /* @__PURE__ */ i("div", { className: `${o}-addbefore`, children: L }),
|
|
371
|
+
ce,
|
|
372
|
+
re && /* @__PURE__ */ i("div", { className: `${o}-addafter`, children: K })
|
|
381
373
|
]
|
|
382
374
|
}
|
|
383
|
-
) :
|
|
375
|
+
) : ce;
|
|
384
376
|
}
|
|
385
|
-
const
|
|
377
|
+
const ht = de.forwardRef(
|
|
386
378
|
gt
|
|
387
379
|
);
|
|
388
|
-
|
|
380
|
+
ht.displayName = "InputTag";
|
|
389
381
|
export {
|
|
390
|
-
|
|
382
|
+
ht as default
|
|
391
383
|
};
|
package/layout/Content.js
CHANGED
|
@@ -3,12 +3,12 @@ import { forwardRef as i, useContext as f } from "react";
|
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
4
|
import l from "@unicom-cloud/utils/class-name";
|
|
5
5
|
import p from "../config-provider/context.js";
|
|
6
|
-
function
|
|
7
|
-
const { className:
|
|
8
|
-
return /* @__PURE__ */ c("main", { ref:
|
|
6
|
+
function C(t, o) {
|
|
7
|
+
const { className: e, children: n, ...s } = t, { getPrefixCls: a } = f(p), r = a?.("layout-content"), m = l(r, e);
|
|
8
|
+
return /* @__PURE__ */ c("main", { ref: o, ...s, className: m, children: n });
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const u = i(C);
|
|
11
|
+
u.displayName = "LayoutContent";
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
u as default
|
|
14
14
|
};
|