@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/select-view/Core.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import We, { useRef as
|
|
1
|
+
import { jsx as t, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import We, { useRef as ae, useContext as qe, useState as ce, useEffect as Xe, useImperativeHandle as Je, useMemo as Qe, createElement as Ye } from "react";
|
|
3
3
|
import Ze from "@unicom-cloud/icons/IconUiClose";
|
|
4
4
|
import eo from "@unicom-cloud/icons/IconUiDown";
|
|
5
5
|
import oo from "@unicom-cloud/icons/IconUiLoading";
|
|
6
6
|
import no from "@unicom-cloud/icons/IconUiSearch";
|
|
7
7
|
import ro from "lodash/isFunction";
|
|
8
|
-
import
|
|
8
|
+
import le from "lodash/isUndefined";
|
|
9
9
|
import "../config-provider/ConfigProvider.js";
|
|
10
10
|
import to from "../components/common/hooks/useForceUpdate.js";
|
|
11
11
|
import so from "../components/common/hooks/usePersistCallback.js";
|
|
@@ -13,148 +13,147 @@ import ao from "../icon-hover/index.js";
|
|
|
13
13
|
import co from "../input-tag/InputTag.js";
|
|
14
14
|
import lo from "../input/InputElement.js";
|
|
15
15
|
import io from "../popover/index.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { fillNBSP as
|
|
16
|
+
import ie from "../tag/index.js";
|
|
17
|
+
import E from "@unicom-cloud/utils/class-name";
|
|
18
|
+
import { fillNBSP as ue } from "../components/common/utils/fillNBSP.js";
|
|
19
19
|
import { include as uo } from "../components/common/utils/include.js";
|
|
20
20
|
import "../components/common/utils/is.js";
|
|
21
|
-
import { Enter as
|
|
21
|
+
import { Enter as mo, Backspace as po } from "@unicom-cloud/utils/constant/keyboardCode";
|
|
22
22
|
import fo from "../config-provider/context.js";
|
|
23
|
-
import { isPlainObject as C, isNumber as
|
|
24
|
-
const
|
|
23
|
+
import { isPlainObject as C, isNumber as de } from "@unicom-cloud/utils/is";
|
|
24
|
+
const K = "__pqb_value_tag_placeholder", w = {
|
|
25
25
|
BEFORE: 0,
|
|
26
26
|
EDITING: 1,
|
|
27
27
|
NONE: 2
|
|
28
|
-
},
|
|
28
|
+
}, _o = We.forwardRef(function(x, me) {
|
|
29
29
|
const {
|
|
30
|
-
id:
|
|
31
|
-
style:
|
|
32
|
-
className:
|
|
33
|
-
size:
|
|
34
|
-
bordered:
|
|
35
|
-
allowClear:
|
|
36
|
-
allowCreate:
|
|
37
|
-
status:
|
|
38
|
-
loading:
|
|
30
|
+
id: pe,
|
|
31
|
+
style: fe,
|
|
32
|
+
className: he,
|
|
33
|
+
size: ge,
|
|
34
|
+
bordered: be,
|
|
35
|
+
allowClear: ve,
|
|
36
|
+
allowCreate: Ce,
|
|
37
|
+
status: xe,
|
|
38
|
+
loading: Ie,
|
|
39
39
|
disabled: g,
|
|
40
|
-
animation:
|
|
40
|
+
animation: we,
|
|
41
41
|
prefixCls: n,
|
|
42
|
-
suffixIcon:
|
|
43
|
-
arrowIcon:
|
|
44
|
-
removeIcon:
|
|
45
|
-
clearIcon:
|
|
46
|
-
placeholder:
|
|
47
|
-
renderText:
|
|
42
|
+
suffixIcon: G,
|
|
43
|
+
arrowIcon: W,
|
|
44
|
+
removeIcon: Ne,
|
|
45
|
+
clearIcon: D,
|
|
46
|
+
placeholder: q,
|
|
47
|
+
renderText: X,
|
|
48
48
|
value: b,
|
|
49
|
-
inputValue:
|
|
50
|
-
popupVisible:
|
|
49
|
+
inputValue: F,
|
|
50
|
+
popupVisible: p,
|
|
51
51
|
maxTagCount: c,
|
|
52
|
-
isMultiple:
|
|
52
|
+
isMultiple: I,
|
|
53
53
|
isEmptyValue: R,
|
|
54
|
-
prefix:
|
|
55
|
-
ariaControls:
|
|
56
|
-
renderTag:
|
|
57
|
-
dragToSort:
|
|
58
|
-
rtl:
|
|
59
|
-
htmlDataAttributes:
|
|
60
|
-
onKeyDown:
|
|
61
|
-
onChangeInputValue:
|
|
62
|
-
onPaste:
|
|
63
|
-
onClear:
|
|
64
|
-
onFocus:
|
|
65
|
-
onBlur:
|
|
66
|
-
onRemoveCheckedItem:
|
|
67
|
-
onSort:
|
|
68
|
-
...
|
|
69
|
-
} =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const o = p ? T.current : f.current;
|
|
54
|
+
prefix: O,
|
|
55
|
+
ariaControls: Te,
|
|
56
|
+
renderTag: M,
|
|
57
|
+
dragToSort: J,
|
|
58
|
+
rtl: $e,
|
|
59
|
+
htmlDataAttributes: ye,
|
|
60
|
+
onKeyDown: Se,
|
|
61
|
+
onChangeInputValue: Pe,
|
|
62
|
+
onPaste: ke,
|
|
63
|
+
onClear: Ee,
|
|
64
|
+
onFocus: De,
|
|
65
|
+
onBlur: Fe,
|
|
66
|
+
onRemoveCheckedItem: Re,
|
|
67
|
+
onSort: A,
|
|
68
|
+
...Oe
|
|
69
|
+
} = x, N = ae(null), f = ae(null), { size: Me, getPrefixCls: Q } = qe(fo), [Ae, Y] = ce(w.NONE), [B, Z] = ce(!1), Be = to(), T = "showSearch" in x ? x.showSearch : I, m = T || Ce, y = ge || Me, V = B || p, Ve = C(T) && T.retainInputValue, v = !I && b !== void 0 ? X(b).text : "", _ = (e) => {
|
|
70
|
+
e?.preventDefault?.();
|
|
71
|
+
}, U = (e) => {
|
|
72
|
+
const o = m ? N.current : f.current;
|
|
74
73
|
o && (e === "focus" ? o.focus() : o.blur());
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
if (
|
|
74
|
+
}, S = (e, o) => {
|
|
75
|
+
m && o.target === f.current || (e === "focus" ? (Z(!0), De?.(o)) : (Z(!1), Fe?.(o)));
|
|
76
|
+
}, ee = (e) => {
|
|
77
|
+
if (m && e.currentTarget === f.current)
|
|
79
78
|
return;
|
|
80
|
-
e.key ===
|
|
79
|
+
e.key === mo.key && e.preventDefault(), Se?.(e);
|
|
81
80
|
};
|
|
82
81
|
Xe(() => {
|
|
83
|
-
|
|
84
|
-
}, [
|
|
82
|
+
U(p ? "focus" : "blur"), m && Y(p ? w.BEFORE : w.NONE);
|
|
83
|
+
}, [p]), Je(me, () => ({
|
|
85
84
|
dom: f.current,
|
|
86
85
|
getRootDOMNode: () => f.current,
|
|
87
|
-
focus:
|
|
88
|
-
blur:
|
|
86
|
+
focus: U.bind(null, "focus"),
|
|
87
|
+
blur: U.bind(null, "blur"),
|
|
89
88
|
getWidth: () => f.current && f.current.clientWidth
|
|
90
89
|
}));
|
|
91
|
-
const
|
|
92
|
-
paste:
|
|
93
|
-
keyDown:
|
|
90
|
+
const _e = "arrowIcon" in x ? W === null ? null : /* @__PURE__ */ t("div", { className: `${n}-arrow-icon`, children: W }) : /* @__PURE__ */ t("div", { className: `${n}-arrow-icon`, children: /* @__PURE__ */ t(eo, {}) }), Ue = Ie ? /* @__PURE__ */ t("span", { className: `${n}-loading-icon`, children: /* @__PURE__ */ t(oo, {}) }) : G ? /* @__PURE__ */ t("span", { className: `${n}-suffix-icon`, children: G }) : x.showSearch && p ? /* @__PURE__ */ t("div", { className: `${n}-search-icon`, children: /* @__PURE__ */ t(no, {}) }) : _e, i = {
|
|
91
|
+
paste: ke,
|
|
92
|
+
keyDown: ee,
|
|
94
93
|
focus: (e) => {
|
|
95
|
-
e.stopPropagation(),
|
|
94
|
+
e.stopPropagation(), S("focus", e);
|
|
96
95
|
},
|
|
97
96
|
blur: (e) => {
|
|
98
|
-
e.stopPropagation(),
|
|
97
|
+
e.stopPropagation(), S("blur", e);
|
|
99
98
|
},
|
|
100
99
|
change: (e, o) => {
|
|
101
|
-
|
|
100
|
+
Y(w.EDITING), Pe?.(e, o);
|
|
102
101
|
}
|
|
103
102
|
}, ze = () => {
|
|
104
103
|
let e;
|
|
105
104
|
switch (Ae) {
|
|
106
|
-
case
|
|
107
|
-
e =
|
|
105
|
+
case w.BEFORE:
|
|
106
|
+
e = F || (Ve ? v : "");
|
|
108
107
|
break;
|
|
109
|
-
case
|
|
110
|
-
e =
|
|
108
|
+
case w.EDITING:
|
|
109
|
+
e = F || "";
|
|
111
110
|
break;
|
|
112
111
|
default:
|
|
113
|
-
e =
|
|
112
|
+
e = v;
|
|
114
113
|
break;
|
|
115
114
|
}
|
|
116
|
-
const o = !!(
|
|
115
|
+
const o = !!(V && m || R), s = {
|
|
117
116
|
style: { width: "100%" },
|
|
118
117
|
// _inputValue after renderText(value) may be rich text, but the value of <input> cannot be object
|
|
119
118
|
value: o && typeof e != "object" ? e : "",
|
|
120
119
|
// Allow placeholder to display the selected value first when searching
|
|
121
|
-
placeholder:
|
|
120
|
+
placeholder: m && v && typeof v != "object" ? v : q
|
|
122
121
|
};
|
|
123
|
-
return
|
|
122
|
+
return m ? (s.onPaste = i.paste, s.onKeyDown = i.keyDown, s.onFocus = i.focus, s.onBlur = i.blur, s.onChange = i.change) : (s.tabIndex = -1, s.style.pointerEvents = "none"), /* @__PURE__ */ k("span", { className: `${n}-view-selector`, children: [
|
|
124
123
|
/* @__PURE__ */ t(
|
|
125
124
|
lo,
|
|
126
125
|
{
|
|
127
126
|
"aria-hidden": !o || void 0,
|
|
128
|
-
ref:
|
|
127
|
+
ref: N,
|
|
129
128
|
disabled: g,
|
|
130
|
-
className:
|
|
129
|
+
className: E(`${n}-view-input`, {
|
|
131
130
|
[`${n}-hidden`]: !o
|
|
132
131
|
}),
|
|
133
132
|
autoComplete: "off",
|
|
134
133
|
...s
|
|
135
134
|
}
|
|
136
135
|
),
|
|
137
|
-
o ? /* @__PURE__ */ t("span", { className: `${n}-view-value-mirror`, children:
|
|
136
|
+
o ? /* @__PURE__ */ t("span", { className: `${n}-view-value-mirror`, children: ue(s.value ? e : s.placeholder) }) : null,
|
|
138
137
|
/* @__PURE__ */ t(
|
|
139
138
|
"span",
|
|
140
139
|
{
|
|
141
140
|
style: o ? { display: "none" } : {},
|
|
142
141
|
className: `${n}-view-value`,
|
|
143
|
-
children:
|
|
142
|
+
children: ue(R ? s.placeholder : e)
|
|
144
143
|
}
|
|
145
144
|
)
|
|
146
145
|
] });
|
|
147
|
-
},
|
|
148
|
-
const o =
|
|
146
|
+
}, z = so(X), oe = C(c) ? c.count : c, ne = (e) => {
|
|
147
|
+
const o = z(e);
|
|
149
148
|
return { value: e, label: o.text, closable: !o.disabled };
|
|
150
|
-
},
|
|
151
|
-
if (!
|
|
149
|
+
}, L = Qe(() => {
|
|
150
|
+
if (!I)
|
|
152
151
|
return [];
|
|
153
|
-
const e =
|
|
154
|
-
return (
|
|
155
|
-
}, [b,
|
|
156
|
-
const e = C(c) ? c.count : c, o = C(c) && c.showPopover, s =
|
|
157
|
-
|
|
152
|
+
const e = le(b) ? [] : [].concat(b);
|
|
153
|
+
return (de(oe) ? e.slice(0, oe) : e).map((P, h, te) => ne(P));
|
|
154
|
+
}, [b, I, c, z]), Le = () => {
|
|
155
|
+
const e = C(c) ? c.count : c, o = C(c) && c.showPopover, s = Q?.("input-tag"), P = (r) => C(c) && ro(c.render) ? c.render(r) : e === "responsive" ? /* @__PURE__ */ k(
|
|
156
|
+
ie,
|
|
158
157
|
{
|
|
159
158
|
className: `${s}-tag`,
|
|
160
159
|
children: [
|
|
@@ -163,69 +162,69 @@ const Q = "__pqb_value_tag_placeholder", I = {
|
|
|
163
162
|
"..."
|
|
164
163
|
]
|
|
165
164
|
},
|
|
166
|
-
|
|
167
|
-
) : `+${r}...`, h =
|
|
165
|
+
K
|
|
166
|
+
) : `+${r}...`, h = le(b) ? [] : [].concat(b), te = () => {
|
|
168
167
|
for (let r = h.length - 1; r >= 0; r--) {
|
|
169
168
|
const l = h[r];
|
|
170
|
-
if (!
|
|
169
|
+
if (!z(l).disabled)
|
|
171
170
|
return r;
|
|
172
171
|
}
|
|
173
172
|
return -1;
|
|
174
|
-
},
|
|
173
|
+
}, j = {
|
|
175
174
|
onPaste: i.paste,
|
|
176
175
|
onKeyDown: i.keyDown,
|
|
177
176
|
onFocus: i.focus,
|
|
178
177
|
onBlur: i.blur,
|
|
179
178
|
onInputChange: i.change,
|
|
180
179
|
onRemove: (r, l, u) => {
|
|
181
|
-
const
|
|
180
|
+
const $ = u.key;
|
|
182
181
|
let a = -1;
|
|
183
|
-
|
|
182
|
+
$ === po.key && (a = te()) !== -1 && (r = h[a], l = a), c && Be(), Re?.(r, l, u);
|
|
184
183
|
}
|
|
185
|
-
},
|
|
184
|
+
}, Ke = {
|
|
186
185
|
suffix: null,
|
|
187
186
|
prefix: null,
|
|
188
187
|
addBefore: null,
|
|
189
188
|
addAfter: null,
|
|
190
189
|
allowClear: !1,
|
|
191
190
|
labelInValue: !1
|
|
192
|
-
},
|
|
193
|
-
if (
|
|
191
|
+
}, se = (() => {
|
|
192
|
+
if (de(e)) {
|
|
194
193
|
const r = h.length - e;
|
|
195
194
|
if (r > 0) {
|
|
196
195
|
const l = {
|
|
197
|
-
label:
|
|
196
|
+
label: P(r),
|
|
198
197
|
closable: !1,
|
|
199
198
|
// InputTag needs to extract value as key
|
|
200
|
-
value:
|
|
199
|
+
value: K
|
|
201
200
|
};
|
|
202
201
|
if (o) {
|
|
203
202
|
const u = h.map((a, d) => ({ val: a, index: d })).slice(e).map((a) => {
|
|
204
|
-
const d =
|
|
205
|
-
return
|
|
203
|
+
const d = ne(a.val);
|
|
204
|
+
return M ? M(
|
|
206
205
|
{
|
|
207
206
|
...d,
|
|
208
|
-
onClose: (
|
|
209
|
-
|
|
207
|
+
onClose: (H) => {
|
|
208
|
+
j.onRemove(d.value, a.index, H);
|
|
210
209
|
}
|
|
211
210
|
},
|
|
212
211
|
a.index,
|
|
213
|
-
|
|
212
|
+
L.concat(l)
|
|
214
213
|
) : /* @__PURE__ */ Ye(
|
|
215
|
-
|
|
214
|
+
ie,
|
|
216
215
|
{
|
|
217
216
|
...d,
|
|
218
217
|
key: d.value,
|
|
219
218
|
className: `${s}-tag`,
|
|
220
|
-
onClose: (
|
|
219
|
+
onClose: (H) => j.onRemove(d.value, a.index, H)
|
|
221
220
|
},
|
|
222
221
|
d.label
|
|
223
222
|
);
|
|
224
|
-
}),
|
|
223
|
+
}), $ = C(o) ? o : {};
|
|
225
224
|
l.label = /* @__PURE__ */ t(
|
|
226
225
|
io,
|
|
227
226
|
{
|
|
228
|
-
|
|
227
|
+
...$,
|
|
229
228
|
content: !!u.length && /* @__PURE__ */ t(
|
|
230
229
|
"div",
|
|
231
230
|
{
|
|
@@ -242,70 +241,70 @@ const Q = "__pqb_value_tag_placeholder", I = {
|
|
|
242
241
|
return l;
|
|
243
242
|
}
|
|
244
243
|
}
|
|
245
|
-
})(),
|
|
244
|
+
})(), Ge = se ? L.concat(se) : L;
|
|
246
245
|
return /* @__PURE__ */ t(
|
|
247
246
|
co,
|
|
248
247
|
{
|
|
249
|
-
...
|
|
250
|
-
className:
|
|
251
|
-
ref:
|
|
248
|
+
...Ke,
|
|
249
|
+
className: V ? `${Q?.("input-tag")}-focus` : "",
|
|
250
|
+
ref: N,
|
|
252
251
|
disabled: g,
|
|
253
|
-
dragToSort:
|
|
254
|
-
disableInput:
|
|
255
|
-
animation:
|
|
256
|
-
placeholder:
|
|
257
|
-
value:
|
|
258
|
-
inputValue:
|
|
252
|
+
dragToSort: J,
|
|
253
|
+
disableInput: !T,
|
|
254
|
+
animation: we,
|
|
255
|
+
placeholder: q,
|
|
256
|
+
value: Ge,
|
|
257
|
+
inputValue: F,
|
|
259
258
|
size: y,
|
|
260
259
|
tagClassName: `${n}-tag`,
|
|
261
|
-
renderTag:
|
|
262
|
-
icon: { removeIcon:
|
|
260
|
+
renderTag: M,
|
|
261
|
+
icon: { removeIcon: Ne },
|
|
263
262
|
maxTagCount: e === "responsive" ? {
|
|
264
263
|
count: e,
|
|
265
|
-
render:
|
|
264
|
+
render: P,
|
|
266
265
|
popoverProps: C(o) ? o : o ? {} : { disabled: !0 }
|
|
267
266
|
} : void 0,
|
|
268
267
|
onChange: (r, l) => {
|
|
269
|
-
if (
|
|
268
|
+
if (A && l === "sort") {
|
|
270
269
|
const u = r.indexOf(
|
|
271
|
-
|
|
270
|
+
K
|
|
272
271
|
);
|
|
273
272
|
if (u > -1) {
|
|
274
|
-
const
|
|
273
|
+
const $ = r.slice(0, u), a = r.slice(u + 1), d = h.slice(
|
|
275
274
|
r.length - 1 - h.length
|
|
276
275
|
);
|
|
277
|
-
|
|
276
|
+
A($.concat(d, a));
|
|
278
277
|
} else
|
|
279
|
-
|
|
278
|
+
A(r);
|
|
280
279
|
}
|
|
281
280
|
},
|
|
282
|
-
...
|
|
281
|
+
...j
|
|
283
282
|
}
|
|
284
283
|
);
|
|
285
|
-
},
|
|
284
|
+
}, re = xe || (x.error ? "error" : void 0), je = !g && !R && ve ? /* @__PURE__ */ t(
|
|
286
285
|
ao,
|
|
287
286
|
{
|
|
288
287
|
size: y,
|
|
289
288
|
className: `${n}-clear-icon`,
|
|
290
|
-
onClick:
|
|
291
|
-
onMouseDown:
|
|
292
|
-
children:
|
|
289
|
+
onClick: Ee,
|
|
290
|
+
onMouseDown: _,
|
|
291
|
+
children: D ?? /* @__PURE__ */ t(Ze, {})
|
|
293
292
|
},
|
|
294
293
|
"clearIcon"
|
|
295
|
-
) : null, He =
|
|
294
|
+
) : null, He = E(
|
|
296
295
|
n,
|
|
297
|
-
`${n}-${
|
|
296
|
+
`${n}-${I ? "multiple" : "single"}`,
|
|
298
297
|
{
|
|
299
|
-
[`${n}-show-search`]:
|
|
300
|
-
[`${n}-open`]:
|
|
298
|
+
[`${n}-show-search`]: T,
|
|
299
|
+
[`${n}-open`]: p,
|
|
301
300
|
[`${n}-size-${y}`]: y,
|
|
302
|
-
[`${n}-focused`]:
|
|
303
|
-
[`${n}-${
|
|
301
|
+
[`${n}-focused`]: V,
|
|
302
|
+
[`${n}-${re}`]: re,
|
|
304
303
|
[`${n}-disabled`]: g,
|
|
305
|
-
[`${n}-no-border`]: !
|
|
306
|
-
[`${n}-rtl`]:
|
|
304
|
+
[`${n}-no-border`]: !be,
|
|
305
|
+
[`${n}-rtl`]: $e
|
|
307
306
|
},
|
|
308
|
-
|
|
307
|
+
he
|
|
309
308
|
);
|
|
310
309
|
return /* @__PURE__ */ t(
|
|
311
310
|
"div",
|
|
@@ -313,49 +312,49 @@ const Q = "__pqb_value_tag_placeholder", I = {
|
|
|
313
312
|
role: "combobox",
|
|
314
313
|
"aria-haspopup": "listbox",
|
|
315
314
|
"aria-autocomplete": "list",
|
|
316
|
-
"aria-expanded":
|
|
315
|
+
"aria-expanded": p,
|
|
317
316
|
"aria-disabled": g,
|
|
318
|
-
"aria-controls":
|
|
319
|
-
...uo(
|
|
320
|
-
...
|
|
317
|
+
"aria-controls": Te,
|
|
318
|
+
...uo(Oe, ["onClick", "onMouseEnter", "onMouseLeave"]),
|
|
319
|
+
...ye,
|
|
321
320
|
ref: f,
|
|
322
321
|
tabIndex: g ? -1 : 0,
|
|
323
|
-
id:
|
|
324
|
-
style:
|
|
322
|
+
id: pe,
|
|
323
|
+
style: fe,
|
|
325
324
|
className: He,
|
|
326
|
-
onKeyDown:
|
|
325
|
+
onKeyDown: ee,
|
|
327
326
|
onFocus: (e) => {
|
|
328
|
-
!g && !
|
|
327
|
+
!g && !J && (m ? N.current && N.current.focus() : S("focus", e));
|
|
329
328
|
},
|
|
330
|
-
onBlur: (e) =>
|
|
331
|
-
children: /* @__PURE__ */
|
|
329
|
+
onBlur: (e) => S("blur", e),
|
|
330
|
+
children: /* @__PURE__ */ k(
|
|
332
331
|
"div",
|
|
333
332
|
{
|
|
334
|
-
title: typeof
|
|
335
|
-
className:
|
|
336
|
-
[`${n}-view-with-prefix`]:
|
|
333
|
+
title: typeof v == "string" ? v : void 0,
|
|
334
|
+
className: E(`${n}-view`, {
|
|
335
|
+
[`${n}-view-with-prefix`]: O
|
|
337
336
|
}),
|
|
338
|
-
onClick: (e) =>
|
|
337
|
+
onClick: (e) => p && m && e.stopPropagation(),
|
|
339
338
|
children: [
|
|
340
|
-
|
|
339
|
+
O && /* @__PURE__ */ t(
|
|
341
340
|
"div",
|
|
342
341
|
{
|
|
343
342
|
"aria-hidden": "true",
|
|
344
|
-
className:
|
|
345
|
-
onMouseDown: (e) =>
|
|
346
|
-
children:
|
|
343
|
+
className: E(`${n}-prefix`),
|
|
344
|
+
onMouseDown: (e) => B && _(e),
|
|
345
|
+
children: O
|
|
347
346
|
}
|
|
348
347
|
),
|
|
349
|
-
|
|
350
|
-
/* @__PURE__ */
|
|
348
|
+
I ? Le() : ze(),
|
|
349
|
+
/* @__PURE__ */ k(
|
|
351
350
|
"div",
|
|
352
351
|
{
|
|
353
352
|
"aria-hidden": "true",
|
|
354
353
|
className: `${n}-suffix`,
|
|
355
|
-
onMouseDown: (e) =>
|
|
354
|
+
onMouseDown: (e) => B && _(e),
|
|
356
355
|
children: [
|
|
357
356
|
je,
|
|
358
|
-
|
|
357
|
+
Ue
|
|
359
358
|
]
|
|
360
359
|
}
|
|
361
360
|
)
|
|
@@ -366,5 +365,5 @@ const Q = "__pqb_value_tag_placeholder", I = {
|
|
|
366
365
|
);
|
|
367
366
|
});
|
|
368
367
|
export {
|
|
369
|
-
|
|
368
|
+
_o as default
|
|
370
369
|
};
|
package/skeleton/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import k from "lodash/isPlainObject";
|
|
3
3
|
import S, { forwardRef as j, useContext as v } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
5
|
import b from "../components/common/hooks/useMergeProps.js";
|
|
@@ -8,43 +8,43 @@ import { pickDataAttributes as R } from "../components/common/utils/pick.js";
|
|
|
8
8
|
import w from "./Image.js";
|
|
9
9
|
import A from "./Text.js";
|
|
10
10
|
import D from "../config-provider/context.js";
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function a(o) {
|
|
12
|
+
return k(o) ? o : {};
|
|
13
13
|
}
|
|
14
14
|
const F = {
|
|
15
15
|
text: !0,
|
|
16
16
|
loading: !0
|
|
17
17
|
};
|
|
18
|
-
function I(o,
|
|
19
|
-
const { getPrefixCls:
|
|
18
|
+
function I(o, c) {
|
|
19
|
+
const { getPrefixCls: l, componentConfig: p, rtl: f } = v(D), n = b(
|
|
20
20
|
o,
|
|
21
21
|
F,
|
|
22
|
-
|
|
23
|
-
), { style:
|
|
22
|
+
p?.Skeleton
|
|
23
|
+
), { style: d, className: g, animation: u, loading: x, image: i, text: s, children: h } = n, r = a(i), C = a(s), t = l?.("skeleton"), N = y(
|
|
24
24
|
t,
|
|
25
25
|
{
|
|
26
|
-
[`${t}-animate`]:
|
|
27
|
-
[`${t}-rtl`]:
|
|
26
|
+
[`${t}-animate`]: u,
|
|
27
|
+
[`${t}-rtl`]: f
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
g
|
|
30
30
|
);
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function m() {
|
|
32
|
+
return i && /* @__PURE__ */ e("div", { className: `${t}-header`, children: /* @__PURE__ */ e(w, { prefixCls: t, ...r }) });
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
34
|
+
function P() {
|
|
35
|
+
return s && /* @__PURE__ */ e("div", { className: `${t}-content`, children: /* @__PURE__ */ e(A, { prefixCls: t, ...C }) });
|
|
36
36
|
}
|
|
37
|
-
return /* @__PURE__ */ e(S.Fragment, { children: x ? /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ e(S.Fragment, { children: x ? /* @__PURE__ */ $(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
|
-
...R(
|
|
41
|
-
className:
|
|
42
|
-
style:
|
|
43
|
-
ref:
|
|
40
|
+
...R(n),
|
|
41
|
+
className: N,
|
|
42
|
+
style: d,
|
|
43
|
+
ref: c,
|
|
44
44
|
children: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
r.position !== "right" && m(),
|
|
46
|
+
P(),
|
|
47
|
+
r.position === "right" && m()
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
) : h });
|