@progress/kendo-react-dateinputs 9.4.0-develop.24 → 9.4.0-develop.4
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/NOTICE.txt +51 -40
- package/calendar/components/Calendar.js +1 -1
- package/calendar/components/Calendar.mjs +1 -0
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +13 -12
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +4 -3
- package/calendar/components/CalendarNavigationItem.js +1 -1
- package/calendar/components/CalendarNavigationItem.mjs +3 -2
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +9 -8
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +1 -0
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +1 -0
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +1 -0
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +1 -0
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +1 -0
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +1 -0
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +1 -0
- package/calendar/models/CalendarViewEnum.js +1 -1
- package/calendar/models/CalendarViewEnum.mjs +1 -0
- package/calendar/models/NavigationAction.js +1 -1
- package/calendar/models/NavigationAction.mjs +1 -0
- package/calendar/models/SelectionRange.js +1 -1
- package/calendar/models/SelectionRange.mjs +1 -0
- package/calendar/services/BusViewService.js +1 -1
- package/calendar/services/BusViewService.mjs +1 -0
- package/calendar/services/CenturyViewService.js +1 -1
- package/calendar/services/CenturyViewService.mjs +1 -0
- package/calendar/services/DOMService.js +1 -1
- package/calendar/services/DOMService.mjs +1 -0
- package/calendar/services/DecadeViewService.js +1 -1
- package/calendar/services/DecadeViewService.mjs +1 -0
- package/calendar/services/MonthViewService.js +1 -1
- package/calendar/services/MonthViewService.mjs +1 -0
- package/calendar/services/NavigationService.js +1 -1
- package/calendar/services/NavigationService.mjs +19 -18
- package/calendar/services/ScrollSyncService.js +1 -1
- package/calendar/services/ScrollSyncService.mjs +1 -0
- package/calendar/services/WeekNamesService.js +1 -1
- package/calendar/services/WeekNamesService.mjs +6 -5
- package/calendar/services/YearViewService.js +1 -1
- package/calendar/services/YearViewService.mjs +1 -0
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +8 -7
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +8 -7
- package/common/PickerWrap.js +1 -1
- package/common/PickerWrap.mjs +4 -3
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +68 -69
- package/dateinput/dateInputIntl.js +1 -1
- package/dateinput/dateInputIntl.mjs +4 -3
- package/dateinput/utils.js +1 -1
- package/dateinput/utils.mjs +5 -4
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +197 -203
- package/datepicker/ToggleButton.js +1 -1
- package/datepicker/ToggleButton.mjs +4 -3
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +1 -0
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +1 -0
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +1 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -8
- package/hooks/usePickerFloatingLabel.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +6 -5
- package/index.js +1 -2
- package/messages/index.js +1 -1
- package/messages/index.mjs +6 -5
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +3 -2
- package/package.json +9 -9
- package/timepicker/TimeList.js +1 -1
- package/timepicker/TimeList.mjs +17 -16
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +1 -0
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +1 -0
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +1 -0
- package/timepicker/models/TimePart.js +1 -1
- package/timepicker/models/TimePart.mjs +3 -2
- package/timepicker/services/DOMService.js +1 -1
- package/timepicker/services/DOMService.mjs +1 -0
- package/timepicker/services/DayPeriodService.js +1 -1
- package/timepicker/services/DayPeriodService.mjs +4 -3
- package/timepicker/services/HoursService.js +1 -1
- package/timepicker/services/HoursService.mjs +4 -3
- package/timepicker/services/MinutesService.js +1 -1
- package/timepicker/services/MinutesService.mjs +6 -5
- package/timepicker/services/SecondsService.js +1 -1
- package/timepicker/services/SecondsService.mjs +1 -0
- package/timepicker/utils.js +1 -1
- package/timepicker/utils.mjs +1 -0
- package/utils.js +1 -1
- package/utils.mjs +19 -18
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +1 -0
- package/virtualization/services/ScrollerService.js +1 -1
- package/virtualization/services/ScrollerService.mjs +1 -0
package/dateinput/DateInput.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 Ve=require("react"),e=require("prop-types"),I=require("@progress/kendo-date-math"),$=require("@progress/kendo-react-buttons"),G=require("@progress/kendo-svg-icons"),Z=require("@progress/kendo-react-intl"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ve=require("react"),e=require("prop-types"),I=require("@progress/kendo-date-math"),$=require("@progress/kendo-react-buttons"),G=require("@progress/kendo-svg-icons"),Z=require("@progress/kendo-react-intl"),l=require("@progress/kendo-react-common"),pe=require("@progress/kendo-react-labels"),Le=require("@progress/kendo-dateinputs-common"),k=require("./utils.js"),Ne=require("../package-metadata.js"),c=require("../utils.js"),s=require("../messages/index.js"),Ae=require("../timepicker/utils.js"),_e=require("../common/ClearButton.js"),Be=require("./dateInputIntl.js");function je(t){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const m in t)if(m!=="default"){const O=Object.getOwnPropertyDescriptor(t,m);Object.defineProperty(b,m,O.get?O:{enumerable:!0,get:()=>t[m]})}}return b.default=t,Object.freeze(b)}const a=je(Ve),Fe="Please enter a valid value!",p=a.forwardRef((t,b)=>{var J;l.validatePackage(Ne.packageMetadata);const m=l.useId(t.id),O=Z.useInternationalization(),E=Z.useLocalization(),Q=l.useUnstyled(),L=l.usePropsContext(V,t).unstyled||Q,{format:w=r.format,size:ee=r.size,rounded:te=r.rounded,fillMode:ne=r.fillMode,formatPlaceholder:ae=r.formatPlaceholder,spinners:re=r.spinners,disabled:C=r.disabled,min:ie=r.min,max:le=r.max,minTime:ue=r.minTime,maxTime:oe=r.maxTime,validityStyles:se=r.validityStyles,validationMessage:N=r.validationMessage,placeholder:y=r.placeholder,enableMouseWheel:ce=r.enableMouseWheel,autoCorrectParts:de=r.autoCorrectParts,autoSwitchParts:fe=r.autoSwitchParts,allowCaretMode:me=r.allowCaretMode,twoDigitYearMax:ge=r.twoDigitYearMax,ariaHasPopup:ve=r.ariaHasPopup,autoFocus:be=r.autoFocus}=l.usePropsContext(V,t),g=()=>M.current!==void 0?M.current:u.current&&u.current.value,A=()=>{const n=u.current&&u.current.currentText||"",i=g();return y!=null&&!we.focused&&!i?y:n},_=()=>t.required!==void 0?t.required:!1,P=()=>{const n=g()||t.value,i=ie,X=le,Te=k.isInRange(n,i,X)&&Ae.isInTimeRange(n,ue,oe),qe=N!==void 0,Se=(!_()||n!=null)&&Te,ke=t.valid!==void 0?t.valid:Se;return{customError:qe,rangeOverflow:n&&X.getTime()<n.getTime()||!1,rangeUnderflow:n&&n.getTime()<i.getTime()||!1,valid:ke,valueMissing:n===null}},ye=()=>{o.current&&o.current.focus()},B=()=>new Be.DateInputIntl(O),R=()=>{const n=g();return{format:w,steps:t.steps,formatPlaceholder:ae,placeholder:y,selectPreviousSegmentOnBackspace:!0,value:t.value||n,intlService:B(),autoFill:t.autoFill!==void 0?t.autoFill:!1,enableMouseWheel:ce,autoCorrectParts:de,autoSwitchParts:fe,autoSwitchKeys:t.autoSwitchKeys||[],twoDigitYearMax:ge,allowCaretMode:me}},he=n=>{d.current&&d.current.classList.add("k-focus"),U({focused:!0})},De=n=>{d.current&&d.current.classList.remove("k-focus"),U({focused:!1})},Ie=(n,i)=>typeof n!=typeof i?!0:typeof n=="string"&&typeof i=="string"?n!==i:typeof n=="object"&&typeof i=="object"?JSON.stringify(n)!==JSON.stringify(i):!1,Oe=n=>typeof n=="string"?n:{inputFormat:n,displayFormat:n},j=n=>{M.current=g(),Pe(),v.current=n,M.current=void 0},F=n=>{t.onChange&&t.onChange(n)},H=n=>{l.getActiveElement(document)===o.current&&n.preventDefault()},Ee=()=>new Le.DateInput(o.current,{...R(),format:Oe(R().format),events:{focus:he,blur:De,valueChange:j,click:F}}),z=()=>{o.current&&o.current.setCustomValidity&&o.current.setCustomValidity(P().valid?"":N||r.validationMessage)},Ce=n=>{!o.current||!u.current||j(n)},Re=n=>{n.preventDefault();const i=l.getActiveElement(document);o.current&&i!==o.current&&o.current.focus({preventScroll:!0})},f=n=>{const i=g();v.current&&t.onChange&&!I.isEqual(v.current.oldValue,i)&&t.onChange.call(void 0,{syntheticEvent:n,nativeEvent:v.current.event,value:v.current.value,target:x.current}),v.current=null},xe=n=>{var i;(i=u.current)==null||i.modifyDateSegmentValue(1),f(n)},Me=n=>{var i;(i=u.current)==null||i.modifyDateSegmentValue(-1),f(n)},x=a.useRef(null),o=a.useRef(null),d=a.useRef(null);a.useImperativeHandle(x,()=>({props:t,get options(){return R()},get text(){return A()},get element(){return o.current},get name(){return t.name},get value(){return g()},get validity(){return P()},focus:ye,updateOnPaste:Ce})),a.useImperativeHandle(b,()=>x.current);const u=a.useRef(null),T=a.useRef(null),q=a.useRef(!1),M=a.useRef(null),v=a.useRef(null),h=a.useRef(t),[we,U]=a.useState({focused:!1}),[,Pe]=a.useReducer(n=>n+1,0);a.useLayoutEffect(()=>{q.current||(u.current=Ee(),T.current=u.current.dateObject,q.current=!0)},[]),a.useEffect(()=>(z(),q.current||d.current&&d.current.addEventListener("wheel",H,{passive:!1}),()=>{d.current&&d.current.removeEventListener("wheel",H)}),[]),a.useEffect(()=>{z(),u.current&&((Ie(h.current.format,w)||h.current.readonly!==t.readonly||h.current.steps!==t.steps||B().locale!==u.current.options.intlService.locale)&&u.current.setOptions(R(),!0),h.current.value!==t.value&&(T.current.getValue()!==null||t.value!==null)&&T.current.setValue(t.value),t.ariaExpanded!==void 0&&t.ariaExpanded&&(u.current.options.placeholder=null),t.ariaExpanded!==void 0&&!t.ariaExpanded&&(u.current.options.placeholder=y),u.current.refreshElementValue(),h.current={format:w,readonly:t.readonly,ariaExpanded:t.ariaExpanded,steps:t.steps,value:t.value})});const W=t.id||m+"-accessibility-id",D=L&&L.uDateInput,K=A(),S=!se||P().valid;a.useImperativeHandle(t._ref,()=>x.current);const Y=a.createElement("span",{ref:n=>d.current=n,style:t.label?void 0:{width:t.width},dir:t.dir,className:l.classNames(l.uDateInput.wrapper({c:D,size:ee,fillMode:ne,rounded:te,disabled:C,required:_(),invalid:!S}),t.className)},a.createElement("input",{ref:n=>o.current=n,role:t.ariaRole||"textbox",readOnly:t.readonly,tabIndex:t.tabIndex||0,disabled:C,title:t.title!==void 0?t.title:K,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:be,className:l.classNames(l.uDateInput.inputInner({c:D})),id:W,value:K,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledBy,"aria-describedby":t.ariaDescribedBy,"aria-haspopup":ve,"aria-disabled":C,"aria-expanded":t.ariaExpanded,"aria-controls":t.ariaControls,"aria-required":t.required,"aria-invalid":!S,onKeyDown:f,onChange:f,onWheel:f,onInput:f,onClick:f,name:t.name,...t.inputAttributes}),t.children,t.clearButton&&t.value&&a.createElement(_e,{onClick:F,key:"clearbutton"}),re&&a.createElement("span",{className:l.classNames(l.uDateInput.inputSpinner({c:D})),onMouseDown:Re},a.createElement($.Button,{tabIndex:-1,type:"button",rounded:null,className:l.classNames(l.uDateInput.spinnerIncrease({c:D})),icon:"caret-alt-up",svgIcon:G.caretAltUpIcon,"aria-label":E.toLanguageString(s.increaseValue,s.messages[s.increaseValue]),title:E.toLanguageString(s.increaseValue,s.messages[s.increaseValue]),onClick:xe}),a.createElement($.Button,{tabIndex:-1,type:"button",rounded:null,className:l.classNames(l.uDateInput.spinnerDecrease({c:D})),icon:"caret-alt-down",svgIcon:G.caretAltDownIcon,"aria-label":E.toLanguageString(s.decreaseValue,s.messages[s.decreaseValue]),title:E.toLanguageString(s.decreaseValue,s.messages[s.decreaseValue]),onClick:Me})));return t.label?a.createElement(pe.FloatingLabel,{label:t.label,editorId:W,editorValue:(J=o.current)==null?void 0:J.value,editorValid:S,editorDisabled:C,children:Y,style:{width:t.width}}):Y});p.propTypes={value:e.instanceOf(Date),format:e.oneOfType([c.nullable(e.string),e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]).isRequired,e.shape({year:e.string.isRequired,month:e.string.isRequired,day:e.string.isRequired,hour:e.string.isRequired,minute:e.string.isRequired,second:e.string.isRequired})]),width:e.oneOfType([e.string,e.number]),tabIndex:e.number,title:e.string,steps:e.shape({year:c.nullable(e.number),month:c.nullable(e.number),day:c.nullable(e.number),hour:c.nullable(e.number),minute:c.nullable(e.number),second:c.nullable(e.number)}),min:e.instanceOf(Date),max:e.instanceOf(Date),disabled:e.bool,spinners:e.bool,name:e.string,dir:e.string,label:e.string,id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,ariaRole:e.string,ariaHasPopup:e.oneOfType([e.bool,e.oneOf(["grid","dialog"])]),ariaExpanded:e.oneOfType([e.bool]),onChange:e.func,validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),autoFocus:e.bool,inputAttributes:e.object};const r={format:k.DEFAULT_FORMAT,size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:k.DEFAULT_FORMAT_PLACEHOLDER,spinners:!1,disabled:!1,max:I.cloneDate(c.MAX_DATE),min:I.cloneDate(c.MIN_DATE),minTime:I.cloneDate(c.MIN_TIME),maxTime:I.cloneDate(c.MAX_TIME),validityStyles:!0,validationMessage:Fe,placeholder:null,enableMouseWheel:!0,autoCorrectParts:!0,autoSwitchParts:!0,allowCaretMode:!1,twoDigitYearMax:68,ariaHasPopup:"grid",autoFocus:!1},V=l.createPropsContext();p.displayName="KendoReactDateInput";exports.DateInput=p;exports.DateInputPropsContext=V;exports.dateInputDefaultProps=r;
|
package/dateinput/DateInput.mjs
CHANGED
|
@@ -5,27 +5,28 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
"use client";
|
|
8
9
|
import * as a from "react";
|
|
9
10
|
import e from "prop-types";
|
|
10
11
|
import { cloneDate as x, isEqual as Ve } from "@progress/kendo-date-math";
|
|
11
12
|
import { Button as Y } from "@progress/kendo-react-buttons";
|
|
12
|
-
import { caretAltUpIcon as
|
|
13
|
-
import { useInternationalization as
|
|
14
|
-
import { validatePackage as
|
|
13
|
+
import { caretAltUpIcon as qe, caretAltDownIcon as Ne } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { useInternationalization as _e, useLocalization as Fe } from "@progress/kendo-react-intl";
|
|
15
|
+
import { validatePackage as He, useId as Be, useUnstyled as ze, usePropsContext as J, classNames as y, uDateInput as b, createPropsContext as Ue, getActiveElement as X } from "@progress/kendo-react-common";
|
|
15
16
|
import { FloatingLabel as We } from "@progress/kendo-react-labels";
|
|
16
17
|
import { DateInput as je } from "@progress/kendo-dateinputs-common";
|
|
17
18
|
import { DEFAULT_FORMAT as Ke, DEFAULT_FORMAT_PLACEHOLDER as Ye, isInRange as Je } from "./utils.mjs";
|
|
18
19
|
import { packageMetadata as Xe } from "../package-metadata.mjs";
|
|
19
|
-
import { nullable as
|
|
20
|
-
import { increaseValue as C, messages as
|
|
20
|
+
import { nullable as c, MAX_DATE as Ge, MIN_DATE as Ze, MIN_TIME as $e, MAX_TIME as Qe } from "../utils.mjs";
|
|
21
|
+
import { increaseValue as C, messages as R, decreaseValue as w } from "../messages/index.mjs";
|
|
21
22
|
import { isInTimeRange as et } from "../timepicker/utils.mjs";
|
|
22
23
|
import tt from "../common/ClearButton.mjs";
|
|
23
24
|
import { DateInputIntl as nt } from "./dateInputIntl.mjs";
|
|
24
25
|
const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
25
26
|
var j;
|
|
26
|
-
|
|
27
|
-
const Q =
|
|
28
|
-
format:
|
|
27
|
+
He(Xe);
|
|
28
|
+
const Q = Be(t.id), ee = _e(), h = Fe(), te = ze(), p = J(G, t).unstyled || te, {
|
|
29
|
+
format: M = r.format,
|
|
29
30
|
size: ne = r.size,
|
|
30
31
|
rounded: ae = r.rounded,
|
|
31
32
|
fillMode: re = r.fillMode,
|
|
@@ -49,7 +50,7 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
49
50
|
} = J(G, t), d = () => D.current !== void 0 ? D.current : l.current && l.current.value, A = () => {
|
|
50
51
|
const n = l.current && l.current.currentText || "", i = d();
|
|
51
52
|
return f != null && !Pe.focused && !i ? f : n;
|
|
52
|
-
}, V = () => t.required !== void 0 ? t.required : !1,
|
|
53
|
+
}, V = () => t.required !== void 0 ? t.required : !1, T = () => {
|
|
53
54
|
const n = d() || t.value, i = oe, K = ue, ke = Je(n, i, K) && et(n, se, ce), pe = L !== void 0, Le = (!V() || n != null) && ke, Ae = t.valid !== void 0 ? t.valid : Le;
|
|
54
55
|
return {
|
|
55
56
|
customError: pe,
|
|
@@ -60,16 +61,16 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
60
61
|
};
|
|
61
62
|
}, Ee = () => {
|
|
62
63
|
o.current && o.current.focus();
|
|
63
|
-
},
|
|
64
|
+
}, q = () => new nt(ee), I = () => {
|
|
64
65
|
const n = d();
|
|
65
66
|
return {
|
|
66
|
-
format:
|
|
67
|
+
format: M,
|
|
67
68
|
steps: t.steps,
|
|
68
69
|
formatPlaceholder: ie,
|
|
69
70
|
placeholder: f,
|
|
70
71
|
selectPreviousSegmentOnBackspace: !0,
|
|
71
72
|
value: t.value || n,
|
|
72
|
-
intlService:
|
|
73
|
+
intlService: q(),
|
|
73
74
|
autoFill: t.autoFill !== void 0 ? t.autoFill : !1,
|
|
74
75
|
enableMouseWheel: me,
|
|
75
76
|
autoCorrectParts: fe,
|
|
@@ -79,17 +80,17 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
79
80
|
allowCaretMode: ve
|
|
80
81
|
};
|
|
81
82
|
}, Ie = (n) => {
|
|
82
|
-
|
|
83
|
+
u.current && u.current.classList.add("k-focus"), B({ focused: !0 });
|
|
83
84
|
}, Oe = (n) => {
|
|
84
|
-
|
|
85
|
+
u.current && u.current.classList.remove("k-focus"), B({ focused: !1 });
|
|
85
86
|
}, De = (n, i) => typeof n != typeof i ? !0 : typeof n == "string" && typeof i == "string" ? n !== i : typeof n == "object" && typeof i == "object" ? JSON.stringify(n) !== JSON.stringify(i) : !1, xe = (n) => typeof n == "string" ? n : {
|
|
86
87
|
inputFormat: n,
|
|
87
88
|
displayFormat: n
|
|
88
|
-
},
|
|
89
|
+
}, N = (n) => {
|
|
89
90
|
D.current = d(), Se(), m.current = n, D.current = void 0;
|
|
90
|
-
},
|
|
91
|
+
}, _ = (n) => {
|
|
91
92
|
t.onChange && t.onChange(n);
|
|
92
|
-
},
|
|
93
|
+
}, F = (n) => {
|
|
93
94
|
X(document) === o.current && n.preventDefault();
|
|
94
95
|
}, Ce = () => new je(o.current, {
|
|
95
96
|
...I(),
|
|
@@ -97,20 +98,20 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
97
98
|
events: {
|
|
98
99
|
focus: Ie,
|
|
99
100
|
blur: Oe,
|
|
100
|
-
valueChange:
|
|
101
|
-
click:
|
|
101
|
+
valueChange: N,
|
|
102
|
+
click: _
|
|
102
103
|
}
|
|
103
|
-
}),
|
|
104
|
+
}), H = () => {
|
|
104
105
|
o.current && o.current.setCustomValidity && o.current.setCustomValidity(
|
|
105
|
-
|
|
106
|
+
T().valid ? "" : L || r.validationMessage
|
|
106
107
|
);
|
|
108
|
+
}, Re = (n) => {
|
|
109
|
+
!o.current || !l.current || N(n);
|
|
107
110
|
}, we = (n) => {
|
|
108
|
-
!o.current || !l.current || _(n);
|
|
109
|
-
}, Me = (n) => {
|
|
110
111
|
n.preventDefault();
|
|
111
112
|
const i = X(document);
|
|
112
113
|
o.current && i !== o.current && o.current.focus({ preventScroll: !0 });
|
|
113
|
-
},
|
|
114
|
+
}, s = (n) => {
|
|
114
115
|
const i = d();
|
|
115
116
|
m.current && t.onChange && !Ve(m.current.oldValue, i) && t.onChange.call(void 0, {
|
|
116
117
|
syntheticEvent: n,
|
|
@@ -118,13 +119,13 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
118
119
|
value: m.current.value,
|
|
119
120
|
target: O.current
|
|
120
121
|
}), m.current = null;
|
|
121
|
-
},
|
|
122
|
+
}, Me = (n) => {
|
|
122
123
|
var i;
|
|
123
|
-
(i = l.current) == null || i.modifyDateSegmentValue(1),
|
|
124
|
-
},
|
|
124
|
+
(i = l.current) == null || i.modifyDateSegmentValue(1), s(n);
|
|
125
|
+
}, Te = (n) => {
|
|
125
126
|
var i;
|
|
126
|
-
(i = l.current) == null || i.modifyDateSegmentValue(-1),
|
|
127
|
-
}, O = a.useRef(null), o = a.useRef(null),
|
|
127
|
+
(i = l.current) == null || i.modifyDateSegmentValue(-1), s(n);
|
|
128
|
+
}, O = a.useRef(null), o = a.useRef(null), u = a.useRef(null);
|
|
128
129
|
a.useImperativeHandle(
|
|
129
130
|
O,
|
|
130
131
|
() => ({
|
|
@@ -145,33 +146,33 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
145
146
|
return d();
|
|
146
147
|
},
|
|
147
148
|
get validity() {
|
|
148
|
-
return
|
|
149
|
+
return T();
|
|
149
150
|
},
|
|
150
151
|
// hidden methods
|
|
151
152
|
focus: Ee,
|
|
152
|
-
updateOnPaste:
|
|
153
|
+
updateOnPaste: Re
|
|
153
154
|
})
|
|
154
155
|
), a.useImperativeHandle($, () => O.current);
|
|
155
|
-
const l = a.useRef(null), P = a.useRef(null), S = a.useRef(!1), D = a.useRef(null), m = a.useRef(null), g = a.useRef(t), [Pe,
|
|
156
|
+
const l = a.useRef(null), P = a.useRef(null), S = a.useRef(!1), D = a.useRef(null), m = a.useRef(null), g = a.useRef(t), [Pe, B] = a.useState({ focused: !1 }), [, Se] = a.useReducer((n) => n + 1, 0);
|
|
156
157
|
a.useLayoutEffect(() => {
|
|
157
158
|
S.current || (l.current = Ce(), P.current = l.current.dateObject, S.current = !0);
|
|
158
|
-
}, []), a.useEffect(() => (
|
|
159
|
-
|
|
159
|
+
}, []), a.useEffect(() => (H(), S.current || u.current && u.current.addEventListener("wheel", F, { passive: !1 }), () => {
|
|
160
|
+
u.current && u.current.removeEventListener("wheel", F);
|
|
160
161
|
}), []), a.useEffect(() => {
|
|
161
|
-
|
|
162
|
-
format:
|
|
162
|
+
H(), l.current && ((De(g.current.format, M) || g.current.readonly !== t.readonly || g.current.steps !== t.steps || q().locale !== l.current.options.intlService.locale) && l.current.setOptions(I(), !0), g.current.value !== t.value && (P.current.getValue() !== null || t.value !== null) && P.current.setValue(t.value), t.ariaExpanded !== void 0 && t.ariaExpanded && (l.current.options.placeholder = null), t.ariaExpanded !== void 0 && !t.ariaExpanded && (l.current.options.placeholder = f), l.current.refreshElementValue(), g.current = {
|
|
163
|
+
format: M,
|
|
163
164
|
readonly: t.readonly,
|
|
164
165
|
ariaExpanded: t.ariaExpanded,
|
|
165
166
|
steps: t.steps,
|
|
166
167
|
value: t.value
|
|
167
168
|
});
|
|
168
169
|
});
|
|
169
|
-
const z = t.id || Q + "-accessibility-id", v = p && p.uDateInput, U = A(), k = !de ||
|
|
170
|
+
const z = t.id || Q + "-accessibility-id", v = p && p.uDateInput, U = A(), k = !de || T().valid;
|
|
170
171
|
a.useImperativeHandle(t._ref, () => O.current);
|
|
171
172
|
const W = /* @__PURE__ */ a.createElement(
|
|
172
173
|
"span",
|
|
173
174
|
{
|
|
174
|
-
ref: (n) =>
|
|
175
|
+
ref: (n) => u.current = n,
|
|
175
176
|
style: t.label ? void 0 : { width: t.width },
|
|
176
177
|
dir: t.dir,
|
|
177
178
|
className: y(
|
|
@@ -213,18 +214,18 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
213
214
|
"aria-controls": t.ariaControls,
|
|
214
215
|
"aria-required": t.required,
|
|
215
216
|
"aria-invalid": !k,
|
|
216
|
-
onKeyDown:
|
|
217
|
-
onChange:
|
|
218
|
-
onWheel:
|
|
219
|
-
onInput:
|
|
220
|
-
onClick:
|
|
217
|
+
onKeyDown: s,
|
|
218
|
+
onChange: s,
|
|
219
|
+
onWheel: s,
|
|
220
|
+
onInput: s,
|
|
221
|
+
onClick: s,
|
|
221
222
|
name: t.name,
|
|
222
223
|
...t.inputAttributes
|
|
223
224
|
}
|
|
224
225
|
),
|
|
225
226
|
t.children,
|
|
226
|
-
t.clearButton && t.value && /* @__PURE__ */ a.createElement(tt, { onClick:
|
|
227
|
-
le && /* @__PURE__ */ a.createElement("span", { className: y(b.inputSpinner({ c: v })), onMouseDown:
|
|
227
|
+
t.clearButton && t.value && /* @__PURE__ */ a.createElement(tt, { onClick: _, key: "clearbutton" }),
|
|
228
|
+
le && /* @__PURE__ */ a.createElement("span", { className: y(b.inputSpinner({ c: v })), onMouseDown: we }, /* @__PURE__ */ a.createElement(
|
|
228
229
|
Y,
|
|
229
230
|
{
|
|
230
231
|
tabIndex: -1,
|
|
@@ -232,10 +233,10 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
232
233
|
rounded: null,
|
|
233
234
|
className: y(b.spinnerIncrease({ c: v })),
|
|
234
235
|
icon: "caret-alt-up",
|
|
235
|
-
svgIcon:
|
|
236
|
-
"aria-label": h.toLanguageString(C,
|
|
237
|
-
title: h.toLanguageString(C,
|
|
238
|
-
onClick:
|
|
236
|
+
svgIcon: qe,
|
|
237
|
+
"aria-label": h.toLanguageString(C, R[C]),
|
|
238
|
+
title: h.toLanguageString(C, R[C]),
|
|
239
|
+
onClick: Me
|
|
239
240
|
}
|
|
240
241
|
), /* @__PURE__ */ a.createElement(
|
|
241
242
|
Y,
|
|
@@ -245,10 +246,10 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
245
246
|
rounded: null,
|
|
246
247
|
className: y(b.spinnerDecrease({ c: v })),
|
|
247
248
|
icon: "caret-alt-down",
|
|
248
|
-
svgIcon:
|
|
249
|
-
"aria-label": h.toLanguageString(
|
|
250
|
-
title: h.toLanguageString(
|
|
251
|
-
onClick:
|
|
249
|
+
svgIcon: Ne,
|
|
250
|
+
"aria-label": h.toLanguageString(w, R[w]),
|
|
251
|
+
title: h.toLanguageString(w, R[w]),
|
|
252
|
+
onClick: Te
|
|
252
253
|
}
|
|
253
254
|
))
|
|
254
255
|
);
|
|
@@ -268,7 +269,7 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
268
269
|
Z.propTypes = {
|
|
269
270
|
value: e.instanceOf(Date),
|
|
270
271
|
format: e.oneOfType([
|
|
271
|
-
|
|
272
|
+
c(e.string),
|
|
272
273
|
e.shape({
|
|
273
274
|
skeleton: e.string,
|
|
274
275
|
pattern: e.string,
|
|
@@ -288,28 +289,26 @@ Z.propTypes = {
|
|
|
288
289
|
})
|
|
289
290
|
]),
|
|
290
291
|
formatPlaceholder: e.oneOfType([
|
|
291
|
-
|
|
292
|
-
e.oneOf(["wide", "narrow", "short", "formatPattern"])
|
|
293
|
-
),
|
|
292
|
+
e.oneOf(["wide", "narrow", "short", "formatPattern"]).isRequired,
|
|
294
293
|
e.shape({
|
|
295
|
-
year:
|
|
296
|
-
month:
|
|
297
|
-
day:
|
|
298
|
-
hour:
|
|
299
|
-
minute:
|
|
300
|
-
second:
|
|
294
|
+
year: e.string.isRequired,
|
|
295
|
+
month: e.string.isRequired,
|
|
296
|
+
day: e.string.isRequired,
|
|
297
|
+
hour: e.string.isRequired,
|
|
298
|
+
minute: e.string.isRequired,
|
|
299
|
+
second: e.string.isRequired
|
|
301
300
|
})
|
|
302
301
|
]),
|
|
303
302
|
width: e.oneOfType([e.string, e.number]),
|
|
304
303
|
tabIndex: e.number,
|
|
305
304
|
title: e.string,
|
|
306
305
|
steps: e.shape({
|
|
307
|
-
year:
|
|
308
|
-
month:
|
|
309
|
-
day:
|
|
310
|
-
hour:
|
|
311
|
-
minute:
|
|
312
|
-
second:
|
|
306
|
+
year: c(e.number),
|
|
307
|
+
month: c(e.number),
|
|
308
|
+
day: c(e.number),
|
|
309
|
+
hour: c(e.number),
|
|
310
|
+
minute: c(e.number),
|
|
311
|
+
second: c(e.number)
|
|
313
312
|
}),
|
|
314
313
|
min: e.instanceOf(Date),
|
|
315
314
|
max: e.instanceOf(Date),
|
|
@@ -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 l=require("@progress/kendo-intl");class s{constructor(t){this.service=t,this.cldr={},this.locale=t.locale,this.format=t.format,this.toString=t.toString,this.formatDate=t.formatDate,this.parseDate=t.parseDate,this.parseNumber=t.parseNumber,this.formatNumber=t.formatNumber,this.splitDateFormat=t.splitDateFormat,this.numberSymbols=t.numberSymbols,this.firstDay=t.firstDay,this.dateFieldName=t.dateFieldName,this.dateFormatNames=(e,o)=>this.service.dateFormatNames(o),this.weekendRange=e=>{};const a=l.localeInfo(this.locale);this.cldr[a.name]=a}}exports.DateInputIntl=s;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@progress/kendo-intl");class s{constructor(t){this.service=t,this.cldr={},this.locale=t.locale,this.format=t.format,this.toString=t.toString,this.formatDate=t.formatDate,this.parseDate=t.parseDate,this.parseNumber=t.parseNumber,this.formatNumber=t.formatNumber,this.splitDateFormat=t.splitDateFormat,this.numberSymbols=t.numberSymbols,this.firstDay=t.firstDay,this.dateFieldName=t.dateFieldName,this.dateFormatNames=(e,o)=>this.service.dateFormatNames(o),this.weekendRange=e=>{};const a=l.localeInfo(this.locale);this.cldr[a.name]=a}}exports.DateInputIntl=s;
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
"use client";
|
|
9
|
+
import { localeInfo as l } from "@progress/kendo-intl";
|
|
9
10
|
class r {
|
|
10
11
|
constructor(t) {
|
|
11
|
-
this.service = t, this.cldr = {}, this.locale = t.locale, this.format = t.format, this.toString = t.toString, this.formatDate = t.formatDate, this.parseDate = t.parseDate, this.parseNumber = t.parseNumber, this.formatNumber = t.formatNumber, this.splitDateFormat = t.splitDateFormat, this.numberSymbols = t.numberSymbols, this.firstDay = t.firstDay, this.dateFieldName = t.dateFieldName, this.dateFormatNames = (o,
|
|
12
|
+
this.service = t, this.cldr = {}, this.locale = t.locale, this.format = t.format, this.toString = t.toString, this.formatDate = t.formatDate, this.parseDate = t.parseDate, this.parseNumber = t.parseNumber, this.formatNumber = t.formatNumber, this.splitDateFormat = t.splitDateFormat, this.numberSymbols = t.numberSymbols, this.firstDay = t.firstDay, this.dateFieldName = t.dateFieldName, this.dateFormatNames = (o, s) => this.service.dateFormatNames(s), this.weekendRange = (o) => {
|
|
12
13
|
};
|
|
13
|
-
const a =
|
|
14
|
+
const a = l(this.locale);
|
|
14
15
|
this.cldr[a.name] = a;
|
|
15
16
|
}
|
|
16
17
|
}
|
package/dateinput/utils.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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="d",s="wide",t=(e,A,T)=>e===null||!(A&&A>e||T&&T<e);exports.DEFAULT_FORMAT=n;exports.DEFAULT_FORMAT_PLACEHOLDER=s;exports.isInRange=t;
|
package/dateinput/utils.mjs
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
"use client";
|
|
9
|
+
const o = "d", E = "wide", F = (s, A, n) => s === null || !(A && A > s || n && n < s);
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
o as DEFAULT_FORMAT,
|
|
12
|
+
E as DEFAULT_FORMAT_PLACEHOLDER,
|
|
13
|
+
F as isInRange
|
|
13
14
|
};
|
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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ze=require("react"),e=require("prop-types"),Ge=require("@progress/kendo-react-popup"),z=require("@progress/kendo-date-math"),u=require("@progress/kendo-react-common"),Je=require("@progress/kendo-svg-icons"),Qe=require("../package-metadata.js"),et=require("../dateinput/DateInput.js"),tt=require("../calendar/components/Calendar.js"),l=require("../utils.js"),K=require("../messages/index.js"),nt=require("@progress/kendo-react-intl"),at=require("./ToggleButton.js"),ot=require("../common/PickerWrap.js"),rt=require("../hooks/usePickerFloatingLabel.js"),lt=require("@progress/kendo-react-layout"),ut=require("../common/AdaptiveMode.js");function it(n){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const f in n)if(f!=="default"){const M=Object.getOwnPropertyDescriptor(n,f);Object.defineProperty(h,f,M.get?M:{enumerable:!0,get:()=>n[f]})}}return h.default=n,Object.freeze(h)}const a=it(Ze),L=a.forwardRef((n,h)=>{u.validatePackage(Qe.packageMetadata);const f=u.useId(n.id),M=nt.useLocalization(),v=u.useAdaptiveModeContext(),{defaultShow:ie=r.defaultShow,defaultValue:se=r.defaultValue,dateInput:ce=r.dateInput,calendar:de=r.calendar,toggleButton:fe=r.toggleButton,popup:me=r.popup,pickerWrap:st=r.pickerWrap,disabled:w=r.disabled,format:ge=r.format,max:S=r.max,min:E=r.min,popupSettings:y=r.popupSettings,tabIndex:pe=r.tabIndex,weekNumber:be=r.weekNumber,validityStyles:W=r.validityStyles,size:T=r.size,rounded:x=r.rounded,fillMode:_=r.fillMode,autoFocus:he=r.autoFocus,show:j,autoSwitchParts:ve,autoSwitchKeys:we,twoDigitYearMax:ye,ariaLabel:ke,adaptive:ct,adaptiveTitle:De,inputAttributes:Ce,validationMessage:H,_adaptiveMode:dt=v,valid:U,focusedDate:Pe,...Y}=u.usePropsContext(ue,n),B=()=>{if(u.canUseDOM)return D.current&&D.current.ownerDocument||window.document},c=()=>!!(b.windowWidth&&v&&b.windowWidth<=(v==null?void 0:v.medium)&&n.adaptive),m=()=>{const t=P.current!==void 0&&P.current!==null?P.current:n.value!==void 0?n.value:b.value;return t!==null?z.cloneDate(t):null},i=()=>q.current!==void 0?q.current:j!==void 0?j:b.show,Re=()=>ce||r.dateInput,Oe=()=>fe||r.toggleButton,Me=()=>de||r.calendar,qe=()=>me||r.popup,$=()=>n.required!==void 0?n.required:!1,A=()=>{const t=m()||n.value||null,o=E,s=S,I=l.isInDateRange(t,o,s),N=H!==void 0,F=(!$()||t!=null)&&I,V=U!==void 0?U:F;return{customError:N,rangeOverflow:t&&s.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<o.getTime()||!1,valid:V,valueMissing:t===null}},Ie=t=>{for(const o of t)O({windowWidth:o.target.clientWidth})},Se=()=>{d.current&&d.current.focus()},X=t=>{C.current=t},g=t=>{i()!==t&&(O({show:t}),t&&n.onOpen&&n.onOpen.call(void 0,{target:k.current}),!t&&n.onClose&&n.onClose.call(void 0,{target:k.current}))},Ee=t=>{const o=m();return o&&t?l.setTime(t,o):t},Te=t=>{y!=null&&y.onMouseDownOutside&&y.onMouseDownOutside.call(void 0,t)},Z=(t,o)=>{O({value:z.cloneDate(t||void 0)}),P.current=t,q.current=!1,c()||(p.current=!0),n.onChange&&n.onChange.call(void 0,{syntheticEvent:o.syntheticEvent,nativeEvent:o.nativeEvent,value:m(),show:i(),target:k.current}),P.current=void 0,q.current=void 0,g(!1)},xe=t=>{const o=Ee(t.value);Z(o,t)},G=()=>{const{popupClass:t,...o}=y,s=i(),I=m(),N=I&&z.getDate(I),F=u.classNames(t),V={popupClass:"k-datepicker-popup",show:s,anchor:D.current,className:F,id:te,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...o,onMouseDownOutside:Te},re={disabled:w,value:N,min:E,max:S,weekNumber:be,focusedDate:Pe,className:c()?"k-calendar-lg":"",navigation:!c(),onChange:xe},le=Me(),Xe=qe();return c()?a.createElement(le,{_ref:X,...re}):a.createElement(Xe,{...V},a.createElement(le,{_ref:X,...re}))},J=()=>{O({focused:!1}),g(!1)},_e=()=>{const{windowWidth:t=0}=b,o={expand:i(),onClose:J,adaptiveTitle:De,windowWidth:t},s=G();return a.createElement(ut.AdaptiveMode,{...o},a.createElement(lt.ActionSheetContent,{overflowHidden:!0},s))},Be=t=>{Z(t.value,t)},Ae=()=>{O({focused:!0})},Ne=()=>{g(!i())},Q=()=>{w||(p.current=!0,g(!i()))},Fe=t=>{t.preventDefault()},Ve=t=>{const{altKey:o,keyCode:s}=t;if(s===u.Keys.esc&&i()){p.current=!0,g(!1);return}o&&(s===u.Keys.up||s===u.Keys.down)&&(t.preventDefault(),t.stopPropagation(),p.current=s===u.Keys.up,g(s===u.Keys.down))},k=a.useRef(null),D=a.useRef(null),d=a.useRef(null),C=a.useRef(null);a.useImperativeHandle(k,()=>({props:n,get element(){return D.current},get calendar(){return C.current},get dateInput(){return d.current},get name(){return n.name},get show(){return i()},get validity(){return A()},get value(){return m()},get mobileMode(){return c()},togglePopup:Ne,focus:Se})),a.useImperativeHandle(h,()=>k.current);const P=a.useRef(null),q=a.useRef(void 0),ze=a.useRef(null),p=a.useRef(!1),ee=a.useRef(!1),R=a.useRef(null),[b,Ke]=a.useState({value:se,show:ie,focused:!1}),[,Le]=a.useReducer(t=>t,!0),O=t=>{Ke(o=>({...o,...t}))};a.useEffect(()=>{C.current&&C.current.element&&i()&&!ee.current&&C.current.element.focus({preventScroll:!0}),d.current&&d.current.element&&!i()&&p.current&&d.current.element.focus({preventScroll:!0}),ee.current=i(),p.current=!1}),a.useEffect(()=>{var t;return R.current=u.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(o=>Ie(o)),i()&&Le(),(t=B())!=null&&t.body&&R.current&&R.current.observe(B().body),()=>{var o;clearTimeout(ze.current),(o=B())!=null&&o.body&&R.current&&R.current.disconnect()}},[]);const te=f+"-popup-id",We=G(),je=Re(),He=m(),Ue=Oe(),Ye=_e(),ne=!W||A().valid,ae=M.toLanguageString(K.toggleCalendar,K.messages[K.toggleCalendar]),$e={disabled:w,format:ge,formatPlaceholder:n.formatPlaceholder,id:n.id,ariaLabelledBy:n.ariaLabelledBy,ariaDescribedBy:n.ariaDescribedBy,ariaLabel:ke,max:S,min:E,name:n.name,onChange:Be,required:n.required,_ref:d,tabIndex:i()?-1:pe,title:n.title,valid:A().valid,validationMessage:H,validityStyles:W,value:He,label:void 0,placeholder:b.focused?null:n.placeholder,ariaExpanded:i(),size:null,fillMode:null,rounded:null,autoFill:n.autoFill,twoDigitYearMax:ye,enableMouseWheel:n.enableMouseWheel,autoCorrectParts:n.autoCorrectParts,autoSwitchParts:ve,autoSwitchKeys:we,allowCaretMode:n.allowCaretMode,inputAttributes:Ce},oe=a.createElement(u.AsyncFocusBlur,{onFocus:Ae,onBlur:c()?void 0:J,onSyncBlur:n.onBlur,onSyncFocus:n.onFocus},t=>a.createElement(a.Fragment,null,a.createElement("span",{...n.label?{}:Y,ref:D,className:u.classNames("k-input","k-datepicker",{[`k-input-${u.kendoThemeMaps.sizeMap[T]||T}`]:T,[`k-rounded-${u.kendoThemeMaps.roundedMap[x]||x}`]:x,[`k-input-${_}`]:_,"k-invalid":!ne,"k-required":$(),"k-disabled":w},n.className),onKeyDown:Ve,style:{width:n.width},onFocus:t.onFocus,onBlur:t.onBlur,onClick:c()?Q:void 0},a.createElement(je,{_ref:d,ariaRole:"combobox",ariaExpanded:i(),ariaControls:te,autoFocus:he,...$e}),a.createElement(Ue,{type:"button",icon:"calendar",svgIcon:Je.calendarIcon,title:ae,className:"k-input-button",rounded:null,onClick:c()?void 0:Q,"aria-label":ae,fillMode:_,onMouseDown:Fe}),!c()&&We),c()&&Ye));return n.label?a.createElement(rt.PickerFloatingLabel,{dateInput:d,label:n.label,editorId:f,editorValid:ne,editorDisabled:w,children:oe,style:{width:n.width},...Y}):oe});L.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:l.nullable(e.string),pattern:l.nullable(e.string),date:l.nullable(e.oneOf(["short","medium","long","full"])),time:l.nullable(e.oneOf(["short","medium","long","full"])),datetime:l.nullable(e.oneOf(["short","medium","long","full"])),era:l.nullable(e.oneOf(["narrow","short","long"])),year:l.nullable(e.oneOf(["numeric","2-digit"])),month:l.nullable(e.oneOf(["numeric","2-digit","narrow","short","long"])),day:l.nullable(e.oneOf(["numeric","2-digit"])),weekday:l.nullable(e.oneOf(["narrow","short","long"])),hour:l.nullable(e.oneOf(["numeric","2-digit"])),hour12:l.nullable(e.bool),minute:l.nullable(e.oneOf(["numeric","2-digit"])),second:l.nullable(e.oneOf(["numeric","2-digit"])),timeZoneName:l.nullable(e.oneOf(["short","long"]))})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]).isRequired,e.shape({year:e.string.isRequired,month:e.string.isRequired,day:e.string.isRequired,hour:e.string.isRequired,minute:e.string.isRequired,second:e.string.isRequired})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool.isRequired,appendTo:e.any.isRequired,popupClass:e.string.isRequired}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string,autoFocus:e.bool,inputAttributes:e.object};const r={defaultShow:!1,defaultValue:null,dateInput:et.DateInput,calendar:tt.Calendar,toggleButton:at.ToggleButton,popup:Ge.Popup,pickerWrap:ot.PickerWrap,disabled:!1,format:"d",max:l.MAX_DATE,min:l.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1},ue=u.createPropsContext();L.displayName="KendoReactDatePicker";exports.DatePicker=L;exports.DatePickerPropsContext=ue;exports.datePickerDefaultProps=r;
|