@kohaku-ui/renderer-wc 0.1.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/LICENSE +201 -0
- package/README.md +18 -0
- package/dist/dom.d.ts +23 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +132 -0
- package/dist/dom.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/kohaku-surface.d.ts +42 -0
- package/dist/kohaku-surface.d.ts.map +1 -0
- package/dist/kohaku-surface.js +157 -0
- package/dist/kohaku-surface.js.map +1 -0
- package/dist/parts/action-button.d.ts +8 -0
- package/dist/parts/action-button.d.ts.map +1 -0
- package/dist/parts/action-button.js +38 -0
- package/dist/parts/action-button.js.map +1 -0
- package/dist/parts/chart-svg.d.ts +21 -0
- package/dist/parts/chart-svg.d.ts.map +1 -0
- package/dist/parts/chart-svg.js +181 -0
- package/dist/parts/chart-svg.js.map +1 -0
- package/dist/parts/chart.d.ts +9 -0
- package/dist/parts/chart.d.ts.map +1 -0
- package/dist/parts/chart.js +107 -0
- package/dist/parts/chart.js.map +1 -0
- package/dist/parts/control-select.d.ts +9 -0
- package/dist/parts/control-select.d.ts.map +1 -0
- package/dist/parts/control-select.js +56 -0
- package/dist/parts/control-select.js.map +1 -0
- package/dist/parts/form.d.ts +10 -0
- package/dist/parts/form.d.ts.map +1 -0
- package/dist/parts/form.js +346 -0
- package/dist/parts/form.js.map +1 -0
- package/dist/parts/kit.d.ts +25 -0
- package/dist/parts/kit.d.ts.map +1 -0
- package/dist/parts/kit.js +41 -0
- package/dist/parts/kit.js.map +1 -0
- package/dist/parts/layout.d.ts +6 -0
- package/dist/parts/layout.d.ts.map +1 -0
- package/dist/parts/layout.js +29 -0
- package/dist/parts/layout.js.map +1 -0
- package/dist/parts/list.d.ts +8 -0
- package/dist/parts/list.d.ts.map +1 -0
- package/dist/parts/list.js +60 -0
- package/dist/parts/list.js.map +1 -0
- package/dist/parts/loading.d.ts +7 -0
- package/dist/parts/loading.d.ts.map +1 -0
- package/dist/parts/loading.js +37 -0
- package/dist/parts/loading.js.map +1 -0
- package/dist/parts/metric.d.ts +11 -0
- package/dist/parts/metric.d.ts.map +1 -0
- package/dist/parts/metric.js +37 -0
- package/dist/parts/metric.js.map +1 -0
- package/dist/parts/overlay.d.ts +20 -0
- package/dist/parts/overlay.d.ts.map +1 -0
- package/dist/parts/overlay.js +131 -0
- package/dist/parts/overlay.js.map +1 -0
- package/dist/parts/spreadsheet.d.ts +11 -0
- package/dist/parts/spreadsheet.d.ts.map +1 -0
- package/dist/parts/spreadsheet.js +206 -0
- package/dist/parts/spreadsheet.js.map +1 -0
- package/dist/parts/tabs.d.ts +11 -0
- package/dist/parts/tabs.d.ts.map +1 -0
- package/dist/parts/tabs.js +109 -0
- package/dist/parts/tabs.js.map +1 -0
- package/dist/parts/text.d.ts +9 -0
- package/dist/parts/text.d.ts.map +1 -0
- package/dist/parts/text.js +72 -0
- package/dist/parts/text.js.map +1 -0
- package/dist/registry.d.ts +8 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +38 -0
- package/dist/registry.js.map +1 -0
- package/dist/sandbox-mount.d.ts +10 -0
- package/dist/sandbox-mount.d.ts.map +1 -0
- package/dist/sandbox-mount.js +73 -0
- package/dist/sandbox-mount.js.map +1 -0
- package/dist/tree.d.ts +24 -0
- package/dist/tree.d.ts.map +1 -0
- package/dist/tree.js +156 -0
- package/dist/tree.js.map +1 -0
- package/dist/types.d.ts +87 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { actionButtonStyle } from "@kohaku-ui/renderer-core";
|
|
2
|
+
import { el, setStyle, text } from "../dom.js";
|
|
3
|
+
import { tokenStr } from "./kit.js";
|
|
4
|
+
/**
|
|
5
|
+
* action.button — an action button (same as renderer-react's ActionButton). Fires press.
|
|
6
|
+
* If press has emit==="action.invoke" and binding is configured, it runs the write directly and, while running,
|
|
7
|
+
* is disabled + aria-busy. Otherwise it forwards via emit to onEvent (rt.invoke decides).
|
|
8
|
+
*/
|
|
9
|
+
export const actionButton = (rt, parent, node, row) => {
|
|
10
|
+
const primary = tokenStr(rt, "color.primary");
|
|
11
|
+
const border = tokenStr(rt, "color.border");
|
|
12
|
+
const danger = tokenStr(rt, "color.danger");
|
|
13
|
+
const textColor = tokenStr(rt, "color.text");
|
|
14
|
+
const onPrimary = tokenStr(rt, "color.on-primary");
|
|
15
|
+
const label = String(node.props["label"] ?? "");
|
|
16
|
+
const variant = node.props["variant"] ?? "primary";
|
|
17
|
+
const baseDisabled = node.props["disabled"] === true;
|
|
18
|
+
const tokens = { primary, border, danger, text: textColor, onPrimary };
|
|
19
|
+
const button = el("button", { "data-kohaku": node.id, type: "button" });
|
|
20
|
+
button.appendChild(text(label));
|
|
21
|
+
const apply = (phase) => {
|
|
22
|
+
const pending = phase.phase === "pending";
|
|
23
|
+
const disabled = baseDisabled || pending;
|
|
24
|
+
button.disabled = disabled;
|
|
25
|
+
if (pending)
|
|
26
|
+
button.setAttribute("aria-busy", "true");
|
|
27
|
+
else
|
|
28
|
+
button.removeAttribute("aria-busy");
|
|
29
|
+
setStyle(button, actionButtonStyle(variant, tokens, { disabled }));
|
|
30
|
+
};
|
|
31
|
+
apply({ phase: "idle" });
|
|
32
|
+
button.addEventListener("click", () => {
|
|
33
|
+
void rt.invoke(node, "press", {}, row, apply);
|
|
34
|
+
});
|
|
35
|
+
parent.appendChild(button);
|
|
36
|
+
return () => button.remove();
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=action-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button.js","sourceRoot":"","sources":["../../src/parts/action-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MA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AG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;QAC1C,MAAM,QAAQ,GAAG,YAAY,IAAI,OAAO,CAAC;QACxC,MAA4B,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAClD,IAAI,OAAO;YAAE,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;;YACjD,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QACzC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC;IACF,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAEzB,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;QACpC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;AAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ChartColors, type ChartConfig } from "@kohaku-ui/renderer-core";
|
|
2
|
+
import type { JsonObject } from "@kohaku-ui/spec-core";
|
|
3
|
+
/**
|
|
4
|
+
* Wiring for data-point clicks (pointClick). Since an SVG cannot sit under aria-hidden (avoiding the contradiction
|
|
5
|
+
* of hiding a focusable element from AT), when interactive, chart.ts removes the holder's aria-hidden and gives
|
|
6
|
+
* each point/bar role="button" + tabindex + aria-label + Enter/Space activation.
|
|
7
|
+
*/
|
|
8
|
+
export interface ChartPointHandler {
|
|
9
|
+
/** Callback on point click (wide row + series key → chart.ts assembles a long row and emits). */
|
|
10
|
+
onPoint: (wideRow: JsonObject, yKey: string) => void;
|
|
11
|
+
/** aria-label of the interactive element (for screen-reader announcement). */
|
|
12
|
+
ariaLabel: (wideRow: JsonObject, yKey: string) => string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A zero-dependency inline SVG chart (bar / line / area). A substitute for renderer-react's Recharts rendering.
|
|
16
|
+
* It does not claim pixel-match (stays at semantic equivalence). Series colors come from the shared palette.
|
|
17
|
+
* cfg (kind / rows / x / yKeys / stacked / referenceLines) is the framework-free view model resolved by
|
|
18
|
+
* renderer-core's resolveChartConfig; point (wiring for data-point clicks) is optional.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildChartSvg(cfg: ChartConfig, colors: ChartColors, palette: string[], point?: ChartPointHandler): SVGElement;
|
|
21
|
+
//# sourceMappingURL=chart-svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-svg.d.ts","sourceRoot":"","sources":["../../src/parts/chart-svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAmB,MAAM,0BAA0B,CAAC;AAC/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOvD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,iGAAiG;IACjG,OAAO,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,8EAA8E;IAC9E,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC1D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,CAAC,EAAE,iBAAiB,GACxB,UAAU,CAwKZ"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { isActivationKey } from "@kohaku-ui/renderer-core";
|
|
2
|
+
import { svgEl } from "../dom.js";
|
|
3
|
+
const W = 600;
|
|
4
|
+
const H = 320;
|
|
5
|
+
const M = { top: 8, right: 16, bottom: 28, left: 48 };
|
|
6
|
+
/**
|
|
7
|
+
* A zero-dependency inline SVG chart (bar / line / area). A substitute for renderer-react's Recharts rendering.
|
|
8
|
+
* It does not claim pixel-match (stays at semantic equivalence). Series colors come from the shared palette.
|
|
9
|
+
* cfg (kind / rows / x / yKeys / stacked / referenceLines) is the framework-free view model resolved by
|
|
10
|
+
* renderer-core's resolveChartConfig; point (wiring for data-point clicks) is optional.
|
|
11
|
+
*/
|
|
12
|
+
export function buildChartSvg(cfg, colors, palette, point) {
|
|
13
|
+
const { kind, rows, x, yKeys, stacked, referenceLines } = cfg;
|
|
14
|
+
const color = (i) => palette[i % palette.length];
|
|
15
|
+
const plotW = W - M.left - M.right;
|
|
16
|
+
const plotH = H - M.top - M.bottom;
|
|
17
|
+
// Max of the y axis (stacked = the series sum at each x, otherwise the max across all series). Floor of 1 to avoid division by zero.
|
|
18
|
+
let max = 0;
|
|
19
|
+
for (const row of rows) {
|
|
20
|
+
if (stacked) {
|
|
21
|
+
let sum = 0;
|
|
22
|
+
for (const key of yKeys)
|
|
23
|
+
sum += num(row[key]);
|
|
24
|
+
max = Math.max(max, sum);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
for (const key of yKeys)
|
|
28
|
+
max = Math.max(max, num(row[key]));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Include reference-line values in the max to widen the axis domain (target lines exceeding the data stay visible; equivalent to React's ifOverflow="extendDomain").
|
|
32
|
+
for (const rl of referenceLines)
|
|
33
|
+
max = Math.max(max, num(rl.value));
|
|
34
|
+
if (max <= 0)
|
|
35
|
+
max = 1;
|
|
36
|
+
const svg = svgEl("svg", {
|
|
37
|
+
width: "100%",
|
|
38
|
+
height: String(H),
|
|
39
|
+
viewBox: `0 0 ${W} ${H}`,
|
|
40
|
+
preserveAspectRatio: "none",
|
|
41
|
+
role: point != null ? "group" : "presentation",
|
|
42
|
+
});
|
|
43
|
+
const n = rows.length;
|
|
44
|
+
const bandW = n > 0 ? plotW / n : plotW;
|
|
45
|
+
const xCenter = (i) => M.left + bandW * i + bandW / 2;
|
|
46
|
+
const yOf = (v) => M.top + plotH - (v / max) * plotH;
|
|
47
|
+
/** Gives an interactive element (rect / circle) role="button" + tabindex + aria-label + click/Enter/Space. */
|
|
48
|
+
const makeInteractive = (elm, row, key) => {
|
|
49
|
+
if (point == null)
|
|
50
|
+
return;
|
|
51
|
+
elm.setAttribute("role", "button");
|
|
52
|
+
elm.setAttribute("tabindex", "0");
|
|
53
|
+
elm.setAttribute("aria-label", point.ariaLabel(row, key));
|
|
54
|
+
elm.style.cursor = "pointer";
|
|
55
|
+
elm.addEventListener("click", () => point.onPoint(row, key));
|
|
56
|
+
elm.addEventListener("keydown", (e) => {
|
|
57
|
+
const ke = e;
|
|
58
|
+
if (isActivationKey(ke.key)) {
|
|
59
|
+
if (ke.key === " ")
|
|
60
|
+
ke.preventDefault();
|
|
61
|
+
point.onPoint(row, key);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
if (kind === "line" || kind === "area") {
|
|
66
|
+
yKeys.forEach((key, si) => {
|
|
67
|
+
const points = rows.map((row, i) => `${xCenter(i)},${yOf(num(row[key]))}`).join(" ");
|
|
68
|
+
if (kind === "area") {
|
|
69
|
+
const first = xCenter(0);
|
|
70
|
+
const last = xCenter(n - 1);
|
|
71
|
+
const baseline = M.top + plotH;
|
|
72
|
+
svg.appendChild(svgEl("polygon", {
|
|
73
|
+
points: `${first},${baseline} ${points} ${last},${baseline}`,
|
|
74
|
+
fill: color(si),
|
|
75
|
+
"fill-opacity": "0.25",
|
|
76
|
+
stroke: "none",
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
svg.appendChild(svgEl("polyline", { points, fill: "none", stroke: color(si), "stroke-width": "2" }));
|
|
80
|
+
// Only when clickable, overlay a dot on each point (both the click target and the affordance).
|
|
81
|
+
if (point != null) {
|
|
82
|
+
rows.forEach((row, i) => {
|
|
83
|
+
const dot = svgEl("circle", {
|
|
84
|
+
cx: String(xCenter(i)),
|
|
85
|
+
cy: String(yOf(num(row[key]))),
|
|
86
|
+
r: "5",
|
|
87
|
+
fill: color(si),
|
|
88
|
+
stroke: colors.dotStroke,
|
|
89
|
+
"stroke-width": "1",
|
|
90
|
+
});
|
|
91
|
+
makeInteractive(dot, row, key);
|
|
92
|
+
svg.appendChild(dot);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// bar (default). Grouped or stacked.
|
|
99
|
+
const groupPad = bandW * 0.15;
|
|
100
|
+
const innerW = bandW - groupPad * 2;
|
|
101
|
+
rows.forEach((row, i) => {
|
|
102
|
+
const x0 = M.left + bandW * i + groupPad;
|
|
103
|
+
if (stacked) {
|
|
104
|
+
let acc = 0;
|
|
105
|
+
yKeys.forEach((key, si) => {
|
|
106
|
+
const v = num(row[key]);
|
|
107
|
+
const h = (v / max) * plotH;
|
|
108
|
+
const y = M.top + plotH - acc - h;
|
|
109
|
+
acc += h;
|
|
110
|
+
const rect = svgEl("rect", {
|
|
111
|
+
x: String(x0),
|
|
112
|
+
y: String(y),
|
|
113
|
+
width: String(innerW),
|
|
114
|
+
height: String(h),
|
|
115
|
+
fill: color(si),
|
|
116
|
+
});
|
|
117
|
+
makeInteractive(rect, row, key);
|
|
118
|
+
svg.appendChild(rect);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
const each = innerW / Math.max(1, yKeys.length);
|
|
123
|
+
yKeys.forEach((key, si) => {
|
|
124
|
+
const v = num(row[key]);
|
|
125
|
+
const h = (v / max) * plotH;
|
|
126
|
+
const y = M.top + plotH - h;
|
|
127
|
+
const rect = svgEl("rect", {
|
|
128
|
+
x: String(x0 + each * si),
|
|
129
|
+
y: String(y),
|
|
130
|
+
width: String(each),
|
|
131
|
+
height: String(h),
|
|
132
|
+
fill: color(si),
|
|
133
|
+
});
|
|
134
|
+
makeInteractive(rect, row, key);
|
|
135
|
+
svg.appendChild(rect);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// Reference lines (horizontal lines for targets / thresholds + labels). Drawn after points/bars to sit in front of the data.
|
|
141
|
+
for (const rl of referenceLines) {
|
|
142
|
+
const yy = yOf(num(rl.value));
|
|
143
|
+
svg.appendChild(svgEl("line", {
|
|
144
|
+
x1: String(M.left),
|
|
145
|
+
y1: String(yy),
|
|
146
|
+
x2: String(M.left + plotW),
|
|
147
|
+
y2: String(yy),
|
|
148
|
+
stroke: colors.axis,
|
|
149
|
+
"stroke-width": "1",
|
|
150
|
+
"stroke-dasharray": "4 4",
|
|
151
|
+
}));
|
|
152
|
+
if (rl.label != null) {
|
|
153
|
+
const lbl = svgEl("text", {
|
|
154
|
+
x: String(M.left + plotW),
|
|
155
|
+
y: String(yy - 3),
|
|
156
|
+
"text-anchor": "end",
|
|
157
|
+
"font-size": "11",
|
|
158
|
+
fill: colors.axis,
|
|
159
|
+
});
|
|
160
|
+
lbl.textContent = rl.label;
|
|
161
|
+
svg.appendChild(lbl);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// x-axis labels (placed at each band's center for determinism).
|
|
165
|
+
rows.forEach((row, i) => {
|
|
166
|
+
const label = svgEl("text", {
|
|
167
|
+
x: String(xCenter(i)),
|
|
168
|
+
y: String(H - 8),
|
|
169
|
+
"text-anchor": "middle",
|
|
170
|
+
"font-size": "12",
|
|
171
|
+
fill: colors.axisLabel,
|
|
172
|
+
});
|
|
173
|
+
label.textContent = String(row[x] ?? "");
|
|
174
|
+
svg.appendChild(label);
|
|
175
|
+
});
|
|
176
|
+
return svg;
|
|
177
|
+
}
|
|
178
|
+
function num(v) {
|
|
179
|
+
return typeof v === "number" && Number.isFinite(v) ? v : 0;
|
|
180
|
+
}
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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PartBuilder } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* presentChart — a chart (the non-React version of renderer-react's PresentChart).
|
|
4
|
+
* bar/line/area use a zero-dependency inline SVG (shared prepareRows + palette); pie/scatter fall back to a visible
|
|
5
|
+
* data table. In all cases a visually hidden a11y data table is always attached (same a11y as React).
|
|
6
|
+
* It does not claim pixel-match (stays at semantic equivalence).
|
|
7
|
+
*/
|
|
8
|
+
export declare const presentChart: PartBuilder;
|
|
9
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/parts/chart.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,aAAa,CAAC;AAI9D;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,WAC0D,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { A11Y_TABLE_ROW_CAP, chartPointRow, resolveChartConfig, resolveToken, visuallyHiddenStyle, } from "@kohaku-ui/renderer-core";
|
|
2
|
+
import { el, setStyle, text } from "../dom.js";
|
|
3
|
+
import { buildChartSvg } from "./chart-svg.js";
|
|
4
|
+
import { dataStateNotice, mountBoundPart } from "./kit.js";
|
|
5
|
+
/**
|
|
6
|
+
* presentChart — a chart (the non-React version of renderer-react's PresentChart).
|
|
7
|
+
* bar/line/area use a zero-dependency inline SVG (shared prepareRows + palette); pie/scatter fall back to a visible
|
|
8
|
+
* data table. In all cases a visually hidden a11y data table is always attached (same a11y as React).
|
|
9
|
+
* It does not claim pixel-match (stays at semantic equivalence).
|
|
10
|
+
*/
|
|
11
|
+
export const presentChart = (rt, parent, node) => mountBoundPart(rt, parent, node, (state) => ({ el: renderChart(rt, node, state) }));
|
|
12
|
+
function renderChart(rt, node, state) {
|
|
13
|
+
if (state.status !== "ready")
|
|
14
|
+
return dataStateNotice(rt, state);
|
|
15
|
+
const palette = String(resolveToken(rt.theme, "chart.palette")).split(",");
|
|
16
|
+
// Resolve the colors of reference lines / axes / point strokes / axis labels from tokens (equivalent to React's useToken path).
|
|
17
|
+
const chartColors = {
|
|
18
|
+
axis: String(resolveToken(rt.theme, "chart.axis")),
|
|
19
|
+
dotStroke: String(resolveToken(rt.theme, "color.background")),
|
|
20
|
+
axisLabel: String(resolveToken(rt.theme, "color.muted")),
|
|
21
|
+
};
|
|
22
|
+
// The config / view model (prop defaults, default label, pointClickable) comes from renderer-core; only the markup is emitted here.
|
|
23
|
+
const cfg = resolveChartConfig(node, rt.spec, state.data.rows, rt.messages);
|
|
24
|
+
const { kind, x, series, rows, yKeys, title, label } = cfg;
|
|
25
|
+
// If undeclared, points stay non-interactive (rt.emit = resolveEmit is the gatekeeper).
|
|
26
|
+
const point = cfg.pointClickable
|
|
27
|
+
? {
|
|
28
|
+
onPoint: (wideRow, yKey) => rt.emit(node, "pointClick", { row: chartPointRow(wideRow, yKey, x, cfg.yProp, series) }, null),
|
|
29
|
+
ariaLabel: (wideRow, yKey) => {
|
|
30
|
+
const xVal = String(wideRow[x] ?? "");
|
|
31
|
+
const val = String(wideRow[yKey] ?? "");
|
|
32
|
+
return series != null ? `${x} ${xVal}、${series} ${yKey}: ${val}` : `${x} ${xVal}、${yKey}: ${val}`;
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
: undefined;
|
|
36
|
+
// Give it a name via figure's implicit role + aria-label (no role="img" — let the descendant a11y table be read).
|
|
37
|
+
const figure = el("figure", { "data-kohaku": node.id, "aria-label": label }, { margin: 0, width: "100%" });
|
|
38
|
+
if (title != null) {
|
|
39
|
+
const caption = el("figcaption", {}, { fontSize: 13, fontWeight: 600, marginBottom: 6 });
|
|
40
|
+
caption.appendChild(text(title));
|
|
41
|
+
figure.appendChild(caption);
|
|
42
|
+
}
|
|
43
|
+
if (kind === "pie" || kind === "scatter") {
|
|
44
|
+
// Not a hand-drawn SVG kind. Substitute with a visible data table (a visible table separate from the a11y table).
|
|
45
|
+
figure.appendChild(visibleFallbackTable(x, yKeys, rows));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// When non-interactive, mark the SVG aria-hidden and defer to the a11y table. When interactive, remove aria-hidden
|
|
49
|
+
// so focusable points aren't hidden from AT, and give the holder role="group" + a name (points are role="button").
|
|
50
|
+
const svgHolder = point != null
|
|
51
|
+
? el("div", { role: "group", "aria-label": label }, { width: "100%", height: 320 })
|
|
52
|
+
: el("div", { "aria-hidden": "true" }, { width: "100%", height: 320 });
|
|
53
|
+
svgHolder.appendChild(buildChartSvg(cfg, chartColors, palette, point));
|
|
54
|
+
figure.appendChild(svgHolder);
|
|
55
|
+
}
|
|
56
|
+
figure.appendChild(a11yTable(label, x, yKeys, rows));
|
|
57
|
+
return figure;
|
|
58
|
+
}
|
|
59
|
+
/** Visually hidden data-table substitute (same as renderer-react's ChartDataTable). Row count is truncated at the cap. */
|
|
60
|
+
function a11yTable(label, x, yKeys, rows) {
|
|
61
|
+
const table = el("table");
|
|
62
|
+
setStyle(table, visuallyHiddenStyle);
|
|
63
|
+
const caption = el("caption");
|
|
64
|
+
caption.appendChild(text(label));
|
|
65
|
+
table.appendChild(caption);
|
|
66
|
+
table.appendChild(headRow(x, yKeys));
|
|
67
|
+
table.appendChild(bodyRows(x, yKeys, rows.slice(0, A11Y_TABLE_ROW_CAP)));
|
|
68
|
+
return table;
|
|
69
|
+
}
|
|
70
|
+
/** Visible fallback table for pie/scatter (a plain visible table). */
|
|
71
|
+
function visibleFallbackTable(x, yKeys, rows) {
|
|
72
|
+
const table = el("table", {}, { width: "100%", borderCollapse: "collapse", fontSize: 13.5 });
|
|
73
|
+
table.appendChild(headRow(x, yKeys));
|
|
74
|
+
table.appendChild(bodyRows(x, yKeys, rows.slice(0, A11Y_TABLE_ROW_CAP)));
|
|
75
|
+
return table;
|
|
76
|
+
}
|
|
77
|
+
function headRow(x, yKeys) {
|
|
78
|
+
const thead = el("thead");
|
|
79
|
+
const tr = el("tr");
|
|
80
|
+
const xh = el("th", { scope: "col" });
|
|
81
|
+
xh.appendChild(text(x));
|
|
82
|
+
tr.appendChild(xh);
|
|
83
|
+
for (const key of yKeys) {
|
|
84
|
+
const th = el("th", { scope: "col" });
|
|
85
|
+
th.appendChild(text(key));
|
|
86
|
+
tr.appendChild(th);
|
|
87
|
+
}
|
|
88
|
+
thead.appendChild(tr);
|
|
89
|
+
return thead;
|
|
90
|
+
}
|
|
91
|
+
function bodyRows(x, yKeys, rows) {
|
|
92
|
+
const tbody = el("tbody");
|
|
93
|
+
for (const row of rows) {
|
|
94
|
+
const tr = el("tr");
|
|
95
|
+
const xd = el("td");
|
|
96
|
+
xd.appendChild(text(String(row[x] ?? "")));
|
|
97
|
+
tr.appendChild(xd);
|
|
98
|
+
for (const key of yKeys) {
|
|
99
|
+
const td = el("td");
|
|
100
|
+
td.appendChild(text(String(row[key] ?? "")));
|
|
101
|
+
tr.appendChild(td);
|
|
102
|
+
}
|
|
103
|
+
tbody.appendChild(tr);
|
|
104
|
+
}
|
|
105
|
+
return tbody;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../../src/parts/chart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,aAAa,EAA0B,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,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C,CAAC,CAAC;QAC1B,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACtB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,KAAe,EAAE,IAAkB;IAC9D,MAAM,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACpB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACpB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3C,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACnB,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;YACpB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7C,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PartBuilder } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* control.select — a lightweight select (same as renderer-react's ControlSelect). On change, fires the selected value ($value).
|
|
4
|
+
* If `<id>.change` → emit "state.set" is declared, rt.emit updates $state (the existing state.set path), and
|
|
5
|
+
* parts that carry data.bind re-resolve their effective ref, making cross-filtering work (without firing a compose).
|
|
6
|
+
* The displayed value follows the current value of the $state key it writes to.
|
|
7
|
+
*/
|
|
8
|
+
export declare const controlSelect: PartBuilder;
|
|
9
|
+
//# sourceMappingURL=control-select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-select.d.ts","sourceRoot":"","sources":["../../src/parts/control-select.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,WAqD3B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { boundStateKey, normalizeSelectOptions } from "@kohaku-ui/renderer-core";
|
|
2
|
+
import { el, text } from "../dom.js";
|
|
3
|
+
import { tokenStr } from "./kit.js";
|
|
4
|
+
/**
|
|
5
|
+
* control.select — a lightweight select (same as renderer-react's ControlSelect). On change, fires the selected value ($value).
|
|
6
|
+
* If `<id>.change` → emit "state.set" is declared, rt.emit updates $state (the existing state.set path), and
|
|
7
|
+
* parts that carry data.bind re-resolve their effective ref, making cross-filtering work (without firing a compose).
|
|
8
|
+
* The displayed value follows the current value of the $state key it writes to.
|
|
9
|
+
*/
|
|
10
|
+
export const controlSelect = (rt, parent, node, row) => {
|
|
11
|
+
const border = tokenStr(rt, "color.border");
|
|
12
|
+
const options = normalizeSelectOptions(node.props["options"]);
|
|
13
|
+
const placeholder = node.props["placeholder"];
|
|
14
|
+
const label = node.props["label"];
|
|
15
|
+
const select = el("select", { "data-kohaku": node.id }, {
|
|
16
|
+
border: `1px solid ${border}`,
|
|
17
|
+
borderRadius: 6,
|
|
18
|
+
padding: "7px 10px",
|
|
19
|
+
fontSize: 13.5,
|
|
20
|
+
alignSelf: "flex-start",
|
|
21
|
+
});
|
|
22
|
+
if (label != null)
|
|
23
|
+
select.setAttribute("aria-label", String(label));
|
|
24
|
+
if (placeholder != null) {
|
|
25
|
+
const opt = el("option", { value: "" });
|
|
26
|
+
opt.appendChild(text(String(placeholder)));
|
|
27
|
+
select.appendChild(opt);
|
|
28
|
+
}
|
|
29
|
+
for (const opt of options) {
|
|
30
|
+
const o = el("option", { value: opt.value });
|
|
31
|
+
o.appendChild(text(opt.label));
|
|
32
|
+
select.appendChild(o);
|
|
33
|
+
}
|
|
34
|
+
// Use as the displayed value the current value of the state key that this element's change writes via state.set (falling back to props.value).
|
|
35
|
+
const boundKey = boundStateKey(rt.spec, node.id);
|
|
36
|
+
const readValue = () => {
|
|
37
|
+
const stateValue = boundKey != null ? rt.store.get(boundKey) : undefined;
|
|
38
|
+
return String(stateValue ?? node.props["value"] ?? "");
|
|
39
|
+
};
|
|
40
|
+
select.value = readValue();
|
|
41
|
+
select.addEventListener("change", () => {
|
|
42
|
+
rt.emit(node, "change", { value: select.value }, row);
|
|
43
|
+
});
|
|
44
|
+
// Update the displayed value following $state changes (also reflecting state.set from other controls via A1 cross-filtering).
|
|
45
|
+
const unsub = rt.store.subscribe(() => {
|
|
46
|
+
const next = readValue();
|
|
47
|
+
if (select.value !== next)
|
|
48
|
+
select.value = next;
|
|
49
|
+
});
|
|
50
|
+
parent.appendChild(select);
|
|
51
|
+
return () => {
|
|
52
|
+
unsub();
|
|
53
|
+
select.remove();
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=control-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-select.js","sourceRoot":"","sources":["../../src/parts/control-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;IAClE,MAAM,MAAM,GAAG,QAAQ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AAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,GAAW,EAAE;QAC7B,MAAM,UAAU,GAAG,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,OAAO,MAAM,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC;IACF,MAAM,CAAC,KAAK,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;QACrC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,8HAA8H;IAC9H,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACpC,MAAM,IAAI,GAAG,SAAS,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;YAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,OAAO,GAAG,EAAE;QACV,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PartBuilder } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* presentForm — an input form (same behavior as renderer-react's PresentForm). Wires submit directly to action.invoke
|
|
4
|
+
* (auto-falls back to onEvent forwarding if binding is unset). If node.data exists, initial values are filled from the first row.
|
|
5
|
+
*
|
|
6
|
+
* To preserve focus/caret, WC does not swap the whole element; it locally updates only value filling, busy, and submit result
|
|
7
|
+
* (the final submit payload matches React's controlled re-render).
|
|
8
|
+
*/
|
|
9
|
+
export declare const presentForm: PartBuilder;
|
|
10
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/parts/form.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAe,WAAW,EAA2B,MAAM,aAAa,CAAC;AAGrF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,WAiJzB,CAAC"}
|