@digital-realty/ix-button
Advanced tools
Comparing version 3.2.7 to 3.2.8
@@ -56,3 +56,4 @@ import { LitElement } from 'lit'; | ||
private readonly handleActivationClick; | ||
render(): import("lit-html").TemplateResult<1>; | ||
private readonly tags; | ||
protected render(): import("lit-html").TemplateResult; | ||
} |
var _a; | ||
import { __decorate } from "tslib"; | ||
import { html, LitElement, isServer, nothing } from 'lit'; | ||
import { html as staticHtml, literal } from 'lit/static-html.js'; | ||
import { property } from 'lit/decorators.js'; | ||
@@ -82,2 +83,9 @@ import { dispatchActivationClick, isActivationClick, } from '@material/web/internal/controller/events.js'; | ||
}; | ||
this.tags = { | ||
elevated: literal `md-elevated-button`, | ||
filled: literal `md-filled-button`, | ||
'filled-tonal': literal `md-filled-tonal-button`, | ||
outlined: literal `md-outlined-button`, | ||
text: literal `md-text-button`, | ||
}; | ||
if (!isServer) { | ||
@@ -88,79 +96,17 @@ this.addEventListener('click', this.handleActivationClick); | ||
render() { | ||
let comp; | ||
if (this.appearance === 'elevated') { | ||
comp = html `<md-elevated-button | ||
?disabled=${this.disabled} | ||
target=${ifDefined(this.target)} | ||
href=${ifDefined(this.href)} | ||
?trailing-icon=${this.trailingIcon} | ||
?has-icon=${this.hasIcon} | ||
value="${this.value}" | ||
type=${this.type} | ||
class="md-button" | ||
> | ||
<slot></slot> | ||
${this.hasIcon ? html `<slot slot="icon" name="icon"></slot>` : nothing} | ||
</md-elevated-button>`; | ||
} | ||
else if (this.appearance === 'filled') { | ||
comp = html `<md-filled-button | ||
?disabled=${this.disabled} | ||
target=${ifDefined(this.target)} | ||
href=${ifDefined(this.href)} | ||
?trailing-icon=${this.trailingIcon} | ||
?has-icon=${this.hasIcon} | ||
value="${this.value}" | ||
type=${this.type} | ||
class="md-button" | ||
> | ||
<slot></slot> | ||
${this.hasIcon ? html `<slot slot="icon" name="icon"></slot>` : nothing} | ||
</md-filled-button>`; | ||
} | ||
else if (this.appearance === 'filled-tonal') { | ||
comp = html `<md-filled-tonal-button | ||
?disabled=${this.disabled} | ||
target=${ifDefined(this.target)} | ||
href=${ifDefined(this.href)} | ||
?trailing-icon=${this.trailingIcon} | ||
?has-icon=${this.hasIcon} | ||
value="${this.value}" | ||
type=${this.type} | ||
class="md-button" | ||
> | ||
<slot></slot> | ||
${this.hasIcon ? html `<slot slot="icon" name="icon"></slot>` : nothing} | ||
</md-filled-tonal-button>`; | ||
} | ||
else if (this.appearance === 'outlined') { | ||
comp = html `<md-outlined-button | ||
?disabled=${this.disabled} | ||
target=${ifDefined(this.target)} | ||
href=${ifDefined(this.href)} | ||
?trailing-icon=${this.trailingIcon} | ||
?has-icon=${this.hasIcon} | ||
value="${this.value}" | ||
type=${this.type} | ||
class="md-button" | ||
> | ||
<slot></slot> | ||
${this.hasIcon ? html `<slot slot="icon" name="icon"></slot>` : nothing} | ||
</md-outlined-button>`; | ||
} | ||
else if (this.appearance === 'text') { | ||
comp = html `<md-text-button | ||
?disabled=${this.disabled} | ||
target=${ifDefined(this.target)} | ||
href=${ifDefined(this.href)} | ||
?trailing-icon=${this.trailingIcon} | ||
?has-icon=${this.hasIcon} | ||
value="${this.value}" | ||
type=${this.type} | ||
class="md-button" | ||
> | ||
<slot></slot> | ||
${this.hasIcon ? html `<slot slot="icon" name="icon"></slot>` : nothing} | ||
</md-text-button>`; | ||
} | ||
return html `${comp}`; | ||
var _b; | ||
const tag = ((_b = this.tags) === null || _b === void 0 ? void 0 : _b[this.appearance]) || this.tags.outlined; | ||
return staticHtml `<${tag} | ||
?disabled=${this.disabled} | ||
target=${ifDefined(this.target)} | ||
href=${ifDefined(this.href)} | ||
?trailing-icon=${this.trailingIcon} | ||
?has-icon=${this.hasIcon} | ||
value="${this.value}" | ||
type=${this.type} | ||
class="md-button" | ||
> | ||
<slot></slot> | ||
${this.hasIcon ? html `<slot slot="icon" name="icon"></slot>` : nothing} | ||
</${tag}>`; | ||
} | ||
@@ -167,0 +113,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"author": "Digital Realty", | ||
"version": "3.2.7", | ||
"version": "3.2.8", | ||
"type": "module", | ||
@@ -30,6 +30,5 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@lit-labs/react": "^2.0.3", | ||
"@material/web": "^1.0.0-pre.16", | ||
"i18next": "^23.3.0", | ||
"lit": "^2.7.6", | ||
"@lit-labs/react": "^2.1.0", | ||
"@material/web": "^1.0.0", | ||
"lit": "^2.0.2", | ||
"react": "^18.2.0" | ||
@@ -108,3 +107,3 @@ }, | ||
], | ||
"gitHead": "f487170ac27de967505c921dabf983d2a122e625" | ||
"gitHead": "d57dedc86cbf4e58a5f01445702dc5f540317d00" | ||
} |
Sorry, the diff of this file is not supported yet
4
21517
224
- Removedi18next@^23.3.0
- Removed@babel/runtime@7.26.9(transitive)
- Removedi18next@23.16.8(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
Updated@lit-labs/react@^2.1.0
Updated@material/web@^1.0.0
Updatedlit@^2.0.2