tooltip-like-template-rule.js 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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.TooltipLikeTemplateRule = void 0;
  8. const schematics_1 = require("@angular/cdk/schematics");
  9. const deprecated_component_1 = require("../utils/deprecated-component");
  10. class TooltipLikeTemplateRule extends schematics_1.Migration {
  11. constructor() {
  12. super(...arguments);
  13. this.enabled = true;
  14. this.deprecatedComponents = [{
  15. replace: 'nz-tooltip',
  16. replaceWith: '[nz-tooltip]'
  17. }, {
  18. replace: 'nz-popover',
  19. replaceWith: '[nz-popover]'
  20. }, {
  21. replace: 'nz-popconfirm',
  22. replaceWith: '[nz-popconfirm]'
  23. }];
  24. }
  25. visitTemplate(template) {
  26. this.deprecatedComponents.forEach(data => {
  27. this.failures.push(...(0, deprecated_component_1.deprecatedComponent)(template, data.replace, data.replaceWith));
  28. });
  29. }
  30. }
  31. exports.TooltipLikeTemplateRule = TooltipLikeTemplateRule;
  32. //# sourceMappingURL=tooltip-like-template-rule.js.map