@progress/kendo-angular-dateinputs
Version:
Kendo UI for Angular Date Inputs Package - Everything you need to add date selection functionality to apps (DatePicker, TimePicker, DateInput, DateRangePicker, DateTimePicker, Calendar, and MultiViewCalendar).
78 lines (77 loc) • 2.5 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* 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 requiresZoneOnBlur = (ngControl) => ngControl &&
(!ngControl.touched || (ngControl.control && ngControl.control.updateOn === 'blur'));
/**
* @hidden
*/
export const preventDefault = (args) => args.preventDefault();
/**
* @hidden
*/
export const currentFocusTarget = (blurArgs) => blurArgs.relatedTarget || document.activeElement;
/**
* @hidden
*/
export const isPresent = (value) => value !== undefined && value !== null;
/**
* @hidden
*/
export const isNullOrDate = (value) => value === null || value instanceof Date;
/**
* @hidden
*/
export const isTruthy = (value) => !!value;
/**
* @hidden
*
* If the provided parameter is an array with at least one item
* and all items in the array are numbers, returns `true.
*/
export const isNumberArray = (value) => Array.isArray(value) && value.length > 0 && value.every(item => typeof item === 'number');
/**
* @hidden
*
* If the provided parameter is an array with at least one item
* and all items in the array are dates, returns `true`.
*/
export const isDateArray = (value) => Array.isArray(value) && value.length > 0 && value.every(item => item instanceof Date);
/**
* @hidden
*/
export const isArrowWithShiftPressed = (args) => args.shiftKey && (args.keyCode === Keys.ArrowRight || args.keyCode === Keys.ArrowLeft || args.keyCode === Keys.ArrowDown || args.keyCode === Keys.ArrowUp);
/**
* @hidden
* Enum with key codes.
*/
export var Keys;
(function (Keys) {
Keys[Keys["ArrowDown"] = 40] = "ArrowDown";
Keys[Keys["ArrowLeft"] = 37] = "ArrowLeft";
Keys[Keys["ArrowRight"] = 39] = "ArrowRight";
Keys[Keys["ArrowUp"] = 38] = "ArrowUp";
})(Keys || (Keys = {}));
/**
* @hidden
*/
export const selectors = {
infiniteCalendarTable: '.k-content .k-calendar-table',
multiViewCalendarTable: '.k-calendar-table'
};
/**
* @hidden
*/
export const attributeNames = {
ariaActiveDescendant: 'aria-activedescendant',
ariaControls: 'aria-controls',
ariaExpanded: 'aria-expanded',
ariaHasPopup: 'aria-haspopup',
valueNow: 'aria-valuenow',
valuetext: 'aria-valuetext',
ariaInvalid: 'aria-invalid'
};