fix(core-dialogs): CB-875 toolTip -> tooltip

This commit is contained in:
Naumov Alexey
2021-04-22 12:23:03 +03:00
parent 5b7f13be20
commit bb330e351a
6 changed files with 14 additions and 14 deletions
@@ -85,8 +85,8 @@ class ComputedMenuItemOptionsWithContext<T> implements IComputedMenuItemOptions
// set title or getter
title?: TLocalizationToken;
titleGetter?: () => TLocalizationToken | undefined;
toolTip?: TLocalizationToken;
toolTipGetter?: () => TLocalizationToken | undefined;
tooltip?: TLocalizationToken;
tooltipGetter?: () => TLocalizationToken | undefined;
isDisabled?: () => boolean;
isHidden?: () => boolean;
// set icon or getter
@@ -101,8 +101,8 @@ class ComputedMenuItemOptionsWithContext<T> implements IComputedMenuItemOptions
// doesn't depend on context
this.title = options.title;
this.titleGetter = options.titleGetter;
this.toolTip = options.toolTip;
this.toolTipGetter = options.toolTipGetter;
this.tooltip = options.tooltip;
this.tooltipGetter = options.tooltipGetter;
this.icon = options.icon;
this.type = options.type;
this.separator = options.separator;
@@ -29,7 +29,7 @@ export interface IMenuItem {
isDisabled?: boolean;
isHidden?: boolean;
icon?: string; // path to icon or svg icon name
toolTip?: string;
tooltip?: string;
panel?: IMenuPanel; // if menu has sub-items
type?: MenuItemType;
separator?: boolean;
@@ -35,11 +35,11 @@ export class ComputedMenuItemModel implements IMenuItem {
return this.options.titleGetter ? this.options.titleGetter() || '' : '';
}
get toolTip() {
if (this.options.toolTip) {
return this.options.toolTip;
get tooltip() {
if (this.options.tooltip) {
return this.options.tooltip;
}
return this.options.toolTipGetter ? this.options.toolTipGetter() : undefined;
return this.options.tooltipGetter ? this.options.tooltipGetter() : undefined;
}
get isDisabled() {
@@ -64,7 +64,7 @@ export class ComputedMenuItemModel implements IMenuItem {
constructor(private options: IComputedMenuItemOptions) {
makeObservable(this, {
title: computed,
toolTip: computed,
tooltip: computed,
isDisabled: computed,
icon: computed,
isHidden: computed,
@@ -22,8 +22,8 @@ export interface IMenuItemOptions {
// set icon or getter
icon?: string;
iconGetter?: () => string | undefined;
toolTip?: string;
toolTipGetter?: () => TLocalizationToken | undefined;
tooltip?: string;
tooltipGetter?: () => TLocalizationToken | undefined;
order?: number;
isPanel?: boolean;
panel?: IMenuPanel;
@@ -35,7 +35,7 @@ export class DataExportMenuService {
},
order: 5,
title: 'data_transfer_dialog_export',
toolTip: 'data_transfer_dialog_export_tooltip',
tooltip: 'data_transfer_dialog_export_tooltip',
icon: 'table-export',
onClick: this.exportData.bind(this),
});
@@ -70,7 +70,7 @@ export const TableFooterMenuItem = observer(function TableFooterMenuItem({
as="button"
{...props}
disabled={menuItem.isDisabled}
title={translate(menuItem.toolTip || '')}
title={menuItem.tooltip ? translate(menuItem.tooltip) : ''}
onClick={() => menuItem.onClick?.()}
>
{menuItem.icon && (