@unicom-cloud/ui 0.8.77 → 0.8.79
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 +3 -3
- package/Alert.js +3 -3
- package/AutoComplete.js +5 -5
- package/BackTop.js +5 -5
- package/Badge.js +3 -3
- package/Breadcrumb.js +4 -4
- package/Button.js +2 -2
- package/Calendar.js +4 -4
- package/Card.js +2 -2
- package/Carousel.js +2 -2
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +3 -3
- package/Comment.js +2 -2
- package/ConfigProvider.js +1 -1
- package/Copy.js +4 -4
- package/DatePicker.js +1 -1
- package/Descriptions.js +2 -2
- package/Divider.js +2 -2
- package/Draggable.js +2 -2
- package/Dropdown.js +5 -5
- package/Empty.js +2 -2
- package/Icon.js +9 -5
- package/IconHover.js +2 -2
- package/Image.js +1 -1
- package/InputNumber.js +3 -3
- package/Layout.js +2 -2
- package/Link.js +3 -3
- package/List.js +4 -4
- package/Mentions.js +5 -5
- package/Menu.js +1 -1
- package/Message.js +3 -3
- package/Modal.js +1 -1
- package/Notice.js +9 -8
- package/Notification.js +3 -3
- package/OverflowEllipsis.js +2 -2
- package/PageHeader.js +3 -3
- package/Pagination.js +1 -1
- package/Popconfirm.js +3 -3
- package/Popover.js +3 -3
- package/Progress.js +2 -2
- package/Radio.js +1 -1
- package/Rate.js +3 -3
- package/ResizeBox.js +3 -3
- package/Result.js +2 -2
- package/Select.js +1 -1
- package/SelectView.js +5 -6
- package/Skeleton.js +2 -2
- package/Slider.js +4 -4
- package/Space.js +2 -2
- package/SpeechSynthesis.js +18 -20
- package/Spin.js +3 -3
- package/Statistic.js +3 -3
- package/Steps.js +2 -2
- package/Switch.js +7 -8
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +3 -3
- package/Tooltip.js +3 -3
- package/Transfer.js +4 -4
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +9 -10
- package/Typography.js +1 -1
- package/affix/index.js +17 -17
- package/alert/index.js +13 -13
- package/anchor/Anchor.js +40 -40
- package/anchor/Link.js +14 -14
- package/anchor/util.js +2 -2
- package/auto-complete/index.js +5 -5
- package/avatar/Avatar.js +17 -17
- package/avatar/Group.js +13 -13
- package/back-top/index.js +13 -13
- package/badge/Count.js +13 -13
- package/badge/index.js +21 -21
- package/breadcrumb/Item.js +25 -25
- package/breadcrumb/index.js +12 -12
- package/button/Group.js +6 -6
- package/button/index.js +30 -30
- package/calendar/Month.js +2 -2
- package/calendar/Year.js +1 -1
- package/calendar/index.js +4 -4
- package/card/Grid.js +13 -13
- package/card/Meta.js +13 -13
- package/card/index.js +29 -29
- package/carousel/Arrow.js +6 -6
- package/carousel/Indicator.js +27 -27
- package/carousel/index.js +24 -24
- package/cascader/Cascader.js +8 -8
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +4 -4
- package/checkbox/Group.js +4 -4
- package/checkbox/GroupBlock.js +3 -3
- package/checkbox/index.js +2 -2
- package/chunk/{ZrBrCzQX.js → B4WG1mhs.js} +6 -7
- package/chunk/{Cwm8LL5p.js → B4mZh-RK.js} +7245 -7249
- package/chunk/{CjqvxJml.js → BG7YGUsx.js} +32 -32
- package/chunk/{BhBEMwvI.js → BNevupAU.js} +18 -20
- package/chunk/BYdIoY50.js +17 -0
- package/chunk/{Cc_-i0o_.js → BZ3igxQN.js} +6 -7
- package/chunk/{uEGHykhe.js → BZ9g7J4R.js} +1 -1
- package/chunk/BsUZRQDT.js +23 -0
- package/chunk/{CBgu99gQ.js → C5X4hOkx.js} +130 -130
- package/chunk/{B0n0iRhF.js → CCKr5jj1.js} +1 -1
- package/chunk/{CNcLypMY.js → CQvM33Vg.js} +190 -189
- package/chunk/CXPOj2uy.js +19 -0
- package/chunk/{DAAff-FT.js → ClM74To2.js} +9 -10
- package/chunk/{RS6OAxzv.js → D-ap9qEk.js} +2 -2
- package/chunk/{tpmioyz1.js → DEiyXzBZ.js} +28 -28
- package/chunk/{CplLA01W.js → DEuVgCzp.js} +45 -52
- package/chunk/{BPQXH_5i.js → DYspELhF.js} +43 -43
- package/chunk/DxYoPlum.js +50 -0
- package/chunk/{BpYX5PN4.js → NPajzdOv.js} +2 -2
- package/chunk/{BBkdXHrJ.js → rT6qmv-Y.js} +1 -1
- package/chunk/{BC5fEyWK.js → yLRv5RIK.js} +61 -61
- package/chunk/{C_4I3haT.js → yhU2zeeu.js} +96 -96
- package/collapse/Collapse.js +4 -4
- package/collapse/Item.js +4 -4
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +22 -22
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +4 -4
- package/color-picker/index.js +3 -3
- package/comment/index.js +18 -18
- package/config-provider/ConfigProvider.js +2 -2
- package/config-provider/context.js +2 -2
- package/config-provider/index.js +2 -2
- package/copy/index.js +23 -23
- package/date-picker/Picker.js +41 -41
- package/date-picker/PickerRange.js +3 -3
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +28 -28
- package/divider/index.js +15 -15
- package/draggable/Item.js +11 -11
- package/draggable/index.js +15 -15
- package/drawer/Drawer.js +31 -31
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +22 -22
- package/empty/index.js +2 -2
- package/form/Control.js +46 -46
- package/form/Form.js +12 -12
- package/form/FormItem.js +12 -12
- package/form/FormLabel.js +11 -11
- package/form/context.js +7 -6
- package/form/promisify.js +9 -10
- package/form/store.js +1 -1
- package/form/util.js +1 -1
- package/grid/Col.js +38 -38
- package/grid/Row.js +15 -15
- package/grid/grid-item.js +17 -17
- package/grid/grid.js +28 -28
- package/hooks/index.js +6 -6
- package/hooks/useInView.js +1 -1
- package/hooks/useIntersectionObserver.js +1 -1
- package/hooks/useKeyboardEvent.js +1 -1
- package/hooks/useMergeValue.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/hooks/usePrefersColorSchemeDark.js +1 -1
- package/hooks/useVerificationCode.js +30 -30
- package/icon/index.js +20 -16
- package/icon-hover/index.js +2 -2
- package/image/Image.js +22 -22
- package/image/ImageFooter.js +2 -2
- package/image/ImagePreview.js +11 -11
- package/image/ImagePreviewArrow.js +16 -16
- package/image/ImagePreviewGroup.js +2 -2
- package/image/ImagePreviewToolbar.js +7 -7
- package/image/TriggerForToolbar.js +7 -7
- package/image/index.js +1 -1
- package/index.js +547 -580
- package/input/Group.js +10 -10
- package/input/Input.js +213 -214
- package/input/InputElement.js +10 -11
- package/input/Password.js +4 -4
- package/input/Search.js +3 -3
- package/input/Textarea.js +7 -8
- package/input/useComposition.js +6 -6
- package/input-number/index.js +3 -3
- package/input-tag/InputTag.js +110 -111
- package/layout/Content.js +4 -4
- package/layout/Footer.js +6 -6
- package/layout/Header.js +8 -8
- package/layout/Sider.js +29 -29
- package/layout/index.js +16 -16
- package/link/index.js +27 -27
- package/list/Item.js +5 -5
- package/list/Meta.js +11 -11
- package/list/index.js +4 -4
- package/locale/en-US.js +1 -1
- package/locale/tr-TR.js +1 -1
- package/mentions/index.js +5 -5
- package/menu/Item.js +11 -11
- package/menu/ItemGroup.js +8 -8
- package/menu/Menu.js +5 -5
- package/menu/OverflowWrap.js +2 -2
- package/menu/index.js +2 -2
- package/message/index.js +3 -3
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +7 -7
- package/modal/index.js +1 -1
- package/notice/index.js +9 -8
- package/notification/index.js +3 -3
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +6 -6
- package/overflow-ellipsis/index.js +27 -27
- package/package.json +1 -1
- package/page-header/index.js +3 -3
- package/pagination/PageItem.js +7 -7
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +3 -3
- package/pagination/Pagination.js +4 -4
- package/pagination/index.js +1 -1
- package/picker/Input.js +7 -7
- package/picker/InputRange.js +77 -77
- package/popconfirm/index.js +11 -11
- package/popover/index.js +21 -21
- package/progress/CircleProgress.js +14 -14
- package/progress/LineProgess.js +14 -14
- package/progress/StepProgress.js +9 -9
- package/progress/index.js +26 -26
- package/radio/Group.js +4 -4
- package/radio/GroupBlock.js +3 -3
- package/radio/Radio.js +4 -4
- package/radio/index.js +2 -2
- package/rate/index.js +16 -16
- package/resize-box/ResizeTrigger.js +27 -28
- package/resize-box/Split.js +21 -21
- package/resize-box/SplitGroup.js +40 -40
- package/resize-box/index.js +23 -23
- package/result/index.js +29 -29
- package/select/Option.js +2 -2
- package/select/Select.js +11 -12
- package/select/index.js +2 -2
- package/select/util.js +5 -5
- package/select-view/Core.js +104 -106
- package/select-view/index.js +22 -23
- package/skeleton/Image.js +14 -14
- package/skeleton/Text.js +16 -16
- package/skeleton/index.js +11 -11
- package/slider/Button.js +4 -4
- package/slider/Dot.js +9 -9
- package/slider/Input.js +20 -20
- package/slider/Tick.js +14 -14
- package/slider/index.js +103 -103
- package/slider/util.js +3 -3
- package/space/index.js +14 -14
- package/speech-synthesis/index.js +26 -28
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +16 -16
- package/statistic/Countdown.js +17 -17
- package/statistic/index.js +32 -32
- package/steps/Step.js +8 -8
- package/steps/index.js +17 -17
- package/style.css +1 -1
- package/switch/index.js +32 -33
- package/table/Table.js +5 -5
- package/table/index.js +1 -1
- package/tabs/Tab.js +4 -4
- package/tabs/TabContent.js +3 -3
- package/tabs/TabPane.js +11 -11
- package/tabs/index.js +2 -2
- package/tabs/util.js +1 -1
- package/tag/index.js +16 -16
- package/time-picker/Picker.js +50 -50
- package/time-picker/TimeColumn.js +8 -8
- package/time-picker/TimePicker.js +32 -32
- package/time-picker/util.js +1 -1
- package/timeline/Item.js +15 -15
- package/timeline/Timeline.js +24 -24
- package/tooltip/index.js +23 -23
- package/transfer/Item.js +4 -4
- package/transfer/List.js +4 -4
- package/transfer/index.js +4 -4
- package/tree/Animation.js +3 -3
- package/tree/Node.js +3 -3
- package/tree/NodeList.js +2 -2
- package/tree/Tree.js +4 -4
- package/tree/index.js +1 -1
- package/tree-select/List.js +2 -2
- package/tree-select/Select.js +8 -9
- package/tree-select/index.js +2 -2
- package/trigger/getPopupStyle.js +18 -19
- package/trigger/index.js +32 -33
- package/types/button/index.d.ts +2 -2
- package/types/color-picker/colors.d.ts +1 -1
- package/types/date-picker/util.d.ts +1 -1
- package/types/icon/index.d.ts +3 -1
- package/types/index.d.ts +1 -1
- package/types/menu/context.d.ts +1 -1
- package/typography/Base.js +33 -35
- package/typography/EditContent.js +16 -16
- package/typography/Ellipsis.js +24 -26
- package/typography/Operations.js +1 -1
- package/typography/Paragraph.js +8 -8
- package/typography/Typography.js +7 -7
- package/typography/index.js +1 -1
- package/upload/TriggerNode.js +8 -8
- package/upload/Upload.js +64 -65
- package/upload/Uploader.js +12 -12
- package/upload/request.js +13 -12
- package/upload/request_.js +5 -6
- package/utils/PqbCSSTransition.js +1 -1
- package/utils/caseName.js +4 -3
- package/utils/className.js +4 -3
- package/utils/constant.js +3 -3
- package/utils/contextHolder.js +1 -1
- package/utils/copy.js +5 -4
- package/utils/fileToURL.js +4 -3
- package/utils/index.js +261 -298
- package/utils/is.js +78 -115
- package/utils/keyboardCode.js +4 -26
- package/utils/math.js +10 -32
- package/utils/react19Adapter.js +1 -1
- package/utils/reactDOM.js +1 -1
- package/utils/saveAs.js +4 -3
- package/utils/screenfull.js +4 -3
- package/utils/scrollIntoView.js +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/tree.js +7 -83
- package/utils/tween.js +1 -1
- package/utils/validate.js +1 -1
- package/verification-code/VerificationCode.js +25 -25
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +1 -1
- package/watermark/Watermark.js +8 -8
- package/chunk/ATwvJ8j2.js +0 -6
- package/chunk/BFmckYou.js +0 -25
- package/chunk/Bl7BnD1R.js +0 -119
- package/chunk/Bmvhjhzq.js +0 -24
- package/chunk/BrOW642m.js +0 -130
- package/chunk/C0pRaDCf.js +0 -96
- package/chunk/CBzE-PUr.js +0 -23
- package/chunk/CUFsOxJ2.js +0 -10
- package/chunk/Ce1j9KTi.js +0 -6
- package/chunk/D0Dlbc2g.js +0 -41
- package/chunk/DRTWRsgI.js +0 -34
- package/chunk/DeV0v__J.js +0 -20
- package/chunk/DohlrJ4S.js +0 -50
- package/chunk/XTEsYGuF.js +0 -17
- package/chunk/yl4BU7Sd.js +0 -1068
package/slider/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsx as R, jsxs as Ve } from "react/jsx-runtime";
|
|
2
|
-
import { times as Ce, plus as Z, divide as ze } from "
|
|
2
|
+
import { times as Ce, plus as Z, divide as ze } from "@unicom-cloud/utils/math";
|
|
3
3
|
import _ from "lodash/isArray";
|
|
4
4
|
import ee from "lodash/isFunction";
|
|
5
5
|
import te from "lodash/isPlainObject";
|
|
6
|
-
import Ge, { useMemo as ne, useCallback as T, forwardRef as He, useContext as Qe, useRef as
|
|
7
|
-
import { a as Ze } from "../chunk/
|
|
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/CQvM33Vg.js";
|
|
8
8
|
import { u as _e } from "../chunk/BFTV6myl.js";
|
|
9
|
-
import { u as et } from "../chunk/
|
|
9
|
+
import { u as et } from "../chunk/CXPOj2uy.js";
|
|
10
10
|
import { u as tt } from "../chunk/a3hR6zLw.js";
|
|
11
|
-
import
|
|
12
|
-
import { on as
|
|
11
|
+
import ve from "@unicom-cloud/utils/class-name";
|
|
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 rt from "./Button.js";
|
|
15
|
+
import ot from "./Dot.js";
|
|
16
16
|
import st from "./Input.js";
|
|
17
17
|
import it from "./Mark.js";
|
|
18
18
|
import at from "./Tick.js";
|
|
19
19
|
import U from "lodash/isNumber";
|
|
20
20
|
import { rateToFloat as lt, getPrecision as ut, needSort as ct, sortNumberArray as ke, getIntervalOffset as Q, formatPercent as F, findNearestIndex as ft } from "./util.js";
|
|
21
|
-
import {
|
|
21
|
+
import { isEmptyObject as mt } from "@unicom-cloud/utils/is";
|
|
22
22
|
import gt from "lodash/isUndefined";
|
|
23
23
|
function dt(m) {
|
|
24
24
|
if (m.length < 2)
|
|
25
25
|
return [];
|
|
26
26
|
const y = [];
|
|
27
27
|
for (let f = 1; f < m.length; f++) {
|
|
28
|
-
const g = m[f - 1],
|
|
29
|
-
y.push([g,
|
|
28
|
+
const g = m[f - 1], b = m[f];
|
|
29
|
+
y.push([g, b]);
|
|
30
30
|
}
|
|
31
31
|
return y;
|
|
32
32
|
}
|
|
33
33
|
function pt(m) {
|
|
34
|
-
const { marks: y = {}, getIntervalConfig: f, max: g, min:
|
|
35
|
-
const x = Object.keys(y).filter((s) => U(+s) && +s >=
|
|
34
|
+
const { marks: y = {}, getIntervalConfig: f, max: g, min: b } = m, { markIntervals: d, markList: I } = ne(() => {
|
|
35
|
+
const x = Object.keys(y).filter((s) => U(+s) && +s >= b && +s <= g).sort((s, e) => +s > +e ? 1 : -1), p = x.map((s) => ({ key: s, content: y[s] }));
|
|
36
36
|
let v = x.map((s) => +s);
|
|
37
|
-
return v.length === 0 ? v = [
|
|
38
|
-
}, [y,
|
|
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
|
+
}, [y, b, g]);
|
|
39
39
|
return {
|
|
40
40
|
intervalConfigs: ne(() => {
|
|
41
41
|
if (!ee(f))
|
|
42
42
|
return [
|
|
43
43
|
{
|
|
44
|
-
begin:
|
|
44
|
+
begin: b,
|
|
45
45
|
end: g,
|
|
46
46
|
step: m.step,
|
|
47
47
|
beginOffset: 0,
|
|
@@ -50,27 +50,27 @@ function pt(m) {
|
|
|
50
50
|
}
|
|
51
51
|
];
|
|
52
52
|
const x = ([e, l], i) => {
|
|
53
|
-
const a = { step: m.step, width: 0 }, c = f([e, l], i) || {},
|
|
54
|
-
return U(
|
|
53
|
+
const a = { step: m.step, width: 0 }, c = f([e, l], i) || {}, o = c.step, h = lt(c.width);
|
|
54
|
+
return U(o) && o && (a.step = o), U(h) && h && (a.width = h), a;
|
|
55
55
|
};
|
|
56
|
-
let p = 1, v = g -
|
|
57
|
-
const
|
|
56
|
+
let p = 1, v = g - b;
|
|
57
|
+
const w = d.map(([e, l], i) => {
|
|
58
58
|
const a = x([e, l], i);
|
|
59
59
|
let c = a.width;
|
|
60
60
|
if (c) {
|
|
61
61
|
c = Math.min(p, c);
|
|
62
|
-
const
|
|
63
|
-
v -=
|
|
62
|
+
const o = l - e;
|
|
63
|
+
v -= o, p -= c;
|
|
64
64
|
}
|
|
65
65
|
return { width: c, step: a.step };
|
|
66
66
|
});
|
|
67
|
-
if (
|
|
68
|
-
const e =
|
|
67
|
+
if (w.every(({ width: e }) => e) && p) {
|
|
68
|
+
const e = w[d.length - 1];
|
|
69
69
|
e.width += p;
|
|
70
70
|
}
|
|
71
71
|
const s = [];
|
|
72
72
|
return d.forEach(([e, l], i) => {
|
|
73
|
-
const { step: a, width: c } =
|
|
73
|
+
const { step: a, width: c } = w[i], o = {
|
|
74
74
|
begin: e,
|
|
75
75
|
end: l,
|
|
76
76
|
step: a,
|
|
@@ -78,23 +78,23 @@ function pt(m) {
|
|
|
78
78
|
endOffset: 0,
|
|
79
79
|
width: c
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
o.width || (o.width = p * ((l - e) / v));
|
|
82
82
|
const h = s.length - 1;
|
|
83
|
-
s[h] && (
|
|
83
|
+
s[h] && (o.beginOffset = s[h].endOffset), o.endOffset = Math.min(1, o.beginOffset + o.width), s.push(o);
|
|
84
84
|
}), s;
|
|
85
|
-
}, [f, d, g,
|
|
85
|
+
}, [f, d, g, b, m.step]),
|
|
86
86
|
markList: I
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
function ht(m) {
|
|
90
|
-
const { isRange: y, min: f, max: g, onlyMarkValue:
|
|
90
|
+
const { isRange: y, min: f, max: g, onlyMarkValue: b, intervalConfigs: d, marks: I } = m, B = T(
|
|
91
91
|
(e) => {
|
|
92
92
|
const l = d.find((i) => e >= i.begin && e <= i.end);
|
|
93
93
|
if (l) {
|
|
94
|
-
const { begin: i, step: a } = l, c = e - i,
|
|
95
|
-
Ce(a,
|
|
94
|
+
const { begin: i, step: a } = l, c = e - i, o = Math.round(c / a), h = ut(a), A = parseFloat(
|
|
95
|
+
Ce(a, o).toFixed(h)
|
|
96
96
|
);
|
|
97
|
-
return Z(i,
|
|
97
|
+
return Z(i, A);
|
|
98
98
|
}
|
|
99
99
|
return e;
|
|
100
100
|
},
|
|
@@ -110,12 +110,12 @@ function ht(m) {
|
|
|
110
110
|
},
|
|
111
111
|
[I, f]
|
|
112
112
|
), p = T(
|
|
113
|
-
(e) => gt(e) || e <= f ? f : e >= g ? g :
|
|
114
|
-
[x,
|
|
113
|
+
(e) => gt(e) || e <= f ? f : e >= g ? g : b ? x(e) : B(e),
|
|
114
|
+
[x, B, g, f, b]
|
|
115
115
|
), v = T(
|
|
116
116
|
(e) => p(e) === e,
|
|
117
117
|
[p]
|
|
118
|
-
),
|
|
118
|
+
), w = T(
|
|
119
119
|
(e) => {
|
|
120
120
|
let [l, i] = [f, f];
|
|
121
121
|
if (y) {
|
|
@@ -131,15 +131,15 @@ function ht(m) {
|
|
|
131
131
|
const i = l === "subtraction" ? -1 : 1;
|
|
132
132
|
let a = Z(e, i * m.step);
|
|
133
133
|
if (m.onlyMarkValue) {
|
|
134
|
-
const c = Object.keys(m.marks),
|
|
135
|
-
a = c[
|
|
134
|
+
const c = Object.keys(m.marks), o = c.findIndex((h) => Number(h) === e);
|
|
135
|
+
a = c[o + i] !== void 0 ? Number(c[o + i]) : e;
|
|
136
136
|
}
|
|
137
137
|
return a;
|
|
138
138
|
},
|
|
139
139
|
[m.marks, m.onlyMarkValue, m.step]
|
|
140
140
|
);
|
|
141
141
|
return {
|
|
142
|
-
getLegalRangeValue:
|
|
142
|
+
getLegalRangeValue: w,
|
|
143
143
|
getLegalValue: p,
|
|
144
144
|
isLegalValue: v,
|
|
145
145
|
getNextMarkValue: s
|
|
@@ -151,71 +151,71 @@ const Vt = {
|
|
|
151
151
|
step: 1
|
|
152
152
|
};
|
|
153
153
|
function vt(m, y) {
|
|
154
|
-
const { getPrefixCls: f, componentConfig: g, rtl:
|
|
154
|
+
const { getPrefixCls: f, 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
|
-
style:
|
|
160
|
+
style: B,
|
|
161
161
|
tooltipVisible: x,
|
|
162
162
|
tooltipPosition: p,
|
|
163
163
|
disabled: v,
|
|
164
|
-
min:
|
|
164
|
+
min: w,
|
|
165
165
|
max: s,
|
|
166
166
|
range: e,
|
|
167
167
|
step: l,
|
|
168
168
|
showTicks: i,
|
|
169
169
|
marks: a,
|
|
170
170
|
onlyMarkValue: c,
|
|
171
|
-
vertical:
|
|
171
|
+
vertical: o,
|
|
172
172
|
showInput: h,
|
|
173
|
-
reverse:
|
|
173
|
+
reverse: A,
|
|
174
174
|
getIntervalConfig: ye,
|
|
175
175
|
...Ie
|
|
176
|
-
} = d, O = !!e, xe = te(e) ? { ...e } : { draggableBar: !1 }, M =
|
|
177
|
-
min:
|
|
176
|
+
} = d, O = !!e, xe = te(e) ? { ...e } : { draggableBar: !1 }, M = b ? !A : A, { intervalConfigs: P, markList: re } = pt({
|
|
177
|
+
min: w,
|
|
178
178
|
max: s,
|
|
179
179
|
step: l,
|
|
180
180
|
marks: a,
|
|
181
181
|
getIntervalConfig: ye
|
|
182
182
|
}), { getLegalValue: E, getLegalRangeValue: W, isLegalValue: Oe, getNextMarkValue: Pe } = ht({
|
|
183
183
|
isRange: O,
|
|
184
|
-
min:
|
|
184
|
+
min: w,
|
|
185
185
|
max: s,
|
|
186
186
|
onlyMarkValue: c,
|
|
187
187
|
step: l,
|
|
188
188
|
intervalConfigs: P,
|
|
189
189
|
marks: a
|
|
190
190
|
}), [K, Ne] = et(
|
|
191
|
-
O ? [
|
|
191
|
+
O ? [w, w] : w,
|
|
192
192
|
{
|
|
193
193
|
defaultValue: d.defaultValue,
|
|
194
194
|
value: d.value
|
|
195
195
|
}
|
|
196
196
|
);
|
|
197
197
|
let u = W(K);
|
|
198
|
-
const X =
|
|
198
|
+
const X = $(u), Y = $(ct(u));
|
|
199
199
|
tt(() => {
|
|
200
200
|
X.current = W(K);
|
|
201
201
|
}, [K, W]), Y.current && (u = ke(u));
|
|
202
|
-
const J = u[u.length - 1], q = u[0], z = h && !c && (!O || u.length < 3), Re = ne(() => z && (_(h) || te(h)) ? _(h) ? [...h] : [{ ...h }, { ...h }] : [], [z, h]), k = f("slider"),
|
|
202
|
+
const J = u[u.length - 1], q = u[0], z = h && !c && (!O || u.length < 3), Re = ne(() => z && (_(h) || te(h)) ? _(h) ? [...h] : [{ ...h }, { ...h }] : [], [z, h]), k = f("slider"), oe = $(null), se = $({
|
|
203
203
|
left: 0,
|
|
204
204
|
height: 0,
|
|
205
205
|
top: 0,
|
|
206
206
|
width: 0
|
|
207
|
-
}), ie =
|
|
207
|
+
}), ie = $(!1), ae = $(0);
|
|
208
208
|
function le(n) {
|
|
209
209
|
const t = ke(n);
|
|
210
210
|
return O ? t : t[t.length - 1];
|
|
211
211
|
}
|
|
212
212
|
function Le(n) {
|
|
213
|
-
const t = n.map((
|
|
213
|
+
const t = n.map((r) => E(r));
|
|
214
214
|
return X.current = t, t;
|
|
215
215
|
}
|
|
216
216
|
function L(n, t) {
|
|
217
|
-
const
|
|
218
|
-
Ne(V), t === "inputValueChange" ? Y.current =
|
|
217
|
+
const r = Le(n), V = le(r);
|
|
218
|
+
Ne(V), t === "inputValueChange" ? Y.current = r.some((C, S) => C > r[S]) : Y.current = !1, ee(d.onChange) && d.onChange(V);
|
|
219
219
|
}
|
|
220
220
|
function D() {
|
|
221
221
|
if (ee(d.onAfterChange)) {
|
|
@@ -224,30 +224,30 @@ function vt(m, y) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
function Se(n) {
|
|
227
|
-
let [t,
|
|
228
|
-
return t >
|
|
227
|
+
let [t, r] = [u[0], u[u.length - 1]];
|
|
228
|
+
return t > r && ([t, r] = [r, t]), O ? n >= t && n <= r : n <= r;
|
|
229
229
|
}
|
|
230
230
|
function G(n, t) {
|
|
231
|
-
const { left:
|
|
232
|
-
let N = C, me = M ?
|
|
233
|
-
if (
|
|
231
|
+
const { left: r, top: V, width: C, height: S } = se.current;
|
|
232
|
+
let N = C, me = M ? r + C - n : n - r;
|
|
233
|
+
if (o && (N = S, me = M ? t - V : V + S - t), N <= 0)
|
|
234
234
|
return 0;
|
|
235
|
-
let
|
|
236
|
-
|
|
237
|
-
const Ue = P.find((he) =>
|
|
235
|
+
let j = Math.max(ze(me, N), 0);
|
|
236
|
+
j = Math.min(1, j);
|
|
237
|
+
const Ue = P.find((he) => j >= he.beginOffset && j <= he.endOffset), {
|
|
238
238
|
begin: ge,
|
|
239
239
|
beginOffset: de,
|
|
240
240
|
step: pe,
|
|
241
241
|
endOffset: We,
|
|
242
242
|
end: Ke
|
|
243
|
-
} = Ue, Xe =
|
|
243
|
+
} = Ue, Xe = j - de, Ye = We - de, Je = Xe / Ye * (Ke - ge), qe = Math.round(Je / pe);
|
|
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, r] = n;
|
|
248
|
+
t > r && ([t, r] = [r, t]);
|
|
249
|
+
const V = F(t), C = F(1 - r);
|
|
250
|
+
return o ? {
|
|
251
251
|
[M ? "top" : "bottom"]: V,
|
|
252
252
|
[M ? "bottom" : "top"]: C
|
|
253
253
|
} : {
|
|
@@ -255,10 +255,10 @@ function vt(m, y) {
|
|
|
255
255
|
[M ? "left" : "right"]: C
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
return
|
|
258
|
+
function $e(n) {
|
|
259
|
+
return o ? { [M ? "top" : "bottom"]: F(n) } : { [M ? "right" : "left"]: F(n) };
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function Be() {
|
|
262
262
|
const n = {
|
|
263
263
|
getTooltipContainer: d.getTooltipContainer,
|
|
264
264
|
formatTooltip: d.formatTooltip
|
|
@@ -266,26 +266,26 @@ function vt(m, y) {
|
|
|
266
266
|
return "tooltipPosition" in d && (n.tooltipPosition = p), "tooltipVisible" in d && (n.tooltipVisible = x), n;
|
|
267
267
|
}
|
|
268
268
|
function ue() {
|
|
269
|
-
se.current =
|
|
269
|
+
se.current = oe.current.getBoundingClientRect();
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function je(n) {
|
|
272
272
|
ue();
|
|
273
273
|
const t = G(n.clientX, n.clientY);
|
|
274
|
-
xe.draggableBar && Se(t) ? (ae.current = E(t),
|
|
274
|
+
xe.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
|
-
O && S - t > t - C ? (N[
|
|
279
|
+
const t = E(n), [r, V] = ft(t, u), C = u[r], S = u[V], N = u.slice(0);
|
|
280
|
+
O && S - t > t - C ? (N[r] = t, L(N, "jumpToClick")) : (N[V] = t, L(N, "jumpToClick")), D();
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Ae(n) {
|
|
283
283
|
L(n, "inputValueChange"), D();
|
|
284
284
|
}
|
|
285
|
-
function Ee(n, t,
|
|
285
|
+
function Ee(n, t, r) {
|
|
286
286
|
ie.current = !0;
|
|
287
287
|
const V = u.slice(0);
|
|
288
|
-
V[
|
|
288
|
+
V[r] = G(n, t), L(V, "mousemove");
|
|
289
289
|
}
|
|
290
290
|
function De() {
|
|
291
291
|
ie.current = !1, D();
|
|
@@ -293,15 +293,15 @@ function vt(m, y) {
|
|
|
293
293
|
function Fe(n, t) {
|
|
294
294
|
if (v)
|
|
295
295
|
return;
|
|
296
|
-
const
|
|
297
|
-
|
|
296
|
+
const r = u.slice(0);
|
|
297
|
+
r[t] = Pe(u[t], n), L(r);
|
|
298
298
|
}
|
|
299
299
|
function ce(n) {
|
|
300
|
-
const
|
|
300
|
+
const r = E(G(n.clientX, n.clientY)) - ae.current, V = u.map((C) => C + r);
|
|
301
301
|
V.every((C) => Oe(C)) && L(V, "mousemove");
|
|
302
302
|
}
|
|
303
303
|
function fe() {
|
|
304
|
-
|
|
304
|
+
we(window, "mousemove", ce), we(window, "mouseup", fe), D();
|
|
305
305
|
}
|
|
306
306
|
return /* @__PURE__ */ R(
|
|
307
307
|
"div",
|
|
@@ -317,25 +317,25 @@ function vt(m, y) {
|
|
|
317
317
|
className: ve(
|
|
318
318
|
k,
|
|
319
319
|
{
|
|
320
|
-
[`${k}-vertical`]:
|
|
320
|
+
[`${k}-vertical`]: o,
|
|
321
321
|
[`${k}-with-marks`]: a,
|
|
322
322
|
[`${k}-reverse`]: M,
|
|
323
|
-
[`${k}-rtl`]:
|
|
323
|
+
[`${k}-rtl`]: b
|
|
324
324
|
},
|
|
325
325
|
I
|
|
326
326
|
),
|
|
327
|
-
style:
|
|
327
|
+
style: B,
|
|
328
328
|
ref: y,
|
|
329
329
|
children: /* @__PURE__ */ Ve("div", { className: `${k}-wrapper`, children: [
|
|
330
330
|
/* @__PURE__ */ Ve(
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
|
-
ref:
|
|
333
|
+
ref: oe,
|
|
334
334
|
className: ve(`${k}-road`, {
|
|
335
335
|
[`${k}-road-disabled`]: v,
|
|
336
|
-
[`${k}-road-vertical`]:
|
|
336
|
+
[`${k}-road-vertical`]: o
|
|
337
337
|
}),
|
|
338
|
-
onMouseDown:
|
|
338
|
+
onMouseDown: je,
|
|
339
339
|
children: [
|
|
340
340
|
/* @__PURE__ */ R(
|
|
341
341
|
"div",
|
|
@@ -351,21 +351,21 @@ function vt(m, y) {
|
|
|
351
351
|
at,
|
|
352
352
|
{
|
|
353
353
|
intervalConfigs: P,
|
|
354
|
-
min:
|
|
354
|
+
min: w,
|
|
355
355
|
max: s,
|
|
356
356
|
valueRange: [q, J],
|
|
357
357
|
prefixCls: k,
|
|
358
|
-
vertical:
|
|
358
|
+
vertical: o,
|
|
359
359
|
reverse: M
|
|
360
360
|
}
|
|
361
361
|
),
|
|
362
362
|
/* @__PURE__ */ R(
|
|
363
|
-
|
|
363
|
+
ot,
|
|
364
364
|
{
|
|
365
|
-
data:
|
|
365
|
+
data: re,
|
|
366
366
|
intervalConfigs: P,
|
|
367
367
|
valueRange: [q, J],
|
|
368
|
-
vertical:
|
|
368
|
+
vertical: o,
|
|
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:
|
|
377
|
+
data: re,
|
|
378
378
|
intervalConfigs: P,
|
|
379
|
-
vertical:
|
|
379
|
+
vertical: o,
|
|
380
380
|
prefixCls: k,
|
|
381
381
|
reverse: M,
|
|
382
382
|
onMouseDown: H
|
|
383
383
|
}
|
|
384
384
|
),
|
|
385
385
|
u.map((n, t) => !O && t !== u.length - 1 ? null : /* @__PURE__ */ R(
|
|
386
|
-
|
|
386
|
+
rt,
|
|
387
387
|
{
|
|
388
|
-
style:
|
|
388
|
+
style: $e(Q(n, P)),
|
|
389
389
|
disabled: v,
|
|
390
390
|
prefixCls: k,
|
|
391
391
|
value: n,
|
|
392
392
|
maxValue: s,
|
|
393
|
-
minValue:
|
|
394
|
-
vertical:
|
|
395
|
-
|
|
393
|
+
minValue: w,
|
|
394
|
+
vertical: o,
|
|
395
|
+
...Be(),
|
|
396
396
|
onMoveBegin: ue,
|
|
397
|
-
onMoving: (
|
|
397
|
+
onMoving: (r, V) => Ee(r, V, t),
|
|
398
398
|
onMoveEnd: De,
|
|
399
|
-
onArrowEvent: (
|
|
399
|
+
onArrowEvent: (r) => Fe(r, t)
|
|
400
400
|
},
|
|
401
401
|
t
|
|
402
402
|
))
|
|
@@ -406,14 +406,14 @@ function vt(m, y) {
|
|
|
406
406
|
z && /* @__PURE__ */ R(
|
|
407
407
|
st,
|
|
408
408
|
{
|
|
409
|
-
min:
|
|
409
|
+
min: w,
|
|
410
410
|
max: s,
|
|
411
411
|
step: l,
|
|
412
412
|
value: u,
|
|
413
413
|
range: O,
|
|
414
414
|
disabled: v,
|
|
415
415
|
prefixCls: k,
|
|
416
|
-
onChange:
|
|
416
|
+
onChange: Ae,
|
|
417
417
|
extra: Re
|
|
418
418
|
}
|
|
419
419
|
)
|
package/slider/util.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { minus as
|
|
1
|
+
import { minus as i, times as d, plus as m, divide as l } from "@unicom-cloud/utils/math";
|
|
2
2
|
function I(t) {
|
|
3
3
|
const n = `${t}`.split(".")[1];
|
|
4
4
|
return n && n.length || 0;
|
|
@@ -10,7 +10,7 @@ function x(t, n) {
|
|
|
10
10
|
const e = Number(t);
|
|
11
11
|
if (n && !isNaN(e)) {
|
|
12
12
|
const [r, o] = n;
|
|
13
|
-
return l(
|
|
13
|
+
return l(i(e, r), i(o, r));
|
|
14
14
|
}
|
|
15
15
|
return 0;
|
|
16
16
|
}
|
|
@@ -31,7 +31,7 @@ function h(t, n) {
|
|
|
31
31
|
(r) => t >= r.begin && t <= r.end
|
|
32
32
|
);
|
|
33
33
|
if (e) {
|
|
34
|
-
const { beginOffset: r, begin: o, end:
|
|
34
|
+
const { beginOffset: r, begin: o, end: s, endOffset: f } = e, c = x(t, [o, s]), u = i(f, r), a = d(c, u);
|
|
35
35
|
return m(r, a);
|
|
36
36
|
}
|
|
37
37
|
}
|
package/space/index.js
CHANGED
|
@@ -2,16 +2,16 @@ import { jsx as a, jsxs as A } from "react/jsx-runtime";
|
|
|
2
2
|
import L from "lodash/isArray";
|
|
3
3
|
import M from "lodash/isNumber";
|
|
4
4
|
import P, { forwardRef as b, useContext as j } from "react";
|
|
5
|
-
import { a as k } from "../chunk/
|
|
5
|
+
import { a as k } from "../chunk/CQvM33Vg.js";
|
|
6
6
|
import { u as D } from "../chunk/BFTV6myl.js";
|
|
7
|
-
import
|
|
7
|
+
import F from "@unicom-cloud/utils/class-name";
|
|
8
8
|
import H from "./toArray.js";
|
|
9
9
|
const O = {
|
|
10
10
|
size: "small",
|
|
11
11
|
direction: "horizontal"
|
|
12
12
|
};
|
|
13
13
|
function V(c, m) {
|
|
14
|
-
const { getPrefixCls:
|
|
14
|
+
const { getPrefixCls: N, componentConfig: l, rtl: d } = j(k), v = D(
|
|
15
15
|
c,
|
|
16
16
|
O,
|
|
17
17
|
l == null ? void 0 : l.Space
|
|
@@ -22,20 +22,20 @@ function V(c, m) {
|
|
|
22
22
|
size: i,
|
|
23
23
|
direction: s,
|
|
24
24
|
align: w,
|
|
25
|
-
wrap:
|
|
26
|
-
split:
|
|
25
|
+
wrap: u,
|
|
26
|
+
split: f,
|
|
27
27
|
...B
|
|
28
|
-
} =
|
|
28
|
+
} = v, e = N("space"), $ = w || (s === "horizontal" ? "center" : ""), R = F(
|
|
29
29
|
e,
|
|
30
30
|
{
|
|
31
31
|
[`${e}-${s}`]: s,
|
|
32
32
|
[`${e}-align-${$}`]: $,
|
|
33
|
-
[`${e}-wrap`]:
|
|
33
|
+
[`${e}-wrap`]: u,
|
|
34
34
|
[`${e}-rtl`]: d
|
|
35
35
|
},
|
|
36
36
|
S
|
|
37
37
|
);
|
|
38
|
-
function
|
|
38
|
+
function p(r) {
|
|
39
39
|
if (M(r))
|
|
40
40
|
return r;
|
|
41
41
|
switch (r) {
|
|
@@ -55,8 +55,8 @@ function V(c, m) {
|
|
|
55
55
|
function z(r) {
|
|
56
56
|
const n = y.length === r + 1, o = d ? "marginLeft" : "marginRight";
|
|
57
57
|
if (typeof i == "string" || typeof i == "number") {
|
|
58
|
-
const t =
|
|
59
|
-
return
|
|
58
|
+
const t = p(i);
|
|
59
|
+
return u ? n ? { marginBottom: t } : {
|
|
60
60
|
[`${o}`]: t,
|
|
61
61
|
marginBottom: t
|
|
62
62
|
} : n ? {} : {
|
|
@@ -64,17 +64,17 @@ function V(c, m) {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
if (L(i)) {
|
|
67
|
-
const t =
|
|
68
|
-
return
|
|
67
|
+
const t = p(i[0]), g = p(i[1]);
|
|
68
|
+
return u ? n ? { marginBottom: g } : {
|
|
69
69
|
[`${o}`]: t,
|
|
70
70
|
marginBottom: g
|
|
71
71
|
} : s === "vertical" ? { marginBottom: g } : { [`${o}`]: t };
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
return /* @__PURE__ */ a("div", { ref: m, className: R, style: x, ...B, children: y.map((r, n) => {
|
|
75
|
-
const o = (r == null ? void 0 : r.key) || n, t =
|
|
75
|
+
const o = (r == null ? void 0 : r.key) || n, t = f != null && n > 0;
|
|
76
76
|
return /* @__PURE__ */ A(P.Fragment, { children: [
|
|
77
|
-
t && /* @__PURE__ */ a("div", { className: `${e}-item-split`, children:
|
|
77
|
+
t && /* @__PURE__ */ a("div", { className: `${e}-item-split`, children: f }),
|
|
78
78
|
/* @__PURE__ */ a("div", { className: `${e}-item`, style: z(n), children: r })
|
|
79
79
|
] }, o);
|
|
80
80
|
}) });
|