Skip to content

Commit

Permalink
Merge pull request #41 from squidit/modal-close-button
Browse files Browse the repository at this point in the history
Add functionality to control the display of the close button in the modal
  • Loading branch information
dyelmag committed Dec 22, 2023
2 parents 69910e5 + 0ab76fe commit c4ede03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/sq-modal/sq-modal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ng-container *ngIf="headerTemplate">
<ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
</ng-container>
<button type="button" class="close button-close" aria-label="Close" (click)="modalClose.emit()">
<button *ngIf="buttonClose" type="button" class="close button-close" aria-label="Close" (click)="modalClose.emit()">
<i class="fa-solid fa-xmark fa-lg"></i>
</button>
</div>
Expand Down
9 changes: 7 additions & 2 deletions src/components/sq-modal/sq-modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import { Subscription } from 'rxjs'

/**
* Represents a modal component with customizable options and event handling.
*
*
* Look the link about the component in original framework and the appearance
*
* @see {@link https://css.squidit.com.br/components/modal}
*
*
* @example
* <sq-modal [open]="isModalOpen" (modalClose)="onModalClose()">
* <ng-template #headerModal>
Expand Down Expand Up @@ -77,6 +77,11 @@ export class SqModalComponent implements OnChanges, OnDestroy {
*/
@Input() backdrop = 'static'

/**
* Determines whether to display the close button.
*/
@Input() buttonClose = true

/**
* Event emitted when the modal is closed.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@squidit/ngx-css",
"version": "1.2.25",
"version": "1.2.26",
"peerDependencies": {
"@angular/common": ">=15.0.0",
"@angular/core": ">=15.0.0",
Expand Down

0 comments on commit c4ede03

Please sign in to comment.