From 9ea0abc551ed28c3c92dd195e7c7098db7b9e0f7 Mon Sep 17 00:00:00 2001 From: pedro-martins-brisa Date: Mon, 25 Sep 2023 14:51:27 -0300 Subject: [PATCH] fix: changing interface button props popover --- projects/ion/src/lib/core/types/popover.ts | 6 +++++- projects/ion/src/lib/popover/component/popover.component.ts | 3 +-- projects/ion/src/lib/popover/popover.directive.spec.ts | 4 ++-- projects/ion/src/lib/popover/popover.directive.ts | 4 ++-- projects/ion/src/lib/popover/utilsPopover.ts | 5 ----- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/projects/ion/src/lib/core/types/popover.ts b/projects/ion/src/lib/core/types/popover.ts index 6bd5d026d..424b1306e 100644 --- a/projects/ion/src/lib/core/types/popover.ts +++ b/projects/ion/src/lib/core/types/popover.ts @@ -1,6 +1,6 @@ import { TemplateRef } from '@angular/core'; -import { PopoverButtonsProps } from '../../popover/utilsPopover'; +import { IonButtonProps } from './button'; import { IconType } from './icon'; export enum PopoverPosition { @@ -17,6 +17,10 @@ export enum PopoverPosition { DEFAULT = 'bottomRight', } +export interface PopoverButtonsProps extends IonButtonProps { + keepOpenAfterAction?: boolean; +} + export interface PopoverProps { ionPopoverTitle: string; ionPopoverBody: TemplateRef; diff --git a/projects/ion/src/lib/popover/component/popover.component.ts b/projects/ion/src/lib/popover/component/popover.component.ts index b5e7fa486..0bae1b74e 100644 --- a/projects/ion/src/lib/popover/component/popover.component.ts +++ b/projects/ion/src/lib/popover/component/popover.component.ts @@ -2,8 +2,7 @@ import { Component, Input, TemplateRef } from '@angular/core'; import { Subject } from 'rxjs'; import { IconType } from '../../core/types'; -import { PopoverPosition } from '../../core/types/popover'; -import { PopoverButtonsProps } from '../utilsPopover'; +import { PopoverButtonsProps, PopoverPosition } from '../../core/types/popover'; const PRIMARY_6 = '#0858ce'; diff --git a/projects/ion/src/lib/popover/popover.directive.spec.ts b/projects/ion/src/lib/popover/popover.directive.spec.ts index 4f6358e29..44b1047c7 100644 --- a/projects/ion/src/lib/popover/popover.directive.spec.ts +++ b/projects/ion/src/lib/popover/popover.directive.spec.ts @@ -11,14 +11,14 @@ import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; import { fireEvent, render, screen } from '@testing-library/angular'; + import { IonButtonModule } from '../button/button.module'; -import { PopoverPosition } from '../core/types/popover'; +import { PopoverButtonsProps, PopoverPosition } from '../core/types/popover'; import { IonDividerModule } from '../divider/divider.module'; import { IonSharedModule } from '../shared.module'; import { IonPopoverComponent } from './component/popover.component'; import { IonPopoverDirective } from './popover.directive'; import { IonPopoverModule } from './popover.module'; -import { PopoverButtonsProps } from './utilsPopover'; const textButton = 'Teste'; const confirmText = 'VocĂȘ tem certeza?'; diff --git a/projects/ion/src/lib/popover/popover.directive.ts b/projects/ion/src/lib/popover/popover.directive.ts index ff41fb930..5871f82b7 100644 --- a/projects/ion/src/lib/popover/popover.directive.ts +++ b/projects/ion/src/lib/popover/popover.directive.ts @@ -17,10 +17,10 @@ import { import { pick } from 'lodash'; import { IconType } from '../core/types'; -import { PopoverPosition } from '../core/types/popover'; +import { PopoverButtonsProps, PopoverPosition } from '../core/types/popover'; import { SafeAny } from './../utils/safe-any'; import { IonPopoverComponent } from './component/popover.component'; -import { getPositionsPopover, PopoverButtonsProps } from './utilsPopover'; +import { getPositionsPopover } from './utilsPopover'; @Directive({ selector: '[ionPopover]' }) export class IonPopoverDirective implements OnDestroy { diff --git a/projects/ion/src/lib/popover/utilsPopover.ts b/projects/ion/src/lib/popover/utilsPopover.ts index 8081396ed..4d3dc2e61 100644 --- a/projects/ion/src/lib/popover/utilsPopover.ts +++ b/projects/ion/src/lib/popover/utilsPopover.ts @@ -1,4 +1,3 @@ -import { IonButtonProps } from '../core/types'; import { PopoverPosition } from '../core/types/popover'; interface Hostpositions { @@ -12,10 +11,6 @@ export type PopoverPositions = { [key in PopoverPosition]: Pick; }; -export interface PopoverButtonsProps extends IonButtonProps { - keepOpenAfterAction?: boolean; -} - export function getPositionsPopover( { left, right, top, bottom }: Hostpositions, arrowAtCenter: boolean