grid-template-rule.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. /**
  3. * Use of this source code is governed by an MIT-style license that can be
  4. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  5. */
  6. Object.defineProperty(exports, "__esModule", { value: true });
  7. exports.GridTemplateRule = void 0;
  8. const schematics_1 = require("@angular/cdk/schematics");
  9. class GridTemplateRule extends schematics_1.Migration {
  10. constructor() {
  11. super(...arguments);
  12. this.enabled = false;
  13. }
  14. visitTemplate(template) {
  15. const offsets = [];
  16. offsets.push(...(0, schematics_1.findInputsOnElementWithAttr)(template.content, 'nzType', ['nz-row']));
  17. offsets.push(...(0, schematics_1.findInputsOnElementWithTag)(template.content, 'nzType', ['nz-form-item', 'nz-row']));
  18. offsets.forEach(offset => {
  19. this.failures.push({
  20. filePath: template.filePath,
  21. position: template.getCharacterAndLineOfPosition(offset),
  22. message: `Found deprecated input '[nzType]'. Please manually remove this input.`
  23. });
  24. });
  25. (0, schematics_1.findInputsOnElementWithTag)(template.content, 'nzFlex', ['nz-form-item']).forEach(offset => {
  26. this.failures.push({
  27. filePath: template.filePath,
  28. position: template.getCharacterAndLineOfPosition(offset),
  29. message: `Found deprecated input '[nzFlex]'. Please manually remove this input.`
  30. });
  31. });
  32. }
  33. }
  34. exports.GridTemplateRule = GridTemplateRule;
  35. //# sourceMappingURL=grid-template-rule.js.map