Ignore:
Timestamp:
10/16/21 18:10:51 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
eed0bf8
Parents:
6a3a178
Message:

adding new components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/@angular/material/esm2015/badge/badge.js

    r6a3a178 rfa375fe  
    1616const _MatBadgeBase = mixinDisabled(class {
    1717});
    18 const BADGE_CONTENT_CLASS = 'mat-badge-content';
    1918/** Directive to display a text badge. */
    2019export class MatBadge extends _MatBadgeBase {
     
    2625        this._renderer = _renderer;
    2726        this._animationMode = _animationMode;
     27        /** Whether the badge has any content. */
     28        this._hasContent = false;
    2829        this._color = 'primary';
    2930        this._overlap = true;
     
    3738        /** Unique id for the badge */
    3839        this._id = nextId++;
    39         /** Whether the OnInit lifecycle hook has run yet */
    40         this._isInitialized = false;
    4140        if (typeof ngDevMode === 'undefined' || ngDevMode) {
    4241            const nativeElement = _elementRef.nativeElement;
     
    5756        this._overlap = coerceBooleanProperty(val);
    5857    }
    59     /** The content for the badge */
    60     get content() {
    61         return this._content;
    62     }
    63     set content(newContent) {
    64         this._updateRenderedContent(newContent);
    65     }
    6658    /** Message used to describe the decorated element via aria-describedby */
    6759    get description() { return this._description; }
    6860    set description(newDescription) {
    69         this._updateHostAriaDescription(newDescription);
     61        if (newDescription !== this._description) {
     62            const badgeElement = this._badgeElement;
     63            this._updateHostAriaDescription(newDescription, this._description);
     64            this._description = newDescription;
     65            if (badgeElement) {
     66                newDescription ? badgeElement.setAttribute('aria-label', newDescription) :
     67                    badgeElement.removeAttribute('aria-label');
     68            }
     69        }
    7070    }
    7171    /** Whether the badge is hidden. */
     
    8282        return this.position.indexOf('before') === -1;
    8383    }
     84    ngOnChanges(changes) {
     85        const contentChange = changes['content'];
     86        if (contentChange) {
     87            const value = contentChange.currentValue;
     88            this._hasContent = value != null && `${value}`.trim().length > 0;
     89            this._updateTextContent();
     90        }
     91    }
     92    ngOnDestroy() {
     93        const badgeElement = this._badgeElement;
     94        if (badgeElement) {
     95            if (this.description) {
     96                this._ariaDescriber.removeDescription(badgeElement, this.description);
     97            }
     98            // When creating a badge through the Renderer, Angular will keep it in an index.
     99            // We have to destroy it ourselves, otherwise it'll be retained in memory.
     100            if (this._renderer.destroyNode) {
     101                this._renderer.destroyNode(badgeElement);
     102            }
     103        }
     104    }
    84105    /**
    85      * Gets the element into which the badge's content is being rendered. Undefined if the element
    86      * hasn't been created (e.g. if the badge doesn't have content).
     106     * Gets the element into which the badge's content is being rendered.
     107     * Undefined if the element hasn't been created (e.g. if the badge doesn't have content).
    87108     */
    88109    getBadgeElement() {
    89110        return this._badgeElement;
    90111    }
    91     ngOnInit() {
    92         // We may have server-side rendered badge that we need to clear.
    93         // We need to do this in ngOnInit because the full content of the component
    94         // on which the badge is attached won't necessarily be in the DOM until this point.
    95         this._clearExistingBadges();
    96         if (this.content && !this._badgeElement) {
     112    /** Injects a span element into the DOM with the content. */
     113    _updateTextContent() {
     114        if (!this._badgeElement) {
    97115            this._badgeElement = this._createBadgeElement();
    98             this._updateRenderedContent(this.content);
    99         }
    100         this._isInitialized = true;
    101     }
    102     ngOnDestroy() {
    103         // ViewEngine only: when creating a badge through the Renderer, Angular remembers its index.
    104         // We have to destroy it ourselves, otherwise it'll be retained in memory.
    105         if (this._renderer.destroyNode) {
    106             this._renderer.destroyNode(this._badgeElement);
    107         }
    108         this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this.description);
     116        }
     117        else {
     118            this._badgeElement.textContent = this._stringifyContent();
     119        }
     120        return this._badgeElement;
    109121    }
    110122    /** Creates the badge element */
     
    112124        const badgeElement = this._renderer.createElement('span');
    113125        const activeClass = 'mat-badge-active';
     126        const contentClass = 'mat-badge-content';
     127        // Clear any existing badges which may have persisted from a server-side render.
     128        this._clearExistingBadges(contentClass);
    114129        badgeElement.setAttribute('id', `mat-badge-content-${this._id}`);
    115         // The badge is aria-hidden because we don't want it to appear in the page's navigation
    116         // flow. Instead, we use the badge to describe the decorated element with aria-describedby.
    117         badgeElement.setAttribute('aria-hidden', 'true');
    118         badgeElement.classList.add(BADGE_CONTENT_CLASS);
     130        badgeElement.classList.add(contentClass);
     131        badgeElement.textContent = this._stringifyContent();
    119132        if (this._animationMode === 'NoopAnimations') {
    120133            badgeElement.classList.add('_mat-animation-noopable');
     134        }
     135        if (this.description) {
     136            badgeElement.setAttribute('aria-label', this.description);
    121137        }
    122138        this._elementRef.nativeElement.appendChild(badgeElement);
     
    134150        return badgeElement;
    135151    }
    136     /** Update the text content of the badge element in the DOM, creating the element if necessary. */
    137     _updateRenderedContent(newContent) {
    138         const newContentNormalized = `${newContent !== null && newContent !== void 0 ? newContent : ''}`.trim();
    139         // Don't create the badge element if the directive isn't initialized because we want to
    140         // append the badge element to the *end* of the host element's content for backwards
    141         // compatibility.
    142         if (this._isInitialized && newContentNormalized && !this._badgeElement) {
    143             this._badgeElement = this._createBadgeElement();
    144         }
    145         if (this._badgeElement) {
    146             this._badgeElement.textContent = newContentNormalized;
    147         }
    148         this._content = newContentNormalized;
    149     }
    150     /** Updates the host element's aria description via AriaDescriber. */
    151     _updateHostAriaDescription(newDescription) {
    152         this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this.description);
     152    /** Sets the aria-label property on the element */
     153    _updateHostAriaDescription(newDescription, oldDescription) {
     154        // ensure content available before setting label
     155        const content = this._updateTextContent();
     156        if (oldDescription) {
     157            this._ariaDescriber.removeDescription(content, oldDescription);
     158        }
    153159        if (newDescription) {
    154             this._ariaDescriber.describe(this._elementRef.nativeElement, newDescription);
    155         }
    156         this._description = newDescription;
     160            this._ariaDescriber.describe(content, newDescription);
     161        }
    157162    }
    158163    /** Adds css theme class given the color to the component host */
    159164    _setColor(colorPalette) {
    160         const classList = this._elementRef.nativeElement.classList;
    161         classList.remove(`mat-badge-${this._color}`);
    162         if (colorPalette) {
    163             classList.add(`mat-badge-${colorPalette}`);
     165        if (colorPalette !== this._color) {
     166            const classList = this._elementRef.nativeElement.classList;
     167            if (this._color) {
     168                classList.remove(`mat-badge-${this._color}`);
     169            }
     170            if (colorPalette) {
     171                classList.add(`mat-badge-${colorPalette}`);
     172            }
    164173        }
    165174    }
    166175    /** Clears any existing badges that might be left over from server-side rendering. */
    167     _clearExistingBadges() {
    168         // Only check direct children of this host element in order to avoid deleting
    169         // any badges that might exist in descendant elements.
    170         const badges = this._elementRef.nativeElement.querySelectorAll(`:scope > .${BADGE_CONTENT_CLASS}`);
    171         for (const badgeElement of Array.from(badges)) {
    172             if (badgeElement !== this._badgeElement) {
    173                 badgeElement.remove();
    174             }
    175         }
     176    _clearExistingBadges(cssClass) {
     177        const element = this._elementRef.nativeElement;
     178        let childCount = element.children.length;
     179        // Use a reverse while, because we'll be removing elements from the list as we're iterating.
     180        while (childCount--) {
     181            const currentChild = element.children[childCount];
     182            if (currentChild.classList.contains(cssClass)) {
     183                element.removeChild(currentChild);
     184            }
     185        }
     186    }
     187    /** Gets the string representation of the badge content. */
     188    _stringifyContent() {
     189        // Convert null and undefined to an empty string which is consistent
     190        // with how Angular handles them in inside template interpolations.
     191        const content = this.content;
     192        return content == null ? '' : `${content}`;
    176193    }
    177194}
     
    190207                    '[class.mat-badge-medium]': 'size === "medium"',
    191208                    '[class.mat-badge-large]': 'size === "large"',
    192                     '[class.mat-badge-hidden]': 'hidden || !content',
     209                    '[class.mat-badge-hidden]': 'hidden || !_hasContent',
    193210                    '[class.mat-badge-disabled]': 'disabled',
    194211                },
     
    211228    hidden: [{ type: Input, args: ['matBadgeHidden',] }]
    212229};
    213 //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFkZ2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvYmFkZ2UvYmFkZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLGFBQWEsRUFBQyxNQUFN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