x-next 1.7.0 → 1.8.1
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 +47 -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 -1
- package/dist/components/heatmap/index.d.ts +30 -3
- 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 +249 -172
- 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 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
|
/**
|
|
@@ -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,280 @@ 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: 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
|
-
}),
|
|
150
|
-
var
|
|
151
|
-
return (
|
|
152
|
-
}),
|
|
153
|
-
year:
|
|
154
|
-
startDate:
|
|
155
|
-
endDate:
|
|
156
|
-
data:
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
t[a.rowIndex].push(a);
|
|
163
|
-
}), t;
|
|
164
|
-
}), N = n(() => G(e.firstDayOfWeek, O.value.datePicker)), L = n(() => {
|
|
165
|
-
if (!i.value) return [];
|
|
166
|
-
const t = i.value.requestedStart.year() !== i.value.requestedEnd.year();
|
|
167
|
-
return X(i.value, p.value, (a) => t ? a.format("YYYY-MM") : v("heatmap.month", {
|
|
168
|
-
month: a.month() + 1
|
|
149
|
+
}), s = o(() => K[y.value] ?? K.medium), E = o(() => {
|
|
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
|
+
}), R = o(() => t.minimumColor ?? "var(--x-heatmap-color-empty)"), b = o(() => [R.value, ...E.value]), c = o(() => me({
|
|
153
|
+
year: t.year,
|
|
154
|
+
startDate: t.startDate,
|
|
155
|
+
endDate: t.endDate,
|
|
156
|
+
data: t.data
|
|
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", {
|
|
161
|
+
month: l.month() + 1
|
|
169
162
|
}));
|
|
170
|
-
}),
|
|
171
|
-
const
|
|
172
|
-
return
|
|
173
|
-
date:
|
|
174
|
-
}) :
|
|
175
|
-
date:
|
|
176
|
-
value:
|
|
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", {
|
|
166
|
+
date: l
|
|
167
|
+
}) : p("heatmap.value", {
|
|
168
|
+
date: l,
|
|
169
|
+
value: r
|
|
177
170
|
});
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
|
|
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(() => {
|
|
177
|
+
const e = M.value;
|
|
178
|
+
if (!e) return {};
|
|
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`
|
|
185
184
|
};
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
|
|
185
|
+
});
|
|
186
|
+
le(d, (e) => {
|
|
187
|
+
if (e === null) {
|
|
188
|
+
k.value = 0;
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
ae(() => {
|
|
192
|
+
var r;
|
|
193
|
+
const l = ((r = x.value) == null ? void 0 : r.offsetWidth) ?? 0;
|
|
194
|
+
l !== k.value && (k.value = l);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
const j = (e) => {
|
|
198
|
+
var u;
|
|
199
|
+
if (!L.value) return;
|
|
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);
|
|
191
202
|
}, B = () => {
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
|
|
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) => {
|
|
207
|
+
if (!L.value || m.value.length === 0) return;
|
|
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);
|
|
214
|
+
else if (e.key === "Home") {
|
|
215
|
+
const h = r ?? 0, f = m.value[h];
|
|
216
|
+
u = f ? Math.max(0, h - f.rowIndex) : 0;
|
|
217
|
+
} else if (e.key === "End") {
|
|
218
|
+
const h = r ?? l, f = m.value[h];
|
|
219
|
+
u = f ? Math.min(l, h + (6 - f.rowIndex)) : l;
|
|
220
|
+
} else if (e.key === "Escape") {
|
|
221
|
+
B();
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
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(() => {
|
|
228
|
+
const e = M.value;
|
|
229
|
+
return !g.value || !e ? "" : $(e);
|
|
230
|
+
}), Z = (e, l) => {
|
|
231
|
+
D("cellClick", e, l);
|
|
232
|
+
}, J = ue(j), Q = o(() => ({
|
|
233
|
+
"--x-heatmap-cell-size": `${s.value}px`,
|
|
234
|
+
gridTemplateRows: `repeat(7, ${s.value}px)`
|
|
198
235
|
}));
|
|
199
236
|
return {
|
|
200
|
-
t:
|
|
201
|
-
className:
|
|
202
|
-
mergedSize:
|
|
203
|
-
cells:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
throttledMove: u,
|
|
237
|
+
t: p,
|
|
238
|
+
className: z,
|
|
239
|
+
mergedSize: y,
|
|
240
|
+
cells: m,
|
|
241
|
+
range: c,
|
|
242
|
+
gridStyle: Q,
|
|
243
|
+
weekdayLabels: q,
|
|
244
|
+
monthLabels: F,
|
|
245
|
+
activeCell: M,
|
|
246
|
+
tooltipEnabled: L,
|
|
247
|
+
tooltipStyle: O,
|
|
248
|
+
cellColor: V,
|
|
249
|
+
cellLabel: $,
|
|
250
|
+
handleCellClick: Z,
|
|
251
|
+
throttledMove: J,
|
|
216
252
|
clearActive: B,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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,
|
|
263
|
+
setTooltipElement: (e) => {
|
|
264
|
+
x.value = e;
|
|
265
|
+
}
|
|
220
266
|
};
|
|
221
267
|
},
|
|
222
268
|
render() {
|
|
223
269
|
const {
|
|
224
|
-
className:
|
|
225
|
-
mergedSize:
|
|
226
|
-
cells:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
270
|
+
className: t,
|
|
271
|
+
mergedSize: D,
|
|
272
|
+
cells: Y,
|
|
273
|
+
range: p,
|
|
274
|
+
gridStyle: C,
|
|
275
|
+
weekdayLabels: z,
|
|
276
|
+
monthLabels: S,
|
|
277
|
+
activeCell: y,
|
|
278
|
+
tooltipEnabled: s,
|
|
279
|
+
tooltipStyle: E,
|
|
280
|
+
cellColor: R,
|
|
281
|
+
cellLabel: b,
|
|
282
|
+
handleCellClick: c,
|
|
283
|
+
throttledMove: P,
|
|
284
|
+
clearActive: A,
|
|
285
|
+
handleKeydown: m,
|
|
286
|
+
handleGridFocus: q,
|
|
287
|
+
activeDescendant: F,
|
|
288
|
+
gridLabel: V,
|
|
289
|
+
cellIdPrefix: $,
|
|
290
|
+
liveText: d,
|
|
291
|
+
isInRange: L,
|
|
292
|
+
colorPalette: x,
|
|
293
|
+
slots: i,
|
|
294
|
+
refs: k,
|
|
295
|
+
setTooltipElement: M,
|
|
243
296
|
t: w
|
|
244
297
|
} = this;
|
|
245
|
-
if (!
|
|
246
|
-
const
|
|
298
|
+
if (!p) return null;
|
|
299
|
+
const _ = se(this.loading) ? this.loading : {
|
|
247
300
|
loading: this.loading,
|
|
248
301
|
dot: "color"
|
|
249
|
-
},
|
|
250
|
-
class:
|
|
302
|
+
}, O = s && y !== null, j = () => n("div", {
|
|
303
|
+
class: t.element("grid"),
|
|
251
304
|
style: {
|
|
252
|
-
...
|
|
305
|
+
...C,
|
|
253
306
|
"--x-heatmap-cell-gap": "var(--x-spacing-1)"
|
|
254
307
|
},
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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)
|
|
261
322
|
}],
|
|
262
323
|
style: {
|
|
263
|
-
backgroundColor:
|
|
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
|
|
264
336
|
},
|
|
265
|
-
"data-index":
|
|
266
|
-
title:
|
|
267
|
-
onClick: (
|
|
337
|
+
"data-index": v,
|
|
338
|
+
title: O ? void 0 : b(a),
|
|
339
|
+
onClick: (I) => c(a, I),
|
|
268
340
|
role: "gridcell",
|
|
269
|
-
"aria-label":
|
|
270
|
-
}, [])))]),
|
|
271
|
-
if (!
|
|
272
|
-
const
|
|
273
|
-
...
|
|
274
|
-
label: y
|
|
341
|
+
"aria-label": b(a)
|
|
342
|
+
}, [])), B()]), B = () => {
|
|
343
|
+
if (!O || !y) return null;
|
|
344
|
+
const a = {
|
|
345
|
+
...y,
|
|
346
|
+
label: b(y)
|
|
275
347
|
};
|
|
276
|
-
return
|
|
277
|
-
|
|
278
|
-
|
|
348
|
+
return n("div", {
|
|
349
|
+
ref: M,
|
|
350
|
+
class: [t.element("tooltip"), t.is("visible")],
|
|
351
|
+
style: E,
|
|
279
352
|
role: "tooltip"
|
|
280
|
-
}, [
|
|
281
|
-
},
|
|
282
|
-
var
|
|
283
|
-
return this.showColorIndicator ?
|
|
284
|
-
class:
|
|
285
|
-
}, [
|
|
286
|
-
colors:
|
|
287
|
-
}) :
|
|
288
|
-
class:
|
|
289
|
-
}, [((
|
|
290
|
-
key:
|
|
291
|
-
class:
|
|
353
|
+
}, [i.tooltip ? i.tooltip(a) : a.label]);
|
|
354
|
+
}, g = () => {
|
|
355
|
+
var a, v;
|
|
356
|
+
return this.showColorIndicator ? n("div", {
|
|
357
|
+
class: t.element("indicator")
|
|
358
|
+
}, [i.indicator ? i.indicator({
|
|
359
|
+
colors: x
|
|
360
|
+
}) : n(ne, null, [n("span", {
|
|
361
|
+
class: t.element("indicator-leading")
|
|
362
|
+
}, [((a = i["indicator-leading-text"]) == null ? void 0 : a.call(i)) ?? w("heatmap.less")]), x.map((I, G) => n("span", {
|
|
363
|
+
key: G,
|
|
364
|
+
class: t.element("indicator-swatch"),
|
|
292
365
|
style: {
|
|
293
|
-
backgroundColor:
|
|
366
|
+
backgroundColor: I
|
|
294
367
|
}
|
|
295
|
-
}, null)),
|
|
296
|
-
class:
|
|
297
|
-
}, [((
|
|
298
|
-
},
|
|
299
|
-
class:
|
|
300
|
-
}, [this.showWeekLabels &&
|
|
301
|
-
class:
|
|
302
|
-
style:
|
|
303
|
-
}, [
|
|
304
|
-
key:
|
|
305
|
-
class:
|
|
368
|
+
}, null)), n("span", {
|
|
369
|
+
class: t.element("indicator-trailing")
|
|
370
|
+
}, [((v = i["indicator-trailing-text"]) == null ? void 0 : v.call(i)) ?? w("heatmap.more")])])]) : null;
|
|
371
|
+
}, N = () => n("div", {
|
|
372
|
+
class: t.element("body")
|
|
373
|
+
}, [this.showWeekLabels && n("div", {
|
|
374
|
+
class: t.element("week-labels"),
|
|
375
|
+
style: C
|
|
376
|
+
}, [z.map((a, v) => n("span", {
|
|
377
|
+
key: v,
|
|
378
|
+
class: t.element("week-label"),
|
|
306
379
|
style: {
|
|
307
|
-
visibility:
|
|
380
|
+
visibility: v % 2 === 1 ? "visible" : "hidden"
|
|
308
381
|
}
|
|
309
|
-
}, [
|
|
310
|
-
class:
|
|
311
|
-
}, [this.showMonthLabels &&
|
|
312
|
-
class:
|
|
313
|
-
style:
|
|
314
|
-
}, [
|
|
315
|
-
key:
|
|
316
|
-
class:
|
|
382
|
+
}, [a]))]), n("div", {
|
|
383
|
+
class: t.element("grid-wrapper")
|
|
384
|
+
}, [this.showMonthLabels && n("div", {
|
|
385
|
+
class: t.element("month-labels"),
|
|
386
|
+
style: C
|
|
387
|
+
}, [S.map((a) => n("span", {
|
|
388
|
+
key: a.text,
|
|
389
|
+
class: t.element("month-label"),
|
|
317
390
|
style: {
|
|
318
|
-
gridColumn:
|
|
391
|
+
gridColumn: a.colIndex + 1
|
|
319
392
|
}
|
|
320
|
-
}, [
|
|
321
|
-
return
|
|
322
|
-
class: [
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
393
|
+
}, [a.text]))]), j()])]), T = s;
|
|
394
|
+
return n("div", {
|
|
395
|
+
class: [t.block, t.modifier(`size-${D}`)]
|
|
396
|
+
}, [n("div", {
|
|
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", {
|
|
401
|
+
class: t.element("footer")
|
|
402
|
+
}, [i.footer()])]
|
|
403
|
+
})]), n("span", {
|
|
404
|
+
class: t.element("live"),
|
|
405
|
+
"aria-live": "polite"
|
|
406
|
+
}, [d])]);
|
|
330
407
|
}
|
|
331
408
|
});
|
|
332
409
|
export {
|
|
333
|
-
|
|
410
|
+
Ee as default
|
|
334
411
|
};
|