x-next 1.7.0 → 1.8.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/AI_USAGE.md +129 -4
- package/CHANGELOG.md +38 -0
- package/dist/_hooks/use-chart-size.d.ts +25 -0
- package/dist/_utils/chart/index.d.ts +6 -0
- package/dist/_utils/chart/padding.d.ts +15 -0
- package/dist/_utils/chart/path.d.ts +34 -0
- package/dist/_utils/chart/scale.d.ts +55 -0
- package/dist/components/_components/chart/ChartAxis.d.ts +85 -0
- package/dist/components/_components/chart/ChartLegend.d.ts +26 -0
- package/dist/components/_components/chart/ChartTooltip.d.ts +76 -0
- package/dist/components/_components/chart/colors.d.ts +10 -0
- package/dist/components/_components/chart/interface.d.ts +38 -0
- package/dist/components/bar-chart/BarChart.d.ts +278 -0
- package/dist/components/bar-chart/helpers/layout.d.ts +55 -0
- package/dist/components/bar-chart/index.d.ts +600 -0
- package/dist/components/bar-chart/interface.d.ts +74 -0
- package/dist/components/bar-chart/props.d.ts +145 -0
- package/dist/components/heatmap/Heatmap.d.ts +10 -0
- package/dist/components/heatmap/index.d.ts +30 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/line-chart/LineChart.d.ts +295 -0
- package/dist/components/line-chart/helpers/layout.d.ts +74 -0
- package/dist/components/line-chart/index.d.ts +614 -0
- package/dist/components/line-chart/interface.d.ts +76 -0
- package/dist/components/line-chart/props.d.ts +173 -0
- package/dist/components/pie-chart/PieChart.d.ts +219 -0
- package/dist/components/pie-chart/index.d.ts +470 -0
- package/dist/components/pie-chart/interface.d.ts +58 -0
- package/dist/components/pie-chart/props.d.ts +107 -0
- package/dist/components/trend-chart/components/TrendChart.d.ts +19 -96
- package/dist/components/trend-chart/index.d.ts +33 -187
- package/dist/components/trend-chart/props.d.ts +9 -78
- package/dist/components/trend-chart/themes.d.ts +0 -1
- package/dist/es/_hooks/use-chart-size.js +25 -0
- package/dist/es/_styles/palette-aliases.js +5 -0
- package/dist/es/_utils/chart/padding.js +22 -0
- package/dist/es/_utils/chart/path.js +69 -0
- package/dist/es/_utils/chart/scale.js +77 -0
- package/dist/es/components/_components/chart/ChartAxis.js +79 -0
- package/dist/es/components/_components/chart/ChartLegend.js +53 -0
- package/dist/es/components/_components/chart/ChartTooltip.js +64 -0
- package/dist/es/components/_components/chart/colors.js +12 -0
- package/dist/es/components/bar-chart/BarChart.js +470 -0
- package/dist/es/components/bar-chart/helpers/layout.js +53 -0
- package/dist/es/components/bar-chart/index.js +8 -0
- package/dist/es/components/bar-chart/props.js +148 -0
- package/dist/es/components/heatmap/Heatmap.js +244 -169
- package/dist/es/components/index.js +132 -126
- package/dist/es/components/line-chart/LineChart.js +532 -0
- package/dist/es/components/line-chart/helpers/layout.js +80 -0
- package/dist/es/components/line-chart/index.js +8 -0
- package/dist/es/components/line-chart/props.js +178 -0
- package/dist/es/components/pie-chart/PieChart.js +397 -0
- package/dist/es/components/pie-chart/index.js +8 -0
- package/dist/es/components/pie-chart/props.js +104 -0
- package/dist/es/components/trend-chart/components/TrendChart.js +143 -183
- package/dist/es/components/trend-chart/components/trend-chart-curve.js +85 -81
- package/dist/es/components/trend-chart/props.js +28 -74
- package/dist/es/components/trend-chart/themes.js +30 -31
- package/dist/es/index.js +193 -187
- package/dist/es/locale/en-US.js +8 -1
- package/dist/es/locale/zh-CN.js +8 -1
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +13 -0
- package/dist/style/bar-chart.css +1 -0
- package/dist/style/bar-chart.js +2 -0
- package/dist/style/base.css +1 -1
- package/dist/style/heatmap.css +1 -1
- package/dist/style/line-chart.css +1 -0
- package/dist/style/line-chart.js +2 -0
- package/dist/style/pie-chart.css +1 -0
- package/dist/style/pie-chart.js +2 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
- package/volar.d.ts +3 -0
- package/dist/components/trend-chart/components/trend-chart-grid.d.ts +0 -55
- package/dist/components/trend-chart/components/trend-chart-labels.d.ts +0 -26
- package/dist/components/trend-chart/helpers/genPath.d.ts +0 -8
- package/dist/components/trend-chart/helpers/getPadding.d.ts +0 -8
- package/dist/components/trend-chart/helpers/validatePadding.d.ts +0 -2
- package/dist/es/components/trend-chart/components/trend-chart-grid.js +0 -62
- package/dist/es/components/trend-chart/components/trend-chart-labels.js +0 -75
- package/dist/es/components/trend-chart/helpers/genPath.js +0 -22
- package/dist/es/components/trend-chart/helpers/getPadding.js +0 -21
- package/dist/es/components/trend-chart/helpers/validatePadding.js +0 -7
|
@@ -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 ee, createVNode as n, useId as te, toRefs as le, computed as a, ref as Y, watch as ae, nextTick as ne, Fragment as oe } from "vue";
|
|
2
|
+
import { getClassNameMixin as re } from "../../_utils/config.js";
|
|
3
|
+
import { useSize as ie } from "../../_hooks/use-size.js";
|
|
4
|
+
import { useLocale as se } from "../../locale/index.js";
|
|
5
|
+
import { isObject as ue } from "../../_utils/is.js";
|
|
6
|
+
import { throttleByRaf as ce } from "../../_utils/throttle-by-raf.js";
|
|
7
|
+
import { Spin as de } from "../spin/index.js";
|
|
8
|
+
import { getWeekdayLabels as me } from "../date-picker/utils.js";
|
|
9
|
+
import { CELL_SIZE as U, resolveRange as ve, indexDataByDay as fe, getValueExtent as he, buildMatrix as pe, DEFAULT_COLOR_LEVELS as ye, getMonthLabels as ge, isCellInRequestedRange as xe } from "./helpers/matrix.js";
|
|
10
|
+
const Z = 2, Ae = /* @__PURE__ */ ee({
|
|
11
11
|
name: "Heatmap",
|
|
12
12
|
props: {
|
|
13
13
|
/**
|
|
@@ -70,7 +70,7 @@ const ue = /* @__PURE__ */ W({
|
|
|
70
70
|
firstDayOfWeek: {
|
|
71
71
|
type: Number,
|
|
72
72
|
default: 0,
|
|
73
|
-
validator: (
|
|
73
|
+
validator: (t) => t >= 0 && t <= 6
|
|
74
74
|
},
|
|
75
75
|
/**
|
|
76
76
|
* @zh 是否展示星期标签
|
|
@@ -132,203 +132,278 @@ const ue = /* @__PURE__ */ W({
|
|
|
132
132
|
* @param {HeatmapCell} cell
|
|
133
133
|
* @param {MouseEvent} ev
|
|
134
134
|
*/
|
|
135
|
-
cellClick: (
|
|
135
|
+
cellClick: (t, D) => !0
|
|
136
136
|
},
|
|
137
137
|
slots: Object,
|
|
138
|
-
setup(
|
|
139
|
-
emit:
|
|
140
|
-
slots:
|
|
138
|
+
setup(t, {
|
|
139
|
+
emit: D,
|
|
140
|
+
slots: S
|
|
141
141
|
}) {
|
|
142
142
|
const {
|
|
143
|
-
t:
|
|
144
|
-
locale:
|
|
145
|
-
} =
|
|
146
|
-
mergedSize:
|
|
147
|
-
} =
|
|
143
|
+
t: g,
|
|
144
|
+
locale: z
|
|
145
|
+
} = se(), C = re("heatmap"), E = `x-heatmap-cell-${te()}`, {
|
|
146
|
+
mergedSize: A
|
|
147
|
+
} = ie(le(t).size, {
|
|
148
148
|
defaultValue: "medium"
|
|
149
|
-
}),
|
|
150
|
-
var
|
|
151
|
-
return (
|
|
152
|
-
}),
|
|
153
|
-
year:
|
|
154
|
-
startDate:
|
|
155
|
-
endDate:
|
|
156
|
-
data:
|
|
157
|
-
},
|
|
158
|
-
const
|
|
149
|
+
}), d = a(() => U[A.value] ?? U.medium), p = a(() => {
|
|
150
|
+
var e;
|
|
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
|
+
}), O = a(() => t.minimumColor ?? "var(--x-heatmap-color-empty)"), R = a(() => [O.value, ...p.value]), i = a(() => ve({
|
|
153
|
+
year: t.year,
|
|
154
|
+
startDate: t.startDate,
|
|
155
|
+
endDate: t.endDate,
|
|
156
|
+
data: t.data
|
|
157
|
+
}, t.firstDayOfWeek)), P = a(() => fe(t.data)), q = a(() => he(t.data)), m = a(() => i.value ? pe(i.value, P.value, q.value, p.value.length || ye) : []), F = a(() => {
|
|
158
|
+
const e = Array.from({
|
|
159
159
|
length: 7
|
|
160
160
|
}, () => []);
|
|
161
|
-
return
|
|
162
|
-
|
|
163
|
-
}),
|
|
164
|
-
}),
|
|
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
165
|
if (!i.value) return [];
|
|
166
|
-
const
|
|
167
|
-
return
|
|
168
|
-
month:
|
|
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", {
|
|
168
|
+
month: l.month() + 1
|
|
169
169
|
}));
|
|
170
|
-
}),
|
|
171
|
-
const
|
|
172
|
-
return
|
|
173
|
-
date:
|
|
174
|
-
}) :
|
|
175
|
-
date:
|
|
176
|
-
value:
|
|
170
|
+
}), j = (e) => R.value[e.level] ?? O.value, $ = (e) => {
|
|
171
|
+
const l = e.date.format("YYYY-MM-DD"), o = e.value;
|
|
172
|
+
return o === null ? g("heatmap.noData", {
|
|
173
|
+
date: l
|
|
174
|
+
}) : g("heatmap.value", {
|
|
175
|
+
date: l,
|
|
176
|
+
value: o
|
|
177
177
|
});
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
|
|
178
|
+
}, v = Y(null), L = a(() => t.tooltip !== !1), b = Y(null), s = {
|
|
179
|
+
tooltip: b
|
|
180
|
+
}, w = Y(0), M = a(() => v.value === null ? null : m.value[v.value] ?? null), k = a(() => m.value.reduce((e, l) => Math.max(e, l.colIndex + 1), 0)), G = a(() => {
|
|
181
|
+
const e = Z;
|
|
182
|
+
return k.value <= 0 ? 0 : k.value * d.value + (k.value - 1) * e;
|
|
183
|
+
}), B = a(() => {
|
|
184
|
+
const e = M.value;
|
|
185
|
+
if (!e) return {};
|
|
186
|
+
const l = Z, o = e.colIndex * (d.value + l) + d.value / 2, c = e.rowIndex * (d.value + l) + d.value, h = w.value / 2, f = G.value;
|
|
187
|
+
let K = o;
|
|
188
|
+
return h > 0 && f > 0 && (K = f >= w.value ? Math.min(Math.max(o, h), f - h) : f / 2), {
|
|
189
|
+
left: `${K}px`,
|
|
190
|
+
top: `${c + 6}px`
|
|
185
191
|
};
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
});
|
|
193
|
+
ae(v, (e) => {
|
|
194
|
+
if (e === null) {
|
|
195
|
+
w.value = 0;
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
ne(() => {
|
|
199
|
+
var o;
|
|
200
|
+
const l = ((o = b.value) == null ? void 0 : o.offsetWidth) ?? 0;
|
|
201
|
+
l !== w.value && (w.value = l);
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
const H = (e) => {
|
|
205
|
+
var c;
|
|
206
|
+
if (!L.value) return;
|
|
207
|
+
const l = e.target, o = (c = l == null ? void 0 : l.dataset) == null ? void 0 : c.index;
|
|
208
|
+
x.value = !1, v.value = o === void 0 ? null : Number(o);
|
|
209
|
+
}, N = () => {
|
|
210
|
+
v.value = null, x.value = !1;
|
|
211
|
+
}, x = Y(!1), T = (e, l = !1) => {
|
|
212
|
+
x.value = l, v.value = e;
|
|
213
|
+
}, W = (e) => {
|
|
214
|
+
if (!L.value || m.value.length === 0) return;
|
|
215
|
+
const l = m.value.length - 1, o = v.value;
|
|
216
|
+
let c = null;
|
|
217
|
+
if (e.key === "ArrowRight") c = Math.min(l, (o ?? -1) + 1);
|
|
218
|
+
else if (e.key === "ArrowLeft") c = Math.max(0, (o ?? l + 1) - 1);
|
|
219
|
+
else if (e.key === "ArrowDown") c = Math.min(l, (o ?? -7) + 7);
|
|
220
|
+
else if (e.key === "ArrowUp") c = Math.max(0, (o ?? 7) - 7);
|
|
221
|
+
else if (e.key === "Home") {
|
|
222
|
+
const h = o ?? 0, f = m.value[h];
|
|
223
|
+
c = f ? Math.max(0, h - f.rowIndex) : 0;
|
|
224
|
+
} else if (e.key === "End") {
|
|
225
|
+
const h = o ?? l, f = m.value[h];
|
|
226
|
+
c = f ? Math.min(l, h + (6 - f.rowIndex)) : l;
|
|
227
|
+
} else if (e.key === "Escape") {
|
|
228
|
+
N();
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
c !== null && (e.preventDefault(), T(c, !0));
|
|
232
|
+
}, r = () => {
|
|
233
|
+
v.value === null && T(0, !0);
|
|
234
|
+
}, y = a(() => x.value && v.value !== null ? `${E}-${v.value}` : void 0), u = a(() => t.ariaLabel ?? g("heatmap.gridLabel")), I = a(() => {
|
|
235
|
+
const e = M.value;
|
|
236
|
+
return !x.value || !e ? "" : $(e);
|
|
237
|
+
}), J = (e, l) => {
|
|
238
|
+
D("cellClick", e, l);
|
|
239
|
+
}, Q = ce(H), X = a(() => ({
|
|
240
|
+
"--x-heatmap-cell-size": `${d.value}px`,
|
|
241
|
+
gridTemplateRows: `repeat(7, ${d.value}px)`
|
|
198
242
|
}));
|
|
199
243
|
return {
|
|
200
|
-
t:
|
|
201
|
-
className:
|
|
202
|
-
mergedSize:
|
|
203
|
-
cells:
|
|
204
|
-
rows:
|
|
244
|
+
t: g,
|
|
245
|
+
className: C,
|
|
246
|
+
mergedSize: A,
|
|
247
|
+
cells: m,
|
|
248
|
+
rows: F,
|
|
205
249
|
range: i,
|
|
206
|
-
gridStyle:
|
|
207
|
-
weekdayLabels:
|
|
208
|
-
monthLabels:
|
|
209
|
-
activeCell:
|
|
210
|
-
tooltipEnabled:
|
|
211
|
-
tooltipStyle:
|
|
212
|
-
cellColor:
|
|
213
|
-
cellLabel:
|
|
214
|
-
handleCellClick:
|
|
215
|
-
throttledMove:
|
|
216
|
-
clearActive:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
250
|
+
gridStyle: X,
|
|
251
|
+
weekdayLabels: V,
|
|
252
|
+
monthLabels: _,
|
|
253
|
+
activeCell: M,
|
|
254
|
+
tooltipEnabled: L,
|
|
255
|
+
tooltipStyle: B,
|
|
256
|
+
cellColor: j,
|
|
257
|
+
cellLabel: $,
|
|
258
|
+
handleCellClick: J,
|
|
259
|
+
throttledMove: Q,
|
|
260
|
+
clearActive: N,
|
|
261
|
+
handleKeydown: W,
|
|
262
|
+
handleGridFocus: r,
|
|
263
|
+
activeDescendant: y,
|
|
264
|
+
gridLabel: u,
|
|
265
|
+
cellIdPrefix: E,
|
|
266
|
+
liveText: I,
|
|
267
|
+
isInRange: (e) => i.value ? xe(e, i.value.requestedStart, i.value.requestedEnd) : !0,
|
|
268
|
+
colorPalette: R,
|
|
269
|
+
slots: S,
|
|
270
|
+
refs: s,
|
|
271
|
+
setTooltipElement: (e) => {
|
|
272
|
+
b.value = e;
|
|
273
|
+
}
|
|
220
274
|
};
|
|
221
275
|
},
|
|
222
276
|
render() {
|
|
223
277
|
const {
|
|
224
|
-
className:
|
|
225
|
-
mergedSize:
|
|
226
|
-
cells:
|
|
227
|
-
rows:
|
|
228
|
-
range:
|
|
229
|
-
gridStyle:
|
|
230
|
-
weekdayLabels:
|
|
231
|
-
monthLabels:
|
|
278
|
+
className: t,
|
|
279
|
+
mergedSize: D,
|
|
280
|
+
cells: S,
|
|
281
|
+
rows: g,
|
|
282
|
+
range: z,
|
|
283
|
+
gridStyle: C,
|
|
284
|
+
weekdayLabels: E,
|
|
285
|
+
monthLabels: A,
|
|
232
286
|
activeCell: d,
|
|
233
|
-
tooltipEnabled:
|
|
234
|
-
tooltipStyle:
|
|
235
|
-
cellColor:
|
|
236
|
-
cellLabel:
|
|
237
|
-
handleCellClick:
|
|
238
|
-
throttledMove:
|
|
239
|
-
clearActive:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
287
|
+
tooltipEnabled: p,
|
|
288
|
+
tooltipStyle: O,
|
|
289
|
+
cellColor: R,
|
|
290
|
+
cellLabel: i,
|
|
291
|
+
handleCellClick: P,
|
|
292
|
+
throttledMove: q,
|
|
293
|
+
clearActive: m,
|
|
294
|
+
handleKeydown: F,
|
|
295
|
+
handleGridFocus: V,
|
|
296
|
+
activeDescendant: _,
|
|
297
|
+
gridLabel: j,
|
|
298
|
+
cellIdPrefix: $,
|
|
299
|
+
liveText: v,
|
|
300
|
+
isInRange: L,
|
|
301
|
+
colorPalette: b,
|
|
302
|
+
slots: s,
|
|
303
|
+
refs: w,
|
|
304
|
+
setTooltipElement: M,
|
|
305
|
+
t: k
|
|
244
306
|
} = this;
|
|
245
|
-
if (!
|
|
246
|
-
const
|
|
307
|
+
if (!z) return null;
|
|
308
|
+
const G = ue(this.loading) ? this.loading : {
|
|
247
309
|
loading: this.loading,
|
|
248
310
|
dot: "color"
|
|
249
|
-
},
|
|
250
|
-
class:
|
|
311
|
+
}, B = p && d !== null, H = () => n("div", {
|
|
312
|
+
class: t.element("grid"),
|
|
251
313
|
style: {
|
|
252
|
-
...
|
|
314
|
+
...C,
|
|
253
315
|
"--x-heatmap-cell-gap": "var(--x-spacing-1)"
|
|
254
316
|
},
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
317
|
+
role: p ? "grid" : void 0,
|
|
318
|
+
tabindex: p ? 0 : void 0,
|
|
319
|
+
"aria-activedescendant": _,
|
|
320
|
+
"aria-label": p ? j : void 0,
|
|
321
|
+
onMousemove: q,
|
|
322
|
+
onMouseleave: m,
|
|
323
|
+
onFocus: V,
|
|
324
|
+
onBlur: m,
|
|
325
|
+
onKeydown: F
|
|
326
|
+
}, [g.map((r, y) => r.map((u) => n("div", {
|
|
327
|
+
key: u.timestamp,
|
|
328
|
+
id: `${$}-${S.indexOf(u)}`,
|
|
329
|
+
class: [t.element("cell"), t.modifier(`level-${u.level}`), {
|
|
330
|
+
[t.is("out-of-range")]: !L(u)
|
|
261
331
|
}],
|
|
262
332
|
style: {
|
|
263
|
-
backgroundColor:
|
|
333
|
+
backgroundColor: R(u)
|
|
264
334
|
},
|
|
265
|
-
"data-index":
|
|
266
|
-
title:
|
|
267
|
-
onClick: (
|
|
335
|
+
"data-index": S.indexOf(u),
|
|
336
|
+
title: B ? void 0 : i(u),
|
|
337
|
+
onClick: (I) => P(u, I),
|
|
268
338
|
role: "gridcell",
|
|
269
|
-
"aria-label":
|
|
270
|
-
}, [])))]),
|
|
271
|
-
if (!
|
|
272
|
-
const
|
|
339
|
+
"aria-label": i(u)
|
|
340
|
+
}, []))), N()]), N = () => {
|
|
341
|
+
if (!B || !d) return null;
|
|
342
|
+
const r = {
|
|
273
343
|
...d,
|
|
274
|
-
label:
|
|
344
|
+
label: i(d)
|
|
275
345
|
};
|
|
276
|
-
return
|
|
277
|
-
|
|
278
|
-
|
|
346
|
+
return n("div", {
|
|
347
|
+
ref: M,
|
|
348
|
+
class: [t.element("tooltip"), t.is("visible")],
|
|
349
|
+
style: O,
|
|
279
350
|
role: "tooltip"
|
|
280
|
-
}, [
|
|
281
|
-
},
|
|
282
|
-
var
|
|
283
|
-
return this.showColorIndicator ?
|
|
284
|
-
class:
|
|
285
|
-
}, [
|
|
286
|
-
colors:
|
|
287
|
-
}) :
|
|
288
|
-
class:
|
|
289
|
-
}, [((
|
|
290
|
-
key:
|
|
291
|
-
class:
|
|
351
|
+
}, [s.tooltip ? s.tooltip(r) : r.label]);
|
|
352
|
+
}, x = () => {
|
|
353
|
+
var r, y;
|
|
354
|
+
return this.showColorIndicator ? n("div", {
|
|
355
|
+
class: t.element("indicator")
|
|
356
|
+
}, [s.indicator ? s.indicator({
|
|
357
|
+
colors: b
|
|
358
|
+
}) : n(oe, null, [n("span", {
|
|
359
|
+
class: t.element("indicator-leading")
|
|
360
|
+
}, [((r = s["indicator-leading-text"]) == null ? void 0 : r.call(s)) ?? k("heatmap.less")]), b.map((u, I) => n("span", {
|
|
361
|
+
key: I,
|
|
362
|
+
class: t.element("indicator-swatch"),
|
|
292
363
|
style: {
|
|
293
|
-
backgroundColor:
|
|
364
|
+
backgroundColor: u
|
|
294
365
|
}
|
|
295
|
-
}, null)),
|
|
296
|
-
class:
|
|
297
|
-
}, [((
|
|
298
|
-
},
|
|
299
|
-
class:
|
|
300
|
-
}, [this.showWeekLabels &&
|
|
301
|
-
class:
|
|
302
|
-
style:
|
|
303
|
-
}, [
|
|
304
|
-
key:
|
|
305
|
-
class:
|
|
366
|
+
}, null)), n("span", {
|
|
367
|
+
class: t.element("indicator-trailing")
|
|
368
|
+
}, [((y = s["indicator-trailing-text"]) == null ? void 0 : y.call(s)) ?? k("heatmap.more")])])]) : null;
|
|
369
|
+
}, T = () => n("div", {
|
|
370
|
+
class: t.element("body")
|
|
371
|
+
}, [this.showWeekLabels && n("div", {
|
|
372
|
+
class: t.element("week-labels"),
|
|
373
|
+
style: C
|
|
374
|
+
}, [E.map((r, y) => n("span", {
|
|
375
|
+
key: y,
|
|
376
|
+
class: t.element("week-label"),
|
|
306
377
|
style: {
|
|
307
|
-
visibility:
|
|
378
|
+
visibility: y % 2 === 1 ? "visible" : "hidden"
|
|
308
379
|
}
|
|
309
|
-
}, [
|
|
310
|
-
class:
|
|
311
|
-
}, [this.showMonthLabels &&
|
|
312
|
-
class:
|
|
313
|
-
style:
|
|
314
|
-
}, [
|
|
315
|
-
key:
|
|
316
|
-
class:
|
|
380
|
+
}, [r]))]), n("div", {
|
|
381
|
+
class: t.element("grid-wrapper")
|
|
382
|
+
}, [this.showMonthLabels && n("div", {
|
|
383
|
+
class: t.element("month-labels"),
|
|
384
|
+
style: C
|
|
385
|
+
}, [A.map((r) => n("span", {
|
|
386
|
+
key: r.text,
|
|
387
|
+
class: t.element("month-label"),
|
|
317
388
|
style: {
|
|
318
|
-
gridColumn:
|
|
389
|
+
gridColumn: r.colIndex + 1
|
|
319
390
|
}
|
|
320
|
-
}, [
|
|
321
|
-
return
|
|
322
|
-
class: [
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
391
|
+
}, [r.text]))]), H()])]), W = p;
|
|
392
|
+
return n("div", {
|
|
393
|
+
class: [t.block, t.modifier(`size-${D}`)]
|
|
394
|
+
}, [n("div", {
|
|
395
|
+
role: !W && this.ariaLabel ? "img" : void 0,
|
|
396
|
+
"aria-label": W ? void 0 : this.ariaLabel
|
|
397
|
+
}, [n(de, G, {
|
|
398
|
+
default: () => [T(), x(), s.footer && n("div", {
|
|
399
|
+
class: t.element("footer")
|
|
400
|
+
}, [s.footer()])]
|
|
401
|
+
})]), n("span", {
|
|
402
|
+
class: t.element("live"),
|
|
403
|
+
"aria-live": "polite"
|
|
404
|
+
}, [v])]);
|
|
330
405
|
}
|
|
331
406
|
});
|
|
332
407
|
export {
|
|
333
|
-
|
|
408
|
+
Ae as default
|
|
334
409
|
};
|