UNPKG

@progress/kendo-angular-label

Version:
34 lines (33 loc) 1.18 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ /** * @hidden */ export const isInputElement = (component) => component instanceof HTMLElement; /** * @hidden */ export const inputElementHasAttr = (element, attribute) => element.hasAttribute(attribute); /** * @hidden */ export const getWrappedNativeInput = (element) => element.querySelector('kendo-label > input, kendo-label > textarea, kendo-label > select'); /** * @hidden */ export const getRootElement = (element) => { if (!element) { return null; } let rootElement = element; while (rootElement.parentElement) { rootElement = rootElement.parentElement; } return rootElement; }; /** * @hidden */ export const nativeLabelForTargets = ['BUTTON', 'INPUT', 'METER', 'OUTPUT', 'PROGRESS', 'SELECT', 'TEXTAREA']; // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label