dropdown-template-rule.js 1.1 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.DropdownTemplateRule = void 0;
  8. const schematics_1 = require("@angular/cdk/schematics");
  9. const deprecated_component_1 = require("../utils/deprecated-component");
  10. class DropdownTemplateRule extends schematics_1.Migration {
  11. constructor() {
  12. super(...arguments);
  13. this.enabled = false;
  14. this.deprecatedComponents = [{
  15. replace: 'nz-dropdown',
  16. replaceWith: '[nz-dropdown]'
  17. }, {
  18. replace: 'nz-dropdown-button',
  19. replaceWith: '[nz-dropdown]'
  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.DropdownTemplateRule = DropdownTemplateRule;
  29. //# sourceMappingURL=dropdown-template-rule.js.map