@progress/kendo-vue-scheduler 10.2.0-develop.10 → 10.2.0-develop.12
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/Scheduler.d.ts +157 -56
- package/Scheduler.js +1 -1
- package/Scheduler.mjs +242 -214
- package/components/EventOverviewPopover.d.ts +62 -0
- package/components/EventOverviewPopover.js +8 -0
- package/components/EventOverviewPopover.mjs +191 -0
- package/components/MoreEventsPopover.d.ts +3 -1
- package/components/MoreEventsPopover.js +1 -1
- package/components/MoreEventsPopover.mjs +31 -27
- package/components/SchedulerActionButtons.js +1 -1
- package/components/SchedulerActionButtons.mjs +1 -0
- package/components/SchedulerForm.d.ts +412 -2
- package/components/SchedulerForm.js +1 -1
- package/components/SchedulerForm.mjs +162 -60
- package/components/SchedulerQuickCreateForm.d.ts +118 -0
- package/components/SchedulerQuickCreateForm.js +8 -0
- package/components/SchedulerQuickCreateForm.mjs +249 -0
- package/constants/main.d.ts +2 -0
- package/constants/main.js +1 -1
- package/constants/main.mjs +10 -9
- package/dist/cdn/js/kendo-vue-scheduler.js +1 -1
- package/editors/KeepResetCustomEventsDialog.d.ts +31 -0
- package/editors/KeepResetCustomEventsDialog.js +8 -0
- package/editors/KeepResetCustomEventsDialog.mjs +72 -0
- package/editors/SchedulerFormEditor.d.ts +151 -52
- package/editors/SchedulerFormEditor.js +1 -1
- package/editors/SchedulerFormEditor.mjs +192 -139
- package/editors/SchedulerRecurrenceDialog.d.ts +2 -2
- package/editors/SchedulerRecurrenceDialog.js +1 -1
- package/editors/SchedulerRecurrenceDialog.mjs +126 -131
- package/editors/ZonedSplitDateTime.d.ts +32 -3
- package/editors/ZonedSplitDateTime.js +1 -1
- package/editors/ZonedSplitDateTime.mjs +112 -47
- package/hooks/useCloseOnAnchorScrollOut.d.ts +10 -0
- package/hooks/useCloseOnAnchorScrollOut.js +8 -0
- package/hooks/useCloseOnAnchorScrollOut.mjs +43 -0
- package/hooks/useCustomEventsConfirmation.d.ts +20 -0
- package/hooks/useCustomEventsConfirmation.js +8 -0
- package/hooks/useCustomEventsConfirmation.mjs +48 -0
- package/hooks/useDeferredClick.d.ts +12 -0
- package/hooks/useDeferredClick.js +8 -0
- package/hooks/useDeferredClick.mjs +22 -0
- package/hooks/useExclusivePopover.d.ts +26 -0
- package/hooks/useExclusivePopover.js +8 -0
- package/hooks/useExclusivePopover.mjs +30 -0
- package/hooks/useRecurrenceSummary.d.ts +3 -0
- package/hooks/useRecurrenceSummary.js +1 -1
- package/hooks/useRecurrenceSummary.mjs +68 -41
- package/index.d.mts +4 -2
- package/index.d.ts +4 -2
- package/index.js +1 -1
- package/index.mjs +83 -78
- package/items/SchedulerEditItem.d.ts +116 -12
- package/items/SchedulerEditItem.js +1 -1
- package/items/SchedulerEditItem.mjs +212 -131
- package/items/SchedulerItem.d.ts +2 -1
- package/items/SchedulerItem.js +1 -1
- package/items/SchedulerItem.mjs +28 -23
- package/items/SchedulerProportionalViewItem.d.ts +1 -0
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +83 -68
- package/items/SchedulerViewItem.d.ts +1 -0
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +84 -75
- package/items/hooks/use-drag-item.js +1 -1
- package/items/hooks/use-drag-item.mjs +49 -48
- package/items/hooks/use-form-item.d.ts +1 -1
- package/items/hooks/use-remove-item.d.ts +1 -1
- package/items/hooks/use-resize-item.js +1 -1
- package/items/hooks/use-resize-item.mjs +74 -65
- package/messages/main.d.ts +42 -0
- package/messages/main.js +1 -1
- package/messages/main.mjs +303 -275
- package/models/InternalDataAction.d.ts +13 -0
- package/models/SchedulerView.d.ts +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -12
- package/recurrence/RecurrenceEditor.js +1 -1
- package/recurrence/RecurrenceEditor.mjs +42 -42
- package/recurrence/common.d.ts +10 -0
- package/recurrence/common.js +1 -1
- package/recurrence/common.mjs +39 -35
- package/services/itemsService.d.ts +5 -2
- package/services/itemsService.js +1 -1
- package/services/itemsService.mjs +46 -33
- package/services/occurrenceService.js +1 -1
- package/services/occurrenceService.mjs +18 -18
- package/slots/SchedulerEditSlot.d.ts +70 -8
- package/slots/SchedulerEditSlot.js +1 -1
- package/slots/SchedulerEditSlot.mjs +222 -141
- package/slots/SchedulerSlot.js +1 -1
- package/slots/SchedulerSlot.mjs +20 -16
- package/slots/SchedulerViewSlot.d.ts +3 -0
- package/slots/SchedulerViewSlot.js +1 -1
- package/slots/SchedulerViewSlot.mjs +21 -15
- package/tasks/SchedulerEditTask.d.ts +13 -2
- package/tasks/SchedulerEditTask.js +1 -1
- package/tasks/SchedulerEditTask.mjs +45 -30
- package/utils/main.d.ts +27 -0
- package/utils/main.js +1 -1
- package/utils/main.mjs +172 -136
- package/views/agenda/AgendaView.d.ts +6 -2
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +31 -29
- package/views/agenda/AgendaViewBody.d.ts +3 -3
- package/views/agenda/AgendaViewBody.js +1 -1
- package/views/agenda/AgendaViewBody.mjs +31 -29
- package/views/common/SchedulerDrag.d.ts +4 -2
- package/views/common/SchedulerDrag.js +1 -1
- package/views/common/SchedulerDrag.mjs +8 -7
- package/views/common/SchedulerResize.d.ts +4 -2
- package/views/common/SchedulerResize.js +1 -1
- package/views/common/SchedulerResize.mjs +14 -12
- package/views/common/VerticalResourceIterator.d.ts +3 -3
- package/views/common/VerticalResourceIterator.js +1 -1
- package/views/common/VerticalResourceIterator.mjs +34 -33
- package/views/day/DayView.d.ts +2 -0
- package/views/day/DayView.js +1 -1
- package/views/day/DayView.mjs +9 -7
- package/views/day/DayViewAllDaySlots.d.ts +7 -5
- package/views/day/DayViewAllDaySlots.js +1 -1
- package/views/day/DayViewAllDaySlots.mjs +24 -21
- package/views/day/DayViewMiddleRow.d.ts +7 -5
- package/views/day/DayViewMiddleRow.js +1 -1
- package/views/day/DayViewMiddleRow.mjs +18 -13
- package/views/day/DayViewVerticalRow.d.ts +7 -5
- package/views/day/DayViewVerticalRow.js +1 -1
- package/views/day/DayViewVerticalRow.mjs +23 -17
- package/views/day/DayViewVerticalSlotsRow.d.ts +7 -5
- package/views/day/DayViewVerticalSlotsRow.js +1 -1
- package/views/day/DayViewVerticalSlotsRow.mjs +34 -29
- package/views/day/MultiDayView.d.ts +13 -7
- package/views/day/MultiDayView.js +1 -1
- package/views/day/MultiDayView.mjs +108 -95
- package/views/month/MonthView.d.ts +15 -4
- package/views/month/MonthView.js +1 -1
- package/views/month/MonthView.mjs +105 -68
- package/views/month/MonthViewBody.d.ts +3 -3
- package/views/month/MonthViewBody.js +1 -1
- package/views/month/MonthViewBody.mjs +18 -16
- package/views/time/MultiDayTimelineView.d.ts +6 -4
- package/views/time/MultiDayTimelineView.js +1 -1
- package/views/time/MultiDayTimelineView.mjs +64 -63
- package/views/time/TimelineView.d.ts +2 -0
- package/views/time/TimelineView.js +1 -1
- package/views/time/TimelineView.mjs +5 -3
- package/views/time/TimelineViewBody.d.ts +7 -5
- package/views/time/TimelineViewBody.js +1 -1
- package/views/time/TimelineViewBody.mjs +29 -27
- package/views/week/WeekView.d.ts +2 -0
- package/views/week/WeekView.js +1 -1
- package/views/week/WeekView.mjs +11 -10
- package/views/week/WorkWeekView.d.ts +2 -0
- package/views/week/WorkWeekView.js +1 -1
- package/views/week/WorkWeekView.mjs +17 -16
|
@@ -5,23 +5,27 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { Keys as
|
|
10
|
-
import { DATA_ACTION as
|
|
11
|
-
import { findFirstItem as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
import { defineComponent as R, h as D, createVNode as y, inject as f, shallowRef as v, computed as w, watch as _, isVNode as M } from "vue";
|
|
9
|
+
import { Keys as l, templateRendering as z, getTemplate as E, getDefaultSlots as B } from "@progress/kendo-vue-common";
|
|
10
|
+
import { DATA_ACTION as x } from "../constants/main.mjs";
|
|
11
|
+
import { emitDataAction as O, findFirstItem as W, findCurrentItem as L, getSortedSlots as K, setField as c, isGroupped as P, getField as V, compareSlots as Q } from "../utils/main.mjs";
|
|
12
|
+
import { SchedulerQuickCreateForm as H } from "../components/SchedulerQuickCreateForm.mjs";
|
|
13
|
+
import { SchedulerViewSlot as U } from "./SchedulerViewSlot.mjs";
|
|
14
|
+
import { SLOTS_SELECT_ACTION as G } from "../hooks/use-slots-selection.mjs";
|
|
15
|
+
import { ITEMS_SELECT_ACTION as J } from "../hooks/use-items-selection.mjs";
|
|
16
|
+
import { useDeferredClick as X } from "../hooks/useDeferredClick.mjs";
|
|
17
|
+
import { useExclusivePopover as Y } from "../hooks/useExclusivePopover.mjs";
|
|
18
|
+
import { ITEMS_FOCUS_ACTION as Z } from "../hooks/use-items-focus.mjs";
|
|
19
|
+
import { SLOTS_FOCUS_ACTION as m } from "../hooks/use-slots-focus.mjs";
|
|
20
|
+
import { useEditable as ee } from "../hooks/useEditable.mjs";
|
|
21
|
+
import { useSlotExpand as A } from "../hooks/useSlotExpand.mjs";
|
|
22
|
+
function te(e) {
|
|
23
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
21
24
|
}
|
|
22
|
-
const
|
|
25
|
+
const fe = /* @__PURE__ */ R({
|
|
23
26
|
name: "KendoSchedulerEditSlot",
|
|
24
27
|
inheritAttrs: !1,
|
|
28
|
+
emits: ["dataaction", "showmoreitems", "focus", "click", "doubleclick", "formitemchange", "quickcreateformitemchange"],
|
|
25
29
|
props: {
|
|
26
30
|
role: String,
|
|
27
31
|
tabIndex: {
|
|
@@ -31,6 +35,8 @@ const it = /* @__PURE__ */ C({
|
|
|
31
35
|
className: String,
|
|
32
36
|
form: Object,
|
|
33
37
|
formItem: Object,
|
|
38
|
+
quickCreateForm: [String, Function, Object],
|
|
39
|
+
quickCreateFormItem: Object,
|
|
34
40
|
refTo: [Function, Object],
|
|
35
41
|
items: Array,
|
|
36
42
|
row: Number,
|
|
@@ -58,28 +64,29 @@ const it = /* @__PURE__ */ C({
|
|
|
58
64
|
navDay: Boolean,
|
|
59
65
|
editable: [Object, Boolean],
|
|
60
66
|
itemsPerSlot: Number,
|
|
61
|
-
|
|
67
|
+
onDataAction: Function
|
|
62
68
|
},
|
|
63
69
|
created() {
|
|
64
70
|
this.slot = null, this.editableSlot = null;
|
|
65
71
|
},
|
|
66
72
|
mounted() {
|
|
67
|
-
const
|
|
73
|
+
const e = this;
|
|
68
74
|
this.$nextTick(function() {
|
|
69
|
-
|
|
75
|
+
A(e, e.ks.scheduler.$el, e.$props.expandable);
|
|
70
76
|
});
|
|
71
77
|
},
|
|
72
78
|
updated() {
|
|
73
|
-
const
|
|
79
|
+
const e = this;
|
|
74
80
|
this.$nextTick(function() {
|
|
75
|
-
|
|
81
|
+
A(e, e.ks.scheduler.$el, e.$props.expandable);
|
|
76
82
|
});
|
|
77
83
|
},
|
|
78
84
|
provide() {
|
|
79
85
|
return {
|
|
80
86
|
ksEditFormSubmit: this.handleEditFormSubmit,
|
|
81
87
|
ksEditFormCancel: this.handleEditFormCancel,
|
|
82
|
-
ksEditFormClose: this.handleEditFormClose
|
|
88
|
+
ksEditFormClose: this.handleEditFormClose,
|
|
89
|
+
ksRenderQuickCreateForm: this.renderQuickCreateForm
|
|
83
90
|
};
|
|
84
91
|
},
|
|
85
92
|
inject: {
|
|
@@ -105,6 +112,28 @@ const it = /* @__PURE__ */ C({
|
|
|
105
112
|
default: {}
|
|
106
113
|
}
|
|
107
114
|
},
|
|
115
|
+
setup(e, {
|
|
116
|
+
emit: t
|
|
117
|
+
}) {
|
|
118
|
+
const i = f("ks", null), o = f("ksQuickCreate", () => !0), p = v(null), d = v(null), u = X(), S = w(() => (i == null ? void 0 : i.activeViewName.toLowerCase()) !== "agenda" && o()), a = w(() => e.quickCreateFormItem !== void 0 ? e.quickCreateFormItem : p.value), n = (r, h) => {
|
|
119
|
+
p.value = r, t("quickcreateformitemchange", {
|
|
120
|
+
value: r,
|
|
121
|
+
event: h
|
|
122
|
+
});
|
|
123
|
+
}, s = (r) => {
|
|
124
|
+
u.cancel(), a.value && n(null, r);
|
|
125
|
+
};
|
|
126
|
+
return Y(() => !!a.value, s), _([() => i == null ? void 0 : i.currentDate, () => i == null ? void 0 : i.activeViewName], () => s()), {
|
|
127
|
+
quickCreateAnchor: d,
|
|
128
|
+
quickCreateEnabled: S,
|
|
129
|
+
quickCreateFormItem: a,
|
|
130
|
+
deferredQuickCreate: u,
|
|
131
|
+
setQuickCreateFormItem: n,
|
|
132
|
+
closeQuickCreate: s,
|
|
133
|
+
quickCreateFormTemplate: f("ksQuickCreateForm", () => {
|
|
134
|
+
})
|
|
135
|
+
};
|
|
136
|
+
},
|
|
108
137
|
data() {
|
|
109
138
|
return {
|
|
110
139
|
currentFormItem: null
|
|
@@ -115,208 +144,260 @@ const it = /* @__PURE__ */ C({
|
|
|
115
144
|
return this.ksSlots.cSlots ? this.ksSlots.cSlots[this.index] : {};
|
|
116
145
|
},
|
|
117
146
|
currentTabIndex() {
|
|
118
|
-
const
|
|
119
|
-
return this.$props.tabIndex !== void 0 ? this.$props.tabIndex === null ? void 0 : this.$props.tabIndex : this.bv.selectedSlots.length === 0 &&
|
|
147
|
+
const e = this.bv.slots.length && Q(this.bv.slots[0].cSlot, this.cSlot);
|
|
148
|
+
return this.$props.tabIndex !== void 0 ? this.$props.tabIndex === null ? void 0 : this.$props.tabIndex : this.bv.selectedSlots.length === 0 && e && this.cSlot.items.length === 0 ? 0 : void 0;
|
|
120
149
|
},
|
|
121
150
|
computedEditable() {
|
|
122
|
-
return
|
|
151
|
+
return ee(this.$props.editable);
|
|
123
152
|
},
|
|
124
153
|
compFormItem() {
|
|
125
154
|
return this.formItem !== void 0 ? this.formItem : this.currentFormItem;
|
|
126
155
|
}
|
|
127
156
|
},
|
|
128
157
|
render() {
|
|
129
|
-
const
|
|
130
|
-
role:
|
|
131
|
-
viewSlot:
|
|
158
|
+
const e = B(this), {
|
|
159
|
+
role: t,
|
|
160
|
+
viewSlot: i,
|
|
132
161
|
form: o,
|
|
133
|
-
formItem:
|
|
134
|
-
items:
|
|
135
|
-
row:
|
|
136
|
-
group:
|
|
137
|
-
range:
|
|
138
|
-
isWorkDay:
|
|
139
|
-
isWorkHour:
|
|
140
|
-
col:
|
|
141
|
-
index:
|
|
142
|
-
start:
|
|
143
|
-
end:
|
|
144
|
-
zonedStart:
|
|
145
|
-
zonedEnd:
|
|
146
|
-
navDay:
|
|
147
|
-
itemsPerSlot:
|
|
148
|
-
className:
|
|
149
|
-
} = this.$props,
|
|
150
|
-
let
|
|
151
|
-
const
|
|
152
|
-
role:
|
|
153
|
-
className:
|
|
162
|
+
formItem: p,
|
|
163
|
+
items: d,
|
|
164
|
+
row: u,
|
|
165
|
+
group: S,
|
|
166
|
+
range: a,
|
|
167
|
+
isWorkDay: n,
|
|
168
|
+
isWorkHour: s,
|
|
169
|
+
col: r,
|
|
170
|
+
index: h,
|
|
171
|
+
start: T,
|
|
172
|
+
end: q,
|
|
173
|
+
zonedStart: k,
|
|
174
|
+
zonedEnd: b,
|
|
175
|
+
navDay: C,
|
|
176
|
+
itemsPerSlot: F,
|
|
177
|
+
className: $
|
|
178
|
+
} = this.$props, I = this.bv.selectedSlots.some((N) => Q(N.cSlot, this.cSlot));
|
|
179
|
+
let g;
|
|
180
|
+
const j = y(U, {
|
|
181
|
+
role: t,
|
|
182
|
+
className: $,
|
|
154
183
|
slotRender: this.$props.slotRender,
|
|
155
184
|
isAllDay: this.isAllDay,
|
|
156
185
|
expandable: this.expandable,
|
|
157
186
|
editable: this.editable,
|
|
158
|
-
items:
|
|
159
|
-
row:
|
|
160
|
-
group:
|
|
161
|
-
range:
|
|
162
|
-
isWorkDay:
|
|
163
|
-
isWorkHour:
|
|
164
|
-
col:
|
|
165
|
-
index:
|
|
166
|
-
start:
|
|
167
|
-
end:
|
|
168
|
-
zonedStart:
|
|
169
|
-
zonedEnd:
|
|
170
|
-
selected:
|
|
171
|
-
navDay:
|
|
172
|
-
itemsPerSlot:
|
|
187
|
+
items: d,
|
|
188
|
+
row: u,
|
|
189
|
+
group: S,
|
|
190
|
+
range: a,
|
|
191
|
+
isWorkDay: n,
|
|
192
|
+
isWorkHour: s,
|
|
193
|
+
col: r,
|
|
194
|
+
index: h,
|
|
195
|
+
start: T,
|
|
196
|
+
end: q,
|
|
197
|
+
zonedStart: k,
|
|
198
|
+
zonedEnd: b,
|
|
199
|
+
selected: I,
|
|
200
|
+
navDay: C,
|
|
201
|
+
itemsPerSlot: F,
|
|
173
202
|
tabIndex: this.currentTabIndex,
|
|
174
203
|
formItem: this.compFormItem,
|
|
175
204
|
onFocus: this.handleFocus,
|
|
205
|
+
onClick: this.handleClick,
|
|
176
206
|
onDoubleclick: this.handleDoubleClick,
|
|
177
207
|
onKeydown: this.handleKeyDown,
|
|
178
208
|
onShowmoreitems: this.handleShowMoreItemsClick
|
|
179
|
-
},
|
|
180
|
-
default: () => [
|
|
209
|
+
}, te(e) ? e : {
|
|
210
|
+
default: () => [e]
|
|
181
211
|
});
|
|
182
|
-
return
|
|
183
|
-
h:
|
|
212
|
+
return g = E.call(this, {
|
|
213
|
+
h: D,
|
|
184
214
|
template: this.$props.viewSlot,
|
|
185
|
-
defaultRendering:
|
|
186
|
-
defaultSlots:
|
|
215
|
+
defaultRendering: j,
|
|
216
|
+
defaultSlots: e,
|
|
187
217
|
additionalProps: {
|
|
188
218
|
...this.cSlot,
|
|
189
219
|
isAllDay: this.cSlot.isAllDay,
|
|
190
220
|
expandable: this.expandable,
|
|
191
221
|
editable: this.editable,
|
|
192
|
-
items:
|
|
222
|
+
items: d,
|
|
193
223
|
row: this.cSlot.row,
|
|
194
224
|
group: this.cSlot.group,
|
|
195
225
|
range: this.cSlot.range,
|
|
196
|
-
isWorkDay:
|
|
197
|
-
isWorkHour:
|
|
226
|
+
isWorkDay: n,
|
|
227
|
+
isWorkHour: s,
|
|
198
228
|
col: this.cSlot.col,
|
|
199
|
-
index:
|
|
229
|
+
index: h,
|
|
200
230
|
start: this.cSlot.start,
|
|
201
231
|
end: this.cSlot.end,
|
|
202
|
-
zonedStart:
|
|
203
|
-
zonedEnd:
|
|
204
|
-
selected:
|
|
205
|
-
navDay:
|
|
206
|
-
itemsPerSlot:
|
|
232
|
+
zonedStart: k,
|
|
233
|
+
zonedEnd: b,
|
|
234
|
+
selected: I,
|
|
235
|
+
navDay: C,
|
|
236
|
+
itemsPerSlot: F,
|
|
207
237
|
tabIndex: this.currentTabIndex
|
|
208
238
|
},
|
|
209
239
|
additionalListeners: {
|
|
210
240
|
focus: this.handleFocus,
|
|
241
|
+
click: this.handleClick,
|
|
211
242
|
doubleclick: this.handleDoubleClick,
|
|
212
243
|
keydown: this.handleKeyDown,
|
|
213
244
|
showmoreitems: this.handleShowMoreItemsClick
|
|
214
245
|
}
|
|
215
|
-
}),
|
|
246
|
+
}), g;
|
|
216
247
|
},
|
|
217
248
|
methods: {
|
|
218
|
-
|
|
219
|
-
this
|
|
249
|
+
renderQuickCreateForm() {
|
|
250
|
+
if (!this.quickCreateFormItem)
|
|
251
|
+
return null;
|
|
252
|
+
const e = this.$props.quickCreateForm ? z.call(this, this.$props.quickCreateForm, {}) : this.quickCreateFormTemplate();
|
|
253
|
+
return E.call(this, {
|
|
254
|
+
h: D,
|
|
255
|
+
template: e,
|
|
256
|
+
defaultRendering: y(H, {
|
|
257
|
+
show: !0,
|
|
258
|
+
anchor: this.quickCreateAnchor,
|
|
259
|
+
dataItem: this.quickCreateFormItem,
|
|
260
|
+
onSubmit: this.handleQuickCreateSubmit,
|
|
261
|
+
onMoreoptions: this.handleQuickCreateMoreOptions,
|
|
262
|
+
onCancel: this.handleQuickCreateCancel
|
|
263
|
+
}, null),
|
|
264
|
+
additionalListeners: {
|
|
265
|
+
submit: this.handleQuickCreateSubmit,
|
|
266
|
+
moreoptions: this.handleQuickCreateMoreOptions,
|
|
267
|
+
cancel: this.handleQuickCreateCancel
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
},
|
|
271
|
+
restoreSlotFocus() {
|
|
272
|
+
var e;
|
|
273
|
+
(e = this.quickCreateAnchor) == null || e.focus({
|
|
274
|
+
preventScroll: !0
|
|
275
|
+
});
|
|
276
|
+
},
|
|
277
|
+
handleQuickCreateSubmit(e) {
|
|
278
|
+
O(this, {
|
|
279
|
+
type: x.create,
|
|
280
|
+
series: !1,
|
|
281
|
+
dataItem: e.value
|
|
282
|
+
}, e.event), this.setQuickCreateFormItem(null, e.event), this.restoreSlotFocus();
|
|
283
|
+
},
|
|
284
|
+
handleQuickCreateMoreOptions(e) {
|
|
285
|
+
this.setFormItem(e.value, e.event), this.setQuickCreateFormItem(null, e.event);
|
|
286
|
+
},
|
|
287
|
+
handleQuickCreateCancel(e) {
|
|
288
|
+
this.setQuickCreateFormItem(null, e.event), this.restoreSlotFocus();
|
|
289
|
+
},
|
|
290
|
+
handleShowMoreItemsClick(e) {
|
|
291
|
+
this.$emit("showmoreitems", e);
|
|
220
292
|
},
|
|
221
293
|
createDataItemFromSlot() {
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
for (let
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
227
|
-
const o =
|
|
228
|
-
|
|
294
|
+
const e = {};
|
|
295
|
+
if (c(e, this.ks.fields.start, new Date(this.cSlot.start.getTime())), c(e, this.ks.fields.end, new Date(this.cSlot.end.getTime())), c(e, this.ks.fields.isAllDay, this.cSlot.isAllDay), this.cSlot.group.resources.length)
|
|
296
|
+
for (let t = 0; t < this.cSlot.group.resources.length; t++) {
|
|
297
|
+
const i = this.cSlot.group.resources[t];
|
|
298
|
+
if (P(this.cSlot.group.resources)) {
|
|
299
|
+
const o = V(this.cSlot.group.resources[t], i.valueField);
|
|
300
|
+
c(e, i.field, i.multiple ? [o] : o);
|
|
229
301
|
} else
|
|
230
|
-
|
|
302
|
+
c(e, i.field, i.multiple ? [] : void 0);
|
|
231
303
|
}
|
|
232
|
-
return
|
|
304
|
+
return e;
|
|
233
305
|
},
|
|
234
|
-
handleFocus(
|
|
306
|
+
handleFocus(e) {
|
|
235
307
|
this.computedEditable.select && this.dispatchSelectedSlots({
|
|
236
|
-
type:
|
|
308
|
+
type: G.select,
|
|
237
309
|
slot: this
|
|
238
|
-
},
|
|
310
|
+
}, e.event), this.$emit("focus", e);
|
|
311
|
+
},
|
|
312
|
+
handleClick(e) {
|
|
313
|
+
if (this.computedEditable.add && this.quickCreateEnabled) {
|
|
314
|
+
const t = e.target.element;
|
|
315
|
+
this.deferredQuickCreate.schedule(() => {
|
|
316
|
+
this.quickCreateAnchor = t, this.setQuickCreateFormItem(this.createDataItemFromSlot(), e.event);
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
this.$emit("click", e);
|
|
239
320
|
},
|
|
240
|
-
handleDoubleClick(
|
|
241
|
-
if (this.computedEditable.add) {
|
|
242
|
-
const
|
|
243
|
-
this.setFormItem(
|
|
321
|
+
handleDoubleClick(e) {
|
|
322
|
+
if (this.closeQuickCreate(e.event), this.computedEditable.add) {
|
|
323
|
+
const t = this.createDataItemFromSlot();
|
|
324
|
+
this.setFormItem(t, e);
|
|
244
325
|
}
|
|
245
|
-
this.$emit("doubleclick",
|
|
326
|
+
this.$emit("doubleclick", e);
|
|
246
327
|
},
|
|
247
|
-
handleKeyDown(
|
|
248
|
-
let
|
|
249
|
-
switch (
|
|
250
|
-
case
|
|
328
|
+
handleKeyDown(e) {
|
|
329
|
+
let t, i, o;
|
|
330
|
+
switch (e.event.keyCode) {
|
|
331
|
+
case l.left:
|
|
251
332
|
if (!this.bv.slots)
|
|
252
333
|
return;
|
|
253
|
-
|
|
254
|
-
type:
|
|
334
|
+
e.event.preventDefault(), this.dispatchFocusedSlots({
|
|
335
|
+
type: m.left,
|
|
255
336
|
slot: this
|
|
256
|
-
},
|
|
337
|
+
}, e.event);
|
|
257
338
|
break;
|
|
258
|
-
case
|
|
339
|
+
case l.right:
|
|
259
340
|
if (!this.bv.slots)
|
|
260
341
|
return;
|
|
261
|
-
|
|
262
|
-
type:
|
|
342
|
+
e.event.preventDefault(), this.dispatchFocusedSlots({
|
|
343
|
+
type: m.right,
|
|
263
344
|
slot: this
|
|
264
|
-
},
|
|
345
|
+
}, e.event);
|
|
265
346
|
break;
|
|
266
|
-
case
|
|
347
|
+
case l.up:
|
|
267
348
|
if (!this.bv.slots)
|
|
268
349
|
return;
|
|
269
|
-
|
|
270
|
-
type:
|
|
350
|
+
e.event.preventDefault(), this.dispatchFocusedSlots({
|
|
351
|
+
type: m.up,
|
|
271
352
|
slot: this
|
|
272
|
-
},
|
|
353
|
+
}, e.event);
|
|
273
354
|
break;
|
|
274
|
-
case
|
|
355
|
+
case l.down:
|
|
275
356
|
if (!this.bv.slots)
|
|
276
357
|
return;
|
|
277
|
-
|
|
278
|
-
type:
|
|
358
|
+
e.event.preventDefault(), this.dispatchFocusedSlots({
|
|
359
|
+
type: m.down,
|
|
279
360
|
slot: this
|
|
280
|
-
},
|
|
361
|
+
}, e.event);
|
|
281
362
|
break;
|
|
282
|
-
case
|
|
363
|
+
case l.enter:
|
|
283
364
|
if (!this.bv.slots || !this.computedEditable.add)
|
|
284
365
|
return;
|
|
285
|
-
o = this.createDataItemFromSlot(), this.setFormItem(o);
|
|
366
|
+
e.event.preventDefault(), o = this.createDataItemFromSlot(), this.quickCreateEnabled ? (this.quickCreateAnchor = e.target.element, this.setQuickCreateFormItem(o, e.event)) : this.setFormItem(o);
|
|
286
367
|
break;
|
|
287
|
-
case
|
|
288
|
-
|
|
289
|
-
type:
|
|
290
|
-
item:
|
|
291
|
-
},
|
|
292
|
-
type:
|
|
293
|
-
item:
|
|
294
|
-
},
|
|
368
|
+
case l.tab:
|
|
369
|
+
i = W(e.target), t = i ? L(i, this.bv.items, !1) : K(this.bv.items, this.ignoreIsAllDay)[0], this.dispatchFocusedItems({
|
|
370
|
+
type: Z.current,
|
|
371
|
+
item: t
|
|
372
|
+
}, e.event), this.dispatchSelectedItems({
|
|
373
|
+
type: J.select,
|
|
374
|
+
item: t
|
|
375
|
+
}, e);
|
|
295
376
|
break;
|
|
296
377
|
}
|
|
297
|
-
|
|
378
|
+
t && e.event.preventDefault();
|
|
298
379
|
},
|
|
299
|
-
handleEditFormSubmit(
|
|
300
|
-
this
|
|
301
|
-
type:
|
|
380
|
+
handleEditFormSubmit(e) {
|
|
381
|
+
O(this, {
|
|
382
|
+
type: x.create,
|
|
302
383
|
series: !1,
|
|
303
|
-
dataItem:
|
|
304
|
-
},
|
|
384
|
+
dataItem: e.value
|
|
385
|
+
}, e), this.setFormItem(null, e.event);
|
|
305
386
|
},
|
|
306
|
-
handleEditFormCancel(
|
|
307
|
-
this.setFormItem(null,
|
|
387
|
+
handleEditFormCancel(e) {
|
|
388
|
+
this.setFormItem(null, e.event);
|
|
308
389
|
},
|
|
309
|
-
handleEditFormClose(
|
|
310
|
-
this.setFormItem(null,
|
|
390
|
+
handleEditFormClose(e) {
|
|
391
|
+
this.setFormItem(null, e);
|
|
311
392
|
},
|
|
312
|
-
handleFormItemChange(
|
|
313
|
-
this.setFormItem && this.setFormItem(
|
|
393
|
+
handleFormItemChange(e, t) {
|
|
394
|
+
this.setFormItem && this.setFormItem(e, t);
|
|
314
395
|
},
|
|
315
|
-
setFormItem(
|
|
316
|
-
this.currentFormItem =
|
|
396
|
+
setFormItem(e, t) {
|
|
397
|
+
this.currentFormItem = e, this.$emit("formitemchange", t);
|
|
317
398
|
}
|
|
318
399
|
}
|
|
319
400
|
});
|
|
320
401
|
export {
|
|
321
|
-
|
|
402
|
+
fe as SchedulerEditSlot
|
|
322
403
|
};
|
package/slots/SchedulerSlot.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 s=require("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),i=require("@progress/kendo-vue-common"),l=require("../utils/main.js"),n=require("@progress/kendo-vue-intl"),r=require("../components/ShowMoreItemsButton.js"),a=require("../components/SchedulerForm.js"),h={skeleton:"dd"},u=s.defineComponent({name:"KendoSchedulerSlot",inheritAttrs:!1,emits:{focus:null,blur:null,click:null,showmoreitems:null,mouseover:null,mouseout:null,mouseenter:null,mouseleave:null,doubleclick:null,keydown:null,keypress:null,keyup:null,cancel:null,close:null,formsubmit:null},props:{refTo:[Function,Object],role:String,items:Array,row:Number,group:Object,range:Object,className:String,isWorkDay:{type:Boolean,default:!0},isWorkHour:{type:Boolean,default:!0},selected:Boolean,tabIndex:{type:Number,default:void 0},col:Number,index:Number,start:Date,end:Date,zonedStart:Object,zonedEnd:Object,isAllDay:Boolean,navDay:Boolean,editable:[Object,Boolean],itemsPerSlot:Number,formItem:Object,slotStyle:Object,viewSlot:Object},computed:{cSlot(){const e=this.ksSlots.cSlots;return e?e[this.index]?e[this.index]:e.length?e[0]:{}:{}},currentTabIndex(){return this.$props.tabIndex!==void 0?this.$props.tabIndex===null?void 0:this.$props.tabIndex:this.$props.selected?0:-1},slotClass(){return{"k-scheduler-cell k-slot-cell":!0,"k-nonwork-hour":!this.$props.isWorkHour||!this.$props.isWorkDay,"k-selected":this.$props.selected,[this.$props.className]:this.$props.className}},slotLabel(){return`${l.formatEventTime(this.intl,this.$props.zonedStart,this.$props.zonedEnd,this.$props.isAllDay||!1)}`}},inject:{ks:{default:null},kendoIntlService:{default:null},setSlots:{default:null},slotClick:{default:null},slotDoubleClick:{default:null},ksEditFormSubmit:{default:null},ksEditFormCancel:{default:null},ksEditFormClose:{default:null},ksRenderQuickCreateForm:{default:null},ksSlots:{default:{}}},data(){return{hasMounted:!1}},mounted(){this.hasMounted=!0,this.setSlots({type:l.COLLECTION_ACTION.add,item:this})},unmounted(){this.setSlots({type:l.COLLECTION_ACTION.remove,item:this})},render(){var o;this.intl=n.provideIntlService(this);const e=i.getDefaultSlots(this),t=Object.assign({userSelect:"none"},this.$props.slotStyle,this.$attrs.style);return s.createVNode("div",{id:this.$props.id,style:t,class:this.slotClass,tabindex:this.currentTabIndex,role:this.$props.role,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onMouseover:this.handleMouseOver,onMouseout:this.handleMouseOut,onDblclick:this.handleDoubleClick,onKeydown:this.handleKeyDown,onKeypress:this.handleKeyPress,onKeyup:this.handleKeyUp,"data-slot":!0,"data-slot-allday":this.cSlot.isAllDay,"data-slot-start":this.cSlot.start.getTime(),"data-slot-end":this.cSlot.end.getTime(),"data-slot-group":this.cSlot.group.index,"data-slot-range":this.cSlot.range.index,"data-slot-index":this.cSlot.index},[this.navDay&&s.createVNode("span",{class:"k-link k-nav-day"},[this.intl.formatDate(new Date(this.cSlot.end.getTime()-(this.cSlot.end.getTime()-this.cSlot.start.getTime())/2),h)]),this.itemsPerSlot<this.cSlot.items.length&&s.createVNode(r.ShowMoreItemsButton,{currentSlot:this.cSlot,hiddenCount:this.cSlot.items.length-this.itemsPerSlot,onClick:this.handleShowMoreItemsClick},null),e,(o=this.ksRenderQuickCreateForm)==null?void 0:o.call(this),this.formItem&&s.createVNode(a.SchedulerForm,{dataItem:this.formItem,onSubmit:this.handleFormSubmit,onClose:this.handleFormClose,onCancel:this.handleFormCancel},null)])},methods:{handleShowMoreItemsClick(e){this.$emit("showmoreitems",e)},handleFocus(e){this.$emit("focus",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleBlur(e){this.$emit("blur",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleClick(e){const t={event:e,target:{props:{...this.cSlot},element:this.$el}};this.$emit("click",t),this.slotClick(t)},handleMouseOver(e){this.$emit("mouseover",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleMouseOut(e){this.$emit("mouseout",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleMouseEnter(e){this.$emit("mouseenter",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleMouseLeave(e){this.$emit("mouseleave",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleDoubleClick(e){if(e.target.closest(".k-more-events"))return;const t={event:e,target:{props:{...this.cSlot},element:this.$el}};this.$emit("doubleclick",t),this.slotDoubleClick(t)},handleKeyDown(e){this.$emit("keydown",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleKeyPress(e){this.$emit("keypress",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleKeyUp(e){this.$emit("keyup",{event:e,target:{props:{...this.cSlot},element:this.$el}})},handleFormClose(e){this.ksEditFormClose(e),this.$emit("close",e)},handleFormSubmit(e){this.ksEditFormSubmit(e),this.$emit("formsubmit",e)},handleFormCancel(e){this.ksEditFormCancel(e),this.$emit("cancel",e)}}});exports.SchedulerSlot=u;
|
package/slots/SchedulerSlot.mjs
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { getDefaultSlots as
|
|
10
|
-
import { COLLECTION_ACTION as
|
|
11
|
-
import { provideIntlService as
|
|
12
|
-
import { ShowMoreItemsButton as
|
|
13
|
-
import { SchedulerForm as
|
|
14
|
-
const
|
|
8
|
+
import { defineComponent as i, createVNode as s } from "vue";
|
|
9
|
+
import { getDefaultSlots as n } from "@progress/kendo-vue-common";
|
|
10
|
+
import { COLLECTION_ACTION as o, formatEventTime as r } from "../utils/main.mjs";
|
|
11
|
+
import { provideIntlService as a } from "@progress/kendo-vue-intl";
|
|
12
|
+
import { ShowMoreItemsButton as h } from "../components/ShowMoreItemsButton.mjs";
|
|
13
|
+
import { SchedulerForm as u } from "../components/SchedulerForm.mjs";
|
|
14
|
+
const d = {
|
|
15
15
|
skeleton: "dd"
|
|
16
|
-
},
|
|
16
|
+
}, b = /* @__PURE__ */ i({
|
|
17
17
|
name: "KendoSchedulerSlot",
|
|
18
18
|
inheritAttrs: !1,
|
|
19
19
|
emits: {
|
|
@@ -85,7 +85,7 @@ const u = {
|
|
|
85
85
|
};
|
|
86
86
|
},
|
|
87
87
|
slotLabel() {
|
|
88
|
-
return `${
|
|
88
|
+
return `${r(this.intl, this.$props.zonedStart, this.$props.zonedEnd, this.$props.isAllDay || !1)}`;
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
inject: {
|
|
@@ -113,6 +113,9 @@ const u = {
|
|
|
113
113
|
ksEditFormClose: {
|
|
114
114
|
default: null
|
|
115
115
|
},
|
|
116
|
+
ksRenderQuickCreateForm: {
|
|
117
|
+
default: null
|
|
118
|
+
},
|
|
116
119
|
ksSlots: {
|
|
117
120
|
default: {}
|
|
118
121
|
}
|
|
@@ -124,19 +127,20 @@ const u = {
|
|
|
124
127
|
},
|
|
125
128
|
mounted() {
|
|
126
129
|
this.hasMounted = !0, this.setSlots({
|
|
127
|
-
type:
|
|
130
|
+
type: o.add,
|
|
128
131
|
item: this
|
|
129
132
|
});
|
|
130
133
|
},
|
|
131
134
|
unmounted() {
|
|
132
135
|
this.setSlots({
|
|
133
|
-
type:
|
|
136
|
+
type: o.remove,
|
|
134
137
|
item: this
|
|
135
138
|
});
|
|
136
139
|
},
|
|
137
140
|
render() {
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
var l;
|
|
142
|
+
this.intl = a(this);
|
|
143
|
+
const e = n(this), t = Object.assign({
|
|
140
144
|
userSelect: "none"
|
|
141
145
|
}, this.$props.slotStyle, this.$attrs.style);
|
|
142
146
|
return s("div", {
|
|
@@ -165,11 +169,11 @@ const u = {
|
|
|
165
169
|
"data-slot-index": this.cSlot.index
|
|
166
170
|
}, [this.navDay && s("span", {
|
|
167
171
|
class: "k-link k-nav-day"
|
|
168
|
-
}, [this.intl.formatDate(new Date(this.cSlot.end.getTime() - (this.cSlot.end.getTime() - this.cSlot.start.getTime()) / 2),
|
|
172
|
+
}, [this.intl.formatDate(new Date(this.cSlot.end.getTime() - (this.cSlot.end.getTime() - this.cSlot.start.getTime()) / 2), d)]), this.itemsPerSlot < this.cSlot.items.length && s(h, {
|
|
169
173
|
currentSlot: this.cSlot,
|
|
170
174
|
hiddenCount: this.cSlot.items.length - this.itemsPerSlot,
|
|
171
175
|
onClick: this.handleShowMoreItemsClick
|
|
172
|
-
}, null), e, this.formItem && s(
|
|
176
|
+
}, null), e, (l = this.ksRenderQuickCreateForm) == null ? void 0 : l.call(this), this.formItem && s(u, {
|
|
173
177
|
dataItem: this.formItem,
|
|
174
178
|
onSubmit: this.handleFormSubmit,
|
|
175
179
|
onClose: this.handleFormClose,
|
|
@@ -317,5 +321,5 @@ const u = {
|
|
|
317
321
|
}
|
|
318
322
|
});
|
|
319
323
|
export {
|
|
320
|
-
|
|
324
|
+
b as SchedulerSlot
|
|
321
325
|
};
|
|
@@ -82,12 +82,14 @@ declare const SchedulerViewSlot: import('vue').DefineComponent<import('vue').Ext
|
|
|
82
82
|
}, {
|
|
83
83
|
getLayoutSignature(): string;
|
|
84
84
|
handleShowMoreItemsClick(event: any): void;
|
|
85
|
+
handleClick(event: Parameters<NonNullable<SchedulerViewSlotProps['onClick']>>[0]): void;
|
|
85
86
|
handleDoubleClick(args: any): void;
|
|
86
87
|
handleKeyDown(args: any): void;
|
|
87
88
|
handleFocus(args: any): void;
|
|
88
89
|
handleResize(): void;
|
|
89
90
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
90
91
|
focus: any;
|
|
92
|
+
click: any;
|
|
91
93
|
showmoreitems: any;
|
|
92
94
|
doubleclick: any;
|
|
93
95
|
keydown: any;
|
|
@@ -127,6 +129,7 @@ declare const SchedulerViewSlot: import('vue').DefineComponent<import('vue').Ext
|
|
|
127
129
|
};
|
|
128
130
|
slotStyle: PropType<any>;
|
|
129
131
|
}>> & Readonly<{
|
|
132
|
+
onClick?: (...args: any) => any;
|
|
130
133
|
onFocus?: (...args: any) => any;
|
|
131
134
|
onKeydown?: (...args: any) => any;
|
|
132
135
|
onDoubleclick?: (...args: any) => any;
|