dhtmlx-scheduler 7.0.2 → 7.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.
@@ -4268,7 +4268,7 @@
4268
4268
  cs2 += " " + cse;
4269
4269
  }
4270
4270
  var bg_color = ev.color ? "--dhx-scheduler-event-background:" + ev.color + ";" : "";
4271
- var color = ev.textColor ? "--dhx-scheduler-event-text:" + ev.textColor + ";" : "";
4271
+ var color = ev.textColor ? "--dhx-scheduler-event-color:" + ev.textColor + ";" : "";
4272
4272
  var style_text = ["position:absolute", "top:" + y + "px", "left:" + x + "px", "width:" + (x2 - x - (timed ? 1 : 0)) + "px", "height:" + (this.xy.bar_height - 2) + "px", color, bg_color, ev._text_style || ""].join(";");
4273
4273
  var html = "<div event_id='" + ev.id + "' " + this.config.event_attribute + "='" + ev.id + "' class='" + cs2 + "' style='" + style_text + "'" + this._waiAria.eventBarAttrString(ev) + ">";
4274
4274
  if (resizable) {
@@ -7616,7 +7616,7 @@
7616
7616
  }
7617
7617
  }
7618
7618
  function factoryMethod(extensionManager) {
7619
- const scheduler2 = { version: "7.0.2" };
7619
+ const scheduler2 = { version: "7.0.3" };
7620
7620
  extend$n(scheduler2);
7621
7621
  extend$i(scheduler2);
7622
7622
  extend$j(scheduler2);
@@ -8067,7 +8067,13 @@
8067
8067
  const selectedId = scheduler2.getState().select_id;
8068
8068
  const cls = scheduler2.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);
8069
8069
  const description = scheduler2.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);
8070
- return `<div class="dhx_cal_agenda_event_line ${cls || ""} ${calendarEvent.id == selectedId ? "dhx_cal_agenda_event_line_selected" : ""}" ${scheduler2.config.event_attribute}="${calendarEvent.id}">
8070
+ let style = "";
8071
+ if (calendarEvent.color || calendarEvent.textColor) {
8072
+ const bg = calendarEvent.color ? "--dhx-scheduler-event-background:" + calendarEvent.color + ";" : "";
8073
+ const color = calendarEvent.textColor ? "--dhx-scheduler-event-color:" + calendarEvent.textColor + ";" : "";
8074
+ style = ` style="${bg}${color}" `;
8075
+ }
8076
+ return `<div class="dhx_cal_agenda_event_line ${cls || ""} ${calendarEvent.id == selectedId ? "dhx_cal_agenda_event_line_selected" : ""}" ${style} ${scheduler2.config.event_attribute}="${calendarEvent.id}">
8071
8077
  <div class="dhx_cal_agenda_event_line_marker"></div>
8072
8078
  <div class="dhx_cal_agenda_event_line_time">${dates}</div>
8073
8079
  <div class="dhx_cal_agenda_event_line_text">${description}</div>
@@ -9177,9 +9183,13 @@
9177
9183
  }
9178
9184
  if (section) {
9179
9185
  if (scheduler2.matrix && scheduler2.matrix[mode]) {
9180
- label += ", " + scheduler2.templates[mode + "_scale_label"](section.key, section.label, section);
9186
+ const timeline = scheduler2.matrix[mode];
9187
+ const sectionObject = timeline.y_unit[timeline.order[section]];
9188
+ label += ", " + scheduler2.templates[mode + "_scale_label"](sectionObject.key, sectionObject.label, sectionObject);
9181
9189
  } else if (scheduler2._props && scheduler2._props[mode]) {
9182
- label += ", " + scheduler2.templates[mode + "_scale_text"](section.key, section.label, section);
9190
+ const units = scheduler2._props[mode];
9191
+ const sectionObject = units.options[units.order[section]];
9192
+ label += ", " + scheduler2.templates[mode + "_scale_text"](sectionObject.key, sectionObject.label, sectionObject);
9183
9193
  }
9184
9194
  }
9185
9195
  for (var i = 0; i < divs.length; i++) {
@@ -9251,8 +9261,25 @@
9251
9261
  if (!(min_date < end_date && max_date > start_date))
9252
9262
  return blocks;
9253
9263
  var block = this.createElement();
9254
- var start_pos = scheduler2._timeline_getX({ start_date }, false, view_opts) - 1;
9255
- var end_pos = scheduler2._timeline_getX({ start_date: end_date }, false, view_opts) - 1;
9264
+ let start_pos;
9265
+ let end_pos;
9266
+ function set_date_part(source, target) {
9267
+ target.setDate(1);
9268
+ target.setFullYear(source.getFullYear());
9269
+ target.setMonth(source.getMonth());
9270
+ target.setDate(source.getDate());
9271
+ }
9272
+ if (!scheduler2.getView().days) {
9273
+ start_pos = scheduler2._timeline_getX({ start_date }, false, view_opts);
9274
+ end_pos = scheduler2._timeline_getX({ start_date: end_date }, false, view_opts);
9275
+ } else {
9276
+ const tempStart = new Date(start_date);
9277
+ set_date_part(scheduler2._min_date, tempStart);
9278
+ const tempEnd = new Date(end_date);
9279
+ set_date_part(scheduler2._min_date, tempEnd);
9280
+ start_pos = scheduler2._timeline_getX({ start_date: tempStart }, false, view_opts);
9281
+ end_pos = scheduler2._timeline_getX({ start_date: tempEnd }, false, view_opts);
9282
+ }
9256
9283
  var height = view_opts._section_height[section] - 1 || view_opts.dy - 1;
9257
9284
  var top = 0;
9258
9285
  if (scheduler2._isRender("cell")) {
@@ -12184,6 +12211,9 @@
12184
12211
  return divs;
12185
12212
  };
12186
12213
  scheduler2.markTimespan = function(configuration) {
12214
+ if (!this._els) {
12215
+ throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.");
12216
+ }
12187
12217
  var rebuild_els = false;
12188
12218
  if (!this._els["dhx_cal_data"]) {
12189
12219
  scheduler2.get_elements();