@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.
Files changed (156) hide show
  1. package/Scheduler.d.ts +157 -56
  2. package/Scheduler.js +1 -1
  3. package/Scheduler.mjs +242 -214
  4. package/components/EventOverviewPopover.d.ts +62 -0
  5. package/components/EventOverviewPopover.js +8 -0
  6. package/components/EventOverviewPopover.mjs +191 -0
  7. package/components/MoreEventsPopover.d.ts +3 -1
  8. package/components/MoreEventsPopover.js +1 -1
  9. package/components/MoreEventsPopover.mjs +31 -27
  10. package/components/SchedulerActionButtons.js +1 -1
  11. package/components/SchedulerActionButtons.mjs +1 -0
  12. package/components/SchedulerForm.d.ts +412 -2
  13. package/components/SchedulerForm.js +1 -1
  14. package/components/SchedulerForm.mjs +162 -60
  15. package/components/SchedulerQuickCreateForm.d.ts +118 -0
  16. package/components/SchedulerQuickCreateForm.js +8 -0
  17. package/components/SchedulerQuickCreateForm.mjs +249 -0
  18. package/constants/main.d.ts +2 -0
  19. package/constants/main.js +1 -1
  20. package/constants/main.mjs +10 -9
  21. package/dist/cdn/js/kendo-vue-scheduler.js +1 -1
  22. package/editors/KeepResetCustomEventsDialog.d.ts +31 -0
  23. package/editors/KeepResetCustomEventsDialog.js +8 -0
  24. package/editors/KeepResetCustomEventsDialog.mjs +72 -0
  25. package/editors/SchedulerFormEditor.d.ts +151 -52
  26. package/editors/SchedulerFormEditor.js +1 -1
  27. package/editors/SchedulerFormEditor.mjs +192 -139
  28. package/editors/SchedulerRecurrenceDialog.d.ts +2 -2
  29. package/editors/SchedulerRecurrenceDialog.js +1 -1
  30. package/editors/SchedulerRecurrenceDialog.mjs +126 -131
  31. package/editors/ZonedSplitDateTime.d.ts +32 -3
  32. package/editors/ZonedSplitDateTime.js +1 -1
  33. package/editors/ZonedSplitDateTime.mjs +112 -47
  34. package/hooks/useCloseOnAnchorScrollOut.d.ts +10 -0
  35. package/hooks/useCloseOnAnchorScrollOut.js +8 -0
  36. package/hooks/useCloseOnAnchorScrollOut.mjs +43 -0
  37. package/hooks/useCustomEventsConfirmation.d.ts +20 -0
  38. package/hooks/useCustomEventsConfirmation.js +8 -0
  39. package/hooks/useCustomEventsConfirmation.mjs +48 -0
  40. package/hooks/useDeferredClick.d.ts +12 -0
  41. package/hooks/useDeferredClick.js +8 -0
  42. package/hooks/useDeferredClick.mjs +22 -0
  43. package/hooks/useExclusivePopover.d.ts +26 -0
  44. package/hooks/useExclusivePopover.js +8 -0
  45. package/hooks/useExclusivePopover.mjs +30 -0
  46. package/hooks/useRecurrenceSummary.d.ts +3 -0
  47. package/hooks/useRecurrenceSummary.js +1 -1
  48. package/hooks/useRecurrenceSummary.mjs +68 -41
  49. package/index.d.mts +4 -2
  50. package/index.d.ts +4 -2
  51. package/index.js +1 -1
  52. package/index.mjs +83 -78
  53. package/items/SchedulerEditItem.d.ts +116 -12
  54. package/items/SchedulerEditItem.js +1 -1
  55. package/items/SchedulerEditItem.mjs +212 -131
  56. package/items/SchedulerItem.d.ts +2 -1
  57. package/items/SchedulerItem.js +1 -1
  58. package/items/SchedulerItem.mjs +28 -23
  59. package/items/SchedulerProportionalViewItem.d.ts +1 -0
  60. package/items/SchedulerProportionalViewItem.js +1 -1
  61. package/items/SchedulerProportionalViewItem.mjs +83 -68
  62. package/items/SchedulerViewItem.d.ts +1 -0
  63. package/items/SchedulerViewItem.js +1 -1
  64. package/items/SchedulerViewItem.mjs +84 -75
  65. package/items/hooks/use-drag-item.js +1 -1
  66. package/items/hooks/use-drag-item.mjs +49 -48
  67. package/items/hooks/use-form-item.d.ts +1 -1
  68. package/items/hooks/use-remove-item.d.ts +1 -1
  69. package/items/hooks/use-resize-item.js +1 -1
  70. package/items/hooks/use-resize-item.mjs +74 -65
  71. package/messages/main.d.ts +42 -0
  72. package/messages/main.js +1 -1
  73. package/messages/main.mjs +303 -275
  74. package/models/InternalDataAction.d.ts +13 -0
  75. package/models/SchedulerView.d.ts +1 -1
  76. package/package-metadata.js +1 -1
  77. package/package-metadata.mjs +2 -2
  78. package/package.json +13 -12
  79. package/recurrence/RecurrenceEditor.js +1 -1
  80. package/recurrence/RecurrenceEditor.mjs +42 -42
  81. package/recurrence/common.d.ts +10 -0
  82. package/recurrence/common.js +1 -1
  83. package/recurrence/common.mjs +39 -35
  84. package/services/itemsService.d.ts +5 -2
  85. package/services/itemsService.js +1 -1
  86. package/services/itemsService.mjs +46 -33
  87. package/services/occurrenceService.js +1 -1
  88. package/services/occurrenceService.mjs +18 -18
  89. package/slots/SchedulerEditSlot.d.ts +70 -8
  90. package/slots/SchedulerEditSlot.js +1 -1
  91. package/slots/SchedulerEditSlot.mjs +222 -141
  92. package/slots/SchedulerSlot.js +1 -1
  93. package/slots/SchedulerSlot.mjs +20 -16
  94. package/slots/SchedulerViewSlot.d.ts +3 -0
  95. package/slots/SchedulerViewSlot.js +1 -1
  96. package/slots/SchedulerViewSlot.mjs +21 -15
  97. package/tasks/SchedulerEditTask.d.ts +13 -2
  98. package/tasks/SchedulerEditTask.js +1 -1
  99. package/tasks/SchedulerEditTask.mjs +45 -30
  100. package/utils/main.d.ts +27 -0
  101. package/utils/main.js +1 -1
  102. package/utils/main.mjs +172 -136
  103. package/views/agenda/AgendaView.d.ts +6 -2
  104. package/views/agenda/AgendaView.js +1 -1
  105. package/views/agenda/AgendaView.mjs +31 -29
  106. package/views/agenda/AgendaViewBody.d.ts +3 -3
  107. package/views/agenda/AgendaViewBody.js +1 -1
  108. package/views/agenda/AgendaViewBody.mjs +31 -29
  109. package/views/common/SchedulerDrag.d.ts +4 -2
  110. package/views/common/SchedulerDrag.js +1 -1
  111. package/views/common/SchedulerDrag.mjs +8 -7
  112. package/views/common/SchedulerResize.d.ts +4 -2
  113. package/views/common/SchedulerResize.js +1 -1
  114. package/views/common/SchedulerResize.mjs +14 -12
  115. package/views/common/VerticalResourceIterator.d.ts +3 -3
  116. package/views/common/VerticalResourceIterator.js +1 -1
  117. package/views/common/VerticalResourceIterator.mjs +34 -33
  118. package/views/day/DayView.d.ts +2 -0
  119. package/views/day/DayView.js +1 -1
  120. package/views/day/DayView.mjs +9 -7
  121. package/views/day/DayViewAllDaySlots.d.ts +7 -5
  122. package/views/day/DayViewAllDaySlots.js +1 -1
  123. package/views/day/DayViewAllDaySlots.mjs +24 -21
  124. package/views/day/DayViewMiddleRow.d.ts +7 -5
  125. package/views/day/DayViewMiddleRow.js +1 -1
  126. package/views/day/DayViewMiddleRow.mjs +18 -13
  127. package/views/day/DayViewVerticalRow.d.ts +7 -5
  128. package/views/day/DayViewVerticalRow.js +1 -1
  129. package/views/day/DayViewVerticalRow.mjs +23 -17
  130. package/views/day/DayViewVerticalSlotsRow.d.ts +7 -5
  131. package/views/day/DayViewVerticalSlotsRow.js +1 -1
  132. package/views/day/DayViewVerticalSlotsRow.mjs +34 -29
  133. package/views/day/MultiDayView.d.ts +13 -7
  134. package/views/day/MultiDayView.js +1 -1
  135. package/views/day/MultiDayView.mjs +108 -95
  136. package/views/month/MonthView.d.ts +15 -4
  137. package/views/month/MonthView.js +1 -1
  138. package/views/month/MonthView.mjs +105 -68
  139. package/views/month/MonthViewBody.d.ts +3 -3
  140. package/views/month/MonthViewBody.js +1 -1
  141. package/views/month/MonthViewBody.mjs +18 -16
  142. package/views/time/MultiDayTimelineView.d.ts +6 -4
  143. package/views/time/MultiDayTimelineView.js +1 -1
  144. package/views/time/MultiDayTimelineView.mjs +64 -63
  145. package/views/time/TimelineView.d.ts +2 -0
  146. package/views/time/TimelineView.js +1 -1
  147. package/views/time/TimelineView.mjs +5 -3
  148. package/views/time/TimelineViewBody.d.ts +7 -5
  149. package/views/time/TimelineViewBody.js +1 -1
  150. package/views/time/TimelineViewBody.mjs +29 -27
  151. package/views/week/WeekView.d.ts +2 -0
  152. package/views/week/WeekView.js +1 -1
  153. package/views/week/WeekView.mjs +11 -10
  154. package/views/week/WorkWeekView.d.ts +2 -0
  155. package/views/week/WorkWeekView.js +1 -1
  156. 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 C, createVNode as O, h as T, isVNode as $ } from "vue";
9
- import { Keys as i, getDefaultSlots as A, getTemplate as j } from "@progress/kendo-vue-common";
10
- import { DATA_ACTION as N } from "../constants/main.mjs";
11
- import { findFirstItem as _, findCurrentItem as z, getSortedSlots as W, setField as l, isGroupped as B, getField as R, compareSlots as b } from "../utils/main.mjs";
12
- import { SchedulerViewSlot as K } from "./SchedulerViewSlot.mjs";
13
- import { SLOTS_SELECT_ACTION as L } from "../hooks/use-slots-selection.mjs";
14
- import { ITEMS_SELECT_ACTION as M } from "../hooks/use-items-selection.mjs";
15
- import { ITEMS_FOCUS_ACTION as P } from "../hooks/use-items-focus.mjs";
16
- import { SLOTS_FOCUS_ACTION as r } from "../hooks/use-slots-focus.mjs";
17
- import { useEditable as H } from "../hooks/useEditable.mjs";
18
- import { useSlotExpand as I } from "../hooks/useSlotExpand.mjs";
19
- function V(t) {
20
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !$(t);
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 it = /* @__PURE__ */ C({
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
- onDataaction: Function
67
+ onDataAction: Function
62
68
  },
63
69
  created() {
64
70
  this.slot = null, this.editableSlot = null;
65
71
  },
66
72
  mounted() {
67
- const t = this;
73
+ const e = this;
68
74
  this.$nextTick(function() {
69
- I(t, t.ks.scheduler.$el, t.$props.expandable);
75
+ A(e, e.ks.scheduler.$el, e.$props.expandable);
70
76
  });
71
77
  },
72
78
  updated() {
73
- const t = this;
79
+ const e = this;
74
80
  this.$nextTick(function() {
75
- I(t, t.ks.scheduler.$el, t.$props.expandable);
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 t = this.bv.slots.length && b(this.bv.slots[0].cSlot, this.cSlot);
119
- return this.$props.tabIndex !== void 0 ? this.$props.tabIndex === null ? void 0 : this.$props.tabIndex : this.bv.selectedSlots.length === 0 && t && this.cSlot.items.length === 0 ? 0 : void 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 H(this.$props.editable);
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 t = A(this), {
130
- role: e,
131
- viewSlot: s,
158
+ const e = B(this), {
159
+ role: t,
160
+ viewSlot: i,
132
161
  form: o,
133
- formItem: U,
134
- items: n,
135
- row: F,
136
- group: g,
137
- range: k,
138
- isWorkDay: a,
139
- isWorkHour: d,
140
- col: D,
141
- index: c,
142
- start: y,
143
- end: x,
144
- zonedStart: h,
145
- zonedEnd: m,
146
- navDay: u,
147
- itemsPerSlot: p,
148
- className: E
149
- } = this.$props, S = this.bv.selectedSlots.some((w) => b(w.cSlot, this.cSlot));
150
- let f;
151
- const v = O(K, {
152
- role: e,
153
- className: E,
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: n,
159
- row: F,
160
- group: g,
161
- range: k,
162
- isWorkDay: a,
163
- isWorkHour: d,
164
- col: D,
165
- index: c,
166
- start: y,
167
- end: x,
168
- zonedStart: h,
169
- zonedEnd: m,
170
- selected: S,
171
- navDay: u,
172
- itemsPerSlot: p,
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
- }, V(t) ? t : {
180
- default: () => [t]
209
+ }, te(e) ? e : {
210
+ default: () => [e]
181
211
  });
182
- return f = j.call(this, {
183
- h: T,
212
+ return g = E.call(this, {
213
+ h: D,
184
214
  template: this.$props.viewSlot,
185
- defaultRendering: v,
186
- defaultSlots: t,
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: n,
222
+ items: d,
193
223
  row: this.cSlot.row,
194
224
  group: this.cSlot.group,
195
225
  range: this.cSlot.range,
196
- isWorkDay: a,
197
- isWorkHour: d,
226
+ isWorkDay: n,
227
+ isWorkHour: s,
198
228
  col: this.cSlot.col,
199
- index: c,
229
+ index: h,
200
230
  start: this.cSlot.start,
201
231
  end: this.cSlot.end,
202
- zonedStart: h,
203
- zonedEnd: m,
204
- selected: S,
205
- navDay: u,
206
- itemsPerSlot: p,
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
- }), f;
246
+ }), g;
216
247
  },
217
248
  methods: {
218
- handleShowMoreItemsClick(t) {
219
- this.$emit("showmoreitems", t);
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 t = {};
223
- if (l(t, this.ks.fields.start, new Date(this.cSlot.start.getTime())), l(t, this.ks.fields.end, new Date(this.cSlot.end.getTime())), l(t, this.ks.fields.isAllDay, this.cSlot.isAllDay), this.cSlot.group.resources.length)
224
- for (let e = 0; e < this.cSlot.group.resources.length; e++) {
225
- const s = this.cSlot.group.resources[e];
226
- if (B(this.cSlot.group.resources)) {
227
- const o = R(this.cSlot.group.resources[e], s.valueField);
228
- l(t, s.field, s.multiple ? [o] : o);
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
- l(t, s.field, s.multiple ? [] : void 0);
302
+ c(e, i.field, i.multiple ? [] : void 0);
231
303
  }
232
- return t;
304
+ return e;
233
305
  },
234
- handleFocus(t) {
306
+ handleFocus(e) {
235
307
  this.computedEditable.select && this.dispatchSelectedSlots({
236
- type: L.select,
308
+ type: G.select,
237
309
  slot: this
238
- }, t.event), this.$emit("focus", t);
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(t) {
241
- if (this.computedEditable.add) {
242
- const e = this.createDataItemFromSlot();
243
- this.setFormItem(e, t);
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", t);
326
+ this.$emit("doubleclick", e);
246
327
  },
247
- handleKeyDown(t) {
248
- let e, s, o;
249
- switch (t.event.keyCode) {
250
- case i.left:
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
- t.event.preventDefault(), this.dispatchFocusedSlots({
254
- type: r.left,
334
+ e.event.preventDefault(), this.dispatchFocusedSlots({
335
+ type: m.left,
255
336
  slot: this
256
- }, t.event);
337
+ }, e.event);
257
338
  break;
258
- case i.right:
339
+ case l.right:
259
340
  if (!this.bv.slots)
260
341
  return;
261
- t.event.preventDefault(), this.dispatchFocusedSlots({
262
- type: r.right,
342
+ e.event.preventDefault(), this.dispatchFocusedSlots({
343
+ type: m.right,
263
344
  slot: this
264
- }, t.event);
345
+ }, e.event);
265
346
  break;
266
- case i.up:
347
+ case l.up:
267
348
  if (!this.bv.slots)
268
349
  return;
269
- t.event.preventDefault(), this.dispatchFocusedSlots({
270
- type: r.up,
350
+ e.event.preventDefault(), this.dispatchFocusedSlots({
351
+ type: m.up,
271
352
  slot: this
272
- }, t.event);
353
+ }, e.event);
273
354
  break;
274
- case i.down:
355
+ case l.down:
275
356
  if (!this.bv.slots)
276
357
  return;
277
- t.event.preventDefault(), this.dispatchFocusedSlots({
278
- type: r.down,
358
+ e.event.preventDefault(), this.dispatchFocusedSlots({
359
+ type: m.down,
279
360
  slot: this
280
- }, t.event);
361
+ }, e.event);
281
362
  break;
282
- case i.enter:
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 i.tab:
288
- s = _(t.target), e = s ? z(s, this.bv.items, !1) : W(this.bv.items, this.ignoreIsAllDay)[0], this.dispatchFocusedItems({
289
- type: P.current,
290
- item: e
291
- }, t.event), this.dispatchSelectedItems({
292
- type: M.select,
293
- item: e
294
- }, t);
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
- e && t.event.preventDefault();
378
+ t && e.event.preventDefault();
298
379
  },
299
- handleEditFormSubmit(t) {
300
- this.$emit("dataaction", {
301
- type: N.create,
380
+ handleEditFormSubmit(e) {
381
+ O(this, {
382
+ type: x.create,
302
383
  series: !1,
303
- dataItem: t.value
304
- }, t), this.setFormItem(null, t.event);
384
+ dataItem: e.value
385
+ }, e), this.setFormItem(null, e.event);
305
386
  },
306
- handleEditFormCancel(t) {
307
- this.setFormItem(null, t.event);
387
+ handleEditFormCancel(e) {
388
+ this.setFormItem(null, e.event);
308
389
  },
309
- handleEditFormClose(t) {
310
- this.setFormItem(null, t);
390
+ handleEditFormClose(e) {
391
+ this.setFormItem(null, e);
311
392
  },
312
- handleFormItemChange(t, e) {
313
- this.setFormItem && this.setFormItem(t, e);
393
+ handleFormItemChange(e, t) {
394
+ this.setFormItem && this.setFormItem(e, t);
314
395
  },
315
- setFormItem(t, e) {
316
- this.currentFormItem = t, this.$emit("formitemchange", e);
396
+ setFormItem(e, t) {
397
+ this.currentFormItem = e, this.$emit("formitemchange", t);
317
398
  }
318
399
  }
319
400
  });
320
401
  export {
321
- it as SchedulerEditSlot
402
+ fe as SchedulerEditSlot
322
403
  };
@@ -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"),o=require("@progress/kendo-vue-common"),l=require("../utils/main.js"),i=require("@progress/kendo-vue-intl"),n=require("../components/ShowMoreItemsButton.js"),r=require("../components/SchedulerForm.js"),a={skeleton:"dd"},h=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},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(){this.intl=i.provideIntlService(this);const e=o.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),a)]),this.itemsPerSlot<this.cSlot.items.length&&s.createVNode(n.ShowMoreItemsButton,{currentSlot:this.cSlot,hiddenCount:this.cSlot.items.length-this.itemsPerSlot,onClick:this.handleShowMoreItemsClick},null),e,this.formItem&&s.createVNode(r.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=h;
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;
@@ -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 o, createVNode as s } from "vue";
9
- import { getDefaultSlots as i } from "@progress/kendo-vue-common";
10
- import { COLLECTION_ACTION as l, formatEventTime as n } from "../utils/main.mjs";
11
- import { provideIntlService as r } from "@progress/kendo-vue-intl";
12
- import { ShowMoreItemsButton as a } from "../components/ShowMoreItemsButton.mjs";
13
- import { SchedulerForm as h } from "../components/SchedulerForm.mjs";
14
- const u = {
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
- }, $ = /* @__PURE__ */ o({
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 `${n(this.intl, this.$props.zonedStart, this.$props.zonedEnd, this.$props.isAllDay || !1)}`;
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: l.add,
130
+ type: o.add,
128
131
  item: this
129
132
  });
130
133
  },
131
134
  unmounted() {
132
135
  this.setSlots({
133
- type: l.remove,
136
+ type: o.remove,
134
137
  item: this
135
138
  });
136
139
  },
137
140
  render() {
138
- this.intl = r(this);
139
- const e = i(this), t = Object.assign({
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), u)]), this.itemsPerSlot < this.cSlot.items.length && s(a, {
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(h, {
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
- $ as SchedulerSlot
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;