@progress/kendo-vue-scheduler 3.1.2 → 3.1.3-dev.202203311441

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 (78) hide show
  1. package/dist/cdn/js/kendo-vue-scheduler.js +2 -2
  2. package/dist/es/Scheduler.js +4 -1
  3. package/dist/es/components/SchedulerActionButtons.d.ts +42 -0
  4. package/dist/es/components/SchedulerActionButtons.js +89 -0
  5. package/dist/es/components/SchedulerForm.js +62 -49
  6. package/dist/es/components/header/view-selector/ViewSelectorItem.js +1 -1
  7. package/dist/es/components/header/view-selector/ViewSelectorList.js +3 -3
  8. package/dist/es/editors/SchedulerFormEditor.js +331 -130
  9. package/dist/es/editors/ZonedDateTime.d.ts +2 -4
  10. package/dist/es/editors/ZonedDateTime.js +32 -15
  11. package/dist/es/package-metadata.js +1 -1
  12. package/dist/es/recurrence/RecurrenceEditor.d.ts +3 -0
  13. package/dist/es/recurrence/RecurrenceEditor.js +307 -457
  14. package/dist/es/recurrence/RecurrenceFrequencyEditor.js +38 -12
  15. package/dist/es/slots/SchedulerEditSlot.js +10 -7
  16. package/dist/es/slots/SchedulerSlot.js +1 -0
  17. package/dist/es/slots/SchedulerViewSlot.js +6 -2
  18. package/dist/es/views/agenda/AgendaView.d.ts +1 -1
  19. package/dist/es/views/agenda/AgendaView.js +39 -9
  20. package/dist/es/views/agenda/AgendaViewBody.d.ts +1 -0
  21. package/dist/es/views/agenda/AgendaViewBody.js +2 -1
  22. package/dist/es/views/common/VerticalResourceIterator.js +12 -6
  23. package/dist/es/views/day/DayView.js +10 -1
  24. package/dist/es/views/day/DayViewMiddleRow.d.ts +12 -0
  25. package/dist/es/views/day/DayViewMiddleRow.js +1 -0
  26. package/dist/es/views/day/DayViewVerticalRow.d.ts +1 -0
  27. package/dist/es/views/day/DayViewVerticalRow.js +5 -2
  28. package/dist/es/views/day/DayViewVerticalSlotsRow.d.ts +1 -0
  29. package/dist/es/views/day/DayViewVerticalSlotsRow.js +1 -0
  30. package/dist/es/views/day/MultiDayView.js +48 -24
  31. package/dist/es/views/month/MonthView.js +10 -4
  32. package/dist/es/views/month/MonthViewBody.d.ts +1 -0
  33. package/dist/es/views/month/MonthViewBody.js +1 -0
  34. package/dist/es/views/time/MultiDayTimelineView.js +12 -4
  35. package/dist/es/views/time/TimelineView.js +15 -3
  36. package/dist/es/views/time/TimelineViewBody.d.ts +1 -0
  37. package/dist/es/views/time/TimelineViewBody.js +1 -0
  38. package/dist/es/views/week/WeekView.js +10 -1
  39. package/dist/es/views/week/WorkWeekView.js +10 -1
  40. package/dist/npm/Scheduler.js +4 -1
  41. package/dist/npm/components/SchedulerActionButtons.d.ts +42 -0
  42. package/dist/npm/components/SchedulerActionButtons.js +100 -0
  43. package/dist/npm/components/SchedulerForm.js +61 -48
  44. package/dist/npm/components/header/view-selector/ViewSelectorItem.js +1 -1
  45. package/dist/npm/components/header/view-selector/ViewSelectorList.js +3 -3
  46. package/dist/npm/editors/SchedulerFormEditor.js +336 -129
  47. package/dist/npm/editors/ZonedDateTime.d.ts +2 -4
  48. package/dist/npm/editors/ZonedDateTime.js +32 -15
  49. package/dist/npm/package-metadata.js +1 -1
  50. package/dist/npm/recurrence/RecurrenceEditor.d.ts +3 -0
  51. package/dist/npm/recurrence/RecurrenceEditor.js +307 -457
  52. package/dist/npm/recurrence/RecurrenceFrequencyEditor.js +38 -12
  53. package/dist/npm/slots/SchedulerEditSlot.js +10 -7
  54. package/dist/npm/slots/SchedulerSlot.js +1 -0
  55. package/dist/npm/slots/SchedulerViewSlot.js +6 -2
  56. package/dist/npm/views/agenda/AgendaView.d.ts +1 -1
  57. package/dist/npm/views/agenda/AgendaView.js +39 -9
  58. package/dist/npm/views/agenda/AgendaViewBody.d.ts +1 -0
  59. package/dist/npm/views/agenda/AgendaViewBody.js +2 -1
  60. package/dist/npm/views/common/VerticalResourceIterator.js +12 -6
  61. package/dist/npm/views/day/DayView.js +10 -1
  62. package/dist/npm/views/day/DayViewMiddleRow.d.ts +12 -0
  63. package/dist/npm/views/day/DayViewMiddleRow.js +1 -0
  64. package/dist/npm/views/day/DayViewVerticalRow.d.ts +1 -0
  65. package/dist/npm/views/day/DayViewVerticalRow.js +5 -2
  66. package/dist/npm/views/day/DayViewVerticalSlotsRow.d.ts +1 -0
  67. package/dist/npm/views/day/DayViewVerticalSlotsRow.js +1 -0
  68. package/dist/npm/views/day/MultiDayView.js +48 -24
  69. package/dist/npm/views/month/MonthView.js +10 -4
  70. package/dist/npm/views/month/MonthViewBody.d.ts +1 -0
  71. package/dist/npm/views/month/MonthViewBody.js +1 -0
  72. package/dist/npm/views/time/MultiDayTimelineView.js +12 -4
  73. package/dist/npm/views/time/TimelineView.js +15 -3
  74. package/dist/npm/views/time/TimelineViewBody.d.ts +1 -0
  75. package/dist/npm/views/time/TimelineViewBody.js +1 -0
  76. package/dist/npm/views/week/WeekView.js +10 -1
  77. package/dist/npm/views/week/WorkWeekView.js +10 -1
  78. package/package.json +12 -12
@@ -160,7 +160,7 @@ var SchedulerVue2 = {
160
160
  currentDate: currentDate,
161
161
  showWorkHours: view.showWorkHours !== undefined ? view.showWorkHours : true,
162
162
  timezone: this.$props.timezone,
163
- props: this.$props,
163
+ props: __assign({}, this.$props),
164
164
  views: this.views,
165
165
  view: view,
166
166
  fields: getModelFields(this.$props.modelFields).fields,
@@ -184,6 +184,9 @@ var SchedulerVue2 = {
184
184
  timezone: function timezone(newName) {
185
185
  this.ks.timezone = newName;
186
186
  this.updatePassedState();
187
+ },
188
+ dataItems: function dataItems(newDataItems) {
189
+ this.ks.dataItems = newDataItems;
187
190
  }
188
191
  },
189
192
  // @ts-ignore
@@ -0,0 +1,42 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
2
+ declare type DefaultData<V> = object | ((this: V) => {});
3
+ declare type DefaultMethods<V> = {
4
+ [key: string]: (this: V, ...args: any[]) => any;
5
+ };
6
+ /**
7
+ * Represents the properties of [SchedulerActionButtons]({% slug api_scheduler_dateheadercell %}) component.
8
+ */
9
+ export interface SchedulerActionButtonsProps {
10
+ editSaveMessage: string;
11
+ editCancelMessage: string;
12
+ }
13
+ /**
14
+ * @hidden
15
+ */
16
+ export interface SchedulerActionButtonsState {
17
+ }
18
+ /**
19
+ * @hidden
20
+ */
21
+ export interface SchedulerActionButtonsComputed {
22
+ [key: string]: any;
23
+ }
24
+ /**
25
+ * @hidden
26
+ */
27
+ export interface SchedulerActionButtonsMethods {
28
+ [key: string]: any;
29
+ }
30
+ /**
31
+ * @hidden
32
+ */
33
+ export interface SchedulerActionButtonsData {
34
+ }
35
+ /**
36
+ * @hidden
37
+ */
38
+ export interface SchedulerActionButtonsAll extends Vue2type, SchedulerActionButtonsMethods, SchedulerActionButtonsData, SchedulerActionButtonsComputed, SchedulerActionButtonsState {
39
+ }
40
+ declare let SchedulerActionButtonsVue2: ComponentOptions<SchedulerActionButtonsAll, DefaultData<SchedulerActionButtonsData>, DefaultMethods<SchedulerActionButtonsAll>, SchedulerActionButtonsComputed, RecordPropsDefinition<SchedulerActionButtonsProps>>;
41
+ declare const SchedulerActionButtons: DefineComponent<SchedulerActionButtonsProps, any, SchedulerActionButtonsData, SchedulerActionButtonsComputed, SchedulerActionButtonsMethods, {}, {}, {}, string, SchedulerActionButtonsProps, SchedulerActionButtonsProps, {}>;
42
+ export { SchedulerActionButtons, SchedulerActionButtonsVue2 };
@@ -0,0 +1,89 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ import { Button } from '@progress/kendo-vue-buttons';
6
+ import { DialogActionsBar } from '@progress/kendo-vue-dialogs'; // tslint:enable:max-line-length
7
+
8
+ var SchedulerActionButtonsVue2 = {
9
+ name: 'KendoSchedulerActionButtons',
10
+ props: {
11
+ editSaveMessage: String,
12
+ editCancelMessage: String
13
+ },
14
+ inject: {
15
+ kendoForm: {
16
+ default: {}
17
+ }
18
+ },
19
+ // @ts-ignore
20
+ setup: !gh ? undefined : function () {
21
+ var v3 = !!gh;
22
+ return {
23
+ v3: v3
24
+ };
25
+ },
26
+ // @ts-ignore
27
+ render: function render(createElement) {
28
+ var _this = this;
29
+
30
+ var h = gh || createElement;
31
+ return (// @ts-ignore function children
32
+ h(DialogActionsBar, this.v3 ? function () {
33
+ return [// @ts-ignore function children
34
+ h(Button, {
35
+ type: "submit",
36
+ attrs: _this.v3 ? undefined : {
37
+ type: "submit",
38
+ disabled: !_this.kendoForm.allowSubmit
39
+ },
40
+ disabled: !_this.kendoForm.allowSubmit,
41
+ onClick: _this.onSubmit,
42
+ on: _this.v3 ? undefined : {
43
+ "click": _this.onSubmit
44
+ }
45
+ }, _this.v3 ? function () {
46
+ return [_this.editSaveMessage];
47
+ } : [_this.editSaveMessage]), // @ts-ignore function children
48
+ h(Button, {
49
+ onClick: _this.handleCancel,
50
+ on: _this.v3 ? undefined : {
51
+ "click": _this.handleCancel
52
+ }
53
+ }, _this.v3 ? function () {
54
+ return [_this.editCancelMessage];
55
+ } : [_this.editCancelMessage])];
56
+ } : [h(Button, {
57
+ type: "submit",
58
+ attrs: _this.v3 ? undefined : {
59
+ type: "submit",
60
+ disabled: !_this.kendoForm.allowSubmit
61
+ },
62
+ disabled: !_this.kendoForm.allowSubmit,
63
+ onClick: _this.onSubmit,
64
+ on: _this.v3 ? undefined : {
65
+ "click": _this.onSubmit
66
+ }
67
+ }, _this.v3 ? function () {
68
+ return [_this.editSaveMessage];
69
+ } : [_this.editSaveMessage]), h(Button, {
70
+ onClick: _this.handleCancel,
71
+ on: _this.v3 ? undefined : {
72
+ "click": _this.handleCancel
73
+ }
74
+ }, _this.v3 ? function () {
75
+ return [_this.editCancelMessage];
76
+ } : [_this.editCancelMessage])])
77
+ );
78
+ },
79
+ methods: {
80
+ onSubmit: function onSubmit(e) {
81
+ this.kendoForm.onSubmit(e);
82
+ },
83
+ handleCancel: function handleCancel(e) {
84
+ this.$emit('cancel', e);
85
+ }
86
+ }
87
+ };
88
+ var SchedulerActionButtons = SchedulerActionButtonsVue2;
89
+ export { SchedulerActionButtons, SchedulerActionButtonsVue2 };
@@ -19,11 +19,12 @@ import * as Vue from 'vue';
19
19
  var allVue = Vue;
20
20
  var gh = allVue.h;
21
21
  var inject = allVue.inject;
22
- import { Button } from '@progress/kendo-vue-buttons';
22
+ import { SchedulerActionButtons } from './SchedulerActionButtons';
23
23
  import { Form } from '@progress/kendo-vue-form';
24
- import { Dialog as KendoDialog, DialogActionsBar } from '@progress/kendo-vue-dialogs';
24
+ import { Dialog as KendoDialog } from '@progress/kendo-vue-dialogs';
25
25
  import { provideLocalizationService } from '@progress/kendo-vue-intl';
26
- import { SchedulerFormEditor } from '../editors/SchedulerFormEditor';
26
+ import { SchedulerFormEditor } from '../editors/SchedulerFormEditor'; // import { useSchedulerFieldsContext } from '../context';
27
+
27
28
  import { messages, editorValidationRequired, editorValidationStart, editorValidationEnd, editorSave, editorCancel, editorTitle } from '../messages'; // tslint:enable:max-line-length
28
29
 
29
30
  var SchedulerFormVue2 = {
@@ -32,9 +33,18 @@ var SchedulerFormVue2 = {
32
33
  dataItem: Object,
33
34
  renderForm: Object,
34
35
  editor: [String, Function, Object],
35
- dialog: [String, Function, Object]
36
+ dialog: [String, Function, Object],
37
+ validator: {
38
+ type: Function,
39
+ default: function _default() {
40
+ return {};
41
+ }
42
+ }
36
43
  },
37
44
  inject: {
45
+ ks: {
46
+ default: null
47
+ },
38
48
  kendoLocalizationService: {
39
49
  default: null
40
50
  }
@@ -71,8 +81,10 @@ var SchedulerFormVue2 = {
71
81
  title: editorTitleMessage,
72
82
  attrs: this.v3 ? undefined : {
73
83
  title: editorTitleMessage,
84
+ appendTo: 'body',
74
85
  minWidth: 600
75
86
  },
87
+ appendTo: 'body',
76
88
  minWidth: 600,
77
89
  onClose: this.handleClose,
78
90
  on: this.v3 ? undefined : {
@@ -99,36 +111,35 @@ var SchedulerFormVue2 = {
99
111
  attrs: _this.v3 ? undefined : {
100
112
  as: Editor
101
113
  }
114
+ }), h(SchedulerActionButtons, {
115
+ editSaveMessage: editSaveMessage,
116
+ attrs: _this.v3 ? undefined : {
117
+ editSaveMessage: editSaveMessage,
118
+ editCancelMessage: editCancelMessage
119
+ },
120
+ editCancelMessage: editCancelMessage,
121
+ onCancel: _this.handleCancel,
122
+ on: _this.v3 ? undefined : {
123
+ "cancel": _this.handleCancel
124
+ }
102
125
  })];
103
126
  } : [h(SchedulerFormEditor, {
104
127
  as: Editor,
105
128
  attrs: _this.v3 ? undefined : {
106
129
  as: Editor
107
130
  }
108
- })]), // @ts-ignore function children
109
- h(DialogActionsBar, _this.v3 ? function () {
110
- return [// @ts-ignore function children
111
- h(Button, _this.v3 ? function () {
112
- return [editSaveMessage];
113
- } : [editSaveMessage]), // @ts-ignore function children
114
- h(Button, {
115
- onClick: _this.handleCancel,
116
- on: _this.v3 ? undefined : {
117
- "click": _this.handleCancel
118
- }
119
- }, _this.v3 ? function () {
120
- return [editCancelMessage];
121
- } : [editCancelMessage])];
122
- } : [h(Button, _this.v3 ? function () {
123
- return [editSaveMessage];
124
- } : [editSaveMessage]), h(Button, {
125
- onClick: _this.handleCancel,
131
+ }), h(SchedulerActionButtons, {
132
+ editSaveMessage: editSaveMessage,
133
+ attrs: _this.v3 ? undefined : {
134
+ editSaveMessage: editSaveMessage,
135
+ editCancelMessage: editCancelMessage
136
+ },
137
+ editCancelMessage: editCancelMessage,
138
+ onCancel: _this.handleCancel,
126
139
  on: _this.v3 ? undefined : {
127
- "click": _this.handleCancel
140
+ "cancel": _this.handleCancel
128
141
  }
129
- }, _this.v3 ? function () {
130
- return [editCancelMessage];
131
- } : [editCancelMessage])])];
142
+ })])];
132
143
  } : [h(Form, {
133
144
  initialValues: _this.$props.dataItem,
134
145
  attrs: _this.v3 ? undefined : {
@@ -146,33 +157,35 @@ var SchedulerFormVue2 = {
146
157
  attrs: _this.v3 ? undefined : {
147
158
  as: Editor
148
159
  }
160
+ }), h(SchedulerActionButtons, {
161
+ editSaveMessage: editSaveMessage,
162
+ attrs: _this.v3 ? undefined : {
163
+ editSaveMessage: editSaveMessage,
164
+ editCancelMessage: editCancelMessage
165
+ },
166
+ editCancelMessage: editCancelMessage,
167
+ onCancel: _this.handleCancel,
168
+ on: _this.v3 ? undefined : {
169
+ "cancel": _this.handleCancel
170
+ }
149
171
  })];
150
172
  } : [h(SchedulerFormEditor, {
151
173
  as: Editor,
152
174
  attrs: _this.v3 ? undefined : {
153
175
  as: Editor
154
176
  }
155
- })]), h(DialogActionsBar, _this.v3 ? function () {
156
- return [h(Button, _this.v3 ? function () {
157
- return [editSaveMessage];
158
- } : [editSaveMessage]), h(Button, {
159
- onClick: _this.handleCancel,
160
- on: _this.v3 ? undefined : {
161
- "click": _this.handleCancel
162
- }
163
- }, _this.v3 ? function () {
164
- return [editCancelMessage];
165
- } : [editCancelMessage])];
166
- } : [h(Button, _this.v3 ? function () {
167
- return [editSaveMessage];
168
- } : [editSaveMessage]), h(Button, {
169
- onClick: _this.handleCancel,
177
+ }), h(SchedulerActionButtons, {
178
+ editSaveMessage: editSaveMessage,
179
+ attrs: _this.v3 ? undefined : {
180
+ editSaveMessage: editSaveMessage,
181
+ editCancelMessage: editCancelMessage
182
+ },
183
+ editCancelMessage: editCancelMessage,
184
+ onCancel: _this.handleCancel,
170
185
  on: _this.v3 ? undefined : {
171
- "click": _this.handleCancel
186
+ "cancel": _this.handleCancel
172
187
  }
173
- }, _this.v3 ? function () {
174
- return [editCancelMessage];
175
- } : [editCancelMessage])])])
188
+ })])])
176
189
  );
177
190
  },
178
191
  methods: {
@@ -199,20 +212,20 @@ var SchedulerFormVue2 = {
199
212
  });
200
213
  },
201
214
  startAfterEndValidator: function startAfterEndValidator(value, formValueGetter) {
202
- return Boolean(value && formValueGetter(this.fields.end) && value.getTime() > formValueGetter(this.fields.end).getTime()) ? this.startValidationMessage : undefined;
215
+ return Boolean(value && formValueGetter(this.ks.fields.end) && value.getTime() > formValueGetter(this.ks.fields.end).getTime()) ? this.startValidationMessage : undefined;
203
216
  },
204
217
  endAfterStartValidator: function endAfterStartValidator(value, formValueGetter) {
205
- return Boolean(value && formValueGetter(this.fields.start) && value.getTime() < formValueGetter(this.fields.start).getTime()) ? this.endValidationMessage : undefined;
218
+ return Boolean(value && formValueGetter(this.ks.fields.start) && value.getTime() < formValueGetter(this.ks.fields.start).getTime()) ? this.endValidationMessage : undefined;
206
219
  },
207
220
  requiredValidator: function requiredValidator(value) {
208
221
  return value ? undefined : this.requiredValidationMessage;
209
222
  },
210
223
  formValidator: function formValidator(_dataItem, formValueGetter) {
211
224
  var result = {};
212
- result[this.fields.start] = [this.requiredValidator(formValueGetter(this.fields.start)), this.startAfterEndValidator(formValueGetter(this.fields.start), formValueGetter)].filter(Boolean).reduce(function (current, acc) {
225
+ result[this.ks.fields.start] = [this.requiredValidator(formValueGetter(this.ks.fields.start)), this.startAfterEndValidator(formValueGetter(this.ks.fields.start), formValueGetter)].filter(Boolean).reduce(function (current, acc) {
213
226
  return current || acc;
214
227
  }, '');
215
- result[this.fields.end] = [this.requiredValidator(formValueGetter(this.fields.start)), this.endAfterStartValidator(formValueGetter(this.fields.start), formValueGetter)].filter(Boolean).reduce(function (current, acc) {
228
+ result[this.ks.fields.end] = [this.requiredValidator(formValueGetter(this.ks.fields.start)), this.endAfterStartValidator(formValueGetter(this.ks.fields.start), formValueGetter)].filter(Boolean).reduce(function (current, acc) {
216
229
  return current || acc;
217
230
  }, '');
218
231
  var additionalValidator = this.$props.validator(_dataItem, formValueGetter);
@@ -34,7 +34,7 @@ var ViewSelectorItemVue2 = {
34
34
  var h = gh || createElement;
35
35
  var localization = provideLocalizationService(this);
36
36
  var nameTitle = 'scheduler.' + this.$props.view.name + 'ViewTitle';
37
- var name = localization.toLanguageString(nameTitle, messages[nameTitle]);
37
+ var name = localization.toLanguageString(nameTitle, messages[nameTitle]) || this.$props.view.name;
38
38
  var title = this.$props.view.title || name;
39
39
  return (// @ts-ignore function children
40
40
  h(Button, {
@@ -80,7 +80,7 @@ var ViewSelectorListVue2 = {
80
80
  return v.name === _this.ks.activeViewName;
81
81
  });
82
82
  var activeNameTitle = 'scheduler.' + activeView.name + 'ViewTitle';
83
- var activeName = this.localization.toLanguageString(activeNameTitle, messages[activeNameTitle]);
83
+ var activeName = this.localization.toLanguageString(activeNameTitle, messages[activeNameTitle]) || activeView.name;
84
84
  return h("div", {
85
85
  "class": "k-scheduler-views-wrapper"
86
86
  }, [activeView && this.media === 'mobile' && // @ts-ignore function children
@@ -100,7 +100,7 @@ var ViewSelectorListVue2 = {
100
100
  textField: "title",
101
101
  items: views.map(function (v) {
102
102
  var nameTitle = 'scheduler.' + v.name + 'ViewTitle';
103
- var name = this.localization.toLanguageString(nameTitle, messages[nameTitle]);
103
+ var name = this.localization.toLanguageString(nameTitle, messages[nameTitle]) || v.name;
104
104
  return __assign(__assign({}, v.props), {
105
105
  selected: v.name === this.ks.activeViewName,
106
106
  name: v.name,
@@ -112,7 +112,7 @@ var ViewSelectorListVue2 = {
112
112
  textField: "title",
113
113
  items: views.map(function (v) {
114
114
  var nameTitle = 'scheduler.' + v.name + 'ViewTitle';
115
- var name = this.localization.toLanguageString(nameTitle, messages[nameTitle]);
115
+ var name = this.localization.toLanguageString(nameTitle, messages[nameTitle]) || v.name;
116
116
  return __assign(__assign({}, v.props), {
117
117
  selected: v.name === this.ks.activeViewName,
118
118
  name: v.name,