From 452abd4b931b3ec2a527ee9be7381d60e60c8ab8 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 27 Jun 2023 13:09:10 -0700 Subject: [PATCH] chore: add setVisible (#7214) * chore: add setVisible * chore: format --- core/icons/icon.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/icons/icon.ts b/core/icons/icon.ts index ee9f522fef3..bdc5129c439 100644 --- a/core/icons/icon.ts +++ b/core/icons/icon.ts @@ -14,6 +14,7 @@ import * as dom from '../utils/dom.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import type {IconType} from './icon_types.js'; +import * as deprecation from '../utils/deprecation.js'; /** * The abstract icon class. Icons are visual elements that live in the top-start @@ -109,4 +110,14 @@ export abstract class Icon implements IIcon { } onClick(): void {} + + /** + * Sets the visibility of the icon's bubble if one exists. + * + * @deprecated Use `setBubbleVisible` instead. To be removed in v11. + */ + setVisible(visibility: boolean): void { + deprecation.warn('setVisible', 'v10', 'v11', 'setBubbleVisible'); + if (hasBubble(this)) this.setBubbleVisible(visibility); + } }