Support hint

This commit is contained in:
Tanya Fomina 2024-05-04 17:43:27 +03:00
parent 005e17058e
commit 3ed7f7e85a
3 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,6 @@
/**
*
*/
export class HintContent {
}

View file

@ -6,6 +6,7 @@ import {
} from '../popover-item.types';
import { PopoverItem } from '../popover-item';
import { css } from './popover-item-default.const';
import * as tooltip from '../../../../../utils/tooltip';
/**
* Represents sigle popover item node
@ -197,6 +198,13 @@ export class PopoverItemDefault extends PopoverItem {
el.classList.add(css.disabled);
}
if (params.hint !== undefined) {
tooltip.onHover(el, params.hint.title, {
placement: 'right',
hidingDelay: 100,
});
}
return el;
}

View file

@ -89,6 +89,11 @@ interface PopoverItemDefaultBaseParams {
* In case of string, works like radio buttons group and highlights as inactive any other item that has same toggle key value.
*/
toggle?: boolean | string;
hint?: {
title: string;
description?: string;
}
}
/**