Skip to content

Commit

Permalink
bug fixes in print view duration
Browse files Browse the repository at this point in the history
  • Loading branch information
ATHULKNAIR committed Jul 4, 2022
1 parent c9d94c7 commit ebbcba6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions src/medblocks/duration/duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import EhrElement from '../EhrElement';
@customElement('mb-duration')
export default class MbDuration extends EhrElement {
static styles = css`
div {
.duration {
display: flex;
gap: 10px;
}
Expand All @@ -31,11 +31,10 @@ export default class MbDuration extends EhrElement {
margin: 0px;
padding: 2px;
}
sl-input {
.label {
display: none;
}
.label {
.duration{
display: none;
}
}
Expand Down Expand Up @@ -112,9 +111,6 @@ export default class MbDuration extends EhrElement {
this._mbInput.emit();
}

getDate(value: string | undefined) {
return value?.replace(/[^0-9]/g, '');
}

formatDuration(value: string): string {
return value.charAt(0).toUpperCase() + value.slice(1) + 's';
Expand Down Expand Up @@ -162,8 +158,8 @@ export default class MbDuration extends EhrElement {
${this.label
? html`<label part="label" class="label">${this.label}</label>`
: null}
<div>${this.getInputs()}</div>
<p class="print-only">${this.getDate(this.data) || '-'}</p>
<div class="duration">${this.getInputs()}</div>
<p class="print-only">${this._state.day || '-'}</p>
`;
}
}
2 changes: 1 addition & 1 deletion src/medblocks/quantity/quantity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default class MbQuantity extends QuantityElement {
)}
</sl-select>
<slot style="display: none" @slotchange=${this.handleChildChange}></slot>
<p class="print-only">${this.data?.magnitude || '-'} ${this.data?.unit || "-"}</p>
<p class="print-only">${this.data?.magnitude || '-'}</p>
`;
}
}

0 comments on commit ebbcba6

Please sign in to comment.