@progress/kendo-react-scheduler 16.4.0-develop.1 → 16.4.0-develop.2
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/components/EventOverviewPopover.js +1 -1
- package/components/EventOverviewPopover.mjs +73 -69
- package/components/MoreEventsPopover.js +1 -1
- package/components/MoreEventsPopover.mjs +31 -30
- package/components/SchedulerForm.js +1 -1
- package/components/SchedulerForm.mjs +136 -104
- package/components/SchedulerQuickCreateForm.js +1 -1
- package/components/SchedulerQuickCreateForm.mjs +63 -59
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/editors/DiscardChangesDialog.d.ts +17 -0
- package/editors/DiscardChangesDialog.js +8 -0
- package/editors/DiscardChangesDialog.mjs +34 -0
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/index.js +1 -1
- package/index.mjs +90 -88
- package/messages/index.d.ts +12 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +92 -84
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
|
@@ -6,149 +6,181 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import * as
|
|
10
|
-
import { canUseDOM as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { Form as
|
|
13
|
-
import { Dialog as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
import { SchedulerFormEditor as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
9
|
+
import * as ae from "react-dom";
|
|
10
|
+
import { canUseDOM as oe } from "@progress/kendo-react-common";
|
|
11
|
+
import { Button as h } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { Form as ne } from "@progress/kendo-react-form";
|
|
13
|
+
import { Dialog as ie, DialogActionsBar as le } from "@progress/kendo-react-dialogs";
|
|
14
|
+
import { useLocalization as re } from "@progress/kendo-react-intl";
|
|
15
|
+
import { SchedulerFormEditor as se } from "../editors/SchedulerFormEditor.mjs";
|
|
16
|
+
import { DiscardChangesDialog as ce } from "../editors/DiscardChangesDialog.mjs";
|
|
17
|
+
import { trashIcon as de } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { editorValidationRequired as F, messages as i, editorValidationEnd as w, editorSave as B, editorCancel as T, editorDelete as V, editorValidationStart as q, editorNewEvent as A, editorEditEvent as x } from "../messages/index.mjs";
|
|
19
|
+
import { useSchedulerFieldsContext as ue } from "../context/SchedulerContext.mjs";
|
|
20
|
+
const me = e.forwardRef((l, H) => {
|
|
20
21
|
const {
|
|
21
|
-
onCancel:
|
|
22
|
-
onClose:
|
|
23
|
-
onSubmit:
|
|
22
|
+
onCancel: g,
|
|
23
|
+
onClose: f,
|
|
24
|
+
onSubmit: C,
|
|
24
25
|
onDelete: s,
|
|
25
|
-
editor:
|
|
26
|
-
dialog:
|
|
27
|
-
validator:
|
|
28
|
-
...
|
|
29
|
-
} =
|
|
30
|
-
e.useImperativeHandle(
|
|
31
|
-
const
|
|
32
|
-
() =>
|
|
33
|
-
[
|
|
34
|
-
),
|
|
35
|
-
() =>
|
|
36
|
-
[
|
|
37
|
-
),
|
|
38
|
-
() =>
|
|
39
|
-
[
|
|
40
|
-
),
|
|
41
|
-
() =>
|
|
42
|
-
[
|
|
43
|
-
),
|
|
44
|
-
() =>
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
() =>
|
|
48
|
-
[
|
|
49
|
-
),
|
|
50
|
-
() =>
|
|
51
|
-
[
|
|
52
|
-
),
|
|
53
|
-
() =>
|
|
54
|
-
[
|
|
55
|
-
),
|
|
26
|
+
editor: N,
|
|
27
|
+
dialog: O = z.dialog,
|
|
28
|
+
validator: D = z.validator,
|
|
29
|
+
...K
|
|
30
|
+
} = l, r = e.useRef(null);
|
|
31
|
+
e.useImperativeHandle(r, () => ({ props: l })), e.useImperativeHandle(H, () => r.current);
|
|
32
|
+
const o = re(), n = ue(), k = !!(l.dataItem && l.dataItem[n.id]), I = e.useMemo(
|
|
33
|
+
() => o.toLanguageString(F, i[F]),
|
|
34
|
+
[o]
|
|
35
|
+
), L = e.useMemo(
|
|
36
|
+
() => o.toLanguageString(w, i[w]),
|
|
37
|
+
[o]
|
|
38
|
+
), P = e.useMemo(
|
|
39
|
+
() => o.toLanguageString(B, i[B]),
|
|
40
|
+
[o]
|
|
41
|
+
), U = e.useMemo(
|
|
42
|
+
() => o.toLanguageString(T, i[T]),
|
|
43
|
+
[o]
|
|
44
|
+
), j = e.useMemo(
|
|
45
|
+
() => o.toLanguageString(V, i[V]),
|
|
46
|
+
[o]
|
|
47
|
+
), R = e.useMemo(
|
|
48
|
+
() => o.toLanguageString(q, i[q]),
|
|
49
|
+
[o]
|
|
50
|
+
), J = e.useMemo(
|
|
51
|
+
() => o.toLanguageString(A, i[A]),
|
|
52
|
+
[o]
|
|
53
|
+
), Q = e.useMemo(
|
|
54
|
+
() => o.toLanguageString(x, i[x]),
|
|
55
|
+
[o]
|
|
56
|
+
), W = k ? Q : J, S = e.useRef(!1), [c, d] = e.useState(null), u = e.useCallback(
|
|
56
57
|
(t) => {
|
|
57
|
-
|
|
58
|
+
g && g({
|
|
58
59
|
value: null,
|
|
59
60
|
syntheticEvent: t,
|
|
60
|
-
target:
|
|
61
|
+
target: r.current
|
|
61
62
|
});
|
|
62
63
|
},
|
|
63
|
-
[
|
|
64
|
-
),
|
|
65
|
-
(
|
|
66
|
-
|
|
64
|
+
[g]
|
|
65
|
+
), m = e.useCallback(
|
|
66
|
+
(t) => {
|
|
67
|
+
f && f({
|
|
67
68
|
value: null,
|
|
68
69
|
syntheticEvent: t,
|
|
69
|
-
target:
|
|
70
|
+
target: r.current
|
|
70
71
|
});
|
|
71
72
|
},
|
|
72
|
-
[
|
|
73
|
-
),
|
|
74
|
-
(t
|
|
75
|
-
|
|
73
|
+
[f]
|
|
74
|
+
), X = e.useCallback(
|
|
75
|
+
(t) => {
|
|
76
|
+
if (S.current) {
|
|
77
|
+
d({ type: "cancel", syntheticEvent: t });
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
u(t);
|
|
81
|
+
},
|
|
82
|
+
[u]
|
|
83
|
+
), Y = e.useCallback(
|
|
84
|
+
({ syntheticEvent: t }) => {
|
|
85
|
+
if (S.current) {
|
|
86
|
+
d({ type: "close", syntheticEvent: t });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
m(t);
|
|
90
|
+
},
|
|
91
|
+
[m]
|
|
92
|
+
), Z = e.useCallback(() => {
|
|
93
|
+
if (c) {
|
|
94
|
+
const { type: t, syntheticEvent: a } = c;
|
|
95
|
+
d(null), t === "cancel" ? u(a) : m(a);
|
|
96
|
+
}
|
|
97
|
+
}, [c, u, m]), _ = e.useCallback(() => {
|
|
98
|
+
d(null);
|
|
99
|
+
}, []), $ = e.useCallback(
|
|
100
|
+
(t, a) => {
|
|
101
|
+
C && C({
|
|
76
102
|
value: t,
|
|
77
|
-
syntheticEvent:
|
|
78
|
-
target:
|
|
103
|
+
syntheticEvent: a,
|
|
104
|
+
target: r.current
|
|
79
105
|
});
|
|
80
106
|
},
|
|
81
|
-
[
|
|
82
|
-
),
|
|
107
|
+
[C]
|
|
108
|
+
), G = e.useCallback(
|
|
83
109
|
(t) => {
|
|
84
110
|
s && s({
|
|
85
|
-
value:
|
|
111
|
+
value: l.dataItem,
|
|
86
112
|
syntheticEvent: t,
|
|
87
|
-
target:
|
|
113
|
+
target: r.current
|
|
88
114
|
});
|
|
89
115
|
},
|
|
90
|
-
[s,
|
|
91
|
-
),
|
|
92
|
-
(t,
|
|
93
|
-
[
|
|
94
|
-
),
|
|
95
|
-
(t,
|
|
96
|
-
[
|
|
97
|
-
),
|
|
98
|
-
(t) => t ? void 0 :
|
|
99
|
-
[
|
|
100
|
-
),
|
|
101
|
-
(t,
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
].filter(Boolean).reduce((
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
].filter(Boolean).reduce((
|
|
110
|
-
const
|
|
111
|
-
return { ...
|
|
116
|
+
[s, l.dataItem]
|
|
117
|
+
), p = e.useCallback(
|
|
118
|
+
(t, a) => t && a(n.end) && t.getTime() > a(n.end).getTime() ? R : void 0,
|
|
119
|
+
[n, R]
|
|
120
|
+
), y = e.useCallback(
|
|
121
|
+
(t, a) => t && a(n.start) && t.getTime() < a(n.start).getTime() ? L : void 0,
|
|
122
|
+
[n, L]
|
|
123
|
+
), M = e.useCallback(
|
|
124
|
+
(t) => t ? void 0 : I,
|
|
125
|
+
[I]
|
|
126
|
+
), ee = e.useCallback(
|
|
127
|
+
(t, a) => {
|
|
128
|
+
const b = {};
|
|
129
|
+
b[n.start] = [
|
|
130
|
+
M(a(n.start)),
|
|
131
|
+
p(a(n.start), a)
|
|
132
|
+
].filter(Boolean).reduce((E, v) => E || v, ""), b[n.end] = [
|
|
133
|
+
M(a(n.start)),
|
|
134
|
+
y(a(n.start), a)
|
|
135
|
+
].filter(Boolean).reduce((E, v) => E || v, "");
|
|
136
|
+
const te = D(t, a);
|
|
137
|
+
return { ...b, ...te };
|
|
112
138
|
},
|
|
113
|
-
[
|
|
139
|
+
[y, n.end, n.start, M, p, D]
|
|
114
140
|
);
|
|
115
|
-
return
|
|
141
|
+
return oe ? ae.createPortal(
|
|
116
142
|
/* @__PURE__ */ e.createElement(
|
|
117
|
-
|
|
143
|
+
ne,
|
|
118
144
|
{
|
|
119
145
|
ignoreModified: !0,
|
|
120
|
-
initialValues:
|
|
121
|
-
onSubmit:
|
|
122
|
-
validator:
|
|
123
|
-
render: (t) => /* @__PURE__ */ e.createElement(
|
|
124
|
-
|
|
146
|
+
initialValues: l.dataItem,
|
|
147
|
+
onSubmit: $,
|
|
148
|
+
validator: ee,
|
|
149
|
+
render: (t) => (S.current = t.modified, /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(O, { title: W, width: 650, onClose: Y }, /* @__PURE__ */ e.createElement(se, { ...t, as: N }), /* @__PURE__ */ e.createElement(le, { layout: "end" }, k && s && /* @__PURE__ */ e.createElement(
|
|
150
|
+
h,
|
|
125
151
|
{
|
|
126
152
|
fillMode: "flat",
|
|
127
153
|
themeColor: "primary",
|
|
128
|
-
svgIcon:
|
|
129
|
-
onClick:
|
|
154
|
+
svgIcon: de,
|
|
155
|
+
onClick: G
|
|
130
156
|
},
|
|
131
|
-
|
|
132
|
-
), /* @__PURE__ */ e.createElement(
|
|
133
|
-
|
|
157
|
+
j
|
|
158
|
+
), /* @__PURE__ */ e.createElement(h, { onClick: X }, U), /* @__PURE__ */ e.createElement(
|
|
159
|
+
h,
|
|
134
160
|
{
|
|
135
161
|
themeColor: "primary",
|
|
136
162
|
disabled: !t.allowSubmit,
|
|
137
163
|
onClick: t.onSubmit
|
|
138
164
|
},
|
|
139
|
-
|
|
165
|
+
P
|
|
166
|
+
))), c && /* @__PURE__ */ e.createElement(
|
|
167
|
+
ce,
|
|
168
|
+
{
|
|
169
|
+
onDiscard: Z,
|
|
170
|
+
onCancel: _
|
|
171
|
+
}
|
|
140
172
|
))),
|
|
141
|
-
...
|
|
173
|
+
...K
|
|
142
174
|
}
|
|
143
175
|
),
|
|
144
176
|
document && document.body
|
|
145
177
|
) : null;
|
|
146
|
-
}),
|
|
147
|
-
dialog:
|
|
178
|
+
}), z = {
|
|
179
|
+
dialog: ie,
|
|
148
180
|
validator: () => ({})
|
|
149
181
|
};
|
|
150
|
-
|
|
182
|
+
me.displayName = "KendoReactSchedulerForm";
|
|
151
183
|
export {
|
|
152
|
-
|
|
153
|
-
|
|
184
|
+
me as SchedulerForm,
|
|
185
|
+
z as schedulerFormDefaultProps
|
|
154
186
|
};
|
|
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("react"),L=require("@progress/kendo-react-tooltip"),w=require("@progress/kendo-react-common"),b=require("@progress/kendo-react-buttons"),ee=require("@progress/kendo-react-inputs"),d=require("@progress/kendo-react-form"),P=require("@progress/kendo-react-labels"),x=require("@progress/kendo-react-intl"),R=require("@progress/kendo-date-math"),z=require("@progress/kendo-svg-icons"),E=require("../utils/index.js"),te=require("../hooks/useQuickCreatePlacement.js"),oe=require("../hooks/useCloseOnAnchorScrollOut.js"),t=require("../messages/index.js"),I=require("../context/SchedulerContext.js");function ne(i){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const c in i)if(c!=="default"){const r=Object.getOwnPropertyDescriptor(i,c);Object.defineProperty(a,c,r.get?r:{enumerable:!0,get:()=>i[c]})}}return a.default=i,Object.freeze(a)}const e=ne(Y),N={skeleton:"MMMMd"},A="t",ae=360,Q=6,re=i=>{const{value:a,onChange:c,onKeyDown:r,valid:h,placeholder:p,ariaLabel:m}=i;return e.createElement(ee.TextBox,{"aria-label":m,placeholder:p,autoComplete:"off",value:a!=null?a:"",onChange:c,onKeyDown:r,valid:h})},B=i=>{const{show:a,anchor:c,dataItem:r,validator:h,onSubmit:p,onMoreOptions:m,onCancel:n}=i,g=x.useInternationalization(),u=x.useLocalization(),s=I.useSchedulerFieldsContext(),{timezone:S}=I.useSchedulerPropsContext(),k=te.useQuickCreatePlacement(),y=e.useRef(null),_=e.useCallback(()=>{n==null||n({value:null,syntheticEvent:void 0})},[n]);oe.useCloseOnAnchorScrollOut(a,c,_),e.useEffect(()=>{if(!a)return;const o=l=>{var M,T;const f=l.target,F=(T=(M=y.current)==null?void 0:M.element)==null?void 0:T.closest(".k-popover");(F?F.contains(f):!1)||n==null||n({value:null,syntheticEvent:void 0})};return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[a,c,n]);const v=E.getField(r,s.start),C=E.getField(r,s.end),$=!!E.getField(r,s.isAllDay),j=u.toLanguageString(t.allDay,t.messages[t.allDay]);let D="";if(v&&C){const o=R.ZonedDate.fromLocalDate(v,S),l=R.ZonedDate.fromLocalDate(C,S);D=$?`${g.formatDate(o,N)}, ${j}`:`${g.formatDate(o,N)}, ${g.formatDate(o,A)} - ${g.formatDate(l,A)}`}const O=u.toLanguageString(t.editorNewEvent,t.messages[t.editorNewEvent]),K=u.toLanguageString(t.editorEventTitle,t.messages[t.editorEventTitle]),V=u.toLanguageString(t.quickCreateSave,t.messages[t.quickCreateSave]),W=u.toLanguageString(t.quickCreateMoreOptions,t.messages[t.quickCreateMoreOptions]),G=u.toLanguageString(t.quickCreateCancel,t.messages[t.quickCreateCancel]),Z=e.useCallback((o,l)=>{p({value:o,syntheticEvent:l})},[p]),H=e.useCallback(o=>l=>{if(!m)return;const f={...r};E.setField(f,s.title,o.valueGetter(s.title)),m({value:f,syntheticEvent:l})},[m,r,s.title]),J=e.useCallback(o=>{n&&n({value:null,syntheticEvent:o})},[n]),U=e.useCallback(()=>{n==null||n({value:null,syntheticEvent:void 0})},[n]),q=k.position==="top"||k.position==="bottom",X={vertical:q?Q:0,horizontal:q?0:Q};return e.createElement(d.Form,{key:v?v.getTime():void 0,initialValues:r,validator:h,ignoreModified:!0,onSubmit:Z,render:o=>e.createElement(L.Popover,{anchor:c,show:a,position:k.position,collision:k.collision,callout:!1,title:O,style:{width:ae},onKeyDown:U,animate:{openDuration:1,closeDuration:1},margin:X},e.createElement(d.FormElement,{ref:y,horizontal:!0,className:"k-scheduler-edit-form"},e.createElement(d.FieldWrapper,null,e.createElement(P.Label,{className:"k-form-label"},e.createElement(w.SvgIcon,{icon:z.rightDoubleQuotesIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(d.Field,{name:s.title,component:re,ariaLabel:K,placeholder:O,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o.onSubmit(l))}}))),e.createElement(d.FieldWrapper,null,e.createElement(P.Label,{className:"k-form-label"},e.createElement(w.SvgIcon,{icon:z.clockIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-edit-form-row k-color-subtle"},D)))),e.createElement(L.PopoverActionsBar,null,e.createElement(b.Button,{type:"button",fillMode:"flat",themeColor:"primary",onClick:H(o)},W),e.createElement("span",{className:"k-spacer"}),e.createElement(b.Button,{type:"button",onClick:J},G),e.createElement(b.Button,{type:"button",themeColor:"primary",disabled:!o.allowSubmit,onClick:o.onSubmit},V)))})};B.displayName="KendoReactSchedulerQuickCreateForm";const le={};exports.SchedulerQuickCreateForm=B;exports.schedulerQuickCreateFormDefaultProps=le;
|
|
@@ -6,24 +6,24 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { Popover as
|
|
9
|
+
import { Popover as ee, PopoverActionsBar as te } from "@progress/kendo-react-tooltip";
|
|
10
10
|
import { SvgIcon as F } from "@progress/kendo-react-common";
|
|
11
|
-
import { Button as
|
|
12
|
-
import { TextBox as
|
|
13
|
-
import { Form as
|
|
11
|
+
import { Button as g } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { TextBox as oe } from "@progress/kendo-react-inputs";
|
|
13
|
+
import { Form as ne, FormElement as ae, FieldWrapper as O, Field as le } from "@progress/kendo-react-form";
|
|
14
14
|
import { Label as x } from "@progress/kendo-react-labels";
|
|
15
|
-
import { useInternationalization as
|
|
16
|
-
import { ZonedDate as
|
|
17
|
-
import { rightDoubleQuotesIcon as
|
|
18
|
-
import { getField as
|
|
19
|
-
import { useQuickCreatePlacement as
|
|
20
|
-
import { useCloseOnAnchorScrollOut as
|
|
21
|
-
import { allDay as z, messages as c, editorNewEvent as
|
|
22
|
-
import { useSchedulerFieldsContext as
|
|
23
|
-
const
|
|
24
|
-
const { value: a, onChange: s, onKeyDown: l, valid:
|
|
15
|
+
import { useInternationalization as re, useLocalization as ie } from "@progress/kendo-react-intl";
|
|
16
|
+
import { ZonedDate as P } from "@progress/kendo-date-math";
|
|
17
|
+
import { rightDoubleQuotesIcon as ce, clockIcon as se } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { getField as k, setField as me } from "../utils/index.mjs";
|
|
19
|
+
import { useQuickCreatePlacement as ue } from "../hooks/useQuickCreatePlacement.mjs";
|
|
20
|
+
import { useCloseOnAnchorScrollOut as de } from "../hooks/useCloseOnAnchorScrollOut.mjs";
|
|
21
|
+
import { allDay as z, messages as c, editorNewEvent as A, editorEventTitle as N, quickCreateSave as I, quickCreateMoreOptions as Q, quickCreateCancel as K } from "../messages/index.mjs";
|
|
22
|
+
import { useSchedulerFieldsContext as pe, useSchedulerPropsContext as fe } from "../context/SchedulerContext.mjs";
|
|
23
|
+
const R = { skeleton: "MMMMd" }, $ = "t", Ee = 360, B = 6, ve = (v) => {
|
|
24
|
+
const { value: a, onChange: s, onKeyDown: l, valid: h, placeholder: u, ariaLabel: m } = v;
|
|
25
25
|
return /* @__PURE__ */ e.createElement(
|
|
26
|
-
|
|
26
|
+
oe,
|
|
27
27
|
{
|
|
28
28
|
"aria-label": m,
|
|
29
29
|
placeholder: u,
|
|
@@ -31,114 +31,118 @@ const K = { skeleton: "MMMMd" }, $ = "t", de = 360, pe = (E) => {
|
|
|
31
31
|
value: a != null ? a : "",
|
|
32
32
|
onChange: s,
|
|
33
33
|
onKeyDown: l,
|
|
34
|
-
valid:
|
|
34
|
+
valid: h
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
|
-
},
|
|
38
|
-
const { show: a, anchor: s, dataItem: l, validator:
|
|
37
|
+
}, he = (v) => {
|
|
38
|
+
const { show: a, anchor: s, dataItem: l, validator: h, onSubmit: u, onMoreOptions: m, onCancel: o } = v, d = re(), i = ie(), r = pe(), { timezone: b } = fe(), p = ue(), y = e.useRef(null), V = e.useCallback(() => {
|
|
39
39
|
o == null || o({ value: null, syntheticEvent: void 0 });
|
|
40
40
|
}, [o]);
|
|
41
|
-
|
|
41
|
+
de(a, s, V), e.useEffect(() => {
|
|
42
42
|
if (!a)
|
|
43
43
|
return;
|
|
44
44
|
const t = (n) => {
|
|
45
|
-
var
|
|
46
|
-
const
|
|
47
|
-
(
|
|
45
|
+
var M, T;
|
|
46
|
+
const E = n.target, w = (T = (M = y.current) == null ? void 0 : M.element) == null ? void 0 : T.closest(".k-popover");
|
|
47
|
+
(w ? w.contains(E) : !1) || o == null || o({ value: null, syntheticEvent: void 0 });
|
|
48
48
|
};
|
|
49
49
|
return document.addEventListener("mousedown", t), () => {
|
|
50
50
|
document.removeEventListener("mousedown", t);
|
|
51
51
|
};
|
|
52
52
|
}, [a, s, o]);
|
|
53
|
-
const
|
|
53
|
+
const f = k(l, r.start), D = k(l, r.end), _ = !!k(l, r.isAllDay), q = i.toLanguageString(z, c[z]);
|
|
54
54
|
let S = "";
|
|
55
|
-
if (
|
|
56
|
-
const t =
|
|
57
|
-
S =
|
|
55
|
+
if (f && D) {
|
|
56
|
+
const t = P.fromLocalDate(f, b), n = P.fromLocalDate(D, b);
|
|
57
|
+
S = _ ? `${d.formatDate(t, R)}, ${q}` : `${d.formatDate(t, R)}, ${d.formatDate(
|
|
58
58
|
t,
|
|
59
59
|
$
|
|
60
60
|
)} - ${d.formatDate(n, $)}`;
|
|
61
61
|
}
|
|
62
|
-
const C = i.toLanguageString(
|
|
62
|
+
const C = i.toLanguageString(A, c[A]), G = i.toLanguageString(N, c[N]), W = i.toLanguageString(I, c[I]), H = i.toLanguageString(Q, c[Q]), Z = i.toLanguageString(K, c[K]), j = e.useCallback(
|
|
63
63
|
(t, n) => {
|
|
64
64
|
u({ value: t, syntheticEvent: n });
|
|
65
65
|
},
|
|
66
66
|
[u]
|
|
67
|
-
),
|
|
67
|
+
), J = e.useCallback(
|
|
68
68
|
(t) => (n) => {
|
|
69
69
|
if (!m)
|
|
70
70
|
return;
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const E = { ...l };
|
|
72
|
+
me(E, r.title, t.valueGetter(r.title)), m({ value: E, syntheticEvent: n });
|
|
73
73
|
},
|
|
74
74
|
[m, l, r.title]
|
|
75
|
-
),
|
|
75
|
+
), U = e.useCallback(
|
|
76
76
|
(t) => {
|
|
77
77
|
o && o({ value: null, syntheticEvent: t });
|
|
78
78
|
},
|
|
79
79
|
[o]
|
|
80
|
-
),
|
|
80
|
+
), X = e.useCallback(() => {
|
|
81
81
|
o == null || o({ value: null, syntheticEvent: void 0 });
|
|
82
|
-
}, [o])
|
|
82
|
+
}, [o]), L = p.position === "top" || p.position === "bottom", Y = {
|
|
83
|
+
vertical: L ? B : 0,
|
|
84
|
+
horizontal: L ? 0 : B
|
|
85
|
+
};
|
|
83
86
|
return /* @__PURE__ */ e.createElement(
|
|
84
|
-
|
|
87
|
+
ne,
|
|
85
88
|
{
|
|
86
|
-
key:
|
|
89
|
+
key: f ? f.getTime() : void 0,
|
|
87
90
|
initialValues: l,
|
|
88
|
-
validator:
|
|
91
|
+
validator: h,
|
|
89
92
|
ignoreModified: !0,
|
|
90
|
-
onSubmit:
|
|
93
|
+
onSubmit: j,
|
|
91
94
|
render: (t) => /* @__PURE__ */ e.createElement(
|
|
92
|
-
|
|
95
|
+
ee,
|
|
93
96
|
{
|
|
94
97
|
anchor: s,
|
|
95
98
|
show: a,
|
|
96
|
-
position:
|
|
97
|
-
collision:
|
|
99
|
+
position: p.position,
|
|
100
|
+
collision: p.collision,
|
|
98
101
|
callout: !1,
|
|
99
102
|
title: C,
|
|
100
|
-
style: { width:
|
|
101
|
-
onKeyDown:
|
|
102
|
-
animate: { openDuration: 1, closeDuration: 1 }
|
|
103
|
+
style: { width: Ee },
|
|
104
|
+
onKeyDown: X,
|
|
105
|
+
animate: { openDuration: 1, closeDuration: 1 },
|
|
106
|
+
margin: Y
|
|
103
107
|
},
|
|
104
|
-
/* @__PURE__ */ e.createElement(
|
|
105
|
-
|
|
108
|
+
/* @__PURE__ */ e.createElement(ae, { ref: y, horizontal: !0, className: "k-scheduler-edit-form" }, /* @__PURE__ */ e.createElement(O, null, /* @__PURE__ */ e.createElement(x, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(F, { icon: ce, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
109
|
+
le,
|
|
106
110
|
{
|
|
107
111
|
name: r.title,
|
|
108
|
-
component:
|
|
109
|
-
ariaLabel:
|
|
112
|
+
component: ve,
|
|
113
|
+
ariaLabel: G,
|
|
110
114
|
placeholder: C,
|
|
111
115
|
onKeyDown: (n) => {
|
|
112
116
|
n.key === "Enter" && (n.preventDefault(), t.onSubmit(n));
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
|
-
))), /* @__PURE__ */ e.createElement(
|
|
116
|
-
/* @__PURE__ */ e.createElement(
|
|
117
|
-
|
|
119
|
+
))), /* @__PURE__ */ e.createElement(O, null, /* @__PURE__ */ e.createElement(x, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(F, { icon: se, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-edit-form-row k-color-subtle" }, S)))),
|
|
120
|
+
/* @__PURE__ */ e.createElement(te, null, /* @__PURE__ */ e.createElement(
|
|
121
|
+
g,
|
|
118
122
|
{
|
|
119
123
|
type: "button",
|
|
120
124
|
fillMode: "flat",
|
|
121
125
|
themeColor: "primary",
|
|
122
|
-
onClick:
|
|
126
|
+
onClick: J(t)
|
|
123
127
|
},
|
|
124
|
-
|
|
125
|
-
), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ e.createElement(
|
|
126
|
-
|
|
128
|
+
H
|
|
129
|
+
), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ e.createElement(g, { type: "button", onClick: U }, Z), /* @__PURE__ */ e.createElement(
|
|
130
|
+
g,
|
|
127
131
|
{
|
|
128
132
|
type: "button",
|
|
129
133
|
themeColor: "primary",
|
|
130
134
|
disabled: !t.allowSubmit,
|
|
131
135
|
onClick: t.onSubmit
|
|
132
136
|
},
|
|
133
|
-
|
|
137
|
+
W
|
|
134
138
|
))
|
|
135
139
|
)
|
|
136
140
|
}
|
|
137
141
|
);
|
|
138
142
|
};
|
|
139
|
-
|
|
140
|
-
const
|
|
143
|
+
he.displayName = "KendoReactSchedulerQuickCreateForm";
|
|
144
|
+
const ze = {};
|
|
141
145
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
he as SchedulerQuickCreateForm,
|
|
147
|
+
ze as schedulerQuickCreateFormDefaultProps
|
|
144
148
|
};
|