fix(core): update
This commit is contained in:
parent
b8c231fc61
commit
4eb1abaa39
@ -19,7 +19,7 @@ declare global {
|
||||
|
||||
@customElement('dees-button')
|
||||
export class DeesButton extends DeesElement {
|
||||
public static demo = () => html`<dees-button></dees-button>`;
|
||||
public static demo = () => html`<dees-button>This is a slotted Text</dees-button>`;
|
||||
|
||||
@property()
|
||||
public text: string;
|
||||
|
@ -1,4 +1,11 @@
|
||||
import { customElement, html, DeesElement, css, cssManager, property } from '@designestate/dees-element';
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
DeesElement,
|
||||
css,
|
||||
cssManager,
|
||||
property,
|
||||
} from '@designestate/dees-element';
|
||||
import { DeesForm } from './dees-form';
|
||||
|
||||
declare global {
|
||||
@ -9,15 +16,15 @@ declare global {
|
||||
|
||||
@customElement('dees-form-submit')
|
||||
export class DeesFormSubmit extends DeesElement {
|
||||
public static demo = () => html`<dees-form-submit></dees-form-submit>`;
|
||||
public static demo = () => html`<dees-form-submit>This is a sloted text</dees-form-submit>`;
|
||||
|
||||
@property({
|
||||
type: Boolean
|
||||
type: Boolean,
|
||||
})
|
||||
public disabled = false;
|
||||
|
||||
@property({
|
||||
type: String
|
||||
type: String,
|
||||
})
|
||||
public text: string;
|
||||
|
||||
@ -28,11 +35,15 @@ export class DeesFormSubmit extends DeesElement {
|
||||
public static styles = [cssManager.defaultStyles, css``];
|
||||
|
||||
public render() {
|
||||
return html`<dees-button @click="${this.submit}" .disabled="${this.disabled}">${this.text ? this.text : html`<slot></slot>`}</dees-button> `;
|
||||
return html`
|
||||
<dees-button @click="${this.submit}" .disabled="${this.disabled}">
|
||||
${this.text ? this.text : html`<slot></slot>`}
|
||||
</dees-button>
|
||||
`;
|
||||
}
|
||||
|
||||
public async submit() {
|
||||
if(this.disabled) {
|
||||
if (this.disabled) {
|
||||
return;
|
||||
}
|
||||
const parentElement: DeesForm = this.parentElement as DeesForm;
|
||||
|
Loading…
Reference in New Issue
Block a user