()
| 41 | } |
| 42 | |
| 43 | #init() { |
| 44 | this.#table = this.querySelector('table'); |
| 45 | this.#tbody = this.#table?.tBodies[0]; |
| 46 | |
| 47 | if (!this.#table || !this.#tbody) { |
| 48 | console.warn('ot-table: Missing table or tbody element'); |
| 49 | return; |
| 50 | } |
| 51 | |
| 52 | this.#filter = this.querySelector('[data-table-filter]'); |
| 53 | this.#status = this.querySelector('[data-table-status]'); |
| 54 | this.#selectedStatus = this.querySelector('[data-table-selected]'); |
| 55 | this.#selectAll = this.querySelector('[data-table-select-all]'); |
| 56 | |
| 57 | this.#setupSort(); |
| 58 | this.#setupFilter(); |
| 59 | this.#setupSelection(); |
| 60 | this.addEventListener('ot-table-refresh', () => this.refresh(), { signal: this.#controller.signal }); |
| 61 | |
| 62 | this.refresh(); |
| 63 | this.#applyInitialSort(); |
| 64 | } |
| 65 | |
| 66 | #setupSort() { |
| 67 | this.#headers = Array.from(this.#table.querySelectorAll('thead th[data-sort]')); |
no test coverage detected