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 | */
|
---|
9 | var __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 | };
|
---|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
19 | const schematics_1 = require("@angular-devkit/schematics");
|
---|
20 | const schematics_2 = require("@angular/cdk/schematics");
|
---|
21 | /**
|
---|
22 | * Scaffolds a new dashboard component.
|
---|
23 | * Internally it bootstraps the base component schematic
|
---|
24 | */
|
---|
25 | function 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() : addNavModulesToModule(options)
|
---|
32 | ]);
|
---|
33 | }
|
---|
34 | exports.default = default_1;
|
---|
35 | /**
|
---|
36 | * Adds the required modules to the relative module.
|
---|
37 | */
|
---|
38 | function addNavModulesToModule(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, 'MatGridListModule', '@angular/material/grid-list');
|
---|
42 | schematics_2.addModuleImportToModule(host, modulePath, 'MatCardModule', '@angular/material/card');
|
---|
43 | schematics_2.addModuleImportToModule(host, modulePath, 'MatMenuModule', '@angular/material/menu');
|
---|
44 | schematics_2.addModuleImportToModule(host, modulePath, 'MatIconModule', '@angular/material/icon');
|
---|
45 | schematics_2.addModuleImportToModule(host, modulePath, 'MatButtonModule', '@angular/material/button');
|
---|
46 | schematics_2.addModuleImportToModule(host, modulePath, 'LayoutModule', '@angular/cdk/layout');
|
---|
47 | });
|
---|
48 | }
|
---|
49 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvc2NoZW1hdGljcy9uZy1nZW5lcmF0ZS9kYXNoYm9hcmQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7QUFFSCwyREFBbUU7QUFDbkUsd0RBSWlDO0FBR2pDOzs7R0FHRztBQUNILG1CQUF3QixPQUFlO0lBQ3JDLE9BQU8sa0JBQUssQ0FBQztRQUNYLDJCQUFjLG1CQUFLLE9BQU8sR0FBRztZQUMzQixRQUFRLEVBQUUsa0ZBQWtGO1lBQzVGLFVBQVUsRUFDTix1RkFBdUY7U0FDNUYsQ0FBQztRQUNGLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLGlCQUFJLEVBQUUsQ0FBQyxDQUFDLENBQUMscUJBQXFCLENBQUMsT0FBTyxDQUFDO0tBQzdELENBQUMsQ0FBQztBQUNMLENBQUM7QUFURCw0QkFTQztBQUVEOztHQUVHO0FBQ0gsU0FBUyxxQkFBcUIsQ0FBQyxPQUFlO0lBQzVDLE9BQ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