@digital-realty/ix-button
Advanced tools
Comparing version 3.2.4 to 3.2.5
import { css } from 'lit'; | ||
export const IxButtonStyles = css ` | ||
:host { | ||
font-family: var(--ix-button-font-family, 'Museo-300', Arial, sans-serif); | ||
} | ||
button { | ||
font-family: var(--ix-button-font-family, 'Museo-300', Arial, sans-serif); | ||
} | ||
`; | ||
export const IxButtonStyles = css ``; | ||
//# sourceMappingURL=ix-button-styles.js.map |
@@ -33,2 +33,3 @@ import { LitElement } from 'lit'; | ||
hasIcon: boolean; | ||
icon: string; | ||
text: string; | ||
@@ -38,3 +39,4 @@ type: 'button' | 'submit' | 'reset'; | ||
onClick: (event: MouseEvent) => void; | ||
private renderContent; | ||
render(): import("lit-html").TemplateResult<1>; | ||
} |
import { __decorate } from "tslib"; | ||
import { html, LitElement } from 'lit'; | ||
import { html, LitElement, nothing } from 'lit'; | ||
import { property } from 'lit/decorators.js'; | ||
@@ -36,2 +36,3 @@ import '@material/web/button/text-button.js'; | ||
this.hasIcon = false; | ||
this.icon = ''; | ||
this.text = 'Submit'; | ||
@@ -45,2 +46,8 @@ this.type = 'button'; | ||
} | ||
renderContent() { | ||
const icon = html `<md-icon slot="icon">${this.icon}</md-icon>`; | ||
this.trailingIcon = true; | ||
return html ` ${this.trailingIcon ? icon : nothing} ${this.text} | ||
${this.trailingIcon ? nothing : icon}`; | ||
} | ||
render() { | ||
@@ -54,7 +61,9 @@ let comp; | ||
.href=${this.href} | ||
.trailingIcon=${this.trailingIcon} | ||
.hasIcon=${this.hasIcon} | ||
.value="${this.text}" | ||
>${this.text}</md-elevated-button | ||
>`; | ||
.value=${this.text} | ||
.icon=${this.icon} | ||
?has-icon=${this.hasIcon} | ||
?trailing-icon=${this.trailingIcon} | ||
> | ||
${this.hasIcon ? this.renderContent() : this.text} | ||
</md-elevated-button>`; | ||
} | ||
@@ -67,7 +76,9 @@ else if (this.appearance === 'filled') { | ||
.href=${this.href} | ||
.trailingIcon=${this.trailingIcon} | ||
.hasIcon=${this.hasIcon} | ||
.value="${this.text}" | ||
>${this.text}</md-filled-button | ||
>`; | ||
.value=${this.text} | ||
.icon=${this.icon} | ||
?has-icon=${this.hasIcon} | ||
?trailing-icon=${this.trailingIcon} | ||
> | ||
${this.hasIcon ? this.renderContent() : this.text} | ||
</md-filled-button>`; | ||
} | ||
@@ -80,7 +91,9 @@ else if (this.appearance === 'filled-tonal') { | ||
.href=${this.href} | ||
.trailingIcon=${this.trailingIcon} | ||
.hasIcon=${this.hasIcon} | ||
.value="${this.text}" | ||
>${this.text}</md-filled-tonal-button | ||
>`; | ||
.value=${this.text} | ||
.icon=${this.icon} | ||
?has-icon=${this.hasIcon} | ||
?trailing-icon=${this.trailingIcon} | ||
> | ||
${this.hasIcon ? this.renderContent() : this.text} | ||
</md-filled-tonal-button>`; | ||
} | ||
@@ -93,7 +106,9 @@ else if (this.appearance === 'outlined') { | ||
.href=${this.href} | ||
.trailingIcon=${this.trailingIcon} | ||
.hasIcon=${this.hasIcon} | ||
.value="${this.text}" | ||
>${this.text}</md-outlined-button | ||
>`; | ||
.value=${this.text} | ||
.icon=${this.icon} | ||
?has-icon=${this.hasIcon} | ||
?trailing-icon=${this.trailingIcon} | ||
> | ||
${this.hasIcon ? this.renderContent() : this.text} | ||
</md-outlined-button>`; | ||
} | ||
@@ -106,7 +121,9 @@ else if (this.appearance === 'text') { | ||
.href=${this.href} | ||
.trailingIcon=${this.trailingIcon} | ||
.hasIcon=${this.hasIcon} | ||
.value="${this.text}" | ||
>${this.text}</md-text-button | ||
>`; | ||
.value=${this.text} | ||
.icon=${this.icon} | ||
?has-icon=${this.hasIcon} | ||
?trailing-icon=${this.trailingIcon} | ||
> | ||
${this.hasIcon ? this.renderContent() : this.text} | ||
</md-text-button>`; | ||
} | ||
@@ -133,2 +150,5 @@ return html `${comp}`; | ||
property() | ||
], IxButton.prototype, "icon", void 0); | ||
__decorate([ | ||
property() | ||
], IxButton.prototype, "text", void 0); | ||
@@ -135,0 +155,0 @@ __decorate([ |
@@ -6,3 +6,3 @@ { | ||
"author": "Digital Realty", | ||
"version": "3.2.4", | ||
"version": "3.2.5", | ||
"type": "module", | ||
@@ -104,3 +104,3 @@ "main": "dist/index.js", | ||
], | ||
"gitHead": "1e8e36ae0147d1fb0037ba85c727e3a30daebbc9" | ||
"gitHead": "8b801892bdb92ec0c653961b76f4a144cc35a4f1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21645
219