source: trip-planner-front/node_modules/@angular/cdk/schematics/ng-update/html-parsing/angular.js@ bdd6491

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

initial commit

  • Property mode set to 100644
File size: 8.5 KB
Line 
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.findOutputsOnElementWithAttr = exports.findOutputsOnElementWithTag = exports.findInputsOnElementWithAttr = exports.findInputsOnElementWithTag = void 0;
11const elements_1 = require("./elements");
12/** Finds the specified Angular @Input in the given elements with tag name. */
13function findInputsOnElementWithTag(html, inputName, tagNames) {
14 return [
15 // Inputs can be also used without brackets (e.g. `<mat-toolbar color="primary">`)
16 ...elements_1.findAttributeOnElementWithTag(html, inputName, tagNames),
17 // Add one column to the mapped offset because the first bracket for the @Input
18 // is part of the attribute and therefore also part of the offset. We only want to return
19 // the offset for the inner name of the bracketed input.
20 ...elements_1.findAttributeOnElementWithTag(html, `[${inputName}]`, tagNames).map(offset => offset + 1),
21 ];
22}
23exports.findInputsOnElementWithTag = findInputsOnElementWithTag;
24/** Finds the specified Angular @Input in elements that have one of the specified attributes. */
25function findInputsOnElementWithAttr(html, inputName, attrs) {
26 return [
27 // Inputs can be also used without brackets (e.g. `<button mat-button color="primary">`)
28 ...elements_1.findAttributeOnElementWithAttrs(html, inputName, attrs),
29 // Add one column to the mapped offset because the first bracket for the @Input
30 // is part of the attribute and therefore also part of the offset. We only want to return
31 // the offset for the inner name of the bracketed input.
32 ...elements_1.findAttributeOnElementWithAttrs(html, `[${inputName}]`, attrs).map(offset => offset + 1),
33 ];
34}
35exports.findInputsOnElementWithAttr = findInputsOnElementWithAttr;
36/** Finds the specified Angular @Output in the given elements with tag name. */
37function findOutputsOnElementWithTag(html, outputName, tagNames) {
38 // Add one column to the mapped offset because the first parenthesis for the @Output
39 // is part of the attribute and therefore also part of the offset. We only want to return
40 // the offset for the inner name of the output.
41 return elements_1.findAttributeOnElementWithTag(html, `(${outputName})`, tagNames).map(offset => offset + 1);
42}
43exports.findOutputsOnElementWithTag = findOutputsOnElementWithTag;
44/** Finds the specified Angular @Output in elements that have one of the specified attributes. */
45function findOutputsOnElementWithAttr(html, outputName, attrs) {
46 // Add one column to the mapped offset because the first bracket for the @Output
47 // is part of the attribute and therefore also part of the offset. We only want to return
48 // the offset for the inner name of the output.
49 return elements_1.findAttributeOnElementWithAttrs(html, `(${outputName})`, attrs).map(offset => offset + 1);
50}
51exports.findOutputsOnElementWithAttr = findOutputsOnElementWithAttr;
52//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy9jZGsvc2NoZW1hdGljcy9uZy11cGRhdGUvaHRtbC1wYXJzaW5nL2FuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBRUgseUNBQTBGO0FBRTFGLDhFQUE4RTtBQUM5RSxTQUFnQiwwQkFBMEIsQ0FBQyxJQUFZLEVBQUUsU0FBaUIsRUFBRSxRQUFrQjtJQUM1RixPQUFPO1FBQ0wsa0ZBQWtGO1FBQ2xGLEdBQUcsd0NBQTZCLENBQUMsSUFBSSxFQUFFLFNBQVMsRUFBRSxRQUFRLENBQUM7UUFDM0QsK0VBQStFO1FBQy9FLHlGQUF5RjtRQUN6Rix3REFBd0Q7UUFDeEQsR0FBRyx3Q0FBNkIsQ0FBQyxJQUFJLEVBQUUsSUFBSSxTQUFTLEdBQUcsRUFBRSxRQUFRLENBQUMsQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDO0tBQzdGLENBQU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