Skip to content

Commit

Permalink
hoist added as attribute for popup display
Browse files Browse the repository at this point in the history
  • Loading branch information
ATHULKNAIR committed Apr 20, 2024
1 parent 654fd4c commit 1601cd8
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/medblocks/codedtext/abstractSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export default abstract class MbSearchAbstract extends CodedTextElement {

@property({ type: Boolean, reflect: true }) required = false;

@property({ type: Boolean, reflect: true }) hoist: boolean = true;

@property({ type: Boolean, reflect: true }) fixfilters = false;

@property({ type: Boolean, reflect: true }) disabled: boolean;
Expand Down Expand Up @@ -368,7 +370,7 @@ export default abstract class MbSearchAbstract extends CodedTextElement {
return html`
<mb-dropdown
.containingElement=${this}
.hoist=${true}
.hoist=${this.hoist}
.open=${true}
.focusKeys=${['Enter']}
.typeToSelect=${false}
Expand Down
4 changes: 3 additions & 1 deletion src/medblocks/codedtext/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default class MbSelect extends CodedTextElement {

@property({ type: Boolean, reflect: true }) required: boolean = false;

@property({ type: Boolean, reflect: true }) hoist: boolean = true;

@property({ type: Boolean, reflect: true }) disabled: boolean;

@state() _options: MbOption[] = [];
Expand Down Expand Up @@ -134,7 +136,7 @@ export default class MbSelect extends CodedTextElement {
this.data = undefined;
this._mbInput.emit();
}}
.hoist=${true}
.hoist=${this.hoist}
.value=${this.getValue(this.data)}
>
${this._options.map(
Expand Down
4 changes: 3 additions & 1 deletion src/medblocks/proportion/MbProportion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export default abstract class MbProportion extends EhrElement {

@property({ type: Boolean, reflect: true }) required: boolean = false;

@property({ type: Boolean, reflect: true }) hoist: boolean = true;

@property({ type: String, reflect: true }) step: string;

@property({ type: Boolean, reflect: true }) disabled: boolean;
Expand Down Expand Up @@ -125,7 +127,7 @@ export default abstract class MbProportion extends EhrElement {
style="${this.hideunit ? 'display: none' : ''}"
placeholder="Select units"
class="no-icon"
.hoist=${true}
.hoist=${this.hoist}
value="unit"
.size=${this.variant === 'small' ? 'small' : 'medium'}
disabled
Expand Down
4 changes: 3 additions & 1 deletion src/medblocks/quantity/QuantityLike.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export default abstract class QuantityLike extends EhrElement {
/** Hides the units. Make sure to set a default unit, or set it programatically. */
@property({ type: Boolean, reflect: true }) hideunit: boolean = false;

@property({ type: Boolean, reflect: true }) hoist: boolean = true;

@property({ type: Boolean, reflect: true }) disabled: boolean;

@property({ type: Number, reflect: true }) step: number;
Expand Down Expand Up @@ -187,7 +189,7 @@ export default abstract class QuantityLike extends EhrElement {
class="${this._disabled() || this.hideicon ? 'no-icon' : ''}"
style="${this.hideunit ? 'display: none' : ''}"
placeholder="Select units"
.hoist=${true}
.hoist=${this.hoist}
.value=${this.displayUnit}
.size=${this.variant === 'small' ? 'small' : 'medium'}
@sl-change=${this.handleInput}
Expand Down
4 changes: 3 additions & 1 deletion src/medblocks/quantity/quantity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export default class MbQuantity extends QuantityElement {
/** Hides the units. Make sure to set a default unit, or set it programatically. */
@property({ type: Boolean, reflect: true }) hideunit: boolean = false;

@property({ type: Boolean, reflect: true }) hoist: boolean = true;

@property({ type: Boolean, reflect: true }) disabled: boolean;

@property({ type: Number, reflect: true }) step: number;
Expand Down Expand Up @@ -185,7 +187,7 @@ export default class MbQuantity extends QuantityElement {
class="${this._disabled() || this.hideicon ? 'no-icon' : ''}"
style="${this.hideunit ? 'display: none' : ''}"
placeholder="Select units"
.hoist=${true}
.hoist=${this.hoist}
.value=${this.displayUnit}
.size=${this.variant === 'small' ? 'small' : 'medium'}
@sl-change=${this.handleInput}
Expand Down
2 changes: 1 addition & 1 deletion src/medblocks/text/input-multiple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default class MbInputMultiple extends EhrElement {
</sl-icon>`}
</sl-input>
<div>
${this.data.map(
${this.data?.map(
(s, i) =>
html`<sl-tag
id=${`${this.id}_tag${i}`}
Expand Down
5 changes: 4 additions & 1 deletion src/medblocks/text/text-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export default class MbTextSelect extends EhrElement {

@property({ type: Boolean, reflect: true }) required: boolean = false;

@property({ type: Boolean, reflect: true }) hoist: boolean = true;

@property({ type: String, reflect: true }) placeholder: string;

@property({ type: String, reflect: true }) id: string = 'text_select';
Expand Down Expand Up @@ -69,6 +71,7 @@ export default class MbTextSelect extends EhrElement {
</div> `;
}
return html`
${this.hoist}
<sl-select
id=${this.id}
exportparts="menu"
Expand All @@ -84,7 +87,7 @@ export default class MbTextSelect extends EhrElement {
this.data = undefined;
this._mbInput.emit();
}}
.hoist=${true}
.hoist=${this.hoist}
.value=${this.data || ''}
>
${this._options.map(
Expand Down

0 comments on commit 1601cd8

Please sign in to comment.