- @if (alert()) {
-
- } @if (rightActions()) { @for (action of rightActions()!; track $index) {
- } }
+ }
+ @if (inputSearch()) {
+
+
+
+
+ }
+
+
+ @if (alert()) {
+
+ }
+ @if (rightActions()) {
+ @for (action of rightActions()!; track $index) {
+
+
+ }
+ }
@if (ionPopConfirmDesc()) {
-
- {{ ionPopConfirmDesc() }}
-
+
+ {{ ionPopConfirmDesc() }}
+
}
diff --git a/projects/ion/src/lib/popconfirm/popconfirm.component.ts b/projects/ion/src/lib/popconfirm/popconfirm.component.ts
index 2b8d0f4bb..86a58eb86 100644
--- a/projects/ion/src/lib/popconfirm/popconfirm.component.ts
+++ b/projects/ion/src/lib/popconfirm/popconfirm.component.ts
@@ -7,11 +7,7 @@ import { IonIconComponent } from '../icon/icon.component';
@Component({
selector: 'ion-popconfirm',
- imports: [
- IonIconComponent,
- IonButtonComponent,
- IonDividerComponent
-],
+ imports: [IonIconComponent, IonButtonComponent, IonDividerComponent],
templateUrl: './popconfirm.component.html',
styleUrls: ['./popconfirm.component.scss'],
exportAs: 'IonPopConfirmComponent',
@@ -43,7 +39,7 @@ export class IonPopConfirmComponent {
type: 'close-solid',
color: '#d6293a',
},
- }
+ };
iconColorAndType = computed(() => {
return this.iconConfig[this.ionPopConfirmType()];
diff --git a/projects/ion/src/lib/popconfirm/popconfirm.directive.spec.ts b/projects/ion/src/lib/popconfirm/popconfirm.directive.spec.ts
index a0d2b758e..e7a006aaf 100644
--- a/projects/ion/src/lib/popconfirm/popconfirm.directive.spec.ts
+++ b/projects/ion/src/lib/popconfirm/popconfirm.directive.spec.ts
@@ -174,7 +174,7 @@ describe('Directive: Popconfirm', () => {
fixture.detectChanges();
const directiveEl = fixture.debugElement.query(
- By.directive(IonPopConfirmDirective)
+ By.directive(IonPopConfirmDirective),
);
directive = directiveEl.injector.get(IonPopConfirmDirective);
});
@@ -230,7 +230,7 @@ describe('Directive: Popconfirm', () => {
directive.open();
fixture.detectChanges();
fireEvent.click(
- within(screen.getByTestId('pop-confirm-btn')).getByRole('button')
+ within(screen.getByTestId('pop-confirm-btn')).getByRole('button'),
);
fixture.detectChanges();
expect(screen.queryByTestId('pop-confirm-btn')).not.toBeInTheDocument();
@@ -263,7 +263,7 @@ describe('Popconfirm host tests', () => {
fixture.detectChanges();
const directiveEl = fixture.debugElement.query(
- By.directive(IonPopConfirmDirective)
+ By.directive(IonPopConfirmDirective),
);
directive = directiveEl.injector.get(IonPopConfirmDirective);
input = fixture.debugElement.query(By.directive(IonPopConfirmDirective));
@@ -303,11 +303,11 @@ describe('Popconfirm disabled host component', () => {
fixtureDisabledBtn.detectChanges();
const directiveEl = fixtureDisabledBtn.debugElement.query(
- By.directive(IonPopConfirmDirective)
+ By.directive(IonPopConfirmDirective),
);
directive = directiveEl.injector.get(IonPopConfirmDirective);
input = fixtureDisabledBtn.debugElement.query(
- By.directive(IonPopConfirmDirective)
+ By.directive(IonPopConfirmDirective),
);
});
@@ -361,11 +361,11 @@ describe('Popconfirm loading host component', () => {
fixtureLoadingBtn.detectChanges();
const directiveEl = fixtureLoadingBtn.debugElement.query(
- By.directive(IonPopConfirmDirective)
+ By.directive(IonPopConfirmDirective),
);
directive = directiveEl.injector.get(IonPopConfirmDirective);
input = fixtureLoadingBtn.debugElement.query(
- By.directive(IonPopConfirmDirective)
+ By.directive(IonPopConfirmDirective),
);
});
@@ -402,7 +402,7 @@ describe('Popconfirm position when it opens', () => {
fixtureTable.detectChanges();
const directiveEl = fixtureTable.debugElement.query(
- By.directive(IonPopConfirmDirective)
+ By.directive(IonPopConfirmDirective),
);
directive = directiveEl.injector.get(IonPopConfirmDirective);
@@ -420,7 +420,7 @@ describe('Popconfirm position when it opens', () => {
const position: PopOffset = directive.setPosition(
popconfirmElement,
documentWidth,
- elementPosition
+ elementPosition,
);
expect(position.left).toBe(openToRightOffset.left);
});
@@ -428,7 +428,7 @@ describe('Popconfirm position when it opens', () => {
it('should open to the right side', () => {
jest.spyOn(window, 'requestAnimationFrame');
const popconfirmElement = document.body.querySelector(
- '.sup-container'
+ '.sup-container',
) as HTMLElement;
directive.setStyle(popconfirmElement, openToRightOffset);
expect(popconfirmElement).toHaveClass('warning');
@@ -437,7 +437,7 @@ describe('Popconfirm position when it opens', () => {
it('should open to the left side', async () => {
jest.spyOn(window, 'requestAnimationFrame');
const popconfirmElement = document.body.querySelector(
- '.sup-container'
+ '.sup-container',
) as HTMLElement;
directive.setStyle(popconfirmElement, openToLeftOffset);
expect(popconfirmElement.classList).toContain('sup-container-right');
@@ -448,7 +448,7 @@ describe('Popconfirm position when it opens', () => {
const position: PopOffset = directive.setPosition(
popconfirmElement,
documentWidth,
- openToUpOffset
+ openToUpOffset,
);
directive.setStyle(popconfirmElement, openToUpOffset);
@@ -492,7 +492,7 @@ describe('Popconfirm close on scroll', () => {
}
const sut = async (
- closeOnScroll = false
+ closeOnScroll = false,
): Promise
> => {
return await render(ScrollTestComponent, {
componentInputs: { closeOnScroll },
diff --git a/projects/ion/src/lib/popconfirm/popconfirm.directive.ts b/projects/ion/src/lib/popconfirm/popconfirm.directive.ts
index b71bf3364..2c95179fa 100644
--- a/projects/ion/src/lib/popconfirm/popconfirm.directive.ts
+++ b/projects/ion/src/lib/popconfirm/popconfirm.directive.ts
@@ -83,14 +83,14 @@ export class IonPopConfirmDirective implements OnDestroy {
if (this.componentRef) {
const isBottom = change.connectionPair.originY === 'top';
this.componentRef.instance.ionPopConfirmPosition.set(
- isBottom ? 'bottom' : ''
+ isBottom ? 'bottom' : '',
);
}
});
const portal = new ComponentPortal(
IonPopConfirmComponent,
- this.viewContainerRef
+ this.viewContainerRef,
);
this.componentRef = this.overlayRef.attach(portal);
@@ -174,7 +174,7 @@ export class IonPopConfirmDirective implements OnDestroy {
setPosition(
_element: HTMLElement,
_docWidth: number,
- _position: PopPosition
+ _position: PopPosition,
): PopOffset {
return {
top: _position.top,
@@ -189,7 +189,7 @@ export class IonPopConfirmDirective implements OnDestroy {
element.classList.remove(
'sup-container',
'sup-container-right',
- 'sup-container-bottom'
+ 'sup-container-bottom',
);
if (offset.left < 450) {
element.classList.add('sup-container-right');
diff --git a/projects/ion/src/lib/radio/radio.component.ts b/projects/ion/src/lib/radio/radio.component.ts
index 1644899c4..2df1475ea 100644
--- a/projects/ion/src/lib/radio/radio.component.ts
+++ b/projects/ion/src/lib/radio/radio.component.ts
@@ -1,4 +1,3 @@
-
import {
ChangeDetectionStrategy,
Component,
diff --git a/projects/ion/src/lib/select/select-bug-repro.spec.ts b/projects/ion/src/lib/select/select-bug-repro.spec.ts
index ac7c69bb4..d3d31c37d 100644
--- a/projects/ion/src/lib/select/select-bug-repro.spec.ts
+++ b/projects/ion/src/lib/select/select-bug-repro.spec.ts
@@ -18,20 +18,22 @@ describe('IonSelectComponent Bug Reproduction', () => {
fixture.componentRef.setInput('multiple', true);
fixture.componentRef.setInput('value', ['apple']);
fixture.detectChanges();
-
+
// Initial selection should be Apple
expect(fixture.componentInstance.dropdownSelectedItems()).toHaveLength(1);
- expect((fixture.componentInstance.dropdownSelectedItems()[0] as any).label).toBe('Apple');
+ expect(
+ (fixture.componentInstance.dropdownSelectedItems()[0] as any).label,
+ ).toBe('Apple');
// Change options (simulate search result)
- const newOptions = [
- { label: 'Banana', key: 'banana' },
- ];
+ const newOptions = [{ label: 'Banana', key: 'banana' }];
fixture.componentRef.setInput('options', newOptions);
fixture.detectChanges();
// Verification of the bug: Apple should still be in dropdownSelectedItems
expect(fixture.componentInstance.dropdownSelectedItems()).toHaveLength(1);
- expect((fixture.componentInstance.dropdownSelectedItems()[0] as any).label).toBe('Apple');
+ expect(
+ (fixture.componentInstance.dropdownSelectedItems()[0] as any).label,
+ ).toBe('Apple');
});
});
diff --git a/projects/ion/src/lib/select/select.component.html b/projects/ion/src/lib/select/select.component.html
index 1473c95d3..e030b9458 100644
--- a/projects/ion/src/lib/select/select.component.html
+++ b/projects/ion/src/lib/select/select.component.html
@@ -12,19 +12,19 @@
data-testid="ion-select"
>
@if (dropdownSelectedItems().length === 0) {
- {{ placeholder() }}
+ {{ placeholder() }}
} @else {
-
- @for (item of dropdownSelectedItems(); track $index) {
-
- }
-
+
+ @for (item of dropdownSelectedItems(); track $index) {
+
+ }
+
}
@if (showDropdown()) {
-
+
}
diff --git a/projects/ion/src/lib/select/select.component.ts b/projects/ion/src/lib/select/select.component.ts
index fa98e953b..4ffd4a9bb 100644
--- a/projects/ion/src/lib/select/select.component.ts
+++ b/projects/ion/src/lib/select/select.component.ts
@@ -18,11 +18,7 @@ import { IonChipComponent } from '../chip/chip.component';
@Component({
selector: 'ion-select',
standalone: true,
- imports: [
- IonIconComponent,
- IonDropdownComponent,
- IonChipComponent
-],
+ imports: [IonIconComponent, IonDropdownComponent, IonChipComponent],
templateUrl: './select.component.html',
styleUrls: ['./select.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
@@ -71,26 +67,26 @@ export class IonSelectComponent {
valueArray.some((val) =>
typeof val === 'object'
? (val as any)[prop] === (opt as any)[prop]
- : val === (opt as any)[prop]
- )
+ : val === (opt as any)[prop],
+ ),
);
// Preserve selected items that are in 'value' but NOT in current options
const currentSelected = untracked(() =>
- this.dropdownSelectedItems()
+ this.dropdownSelectedItems(),
);
const preservedSelected = currentSelected.filter(
(item: DropdownItem) => {
const itemNotInOptions = !options.some(
- (opt) => (opt as any)[prop] === (item as any)[prop]
+ (opt) => (opt as any)[prop] === (item as any)[prop],
);
const itemInValue = valueArray.some((val) =>
typeof val === 'object'
? (val as any)[prop] === (item as any)[prop]
- : val === (item as any)[prop]
+ : val === (item as any)[prop],
);
return itemNotInOptions && itemInValue;
- }
+ },
);
selected = [...presentSelected, ...preservedSelected];
@@ -99,30 +95,28 @@ export class IonSelectComponent {
options.forEach((opt) => {
opt.selected = selected.some(
- (s) => (s as any)[prop] === (opt as any)[prop]
+ (s) => (s as any)[prop] === (opt as any)[prop],
);
});
} else {
// Fallback to options marked as selected if no value input is provided
const selected = options.filter((option) => option.selected);
- const currentSelected = untracked(() =>
- this.dropdownSelectedItems()
- );
+ const currentSelected = untracked(() => this.dropdownSelectedItems());
// Only set if different to avoid redundant triggers
if (
selected.length !== currentSelected.length ||
!selected.every((s) =>
currentSelected.some(
- (cs: DropdownItem) => (cs as any)[prop] === (s as any)[prop]
- )
+ (cs: DropdownItem) => (cs as any)[prop] === (s as any)[prop],
+ ),
)
) {
this.dropdownSelectedItems.set(selected);
}
}
},
- { allowSignalWrites: true }
+ { allowSignalWrites: true },
);
// TODO: allowSignalWrites deprecated, update this
}
@@ -144,7 +138,7 @@ export class IonSelectComponent {
// Keep items that were selected but are NOT in the current options (e.g. filtered out by search)
const itemsNotInOptions = currentSelected.filter(
(item) =>
- !options.some((opt) => (opt as any)[prop] === (item as any)[prop])
+ !options.some((opt) => (opt as any)[prop] === (item as any)[prop]),
);
finalSelected = [...itemsNotInOptions, ...selectedItems];
}
diff --git a/projects/ion/src/lib/sidebar/sidebar-group/sidebar-group.component.spec.ts b/projects/ion/src/lib/sidebar/sidebar-group/sidebar-group.component.spec.ts
index 6d1e13185..02f3b1351 100644
--- a/projects/ion/src/lib/sidebar/sidebar-group/sidebar-group.component.spec.ts
+++ b/projects/ion/src/lib/sidebar/sidebar-group/sidebar-group.component.spec.ts
@@ -62,8 +62,9 @@ describe('IonSidebarGroupComponent', () => {
const component = fixture.componentInstance;
const emitSpy = jest.spyOn(component.atGroupClick, 'emit');
- const groupTitle = screen.getByTestId('sidebar-group__title-icon')
- .parentElement!; // The div wrapper has the click
+ const groupTitle = screen.getByTestId(
+ 'sidebar-group__title-icon',
+ ).parentElement!; // The div wrapper has the click
fireEvent.click(groupTitle);
expect(emitSpy).toHaveBeenCalledTimes(1);
diff --git a/projects/ion/src/lib/sidebar/sidebar-group/sidebar-group.component.ts b/projects/ion/src/lib/sidebar/sidebar-group/sidebar-group.component.ts
index d2d72d4fd..18078391a 100644
--- a/projects/ion/src/lib/sidebar/sidebar-group/sidebar-group.component.ts
+++ b/projects/ion/src/lib/sidebar/sidebar-group/sidebar-group.component.ts
@@ -1,4 +1,3 @@
-
import {
ChangeDetectionStrategy,
Component,
@@ -18,11 +17,7 @@ import { IonTooltipDirective } from '../../tooltip/tooltip.directive';
@Component({
selector: 'ion-sidebar-group',
standalone: true,
- imports: [
- IonIconComponent,
- IonSidebarItemComponent,
- IonTooltipDirective
-],
+ imports: [IonIconComponent, IonSidebarItemComponent, IonTooltipDirective],
templateUrl: './sidebar-group.component.html',
styleUrls: ['./sidebar-group.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
diff --git a/projects/ion/src/lib/sidebar/sidebar-item/sidebar-item.component.ts b/projects/ion/src/lib/sidebar/sidebar-item/sidebar-item.component.ts
index 501ff943d..b5fef17f4 100644
--- a/projects/ion/src/lib/sidebar/sidebar-item/sidebar-item.component.ts
+++ b/projects/ion/src/lib/sidebar/sidebar-item/sidebar-item.component.ts
@@ -1,4 +1,3 @@
-
import {
ChangeDetectionStrategy,
Component,
diff --git a/projects/ion/src/lib/sidebar/sidebar.component.html b/projects/ion/src/lib/sidebar/sidebar.component.html
index 5a527056a..c2b336a8d 100644
--- a/projects/ion/src/lib/sidebar/sidebar.component.html
+++ b/projects/ion/src/lib/sidebar/sidebar.component.html
@@ -6,70 +6,72 @@
data-testid="ion-sidebar"
>
@if (!keepShrunken()) {
-
+
}
@if (sidebarFooter()) {
-
+
}
@if (!shrinkMode()) {
-
+
}
diff --git a/projects/ion/src/lib/sidebar/sidebar.spec.ts b/projects/ion/src/lib/sidebar/sidebar.spec.ts
index 45c930189..d3d866433 100644
--- a/projects/ion/src/lib/sidebar/sidebar.spec.ts
+++ b/projects/ion/src/lib/sidebar/sidebar.spec.ts
@@ -49,7 +49,7 @@ describe('IonSidebarComponent', () => {
it('should toggle sidebar when toggle button is clicked', async () => {
const { fixture } = await sut();
const toggleBtn = fixture.debugElement.query(
- By.css('[data-testid="sidebar-toggle"]')
+ By.css('[data-testid="sidebar-toggle"]'),
);
toggleBtn.triggerEventHandler('ionOnClick', null);
fixture.detectChanges();
@@ -68,7 +68,7 @@ describe('IonSidebarComponent', () => {
// Open the sidebar
const { fixture } = await sut();
const toggleBtn = fixture.debugElement.query(
- By.css('[data-testid="sidebar-toggle"]')
+ By.css('[data-testid="sidebar-toggle"]'),
);
toggleBtn.triggerEventHandler('ionOnClick', null);
fixture.detectChanges();
@@ -90,7 +90,7 @@ describe('IonSidebarComponent', () => {
const emitSpy = jest.spyOn(component.ionOnSidebarToggle, 'emit');
const toggleBtn = fixture.debugElement.query(
- By.css('[data-testid="sidebar-toggle"]')
+ By.css('[data-testid="sidebar-toggle"]'),
);
toggleBtn.triggerEventHandler('ionOnClick', null);
fixture.detectChanges();
diff --git a/projects/ion/src/lib/simple-menu/simple-menu.component.ts b/projects/ion/src/lib/simple-menu/simple-menu.component.ts
index afdc522e6..d39e8293f 100644
--- a/projects/ion/src/lib/simple-menu/simple-menu.component.ts
+++ b/projects/ion/src/lib/simple-menu/simple-menu.component.ts
@@ -10,11 +10,7 @@ import { AvatarType } from '../core/types/avatar';
@Component({
selector: 'ion-simple-menu',
- imports: [
- IonAvatarComponent,
- IonButtonComponent,
- IonTabGroupComponent
-],
+ imports: [IonAvatarComponent, IonButtonComponent, IonTabGroupComponent],
templateUrl: './simple-menu.component.html',
styleUrls: ['./simple-menu.component.scss'],
})
diff --git a/projects/ion/src/lib/step/ion-step.component.spec.ts b/projects/ion/src/lib/step/ion-step.component.spec.ts
index 701ed9ce3..5c953494d 100644
--- a/projects/ion/src/lib/step/ion-step.component.spec.ts
+++ b/projects/ion/src/lib/step/ion-step.component.spec.ts
@@ -29,7 +29,7 @@ const defaultProps: StepConfig = {
};
const sut = async (
- customProps: Partial
= defaultProps
+ customProps: Partial = defaultProps,
): Promise> => {
return await render(IonStepsComponent, {
componentInputs: customProps,
@@ -43,14 +43,14 @@ describe('Static IonStepsComponent', () => {
it('should render step in horizontal direction by default', async () => {
await sut();
expect(screen.getByTestId('ion-steps')).toHaveClass(
- 'step-direction-horizontal'
+ 'step-direction-horizontal',
);
});
it('should render step in vertical direction', async () => {
await sut({ ...defaultProps, direction: 'vertical' });
expect(screen.getByTestId('ion-steps')).toHaveClass(
- 'step-direction-vertical'
+ 'step-direction-vertical',
);
});
@@ -59,7 +59,7 @@ describe('Static IonStepsComponent', () => {
async (label: string) => {
await sut();
expect(screen.getByText(label)).toBeTruthy();
- }
+ },
);
it('should render first checked', async () => {
@@ -80,7 +80,7 @@ describe('Static IonStepsComponent', () => {
});
expect(screen.getByTestId('step-1-checked')).toBeTruthy();
expect(screen.getByTestId('step-1-checked')).toHaveClass(
- StepStatus.CHECKED
+ StepStatus.CHECKED,
);
});
@@ -104,7 +104,7 @@ describe('Static IonStepsComponent', () => {
});
expect(screen.getByTestId('step-1-checked')).toBeTruthy();
expect(screen.getByTestId('step-1-checked')).toHaveClass(
- StepStatus.CHECKED
+ StepStatus.CHECKED,
);
expect(screen.getByTestId('step-2-error')).toBeTruthy();
expect(screen.getByTestId('step-2-error')).toHaveClass('error');
@@ -138,7 +138,7 @@ describe('Static IonStepsComponent', () => {
});
expect(screen.getByTestId(stepId)).toBeTruthy();
expect(screen.getByTestId(stepId)).toHaveClass(StepStatus.CHECKED);
- }
+ },
);
it('should go to step 3 when it be clicked', async () => {
diff --git a/projects/ion/src/lib/step/ion-step.component.ts b/projects/ion/src/lib/step/ion-step.component.ts
index 96894e4b0..a9393a3a3 100644
--- a/projects/ion/src/lib/step/ion-step.component.ts
+++ b/projects/ion/src/lib/step/ion-step.component.ts
@@ -49,7 +49,7 @@ export class IonStepsComponent {
const clampedIndex = Math.max(
this.FIRST_STEP,
- Math.min(currentIndex, processedSteps.length)
+ Math.min(currentIndex, processedSteps.length),
);
processedSteps = processedSteps.map((step) => {
diff --git a/projects/ion/src/lib/switch/switch.component.spec.ts b/projects/ion/src/lib/switch/switch.component.spec.ts
index 46a8cba07..5012450d8 100644
--- a/projects/ion/src/lib/switch/switch.component.spec.ts
+++ b/projects/ion/src/lib/switch/switch.component.spec.ts
@@ -17,7 +17,7 @@ const sut = async (
value: boolean;
size: SwitchSize;
disabled: boolean;
- }> = {}
+ }> = {},
): Promise => {
const { fixture } = await render(IonSwitchComponent, {
componentInputs: customProps,
diff --git a/projects/ion/src/lib/table/ion-table.component.html b/projects/ion/src/lib/table/ion-table.component.html
index c366bd2d9..0139e09eb 100644
--- a/projects/ion/src/lib/table/ion-table.component.html
+++ b/projects/ion/src/lib/table/ion-table.component.html
@@ -295,7 +295,6 @@
action.popover(row)['ionPopoverTrigger'] ||
PopoverTrigger.CLICK
"
-
(ionOnFirstAction)="
action.secondCall
? handleEvent(row, action.secondCall)
diff --git a/projects/ion/src/lib/tag/ion-tag.component.ts b/projects/ion/src/lib/tag/ion-tag.component.ts
index 6b7104209..1a2dd7c3a 100644
--- a/projects/ion/src/lib/tag/ion-tag.component.ts
+++ b/projects/ion/src/lib/tag/ion-tag.component.ts
@@ -1,4 +1,3 @@
-
import { Component, computed, input } from '@angular/core';
import { IonIconComponent } from '../icon/icon.component';
import { TagStatus } from '../core/types';
diff --git a/projects/ion/src/lib/tooltip/tooltip.component.ts b/projects/ion/src/lib/tooltip/tooltip.component.ts
index 50dac2f57..0959c7520 100644
--- a/projects/ion/src/lib/tooltip/tooltip.component.ts
+++ b/projects/ion/src/lib/tooltip/tooltip.component.ts
@@ -36,7 +36,7 @@ export class IonTooltipComponent implements AfterViewChecked {
constructor(
private cdr: ChangeDetectorRef,
- private tooltipService: TooltipService
+ private tooltipService: TooltipService,
) {}
ngAfterViewChecked(): void {
diff --git a/projects/ion/src/lib/tooltip/tooltip.directive.spec.ts b/projects/ion/src/lib/tooltip/tooltip.directive.spec.ts
index 3e3588aae..e0838e302 100644
--- a/projects/ion/src/lib/tooltip/tooltip.directive.spec.ts
+++ b/projects/ion/src/lib/tooltip/tooltip.directive.spec.ts
@@ -1,4 +1,3 @@
-
import { Component, input } from '@angular/core';
import { fireEvent, render, screen } from '@testing-library/angular';
@@ -113,9 +112,9 @@ describe('Directive: Tooltip', () => {
fireEvent.mouseEnter(screen.getByTestId('hostTooltip'));
const tooltipElement = screen.getByTestId('ion-tooltip');
expect(tooltipElement.className).toContain(
- `ion-tooltip-${ionTooltipColorScheme}`
+ `ion-tooltip-${ionTooltipColorScheme}`,
);
- }
+ },
);
it('should show tooltip after delay time setted', async () => {
@@ -143,7 +142,7 @@ describe('Directive: Tooltip', () => {
fireEvent.mouseEnter(screen.getByTestId('hostTooltip'));
const tooltipElement = screen.getByTestId('ion-tooltip');
expect(tooltipElement.className).toContain(
- `ion-tooltip-position--topCenter`
+ `ion-tooltip-position--topCenter`,
);
});
diff --git a/projects/ion/src/lib/tooltip/tooltip.directive.ts b/projects/ion/src/lib/tooltip/tooltip.directive.ts
index 9b279b425..945a2d585 100644
--- a/projects/ion/src/lib/tooltip/tooltip.directive.ts
+++ b/projects/ion/src/lib/tooltip/tooltip.directive.ts
@@ -54,7 +54,7 @@ export class IonTooltipDirective implements OnDestroy, OnInit {
private injector: Injector,
private elementRef: ElementRef,
private tooltipService: TooltipService,
- private environmentInjector: EnvironmentInjector
+ private environmentInjector: EnvironmentInjector,
) {
effect(() => {
if (this.componentRef) {
@@ -95,16 +95,16 @@ export class IonTooltipDirective implements OnDestroy, OnInit {
this.componentRef.setInput('ionTooltipTitle', this.ionTooltipTitle());
this.componentRef.setInput(
'ionTooltipTemplateRef',
- this.ionTooltipTemplateRef()
+ this.ionTooltipTemplateRef(),
);
this.componentRef.setInput(
'ionTooltipColorScheme',
- this.ionTooltipColorScheme()
+ this.ionTooltipColorScheme(),
);
this.componentRef.setInput('ionTooltipContext', this.ionTooltipContext());
this.componentRef.setInput(
'ionTooltipCustomClass',
- this.ionTooltipCustomClass()
+ this.ionTooltipCustomClass(),
);
}
}
@@ -119,7 +119,7 @@ export class IonTooltipDirective implements OnDestroy, OnInit {
this.delayTimeout = window.setTimeout(
this.showTooltip.bind(this),
- this.ionTooltipShowDelay()
+ this.ionTooltipShowDelay(),
);
this.setComponentPosition();
}
@@ -137,7 +137,7 @@ export class IonTooltipDirective implements OnDestroy, OnInit {
const positions = getPositions(
hostPositions,
- this.ionTooltipArrowPointAtCenter()
+ this.ionTooltipArrowPointAtCenter(),
);
const currentPosition = this.componentRef.instance.ionTooltipPosition();
diff --git a/projects/ion/src/lib/typography/heading/heading.component.html b/projects/ion/src/lib/typography/heading/heading.component.html
index 8b3527f24..42413376c 100644
--- a/projects/ion/src/lib/typography/heading/heading.component.html
+++ b/projects/ion/src/lib/typography/heading/heading.component.html
@@ -1,38 +1,21 @@
-
@switch (type()) {
@case ('h1') {
-
+
{{ text() }}
}
@case ('h2') {
-
+
{{ text() }}
}
@case ('h3') {
-
+
{{ text() }}
}
@case ('h4') {
-
+
{{ text() }}
}
diff --git a/projects/ion/src/lib/upload/upload.component.html b/projects/ion/src/lib/upload/upload.component.html
index 3477694d2..7b7464284 100644
--- a/projects/ion/src/lib/upload/upload.component.html
+++ b/projects/ion/src/lib/upload/upload.component.html
@@ -13,7 +13,9 @@
- {{ selectedFile()!.name }}
+ {{
+ selectedFile()!.name
+ }}
-
+ Importar de uma URL
{
describe('dropzone default state', () => {
it('should render the upload icon', () => {
- const icon = fixture.nativeElement.querySelector('ion-icon[type="upload"]');
+ const icon = fixture.nativeElement.querySelector(
+ 'ion-icon[type="upload"]',
+ );
expect(icon).toBeTruthy();
});
it('should render the click-to-add link text', () => {
- const link = fixture.nativeElement.querySelector('.upload-dropzone__link');
+ const link = fixture.nativeElement.querySelector(
+ '.upload-dropzone__link',
+ );
expect(link.textContent.trim()).toBe('Clique para adicionar');
});
it('should not render acceptLabel when not provided', () => {
- const hint = fixture.nativeElement.querySelector('.upload-dropzone__hint');
+ const hint = fixture.nativeElement.querySelector(
+ '.upload-dropzone__hint',
+ );
expect(hint).toBeNull();
});
it('should render acceptLabel when provided', () => {
fixture.componentRef.setInput('acceptLabel', 'PNG, JPG até 5MB');
fixture.detectChanges();
- const hint = fixture.nativeElement.querySelector('.upload-dropzone__hint');
+ const hint = fixture.nativeElement.querySelector(
+ '.upload-dropzone__hint',
+ );
expect(hint.textContent.trim()).toBe('PNG, JPG até 5MB');
});
});
@@ -95,7 +103,10 @@ describe('IonUploadComponent', () => {
const file = createFile();
const input = fixture.nativeElement.querySelector('input[type="file"]');
- Object.defineProperty(input, 'files', { value: [file], configurable: true });
+ Object.defineProperty(input, 'files', {
+ value: [file],
+ configurable: true,
+ });
input.dispatchEvent(new Event('change'));
expect(component.selectedFile()).toBe(file);
@@ -127,7 +138,9 @@ describe('IonUploadComponent', () => {
});
it('should show file name', () => {
- const fileName = fixture.nativeElement.querySelector('.upload-dropzone__file-name');
+ const fileName = fixture.nativeElement.querySelector(
+ '.upload-dropzone__file-name',
+ );
expect(fileName.textContent.trim()).toBe('documento.pdf');
});
@@ -137,7 +150,9 @@ describe('IonUploadComponent', () => {
});
it('should hide the default content when file is selected', () => {
- const content = fixture.nativeElement.querySelector('.upload-dropzone__content');
+ const content = fixture.nativeElement.querySelector(
+ '.upload-dropzone__content',
+ );
expect(content).toBeNull();
});
@@ -174,7 +189,9 @@ describe('IonUploadComponent', () => {
component.removeFile();
fixture.detectChanges();
- const content = fixture.nativeElement.querySelector('.upload-dropzone__content');
+ const content = fixture.nativeElement.querySelector(
+ '.upload-dropzone__content',
+ );
expect(content).toBeTruthy();
});
@@ -182,8 +199,13 @@ describe('IonUploadComponent', () => {
component.selectedFile.set(createFile());
fixture.detectChanges();
- const clickSpy = jest.spyOn(component.fileInputRef.nativeElement, 'click');
- const removeButton = fixture.nativeElement.querySelector('ion-button[icontype="trash"]');
+ const clickSpy = jest.spyOn(
+ component.fileInputRef.nativeElement,
+ 'click',
+ );
+ const removeButton = fixture.nativeElement.querySelector(
+ 'ion-button[icontype="trash"]',
+ );
removeButton.click();
fixture.detectChanges();
@@ -262,7 +284,10 @@ describe('IonUploadComponent', () => {
});
it('should not open file dialog when disabled', () => {
- const clickSpy = jest.spyOn(component.fileInputRef.nativeElement, 'click');
+ const clickSpy = jest.spyOn(
+ component.fileInputRef.nativeElement,
+ 'click',
+ );
component.openFileDialog();
expect(clickSpy).not.toHaveBeenCalled();
});
@@ -275,7 +300,10 @@ describe('IonUploadComponent', () => {
describe('openFileDialog', () => {
it('should trigger click on file input when not disabled', () => {
- const clickSpy = jest.spyOn(component.fileInputRef.nativeElement, 'click');
+ const clickSpy = jest.spyOn(
+ component.fileInputRef.nativeElement,
+ 'click',
+ );
component.openFileDialog();
expect(clickSpy).toHaveBeenCalled();
});
@@ -290,8 +318,7 @@ describe('IonUploadComponent', () => {
describe('upload-url-input element', () => {
const getUrlInputInstance = (f: ComponentFixture) =>
- f.debugElement
- .query(By.css('[data-testid="upload-url-input"]'))
+ f.debugElement.query(By.css('[data-testid="upload-url-input"]'))
.componentInstance as IonInputComponent;
beforeEach(() => {
@@ -300,14 +327,18 @@ describe('IonUploadComponent', () => {
});
it('should render the ion-input with data-testid="upload-url-input"', () => {
- const el = fixture.nativeElement.querySelector('[data-testid="upload-url-input"]');
+ const el = fixture.nativeElement.querySelector(
+ '[data-testid="upload-url-input"]',
+ );
expect(el).toBeTruthy();
});
it('should forward urlPlaceholder to the ion-input placeholder', () => {
fixture.componentRef.setInput('urlPlaceholder', 'https://my-image.com');
fixture.detectChanges();
- expect(getUrlInputInstance(fixture).placeholder()).toBe('https://my-image.com');
+ expect(getUrlInputInstance(fixture).placeholder()).toBe(
+ 'https://my-image.com',
+ );
});
it('should forward disabled to the ion-input', () => {
diff --git a/projects/ion/src/lib/upload/upload.component.ts b/projects/ion/src/lib/upload/upload.component.ts
index b06c9d4c6..c6482166e 100644
--- a/projects/ion/src/lib/upload/upload.component.ts
+++ b/projects/ion/src/lib/upload/upload.component.ts
@@ -14,7 +14,12 @@ import { IonDividerComponent } from '../divider/divider.component';
@Component({
selector: 'ion-upload',
- imports: [IonIconComponent, IonButtonComponent, IonInputComponent, IonDividerComponent],
+ imports: [
+ IonIconComponent,
+ IonButtonComponent,
+ IonInputComponent,
+ IonDividerComponent,
+ ],
templateUrl: './upload.component.html',
styleUrls: ['./upload.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
diff --git a/projects/ion/src/styles/themes/index.scss b/projects/ion/src/styles/themes/index.scss
index 419bd0318..26d04c95f 100644
--- a/projects/ion/src/styles/themes/index.scss
+++ b/projects/ion/src/styles/themes/index.scss
@@ -10,7 +10,8 @@ $negative-color: $negative-6;
$warning-color: $warning-6;
$info-color: $info-6;
-html, body {
+html,
+body {
font-family: 'Source Sans Pro';
}