diff --git a/src/medblocks/boolean/checkbox.ts b/src/medblocks/boolean/checkbox.ts index 9e930b4..e8846be 100644 --- a/src/medblocks/boolean/checkbox.ts +++ b/src/medblocks/boolean/checkbox.ts @@ -8,6 +8,7 @@ export default class MbCheckBox extends EhrElement { @property({ type: Boolean }) data: boolean | undefined = undefined; @property({ type: Boolean, reflect: true }) disabled: boolean = false; @property({ type: Boolean, reflect: true }) required: boolean = false; + @property({ type: String, reflect: true }) id: string = 'checkbox'; _handleChange(e: CustomEvent) { const checkbox = e.target as SlCheckbox; @@ -27,6 +28,7 @@ export default class MbCheckBox extends EhrElement { `; } return html` ${this.textFallbackLabel}${this.searchTerm}`; @@ -368,6 +368,7 @@ export default abstract class MbSearchAbstract extends CodedTextElement { }} > html` this._handleInput(option)} diff --git a/src/medblocks/codedtext/buttons.ts b/src/medblocks/codedtext/buttons.ts index facae8f..0402997 100644 --- a/src/medblocks/codedtext/buttons.ts +++ b/src/medblocks/codedtext/buttons.ts @@ -13,6 +13,7 @@ import { property } from 'lit-element'; export default class CodedTextButtons extends CodedTextElement { @property({ type: Boolean, reflect: true }) required: boolean = false; @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: String, reflect: true }) id: string ='buttons'; /** @ignore */ static styles = css` .buttons { @@ -91,7 +92,7 @@ export default class CodedTextButtons extends CodedTextElement { ${this._options.map( option => html` this._handleInput(option)} diff --git a/src/medblocks/codedtext/select.ts b/src/medblocks/codedtext/select.ts index b8b7b30..12982e1 100644 --- a/src/medblocks/codedtext/select.ts +++ b/src/medblocks/codedtext/select.ts @@ -16,7 +16,9 @@ export default class MbSelect extends CodedTextElement { @property({ type: String }) terminology: string; @property({ type: Object }) data: CodedText | CodedText[] | undefined; - @property({ type: String, reflect: true }) placeholder: string; + @property({ type: String, reflect: true }) placeholder: string = 'Please select'; + + @property({ type: String, reflect: true }) id: string = 'select'; @property({ type: Boolean, reflect: true }) multiple: boolean = false; @@ -115,6 +117,7 @@ export default class MbSelect extends CodedTextElement { } return html` ${this._options.map( option => - html` + html` ${option.label} ` )} diff --git a/src/medblocks/count/count.ts b/src/medblocks/count/count.ts index 14e4806..9e8e398 100644 --- a/src/medblocks/count/count.ts +++ b/src/medblocks/count/count.ts @@ -15,6 +15,10 @@ export default class MbCount extends EhrElement { @property({ type: String }) label: string = ''; + @property({ type: String }) placeholder: string = ''; + + @property({ type: String }) id: string = 'count'; + @property({ type: Boolean, reflect: true }) required: boolean = false; @property({ type: Boolean, reflect: true }) disabled: boolean; @@ -42,11 +46,12 @@ export default class MbCount extends EhrElement { if (this.variant === 'text') { return html`
${this._label()} -

${this.data>=Number(this.min || 0) ? this.data : '-'}

+

${this.data >= Number(this.min || 0) ? this.data : '-'}

`; } return html` =Number(this.min || 0) ? this.data : ''} + value=${this.data >= Number(this.min || 0) ? this.data : ''} + placeholder=${this.placeholder} > `; } diff --git a/src/medblocks/datetime/date.ts b/src/medblocks/datetime/date.ts index e270d38..ffb25f7 100644 --- a/src/medblocks/datetime/date.ts +++ b/src/medblocks/datetime/date.ts @@ -12,7 +12,7 @@ export default class MbDateTime extends EhrElement { width: unset; } .placeholder::part(input) { - color: rgb(var(--sl-input-placeholder-color)); + color: var(--sl-input-placeholder-color); } `; @property({ type: String }) data: string | undefined; @@ -31,6 +31,9 @@ export default class MbDateTime extends EhrElement { @property({ type: Boolean, reflect: true }) disabled: boolean; + @property({ type: Boolean, reflect: true }) id: string = 'date'; + + @event('mb-input') _mbInput: EventEmitter; handleInput(e: CustomEvent) { @@ -90,6 +93,7 @@ export default class MbDateTime extends EhrElement { } return html` html``; } return html` html`${unit.label} html`${unit.label} html` this.handleClear(i)} diff --git a/src/medblocks/text/input.ts b/src/medblocks/text/input.ts index c70944b..775061c 100644 --- a/src/medblocks/text/input.ts +++ b/src/medblocks/text/input.ts @@ -39,6 +39,8 @@ export default class MbInput extends EhrElement { @property({ type: String }) label: string = ''; + @property({ type: String }) id: string = 'input'; + @property({ type: Boolean, reflect: true }) required: boolean = false; @property({ type: String, reflect: true }) type: string; @@ -89,6 +91,7 @@ export default class MbInput extends EhrElement { return this.textarea ? html` { @@ -67,6 +69,7 @@ export default class MbTextSelect extends EhrElement { } return html` ${this._options.map( option => - html`${option.label} ` )}