← Commit history
readme.html: add the <adom-table> section
adom/widgets#3 merged, so the registry entry is complete at 9 attrs
(colorby last) and any page can now reach the tag from markdown. This page
shipped widgets/adom-table.js without naming it anywhere in its own docs.
Descriptive rather than live: unlike the widgets above it, it is not fed
from this frame, and the private-page caveat (adom/wiki#166) is the thing
a reader most needs before trying it.
1 file changed
+22−1
readme.html+22−1@@ -204,6 +204,27 @@ h2 .anchor:hover{opacity:1;color:var(--teal)} <p>This page is a <code>readme.html</code> — the wiki serves it byte-for-byte in a sandboxed iframe where scripts run. So the widgets above aren't renders of the widgets; they <b>are</b> the widgets. Drop the same <code><adom-*></code> tags into any component page and they behave identically.</p> </div> + <!-- ADOM-TABLE -->+ <section>+ <div class="eyebrow">The generic one — registered wiki-wide</div>+ <h2 id="table">Table <span class="tag"><adom-table></span> <span class="new">new</span><a class="anchor" href="#table" aria-label="direct link">#</a></h2>+ <p class="sub">Any JSON array as a filterable, sortable, facetable table. Not component-specific and not on the <code>lbr-hover</code> bus — and unlike the widgets above it ships with the <code>adom-widget</code> runtime <b>bundled in</b>, because the wiki's widget frame loads exactly one script. It is registered in <a href="/adom/widgets">adom/widgets</a>, so any page can write the tag in plain markdown instead of hosting the script.</p>+ <pre><code><span class="tok-com">› in any README.md, on its own line</span>+<span class="tok-tag">::adom-table</span>{<span class="tok-attr">src</span>=<span class="tok-str">"/OWNER/SLUG/render/data.json"</span> <span class="tok-attr">columns</span>=<span class="tok-str">"repo,owner,policy"</span> <span class="tok-attr">facet</span>=<span class="tok-str">"owner"</span>}</code></pre>+ <div class="refgrid">+ <div class="refcard">+ <h3>Nine allowlisted attributes</h3>+ <p><code>src</code> <code>columns</code> <code>heading</code> <code>filter</code> <code>facet</code> <code>sort</code> <code>dim</code> <code>mark</code> <code>colorby</code>. <code>mark</code> colours cells matching a pattern; <code>colorby="col:field"</code> takes the colour from each row's own data (<code>#rgb</code> / <code>#rrggbb</code> only, anything else dropped), so a page and any other rendering of the same data — an <code>.svg</code> export, say — cannot drift into disagreeing about who is which colour.</p>+ <span class="pill">adom/widgets</span>+ </div>+ <div class="refcard">+ <h3>On a private page, host it instead</h3>+ <p>The tag's frame is an opaque origin, so its <code>src</code> fetch carries no session: it 404s and the table renders empty with no error anywhere. Feed the widget inline JSON from a page section instead. See adom/wiki#166; <a href="/adom/repo-ownership">adom/repo-ownership</a> is a working host.</p>+ <span class="pill">adom/wiki#166</span>+ </div>+ </div>+ </section>+ <!-- ADOM-LBR + DATASHEET --> <section> <div class="eyebrow">Already covered — don't rebuild</div>@@ -225,7 +246,7 @@ h2 .anchor:hover{opacity:1;color:var(--teal)} <footer> <div class="eyebrow" style="color:var(--dim2)">Attached in the Files tab</div>- <div class="files">pinout-widget.js · heatsink-via-widget.js · molecule-widget.js · chip-thumbnail-widget.js · moleculize-widget.js<br>+ each widget's <span class="mono">*-viewer.html</span> (iframe-embeddable) and the example JSON sources</div>+ <div class="files">pinout-widget.js · heatsink-via-widget.js · molecule-widget.js · chip-thumbnail-widget.js · moleculize-widget.js<br>+ each widget's <span class="mono">*-viewer.html</span> (iframe-embeddable) and the example JSON sources<br>+ <span class="mono">widgets/adom-table.js</span>, which pages load through the registry route <span class="mono">/widget-script/adom-table.js</span></div> <div class="url">wiki.adom.inc/adom/component-widgets</div> </footer>