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