"use strict"; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ Object.defineProperty(exports, "__esModule", { value: true }); const schematics_1 = require("@angular-devkit/schematics"); const schematics_2 = require("@angular/cdk/schematics"); /** * Scaffolds a new table component. * Internally it bootstraps the base component schematic */ function default_1(options) { return (0, schematics_1.chain)([ (0, schematics_2.buildComponent)({ ...options }, { template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template', stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template', }), options.skipImport ? (0, schematics_1.noop)() : addTableModulesToModule(options), ]); } exports.default = default_1; /** * Adds the required modules to the relative module. */ function addTableModulesToModule(options) { return async (host) => { const isStandalone = await (0, schematics_2.isStandaloneSchematic)(host, options); if (!isStandalone) { const modulePath = (await (0, schematics_2.findModuleFromOptions)(host, options)); (0, schematics_2.addModuleImportToModule)(host, modulePath, 'MatTableModule', '@angular/material/table'); (0, schematics_2.addModuleImportToModule)(host, modulePath, 'MatPaginatorModule', '@angular/material/paginator'); (0, schematics_2.addModuleImportToModule)(host, modulePath, 'MatSortModule', '@angular/material/sort'); } }; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvc2NoZW1hdGljcy9uZy1nZW5lcmF0ZS90YWJsZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7OztHQU1HOztBQUVILDJEQUFtRTtBQUNuRSx3REFLaUM7QUFHakM7OztHQUdHO0FBQ0gsbUJBQXlCLE9BQWU7SUFDdEMsT0FBTyxJQUFBLGtCQUFLLEVBQUM7UUFDWCxJQUFBLDJCQUFjLEVBQ1osRUFBQyxHQUFHLE9BQU8sRUFBQyxFQUNaO1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