@progress/kendo-react-scheduler 15.2.0-develop.6 → 15.2.0-develop.8

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.
@@ -40,9 +40,9 @@ export interface RecurrenceButtonTextTemplateProps {
40
40
  parsedRule: RecurrenceRule | null;
41
41
  }
42
42
  /**
43
- * Represents the props passed to the [`recurrenceEditorHintTemplate`](https://www.telerik.com/kendo-react-ui/components/scheduler/api/schedulerformeditorprops#toc-recurrenceEditorHintTemplate) component.
43
+ * Represents the props passed to the [`recurrenceSummaryTemplate`](https://www.telerik.com/kendo-react-ui/components/scheduler/api/schedulerformeditorprops#toc-recurrenceSummaryTemplate) component.
44
44
  */
45
- export interface RecurrenceEditorHintTemplateProps {
45
+ export interface RecurrenceSummaryTemplateProps {
46
46
  /**
47
47
  * The current recurrence rule string (RRULE).
48
48
  */
@@ -169,7 +169,7 @@ export interface SchedulerFormEditorProps extends Omit<FormElementProps, 'childr
169
169
  * Receives the current `recurrenceRule` (RRULE string) and should render the desired summary.
170
170
  * This template is only used when a recurrence rule exists.
171
171
  */
172
- recurrenceEditorHintTemplate?: React.ComponentType<RecurrenceEditorHintTemplateProps>;
172
+ recurrenceSummaryTemplate?: React.ComponentType<RecurrenceSummaryTemplateProps>;
173
173
  }
174
174
  /**
175
175
  * Represents the `ref` of the SchedulerFormEditor component.
@@ -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 ze=require("react"),De=require("@progress/kendo-date-math"),pe=require("@progress/kendo-recurrence"),k=require("@progress/kendo-react-labels"),W=require("@progress/kendo-react-intl"),l=require("@progress/kendo-react-form"),w=require("@progress/kendo-react-inputs"),b=require("@progress/kendo-react-buttons"),L=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),t=require("../messages/index.js"),Y=require("./TimezoneDropDownList.js"),Ce=require("../recurrence/RecurrenceEditor.js"),Fe=require("./ResourceEditor.js"),G=require("./ZonedSplitDateTime.js"),K=require("@progress/kendo-react-dialogs"),ye=require("./SchedulerRecurrenceDialog.js"),Ne=require("./RemoveRecurrenceConfirmDialog.js"),Q=require("../hooks/useRecurrenceSummary.js"),J=require("../context/SchedulerContext.js");function Ie(a){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const c in a)if(c!=="default"){const T=Object.getOwnPropertyDescriptor(a,c);Object.defineProperty(m,c,T.get?T:{enumerable:!0,get:()=>a[c]})}}return m.default=a,Object.freeze(m)}const e=Ie(ze),U=e.forwardRef((a,m)=>{const c=e.useRef(null),T=e.useRef(null),C=De.timezoneNames(),n=W.useLocalization(),S=W.useInternationalization(),r=J.useSchedulerFieldsContext(),{resources:x,timezone:u}=J.useSchedulerPropsContext();e.useImperativeHandle(T,()=>{var o;return{element:(o=c.current)!=null&&o.element?c.current.element:c.current,props:a}}),e.useImperativeHandle(m,()=>T.current);const{as:z=i.as,...F}=a,{onChange:d,valueGetter:g}=a,{titleEditor:$=i.titleEditor,startEditor:A=i.startEditor,endEditor:q=i.endEditor,startTimezoneEditor:ee=i.startTimezoneEditor,endTimezoneEditor:te=i.endTimezoneEditor,startLabel:re=i.startLabel,endLabel:M=i.endLabel,allDayEditor:ne=i.allDayEditor,allDayLabel:ae=i.allDayLabel,recurrenceEditor:oe,descriptionEditor:le=i.descriptionEditor,resourceEditor:ie=i.resourceEditor}=a,h=e.useMemo(()=>g(r.start)||new Date,[g,r.start]),R=g(r.isAllDay)||!1,E=g(r.startTimezone)||u||"",s=g(r.recurrenceRule),B=g(r.recurrenceId),ce=!(B!=null),_=e.useMemo(()=>n.toLanguageString(t.editorEventAllDay,t.messages[t.editorEventAllDay]),[n]),[f,O]=e.useState(!!g(r.startTimezone)),[se,y]=e.useState(!1),[de,D]=e.useState(!1),[me,N]=e.useState(!1),Z=a.recurrenceButtonTextTemplate,ue=a.recurrenceEditorHintTemplate,I=e.useMemo(()=>n.toLanguageString(t.editorMakeRecurring,t.messages[t.editorMakeRecurring]),[n]),ge=e.useMemo(()=>s&&Q.getRecurrenceSummary(s,h,S,n)||I,[s,h,S,n,I]),Ee=e.useMemo(()=>s?Q.getRecurrenceSummary(s,h,S,n):null,[s,h,S,n]),fe=e.useMemo(()=>s?pe.parseRule({recurrenceRule:s}):null,[s]),P=e.useRef(E);e.useEffect(()=>{f&&E&&E!==P.current&&d(r.endTimezone,{value:E}),P.current=E},[E,f,d,r.endTimezone]);const j=e.useCallback(o=>{o.preventDefault(),f?y(!0):O(!0)},[f]),Te=e.useCallback(()=>{d(r.startTimezone,{value:null}),d(r.endTimezone,{value:null}),O(!1),y(!1)},[d,r.startTimezone,r.endTimezone]),H=e.useCallback(()=>{y(!1)},[]),ve=e.useCallback(()=>{D(!0)},[]),Se=e.useCallback(o=>{d(r.recurrenceRule,{value:o}),D(!1)},[d,r.recurrenceRule]),he=e.useCallback(()=>{D(!1)},[]),Re=e.useCallback(()=>{N(!0)},[]),be=e.useCallback(()=>{d(r.recurrenceRule,{value:null}),d(r.recurrenceExceptions,{value:null}),N(!1),D(!1)},[d,r.recurrenceRule,r.recurrenceExceptions]),Le=e.useCallback(()=>{N(!1)},[]),ke=e.useMemo(()=>L.classNames("k-scheduler-edit-form",a.className),[a.className]);return e.createElement(e.Fragment,null,e.createElement(z,{ref:z===i.as?c:void 0,horizontal:!0,...F,className:ke},e.createElement(e.Fragment,null,e.createElement(l.FieldWrapper,null,e.createElement(k.Label,{className:"k-form-label"},e.createElement(L.SvgIcon,{icon:v.rightDoubleQuotesIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(l.Field,{id:"k-scheduler-editor-title",name:r.title,field:r.title,component:$,placeholder:n.toLanguageString(t.editorEventTitle,t.messages[t.editorEventTitle]),"aria-label":n.toLanguageString(t.editorEventTitle,t.messages[t.editorEventTitle])}))),e.createElement(l.FieldWrapper,null,e.createElement(k.Label,{className:"k-form-label"},e.createElement(L.SvgIcon,{icon:v.clockIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-datetime-section"},e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(l.Field,{id:"k-is-allday-switch",name:r.isAllDay,component:ne,onLabel:"",offLabel:"",ariaLabel:_}),e.createElement(l.Field,{name:r.isAllDay,field:r.isAllDay,editorId:"k-is-allday-switch",component:ae},_)),e.createElement("div",{className:"k-scheduler-datetime-grid"},R?e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(l.Field,{name:r.start,component:A,isAllDay:R,fieldError:a.errors[r.start],ariaLabel:n.toLanguageString(t.editorEventStart,t.messages[t.editorEventStart]),timezone:u}),e.createElement(l.Field,{name:r.end,component:M,editorId:"k-scheduler-editor-end",className:"k-scheduler-datetime-label"},n.toLanguageString(t.editorDateConnectorTo,t.messages[t.editorDateConnectorTo])),e.createElement(l.Field,{name:r.end,component:q,isAllDay:R,dateId:"k-scheduler-editor-end",fieldError:a.errors[r.end],ariaLabel:n.toLanguageString(t.editorEventEnd,t.messages[t.editorEventEnd]),timezone:u})):e.createElement(e.Fragment,null,e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(l.Field,{name:r.start,component:A,isAllDay:R,timeId:"k-scheduler-editor-start-time",connectorElement:e.createElement(l.Field,{name:r.start,component:re,editorId:"k-scheduler-editor-start-time",className:"k-scheduler-datetime-label"},n.toLanguageString(t.editorDateConnectorFrom,t.messages[t.editorDateConnectorFrom])),fieldError:a.errors[r.start],ariaLabel:n.toLanguageString(t.editorEventStart,t.messages[t.editorEventStart]),timeAriaLabel:n.toLanguageString(t.editorStartTimeAriaLabel,t.messages[t.editorStartTimeAriaLabel]),timezone:u})),!f&&e.createElement(b.Button,{className:"k-col-span-2",fillMode:"flat",themeColor:"primary",title:n.toLanguageString(t.editorSetTimezoneTitle,t.messages[t.editorSetTimezoneTitle]),onClick:j,svgIcon:v.globeIcon},n.toLanguageString(t.editorTimezoneButton,t.messages[t.editorTimezoneButton])),f&&e.createElement(e.Fragment,null,e.createElement(l.Field,{name:r.startTimezone,component:ee,data:C,value:E,ariaLabel:n.toLanguageString(t.editorEventStartTimeZone,t.messages[t.editorEventStartTimeZone])}),e.createElement(b.Button,{title:n.toLanguageString(t.editorResetTimezoneTitle,t.messages[t.editorResetTimezoneTitle]),"aria-label":n.toLanguageString(t.editorResetTimezoneAriaLabel,t.messages[t.editorResetTimezoneAriaLabel]),onClick:j,svgIcon:v.globeIcon,fillMode:"flat",themeColor:"primary"})),e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(l.Field,{name:r.end,component:q,isAllDay:R,timeId:"k-scheduler-editor-end-time",connectorElement:e.createElement(l.Field,{name:r.end,component:M,editorId:"k-scheduler-editor-end-time",className:"k-scheduler-datetime-label"},n.toLanguageString(t.editorDateConnectorTo,t.messages[t.editorDateConnectorTo])),fieldError:a.errors[r.end],ariaLabel:n.toLanguageString(t.editorEventEnd,t.messages[t.editorEventEnd]),timeAriaLabel:n.toLanguageString(t.editorEndTimeAriaLabel,t.messages[t.editorEndTimeAriaLabel]),timezone:u})),f&&e.createElement(l.Field,{name:r.endTimezone,component:te,data:C,value:g(r.endTimezone)||u||"",ariaLabel:n.toLanguageString(t.editorEventEndTimeZone,t.messages[t.editorEventEndTimeZone])}))),ce&&e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(b.Button,{className:"k-scheduler-recurrence-button",type:"button",fillMode:"flat",themeColor:"primary",svgIcon:v.arrowRotateCwIcon,onClick:ve},Z?e.createElement(Z,{recurrenceRule:s,text:Ee,parsedRule:fe}):ge))))),e.createElement(l.FieldWrapper,null,e.createElement(k.Label,{className:"k-form-label"},e.createElement(L.SvgIcon,{icon:v.commentIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(l.Field,{component:le,name:r.description,id:"k-event-description",resizable:"vertical",placeholder:n.toLanguageString(t.editorEventDescription,t.messages[t.editorEventDescription]),"aria-label":n.toLanguageString(t.editorEventDescription,t.messages[t.editorEventDescription])}))),(x||[]).map(o=>e.createElement(l.FieldWrapper,{key:o.field},o.svgIcon&&e.createElement(k.Label,{className:"k-form-label"},e.createElement(L.SvgIcon,{icon:o.svgIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(l.Field,{name:o.field,component:ie,resource:o,multiple:o.multiple,data:o.data,textField:o.textField,valueField:o.valueField,colorField:o.colorField,ariaLabel:o.name||o.field})))))),de&&e.createElement(ye.SchedulerRecurrenceDialog,{value:s,start:h,timezone:u||"",onSave:Se,onCancel:he,onRemoveRecurrence:Re,recurrenceEditorHintTemplate:ue,recurrenceEditor:oe}),me&&e.createElement(Ne.RemoveRecurrenceConfirmDialog,{onConfirm:be,onCancel:Le}),se&&e.createElement(K.Dialog,{title:n.toLanguageString(t.resetTimezoneDialogTitle,t.messages[t.resetTimezoneDialogTitle]),onClose:H},n.toLanguageString(t.resetTimezoneConfirmation,t.messages[t.resetTimezoneConfirmation]),e.createElement(K.DialogActionsBar,null,e.createElement(b.Button,{onClick:H},n.toLanguageString(t.resetTimezoneNo,t.messages[t.resetTimezoneNo])),e.createElement(b.Button,{themeColor:"primary",onClick:Te},n.toLanguageString(t.resetTimezoneYes,t.messages[t.resetTimezoneYes])))))});U.displayName="KendoReactSchedulerFormEditor";const V=e.forwardRef((a,m)=>e.createElement(l.FormElement,{ref:m,id:a.id,style:a.style,tabIndex:a.tabIndex,className:a.className,horizontal:a.horizontal,children:a.children}));V.displayName="SchedulerFormEditorDefaultElement";const X=a=>{const{value:m,onChange:c,valid:T,visited:C,touched:n,modified:S,name:r,validationMessage:x,...u}=a,z=e.useCallback(F=>{c&&c({value:F.value})},[c]);return e.createElement(w.Switch,{...u,checked:m||!1,onChange:z})};X.displayName="SwitchFieldAdapter";const p=a=>e.createElement(k.Label,{...a,style:{marginBottom:0,...a.style}});p.displayName="DefaultLabel";const i={as:V,titleEditor:w.Input,startEditor:G.ZonedSplitDateTime,endEditor:G.ZonedSplitDateTime,startTimezoneEditor:Y.TimezoneDropDownList,endTimezoneEditor:Y.TimezoneDropDownList,startLabel:p,endLabel:p,allDayEditor:X,allDayLabel:p,recurrenceEditor:Ce.RecurrenceEditor,descriptionEditor:w.TextArea,resourceEditor:Fe.ResourceEditor};exports.SchedulerFormEditor=U;exports.schedulerFormEditorDefaultProps=i;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("react"),De=require("@progress/kendo-date-math"),pe=require("@progress/kendo-recurrence"),k=require("@progress/kendo-react-labels"),H=require("@progress/kendo-react-intl"),l=require("@progress/kendo-react-form"),w=require("@progress/kendo-react-inputs"),b=require("@progress/kendo-react-buttons"),L=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),t=require("../messages/index.js"),Y=require("./TimezoneDropDownList.js"),Ce=require("../recurrence/RecurrenceEditor.js"),ye=require("./ResourceEditor.js"),G=require("./ZonedSplitDateTime.js"),K=require("@progress/kendo-react-dialogs"),Fe=require("./SchedulerRecurrenceDialog.js"),Ne=require("./RemoveRecurrenceConfirmDialog.js"),Q=require("../hooks/useRecurrenceSummary.js"),J=require("../context/SchedulerContext.js");function Ie(a){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const c in a)if(c!=="default"){const T=Object.getOwnPropertyDescriptor(a,c);Object.defineProperty(d,c,T.get?T:{enumerable:!0,get:()=>a[c]})}}return d.default=a,Object.freeze(d)}const e=Ie(ze),U=e.forwardRef((a,d)=>{const c=e.useRef(null),T=e.useRef(null),C=De.timezoneNames(),n=H.useLocalization(),S=H.useInternationalization(),r=J.useSchedulerFieldsContext(),{resources:x,timezone:u}=J.useSchedulerPropsContext();e.useImperativeHandle(T,()=>{var o;return{element:(o=c.current)!=null&&o.element?c.current.element:c.current,props:a}}),e.useImperativeHandle(d,()=>T.current);const{as:z=i.as,...y}=a,{onChange:m,valueGetter:g}=a,{titleEditor:$=i.titleEditor,startEditor:A=i.startEditor,endEditor:q=i.endEditor,startTimezoneEditor:ee=i.startTimezoneEditor,endTimezoneEditor:te=i.endTimezoneEditor,startLabel:re=i.startLabel,endLabel:M=i.endLabel,allDayEditor:ne=i.allDayEditor,allDayLabel:ae=i.allDayLabel,recurrenceEditor:oe,descriptionEditor:le=i.descriptionEditor,resourceEditor:ie=i.resourceEditor}=a,h=e.useMemo(()=>g(r.start)||new Date,[g,r.start]),R=g(r.isAllDay)||!1,E=g(r.startTimezone)||u||"",s=g(r.recurrenceRule),B=g(r.recurrenceId),ce=!(B!=null),_=e.useMemo(()=>n.toLanguageString(t.editorEventAllDay,t.messages[t.editorEventAllDay]),[n]),[f,O]=e.useState(!!g(r.startTimezone)),[se,F]=e.useState(!1),[me,D]=e.useState(!1),[de,N]=e.useState(!1),Z=a.recurrenceButtonTextTemplate,ue=a.recurrenceSummaryTemplate,I=e.useMemo(()=>n.toLanguageString(t.editorMakeRecurring,t.messages[t.editorMakeRecurring]),[n]),ge=e.useMemo(()=>s&&Q.getRecurrenceSummary(s,h,S,n)||I,[s,h,S,n,I]),Ee=e.useMemo(()=>s?Q.getRecurrenceSummary(s,h,S,n):null,[s,h,S,n]),fe=e.useMemo(()=>s?pe.parseRule({recurrenceRule:s}):null,[s]),P=e.useRef(E);e.useEffect(()=>{f&&E&&E!==P.current&&m(r.endTimezone,{value:E}),P.current=E},[E,f,m,r.endTimezone]);const j=e.useCallback(o=>{o.preventDefault(),f?F(!0):O(!0)},[f]),Te=e.useCallback(()=>{m(r.startTimezone,{value:null}),m(r.endTimezone,{value:null}),O(!1),F(!1)},[m,r.startTimezone,r.endTimezone]),W=e.useCallback(()=>{F(!1)},[]),ve=e.useCallback(()=>{D(!0)},[]),Se=e.useCallback(o=>{m(r.recurrenceRule,{value:o}),D(!1)},[m,r.recurrenceRule]),he=e.useCallback(()=>{D(!1)},[]),Re=e.useCallback(()=>{N(!0)},[]),be=e.useCallback(()=>{m(r.recurrenceRule,{value:null}),m(r.recurrenceExceptions,{value:null}),N(!1),D(!1)},[m,r.recurrenceRule,r.recurrenceExceptions]),Le=e.useCallback(()=>{N(!1)},[]),ke=e.useMemo(()=>L.classNames("k-scheduler-edit-form",a.className),[a.className]);return e.createElement(e.Fragment,null,e.createElement(z,{ref:z===i.as?c:void 0,horizontal:!0,...y,className:ke},e.createElement(e.Fragment,null,e.createElement(l.FieldWrapper,null,e.createElement(k.Label,{className:"k-form-label"},e.createElement(L.SvgIcon,{icon:v.rightDoubleQuotesIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(l.Field,{id:"k-scheduler-editor-title",name:r.title,field:r.title,component:$,placeholder:n.toLanguageString(t.editorEventTitle,t.messages[t.editorEventTitle]),"aria-label":n.toLanguageString(t.editorEventTitle,t.messages[t.editorEventTitle])}))),e.createElement(l.FieldWrapper,null,e.createElement(k.Label,{className:"k-form-label"},e.createElement(L.SvgIcon,{icon:v.clockIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-datetime-section"},e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(l.Field,{id:"k-is-allday-switch",name:r.isAllDay,component:ne,onLabel:"",offLabel:"",ariaLabel:_}),e.createElement(l.Field,{name:r.isAllDay,field:r.isAllDay,editorId:"k-is-allday-switch",component:ae},_)),e.createElement("div",{className:"k-scheduler-datetime-grid"},R?e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(l.Field,{name:r.start,component:A,isAllDay:R,fieldError:a.errors[r.start],ariaLabel:n.toLanguageString(t.editorEventStart,t.messages[t.editorEventStart]),timezone:u}),e.createElement(l.Field,{name:r.end,component:M,editorId:"k-scheduler-editor-end",className:"k-scheduler-datetime-label"},n.toLanguageString(t.editorDateConnectorTo,t.messages[t.editorDateConnectorTo])),e.createElement(l.Field,{name:r.end,component:q,isAllDay:R,dateId:"k-scheduler-editor-end",fieldError:a.errors[r.end],ariaLabel:n.toLanguageString(t.editorEventEnd,t.messages[t.editorEventEnd]),timezone:u})):e.createElement(e.Fragment,null,e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(l.Field,{name:r.start,component:A,isAllDay:R,timeId:"k-scheduler-editor-start-time",connectorElement:e.createElement(l.Field,{name:r.start,component:re,editorId:"k-scheduler-editor-start-time",className:"k-scheduler-datetime-label"},n.toLanguageString(t.editorDateConnectorFrom,t.messages[t.editorDateConnectorFrom])),fieldError:a.errors[r.start],ariaLabel:n.toLanguageString(t.editorEventStart,t.messages[t.editorEventStart]),timeAriaLabel:n.toLanguageString(t.editorStartTimeAriaLabel,t.messages[t.editorStartTimeAriaLabel]),timezone:u})),!f&&e.createElement(b.Button,{className:"k-col-span-2",fillMode:"flat",themeColor:"primary",title:n.toLanguageString(t.editorSetTimezoneTitle,t.messages[t.editorSetTimezoneTitle]),onClick:j,svgIcon:v.globeIcon},n.toLanguageString(t.editorTimezoneButton,t.messages[t.editorTimezoneButton])),f&&e.createElement(e.Fragment,null,e.createElement(l.Field,{name:r.startTimezone,component:ee,data:C,value:E,ariaLabel:n.toLanguageString(t.editorEventStartTimeZone,t.messages[t.editorEventStartTimeZone])}),e.createElement(b.Button,{title:n.toLanguageString(t.editorResetTimezoneTitle,t.messages[t.editorResetTimezoneTitle]),"aria-label":n.toLanguageString(t.editorResetTimezoneAriaLabel,t.messages[t.editorResetTimezoneAriaLabel]),onClick:j,svgIcon:v.globeIcon,fillMode:"flat",themeColor:"primary"})),e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(l.Field,{name:r.end,component:q,isAllDay:R,timeId:"k-scheduler-editor-end-time",connectorElement:e.createElement(l.Field,{name:r.end,component:M,editorId:"k-scheduler-editor-end-time",className:"k-scheduler-datetime-label"},n.toLanguageString(t.editorDateConnectorTo,t.messages[t.editorDateConnectorTo])),fieldError:a.errors[r.end],ariaLabel:n.toLanguageString(t.editorEventEnd,t.messages[t.editorEventEnd]),timeAriaLabel:n.toLanguageString(t.editorEndTimeAriaLabel,t.messages[t.editorEndTimeAriaLabel]),timezone:u})),f&&e.createElement(l.Field,{name:r.endTimezone,component:te,data:C,value:g(r.endTimezone)||u||"",ariaLabel:n.toLanguageString(t.editorEventEndTimeZone,t.messages[t.editorEventEndTimeZone])}))),ce&&e.createElement("div",{className:"k-scheduler-edit-form-row"},e.createElement(b.Button,{className:"k-scheduler-recurrence-button",type:"button",fillMode:"flat",themeColor:"primary",svgIcon:v.arrowRotateCwIcon,onClick:ve},Z?e.createElement(Z,{recurrenceRule:s,text:Ee,parsedRule:fe}):ge))))),e.createElement(l.FieldWrapper,null,e.createElement(k.Label,{className:"k-form-label"},e.createElement(L.SvgIcon,{icon:v.commentIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(l.Field,{component:le,name:r.description,id:"k-event-description",resizable:"vertical",placeholder:n.toLanguageString(t.editorEventDescription,t.messages[t.editorEventDescription]),"aria-label":n.toLanguageString(t.editorEventDescription,t.messages[t.editorEventDescription])}))),(x||[]).map(o=>e.createElement(l.FieldWrapper,{key:o.field},o.svgIcon&&e.createElement(k.Label,{className:"k-form-label"},e.createElement(L.SvgIcon,{icon:o.svgIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(l.Field,{name:o.field,component:ie,resource:o,multiple:o.multiple,data:o.data,textField:o.textField,valueField:o.valueField,colorField:o.colorField,ariaLabel:o.name||o.field})))))),me&&e.createElement(Fe.SchedulerRecurrenceDialog,{value:s,start:h,timezone:u||"",onSave:Se,onCancel:he,onRemoveRecurrence:Re,recurrenceSummaryTemplate:ue,recurrenceEditor:oe}),de&&e.createElement(Ne.RemoveRecurrenceConfirmDialog,{onConfirm:be,onCancel:Le}),se&&e.createElement(K.Dialog,{title:n.toLanguageString(t.resetTimezoneDialogTitle,t.messages[t.resetTimezoneDialogTitle]),onClose:W},n.toLanguageString(t.resetTimezoneConfirmation,t.messages[t.resetTimezoneConfirmation]),e.createElement(K.DialogActionsBar,null,e.createElement(b.Button,{onClick:W},n.toLanguageString(t.resetTimezoneNo,t.messages[t.resetTimezoneNo])),e.createElement(b.Button,{themeColor:"primary",onClick:Te},n.toLanguageString(t.resetTimezoneYes,t.messages[t.resetTimezoneYes])))))});U.displayName="KendoReactSchedulerFormEditor";const V=e.forwardRef((a,d)=>e.createElement(l.FormElement,{ref:d,id:a.id,style:a.style,tabIndex:a.tabIndex,className:a.className,horizontal:a.horizontal,children:a.children}));V.displayName="SchedulerFormEditorDefaultElement";const X=a=>{const{value:d,onChange:c,valid:T,visited:C,touched:n,modified:S,name:r,validationMessage:x,...u}=a,z=e.useCallback(y=>{c&&c({value:y.value})},[c]);return e.createElement(w.Switch,{...u,checked:d||!1,onChange:z})};X.displayName="SwitchFieldAdapter";const p=a=>e.createElement(k.Label,{...a,style:{marginBottom:0,...a.style}});p.displayName="DefaultLabel";const i={as:V,titleEditor:w.Input,startEditor:G.ZonedSplitDateTime,endEditor:G.ZonedSplitDateTime,startTimezoneEditor:Y.TimezoneDropDownList,endTimezoneEditor:Y.TimezoneDropDownList,startLabel:p,endLabel:p,allDayEditor:X,allDayLabel:p,recurrenceEditor:Ce.RecurrenceEditor,descriptionEditor:w.TextArea,resourceEditor:ye.ResourceEditor};exports.SchedulerFormEditor=U;exports.schedulerFormEditorDefaultProps=i;
@@ -8,11 +8,11 @@
8
8
  import * as e from "react";
9
9
  import { timezoneNames as Oe } from "@progress/kendo-date-math";
10
10
  import { parseRule as Pe } from "@progress/kendo-recurrence";
11
- import { Label as b } from "@progress/kendo-react-labels";
11
+ import { Label as L } from "@progress/kendo-react-labels";
12
12
  import { useLocalization as Ge, useInternationalization as Ke } from "@progress/kendo-react-intl";
13
13
  import { FieldWrapper as k, Field as o, FormElement as Qe } from "@progress/kendo-react-form";
14
14
  import { TextArea as We, Input as Ye, Switch as je } from "@progress/kendo-react-inputs";
15
- import { Button as L } from "@progress/kendo-react-buttons";
15
+ import { Button as S } from "@progress/kendo-react-buttons";
16
16
  import { classNames as qe, SvgIcon as p } from "@progress/kendo-react-common";
17
17
  import { rightDoubleQuotesIcon as Je, clockIcon as Ue, globeIcon as q, arrowRotateCwIcon as Ve, commentIcon as Xe } from "@progress/kendo-svg-icons";
18
18
  import { editorEventAllDay as J, messages as a, editorMakeRecurring as U, editorEventTitle as z, editorEventStart as C, editorDateConnectorTo as D, editorEventEnd as y, editorStartTimeAriaLabel as V, editorDateConnectorFrom as X, editorSetTimezoneTitle as $, editorTimezoneButton as ee, editorEventStartTimeZone as te, editorResetTimezoneAriaLabel as re, editorResetTimezoneTitle as ae, editorEndTimeAriaLabel as ne, editorEventEndTimeZone as le, editorEventDescription as N, resetTimezoneDialogTitle as oe, resetTimezoneConfirmation as ie, resetTimezoneNo as ce, resetTimezoneYes as me } from "../messages/index.mjs";
@@ -41,23 +41,23 @@ const it = e.forwardRef(
41
41
  f,
42
42
  () => I.current
43
43
  );
44
- const { as: S = i.as, ...x } = n, { onChange: m, valueGetter: u } = n, {
44
+ const { as: b = i.as, ...x } = n, { onChange: m, valueGetter: u } = n, {
45
45
  titleEditor: fe = i.titleEditor,
46
- startEditor: H = i.startEditor,
47
- endEditor: Z = i.endEditor,
46
+ startEditor: Z = i.startEditor,
47
+ endEditor: H = i.endEditor,
48
48
  startTimezoneEditor: he = i.startTimezoneEditor,
49
49
  endTimezoneEditor: ve = i.endTimezoneEditor,
50
50
  startLabel: Te = i.startLabel,
51
51
  endLabel: O = i.endLabel,
52
- allDayEditor: Le = i.allDayEditor,
53
- allDayLabel: be = i.allDayLabel,
54
- recurrenceEditor: Se,
52
+ allDayEditor: Se = i.allDayEditor,
53
+ allDayLabel: Le = i.allDayLabel,
54
+ recurrenceEditor: be,
55
55
  descriptionEditor: Re = i.descriptionEditor,
56
56
  resourceEditor: ke = i.resourceEditor
57
57
  } = n, v = e.useMemo(() => u(t.start) || /* @__PURE__ */ new Date(), [u, t.start]), T = u(t.isAllDay) || !1, E = u(t.startTimezone) || s || "", c = u(t.recurrenceRule), P = u(t.recurrenceId), pe = !(P != null), G = e.useMemo(
58
58
  () => r.toLanguageString(J, a[J]),
59
59
  [r]
60
- ), [g, K] = e.useState(!!u(t.startTimezone)), [ze, A] = e.useState(!1), [Ce, R] = e.useState(!1), [De, M] = e.useState(!1), Q = n.recurrenceButtonTextTemplate, ye = n.recurrenceEditorHintTemplate, B = e.useMemo(
60
+ ), [g, K] = e.useState(!!u(t.startTimezone)), [ze, A] = e.useState(!1), [Ce, R] = e.useState(!1), [De, M] = e.useState(!1), Q = n.recurrenceButtonTextTemplate, ye = n.recurrenceSummaryTemplate, B = e.useMemo(
61
61
  () => r.toLanguageString(U, a[U]),
62
62
  [r]
63
63
  ), Ne = e.useMemo(() => c && ue(c, v, h, r) || B, [c, v, h, r, B]), we = e.useMemo(() => c ? ue(c, v, h, r) : null, [c, v, h, r]), Ie = e.useMemo(() => c ? Pe({ recurrenceRule: c }) : null, [c]), W = e.useRef(E);
@@ -86,18 +86,18 @@ const it = e.forwardRef(
86
86
  M(!0);
87
87
  }, []), _e = e.useCallback(() => {
88
88
  m(t.recurrenceRule, { value: null }), m(t.recurrenceExceptions, { value: null }), M(!1), R(!1);
89
- }, [m, t.recurrenceRule, t.recurrenceExceptions]), He = e.useCallback(() => {
89
+ }, [m, t.recurrenceRule, t.recurrenceExceptions]), Ze = e.useCallback(() => {
90
90
  M(!1);
91
- }, []), Ze = e.useMemo(() => qe("k-scheduler-edit-form", n.className), [n.className]);
91
+ }, []), He = e.useMemo(() => qe("k-scheduler-edit-form", n.className), [n.className]);
92
92
  return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
93
- S,
93
+ b,
94
94
  {
95
- ref: S === i.as ? d : void 0,
95
+ ref: b === i.as ? d : void 0,
96
96
  horizontal: !0,
97
97
  ...x,
98
- className: Ze
98
+ className: He
99
99
  },
100
- /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement(b, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(p, { icon: Je, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
100
+ /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement(L, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(p, { icon: Je, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
101
101
  o,
102
102
  {
103
103
  id: "k-scheduler-editor-title",
@@ -113,12 +113,12 @@ const it = e.forwardRef(
113
113
  a[z]
114
114
  )
115
115
  }
116
- ))), /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement(b, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(p, { icon: Ue, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-datetime-section" }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-edit-form-row" }, /* @__PURE__ */ e.createElement(
116
+ ))), /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement(L, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(p, { icon: Ue, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-datetime-section" }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-edit-form-row" }, /* @__PURE__ */ e.createElement(
117
117
  o,
118
118
  {
119
119
  id: "k-is-allday-switch",
120
120
  name: t.isAllDay,
121
- component: Le,
121
+ component: Se,
122
122
  onLabel: "",
123
123
  offLabel: "",
124
124
  ariaLabel: G
@@ -129,14 +129,14 @@ const it = e.forwardRef(
129
129
  name: t.isAllDay,
130
130
  field: t.isAllDay,
131
131
  editorId: "k-is-allday-switch",
132
- component: be
132
+ component: Le
133
133
  },
134
134
  G
135
135
  )), /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-datetime-grid" }, T ? /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-edit-form-row" }, /* @__PURE__ */ e.createElement(
136
136
  o,
137
137
  {
138
138
  name: t.start,
139
- component: H,
139
+ component: Z,
140
140
  isAllDay: T,
141
141
  fieldError: n.errors[t.start],
142
142
  ariaLabel: r.toLanguageString(
@@ -161,7 +161,7 @@ const it = e.forwardRef(
161
161
  o,
162
162
  {
163
163
  name: t.end,
164
- component: Z,
164
+ component: H,
165
165
  isAllDay: T,
166
166
  dateId: "k-scheduler-editor-end",
167
167
  fieldError: n.errors[t.end],
@@ -175,7 +175,7 @@ const it = e.forwardRef(
175
175
  o,
176
176
  {
177
177
  name: t.start,
178
- component: H,
178
+ component: Z,
179
179
  isAllDay: T,
180
180
  timeId: "k-scheduler-editor-start-time",
181
181
  connectorElement: /* @__PURE__ */ e.createElement(
@@ -203,7 +203,7 @@ const it = e.forwardRef(
203
203
  timezone: s
204
204
  }
205
205
  )), !g && /* @__PURE__ */ e.createElement(
206
- L,
206
+ S,
207
207
  {
208
208
  className: "k-col-span-2",
209
209
  fillMode: "flat",
@@ -232,7 +232,7 @@ const it = e.forwardRef(
232
232
  )
233
233
  }
234
234
  ), /* @__PURE__ */ e.createElement(
235
- L,
235
+ S,
236
236
  {
237
237
  title: r.toLanguageString(
238
238
  ae,
@@ -251,7 +251,7 @@ const it = e.forwardRef(
251
251
  o,
252
252
  {
253
253
  name: t.end,
254
- component: Z,
254
+ component: H,
255
255
  isAllDay: T,
256
256
  timeId: "k-scheduler-editor-end-time",
257
257
  connectorElement: /* @__PURE__ */ e.createElement(
@@ -291,7 +291,7 @@ const it = e.forwardRef(
291
291
  )
292
292
  }
293
293
  ))), pe && /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-edit-form-row" }, /* @__PURE__ */ e.createElement(
294
- L,
294
+ S,
295
295
  {
296
296
  className: "k-scheduler-recurrence-button",
297
297
  type: "button",
@@ -308,7 +308,7 @@ const it = e.forwardRef(
308
308
  parsedRule: Ie
309
309
  }
310
310
  ) : Ne
311
- ))))), /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement(b, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(p, { icon: Xe, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
311
+ ))))), /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement(L, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(p, { icon: Xe, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
312
312
  o,
313
313
  {
314
314
  component: Re,
@@ -324,7 +324,7 @@ const it = e.forwardRef(
324
324
  a[N]
325
325
  )
326
326
  }
327
- ))), (_ || []).map((l) => /* @__PURE__ */ e.createElement(k, { key: l.field }, l.svgIcon && /* @__PURE__ */ e.createElement(b, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(p, { icon: l.svgIcon, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
327
+ ))), (_ || []).map((l) => /* @__PURE__ */ e.createElement(k, { key: l.field }, l.svgIcon && /* @__PURE__ */ e.createElement(L, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(p, { icon: l.svgIcon, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
328
328
  o,
329
329
  {
330
330
  name: l.field,
@@ -347,14 +347,14 @@ const it = e.forwardRef(
347
347
  onSave: Ae,
348
348
  onCancel: Me,
349
349
  onRemoveRecurrence: Be,
350
- recurrenceEditorHintTemplate: ye,
351
- recurrenceEditor: Se
350
+ recurrenceSummaryTemplate: ye,
351
+ recurrenceEditor: be
352
352
  }
353
353
  ), De && /* @__PURE__ */ e.createElement(
354
354
  nt,
355
355
  {
356
356
  onConfirm: _e,
357
- onCancel: He
357
+ onCancel: Ze
358
358
  }
359
359
  ), ze && /* @__PURE__ */ e.createElement(
360
360
  tt,
@@ -366,7 +366,7 @@ const it = e.forwardRef(
366
366
  onClose: j
367
367
  },
368
368
  r.toLanguageString(ie, a[ie]),
369
- /* @__PURE__ */ e.createElement(rt, null, /* @__PURE__ */ e.createElement(L, { onClick: j }, r.toLanguageString(ce, a[ce])), /* @__PURE__ */ e.createElement(L, { themeColor: "primary", onClick: Fe }, r.toLanguageString(me, a[me])))
369
+ /* @__PURE__ */ e.createElement(rt, null, /* @__PURE__ */ e.createElement(S, { onClick: j }, r.toLanguageString(ce, a[ce])), /* @__PURE__ */ e.createElement(S, { themeColor: "primary", onClick: Fe }, r.toLanguageString(me, a[me])))
370
370
  ));
371
371
  }
372
372
  );
@@ -395,16 +395,16 @@ const ge = (n) => {
395
395
  name: t,
396
396
  validationMessage: _,
397
397
  ...s
398
- } = n, S = e.useCallback(
398
+ } = n, b = e.useCallback(
399
399
  (x) => {
400
400
  d && d({ value: x.value });
401
401
  },
402
402
  [d]
403
403
  );
404
- return /* @__PURE__ */ e.createElement(je, { ...s, checked: f || !1, onChange: S });
404
+ return /* @__PURE__ */ e.createElement(je, { ...s, checked: f || !1, onChange: b });
405
405
  };
406
406
  ge.displayName = "SwitchFieldAdapter";
407
- const w = (n) => /* @__PURE__ */ e.createElement(b, { ...n, style: { marginBottom: 0, ...n.style } });
407
+ const w = (n) => /* @__PURE__ */ e.createElement(L, { ...n, style: { marginBottom: 0, ...n.style } });
408
408
  w.displayName = "DefaultLabel";
409
409
  const i = {
410
410
  as: Ee,
@@ -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 { RecurrenceEditorHintTemplateProps } from './SchedulerFormEditor.js';
8
+ import { RecurrenceSummaryTemplateProps } from './SchedulerFormEditor.js';
9
9
  import * as React from 'react';
10
10
  /** @hidden */
11
11
  export interface SchedulerRecurrenceDialogProps {
@@ -22,7 +22,7 @@ export interface SchedulerRecurrenceDialogProps {
22
22
  /** Fires when the user clicks Remove recurrence. */
23
23
  onRemoveRecurrence?: () => void;
24
24
  /** Custom template for the recurrence summary text. */
25
- recurrenceEditorHintTemplate?: React.ComponentType<RecurrenceEditorHintTemplateProps>;
25
+ recurrenceSummaryTemplate?: React.ComponentType<RecurrenceSummaryTemplateProps>;
26
26
  /** Custom recurrence editor component rendered inside the dialog instead of the built-in form. */
27
27
  recurrenceEditor?: React.ComponentType<any>;
28
28
  }
@@ -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 Se=require("react"),qe=require("react-dom"),Ne=require("@progress/kendo-react-common"),B=require("@progress/kendo-react-buttons"),le=require("@progress/kendo-react-dialogs"),oe=require("@progress/kendo-react-intl"),C=require("@progress/kendo-react-inputs"),h=require("@progress/kendo-react-dropdowns"),We=require("@progress/kendo-react-dateinputs"),w=require("@progress/kendo-react-labels"),m=require("@progress/kendo-react-form"),M=require("@progress/kendo-date-math"),T=require("@progress/kendo-recurrence"),l=require("../messages/index.js"),s=require("../recurrence/common.js"),Fe=require("../hooks/useRecurrenceSummary.js"),Oe=require("../context/SchedulerContext.js");function ce(D){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(D){for(const E in D)if(E!=="default"){const i=Object.getOwnPropertyDescriptor(D,E);Object.defineProperty(f,E,i.get?i:{enumerable:!0,get:()=>D[E]})}}return f.default=D,Object.freeze(f)}const e=ce(Se),Le=ce(qe),ue=D=>{const{value:f,start:E,timezone:i,onSave:x,onCancel:Y,onRemoveRecurrence:Z,recurrenceEditorHintTemplate:A,recurrenceEditor:S}=D,u=oe.useInternationalization(),g=oe.useLocalization(),q=Oe.useSchedulerFieldsContext(),o=e.useCallback((a,t)=>{const r=t?a:"scheduler.recurrenceEditor"+a;return g.toLanguageString(r,l.messages[r])},[g]),[n,se]=e.useState(()=>{const a=s.getRule(f!=null?f:"");return a.freq?a:{freq:"daily",interval:1}}),[P,ie]=e.useState(1),[K,de]=e.useState(()=>M.ZonedDate.fromUTCDate(E)),[d]=e.useState(E),N=e.useRef(null),v=e.useMemo(()=>s.getFrequency(n),[n]),G=e.useMemo(()=>s.getWeekDays(u),[u]),W=e.useMemo(()=>s.getExtendedWeekDays(u,o),[u,o]),b=e.useMemo(()=>s.getWeekDay(W,n,d),[W,n,d]),F=e.useMemo(()=>s.getMonths(u),[u]),H=e.useMemo(()=>s.getMonth(F,n),[F,n]),O=e.useMemo(()=>s.getOffsets(o),[o]),k=e.useMemo(()=>s.getOffset(O,n),[O,n]),L=e.useMemo(()=>s.getEndRule(n),[n]),j=e.useMemo(()=>s.getMonthDay(n,d),[n,d]),U=e.useMemo(()=>n.until?M.toLocalDate(n.until):null,[n.until]),y=e.useMemo(()=>s.getRepeatOnRule(n),[n.byWeekDay,n.byMonthDay]),me=!!f,ye=g.toLanguageString(l.editorSave,l.messages[l.editorSave]),fe=g.toLanguageString(l.editorCancel,l.messages[l.editorCancel]),c=e.useCallback(a=>{se({...a})},[]),$=e.useCallback(a=>{const t={};t.freq=a,t.interval=1,a==="weekly"&&(t.byWeekDay=[{day:M.ZonedDate.fromLocalDate(d,i).getDay(),offset:0}]),(a==="monthly"||a==="yearly")&&(t.byMonthDay=[d.getDate()]),a==="yearly"&&(t.byMonth=[d.getMonth()+1]),c(t)},[d,i,c]),ve=e.useCallback(a=>{var t;c({...n,interval:(t=a.value)!=null?t:1})},[n,c]),ke=e.useCallback(a=>{const t=a.value;c({...n,count:t!=null?t:void 0}),t!==null&&ie(t)},[n,c]),he=e.useCallback(a=>{if(!a.value)return;const t=M.ZonedDate.fromLocalDate(a.value,i);c({...n,until:t}),de(t)},[n,i,c]),J=e.useCallback(a=>{c({...n,byWeekDay:G.filter(t=>a.some(r=>r===t.value)).map(t=>({offset:0,day:t.value}))})},[n,G,c]),Q=e.useCallback(a=>{const t={...n},r=a.target.value;typeof r.value=="string"?(t.byWeekDay=s.weekDayRuleFromString(r.value),t.bySetPosition=[k.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:k.value}]),c(t)},[k.value,n,c]),X=e.useCallback(a=>{var t;c({...n,byMonthDay:[(t=a.value)!=null?t:1]})},[n,c]),ee=e.useCallback(a=>{c({...n,byMonth:[a.value.value]})},[n,c]),De=e.useCallback(a=>{const t=a.value.value,r={...n};switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=P;break;case"until":r.until=K,r.count=void 0;break}c(r)},[n,P,K,c]),te=e.useCallback(a=>{const t={...n};a.value==="monthday"?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[j]):a.value==="weekday"&&(t.byMonthDay=void 0,typeof b.value=="string"?(t.bySetPosition=[k.value],t.byWeekDay=s.weekDayRuleFromString(b.value)):t.byWeekDay=[{day:b.value,offset:k.value}]),c(t)},[n,j,b,k.value,c]),ae=e.useCallback(a=>{const t={...n},r=a.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value;break}c(t)},[n,c]),Ee=e.useCallback(a=>{const t=a.value.value;$(t)},[$]),I=e.useMemo(()=>[{text:o(l.recurrenceEditorFrequenciesDaily,!0),value:"daily"},{text:o(l.recurrenceEditorFrequenciesWeekly,!0),value:"weekly"},{text:o(l.recurrenceEditorFrequenciesMonthly,!0),value:"monthly"},{text:o(l.recurrenceEditorFrequenciesYearly,!0),value:"yearly"}],[o]),z=e.useMemo(()=>[{text:o(l.recurrenceEditorEndNever,!0),value:"never"},{text:o(l.recurrenceEditorEndAfter,!0),value:"count"},{text:o(l.recurrenceEditorEndOn,!0),value:"until"}],[o]),ge=e.useMemo(()=>I.find(a=>a.value===v)||I[0],[I,v]),be=e.useMemo(()=>z.find(a=>a.value===L)||z[0],[z,L]),pe=e.useMemo(()=>{const a=u.firstDay(),t=u.dateFormatNames({type:"days",nameType:"narrow"}),r=u.dateFormatNames({type:"days",nameType:"wide"}),V=t.map((xe,re)=>({narrow:xe,wide:r[re],value:re}));return V.slice(a).concat(V.slice(0,a))},[u]),p=e.useMemo(()=>(n.byWeekDay||[]).map(({day:a})=>a),[n.byWeekDay]),Ce=e.useCallback(a=>{const t=p.includes(a)?p.filter(r=>r!==a):[...p,a];J(t)},[p,J]),Re=e.useCallback(()=>{var a;if(S){const t=((a=N.current)==null?void 0:a.call(N,q.recurrenceRule))||null;x(t)}else n.freq==="never"||!n.freq?x(null):(n.weekStart===void 0&&(n.weekStart=u.firstDay()),x(T.serializeRule(n,i)))},[S,n,i,u,x]),ne=e.useCallback(()=>{Y()},[Y]),_=e.useMemo(()=>{if(!n.freq||n.freq==="never")return"";const a=T.serializeRule(n,i);return Fe.getRecurrenceSummary(a,d,u,g)},[n,i,d,u,g]),R=e.useMemo(()=>!n.freq||n.freq==="never"?null:T.serializeRule(n,i),[n,i]),we=e.useMemo(()=>R?T.parseRule({recurrenceRule:R}):null,[R]),Me=e.createElement(le.Dialog,{title:o(l.recurrenceEditorDialogTitle,!0),onClose:ne,width:540},S?e.createElement(m.Form,{initialValues:{[q.recurrenceRule]:f||""},render:a=>(N.current=a.valueGetter,e.createElement(m.FormElement,{horizontal:!0},e.createElement(m.Field,{name:q.recurrenceRule,field:q.recurrenceRule,component:S,start:d})))}):e.createElement(m.Form,{render:()=>{var a,t;return e.createElement(m.FormElement,{horizontal:!0},e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{editorId:"recurrence-interval",className:"k-form-label"},o(l.recurrenceEditorRepeat,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-recurrence-fields"},v!=="never"&&e.createElement(C.NumericTextBox,{id:"recurrence-interval",min:1,step:1,defaultValue:1,value:n.interval,onChange:ve}),e.createElement(h.DropDownList,{data:I,textField:"text",dataItemKey:"value",value:ge,onChange:Ee})))),v==="weekly"&&e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},o(l.recurrenceEditorWeeklyRepeatOn,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-weekday-picker",role:"group","aria-label":o(l.recurrenceEditorWeeklyRepeatOnDays,!0)},pe.map(r=>e.createElement(B.Button,{key:r.value,type:"button",themeColor:"primary",fillMode:"flat",rounded:"full",togglable:!0,selected:p.includes(r.value),"aria-label":r.wide,"aria-pressed":p.includes(r.value),onClick:()=>Ce(r.value)},r.narrow))))),v==="monthly"&&e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},o(l.recurrenceEditorMonthlyRepeatOn,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(C.RadioGroup,{value:y,onChange:te,className:"k-reset",data:[{value:"weekday",label:" ",children:[e.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},e.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:y!=="weekday",data:O,value:k,onChange:ae}),e.createElement(h.DropDownList,{disabled:y!=="weekday",value:b,data:W,onChange:Q,textField:"text",dataItemKey:"value"}))]},{value:"monthday",label:" ",children:[e.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},e.createElement(C.NumericTextBox,{min:1,max:31,disabled:y!=="monthday",value:(a=n==null?void 0:n.byMonthDay)==null?void 0:a[0],onChange:X,width:"auto"}))]}]}))),v==="yearly"&&e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},o(l.recurrenceEditorYearlyRepeatOn,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(C.RadioGroup,{value:y,onChange:te,className:"k-reset",data:[{value:"monthday",label:" ",children:[e.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},e.createElement(h.DropDownList,{disabled:y!=="monthday",value:H,data:F,textField:"text",dataItemKey:"value",onChange:ee}),e.createElement(C.NumericTextBox,{min:1,max:31,disabled:y!=="monthday",value:j,onChange:X,width:"auto"}))]},{value:"weekday",label:" ",children:[e.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},e.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:y!=="weekday",data:O,value:k,onChange:ae}),e.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:y!=="weekday",value:b,data:W,onChange:Q}),e.createElement("span",{key:"of-row",className:"k-scheduler-edit-form-row"},e.createElement("span",null,o(l.recurrenceEditorYearlyOf,!0)),e.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:y!=="weekday",value:H,data:F,onChange:ee})))]}]}))),v!=="never"&&e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},o(l.recurrenceEditorEndLabel,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-recurrence-fields"},e.createElement(h.DropDownList,{data:z,textField:"text",dataItemKey:"value",value:be,onChange:De}),L==="count"&&e.createElement(C.NumericTextBox,{min:1,width:"auto",value:(t=n.count)!=null?t:P,onChange:ke,format:`0 '${o(l.recurrenceEditorEndOccurrence,!0)}'`}),L==="until"&&e.createElement(We.DatePicker,{min:d,value:U!=null?U:M.toLocalDate(K),onChange:he,width:"auto"})))),v!=="never"&&(A&&R?e.createElement(m.FieldWrapper,null,e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-form-hint"},e.createElement(A,{recurrenceRule:R,text:_||"",parsedRule:we})))):_?e.createElement(m.FieldWrapper,null,e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-form-hint"},_))):null))}}),e.createElement(le.DialogActionsBar,{layout:"end"},me&&Z&&e.createElement(B.Button,{fillMode:"flat",themeColor:"primary",onClick:Z},o(l.recurrenceEditorRemoveRecurrence,!0)),e.createElement(B.Button,{onClick:ne},fe),e.createElement(B.Button,{themeColor:"primary",onClick:Re},ye)));return Ne.canUseDOM?Le.createPortal(Me,document.body):null};ue.displayName="KendoReactSchedulerRecurrenceDialog";exports.SchedulerRecurrenceDialog=ue;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Se=require("react"),qe=require("react-dom"),Ne=require("@progress/kendo-react-common"),B=require("@progress/kendo-react-buttons"),le=require("@progress/kendo-react-dialogs"),oe=require("@progress/kendo-react-intl"),C=require("@progress/kendo-react-inputs"),h=require("@progress/kendo-react-dropdowns"),We=require("@progress/kendo-react-dateinputs"),w=require("@progress/kendo-react-labels"),m=require("@progress/kendo-react-form"),M=require("@progress/kendo-date-math"),T=require("@progress/kendo-recurrence"),l=require("../messages/index.js"),s=require("../recurrence/common.js"),Fe=require("../hooks/useRecurrenceSummary.js"),Oe=require("../context/SchedulerContext.js");function ce(D){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(D){for(const E in D)if(E!=="default"){const i=Object.getOwnPropertyDescriptor(D,E);Object.defineProperty(f,E,i.get?i:{enumerable:!0,get:()=>D[E]})}}return f.default=D,Object.freeze(f)}const e=ce(Se),Le=ce(qe),ue=D=>{const{value:f,start:E,timezone:i,onSave:x,onCancel:Y,onRemoveRecurrence:Z,recurrenceSummaryTemplate:A,recurrenceEditor:S}=D,u=oe.useInternationalization(),g=oe.useLocalization(),q=Oe.useSchedulerFieldsContext(),o=e.useCallback((a,t)=>{const r=t?a:"scheduler.recurrenceEditor"+a;return g.toLanguageString(r,l.messages[r])},[g]),[n,se]=e.useState(()=>{const a=s.getRule(f!=null?f:"");return a.freq?a:{freq:"daily",interval:1}}),[P,ie]=e.useState(1),[K,de]=e.useState(()=>M.ZonedDate.fromUTCDate(E)),[d]=e.useState(E),N=e.useRef(null),v=e.useMemo(()=>s.getFrequency(n),[n]),G=e.useMemo(()=>s.getWeekDays(u),[u]),W=e.useMemo(()=>s.getExtendedWeekDays(u,o),[u,o]),b=e.useMemo(()=>s.getWeekDay(W,n,d),[W,n,d]),F=e.useMemo(()=>s.getMonths(u),[u]),$=e.useMemo(()=>s.getMonth(F,n),[F,n]),O=e.useMemo(()=>s.getOffsets(o),[o]),k=e.useMemo(()=>s.getOffset(O,n),[O,n]),L=e.useMemo(()=>s.getEndRule(n),[n]),j=e.useMemo(()=>s.getMonthDay(n,d),[n,d]),U=e.useMemo(()=>n.until?M.toLocalDate(n.until):null,[n.until]),y=e.useMemo(()=>s.getRepeatOnRule(n),[n.byWeekDay,n.byMonthDay]),me=!!f,ye=g.toLanguageString(l.editorSave,l.messages[l.editorSave]),fe=g.toLanguageString(l.editorCancel,l.messages[l.editorCancel]),c=e.useCallback(a=>{se({...a})},[]),H=e.useCallback(a=>{const t={};t.freq=a,t.interval=1,a==="weekly"&&(t.byWeekDay=[{day:M.ZonedDate.fromLocalDate(d,i).getDay(),offset:0}]),(a==="monthly"||a==="yearly")&&(t.byMonthDay=[d.getDate()]),a==="yearly"&&(t.byMonth=[d.getMonth()+1]),c(t)},[d,i,c]),ve=e.useCallback(a=>{var t;c({...n,interval:(t=a.value)!=null?t:1})},[n,c]),ke=e.useCallback(a=>{const t=a.value;c({...n,count:t!=null?t:void 0}),t!==null&&ie(t)},[n,c]),he=e.useCallback(a=>{if(!a.value)return;const t=M.ZonedDate.fromLocalDate(a.value,i);c({...n,until:t}),de(t)},[n,i,c]),J=e.useCallback(a=>{c({...n,byWeekDay:G.filter(t=>a.some(r=>r===t.value)).map(t=>({offset:0,day:t.value}))})},[n,G,c]),Q=e.useCallback(a=>{const t={...n},r=a.target.value;typeof r.value=="string"?(t.byWeekDay=s.weekDayRuleFromString(r.value),t.bySetPosition=[k.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:k.value}]),c(t)},[k.value,n,c]),X=e.useCallback(a=>{var t;c({...n,byMonthDay:[(t=a.value)!=null?t:1]})},[n,c]),ee=e.useCallback(a=>{c({...n,byMonth:[a.value.value]})},[n,c]),De=e.useCallback(a=>{const t=a.value.value,r={...n};switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=P;break;case"until":r.until=K,r.count=void 0;break}c(r)},[n,P,K,c]),te=e.useCallback(a=>{const t={...n};a.value==="monthday"?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[j]):a.value==="weekday"&&(t.byMonthDay=void 0,typeof b.value=="string"?(t.bySetPosition=[k.value],t.byWeekDay=s.weekDayRuleFromString(b.value)):t.byWeekDay=[{day:b.value,offset:k.value}]),c(t)},[n,j,b,k.value,c]),ae=e.useCallback(a=>{const t={...n},r=a.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value;break}c(t)},[n,c]),Ee=e.useCallback(a=>{const t=a.value.value;H(t)},[H]),I=e.useMemo(()=>[{text:o(l.recurrenceEditorFrequenciesDaily,!0),value:"daily"},{text:o(l.recurrenceEditorFrequenciesWeekly,!0),value:"weekly"},{text:o(l.recurrenceEditorFrequenciesMonthly,!0),value:"monthly"},{text:o(l.recurrenceEditorFrequenciesYearly,!0),value:"yearly"}],[o]),z=e.useMemo(()=>[{text:o(l.recurrenceEditorEndNever,!0),value:"never"},{text:o(l.recurrenceEditorEndAfter,!0),value:"count"},{text:o(l.recurrenceEditorEndOn,!0),value:"until"}],[o]),ge=e.useMemo(()=>I.find(a=>a.value===v)||I[0],[I,v]),be=e.useMemo(()=>z.find(a=>a.value===L)||z[0],[z,L]),pe=e.useMemo(()=>{const a=u.firstDay(),t=u.dateFormatNames({type:"days",nameType:"narrow"}),r=u.dateFormatNames({type:"days",nameType:"wide"}),V=t.map((xe,re)=>({narrow:xe,wide:r[re],value:re}));return V.slice(a).concat(V.slice(0,a))},[u]),p=e.useMemo(()=>(n.byWeekDay||[]).map(({day:a})=>a),[n.byWeekDay]),Ce=e.useCallback(a=>{const t=p.includes(a)?p.filter(r=>r!==a):[...p,a];J(t)},[p,J]),Re=e.useCallback(()=>{var a;if(S){const t=((a=N.current)==null?void 0:a.call(N,q.recurrenceRule))||null;x(t)}else n.freq==="never"||!n.freq?x(null):(n.weekStart===void 0&&(n.weekStart=u.firstDay()),x(T.serializeRule(n,i)))},[S,n,i,u,x]),ne=e.useCallback(()=>{Y()},[Y]),_=e.useMemo(()=>{if(!n.freq||n.freq==="never")return"";const a=T.serializeRule(n,i);return Fe.getRecurrenceSummary(a,d,u,g)},[n,i,d,u,g]),R=e.useMemo(()=>!n.freq||n.freq==="never"?null:T.serializeRule(n,i),[n,i]),we=e.useMemo(()=>R?T.parseRule({recurrenceRule:R}):null,[R]),Me=e.createElement(le.Dialog,{title:o(l.recurrenceEditorDialogTitle,!0),onClose:ne,width:540},S?e.createElement(m.Form,{initialValues:{[q.recurrenceRule]:f||""},render:a=>(N.current=a.valueGetter,e.createElement(m.FormElement,{horizontal:!0},e.createElement(m.Field,{name:q.recurrenceRule,field:q.recurrenceRule,component:S,start:d})))}):e.createElement(m.Form,{render:()=>{var a,t;return e.createElement(m.FormElement,{horizontal:!0},e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{editorId:"recurrence-interval",className:"k-form-label"},o(l.recurrenceEditorRepeat,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-recurrence-fields"},v!=="never"&&e.createElement(C.NumericTextBox,{id:"recurrence-interval",min:1,step:1,defaultValue:1,value:n.interval,onChange:ve}),e.createElement(h.DropDownList,{data:I,textField:"text",dataItemKey:"value",value:ge,onChange:Ee})))),v==="weekly"&&e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},o(l.recurrenceEditorWeeklyRepeatOn,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-weekday-picker",role:"group","aria-label":o(l.recurrenceEditorWeeklyRepeatOnDays,!0)},pe.map(r=>e.createElement(B.Button,{key:r.value,type:"button",themeColor:"primary",fillMode:"flat",rounded:"full",togglable:!0,selected:p.includes(r.value),"aria-label":r.wide,"aria-pressed":p.includes(r.value),onClick:()=>Ce(r.value)},r.narrow))))),v==="monthly"&&e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},o(l.recurrenceEditorMonthlyRepeatOn,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(C.RadioGroup,{value:y,onChange:te,className:"k-reset",data:[{value:"weekday",label:" ",children:[e.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},e.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:y!=="weekday",data:O,value:k,onChange:ae}),e.createElement(h.DropDownList,{disabled:y!=="weekday",value:b,data:W,onChange:Q,textField:"text",dataItemKey:"value"}))]},{value:"monthday",label:" ",children:[e.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},e.createElement(C.NumericTextBox,{min:1,max:31,disabled:y!=="monthday",value:(a=n==null?void 0:n.byMonthDay)==null?void 0:a[0],onChange:X,width:"auto"}))]}]}))),v==="yearly"&&e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},o(l.recurrenceEditorYearlyRepeatOn,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(C.RadioGroup,{value:y,onChange:te,className:"k-reset",data:[{value:"monthday",label:" ",children:[e.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},e.createElement(h.DropDownList,{disabled:y!=="monthday",value:$,data:F,textField:"text",dataItemKey:"value",onChange:ee}),e.createElement(C.NumericTextBox,{min:1,max:31,disabled:y!=="monthday",value:j,onChange:X,width:"auto"}))]},{value:"weekday",label:" ",children:[e.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},e.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:y!=="weekday",data:O,value:k,onChange:ae}),e.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:y!=="weekday",value:b,data:W,onChange:Q}),e.createElement("span",{key:"of-row",className:"k-scheduler-edit-form-row"},e.createElement("span",null,o(l.recurrenceEditorYearlyOf,!0)),e.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:y!=="weekday",value:$,data:F,onChange:ee})))]}]}))),v!=="never"&&e.createElement(m.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},o(l.recurrenceEditorEndLabel,!0)),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-recurrence-fields"},e.createElement(h.DropDownList,{data:z,textField:"text",dataItemKey:"value",value:be,onChange:De}),L==="count"&&e.createElement(C.NumericTextBox,{min:1,width:"auto",value:(t=n.count)!=null?t:P,onChange:ke,format:`0 '${o(l.recurrenceEditorEndOccurrence,!0)}'`}),L==="until"&&e.createElement(We.DatePicker,{min:d,value:U!=null?U:M.toLocalDate(K),onChange:he,width:"auto"})))),v!=="never"&&(A&&R?e.createElement(m.FieldWrapper,null,e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-form-hint"},e.createElement(A,{recurrenceRule:R,text:_||"",parsedRule:we})))):_?e.createElement(m.FieldWrapper,null,e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-form-hint"},_))):null))}}),e.createElement(le.DialogActionsBar,{layout:"end"},me&&Z&&e.createElement(B.Button,{fillMode:"flat",themeColor:"primary",onClick:Z},o(l.recurrenceEditorRemoveRecurrence,!0)),e.createElement(B.Button,{onClick:ne},fe),e.createElement(B.Button,{themeColor:"primary",onClick:Re},ye)));return Ne.canUseDOM?Le.createPortal(Me,document.body):null};ue.displayName="KendoReactSchedulerRecurrenceDialog";exports.SchedulerRecurrenceDialog=ue;