vane-waterfall 1.0.4 → 2.0.0
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/README.md +174 -365
- package/dist/chunks/WaterfallCore-BSXw7bl_.js +581 -0
- package/dist/chunks/doc-3Fpag2G8.js +84 -0
- package/dist/chunks/doc-78xF08vt.js +82 -0
- package/dist/chunks/doc-B-7dugGv.js +79 -0
- package/dist/chunks/doc-B6kLfMPv.js +121 -0
- package/dist/chunks/doc-BCGQ8Cp5.js +114 -0
- package/dist/chunks/doc-BIzjYAZW.js +50 -0
- package/dist/chunks/doc-BP0DmB7-.js +91 -0
- package/dist/chunks/doc-BXElhF2h.js +138 -0
- package/dist/chunks/doc-BXSy2aPP.js +59 -0
- package/dist/chunks/doc-BfWnfTst.js +83 -0
- package/dist/chunks/doc-BtzhgTYj.js +85 -0
- package/dist/chunks/doc-C5xrHNoC.js +70 -0
- package/dist/chunks/doc-CBHjiDG7.js +88 -0
- package/dist/chunks/doc-CTUoMe7o.js +79 -0
- package/dist/chunks/doc-CcPFavOs.js +56 -0
- package/dist/chunks/doc-CraXjOaA.js +68 -0
- package/dist/chunks/doc-DElLNjIc.js +61 -0
- package/dist/chunks/doc-DJjxOYzW.js +111 -0
- package/dist/chunks/doc-DukOmDCo.js +95 -0
- package/dist/chunks/doc-DzvTrZ13.js +60 -0
- package/dist/chunks/doc-NhL4Ux8q.js +125 -0
- package/dist/chunks/doc-bTHwfIVb.js +78 -0
- package/dist/chunks/doc-f4Uijujv.js +102 -0
- package/dist/chunks/doc-gTAsLjVx.js +55 -0
- package/dist/chunks/doc-j4W9SUrY.js +76 -0
- package/dist/chunks/doc-kTbJE7rY.js +92 -0
- package/dist/chunks/index-BAWlVYr3.js +5 -0
- package/dist/chunks/index-COaun3nf.js +15 -0
- package/dist/chunks/index-DXAtA2f6.js +11 -0
- package/dist/chunks/index-DsRLmBW-.js +13 -0
- package/dist/chunks/index-gjoCq0yC.js +21 -0
- package/dist/chunks/index-wLI6UXkY.js +5 -0
- package/dist/chunks/withPlugins-DLoKg4AP.js +559 -0
- package/dist/components/WaterfallPlugin/WaterfallCore.d.ts +124 -0
- package/dist/components/WaterfallPlugin/WaterfallCore.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/index.d.ts +9 -10
- package/dist/components/WaterfallPlugin/index.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/layout.d.ts +41 -0
- package/dist/components/WaterfallPlugin/layout.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/plugins/types.d.ts +76 -380
- package/dist/components/WaterfallPlugin/plugins/types.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/virtualize.d.ts +62 -0
- package/dist/components/WaterfallPlugin/virtualize.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/{plugins/withPlugins.d.ts → withPlugins.d.ts} +4 -2
- package/dist/components/WaterfallPlugin/withPlugins.d.ts.map +1 -0
- package/dist/custom-plugins/A11yPlugin/create.d.ts +23 -0
- package/dist/custom-plugins/A11yPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/A11yPlugin/doc.json.d.ts +52 -0
- package/dist/custom-plugins/A11yPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/A11yPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/A11yPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Alignment/index.d.ts → custom-plugins/AlignmentPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/AlignmentPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/AlignmentPlugin/doc.json.d.ts +34 -0
- package/dist/custom-plugins/AlignmentPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/AlignmentPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/AlignmentPlugin/index.js +5 -0
- package/dist/custom-plugins/AutoColumnPlugin/create.d.ts +18 -0
- package/dist/custom-plugins/AutoColumnPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/AutoColumnPlugin/doc.json.d.ts +50 -0
- package/dist/custom-plugins/AutoColumnPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/AutoColumnPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/AutoColumnPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Bookmark/index.d.ts → custom-plugins/BookmarkPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/BookmarkPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/BookmarkPlugin/doc.json.d.ts +41 -0
- package/dist/custom-plugins/BookmarkPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/BookmarkPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/BookmarkPlugin/index.js +5 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts +25 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/doc.json.d.ts +41 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/DebounceLayout/index.d.ts → custom-plugins/DebounceLayoutPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/DebounceLayoutPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/DebounceLayoutPlugin/doc.json.d.ts +34 -0
- package/dist/custom-plugins/DebounceLayoutPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/DebounceLayoutPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/DebounceLayoutPlugin/index.js +5 -0
- package/dist/custom-plugins/DragReorderPlugin/create.d.ts +33 -0
- package/dist/custom-plugins/DragReorderPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/DragReorderPlugin/doc.json.d.ts +53 -0
- package/dist/custom-plugins/DragReorderPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/DragReorderPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/DragReorderPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Filter/index.d.ts → custom-plugins/FilterPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/FilterPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/FilterPlugin/doc.json.d.ts +47 -0
- package/dist/custom-plugins/FilterPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/FilterPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/FilterPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/FixedHeight/index.d.ts → custom-plugins/FixedHeightPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/FixedHeightPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/FixedHeightPlugin/doc.json.d.ts +34 -0
- package/dist/custom-plugins/FixedHeightPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/FixedHeightPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/FixedHeightPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Gap/index.d.ts → custom-plugins/GapPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/GapPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/GapPlugin/doc.json.d.ts +47 -0
- package/dist/custom-plugins/GapPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/GapPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/GapPlugin/index.js +5 -0
- package/dist/custom-plugins/GroupingPlugin/create.d.ts +16 -0
- package/dist/custom-plugins/GroupingPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/GroupingPlugin/doc.json.d.ts +40 -0
- package/dist/custom-plugins/GroupingPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/GroupingPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/GroupingPlugin/index.js +5 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts +31 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/doc.json.d.ts +43 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.js +5 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/create.d.ts +17 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/doc.json.d.ts +44 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Pagination/index.d.ts → custom-plugins/PaginationPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/PaginationPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/PaginationPlugin/doc.json.d.ts +50 -0
- package/dist/custom-plugins/PaginationPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/PaginationPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/PaginationPlugin/index.js +5 -0
- package/dist/custom-plugins/PinItemPlugin/create.d.ts +23 -0
- package/dist/custom-plugins/PinItemPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/PinItemPlugin/doc.json.d.ts +43 -0
- package/dist/custom-plugins/PinItemPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/PinItemPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/PinItemPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Recycle/index.d.ts → custom-plugins/RecyclePlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/RecyclePlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/RecyclePlugin/doc.json.d.ts +35 -0
- package/dist/custom-plugins/RecyclePlugin/index.d.ts +11 -0
- package/dist/custom-plugins/RecyclePlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/RecyclePlugin/index.js +5 -0
- package/dist/custom-plugins/ReducedMotionPlugin/create.d.ts +25 -0
- package/dist/custom-plugins/ReducedMotionPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ReducedMotionPlugin/doc.json.d.ts +42 -0
- package/dist/custom-plugins/ReducedMotionPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/ReducedMotionPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ReducedMotionPlugin/index.js +5 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/create.d.ts +22 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/doc.json.d.ts +37 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/index.d.ts +10 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/ScrollAnchor/index.d.ts → custom-plugins/ScrollAnchorPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/ScrollAnchorPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ScrollAnchorPlugin/doc.json.d.ts +34 -0
- package/dist/custom-plugins/ScrollAnchorPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/ScrollAnchorPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ScrollAnchorPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Search/index.d.ts → custom-plugins/SearchPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/SearchPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/SearchPlugin/doc.json.d.ts +47 -0
- package/dist/custom-plugins/SearchPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/SearchPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/SearchPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Sort/index.d.ts → custom-plugins/SortPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/SortPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/SortPlugin/doc.json.d.ts +46 -0
- package/dist/custom-plugins/SortPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/SortPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/SortPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/StatePersistence/index.d.ts → custom-plugins/StatePersistencePlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/StatePersistencePlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/StatePersistencePlugin/doc.json.d.ts +47 -0
- package/dist/custom-plugins/StatePersistencePlugin/index.d.ts +11 -0
- package/dist/custom-plugins/StatePersistencePlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/StatePersistencePlugin/index.js +5 -0
- package/dist/custom-plugins/StickyHeaderPlugin/create.d.ts +13 -0
- package/dist/custom-plugins/StickyHeaderPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/StickyHeaderPlugin/doc.json.d.ts +40 -0
- package/dist/custom-plugins/StickyHeaderPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/StickyHeaderPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/StickyHeaderPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Throttle/index.d.ts → custom-plugins/ThrottlePlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/ThrottlePlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ThrottlePlugin/doc.json.d.ts +40 -0
- package/dist/custom-plugins/ThrottlePlugin/index.d.ts +11 -0
- package/dist/custom-plugins/ThrottlePlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ThrottlePlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Transition/index.d.ts → custom-plugins/TransitionPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/TransitionPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/TransitionPlugin/doc.json.d.ts +43 -0
- package/dist/custom-plugins/TransitionPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/TransitionPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/TransitionPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/URLSync/index.d.ts → custom-plugins/URLSyncPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/URLSyncPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/URLSyncPlugin/doc.json.d.ts +41 -0
- package/dist/custom-plugins/URLSyncPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/URLSyncPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/URLSyncPlugin/index.js +5 -0
- package/dist/custom-plugins/index.d.ts +61 -0
- package/dist/custom-plugins/index.d.ts.map +1 -0
- package/dist/custom-plugins/index.js +34 -0
- package/dist/entries/core.d.ts +8 -0
- package/dist/entries/core.d.ts.map +1 -0
- package/dist/entries/core.js +7 -0
- package/dist/entries/plugins.d.ts +7 -0
- package/dist/entries/plugins.d.ts.map +1 -0
- package/dist/entries/plugins.js +36 -0
- package/dist/index.d.ts +14 -9
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/presets/dashboard/index.d.ts +13 -0
- package/dist/presets/dashboard/index.d.ts.map +1 -0
- package/dist/presets/dashboard/index.js +21 -0
- package/dist/presets/photo-feed/index.d.ts +13 -0
- package/dist/presets/photo-feed/index.d.ts.map +1 -0
- package/dist/presets/photo-feed/index.js +17 -0
- package/dist/presets/product-feed/index.d.ts +9 -0
- package/dist/presets/product-feed/index.d.ts.map +1 -0
- package/dist/presets/product-feed/index.js +23 -0
- package/package.json +222 -82
- package/dist/404.jpg +0 -0
- package/dist/components/WaterfallPlugin/core/WaterfallCore.d.ts +0 -174
- package/dist/components/WaterfallPlugin/custom-plugins/A11y/index.d.ts +0 -16
- package/dist/components/WaterfallPlugin/custom-plugins/AutoColumn/index.d.ts +0 -17
- package/dist/components/WaterfallPlugin/custom-plugins/ClickAnalytics/index.d.ts +0 -12
- package/dist/components/WaterfallPlugin/custom-plugins/DragReorder/index.d.ts +0 -13
- package/dist/components/WaterfallPlugin/custom-plugins/Grouping/index.d.ts +0 -12
- package/dist/components/WaterfallPlugin/custom-plugins/HeatmapAnalytics/index.d.ts +0 -14
- package/dist/components/WaterfallPlugin/custom-plugins/InfiniteScroll/index.d.ts +0 -13
- package/dist/components/WaterfallPlugin/custom-plugins/PinItem/index.d.ts +0 -13
- package/dist/components/WaterfallPlugin/custom-plugins/ReducedMotion/index.d.ts +0 -13
- package/dist/components/WaterfallPlugin/custom-plugins/ResponsiveColumns/index.d.ts +0 -10
- package/dist/components/WaterfallPlugin/custom-plugins/StickyHeader/index.d.ts +0 -11
- package/dist/components/WaterfallPlugin/custom-plugins/VirtualWaterfall/index.d.ts +0 -12
- package/dist/components/WaterfallPlugin/custom-plugins/index.d.ts +0 -30
- package/dist/components/WaterfallPlugin/plugins/PluginBus.d.ts +0 -2
- package/dist/components/WaterfallPlugin/plugins/PluginManager.d.ts +0 -2
- package/dist/components/WaterfallPlugin/plugins/index.d.ts +0 -8
- package/dist/index.es.js +0 -2382
- package/dist/index.umd.js +0 -30
- package/dist/vite.svg +0 -1
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { ItemKeyExtractor, ItemPosition, LayoutInfo, ViewportInfo } from '../plugins/types';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
export interface WaterfallCoreProps<T = any> {
|
|
4
|
-
/**
|
|
5
|
-
* 数据源
|
|
6
|
-
*/
|
|
7
|
-
items: T[];
|
|
8
|
-
/**
|
|
9
|
-
* 渲染函数
|
|
10
|
-
*/
|
|
11
|
-
renderItem: (item: T, index: number) => React.ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* 键提取函数(用于 React key)
|
|
14
|
-
*/
|
|
15
|
-
keyExtractor?: ItemKeyExtractor<T>;
|
|
16
|
-
/**
|
|
17
|
-
* 列数(可由插件动态计算)
|
|
18
|
-
*/
|
|
19
|
-
columns?: number;
|
|
20
|
-
/**
|
|
21
|
-
* 列间距
|
|
22
|
-
*/
|
|
23
|
-
gap?: number;
|
|
24
|
-
/**
|
|
25
|
-
* 行间距(可选,默认等于 gap)
|
|
26
|
-
*/
|
|
27
|
-
rowGap?: number;
|
|
28
|
-
/**
|
|
29
|
-
* 列间距(可选,默认等于 gap)
|
|
30
|
-
*/
|
|
31
|
-
columnGap?: number;
|
|
32
|
-
/**
|
|
33
|
-
* 列分配策略(默认 shortest)
|
|
34
|
-
* - shortest:将下一项放入当前最矮列(默认)
|
|
35
|
-
* - sequential:按顺序轮转分配列(0,1,2...)
|
|
36
|
-
* - balanced:尽量使各列项数均衡(按项数最少列放置)
|
|
37
|
-
*/
|
|
38
|
-
alignmentMode?: "shortest" | "balanced" | "sequential";
|
|
39
|
-
/**
|
|
40
|
-
* 容器内边距
|
|
41
|
-
*/
|
|
42
|
-
padding?: number | {
|
|
43
|
-
top?: number;
|
|
44
|
-
right?: number;
|
|
45
|
-
bottom?: number;
|
|
46
|
-
left?: number;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* 容器样式
|
|
50
|
-
*/
|
|
51
|
-
containerStyle?: React.CSSProperties;
|
|
52
|
-
/**
|
|
53
|
-
* 容器类名
|
|
54
|
-
*/
|
|
55
|
-
containerClassName?: string;
|
|
56
|
-
/**
|
|
57
|
-
* 项容器样式
|
|
58
|
-
*/
|
|
59
|
-
itemStyle?: React.CSSProperties;
|
|
60
|
-
/**
|
|
61
|
-
* 项容器类名
|
|
62
|
-
*/
|
|
63
|
-
itemClassName?: string;
|
|
64
|
-
/**
|
|
65
|
-
* 是否使用 transform 定位(性能更好)
|
|
66
|
-
*/
|
|
67
|
-
useTransform?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* 节流延迟(ms)
|
|
70
|
-
*/
|
|
71
|
-
throttleDelay?: number;
|
|
72
|
-
/**
|
|
73
|
-
* 防抖延迟(ms)
|
|
74
|
-
*/
|
|
75
|
-
debounceDelay?: number;
|
|
76
|
-
onMount?: () => void;
|
|
77
|
-
onUnmount?: () => void;
|
|
78
|
-
onBeforeLayout?: () => boolean | Promise<boolean>;
|
|
79
|
-
onLayout?: () => void;
|
|
80
|
-
onLayoutComplete?: () => void;
|
|
81
|
-
onItemMount?: (index: number, element: HTMLElement) => void;
|
|
82
|
-
onItemUnmount?: (index: number) => void;
|
|
83
|
-
onItemEnterViewport?: (index: number) => void;
|
|
84
|
-
onItemLeaveViewport?: (index: number) => void;
|
|
85
|
-
onScroll?: (scrollTop: number, scrollLeft: number) => void;
|
|
86
|
-
onResize?: (width: number, height: number) => void;
|
|
87
|
-
onReachBottom?: (distance: number) => void;
|
|
88
|
-
onItemClick?: (index: number, item: T, event: React.MouseEvent) => void;
|
|
89
|
-
/**
|
|
90
|
-
* 子元素(用于插件渲染覆盖层等)
|
|
91
|
-
*/
|
|
92
|
-
children?: React.ReactNode;
|
|
93
|
-
/**
|
|
94
|
-
* 外部容器引用(供 HOC 传入)
|
|
95
|
-
*/
|
|
96
|
-
containerRefExternal?: React.RefObject<HTMLDivElement | null>;
|
|
97
|
-
/**
|
|
98
|
-
* 外部项引用映射(供 HOC 传入)
|
|
99
|
-
*/
|
|
100
|
-
itemRefsExternal?: React.MutableRefObject<Map<number, HTMLElement>>;
|
|
101
|
-
/**
|
|
102
|
-
* 是否启用调试模式
|
|
103
|
-
*/
|
|
104
|
-
debug?: boolean;
|
|
105
|
-
}
|
|
106
|
-
export interface WaterfallCoreRef {
|
|
107
|
-
/**
|
|
108
|
-
* 重新布局
|
|
109
|
-
*/
|
|
110
|
-
relayout: () => void;
|
|
111
|
-
/**
|
|
112
|
-
* 滚动到指定项
|
|
113
|
-
*/
|
|
114
|
-
scrollToItem: (index: number, options?: ScrollToItemOptions) => void;
|
|
115
|
-
/**
|
|
116
|
-
* 滚动到顶部
|
|
117
|
-
*/
|
|
118
|
-
scrollToTop: (options?: ScrollToOptions) => void;
|
|
119
|
-
/**
|
|
120
|
-
* 滚动到底部
|
|
121
|
-
*/
|
|
122
|
-
scrollToBottom: (options?: ScrollToOptions) => void;
|
|
123
|
-
/**
|
|
124
|
-
* 获取项位置
|
|
125
|
-
*/
|
|
126
|
-
getItemPosition: (index: number) => ItemPosition | null;
|
|
127
|
-
/**
|
|
128
|
-
* 获取所有项位置
|
|
129
|
-
*/
|
|
130
|
-
getAllItemPositions: () => Map<number, ItemPosition>;
|
|
131
|
-
/**
|
|
132
|
-
* 获取列高度
|
|
133
|
-
*/
|
|
134
|
-
getColumnHeights: () => number[];
|
|
135
|
-
/**
|
|
136
|
-
* 获取布局信息
|
|
137
|
-
*/
|
|
138
|
-
getLayoutInfo: () => LayoutInfo;
|
|
139
|
-
/**
|
|
140
|
-
* 获取视口信息
|
|
141
|
-
*/
|
|
142
|
-
getViewportInfo: () => ViewportInfo;
|
|
143
|
-
/**
|
|
144
|
-
* 强制更新
|
|
145
|
-
*/
|
|
146
|
-
forceUpdate: () => void;
|
|
147
|
-
/**
|
|
148
|
-
* 获取容器 DOM
|
|
149
|
-
*/
|
|
150
|
-
getContainer: () => HTMLDivElement | null;
|
|
151
|
-
/**
|
|
152
|
-
* 获取项 DOM
|
|
153
|
-
*/
|
|
154
|
-
getItemElement: (index: number) => HTMLElement | null;
|
|
155
|
-
/**
|
|
156
|
-
* 测量项尺寸
|
|
157
|
-
*/
|
|
158
|
-
measureItem: (index: number) => Promise<{
|
|
159
|
-
width: number;
|
|
160
|
-
height: number;
|
|
161
|
-
}>;
|
|
162
|
-
}
|
|
163
|
-
export interface ScrollToItemOptions {
|
|
164
|
-
behavior?: "auto" | "smooth";
|
|
165
|
-
block?: "start" | "center" | "end" | "nearest";
|
|
166
|
-
inline?: "start" | "center" | "end" | "nearest";
|
|
167
|
-
offset?: number;
|
|
168
|
-
}
|
|
169
|
-
export interface ScrollToOptions {
|
|
170
|
-
behavior?: "auto" | "smooth";
|
|
171
|
-
offset?: number;
|
|
172
|
-
}
|
|
173
|
-
declare const WaterfallCore: React.ForwardRefExoticComponent<WaterfallCoreProps<any> & React.RefAttributes<WaterfallCoreRef>>;
|
|
174
|
-
export default WaterfallCore;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type A11yConfig = {
|
|
3
|
-
/** 为容器设置 ARIA role(默认 list) */
|
|
4
|
-
containerRole?: string;
|
|
5
|
-
/** 为项设置 ARIA role(默认 listitem) */
|
|
6
|
-
itemRole?: string;
|
|
7
|
-
/** 是否给项添加 tabindex 便于键盘焦点 */
|
|
8
|
-
enableTabIndex?: boolean;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* A11yPlugin - 可访问性增强
|
|
12
|
-
* - 为容器与项添加合理的 ARIA 角色与属性
|
|
13
|
-
* - 为项添加 tabindex,支持键盘导航与聚焦
|
|
14
|
-
*/
|
|
15
|
-
export declare function createA11yPlugin<T = any>(config?: A11yConfig): WaterfallPlugin<T>;
|
|
16
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type AutoColumnConfig = {
|
|
3
|
-
/** 每列最小宽度(含内容区,不含列间距) */
|
|
4
|
-
minColumnWidth: number;
|
|
5
|
-
/** 最大列数(可选) */
|
|
6
|
-
maxColumns?: number;
|
|
7
|
-
/** 最小列数(可选,默认 1) */
|
|
8
|
-
minColumns?: number;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* 根据视口宽度和最小列宽自动计算列数
|
|
12
|
-
* 公式(近似):columns = floor((availableWidth + columnGap) / (minColumnWidth + columnGap))
|
|
13
|
-
* - availableWidth 近似取 window.innerWidth,避免强依赖容器 ref
|
|
14
|
-
* - 考虑 padding 与 columnGap,提高真实布局的贴合度
|
|
15
|
-
*/
|
|
16
|
-
export declare function createAutoColumnPlugin<T = any>(config: AutoColumnConfig): WaterfallPlugin<T>;
|
|
17
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type ClickAnalyticsConfig = {
|
|
3
|
-
/** 是否在控制台输出点击日志 */
|
|
4
|
-
log?: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* ClickAnalyticsPlugin - 点击分析(基础版)
|
|
8
|
-
* - 统计点击次数,向 bus 发送事件:analytics:click
|
|
9
|
-
* - 可选控制台输出日志
|
|
10
|
-
*/
|
|
11
|
-
export declare function createClickAnalyticsPlugin<T = any>(config?: ClickAnalyticsConfig): WaterfallPlugin<T>;
|
|
12
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type DragReorderConfig = {
|
|
3
|
-
/** 是否启用(默认 true) */
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* DragReorderPlugin - 拖拽重排
|
|
8
|
-
* - 为项包装器添加可拖拽样式与属性
|
|
9
|
-
* - 记录最后一次拖拽的 from/to 索引(sharedData)
|
|
10
|
-
* - 实际数据重排需外层配合(示例页提供)
|
|
11
|
-
*/
|
|
12
|
-
export declare function createDragReorderPlugin<T = any>(config?: DragReorderConfig): WaterfallPlugin<T>;
|
|
13
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type GroupingConfig<T = any> = {
|
|
3
|
-
/** 分组函数,返回组键 */
|
|
4
|
-
groupBy?: (item: T, index: number) => string | number;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* GroupingPlugin - 按组聚合(实验版)
|
|
8
|
-
* - 计算分组信息,写入 sharedData(GROUPS)
|
|
9
|
-
* - 仅提供覆盖层标签展示当前分组数量
|
|
10
|
-
*/
|
|
11
|
-
export declare function createGroupingPlugin<T = any>(config?: GroupingConfig<T>): WaterfallPlugin<T>;
|
|
12
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type HeatmapAnalyticsConfig = {
|
|
3
|
-
/** 是否显示简单统计叠层 */
|
|
4
|
-
showOverlay?: boolean;
|
|
5
|
-
/** 别名:示例页使用的 showOverlaySummary */
|
|
6
|
-
showOverlaySummary?: boolean;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* HeatmapAnalyticsPlugin - 点击/曝光热力分析(基础版)
|
|
10
|
-
* - 统计每项进入视口次数与点击次数
|
|
11
|
-
* - 可选在顶部显示统计摘要叠层
|
|
12
|
-
*/
|
|
13
|
-
export declare function createHeatmapAnalyticsPlugin<T = any>(config?: HeatmapAnalyticsConfig): WaterfallPlugin<T>;
|
|
14
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type InfiniteScrollConfig = {
|
|
3
|
-
/** 触发加载的距离阈值(像素) */
|
|
4
|
-
threshold?: number;
|
|
5
|
-
/** 加载更多的回调,由页面传入 */
|
|
6
|
-
onLoadMore?: () => Promise<void> | void;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* InfiniteScrollPlugin - 到达底部触发加载更多
|
|
10
|
-
* 通过 transformProps 包装 onReachBottom,实现基于阈值的加载触发
|
|
11
|
-
*/
|
|
12
|
-
export declare function createInfiniteScrollPlugin<T = any>(config?: InfiniteScrollConfig): WaterfallPlugin<T>;
|
|
13
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type PinItemConfig = {
|
|
3
|
-
/** 置顶的项索引列表 */
|
|
4
|
-
pinnedIndices: number[];
|
|
5
|
-
/** 固定到的列(默认 0) */
|
|
6
|
-
column?: number;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* PinItemPlugin - 将指定索引的项固定在顶部某列
|
|
10
|
-
* - 通过 calculateItemPosition 覆盖其位置,使其始终位于顶部
|
|
11
|
-
*/
|
|
12
|
-
export declare function createPinItemPlugin<T = any>(config: PinItemConfig): WaterfallPlugin<T>;
|
|
13
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type ReducedMotionConfig = {
|
|
3
|
-
/** 当用户偏好减少动画时,是否禁用 transform 定位 */
|
|
4
|
-
disableTransform?: boolean;
|
|
5
|
-
/** 当用户偏好减少动画时,是否移除项过渡效果 */
|
|
6
|
-
removeTransitions?: boolean;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* ReducedMotionPlugin - 尊重系统的减少动画偏好
|
|
10
|
-
* - 通过 transformProps 调整核心配置与项样式
|
|
11
|
-
*/
|
|
12
|
-
export declare function createReducedMotionPlugin<T = any>(config?: ReducedMotionConfig): WaterfallPlugin<T>;
|
|
13
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type Breakpoint = {
|
|
3
|
-
width: number;
|
|
4
|
-
columns: number;
|
|
5
|
-
};
|
|
6
|
-
type Breakpoints = Record<string, Breakpoint>;
|
|
7
|
-
export declare function createResponsiveColumnsPlugin<T = any>(config: {
|
|
8
|
-
breakpoints: Breakpoints;
|
|
9
|
-
}): WaterfallPlugin<T>;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type StickyHeaderConfig = {
|
|
3
|
-
/** 标题文本(默认:当前分组) */
|
|
4
|
-
title?: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* StickyHeaderPlugin - 吸顶标题(实验版)
|
|
8
|
-
* - 简化实现:始终显示一个吸顶条,可与 GroupingPlugin 联动
|
|
9
|
-
*/
|
|
10
|
-
export declare function createStickyHeaderPlugin<T = any>(config?: StickyHeaderConfig): WaterfallPlugin<T>;
|
|
11
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
export type VirtualWaterfallConfig<T = any> = {
|
|
3
|
-
/** 视口上下额外渲染的像素范围(overscan) */
|
|
4
|
-
overscanPx?: number;
|
|
5
|
-
/** 获取项高度(可选;不可预测时走测量) */
|
|
6
|
-
getItemHeight?: (item: T, index: number) => number;
|
|
7
|
-
/** 动态高度测量模式:开启后使用 ResizeObserver 实时测量 */
|
|
8
|
-
dynamicHeights?: boolean;
|
|
9
|
-
/** 初始估算高度(用于首屏布局与未测量项) */
|
|
10
|
-
estimateItemHeight?: number;
|
|
11
|
-
};
|
|
12
|
-
export declare function createVirtualWaterfallPlugin<T = any>(config: VirtualWaterfallConfig<T>): WaterfallPlugin<T>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WaterfallPlugin 自定义插件导出
|
|
3
|
-
*/
|
|
4
|
-
export { createResponsiveColumnsPlugin } from './ResponsiveColumns';
|
|
5
|
-
export { createAutoColumnPlugin } from './AutoColumn';
|
|
6
|
-
export { createAlignmentPlugin } from './Alignment';
|
|
7
|
-
export { createGapPlugin } from './Gap';
|
|
8
|
-
export { createFixedHeightPlugin } from './FixedHeight';
|
|
9
|
-
export { createVirtualWaterfallPlugin } from './VirtualWaterfall';
|
|
10
|
-
export { createThrottlePlugin } from './Throttle';
|
|
11
|
-
export { createDebounceLayoutPlugin } from './DebounceLayout';
|
|
12
|
-
export { createRecyclePlugin } from './Recycle';
|
|
13
|
-
export { createInfiniteScrollPlugin } from './InfiniteScroll';
|
|
14
|
-
export { createPaginationPlugin } from './Pagination';
|
|
15
|
-
export { createFilterPlugin } from './Filter';
|
|
16
|
-
export { createSortPlugin } from './Sort';
|
|
17
|
-
export { createSearchPlugin } from './Search';
|
|
18
|
-
export { createClickAnalyticsPlugin } from './ClickAnalytics/index.tsx';
|
|
19
|
-
export { createBookmarkPlugin } from './Bookmark/index.tsx';
|
|
20
|
-
export { createURLSyncPlugin } from './URLSync';
|
|
21
|
-
export { createA11yPlugin } from './A11y';
|
|
22
|
-
export { createReducedMotionPlugin } from './ReducedMotion';
|
|
23
|
-
export { createTransitionPlugin } from './Transition';
|
|
24
|
-
export { createPinItemPlugin } from './PinItem';
|
|
25
|
-
export { createHeatmapAnalyticsPlugin } from './HeatmapAnalytics';
|
|
26
|
-
export { createStatePersistencePlugin } from './StatePersistence';
|
|
27
|
-
export { createGroupingPlugin } from './Grouping/index.tsx';
|
|
28
|
-
export { createStickyHeaderPlugin } from './StickyHeader/index.tsx';
|
|
29
|
-
export { createScrollAnchorPlugin } from './ScrollAnchor/index.tsx';
|
|
30
|
-
export { createDragReorderPlugin } from './DragReorder/index.tsx';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WaterfallPlugin 插件系统导出
|
|
3
|
-
*/
|
|
4
|
-
export type { WaterfallPlugin, PluginManager, PluginBus, WaterfallPluginContext, WaterfallPluginHooks, PluginCreator, ItemPosition, LayoutInfo, ViewportInfo, ItemVisibility, PerformanceMetrics, DeviceInfo, NetworkInfo, AnimationConfig, DragInfo, ItemRenderer, ItemKeyExtractor, ScrollToOptions, } from './types';
|
|
5
|
-
export type { WithPluginsConfig } from './withPlugins';
|
|
6
|
-
export { createPluginBus } from './PluginBus';
|
|
7
|
-
export { createPluginManager } from './PluginManager';
|
|
8
|
-
export { withPlugins } from './withPlugins';
|