@seed-ship/mcp-ui-solid 6.23.0 → 6.24.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/CHANGELOG.md +125 -0
- package/README.md +107 -2
- package/dist/components/ChartJSRenderer.cjs +192 -66
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +192 -66
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/DegradedFallback.cjs +34 -2
- package/dist/components/DegradedFallback.cjs.map +1 -1
- package/dist/components/DegradedFallback.d.ts +7 -0
- package/dist/components/DegradedFallback.d.ts.map +1 -1
- package/dist/components/DegradedFallback.js +34 -2
- package/dist/components/DegradedFallback.js.map +1 -1
- package/dist/components/MissingValue.cjs +43 -0
- package/dist/components/MissingValue.cjs.map +1 -0
- package/dist/components/MissingValue.d.ts +27 -0
- package/dist/components/MissingValue.d.ts.map +1 -0
- package/dist/components/MissingValue.js +43 -0
- package/dist/components/MissingValue.js.map +1 -0
- package/dist/components/UIResourceRenderer.cjs +237 -199
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +237 -199
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/components/chart-data-table.cjs +30 -5
- package/dist/components/chart-data-table.cjs.map +1 -1
- package/dist/components/chart-data-table.d.ts +18 -1
- package/dist/components/chart-data-table.d.ts.map +1 -1
- package/dist/components/chart-data-table.js +30 -5
- package/dist/components/chart-data-table.js.map +1 -1
- package/dist/components/chart-missing-plugin.cjs +194 -0
- package/dist/components/chart-missing-plugin.cjs.map +1 -0
- package/dist/components/chart-missing-plugin.d.ts +127 -0
- package/dist/components/chart-missing-plugin.d.ts.map +1 -0
- package/dist/components/chart-missing-plugin.js +194 -0
- package/dist/components/chart-missing-plugin.js.map +1 -0
- package/dist/context/MCPUIStringsContext.cjs +12 -1
- package/dist/context/MCPUIStringsContext.cjs.map +1 -1
- package/dist/context/MCPUIStringsContext.d.ts +62 -0
- package/dist/context/MCPUIStringsContext.d.ts.map +1 -1
- package/dist/context/MCPUIStringsContext.js +12 -1
- package/dist/context/MCPUIStringsContext.js.map +1 -1
- package/dist/services/component-registry.cjs +9 -2
- package/dist/services/component-registry.cjs.map +1 -1
- package/dist/services/component-registry.d.ts.map +1 -1
- package/dist/services/component-registry.js +9 -2
- package/dist/services/component-registry.js.map +1 -1
- package/dist/services/validation.cjs +31 -8
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.ts.map +1 -1
- package/dist/services/validation.js +31 -8
- package/dist/services/validation.js.map +1 -1
- package/dist/types/index.d.ts +14 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/degraded-projections.cjs +19 -3
- package/dist/utils/degraded-projections.cjs.map +1 -1
- package/dist/utils/degraded-projections.d.ts +22 -2
- package/dist/utils/degraded-projections.d.ts.map +1 -1
- package/dist/utils/degraded-projections.js +19 -3
- package/dist/utils/degraded-projections.js.map +1 -1
- package/dist/utils/missing-value.cjs +60 -0
- package/dist/utils/missing-value.cjs.map +1 -0
- package/dist/utils/missing-value.d.ts +79 -0
- package/dist/utils/missing-value.d.ts.map +1 -0
- package/dist/utils/missing-value.js +60 -0
- package/dist/utils/missing-value.js.map +1 -0
- package/package.json +3 -3
- package/src/components/ChartJSRenderer.tsx +159 -6
- package/src/components/DegradedFallback.tsx +24 -2
- package/src/components/MissingValue.tsx +61 -0
- package/src/components/UIResourceRenderer.tsx +42 -9
- package/src/components/chart-data-table.ts +50 -6
- package/src/components/chart-missing-plugin.ts +334 -0
- package/src/context/MCPUIStringsContext.tsx +76 -0
- package/src/services/component-registry.ts +10 -2
- package/src/services/validation.ts +44 -9
- package/src/types/index.ts +13 -1
- package/src/utils/degraded-projections.ts +44 -4
- package/src/utils/missing-value.ts +127 -0
|
@@ -26,12 +26,15 @@ const web = require("solid-js/web");
|
|
|
26
26
|
const solidJs = require("solid-js");
|
|
27
27
|
const ExpandableWrapper = require("./ExpandableWrapper.cjs");
|
|
28
28
|
const DegradedFallback = require("./DegradedFallback.cjs");
|
|
29
|
+
const MissingValue = require("./MissingValue.cjs");
|
|
29
30
|
const chartDataTable = require("./chart-data-table.cjs");
|
|
31
|
+
const chartMissingPlugin = require("./chart-missing-plugin.cjs");
|
|
32
|
+
const missingValue = require("../utils/missing-value.cjs");
|
|
30
33
|
const MCPUITelemetryContext = require("../context/MCPUITelemetryContext.cjs");
|
|
31
34
|
const MCPUIConfigContext = require("../context/MCPUIConfigContext.cjs");
|
|
32
35
|
const MCPUIStringsContext = require("../context/MCPUIStringsContext.cjs");
|
|
33
36
|
const formatString = require("../utils/format-string.cjs");
|
|
34
|
-
var _tmpl$ = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button type=button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15">`), _tmpl$3 = /* @__PURE__ */ web.template(`<div class="inline-flex items-center gap-1"><button type=button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607zM13.5 10.5h-6"></path></svg></button><button type=button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607zM10.5 7.5v6m3-3h-6"></path></svg></button><!$><!/>`), _tmpl$4 = /* @__PURE__ */ web.template(`<button type=button class="opacity-0 group-hover:opacity-60 hover:!opacity-100 disabled:!opacity-30 disabled:cursor-not-allowed px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z">`), _tmpl$5 = /* @__PURE__ */ web.template(`<tr><td class="px-3 py-6 text-center text-gray-500 dark:text-gray-400">`), _tmpl$6 = /* @__PURE__ */ web.template(`<div><table class="w-full border-collapse text-left text-sm"><caption class=sr-only><!$><!/> — <!$><!/></caption><thead class="bg-gray-50 dark:bg-gray-900/40"><tr></tr></thead><tbody><!$><!/><!$><!/>`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center bg-white/80 dark:bg-gray-800/80"><div class="flex flex-col items-center gap-2"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"></div><span class="text-sm text-gray-500 dark:text-gray-400">`), _tmpl$8 = /* @__PURE__ */ web.template(`<div><div class="flex items-center justify-between gap-3 mb-3 flex-shrink-0"><div class=min-w-0></div><div class="flex items-center gap-2"><div class="inline-flex rounded-md border border-gray-200 p-0.5 dark:border-gray-600"role=group><button type=button></button><button type=button></button></div><!$><!/><!$><!/></div></div><p class=sr-only><!$><!/>. <!$><!/></p><!$><!/><!$><!/><div><canvas role=img></canvas><!$><!/>`), _tmpl$
|
|
37
|
+
var _tmpl$ = /* @__PURE__ */ web.template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$2 = /* @__PURE__ */ web.template(`<button type=button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15">`), _tmpl$3 = /* @__PURE__ */ web.template(`<div class="inline-flex items-center gap-1"><button type=button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607zM13.5 10.5h-6"></path></svg></button><button type=button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607zM10.5 7.5v6m3-3h-6"></path></svg></button><!$><!/>`), _tmpl$4 = /* @__PURE__ */ web.template(`<button type=button class="opacity-0 group-hover:opacity-60 hover:!opacity-100 disabled:!opacity-30 disabled:cursor-not-allowed px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z">`), _tmpl$5 = /* @__PURE__ */ web.template(`<tr><td class="px-3 py-6 text-center text-gray-500 dark:text-gray-400">`), _tmpl$6 = /* @__PURE__ */ web.template(`<div><table class="w-full border-collapse text-left text-sm"><caption class=sr-only><!$><!/> — <!$><!/></caption><thead class="bg-gray-50 dark:bg-gray-900/40"><tr></tr></thead><tbody><!$><!/><!$><!/>`), _tmpl$7 = /* @__PURE__ */ web.template(`<div class="absolute inset-0 flex items-center justify-center bg-white/80 dark:bg-gray-800/80"><div class="flex flex-col items-center gap-2"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"></div><span class="text-sm text-gray-500 dark:text-gray-400">`), _tmpl$8 = /* @__PURE__ */ web.template(`<p>`), _tmpl$9 = /* @__PURE__ */ web.template(`<p data-mcp-chart-note=no-data>`), _tmpl$0 = /* @__PURE__ */ web.template(`<div data-mcp-chart-notes class="mt-2 space-y-0.5 text-xs text-gray-600 dark:text-gray-400"><!$><!/><!$><!/>`), _tmpl$1 = /* @__PURE__ */ web.template(`<div><div class="flex items-center justify-between gap-3 mb-3 flex-shrink-0"><div class=min-w-0></div><div class="flex items-center gap-2"><div class="inline-flex rounded-md border border-gray-200 p-0.5 dark:border-gray-600"role=group><button type=button></button><button type=button></button></div><!$><!/><!$><!/></div></div><p class=sr-only><!$><!/>. <!$><!/></p><!$><!/><!$><!/><div><canvas role=img></canvas><!$><!/></div><!$><!/>`), _tmpl$10 = /* @__PURE__ */ web.template(`<th scope=col class="px-3 py-2 font-medium text-gray-900 dark:text-gray-100">`), _tmpl$11 = /* @__PURE__ */ web.template(`<tr class="border-t border-gray-100 dark:border-gray-700">`), _tmpl$12 = /* @__PURE__ */ web.template(`<td class="px-3 py-2 text-gray-700 dark:text-gray-300">`);
|
|
35
38
|
let ChartJS = null;
|
|
36
39
|
let chartJSLoadPromise = null;
|
|
37
40
|
const loadChartJS = async () => {
|
|
@@ -132,9 +135,33 @@ const ChartJSRenderer = (props) => {
|
|
|
132
135
|
series: strings.chartTableSeries,
|
|
133
136
|
point: strings.chartTablePoint,
|
|
134
137
|
label: strings.degradedColLabel,
|
|
135
|
-
seriesName: strings.degradedSeries
|
|
138
|
+
seriesName: strings.degradedSeries,
|
|
139
|
+
withUnit: strings.chartLabelWithUnit
|
|
136
140
|
}));
|
|
141
|
+
const missingSummary = solidJs.createMemo(() => missingValue.summarizeChartMissing(params()));
|
|
142
|
+
const unit = () => {
|
|
143
|
+
const value = params().unit;
|
|
144
|
+
return typeof value === "string" && value !== "" ? value : void 0;
|
|
145
|
+
};
|
|
146
|
+
const anyMissingCell = () => tableData().missing.some((row) => row.some(Boolean));
|
|
147
|
+
const notesShown = () => missingSummary().hasMissing && !missingValue.PART_TO_WHOLE_CHART_TYPES.has(params().type) && activeView() === "chart" && !error();
|
|
148
|
+
const noteKind = () => chartMissingPlugin.missingNoteKind(params().type, params().options);
|
|
149
|
+
const conventionNoteShown = () => noteKind() === "bars" ? missingSummary().hasMissing : missingSummary().partiallyMissing.some(Boolean);
|
|
150
|
+
const noDataSeries = () => {
|
|
151
|
+
var _a;
|
|
152
|
+
const names = (((_a = params().data) == null ? void 0 : _a.datasets) ?? []).map((dataset, index) => missingSummary().fullyMissing[index] ? (dataset == null ? void 0 : dataset.label) || formatString.formatMCPUIString(strings.degradedSeries, {
|
|
153
|
+
n: index + 1
|
|
154
|
+
}) : null).filter((name) => name !== null);
|
|
155
|
+
try {
|
|
156
|
+
return new Intl.ListFormat(strings.locale, {
|
|
157
|
+
type: "conjunction"
|
|
158
|
+
}).format(names);
|
|
159
|
+
} catch {
|
|
160
|
+
return names.join(", ");
|
|
161
|
+
}
|
|
162
|
+
};
|
|
137
163
|
const descriptionId = solidJs.createUniqueId();
|
|
164
|
+
const notesId = solidJs.createUniqueId();
|
|
138
165
|
const title = () => params().title || strings.chartView;
|
|
139
166
|
const exportEnabled = () => params().exportable !== false;
|
|
140
167
|
const copyDataJSON = () => JSON.stringify({
|
|
@@ -204,9 +231,11 @@ const ChartJSRenderer = (props) => {
|
|
|
204
231
|
a.click();
|
|
205
232
|
};
|
|
206
233
|
solidJs.createEffect(async () => {
|
|
207
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
234
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
208
235
|
if (!canvasRef) return;
|
|
209
236
|
const chartParams = params();
|
|
237
|
+
const chartMissing = missingSummary();
|
|
238
|
+
const chartUnit = unit();
|
|
210
239
|
const zoom = zoomOptions();
|
|
211
240
|
const version = ++renderVersion;
|
|
212
241
|
setIsLoading(true);
|
|
@@ -218,6 +247,9 @@ const ChartJSRenderer = (props) => {
|
|
|
218
247
|
chartInstance.destroy();
|
|
219
248
|
chartInstance = null;
|
|
220
249
|
}
|
|
250
|
+
if (chartMissing.hasMissing && missingValue.PART_TO_WHOLE_CHART_TYPES.has(chartParams.type)) {
|
|
251
|
+
throw new Error(strings.chartMissingUnsupported);
|
|
252
|
+
}
|
|
221
253
|
const hostZoomOptions = (_b = (_a = chartParams.options) == null ? void 0 : _a.plugins) == null ? void 0 : _b.zoom;
|
|
222
254
|
const baseOptions = {
|
|
223
255
|
responsive: true,
|
|
@@ -263,11 +295,46 @@ const ChartJSRenderer = (props) => {
|
|
|
263
295
|
}
|
|
264
296
|
};
|
|
265
297
|
}
|
|
266
|
-
|
|
298
|
+
chartMissingPlugin.applyUnitAxisTitle(baseOptions, chartParams.type, chartUnit);
|
|
299
|
+
const chartConfig = {
|
|
267
300
|
type: chartParams.type,
|
|
268
301
|
data: chartParams.data,
|
|
269
302
|
options: baseOptions
|
|
270
|
-
}
|
|
303
|
+
};
|
|
304
|
+
if (chartUnit !== void 0 || chartMissing.hasMissing) {
|
|
305
|
+
const tooltip = baseOptions.plugins.tooltip;
|
|
306
|
+
if (tooltip !== false && tooltip !== null && !((_g = tooltip == null ? void 0 : tooltip.callbacks) == null ? void 0 : _g.label)) {
|
|
307
|
+
baseOptions.plugins.tooltip = {
|
|
308
|
+
...tooltip,
|
|
309
|
+
callbacks: {
|
|
310
|
+
...tooltip == null ? void 0 : tooltip.callbacks,
|
|
311
|
+
label: chartMissingPlugin.createTooltipLabel(() => strings, chartUnit, chartParams.type)
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (chartMissing.hasMissing) {
|
|
317
|
+
chartConfig.data = chartMissingPlugin.withDatasetsNoGapSpan(chartParams.data);
|
|
318
|
+
const defaultGenerate = ((_i = (_h = baseOptions.plugins.legend) == null ? void 0 : _h.labels) == null ? void 0 : _i.generateLabels) ?? ((_m = (_l = (_k = (_j = Chart == null ? void 0 : Chart.defaults) == null ? void 0 : _j.plugins) == null ? void 0 : _k.legend) == null ? void 0 : _l.labels) == null ? void 0 : _m.generateLabels);
|
|
319
|
+
if (typeof defaultGenerate === "function") {
|
|
320
|
+
baseOptions.plugins.legend = {
|
|
321
|
+
...baseOptions.plugins.legend,
|
|
322
|
+
labels: {
|
|
323
|
+
...(_n = baseOptions.plugins.legend) == null ? void 0 : _n.labels,
|
|
324
|
+
generateLabels: chartMissingPlugin.createMissingLegendGenerator(defaultGenerate, chartMissing.fullyMissing, () => strings)
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
chartConfig.plugins = [chartMissingPlugin.createMissingValuesPlugin({
|
|
329
|
+
allMissing: chartMissing.allMissing,
|
|
330
|
+
getNoDataText: () => strings.chartNoData,
|
|
331
|
+
getFontFamily: () => {
|
|
332
|
+
var _a2, _b2;
|
|
333
|
+
return (_b2 = (_a2 = Chart == null ? void 0 : Chart.defaults) == null ? void 0 : _a2.font) == null ? void 0 : _b2.family;
|
|
334
|
+
}
|
|
335
|
+
})];
|
|
336
|
+
}
|
|
337
|
+
chartInstance = new Chart(canvasRef, chartConfig);
|
|
271
338
|
setIsZoomed(false);
|
|
272
339
|
setIsLoading(false);
|
|
273
340
|
} catch (err) {
|
|
@@ -278,11 +345,11 @@ const ChartJSRenderer = (props) => {
|
|
|
278
345
|
telemetry == null ? void 0 : telemetry.dispatch({
|
|
279
346
|
type: "render:error",
|
|
280
347
|
errorMessage: error2.message,
|
|
281
|
-
id: ((
|
|
348
|
+
id: ((_o = props.component) == null ? void 0 : _o.id) ?? "",
|
|
282
349
|
componentType: "chart",
|
|
283
350
|
ts: Date.now()
|
|
284
351
|
});
|
|
285
|
-
(
|
|
352
|
+
(_p = props.onError) == null ? void 0 : _p.call(props, error2);
|
|
286
353
|
}
|
|
287
354
|
});
|
|
288
355
|
solidJs.createEffect(() => {
|
|
@@ -316,7 +383,7 @@ const ChartJSRenderer = (props) => {
|
|
|
316
383
|
get children() {
|
|
317
384
|
return web.createComponent(ContextAwareChartLayout, {
|
|
318
385
|
render: (isExpanded2) => (() => {
|
|
319
|
-
var _el$ = web.getNextElement(_tmpl$
|
|
386
|
+
var _el$ = web.getNextElement(_tmpl$1), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$14 = _el$6.nextSibling, [_el$15, _co$2] = web.getNextMarker(_el$14.nextSibling), _el$16 = _el$15.nextSibling, [_el$17, _co$3] = web.getNextMarker(_el$16.nextSibling), _el$18 = _el$2.nextSibling, _el$20 = _el$18.firstChild, [_el$21, _co$4] = web.getNextMarker(_el$20.nextSibling), _el$19 = _el$21.nextSibling, _el$22 = _el$19.nextSibling, [_el$23, _co$5] = web.getNextMarker(_el$22.nextSibling), _el$56 = _el$18.nextSibling, [_el$57, _co$11] = web.getNextMarker(_el$56.nextSibling), _el$58 = _el$57.nextSibling, [_el$59, _co$12] = web.getNextMarker(_el$58.nextSibling), _el$41 = _el$59.nextSibling, _el$42 = _el$41.firstChild, _el$47 = _el$42.nextSibling, [_el$48, _co$0] = web.getNextMarker(_el$47.nextSibling), _el$60 = _el$41.nextSibling, [_el$61, _co$13] = web.getNextMarker(_el$60.nextSibling);
|
|
320
387
|
web.insert(_el$3, web.createComponent(solidJs.Show, {
|
|
321
388
|
get when() {
|
|
322
389
|
return params().title;
|
|
@@ -417,73 +484,94 @@ const ChartJSRenderer = (props) => {
|
|
|
417
484
|
}
|
|
418
485
|
}, tableData));
|
|
419
486
|
}
|
|
420
|
-
}), _el$
|
|
487
|
+
}), _el$57, _co$11);
|
|
421
488
|
web.insert(_el$, web.createComponent(solidJs.Show, {
|
|
422
489
|
get when() {
|
|
423
490
|
return activeView() === "data";
|
|
424
491
|
},
|
|
425
492
|
get children() {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
493
|
+
return [(() => {
|
|
494
|
+
var _el$24 = web.getNextElement(_tmpl$6), _el$25 = _el$24.firstChild, _el$26 = _el$25.firstChild, _el$28 = _el$26.firstChild, [_el$29, _co$6] = web.getNextMarker(_el$28.nextSibling), _el$27 = _el$29.nextSibling, _el$30 = _el$27.nextSibling, [_el$31, _co$7] = web.getNextMarker(_el$30.nextSibling), _el$32 = _el$26.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$32.nextSibling, _el$37 = _el$34.firstChild, [_el$38, _co$8] = web.getNextMarker(_el$37.nextSibling), _el$39 = _el$38.nextSibling, [_el$40, _co$9] = web.getNextMarker(_el$39.nextSibling);
|
|
495
|
+
web.insert(_el$26, title, _el$29, _co$6);
|
|
496
|
+
web.insert(_el$26, () => strings.chartDataTable, _el$31, _co$7);
|
|
497
|
+
web.insert(_el$33, web.createComponent(solidJs.For, {
|
|
498
|
+
get each() {
|
|
499
|
+
return tableData().columns;
|
|
500
|
+
},
|
|
501
|
+
children: (column) => (() => {
|
|
502
|
+
var _el$62 = web.getNextElement(_tmpl$10);
|
|
503
|
+
web.insert(_el$62, column);
|
|
504
|
+
return _el$62;
|
|
505
|
+
})()
|
|
506
|
+
}));
|
|
507
|
+
web.insert(_el$34, web.createComponent(solidJs.For, {
|
|
508
|
+
get each() {
|
|
509
|
+
return tableData().rows;
|
|
510
|
+
},
|
|
511
|
+
children: (row, rowIndex) => (() => {
|
|
512
|
+
var _el$63 = web.getNextElement(_tmpl$11);
|
|
513
|
+
web.insert(_el$63, web.createComponent(solidJs.For, {
|
|
514
|
+
get each() {
|
|
515
|
+
return tableData().columns;
|
|
516
|
+
},
|
|
517
|
+
children: (_column, index) => (() => {
|
|
518
|
+
var _el$64 = web.getNextElement(_tmpl$12);
|
|
519
|
+
web.insert(_el$64, web.createComponent(solidJs.Show, {
|
|
520
|
+
get when() {
|
|
521
|
+
var _a;
|
|
522
|
+
return (_a = tableData().missing[rowIndex()]) == null ? void 0 : _a[index()];
|
|
523
|
+
},
|
|
524
|
+
get fallback() {
|
|
525
|
+
return String(row[index()] ?? "");
|
|
526
|
+
},
|
|
527
|
+
get children() {
|
|
528
|
+
return web.createComponent(MissingValue.MissingValueMark, {});
|
|
529
|
+
}
|
|
530
|
+
}));
|
|
531
|
+
return _el$64;
|
|
532
|
+
})()
|
|
533
|
+
}));
|
|
534
|
+
return _el$63;
|
|
535
|
+
})()
|
|
536
|
+
}), _el$38, _co$8);
|
|
537
|
+
web.insert(_el$34, web.createComponent(solidJs.Show, {
|
|
538
|
+
get when() {
|
|
539
|
+
return tableData().rows.length === 0;
|
|
540
|
+
},
|
|
541
|
+
get children() {
|
|
542
|
+
var _el$35 = web.getNextElement(_tmpl$5), _el$36 = _el$35.firstChild;
|
|
543
|
+
web.insert(_el$36, () => strings.chartNoData);
|
|
544
|
+
web.effect(() => web.setAttribute(_el$36, "colspan", Math.max(1, tableData().columns.length)));
|
|
545
|
+
return _el$35;
|
|
546
|
+
}
|
|
547
|
+
}), _el$40, _co$9);
|
|
548
|
+
web.effect((_p$) => {
|
|
549
|
+
var _v$0 = `w-full overflow-auto rounded border border-gray-200 dark:border-gray-700 ${isExpanded2() ? "flex-1 min-h-0" : ""}`, _v$1 = isExpanded2() ? void 0 : {
|
|
550
|
+
height: params().height || "250px",
|
|
551
|
+
"max-height": "70vh"
|
|
552
|
+
};
|
|
553
|
+
_v$0 !== _p$.e && web.className(_el$24, _p$.e = _v$0);
|
|
554
|
+
_p$.t = web.style(_el$24, _v$1, _p$.t);
|
|
555
|
+
return _p$;
|
|
556
|
+
}, {
|
|
557
|
+
e: void 0,
|
|
558
|
+
t: void 0
|
|
559
|
+
});
|
|
560
|
+
return _el$24;
|
|
561
|
+
})(), web.createComponent(solidJs.Show, {
|
|
459
562
|
get when() {
|
|
460
|
-
return
|
|
563
|
+
return anyMissingCell();
|
|
461
564
|
},
|
|
462
565
|
get children() {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
return _el$35;
|
|
566
|
+
return web.createComponent(MissingValue.MissingValueLegend, {
|
|
567
|
+
"class": "mt-2"
|
|
568
|
+
});
|
|
467
569
|
}
|
|
468
|
-
})
|
|
469
|
-
web.effect((_p$) => {
|
|
470
|
-
var _v$0 = `w-full overflow-auto rounded border border-gray-200 dark:border-gray-700 ${isExpanded2() ? "flex-1 min-h-0" : ""}`, _v$1 = isExpanded2() ? void 0 : {
|
|
471
|
-
height: params().height || "250px",
|
|
472
|
-
"max-height": "70vh"
|
|
473
|
-
};
|
|
474
|
-
_v$0 !== _p$.e && web.className(_el$24, _p$.e = _v$0);
|
|
475
|
-
_p$.t = web.style(_el$24, _v$1, _p$.t);
|
|
476
|
-
return _p$;
|
|
477
|
-
}, {
|
|
478
|
-
e: void 0,
|
|
479
|
-
t: void 0
|
|
480
|
-
});
|
|
481
|
-
return _el$24;
|
|
570
|
+
})];
|
|
482
571
|
}
|
|
483
|
-
}), _el$
|
|
572
|
+
}), _el$59, _co$12);
|
|
484
573
|
var _ref$ = canvasRef;
|
|
485
574
|
typeof _ref$ === "function" ? web.use(_ref$, _el$42) : canvasRef = _el$42;
|
|
486
|
-
web.setAttribute(_el$42, "aria-describedby", descriptionId);
|
|
487
575
|
web.insert(_el$41, web.createComponent(solidJs.Show, {
|
|
488
576
|
get when() {
|
|
489
577
|
return web.memo(() => !!isLoading())() && activeView() === "chart";
|
|
@@ -494,6 +582,42 @@ const ChartJSRenderer = (props) => {
|
|
|
494
582
|
return _el$43;
|
|
495
583
|
}
|
|
496
584
|
}), _el$48, _co$0);
|
|
585
|
+
web.insert(_el$, web.createComponent(solidJs.Show, {
|
|
586
|
+
get when() {
|
|
587
|
+
return notesShown();
|
|
588
|
+
},
|
|
589
|
+
get children() {
|
|
590
|
+
var _el$49 = web.getNextElement(_tmpl$0), _el$52 = _el$49.firstChild, [_el$53, _co$1] = web.getNextMarker(_el$52.nextSibling), _el$54 = _el$53.nextSibling, [_el$55, _co$10] = web.getNextMarker(_el$54.nextSibling);
|
|
591
|
+
web.setAttribute(_el$49, "id", notesId);
|
|
592
|
+
web.insert(_el$49, web.createComponent(solidJs.Show, {
|
|
593
|
+
get when() {
|
|
594
|
+
return conventionNoteShown();
|
|
595
|
+
},
|
|
596
|
+
get children() {
|
|
597
|
+
var _el$50 = web.getNextElement(_tmpl$8);
|
|
598
|
+
web.insert(_el$50, (() => {
|
|
599
|
+
var _c$ = web.memo(() => noteKind() === "bars");
|
|
600
|
+
return () => _c$() ? strings.chartMissingBars : web.memo(() => noteKind() === "omitted")() ? strings.chartMissingPoints : strings.chartMissingGaps;
|
|
601
|
+
})());
|
|
602
|
+
web.effect(() => web.setAttribute(_el$50, "data-mcp-chart-note", noteKind()));
|
|
603
|
+
return _el$50;
|
|
604
|
+
}
|
|
605
|
+
}), _el$53, _co$1);
|
|
606
|
+
web.insert(_el$49, web.createComponent(solidJs.Show, {
|
|
607
|
+
get when() {
|
|
608
|
+
return missingSummary().fullyMissing.some(Boolean);
|
|
609
|
+
},
|
|
610
|
+
get children() {
|
|
611
|
+
var _el$51 = web.getNextElement(_tmpl$9);
|
|
612
|
+
web.insert(_el$51, () => formatString.formatMCPUIString(strings.chartSeriesNoData, {
|
|
613
|
+
series: noDataSeries()
|
|
614
|
+
}));
|
|
615
|
+
return _el$51;
|
|
616
|
+
}
|
|
617
|
+
}), _el$55, _co$10);
|
|
618
|
+
return _el$49;
|
|
619
|
+
}
|
|
620
|
+
}), _el$61, _co$13);
|
|
497
621
|
web.effect((_p$) => {
|
|
498
622
|
var _v$10 = `relative w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden p-4 group ${isExpanded2() ? "flex-1 min-h-0 flex flex-col" : ""} ${params().className || ""}`, _v$11 = strings.chartViewSelector, _v$12 = activeView() === "chart", _v$13 = `rounded px-2 py-1 text-xs font-medium transition-colors ${activeView() === "chart" ? "bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`, _v$14 = activeView() === "data", _v$15 = `rounded px-2 py-1 text-xs font-medium transition-colors ${activeView() === "data" ? "bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`, _v$16 = `relative w-full ${isExpanded2() ? "flex-1 min-h-0" : ""}`, _v$17 = error() || activeView() === "data" ? {
|
|
499
623
|
display: "none"
|
|
@@ -503,7 +627,7 @@ const ChartJSRenderer = (props) => {
|
|
|
503
627
|
} : {
|
|
504
628
|
height: params().height || "250px",
|
|
505
629
|
display: "block"
|
|
506
|
-
}, _v$18 = title(), _v$19 = activeView() !== "chart" || Boolean(error());
|
|
630
|
+
}, _v$18 = title(), _v$19 = notesShown() ? `${descriptionId} ${notesId}` : descriptionId, _v$20 = activeView() !== "chart" || Boolean(error());
|
|
507
631
|
_v$10 !== _p$.e && web.className(_el$, _p$.e = _v$10);
|
|
508
632
|
_v$11 !== _p$.t && web.setAttribute(_el$6, "aria-label", _p$.t = _v$11);
|
|
509
633
|
_v$12 !== _p$.a && web.setAttribute(_el$7, "aria-pressed", _p$.a = _v$12);
|
|
@@ -513,7 +637,8 @@ const ChartJSRenderer = (props) => {
|
|
|
513
637
|
_v$16 !== _p$.s && web.className(_el$41, _p$.s = _v$16);
|
|
514
638
|
_p$.h = web.style(_el$41, _v$17, _p$.h);
|
|
515
639
|
_v$18 !== _p$.r && web.setAttribute(_el$42, "aria-label", _p$.r = _v$18);
|
|
516
|
-
_v$19 !== _p$.d && web.setAttribute(_el$42, "aria-
|
|
640
|
+
_v$19 !== _p$.d && web.setAttribute(_el$42, "aria-describedby", _p$.d = _v$19);
|
|
641
|
+
_v$20 !== _p$.l && web.setAttribute(_el$42, "aria-hidden", _p$.l = _v$20);
|
|
517
642
|
return _p$;
|
|
518
643
|
}, {
|
|
519
644
|
e: void 0,
|
|
@@ -525,7 +650,8 @@ const ChartJSRenderer = (props) => {
|
|
|
525
650
|
s: void 0,
|
|
526
651
|
h: void 0,
|
|
527
652
|
r: void 0,
|
|
528
|
-
d: void 0
|
|
653
|
+
d: void 0,
|
|
654
|
+
l: void 0
|
|
529
655
|
});
|
|
530
656
|
web.runHydrationEvents();
|
|
531
657
|
return _el$;
|