dhtmlx-scheduler 7.0.3 → 7.0.4
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/README.md +2 -2
- package/bower.json +1 -1
- package/codebase/dhtmlxscheduler.d.ts +16 -15
- package/codebase/dhtmlxscheduler.es.d.ts +16 -15
- package/codebase/dhtmlxscheduler.es.js +2281 -2266
- package/codebase/dhtmlxscheduler.es.js.map +1 -1
- package/codebase/dhtmlxscheduler.js +32 -32
- package/codebase/dhtmlxscheduler.js.map +1 -1
- package/codebase/sources/dhtmlxscheduler.es.js +120 -101
- package/codebase/sources/dhtmlxscheduler.es.js.map +1 -1
- package/codebase/sources/dhtmlxscheduler.js +120 -101
- package/codebase/sources/dhtmlxscheduler.js.map +1 -1
- package/codebase/sources/less/package.json +1 -1
- package/package.json +1 -1
- package/whatsnew.md +8 -0
|
@@ -520,14 +520,14 @@ function extend$j(scheduler2) {
|
|
|
520
520
|
scheduler2._init_once = function() {
|
|
521
521
|
};
|
|
522
522
|
};
|
|
523
|
-
|
|
523
|
+
const layout = { navbar: { render: function(config) {
|
|
524
524
|
return scheduler2._init_nav_bar(config);
|
|
525
525
|
} }, header: { render: function(config) {
|
|
526
|
-
|
|
526
|
+
const element = document.createElement("div");
|
|
527
527
|
element.className = "dhx_cal_header";
|
|
528
528
|
return element;
|
|
529
529
|
} }, dataArea: { render: function(config) {
|
|
530
|
-
|
|
530
|
+
const element = document.createElement("div");
|
|
531
531
|
element.className = "dhx_cal_data";
|
|
532
532
|
return element;
|
|
533
533
|
} }, html_element: { render: function(config) {
|
|
@@ -537,25 +537,25 @@ function extend$j(scheduler2) {
|
|
|
537
537
|
return !!(element.querySelector(".dhx_cal_header") && element.querySelector(".dhx_cal_data") && element.querySelector(".dhx_cal_navline"));
|
|
538
538
|
}
|
|
539
539
|
function createDefaultHeader(scheduler3) {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
540
|
+
const views = ["day", "week", "month"];
|
|
541
|
+
const date = ["date"];
|
|
542
|
+
const nav = ["prev", "today", "next"];
|
|
543
543
|
if (scheduler3.matrix) {
|
|
544
|
-
for (
|
|
544
|
+
for (const i in scheduler3.matrix) {
|
|
545
545
|
views.push(i);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
if (scheduler3._props) {
|
|
549
|
-
for (
|
|
549
|
+
for (const i in scheduler3._props) {
|
|
550
550
|
views.push(i);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
if (scheduler3._grid && scheduler3._grid.names) {
|
|
554
|
-
for (
|
|
554
|
+
for (const i in scheduler3._grid.names) {
|
|
555
555
|
views.push(i);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
|
|
558
|
+
const optionalViews = ["map", "agenda", "week_agenda", "year"];
|
|
559
559
|
optionalViews.forEach(function(viewName) {
|
|
560
560
|
if (scheduler3[viewName + "_view"]) {
|
|
561
561
|
views.push(viewName);
|
|
@@ -697,16 +697,16 @@ function extend$j(scheduler2) {
|
|
|
697
697
|
}
|
|
698
698
|
};
|
|
699
699
|
scheduler2.get_elements = function() {
|
|
700
|
-
|
|
701
|
-
for (
|
|
702
|
-
|
|
703
|
-
|
|
700
|
+
const els = this._obj.getElementsByTagName("DIV");
|
|
701
|
+
for (let i = 0; i < els.length; i++) {
|
|
702
|
+
let class_name = scheduler2._getClassName(els[i]);
|
|
703
|
+
const attr_value = els[i].getAttribute("data-tab") || els[i].getAttribute("name") || "";
|
|
704
704
|
if (class_name)
|
|
705
705
|
class_name = class_name.split(" ")[0];
|
|
706
706
|
if (!this._els[class_name])
|
|
707
707
|
this._els[class_name] = [];
|
|
708
708
|
this._els[class_name].push(els[i]);
|
|
709
|
-
|
|
709
|
+
let label = scheduler2.locale.labels[attr_value + "_tab"] || scheduler2.locale.labels[attr_value || class_name];
|
|
710
710
|
if (typeof label !== "string" && attr_value && !els[i].innerHTML)
|
|
711
711
|
label = attr_value.split("_")[0];
|
|
712
712
|
if (label) {
|
|
@@ -715,14 +715,14 @@ function extend$j(scheduler2) {
|
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
717
|
};
|
|
718
|
-
|
|
718
|
+
const domEventsScope = scheduler2._createDomEventScope();
|
|
719
719
|
scheduler2.unset_actions = function() {
|
|
720
720
|
domEventsScope.detachAll();
|
|
721
721
|
};
|
|
722
722
|
scheduler2.set_actions = function() {
|
|
723
|
-
for (
|
|
723
|
+
for (const a in this._els) {
|
|
724
724
|
if (this._click[a]) {
|
|
725
|
-
for (
|
|
725
|
+
for (let i = 0; i < this._els[a].length; i++) {
|
|
726
726
|
const element = this._els[a][i];
|
|
727
727
|
const handler = this._click[a].bind(element);
|
|
728
728
|
domEventsScope.attach(element, "click", handler);
|
|
@@ -748,13 +748,11 @@ function extend$j(scheduler2) {
|
|
|
748
748
|
domEventsScope.attach(this._obj, "dblclick", function(e) {
|
|
749
749
|
scheduler2._on_dbl_click(e);
|
|
750
750
|
});
|
|
751
|
-
domEventsScope.attach(this._obj, "contextmenu", function(
|
|
751
|
+
domEventsScope.attach(this._obj, "contextmenu", function(event2) {
|
|
752
752
|
if (scheduler2.checkEvent("onContextMenu")) {
|
|
753
|
-
|
|
753
|
+
event2.preventDefault();
|
|
754
754
|
}
|
|
755
|
-
|
|
756
|
-
var src = ev.target || ev.srcElement;
|
|
757
|
-
var returnValue = scheduler2.callEvent("onContextMenu", [scheduler2._locate_event(src), ev]);
|
|
755
|
+
const returnValue = scheduler2.callEvent("onContextMenu", [scheduler2._locate_event(event2.target), event2]);
|
|
758
756
|
return returnValue;
|
|
759
757
|
});
|
|
760
758
|
};
|
|
@@ -771,13 +769,15 @@ function extend$j(scheduler2) {
|
|
|
771
769
|
this.callEvent("onEventSelected", [id2]);
|
|
772
770
|
};
|
|
773
771
|
scheduler2.unselect = function(id2) {
|
|
774
|
-
if (id2 && id2 != this._select_id)
|
|
772
|
+
if (id2 && id2 != this._select_id) {
|
|
775
773
|
return;
|
|
776
|
-
|
|
774
|
+
}
|
|
775
|
+
const previousSelection = this._select_id;
|
|
777
776
|
this._select_id = null;
|
|
778
|
-
if (
|
|
779
|
-
this.updateEvent(
|
|
780
|
-
|
|
777
|
+
if (previousSelection && this.getEvent(previousSelection)) {
|
|
778
|
+
this.updateEvent(previousSelection);
|
|
779
|
+
}
|
|
780
|
+
this.callEvent("onEventUnselected", [previousSelection]);
|
|
781
781
|
};
|
|
782
782
|
scheduler2.getState = function() {
|
|
783
783
|
return { mode: this._mode, date: new Date(this._date), min_date: new Date(this._min_date), max_date: new Date(this._max_date), editor_id: this._edit_id, lightbox_id: this._lightbox_id, new_event: this._new_event, select_id: this._select_id, expanded: this.expanded, drag_id: this._drag_id, drag_mode: this._drag_mode };
|
|
@@ -790,8 +790,7 @@ function extend$j(scheduler2) {
|
|
|
790
790
|
scheduler2._ignore_next_click = false;
|
|
791
791
|
return false;
|
|
792
792
|
}
|
|
793
|
-
|
|
794
|
-
var id2 = scheduler2._locate_event(trg);
|
|
793
|
+
const id2 = scheduler2._locate_event(e.target);
|
|
795
794
|
if (!id2) {
|
|
796
795
|
scheduler2.callEvent("onEmptyClick", [scheduler2.getActionData(e).date, e]);
|
|
797
796
|
} else {
|
|
@@ -800,8 +799,8 @@ function extend$j(scheduler2) {
|
|
|
800
799
|
}
|
|
801
800
|
if (id2 && scheduler2.config.select) {
|
|
802
801
|
scheduler2.select(id2);
|
|
803
|
-
const icon =
|
|
804
|
-
|
|
802
|
+
const icon = e.target.closest(".dhx_menu_icon");
|
|
803
|
+
const mask = scheduler2._getClassName(icon);
|
|
805
804
|
if (mask.indexOf("_icon") != -1)
|
|
806
805
|
scheduler2._click.buttons[mask.split(" ")[1].replace("icon_", "")](id2);
|
|
807
806
|
} else {
|
|
@@ -813,7 +812,7 @@ function extend$j(scheduler2) {
|
|
|
813
812
|
}, dhx_cal_prev_button: function() {
|
|
814
813
|
scheduler2._click.dhx_cal_next_button(0, -1);
|
|
815
814
|
}, dhx_cal_next_button: function(dummy, step) {
|
|
816
|
-
|
|
815
|
+
let def_step = 1;
|
|
817
816
|
if (scheduler2.config.rtl) {
|
|
818
817
|
step = -step;
|
|
819
818
|
def_step = -def_step;
|
|
@@ -824,12 +823,12 @@ function extend$j(scheduler2) {
|
|
|
824
823
|
scheduler2.setCurrentView(scheduler2._currentDate());
|
|
825
824
|
}
|
|
826
825
|
}, dhx_cal_tab: function() {
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
826
|
+
const name = this.getAttribute("data-tab");
|
|
827
|
+
const deprecated_name = this.getAttribute("name");
|
|
828
|
+
const mode = name || deprecated_name.substring(0, deprecated_name.search("_tab"));
|
|
830
829
|
scheduler2.setCurrentView(scheduler2._date, mode);
|
|
831
830
|
}, buttons: { delete: function(id2) {
|
|
832
|
-
|
|
831
|
+
const c = scheduler2.locale.labels.confirm_deleting;
|
|
833
832
|
scheduler2._dhtmlx_confirm({ message: c, title: scheduler2.locale.labels.title_confirm_deleting, callback: function() {
|
|
834
833
|
scheduler2.deleteEvent(id2);
|
|
835
834
|
}, config: { ok: scheduler2.locale.labels.icon_delete } });
|
|
@@ -848,45 +847,47 @@ function extend$j(scheduler2) {
|
|
|
848
847
|
if (!message2)
|
|
849
848
|
return callback();
|
|
850
849
|
config = config || {};
|
|
851
|
-
|
|
852
|
-
if (title)
|
|
850
|
+
const opts = { ...config, text: message2 };
|
|
851
|
+
if (title) {
|
|
853
852
|
opts.title = title;
|
|
853
|
+
}
|
|
854
854
|
if (callback) {
|
|
855
855
|
opts.callback = function(result) {
|
|
856
|
-
if (result)
|
|
856
|
+
if (result) {
|
|
857
857
|
callback();
|
|
858
|
+
}
|
|
858
859
|
};
|
|
859
860
|
}
|
|
860
861
|
scheduler2.confirm(opts);
|
|
861
862
|
};
|
|
862
863
|
scheduler2.addEventNow = function(start, end, e) {
|
|
863
|
-
|
|
864
|
+
let base = {};
|
|
864
865
|
if (scheduler2._isObject(start) && !scheduler2._isDate(start)) {
|
|
865
866
|
base = start;
|
|
866
867
|
start = null;
|
|
867
868
|
}
|
|
868
|
-
|
|
869
|
+
const duration = (this.config.event_duration || this.config.time_step) * 6e4;
|
|
869
870
|
if (!start)
|
|
870
|
-
start = base.start_date || Math.round(scheduler2._currentDate().valueOf() /
|
|
871
|
-
|
|
871
|
+
start = base.start_date || Math.round(scheduler2._currentDate().valueOf() / duration) * duration;
|
|
872
|
+
let start_date = new Date(start);
|
|
872
873
|
if (!end) {
|
|
873
|
-
|
|
874
|
+
let start_hour = this.config.first_hour;
|
|
874
875
|
if (start_hour > start_date.getHours()) {
|
|
875
876
|
start_date.setHours(start_hour);
|
|
876
877
|
start = start_date.valueOf();
|
|
877
878
|
}
|
|
878
|
-
end = start.valueOf() +
|
|
879
|
+
end = start.valueOf() + duration;
|
|
879
880
|
}
|
|
880
|
-
|
|
881
|
+
let end_date = new Date(end);
|
|
881
882
|
if (start_date.valueOf() == end_date.valueOf())
|
|
882
|
-
end_date.setTime(end_date.valueOf() +
|
|
883
|
+
end_date.setTime(end_date.valueOf() + duration);
|
|
883
884
|
base.start_date = base.start_date || start_date;
|
|
884
885
|
base.end_date = base.end_date || end_date;
|
|
885
886
|
base.text = base.text || this.locale.labels.new_event;
|
|
886
887
|
base.id = this._drag_id = base.id || this.uid();
|
|
887
888
|
this._drag_mode = "new-size";
|
|
888
889
|
this._loading = true;
|
|
889
|
-
|
|
890
|
+
const eventId = this.addEvent(base);
|
|
890
891
|
this.callEvent("onEventCreated", [this._drag_id, e]);
|
|
891
892
|
this._loading = false;
|
|
892
893
|
this._drag_event = {};
|
|
@@ -894,10 +895,10 @@ function extend$j(scheduler2) {
|
|
|
894
895
|
return eventId;
|
|
895
896
|
};
|
|
896
897
|
scheduler2._on_dbl_click = function(e, src) {
|
|
897
|
-
src = src ||
|
|
898
|
+
src = src || e.target;
|
|
898
899
|
if (this.config.readonly)
|
|
899
900
|
return;
|
|
900
|
-
|
|
901
|
+
const name = scheduler2._getClassName(src).split(" ")[0];
|
|
901
902
|
switch (name) {
|
|
902
903
|
case "dhx_scale_holder":
|
|
903
904
|
case "dhx_scale_holder_now":
|
|
@@ -913,8 +914,8 @@ function extend$j(scheduler2) {
|
|
|
913
914
|
case "dhx_cal_agenda_event_line":
|
|
914
915
|
case "dhx_grid_event":
|
|
915
916
|
case "dhx_cal_event_line":
|
|
916
|
-
case "dhx_cal_event_clear":
|
|
917
|
-
|
|
917
|
+
case "dhx_cal_event_clear": {
|
|
918
|
+
const id2 = this._locate_event(src);
|
|
918
919
|
if (!this.callEvent("onDblClick", [id2, e]))
|
|
919
920
|
return;
|
|
920
921
|
if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id2)._timed || !this.config.select)
|
|
@@ -922,25 +923,27 @@ function extend$j(scheduler2) {
|
|
|
922
923
|
else
|
|
923
924
|
this.edit(id2);
|
|
924
925
|
break;
|
|
926
|
+
}
|
|
925
927
|
case "dhx_time_block":
|
|
926
928
|
case "dhx_cal_container":
|
|
927
929
|
return;
|
|
928
|
-
default:
|
|
929
|
-
|
|
930
|
-
if (
|
|
931
|
-
|
|
930
|
+
default: {
|
|
931
|
+
const viewHandler = this["dblclick_" + name];
|
|
932
|
+
if (viewHandler) {
|
|
933
|
+
viewHandler.call(this, e);
|
|
932
934
|
} else {
|
|
933
935
|
if (src.parentNode && src != this)
|
|
934
936
|
return scheduler2._on_dbl_click(e, src.parentNode);
|
|
935
937
|
}
|
|
936
938
|
break;
|
|
939
|
+
}
|
|
937
940
|
}
|
|
938
941
|
};
|
|
939
942
|
scheduler2._get_column_index = function(x_pos) {
|
|
940
|
-
|
|
943
|
+
let column = 0;
|
|
941
944
|
if (this._cols) {
|
|
942
|
-
|
|
943
|
-
|
|
945
|
+
let width = 0;
|
|
946
|
+
let i = 0;
|
|
944
947
|
while (width + this._cols[i] < x_pos && i < this._cols.length) {
|
|
945
948
|
width += this._cols[i];
|
|
946
949
|
i++;
|
|
@@ -960,20 +963,20 @@ function extend$j(scheduler2) {
|
|
|
960
963
|
if (!this._cols) {
|
|
961
964
|
return pos;
|
|
962
965
|
} else {
|
|
963
|
-
|
|
966
|
+
const column = this._get_column_index(pos.x);
|
|
964
967
|
pos.x = Math.min(this._cols.length - 1, Math.max(0, Math.ceil(column) - 1));
|
|
965
968
|
pos.y = Math.max(0, Math.ceil(pos.y * 60 / (this.config.time_step * this.config.hour_size_px)) - 1) + this.config.first_hour * (60 / this.config.time_step);
|
|
966
969
|
return pos;
|
|
967
970
|
}
|
|
968
971
|
};
|
|
969
972
|
scheduler2._mouse_coords = function(ev) {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
+
let pos;
|
|
974
|
+
const body = document.body;
|
|
975
|
+
const documentElement = document.documentElement;
|
|
973
976
|
if (!this.$env.isIE && (ev.pageX || ev.pageY))
|
|
974
977
|
pos = { x: ev.pageX, y: ev.pageY };
|
|
975
978
|
else
|
|
976
|
-
pos = { x: ev.clientX + (
|
|
979
|
+
pos = { x: ev.clientX + (body.scrollLeft || documentElement.scrollLeft || 0) - body.clientLeft, y: ev.clientY + (body.scrollTop || documentElement.scrollTop || 0) - body.clientTop };
|
|
977
980
|
if (this.config.rtl && this._colsS) {
|
|
978
981
|
pos.x = this.$container.querySelector(".dhx_cal_data").offsetWidth - pos.x;
|
|
979
982
|
pos.x += this.$domHelpers.getAbsoluteLeft(this._obj);
|
|
@@ -983,20 +986,20 @@ function extend$j(scheduler2) {
|
|
|
983
986
|
} else {
|
|
984
987
|
pos.x -= this.$domHelpers.getAbsoluteLeft(this._obj) + (this._table_view ? 0 : this.xy.scale_width);
|
|
985
988
|
}
|
|
986
|
-
|
|
989
|
+
const dataArea = this.$container.querySelector(".dhx_cal_data");
|
|
987
990
|
pos.y -= this.$domHelpers.getAbsoluteTop(dataArea) - this._els["dhx_cal_data"][0].scrollTop;
|
|
988
991
|
pos.ev = ev;
|
|
989
|
-
|
|
992
|
+
const handler = this["mouse_" + this._mode];
|
|
990
993
|
if (handler) {
|
|
991
994
|
pos = handler.call(this, pos);
|
|
992
995
|
} else {
|
|
993
996
|
if (!this._table_view) {
|
|
994
997
|
pos = this._week_indexes_from_pos(pos);
|
|
995
998
|
} else {
|
|
996
|
-
|
|
999
|
+
const column = this._get_column_index(pos.x);
|
|
997
1000
|
if (!this._cols || !this._colsS)
|
|
998
1001
|
return pos;
|
|
999
|
-
|
|
1002
|
+
let dy = 0;
|
|
1000
1003
|
for (dy = 1; dy < this._colsS.heights.length; dy++)
|
|
1001
1004
|
if (this._colsS.heights[dy] > pos.y)
|
|
1002
1005
|
break;
|
|
@@ -1018,11 +1021,11 @@ function extend$j(scheduler2) {
|
|
|
1018
1021
|
};
|
|
1019
1022
|
scheduler2._close_not_saved = function() {
|
|
1020
1023
|
if ((/* @__PURE__ */ new Date()).valueOf() - (scheduler2._new_event || 0) > 500 && scheduler2._edit_id) {
|
|
1021
|
-
|
|
1022
|
-
scheduler2._dhtmlx_confirm({ message:
|
|
1024
|
+
const confirmationText = scheduler2.locale.labels.confirm_closing;
|
|
1025
|
+
scheduler2._dhtmlx_confirm({ message: confirmationText, title: scheduler2.locale.labels.title_confirm_closing, callback: function() {
|
|
1023
1026
|
scheduler2.editStop(scheduler2.config.positive_closing);
|
|
1024
1027
|
} });
|
|
1025
|
-
if (
|
|
1028
|
+
if (confirmationText) {
|
|
1026
1029
|
this._drag_id = this._drag_pos = this._drag_mode = null;
|
|
1027
1030
|
}
|
|
1028
1031
|
}
|
|
@@ -1037,26 +1040,28 @@ function extend$j(scheduler2) {
|
|
|
1037
1040
|
if (!(old_pos && this._drag_pos)) {
|
|
1038
1041
|
return true;
|
|
1039
1042
|
}
|
|
1040
|
-
|
|
1043
|
+
const delay2 = 100;
|
|
1044
|
+
const d_pos = 5;
|
|
1041
1045
|
return !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || new_pos.timestamp - this._drag_pos.timestamp > delay2 || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));
|
|
1042
1046
|
};
|
|
1043
1047
|
scheduler2._correct_drag_start_date = function(start) {
|
|
1044
|
-
|
|
1048
|
+
let obj;
|
|
1045
1049
|
if (scheduler2.matrix)
|
|
1046
1050
|
obj = scheduler2.matrix[scheduler2._mode];
|
|
1047
1051
|
obj = obj || { x_step: 1, x_unit: "day" };
|
|
1048
1052
|
start = new Date(start);
|
|
1049
|
-
|
|
1053
|
+
let len = 1;
|
|
1050
1054
|
if (obj._start_correction || obj._end_correction)
|
|
1051
1055
|
len = (obj.last_hour || 0) * 60 - (start.getHours() * 60 + start.getMinutes()) || 1;
|
|
1052
1056
|
return start * 1 + (scheduler2._get_fictional_event_length(start, len, obj) - len);
|
|
1053
1057
|
};
|
|
1054
1058
|
scheduler2._correct_drag_end_date = function(start, duration) {
|
|
1055
|
-
|
|
1056
|
-
if (scheduler2.matrix)
|
|
1059
|
+
let obj;
|
|
1060
|
+
if (scheduler2.matrix) {
|
|
1057
1061
|
obj = scheduler2.matrix[scheduler2._mode];
|
|
1062
|
+
}
|
|
1058
1063
|
obj = obj || { x_step: 1, x_unit: "day" };
|
|
1059
|
-
|
|
1064
|
+
const end = start * 1 + scheduler2._get_fictional_event_length(start, duration, obj);
|
|
1060
1065
|
return new Date(end * 1 - (scheduler2._get_fictional_event_length(end, -1, obj, -1) + 1));
|
|
1061
1066
|
};
|
|
1062
1067
|
scheduler2._on_mouse_move = function(e) {
|
|
@@ -1980,9 +1985,9 @@ function extend$j(scheduler2) {
|
|
|
1980
1985
|
const intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));
|
|
1981
1986
|
const intervalEnd = endDate;
|
|
1982
1987
|
const leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);
|
|
1983
|
-
const leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour);
|
|
1988
|
+
const leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour || 24);
|
|
1984
1989
|
const rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);
|
|
1985
|
-
const rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour);
|
|
1990
|
+
const rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour || 24);
|
|
1986
1991
|
if (intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()) {
|
|
1987
1992
|
excludedDuration += intervalEnd - rightCellCutOffEnd;
|
|
1988
1993
|
}
|
|
@@ -2695,7 +2700,7 @@ if (Element.prototype.closest) {
|
|
|
2695
2700
|
};
|
|
2696
2701
|
}
|
|
2697
2702
|
var isWindowAwailable = typeof window !== "undefined";
|
|
2698
|
-
const env = { isIE: isWindowAwailable && (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0),
|
|
2703
|
+
const env = { isIE: isWindowAwailable && (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0), isOpera: isWindowAwailable && navigator.userAgent.indexOf("Opera") >= 0, isChrome: isWindowAwailable && navigator.userAgent.indexOf("Chrome") >= 0, isKHTML: isWindowAwailable && (navigator.userAgent.indexOf("Safari") >= 0 || navigator.userAgent.indexOf("Konqueror") >= 0), isFF: isWindowAwailable && navigator.userAgent.indexOf("Firefox") >= 0, isIPad: isWindowAwailable && navigator.userAgent.search(/iPad/gi) >= 0, isEdge: isWindowAwailable && navigator.userAgent.indexOf("Edge") != -1, isNode: !isWindowAwailable || typeof navigator == "undefined" };
|
|
2699
2704
|
function extend$g(scheduler2) {
|
|
2700
2705
|
scheduler2.destructor = function() {
|
|
2701
2706
|
scheduler2.callEvent("onDestroy", []);
|
|
@@ -3017,10 +3022,10 @@ function extend$e(scheduler2) {
|
|
|
3017
3022
|
};
|
|
3018
3023
|
};
|
|
3019
3024
|
var csp_str_to_date = function(format, utc) {
|
|
3025
|
+
const mask = format.match(/%[a-zA-Z]/g);
|
|
3020
3026
|
return function(date) {
|
|
3021
3027
|
var set = [0, 0, 1, 0, 0, 0];
|
|
3022
3028
|
var temp = date.match(/[a-zA-Z]+|[0-9]+/g);
|
|
3023
|
-
var mask = format.match(/%[a-zA-Z]/g);
|
|
3024
3029
|
for (var i = 0; i < mask.length; i++) {
|
|
3025
3030
|
switch (mask[i]) {
|
|
3026
3031
|
case "%j":
|
|
@@ -3067,18 +3072,23 @@ function extend$e(scheduler2) {
|
|
|
3067
3072
|
return new Date(set[0], set[1], set[2], set[3], set[4], set[5]);
|
|
3068
3073
|
};
|
|
3069
3074
|
};
|
|
3070
|
-
|
|
3071
|
-
|
|
3075
|
+
let cspEnabled = void 0;
|
|
3076
|
+
function checkIfCSPEnabled() {
|
|
3072
3077
|
try {
|
|
3073
|
-
new Function("
|
|
3078
|
+
new Function("cspEnabled = false;");
|
|
3079
|
+
cspEnabled = false;
|
|
3074
3080
|
} catch (e) {
|
|
3075
|
-
|
|
3081
|
+
cspEnabled = true;
|
|
3076
3082
|
}
|
|
3077
|
-
|
|
3083
|
+
return cspEnabled;
|
|
3084
|
+
}
|
|
3078
3085
|
function useCsp() {
|
|
3079
3086
|
var result = false;
|
|
3080
3087
|
if (scheduler2.config.csp === "auto") {
|
|
3081
|
-
|
|
3088
|
+
if (cspEnabled === void 0) {
|
|
3089
|
+
cspEnabled = checkIfCSPEnabled();
|
|
3090
|
+
}
|
|
3091
|
+
result = cspEnabled;
|
|
3082
3092
|
} else {
|
|
3083
3093
|
result = scheduler2.config.csp;
|
|
3084
3094
|
}
|
|
@@ -3093,14 +3103,6 @@ function extend$e(scheduler2) {
|
|
|
3093
3103
|
var t = scheduler2.locale.date.month_full_hash = {};
|
|
3094
3104
|
for (var i = 0; i < s.length; i++)
|
|
3095
3105
|
t[s[i]] = i;
|
|
3096
|
-
}, _bind_host_object: function(method) {
|
|
3097
|
-
if (method.bind) {
|
|
3098
|
-
return method.bind(scheduler2);
|
|
3099
|
-
} else {
|
|
3100
|
-
return function() {
|
|
3101
|
-
return method.apply(scheduler2, arguments);
|
|
3102
|
-
};
|
|
3103
|
-
}
|
|
3104
3106
|
}, date_part: function(date) {
|
|
3105
3107
|
var old = new Date(date);
|
|
3106
3108
|
date.setHours(0);
|
|
@@ -3224,7 +3226,7 @@ function extend$e(scheduler2) {
|
|
|
3224
3226
|
if (utc)
|
|
3225
3227
|
format = format.replace(/date\.get/g, "date.getUTC");
|
|
3226
3228
|
var func = new Function("date", 'return "' + format + '";');
|
|
3227
|
-
return
|
|
3229
|
+
return func.bind(scheduler2);
|
|
3228
3230
|
}, str_to_date: function(format, utc, exactFormat) {
|
|
3229
3231
|
var stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;
|
|
3230
3232
|
var parseExactFormat = stringToDateMethod(format, utc);
|
|
@@ -3920,6 +3922,7 @@ function extend$c(scheduler2) {
|
|
|
3920
3922
|
ev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1e3 * 24 * cols));
|
|
3921
3923
|
var isAnyCellVisible = scheduler2._is_any_multiday_cell_visible(sd, ed, ev);
|
|
3922
3924
|
if (!isAnyCellVisible) {
|
|
3925
|
+
start_date = null;
|
|
3923
3926
|
continue;
|
|
3924
3927
|
}
|
|
3925
3928
|
var stack = weeks[ev._sweek];
|
|
@@ -4920,7 +4923,8 @@ function extend$6(scheduler2) {
|
|
|
4920
4923
|
return node.innerHTML || "";
|
|
4921
4924
|
}, focus: function(node) {
|
|
4922
4925
|
} }, textarea: { render: function(sns) {
|
|
4923
|
-
|
|
4926
|
+
const placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : "";
|
|
4927
|
+
return `<div class='dhx_cal_ltext'><textarea ${placeholder}></textarea></div>`;
|
|
4924
4928
|
}, set_value: function(node, value, ev) {
|
|
4925
4929
|
scheduler2.form_blocks.textarea._get_input(node).value = value || "";
|
|
4926
4930
|
}, get_value: function(node, ev) {
|
|
@@ -7612,7 +7616,7 @@ class DatePicker {
|
|
|
7612
7616
|
}
|
|
7613
7617
|
}
|
|
7614
7618
|
function factoryMethod(extensionManager) {
|
|
7615
|
-
const scheduler2 = { version: "7.0.
|
|
7619
|
+
const scheduler2 = { version: "7.0.4" };
|
|
7616
7620
|
extend$n(scheduler2);
|
|
7617
7621
|
extend$i(scheduler2);
|
|
7618
7622
|
extend$j(scheduler2);
|
|
@@ -8039,6 +8043,11 @@ function agenda_view(scheduler2) {
|
|
|
8039
8043
|
scheduler2._els["dhx_cal_data"][0].innerHTML = html;
|
|
8040
8044
|
}
|
|
8041
8045
|
scheduler2._els["dhx_cal_data"][0].scrollTop = scrollTop;
|
|
8046
|
+
let t = scheduler2._els["dhx_cal_data"][0].querySelectorAll(".dhx_cal_agenda_event_line");
|
|
8047
|
+
scheduler2._rendered = [];
|
|
8048
|
+
for (var i = 0; i < t.length - 1; i++) {
|
|
8049
|
+
scheduler2._rendered[i] = t[i];
|
|
8050
|
+
}
|
|
8042
8051
|
}
|
|
8043
8052
|
function renderEmptyView() {
|
|
8044
8053
|
return `<div class="dhx_cal_agenda_no_events">${scheduler2.locale.labels.agenda_tab}</div>`;
|
|
@@ -9332,7 +9341,7 @@ function marker(scheduler2) {
|
|
|
9332
9341
|
div.style.width = scheduler2._cols[dayIndex] + "px";
|
|
9333
9342
|
div.style.height = (scheduler2._colsS.heights[weekNumber + 1] - top || scheduler2._colsS.height) + "px";
|
|
9334
9343
|
var container = scheduler2.$container.querySelector(".dhx_cal_data");
|
|
9335
|
-
var datatable = container.querySelector("
|
|
9344
|
+
var datatable = container.querySelector(".dhx_cal_month_table");
|
|
9336
9345
|
if (datatable.nextSibling) {
|
|
9337
9346
|
container.insertBefore(div, datatable.nextSibling);
|
|
9338
9347
|
} else {
|
|
@@ -10918,7 +10927,17 @@ function scheduler_handlers(scheduler2) {
|
|
|
10918
10927
|
function mousedownHandler(e) {
|
|
10919
10928
|
if (!scheduler2.config.key_nav)
|
|
10920
10929
|
return true;
|
|
10921
|
-
|
|
10930
|
+
const view = scheduler2.getView();
|
|
10931
|
+
let dataAreaClick = false;
|
|
10932
|
+
if (scheduler2.getState().mode === "month") {
|
|
10933
|
+
dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_cal_month_table"));
|
|
10934
|
+
} else if (view && view.layout === "timeline") {
|
|
10935
|
+
dataAreaClick = scheduler2.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler2.$container.querySelector(".dhx_timeline_data_col"));
|
|
10936
|
+
} else {
|
|
10937
|
+
const listOfScales = scheduler2.$container.querySelectorAll(".dhx_scale_holder");
|
|
10938
|
+
const arrOfScales = Array.from(listOfScales);
|
|
10939
|
+
dataAreaClick = arrOfScales.some((scale) => scale === e.target.parentNode);
|
|
10940
|
+
}
|
|
10922
10941
|
var pos = scheduler2.getActionData(e);
|
|
10923
10942
|
var focusNode;
|
|
10924
10943
|
if (scheduler2._locate_event(e.target || e.srcElement)) {
|