@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/slider/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as v, jsxs as
|
|
1
|
+
import { jsx as v, jsxs as te } from "react/jsx-runtime";
|
|
2
2
|
import { div as Fe, plus as Je, times as qe } from "@unicom-cloud/utils/math";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import ne from "lodash/isArray";
|
|
4
|
+
import oe from "lodash/isFunction";
|
|
5
|
+
import re from "lodash/isPlainObject";
|
|
6
6
|
import ze, { forwardRef as Ge, useContext as He, useRef as V, useMemo as Ke } from "react";
|
|
7
7
|
import "../config-provider/ConfigProvider.js";
|
|
8
8
|
import Qe from "../components/common/hooks/useMergeProps.js";
|
|
9
9
|
import We from "../components/common/hooks/useMergeValue.js";
|
|
10
10
|
import Ze from "../components/common/hooks/useUpdateEffect.js";
|
|
11
|
-
import
|
|
12
|
-
import { on as
|
|
11
|
+
import ae from "@unicom-cloud/utils/class-name";
|
|
12
|
+
import { on as ie, off as se } from "../components/common/utils/dom.js";
|
|
13
13
|
import { omit as _e } from "../components/common/utils/omit.js";
|
|
14
14
|
import et from "./Button.js";
|
|
15
15
|
import tt from "./Dot.js";
|
|
@@ -18,83 +18,83 @@ import ot from "./Mark.js";
|
|
|
18
18
|
import rt from "./Tick.js";
|
|
19
19
|
import at from "./hook/useInterval.js";
|
|
20
20
|
import it from "./hook/useLegalValue.js";
|
|
21
|
-
import { needSort as st, sortNumberArray as
|
|
21
|
+
import { needSort as st, sortNumberArray as le, getIntervalOffset as E, formatPercent as y, findNearestIndex as lt } from "./util.js";
|
|
22
22
|
import ut from "../config-provider/context.js";
|
|
23
23
|
const ct = {
|
|
24
24
|
max: 100,
|
|
25
25
|
min: 0,
|
|
26
26
|
step: 1
|
|
27
27
|
};
|
|
28
|
-
function ft(
|
|
29
|
-
const { getPrefixCls:
|
|
30
|
-
|
|
28
|
+
function ft(ce, fe) {
|
|
29
|
+
const { getPrefixCls: me, componentConfig: pe, rtl: L } = He(ut), l = Qe(
|
|
30
|
+
ce,
|
|
31
31
|
ct,
|
|
32
|
-
|
|
32
|
+
pe?.Slider
|
|
33
33
|
), {
|
|
34
34
|
className: ge,
|
|
35
35
|
style: de,
|
|
36
36
|
tooltipVisible: ve,
|
|
37
37
|
tooltipPosition: he,
|
|
38
|
-
disabled:
|
|
38
|
+
disabled: C,
|
|
39
39
|
min: f,
|
|
40
|
-
max:
|
|
41
|
-
range:
|
|
42
|
-
step:
|
|
40
|
+
max: w,
|
|
41
|
+
range: I,
|
|
42
|
+
step: P,
|
|
43
43
|
showTicks: Ve,
|
|
44
|
-
marks:
|
|
45
|
-
onlyMarkValue:
|
|
44
|
+
marks: R,
|
|
45
|
+
onlyMarkValue: j,
|
|
46
46
|
vertical: u,
|
|
47
47
|
showInput: m,
|
|
48
|
-
reverse:
|
|
49
|
-
getIntervalConfig:
|
|
50
|
-
...
|
|
51
|
-
} = l, p = !!
|
|
48
|
+
reverse: U,
|
|
49
|
+
getIntervalConfig: Ce,
|
|
50
|
+
...we
|
|
51
|
+
} = l, p = !!I, Me = re(I) ? { ...I } : { draggableBar: !1 }, s = L ? !U : U, { intervalConfigs: g, markList: X } = at({
|
|
52
52
|
min: f,
|
|
53
|
-
max:
|
|
54
|
-
step:
|
|
55
|
-
marks:
|
|
56
|
-
getIntervalConfig:
|
|
57
|
-
}), { getLegalValue: b, getLegalRangeValue:
|
|
53
|
+
max: w,
|
|
54
|
+
step: P,
|
|
55
|
+
marks: R,
|
|
56
|
+
getIntervalConfig: Ce
|
|
57
|
+
}), { getLegalValue: b, getLegalRangeValue: N, isLegalValue: be, getNextMarkValue: xe } = it({
|
|
58
58
|
isRange: p,
|
|
59
59
|
min: f,
|
|
60
|
-
max:
|
|
61
|
-
onlyMarkValue:
|
|
62
|
-
step:
|
|
60
|
+
max: w,
|
|
61
|
+
onlyMarkValue: j,
|
|
62
|
+
step: P,
|
|
63
63
|
intervalConfigs: g,
|
|
64
|
-
marks:
|
|
65
|
-
}), [
|
|
64
|
+
marks: R
|
|
65
|
+
}), [k, ye] = We(
|
|
66
66
|
p ? [f, f] : f,
|
|
67
67
|
{
|
|
68
68
|
defaultValue: l.defaultValue,
|
|
69
69
|
value: l.value
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
|
-
let o =
|
|
73
|
-
const
|
|
72
|
+
let o = N(k);
|
|
73
|
+
const B = V(o), O = V(st(o));
|
|
74
74
|
Ze(() => {
|
|
75
|
-
|
|
76
|
-
}, [
|
|
77
|
-
const
|
|
75
|
+
B.current = N(k);
|
|
76
|
+
}, [k, N]), O.current && (o = le(o));
|
|
77
|
+
const S = o[o.length - 1], T = o[0], $ = m && !j && (!p || o.length < 3), Ie = Ke(() => $ && (ne(m) || re(m)) ? ne(m) ? [...m] : [{ ...m }, { ...m }] : [], [$, m]), a = me?.("slider"), Y = V(null), F = V({
|
|
78
78
|
left: 0,
|
|
79
79
|
height: 0,
|
|
80
80
|
top: 0,
|
|
81
81
|
width: 0
|
|
82
|
-
}),
|
|
83
|
-
function
|
|
84
|
-
const e =
|
|
82
|
+
}), J = V(!1), q = V(0);
|
|
83
|
+
function z(t) {
|
|
84
|
+
const e = le(t);
|
|
85
85
|
return p ? e : e[e.length - 1];
|
|
86
86
|
}
|
|
87
87
|
function Pe(t) {
|
|
88
88
|
const e = t.map((n) => b(n));
|
|
89
|
-
return
|
|
89
|
+
return B.current = e, e;
|
|
90
90
|
}
|
|
91
91
|
function h(t, e) {
|
|
92
|
-
const n = Pe(t), r =
|
|
93
|
-
|
|
92
|
+
const n = Pe(t), r = z(n);
|
|
93
|
+
ye(r), e === "inputValueChange" ? O.current = n.some((i, d) => i > n[d]) : O.current = !1, oe(l.onChange) && l.onChange(r);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
if (
|
|
97
|
-
const t =
|
|
95
|
+
function x() {
|
|
96
|
+
if (oe(l.onAfterChange)) {
|
|
97
|
+
const t = z(B.current);
|
|
98
98
|
l.onAfterChange(t);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -102,26 +102,26 @@ function ft(me, pe) {
|
|
|
102
102
|
let [e, n] = [o[0], o[o.length - 1]];
|
|
103
103
|
return e > n && ([e, n] = [n, e]), p ? t >= e && t <= n : t <= n;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const { left: n, top: r, width: i, height: d } =
|
|
107
|
-
let c = i,
|
|
108
|
-
if (u && (c = d,
|
|
105
|
+
function A(t, e) {
|
|
106
|
+
const { left: n, top: r, width: i, height: d } = F.current;
|
|
107
|
+
let c = i, Q = s ? n + i - t : t - n;
|
|
108
|
+
if (u && (c = d, Q = s ? e - r : r + d - e), c <= 0)
|
|
109
109
|
return 0;
|
|
110
|
-
let M = Math.max(Fe(
|
|
110
|
+
let M = Math.max(Fe(Q, c), 0);
|
|
111
111
|
M = Math.min(1, M);
|
|
112
|
-
const De = g.find((
|
|
113
|
-
begin:
|
|
114
|
-
beginOffset:
|
|
115
|
-
step:
|
|
112
|
+
const De = g.find((ee) => M >= ee.beginOffset && M <= ee.endOffset), {
|
|
113
|
+
begin: W,
|
|
114
|
+
beginOffset: Z,
|
|
115
|
+
step: _,
|
|
116
116
|
endOffset: Ee,
|
|
117
117
|
end: Le
|
|
118
|
-
} = De, je = M -
|
|
119
|
-
return Je(
|
|
118
|
+
} = De, je = M - Z, Ue = Ee - Z, Xe = je / Ue * (Le - W), Ye = Math.round(Xe / _);
|
|
119
|
+
return Je(W, qe(Ye, _));
|
|
120
120
|
}
|
|
121
121
|
function Ne(t) {
|
|
122
122
|
let [e, n] = t;
|
|
123
123
|
e > n && ([e, n] = [n, e]);
|
|
124
|
-
const r =
|
|
124
|
+
const r = y(e), i = y(1 - n);
|
|
125
125
|
return u ? {
|
|
126
126
|
[s ? "top" : "bottom"]: r,
|
|
127
127
|
[s ? "bottom" : "top"]: i
|
|
@@ -131,7 +131,7 @@ function ft(me, pe) {
|
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
function ke(t) {
|
|
134
|
-
return u ? { [s ? "top" : "bottom"]:
|
|
134
|
+
return u ? { [s ? "top" : "bottom"]: y(t) } : { [s ? "right" : "left"]: y(t) };
|
|
135
135
|
}
|
|
136
136
|
function Be() {
|
|
137
137
|
const t = {
|
|
@@ -140,48 +140,48 @@ function ft(me, pe) {
|
|
|
140
140
|
};
|
|
141
141
|
return "tooltipPosition" in l && (t.tooltipPosition = he), "tooltipVisible" in l && (t.tooltipVisible = ve), t;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
|
|
143
|
+
function G() {
|
|
144
|
+
F.current = Y.current.getBoundingClientRect();
|
|
145
145
|
}
|
|
146
146
|
function Oe(t) {
|
|
147
|
-
|
|
148
|
-
const e =
|
|
149
|
-
Me.draggableBar && Re(e) ? (
|
|
147
|
+
G();
|
|
148
|
+
const e = A(t.clientX, t.clientY);
|
|
149
|
+
Me.draggableBar && Re(e) ? (q.current = b(e), ie(window, "mousemove", H), ie(window, "mouseup", K)) : D(e);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
if (
|
|
151
|
+
function D(t) {
|
|
152
|
+
if (C)
|
|
153
153
|
return;
|
|
154
154
|
const e = b(t), [n, r] = lt(e, o), i = o[n], d = o[r], c = o.slice(0);
|
|
155
|
-
p && d - e > e - i ? (c[n] = e, h(c, "jumpToClick")) : (c[r] = e, h(c, "jumpToClick")),
|
|
155
|
+
p && d - e > e - i ? (c[n] = e, h(c, "jumpToClick")) : (c[r] = e, h(c, "jumpToClick")), x();
|
|
156
156
|
}
|
|
157
157
|
function Se(t) {
|
|
158
|
-
h(t, "inputValueChange"),
|
|
158
|
+
h(t, "inputValueChange"), x();
|
|
159
159
|
}
|
|
160
160
|
function Te(t, e, n) {
|
|
161
|
-
|
|
161
|
+
J.current = !0;
|
|
162
162
|
const r = o.slice(0);
|
|
163
|
-
r[n] =
|
|
163
|
+
r[n] = A(t, e), h(r, "mousemove");
|
|
164
164
|
}
|
|
165
165
|
function $e() {
|
|
166
|
-
|
|
166
|
+
J.current = !1, x();
|
|
167
167
|
}
|
|
168
168
|
function Ae(t, e) {
|
|
169
|
-
if (
|
|
169
|
+
if (C)
|
|
170
170
|
return;
|
|
171
171
|
const n = o.slice(0);
|
|
172
|
-
n[e] =
|
|
172
|
+
n[e] = xe(o[e], t), h(n);
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
const n = b(
|
|
174
|
+
function H(t) {
|
|
175
|
+
const n = b(A(t.clientX, t.clientY)) - q.current, r = o.map((i) => i + n);
|
|
176
176
|
r.every((i, d, c) => be(i)) && h(r, "mousemove");
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
|
|
178
|
+
function K() {
|
|
179
|
+
se(window, "mousemove", H), se(window, "mouseup", K), x();
|
|
180
180
|
}
|
|
181
181
|
return /* @__PURE__ */ v(
|
|
182
182
|
"div",
|
|
183
183
|
{
|
|
184
|
-
..._e(
|
|
184
|
+
..._e(we, [
|
|
185
185
|
"defaultValue",
|
|
186
186
|
"value",
|
|
187
187
|
"onChange",
|
|
@@ -189,25 +189,25 @@ function ft(me, pe) {
|
|
|
189
189
|
"formatTooltip",
|
|
190
190
|
"onAfterChange"
|
|
191
191
|
]),
|
|
192
|
-
className:
|
|
192
|
+
className: ae(
|
|
193
193
|
a,
|
|
194
194
|
{
|
|
195
195
|
[`${a}-vertical`]: u,
|
|
196
|
-
[`${a}-with-marks`]:
|
|
196
|
+
[`${a}-with-marks`]: R,
|
|
197
197
|
[`${a}-reverse`]: s,
|
|
198
|
-
[`${a}-rtl`]:
|
|
198
|
+
[`${a}-rtl`]: L
|
|
199
199
|
},
|
|
200
200
|
ge
|
|
201
201
|
),
|
|
202
202
|
style: de,
|
|
203
|
-
ref:
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */
|
|
203
|
+
ref: fe,
|
|
204
|
+
children: /* @__PURE__ */ te("div", { className: `${a}-wrapper`, children: [
|
|
205
|
+
/* @__PURE__ */ te(
|
|
206
206
|
"div",
|
|
207
207
|
{
|
|
208
|
-
ref:
|
|
209
|
-
className:
|
|
210
|
-
[`${a}-road-disabled`]:
|
|
208
|
+
ref: Y,
|
|
209
|
+
className: ae(`${a}-road`, {
|
|
210
|
+
[`${a}-road-disabled`]: C,
|
|
211
211
|
[`${a}-road-vertical`]: u
|
|
212
212
|
}),
|
|
213
213
|
onMouseDown: Oe,
|
|
@@ -217,8 +217,8 @@ function ft(me, pe) {
|
|
|
217
217
|
{
|
|
218
218
|
className: `${a}-bar`,
|
|
219
219
|
style: Ne([
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
E(T, g),
|
|
221
|
+
E(S, g)
|
|
222
222
|
])
|
|
223
223
|
}
|
|
224
224
|
),
|
|
@@ -227,8 +227,8 @@ function ft(me, pe) {
|
|
|
227
227
|
{
|
|
228
228
|
intervalConfigs: g,
|
|
229
229
|
min: f,
|
|
230
|
-
max:
|
|
231
|
-
valueRange: [
|
|
230
|
+
max: w,
|
|
231
|
+
valueRange: [T, S],
|
|
232
232
|
prefixCls: a,
|
|
233
233
|
vertical: u,
|
|
234
234
|
reverse: s
|
|
@@ -237,38 +237,38 @@ function ft(me, pe) {
|
|
|
237
237
|
/* @__PURE__ */ v(
|
|
238
238
|
tt,
|
|
239
239
|
{
|
|
240
|
-
data:
|
|
240
|
+
data: X,
|
|
241
241
|
intervalConfigs: g,
|
|
242
|
-
valueRange: [
|
|
242
|
+
valueRange: [T, S],
|
|
243
243
|
vertical: u,
|
|
244
244
|
prefixCls: a,
|
|
245
245
|
reverse: s,
|
|
246
|
-
onMouseDown:
|
|
246
|
+
onMouseDown: D
|
|
247
247
|
}
|
|
248
248
|
),
|
|
249
249
|
/* @__PURE__ */ v(
|
|
250
250
|
ot,
|
|
251
251
|
{
|
|
252
|
-
data:
|
|
252
|
+
data: X,
|
|
253
253
|
intervalConfigs: g,
|
|
254
254
|
vertical: u,
|
|
255
255
|
prefixCls: a,
|
|
256
256
|
reverse: s,
|
|
257
|
-
onMouseDown:
|
|
257
|
+
onMouseDown: D
|
|
258
258
|
}
|
|
259
259
|
),
|
|
260
260
|
o.map((t, e) => !p && e !== o.length - 1 ? null : /* @__PURE__ */ v(
|
|
261
261
|
et,
|
|
262
262
|
{
|
|
263
|
-
style: ke(
|
|
264
|
-
disabled:
|
|
263
|
+
style: ke(E(t, g)),
|
|
264
|
+
disabled: C,
|
|
265
265
|
prefixCls: a,
|
|
266
266
|
value: t,
|
|
267
|
-
maxValue:
|
|
267
|
+
maxValue: w,
|
|
268
268
|
minValue: f,
|
|
269
269
|
vertical: u,
|
|
270
270
|
...Be(),
|
|
271
|
-
onMoveBegin:
|
|
271
|
+
onMoveBegin: G,
|
|
272
272
|
onMoving: (n, r) => Te(n, r, e),
|
|
273
273
|
onMoveEnd: $e,
|
|
274
274
|
onArrowEvent: (n) => Ae(n, e)
|
|
@@ -278,27 +278,27 @@ function ft(me, pe) {
|
|
|
278
278
|
]
|
|
279
279
|
}
|
|
280
280
|
),
|
|
281
|
-
|
|
281
|
+
$ && /* @__PURE__ */ v(
|
|
282
282
|
nt,
|
|
283
283
|
{
|
|
284
284
|
min: f,
|
|
285
|
-
max:
|
|
286
|
-
step:
|
|
285
|
+
max: w,
|
|
286
|
+
step: P,
|
|
287
287
|
value: o,
|
|
288
288
|
range: p,
|
|
289
|
-
disabled:
|
|
289
|
+
disabled: C,
|
|
290
290
|
prefixCls: a,
|
|
291
291
|
onChange: Se,
|
|
292
|
-
extra:
|
|
292
|
+
extra: Ie
|
|
293
293
|
}
|
|
294
294
|
)
|
|
295
295
|
] })
|
|
296
296
|
}
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
const $t = ze.memo(
|
|
299
|
+
const ue = Ge(ft);
|
|
300
|
+
ue.displayName = "Slider";
|
|
301
|
+
const $t = ze.memo(ue);
|
|
302
302
|
export {
|
|
303
303
|
$t as default
|
|
304
304
|
};
|
package/space/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
2
|
+
import { forwardRef as g, useContext as x } from "react";
|
|
3
|
+
import C from "../components/common/space/index.js";
|
|
4
4
|
import { SpaceVertical as J } from "../components/common/space/index.js";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
6
|
import "lodash/isEqualWith";
|
|
@@ -10,43 +10,43 @@ import "lodash/isNumber";
|
|
|
10
10
|
import "lodash/merge";
|
|
11
11
|
import "../components/common/utils/dom.js";
|
|
12
12
|
import "../components/common/hooks/useIntersectionObserver.js";
|
|
13
|
-
import
|
|
13
|
+
import d from "../components/common/hooks/useMergeProps.js";
|
|
14
14
|
import "../components/common/utils/reactDOM.js";
|
|
15
15
|
import "@unicom-cloud/utils/constant";
|
|
16
16
|
import "lodash/debounce";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
17
|
+
import u from "@unicom-cloud/utils/class-name";
|
|
18
|
+
import $ from "../config-provider/context.js";
|
|
19
|
+
const N = {
|
|
20
20
|
gap: "small",
|
|
21
21
|
direction: "horizontal"
|
|
22
22
|
};
|
|
23
|
-
function
|
|
24
|
-
const { getPrefixCls:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
), { className: f, direction:
|
|
29
|
-
|
|
30
|
-
const
|
|
23
|
+
function S(m, a) {
|
|
24
|
+
const { getPrefixCls: s, componentConfig: n, rtl: P } = x($), c = d(
|
|
25
|
+
m,
|
|
26
|
+
N,
|
|
27
|
+
n?.Space
|
|
28
|
+
), { className: f, direction: t, wrap: p, size: e, align: i, ...o } = c;
|
|
29
|
+
e && (o.gap = e), i && (o.alignItems = i);
|
|
30
|
+
const r = s?.("space");
|
|
31
31
|
return /* @__PURE__ */ l(
|
|
32
|
-
|
|
32
|
+
C,
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
35
|
-
className:
|
|
36
|
-
`${
|
|
37
|
-
|
|
38
|
-
`${
|
|
34
|
+
ref: a,
|
|
35
|
+
className: u(
|
|
36
|
+
`${r}`,
|
|
37
|
+
p && `${r}-wrap`,
|
|
38
|
+
`${r}-${t}`,
|
|
39
39
|
f
|
|
40
40
|
),
|
|
41
|
-
direction:
|
|
42
|
-
wrap:
|
|
43
|
-
...
|
|
41
|
+
direction: t,
|
|
42
|
+
wrap: p,
|
|
43
|
+
...o
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
47
|
+
const w = g(S);
|
|
48
|
+
w.displayName = "Space";
|
|
49
49
|
export {
|
|
50
50
|
J as SpaceVertical,
|
|
51
|
-
|
|
51
|
+
w as default
|
|
52
52
|
};
|
package/space-/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { jsx as c, jsxs as M } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
2
|
+
import P from "lodash/isArray";
|
|
3
|
+
import R from "lodash/isNumber";
|
|
4
|
+
import { forwardRef as $, useContext as V, Fragment as b } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
6
|
+
import j from "../components/common/hooks/useMergeProps.js";
|
|
7
|
+
import k from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import D from "./toArray.js";
|
|
9
|
+
import F from "../config-provider/context.js";
|
|
10
|
+
const H = {
|
|
11
11
|
size: "small",
|
|
12
12
|
direction: "horizontal"
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
const { getPrefixCls:
|
|
14
|
+
function O(s, m) {
|
|
15
|
+
const { getPrefixCls: N, componentConfig: C, rtl: g } = V(F), v = j(
|
|
16
16
|
s,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
H,
|
|
18
|
+
C?.Space
|
|
19
19
|
), {
|
|
20
|
-
className:
|
|
21
|
-
style:
|
|
22
|
-
children:
|
|
20
|
+
className: S,
|
|
21
|
+
style: x,
|
|
22
|
+
children: w,
|
|
23
23
|
size: i,
|
|
24
24
|
direction: a,
|
|
25
|
-
align:
|
|
26
|
-
wrap:
|
|
27
|
-
split:
|
|
25
|
+
align: B,
|
|
26
|
+
wrap: l,
|
|
27
|
+
split: p,
|
|
28
28
|
...z
|
|
29
|
-
} =
|
|
29
|
+
} = v, e = N?.("space-"), d = B || (a === "horizontal" ? "center" : ""), A = k(
|
|
30
30
|
e,
|
|
31
31
|
{
|
|
32
32
|
[`${e}-${a}`]: a,
|
|
33
|
-
[`${e}-align-${
|
|
34
|
-
[`${e}-wrap`]:
|
|
35
|
-
[`${e}-rtl`]:
|
|
33
|
+
[`${e}-align-${d}`]: d,
|
|
34
|
+
[`${e}-wrap`]: l,
|
|
35
|
+
[`${e}-rtl`]: g
|
|
36
36
|
},
|
|
37
|
-
|
|
37
|
+
S
|
|
38
38
|
);
|
|
39
|
-
function
|
|
40
|
-
if (
|
|
41
|
-
return
|
|
42
|
-
switch (
|
|
39
|
+
function f(t) {
|
|
40
|
+
if (R(t))
|
|
41
|
+
return t;
|
|
42
|
+
switch (t) {
|
|
43
43
|
case "mini":
|
|
44
44
|
return 4;
|
|
45
45
|
case "small":
|
|
@@ -52,42 +52,42 @@ function P(s, m) {
|
|
|
52
52
|
return 8;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
function L(
|
|
57
|
-
const n =
|
|
55
|
+
const h = D(w);
|
|
56
|
+
function L(t) {
|
|
57
|
+
const n = h.length === t + 1, o = g ? "marginLeft" : "marginRight";
|
|
58
58
|
if (typeof i == "string" || typeof i == "number") {
|
|
59
|
-
const
|
|
60
|
-
return
|
|
61
|
-
[`${o}`]:
|
|
62
|
-
marginBottom:
|
|
59
|
+
const r = f(i);
|
|
60
|
+
return l ? n ? { marginBottom: r } : {
|
|
61
|
+
[`${o}`]: r,
|
|
62
|
+
marginBottom: r
|
|
63
63
|
} : n ? {} : {
|
|
64
|
-
[a === "vertical" ? "marginBottom" : o]:
|
|
64
|
+
[a === "vertical" ? "marginBottom" : o]: r
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
68
|
-
const
|
|
69
|
-
return
|
|
70
|
-
[`${o}`]:
|
|
71
|
-
marginBottom:
|
|
72
|
-
} : a === "vertical" ? { marginBottom:
|
|
67
|
+
if (P(i)) {
|
|
68
|
+
const r = f(i[0]), u = f(i[1]);
|
|
69
|
+
return l ? n ? { marginBottom: u } : {
|
|
70
|
+
[`${o}`]: r,
|
|
71
|
+
marginBottom: u
|
|
72
|
+
} : a === "vertical" ? { marginBottom: u } : { [`${o}`]: r };
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
return /* @__PURE__ */ c("div", { ref: m, className: A, style:
|
|
76
|
-
const o =
|
|
77
|
-
return /* @__PURE__ */ M(
|
|
78
|
-
|
|
79
|
-
/* @__PURE__ */ c("div", { className: `${e}-item`, style: L(n), children:
|
|
75
|
+
return /* @__PURE__ */ c("div", { ref: m, className: A, style: x, ...z, children: h.map((t, n) => {
|
|
76
|
+
const o = t?.key || n, r = p != null && n > 0;
|
|
77
|
+
return /* @__PURE__ */ M(b, { children: [
|
|
78
|
+
r && /* @__PURE__ */ c("div", { className: `${e}-item-split`, children: p }),
|
|
79
|
+
/* @__PURE__ */ c("div", { className: `${e}-item`, style: L(n), children: t })
|
|
80
80
|
] }, o);
|
|
81
81
|
}) });
|
|
82
82
|
}
|
|
83
|
-
const
|
|
84
|
-
|
|
83
|
+
const y = $(O);
|
|
84
|
+
y.displayName = "Space-";
|
|
85
85
|
function q(s, m) {
|
|
86
|
-
return /* @__PURE__ */ c(
|
|
86
|
+
return /* @__PURE__ */ c(y, { ref: m, ...s, direction: "vertical", children: s.children });
|
|
87
87
|
}
|
|
88
|
-
const E =
|
|
88
|
+
const E = $(q);
|
|
89
89
|
E.displayName = "SpaceVertical-";
|
|
90
90
|
export {
|
|
91
91
|
E as SpaceVertical,
|
|
92
|
-
|
|
92
|
+
y as default
|
|
93
93
|
};
|
package/spin/DotLoading.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import m from "lodash/isNumber";
|
|
3
3
|
import { useContext as a } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
function
|
|
7
|
-
const { getPrefixCls:
|
|
5
|
+
import l from "../config-provider/context.js";
|
|
6
|
+
function x(t) {
|
|
7
|
+
const { getPrefixCls: r } = a(l), i = `${r?.("spin")}-dot`, o = {
|
|
8
8
|
width: t.size,
|
|
9
9
|
height: t.size
|
|
10
10
|
}, e = t.size ? parseInt(String(t.size)) : 0;
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ s(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
|
-
className: `${
|
|
14
|
+
className: `${i}-list`,
|
|
15
15
|
style: {
|
|
16
16
|
height: t.size,
|
|
17
17
|
width: m(e) && e > 0 ? e * 7 : ""
|
|
18
18
|
},
|
|
19
|
-
children: [...new Array(5)].map((
|
|
19
|
+
children: [...new Array(5)].map((d, n) => /* @__PURE__ */ s("div", { className: i, style: o }, n))
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
x as default
|
|
25
25
|
};
|