@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
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as E, jsxs as _t, Fragment as wt } from "react/jsx-runtime";
|
|
2
2
|
import Ft from "lodash/isFunction";
|
|
3
3
|
import dt from "lodash/isNumber";
|
|
4
|
-
import
|
|
4
|
+
import J, { useRef as H, useState as Ct, useMemo as Nt, useEffect as b, useImperativeHandle as Ut } from "react";
|
|
5
5
|
import kt from "../components/common/hooks/useForceUpdate.js";
|
|
6
6
|
import Vt from "../components/common/hooks/useIsFirstRender.js";
|
|
7
7
|
import jt from "../components/common/hooks/useIsomorphicLayoutEffect.js";
|
|
8
8
|
import Dt from "../components/common/hooks/usePrevious.js";
|
|
9
9
|
import Kt from "../components/common/hooks/useStateWithPromise.js";
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
10
|
+
import { resizeObserver as Bt } from "../components/common/utils/resizeObserver.js";
|
|
11
|
+
import ft from "./Filler.js";
|
|
12
12
|
import { findListDiffIndex as qt, getIndexByStartLoc as Gt } from "./util/algorithm.js";
|
|
13
|
-
import { getItemRelativeTop as
|
|
14
|
-
const Jt = 32,
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
Object.keys(
|
|
18
|
-
(
|
|
19
|
-
const
|
|
20
|
-
return
|
|
13
|
+
import { getItemRelativeTop as Q, getScrollPercentage as A, getItemAbsoluteTop as Wt, getRangeIndex as pt, getValidScrollTop as gt, GHOST_ITEM_KEY as Yt, getCompareItemRelativeTop as zt, getLocationItem as Xt, getLongestItemIndex as $t, getNodeHeight as ht } from "./util/item.js";
|
|
14
|
+
const Jt = 32, L = `__virtual_item_height_${Math.random().toFixed(5).slice(2)}`, Qt = (h) => {
|
|
15
|
+
const T = kt(), { current: f } = h;
|
|
16
|
+
b(() => {
|
|
17
|
+
Object.keys(f).length && !f[L] && (f[L] = Object.entries(f).reduce(
|
|
18
|
+
(_, [, x], m, S) => {
|
|
19
|
+
const w = _ + x;
|
|
20
|
+
return m === S.length - 1 ? Math.round(w / S.length) : w;
|
|
21
21
|
},
|
|
22
22
|
0
|
|
23
|
-
),
|
|
24
|
-
}, [Object.keys(
|
|
25
|
-
}, Zt = (
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
}, te =
|
|
23
|
+
), T());
|
|
24
|
+
}, [Object.keys(f).length]);
|
|
25
|
+
}, Zt = (h) => {
|
|
26
|
+
const T = H({}), f = H(h);
|
|
27
|
+
return b(() => {
|
|
28
|
+
f.current = h;
|
|
29
|
+
}, [h]), h !== f.current && (T.current = {}), (_, x, m) => (Object.prototype.hasOwnProperty.call(T.current, x) || (T.current[x] = h(_, x, m)), T.current[x]);
|
|
30
|
+
}, te = J.forwardRef((h, T) => {
|
|
31
31
|
const {
|
|
32
|
-
style:
|
|
33
|
-
className:
|
|
34
|
-
children:
|
|
35
|
-
data:
|
|
32
|
+
style: f,
|
|
33
|
+
className: _,
|
|
34
|
+
children: x,
|
|
35
|
+
data: m = [],
|
|
36
36
|
itemKey: S,
|
|
37
|
-
threshold:
|
|
38
|
-
wrapper:
|
|
39
|
-
height:
|
|
40
|
-
isStaticItemHeight:
|
|
41
|
-
itemHeight:
|
|
42
|
-
measureLongestItem:
|
|
43
|
-
scrollOptions:
|
|
44
|
-
onScroll:
|
|
45
|
-
needFiller:
|
|
46
|
-
outerStyle:
|
|
47
|
-
innerStyle:
|
|
48
|
-
wrapperChild:
|
|
37
|
+
threshold: w = 100,
|
|
38
|
+
wrapper: It = "div",
|
|
39
|
+
height: Tt = "100%",
|
|
40
|
+
isStaticItemHeight: K = !0,
|
|
41
|
+
itemHeight: xt,
|
|
42
|
+
measureLongestItem: Ht,
|
|
43
|
+
scrollOptions: St,
|
|
44
|
+
onScroll: Z,
|
|
45
|
+
needFiller: yt = !0,
|
|
46
|
+
outerStyle: tt,
|
|
47
|
+
innerStyle: et,
|
|
48
|
+
wrapperChild: B = J.Fragment,
|
|
49
49
|
...Et
|
|
50
|
-
} =
|
|
51
|
-
Qt(
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const t = (e) => +window.getComputedStyle(
|
|
50
|
+
} = h, k = f && f.maxHeight || Tt, F = H({}), [bt, Pt] = Ct(200), rt = Zt(x);
|
|
51
|
+
Qt(F);
|
|
52
|
+
const P = m.length, R = xt || F.current[L] || Jt, V = dt(k) ? k : bt, M = Math.ceil(V / R), q = R * P, I = w !== null && P >= w && q > V, o = H(null), y = H(null), C = H(!1), nt = H(I), ot = Nt(() => {
|
|
53
|
+
if (o.current) {
|
|
54
|
+
const t = (e) => +window.getComputedStyle(o.current)[e].replace(/\D/g, "");
|
|
55
55
|
return {
|
|
56
56
|
top: t("paddingTop"),
|
|
57
57
|
bottom: t("paddingBottom")
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
return { top: 0, bottom: 0 };
|
|
61
|
-
}, [
|
|
61
|
+
}, [o.current]), [i, N] = Kt({
|
|
62
62
|
// measure status
|
|
63
63
|
status: "NONE",
|
|
64
64
|
// render range info
|
|
@@ -69,309 +69,308 @@ const Jt = 32, _ = `__virtual_item_height_${Math.random().toFixed(5).slice(2)}`,
|
|
|
69
69
|
// scroll info
|
|
70
70
|
startItemTop: 0,
|
|
71
71
|
scrollTop: 0
|
|
72
|
-
}),
|
|
72
|
+
}), j = Dt(m) || [], Rt = Vt(), U = (t, e) => typeof S == "function" ? S(t, e) : typeof S == "string" ? t[S] : t.key || e, p = (t, e = m) => {
|
|
73
73
|
if (t === e.length)
|
|
74
74
|
return Yt;
|
|
75
|
-
const
|
|
76
|
-
return
|
|
77
|
-
},
|
|
78
|
-
const { itemIndex: e, relativeTop:
|
|
79
|
-
let
|
|
80
|
-
for (let
|
|
81
|
-
const
|
|
82
|
-
scrollTop:
|
|
83
|
-
scrollHeight:
|
|
75
|
+
const s = e[t];
|
|
76
|
+
return s !== void 0 ? U(s, t) : null;
|
|
77
|
+
}, g = (t) => F.current[t] || R, it = (t) => {
|
|
78
|
+
const { itemIndex: e, relativeTop: s } = t, { scrollHeight: r, clientHeight: l } = o.current, c = i.scrollTop, n = r - l;
|
|
79
|
+
let u = Number.MAX_VALUE, a = null, d = null, v = null, O = null, lt = null, W = 0;
|
|
80
|
+
for (let Y = 0; Y < n; Y++) {
|
|
81
|
+
const ct = Gt(0, n, c, Y), ut = A({
|
|
82
|
+
scrollTop: ct,
|
|
83
|
+
scrollHeight: r,
|
|
84
84
|
clientHeight: l
|
|
85
|
-
}), { itemIndex:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
}), { itemIndex: z, itemOffsetPtg: at, startIndex: X, endIndex: $ } = pt(
|
|
86
|
+
ut,
|
|
87
|
+
P,
|
|
88
|
+
M
|
|
89
89
|
);
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
itemHeight:
|
|
93
|
-
itemOffsetPtg:
|
|
90
|
+
if (X <= e && e <= $) {
|
|
91
|
+
const At = Q({
|
|
92
|
+
itemHeight: g(p(z)),
|
|
93
|
+
itemOffsetPtg: at,
|
|
94
94
|
clientHeight: l,
|
|
95
|
-
scrollPtg:
|
|
95
|
+
scrollPtg: ut
|
|
96
96
|
}), Lt = zt({
|
|
97
|
-
locatedItemRelativeTop:
|
|
98
|
-
locatedItemIndex:
|
|
97
|
+
locatedItemRelativeTop: At,
|
|
98
|
+
locatedItemIndex: z,
|
|
99
99
|
compareItemIndex: e,
|
|
100
|
-
startIndex:
|
|
101
|
-
endIndex:
|
|
102
|
-
itemHeight:
|
|
103
|
-
getItemKey:
|
|
104
|
-
itemElementHeights:
|
|
105
|
-
}),
|
|
106
|
-
|
|
100
|
+
startIndex: X,
|
|
101
|
+
endIndex: $,
|
|
102
|
+
itemHeight: R,
|
|
103
|
+
getItemKey: p,
|
|
104
|
+
itemElementHeights: F.current
|
|
105
|
+
}), mt = Math.abs(Lt - s);
|
|
106
|
+
mt < u ? (u = mt, a = ct, d = z, v = at, O = X, lt = $, W = 0) : W += 1;
|
|
107
107
|
}
|
|
108
|
-
if (
|
|
108
|
+
if (W > 10)
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
...
|
|
111
|
+
a !== null && (C.current = !0, o.current.scrollTop = a, N({
|
|
112
|
+
...i,
|
|
113
113
|
status: "MEASURE_START",
|
|
114
|
-
scrollTop:
|
|
115
|
-
itemIndex:
|
|
116
|
-
itemOffsetPtg:
|
|
117
|
-
startIndex:
|
|
118
|
-
endIndex:
|
|
119
|
-
})),
|
|
120
|
-
|
|
114
|
+
scrollTop: a,
|
|
115
|
+
itemIndex: d,
|
|
116
|
+
itemOffsetPtg: v,
|
|
117
|
+
startIndex: O,
|
|
118
|
+
endIndex: lt
|
|
119
|
+
})), y.current = requestAnimationFrame(() => {
|
|
120
|
+
C.current = !1;
|
|
121
121
|
});
|
|
122
122
|
}, Mt = (t) => {
|
|
123
123
|
const {
|
|
124
124
|
scrollTop: e,
|
|
125
|
-
clientHeight:
|
|
126
|
-
scrollHeight:
|
|
127
|
-
} =
|
|
125
|
+
clientHeight: s,
|
|
126
|
+
scrollHeight: r
|
|
127
|
+
} = o.current, l = gt(
|
|
128
128
|
e,
|
|
129
|
-
|
|
130
|
-
),
|
|
129
|
+
r - s
|
|
130
|
+
), c = A({
|
|
131
131
|
scrollTop: l,
|
|
132
|
-
clientHeight:
|
|
133
|
-
scrollHeight:
|
|
134
|
-
}), { index:
|
|
135
|
-
|
|
136
|
-
...
|
|
132
|
+
clientHeight: s,
|
|
133
|
+
scrollHeight: r
|
|
134
|
+
}), { index: n, offsetPtg: u } = Xt(c, P);
|
|
135
|
+
N({
|
|
136
|
+
...i,
|
|
137
137
|
scrollTop: l,
|
|
138
|
-
itemIndex:
|
|
139
|
-
itemOffsetPtg:
|
|
140
|
-
}), t && (
|
|
141
|
-
},
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
itemIndex: n,
|
|
139
|
+
itemOffsetPtg: u
|
|
140
|
+
}), t && Z?.(t, { index: n });
|
|
141
|
+
}, st = (t, e = !1) => {
|
|
142
|
+
const s = q, { scrollTop: r, clientHeight: l } = o.current, c = gt(
|
|
143
|
+
r,
|
|
144
|
+
s - l
|
|
145
145
|
);
|
|
146
|
-
if (!e && (
|
|
146
|
+
if (!e && (c === i.scrollTop || C.current))
|
|
147
147
|
return;
|
|
148
|
-
const
|
|
149
|
-
scrollTop:
|
|
148
|
+
const n = A({
|
|
149
|
+
scrollTop: c,
|
|
150
150
|
clientHeight: l,
|
|
151
|
-
scrollHeight:
|
|
152
|
-
}), { itemIndex:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
scrollHeight: s
|
|
152
|
+
}), { itemIndex: u, itemOffsetPtg: a, startIndex: d, endIndex: v } = pt(
|
|
153
|
+
n,
|
|
154
|
+
P,
|
|
155
|
+
M
|
|
156
156
|
);
|
|
157
|
-
|
|
158
|
-
...
|
|
159
|
-
scrollTop:
|
|
160
|
-
itemIndex:
|
|
161
|
-
itemOffsetPtg:
|
|
162
|
-
startIndex:
|
|
163
|
-
endIndex:
|
|
157
|
+
N({
|
|
158
|
+
...i,
|
|
159
|
+
scrollTop: c,
|
|
160
|
+
itemIndex: u,
|
|
161
|
+
itemOffsetPtg: a,
|
|
162
|
+
startIndex: d,
|
|
163
|
+
endIndex: v,
|
|
164
164
|
status: "MEASURE_START"
|
|
165
|
-
}), t && (
|
|
165
|
+
}), t && Z?.(t, { index: u });
|
|
166
166
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}, []),
|
|
170
|
-
|
|
171
|
-
}, [
|
|
172
|
-
if (!
|
|
167
|
+
b(() => () => {
|
|
168
|
+
y.current && cancelAnimationFrame(y.current);
|
|
169
|
+
}, []), b(() => {
|
|
170
|
+
o.current && (Rt && (o.current.scrollTop = 0), st(null, !0));
|
|
171
|
+
}, [M]), b(() => {
|
|
172
|
+
if (!o.current)
|
|
173
173
|
return;
|
|
174
174
|
let t = null;
|
|
175
|
-
const e =
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
t =
|
|
175
|
+
const e = nt.current !== I ? I ? "virtual" : "raw" : "";
|
|
176
|
+
if (nt.current = I, V && j.length !== m.length) {
|
|
177
|
+
const s = qt(j, m, U);
|
|
178
|
+
t = s ? s.index : null;
|
|
179
179
|
}
|
|
180
|
-
if (e ||
|
|
181
|
-
const { clientHeight:
|
|
182
|
-
itemHeight:
|
|
183
|
-
|
|
180
|
+
if (e || I && t) {
|
|
181
|
+
const { clientHeight: s } = o.current, r = Q({
|
|
182
|
+
itemHeight: g(
|
|
183
|
+
p(i.itemIndex, j)
|
|
184
184
|
),
|
|
185
|
-
itemOffsetPtg:
|
|
186
|
-
scrollPtg:
|
|
187
|
-
scrollTop:
|
|
188
|
-
scrollHeight:
|
|
189
|
-
clientHeight:
|
|
185
|
+
itemOffsetPtg: i.itemOffsetPtg,
|
|
186
|
+
scrollPtg: A({
|
|
187
|
+
scrollTop: i.scrollTop,
|
|
188
|
+
scrollHeight: j.length * R,
|
|
189
|
+
clientHeight: s
|
|
190
190
|
}),
|
|
191
|
-
clientHeight:
|
|
191
|
+
clientHeight: s
|
|
192
192
|
});
|
|
193
193
|
if (e === "raw") {
|
|
194
|
-
let l =
|
|
195
|
-
for (let
|
|
196
|
-
l -=
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
let l = r;
|
|
195
|
+
for (let c = 0; c < i.itemIndex; c++)
|
|
196
|
+
l -= g(p(c));
|
|
197
|
+
o.current.scrollTop = -l, C.current = !0, y.current = requestAnimationFrame(() => {
|
|
198
|
+
C.current = !1;
|
|
199
199
|
});
|
|
200
200
|
} else
|
|
201
|
-
|
|
202
|
-
itemIndex:
|
|
203
|
-
relativeTop:
|
|
201
|
+
it({
|
|
202
|
+
itemIndex: i.itemIndex,
|
|
203
|
+
relativeTop: r
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
|
-
}, [
|
|
207
|
-
if (
|
|
208
|
-
const { scrollTop: t, scrollHeight: e, clientHeight:
|
|
206
|
+
}, [m, I]), jt(() => {
|
|
207
|
+
if (i.status === "MEASURE_START" && o.current) {
|
|
208
|
+
const { scrollTop: t, scrollHeight: e, clientHeight: s } = o.current, r = A({
|
|
209
209
|
scrollTop: t,
|
|
210
210
|
scrollHeight: e,
|
|
211
|
-
clientHeight:
|
|
211
|
+
clientHeight: s
|
|
212
212
|
});
|
|
213
213
|
let l = Wt({
|
|
214
|
-
scrollPtg:
|
|
215
|
-
clientHeight:
|
|
216
|
-
scrollTop: t - (
|
|
217
|
-
itemHeight:
|
|
218
|
-
itemOffsetPtg:
|
|
214
|
+
scrollPtg: r,
|
|
215
|
+
clientHeight: s,
|
|
216
|
+
scrollTop: t - (ot.top + ot.bottom) * r,
|
|
217
|
+
itemHeight: g(p(i.itemIndex)),
|
|
218
|
+
itemOffsetPtg: i.itemOffsetPtg
|
|
219
219
|
});
|
|
220
|
-
for (let
|
|
221
|
-
l -=
|
|
222
|
-
|
|
223
|
-
...
|
|
220
|
+
for (let c = i.itemIndex - 1; c >= i.startIndex; c--)
|
|
221
|
+
l -= g(p(c));
|
|
222
|
+
N({
|
|
223
|
+
...i,
|
|
224
224
|
startItemTop: l,
|
|
225
225
|
status: "MEASURE_DONE"
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
-
}, [
|
|
229
|
-
|
|
228
|
+
}, [i]), Ut(
|
|
229
|
+
T,
|
|
230
230
|
() => ({
|
|
231
|
-
dom:
|
|
232
|
-
getRootDOMNode: () =>
|
|
231
|
+
dom: o.current,
|
|
232
|
+
getRootDOMNode: () => o.current,
|
|
233
233
|
// Scroll to a certain height or an element
|
|
234
234
|
scrollTo: (t) => {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if (!i.current)
|
|
235
|
+
y.current && cancelAnimationFrame(y.current), y.current = requestAnimationFrame(() => {
|
|
236
|
+
if (!o.current)
|
|
238
237
|
return;
|
|
239
238
|
if (typeof t == "number") {
|
|
240
|
-
|
|
239
|
+
o.current.scrollTop = t;
|
|
241
240
|
return;
|
|
242
241
|
}
|
|
243
|
-
const e = "index" in t ? t.index : "key" in t ?
|
|
244
|
-
(
|
|
245
|
-
) : 0,
|
|
246
|
-
if (!
|
|
242
|
+
const e = "index" in t ? t.index : "key" in t ? m.findIndex(
|
|
243
|
+
(n, u) => U(n, u) === t.key
|
|
244
|
+
) : 0, s = m[e];
|
|
245
|
+
if (!s)
|
|
247
246
|
return;
|
|
248
|
-
let
|
|
249
|
-
const { clientHeight: l, scrollTop:
|
|
250
|
-
if (
|
|
251
|
-
if (
|
|
252
|
-
const { itemIndex:
|
|
253
|
-
if (Math.abs(
|
|
254
|
-
let
|
|
255
|
-
itemHeight:
|
|
247
|
+
let r = typeof t == "object" && t.options?.block ? t.options.block : St?.block || "nearest";
|
|
248
|
+
const { clientHeight: l, scrollTop: c } = o.current;
|
|
249
|
+
if (I && !K) {
|
|
250
|
+
if (r === "nearest") {
|
|
251
|
+
const { itemIndex: n, itemOffsetPtg: u } = i;
|
|
252
|
+
if (Math.abs(n - e) < M) {
|
|
253
|
+
let a = Q({
|
|
254
|
+
itemHeight: g(p(n)),
|
|
256
255
|
itemOffsetPtg: u,
|
|
257
256
|
clientHeight: l,
|
|
258
|
-
scrollPtg:
|
|
257
|
+
scrollPtg: A(o.current)
|
|
259
258
|
});
|
|
260
|
-
if (e <
|
|
261
|
-
for (let
|
|
262
|
-
|
|
259
|
+
if (e < n)
|
|
260
|
+
for (let d = e; d < n; d++)
|
|
261
|
+
a -= g(p(d));
|
|
263
262
|
else
|
|
264
|
-
for (let
|
|
265
|
-
|
|
266
|
-
if (
|
|
267
|
-
|
|
263
|
+
for (let d = n; d < e; d++)
|
|
264
|
+
a += g(p(d));
|
|
265
|
+
if (a < 0 || a > l)
|
|
266
|
+
r = a < 0 ? "start" : "end";
|
|
268
267
|
else
|
|
269
268
|
return;
|
|
270
269
|
} else
|
|
271
|
-
|
|
270
|
+
r = e < n ? "start" : "end";
|
|
272
271
|
}
|
|
273
|
-
|
|
274
|
-
...
|
|
275
|
-
startIndex: Math.max(0, e -
|
|
276
|
-
endIndex: Math.min(
|
|
272
|
+
N({
|
|
273
|
+
...i,
|
|
274
|
+
startIndex: Math.max(0, e - M),
|
|
275
|
+
endIndex: Math.min(P - 1, e + M)
|
|
277
276
|
}).then(() => {
|
|
278
|
-
const
|
|
279
|
-
|
|
277
|
+
const n = g(U(s, e));
|
|
278
|
+
it({
|
|
280
279
|
itemIndex: e,
|
|
281
|
-
relativeTop:
|
|
280
|
+
relativeTop: r === "start" ? 0 : (l - n) / (r === "center" ? 2 : 1)
|
|
282
281
|
});
|
|
283
282
|
});
|
|
284
283
|
} else {
|
|
285
|
-
const
|
|
286
|
-
|
|
284
|
+
const n = g(
|
|
285
|
+
p(e)
|
|
287
286
|
);
|
|
288
287
|
let u = 0;
|
|
289
288
|
for (let O = 0; O < e; O++)
|
|
290
|
-
u +=
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
289
|
+
u += g(p(O));
|
|
290
|
+
const a = u + n, d = u + n / 2;
|
|
291
|
+
if (d > c && d < l + c)
|
|
293
292
|
return;
|
|
294
|
-
|
|
295
|
-
const
|
|
296
|
-
|
|
293
|
+
r === "nearest" && (u < c ? r = "start" : a > c + l && (r = "end"));
|
|
294
|
+
const v = l - n;
|
|
295
|
+
o.current.scrollTop = u - (r === "start" ? 0 : v / (r === "center" ? 2 : 1));
|
|
297
296
|
}
|
|
298
297
|
});
|
|
299
298
|
}
|
|
300
299
|
}),
|
|
301
|
-
[
|
|
300
|
+
[m, R, i]
|
|
302
301
|
);
|
|
303
|
-
const
|
|
304
|
-
const l = e +
|
|
302
|
+
const G = (t, e) => t.map((s, r) => {
|
|
303
|
+
const l = e + r, c = rt(s, l, {
|
|
305
304
|
style: {},
|
|
306
|
-
itemIndex:
|
|
307
|
-
}),
|
|
308
|
-
return
|
|
309
|
-
key:
|
|
310
|
-
ref: (
|
|
311
|
-
const { current:
|
|
312
|
-
|
|
305
|
+
itemIndex: r
|
|
306
|
+
}), n = U(s, l);
|
|
307
|
+
return J.cloneElement(c, {
|
|
308
|
+
key: n,
|
|
309
|
+
ref: (u) => {
|
|
310
|
+
const { current: a } = F;
|
|
311
|
+
u && i.status === "MEASURE_START" && (!K || a[n] === void 0) && (K ? (a[L] || (a[L] = ht(u, !0)), a[n] = a[L]) : a[n] = ht(u, !0)), Ft(c?.ref) && c?.ref(u);
|
|
313
312
|
}
|
|
314
313
|
});
|
|
315
|
-
}),
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}, [
|
|
314
|
+
}), D = H(null);
|
|
315
|
+
b(() => {
|
|
316
|
+
D.current = null;
|
|
317
|
+
}, [m]);
|
|
319
318
|
const vt = () => {
|
|
320
|
-
if (
|
|
321
|
-
const t =
|
|
322
|
-
return
|
|
319
|
+
if (Ht) {
|
|
320
|
+
const t = D.current === null ? $t(m) : D.current, e = m[t];
|
|
321
|
+
return D.current = t, e ? /* @__PURE__ */ E("div", { style: { height: 1, overflow: "hidden", opacity: 0 }, children: rt(e, t, { style: {} }) }) : null;
|
|
323
322
|
}
|
|
324
323
|
return null;
|
|
325
324
|
};
|
|
326
|
-
function
|
|
327
|
-
if (
|
|
328
|
-
const { clientHeight: t } =
|
|
325
|
+
function Ot() {
|
|
326
|
+
if (o.current && !dt(k)) {
|
|
327
|
+
const { clientHeight: t } = o.current;
|
|
329
328
|
Pt(t);
|
|
330
329
|
}
|
|
331
330
|
}
|
|
332
|
-
return
|
|
333
|
-
const t = Bt([
|
|
331
|
+
return b(() => {
|
|
332
|
+
const t = Bt([o.current], Ot);
|
|
334
333
|
return () => {
|
|
335
334
|
t();
|
|
336
335
|
};
|
|
337
|
-
}, [
|
|
338
|
-
|
|
336
|
+
}, [o.current]), /* @__PURE__ */ E(
|
|
337
|
+
It,
|
|
339
338
|
{
|
|
340
|
-
ref:
|
|
339
|
+
ref: o,
|
|
341
340
|
style: {
|
|
342
341
|
overflowY: "auto",
|
|
343
342
|
scrollSnapType: "y mandatory",
|
|
344
343
|
overflowAnchor: "none",
|
|
345
|
-
...
|
|
346
|
-
maxHeight:
|
|
344
|
+
...f,
|
|
345
|
+
maxHeight: k
|
|
347
346
|
},
|
|
348
|
-
className:
|
|
349
|
-
onScroll:
|
|
347
|
+
className: _,
|
|
348
|
+
onScroll: I ? st : Mt,
|
|
350
349
|
...Et,
|
|
351
|
-
children:
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
|
|
350
|
+
children: I ? /* @__PURE__ */ _t(wt, { children: [
|
|
351
|
+
/* @__PURE__ */ E(
|
|
352
|
+
ft,
|
|
354
353
|
{
|
|
355
|
-
height:
|
|
356
|
-
outerStyle:
|
|
357
|
-
innerStyle:
|
|
358
|
-
offset:
|
|
359
|
-
children: /* @__PURE__ */
|
|
360
|
-
|
|
361
|
-
|
|
354
|
+
height: q,
|
|
355
|
+
outerStyle: tt,
|
|
356
|
+
innerStyle: et,
|
|
357
|
+
offset: i.status === "MEASURE_DONE" ? i.startItemTop : 0,
|
|
358
|
+
children: /* @__PURE__ */ E(B, { children: G(
|
|
359
|
+
m.slice(i.startIndex, i.endIndex + 1),
|
|
360
|
+
i.startIndex
|
|
362
361
|
) })
|
|
363
362
|
}
|
|
364
363
|
),
|
|
365
364
|
vt()
|
|
366
|
-
] }) :
|
|
367
|
-
|
|
365
|
+
] }) : yt ? /* @__PURE__ */ E(
|
|
366
|
+
ft,
|
|
368
367
|
{
|
|
369
|
-
height:
|
|
370
|
-
outerStyle:
|
|
371
|
-
innerStyle:
|
|
372
|
-
children: /* @__PURE__ */
|
|
368
|
+
height: V,
|
|
369
|
+
outerStyle: tt,
|
|
370
|
+
innerStyle: et,
|
|
371
|
+
children: /* @__PURE__ */ E(B, { children: G(m, 0) })
|
|
373
372
|
}
|
|
374
|
-
) : /* @__PURE__ */
|
|
373
|
+
) : /* @__PURE__ */ E(B, { children: G(m, 0) })
|
|
375
374
|
}
|
|
376
375
|
);
|
|
377
376
|
});
|
|
@@ -78,10 +78,9 @@ function y({
|
|
|
78
78
|
function S(n) {
|
|
79
79
|
let e = -1, o = 0;
|
|
80
80
|
return n.forEach((t, f) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
c > o && (o = c, e = f);
|
|
81
|
+
if (t = typeof t == "string" ? t : t.props?.children, typeof t == "string") {
|
|
82
|
+
const r = m(t);
|
|
83
|
+
r > o && (o = r, e = f);
|
|
85
84
|
}
|
|
86
85
|
}), e;
|
|
87
86
|
}
|