(container: HTMLElement)
| 36 | } |
| 37 | |
| 38 | function add(container: HTMLElement): void { |
| 39 | container.classList.add('d-flex'); |
| 40 | |
| 41 | container.parentElement!.append( |
| 42 | <details className="details-reset details-overlay select-menu select-menu-modal-right hx_rsm my-auto"> |
| 43 | {tooltipped( |
| 44 | 'Add a table', |
| 45 | <summary |
| 46 | className="Button Button--iconOnly Button--invisible Button--medium" |
| 47 | role="button" |
| 48 | aria-haspopup="menu" |
| 49 | > |
| 50 | <TableIcon /> |
| 51 | </summary>, |
| 52 | )} |
| 53 | <details-menu |
| 54 | className="select-menu-modal position-absolute right-0 hx_rsm-modal rgh-table-input" |
| 55 | role="menu" |
| 56 | > |
| 57 | {Array.from({length: 25}, (_, index) => ( |
| 58 | <button |
| 59 | type="button" |
| 60 | role="menuitem" |
| 61 | className="rgh-tic btn-link" |
| 62 | data-x={(index % 5) + 1} |
| 63 | data-y={Math.floor(index / 5) + 1} |
| 64 | /> |
| 65 | ))} |
| 66 | </details-menu> |
| 67 | </details>, |
| 68 | ); |
| 69 | } |
| 70 | |
| 71 | function init(signal: AbortSignal): void { |
| 72 | observe(actionBar, add, {signal}); |
nothing calls this directly
no test coverage detected