@progress/kendo-react-dateinputs 14.5.0-develop.13 → 14.5.0-develop.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CalendarMcpWrapper.d.ts +16 -0
- package/CalendarMcpWrapper.js +8 -0
- package/CalendarMcpWrapper.mjs +18 -0
- package/DateRangePickerMcpWrapper.d.ts +16 -0
- package/DateRangePickerMcpWrapper.js +8 -0
- package/DateRangePickerMcpWrapper.mjs +18 -0
- package/DateTimePickerMcpWrapper.d.ts +16 -0
- package/DateTimePickerMcpWrapper.js +8 -0
- package/DateTimePickerMcpWrapper.mjs +18 -0
- package/TimePickerMcpWrapper.d.ts +16 -0
- package/TimePickerMcpWrapper.js +8 -0
- package/TimePickerMcpWrapper.mjs +18 -0
- package/calendar/components/Calendar.d.ts +6 -1
- package/calendar/components/Calendar.mjs +5 -5
- package/datepicker/DatePicker.d.ts +6 -1
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +111 -111
- package/daterangepicker/DateRangePicker.d.ts +6 -1
- package/daterangepicker/DateRangePicker.mjs +8 -8
- package/datetimepicker/DateTimePicker.d.ts +6 -1
- package/datetimepicker/DateTimePicker.mjs +7 -7
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +12 -4
- package/index.d.ts +12 -4
- package/index.js +1 -1
- package/index.mjs +110 -105
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/timepicker/TimePicker.d.ts +6 -1
- package/timepicker/TimePicker.mjs +8 -8
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { CalendarHandle, CalendarProps } from './calendar/components/Calendar.js';
|
|
9
|
+
/**
|
|
10
|
+
* Calendar wrapper that integrates the Web MCP hook.
|
|
11
|
+
*
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
/** @hidden */
|
|
16
|
+
export declare const CalendarWrapper: React.ForwardRefExoticComponent<CalendarProps<any> & React.RefAttributes<CalendarHandle>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),d=require("./calendar/components/Calendar.js"),a=require("@progress/kendo-react-common");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const c=u(l),o=c.forwardRef((e,t)=>{const[r,n]=a.useMergedRef(t);return a.useWebMcpRegister("calendar",r,e,e.webMcp),c.createElement(d.Calendar,{...e,ref:n})});o.displayName="KendoReactCalendar";exports.CalendarWrapper=o;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import { Calendar as d } from "./calendar/components/Calendar.mjs";
|
|
10
|
+
import { useMergedRef as f, useWebMcpRegister as m } from "@progress/kendo-react-common";
|
|
11
|
+
const o = r.forwardRef((e, a) => {
|
|
12
|
+
const [t, n] = f(a);
|
|
13
|
+
return m("calendar", t, e, e.webMcp), /* @__PURE__ */ r.createElement(d, { ...e, ref: n });
|
|
14
|
+
});
|
|
15
|
+
o.displayName = "KendoReactCalendar";
|
|
16
|
+
export {
|
|
17
|
+
o as CalendarWrapper
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { DateRangePickerHandle, DateRangePickerProps } from './daterangepicker/DateRangePicker.js';
|
|
9
|
+
/**
|
|
10
|
+
* DateRangePicker wrapper that integrates the Web MCP hook.
|
|
11
|
+
*
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
/** @hidden */
|
|
16
|
+
export declare const DateRangePickerWrapper: React.ForwardRefExoticComponent<DateRangePickerProps & React.RefAttributes<DateRangePickerHandle>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),u=require("./daterangepicker/DateRangePicker.js"),a=require("@progress/kendo-react-common");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const c=f(i),o=c.forwardRef((e,r)=>{const[t,n]=a.useMergedRef(r);return a.useWebMcpRegister("daterangepicker",t,e,e.webMcp),c.createElement(u.DateRangePicker,{...e,ref:n})});o.displayName="KendoReactDateRangePicker";exports.DateRangePickerWrapper=o;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import { DateRangePicker as n } from "./daterangepicker/DateRangePicker.mjs";
|
|
10
|
+
import { useMergedRef as i, useWebMcpRegister as R } from "@progress/kendo-react-common";
|
|
11
|
+
const f = r.forwardRef((e, a) => {
|
|
12
|
+
const [t, c] = i(a);
|
|
13
|
+
return R("daterangepicker", t, e, e.webMcp), /* @__PURE__ */ r.createElement(n, { ...e, ref: c });
|
|
14
|
+
});
|
|
15
|
+
f.displayName = "KendoReactDateRangePicker";
|
|
16
|
+
export {
|
|
17
|
+
f as DateRangePickerWrapper
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { DateTimePickerHandle, DateTimePickerProps } from './datetimepicker/DateTimePicker.js';
|
|
9
|
+
/**
|
|
10
|
+
* DateTimePicker wrapper that integrates the Web MCP hook.
|
|
11
|
+
*
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
/** @hidden */
|
|
16
|
+
export declare const DateTimePickerWrapper: React.ForwardRefExoticComponent<DateTimePickerProps & React.RefAttributes<DateTimePickerHandle>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),u=require("./datetimepicker/DateTimePicker.js"),n=require("@progress/kendo-react-common");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const a=f(o),i=a.forwardRef((e,r)=>{const[t,c]=n.useMergedRef(r);return n.useWebMcpRegister("datetimepicker",t,e,e.webMcp),a.createElement(u.DateTimePicker,{...e,ref:c})});i.displayName="KendoReactDateTimePicker";exports.DateTimePickerWrapper=i;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import { DateTimePicker as a } from "./datetimepicker/DateTimePicker.mjs";
|
|
10
|
+
import { useMergedRef as c, useWebMcpRegister as f } from "@progress/kendo-react-common";
|
|
11
|
+
const o = r.forwardRef((e, t) => {
|
|
12
|
+
const [i, m] = c(t);
|
|
13
|
+
return f("datetimepicker", i, e, e.webMcp), /* @__PURE__ */ r.createElement(a, { ...e, ref: m });
|
|
14
|
+
});
|
|
15
|
+
o.displayName = "KendoReactDateTimePicker";
|
|
16
|
+
export {
|
|
17
|
+
o as DateTimePickerWrapper
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { TimePickerHandle, TimePickerProps } from './timepicker/TimePicker.js';
|
|
9
|
+
/**
|
|
10
|
+
* TimePicker wrapper that integrates the Web MCP hook.
|
|
11
|
+
*
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
/** @hidden */
|
|
16
|
+
export declare const TimePickerWrapper: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<TimePickerHandle>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),u=require("./timepicker/TimePicker.js"),n=require("@progress/kendo-react-common");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=f(a),o=i.forwardRef((e,r)=>{const[t,c]=n.useMergedRef(r);return n.useWebMcpRegister("timepicker",t,e,e.webMcp),i.createElement(u.TimePicker,{...e,ref:c})});o.displayName="KendoReactTimePicker";exports.TimePickerWrapper=o;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import { TimePicker as c } from "./timepicker/TimePicker.mjs";
|
|
10
|
+
import { useMergedRef as f, useWebMcpRegister as o } from "@progress/kendo-react-common";
|
|
11
|
+
const a = r.forwardRef((e, i) => {
|
|
12
|
+
const [m, t] = f(i);
|
|
13
|
+
return o("timepicker", m, e, e.webMcp), /* @__PURE__ */ r.createElement(c, { ...e, ref: t });
|
|
14
|
+
});
|
|
15
|
+
a.displayName = "KendoReactTimePicker";
|
|
16
|
+
export {
|
|
17
|
+
a as TimePickerWrapper
|
|
18
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { DateInputsClassStructure } from '@progress/kendo-react-common';
|
|
8
|
+
import { DateInputsClassStructure, WebMcpProps } from '@progress/kendo-react-common';
|
|
9
9
|
import { CalendarViewEnum, ActiveView, CalendarSettings } from '../models/index.js';
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
/**
|
|
@@ -57,6 +57,11 @@ export interface CalendarProps<T = any> extends CalendarSettings {
|
|
|
57
57
|
* @hidden
|
|
58
58
|
*/
|
|
59
59
|
unstyled?: DateInputsClassStructure;
|
|
60
|
+
/**
|
|
61
|
+
* Enables Web MCP tool registration for this component.
|
|
62
|
+
* Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
|
|
63
|
+
*/
|
|
64
|
+
webMcp?: boolean | WebMcpProps;
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
67
|
* @hidden
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import n from "prop-types";
|
|
10
|
-
import {
|
|
10
|
+
import { createPropsContext as Xe, usePropsContext as je, useUnstyled as Ge, useId as Je, setScrollbarWidth as re, classNames as Qe, uCalendar as Ze, Keys as N } from "@progress/kendo-react-common";
|
|
11
11
|
import { getDate as C, isEqualDate as H, cloneDate as I } from "@progress/kendo-date-math";
|
|
12
12
|
import { useInternationalization as et } from "@progress/kendo-react-intl";
|
|
13
13
|
import { ViewList as tt } from "./ViewList.mjs";
|
|
@@ -29,8 +29,8 @@ const W = (r) => r ? r.virtualization : null, ie = (r, o, a = i.min, u = i.max)
|
|
|
29
29
|
topView: "century",
|
|
30
30
|
bottomView: "month",
|
|
31
31
|
showOtherMonthDays: !1
|
|
32
|
-
}, ut =
|
|
33
|
-
const a =
|
|
32
|
+
}, ut = Xe(), T = t.forwardRef((r, o) => {
|
|
33
|
+
const a = je(ut, r), u = Ge(), v = Je(a.id), se = et(), {
|
|
34
34
|
disabled: R = i.disabled,
|
|
35
35
|
min: ue = i.min,
|
|
36
36
|
max: le = i.max,
|
|
@@ -186,8 +186,8 @@ const W = (r) => r ? r.virtualization : null, ie = (r, o, a = i.min, u = i.max)
|
|
|
186
186
|
B(Le && O !== null ? O : l.focusedDate, d, w)
|
|
187
187
|
);
|
|
188
188
|
b.current.configure(_, $);
|
|
189
|
-
const S = b.current.service(ne, se), { smoothScroll: Ye = Number.parseFloat(t.version) < 18 } = a, He =
|
|
190
|
-
|
|
189
|
+
const S = b.current.service(ne, se), { smoothScroll: Ye = Number.parseFloat(t.version) < 18 } = a, He = Qe(
|
|
190
|
+
Ze.wrapper({
|
|
191
191
|
c: ze,
|
|
192
192
|
disabled: R,
|
|
193
193
|
weekNumber: X,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { PopupProps } from '@progress/kendo-react-popup';
|
|
9
|
-
import { FormComponentProps, FormComponentValidity, AdaptiveModeContextType } from '@progress/kendo-react-common';
|
|
9
|
+
import { FormComponentProps, FormComponentValidity, AdaptiveModeContextType, WebMcpProps } from '@progress/kendo-react-common';
|
|
10
10
|
import { DateInputHandle, DateInputProps } from '../dateinput/DateInput.js';
|
|
11
11
|
import { Calendar, CalendarProps } from '../calendar/components/Calendar.js';
|
|
12
12
|
import { DatePickerSettings } from './models/index.js';
|
|
@@ -179,6 +179,11 @@ export interface DatePickerProps extends DatePickerSettings, FormComponentProps,
|
|
|
179
179
|
* Attributes required for core logic are ignored.
|
|
180
180
|
*/
|
|
181
181
|
inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
182
|
+
/**
|
|
183
|
+
* Enables Web MCP tool registration for this component.
|
|
184
|
+
* Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
|
|
185
|
+
*/
|
|
186
|
+
webMcp?: boolean | WebMcpProps;
|
|
182
187
|
/**
|
|
183
188
|
* @hidden
|
|
184
189
|
* This prop is provided by the withAdaptiveModeContext HOC to subscribe to AdaptiveModeContext.
|
package/datepicker/DatePicker.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("react"),t=require("prop-types"),st=require("@progress/kendo-react-popup"),j=require("@progress/kendo-date-math"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("react"),t=require("prop-types"),st=require("@progress/kendo-react-popup"),j=require("@progress/kendo-date-math"),u=require("@progress/kendo-react-common"),ct=require("@progress/kendo-svg-icons"),dt=require("../dateinput/DateInput.js"),ft=require("../calendar/components/Calendar.js"),r=require("../utils.js"),U=require("../messages/index.js"),mt=require("@progress/kendo-react-intl"),gt=require("./ToggleButton.js"),pt=require("../hooks/usePickerFloatingLabel.js"),bt=require("@progress/kendo-react-layout"),ht=require("../common/AdaptiveMode.js");function vt(n){const D=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const f in n)if(f!=="default"){const S=Object.getOwnPropertyDescriptor(n,f);Object.defineProperty(D,f,S.get?S:{enumerable:!0,get:()=>n[f]})}}return D.default=n,Object.freeze(D)}const o=vt(it),H=o.forwardRef((n,D)=>{const f=u.useId(n.id),S=mt.useLocalization(),C=u.useAdaptiveModeContext(),{defaultShow:me=l.defaultShow,defaultValue:ge=l.defaultValue,dateInput:pe=l.dateInput,calendar:be=l.calendar,toggleButton:he=l.toggleButton,popup:ve=l.popup,disabled:p=l.disabled,format:we=l.format,max:k=l.max,min:P=l.min,popupSettings:O=l.popupSettings,tabIndex:ye=l.tabIndex,weekNumber:De=l.weekNumber,validityStyles:Y=l.validityStyles,size:B=l.size,rounded:E=l.rounded,fillMode:x=l.fillMode,autoFocus:Ce=l.autoFocus,show:$,autoSwitchParts:ke,autoSwitchKeys:Pe,twoDigitYearMax:Oe,ariaLabel:Me,adaptive:wt,adaptiveTitle:Re=n.label||void 0,adaptiveSubtitle:Se,formatPlaceholder:Ie,inputAttributes:_e,validationMessage:X,visited:yt,value:q,touched:Dt,modified:Ct,_adaptiveMode:kt=C,valid:Z,focusedDate:Te,id:Be,ariaLabelledBy:Ee,ariaDescribedBy:xe,placeholder:qe,onChange:G,onOpen:J,onClose:Q,...ee}=u.usePropsContext(fe,n),N=()=>{if(u.canUseDOM)return m.current&&m.current.ownerDocument||window.document},c=()=>!!(y.windowWidth&&C&&y.windowWidth<=(C==null?void 0:C.medium)&&n.adaptive),b=()=>{const e=I.current!==void 0?I.current:q!==void 0?q:y.value;return e!==null?j.cloneDate(e):null},i=()=>_.current!==void 0?_.current:$!==void 0?$:y.show,Ne=()=>pe||l.dateInput,Ae=()=>he||l.toggleButton,Fe=()=>be||l.calendar,ze=()=>ve||l.popup,te=()=>n.required!==void 0?n.required:!1,A=()=>{const e=b()||q||null,a=P,s=k,T=r.isInDateRange(e,a,s),L=X!==void 0,V=(!te()||e!=null)&&T,W=Z!==void 0?Z:V;return{customError:L,rangeOverflow:e&&s.getTime()<e.getTime()||!1,rangeUnderflow:e&&e.getTime()<a.getTime()||!1,valid:W,valueMissing:e===null}},Ke=e=>{for(const a of e)R({windowWidth:a.target.clientWidth})},Le=()=>{d.current&&d.current.focus()},ne=e=>{g.current=e},h=e=>{i()!==e&&(R({show:e}),e&&J&&J({target:v.current}),!e&&Q&&Q({target:v.current}))},Ve=e=>{const a=b();return a&&e?r.setTime(e,a):e},We=e=>{O!=null&&O.onMouseDownOutside&&O.onMouseDownOutside(e)},F=(e,a)=>{R({value:j.cloneDate(e||void 0)}),I.current=e,_.current=!1,c()||(w.current=!0),G&&G({syntheticEvent:a.syntheticEvent,nativeEvent:a.nativeEvent,value:b(),show:i(),target:v.current}),I.current=void 0,_.current=void 0,h(!1)},je=e=>{const a=Ve(e.value);F(a,e)},ae=()=>{const{popupClass:e,...a}=O,s=i(),T=b(),L=T&&j.getDate(T),V=u.classNames(e),W={popupClass:"k-datepicker-popup",show:s,anchor:m.current,className:V,id:le,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...a,onMouseDownOutside:We},ce={disabled:p,value:L,min:P,max:k,weekNumber:De,focusedDate:Te,className:c()?"k-calendar-lg":"",navigation:!c(),onChange:je},de=Fe(),ut=ze();return c()?o.createElement(de,{_ref:ne,...ce}):o.createElement(ut,{...W},o.createElement(de,{_ref:ne,...ce}))},oe=()=>{R({focused:!1}),h(!1)},Ue=()=>{const{windowWidth:e=0}=y,a={expand:i(),onClose:oe,title:Re,subTitle:Se,windowWidth:e};return o.createElement(ht.AdaptiveMode,{...a},o.createElement(bt.ActionSheetContent,null,ae()))},He=e=>{F(e.value,e)},Ye=()=>{R({focused:!0})},$e=()=>{h(!i())},z=()=>{p||(w.current=!0,h(!i()))},Xe=e=>{e.preventDefault()},Ze=e=>{const{altKey:a,keyCode:s}=e;if(s===u.Keys.esc&&i()){w.current=!0,h(!1);return}a&&(s===u.Keys.up||s===u.Keys.down)&&(e.preventDefault(),e.stopPropagation(),w.current=s===u.Keys.up,h(s===u.Keys.down))},v=o.useRef(null),m=o.useRef(null),d=o.useRef(null),g=o.useRef(null);o.useImperativeHandle(v,()=>({props:n,get element(){return m.current},get calendar(){return g.current},get dateInput(){return d.current},get name(){return n.name},get show(){return i()},get validity(){return A()},get value(){return b()},get mobileMode(){return c()},togglePopup:$e,focus:Le})),o.useImperativeHandle(D,()=>v.current),u.useWebMcpRegister("datepicker",v,n,n.webMcp);const I=o.useRef(void 0),_=o.useRef(void 0),Ge=o.useRef(null),w=o.useRef(!1),K=o.useRef(!1),M=o.useRef(null),[y,Je]=o.useState({value:ge,show:me,focused:!1}),[,Qe]=o.useReducer(e=>e,!0),re=n.name||f||void 0,et=o.useCallback(e=>{if(p)return;let a=null;if(e!=null){if(e instanceof Date)a=e;else if(typeof e=="string"||typeof e=="number"){const s=new Date(e);isNaN(s.getTime())||(a=s)}}if(a&&r.isInDateRange(a,P,k)){const s={target:m.current,currentTarget:m.current};F(a,{syntheticEvent:s})}},[p,P,k]);u.useKendoPaste(m,{fieldName:re,onValueChange:et,enabled:!!re});const R=e=>{Je(a=>({...a,...e}))};o.useEffect(()=>{g.current&&g.current.element&&i()&&!K.current&&g.current.element.focus({preventScroll:!0}),c()&&i()&&!K.current&&setTimeout(()=>{g.current&&g.current.element&&g.current.element.focus({preventScroll:!0})},300),d.current&&d.current.element&&!i()&&w.current&&d.current.element.focus({preventScroll:!0}),K.current=i(),w.current=!1}),o.useEffect(()=>{var e;return M.current=u.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(a=>Ke(a)),i()&&Qe(),(e=N())!=null&&e.body&&M.current&&M.current.observe(N().body),()=>{var a;clearTimeout(Ge.current),(a=N())!=null&&a.body&&M.current&&M.current.disconnect()}},[]);const le=f+"-popup-id",tt=ae(),nt=Ne(),at=b(),ot=Ae(),rt=Ue(),ue=!Y||A().valid,ie=S.toLanguageString(U.toggleCalendar,U.messages[U.toggleCalendar]),lt={disabled:p,format:we,formatPlaceholder:Ie,id:Be,ariaLabelledBy:Ee,ariaDescribedBy:xe,ariaLabel:Me,max:k,min:P,name:n.name,onChange:He,required:n.required,_ref:d,tabIndex:i()?-1:ye,title:n.title,valid:A().valid,validationMessage:X,validityStyles:Y,value:at,label:void 0,placeholder:y.focused?null:qe,ariaExpanded:i(),autoFill:n.autoFill,twoDigitYearMax:Oe,enableMouseWheel:n.enableMouseWheel,autoCorrectParts:n.autoCorrectParts,autoSwitchParts:ke,autoSwitchKeys:Pe,allowCaretMode:n.allowCaretMode,inputAttributes:_e},se=o.createElement(u.AsyncFocusBlur,{onFocus:Ye,onBlur:c()?void 0:oe,onSyncBlur:n.onBlur,onSyncFocus:n.onFocus},e=>o.createElement(o.Fragment,null,o.createElement("span",{...n.label?{}:ee,ref:m,className:u.classNames("k-input","k-datepicker",{[`k-input-${u.kendoThemeMaps.sizeMap[B]||B}`]:B,[`k-rounded-${u.kendoThemeMaps.roundedMap[E]||E}`]:E,[`k-input-${x}`]:x,"k-invalid":!ue,"k-required":te(),"k-disabled":p},n.className),onKeyDown:Ze,style:{width:n.width},onFocus:c()?z:e.onFocus,onBlur:e.onBlur,onClick:c()?z:void 0},o.createElement(nt,{_ref:d,ariaRole:"combobox",ariaExpanded:i(),ariaControls:i()?le:void 0,autoFocus:Ce,...lt}),o.createElement(ot,{type:"button",icon:"calendar",svgIcon:ct.calendarIcon,title:ie,className:"k-input-button",onClick:c()?void 0:z,"aria-label":ie,fillMode:x,onMouseDown:Xe}),!c()&&tt),c()&&rt));return n.label?o.createElement(pt.PickerFloatingLabel,{dateInput:d,label:n.label,editorId:f,editorValid:ue,editorDisabled:p,children:se,style:{width:n.width},...ee}):se});H.propTypes={className:t.string,defaultShow:t.bool,defaultValue:t.instanceOf(Date),disabled:t.bool,focusedDate:t.instanceOf(Date),format:t.oneOfType([t.string,t.shape({skeleton:r.nullable(t.string),pattern:r.nullable(t.string),date:r.nullable(t.oneOf(["short","medium","long","full"])),time:r.nullable(t.oneOf(["short","medium","long","full"])),datetime:r.nullable(t.oneOf(["short","medium","long","full"])),era:r.nullable(t.oneOf(["narrow","short","long"])),year:r.nullable(t.oneOf(["numeric","2-digit"])),month:r.nullable(t.oneOf(["numeric","2-digit","narrow","short","long"])),day:r.nullable(t.oneOf(["numeric","2-digit"])),weekday:r.nullable(t.oneOf(["narrow","short","long"])),hour:r.nullable(t.oneOf(["numeric","2-digit"])),hour12:r.nullable(t.bool),minute:r.nullable(t.oneOf(["numeric","2-digit"])),second:r.nullable(t.oneOf(["numeric","2-digit"])),timeZoneName:r.nullable(t.oneOf(["short","long"]))})]),formatPlaceholder:t.oneOfType([r.nullable(t.oneOf(["wide","narrow","short","formatPattern"])),t.shape({year:r.nullable(t.string),month:r.nullable(t.string),day:r.nullable(t.string),hour:r.nullable(t.string),minute:r.nullable(t.string),second:r.nullable(t.string)})]),id:t.string,ariaLabelledBy:t.string,ariaDescribedBy:t.string,ariaLabel:t.string,min:t.instanceOf(Date),max:t.instanceOf(Date),name:t.string,popupSettings:t.shape({animate:r.nullable(t.bool),appendTo:r.nullable(t.any),popupClass:r.nullable(t.string)}),show:t.bool,tabIndex:t.number,title:t.string,value:t.instanceOf(Date),weekNumber:t.bool,width:t.oneOfType([t.number,t.string]),validationMessage:t.string,required:t.bool,valid:t.bool,size:t.oneOf(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full","none"]),fillMode:t.oneOf(["solid","flat","outline"]),adaptive:t.bool,adaptiveTitle:t.string,adaptiveSubtitle:t.string,autoFocus:t.bool,inputAttributes:t.object};const l={defaultShow:!1,defaultValue:null,dateInput:dt.DateInput,calendar:ft.Calendar,toggleButton:gt.ToggleButton,popup:st.Popup,disabled:!1,format:"d",max:r.MAX_DATE,min:r.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1},fe=u.createPropsContext();H.displayName="KendoReactDatePicker";exports.DatePicker=H;exports.DatePickerPropsContext=fe;exports.datePickerDefaultProps=l;
|