dropdown-class-rule.js 1.2 KB

123456789101112131415161718192021222324252627282930
  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.DropdownClassRule = void 0;
  8. const schematics_1 = require("@angular/cdk/schematics");
  9. const ts = require("typescript");
  10. class DropdownClassRule extends schematics_1.Migration {
  11. constructor() {
  12. super(...arguments);
  13. this.enabled = false;
  14. }
  15. visitNode(node) {
  16. if (ts.isIdentifier(node)) {
  17. this._visitIdentifier(node);
  18. }
  19. }
  20. _visitIdentifier(identifier) {
  21. if (identifier.getText() === 'NzDropdownContextComponent') {
  22. this.createFailureAtNode(identifier, `Found "NzDropdownContextComponent" which has been removed. Your code need to be updated.`);
  23. }
  24. if (identifier.getText() === 'NzDropdownService') {
  25. this.createFailureAtNode(identifier, `Found usage of "NzDropdownService" which has been removed. Please use "NzContextMenuService" instead.`);
  26. }
  27. }
  28. }
  29. exports.DropdownClassRule = DropdownClassRule;
  30. //# sourceMappingURL=dropdown-class-rule.js.map