table-template-rule.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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.TableTemplateRule = void 0;
  8. const schematics_1 = require("@angular/cdk/schematics");
  9. class TableTemplateRule extends schematics_1.Migration {
  10. constructor() {
  11. super(...arguments);
  12. this.enabled = false;
  13. }
  14. visitTemplate(template) {
  15. const content = template.content.replace('nz-table', 'table ');
  16. (0, schematics_1.findOutputsOnElementWithTag)(content, 'nzSortChangeWithKey', ['th'])
  17. .forEach(offset => {
  18. this.failures.push({
  19. filePath: template.filePath,
  20. position: template.getCharacterAndLineOfPosition(offset),
  21. message: `Found deprecated output 'th(nzSortChangeWithKey)'. Please manually remove this output.`
  22. });
  23. });
  24. (0, schematics_1.findInputsOnElementWithTag)(content, 'nzSingleSort', ['thead'])
  25. .forEach(offset => {
  26. this.failures.push({
  27. filePath: template.filePath,
  28. position: template.getCharacterAndLineOfPosition(offset),
  29. message: `Found deprecated input 'thead[nzSingleSort]'. Please manually change to 'th[nzSortFn]'.`
  30. });
  31. });
  32. (0, schematics_1.findInputsOnElementWithTag)(content, 'nzSortKey', ['th'])
  33. .forEach(offset => {
  34. this.failures.push({
  35. filePath: template.filePath,
  36. position: template.getCharacterAndLineOfPosition(offset),
  37. message: `Found deprecated input 'th[nzSortKey]'. Please manually change to 'th[nzSortFn]'.`
  38. });
  39. });
  40. }
  41. }
  42. exports.TableTemplateRule = TableTemplateRule;
  43. //# sourceMappingURL=table-template-rule.js.map