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 table 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() : addTableModulesToModule(options)
|
---|
32 | ]);
|
---|
33 | }
|
---|
34 | exports.default = default_1;
|
---|
35 | /**
|
---|
36 | * Adds the required modules to the relative module.
|
---|
37 | */
|
---|
38 | function addTableModulesToModule(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, 'MatTableModule', '@angular/material/table');
|
---|
42 | schematics_2.addModuleImportToModule(host, modulePath, 'MatPaginatorModule', '@angular/material/paginator');
|
---|
43 | schematics_2.addModuleImportToModule(host, modulePath, 'MatSortModule', '@angular/material/sort');
|
---|
44 | });
|
---|
45 | }
|
---|
46 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvc2NoZW1hdGljcy9uZy1nZW5lcmF0ZS90YWJsZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7OztBQUVILDJEQUFtRTtBQUNuRSx3REFJaUM7QUFHakM7OztHQUdHO0FBQ0gsbUJBQXdCLE9BQWU7SUFDckMsT0FBTyxrQkFBSyxDQUFDO1FBQ1gsMkJBQWMsbUJBQUssT0FBTyxHQUFHO1lBQzNCLFFBQVEsRUFBRSxrRkFBa0Y7WUFDNUYsVUFBVSxFQUNOLHVGQUF1RjtTQUM1RixDQUFDO1FBQ0YsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsaUJBQUksRUFBRSxDQUFDLENBQUMsQ0FBQyx1QkFBdUIsQ0FBQyxPQUFPLENBQUM7S0FDL0QsQ0FBQyxDQUFDO0FBQ0wsQ0FBQztBQVRELDRCQVNDO0FBRUQ7O0dBRUc7QUFDSCxTQUFTLHVCQUF1QixDQUFDLE9BQWU7SUFDOUMsT0FBTyxDQUFPLElBQVUsRUFBRSxFQUFFO1FBQzFCLE1BQU0sVUFBVSxHQUFHLENBQUMsTUFBTSxrQ0FBcUIsQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLENBQUUsQ0FBQztRQUNqRSxvQ0FBdUIsQ0FBQyxJQUFJLE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