source: trip-planner-front/node_modules/@angular/material/schematics/ng-generate/tree/index.mjs

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

initial commit

  • Property mode set to 100644
File size: 5.3 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 */
9var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11 return new (P || (P = Promise))(function (resolve, reject) {
12 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
13 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
14 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
15 step((generator = generator.apply(thisArg, _arguments || [])).next());
16 });
17};
18Object.defineProperty(exports, "__esModule", { value: true });
19const schematics_1 = require("@angular-devkit/schematics");
20const schematics_2 = require("@angular/cdk/schematics");
21/**
22 * Scaffolds a new tree component.
23 * Internally it bootstraps the base component schematic
24 */
25function default_1(options) {
26 return schematics_1.chain([
27 schematics_2.buildComponent(Object.assign({}, options), {
28 template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
29 stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template',
30 }),
31 options.skipImport ? schematics_1.noop() : addTreeModulesToModule(options)
32 ]);
33}
34exports.default = default_1;
35/**
36 * Adds the required modules to the relative module.
37 */
38function addTreeModulesToModule(options) {
39 return (host) => __awaiter(this, void 0, void 0, function* () {
40 const modulePath = (yield schematics_2.findModuleFromOptions(host, options));
41 schematics_2.addModuleImportToModule(host, modulePath, 'MatTreeModule', '@angular/material/tree');
42 schematics_2.addModuleImportToModule(host, modulePath, 'MatIconModule', '@angular/material/icon');
43 schematics_2.addModuleImportToModule(host, modulePath, 'MatButtonModule', '@angular/material/button');
44 });
45}
46//#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