@opendata-ai/openchart-vanilla 2.12.0 → 2.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/mount.ts +11 -0
- package/src/table-renderer.ts +20 -1
package/dist/index.js
CHANGED
|
@@ -4725,6 +4725,15 @@ function createScreenReaderTable(layout, container) {
|
|
|
4725
4725
|
if (!data || data.length === 0) return null;
|
|
4726
4726
|
const table = document.createElement("table");
|
|
4727
4727
|
table.className = "viz-sr-only";
|
|
4728
|
+
table.style.position = "absolute";
|
|
4729
|
+
table.style.width = "1px";
|
|
4730
|
+
table.style.height = "1px";
|
|
4731
|
+
table.style.padding = "0";
|
|
4732
|
+
table.style.margin = "-1px";
|
|
4733
|
+
table.style.overflow = "hidden";
|
|
4734
|
+
table.style.clipPath = "inset(50%)";
|
|
4735
|
+
table.style.whiteSpace = "nowrap";
|
|
4736
|
+
table.style.borderWidth = "0";
|
|
4728
4737
|
table.setAttribute("role", "table");
|
|
4729
4738
|
table.setAttribute("aria-label", `Data table: ${layout.a11y.altText}`);
|
|
4730
4739
|
if (data.length > 0) {
|
|
@@ -5711,6 +5720,15 @@ function renderTable(layout, container) {
|
|
|
5711
5720
|
}
|
|
5712
5721
|
const caption = document.createElement("caption");
|
|
5713
5722
|
caption.className = "viz-sr-only";
|
|
5723
|
+
caption.style.position = "absolute";
|
|
5724
|
+
caption.style.width = "1px";
|
|
5725
|
+
caption.style.height = "1px";
|
|
5726
|
+
caption.style.padding = "0";
|
|
5727
|
+
caption.style.margin = "-1px";
|
|
5728
|
+
caption.style.overflow = "hidden";
|
|
5729
|
+
caption.style.clipPath = "inset(50%)";
|
|
5730
|
+
caption.style.whiteSpace = "nowrap";
|
|
5731
|
+
caption.style.borderWidth = "0";
|
|
5714
5732
|
caption.textContent = layout.a11y.summary;
|
|
5715
5733
|
table.appendChild(caption);
|
|
5716
5734
|
table.appendChild(renderThead(layout.columns, layout.sort));
|
|
@@ -5728,6 +5746,15 @@ function renderTable(layout, container) {
|
|
|
5728
5746
|
}
|
|
5729
5747
|
const liveRegion = document.createElement("div");
|
|
5730
5748
|
liveRegion.className = "viz-table-live-region viz-sr-only";
|
|
5749
|
+
liveRegion.style.position = "absolute";
|
|
5750
|
+
liveRegion.style.width = "1px";
|
|
5751
|
+
liveRegion.style.height = "1px";
|
|
5752
|
+
liveRegion.style.padding = "0";
|
|
5753
|
+
liveRegion.style.margin = "-1px";
|
|
5754
|
+
liveRegion.style.overflow = "hidden";
|
|
5755
|
+
liveRegion.style.clipPath = "inset(50%)";
|
|
5756
|
+
liveRegion.style.whiteSpace = "nowrap";
|
|
5757
|
+
liveRegion.style.borderWidth = "0";
|
|
5731
5758
|
liveRegion.setAttribute("aria-live", "polite");
|
|
5732
5759
|
liveRegion.setAttribute("aria-atomic", "true");
|
|
5733
5760
|
liveRegion.setAttribute("role", "status");
|