source: trip-planner-front/node_modules/@angular/material/esm2015/icon/icon.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 47.0 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { coerceBooleanProperty } from '@angular/cdk/coercion';
9import { DOCUMENT } from '@angular/common';
10import { Attribute, ChangeDetectionStrategy, Component, ElementRef, ErrorHandler, inject, Inject, InjectionToken, Input, ViewEncapsulation, } from '@angular/core';
11import { mixinColor } from '@angular/material/core';
12import { Subscription } from 'rxjs';
13import { take } from 'rxjs/operators';
14import { MatIconRegistry } from './icon-registry';
15// Boilerplate for applying mixins to MatIcon.
16/** @docs-private */
17const _MatIconBase = mixinColor(class {
18 constructor(_elementRef) {
19 this._elementRef = _elementRef;
20 }
21});
22/**
23 * Injection token used to provide the current location to `MatIcon`.
24 * Used to handle server-side rendering and to stub out during unit tests.
25 * @docs-private
26 */
27export const MAT_ICON_LOCATION = new InjectionToken('mat-icon-location', {
28 providedIn: 'root',
29 factory: MAT_ICON_LOCATION_FACTORY
30});
31/** @docs-private */
32export function MAT_ICON_LOCATION_FACTORY() {
33 const _document = inject(DOCUMENT);
34 const _location = _document ? _document.location : null;
35 return {
36 // Note that this needs to be a function, rather than a property, because Angular
37 // will only resolve it once, but we want the current path on each call.
38 getPathname: () => _location ? (_location.pathname + _location.search) : ''
39 };
40}
41/** SVG attributes that accept a FuncIRI (e.g. `url(<something>)`). */
42const funcIriAttributes = [
43 'clip-path',
44 'color-profile',
45 'src',
46 'cursor',
47 'fill',
48 'filter',
49 'marker',
50 'marker-start',
51 'marker-mid',
52 'marker-end',
53 'mask',
54 'stroke'
55];
56const ɵ0 = attr => `[${attr}]`;
57/** Selector that can be used to find all elements that are using a `FuncIRI`. */
58const funcIriAttributeSelector = funcIriAttributes.map(ɵ0).join(', ');
59/** Regex that can be used to extract the id out of a FuncIRI. */
60const funcIriPattern = /^url\(['"]?#(.*?)['"]?\)$/;
61/**
62 * Component to display an icon. It can be used in the following ways:
63 *
64 * - Specify the svgIcon input to load an SVG icon from a URL previously registered with the
65 * addSvgIcon, addSvgIconInNamespace, addSvgIconSet, or addSvgIconSetInNamespace methods of
66 * MatIconRegistry. If the svgIcon value contains a colon it is assumed to be in the format
67 * "[namespace]:[name]", if not the value will be the name of an icon in the default namespace.
68 * Examples:
69 * `<mat-icon svgIcon="left-arrow"></mat-icon>
70 * <mat-icon svgIcon="animals:cat"></mat-icon>`
71 *
72 * - Use a font ligature as an icon by putting the ligature text in the content of the `<mat-icon>`
73 * component. By default the Material icons font is used as described at
74 * http://google.github.io/material-design-icons/#icon-font-for-the-web. You can specify an
75 * alternate font by setting the fontSet input to either the CSS class to apply to use the
76 * desired font, or to an alias previously registered with MatIconRegistry.registerFontClassAlias.
77 * Examples:
78 * `<mat-icon>home</mat-icon>
79 * <mat-icon fontSet="myfont">sun</mat-icon>`
80 *
81 * - Specify a font glyph to be included via CSS rules by setting the fontSet input to specify the
82 * font, and the fontIcon input to specify the icon. Typically the fontIcon will specify a
83 * CSS class which causes the glyph to be displayed via a :before selector, as in
84 * https://fortawesome.github.io/Font-Awesome/examples/
85 * Example:
86 * `<mat-icon fontSet="fa" fontIcon="alarm"></mat-icon>`
87 */
88export class MatIcon extends _MatIconBase {
89 constructor(elementRef, _iconRegistry, ariaHidden, _location, _errorHandler) {
90 super(elementRef);
91 this._iconRegistry = _iconRegistry;
92 this._location = _location;
93 this._errorHandler = _errorHandler;
94 this._inline = false;
95 /** Subscription to the current in-progress SVG icon request. */
96 this._currentIconFetch = Subscription.EMPTY;
97 // If the user has not explicitly set aria-hidden, mark the icon as hidden, as this is
98 // the right thing to do for the majority of icon use-cases.
99 if (!ariaHidden) {
100 elementRef.nativeElement.setAttribute('aria-hidden', 'true');
101 }
102 }
103 /**
104 * Whether the icon should be inlined, automatically sizing the icon to match the font size of
105 * the element the icon is contained in.
106 */
107 get inline() {
108 return this._inline;
109 }
110 set inline(inline) {
111 this._inline = coerceBooleanProperty(inline);
112 }
113 /** Name of the icon in the SVG icon set. */
114 get svgIcon() { return this._svgIcon; }
115 set svgIcon(value) {
116 if (value !== this._svgIcon) {
117 if (value) {
118 this._updateSvgIcon(value);
119 }
120 else if (this._svgIcon) {
121 this._clearSvgElement();
122 }
123 this._svgIcon = value;
124 }
125 }
126 /** Font set that the icon is a part of. */
127 get fontSet() { return this._fontSet; }
128 set fontSet(value) {
129 const newValue = this._cleanupFontValue(value);
130 if (newValue !== this._fontSet) {
131 this._fontSet = newValue;
132 this._updateFontIconClasses();
133 }
134 }
135 /** Name of an icon within a font set. */
136 get fontIcon() { return this._fontIcon; }
137 set fontIcon(value) {
138 const newValue = this._cleanupFontValue(value);
139 if (newValue !== this._fontIcon) {
140 this._fontIcon = newValue;
141 this._updateFontIconClasses();
142 }
143 }
144 /**
145 * Splits an svgIcon binding value into its icon set and icon name components.
146 * Returns a 2-element array of [(icon set), (icon name)].
147 * The separator for the two fields is ':'. If there is no separator, an empty
148 * string is returned for the icon set and the entire value is returned for
149 * the icon name. If the argument is falsy, returns an array of two empty strings.
150 * Throws an error if the name contains two or more ':' separators.
151 * Examples:
152 * `'social:cake' -> ['social', 'cake']
153 * 'penguin' -> ['', 'penguin']
154 * null -> ['', '']
155 * 'a:b:c' -> (throws Error)`
156 */
157 _splitIconName(iconName) {
158 if (!iconName) {
159 return ['', ''];
160 }
161 const parts = iconName.split(':');
162 switch (parts.length) {
163 case 1: return ['', parts[0]]; // Use default namespace.
164 case 2: return parts;
165 default: throw Error(`Invalid icon name: "${iconName}"`); // TODO: add an ngDevMode check
166 }
167 }
168 ngOnInit() {
169 // Update font classes because ngOnChanges won't be called if none of the inputs are present,
170 // e.g. <mat-icon>arrow</mat-icon> In this case we need to add a CSS class for the default font.
171 this._updateFontIconClasses();
172 }
173 ngAfterViewChecked() {
174 const cachedElements = this._elementsWithExternalReferences;
175 if (cachedElements && cachedElements.size) {
176 const newPath = this._location.getPathname();
177 // We need to check whether the URL has changed on each change detection since
178 // the browser doesn't have an API that will let us react on link clicks and
179 // we can't depend on the Angular router. The references need to be updated,
180 // because while most browsers don't care whether the URL is correct after
181 // the first render, Safari will break if the user navigates to a different
182 // page and the SVG isn't re-rendered.
183 if (newPath !== this._previousPath) {
184 this._previousPath = newPath;
185 this._prependPathToReferences(newPath);
186 }
187 }
188 }
189 ngOnDestroy() {
190 this._currentIconFetch.unsubscribe();
191 if (this._elementsWithExternalReferences) {
192 this._elementsWithExternalReferences.clear();
193 }
194 }
195 _usingFontIcon() {
196 return !this.svgIcon;
197 }
198 _setSvgElement(svg) {
199 this._clearSvgElement();
200 // Workaround for IE11 and Edge ignoring `style` tags inside dynamically-created SVGs.
201 // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10898469/
202 // Do this before inserting the element into the DOM, in order to avoid a style recalculation.
203 const styleTags = svg.querySelectorAll('style');
204 for (let i = 0; i < styleTags.length; i++) {
205 styleTags[i].textContent += ' ';
206 }
207 // Note: we do this fix here, rather than the icon registry, because the
208 // references have to point to the URL at the time that the icon was created.
209 const path = this._location.getPathname();
210 this._previousPath = path;
211 this._cacheChildrenWithExternalReferences(svg);
212 this._prependPathToReferences(path);
213 this._elementRef.nativeElement.appendChild(svg);
214 }
215 _clearSvgElement() {
216 const layoutElement = this._elementRef.nativeElement;
217 let childCount = layoutElement.childNodes.length;
218 if (this._elementsWithExternalReferences) {
219 this._elementsWithExternalReferences.clear();
220 }
221 // Remove existing non-element child nodes and SVGs, and add the new SVG element. Note that
222 // we can't use innerHTML, because IE will throw if the element has a data binding.
223 while (childCount--) {
224 const child = layoutElement.childNodes[childCount];
225 // 1 corresponds to Node.ELEMENT_NODE. We remove all non-element nodes in order to get rid
226 // of any loose text nodes, as well as any SVG elements in order to remove any old icons.
227 if (child.nodeType !== 1 || child.nodeName.toLowerCase() === 'svg') {
228 layoutElement.removeChild(child);
229 }
230 }
231 }
232 _updateFontIconClasses() {
233 if (!this._usingFontIcon()) {
234 return;
235 }
236 const elem = this._elementRef.nativeElement;
237 const fontSetClass = this.fontSet ?
238 this._iconRegistry.classNameForFontAlias(this.fontSet) :
239 this._iconRegistry.getDefaultFontSetClass();
240 if (fontSetClass != this._previousFontSetClass) {
241 if (this._previousFontSetClass) {
242 elem.classList.remove(this._previousFontSetClass);
243 }
244 if (fontSetClass) {
245 elem.classList.add(fontSetClass);
246 }
247 this._previousFontSetClass = fontSetClass;
248 }
249 if (this.fontIcon != this._previousFontIconClass) {
250 if (this._previousFontIconClass) {
251 elem.classList.remove(this._previousFontIconClass);
252 }
253 if (this.fontIcon) {
254 elem.classList.add(this.fontIcon);
255 }
256 this._previousFontIconClass = this.fontIcon;
257 }
258 }
259 /**
260 * Cleans up a value to be used as a fontIcon or fontSet.
261 * Since the value ends up being assigned as a CSS class, we
262 * have to trim the value and omit space-separated values.
263 */
264 _cleanupFontValue(value) {
265 return typeof value === 'string' ? value.trim().split(' ')[0] : value;
266 }
267 /**
268 * Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
269 * reference. This is required because WebKit browsers require references to be prefixed with
270 * the current path, if the page has a `base` tag.
271 */
272 _prependPathToReferences(path) {
273 const elements = this._elementsWithExternalReferences;
274 if (elements) {
275 elements.forEach((attrs, element) => {
276 attrs.forEach(attr => {
277 element.setAttribute(attr.name, `url('${path}#${attr.value}')`);
278 });
279 });
280 }
281 }
282 /**
283 * Caches the children of an SVG element that have `url()`
284 * references that we need to prefix with the current path.
285 */
286 _cacheChildrenWithExternalReferences(element) {
287 const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);
288 const elements = this._elementsWithExternalReferences =
289 this._elementsWithExternalReferences || new Map();
290 for (let i = 0; i < elementsWithFuncIri.length; i++) {
291 funcIriAttributes.forEach(attr => {
292 const elementWithReference = elementsWithFuncIri[i];
293 const value = elementWithReference.getAttribute(attr);
294 const match = value ? value.match(funcIriPattern) : null;
295 if (match) {
296 let attributes = elements.get(elementWithReference);
297 if (!attributes) {
298 attributes = [];
299 elements.set(elementWithReference, attributes);
300 }
301 attributes.push({ name: attr, value: match[1] });
302 }
303 });
304 }
305 }
306 /** Sets a new SVG icon with a particular name. */
307 _updateSvgIcon(rawName) {
308 this._svgNamespace = null;
309 this._svgName = null;
310 this._currentIconFetch.unsubscribe();
311 if (rawName) {
312 const [namespace, iconName] = this._splitIconName(rawName);
313 if (namespace) {
314 this._svgNamespace = namespace;
315 }
316 if (iconName) {
317 this._svgName = iconName;
318 }
319 this._currentIconFetch = this._iconRegistry.getNamedSvgIcon(iconName, namespace)
320 .pipe(take(1))
321 .subscribe(svg => this._setSvgElement(svg), (err) => {
322 const errorMessage = `Error retrieving icon ${namespace}:${iconName}! ${err.message}`;
323 this._errorHandler.handleError(new Error(errorMessage));
324 });
325 }
326 }
327}
328MatIcon.decorators = [
329 { type: Component, args: [{
330 template: '<ng-content></ng-content>',
331 selector: 'mat-icon',
332 exportAs: 'matIcon',
333 inputs: ['color'],
334 host: {
335 'role': 'img',
336 'class': 'mat-icon notranslate',
337 '[attr.data-mat-icon-type]': '_usingFontIcon() ? "font" : "svg"',
338 '[attr.data-mat-icon-name]': '_svgName || fontIcon',
339 '[attr.data-mat-icon-namespace]': '_svgNamespace || fontSet',
340 '[class.mat-icon-inline]': 'inline',
341 '[class.mat-icon-no-color]': 'color !== "primary" && color !== "accent" && color !== "warn"',
342 },
343 encapsulation: ViewEncapsulation.None,
344 changeDetection: ChangeDetectionStrategy.OnPush,
345 styles: [".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"]
346 },] }
347];
348MatIcon.ctorParameters = () => [
349 { type: ElementRef },
350 { type: MatIconRegistry },
351 { type: String, decorators: [{ type: Attribute, args: ['aria-hidden',] }] },
352 { type: undefined, decorators: [{ type: Inject, args: [MAT_ICON_LOCATION,] }] },
353 { type: ErrorHandler }
354];
355MatIcon.propDecorators = {
356 inline: [{ type: Input }],
357 svgIcon: [{ type: Input }],
358 fontSet: [{ type: Input }],
359 fontIcon: [{ type: Input }]
360};
361export { ɵ0 };
362//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWNvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC9pY29uL2ljb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFlLHFCQUFxQixFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFDMUUsT0FBTyxFQUFDLFFBQVEsRUFBQyxNQUFNLGlCQUFpQixDQUFDO0FBQ3pDLE9BQU8sRUFFTCxTQUFTLEVBQ1QsdUJBQXVCLEVBQ3ZCLFNBQVMsRUFDVCxVQUFVLEVBQ1YsWUFBWSxFQUNaLE1BQU0sRUFDTixNQUFNLEVBQ04sY0FBYyxFQUNkLEtBQUssRUFHTCxpQkFBaUIsR0FDbEIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFXLFVBQVUsRUFBQyxNQUFNLHdCQUF3QixDQUFDO0FBQzVELE9BQU8sRUFBQyxZQUFZLEVBQUMsTUFBTSxNQUFNLENBQUM7QUFDbEMsT0FBTyxFQUFDLElBQUksRUFBQyxNQUFNLGdCQUFnQixDQU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JNZXNzYWdlID0gYEVycm9yIHJldHJpZXZpbmcgaWNvbiAke25hbWVzcGFjZX06JHtpY29uTmFtZX0hICR7ZXJyLm1lc3NhZ2V9YDtcbiAgICAgICAgICAgIHRoaXMuX2Vycm9ySGFuZGxlci5oYW5kbGVFcnJvcihuZXcgRXJyb3IoZXJyb3JNZXNzYWdlKSk7XG4gICAgICAgICAgfSk7XG4gICAgfVxuICB9XG5cbiAgc3RhdGljIG5nQWNjZXB0SW5wdXRUeXBlX2lubGluZTogQm9vbGVhbklucHV0O1xufVxuIl19
Note: See TracBrowser for help on using the repository browser.