@progress/kendo-angular-menu
Version:
Kendo UI Angular Menu component
53 lines (52 loc) • 1.47 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { ElementRef } from '@angular/core';
import { isDocumentAvailable } from '@progress/kendo-angular-common';
import { caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';
/**
* @hidden
*/
export const defined = (value) => typeof value !== 'undefined';
/**
* @hidden
*/
export const bodyFactory = () => {
if (isDocumentAvailable()) {
return new ElementRef(document.body);
}
};
/**
* @hidden
*/
export const getSizeClass = (size) => {
const SIZE_CLASSES = {
'small': 'k-menu-group-sm',
'medium': 'k-menu-group-md',
'large': 'k-menu-group-lg'
};
return SIZE_CLASSES[size];
};
/**
* @hidden
*/
export const getFontIcon = (horizontal, rtl) => {
const icon = horizontal ?
rtl ?
'caret-alt-left' :
'caret-alt-right' :
'caret-alt-down';
return icon;
};
/**
* @hidden
*/
export const getSVGIcon = (horizontal, rtl) => {
const icon = horizontal ?
rtl ?
caretAltLeftIcon :
caretAltRightIcon :
caretAltDownIcon;
return icon;
};