-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable-header-cell-tag.js
52 lines (40 loc) · 1.28 KB
/
table-header-cell-tag.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const template = document.createElement('template');
template.innerHTML = `
<style>
/* Uncomment and provide a URL if you want to import an external stylesheet */
/* @import url(); */
:host {
/* for the shadow root */
display: block;
}
:host(table-header-cell-tag) {
/* if my shadow root is table-header-cell-tag */
}
:host-context(main) {
/* if one of my ancestors is main */
}
::slotted(*) {
/* anything that is slotted */
}
.table-header-cell-tag {}
</style>
<th class="table-header-cell-tag" part="table-header-cell-tag"></th>
`;
class TableHeaderCellTag extends HTMLElement {
constructor() {
super();
this.root = this.attachShadow({ mode: 'closed' });
this.root.innerHTML = template.innerHTML;
}
// Define allowed attributes
static get observedAttributes() {
return [];
}
// Handle values and changes to the attributes
attributeChangedCallback(_attrName, _oldVal, _newVal) {
// Handle attribute changes here if needed
}
}
customElements.define('table-header-cell-tag', TableHeaderCellTag);
// <table-header-cell-tag id='some id'>
// </table-header-cell-tag>