@unicom-cloud/ui 0.8.81 → 0.8.82
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/Alert.js +1 -1
- package/AutoComplete.js +2 -2
- package/BackTop.js +2 -2
- package/Badge.js +1 -1
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +2 -2
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +2 -2
- package/Comment.js +1 -1
- package/ConfigProvider.js +5 -4
- package/Copy.js +1 -1
- package/DatePicker.js +7 -7
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/List.js +2 -2
- package/Mentions.js +2 -2
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +1 -1
- package/Notification.js +5 -5
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +1 -1
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +1 -1
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/Select.js +1 -1
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +1 -1
- package/SpeechSynthesis.js +1 -1
- package/Spin.js +1 -1
- package/Statistic.js +2 -2
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +1 -1
- package/Transfer.js +2 -2
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +1 -1
- package/Typography.js +1 -1
- package/affix/index.js +60 -57
- package/alert/index.js +53 -53
- package/anchor/Anchor.js +72 -72
- package/anchor/Link.js +27 -27
- package/anchor/util.js +1 -1
- package/auto-complete/index.js +2 -2
- package/avatar/Avatar.js +31 -31
- package/avatar/Group.js +25 -25
- package/back-top/index.js +30 -30
- package/badge/index.js +37 -37
- package/breadcrumb/index.js +26 -26
- package/button/Group.js +7 -7
- package/button/index.js +29 -29
- package/calendar/index.js +2 -2
- package/card/Grid.js +12 -12
- package/card/Meta.js +17 -17
- package/card/index.js +44 -44
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +25 -25
- package/carousel/index.js +77 -77
- package/cascader/Cascader.js +2 -2
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Group.js +2 -2
- package/checkbox/GroupBlock.js +2 -2
- package/checkbox/index.js +2 -2
- package/chunk/{yLRv5RIK.js → CQI1gsQs.js} +181 -181
- package/chunk/CmMehQON.js +1464 -0
- package/chunk/Cplu5dtQ.js +730 -0
- package/chunk/{C5X4hOkx.js → D0338Pbq.js} +80 -80
- package/chunk/{DYspELhF.js → DXDbeIai.js} +223 -223
- package/chunk/{DEiyXzBZ.js → DfrB26fI.js} +63 -63
- package/chunk/{BG7YGUsx.js → dKvAiKxr.js} +119 -119
- package/chunk/{BNevupAU.js → uKZyjtff.js} +5 -4
- package/chunk/{DLBfXSnU.js → w221i0nK.js} +2872 -2871
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +2 -2
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +36 -36
- package/color-picker/InputAlpha.js +11 -11
- package/color-picker/InputHex.js +24 -24
- package/color-picker/InputRgb.js +23 -23
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +2 -2
- package/color-picker/index.js +2 -2
- package/comment/index.js +31 -31
- package/config-provider/ConfigProvider.js +5 -4
- package/config-provider/context.js +2 -2
- package/config-provider/index.js +4 -3
- package/copy/index.js +28 -28
- package/date-picker/Picker.js +276 -276
- package/date-picker/{PickerRange.js → RangePicker.js} +2 -2
- package/date-picker/index.js +26 -27
- package/descriptions/index.js +33 -33
- package/divider/index.js +12 -12
- package/draggable/index.js +23 -23
- package/drawer/Drawer.js +81 -81
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +56 -56
- package/empty/index.js +1 -1
- package/form/Form.js +76 -76
- package/form/FormItem.js +64 -64
- package/grid/Col.js +53 -53
- package/grid/Row.js +34 -34
- package/grid/grid-item.js +29 -29
- package/grid/grid.js +50 -50
- package/icon/index.js +20 -19
- package/icon-hover/index.js +1 -1
- package/image/Image.js +86 -86
- package/image/ImagePreview.js +2 -2
- package/image/ImagePreviewArrow.js +22 -22
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +410 -408
- package/input/Group.js +8 -8
- package/input/Input.js +322 -322
- package/input/InputElement.js +1 -1
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +1 -1
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +40 -40
- package/layout/Content.js +7 -7
- package/layout/Footer.js +9 -9
- package/layout/Header.js +7 -7
- package/layout/Sider.js +55 -55
- package/layout/index.js +32 -32
- package/link/index.js +35 -35
- package/list/Item.js +29 -29
- package/list/Meta.js +12 -12
- package/list/index.js +2 -2
- package/mentions/index.js +2 -2
- package/menu/Menu.js +2 -2
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +1 -1
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +2 -2
- package/modal/index.js +1 -1
- package/notice/index.js +1 -1
- package/notification/index.js +5 -5
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +12 -12
- package/overflow-ellipsis/index.js +24 -24
- package/package.json +1 -1
- package/page-header/index.js +38 -38
- package/pagination/PageItem.js +16 -16
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +2 -2
- package/pagination/Pagination.js +2 -2
- package/pagination/index.js +1 -1
- package/picker/Input.js +69 -69
- package/picker/InputRange.js +111 -111
- package/popconfirm/index.js +61 -61
- package/popover/index.js +35 -35
- package/progress/index.js +22 -22
- package/radio/Group.js +2 -2
- package/radio/GroupBlock.js +2 -2
- package/radio/Radio.js +2 -2
- package/radio/index.js +2 -2
- package/rate/index.js +49 -49
- package/resize-box/ResizeTrigger.js +34 -34
- package/resize-box/Split.js +56 -56
- package/resize-box/SplitGroup.js +55 -55
- package/resize-box/index.js +51 -51
- package/result/index.js +41 -41
- package/select/Option.js +1 -1
- package/select/Select.js +2 -2
- package/select/index.js +2 -2
- package/select/util.js +1 -1
- package/select-view/Core.js +125 -125
- package/skeleton/index.js +20 -20
- package/slider/Button.js +57 -57
- package/slider/index.js +116 -116
- package/space/index.js +46 -44
- package/speech-synthesis/index.js +1 -1
- package/spin/DotLoading.js +10 -10
- package/spin/index.js +44 -44
- package/statistic/Countdown.js +34 -34
- package/statistic/index.js +67 -67
- package/steps/index.js +55 -55
- package/style.css +1 -1
- package/switch/index.js +54 -54
- package/table/Table.js +3 -3
- package/table/index.js +1 -1
- package/tabs/Tab.js +2 -2
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +12 -12
- package/tabs/index.js +2 -2
- package/tag/index.js +45 -45
- package/time-picker/Picker.js +76 -76
- package/time-picker/TimePicker.js +136 -136
- package/time-picker/index.js +8 -8
- package/time-picker/util.js +5 -5
- package/timeline/Item.js +47 -47
- package/timeline/Timeline.js +41 -41
- package/tooltip/index.js +29 -29
- package/transfer/Item.js +2 -2
- package/transfer/List.js +2 -2
- package/transfer/index.js +2 -2
- package/tree/Animation.js +2 -2
- package/tree/Node.js +2 -2
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +2 -2
- package/tree/index.js +1 -1
- package/tree-select/List.js +1 -1
- package/tree-select/Select.js +2 -2
- package/tree-select/index.js +2 -2
- package/trigger/index.js +60 -60
- package/types/config-provider/ConfigProvider.d.ts +2 -2
- package/types/config-provider/context.d.ts +1 -1
- package/types/date-picker/index.d.ts +8 -9
- package/types/date-picker/interface.d.ts +9 -9
- package/types/index.d.ts +1 -1
- package/types/picker/Input.d.ts +2 -2
- package/types/space/index.d.ts +2 -1
- package/types/utils/names.d.ts +1 -1
- package/typography/Base.js +53 -53
- package/typography/Ellipsis.js +9 -8
- package/typography/Operations.js +28 -28
- package/typography/Paragraph.js +8 -8
- package/typography/Typography.js +7 -7
- package/typography/index.js +1 -1
- package/upload/TriggerNode.js +47 -47
- package/upload/Upload.js +184 -184
- package/utils/contextHolder.js +3 -3
- package/utils/index.js +13 -13
- package/utils/names.js +1 -1
- package/utils/setPrimaryColor.js +18 -13
- package/utils/tween.js +1 -1
- package/verification-code/VerificationCode.js +49 -49
- package/version/index.js +1 -1
- package/watermark/Watermark.js +24 -24
- package/chunk/CQvM33Vg.js +0 -724
- package/chunk/yhU2zeeu.js +0 -1461
- /package/types/date-picker/{PickerRange.d.ts → RangePicker.d.ts} +0 -0
package/slider/Button.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import g from "lodash/isFunction";
|
|
3
3
|
import W from "lodash/isNumber";
|
|
4
4
|
import q from "lodash/isString";
|
|
5
|
-
import G, { useState as H, useContext as J, useMemo as B, useRef as
|
|
6
|
-
import { a as Z } from "../chunk/
|
|
5
|
+
import G, { useState as H, useContext as J, useMemo as B, useRef as h, useEffect as Q } from "react";
|
|
6
|
+
import { a as Z } from "../chunk/Cplu5dtQ.js";
|
|
7
7
|
import { u as _ } from "../chunk/BYdIoY50.js";
|
|
8
8
|
import { u as tt } from "../chunk/CXPOj2uy.js";
|
|
9
9
|
import et from "../trigger/index.js";
|
|
10
10
|
import L from "@unicom-cloud/utils/class-name";
|
|
11
|
-
import { on as
|
|
11
|
+
import { on as a, off as c } from "../utils/dom.js";
|
|
12
12
|
const nt = { maxWidth: 350 }, ot = {
|
|
13
13
|
enter: 300,
|
|
14
14
|
exit: 100
|
|
@@ -20,67 +20,67 @@ const nt = { maxWidth: 350 }, ot = {
|
|
|
20
20
|
}, rt = function(n) {
|
|
21
21
|
const {
|
|
22
22
|
style: I,
|
|
23
|
-
disabled:
|
|
24
|
-
prefixCls:
|
|
25
|
-
value:
|
|
26
|
-
vertical:
|
|
27
|
-
tooltipVisible:
|
|
28
|
-
tooltipPosition:
|
|
29
|
-
formatTooltip:
|
|
23
|
+
disabled: b,
|
|
24
|
+
prefixCls: A,
|
|
25
|
+
value: r,
|
|
26
|
+
vertical: E,
|
|
27
|
+
tooltipVisible: p,
|
|
28
|
+
tooltipPosition: D,
|
|
29
|
+
formatTooltip: M,
|
|
30
30
|
getTooltipContainer: R,
|
|
31
|
-
onMoving:
|
|
32
|
-
onMoveEnd:
|
|
33
|
-
onMoveBegin:
|
|
34
|
-
} = n, X = _(), [Y,
|
|
35
|
-
value:
|
|
36
|
-
}), { getPrefixCls:
|
|
37
|
-
() =>
|
|
38
|
-
[
|
|
39
|
-
),
|
|
31
|
+
onMoving: T,
|
|
32
|
+
onMoveEnd: P,
|
|
33
|
+
onMoveBegin: V
|
|
34
|
+
} = n, X = _(), [Y, y] = H(!1), [S, F] = tt(!1, {
|
|
35
|
+
value: p
|
|
36
|
+
}), { getPrefixCls: o } = J(Z), $ = B(
|
|
37
|
+
() => D || (E ? "right" : "top"),
|
|
38
|
+
[D, E]
|
|
39
|
+
), u = h(null), l = h(!1), s = h(!1), C = h(null);
|
|
40
40
|
function K(t) {
|
|
41
|
-
t.stopPropagation(), !
|
|
41
|
+
t.stopPropagation(), !b && (j(t), y(!0), a(window, "mousemove", f), a(window, "touchmove", f), a(window, "mouseup", i), a(window, "touchend", i), a(window, "contextmenu", i));
|
|
42
42
|
}
|
|
43
43
|
function O() {
|
|
44
|
-
l.current = !0,
|
|
44
|
+
l.current = !0, m(), S || (u.current = setTimeout(() => {
|
|
45
45
|
x(!0);
|
|
46
46
|
}, 50));
|
|
47
47
|
}
|
|
48
48
|
function N() {
|
|
49
|
-
l.current = !1,
|
|
49
|
+
l.current = !1, s.current || (m(), u.current = setTimeout(() => {
|
|
50
50
|
x(!1);
|
|
51
51
|
}, 200));
|
|
52
52
|
}
|
|
53
53
|
function j(t) {
|
|
54
|
-
var
|
|
54
|
+
var v;
|
|
55
55
|
t.preventDefault();
|
|
56
56
|
const e = document.activeElement;
|
|
57
|
-
(
|
|
57
|
+
(v = e == null ? void 0 : e.blur) == null || v.call(e), g(V) && V();
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
59
|
+
function f(t) {
|
|
60
|
+
s.current = !0, t.type === "touchstart" && (t.clientY = t.touches[0].clientY, t.clientX = t.touches[0].clientX), g(T) && T(t.clientX, t.clientY);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
62
|
+
function i() {
|
|
63
|
+
s.current = !1, y(!1), k(), x(l.current), g(P) && P();
|
|
64
64
|
}
|
|
65
65
|
function k() {
|
|
66
|
-
|
|
66
|
+
m(), c(window, "mousemove", f), c(window, "touchmove", f), c(window, "mouseup", i), c(window, "touchend", i), c(window, "contextmenu", i);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
68
|
+
function m() {
|
|
69
|
+
u.current && (clearTimeout(u.current), u.current = null);
|
|
70
70
|
}
|
|
71
71
|
function x(t) {
|
|
72
|
-
if (
|
|
72
|
+
if (s.current)
|
|
73
73
|
return;
|
|
74
|
-
const e = "tooltipVisible" in n ?
|
|
74
|
+
const e = "tooltipVisible" in n ? p : t;
|
|
75
75
|
F(e);
|
|
76
76
|
}
|
|
77
77
|
function z() {
|
|
78
|
-
l.current = !0,
|
|
78
|
+
l.current = !0, m();
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const d = B(() => g(M) ? M(r) : r, [M, r]);
|
|
81
81
|
function U(t) {
|
|
82
|
-
const e =
|
|
83
|
-
return /* @__PURE__ */
|
|
82
|
+
const e = o == null ? void 0 : o("tooltip");
|
|
83
|
+
return /* @__PURE__ */ w(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
86
86
|
className: L(
|
|
@@ -89,17 +89,17 @@ const nt = { maxWidth: 350 }, ot = {
|
|
|
89
89
|
),
|
|
90
90
|
onMouseLeave: N,
|
|
91
91
|
onMouseEnter: z,
|
|
92
|
-
onClick: (
|
|
93
|
-
|
|
92
|
+
onClick: (v) => {
|
|
93
|
+
v.stopPropagation();
|
|
94
94
|
},
|
|
95
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ w("div", { className: `${e}-content-inner`, children: d })
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
return Q(() => {
|
|
100
100
|
var t, e;
|
|
101
|
-
(e = (t =
|
|
102
|
-
}, [
|
|
101
|
+
(e = (t = C.current) == null ? void 0 : t.update) == null || e.call(t);
|
|
102
|
+
}, [r]), /* @__PURE__ */ w(
|
|
103
103
|
et,
|
|
104
104
|
{
|
|
105
105
|
style: nt,
|
|
@@ -107,18 +107,18 @@ const nt = { maxWidth: 350 }, ot = {
|
|
|
107
107
|
duration: ot,
|
|
108
108
|
showArrow: !0,
|
|
109
109
|
popupAlign: it,
|
|
110
|
-
ref:
|
|
111
|
-
popup: () => U(
|
|
112
|
-
popupVisible:
|
|
113
|
-
disabled:
|
|
110
|
+
ref: C,
|
|
111
|
+
popup: () => U($),
|
|
112
|
+
popupVisible: S,
|
|
113
|
+
disabled: p === !1,
|
|
114
114
|
getPopupContainer: R,
|
|
115
|
-
position:
|
|
116
|
-
childrenPrefix:
|
|
117
|
-
children: /* @__PURE__ */
|
|
115
|
+
position: $,
|
|
116
|
+
childrenPrefix: o == null ? void 0 : o("tooltip"),
|
|
117
|
+
children: /* @__PURE__ */ w(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
120
|
-
className: L(`${
|
|
121
|
-
[`${
|
|
120
|
+
className: L(`${A}-button`, {
|
|
121
|
+
[`${A}-button-active`]: Y
|
|
122
122
|
}),
|
|
123
123
|
onMouseDown: K,
|
|
124
124
|
onMouseEnter: O,
|
|
@@ -127,10 +127,10 @@ const nt = { maxWidth: 350 }, ot = {
|
|
|
127
127
|
role: "slider",
|
|
128
128
|
"aria-valuemax": n.maxValue,
|
|
129
129
|
"aria-valuemin": n.minValue,
|
|
130
|
-
"aria-valuenow":
|
|
131
|
-
"aria-disabled": !!
|
|
132
|
-
tabIndex:
|
|
133
|
-
"aria-valuetext": q(
|
|
130
|
+
"aria-valuenow": r,
|
|
131
|
+
"aria-disabled": !!b,
|
|
132
|
+
tabIndex: b ? -1 : 0,
|
|
133
|
+
"aria-valuetext": q(d) || W(d) ? String(d) : void 0,
|
|
134
134
|
...X({
|
|
135
135
|
onArrowRight: (t) => {
|
|
136
136
|
var e;
|
package/slider/index.js
CHANGED
|
@@ -4,15 +4,15 @@ import _ from "lodash/isArray";
|
|
|
4
4
|
import ee from "lodash/isFunction";
|
|
5
5
|
import te from "lodash/isPlainObject";
|
|
6
6
|
import Ge, { useMemo as ne, useCallback as T, forwardRef as He, useContext as Qe, useRef as $ } from "react";
|
|
7
|
-
import { a as Ze } from "../chunk/
|
|
7
|
+
import { a as Ze } from "../chunk/Cplu5dtQ.js";
|
|
8
8
|
import { u as _e } from "../chunk/BFTV6myl.js";
|
|
9
9
|
import { u as et } from "../chunk/CXPOj2uy.js";
|
|
10
10
|
import { u as tt } from "../chunk/a3hR6zLw.js";
|
|
11
11
|
import ve from "@unicom-cloud/utils/class-name";
|
|
12
12
|
import { on as be, off as we } from "../utils/dom.js";
|
|
13
13
|
import { o as nt } from "../chunk/BKKEev13.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import ot from "./Button.js";
|
|
15
|
+
import rt from "./Dot.js";
|
|
16
16
|
import st from "./Input.js";
|
|
17
17
|
import it from "./Mark.js";
|
|
18
18
|
import at from "./Tick.js";
|
|
@@ -24,21 +24,21 @@ function dt(m) {
|
|
|
24
24
|
if (m.length < 2)
|
|
25
25
|
return [];
|
|
26
26
|
const y = [];
|
|
27
|
-
for (let
|
|
28
|
-
const g = m[
|
|
27
|
+
for (let l = 1; l < m.length; l++) {
|
|
28
|
+
const g = m[l - 1], b = m[l];
|
|
29
29
|
y.push([g, b]);
|
|
30
30
|
}
|
|
31
31
|
return y;
|
|
32
32
|
}
|
|
33
33
|
function pt(m) {
|
|
34
|
-
const { marks: y = {}, getIntervalConfig:
|
|
35
|
-
const
|
|
36
|
-
let v =
|
|
34
|
+
const { marks: y = {}, getIntervalConfig: l, max: g, min: b } = m, { markIntervals: d, markList: I } = ne(() => {
|
|
35
|
+
const O = Object.keys(y).filter((s) => U(+s) && +s >= b && +s <= g).sort((s, e) => +s > +e ? 1 : -1), p = O.map((s) => ({ key: s, content: y[s] }));
|
|
36
|
+
let v = O.map((s) => +s);
|
|
37
37
|
return v.length === 0 ? v = [b, g] : (v[0] > b && (v.unshift(b), p.unshift({ key: `${b}`, content: "" })), v.slice(-1)[0] < g && (v.push(g), p.push({ key: `${g}`, content: "" }))), { markIntervals: dt(v), markList: p };
|
|
38
38
|
}, [y, b, g]);
|
|
39
39
|
return {
|
|
40
40
|
intervalConfigs: ne(() => {
|
|
41
|
-
if (!ee(
|
|
41
|
+
if (!ee(l))
|
|
42
42
|
return [
|
|
43
43
|
{
|
|
44
44
|
begin: b,
|
|
@@ -49,90 +49,90 @@ function pt(m) {
|
|
|
49
49
|
width: 1
|
|
50
50
|
}
|
|
51
51
|
];
|
|
52
|
-
const
|
|
53
|
-
const a = { step: m.step, width: 0 },
|
|
54
|
-
return U(
|
|
52
|
+
const O = ([e, u], i) => {
|
|
53
|
+
const a = { step: m.step, width: 0 }, f = l([e, u], i) || {}, r = f.step, h = lt(f.width);
|
|
54
|
+
return U(r) && r && (a.step = r), U(h) && h && (a.width = h), a;
|
|
55
55
|
};
|
|
56
56
|
let p = 1, v = g - b;
|
|
57
|
-
const w = d.map(([e,
|
|
58
|
-
const a =
|
|
59
|
-
let
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
v -=
|
|
57
|
+
const w = d.map(([e, u], i) => {
|
|
58
|
+
const a = O([e, u], i);
|
|
59
|
+
let f = a.width;
|
|
60
|
+
if (f) {
|
|
61
|
+
f = Math.min(p, f);
|
|
62
|
+
const r = u - e;
|
|
63
|
+
v -= r, p -= f;
|
|
64
64
|
}
|
|
65
|
-
return { width:
|
|
65
|
+
return { width: f, step: a.step };
|
|
66
66
|
});
|
|
67
67
|
if (w.every(({ width: e }) => e) && p) {
|
|
68
68
|
const e = w[d.length - 1];
|
|
69
69
|
e.width += p;
|
|
70
70
|
}
|
|
71
71
|
const s = [];
|
|
72
|
-
return d.forEach(([e,
|
|
73
|
-
const { step: a, width:
|
|
72
|
+
return d.forEach(([e, u], i) => {
|
|
73
|
+
const { step: a, width: f } = w[i], r = {
|
|
74
74
|
begin: e,
|
|
75
|
-
end:
|
|
75
|
+
end: u,
|
|
76
76
|
step: a,
|
|
77
77
|
beginOffset: 0,
|
|
78
78
|
endOffset: 0,
|
|
79
|
-
width:
|
|
79
|
+
width: f
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
r.width || (r.width = p * ((u - e) / v));
|
|
82
82
|
const h = s.length - 1;
|
|
83
|
-
s[h] && (
|
|
83
|
+
s[h] && (r.beginOffset = s[h].endOffset), r.endOffset = Math.min(1, r.beginOffset + r.width), s.push(r);
|
|
84
84
|
}), s;
|
|
85
|
-
}, [
|
|
85
|
+
}, [l, d, g, b, m.step]),
|
|
86
86
|
markList: I
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
function ht(m) {
|
|
90
|
-
const { isRange: y, min:
|
|
90
|
+
const { isRange: y, min: l, max: g, onlyMarkValue: b, intervalConfigs: d, marks: I } = m, B = T(
|
|
91
91
|
(e) => {
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
const { begin: i, step: a } =
|
|
95
|
-
Ce(a,
|
|
92
|
+
const u = d.find((i) => e >= i.begin && e <= i.end);
|
|
93
|
+
if (u) {
|
|
94
|
+
const { begin: i, step: a } = u, f = e - i, r = Math.round(f / a), h = ut(a), A = parseFloat(
|
|
95
|
+
Ce(a, r).toFixed(h)
|
|
96
96
|
);
|
|
97
97
|
return Z(i, A);
|
|
98
98
|
}
|
|
99
99
|
return e;
|
|
100
100
|
},
|
|
101
101
|
[d]
|
|
102
|
-
),
|
|
102
|
+
), O = T(
|
|
103
103
|
(e) => {
|
|
104
104
|
if (!te(I) || mt(I))
|
|
105
|
-
return console.warn("marks must be an object when onlyMarkValue is true"),
|
|
105
|
+
return console.warn("marks must be an object when onlyMarkValue is true"), l;
|
|
106
106
|
if (I[e])
|
|
107
107
|
return e;
|
|
108
|
-
const
|
|
109
|
-
return parseFloat(
|
|
108
|
+
const u = Object.keys(I), i = u.map((f) => Math.abs(e - parseFloat(f))), a = i.indexOf(Math.min.apply(null, i));
|
|
109
|
+
return parseFloat(u[a]);
|
|
110
110
|
},
|
|
111
|
-
[I,
|
|
111
|
+
[I, l]
|
|
112
112
|
), p = T(
|
|
113
|
-
(e) => gt(e) || e <=
|
|
114
|
-
[
|
|
113
|
+
(e) => gt(e) || e <= l ? l : e >= g ? g : b ? O(e) : B(e),
|
|
114
|
+
[O, B, g, l, b]
|
|
115
115
|
), v = T(
|
|
116
116
|
(e) => p(e) === e,
|
|
117
117
|
[p]
|
|
118
118
|
), w = T(
|
|
119
119
|
(e) => {
|
|
120
|
-
let [
|
|
120
|
+
let [u, i] = [l, l];
|
|
121
121
|
if (y) {
|
|
122
122
|
if (_(e))
|
|
123
|
-
return
|
|
123
|
+
return u = p(e[0]), e.map((a) => p(a));
|
|
124
124
|
console.error("value must be an array when range is true");
|
|
125
125
|
} else U(e) ? i = p(e) : console.error("value must be a number when range is false");
|
|
126
|
-
return [
|
|
126
|
+
return [u, i];
|
|
127
127
|
},
|
|
128
|
-
[p, y,
|
|
128
|
+
[p, y, l]
|
|
129
129
|
), s = T(
|
|
130
|
-
(e,
|
|
131
|
-
const i =
|
|
130
|
+
(e, u) => {
|
|
131
|
+
const i = u === "subtraction" ? -1 : 1;
|
|
132
132
|
let a = Z(e, i * m.step);
|
|
133
133
|
if (m.onlyMarkValue) {
|
|
134
|
-
const
|
|
135
|
-
a =
|
|
134
|
+
const f = Object.keys(m.marks), r = f.findIndex((h) => Number(h) === e);
|
|
135
|
+
a = f[r + i] !== void 0 ? Number(f[r + i]) : e;
|
|
136
136
|
}
|
|
137
137
|
return a;
|
|
138
138
|
},
|
|
@@ -151,55 +151,55 @@ const Vt = {
|
|
|
151
151
|
step: 1
|
|
152
152
|
};
|
|
153
153
|
function vt(m, y) {
|
|
154
|
-
const { getPrefixCls:
|
|
154
|
+
const { getPrefixCls: l, componentConfig: g, rtl: b } = Qe(Ze), d = _e(
|
|
155
155
|
m,
|
|
156
156
|
Vt,
|
|
157
157
|
g == null ? void 0 : g.Slider
|
|
158
158
|
), {
|
|
159
159
|
className: I,
|
|
160
160
|
style: B,
|
|
161
|
-
tooltipVisible:
|
|
161
|
+
tooltipVisible: O,
|
|
162
162
|
tooltipPosition: p,
|
|
163
163
|
disabled: v,
|
|
164
164
|
min: w,
|
|
165
165
|
max: s,
|
|
166
166
|
range: e,
|
|
167
|
-
step:
|
|
167
|
+
step: u,
|
|
168
168
|
showTicks: i,
|
|
169
169
|
marks: a,
|
|
170
|
-
onlyMarkValue:
|
|
171
|
-
vertical:
|
|
170
|
+
onlyMarkValue: f,
|
|
171
|
+
vertical: r,
|
|
172
172
|
showInput: h,
|
|
173
173
|
reverse: A,
|
|
174
174
|
getIntervalConfig: ye,
|
|
175
175
|
...Ie
|
|
176
|
-
} = d,
|
|
176
|
+
} = d, x = !!e, Oe = te(e) ? { ...e } : { draggableBar: !1 }, M = b ? !A : A, { intervalConfigs: N, markList: oe } = pt({
|
|
177
177
|
min: w,
|
|
178
178
|
max: s,
|
|
179
|
-
step:
|
|
179
|
+
step: u,
|
|
180
180
|
marks: a,
|
|
181
181
|
getIntervalConfig: ye
|
|
182
|
-
}), { getLegalValue: E, getLegalRangeValue: W, isLegalValue:
|
|
183
|
-
isRange:
|
|
182
|
+
}), { getLegalValue: E, getLegalRangeValue: W, isLegalValue: xe, getNextMarkValue: Ne } = ht({
|
|
183
|
+
isRange: x,
|
|
184
184
|
min: w,
|
|
185
185
|
max: s,
|
|
186
|
-
onlyMarkValue:
|
|
187
|
-
step:
|
|
188
|
-
intervalConfigs:
|
|
186
|
+
onlyMarkValue: f,
|
|
187
|
+
step: u,
|
|
188
|
+
intervalConfigs: N,
|
|
189
189
|
marks: a
|
|
190
|
-
}), [K,
|
|
191
|
-
|
|
190
|
+
}), [K, Pe] = et(
|
|
191
|
+
x ? [w, w] : w,
|
|
192
192
|
{
|
|
193
193
|
defaultValue: d.defaultValue,
|
|
194
194
|
value: d.value
|
|
195
195
|
}
|
|
196
196
|
);
|
|
197
|
-
let
|
|
198
|
-
const X = $(
|
|
197
|
+
let c = W(K);
|
|
198
|
+
const X = $(c), Y = $(ct(c));
|
|
199
199
|
tt(() => {
|
|
200
200
|
X.current = W(K);
|
|
201
|
-
}, [K, W]), Y.current && (
|
|
202
|
-
const J =
|
|
201
|
+
}, [K, W]), Y.current && (c = ke(c));
|
|
202
|
+
const J = c[c.length - 1], q = c[0], z = h && !f && (!x || c.length < 3), Re = ne(() => z && (_(h) || te(h)) ? _(h) ? [...h] : [{ ...h }, { ...h }] : [], [z, h]), k = l == null ? void 0 : l("slider"), re = $(null), se = $({
|
|
203
203
|
left: 0,
|
|
204
204
|
height: 0,
|
|
205
205
|
top: 0,
|
|
@@ -207,15 +207,15 @@ function vt(m, y) {
|
|
|
207
207
|
}), ie = $(!1), ae = $(0);
|
|
208
208
|
function le(n) {
|
|
209
209
|
const t = ke(n);
|
|
210
|
-
return
|
|
210
|
+
return x ? t : t[t.length - 1];
|
|
211
211
|
}
|
|
212
212
|
function Le(n) {
|
|
213
|
-
const t = n.map((
|
|
213
|
+
const t = n.map((o) => E(o));
|
|
214
214
|
return X.current = t, t;
|
|
215
215
|
}
|
|
216
216
|
function L(n, t) {
|
|
217
|
-
const
|
|
218
|
-
|
|
217
|
+
const o = Le(n), V = le(o);
|
|
218
|
+
Pe(V), t === "inputValueChange" ? Y.current = o.some((C, S) => C > o[S]) : Y.current = !1, ee(d.onChange) && d.onChange(V);
|
|
219
219
|
}
|
|
220
220
|
function D() {
|
|
221
221
|
if (ee(d.onAfterChange)) {
|
|
@@ -224,17 +224,17 @@ function vt(m, y) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
function Se(n) {
|
|
227
|
-
let [t,
|
|
228
|
-
return t >
|
|
227
|
+
let [t, o] = [c[0], c[c.length - 1]];
|
|
228
|
+
return t > o && ([t, o] = [o, t]), x ? n >= t && n <= o : n <= o;
|
|
229
229
|
}
|
|
230
230
|
function G(n, t) {
|
|
231
|
-
const { left:
|
|
232
|
-
let
|
|
233
|
-
if (
|
|
231
|
+
const { left: o, top: V, width: C, height: S } = se.current;
|
|
232
|
+
let P = C, me = M ? o + C - n : n - o;
|
|
233
|
+
if (r && (P = S, me = M ? t - V : V + S - t), P <= 0)
|
|
234
234
|
return 0;
|
|
235
|
-
let j = Math.max(ze(me,
|
|
235
|
+
let j = Math.max(ze(me, P), 0);
|
|
236
236
|
j = Math.min(1, j);
|
|
237
|
-
const Ue =
|
|
237
|
+
const Ue = N.find((he) => j >= he.beginOffset && j <= he.endOffset), {
|
|
238
238
|
begin: ge,
|
|
239
239
|
beginOffset: de,
|
|
240
240
|
step: pe,
|
|
@@ -244,10 +244,10 @@ function vt(m, y) {
|
|
|
244
244
|
return Z(ge, Ce(qe, pe));
|
|
245
245
|
}
|
|
246
246
|
function Te(n) {
|
|
247
|
-
let [t,
|
|
248
|
-
t >
|
|
249
|
-
const V = F(t), C = F(1 -
|
|
250
|
-
return
|
|
247
|
+
let [t, o] = n;
|
|
248
|
+
t > o && ([t, o] = [o, t]);
|
|
249
|
+
const V = F(t), C = F(1 - o);
|
|
250
|
+
return r ? {
|
|
251
251
|
[M ? "top" : "bottom"]: V,
|
|
252
252
|
[M ? "bottom" : "top"]: C
|
|
253
253
|
} : {
|
|
@@ -256,36 +256,36 @@ function vt(m, y) {
|
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
function $e(n) {
|
|
259
|
-
return
|
|
259
|
+
return r ? { [M ? "top" : "bottom"]: F(n) } : { [M ? "right" : "left"]: F(n) };
|
|
260
260
|
}
|
|
261
261
|
function Be() {
|
|
262
262
|
const n = {
|
|
263
263
|
getTooltipContainer: d.getTooltipContainer,
|
|
264
264
|
formatTooltip: d.formatTooltip
|
|
265
265
|
};
|
|
266
|
-
return "tooltipPosition" in d && (n.tooltipPosition = p), "tooltipVisible" in d && (n.tooltipVisible =
|
|
266
|
+
return "tooltipPosition" in d && (n.tooltipPosition = p), "tooltipVisible" in d && (n.tooltipVisible = O), n;
|
|
267
267
|
}
|
|
268
268
|
function ue() {
|
|
269
|
-
se.current =
|
|
269
|
+
se.current = re.current.getBoundingClientRect();
|
|
270
270
|
}
|
|
271
271
|
function je(n) {
|
|
272
272
|
ue();
|
|
273
273
|
const t = G(n.clientX, n.clientY);
|
|
274
|
-
|
|
274
|
+
Oe.draggableBar && Se(t) ? (ae.current = E(t), be(window, "mousemove", ce), be(window, "mouseup", fe)) : H(t);
|
|
275
275
|
}
|
|
276
276
|
function H(n) {
|
|
277
277
|
if (v)
|
|
278
278
|
return;
|
|
279
|
-
const t = E(n), [
|
|
280
|
-
|
|
279
|
+
const t = E(n), [o, V] = ft(t, c), C = c[o], S = c[V], P = c.slice(0);
|
|
280
|
+
x && S - t > t - C ? (P[o] = t, L(P, "jumpToClick")) : (P[V] = t, L(P, "jumpToClick")), D();
|
|
281
281
|
}
|
|
282
282
|
function Ae(n) {
|
|
283
283
|
L(n, "inputValueChange"), D();
|
|
284
284
|
}
|
|
285
|
-
function Ee(n, t,
|
|
285
|
+
function Ee(n, t, o) {
|
|
286
286
|
ie.current = !0;
|
|
287
|
-
const V =
|
|
288
|
-
V[
|
|
287
|
+
const V = c.slice(0);
|
|
288
|
+
V[o] = G(n, t), L(V, "mousemove");
|
|
289
289
|
}
|
|
290
290
|
function De() {
|
|
291
291
|
ie.current = !1, D();
|
|
@@ -293,12 +293,12 @@ function vt(m, y) {
|
|
|
293
293
|
function Fe(n, t) {
|
|
294
294
|
if (v)
|
|
295
295
|
return;
|
|
296
|
-
const
|
|
297
|
-
|
|
296
|
+
const o = c.slice(0);
|
|
297
|
+
o[t] = Ne(c[t], n), L(o);
|
|
298
298
|
}
|
|
299
299
|
function ce(n) {
|
|
300
|
-
const
|
|
301
|
-
V.every((C) =>
|
|
300
|
+
const o = E(G(n.clientX, n.clientY)) - ae.current, V = c.map((C) => C + o);
|
|
301
|
+
V.every((C) => xe(C)) && L(V, "mousemove");
|
|
302
302
|
}
|
|
303
303
|
function fe() {
|
|
304
304
|
we(window, "mousemove", ce), we(window, "mouseup", fe), D();
|
|
@@ -317,7 +317,7 @@ function vt(m, y) {
|
|
|
317
317
|
className: ve(
|
|
318
318
|
k,
|
|
319
319
|
{
|
|
320
|
-
[`${k}-vertical`]:
|
|
320
|
+
[`${k}-vertical`]: r,
|
|
321
321
|
[`${k}-with-marks`]: a,
|
|
322
322
|
[`${k}-reverse`]: M,
|
|
323
323
|
[`${k}-rtl`]: b
|
|
@@ -330,10 +330,10 @@ function vt(m, y) {
|
|
|
330
330
|
/* @__PURE__ */ Ve(
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
|
-
ref:
|
|
333
|
+
ref: re,
|
|
334
334
|
className: ve(`${k}-road`, {
|
|
335
335
|
[`${k}-road-disabled`]: v,
|
|
336
|
-
[`${k}-road-vertical`]:
|
|
336
|
+
[`${k}-road-vertical`]: r
|
|
337
337
|
}),
|
|
338
338
|
onMouseDown: je,
|
|
339
339
|
children: [
|
|
@@ -342,30 +342,30 @@ function vt(m, y) {
|
|
|
342
342
|
{
|
|
343
343
|
className: `${k}-bar`,
|
|
344
344
|
style: Te([
|
|
345
|
-
Q(q,
|
|
346
|
-
Q(J,
|
|
345
|
+
Q(q, N),
|
|
346
|
+
Q(J, N)
|
|
347
347
|
])
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
350
|
i && /* @__PURE__ */ R(
|
|
351
351
|
at,
|
|
352
352
|
{
|
|
353
|
-
intervalConfigs:
|
|
353
|
+
intervalConfigs: N,
|
|
354
354
|
min: w,
|
|
355
355
|
max: s,
|
|
356
356
|
valueRange: [q, J],
|
|
357
357
|
prefixCls: k,
|
|
358
|
-
vertical:
|
|
358
|
+
vertical: r,
|
|
359
359
|
reverse: M
|
|
360
360
|
}
|
|
361
361
|
),
|
|
362
362
|
/* @__PURE__ */ R(
|
|
363
|
-
|
|
363
|
+
rt,
|
|
364
364
|
{
|
|
365
|
-
data:
|
|
366
|
-
intervalConfigs:
|
|
365
|
+
data: oe,
|
|
366
|
+
intervalConfigs: N,
|
|
367
367
|
valueRange: [q, J],
|
|
368
|
-
vertical:
|
|
368
|
+
vertical: r,
|
|
369
369
|
prefixCls: k,
|
|
370
370
|
reverse: M,
|
|
371
371
|
onMouseDown: H
|
|
@@ -374,29 +374,29 @@ function vt(m, y) {
|
|
|
374
374
|
/* @__PURE__ */ R(
|
|
375
375
|
it,
|
|
376
376
|
{
|
|
377
|
-
data:
|
|
378
|
-
intervalConfigs:
|
|
379
|
-
vertical:
|
|
377
|
+
data: oe,
|
|
378
|
+
intervalConfigs: N,
|
|
379
|
+
vertical: r,
|
|
380
380
|
prefixCls: k,
|
|
381
381
|
reverse: M,
|
|
382
382
|
onMouseDown: H
|
|
383
383
|
}
|
|
384
384
|
),
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
c.map((n, t) => !x && t !== c.length - 1 ? null : /* @__PURE__ */ R(
|
|
386
|
+
ot,
|
|
387
387
|
{
|
|
388
|
-
style: $e(Q(n,
|
|
388
|
+
style: $e(Q(n, N)),
|
|
389
389
|
disabled: v,
|
|
390
390
|
prefixCls: k,
|
|
391
391
|
value: n,
|
|
392
392
|
maxValue: s,
|
|
393
393
|
minValue: w,
|
|
394
|
-
vertical:
|
|
394
|
+
vertical: r,
|
|
395
395
|
...Be(),
|
|
396
396
|
onMoveBegin: ue,
|
|
397
|
-
onMoving: (
|
|
397
|
+
onMoving: (o, V) => Ee(o, V, t),
|
|
398
398
|
onMoveEnd: De,
|
|
399
|
-
onArrowEvent: (
|
|
399
|
+
onArrowEvent: (o) => Fe(o, t)
|
|
400
400
|
},
|
|
401
401
|
t
|
|
402
402
|
))
|
|
@@ -408,9 +408,9 @@ function vt(m, y) {
|
|
|
408
408
|
{
|
|
409
409
|
min: w,
|
|
410
410
|
max: s,
|
|
411
|
-
step:
|
|
412
|
-
value:
|
|
413
|
-
range:
|
|
411
|
+
step: u,
|
|
412
|
+
value: c,
|
|
413
|
+
range: x,
|
|
414
414
|
disabled: v,
|
|
415
415
|
prefixCls: k,
|
|
416
416
|
onChange: Ae,
|