Allow custom dialogs, better styling support.

Fix registration bug with tp-form.
This commit is contained in:
pk
2026-07-06 12:30:51 +02:00
parent e84eab678e
commit 4ea22025ca
5 changed files with 179 additions and 34 deletions
+18 -8
View File
@@ -6,6 +6,14 @@ export class TpRtbBaseExtension extends LitElement {
:host {
display: inline-block;
}
slot::slotted(*) {
cursor: pointer;
}
:host([active]) slot::slotted(*) {
--tp-icon-color: var(--tp-rtb-action-active-color, currentColor);
}
button {
margin: 0 2px;
@@ -26,6 +34,16 @@ export class TpRtbBaseExtension extends LitElement {
`;
}
render() {
return html`
<slot @click=${this._handleClick}>
<button type="button" class="${this.active ? 'active' : ''}" title=${this.label} aria-label=${this.label}>
${this.label}
</button>
</slot>
`;
}
static get properties() {
return {
label: { type: String },
@@ -39,14 +57,6 @@ export class TpRtbBaseExtension extends LitElement {
this.active = false;
}
render() {
return html`
<button class="${this.active ? 'active' : ''}" @click=${this._handleClick}>
${this.label}
</button>
`;
}
connectedCallback() {
super.connectedCallback();
this._findParentEditor();