vane-waterfall 2.0.1 → 2.0.3
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 +4 -4
- package/dist/chunks/WaterfallCore-EdAZuWAY.js +695 -0
- package/dist/chunks/doc-BAhVW3g8.js +150 -0
- package/dist/chunks/doc-BU0CKW63.js +156 -0
- package/dist/chunks/doc-BrEd0oZB.js +100 -0
- package/dist/chunks/{doc-bTHwfIVb.js → doc-Bud0hbaz.js} +39 -25
- package/dist/chunks/{doc-DukOmDCo.js → doc-C-B3zK2o.js} +52 -23
- package/dist/chunks/{doc-DElLNjIc.js → doc-C206ZwYC.js} +33 -24
- package/dist/chunks/doc-C2L8kkeI.js +112 -0
- package/dist/chunks/doc-CE1DGMBV.js +166 -0
- package/dist/chunks/{doc-BXSy2aPP.js → doc-CHbQXLwY.js} +33 -19
- package/dist/chunks/{doc-BfWnfTst.js → doc-CInpKZNU.js} +38 -24
- package/dist/chunks/{doc-gTAsLjVx.js → doc-CYxwSuG6.js} +30 -16
- package/dist/chunks/{doc-DzvTrZ13.js → doc-CaJ02INP.js} +25 -16
- package/dist/chunks/{doc-BXElhF2h.js → doc-CiCso5Ti.js} +44 -30
- package/dist/chunks/doc-CkuMr8Ca.js +118 -0
- package/dist/chunks/{doc-3Fpag2G8.js → doc-D7m1OFCW.js} +38 -24
- package/dist/chunks/doc-DEN2WTDh.js +153 -0
- package/dist/chunks/{doc-C5xrHNoC.js → doc-DhICh9S2.js} +37 -23
- package/dist/chunks/doc-DlJICsyN.js +100 -0
- package/dist/chunks/{doc-BtzhgTYj.js → doc-DtxS1-P0.js} +35 -26
- package/dist/chunks/{doc-BIzjYAZW.js → doc-DudYCn_-.js} +25 -16
- package/dist/chunks/doc-HoyAFR_m.js +101 -0
- package/dist/chunks/doc-RlBMCMNs.js +170 -0
- package/dist/chunks/doc-RwKQqySd.js +102 -0
- package/dist/chunks/{doc-CTUoMe7o.js → doc-eYhNJy97.js} +31 -22
- package/dist/chunks/{doc-CcPFavOs.js → doc-i6FY1We1.js} +27 -13
- package/dist/chunks/doc-skPl6ZMP.js +101 -0
- package/dist/chunks/index-8gEIzUxi.js +15 -0
- package/dist/chunks/index-B96I5CKE.js +21 -0
- package/dist/chunks/index-Bjmhy8jW.js +11 -0
- package/dist/chunks/index-Cuq0ofv-.js +13 -0
- package/dist/chunks/{index-BAWlVYr3.js → index-Cz4YEqRF.js} +1 -1
- package/dist/chunks/{index-wLI6UXkY.js → index-FBJVUYmH.js} +1 -1
- package/dist/chunks/withPlugins-BOeDFhof.js +743 -0
- package/dist/components/WaterfallPlugin/WaterfallCore.d.ts +19 -0
- package/dist/components/WaterfallPlugin/WaterfallCore.d.ts.map +1 -1
- package/dist/components/WaterfallPlugin/layout.d.ts +7 -0
- package/dist/components/WaterfallPlugin/layout.d.ts.map +1 -1
- package/dist/components/WaterfallPlugin/plugins/types.d.ts +3 -0
- package/dist/components/WaterfallPlugin/plugins/types.d.ts.map +1 -1
- package/dist/components/WaterfallPlugin/withPlugins.d.ts.map +1 -1
- package/dist/custom-plugins/A11yPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/A11yPlugin/doc.json.d.ts +64 -40
- package/dist/custom-plugins/A11yPlugin/index.js +1 -1
- package/dist/custom-plugins/AlignmentPlugin/doc.json.d.ts +42 -28
- package/dist/custom-plugins/AlignmentPlugin/index.js +1 -1
- package/dist/custom-plugins/AutoColumnPlugin/doc.json.d.ts +53 -44
- package/dist/custom-plugins/AutoColumnPlugin/index.js +1 -1
- package/dist/custom-plugins/BookmarkPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/BookmarkPlugin/doc.json.d.ts +44 -35
- package/dist/custom-plugins/BookmarkPlugin/index.js +1 -1
- package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts +2 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/ClickAnalyticsPlugin/doc.json.d.ts +29 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/index.js +1 -1
- package/dist/custom-plugins/DebounceLayoutPlugin/doc.json.d.ts +37 -28
- package/dist/custom-plugins/DebounceLayoutPlugin/index.js +1 -1
- package/dist/custom-plugins/DragReorderPlugin/doc.json.d.ts +14 -0
- package/dist/custom-plugins/DragReorderPlugin/index.js +1 -1
- package/dist/custom-plugins/FilterPlugin/doc.json.d.ts +53 -39
- package/dist/custom-plugins/FilterPlugin/index.js +1 -1
- package/dist/custom-plugins/FixedHeightPlugin/doc.json.d.ts +42 -28
- package/dist/custom-plugins/FixedHeightPlugin/index.js +1 -1
- package/dist/custom-plugins/GapPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/GapPlugin/doc.json.d.ts +61 -37
- package/dist/custom-plugins/GapPlugin/index.js +1 -1
- package/dist/custom-plugins/GroupingPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/GroupingPlugin/doc.json.d.ts +61 -32
- package/dist/custom-plugins/GroupingPlugin/index.js +1 -1
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts +2 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/doc.json.d.ts +24 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.js +1 -1
- package/dist/custom-plugins/InfiniteScrollPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/InfiniteScrollPlugin/doc.json.d.ts +55 -36
- package/dist/custom-plugins/InfiniteScrollPlugin/index.js +1 -1
- package/dist/custom-plugins/PaginationPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/PaginationPlugin/doc.json.d.ts +56 -42
- package/dist/custom-plugins/PaginationPlugin/index.js +1 -1
- package/dist/custom-plugins/PinItemPlugin/doc.json.d.ts +49 -35
- package/dist/custom-plugins/PinItemPlugin/index.js +1 -1
- package/dist/custom-plugins/RecyclePlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/RecyclePlugin/doc.json.d.ts +57 -28
- package/dist/custom-plugins/RecyclePlugin/index.js +1 -1
- package/dist/custom-plugins/ReducedMotionPlugin/doc.json.d.ts +29 -0
- package/dist/custom-plugins/ReducedMotionPlugin/index.js +1 -1
- package/dist/custom-plugins/ResponsiveColumnsPlugin/doc.json.d.ts +40 -31
- package/dist/custom-plugins/ResponsiveColumnsPlugin/index.js +1 -1
- package/dist/custom-plugins/ScrollAnchorPlugin/doc.json.d.ts +42 -28
- package/dist/custom-plugins/ScrollAnchorPlugin/index.js +1 -1
- package/dist/custom-plugins/SearchPlugin/doc.json.d.ts +53 -39
- package/dist/custom-plugins/SearchPlugin/index.js +1 -1
- package/dist/custom-plugins/SortPlugin/doc.json.d.ts +52 -38
- package/dist/custom-plugins/SortPlugin/index.js +1 -1
- package/dist/custom-plugins/StatePersistencePlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/StatePersistencePlugin/doc.json.d.ts +71 -37
- package/dist/custom-plugins/StatePersistencePlugin/index.js +1 -1
- package/dist/custom-plugins/StickyHeaderPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/StickyHeaderPlugin/doc.json.d.ts +43 -34
- package/dist/custom-plugins/StickyHeaderPlugin/index.js +1 -1
- package/dist/custom-plugins/ThrottlePlugin/doc.json.d.ts +43 -34
- package/dist/custom-plugins/ThrottlePlugin/index.js +1 -1
- package/dist/custom-plugins/TransitionPlugin/doc.json.d.ts +49 -35
- package/dist/custom-plugins/TransitionPlugin/index.js +1 -1
- package/dist/custom-plugins/URLSyncPlugin/create.d.ts.map +1 -1
- package/dist/custom-plugins/URLSyncPlugin/doc.json.d.ts +57 -33
- package/dist/custom-plugins/URLSyncPlugin/index.js +1 -1
- package/dist/custom-plugins/index.js +6 -6
- package/dist/entries/core.js +1 -1
- package/dist/entries/plugins.js +7 -7
- package/dist/index.js +2 -2
- package/dist/presets/dashboard/index.js +2 -2
- package/dist/presets/photo-feed/index.js +3 -3
- package/dist/presets/product-feed/index.js +2 -2
- package/package.json +16 -8
- package/dist/chunks/WaterfallCore-BSXw7bl_.js +0 -581
- package/dist/chunks/doc-78xF08vt.js +0 -82
- package/dist/chunks/doc-B-7dugGv.js +0 -79
- package/dist/chunks/doc-B6kLfMPv.js +0 -121
- package/dist/chunks/doc-BCGQ8Cp5.js +0 -114
- package/dist/chunks/doc-BP0DmB7-.js +0 -91
- package/dist/chunks/doc-CBHjiDG7.js +0 -88
- package/dist/chunks/doc-CraXjOaA.js +0 -68
- package/dist/chunks/doc-DJjxOYzW.js +0 -111
- package/dist/chunks/doc-NhL4Ux8q.js +0 -125
- package/dist/chunks/doc-f4Uijujv.js +0 -102
- package/dist/chunks/doc-j4W9SUrY.js +0 -76
- package/dist/chunks/doc-kTbJE7rY.js +0 -92
- package/dist/chunks/index-COaun3nf.js +0 -15
- package/dist/chunks/index-DXAtA2f6.js +0 -11
- package/dist/chunks/index-DsRLmBW-.js +0 -13
- package/dist/chunks/index-gjoCq0yC.js +0 -21
- package/dist/chunks/withPlugins-DLoKg4AP.js +0 -559
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
function K(o = {}) {
|
|
2
|
-
const i = o.storageKey || "waterfall-state", l = o.persistScroll ?? !0, a = o.persistKeys || ["pageIndex", "pageSize", "searchQuery"];
|
|
3
|
-
let u = !1;
|
|
4
|
-
function c() {
|
|
5
|
-
try {
|
|
6
|
-
const e = localStorage.getItem(i);
|
|
7
|
-
return e ? JSON.parse(e) : null;
|
|
8
|
-
} catch {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function p(e) {
|
|
13
|
-
try {
|
|
14
|
-
localStorage.setItem(i, JSON.stringify(e));
|
|
15
|
-
} catch {
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
name: "StatePersistencePlugin",
|
|
20
|
-
enabled: !0,
|
|
21
|
-
hooks: {
|
|
22
|
-
// 首次渲染时,尽量将本地快照中的分页/查询键注入到 props,便于核心按恢复后的状态渲染
|
|
23
|
-
transformProps: (e) => {
|
|
24
|
-
if (u) return e;
|
|
25
|
-
const t = c();
|
|
26
|
-
if (!t) return e;
|
|
27
|
-
const n = { ...e };
|
|
28
|
-
let s = !1;
|
|
29
|
-
return a.forEach((r) => {
|
|
30
|
-
t[r] !== void 0 && (n[r] = t[r], s = !0);
|
|
31
|
-
}), s && (u = !0), n;
|
|
32
|
-
},
|
|
33
|
-
onMount: (e) => {
|
|
34
|
-
const t = c();
|
|
35
|
-
if (!t) return;
|
|
36
|
-
if (l) {
|
|
37
|
-
const s = Number(t.scrollTop ?? 0), r = e.containerRef.current;
|
|
38
|
-
r ? r.scrollTo({ top: s, behavior: "auto" }) : e.scrollToTop?.({ behavior: "auto" });
|
|
39
|
-
}
|
|
40
|
-
const n = {};
|
|
41
|
-
if (a.forEach((s) => {
|
|
42
|
-
t[s] !== void 0 && (n[s] = t[s]);
|
|
43
|
-
}), Object.keys(n).length > 0 && (e.bus?.emit("state:restored", n), typeof window < "u"))
|
|
44
|
-
try {
|
|
45
|
-
window.dispatchEvent(new CustomEvent("waterfall:state-restored", { detail: n }));
|
|
46
|
-
} catch {
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
// props 变化时,增量更新快照(立即持久化分页/查询键)
|
|
50
|
-
onPropsChange: (e, t, n) => {
|
|
51
|
-
const r = { ...c() || {} }, g = n ?? {};
|
|
52
|
-
a.forEach((f) => {
|
|
53
|
-
const d = g[f];
|
|
54
|
-
d !== void 0 && (r[f] = d);
|
|
55
|
-
}), p(r);
|
|
56
|
-
},
|
|
57
|
-
onUnmount: (e) => {
|
|
58
|
-
const t = {};
|
|
59
|
-
l && (t.scrollTop = e.containerRef.current?.scrollTop || 0);
|
|
60
|
-
const n = e.props ?? {};
|
|
61
|
-
a.forEach((s) => {
|
|
62
|
-
const r = n[s];
|
|
63
|
-
r !== void 0 && (t[s] = r);
|
|
64
|
-
}), p(t);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
const y = "StatePersistencePlugin", m = "三个时机各做一件事:首次渲染把快照里的 pageIndex / searchQuery 注入 props;挂载后恢复 scrollTop;props 变化与卸载时写回快照。刷新页面不丢进度。", S = "2.0.0", h = [
|
|
70
|
-
"ui",
|
|
71
|
-
"持久化"
|
|
72
|
-
], w = [
|
|
73
|
-
{
|
|
74
|
-
name: "storageKey",
|
|
75
|
-
type: "string",
|
|
76
|
-
default: '"waterfall-state"',
|
|
77
|
-
description: "localStorage 键名"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: "persistScroll",
|
|
81
|
-
type: "boolean",
|
|
82
|
-
default: "true",
|
|
83
|
-
description: "是否持久化滚动位置"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: "persistKeys",
|
|
87
|
-
type: "string[]",
|
|
88
|
-
default: '["pageIndex","pageSize","searchQuery"]',
|
|
89
|
-
description: "要持久化的 props 键"
|
|
90
|
-
}
|
|
91
|
-
], v = `// 把滚动位置与分页/查询状态存 localStorage,回来时恢复。
|
|
92
|
-
const Waterfall = withPlugins(WaterfallCore, [
|
|
93
|
-
createStatePersistencePlugin({
|
|
94
|
-
storageKey: "waterfall-state",
|
|
95
|
-
persistScroll: true,
|
|
96
|
-
persistKeys: ["pageIndex","pageSize","searchQuery"],
|
|
97
|
-
}),
|
|
98
|
-
]);
|
|
99
|
-
|
|
100
|
-
<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;`, P = [
|
|
101
|
-
"滚动位置 + 分页/查询一起存",
|
|
102
|
-
"首帧注入只做一次,不会覆盖用户操作",
|
|
103
|
-
"SSR / 隐私模式下降级为不持久化"
|
|
104
|
-
], b = [
|
|
105
|
-
"后台列表刷新不丢页",
|
|
106
|
-
"搜索结果返回定位",
|
|
107
|
-
"移动端来回切换页面"
|
|
108
|
-
], I = [
|
|
109
|
-
"只能恢复「值」,不能替你把它写回 React state——页面应订阅 `state:restored` 事件或读 bus。",
|
|
110
|
-
"localStorage 不可用(隐私模式/配额满)时静默跳过,不会抛错。"
|
|
111
|
-
], T = {
|
|
112
|
-
name: y,
|
|
113
|
-
description: m,
|
|
114
|
-
since: S,
|
|
115
|
-
tags: h,
|
|
116
|
-
config: w,
|
|
117
|
-
example: v,
|
|
118
|
-
features: P,
|
|
119
|
-
useCases: b,
|
|
120
|
-
notes: I
|
|
121
|
-
};
|
|
122
|
-
export {
|
|
123
|
-
K as c,
|
|
124
|
-
T as d
|
|
125
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { jsxs as u, jsx as f } from "react/jsx-runtime";
|
|
2
|
-
function v(o = {}) {
|
|
3
|
-
const { log: i = !1, showOverlay: l = !1 } = o, n = /* @__PURE__ */ new Map(), s = () => Array.from(n.values()).reduce((t, e) => t + e, 0);
|
|
4
|
-
return {
|
|
5
|
-
name: "ClickAnalyticsPlugin",
|
|
6
|
-
enabled: !0,
|
|
7
|
-
getStats: () => ({
|
|
8
|
-
total: s(),
|
|
9
|
-
byIndex: Array.from(n.entries()).map(([t, e]) => ({ index: t, clicks: e })).sort((t, e) => t.index - e.index)
|
|
10
|
-
}),
|
|
11
|
-
hooks: {
|
|
12
|
-
onMount: (t) => {
|
|
13
|
-
t.sharedData?.set("click-count", s());
|
|
14
|
-
},
|
|
15
|
-
onItemClick: (t, e, c, r) => {
|
|
16
|
-
const d = (n.get(e) ?? 0) + 1;
|
|
17
|
-
n.set(e, d);
|
|
18
|
-
const a = s();
|
|
19
|
-
t.sharedData?.set("click-count", a), t.bus?.emit("analytics:click", { index: e, item: c, event: r, total: a }), t.forceUpdate?.(), i && console.log(`[ClickAnalytics] item=${e} total=${a}`);
|
|
20
|
-
},
|
|
21
|
-
renderOverlay: (t) => {
|
|
22
|
-
if (!l) return null;
|
|
23
|
-
const e = t.sharedData?.get("click-count") || 0;
|
|
24
|
-
return /* @__PURE__ */ u(
|
|
25
|
-
"div",
|
|
26
|
-
{
|
|
27
|
-
style: {
|
|
28
|
-
position: "absolute",
|
|
29
|
-
top: 12,
|
|
30
|
-
right: 12,
|
|
31
|
-
padding: "10px 12px",
|
|
32
|
-
background: "#222",
|
|
33
|
-
color: "#fff",
|
|
34
|
-
borderRadius: 8,
|
|
35
|
-
fontSize: 14,
|
|
36
|
-
fontWeight: 600,
|
|
37
|
-
boxShadow: "0 4px 12px rgba(0,0,0,0.25)",
|
|
38
|
-
border: "1px solid rgba(255,255,255,0.15)",
|
|
39
|
-
pointerEvents: "none",
|
|
40
|
-
zIndex: 99
|
|
41
|
-
},
|
|
42
|
-
children: [
|
|
43
|
-
"点击次数:",
|
|
44
|
-
e,
|
|
45
|
-
/* @__PURE__ */ f("div", { style: { fontSize: 12, fontWeight: 400, opacity: 0.85, marginTop: 4 }, children: "提示:点击任意卡片观察计数变化" })
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const g = "ClickAnalyticsPlugin", p = "统计每次项点击并累计总数,向 bus 发 `analytics:click`(带 index / item / total),`getStats()` 可随时取出按 index 的计数。默认只上报不显示角标,接入真实版式时不会被调试面板盖住内容。", m = "2.0.0", y = [
|
|
54
|
-
"interaction",
|
|
55
|
-
"埋点"
|
|
56
|
-
], k = [
|
|
57
|
-
{
|
|
58
|
-
name: "log",
|
|
59
|
-
type: "boolean",
|
|
60
|
-
default: "false",
|
|
61
|
-
description: "是否在控制台打印每次点击"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: "showOverlay",
|
|
65
|
-
type: "boolean",
|
|
66
|
-
default: "false",
|
|
67
|
-
description: "是否显示右上角计数角标"
|
|
68
|
-
}
|
|
69
|
-
], b = `// 统计项点击次数,发 \`analytics:click\` 事件,可选角标与日志。
|
|
70
|
-
const Waterfall = withPlugins(WaterfallCore, [
|
|
71
|
-
createClickAnalyticsPlugin({
|
|
72
|
-
log: false,
|
|
73
|
-
showOverlay: false,
|
|
74
|
-
}),
|
|
75
|
-
]);
|
|
76
|
-
|
|
77
|
-
<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;`, h = [
|
|
78
|
-
"点击总量 + 按 index 明细(getStats)",
|
|
79
|
-
"bus 事件可被外部订阅上报",
|
|
80
|
-
"角标默认关闭"
|
|
81
|
-
], x = [
|
|
82
|
-
"内容流点击率统计",
|
|
83
|
-
"AB 实验埋点",
|
|
84
|
-
"调试点击行为"
|
|
85
|
-
], C = [
|
|
86
|
-
"生产环境请把数据从 bus 事件或 getStats() 接到自己的埋点 SDK,不要让插件直接打日志。",
|
|
87
|
-
"计数只在内存里,刷新即清零 —— 想持久化要自己定时取 getStats() 上报。"
|
|
88
|
-
], A = {
|
|
89
|
-
name: g,
|
|
90
|
-
description: p,
|
|
91
|
-
since: m,
|
|
92
|
-
tags: y,
|
|
93
|
-
config: k,
|
|
94
|
-
example: b,
|
|
95
|
-
features: h,
|
|
96
|
-
useCases: x,
|
|
97
|
-
notes: C
|
|
98
|
-
};
|
|
99
|
-
export {
|
|
100
|
-
v as c,
|
|
101
|
-
A as d
|
|
102
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
function r(o) {
|
|
2
|
-
const e = typeof window < "u" ? window.innerWidth : 1024, n = o.responsive || {};
|
|
3
|
-
return e >= 1200 && n.xl ? n.xl : e >= 992 && n.lg ? n.lg : e >= 768 && n.md ? n.md : e < 768 && n.sm ? n.sm : {};
|
|
4
|
-
}
|
|
5
|
-
function w(o) {
|
|
6
|
-
return {
|
|
7
|
-
name: "GapPlugin",
|
|
8
|
-
priority: 50,
|
|
9
|
-
enabled: !0,
|
|
10
|
-
hooks: {
|
|
11
|
-
transformProps: (e) => {
|
|
12
|
-
const n = { columnGap: o.columnGap, rowGap: o.rowGap }, t = r(o), s = {
|
|
13
|
-
columnGap: t.columnGap ?? n.columnGap ?? e.columnGap,
|
|
14
|
-
rowGap: t.rowGap ?? n.rowGap ?? e.rowGap
|
|
15
|
-
};
|
|
16
|
-
return { ...e, ...s };
|
|
17
|
-
},
|
|
18
|
-
onResize: (e) => {
|
|
19
|
-
e.relayout?.();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const a = "GapPlugin", p = "把 rowGap / columnGap 收敛到一处配置,并支持按窗口宽度切换间距(窄屏 8px、宽屏 16px 这类)。", i = "2.0.0", c = [
|
|
25
|
-
"layout",
|
|
26
|
-
"间距"
|
|
27
|
-
], l = [
|
|
28
|
-
{
|
|
29
|
-
name: "columnGap",
|
|
30
|
-
type: "number",
|
|
31
|
-
default: "props.columnGap",
|
|
32
|
-
description: "列间距 px"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "rowGap",
|
|
36
|
-
type: "number",
|
|
37
|
-
default: "props.rowGap",
|
|
38
|
-
description: "行间距 px"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "responsive",
|
|
42
|
-
type: "{ sm?, md?, lg?, xl? }",
|
|
43
|
-
default: "—",
|
|
44
|
-
description: "断点覆盖(按 window 宽度)"
|
|
45
|
-
}
|
|
46
|
-
], u = `// 统一控制行/列间距,支持按断点给不同间距。
|
|
47
|
-
const Waterfall = withPlugins(WaterfallCore, [
|
|
48
|
-
createGapPlugin(),
|
|
49
|
-
]);
|
|
50
|
-
|
|
51
|
-
<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;`, m = [
|
|
52
|
-
"行列间距一处配置",
|
|
53
|
-
"断点覆盖(sm/md/lg/xl)",
|
|
54
|
-
"不填则回退到 props"
|
|
55
|
-
], d = [
|
|
56
|
-
"设计规范里间距随断点变化",
|
|
57
|
-
"同一组件在不同页面用不同密度"
|
|
58
|
-
], G = [
|
|
59
|
-
"断点判断用的是 window.innerWidth(间距通常跟视口走,与列数按容器算不一样)。",
|
|
60
|
-
"断点是「命中即覆盖」:桌面窗口 ≥1200 又配了 responsive.lg,那就一直是 lg 的值,config.columnGap/rowGap 在这档不起作用;想让手写值生效就别给该档位配 responsive。",
|
|
61
|
-
"sm 只在小屏(<768)生效,不会被当成兜底档套到桌面端。"
|
|
62
|
-
], f = {
|
|
63
|
-
name: a,
|
|
64
|
-
description: p,
|
|
65
|
-
since: i,
|
|
66
|
-
tags: c,
|
|
67
|
-
config: l,
|
|
68
|
-
example: u,
|
|
69
|
-
features: m,
|
|
70
|
-
useCases: d,
|
|
71
|
-
notes: G
|
|
72
|
-
};
|
|
73
|
-
export {
|
|
74
|
-
w as c,
|
|
75
|
-
f as d
|
|
76
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
function R(n = {}) {
|
|
3
|
-
const i = n.containerRole ?? "list", s = n.itemRole ?? "listitem", o = n.enableTabIndex ?? !0, r = n.containerLabel ?? "Waterfall list", a = (e) => {
|
|
4
|
-
const t = e.containerRef.current;
|
|
5
|
-
t && (t.setAttribute("role", i), t.setAttribute("aria-label", r), t.setAttribute("aria-busy", e.isLayouting ? "true" : "false"));
|
|
6
|
-
};
|
|
7
|
-
return {
|
|
8
|
-
name: "A11yPlugin",
|
|
9
|
-
enabled: !0,
|
|
10
|
-
hooks: {
|
|
11
|
-
onMount: (e) => {
|
|
12
|
-
a(e);
|
|
13
|
-
},
|
|
14
|
-
onLayoutComplete: (e) => {
|
|
15
|
-
a(e);
|
|
16
|
-
},
|
|
17
|
-
renderItemWrapper: (e, t, l) => /* @__PURE__ */ c(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
role: s,
|
|
21
|
-
"aria-posinset": l + 1,
|
|
22
|
-
"aria-setsize": e.itemCount,
|
|
23
|
-
tabIndex: o ? 0 : void 0,
|
|
24
|
-
style: { outline: "none" },
|
|
25
|
-
children: t
|
|
26
|
-
}
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const u = "A11yPlugin", d = "把瀑布流补成读屏可理解的列表:容器 `role=list` + `aria-label`,每项 `role=listitem` + `aria-posinset` / `aria-setsize`,并可选加 `tabIndex` 让键盘能逐项聚焦。", b = "2.0.0", m = [
|
|
32
|
-
"ui",
|
|
33
|
-
"a11y"
|
|
34
|
-
], p = [
|
|
35
|
-
{
|
|
36
|
-
name: "containerRole",
|
|
37
|
-
type: "string",
|
|
38
|
-
default: '"list"',
|
|
39
|
-
description: "容器 role"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: "itemRole",
|
|
43
|
-
type: "string",
|
|
44
|
-
default: '"listitem"',
|
|
45
|
-
description: "项 role"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "enableTabIndex",
|
|
49
|
-
type: "boolean",
|
|
50
|
-
default: "true",
|
|
51
|
-
description: "项是否可 Tab 聚焦"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: "containerLabel",
|
|
55
|
-
type: "string",
|
|
56
|
-
default: '"Waterfall list"',
|
|
57
|
-
description: "容器 aria-label"
|
|
58
|
-
}
|
|
59
|
-
], f = `// 给容器与项补 ARIA role / label / posinset,支持键盘 Tab 遍历。
|
|
60
|
-
const Waterfall = withPlugins(WaterfallCore, [
|
|
61
|
-
createA11yPlugin({
|
|
62
|
-
containerRole: "list",
|
|
63
|
-
itemRole: "listitem",
|
|
64
|
-
enableTabIndex: true,
|
|
65
|
-
}),
|
|
66
|
-
]);
|
|
67
|
-
|
|
68
|
-
<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;`, y = [
|
|
69
|
-
"容器 / 项 role 成对补齐",
|
|
70
|
-
"aria-posinset + aria-setsize 正确标注序号",
|
|
71
|
-
"键盘可逐项聚焦"
|
|
72
|
-
], g = [
|
|
73
|
-
"政务 / 金融等合规站点",
|
|
74
|
-
"读屏用户可用的信息流",
|
|
75
|
-
"键盘操作优先的桌面端"
|
|
76
|
-
], x = [
|
|
77
|
-
"项数很多时 `tabIndex=0` 会让 Tab 变长,建议配合「跳转主内容」链接使用。"
|
|
78
|
-
], A = {
|
|
79
|
-
name: u,
|
|
80
|
-
description: d,
|
|
81
|
-
since: b,
|
|
82
|
-
tags: m,
|
|
83
|
-
config: p,
|
|
84
|
-
example: f,
|
|
85
|
-
features: y,
|
|
86
|
-
useCases: g,
|
|
87
|
-
notes: x
|
|
88
|
-
};
|
|
89
|
-
export {
|
|
90
|
-
R as c,
|
|
91
|
-
A as d
|
|
92
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { c as a, d as e } from "./doc-DElLNjIc.js";
|
|
2
|
-
import { c as t, d as s } from "./doc-CcPFavOs.js";
|
|
3
|
-
import { c, d as i } from "./doc-3Fpag2G8.js";
|
|
4
|
-
import { c as n, d as o } from "./doc-BfWnfTst.js";
|
|
5
|
-
import { c as r, d as g } from "./doc-B-7dugGv.js";
|
|
6
|
-
import { c as l, d as m } from "./doc-f4Uijujv.js";
|
|
7
|
-
const f = Object.assign(a, { meta: e }), j = Object.assign(t, { meta: s }), O = Object.assign(c, { meta: i }), C = Object.assign(n, { meta: o }), F = Object.assign(r, { meta: g }), x = Object.assign(l, { meta: m });
|
|
8
|
-
export {
|
|
9
|
-
O as a,
|
|
10
|
-
j as b,
|
|
11
|
-
x as c,
|
|
12
|
-
F as d,
|
|
13
|
-
f as e,
|
|
14
|
-
C as f
|
|
15
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { c as a, d as e } from "./doc-CTUoMe7o.js";
|
|
2
|
-
import { c as t, d as c } from "./doc-j4W9SUrY.js";
|
|
3
|
-
import { c as o, d as n } from "./doc-DukOmDCo.js";
|
|
4
|
-
import { c as s, d as i } from "./doc-78xF08vt.js";
|
|
5
|
-
const d = Object.assign(a, { meta: e }), g = Object.assign(t, { meta: c }), P = Object.assign(o, { meta: n }), p = Object.assign(s, { meta: i });
|
|
6
|
-
export {
|
|
7
|
-
g as a,
|
|
8
|
-
p as b,
|
|
9
|
-
d as c,
|
|
10
|
-
P as d
|
|
11
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { c as e, d as t } from "./doc-DzvTrZ13.js";
|
|
2
|
-
import { c as a, d as c } from "./doc-BIzjYAZW.js";
|
|
3
|
-
import { c as s, d as o } from "./doc-CraXjOaA.js";
|
|
4
|
-
import { c as r, d as n } from "./doc-BP0DmB7-.js";
|
|
5
|
-
import { c as i, d as m } from "./doc-NhL4Ux8q.js";
|
|
6
|
-
const $ = Object.assign(e, { meta: t }), b = Object.assign(a, { meta: c }), p = Object.assign(s, { meta: o }), f = Object.assign(r, { meta: n }), j = Object.assign(i, { meta: m });
|
|
7
|
-
export {
|
|
8
|
-
b as a,
|
|
9
|
-
p as b,
|
|
10
|
-
f as c,
|
|
11
|
-
j as d,
|
|
12
|
-
$ as e
|
|
13
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { c as a, d as e } from "./doc-gTAsLjVx.js";
|
|
2
|
-
import { c, d as t } from "./doc-bTHwfIVb.js";
|
|
3
|
-
import { c as s, d as r } from "./doc-CBHjiDG7.js";
|
|
4
|
-
import { c as n, d as i } from "./doc-B6kLfMPv.js";
|
|
5
|
-
import { c as o, d as g } from "./doc-BXElhF2h.js";
|
|
6
|
-
import { c as m, d as l } from "./doc-BXSy2aPP.js";
|
|
7
|
-
import { c as d, d as u } from "./doc-BCGQ8Cp5.js";
|
|
8
|
-
import { c as P, d as $ } from "./doc-BtzhgTYj.js";
|
|
9
|
-
import { c as p, d as b } from "./doc-DJjxOYzW.js";
|
|
10
|
-
const k = Object.assign(a, { meta: e }), D = Object.assign(c, { meta: t }), G = Object.assign(s, { meta: r }), I = Object.assign(n, { meta: i }), L = Object.assign(o, { meta: g }), U = Object.assign(m, { meta: l }), x = Object.assign(d, { meta: u }), q = Object.assign(P, { meta: $ }), v = Object.assign(p, { meta: b });
|
|
11
|
-
export {
|
|
12
|
-
L as a,
|
|
13
|
-
x as b,
|
|
14
|
-
k as c,
|
|
15
|
-
I as d,
|
|
16
|
-
D as e,
|
|
17
|
-
U as f,
|
|
18
|
-
G as g,
|
|
19
|
-
q as h,
|
|
20
|
-
v as i
|
|
21
|
-
};
|