@progress/kendo-react-dateinputs
Version:
React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package
9 lines (8 loc) • 2.96 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@progress/kendo-date-math"),y=require("./calendar/models/SelectionRange.js");function S(t){const e=(r,o,s,...c)=>o[s]===null?null:(r?t.isRequired:t)(o,s,...c),n=e.bind(null,!1);return n.isRequired=e.bind(null,!0),n}const w=(t,e,n)=>e===void 0||n===void 0||e<=t&&t<=n?t:t<e?e:n,C=new Date(1980,0,1),F=new Date(1900,0,1),k=new Date(2099,11,31),W=new Date(1980,0,1),q=new Date(1980,0,1,23,59,59),H=(t,e)=>{const n=l.cloneDate(t);return n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n},L=()=>l.getDate(new Date),X=(t,e,n)=>!t||!(e&&e>t||n&&n<t),G=(t,e,n)=>t===null||!(e&&l.getDate(e)>l.getDate(t)||n&&l.getDate(n)<l.getDate(t)),O=(t,e)=>{const{start:n,end:r}=e||y.EMPTY_SELECTIONRANGE;return!n||!r?!1:n<t&&t<r},j=(t,e,n=1)=>{const r=[];for(let o=t;o<e;o=o+n)r.push(o);return r},P=(t,e,n)=>e.getTime()<=t.getTime()&&t.getTime()<=n.getTime(),Y=(t,e)=>t.slice(e).concat(t.slice(0,e)),z=(t,e,n)=>t&&(e&&t<e?l.cloneDate(e):n&&t>n?l.cloneDate(n):t),B=t=>(e,n="",r={})=>{const o=document.createElement(t);return o.className=n,Object.keys(r).map(s=>o.style[s]=r[s]),typeof e=="string"?o.innerHTML=e||"":(e||[]).forEach(s=>s&&o.appendChild(s)),o};function J(t,e,n={}){let r,o;n.maxWait;let s,c,a;const f=window,v=!1,R=!1,I=!e&&e!==0&&typeof f.requestAnimationFrame=="function";if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;function E(i){const u=r,T=o;return r=o=void 0,s=t.apply(T,u),s}function m(i,u){return I?(f.cancelAnimationFrame(c),f.requestAnimationFrame(i)):setTimeout(i,u)}function p(i){if(I)return f.cancelAnimationFrame(i);clearTimeout(i)}function b(i){return c=m(D,e),v?E():s}function d(i){const u=i-a;return e-u}function M(i){const u=i-a;return a===void 0||u>=e||u<0||R}function D(){const i=Date.now();if(M(i))return A();c=m(D,d(i))}function A(i){return c=void 0,r?E():(r=o=void 0,s)}function h(){c!==void 0&&p(c),r=a=o=c=void 0}function N(){return c===void 0?s:A()}function _(){return c!==void 0}function g(...i){const u=Date.now(),T=M(u);return r=i,o=this,a=u,T&&c===void 0?b():(c===void 0&&(c=m(D,e)),s)}return g.cancel=h,g.flush=N,g.pending=_,g}exports.MAX_DATE=k;exports.MAX_TIME=q;exports.MIDNIGHT_DATE=C;exports.MIN_DATE=F;exports.MIN_TIME=W;exports.dateInRange=z;exports.debounce=J;exports.domContainerFactory=B;exports.getToday=L;exports.intersects=P;exports.isInDateRange=G;exports.isInRange=X;exports.isInSelectionRange=O;exports.nullable=S;exports.range=j;exports.setTime=H;exports.shiftWeekNames=Y;exports.viewInRange=w;