form-template-rule.js 1.2 KB

1234567891011121314151617181920212223242526272829
  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.FormTemplateRule = void 0;
  8. const schematics_1 = require("@angular/cdk/schematics");
  9. const deprecated_component_1 = require("../utils/deprecated-component");
  10. class FormTemplateRule extends schematics_1.Migration {
  11. constructor() {
  12. super(...arguments);
  13. this.enabled = false;
  14. this.deprecatedComponents = [{
  15. replace: 'nz-form-extra',
  16. replaceWith: 'nz-form-control[nzExtra]'
  17. }, {
  18. replace: 'nz-form-explain',
  19. replaceWith: 'nz-form-control[nzSuccessTip][nzWarningTip][nzErrorTip][nzValidatingTip]...'
  20. }];
  21. }
  22. visitTemplate(template) {
  23. this.deprecatedComponents.forEach(data => {
  24. this.failures.push(...(0, deprecated_component_1.deprecatedComponent)(template, data.replace, data.replaceWith));
  25. });
  26. }
  27. }
  28. exports.FormTemplateRule = FormTemplateRule;
  29. //# sourceMappingURL=form-template-rule.js.map