Skip to content

Commit

Permalink
fix: changing interface button props popover
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-martins-brisa committed Sep 25, 2023
1 parent a81364e commit 9ea0abc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
6 changes: 5 additions & 1 deletion projects/ion/src/lib/core/types/popover.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -17,6 +17,10 @@ export enum PopoverPosition {
DEFAULT = 'bottomRight',
}

export interface PopoverButtonsProps extends IonButtonProps {
keepOpenAfterAction?: boolean;
}

export interface PopoverProps {
ionPopoverTitle: string;
ionPopoverBody: TemplateRef<void>;
Expand Down
3 changes: 1 addition & 2 deletions projects/ion/src/lib/popover/component/popover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
4 changes: 2 additions & 2 deletions projects/ion/src/lib/popover/popover.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?';
Expand Down
4 changes: 2 additions & 2 deletions projects/ion/src/lib/popover/popover.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions projects/ion/src/lib/popover/utilsPopover.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { IonButtonProps } from '../core/types';
import { PopoverPosition } from '../core/types/popover';

interface Hostpositions {
Expand All @@ -12,10 +11,6 @@ export type PopoverPositions = {
[key in PopoverPosition]: Pick<Hostpositions, 'left' | 'top'>;
};

export interface PopoverButtonsProps extends IonButtonProps {
keepOpenAfterAction?: boolean;
}

export function getPositionsPopover(
{ left, right, top, bottom }: Hostpositions,
arrowAtCenter: boolean
Expand Down

0 comments on commit 9ea0abc

Please sign in to comment.