11
2- // ייבוא הרכיבים של PatternFly
32import { LitElement , type TemplateResult , html , isServer , render } from 'lit' ;
43import { customElement } from 'lit/decorators/custom-element.js' ;
54import { property } from 'lit/decorators/property.js' ;
@@ -67,17 +66,17 @@ export class PfAlert extends LitElement {
6766 const icons = this . renderRoot . querySelectorAll ( '#arrow-icon, #close-button' ) ;
6867 icons . forEach ( icon => {
6968 icon . addEventListener ( 'click' , ( ) => {
70- // הסרה של active מכל האיקונים של כל הרכיבים
69+ // Remove active from all icons of all components
7170 document . querySelectorAll ( 'pf-alert' ) . forEach ( alert => {
7271 const innerIcons = alert . renderRoot ?. querySelectorAll ( '#arrow-icon, #close-button' ) ;
7372 innerIcons ?. forEach ( i => i . classList . remove ( 'active' ) ) ;
7473 } ) ;
75- // הוספת active לאייקון הנוכחי
74+ // Add active to the current icon
7675 icon . classList . add ( 'active' ) ;
7776 } ) ;
7877 } ) ;
7978
80- // קליק בכל מקום אחר מחזיר למצב רגיל
79+ // Click anywhere else returns to normal mode
8180 document . addEventListener ( 'click' , event => {
8281 const path = event . composedPath ( ) ;
8382 const clickedOnIcon = Array . from ( icons ) . some ( i => path . includes ( i as EventTarget ) ) ;
@@ -153,7 +152,6 @@ export class PfAlert extends LitElement {
153152
154153 #onClose( ) {
155154 if ( this . dispatchEvent ( new AlertCloseEvent ( 'close' ) ) ) {
156- // this.#close();
157155 }
158156 }
159157
@@ -198,7 +196,6 @@ export class PfAlert extends LitElement {
198196 const arrowDirection = hasDescription ? 'angle-down' : 'angle-right' ;
199197
200198
201- // footer slot עם האקשנים
202199 const footer = html `< footer class ="${ classMap ( { hasActions } ) } "
203200 @click ="${ this . #onActionsClick} ">
204201 <!-- Provide actions that the user can take for the alert -->
@@ -261,14 +258,6 @@ export class PfAlert extends LitElement {
261258 ` ;
262259 }
263260
264- // async #close() {
265- // await this.updateComplete;
266- // await Promise.all(this.getAnimations().map(x => {
267- // x.finish();
268- // return x.finished;
269- // }));
270- // this.remove();
271- // }
272261
273262 async #onActionsClick( event : MouseEvent ) {
274263 if ( event . target instanceof HTMLElement
@@ -277,7 +266,6 @@ export class PfAlert extends LitElement {
277266 && this . dispatchEvent (
278267 new AlertCloseEvent ( event . target ?. dataset . action . toLowerCase ( ) ) ,
279268 ) ) {
280- // this.#close();
281269 }
282270 }
283271}
0 commit comments