x-next 1.8.0 → 1.8.2
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/AI_USAGE.md +2 -2
- package/CHANGELOG.md +9 -0
- package/dist/components/heatmap/Heatmap.d.ts +0 -1
- package/dist/components/heatmap/index.d.ts +0 -3
- package/dist/es/components/heatmap/Heatmap.js +181 -179
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/style/heatmap.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/AI_USAGE.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!-- Generated by pnpm generate:ai-usage. Edit src/docs/guide/ai-usage-recipes.md and script/ai-usage/manifest.js. -->
|
|
2
2
|
# x-next AI 使用手册
|
|
3
3
|
|
|
4
|
-
适用版本:**x-next@1.8.
|
|
4
|
+
适用版本:**x-next@1.8.2**。Vue:`^3.5.0`;Node:`>=20.19.0`。
|
|
5
5
|
|
|
6
|
-
来源指纹(精选示例、映射、版本与公开类型声明):`
|
|
6
|
+
来源指纹(精选示例、映射、版本与公开类型声明):`c34fe0b5eea3d8bce2e9746c48cb98ee067149bfd006291967c77540d25d9acb`。
|
|
7
7
|
|
|
8
8
|
先按业务需要选择组件,不要求全部迁移。本手册限定在用户确认的 26 个组件及必要的同族子组件,未覆盖的导出不表示已完成业务验收。
|
|
9
9
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [1.8.2] - 2026-10-05
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
|
|
9
|
+
- **Heatmap 行列整体错位(1.6.0 起存在)**:格子的位置由「DOM 顺序 + `grid-auto-flow` 自动填充」共同决定,而渲染顺序(行优先)与数据顺序(列优先)不一致,导致整块热力图错排——视觉上「一列」是 7 个连续周的同一天,而不是同一周的 7 天;月份标签与格子内容、悬浮提示与实际位置全部对不上(表现为「点 7 月的位置,提示显示 9-30」)。
|
|
10
|
+
现改为**显式 `grid-row` / `grid-column` 定位**:位置只由格子的行列号决定,DOM 顺序不再参与布局,与悬浮提示、键盘导航使用的语义坐标天然一致。
|
|
11
|
+
- 移除网格上已无意义的 `grid-auto-flow`(自动填充顺序是本次错位的成因之一)。
|
|
12
|
+
- 新增防转置回归测试:断言同一列日期连续(同周)、同一行日期相隔 7 天(同星期几),以及格子的 grid 定位与行列号一致。
|
|
13
|
+
|
|
5
14
|
## [1.8.0] - 2026-10-05
|
|
6
15
|
|
|
7
16
|
### 新增
|
|
@@ -125,7 +125,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
125
125
|
};
|
|
126
126
|
mergedSize: import('vue').ComputedRef<"mini" | "small" | "medium" | "large">;
|
|
127
127
|
cells: import('vue').ComputedRef<HeatmapCell[]>;
|
|
128
|
-
rows: import('vue').ComputedRef<HeatmapCell[][]>;
|
|
129
128
|
range: import('vue').ComputedRef<HeatmapResolvedRange | null>;
|
|
130
129
|
gridStyle: import('vue').ComputedRef<{
|
|
131
130
|
'--x-heatmap-cell-size': string;
|
|
@@ -62,7 +62,6 @@ export declare const Heatmap: {
|
|
|
62
62
|
};
|
|
63
63
|
mergedSize: import('vue').ComputedRef<"mini" | "small" | "medium" | "large">;
|
|
64
64
|
cells: import('vue').ComputedRef<import('./interface').HeatmapCell[]>;
|
|
65
|
-
rows: import('vue').ComputedRef<import('./interface').HeatmapCell[][]>;
|
|
66
65
|
range: import('vue').ComputedRef<import('./interface').HeatmapResolvedRange | null>;
|
|
67
66
|
gridStyle: import('vue').ComputedRef<{
|
|
68
67
|
'--x-heatmap-cell-size': string;
|
|
@@ -201,7 +200,6 @@ export declare const Heatmap: {
|
|
|
201
200
|
};
|
|
202
201
|
mergedSize: import('vue').ComputedRef<"mini" | "small" | "medium" | "large">;
|
|
203
202
|
cells: import('vue').ComputedRef<import('./interface').HeatmapCell[]>;
|
|
204
|
-
rows: import('vue').ComputedRef<import('./interface').HeatmapCell[][]>;
|
|
205
203
|
range: import('vue').ComputedRef<import('./interface').HeatmapResolvedRange | null>;
|
|
206
204
|
gridStyle: import('vue').ComputedRef<{
|
|
207
205
|
'--x-heatmap-cell-size': string;
|
|
@@ -326,7 +324,6 @@ export declare const Heatmap: {
|
|
|
326
324
|
};
|
|
327
325
|
mergedSize: import('vue').ComputedRef<"mini" | "small" | "medium" | "large">;
|
|
328
326
|
cells: import('vue').ComputedRef<import('./interface').HeatmapCell[]>;
|
|
329
|
-
rows: import('vue').ComputedRef<import('./interface').HeatmapCell[][]>;
|
|
330
327
|
range: import('vue').ComputedRef<import('./interface').HeatmapResolvedRange | null>;
|
|
331
328
|
gridStyle: import('vue').ComputedRef<{
|
|
332
329
|
'--x-heatmap-cell-size': string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getClassNameMixin as
|
|
3
|
-
import { useSize as
|
|
4
|
-
import { useLocale as
|
|
5
|
-
import { isObject as
|
|
6
|
-
import { throttleByRaf as
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { getWeekdayLabels as
|
|
9
|
-
import { CELL_SIZE as
|
|
10
|
-
const
|
|
1
|
+
import { defineComponent as X, createVNode as n, useId as ee, toRefs as te, computed as o, ref as W, watch as le, nextTick as ae, Fragment as ne } from "vue";
|
|
2
|
+
import { getClassNameMixin as oe } from "../../_utils/config.js";
|
|
3
|
+
import { useSize as re } from "../../_hooks/use-size.js";
|
|
4
|
+
import { useLocale as ie } from "../../locale/index.js";
|
|
5
|
+
import { isObject as se } from "../../_utils/is.js";
|
|
6
|
+
import { throttleByRaf as ue } from "../../_utils/throttle-by-raf.js";
|
|
7
|
+
import { Spin as ce } from "../spin/index.js";
|
|
8
|
+
import { getWeekdayLabels as de } from "../date-picker/utils.js";
|
|
9
|
+
import { CELL_SIZE as K, resolveRange as me, indexDataByDay as ve, getValueExtent as fe, buildMatrix as he, DEFAULT_COLOR_LEVELS as pe, getMonthLabels as ye, isCellInRequestedRange as ge } from "./helpers/matrix.js";
|
|
10
|
+
const U = 2, Ee = /* @__PURE__ */ X({
|
|
11
11
|
name: "Heatmap",
|
|
12
12
|
props: {
|
|
13
13
|
/**
|
|
@@ -137,139 +137,131 @@ const Z = 2, Ae = /* @__PURE__ */ ee({
|
|
|
137
137
|
slots: Object,
|
|
138
138
|
setup(t, {
|
|
139
139
|
emit: D,
|
|
140
|
-
slots:
|
|
140
|
+
slots: Y
|
|
141
141
|
}) {
|
|
142
142
|
const {
|
|
143
|
-
t:
|
|
144
|
-
locale:
|
|
145
|
-
} =
|
|
146
|
-
mergedSize:
|
|
147
|
-
} =
|
|
143
|
+
t: p,
|
|
144
|
+
locale: C
|
|
145
|
+
} = ie(), z = oe("heatmap"), S = `x-heatmap-cell-${ee()}`, {
|
|
146
|
+
mergedSize: y
|
|
147
|
+
} = re(te(t).size, {
|
|
148
148
|
defaultValue: "medium"
|
|
149
|
-
}),
|
|
149
|
+
}), s = o(() => K[y.value] ?? K.medium), E = o(() => {
|
|
150
150
|
var e;
|
|
151
151
|
return (e = t.activeColors) != null && e.length ? t.activeColors : ["var(--x-heatmap-color-level-1)", "var(--x-heatmap-color-level-2)", "var(--x-heatmap-color-level-3)", "var(--x-heatmap-color-level-4)", "var(--x-heatmap-color-level-5)"];
|
|
152
|
-
}),
|
|
152
|
+
}), R = o(() => t.minimumColor ?? "var(--x-heatmap-color-empty)"), b = o(() => [R.value, ...E.value]), c = o(() => me({
|
|
153
153
|
year: t.year,
|
|
154
154
|
startDate: t.startDate,
|
|
155
155
|
endDate: t.endDate,
|
|
156
156
|
data: t.data
|
|
157
|
-
}, t.firstDayOfWeek)), P =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return m.value.forEach((l) => {
|
|
162
|
-
e[l.rowIndex].push(l);
|
|
163
|
-
}), e;
|
|
164
|
-
}), V = a(() => me(t.firstDayOfWeek, z.value.datePicker)), _ = a(() => {
|
|
165
|
-
if (!i.value) return [];
|
|
166
|
-
const e = i.value.requestedStart.year() !== i.value.requestedEnd.year();
|
|
167
|
-
return ge(i.value, m.value, (l) => e ? l.format("YYYY-MM") : g("heatmap.month", {
|
|
157
|
+
}, t.firstDayOfWeek)), P = o(() => ve(t.data)), A = o(() => fe(t.data)), m = o(() => c.value ? he(c.value, P.value, A.value, E.value.length || pe) : []), q = o(() => de(t.firstDayOfWeek, C.value.datePicker)), F = o(() => {
|
|
158
|
+
if (!c.value) return [];
|
|
159
|
+
const e = c.value.requestedStart.year() !== c.value.requestedEnd.year();
|
|
160
|
+
return ye(c.value, m.value, (l) => e ? l.format("YYYY-MM") : p("heatmap.month", {
|
|
168
161
|
month: l.month() + 1
|
|
169
162
|
}));
|
|
170
|
-
}),
|
|
171
|
-
const l = e.date.format("YYYY-MM-DD"),
|
|
172
|
-
return
|
|
163
|
+
}), V = (e) => b.value[e.level] ?? R.value, $ = (e) => {
|
|
164
|
+
const l = e.date.format("YYYY-MM-DD"), r = e.value;
|
|
165
|
+
return r === null ? p("heatmap.noData", {
|
|
173
166
|
date: l
|
|
174
|
-
}) :
|
|
167
|
+
}) : p("heatmap.value", {
|
|
175
168
|
date: l,
|
|
176
|
-
value:
|
|
169
|
+
value: r
|
|
177
170
|
});
|
|
178
|
-
},
|
|
179
|
-
tooltip:
|
|
180
|
-
},
|
|
181
|
-
const e =
|
|
182
|
-
return
|
|
183
|
-
}),
|
|
171
|
+
}, d = W(null), L = o(() => t.tooltip !== !1), x = W(null), i = {
|
|
172
|
+
tooltip: x
|
|
173
|
+
}, k = W(0), M = o(() => d.value === null ? null : m.value[d.value] ?? null), w = o(() => m.value.reduce((e, l) => Math.max(e, l.colIndex + 1), 0)), _ = o(() => {
|
|
174
|
+
const e = U;
|
|
175
|
+
return w.value <= 0 ? 0 : w.value * s.value + (w.value - 1) * e;
|
|
176
|
+
}), O = o(() => {
|
|
184
177
|
const e = M.value;
|
|
185
178
|
if (!e) return {};
|
|
186
|
-
const l =
|
|
187
|
-
let
|
|
188
|
-
return h > 0 && f > 0 && (
|
|
189
|
-
left: `${
|
|
190
|
-
top: `${
|
|
179
|
+
const l = U, r = e.colIndex * (s.value + l) + s.value / 2, u = e.rowIndex * (s.value + l) + s.value, h = k.value / 2, f = _.value;
|
|
180
|
+
let H = r;
|
|
181
|
+
return h > 0 && f > 0 && (H = f >= k.value ? Math.min(Math.max(r, h), f - h) : f / 2), {
|
|
182
|
+
left: `${H}px`,
|
|
183
|
+
top: `${u + 6}px`
|
|
191
184
|
};
|
|
192
185
|
});
|
|
193
|
-
|
|
186
|
+
le(d, (e) => {
|
|
194
187
|
if (e === null) {
|
|
195
|
-
|
|
188
|
+
k.value = 0;
|
|
196
189
|
return;
|
|
197
190
|
}
|
|
198
|
-
|
|
199
|
-
var
|
|
200
|
-
const l = ((
|
|
201
|
-
l !==
|
|
191
|
+
ae(() => {
|
|
192
|
+
var r;
|
|
193
|
+
const l = ((r = x.value) == null ? void 0 : r.offsetWidth) ?? 0;
|
|
194
|
+
l !== k.value && (k.value = l);
|
|
202
195
|
});
|
|
203
196
|
});
|
|
204
|
-
const
|
|
205
|
-
var
|
|
197
|
+
const j = (e) => {
|
|
198
|
+
var u;
|
|
206
199
|
if (!L.value) return;
|
|
207
|
-
const l = e.target,
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
},
|
|
200
|
+
const l = e.target, r = (u = l == null ? void 0 : l.dataset) == null ? void 0 : u.index;
|
|
201
|
+
g.value = !1, d.value = r === void 0 ? null : Number(r);
|
|
202
|
+
}, B = () => {
|
|
203
|
+
d.value = null, g.value = !1;
|
|
204
|
+
}, g = W(!1), N = (e, l = !1) => {
|
|
205
|
+
g.value = l, d.value = e;
|
|
206
|
+
}, T = (e) => {
|
|
214
207
|
if (!L.value || m.value.length === 0) return;
|
|
215
|
-
const l = m.value.length - 1,
|
|
216
|
-
let
|
|
217
|
-
if (e.key === "ArrowRight")
|
|
218
|
-
else if (e.key === "ArrowLeft")
|
|
219
|
-
else if (e.key === "ArrowDown")
|
|
220
|
-
else if (e.key === "ArrowUp")
|
|
208
|
+
const l = m.value.length - 1, r = d.value;
|
|
209
|
+
let u = null;
|
|
210
|
+
if (e.key === "ArrowRight") u = Math.min(l, (r ?? -1) + 1);
|
|
211
|
+
else if (e.key === "ArrowLeft") u = Math.max(0, (r ?? l + 1) - 1);
|
|
212
|
+
else if (e.key === "ArrowDown") u = Math.min(l, (r ?? -7) + 7);
|
|
213
|
+
else if (e.key === "ArrowUp") u = Math.max(0, (r ?? 7) - 7);
|
|
221
214
|
else if (e.key === "Home") {
|
|
222
|
-
const h =
|
|
223
|
-
|
|
215
|
+
const h = r ?? 0, f = m.value[h];
|
|
216
|
+
u = f ? Math.max(0, h - f.rowIndex) : 0;
|
|
224
217
|
} else if (e.key === "End") {
|
|
225
|
-
const h =
|
|
226
|
-
|
|
218
|
+
const h = r ?? l, f = m.value[h];
|
|
219
|
+
u = f ? Math.min(l, h + (6 - f.rowIndex)) : l;
|
|
227
220
|
} else if (e.key === "Escape") {
|
|
228
|
-
|
|
221
|
+
B();
|
|
229
222
|
return;
|
|
230
223
|
}
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
|
|
234
|
-
},
|
|
224
|
+
u !== null && (e.preventDefault(), N(u, !0));
|
|
225
|
+
}, a = () => {
|
|
226
|
+
d.value === null && N(0, !0);
|
|
227
|
+
}, v = o(() => g.value && d.value !== null ? `${S}-${d.value}` : void 0), I = o(() => t.ariaLabel ?? p("heatmap.gridLabel")), G = o(() => {
|
|
235
228
|
const e = M.value;
|
|
236
|
-
return !
|
|
237
|
-
}),
|
|
229
|
+
return !g.value || !e ? "" : $(e);
|
|
230
|
+
}), Z = (e, l) => {
|
|
238
231
|
D("cellClick", e, l);
|
|
239
|
-
},
|
|
240
|
-
"--x-heatmap-cell-size": `${
|
|
241
|
-
gridTemplateRows: `repeat(7, ${
|
|
232
|
+
}, J = ue(j), Q = o(() => ({
|
|
233
|
+
"--x-heatmap-cell-size": `${s.value}px`,
|
|
234
|
+
gridTemplateRows: `repeat(7, ${s.value}px)`
|
|
242
235
|
}));
|
|
243
236
|
return {
|
|
244
|
-
t:
|
|
245
|
-
className:
|
|
246
|
-
mergedSize:
|
|
237
|
+
t: p,
|
|
238
|
+
className: z,
|
|
239
|
+
mergedSize: y,
|
|
247
240
|
cells: m,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
monthLabels: _,
|
|
241
|
+
range: c,
|
|
242
|
+
gridStyle: Q,
|
|
243
|
+
weekdayLabels: q,
|
|
244
|
+
monthLabels: F,
|
|
253
245
|
activeCell: M,
|
|
254
246
|
tooltipEnabled: L,
|
|
255
|
-
tooltipStyle:
|
|
256
|
-
cellColor:
|
|
247
|
+
tooltipStyle: O,
|
|
248
|
+
cellColor: V,
|
|
257
249
|
cellLabel: $,
|
|
258
|
-
handleCellClick:
|
|
259
|
-
throttledMove:
|
|
260
|
-
clearActive:
|
|
261
|
-
handleKeydown:
|
|
262
|
-
handleGridFocus:
|
|
263
|
-
activeDescendant:
|
|
264
|
-
gridLabel:
|
|
265
|
-
cellIdPrefix:
|
|
266
|
-
liveText:
|
|
267
|
-
isInRange: (e) =>
|
|
268
|
-
colorPalette:
|
|
269
|
-
slots:
|
|
270
|
-
refs:
|
|
250
|
+
handleCellClick: Z,
|
|
251
|
+
throttledMove: J,
|
|
252
|
+
clearActive: B,
|
|
253
|
+
handleKeydown: T,
|
|
254
|
+
handleGridFocus: a,
|
|
255
|
+
activeDescendant: v,
|
|
256
|
+
gridLabel: I,
|
|
257
|
+
cellIdPrefix: S,
|
|
258
|
+
liveText: G,
|
|
259
|
+
isInRange: (e) => c.value ? ge(e, c.value.requestedStart, c.value.requestedEnd) : !0,
|
|
260
|
+
colorPalette: b,
|
|
261
|
+
slots: Y,
|
|
262
|
+
refs: i,
|
|
271
263
|
setTooltipElement: (e) => {
|
|
272
|
-
|
|
264
|
+
x.value = e;
|
|
273
265
|
}
|
|
274
266
|
};
|
|
275
267
|
},
|
|
@@ -277,133 +269,143 @@ const Z = 2, Ae = /* @__PURE__ */ ee({
|
|
|
277
269
|
const {
|
|
278
270
|
className: t,
|
|
279
271
|
mergedSize: D,
|
|
280
|
-
cells:
|
|
281
|
-
|
|
282
|
-
range: z,
|
|
272
|
+
cells: Y,
|
|
273
|
+
range: p,
|
|
283
274
|
gridStyle: C,
|
|
284
|
-
weekdayLabels:
|
|
285
|
-
monthLabels:
|
|
286
|
-
activeCell:
|
|
287
|
-
tooltipEnabled:
|
|
288
|
-
tooltipStyle:
|
|
275
|
+
weekdayLabels: z,
|
|
276
|
+
monthLabels: S,
|
|
277
|
+
activeCell: y,
|
|
278
|
+
tooltipEnabled: s,
|
|
279
|
+
tooltipStyle: E,
|
|
289
280
|
cellColor: R,
|
|
290
|
-
cellLabel:
|
|
291
|
-
handleCellClick:
|
|
292
|
-
throttledMove:
|
|
293
|
-
clearActive:
|
|
294
|
-
handleKeydown:
|
|
295
|
-
handleGridFocus:
|
|
296
|
-
activeDescendant:
|
|
297
|
-
gridLabel:
|
|
281
|
+
cellLabel: b,
|
|
282
|
+
handleCellClick: c,
|
|
283
|
+
throttledMove: P,
|
|
284
|
+
clearActive: A,
|
|
285
|
+
handleKeydown: m,
|
|
286
|
+
handleGridFocus: q,
|
|
287
|
+
activeDescendant: F,
|
|
288
|
+
gridLabel: V,
|
|
298
289
|
cellIdPrefix: $,
|
|
299
|
-
liveText:
|
|
290
|
+
liveText: d,
|
|
300
291
|
isInRange: L,
|
|
301
|
-
colorPalette:
|
|
302
|
-
slots:
|
|
303
|
-
refs:
|
|
292
|
+
colorPalette: x,
|
|
293
|
+
slots: i,
|
|
294
|
+
refs: k,
|
|
304
295
|
setTooltipElement: M,
|
|
305
|
-
t:
|
|
296
|
+
t: w
|
|
306
297
|
} = this;
|
|
307
|
-
if (!
|
|
308
|
-
const
|
|
298
|
+
if (!p) return null;
|
|
299
|
+
const _ = se(this.loading) ? this.loading : {
|
|
309
300
|
loading: this.loading,
|
|
310
301
|
dot: "color"
|
|
311
|
-
},
|
|
302
|
+
}, O = s && y !== null, j = () => n("div", {
|
|
312
303
|
class: t.element("grid"),
|
|
313
304
|
style: {
|
|
314
305
|
...C,
|
|
315
306
|
"--x-heatmap-cell-gap": "var(--x-spacing-1)"
|
|
316
307
|
},
|
|
317
|
-
role:
|
|
318
|
-
tabindex:
|
|
319
|
-
"aria-activedescendant":
|
|
320
|
-
"aria-label":
|
|
321
|
-
onMousemove:
|
|
322
|
-
onMouseleave:
|
|
323
|
-
onFocus:
|
|
324
|
-
onBlur:
|
|
325
|
-
onKeydown:
|
|
326
|
-
}, [
|
|
327
|
-
key:
|
|
328
|
-
id: `${$}-${
|
|
329
|
-
class: [t.element("cell"), t.modifier(`level-${
|
|
330
|
-
[t.is("out-of-range")]: !L(
|
|
308
|
+
role: s ? "grid" : void 0,
|
|
309
|
+
tabindex: s ? 0 : void 0,
|
|
310
|
+
"aria-activedescendant": F,
|
|
311
|
+
"aria-label": s ? V : void 0,
|
|
312
|
+
onMousemove: P,
|
|
313
|
+
onMouseleave: A,
|
|
314
|
+
onFocus: q,
|
|
315
|
+
onBlur: A,
|
|
316
|
+
onKeydown: m
|
|
317
|
+
}, [Y.map((a, v) => n("div", {
|
|
318
|
+
key: a.timestamp,
|
|
319
|
+
id: `${$}-${v}`,
|
|
320
|
+
class: [t.element("cell"), t.modifier(`level-${a.level}`), {
|
|
321
|
+
[t.is("out-of-range")]: !L(a)
|
|
331
322
|
}],
|
|
332
323
|
style: {
|
|
333
|
-
backgroundColor: R(
|
|
324
|
+
backgroundColor: R(a),
|
|
325
|
+
/*
|
|
326
|
+
* 显式定位:位置由 rowIndex / colIndex 决定,不再依赖
|
|
327
|
+
* `grid-auto-flow` 的自动填充顺序。
|
|
328
|
+
*
|
|
329
|
+
* 这正是此前数据被整体转置的原因:cells 是列优先数组,
|
|
330
|
+
* CSS 按列填充,而渲染顺序曾是行优先,三者不一致时布局静默错位。
|
|
331
|
+
* 显式定位后 DOM 顺序对布局没有任何影响,与 tooltip 使用的
|
|
332
|
+
* 语义坐标天然一致(等价于 SVG 里用公式算 x/y)。
|
|
333
|
+
*/
|
|
334
|
+
gridRow: a.rowIndex + 1,
|
|
335
|
+
gridColumn: a.colIndex + 1
|
|
334
336
|
},
|
|
335
|
-
"data-index":
|
|
336
|
-
title:
|
|
337
|
-
onClick: (I) =>
|
|
337
|
+
"data-index": v,
|
|
338
|
+
title: O ? void 0 : b(a),
|
|
339
|
+
onClick: (I) => c(a, I),
|
|
338
340
|
role: "gridcell",
|
|
339
|
-
"aria-label":
|
|
340
|
-
}, []))
|
|
341
|
-
if (!
|
|
342
|
-
const
|
|
343
|
-
...
|
|
344
|
-
label:
|
|
341
|
+
"aria-label": b(a)
|
|
342
|
+
}, [])), B()]), B = () => {
|
|
343
|
+
if (!O || !y) return null;
|
|
344
|
+
const a = {
|
|
345
|
+
...y,
|
|
346
|
+
label: b(y)
|
|
345
347
|
};
|
|
346
348
|
return n("div", {
|
|
347
349
|
ref: M,
|
|
348
350
|
class: [t.element("tooltip"), t.is("visible")],
|
|
349
|
-
style:
|
|
351
|
+
style: E,
|
|
350
352
|
role: "tooltip"
|
|
351
|
-
}, [
|
|
352
|
-
},
|
|
353
|
-
var
|
|
353
|
+
}, [i.tooltip ? i.tooltip(a) : a.label]);
|
|
354
|
+
}, g = () => {
|
|
355
|
+
var a, v;
|
|
354
356
|
return this.showColorIndicator ? n("div", {
|
|
355
357
|
class: t.element("indicator")
|
|
356
|
-
}, [
|
|
357
|
-
colors:
|
|
358
|
-
}) : n(
|
|
358
|
+
}, [i.indicator ? i.indicator({
|
|
359
|
+
colors: x
|
|
360
|
+
}) : n(ne, null, [n("span", {
|
|
359
361
|
class: t.element("indicator-leading")
|
|
360
|
-
}, [((
|
|
361
|
-
key:
|
|
362
|
+
}, [((a = i["indicator-leading-text"]) == null ? void 0 : a.call(i)) ?? w("heatmap.less")]), x.map((I, G) => n("span", {
|
|
363
|
+
key: G,
|
|
362
364
|
class: t.element("indicator-swatch"),
|
|
363
365
|
style: {
|
|
364
|
-
backgroundColor:
|
|
366
|
+
backgroundColor: I
|
|
365
367
|
}
|
|
366
368
|
}, null)), n("span", {
|
|
367
369
|
class: t.element("indicator-trailing")
|
|
368
|
-
}, [((
|
|
369
|
-
},
|
|
370
|
+
}, [((v = i["indicator-trailing-text"]) == null ? void 0 : v.call(i)) ?? w("heatmap.more")])])]) : null;
|
|
371
|
+
}, N = () => n("div", {
|
|
370
372
|
class: t.element("body")
|
|
371
373
|
}, [this.showWeekLabels && n("div", {
|
|
372
374
|
class: t.element("week-labels"),
|
|
373
375
|
style: C
|
|
374
|
-
}, [
|
|
375
|
-
key:
|
|
376
|
+
}, [z.map((a, v) => n("span", {
|
|
377
|
+
key: v,
|
|
376
378
|
class: t.element("week-label"),
|
|
377
379
|
style: {
|
|
378
|
-
visibility:
|
|
380
|
+
visibility: v % 2 === 1 ? "visible" : "hidden"
|
|
379
381
|
}
|
|
380
|
-
}, [
|
|
382
|
+
}, [a]))]), n("div", {
|
|
381
383
|
class: t.element("grid-wrapper")
|
|
382
384
|
}, [this.showMonthLabels && n("div", {
|
|
383
385
|
class: t.element("month-labels"),
|
|
384
386
|
style: C
|
|
385
|
-
}, [
|
|
386
|
-
key:
|
|
387
|
+
}, [S.map((a) => n("span", {
|
|
388
|
+
key: a.text,
|
|
387
389
|
class: t.element("month-label"),
|
|
388
390
|
style: {
|
|
389
|
-
gridColumn:
|
|
391
|
+
gridColumn: a.colIndex + 1
|
|
390
392
|
}
|
|
391
|
-
}, [
|
|
393
|
+
}, [a.text]))]), j()])]), T = s;
|
|
392
394
|
return n("div", {
|
|
393
395
|
class: [t.block, t.modifier(`size-${D}`)]
|
|
394
396
|
}, [n("div", {
|
|
395
|
-
role: !
|
|
396
|
-
"aria-label":
|
|
397
|
-
}, [n(
|
|
398
|
-
default: () => [
|
|
397
|
+
role: !T && this.ariaLabel ? "img" : void 0,
|
|
398
|
+
"aria-label": T ? void 0 : this.ariaLabel
|
|
399
|
+
}, [n(ce, _, {
|
|
400
|
+
default: () => [N(), g(), i.footer && n("div", {
|
|
399
401
|
class: t.element("footer")
|
|
400
|
-
}, [
|
|
402
|
+
}, [i.footer()])]
|
|
401
403
|
})]), n("span", {
|
|
402
404
|
class: t.element("live"),
|
|
403
405
|
"aria-live": "polite"
|
|
404
|
-
}, [
|
|
406
|
+
}, [d])]);
|
|
405
407
|
}
|
|
406
408
|
});
|
|
407
409
|
export {
|
|
408
|
-
|
|
410
|
+
Ee as default
|
|
409
411
|
};
|