dhtmlx-scheduler 6.0.1 → 6.0.3

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 (30) hide show
  1. package/README.md +7 -2
  2. package/bower.json +1 -1
  3. package/codebase/dhtmlxscheduler.css +2 -2
  4. package/codebase/dhtmlxscheduler.d.ts +1 -1
  5. package/codebase/dhtmlxscheduler.js +2 -2
  6. package/codebase/dhtmlxscheduler.js.map +1 -1
  7. package/codebase/dhtmlxscheduler_contrast_black.css +2 -2
  8. package/codebase/dhtmlxscheduler_contrast_white.css +2 -2
  9. package/codebase/dhtmlxscheduler_flat.css +2 -2
  10. package/codebase/dhtmlxscheduler_material.css +2 -2
  11. package/codebase/dhtmlxscheduler_material_nofont.css +2 -2
  12. package/codebase/dhtmlxscheduler_terrace.css +2 -2
  13. package/codebase/sources/dhtmlxscheduler.css +2 -2
  14. package/codebase/sources/dhtmlxscheduler.js +96 -146
  15. package/codebase/sources/less/package.json +13 -4
  16. package/codebase/sources/less/scripts.js +52 -0
  17. package/codebase/sources/less/skins/basic/skin.less +1 -1
  18. package/codebase/sources/less/skins/contrast_black/skin.less +1 -1
  19. package/codebase/sources/less/skins/flat/skin.less +1 -1
  20. package/codebase/sources/less/skins/material/add_styles.less +6 -6
  21. package/codebase/sources/less/skins/material/skin.less +2 -2
  22. package/codebase/sources/less/skins/terrace/skin.less +1 -1
  23. package/codebase/sources/skins/dhtmlxscheduler_contrast_black.css +2 -2
  24. package/codebase/sources/skins/dhtmlxscheduler_contrast_white.css +2 -2
  25. package/codebase/sources/skins/dhtmlxscheduler_flat.css +2 -2
  26. package/codebase/sources/skins/dhtmlxscheduler_material.css +5 -5
  27. package/codebase/sources/skins/dhtmlxscheduler_material_nofont.css +5 -5
  28. package/codebase/sources/skins/dhtmlxscheduler_terrace.css +2 -2
  29. package/package.json +1 -1
  30. package/whatsnew.md +15 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @license
3
3
  *
4
- * dhtmlxScheduler v.6.0.1 Standard
4
+ * dhtmlxScheduler v.6.0.3 Standard
5
5
  *
6
6
  * To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com
7
7
  *
@@ -5402,9 +5402,9 @@ function extend(scheduler) {
5402
5402
  return ISO8601.test(datestr);
5403
5403
  };
5404
5404
 
5405
- var parseYMD = generateStringToDate("%Y-%m-%d %H:%i:%s", utc);
5406
- var parseMDY = generateStringToDate("%m/%d/%Y %H:%i:%s", utc);
5407
- var parseDMY = generateStringToDate("%d-%m-%Y %H:%i:%s", utc);
5405
+ var parseYMD = stringToDateMethod("%Y-%m-%d %H:%i:%s", utc);
5406
+ var parseMDY = stringToDateMethod("%m/%d/%Y %H:%i:%s", utc);
5407
+ var parseDMY = stringToDateMethod("%d-%m-%Y %H:%i:%s", utc);
5408
5408
  return function (dateString) {
5409
5409
  if (!exactFormat && !scheduler.config.parse_exact_format) {
5410
5410
  if (dateString && dateString.getISOWeek) {
@@ -5772,8 +5772,8 @@ function extend(scheduler) {
5772
5772
  event_attribute: "data-event-id",
5773
5773
  show_errors: true
5774
5774
  };
5775
- scheduler.config.buttons_left.$inital = scheduler.config.buttons_left.join();
5776
- scheduler.config.buttons_right.$inital = scheduler.config.buttons_right.join();
5775
+ scheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();
5776
+ scheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();
5777
5777
  scheduler._helpers = {
5778
5778
  parseDate: function parseDate(date) {
5779
5779
  var parse = scheduler.templates.xml_date || scheduler.templates.parse_date;
@@ -6075,7 +6075,7 @@ DataProcessor.prototype = {
6075
6075
  },
6076
6076
 
6077
6077
  /**
6078
- * @desc: set if rows should be send to server automaticaly
6078
+ * @desc: set if rows should be send to server automatically
6079
6079
  * @param: mode - "row" - based on row selection changed, "cell" - based on cell editing finished, "off" - manual data sending
6080
6080
  * @type: public
6081
6081
  */
@@ -6300,22 +6300,23 @@ DataProcessor.prototype = {
6300
6300
  self.afterUpdateCallback(sid, tid, resultState, tag);
6301
6301
  };
6302
6302
 
6303
+ var routerMode = "event";
6303
6304
  var actionPromise;
6304
6305
 
6305
6306
  if (this._router instanceof Function) {
6306
- actionPromise = this._router("event", action, dataToSend, rowId);
6307
+ actionPromise = this._router(routerMode, action, dataToSend, rowId);
6307
6308
  } else {
6308
6309
  switch (state) {
6309
6310
  case "inserted":
6310
- actionPromise = this._router.create(dataToSend);
6311
+ actionPromise = this._router[routerMode].create(dataToSend);
6311
6312
  break;
6312
6313
 
6313
6314
  case "deleted":
6314
- actionPromise = this._router["delete"](rowId);
6315
+ actionPromise = this._router[routerMode]["delete"](rowId);
6315
6316
  break;
6316
6317
 
6317
6318
  default:
6318
- actionPromise = this._router.update(dataToSend, rowId);
6319
+ actionPromise = this._router[routerMode].update(dataToSend, rowId);
6319
6320
  break;
6320
6321
  }
6321
6322
  }
@@ -6726,8 +6727,8 @@ DataProcessor.prototype = {
6726
6727
  },
6727
6728
 
6728
6729
  /* process updating request answer
6729
- if status == collision version is depricated
6730
- set flag for autoupdating immidiatly
6730
+ if status == collision version is deprecated
6731
+ set flag for autoupdating immediately
6731
6732
  */
6732
6733
  afterAutoUpdate: function afterAutoUpdate(sid, action, tid, xml_node) {
6733
6734
  if (action == 'collision') {
@@ -6929,6 +6930,8 @@ function extend(scheduler) {
6929
6930
  router = config;
6930
6931
  } else if (config.hasOwnProperty("router")) {
6931
6932
  router = config.router;
6933
+ } else if (config.hasOwnProperty("event")) {
6934
+ router = config;
6932
6935
  }
6933
6936
 
6934
6937
  if (router) {
@@ -8981,8 +8984,8 @@ function extend(scheduler) {
8981
8984
 
8982
8985
  var defaults = scheduler._lightbox_controls.defaults.select;
8983
8986
  var defaultHeight = defaults ? defaults.height : 23;
8984
- var height = defaultHeight || 30;
8985
- return "<div style='height:" + height + "px;padding-top:0px;font-size:inherit;' class='dhx_section_time'>" + html + "<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>" + html + "</div>";
8987
+ var height = (sns.height || defaultHeight || 23) + "px";
8988
+ return "<div style='height:" + height + ";padding-top:0px;font-size:inherit;' class='dhx_section_time'>" + html + "<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>" + html + "</div>";
8986
8989
  },
8987
8990
  set_value: function set_value(node, value, ev, config) {
8988
8991
  var cfg = scheduler.config;
@@ -9302,7 +9305,7 @@ function extend(scheduler) {
9302
9305
 
9303
9306
  scheduler.cancel_lightbox = function () {
9304
9307
  if (this._lightbox_id) {
9305
- this.callEvent("onEventCancel", [this._lightbox_id, this._new_event]);
9308
+ this.callEvent("onEventCancel", [this._lightbox_id, !!this._new_event]);
9306
9309
  }
9307
9310
 
9308
9311
  this.hide_lightbox();
@@ -12636,7 +12639,7 @@ function extend(scheduler) {
12636
12639
 
12637
12640
  scheduler._reset_month_scale = function (b, dd, sd, rows) {
12638
12641
  //recalculates rows height and redraws month layout
12639
- var ed = scheduler.date.add(dd, 1, "month"); //trim time part for comparation reasons
12642
+ var ed = scheduler.date.add(dd, 1, "month"); //trim time part for comparison reasons
12640
12643
 
12641
12644
  var cd = scheduler._currentDate();
12642
12645
 
@@ -13134,8 +13137,8 @@ function extend(scheduler) {
13134
13137
  if (scheduler.skin && (scheduler.skin === "classic" || scheduler.skin === "glossy")) set = 1;
13135
13138
 
13136
13139
  if (scheduler._is_material_skin()) {
13137
- var defaultButtonsLeft = scheduler.config.buttons_left.$inital;
13138
- var defaultButtonsRight = scheduler.config.buttons_right.$inital;
13140
+ var defaultButtonsLeft = scheduler.config.buttons_left.$initial;
13141
+ var defaultButtonsRight = scheduler.config.buttons_right.$initial;
13139
13142
 
13140
13143
  if (defaultButtonsLeft && scheduler.config.buttons_left.slice().join() == defaultButtonsLeft && defaultButtonsRight && scheduler.config.buttons_right.slice().join() == defaultButtonsRight) {
13141
13144
  var tmp = scheduler.config.buttons_left.slice();
@@ -15201,7 +15204,7 @@ __webpack_require__.r(__webpack_exports__);
15201
15204
  var is_event_short = function is_event_short(ev) {
15202
15205
  if (!((ev.end_date - ev.start_date) / (1000 * 60 * 60) >= 24)) {
15203
15206
  return true;
15204
- } // short event shouldn't disapear to multiday area during dnd-resize
15207
+ } // short event shouldn't disappear to multiday area during dnd-resize
15205
15208
 
15206
15209
 
15207
15210
  if (scheduler._drag_mode == "resize" && scheduler._drag_id == ev.id) {
@@ -18048,9 +18051,17 @@ __webpack_require__.r(__webpack_exports__);
18048
18051
  nextIndex = view.size && view.position ? view.position : 0;
18049
18052
  }
18050
18053
 
18051
- nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length - 1 : nextIndex;
18054
+ if (nextIndex < 0) {
18055
+ nextIndex = 0;
18056
+ }
18057
+
18052
18058
  var options = view.options || view.y_unit;
18053
18059
 
18060
+ if (nextIndex >= options.length) {
18061
+ nextIndex = options.length - 1;
18062
+ } //nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;
18063
+
18064
+
18054
18065
  if (options[nextIndex]) {
18055
18066
  return options[nextIndex].key;
18056
18067
  } else {
@@ -18087,6 +18098,12 @@ __webpack_require__.r(__webpack_exports__);
18087
18098
  return this.getNodes()[0];
18088
18099
  },
18089
18100
  focus: function focus() {
18101
+ if (this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector("[data-section-id=\"".concat(this.section, "\"]"))) {
18102
+ scheduler.getView().scrollTo({
18103
+ section: this.section
18104
+ });
18105
+ }
18106
+
18090
18107
  scheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);
18091
18108
  scheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);
18092
18109
  scheduler.$keyboardNavigation._pasteDate = this.start_date;
@@ -19126,8 +19143,12 @@ __webpack_require__.r(__webpack_exports__);
19126
19143
 
19127
19144
  var width = Math.max(1, end_pos - start_pos - 1);
19128
19145
  block.style.cssText = "height: " + height + "px; left: " + start_pos + "px; width: " + width + "px; top: " + top + "px;";
19129
- area.appendChild(block);
19130
- blocks.push(block);
19146
+
19147
+ if (area) {
19148
+ area.appendChild(block);
19149
+ blocks.push(block);
19150
+ }
19151
+
19131
19152
  return blocks;
19132
19153
  },
19133
19154
  renderMonthCell: function renderMonthCell(date) {
@@ -19802,7 +19823,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
19802
19823
  for (var i = 0; i < scheduler.layers.length; i++) {
19803
19824
  scheduler.config['lightbox_' + scheduler.layers[i].name] = {};
19804
19825
  scheduler.config['lightbox_' + scheduler.layers[i].name].sections = _cloneObj(scheduler.config.lightbox.sections);
19805
- scheduler._layers_zindex[scheduler.layers[i].name] = scheduler.config.inital_layer_zindex || 5 + i * 3;
19826
+ scheduler._layers_zindex[scheduler.layers[i].name] = scheduler.config.initial_layer_zindex || 5 + i * 3;
19806
19827
 
19807
19828
  if (scheduler.layers[i].url) {
19808
19829
  var dp = scheduler.createDataProcessor({
@@ -21388,7 +21409,7 @@ __webpack_require__.r(__webpack_exports__);
21388
21409
 
21389
21410
  scheduler.config.map_resolve_user_location = true; // if user will be promted to share his location to display it on the map
21390
21411
 
21391
- scheduler.config.map_initial_position = new google.maps.LatLng(48.724, 8.215); // inital position of the map
21412
+ scheduler.config.map_initial_position = new google.maps.LatLng(48.724, 8.215); // initial position of the map
21392
21413
 
21393
21414
  scheduler.config.map_error_position = new google.maps.LatLng(15, 15); // this position will be displayed in case if event doesn't have corresponding coordinates
21394
21415
 
@@ -21397,7 +21418,7 @@ __webpack_require__.r(__webpack_exports__);
21397
21418
  scheduler.config.map_zoom_after_resolve = 15;
21398
21419
  scheduler.locale.labels.marker_geo_success = "It seems you are here.";
21399
21420
  scheduler.locale.labels.marker_geo_fail = "Sorry, could not get your current position using geolocation.";
21400
- scheduler.templates.marker_date = scheduler.date.date_to_str("%Y-%m-%d %H:%i"); // date for map's infowindow will be formated following way
21421
+ scheduler.templates.marker_date = scheduler.date.date_to_str("%Y-%m-%d %H:%i"); // date for map's infowindow will be formatted following way
21401
21422
 
21402
21423
  scheduler.templates.marker_text = function (start, end, ev) {
21403
21424
  return "<div><b>" + ev.text + "</b><br/><br/>" + (ev.event_location || '') + "<br/><br/>" + scheduler.templates.marker_date(start) + " - " + scheduler.templates.marker_date(end) + "</div>";
@@ -21444,7 +21465,7 @@ __webpack_require__.r(__webpack_exports__);
21444
21465
  var gmap = document.createElement('div');
21445
21466
  gmap.className = 'dhx_map';
21446
21467
  gmap.id = 'dhx_gmap';
21447
- gmap.style.dispay = "none";
21468
+ gmap.style.display = "none";
21448
21469
  var node = scheduler._obj;
21449
21470
  node.appendChild(gmap);
21450
21471
  scheduler._els.dhx_gmap = [];
@@ -21454,7 +21475,7 @@ __webpack_require__.r(__webpack_exports__);
21454
21475
  _setMapSize('dhx_gmap');
21455
21476
 
21456
21477
  var mapOptions = {
21457
- zoom: scheduler.config.map_inital_zoom || 10,
21478
+ zoom: scheduler.config.map_initial_zoom || 10,
21458
21479
  center: scheduler.config.map_initial_position,
21459
21480
  mapTypeId: scheduler.config.map_type || google.maps.MapTypeId.ROADMAP
21460
21481
  };
@@ -21657,7 +21678,7 @@ __webpack_require__.r(__webpack_exports__);
21657
21678
  //map tab activated
21658
21679
  clear_map_tab();
21659
21680
  fill_map_tab();
21660
- gmap.style.display = 'block'; // need to resize block everytime window is resized
21681
+ gmap.style.display = 'block'; // need to resize block every time window is resized
21661
21682
 
21662
21683
  _setMapSize('dhx_gmap');
21663
21684
 
@@ -24631,7 +24652,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
24631
24652
 
24632
24653
  for (var i = 0; i < stack.length; i++) {
24633
24654
  if (stack[i].rec_type) {
24634
- //deleted element of serie
24655
+ //deleted element of series
24635
24656
  if (stack[i].rec_pattern != "none") this.repeat_date(stack[i], out);
24636
24657
  } else out.push(stack[i]);
24637
24658
  }
@@ -25582,29 +25603,34 @@ __webpack_require__.r(__webpack_exports__);
25582
25603
  return ev.text;
25583
25604
  };
25584
25605
 
25585
- var is_year_mode = function is_year_mode() {
25606
+ var isYearMode = function isYearMode() {
25586
25607
  return scheduler._mode == "year";
25587
25608
  };
25588
25609
 
25589
- scheduler.dblclick_dhx_month_head = function (e) {
25590
- if (is_year_mode()) {
25591
- var t = e.target || e.srcElement;
25610
+ var getCellDate = function getCellDate(node) {
25611
+ var day = scheduler.$domHelpers.closest(node, "[data-cell-date]");
25612
+ if (!day || !day.hasAttribute("data-cell-date")) return null;
25613
+ return scheduler.templates.parse_date(day.getAttribute("data-cell-date"));
25614
+ }; // dbl click hook for scheduler._on_dbl_click
25592
25615
 
25593
- var className = scheduler._getClassName(t.parentNode);
25594
25616
 
25595
- if (className.indexOf("dhx_before") != -1 || className.indexOf("dhx_after") != -1) return false;
25596
- var monthNode = t;
25617
+ scheduler.dblclick_dhx_month_head = function (e) {
25618
+ if (isYearMode()) {
25619
+ var target = e.target;
25597
25620
 
25598
- while (monthNode && !(monthNode.hasAttribute && monthNode.hasAttribute("date"))) {
25599
- monthNode = monthNode.parentNode;
25621
+ if (scheduler.$domHelpers.closest(target, ".dhx_before") || scheduler.$domHelpers.closest(target, ".dhx_after")) {
25622
+ return false;
25600
25623
  }
25601
25624
 
25602
- if (monthNode) {
25603
- var start = this._helpers.parseDate(monthNode.getAttribute("date"));
25625
+ var date = getCellDate(target);
25604
25626
 
25605
- start.setDate(parseInt(t.innerHTML, 10));
25627
+ if (date) {
25628
+ var start = date;
25606
25629
  var end = this.date.add(start, 1, "day");
25607
- if (!this.config.readonly && this.config.dblclick_create) this.addEventNow(start.valueOf(), end.valueOf(), e);
25630
+
25631
+ if (!this.config.readonly && this.config.dblclick_create) {
25632
+ this.addEventNow(start.valueOf(), end.valueOf(), e);
25633
+ }
25608
25634
  }
25609
25635
  }
25610
25636
  };
@@ -25613,13 +25639,13 @@ __webpack_require__.r(__webpack_exports__);
25613
25639
 
25614
25640
  scheduler.changeEventId = function () {
25615
25641
  chid.apply(this, arguments);
25616
- if (is_year_mode()) this.year_view(true);
25642
+ if (isYearMode()) this.year_view(true);
25617
25643
  };
25618
25644
 
25619
25645
  var old = scheduler.render_data;
25620
25646
 
25621
25647
  scheduler.render_data = function (evs) {
25622
- if (!is_year_mode()) return old.apply(this, arguments);
25648
+ if (!isYearMode()) return old.apply(this, arguments);
25623
25649
 
25624
25650
  for (var i = 0; i < evs.length; i++) {
25625
25651
  this._year_render_event(evs[i]);
@@ -25629,7 +25655,7 @@ __webpack_require__.r(__webpack_exports__);
25629
25655
  var clear = scheduler.clear_view;
25630
25656
 
25631
25657
  scheduler.clear_view = function () {
25632
- if (!is_year_mode()) return clear.apply(this, arguments);
25658
+ if (!isYearMode()) return clear.apply(this, arguments);
25633
25659
  var dates = scheduler._year_marked_cells,
25634
25660
  div = null;
25635
25661
 
@@ -25638,6 +25664,7 @@ __webpack_require__.r(__webpack_exports__);
25638
25664
  div = dates[date];
25639
25665
  div.className = "dhx_month_head";
25640
25666
  div.removeAttribute("date");
25667
+ div.removeAttribute("data-year-date");
25641
25668
  }
25642
25669
  }
25643
25670
 
@@ -25686,11 +25713,11 @@ __webpack_require__.r(__webpack_exports__);
25686
25713
  };
25687
25714
 
25688
25715
  scheduler._year_view_tooltip_handler = function (e) {
25689
- if (!is_year_mode()) return;
25716
+ if (!isYearMode()) return;
25690
25717
  var src = e.target || e.srcElement;
25691
25718
  if (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)
25692
25719
  src = src.parentNode;
25693
- if (scheduler._getClassName(src).indexOf("dhx_year_event") != -1) scheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute("date-year-date")), scheduler.$domHelpers.getOffset(src), e, src);else scheduler._hideToolTip();
25720
+ if (scheduler._getClassName(src).indexOf("dhx_year_event") != -1) scheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute("data-year-date")), scheduler.$domHelpers.getOffset(src), e, src);else scheduler._hideToolTip();
25694
25721
  };
25695
25722
 
25696
25723
  scheduler._init_year_tooltip = function () {
@@ -25700,15 +25727,16 @@ __webpack_require__.r(__webpack_exports__);
25700
25727
  };
25701
25728
 
25702
25729
  scheduler._get_year_cell = function (d) {
25703
- //there can be more than 1 year in view
25704
- //year can start not from January
25705
- var m = d.getMonth() + 12 * (d.getFullYear() - this._min_date.getFullYear()) - this.week_starts._month;
25730
+ var dateString = scheduler.templates.format_date(d);
25731
+ var cells = this.$root.querySelectorAll(".dhx_cal_data [data-cell-date=\"".concat(dateString, "\"] .dhx_month_head"));
25732
+
25733
+ for (var i = 0; i < cells.length; i++) {
25734
+ if (!scheduler.$domHelpers.closest(cells[i], ".dhx_after, .dhx_before")) {
25735
+ return cells[i];
25736
+ }
25737
+ }
25706
25738
 
25707
- var yearBox = this._els["dhx_cal_data"][0].childNodes[m];
25708
- var dayIndex = this.week_starts[m] + d.getDate() - 1;
25709
- var row = yearBox.querySelectorAll(".dhx_year_body tr")[Math.floor(dayIndex / 7)];
25710
- var cell = row.querySelectorAll("td")[dayIndex % 7];
25711
- return cell.querySelector(".dhx_month_head");
25739
+ return null;
25712
25740
  };
25713
25741
 
25714
25742
  scheduler._year_marked_cells = {};
@@ -25725,8 +25753,10 @@ __webpack_require__.r(__webpack_exports__);
25725
25753
  var ev_class = this.templates.event_class(event.start_date, event.end_date, event);
25726
25754
 
25727
25755
  if (!scheduler._year_marked_cells[dateString]) {
25728
- cell.className = "dhx_month_head dhx_year_event";
25729
- cell.setAttribute("date-year-date", dateString);
25756
+ cell.classList.add("dhx_year_event"); // = "dhx_month_head dhx_year_event";
25757
+
25758
+ cell.setAttribute("data-year-date", dateString);
25759
+ cell.setAttribute("date", dateString);
25730
25760
  scheduler._year_marked_cells[dateString] = cell;
25731
25761
  }
25732
25762
 
@@ -25848,6 +25878,7 @@ __webpack_require__.r(__webpack_exports__);
25848
25878
  d.className = "dhx_year_box";
25849
25879
  d.style.cssText = "position:absolute;";
25850
25880
  d.setAttribute("date", this._helpers.formatDate(sd));
25881
+ d.setAttribute("data-month-date", this._helpers.formatDate(sd));
25851
25882
  d.innerHTML = "<div class='dhx_year_month'></div><div class='dhx_year_grid'><div class='dhx_year_week'>" + week_template.innerHTML + "</div><div class='dhx_year_body'></div></div>";
25852
25883
  var header = d.querySelector(".dhx_year_month");
25853
25884
  var grid = d.querySelector(".dhx_year_grid");
@@ -25896,75 +25927,26 @@ __webpack_require__.r(__webpack_exports__);
25896
25927
  var getActionData = scheduler.getActionData;
25897
25928
 
25898
25929
  scheduler.getActionData = function (n_ev) {
25899
- if (!is_year_mode()) return getActionData.apply(scheduler, arguments);
25900
- var trg = n_ev.target;
25901
-
25902
- var date = scheduler._get_year_month_date(trg);
25903
-
25904
- var day = scheduler._get_year_month_cell(trg);
25905
-
25906
- var pos = scheduler._get_year_day_indexes(day);
25907
-
25908
- if (pos && date) {
25909
- date = scheduler.date.add(date, pos.week, "week");
25910
- date = scheduler.date.add(date, pos.day, "day");
25911
- } else {
25912
- date = null;
25930
+ if (!isYearMode()) {
25931
+ return getActionData.apply(scheduler, arguments);
25913
25932
  }
25914
25933
 
25934
+ var date = getCellDate(n_ev.target);
25915
25935
  return {
25916
25936
  date: date,
25917
25937
  section: null
25918
25938
  };
25919
25939
  };
25920
25940
 
25921
- scheduler._get_year_day_indexes = function (targetCell) {
25922
- var month = scheduler._get_year_el_node(targetCell, this._locate_year_month_table);
25923
-
25924
- if (!month) return null;
25925
- var week = 0,
25926
- day = 0;
25927
-
25928
- for (var week = 0, weeks = month.rows.length; week < weeks; week++) {
25929
- var w = month.rows[week].getElementsByTagName("td");
25930
-
25931
- for (var day = 0, days = w.length; day < days; day++) {
25932
- if (w[day] == targetCell) break;
25933
- }
25934
-
25935
- if (day < days) break;
25936
- }
25937
-
25938
- if (week < weeks) return {
25939
- day: day,
25940
- week: week
25941
- };else return null;
25942
- };
25943
-
25944
- scheduler._get_year_month_date = function (node) {
25945
- var node = scheduler._get_year_el_node(node, scheduler._locate_year_month_root);
25946
-
25947
- if (!node) return null;
25948
- var date = node.getAttribute("date-year-date");
25949
- if (!date) return null;
25950
- return scheduler.date.week_start(scheduler.date.month_start(scheduler.templates.parse_date(date)));
25951
- };
25952
-
25953
- scheduler._locate_year_month_day = function (n) {
25954
- return scheduler._getClassName(n).indexOf("dhx_year_event") != -1 && n.hasAttribute && n.hasAttribute("date-year-date");
25955
- };
25956
-
25957
25941
  var locateEvent = scheduler._locate_event;
25958
25942
 
25959
25943
  scheduler._locate_event = function (node) {
25960
25944
  var id = locateEvent.apply(scheduler, arguments);
25961
25945
 
25962
25946
  if (!id) {
25963
- var day = scheduler._get_year_el_node(node, scheduler._locate_year_month_day);
25964
-
25965
- if (!day || !day.hasAttribute("date-year-date")) return null;
25966
- var dat = scheduler.templates.parse_date(day.getAttribute("date-year-date"));
25967
- var evs = scheduler.getEvents(dat, scheduler.date.add(dat, 1, "day"));
25947
+ var date = getCellDate(node);
25948
+ if (!date) return null;
25949
+ var evs = scheduler.getEvents(date, scheduler.date.add(date, 1, "day"));
25968
25950
  if (!evs.length) return null; //can be multiple events in the cell, return any single one
25969
25951
 
25970
25952
  id = evs[0].id;
@@ -25973,38 +25955,6 @@ __webpack_require__.r(__webpack_exports__);
25973
25955
  return id;
25974
25956
  };
25975
25957
 
25976
- scheduler._locate_year_month_cell = function (n) {
25977
- return n.nodeName.toLowerCase() == "td";
25978
- };
25979
-
25980
- scheduler._locate_year_month_table = function (n) {
25981
- return n.nodeName.toLowerCase() == "table";
25982
- };
25983
-
25984
- scheduler._locate_year_month_root = function (n) {
25985
- return n.hasAttribute && n.hasAttribute("date-year-date");
25986
- };
25987
-
25988
- scheduler._get_year_month_cell = function (node) {
25989
- return this._get_year_el_node(node, this._locate_year_month_cell);
25990
- };
25991
-
25992
- scheduler._get_year_month_table = function (node) {
25993
- return this._get_year_el_node(node, this._locate_year_month_table);
25994
- };
25995
-
25996
- scheduler._get_year_month_root = function (node) {
25997
- return this._get_year_el_node(this._get_year_month_table(node), this._locate_year_month_root);
25998
- };
25999
-
26000
- scheduler._get_year_el_node = function (node, condition) {
26001
- while (node && !condition(node)) {
26002
- node = node.parentNode;
26003
- }
26004
-
26005
- return node;
26006
- };
26007
-
26008
25958
  scheduler.attachEvent("onDestroy", function () {
26009
25959
  scheduler._hideToolTip();
26010
25960
  });
@@ -29217,7 +29167,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
29217
29167
 
29218
29168
  /* harmony default export */ __webpack_exports__["default"] = (function (extensionManager) {
29219
29169
  var scheduler = {
29220
- version: "6.0.1"
29170
+ version: "6.0.3"
29221
29171
  };
29222
29172
  Object(_core_common_errors__WEBPACK_IMPORTED_MODULE_2__["default"])(scheduler);
29223
29173
  Object(_core_common__WEBPACK_IMPORTED_MODULE_5__["default"])(scheduler);
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "dhtmlx-scheduler-skins",
3
- "version": "<%= version %>",
3
+ "version": "6.0.3",
4
4
  "description": "Less sources and a build tool for DHTMLXScheduler skins",
5
5
  "scripts": {
6
- "build": "lessc ./dhtmlxscheduler.less ../../dhtmlxscheduler.css && lessc ./dhtmlxscheduler_flat.less ../../dhtmlxscheduler_flat.css && lessc ./dhtmlxscheduler_material.less ../../dhtmlxscheduler_material.css && lessc ./dhtmlxscheduler_terrace.less ../../dhtmlxscheduler_terrace.css && lessc ./dhtmlxscheduler_contrast_white.less ../../dhtmlxscheduler_contrast_white.css && lessc ./dhtmlxscheduler_contrast_black.less ../../dhtmlxscheduler_contrast_black.css",
6
+ "build": "npm run build-default && npm run build-flat && npm run build-material && npm run build-terrace && npm run build-contrast_white && npm run build-contrast_black",
7
+ "build-default": "node scripts.js --file=dhtmlxscheduler",
8
+ "build-flat": "node scripts.js --file=dhtmlxscheduler_flat",
9
+ "build-material": "node scripts.js --file=dhtmlxscheduler_material",
10
+ "build-terrace": "node scripts.js --file=dhtmlxscheduler_terrace",
11
+ "build-contrast_white": "node scripts.js --file=dhtmlxscheduler_contrast_white",
12
+ "build-contrast_black": "node scripts.js --file=dhtmlxscheduler_contrast_black",
7
13
  "watch": "npm-watch build"
8
14
  },
9
15
  "watch":{
@@ -17,11 +23,14 @@
17
23
  "url": "https://github.com/DHTMLX/scheduler"
18
24
  },
19
25
  "author": "XB Software Ltd.",
20
- "license": "<%= license %>",
26
+ "license": "GPL-2.0",
21
27
  "homepage": "https://dhtmlx.com",
22
28
  "dependencies": {
23
29
  "less": "^3.0.4",
24
- "npm-watch": "^0.3.0"
30
+ "minimist": "^1.2.6",
31
+ "npm-watch": "^0.11.0",
32
+ "postcss": "^8.4.14",
33
+ "postcss-url": "^10.1.3"
25
34
  },
26
35
  "devDependencies": {}
27
36
  }
@@ -0,0 +1,52 @@
1
+ const less = require('less')
2
+ const postcss = require('postcss')
3
+ const url = require("postcss-url")
4
+ const fs = require('fs')
5
+
6
+ const argv = require('minimist')(process.argv.slice(2));
7
+
8
+ let themeArg = argv.file;
9
+
10
+ if (!themeArg) {
11
+ throw new Error("Theme root file not specified");
12
+ }
13
+
14
+ const theme = String(themeArg).trim();
15
+ const inputFolder = `./`;
16
+ const inputPath = `${inputFolder}${theme}.less`;
17
+ const outputPath = `../../${theme}.css`;
18
+
19
+
20
+ if (!theme.match(/^[a-zA-Z0-9_\-]+$/)) {
21
+ throw new Error(`Invalid theme root file: ${theme}, a local less file is expected.`);
22
+ }
23
+
24
+ if (!fs.existsSync(inputPath)) {
25
+ throw new Error(`Theme file is not found: ${theme}`);
26
+ }
27
+
28
+ console.log(`Building: ${theme}`);
29
+
30
+ less.render(fs.readFileSync(inputPath, "utf-8"), { rewriteUrls: "all" })
31
+ .then(function (output) {
32
+ runPostCss(output.css,
33
+ inputPath,
34
+ outputPath
35
+ )
36
+ },
37
+ function (error) {
38
+ });
39
+
40
+ function runPostCss(css, from, to) {
41
+ postcss()
42
+ .use(url({
43
+ url: 'inline'
44
+ }))
45
+ .process(css, {
46
+ from: from,
47
+ to: to
48
+ }).then(result => {
49
+ fs.writeFileSync(outputPath, result.css);
50
+ console.log(`Finished: ${theme}`);
51
+ });
52
+ }
@@ -637,7 +637,7 @@
637
637
  @lightbox-area-time-block-padding-left: 0;
638
638
  @lightbox-area-time-block-padding: @lightbox-area-time-block-padding-top @lightbox-area-time-block-padding-right @lightbox-area-time-block-padding-bottom @lightbox-area-time-block-padding-left ~'!important';
639
639
  @lightbox-area-time-block-padding-rtl: @lightbox-area-time-block-padding-top @lightbox-area-time-block-padding-left @lightbox-area-time-block-padding-bottom @lightbox-area-time-block-padding-right ~'!important';
640
- @lightbox-area-time-block-height: 20px ~'!important';
640
+ @lightbox-area-time-block-height: 20px;
641
641
  @lightbox-area-time-block-textaligment: center;
642
642
  @lightbox-responsive-time-select-width: 14.648vw;
643
643
  @lightbox-responsive-time-select-padding:1.953vw !important;
@@ -671,7 +671,7 @@
671
671
  @lightbox-area-time-block-padding-left: 0;
672
672
  @lightbox-area-time-block-padding: @lightbox-area-time-block-padding-top @lightbox-area-time-block-padding-right @lightbox-area-time-block-padding-bottom @lightbox-area-time-block-padding-left ~'!important';
673
673
  @lightbox-area-time-block-padding-rtl: @lightbox-area-time-block-padding-top @lightbox-area-time-block-padding-left @lightbox-area-time-block-padding-bottom @lightbox-area-time-block-padding-right ~'!important';
674
- @lightbox-area-time-block-height: 20px ~'!important';
674
+ @lightbox-area-time-block-height: 20px;
675
675
  @lightbox-area-time-block-textaligment: center;
676
676
 
677
677
 
@@ -603,7 +603,7 @@
603
603
  @lightbox-area-time-block-padding-left: 0;
604
604
  @lightbox-area-time-block-padding: @lightbox-area-time-block-padding-top @lightbox-area-time-block-padding-right @lightbox-area-time-block-padding-bottom @lightbox-area-time-block-padding-left ~'!important';
605
605
  @lightbox-area-time-block-padding-rtl: @lightbox-area-time-block-padding-top @lightbox-area-time-block-padding-left @lightbox-area-time-block-padding-bottom @lightbox-area-time-block-padding-right ~'!important';
606
- @lightbox-area-time-block-height: 20px ~'!important';
606
+ @lightbox-area-time-block-height: 20px;
607
607
  @lightbox-area-time-block-textaligment: center;
608
608
 
609
609