Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

829 - Number as string bug #837

Merged
merged 4 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 50 additions & 13 deletions packages/js-example-app/src/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ <h2>Vanilla JS Example Application</h2>
iconPosition="leading"
icon="blr360"
buttonId="button-id"
loadingStatus="Loading"
></blr-text-button>
<button id="toggleLoadingState">Toggle Loading State</button>
<button id="toggleDisabledState">Toggle Disabled State</button>
Expand Down Expand Up @@ -53,6 +52,29 @@ <h2>Vanilla JS Example Application</h2>
<blr-text-input placeholder="Enter text..." value="" hintText="Hint"></blr-text-input>
</div>

<div class="component">
<p>Number Input</p>
<blr-number-input
value="1000"
size="md"
steppervariant="vertical"
placeholder="Placeholder-text"
fractiondigits="10"
totaldigits="10"
prependunit="true"
unit="kg"
step="1"
haslabel="true"
label="Label-text"
labelappendix="(Appendix)"
numberinputid="test-id"
theme="Light"
name="NumberInput"
decimals="10"
leadingzeros="3"
></blr-number-input>
</div>

<div class="component">
<p>Textarea</p>
<blr-textarea
Expand All @@ -68,6 +90,21 @@ <h2>Vanilla JS Example Application</h2>
></blr-textarea>
</div>

<div class="component">
<p>Tooltip</p>

<blr-tooltip
theme="Light"
placement="top"
elevation="true"
hasarrow="true"
offset="20"
message="Message-text"
>
<blr-text-button theme="Light" variant="secondary" size="md" label="Hover me"></blr-text-button>
</blr-tooltip>
</div>

<div class="component">
<p>Radio Input</p>
<blr-radio size="md"></blr-radio>
Expand All @@ -84,18 +121,18 @@ <h2>Vanilla JS Example Application</h2>
tabContent="labelAndIcon"
iconPosition="leading"
alignment="left"
><p disabled label="Tab 1" icon="blr360">Tab 1</p>
<p label="Tab 2" icon="blrInfo">Tab 2</p>
<p label="Tab 3" icon="blrCrop">Tab 3</p>
<p label="Tab 4" icon="blrDocumentNew">Tab 4</p>
<p label="Tab 5" icon="blrDocumentTwo">Tab 5</p>
<p label="Tab 6" icon="blrDownload">Tab 6</p>
<p label="Tab 7" icon="blrHeart">Tab 7</p>
<p label="Tab 8" icon="blrHome">Tab 8</p>
<p label="Tab 9" icon="blrLockClosed">Tab 9</p>
<p label="Tab 10" icon="blrMusic">Tab 10</p>
<p label="Tab 11" icon="blrPen">Tab 11</p>
</blr-tab-bar>
><p disabled label="Tab 1" icon="blr360">Tab 1</p>
<p label="Tab 2" icon="blrInfo">Tab 2</p>
<p label="Tab 3" icon="blrCrop">Tab 3</p>
<p label="Tab 4" icon="blrDocumentNew">Tab 4</p>
<p label="Tab 5" icon="blrDocumentTwo">Tab 5</p>
<p label="Tab 6" icon="blrDownload">Tab 6</p>
<p label="Tab 7" icon="blrHeart">Tab 7</p>
<p label="Tab 8" icon="blrHome">Tab 8</p>
<p label="Tab 9" icon="blrLockClosed">Tab 9</p>
<p label="Tab 10" icon="blrMusic">Tab 10</p>
<p label="Tab 11" icon="blrPen">Tab 11</p>
</blr-tab-bar>
</div>
</div>

Expand Down
123 changes: 63 additions & 60 deletions packages/js-example-app/src/prod-assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,24 @@ <h2>Vanilla JS Example Application</h2>
iconPosition="leading"
icon="blr360"
buttonId="button-id"
loadingStatus="Loading"
></blr-text-button>
<button id="toggleLoadingState">Toggle Loading State</button>
<button id="toggleDisabledState">Toggle Disabled State</button>
</div>

<div class="component">
<p>Select</p>
<blr-select label="Boiler Select Component">
<option value="" label="--Please choose an option--"></option>
<option value="option1" label="Option 1"></option>
<option value="option2" label="Option 2"></option>
<option value="option3" label="Option 3"></option>
<option value="option4" label="Option 4"></option>
<option value="option5" label="Option 5"></option>
<option value="option6" label="Option 6"></option>
</blr-select>
</div>

<div class="component">
<p>Checkbox</p>
<blr-checkbox hasLabel="true" label="Please check" checkInputId="Test123"></blr-checkbox>
Expand All @@ -40,6 +52,29 @@ <h2>Vanilla JS Example Application</h2>
<blr-text-input placeholder="Enter text..." value="" hintText="Hint"></blr-text-input>
</div>

<div class="component">
<p>Number Input</p>
<blr-number-input
value="1000"
size="md"
steppervariant="vertical"
placeholder="Placeholder-text"
fractiondigits="10"
totaldigits="10"
prependunit="true"
unit="kg"
step="1"
haslabel="true"
label="Label-text"
labelappendix="(Appendix)"
numberinputid="test-id"
theme="Light"
name="NumberInput"
decimals="10"
leadingzeros="3"
></blr-number-input>
</div>

<div class="component">
<p>Textarea</p>
<blr-textarea
Expand All @@ -55,6 +90,21 @@ <h2>Vanilla JS Example Application</h2>
></blr-textarea>
</div>

<div class="component">
<p>Tooltip</p>

<blr-tooltip
theme="Light"
placement="top"
elevation="true"
hasarrow="true"
offset="20"
message="Message-text"
>
<blr-text-button theme="Light" variant="secondary" size="md" label="Hover me"></blr-text-button>
</blr-tooltip>
</div>

<div class="component">
<p>Radio Input</p>
<blr-radio size="md"></blr-radio>
Expand All @@ -63,64 +113,6 @@ <h2>Vanilla JS Example Application</h2>
<div class="component">
<p>Tab Bar</p>
<blr-tab-bar
tabs="[
{
label: 'Tab 1',
icon: 'blr360',
href: './',
disabled: true,
},
{
label: 'Tab 2',
icon: 'blrInfo',
href: './',
},
{
label: 'Tab 3',
icon: 'blrCrop',
href: './',
},
{
label: 'Tab 4',
icon: 'blrDocumentNew',
href: './',
},
{
label: 'Tab 5',
icon: 'blrDocumentTwo',
href: './',
},
{
label: 'Tab 6',
icon: 'blrDownload',
href: './',
},
{
label: 'Tab 7',
icon: 'blrHeart',
href: './',
},
{
label: 'Tab 8',
icon: 'blrHome',
href: './',
},
{
label: 'Tab 9',
icon: 'blrLockClosed',
href: './',
},
{
label: 'Tab 10',
icon: 'blrMusic',
href: './',
},
{
label: 'Tab 11',
icon: 'blrPen',
href: './',
},
]"
variant="standard"
overflowVariantStandard="buttons"
overflowVariantFullWidth="browserOverflow"
Expand All @@ -129,7 +121,18 @@ <h2>Vanilla JS Example Application</h2>
tabContent="labelAndIcon"
iconPosition="leading"
alignment="left"
></blr-tab-bar>
><p disabled label="Tab 1" icon="blr360">Tab 1</p>
<p label="Tab 2" icon="blrInfo">Tab 2</p>
<p label="Tab 3" icon="blrCrop">Tab 3</p>
<p label="Tab 4" icon="blrDocumentNew">Tab 4</p>
<p label="Tab 5" icon="blrDocumentTwo">Tab 5</p>
<p label="Tab 6" icon="blrDownload">Tab 6</p>
<p label="Tab 7" icon="blrHeart">Tab 7</p>
<p label="Tab 8" icon="blrHome">Tab 8</p>
<p label="Tab 9" icon="blrLockClosed">Tab 9</p>
<p label="Tab 10" icon="blrMusic">Tab 10</p>
<p label="Tab 11" icon="blrPen">Tab 11</p>
</blr-tab-bar>
</div>
</div>

Expand Down
6 changes: 5 additions & 1 deletion packages/ui-library/src/components/feedback/tooltip/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ export class BlrTooltip extends LitElement {
@property() hasArrow?: boolean = true;
@property() elevation?: boolean = false;
@property() placement?: PlacementType = 'top';
@property() offset?: number = 4;
@property() offset?: number | string = 4;

@state() protected visible = false;

protected _referenceElement: Element | undefined | null = null;
protected _tooltipElement: HTMLElement | null = null;

protected updated() {
if (typeof this.offset === 'string') {
this.offset = parseInt(this.offset);
}

const slot = this.renderRoot?.querySelector('slot');
this._referenceElement = slot?.assignedElements({ flatten: true })[0];

Expand Down
Loading