UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

39 lines 1.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TableTemplateRule = void 0; const schematics_1 = require("@angular/cdk/schematics"); class TableTemplateRule extends schematics_1.Migration { constructor() { super(...arguments); this.enabled = this.targetVersion === schematics_1.TargetVersion.V10; } visitTemplate(template) { const content = template.content.replace('nz-table', 'table '); schematics_1.findOutputsOnElementWithTag(content, 'nzSortChangeWithKey', ['th']) .forEach(offset => { this.failures.push({ filePath: template.filePath, position: template.getCharacterAndLineOfPosition(offset), message: `Found deprecated output 'th(nzSortChangeWithKey)'. Please manually remove this output.` }); }); schematics_1.findInputsOnElementWithTag(content, 'nzSingleSort', ['thead']) .forEach(offset => { this.failures.push({ filePath: template.filePath, position: template.getCharacterAndLineOfPosition(offset), message: `Found deprecated input 'thead[nzSingleSort]'. Please manually change to 'th[nzSortFn]'.` }); }); schematics_1.findInputsOnElementWithTag(content, 'nzSortKey', ['th']) .forEach(offset => { this.failures.push({ filePath: template.filePath, position: template.getCharacterAndLineOfPosition(offset), message: `Found deprecated input 'th[nzSortKey]'. Please manually change to 'th[nzSortFn]'.` }); }); } } exports.TableTemplateRule = TableTemplateRule; //# sourceMappingURL=table-template-rule.js.map