@xpyjs/gantt-core 0.0.2 → 0.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.
package/dist/x-gantt.js CHANGED
@@ -1,12 +1,12 @@
1
- var Yt = Object.defineProperty;
2
- var Ut = (f, t, e) => t in f ? Yt(f, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[t] = e;
3
- var h = (f, t, e) => Ut(f, typeof t != "symbol" ? t + "" : t, e);
4
- import R from "dayjs";
5
- import { default as li } from "dayjs";
6
- import { merge as at, isArray as X, isString as V, isFunction as j, cloneDeep as J, isObject as Ct, remove as st, isNumber as Xt, omit as wt, throttle as bt, isBoolean as lt, debounce as Vt } from "lodash-es";
1
+ var Ut = Object.defineProperty;
2
+ var Xt = (f, t, e) => t in f ? Ut(f, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[t] = e;
3
+ var h = (f, t, e) => Xt(f, typeof t != "symbol" ? t + "" : t, e);
4
+ import H from "dayjs";
5
+ import { default as ci } from "dayjs";
6
+ import { merge as at, isArray as X, isString as V, isFunction as j, cloneDeep as J, isObject as Mt, remove as st, isNumber as Vt, omit as bt, throttle as vt, isBoolean as ct, debounce as Kt } from "lodash-es";
7
7
  import k from "konva";
8
- const Mt = "0.0.2";
9
- function Kt() {
8
+ const Ot = "0.0.3";
9
+ function jt() {
10
10
  const f = "#eca710", t = "#ffffff", e = "#e7209e", i = "#ffffff", s = "#1c42e8";
11
11
  [
12
12
  " __ __ _____ _____ _____ _____ _____ ",
@@ -19,7 +19,7 @@ function Kt() {
19
19
  `color: ${f}; font-weight: bold; font-family: monospace;`
20
20
  );
21
21
  }), console.log(
22
- `%c 🚀 欢迎使用 XGantt %c Version: ${Mt} `,
22
+ `%c 🚀 欢迎使用 XGantt %c Version: ${Ot} `,
23
23
  `background-color: ${e}; color: ${t}; padding: 2px 4px; border-radius: 6px 0 0 6px; font-weight: bold; margin: 4px 0;`,
24
24
  `background-color: ${s}; color: ${i}; padding: 2px 4px; border-radius: 0 6px 6px 0; font-weight: normal; margin: 4px 0;`
25
25
  );
@@ -114,7 +114,7 @@ const P = class P {
114
114
  */
115
115
  static formatArgs(...t) {
116
116
  const e = [P.Prefix];
117
- return P.options.showTimestamp && e.unshift(`[${R().format("YYYY-MM-DD HH:mm:ss.SSS")}]`), [e.join(""), ...t];
117
+ return P.options.showTimestamp && e.unshift(`[${H().format("YYYY-MM-DD HH:mm:ss.SSS")}]`), [e.join(""), ...t];
118
118
  }
119
119
  };
120
120
  h(P, "Prefix", "[XGantt]"), h(P, "options", {
@@ -123,8 +123,8 @@ h(P, "Prefix", "[XGantt]"), h(P, "options", {
123
123
  // 默认不显示时间戳
124
124
  showTimestamp: !1
125
125
  });
126
- let O = P;
127
- const ct = () => ({
126
+ let L = P;
127
+ const dt = () => ({
128
128
  data: [],
129
129
  links: {
130
130
  show: !1,
@@ -275,9 +275,14 @@ const ct = () => ({
275
275
  border: {
276
276
  color: "#e5e5e5"
277
277
  },
278
+ collapse: {
279
+ show: !0,
280
+ backgroundColor: "#fff",
281
+ radius: 6
282
+ },
278
283
  header: {
279
284
  height: 80,
280
- color: "#000",
285
+ color: "auto",
281
286
  fontSize: 14,
282
287
  fontWeight: 600,
283
288
  fontFamily: "Arial"
@@ -321,20 +326,20 @@ const ct = () => ({
321
326
  opacity: 0.1
322
327
  }
323
328
  });
324
- class jt {
329
+ class qt {
325
330
  constructor() {
326
- h(this, "options", ct());
331
+ h(this, "options", dt());
327
332
  }
328
333
  getOptions() {
329
334
  return this.options;
330
335
  }
331
336
  setOptions(t, e = { merge: !0 }) {
332
337
  var i;
333
- if (this.options = e.merge ? at(ct(), this.options, t) : at(ct(), t), (i = t.holiday) != null && i.holidays && t.holiday.holidays.length > 0) {
338
+ if (this.options = e.merge ? at(dt(), this.options, t) : at(dt(), t), (i = t.holiday) != null && i.holidays && t.holiday.holidays.length > 0) {
334
339
  const s = [];
335
340
  t.holiday.holidays.forEach((n) => {
336
341
  if (X(n.date)) {
337
- const o = n.date.map((r) => R(r)).sort((r, a) => r.diff(a));
342
+ const o = n.date.map((r) => H(r)).sort((r, a) => r.diff(a));
338
343
  for (let r = 1; r < o.length; r++)
339
344
  if (o[r].diff(o[r - 1], "day") > 1) {
340
345
  s.push({
@@ -365,7 +370,7 @@ class jt {
365
370
  return j(t) ? t(e.getEmitData()) : t;
366
371
  }
367
372
  }
368
- class qt {
373
+ class Qt {
369
374
  constructor() {
370
375
  h(this, "events", /* @__PURE__ */ new Map());
371
376
  }
@@ -406,7 +411,7 @@ class qt {
406
411
  this.events.clear();
407
412
  }
408
413
  }
409
- var S = /* @__PURE__ */ ((f) => (f.LOADED = "loaded", f.COLUMN_WIDTH_CHANGE = "column-width-change", f.MOVE_GUIDELINE = "move-guideline", f.SHOW_GUIDELINE = "show-guideline", f.HIDE_GUIDELINE = "hide-guideline", f.TOGGLE_COLLAPSE = "toggle-collapse", f.SCROLL = "scroll", f.CHART_OFFSET_CHANGE = "chart_offset_change", f.DATA_UPDATE = "data-update", f.VIEW_UPDATE = "view-update", f.UPDATE_TABLE_HEADER = "update_table_header", f.UPDATE_TABLE_BODY = "update_table_body", f.UPDATE_CHART_HEADER = "update_chart_header", f.UPDATE_TASK = "update_task", f.UPDATE_LINK = "update_link", f.CREATE_LINK = "create_link", f.TASK_SELECTED = "task_selected", f.TASK_UNSELECTED = "task_unselected", f.SELECT_LINK = "select_link", f.CHECK_TASK = "check_task", f.CONTEXT_LINK = "context_link", f.ROW_CLICK = "row-click", f.ROW_DBL_CLICK = "row-dbl-click", f.ROW_CONTEXTMENU = "row-contextmenu", f.SLIDER_CLICK = "slider-click", f.SLIDER_DBL_CLICK = "slider-dbl-click", f.SLIDER_CONTEXTMENU = "slider-contextmenu", f.SLIDER_DRAGGING = "slider-dragging", f.SLIDER_ENTER = "slider-enter", f.SLIDER_HOVER = "slider-hover", f.SLIDER_LEAVE = "slider-leave", f.SLIDER_BLINK = "slider-blink", f.LINK_BLINK = "link-blink", f.ROW_HIGHLIGHT = "row-highlight", f.ROW_UNHIGHLIGHT = "row-unhighlight", f.TASK_DRAG_START = "task-drag-start", f.TASK_DRAG_MOVE = "task-drag-move", f.TASK_DRAG_END = "task-drag-end", f.BASELINE_CLICK = "baseline-click", f.BASELINE_CONTEXTMENU = "baseline-contextmenu", f.BASELINE_MOUSEENTER = "baseline-mouseenter", f.BASELINE_MOUSEMOVE = "baseline-mousemove", f.BASELINE_MOUSEOUT = "baseline-mouseout", f.ROW_DRAG_START = "row-drag-start", f.ROW_DRAGGING = "row-dragging", f.ROW_DRAG_END = "row-drag-end", f.ERROR = "error", f))(S || {}), Y = /* @__PURE__ */ ((f) => (f.INVALID_TYPE = "INVALID_TYPE", f.TASK_NOT_FOUND = "TASK_NOT_FOUND", f.LINK_NOT_ALLOWED = "LINK_NOT_ALLOWED", f.LINK_SAME = "LINK_SAME", f.LINK_EXIST = "LINK_EXIST", f.LINK_INVALID_ARG = "LINK_INVALID_ARG", f.LINK_CYCLE = "LINK_CYCLE", f))(Y || {});
414
+ var S = /* @__PURE__ */ ((f) => (f.LOADED = "loaded", f.COLUMN_WIDTH_CHANGE = "column-width-change", f.MOVE_GUIDELINE = "move-guideline", f.SHOW_GUIDELINE = "show-guideline", f.HIDE_GUIDELINE = "hide-guideline", f.TOGGLE_COLLAPSE = "toggle-collapse", f.SCROLL = "scroll", f.CHART_OFFSET_CHANGE = "chart_offset_change", f.DATA_UPDATE = "data-update", f.VIEW_UPDATE = "view-update", f.OPTIONS_UPDATE = "options-update", f.UPDATE_TABLE_HEADER = "update_table_header", f.UPDATE_TABLE_BODY = "update_table_body", f.UPDATE_CHART_HEADER = "update_chart_header", f.UPDATE_TASK = "update_task", f.UPDATE_LINK = "update_link", f.CREATE_LINK = "create_link", f.TASK_SELECTED = "task_selected", f.TASK_UNSELECTED = "task_unselected", f.SELECT_LINK = "select_link", f.CHECK_TASK = "check_task", f.CONTEXT_LINK = "context_link", f.ROW_CLICK = "row-click", f.ROW_DBL_CLICK = "row-dbl-click", f.ROW_CONTEXTMENU = "row-contextmenu", f.SLIDER_CLICK = "slider-click", f.SLIDER_DBL_CLICK = "slider-dbl-click", f.SLIDER_CONTEXTMENU = "slider-contextmenu", f.SLIDER_DRAGGING = "slider-dragging", f.SLIDER_ENTER = "slider-enter", f.SLIDER_HOVER = "slider-hover", f.SLIDER_LEAVE = "slider-leave", f.SLIDER_BLINK = "slider-blink", f.LINK_BLINK = "link-blink", f.ROW_HIGHLIGHT = "row-highlight", f.ROW_UNHIGHLIGHT = "row-unhighlight", f.TASK_DRAG_START = "task-drag-start", f.TASK_DRAG_MOVE = "task-drag-move", f.TASK_DRAG_END = "task-drag-end", f.BASELINE_CLICK = "baseline-click", f.BASELINE_CONTEXTMENU = "baseline-contextmenu", f.BASELINE_MOUSEENTER = "baseline-mouseenter", f.BASELINE_MOUSEMOVE = "baseline-mousemove", f.BASELINE_MOUSEOUT = "baseline-mouseout", f.ROW_DRAG_START = "row-drag-start", f.ROW_DRAGGING = "row-dragging", f.ROW_DRAG_END = "row-drag-end", f.ERROR = "error", f))(S || {}), Y = /* @__PURE__ */ ((f) => (f.INVALID_TYPE = "INVALID_TYPE", f.TASK_NOT_FOUND = "TASK_NOT_FOUND", f.LINK_NOT_ALLOWED = "LINK_NOT_ALLOWED", f.LINK_SAME = "LINK_SAME", f.LINK_EXIST = "LINK_EXIST", f.LINK_INVALID_ARG = "LINK_INVALID_ARG", f.LINK_CYCLE = "LINK_CYCLE", f))(Y || {});
410
415
  function Q() {
411
416
  return Math.random().toString(36).substring(2, 15);
412
417
  }
@@ -420,7 +425,7 @@ function ot(f, t) {
420
425
  let e = f;
421
426
  return V(e) && (/%$/.test(e) ? e = t * parseFloat(e) / 100 : e = parseFloat(e)), isNaN(e) ? 0 : e;
422
427
  }
423
- function dt(f, t, e = "round") {
428
+ function ut(f, t, e = "round") {
424
429
  if (t === 0)
425
430
  throw new Error("基准值不能为0");
426
431
  if (Math.abs(f) <= t / 2)
@@ -436,19 +441,19 @@ function rt(f, t = 4) {
436
441
  f[3] ?? t
437
442
  ] : [t, t, t, t];
438
443
  }
439
- function Qt(f, t = 100) {
444
+ function Zt(f, t = 100) {
440
445
  if (!Number.isFinite(f) || !Number.isFinite(t) || t === 0 || f < 0)
441
446
  return 0;
442
447
  const e = f / Math.abs(t);
443
448
  return Math.min(e, 1);
444
449
  }
445
- function ft(f, t = 2, e = !1) {
450
+ function pt(f, t = 2, e = !1) {
446
451
  const i = f.toFixed(t);
447
452
  return e ? i : i.replace(/\.?0+$/, "");
448
453
  }
449
- const ut = /* @__PURE__ */ new Map();
450
- function vt(f, t = 16, e = 16) {
451
- const i = ut.get(f);
454
+ const gt = /* @__PURE__ */ new Map();
455
+ function Tt(f, t = 16, e = 16) {
456
+ const i = gt.get(f);
452
457
  if (i) return i;
453
458
  const s = new Promise((n, o) => {
454
459
  let r = f;
@@ -467,14 +472,14 @@ function vt(f, t = 16, e = 16) {
467
472
  c.onload = () => {
468
473
  URL.revokeObjectURL(c.src), n(c);
469
474
  }, c.onerror = (l) => {
470
- URL.revokeObjectURL(c.src), ut.delete(f), o(l);
475
+ URL.revokeObjectURL(c.src), gt.delete(f), o(l);
471
476
  };
472
477
  const u = new Blob([r], { type: "image/svg+xml" }), d = URL.createObjectURL(u);
473
478
  c.src = d;
474
479
  });
475
- return ut.set(f, s), s;
480
+ return gt.set(f, s), s;
476
481
  }
477
- class xt {
482
+ class yt {
478
483
  constructor(t, e, i, s, n) {
479
484
  h(this, "__key__", Q());
480
485
  /**
@@ -549,12 +554,12 @@ class xt {
549
554
  return;
550
555
  i = i[n];
551
556
  }
552
- return Ct(i) ? J(i) : i;
557
+ return Mt(i) ? J(i) : i;
553
558
  }
554
559
  /** 切换展示模式时,需要调整时间 */
555
560
  updateMode() {
556
561
  let t = !1, e = !1;
557
- return this.data[this.fields.startTime] && (!this.startTime || !this.startTime.isSame(R(this.data[this.fields.startTime]))) && (this.startTime = R(this.data[this.fields.startTime]), t = !0, e = !0), this.data[this.fields.endTime] && (!this.endTime || !this.endTime.isSame(R(this.data[this.fields.endTime]))) && (this.endTime = R(this.data[this.fields.endTime]), t = !0, e = !0), e && this.store.updateTime(this.startTime, this.endTime), this.startTime && this.endTime && this.duration === 0 && (this.duration = this.endTime.diff(this.startTime)), this.isMilestone() && (!this.endTime || !this.endTime.isSame(this.startTime)) && (this.endTime = this.startTime, t = !0), t;
562
+ return this.data[this.fields.startTime] && (!this.startTime || !this.startTime.isSame(H(this.data[this.fields.startTime]))) && (this.startTime = H(this.data[this.fields.startTime]), t = !0, e = !0), this.data[this.fields.endTime] && (!this.endTime || !this.endTime.isSame(H(this.data[this.fields.endTime]))) && (this.endTime = H(this.data[this.fields.endTime]), t = !0, e = !0), e && this.store.updateTime(this.startTime, this.endTime), this.startTime && this.endTime && this.duration === 0 && (this.duration = this.endTime.diff(this.startTime)), this.isMilestone() && (!this.endTime || !this.endTime.isSame(this.startTime)) && (this.endTime = this.startTime, t = !0), t;
558
563
  }
559
564
  updateData(t) {
560
565
  this.data = t;
@@ -568,7 +573,7 @@ class xt {
568
573
  this.data[this.fields.startTime || "startTime"] = this.startTime.format(i), this.isMilestone() ? this.data[this.fields.endTime || "endTime"] = this.startTime.add(this.duration).format(i) : this.data[this.fields.endTime || "endTime"] = this.endTime.format(i), this.event.emit(S.UPDATE_TASK, this);
569
574
  }
570
575
  clone() {
571
- return new xt(
576
+ return new yt(
572
577
  this.store,
573
578
  this.event,
574
579
  J(this.data),
@@ -607,7 +612,7 @@ class xt {
607
612
  return !1;
608
613
  }
609
614
  }
610
- class Zt {
615
+ class Jt {
611
616
  constructor(t, e, i) {
612
617
  /** 基线ID */
613
618
  h(this, "id");
@@ -629,9 +634,9 @@ class Zt {
629
634
  const s = this.store.getOptionManager().getOptions().fields, n = this.store.getOptionManager().getOptions().baselines.fields;
630
635
  this.taskId = i[t.getOptionManager().getOptions().baselines.taskKey], this.id = i[s.id] || i[n.id] || Q(), this.name = i[s.name] || i[n.name] || "", this.highlight = i[n.highlight] !== !1, this.target = i[n.target] === !0;
631
636
  const o = i[s.startTime] || i[n.startTime];
632
- o && (this.startTime = R(o));
637
+ o && (this.startTime = H(o));
633
638
  const r = i[s.endTime] || i[n.endTime];
634
- r && (this.endTime = R(r)), this.data = i;
639
+ r && (this.endTime = H(r)), this.data = i;
635
640
  }
636
641
  getField(t) {
637
642
  return this.data[t];
@@ -653,7 +658,7 @@ class Zt {
653
658
  return { startDiff: i, endDiff: s, startStatus: o, endStatus: r, progressDiff: u, unit: e };
654
659
  }
655
660
  }
656
- class Jt {
661
+ class te {
657
662
  constructor(t, e) {
658
663
  /**
659
664
  * 原始数据
@@ -702,38 +707,36 @@ class Jt {
702
707
  initTasks(t = !1) {
703
708
  t ? (this.dataLevel = 0, this.tasks = [], this.taskMap.clear(), this.collapsedTaskIds.clear(), this.rawData.forEach((e) => {
704
709
  this.tasks.push(this.createTask(e));
705
- })) : (this.dataLevel = 0, this.tasks = [], this.taskMap.clear(), this.rawData.forEach((e) => {
706
- this.tasks.push(this.createTask(e));
707
- }));
710
+ })) : this.rawData.length > 0 ? (this.dataLevel = 0, this.updateTask(this.rawData, this.tasks)) : (this.tasks = [], this.taskMap.clear(), this.collapsedTaskIds.clear(), this.dataLevel = 0);
708
711
  }
709
712
  createTask(t, e, i = !0) {
710
- const s = this.store.getOptionManager().getOptions().fields, n = new xt(this.store, this.event, t, e);
713
+ const s = this.store.getOptionManager().getOptions().fields, n = new yt(this.store, this.event, t, e);
711
714
  return i && Array.isArray(t[s.children]) && (n.children = t[s.children].map(
712
715
  (o) => this.createTask(o, n)
713
716
  )), this.taskMap.set(n.id, n), this.dataLevel = Math.max(this.dataLevel, n.level), n;
714
717
  }
715
718
  updateTask(t, e, i) {
716
- let s = 0;
717
- for (; s < t.length; ) {
718
- const n = t[s], o = e[s];
719
- if (n && !o) {
720
- const a = this.createTask(n, i, !1);
721
- e.push(a), this.dataLevel = Math.max(this.dataLevel, a.level);
722
- } else !n && o ? e.splice(s, 1) : n && o && (n[this.store.getOptionManager().getOptions().fields.id] === o.id ? (o.updateData(n), this.taskMap.set(o.id, o), this.dataLevel = Math.max(this.dataLevel, o.level)) : (e[s] = this.createTask(n, o.parent, !1), this.dataLevel = Math.max(this.dataLevel, e[s].level)));
723
- const r = n[this.store.getOptionManager().getOptions().fields.children];
724
- if (r)
725
- if (o && o.children)
726
- this.updateTask(r, o.children, o);
727
- else {
728
- const a = r.map(
729
- (c) => this.createTask(c, e[s], !1)
730
- );
731
- e[s].children = a;
732
- }
733
- else o && o.children && (o.children = []);
734
- s++;
719
+ const s = this.store.getOptionManager().getOptions(), n = s.fields.id, o = s.fields.children, r = /* @__PURE__ */ new Map();
720
+ e.forEach((a) => r.set(a.id, a)), e.length = 0;
721
+ for (const a of t) {
722
+ const c = a[n];
723
+ let u = r.get(c);
724
+ u ? (u.updateData(a), u.parent = i, r.delete(c)) : u = this.createTask(a, i, !1), u.level = i ? i.level + 1 : 0, this.dataLevel = Math.max(this.dataLevel, u.level);
725
+ const d = a[o];
726
+ Array.isArray(d) && d.length > 0 ? (u.children || (u.children = []), this.updateTask(d, u.children, u)) : u.children && u.children.length > 0 && (this.removeTasksRecursive(u.children), u.children = []), e.push(u);
735
727
  }
736
- e.length >= s && e.splice(s);
728
+ r.size > 0 && this.removeTasksRecursive(Array.from(r.values()));
729
+ }
730
+ /**
731
+ * 递归清理任务(从全局 Map、选中状态等中移除)
732
+ * 这是一个内部辅助方法,不触发视图更新事件,仅清理数据引用
733
+ */
734
+ removeTasksRecursive(t) {
735
+ t.forEach((e) => {
736
+ this.taskMap.delete(e.id), this.collapsedTaskIds.delete(e.id), this.selectedTaskId === e.id && (this.selectedTaskId = null, this.event.emit(S.TASK_UNSELECTED, e.id));
737
+ const i = this.checkedList.findIndex((s) => s.id === e.id);
738
+ i !== -1 && this.checkedList.splice(i, 1), e.children && e.children.length > 0 && this.removeTasksRecursive(e.children);
739
+ });
737
740
  }
738
741
  /**
739
742
  * 获取源数据
@@ -969,7 +972,7 @@ class Jt {
969
972
  setBaselines(t) {
970
973
  this.baselines = [], this.baselineMap.clear(), this.baselineTaskMap.clear(), t.forEach((e) => {
971
974
  var s, n;
972
- const i = new Zt(this.store, this.event, e);
975
+ const i = new Jt(this.store, this.event, e);
973
976
  this.baselines.push(i), this.baselineMap.set(i.id, i), this.baselineTaskMap.has(i.taskId) || this.baselineTaskMap.set(i.taskId, []), i.target ? (s = this.baselineTaskMap.get(i.taskId)) == null || s.unshift(i) : (n = this.baselineTaskMap.get(i.taskId)) == null || n.push(i);
974
977
  });
975
978
  }
@@ -985,7 +988,7 @@ class Jt {
985
988
  return this.baselineTaskMap.get(t) || [];
986
989
  }
987
990
  }
988
- function te(f) {
991
+ function ee(f) {
989
992
  var s;
990
993
  if (typeof f == "object" && f !== null)
991
994
  return {
@@ -995,7 +998,7 @@ function te(f) {
995
998
  a: $(f.a ?? 1, 0, 1)
996
999
  };
997
1000
  if (typeof f != "string")
998
- return O.warn(`Invalid color value type: ${typeof f}`), null;
1001
+ return L.warn(`Invalid color value type: ${typeof f}`), null;
999
1002
  let t = f.trim();
1000
1003
  const e = (s = document == null ? void 0 : document.createElement("canvas")) == null ? void 0 : s.getContext("2d");
1001
1004
  if (e && (e.fillStyle = t, t = e.fillStyle), t.startsWith("#")) {
@@ -1004,7 +1007,7 @@ function te(f) {
1004
1007
  try {
1005
1008
  o = parseInt(n, 16);
1006
1009
  } catch {
1007
- return O.warn(`Invalid hex color: ${f}`), null;
1010
+ return L.warn(`Invalid hex color: ${f}`), null;
1008
1011
  }
1009
1012
  if (n.length === 3)
1010
1013
  r = (o >> 8 & 15) * 17, a = (o >> 4 & 15) * 17, c = (o & 15) * 17;
@@ -1013,7 +1016,7 @@ function te(f) {
1013
1016
  else if (n.length === 8)
1014
1017
  r = o >> 24 & 255, a = o >> 16 & 255, c = o >> 8 & 255, u = (o & 255) / 255;
1015
1018
  else
1016
- return O.warn(`Invalid hex color length: ${f}`), null;
1019
+ return L.warn(`Invalid hex color length: ${f}`), null;
1017
1020
  return { r, g: a, b: c, a: u };
1018
1021
  }
1019
1022
  let i = t.match(
@@ -1028,9 +1031,9 @@ function te(f) {
1028
1031
  a: i[4] !== void 0 ? $(parseFloat(i[4]), 0, 1) : 1
1029
1032
  };
1030
1033
  }
1031
- return O.warn(`Could not parse color: ${f}`), null;
1034
+ return L.warn(`Could not parse color: ${f}`), null;
1032
1035
  }
1033
- function ee(f, t, e, i, s = !1, n = !1) {
1036
+ function ie(f, t, e, i, s = !1, n = !1) {
1034
1037
  const o = (l) => {
1035
1038
  const m = Math.round($(l, 0, 255)).toString(16);
1036
1039
  return m.length === 1 ? "0" + m : m;
@@ -1054,8 +1057,8 @@ class et {
1054
1057
  h(this, "_g");
1055
1058
  h(this, "_b");
1056
1059
  h(this, "_a");
1057
- const e = te(t);
1058
- e === null ? (O.error(`Failed to parse color: ${t}. Using default black.`), this._r = 0, this._g = 0, this._b = 0, this._a = 1) : (this._r = Math.round(e.r), this._g = Math.round(e.g), this._b = Math.round(e.b), this._a = e.a);
1060
+ const e = ee(t);
1061
+ e === null ? (L.error(`Failed to parse color: ${t}. Using default black.`), this._r = 0, this._g = 0, this._b = 0, this._a = 1) : (this._r = Math.round(e.r), this._g = Math.round(e.g), this._b = Math.round(e.b), this._a = e.a);
1059
1062
  }
1060
1063
  // --- Getters ---
1061
1064
  /** 获取 Red 通道值 (0-255) */
@@ -1094,7 +1097,7 @@ class et {
1094
1097
  * @returns Hex/HexA 字符串。
1095
1098
  */
1096
1099
  toHex(t = !1, e = !1) {
1097
- return ee(
1100
+ return ie(
1098
1101
  this._r,
1099
1102
  this._g,
1100
1103
  this._b,
@@ -1201,12 +1204,12 @@ class et {
1201
1204
  * @param option - 传递给插件的选项 (可选)。
1202
1205
  */
1203
1206
  static extend(t, e) {
1204
- typeof t == "function" ? t(e, et, B) : O.warn(
1207
+ typeof t == "function" ? t(e, et, B) : L.warn(
1205
1208
  "Invalid plugin provided to Colorjs.extend. Expected a function."
1206
1209
  );
1207
1210
  }
1208
1211
  }
1209
- const B = (f) => f instanceof et ? f : new et(f);
1212
+ const B = (f) => f instanceof et ? f : new et(f), ht = (f, t) => f.toLowerCase() === "auto" ? B(t).isLight() ? "#000000" : "#FFFFFF" : f;
1210
1213
  class Lt {
1211
1214
  constructor(t, e, i) {
1212
1215
  h(this, "element");
@@ -1366,8 +1369,8 @@ class Lt {
1366
1369
  this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element);
1367
1370
  }
1368
1371
  }
1369
- const Tt = "handler_column";
1370
- class ie {
1372
+ const St = "handler_column";
1373
+ class se {
1371
1374
  constructor(t) {
1372
1375
  /** 源列数据 */
1373
1376
  h(this, "sourceColumns", []);
@@ -1377,6 +1380,8 @@ class ie {
1377
1380
  h(this, "leafColumns", []);
1378
1381
  /** 临时叶子列数据,用于更新源数据,读取宽度等原信息 */
1379
1382
  h(this, "temporaryLeafColumns", []);
1383
+ /** 记录每一列的列宽 */
1384
+ h(this, "columnWidths", /* @__PURE__ */ new Map());
1380
1385
  /**
1381
1386
  * 保存所有行列合并的信息
1382
1387
  *
@@ -1406,7 +1411,7 @@ class ie {
1406
1411
  r ? c = `group-${o}` : c = `field-${n.field}`;
1407
1412
  const u = [...(i == null ? void 0 : i.path) || [], c];
1408
1413
  c = "column-" + o + "-" + u.join("-");
1409
- const d = n.label || (a ? n.field : ""), l = a ? ((p = this.temporaryLeafColumns.find((g) => g.key === c)) == null ? void 0 : p.width) || n.width || 100 : "auto", m = {
1414
+ const d = n.label || (a ? n.field : ""), l = this.columnWidths.get(c) ?? (a ? ((p = this.temporaryLeafColumns.find((g) => g.key === c)) == null ? void 0 : p.width) || n.width || 100 : "auto"), m = {
1410
1415
  label: d,
1411
1416
  level: s,
1412
1417
  maxLevel: s,
@@ -1455,13 +1460,13 @@ class ie {
1455
1460
  return this.isCollapsed() ? 0 : this.leafColumns.reduce((t, e) => t + e.width, this.getHandlerColumn().width);
1456
1461
  }
1457
1462
  getColumnWidth(t) {
1458
- if (t === Tt) return this.getHandlerColumn().width;
1463
+ if (t === St) return this.getHandlerColumn().width;
1459
1464
  const e = this.leafColumns.find((i) => i.key === t);
1460
1465
  return typeof (e == null ? void 0 : e.width) == "number" ? e.width : 0;
1461
1466
  }
1462
1467
  setColumnWidth(t, e) {
1463
1468
  const i = this.leafColumns.find((s) => s.key === t);
1464
- i && (i.width = e), this.context.event.emit(S.COLUMN_WIDTH_CHANGE, t, e);
1469
+ i && (i.width = e, this.columnWidths.set(t, e)), this.context.event.emit(S.COLUMN_WIDTH_CHANGE, t, e);
1465
1470
  }
1466
1471
  isLastColumn(t) {
1467
1472
  return this.leafColumns.findIndex((i) => i.key === t) === this.leafColumns.length - 1;
@@ -1500,7 +1505,7 @@ class ie {
1500
1505
  },
1501
1506
  children: [],
1502
1507
  path: [],
1503
- key: Tt,
1508
+ key: St,
1504
1509
  isLeaf: !0,
1505
1510
  width: t
1506
1511
  };
@@ -1602,23 +1607,23 @@ const tt = class tt {
1602
1607
  return !t || t.from == null || t.to == null ? {
1603
1608
  ok: !1,
1604
1609
  reason: Y.LINK_INVALID_ARG,
1605
- message: O.getMessage("Missing endpoint")
1610
+ message: L.getMessage("Missing endpoint")
1606
1611
  } : t.from === t.to ? {
1607
1612
  ok: !1,
1608
1613
  reason: Y.LINK_SAME,
1609
- message: O.getMessage("Cannot link task to itself")
1614
+ message: L.getMessage("Cannot link task to itself")
1610
1615
  } : !this.getTask(t.from) || !this.getTask(t.to) ? {
1611
1616
  ok: !1,
1612
1617
  reason: Y.TASK_NOT_FOUND,
1613
- message: O.getMessage("Task not found")
1618
+ message: L.getMessage("Task not found")
1614
1619
  } : t.type && !this.validateLinkType(t.type) ? {
1615
1620
  ok: !1,
1616
1621
  reason: Y.INVALID_TYPE,
1617
- message: O.getMessage(`Invalid link type: ${t.type}. It must be one of: ${Object.keys(tt.LINK_TYPE_MAP).join(", ")}`)
1622
+ message: L.getMessage(`Invalid link type: ${t.type}. It must be one of: ${Object.keys(tt.LINK_TYPE_MAP).join(", ")}`)
1618
1623
  } : this.isLinkExist(t.from, t.to, t.type) ? {
1619
1624
  ok: !1,
1620
1625
  reason: Y.LINK_EXIST,
1621
- message: O.getMessage("Link already exists")
1626
+ message: L.getMessage("Link already exists")
1622
1627
  } : { ok: !0 };
1623
1628
  }
1624
1629
  /** 校验新增连线是否会产生环 */
@@ -1631,7 +1636,7 @@ const tt = class tt {
1631
1636
  return {
1632
1637
  ok: !1,
1633
1638
  reason: Y.LINK_CYCLE,
1634
- message: O.getMessage("Adding this link would create a cycle"),
1639
+ message: L.getMessage("Adding this link would create a cycle"),
1635
1640
  cycleInfo: o
1636
1641
  };
1637
1642
  }
@@ -1732,8 +1737,8 @@ const tt = class tt {
1732
1737
  else {
1733
1738
  for (const E of C) {
1734
1739
  const T = r(E, v, b);
1735
- for (const L of T)
1736
- M.push([x, ...L]);
1740
+ for (const O of T)
1741
+ M.push([x, ...O]);
1737
1742
  }
1738
1743
  M.length === 0 && (M = [[x]]);
1739
1744
  }
@@ -1752,8 +1757,8 @@ const tt = class tt {
1752
1757
  else {
1753
1758
  for (const E of C) {
1754
1759
  const T = a(E, v, b);
1755
- for (const L of T)
1756
- M.push([...L, x]);
1760
+ for (const O of T)
1761
+ M.push([...O, x]);
1757
1762
  }
1758
1763
  M.length === 0 && (M = [[x]]);
1759
1764
  }
@@ -1769,8 +1774,8 @@ const tt = class tt {
1769
1774
  for (let C = 0; C < w.length - 1; C++) {
1770
1775
  const M = w[C].id, E = w[C + 1].id, T = this.findLinkFast(M, E);
1771
1776
  if (T) {
1772
- const L = `${T.from}-${T.to}-${T.type || "default"}`;
1773
- m.has(L) || (b.push(T), m.set(L, T));
1777
+ const O = `${T.from}-${T.to}-${T.type || "default"}`;
1778
+ m.has(O) || (b.push(T), m.set(O, T));
1774
1779
  }
1775
1780
  }
1776
1781
  }
@@ -1828,7 +1833,7 @@ const tt = class tt {
1828
1833
  cycles: u,
1829
1834
  nodes: Array.from(new Set(c.flat()))
1830
1835
  };
1831
- return this.lastCycleReport = d, t && d.hasCycle && O.warn("Cycle detected in task dependencies", d), d;
1836
+ return this.lastCycleReport = d, t && d.hasCycle && L.warn("Cycle detected in task dependencies", d), d;
1832
1837
  }
1833
1838
  /** 获取最近一次环检测报告 */
1834
1839
  getCycleReport() {
@@ -2129,12 +2134,12 @@ h(tt, "LINK_TYPE_MAP", {
2129
2134
  FF: { from: "F", to: "F", description: "结束到结束" },
2130
2135
  SS: { from: "S", to: "S", description: "开始到开始" }
2131
2136
  });
2132
- let pt = tt;
2137
+ let mt = tt;
2133
2138
  var N = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2134
2139
  function U(f) {
2135
2140
  return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
2136
2141
  }
2137
- var Ot = { exports: {} };
2142
+ var Dt = { exports: {} };
2138
2143
  (function(f, t) {
2139
2144
  (function(e, i) {
2140
2145
  f.exports = i();
@@ -2154,20 +2159,20 @@ var Ot = { exports: {} };
2154
2159
  }, b = function(M, E) {
2155
2160
  return M ? y(M) ? { negative: !0, format: "" + v(M) + E } : { negative: !1, format: "" + M + E } : { negative: !1, format: "" };
2156
2161
  }, w = function() {
2157
- function M(T, L, A) {
2158
- var _ = this;
2159
- if (this.$d = {}, this.$l = A, T === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), L) return p(T * l[g(L)], this);
2162
+ function M(T, O, A) {
2163
+ var D = this;
2164
+ if (this.$d = {}, this.$l = A, T === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), O) return p(T * l[g(O)], this);
2160
2165
  if (typeof T == "number") return this.$ms = T, this.parseFromMilliseconds(), this;
2161
2166
  if (typeof T == "object") return Object.keys(T).forEach(function(W) {
2162
- _.$d[g(W)] = T[W];
2167
+ D.$d[g(W)] = T[W];
2163
2168
  }), this.calMilliseconds(), this;
2164
2169
  if (typeof T == "string") {
2165
- var D = T.match(d);
2166
- if (D) {
2167
- var H = D.slice(2).map(function(W) {
2170
+ var _ = T.match(d);
2171
+ if (_) {
2172
+ var R = _.slice(2).map(function(W) {
2168
2173
  return W != null ? Number(W) : 0;
2169
2174
  });
2170
- return this.$d.years = H[0], this.$d.months = H[1], this.$d.weeks = H[2], this.$d.days = H[3], this.$d.hours = H[4], this.$d.minutes = H[5], this.$d.seconds = H[6], this.calMilliseconds(), this;
2175
+ return this.$d.years = R[0], this.$d.months = R[1], this.$d.weeks = R[2], this.$d.days = R[3], this.$d.hours = R[4], this.$d.minutes = R[5], this.$d.seconds = R[6], this.calMilliseconds(), this;
2171
2176
  }
2172
2177
  }
2173
2178
  return this;
@@ -2175,39 +2180,39 @@ var Ot = { exports: {} };
2175
2180
  var E = M.prototype;
2176
2181
  return E.calMilliseconds = function() {
2177
2182
  var T = this;
2178
- this.$ms = Object.keys(this.$d).reduce(function(L, A) {
2179
- return L + (T.$d[A] || 0) * l[A];
2183
+ this.$ms = Object.keys(this.$d).reduce(function(O, A) {
2184
+ return O + (T.$d[A] || 0) * l[A];
2180
2185
  }, 0);
2181
2186
  }, E.parseFromMilliseconds = function() {
2182
2187
  var T = this.$ms;
2183
2188
  this.$d.years = x(T / c), T %= c, this.$d.months = x(T / u), T %= u, this.$d.days = x(T / r), T %= r, this.$d.hours = x(T / o), T %= o, this.$d.minutes = x(T / n), T %= n, this.$d.seconds = x(T / s), T %= s, this.$d.milliseconds = T;
2184
2189
  }, E.toISOString = function() {
2185
- var T = b(this.$d.years, "Y"), L = b(this.$d.months, "M"), A = +this.$d.days || 0;
2190
+ var T = b(this.$d.years, "Y"), O = b(this.$d.months, "M"), A = +this.$d.days || 0;
2186
2191
  this.$d.weeks && (A += 7 * this.$d.weeks);
2187
- var _ = b(A, "D"), D = b(this.$d.hours, "H"), H = b(this.$d.minutes, "M"), W = this.$d.seconds || 0;
2192
+ var D = b(A, "D"), _ = b(this.$d.hours, "H"), R = b(this.$d.minutes, "M"), W = this.$d.seconds || 0;
2188
2193
  this.$d.milliseconds && (W += this.$d.milliseconds / 1e3, W = Math.round(1e3 * W) / 1e3);
2189
- var I = b(W, "S"), G = T.negative || L.negative || _.negative || D.negative || H.negative || I.negative, F = D.format || H.format || I.format ? "T" : "", z = (G ? "-" : "") + "P" + T.format + L.format + _.format + F + D.format + H.format + I.format;
2194
+ var I = b(W, "S"), G = T.negative || O.negative || D.negative || _.negative || R.negative || I.negative, F = _.format || R.format || I.format ? "T" : "", z = (G ? "-" : "") + "P" + T.format + O.format + D.format + F + _.format + R.format + I.format;
2190
2195
  return z === "P" || z === "-P" ? "P0D" : z;
2191
2196
  }, E.toJSON = function() {
2192
2197
  return this.toISOString();
2193
2198
  }, E.format = function(T) {
2194
- var L = T || "YYYY-MM-DDTHH:mm:ss", A = { Y: this.$d.years, YY: i.s(this.$d.years, 2, "0"), YYYY: i.s(this.$d.years, 4, "0"), M: this.$d.months, MM: i.s(this.$d.months, 2, "0"), D: this.$d.days, DD: i.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: i.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: i.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: i.s(this.$d.seconds, 2, "0"), SSS: i.s(this.$d.milliseconds, 3, "0") };
2195
- return L.replace(a, function(_, D) {
2196
- return D || String(A[_]);
2199
+ var O = T || "YYYY-MM-DDTHH:mm:ss", A = { Y: this.$d.years, YY: i.s(this.$d.years, 2, "0"), YYYY: i.s(this.$d.years, 4, "0"), M: this.$d.months, MM: i.s(this.$d.months, 2, "0"), D: this.$d.days, DD: i.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: i.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: i.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: i.s(this.$d.seconds, 2, "0"), SSS: i.s(this.$d.milliseconds, 3, "0") };
2200
+ return O.replace(a, function(D, _) {
2201
+ return _ || String(A[D]);
2197
2202
  });
2198
2203
  }, E.as = function(T) {
2199
2204
  return this.$ms / l[g(T)];
2200
2205
  }, E.get = function(T) {
2201
- var L = this.$ms, A = g(T);
2202
- return A === "milliseconds" ? L %= 1e3 : L = A === "weeks" ? x(L / l[A]) : this.$d[A], L || 0;
2203
- }, E.add = function(T, L, A) {
2204
- var _;
2205
- return _ = L ? T * l[g(L)] : m(T) ? T.$ms : p(T, this).$ms, p(this.$ms + _ * (A ? -1 : 1), this);
2206
- }, E.subtract = function(T, L) {
2207
- return this.add(T, L, !0);
2206
+ var O = this.$ms, A = g(T);
2207
+ return A === "milliseconds" ? O %= 1e3 : O = A === "weeks" ? x(O / l[A]) : this.$d[A], O || 0;
2208
+ }, E.add = function(T, O, A) {
2209
+ var D;
2210
+ return D = O ? T * l[g(O)] : m(T) ? T.$ms : p(T, this).$ms, p(this.$ms + D * (A ? -1 : 1), this);
2211
+ }, E.subtract = function(T, O) {
2212
+ return this.add(T, O, !0);
2208
2213
  }, E.locale = function(T) {
2209
- var L = this.clone();
2210
- return L.$l = T, L;
2214
+ var O = this.clone();
2215
+ return O.$l = T, O;
2211
2216
  }, E.clone = function() {
2212
2217
  return p(this.$ms, this);
2213
2218
  }, E.humanize = function(T) {
@@ -2251,22 +2256,22 @@ var Ot = { exports: {} };
2251
2256
  return M.add(E.years() * T, "y").add(E.months() * T, "M").add(E.days() * T, "d").add(E.hours() * T, "h").add(E.minutes() * T, "m").add(E.seconds() * T, "s").add(E.milliseconds() * T, "ms");
2252
2257
  };
2253
2258
  return function(M, E, T) {
2254
- e = T, i = T().$utils(), T.duration = function(_, D) {
2255
- var H = T.locale();
2256
- return p(_, { $l: H }, D);
2259
+ e = T, i = T().$utils(), T.duration = function(D, _) {
2260
+ var R = T.locale();
2261
+ return p(D, { $l: R }, _);
2257
2262
  }, T.isDuration = m;
2258
- var L = E.prototype.add, A = E.prototype.subtract;
2259
- E.prototype.add = function(_, D) {
2260
- return m(_) ? C(this, _, 1) : L.bind(this)(_, D);
2261
- }, E.prototype.subtract = function(_, D) {
2262
- return m(_) ? C(this, _, -1) : A.bind(this)(_, D);
2263
+ var O = E.prototype.add, A = E.prototype.subtract;
2264
+ E.prototype.add = function(D, _) {
2265
+ return m(D) ? C(this, D, 1) : O.bind(this)(D, _);
2266
+ }, E.prototype.subtract = function(D, _) {
2267
+ return m(D) ? C(this, D, -1) : A.bind(this)(D, _);
2263
2268
  };
2264
2269
  };
2265
2270
  });
2266
- })(Ot);
2267
- var se = Ot.exports;
2268
- const ne = /* @__PURE__ */ U(se);
2269
- var Dt = { exports: {} };
2271
+ })(Dt);
2272
+ var ne = Dt.exports;
2273
+ const oe = /* @__PURE__ */ U(ne);
2274
+ var _t = { exports: {} };
2270
2275
  (function(f, t) {
2271
2276
  (function(e, i) {
2272
2277
  f.exports = i();
@@ -2278,10 +2283,10 @@ var Dt = { exports: {} };
2278
2283
  };
2279
2284
  };
2280
2285
  });
2281
- })(Dt);
2282
- var oe = Dt.exports;
2283
- const re = /* @__PURE__ */ U(oe);
2284
- var _t = { exports: {} };
2286
+ })(_t);
2287
+ var re = _t.exports;
2288
+ const ae = /* @__PURE__ */ U(re);
2289
+ var At = { exports: {} };
2285
2290
  (function(f, t) {
2286
2291
  (function(e, i) {
2287
2292
  f.exports = i();
@@ -2292,10 +2297,10 @@ var _t = { exports: {} };
2292
2297
  };
2293
2298
  };
2294
2299
  });
2295
- })(_t);
2296
- var ae = _t.exports;
2297
- const he = /* @__PURE__ */ U(ae);
2298
- var At = { exports: {} };
2300
+ })(At);
2301
+ var he = At.exports;
2302
+ const le = /* @__PURE__ */ U(he);
2303
+ var It = { exports: {} };
2299
2304
  (function(f, t) {
2300
2305
  (function(e, i) {
2301
2306
  f.exports = i();
@@ -2306,10 +2311,10 @@ var At = { exports: {} };
2306
2311
  };
2307
2312
  };
2308
2313
  });
2309
- })(At);
2310
- var le = At.exports;
2311
- const ce = /* @__PURE__ */ U(le);
2312
- var It = { exports: {} };
2314
+ })(It);
2315
+ var ce = It.exports;
2316
+ const de = /* @__PURE__ */ U(ce);
2317
+ var Ht = { exports: {} };
2313
2318
  (function(f, t) {
2314
2319
  (function(e, i) {
2315
2320
  f.exports = i();
@@ -2384,10 +2389,10 @@ var It = { exports: {} };
2384
2389
  };
2385
2390
  };
2386
2391
  });
2387
- })(It);
2388
- var de = It.exports;
2389
- const ue = /* @__PURE__ */ U(de);
2390
- var Ht = { exports: {} };
2392
+ })(Ht);
2393
+ var ue = Ht.exports;
2394
+ const ge = /* @__PURE__ */ U(ue);
2395
+ var Rt = { exports: {} };
2391
2396
  (function(f, t) {
2392
2397
  (function(e, i) {
2393
2398
  f.exports = i();
@@ -2409,10 +2414,10 @@ var Ht = { exports: {} };
2409
2414
  };
2410
2415
  };
2411
2416
  });
2412
- })(Ht);
2413
- var ge = Ht.exports;
2414
- const fe = /* @__PURE__ */ U(ge);
2415
- var Rt = { exports: {} };
2417
+ })(Rt);
2418
+ var fe = Rt.exports;
2419
+ const pe = /* @__PURE__ */ U(fe);
2420
+ var Gt = { exports: {} };
2416
2421
  (function(f, t) {
2417
2422
  (function(e, i) {
2418
2423
  f.exports = i();
@@ -2424,10 +2429,10 @@ var Rt = { exports: {} };
2424
2429
  };
2425
2430
  };
2426
2431
  });
2427
- })(Rt);
2428
- var pe = Rt.exports;
2429
- const me = /* @__PURE__ */ U(pe);
2430
- var Gt = { exports: {} };
2432
+ })(Gt);
2433
+ var me = Gt.exports;
2434
+ const xe = /* @__PURE__ */ U(me);
2435
+ var Wt = { exports: {} };
2431
2436
  (function(f, t) {
2432
2437
  (function(e, i) {
2433
2438
  f.exports = i();
@@ -2474,10 +2479,10 @@ var Gt = { exports: {} };
2474
2479
  };
2475
2480
  };
2476
2481
  });
2477
- })(Gt);
2478
- var xe = Gt.exports;
2479
- const ye = /* @__PURE__ */ U(xe);
2480
- var Wt = { exports: {} };
2482
+ })(Wt);
2483
+ var ye = Wt.exports;
2484
+ const we = /* @__PURE__ */ U(ye);
2485
+ var $t = { exports: {} };
2481
2486
  (function(f, t) {
2482
2487
  (function(e, i) {
2483
2488
  f.exports = i();
@@ -2491,10 +2496,10 @@ var Wt = { exports: {} };
2491
2496
  };
2492
2497
  };
2493
2498
  });
2494
- })(Wt);
2495
- var we = Wt.exports;
2496
- const be = /* @__PURE__ */ U(we);
2497
- var $t = { exports: {} };
2499
+ })($t);
2500
+ var be = $t.exports;
2501
+ const ve = /* @__PURE__ */ U(be);
2502
+ var Ft = { exports: {} };
2498
2503
  (function(f, t) {
2499
2504
  (function(e, i) {
2500
2505
  f.exports = i();
@@ -2520,10 +2525,10 @@ var $t = { exports: {} };
2520
2525
  };
2521
2526
  };
2522
2527
  });
2523
- })($t);
2524
- var ve = $t.exports;
2525
- const Te = /* @__PURE__ */ U(ve);
2526
- var Ft = { exports: {} };
2528
+ })(Ft);
2529
+ var Te = Ft.exports;
2530
+ const Se = /* @__PURE__ */ U(Te);
2531
+ var Bt = { exports: {} };
2527
2532
  (function(f, t) {
2528
2533
  (function(e, i) {
2529
2534
  f.exports = i();
@@ -2570,10 +2575,10 @@ var Ft = { exports: {} };
2570
2575
  var g = p && m, y = p || m || r, x = c(+o(), y);
2571
2576
  if (typeof l != "string") return o(l).tz(y);
2572
2577
  var v = function(M, E, T) {
2573
- var L = M - 60 * E * 1e3, A = c(L, T);
2574
- if (E === A) return [L, E];
2575
- var _ = c(L -= 60 * (A - E) * 1e3, T);
2576
- return A === _ ? [L, A] : [M - 60 * Math.min(A, _) * 1e3, Math.max(A, _)];
2578
+ var O = M - 60 * E * 1e3, A = c(O, T);
2579
+ if (E === A) return [O, E];
2580
+ var D = c(O -= 60 * (A - E) * 1e3, T);
2581
+ return A === D ? [O, A] : [M - 60 * Math.min(A, D) * 1e3, Math.max(A, D)];
2577
2582
  }(o.utc(l, g).valueOf(), x, y), b = v[0], w = v[1], C = o(b).utcOffset(w);
2578
2583
  return C.$x.$timezone = y, C;
2579
2584
  }, o.tz.guess = function() {
@@ -2583,10 +2588,10 @@ var Ft = { exports: {} };
2583
2588
  };
2584
2589
  };
2585
2590
  });
2586
- })(Ft);
2587
- var Se = Ft.exports;
2588
- const ke = /* @__PURE__ */ U(Se);
2589
- var Bt = { exports: {} };
2591
+ })(Bt);
2592
+ var ke = Bt.exports;
2593
+ const Ee = /* @__PURE__ */ U(ke);
2594
+ var zt = { exports: {} };
2590
2595
  (function(f, t) {
2591
2596
  (function(e, i) {
2592
2597
  f.exports = i();
@@ -2622,8 +2627,8 @@ var Bt = { exports: {} };
2622
2627
  C === void 0 && (C = "");
2623
2628
  var M = C.match(i);
2624
2629
  if (!M) return null;
2625
- var E = ("" + M[0]).match(s) || ["-", 0, 0], T = E[0], L = 60 * +E[1] + +E[2];
2626
- return L === 0 ? 0 : T === "+" ? L : -L;
2630
+ var E = ("" + M[0]).match(s) || ["-", 0, 0], T = E[0], O = 60 * +E[1] + +E[2];
2631
+ return O === 0 ? 0 : T === "+" ? O : -O;
2627
2632
  }(g), g === null)) return this;
2628
2633
  var v = Math.abs(g) <= 16 ? 60 * g : g, b = this;
2629
2634
  if (y) return b.$offset = v, b.$u = g === 0, b;
@@ -2659,10 +2664,10 @@ var Bt = { exports: {} };
2659
2664
  };
2660
2665
  };
2661
2666
  });
2662
- })(Bt);
2663
- var Ee = Bt.exports;
2664
- const Ce = /* @__PURE__ */ U(Ee);
2665
- var Me = { exports: {} };
2667
+ })(zt);
2668
+ var Ce = zt.exports;
2669
+ const Me = /* @__PURE__ */ U(Ce);
2670
+ var Oe = { exports: {} };
2666
2671
  (function(f, t) {
2667
2672
  (function(e, i) {
2668
2673
  f.exports = i();
@@ -2672,11 +2677,11 @@ var Me = { exports: {} };
2672
2677
  return "[" + e + (i[(s - 20) % 10] || i[s] || i[0]) + "]";
2673
2678
  } };
2674
2679
  });
2675
- })(Me);
2680
+ })(Oe);
2676
2681
  var Le = { exports: {} };
2677
2682
  (function(f, t) {
2678
2683
  (function(e, i) {
2679
- f.exports = i(R);
2684
+ f.exports = i(H);
2680
2685
  })(N, function(e) {
2681
2686
  function i(o) {
2682
2687
  return o && typeof o == "object" && "default" in o ? o : { default: o };
@@ -2690,39 +2695,39 @@ var Le = { exports: {} };
2690
2695
  return s.default.locale(n, null, !0), n;
2691
2696
  });
2692
2697
  })(Le);
2693
- const Oe = (f, t) => {
2698
+ const De = (f, t) => {
2694
2699
  const e = t.prototype;
2695
2700
  e.setLocale = function(s) {
2696
- return this.$locale = s || R().locale(), this.$L = this.$locale, this;
2701
+ return this.$locale = s || H().locale(), this.$L = this.$locale, this;
2697
2702
  };
2698
2703
  const i = e.format;
2699
2704
  e.format = function(s) {
2700
- return this.$L = R().locale(), i.bind(this)(s);
2705
+ return this.$L = H().locale(), i.bind(this)(s);
2701
2706
  };
2702
2707
  };
2703
- R.extend(ne);
2704
- R.extend(re);
2705
- R.extend(he);
2706
- R.extend(ce);
2707
- R.extend(fe);
2708
- R.extend(ue);
2709
- R.extend(me);
2710
- R.extend(ye);
2711
- R.extend(be);
2712
- R.extend(Te);
2713
- R.extend(ke);
2714
- R.extend(Ce);
2715
- R.extend(Oe);
2716
- function St(f) {
2708
+ H.extend(oe);
2709
+ H.extend(ae);
2710
+ H.extend(le);
2711
+ H.extend(de);
2712
+ H.extend(pe);
2713
+ H.extend(ge);
2714
+ H.extend(xe);
2715
+ H.extend(we);
2716
+ H.extend(ve);
2717
+ H.extend(Se);
2718
+ H.extend(Ee);
2719
+ H.extend(Me);
2720
+ H.extend(De);
2721
+ function kt(f) {
2717
2722
  try {
2718
- if (R.locale() === f) return;
2719
- if (R.locale(f) !== f) throw Error();
2720
- O.info(`Locale set to ${f}`);
2723
+ if (H.locale() === f) return;
2724
+ if (H.locale(f) !== f) throw Error();
2725
+ L.info(`Locale set to ${f}`);
2721
2726
  } catch {
2722
- O.warn(`Failed to set locale ${f}, fallback to en`), R.locale("en");
2727
+ L.warn(`Failed to set locale ${f}, fallback to en`), H.locale("en");
2723
2728
  }
2724
2729
  }
2725
- const gt = () => ({
2730
+ const ft = () => ({
2726
2731
  small: {
2727
2732
  hour: 15,
2728
2733
  day: 15,
@@ -2745,12 +2750,12 @@ const gt = () => ({
2745
2750
  quarter: 14
2746
2751
  }
2747
2752
  });
2748
- class De {
2753
+ class _e {
2749
2754
  constructor() {
2750
- h(this, "startTime", R().startOf("day"));
2751
- h(this, "endTime", R().endOf("day"));
2755
+ h(this, "startTime", H().startOf("day"));
2756
+ h(this, "endTime", H().endOf("day"));
2752
2757
  /** 结束的标准时间。切换单位会影响结尾的扩展,需要单独记录一个标准时间 */
2753
- h(this, "targetEnd", R().endOf("day"));
2758
+ h(this, "targetEnd", H().endOf("day"));
2754
2759
  /** 固定起始日期 */
2755
2760
  h(this, "strictStart", !1);
2756
2761
  /** 固定截止日期 */
@@ -2771,7 +2776,7 @@ class De {
2771
2776
  h(this, "cellWidth");
2772
2777
  /** 用户设定的单位 */
2773
2778
  h(this, "unit", "day");
2774
- this.cellWidth = J(gt().normal);
2779
+ this.cellWidth = J(ft().normal);
2775
2780
  }
2776
2781
  getStartTime() {
2777
2782
  return this.startTime;
@@ -2829,15 +2834,15 @@ class De {
2829
2834
  month: "month",
2830
2835
  quarter: "quarter"
2831
2836
  }[i];
2832
- n || O.warn(`Unknown unit: [${i}]. Falling back to "day".`), this.unit = n || "day", s.startTime && (this.startTime = R(s.startTime).startOf(this.getFinelyUnit()), this.strictStart = !0), s.endTime && (this.endTime = R(s.endTime).endOf(this.getFinelyUnit()), this.strictEnd = !0), s.cellWidth && (Xt(s.cellWidth) ? this.cellWidth = {
2837
+ n || L.warn(`Unknown unit: [${i}]. Falling back to "day".`), this.unit = n || "day", s.startTime && (this.startTime = H(s.startTime).startOf(this.getFinelyUnit()), this.strictStart = !0), s.endTime && (this.endTime = H(s.endTime).endOf(this.getFinelyUnit()), this.strictEnd = !0), s.cellWidth && (Vt(s.cellWidth) ? this.cellWidth = {
2833
2838
  hour: s.cellWidth,
2834
2839
  day: s.cellWidth,
2835
2840
  week: s.cellWidth,
2836
2841
  month: s.cellWidth,
2837
2842
  quarter: s.cellWidth
2838
2843
  } : V(s.cellWidth) ? this.cellWidth = J(
2839
- gt()[s.cellWidth] || gt().normal
2840
- ) : Ct(s.cellWidth) && (this.cellWidth = Object.assign(this.cellWidth, s.cellWidth))), this.headerCellFormat = s.headerCellFormat, this.headerGroupFormat = s.headerGroupFormat;
2844
+ ft()[s.cellWidth] || ft().normal
2845
+ ) : Mt(s.cellWidth) && (this.cellWidth = Object.assign(this.cellWidth, s.cellWidth))), this.headerCellFormat = s.headerCellFormat, this.headerGroupFormat = s.headerGroupFormat;
2841
2846
  }
2842
2847
  update(t) {
2843
2848
  this.init(t, !1), this.endTime = this.targetEnd.clone();
@@ -2970,7 +2975,7 @@ class De {
2970
2975
  return t.isSameOrAfter(this.startTime) && t.isSameOrBefore(this.endTime);
2971
2976
  }
2972
2977
  }
2973
- class _e {
2978
+ class Ae {
2974
2979
  // 使用私有构造函数防止直接创建实例
2975
2980
  constructor(t, e) {
2976
2981
  // 声明成员属性类型
@@ -2981,10 +2986,10 @@ class _e {
2981
2986
  h(this, "timeAxis");
2982
2987
  var n, o, r;
2983
2988
  this.context = t;
2984
- const i = wt(e, ["data"]), s = e == null ? void 0 : e.data;
2989
+ const i = bt(e, ["data"]), s = e == null ? void 0 : e.data;
2985
2990
  if (s && !X(s))
2986
- throw O.exception("Data should be a array.");
2987
- this.optionManager = new jt(), this.optionManager.setOptions(i), i.locale && St(i.locale), this.timeAxis = new De(), this.timeAxis.init(this.optionManager.getOptions()), this.columnManager = new ie(this.context), i.table && i.table.columns && this.columnManager.init(i.table.columns), this.dataManager = new Jt(this, this.context.event), s && this.dataManager.setData(s, !0), (n = e == null ? void 0 : e.baselines) != null && n.data && this.dataManager.setBaselines(e.baselines.data), this.linkManager = new pt(this, this.context.event), X((o = e == null ? void 0 : e.links) == null ? void 0 : o.data) && this.linkManager.setLinks(e.links.data, !0), this.linkManager.setCycleDetection(((r = e == null ? void 0 : e.links) == null ? void 0 : r.enableCycleDetection) ?? !0);
2991
+ throw L.exception("Data should be a array.");
2992
+ this.optionManager = new qt(), this.optionManager.setOptions(i), i.locale && kt(i.locale), this.timeAxis = new _e(), this.timeAxis.init(this.optionManager.getOptions()), this.columnManager = new se(this.context), i.table && i.table.columns && this.columnManager.init(i.table.columns), this.dataManager = new te(this, this.context.event), s && this.dataManager.setData(s, !0), (n = e == null ? void 0 : e.baselines) != null && n.data && this.dataManager.setBaselines(e.baselines.data), this.linkManager = new mt(this, this.context.event), X((o = e == null ? void 0 : e.links) == null ? void 0 : o.data) && this.linkManager.setLinks(e.links.data, !0), this.linkManager.setCycleDetection(((r = e == null ? void 0 : e.links) == null ? void 0 : r.enableCycleDetection) ?? !0);
2988
2993
  }
2989
2994
  getOptionManager() {
2990
2995
  return this.optionManager;
@@ -3003,16 +3008,18 @@ class _e {
3003
3008
  }
3004
3009
  setOption(t, e = { merge: !0 }) {
3005
3010
  var n, o, r, a;
3006
- const i = wt(t, ["data"]), s = t == null ? void 0 : t.data;
3011
+ const i = bt(t, ["data"]), s = t == null ? void 0 : t.data;
3007
3012
  this.optionManager.setOptions(i, e), ((n = i.milestone) == null ? void 0 : n.show) !== void 0 && this.dataManager.getVisibleTasks().forEach((c) => {
3008
3013
  c.updateMode();
3009
- }), X(s) && this.dataManager.setData(s, !1), X((o = t.baselines) == null ? void 0 : o.data) && this.dataManager.setBaselines(t.baselines.data), X((r = t.links) == null ? void 0 : r.data) && this.linkManager.setLinks(t.links.data, !0), this.linkManager.setCycleDetection(((a = t.links) == null ? void 0 : a.enableCycleDetection) ?? !0), i.locale && St(i.locale), i.table && i.table.columns && this.columnManager.update(i.table.columns), this.timeAxis.update(this.optionManager.getOptions());
3014
+ }), this.context.getScrollbar().updateOptions(
3015
+ this.context.store.getOptionManager().getOptions().scrollbar || {}
3016
+ ), this.context.event.emit(S.OPTIONS_UPDATE), X(s) && this.dataManager.setData(s, !1), X((o = t.baselines) == null ? void 0 : o.data) && this.dataManager.setBaselines(t.baselines.data), X((r = t.links) == null ? void 0 : r.data) && this.linkManager.setLinks(t.links.data, !0), this.linkManager.setCycleDetection(((a = t.links) == null ? void 0 : a.enableCycleDetection) ?? !0), i.locale && kt(i.locale), i.table && i.table.columns && this.columnManager.update(i.table.columns), this.timeAxis.update(this.optionManager.getOptions());
3010
3017
  }
3011
3018
  updateTime(t, e) {
3012
3019
  this.timeAxis.setDate(t, e);
3013
3020
  }
3014
3021
  }
3015
- class Ae {
3022
+ class Ie {
3016
3023
  constructor(t, e, i) {
3017
3024
  h(this, "rootElement");
3018
3025
  h(this, "options");
@@ -3101,7 +3108,16 @@ class Ae {
3101
3108
  const e = t - this.animationStartTime, i = this.options.animationDuration, s = Math.min(1, e / i), n = s * (2 - s), o = this.animationStartScrollLeft + (this.animationTargetScrollLeft - this.animationStartScrollLeft) * n, r = this.animationStartScrollTop + (this.animationTargetScrollTop - this.animationStartScrollTop) * n, a = this.scrollLeft !== o, c = this.scrollTop !== r;
3102
3109
  (a || c) && this.emit(this.animationSource, o, r), s < 1 ? this.animationFrameId = requestAnimationFrame(this.animationStep) : (this.isAnimating = !1, this.animationFrameId = null, (this.scrollLeft !== this.animationTargetScrollLeft || this.scrollTop !== this.animationTargetScrollTop) && this.emit(this.animationSource, this.animationTargetScrollLeft, this.animationTargetScrollTop), this.scheduleHide());
3103
3110
  });
3104
- this.root = t, this.rootElement = e, this.options = at(
3111
+ this.root = t, this.rootElement = e, this.createElements(), this.updateOptions(i), this.throttledHandleMouseMove = vt(
3112
+ this.handleMouseMove.bind(this),
3113
+ 16
3114
+ ), this.throttledHandleWheel = vt(this.handleWheel.bind(this), 16, {
3115
+ leading: !0,
3116
+ trailing: !1
3117
+ }), this.bindEvents(), this.rootElement.matches(":hover") ? this.handleMouseEnter() : (this.clearTimeouts(), this.hideScrollbars(!0));
3118
+ }
3119
+ updateOptions(t) {
3120
+ this.options = at(
3105
3121
  {
3106
3122
  showHorizontal: !0,
3107
3123
  showVertical: !0,
@@ -3126,14 +3142,8 @@ class Ae {
3126
3142
  hideDuration: 200
3127
3143
  // 滚动条隐藏动画时长 (ms)
3128
3144
  },
3129
- i
3130
- ), this.throttledHandleMouseMove = bt(
3131
- this.handleMouseMove.bind(this),
3132
- 16
3133
- ), this.throttledHandleWheel = bt(this.handleWheel.bind(this), 16, {
3134
- leading: !0,
3135
- trailing: !1
3136
- }), this.createElements(), this.applyStyles(), this.bindEvents(), this.rootElement.matches(":hover") ? this.handleMouseEnter() : (this.clearTimeouts(), this.hideScrollbars(!0));
3145
+ t
3146
+ ), this.applyStyles();
3137
3147
  }
3138
3148
  // --- 元素创建与管理 ---
3139
3149
  createElements() {
@@ -3245,11 +3255,11 @@ class Ae {
3245
3255
  }
3246
3256
  }
3247
3257
  handleWheel(t) {
3248
- if (t.target !== this.rootElement && !this.rootElement.contains(t.target) && O.debug(
3258
+ if (t.target !== this.rootElement && !this.rootElement.contains(t.target) && L.debug(
3249
3259
  "Wheel event ignored, target not root or descendant:",
3250
3260
  t.target
3251
3261
  ), !this.isMouseOverRoot && !this.isMouseOverScrollbar) {
3252
- O.debug("Wheel event ignored, mouse not over root or scrollbar");
3262
+ L.debug("Wheel event ignored, mouse not over root or scrollbar");
3253
3263
  return;
3254
3264
  }
3255
3265
  const e = this.canScrollHorizontal(), i = this.canScrollVertical();
@@ -3418,7 +3428,7 @@ class Ae {
3418
3428
  }
3419
3429
  // --- 销毁 ---
3420
3430
  destroy() {
3421
- this.unbindEvents(), this.clearTimeouts(), this.cancelAnimation(), this.scrollbarContainer.parentNode && this.scrollbarContainer.parentNode.removeChild(this.scrollbarContainer), this.rootElement = null, this.eventManager = null, this.hScrollbar = null, this.vScrollbar = null, this.hScrollThumb = null, this.vScrollThumb = null, this.scrollbarContainer = null, O.debug("Scrollbar destroyed");
3431
+ this.unbindEvents(), this.clearTimeouts(), this.cancelAnimation(), this.scrollbarContainer.parentNode && this.scrollbarContainer.parentNode.removeChild(this.scrollbarContainer), this.rootElement = null, this.eventManager = null, this.hScrollbar = null, this.vScrollbar = null, this.hScrollThumb = null, this.vScrollThumb = null, this.scrollbarContainer = null, L.debug("Scrollbar destroyed");
3422
3432
  }
3423
3433
  }
3424
3434
  function Z(f, t = "") {
@@ -3444,7 +3454,7 @@ function Z(f, t = "") {
3444
3454
  }
3445
3455
  return t;
3446
3456
  }
3447
- class Ie {
3457
+ class He {
3448
3458
  constructor(t, e, i) {
3449
3459
  h(this, "element");
3450
3460
  h(this, "isDragging", !1);
@@ -3459,16 +3469,16 @@ class Ie {
3459
3469
  h(this, "rowElement", null);
3460
3470
  h(this, "handleMouseDown", (t) => {
3461
3471
  if (!this.task || !this.container) {
3462
- O.warn("DragHandler: task or container is not defined");
3472
+ L.warn("DragHandler: task or container is not defined");
3463
3473
  return;
3464
3474
  }
3465
3475
  if (this.rowElement = this.container.closest(".x-gantt-table-row"), !this.rowElement) {
3466
- O.warn("Row element not found", this.container);
3476
+ L.warn("Row element not found", this.container);
3467
3477
  return;
3468
3478
  }
3469
3479
  t.preventDefault(), t.stopPropagation(), this.isDragging = !0, this.dragStartY = t.clientY + this.context.getScrollbar().getScrollPosition().y, this.dragStartIndex = this.task.flatIndex, this.currentIndex = this.dragStartIndex, this.createGhostElement(t), this.createPlaceholderElement(t), document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("mouseup", this.handleMouseUp), document.addEventListener("keydown", (e) => {
3470
3480
  e.key === "Escape" && this.isDragging && this.cleanup();
3471
- }), O.debug(`Drag started for task ${this.task.id} at index ${this.dragStartIndex}`);
3481
+ }), L.debug(`Drag started for task ${this.task.id} at index ${this.dragStartIndex}`);
3472
3482
  });
3473
3483
  h(this, "handleMouseMove", (t) => {
3474
3484
  !this.isDragging || !this.task || !this.container || (this.animationFrameId && cancelAnimationFrame(this.animationFrameId), this.animationFrameId = requestAnimationFrame(() => {
@@ -3516,7 +3526,7 @@ class Ie {
3516
3526
  rgba(255,255,255,0.3) 50%,
3517
3527
  rgba(255,255,255,0.9) 100%);
3518
3528
  pointer-events: none;
3519
- `, (this.context.getRootElement() || document.body).appendChild(this.ghostElement), O.debug("Ghost element created");
3529
+ `, (this.context.getRootElement() || document.body).appendChild(this.ghostElement), L.debug("Ghost element created");
3520
3530
  }
3521
3531
  /**
3522
3532
  * 更新 ghost 元素位置
@@ -3584,7 +3594,7 @@ class Ie {
3584
3594
  * 销毁组件
3585
3595
  */
3586
3596
  destroy() {
3587
- this.cleanup(), this.element.removeEventListener("mousedown", this.handleMouseDown), this.element.removeEventListener("selectstart", (t) => t.preventDefault()), this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element), O.debug("DragHandler destroyed");
3597
+ this.cleanup(), this.element.removeEventListener("mousedown", this.handleMouseDown), this.element.removeEventListener("selectstart", (t) => t.preventDefault()), this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element), L.debug("DragHandler destroyed");
3588
3598
  }
3589
3599
  }
3590
3600
  class nt {
@@ -3621,12 +3631,12 @@ class nt {
3621
3631
  )), typeof this.column.column.render == "function")
3622
3632
  try {
3623
3633
  const e = this.column.column.render(this.task.getEmitData());
3624
- typeof e == "string" ? t.innerHTML = e : e instanceof HTMLElement ? t.appendChild(e) : O.warn(
3634
+ typeof e == "string" ? t.innerHTML = e : e instanceof HTMLElement ? t.appendChild(e) : L.warn(
3625
3635
  "Table cell render function does not return a valid value.",
3626
3636
  e
3627
3637
  );
3628
3638
  } catch (e) {
3629
- O.error("Table cell render error:", e), t.textContent = this.task.getField(this.column.column.field) ?? this.context.getOptions().table.emptyText;
3639
+ L.error("Table cell render error:", e), t.textContent = this.task.getField(this.column.column.field) ?? this.context.getOptions().table.emptyText;
3630
3640
  }
3631
3641
  else
3632
3642
  t.textContent = this.task.getField(this.column.column.field) ?? this.context.getOptions().table.emptyText;
@@ -3638,7 +3648,7 @@ class nt {
3638
3648
  const e = this.context.getOptions().drag.enabled !== !1, i = this.context.store.getOptionManager().unpackFunc(this.context.getOptions().drag.enabled, this.task), s = ["0.3", "0.3", "0.4"];
3639
3649
  if (e || (s[0] = "0", s[1] = "0.5", s[2] = "0.5"), e) {
3640
3650
  const n = document.createElement("div");
3641
- n.style.flex = s[0], n.style.display = "flex", n.style.justifyContent = "center", n.style.alignItems = "center", i && new Ie(this.context, n, this.task), t.appendChild(n);
3651
+ n.style.flex = s[0], n.style.display = "flex", n.style.justifyContent = "center", n.style.alignItems = "center", i && new He(this.context, n, this.task), t.appendChild(n);
3642
3652
  }
3643
3653
  if (this.context.getOptions().selection.enabled) {
3644
3654
  const n = document.createElement("div");
@@ -3648,6 +3658,8 @@ class nt {
3648
3658
  const n = document.createElement("div");
3649
3659
  n.className = "x-gantt-table-cell__expand", n.style.flex = s[2], n.style.color = this.context.getOptions().primaryColor, n.style.display = "flex", n.style.alignItems = "center", n.style.justifyContent = "center", n.style.height = "100%", n.style.width = "14px", n.style.height = "100%", n.style.cursor = "pointer", n.innerHTML = '<svg t="1746693752280" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2612" width="14" height="14"><path d="M724.48 521.728c-1.8432 7.7824-5.7344 14.848-11.3664 20.48l-341.9136 342.016c-16.6912 16.6912-43.7248 16.6912-60.3136 0s-16.6912-43.7248 0-60.3136L622.6944 512 310.8864 200.0896c-16.6912-16.6912-16.6912-43.7248 0-60.3136 16.6912-16.6912 43.7248-16.6912 60.3136 0l341.9136 341.9136c10.8544 10.8544 14.6432 26.112 11.3664 40.0384z" fill="currentColor" p-id="2613"></path></svg>', n.style.transform = this.task.expanded ? "rotate(90deg)" : "", n.addEventListener("click", (o) => {
3650
3660
  o.stopPropagation(), this.context.store.getDataManager().expandTask(this.task.id, !1);
3661
+ }), n.addEventListener("dblclick", (o) => {
3662
+ o.stopPropagation();
3651
3663
  }), t.appendChild(n);
3652
3664
  }
3653
3665
  this.element.appendChild(t);
@@ -3679,7 +3691,7 @@ class nt {
3679
3691
  this.element.style.height = Z(t * Math.max(1, this.rowspan));
3680
3692
  }
3681
3693
  }
3682
- class kt {
3694
+ class Et {
3683
3695
  /**
3684
3696
  * 创建表格行
3685
3697
  * @param context 上下文
@@ -3803,7 +3815,7 @@ class kt {
3803
3815
  n,
3804
3816
  this.task.level + 1
3805
3817
  );
3806
- if (u && (typeof u.col != "number" ? O.error("colspan function must returned a number") : a = u.col, typeof u.row != "number" ? O.error("rowspan function must returned a number") : c = u.row), a > 1 || c > 1) {
3818
+ if (u && (typeof u.col != "number" ? L.error("colspan function must returned a number") : a = u.col, typeof u.row != "number" ? L.error("rowspan function must returned a number") : c = u.row), a > 1 || c > 1) {
3807
3819
  if (c > 1)
3808
3820
  for (let p = 1; p < c; p++) {
3809
3821
  const g = this.context.store.getDataManager().getVisibleTasks()[this.task.flatIndex + p];
@@ -3869,7 +3881,7 @@ class kt {
3869
3881
  this.clearCells(), this.element.parentNode && this.element.parentNode.removeChild(this.element);
3870
3882
  }
3871
3883
  }
3872
- class He {
3884
+ class Re {
3873
3885
  constructor(t, e) {
3874
3886
  h(this, "element");
3875
3887
  h(this, "rows", /* @__PURE__ */ new Map());
@@ -3894,7 +3906,7 @@ class He {
3894
3906
  const a = this.rows.get(r);
3895
3907
  a.update(n), a.updateTop(t);
3896
3908
  } else {
3897
- const a = new kt(this.context, this.element, n, t);
3909
+ const a = new Et(this.context, this.element, n, t);
3898
3910
  a.create(), this.rows.set(r, a);
3899
3911
  }
3900
3912
  this.context.store.getColumnManager().getLeafColumns().forEach((a, c) => {
@@ -3902,7 +3914,7 @@ class He {
3902
3914
  if (u && u.rowspan > 1) {
3903
3915
  const d = u.task.id;
3904
3916
  if (!this.rows.has(d) && !this.mergeRows.has(d)) {
3905
- const l = new kt(
3917
+ const l = new Et(
3906
3918
  this.context,
3907
3919
  this.element,
3908
3920
  u.task,
@@ -3946,7 +3958,7 @@ class He {
3946
3958
  });
3947
3959
  }
3948
3960
  }
3949
- class mt {
3961
+ class xt {
3950
3962
  constructor(t, e, i, s) {
3951
3963
  h(this, "columnElement");
3952
3964
  this.context = t, this.root = e, this.container = i, this.column = s, this.columnElement = document.createElement("div"), this.initElement(), this.container.appendChild(this.columnElement);
@@ -3963,7 +3975,7 @@ class mt {
3963
3975
  this.context.getOptions().header.fontSize
3964
3976
  ), n.style.setProperty(
3965
3977
  "color",
3966
- this.context.getOptions().header.color,
3978
+ ht(this.context.getOptions().header.color, this.context.getOptions().header.backgroundColor || this.context.getOptions().primaryColor),
3967
3979
  "important"
3968
3980
  ), n.style.fontFamily = this.context.getOptions().header.fontFamily, this.column.column.headerRender) {
3969
3981
  const o = this.column.column.headerRender();
@@ -4004,7 +4016,7 @@ class mt {
4004
4016
  t.addEventListener("mousedown", o);
4005
4017
  }
4006
4018
  }
4007
- class yt {
4019
+ class wt {
4008
4020
  constructor(t, e, i, s) {
4009
4021
  h(this, "groupElement");
4010
4022
  h(this, "titleContainer");
@@ -4022,14 +4034,14 @@ class yt {
4022
4034
  this.context.getOptions().header.fontSize
4023
4035
  ), this.titleContainer.style.fontFamily = this.context.getOptions().header.fontFamily, this.titleContainer.style.setProperty(
4024
4036
  "color",
4025
- this.context.getOptions().header.color,
4037
+ ht(this.context.getOptions().header.color, this.context.getOptions().header.backgroundColor || this.context.getOptions().primaryColor),
4026
4038
  "important"
4027
4039
  ), this.titleContainer.textContent = this.column.label || "", this.childContainer.className = "x-gantt-table-header-children", this.childContainer.style.flex = "1 0 auto", this.childContainer.style.display = "flex", this.childContainer.style.width = "100%", this.groupElement.appendChild(this.titleContainer), this.groupElement.appendChild(this.childContainer);
4028
4040
  }
4029
4041
  initChildren() {
4030
4042
  this.column.children.forEach((t) => {
4031
4043
  if (t.isLeaf) {
4032
- const e = new mt(
4044
+ const e = new xt(
4033
4045
  this.context,
4034
4046
  this.root,
4035
4047
  this.childContainer,
@@ -4037,7 +4049,7 @@ class yt {
4037
4049
  );
4038
4050
  this.children.push(e);
4039
4051
  } else if (t.children.length > 0) {
4040
- const e = new yt(
4052
+ const e = new wt(
4041
4053
  this.context,
4042
4054
  this.root,
4043
4055
  this.childContainer,
@@ -4048,7 +4060,7 @@ class yt {
4048
4060
  });
4049
4061
  }
4050
4062
  }
4051
- class Re {
4063
+ class Ge {
4052
4064
  constructor(t, e) {
4053
4065
  h(this, "headerElement");
4054
4066
  h(this, "headerColumns", []);
@@ -4064,7 +4076,7 @@ class Re {
4064
4076
  "important"
4065
4077
  ), this.headerElement.style.setProperty(
4066
4078
  "color",
4067
- this.context.getOptions().header.color,
4079
+ ht(this.context.getOptions().header.color, this.context.getOptions().header.backgroundColor || this.context.getOptions().primaryColor),
4068
4080
  "important"
4069
4081
  ), this.headerElement.style.fontSize = `${this.context.getOptions().header.fontSize}px`, this.headerElement.style.fontWeight = `${this.context.getOptions().header.fontWeight}`, this.headerElement.style.zIndex = "10", this.headerElement.style.width = "100%", this.headerElement.style.flexShrink = "0", this.headerElement.style.borderBottom = `1px solid ${this.context.getOptions().border.color}`, this.headerElement.style.setProperty(
4070
4082
  "border-color",
@@ -4079,7 +4091,7 @@ class Re {
4079
4091
  this.headerColumns = [], this.headerElement.innerHTML = "", this.initElement();
4080
4092
  const t = this.context.store.getColumnManager(), e = t.getColumns();
4081
4093
  if (t.getHandlerColumn().width !== 0) {
4082
- const i = new mt(
4094
+ const i = new xt(
4083
4095
  this.context,
4084
4096
  this.headerElement,
4085
4097
  this.headerElement,
@@ -4089,7 +4101,7 @@ class Re {
4089
4101
  }
4090
4102
  e.forEach((i) => {
4091
4103
  if (i.isLeaf) {
4092
- const s = new mt(
4104
+ const s = new xt(
4093
4105
  this.context,
4094
4106
  this.headerElement,
4095
4107
  this.headerElement,
@@ -4097,7 +4109,7 @@ class Re {
4097
4109
  );
4098
4110
  this.headerColumns.push(s);
4099
4111
  } else if (i.children.length > 0) {
4100
- const s = new yt(
4112
+ const s = new wt(
4101
4113
  this.context,
4102
4114
  this.headerElement,
4103
4115
  this.headerElement,
@@ -4108,12 +4120,12 @@ class Re {
4108
4120
  });
4109
4121
  }
4110
4122
  }
4111
- class Ge {
4123
+ class We {
4112
4124
  constructor(t, e) {
4113
4125
  h(this, "tableContainer");
4114
4126
  h(this, "tableHeader");
4115
4127
  h(this, "tableBody");
4116
- this.context = t, this.container = e, this.tableContainer = document.createElement("div"), this.tableContainer.className = "x-gantt-table-container", this.tableContainer.style.position = "relative", this.tableContainer.style.width = "100%", this.tableContainer.style.height = "100%", this.tableContainer.style.overflow = "hidden", this.tableContainer.style.display = "flex", this.tableContainer.style.flexDirection = "column", this.container.appendChild(this.tableContainer), this.tableHeader = new Re(t, this.tableContainer), this.tableBody = new He(t, this.tableContainer), this.listenEvents();
4128
+ this.context = t, this.container = e, this.tableContainer = document.createElement("div"), this.tableContainer.className = "x-gantt-table-container", this.tableContainer.style.position = "relative", this.tableContainer.style.width = "100%", this.tableContainer.style.height = "100%", this.tableContainer.style.overflow = "hidden", this.tableContainer.style.display = "flex", this.tableContainer.style.flexDirection = "column", this.container.appendChild(this.tableContainer), this.tableHeader = new Ge(t, this.tableContainer), this.tableBody = new Re(t, this.tableContainer), this.listenEvents();
4117
4129
  }
4118
4130
  render(t, e) {
4119
4131
  this.tableHeader.render(), this.refresh(t, e);
@@ -4135,7 +4147,7 @@ class Ge {
4135
4147
  });
4136
4148
  }
4137
4149
  }
4138
- class We {
4150
+ class $e {
4139
4151
  constructor(t, e) {
4140
4152
  h(this, "background");
4141
4153
  // 表头背景
@@ -4290,7 +4302,7 @@ class We {
4290
4302
  fontSize: u,
4291
4303
  fontFamily: this.context.getOptions().header.fontFamily,
4292
4304
  fontStyle: `${this.context.getOptions().header.fontWeight}`,
4293
- fill: this.context.getOptions().header.color,
4305
+ fill: ht(this.context.getOptions().header.color, this.context.getOptions().header.backgroundColor || this.context.getOptions().primaryColor),
4294
4306
  align: "center",
4295
4307
  verticalAlign: "middle",
4296
4308
  wrap: "none",
@@ -4351,7 +4363,7 @@ class We {
4351
4363
  }).play()));
4352
4364
  }
4353
4365
  }
4354
- class $e {
4366
+ class Fe {
4355
4367
  constructor(t, e) {
4356
4368
  // 网格线组
4357
4369
  h(this, "verticalLines");
@@ -4432,8 +4444,8 @@ class $e {
4432
4444
  this.verticalLines.destroyChildren(), this.horizontalLines.destroyChildren();
4433
4445
  }
4434
4446
  }
4435
- const Et = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><path fill="currentColor" fill-rule="evenodd" d="M5.5 4.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25m4 0a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25M10.625 7.5a1.125 1.125 0 1 1-2.25 0a1.125 1.125 0 0 1 2.25 0M5.5 8.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25m5.125 2.875a1.125 1.125 0 1 1-2.25 0a1.125 1.125 0 0 1 2.25 0M5.5 12.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25" clip-rule="evenodd"/></svg>';
4436
- class Fe {
4447
+ const Ct = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><path fill="currentColor" fill-rule="evenodd" d="M5.5 4.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25m4 0a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25M10.625 7.5a1.125 1.125 0 1 1-2.25 0a1.125 1.125 0 0 1 2.25 0M5.5 8.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25m5.125 2.875a1.125 1.125 0 1 1-2.25 0a1.125 1.125 0 0 1 2.25 0M5.5 12.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25" clip-rule="evenodd"/></svg>';
4448
+ class Be {
4437
4449
  constructor(t, e, i, s, n) {
4438
4450
  h(this, "offsetX", 0);
4439
4451
  h(this, "offsetY", 0);
@@ -4485,10 +4497,10 @@ class Fe {
4485
4497
  });
4486
4498
  }
4487
4499
  render() {
4488
- var p, g, y, x, v, b, w, C, M, E, T, L, A;
4500
+ var p, g, y, x, v, b, w, C, M, E, T, O, A;
4489
4501
  if (!this.task.startTime || !this.task.endTime) return;
4490
4502
  if (this.task.endTime.isBefore(this.task.startTime)) {
4491
- O.error("The endTime of the current task is earlier than the startTime.", this.task);
4503
+ L.error("The endTime of the current task is earlier than the startTime.", this.task);
4492
4504
  return;
4493
4505
  }
4494
4506
  const t = this.context.getOptions().row.height, e = ot(
@@ -4498,14 +4510,12 @@ class Fe {
4498
4510
  this.unpackFunc(this.context.getOptions().bar.radius)
4499
4511
  ), c = this.unpackFunc(this.context.getOptions().bar.shadowColor) || "rgba(0, 0, 0, 0.2)", u = this.unpackFunc(this.context.getOptions().bar.shadowBlur) || 0, d = this.unpackFunc(this.context.getOptions().bar.shadowOffsetX) || 0, l = this.unpackFunc(this.context.getOptions().bar.shadowOffsetY) || 0;
4500
4512
  this.slider || (this.slider = new k.Group({
4501
- dragBoundFunc: (_) => {
4502
- let D = Math.min(0, -(-this.offsetX - this.slider.x()));
4503
- const H = this.context.store.getTimeAxis().getTimeLeft(this.task.endTime);
4504
- let W = this.sliderGroup.getStage().width() - this.slider.width() + Math.abs(H - (-this.offsetX + this.sliderGroup.getStage().width()));
4513
+ dragBoundFunc: (D) => {
4514
+ let _ = Math.min(0, -(-this.offsetX - this.slider.x())), W = this.context.store.getTimeAxis().getTimeLeft(this.context.store.getTimeAxis().getEndTime()) + this.offsetX - this.slider.width();
4505
4515
  if (this.context.getOptions().bar.move.link.parent === "strict" && this.task.parent) {
4506
4516
  if (this.task.parent.startTime) {
4507
4517
  const G = this.task.parent.startTime;
4508
- D = this.context.store.getTimeAxis().getTimeLeft(G);
4518
+ _ = this.context.store.getTimeAxis().getTimeLeft(G);
4509
4519
  }
4510
4520
  if (this.task.parent.endTime) {
4511
4521
  const G = this.task.parent.endTime, F = this.context.store.getTimeAxis().getTimeLeft(G);
@@ -4513,64 +4523,64 @@ class Fe {
4513
4523
  }
4514
4524
  }
4515
4525
  return {
4516
- x: $(_.x, D, W),
4526
+ x: $(D.x, _, W),
4517
4527
  y: this.y + i + this.offsetY
4518
4528
  };
4519
4529
  }
4520
4530
  })), this.slider.position({ x: s, y: i }), this.slider.size({ width: o, height: e });
4521
4531
  const m = !!this.unpackFunc(this.context.getOptions().bar.move.enabled) && (this.task.isSummary() ? this.context.getOptions().summary.move.enabled : !0);
4522
- if (this.slider.draggable(m), this.slider.on("mouseover", (_) => {
4523
- m && !this.isDragging && (_.target.getStage().container().style.cursor = "grab"), this.handleBarHighlight({
4532
+ if (this.slider.draggable(m), this.slider.on("mouseover", (D) => {
4533
+ m && !this.isDragging && (D.target.getStage().container().style.cursor = "grab"), this.handleBarHighlight({
4524
4534
  shadowColor: B(c).alpha(B(c).alpha() + 0.1).toHex(),
4525
4535
  shadowBlur: Math.max((u || 1) * 2, 4),
4526
4536
  shadowOffsetX: Math.max(d || 1, 2),
4527
4537
  shadowOffsetY: Math.max((l || 1) * 1.5, 4)
4528
- }), this.context.event.emit(S.SLIDER_ENTER, _.evt, this.task);
4529
- }), this.slider.on("mousemove", (_) => {
4530
- this.context.event.emit(S.SLIDER_HOVER, _.evt, this.task);
4531
- }), this.slider.on("mouseout", (_) => {
4532
- m && !this.isDragging && (_.target.getStage().container().style.cursor = "default"), this.isDragging || this.handleBarHighlight({
4538
+ }), this.context.event.emit(S.SLIDER_ENTER, D.evt, this.task);
4539
+ }), this.slider.on("mousemove", (D) => {
4540
+ this.context.event.emit(S.SLIDER_HOVER, D.evt, this.task);
4541
+ }), this.slider.on("mouseout", (D) => {
4542
+ m && !this.isDragging && (D.target.getStage().container().style.cursor = "default"), this.isDragging || this.handleBarHighlight({
4533
4543
  shadowColor: c,
4534
4544
  shadowBlur: u,
4535
4545
  shadowOffsetX: d,
4536
4546
  shadowOffsetY: l
4537
- }), this.context.event.emit(S.SLIDER_LEAVE, _.evt, this.task);
4547
+ }), this.context.event.emit(S.SLIDER_LEAVE, D.evt, this.task);
4538
4548
  }), this.task.isMilestone()) {
4539
4549
  this.sliderBar && !this.sliderType.startsWith("milestone") && (this.slider.destroyChildren(), this.sliderBar = null, this.progressGroup = null, this.leftHandleGroup = null, this.rightHandleGroup = null);
4540
- const _ = this.unpackFunc(this.context.getOptions().milestone.size), D = Math.min(_ || e, t / 2), H = this.unpackFunc(this.context.getOptions().milestone.color) || r, W = this.unpackFunc(this.context.getOptions().milestone.border.color), I = this.unpackFunc(this.context.getOptions().milestone.border.width), G = this.unpackFunc(this.context.getOptions().milestone.shape);
4550
+ const D = this.unpackFunc(this.context.getOptions().milestone.size), _ = Math.min(D || e, t / 2), R = this.unpackFunc(this.context.getOptions().milestone.color) || r, W = this.unpackFunc(this.context.getOptions().milestone.border.color), I = this.unpackFunc(this.context.getOptions().milestone.border.width), G = this.unpackFunc(this.context.getOptions().milestone.shape);
4541
4551
  if (!this.sliderBar) {
4542
4552
  switch (G) {
4543
4553
  case "triangle":
4544
4554
  this.sliderBar = new k.RegularPolygon({
4545
4555
  sides: 3,
4546
- radius: D,
4556
+ radius: _,
4547
4557
  rotation: 0,
4548
- fill: H,
4558
+ fill: R,
4549
4559
  stroke: W,
4550
4560
  strokeWidth: I,
4551
- y: D / 3 * 2
4561
+ y: e / 2
4552
4562
  // 居中
4553
4563
  });
4554
4564
  break;
4555
4565
  case "circle":
4556
4566
  this.sliderBar = new k.Circle({
4557
- radius: D,
4558
- fill: H,
4567
+ radius: _,
4568
+ fill: R,
4559
4569
  stroke: W,
4560
4570
  strokeWidth: I,
4561
- y: D / 2
4571
+ y: e / 2
4562
4572
  // 居中
4563
4573
  });
4564
4574
  break;
4565
4575
  case "star":
4566
4576
  this.sliderBar = new k.Star({
4567
4577
  numPoints: 5,
4568
- innerRadius: D / 2,
4569
- outerRadius: D,
4570
- fill: H,
4578
+ innerRadius: _ / 2,
4579
+ outerRadius: _,
4580
+ fill: R,
4571
4581
  stroke: W,
4572
4582
  strokeWidth: I,
4573
- y: D / 2
4583
+ y: e / 2
4574
4584
  // 居中
4575
4585
  });
4576
4586
  break;
@@ -4578,31 +4588,31 @@ class Fe {
4578
4588
  default:
4579
4589
  this.sliderBar = new k.RegularPolygon({
4580
4590
  sides: 4,
4581
- radius: D,
4591
+ radius: _,
4582
4592
  rotation: 0,
4583
- fill: H,
4593
+ fill: R,
4584
4594
  stroke: W,
4585
4595
  strokeWidth: I,
4586
- y: D / 2
4596
+ y: e / 2
4587
4597
  // 居中
4588
4598
  });
4589
4599
  }
4590
4600
  if (this.slider.add(this.sliderBar), this.unpackFunc(this.context.getOptions().milestone.label.show)) {
4591
- const F = this.unpackFunc(this.context.getOptions().milestone.label.text), z = this.unpackFunc(this.context.getOptions().milestone.label.position), q = this.unpackFunc(this.context.getOptions().milestone.label.fontSize), Pt = this.unpackFunc(this.context.getOptions().milestone.label.fontFamily), Nt = this.unpackFunc(this.context.getOptions().milestone.label.color), it = new k.Text({
4601
+ const F = this.unpackFunc(this.context.getOptions().milestone.label.text), z = this.unpackFunc(this.context.getOptions().milestone.label.position), q = this.unpackFunc(this.context.getOptions().milestone.label.fontSize), Nt = this.unpackFunc(this.context.getOptions().milestone.label.fontFamily), Yt = this.unpackFunc(this.context.getOptions().milestone.label.color), it = new k.Text({
4592
4602
  height: e,
4593
4603
  text: F,
4594
- fill: Nt || H,
4604
+ fill: Yt || R,
4595
4605
  fontSize: q,
4596
- fontFamily: Pt
4597
- }), ht = it.measureSize(F);
4598
- it.width(ht.width);
4606
+ fontFamily: Nt
4607
+ }), lt = it.measureSize(F);
4608
+ it.width(lt.width);
4599
4609
  const K = { x: 0, y: 0 };
4600
4610
  switch (z) {
4601
4611
  case "top-left":
4602
- K.x = -(12 + ht.width), K.y = -8;
4612
+ K.x = -(12 + lt.width), K.y = -8;
4603
4613
  break;
4604
4614
  case "bottom-left":
4605
- K.x = -(12 + ht.width), K.y = 10;
4615
+ K.x = -(12 + lt.width), K.y = 10;
4606
4616
  break;
4607
4617
  case "bottom-right":
4608
4618
  K.x = 12, K.y = 10;
@@ -4618,21 +4628,21 @@ class Fe {
4618
4628
  this.sliderType = "milestone";
4619
4629
  } else if (this.task.isSummary() && (this.context.getOptions().summary.mode === "always" || this.task.expanded)) {
4620
4630
  this.sliderBar && this.sliderType !== "summary" && (this.slider.destroyChildren(), this.sliderBar = null, this.progressGroup = null, this.leftHandleGroup = null, this.rightHandleGroup = null);
4621
- const _ = this.unpackFunc(this.context.getOptions().summary.color) || r, D = t * 0.2, H = t * 0.3, W = (I) => new k.Shape({
4631
+ const D = this.unpackFunc(this.context.getOptions().summary.color) || r, _ = t * 0.2, R = t * 0.3, W = (I) => new k.Shape({
4622
4632
  sceneFunc: (G, F) => {
4623
- const z = H * 0.5;
4624
- G.beginPath(), G.moveTo(0, (t - D) / 2), G.lineTo(z, (t - D) / 2), G.lineTo(z, (t - D) / 2 + D), G.lineTo(0, (t - D) / 2 + D + H), G.lineTo(0, (t - D) / 2), G.rect(z, (t - D) / 2, I - 2 * z, D), G.moveTo(I - z, (t - D) / 2), G.lineTo(I, (t - D) / 2), G.lineTo(I, (t - D) / 2 + D + H), G.lineTo(I - z, (t - D) / 2 + D), G.lineTo(I - z, (t - D) / 2), G.fillStrokeShape(F);
4633
+ const z = R * 0.5;
4634
+ G.beginPath(), G.moveTo(0, (t - _) / 2), G.lineTo(z, (t - _) / 2), G.lineTo(z, (t - _) / 2 + _), G.lineTo(0, (t - _) / 2 + _ + R), G.lineTo(0, (t - _) / 2), G.rect(z, (t - _) / 2, I - 2 * z, _), G.moveTo(I - z, (t - _) / 2), G.lineTo(I, (t - _) / 2), G.lineTo(I, (t - _) / 2 + _ + R), G.lineTo(I - z, (t - _) / 2 + _), G.lineTo(I - z, (t - _) / 2), G.fillStrokeShape(F);
4625
4635
  },
4626
4636
  width: I,
4627
- fill: _,
4637
+ fill: D,
4628
4638
  shadowColor: c,
4629
4639
  shadowBlur: u,
4630
4640
  shadowOffsetX: d,
4631
4641
  shadowOffsetY: l,
4632
- y: -(H + D) / 2 - i / 2
4642
+ y: -(R + _) / 2 - i / 2
4633
4643
  });
4634
4644
  !this.sliderBar || this.sliderBar.width() !== o ? (this.sliderBar && this.sliderBar.destroy(), this.sliderBar = W(o), this.slider.add(this.sliderBar)) : this.sliderBar.setAttrs({
4635
- fill: _,
4645
+ fill: D,
4636
4646
  shadowColor: c,
4637
4647
  shadowBlur: u,
4638
4648
  shadowOffsetX: d,
@@ -4648,7 +4658,7 @@ class Fe {
4648
4658
  fill: r,
4649
4659
  cornerRadius: a
4650
4660
  }), this.renderProgress(o, e);
4651
- const _ = (p = this.context.getOptions().bar.move.single) == null ? void 0 : p.icon, D = (g = this.context.getOptions().bar.move.single) == null ? void 0 : g.backgroundColor, H = D ? B(D).alpha(((y = this.context.getOptions().bar.move.single) == null ? void 0 : y.opacity) ?? 1).toHex() : B(r).brighten(30 * (this.unpackFunc((x = this.context.getOptions().bar.progress) == null ? void 0 : x.show) ? -1 : 1)).alpha(((v = this.context.getOptions().bar.move.single) == null ? void 0 : v.opacity) ?? 1).toHex();
4661
+ const D = (p = this.context.getOptions().bar.move.single) == null ? void 0 : p.icon, _ = (g = this.context.getOptions().bar.move.single) == null ? void 0 : g.backgroundColor, R = _ ? B(_).alpha(((y = this.context.getOptions().bar.move.single) == null ? void 0 : y.opacity) ?? 1).toHex() : B(r).brighten(30 * (this.unpackFunc((x = this.context.getOptions().bar.progress) == null ? void 0 : x.show) ? -1 : 1)).alpha(((v = this.context.getOptions().bar.move.single) == null ? void 0 : v.opacity) ?? 1).toHex();
4652
4662
  if (!!this.unpackFunc((b = this.context.getOptions().bar.move.single) == null ? void 0 : b.left)) {
4653
4663
  if (!this.leftHandleGroup) {
4654
4664
  this.leftHandleGroup = new k.Group({
@@ -4668,7 +4678,7 @@ class Fe {
4668
4678
  x: 0,
4669
4679
  y: 0
4670
4680
  });
4671
- this.leftHandleGroup.add(G), _ !== null && vt(_ || Et, this.handlerWidth, e).then((F) => {
4681
+ this.leftHandleGroup.add(G), D !== null && Tt(D || Ct, this.handlerWidth, e).then((F) => {
4672
4682
  var q;
4673
4683
  const z = new k.Image({
4674
4684
  image: F,
@@ -4683,7 +4693,7 @@ class Fe {
4683
4693
  (w = this.leftHandleGroup.findOne("Rect")) == null || w.setAttrs({
4684
4694
  width: this.handlerWidth,
4685
4695
  height: e,
4686
- fill: H,
4696
+ fill: R,
4687
4697
  cornerRadius: [a[0], 0, 0, a[3]]
4688
4698
  }), (C = this.leftHandleGroup.findOne("Image")) == null || C.setAttrs({
4689
4699
  x: 0,
@@ -4711,7 +4721,7 @@ class Fe {
4711
4721
  x: 0,
4712
4722
  y: 0
4713
4723
  });
4714
- this.rightHandleGroup.add(G), _ !== null && vt(_ || Et, this.handlerWidth, e).then((F) => {
4724
+ this.rightHandleGroup.add(G), D !== null && Tt(D || Ct, this.handlerWidth, e).then((F) => {
4715
4725
  var q;
4716
4726
  const z = new k.Image({
4717
4727
  image: F,
@@ -4727,7 +4737,7 @@ class Fe {
4727
4737
  x: o - this.handlerWidth,
4728
4738
  width: this.handlerWidth,
4729
4739
  height: e,
4730
- fill: H,
4740
+ fill: R,
4731
4741
  cornerRadius: [0, a[1], a[2], 0]
4732
4742
  }), (T = this.rightHandleGroup.findOne("Image")) == null || T.setAttrs({
4733
4743
  x: o - this.handlerWidth,
@@ -4736,7 +4746,7 @@ class Fe {
4736
4746
  height: this.handlerWidth
4737
4747
  });
4738
4748
  } else this.rightHandleGroup && (this.rightHandleGroup.remove(), this.rightHandleGroup = null);
4739
- this.renderText(o, e), (L = this.leftHandleGroup) == null || L.moveToTop(), (A = this.rightHandleGroup) == null || A.moveToTop();
4749
+ this.renderText(o, e), (O = this.leftHandleGroup) == null || O.moveToTop(), (A = this.rightHandleGroup) == null || A.moveToTop();
4740
4750
  }
4741
4751
  this.isDragging || this.sliderBar.setAttrs({
4742
4752
  shadowColor: c,
@@ -4783,7 +4793,7 @@ class Fe {
4783
4793
  return;
4784
4794
  }
4785
4795
  if (this.task.progress) {
4786
- const g = Qt(
4796
+ const g = Zt(
4787
4797
  this.task.progress,
4788
4798
  ((s = this.context.getOptions().bar.progress) == null ? void 0 : s.targetVal) ?? 100
4789
4799
  );
@@ -4816,10 +4826,10 @@ class Fe {
4816
4826
  opacity: this.unpackFunc((a = this.context.getOptions().bar.progress) == null ? void 0 : a.opacity)
4817
4827
  });
4818
4828
  this.progressGroup.add(C);
4819
- const M = `${ft(
4829
+ const M = `${pt(
4820
4830
  g * 100,
4821
4831
  (c = this.context.getOptions().bar.progress) == null ? void 0 : c.decimal
4822
- )}%`, E = new k.Text().measureSize(M).width, T = this.unpackFunc((u = this.context.getOptions().bar.progress) == null ? void 0 : u.textAlign), L = new k.Text({
4832
+ )}%`, E = new k.Text().measureSize(M).width, T = this.unpackFunc((u = this.context.getOptions().bar.progress) == null ? void 0 : u.textAlign), O = new k.Text({
4823
4833
  x: 0,
4824
4834
  y: T === "top" ? -e : 0,
4825
4835
  width: T === "right" ? w + E : Math.max(w, E),
@@ -4832,7 +4842,7 @@ class Fe {
4832
4842
  verticalAlign: T === "top" ? "bottom" : "middle",
4833
4843
  align: "right"
4834
4844
  });
4835
- (p = this.progressGroup) == null || p.add(L);
4845
+ (p = this.progressGroup) == null || p.add(O);
4836
4846
  }
4837
4847
  }
4838
4848
  // 绑定事件,包括拖拽和边缘检测
@@ -4864,13 +4874,13 @@ class Fe {
4864
4874
  const e = t.target.getStage();
4865
4875
  if (!e) return;
4866
4876
  this.isDragging = !0, this.oldTasks = [], this.context.event.emit(S.SLIDER_DRAGGING, !0), e.container().style.cursor = "grabbing";
4867
- const i = t.target.x(), s = this.context.store.getTimeAxis().getCellWidth(), n = dt(i, s);
4877
+ const i = t.target.x(), s = this.context.store.getTimeAxis().getCellWidth(), n = ut(i, s);
4868
4878
  this.dragDiffX = n - i, this.handleMove(t, e);
4869
4879
  }
4870
4880
  handleDragMove(t) {
4871
4881
  if (!this.isDragging) return;
4872
4882
  if (t.evt.movementX > 0 ? this.draggingDirection !== "right" && (this.draggingDirection = "right", this.stopAutoScroll(), this.stopAutoExpand()) : t.evt.movementX < 0 && this.draggingDirection !== "left" && (this.draggingDirection = "left", this.stopAutoScroll(), this.stopAutoExpand()), !!this.context.getOptions().bar.move.byUnit) {
4873
- const i = t.target.x(), s = this.context.store.getTimeAxis().getCellWidth(), n = dt(i, s);
4883
+ const i = t.target.x(), s = this.context.store.getTimeAxis().getCellWidth(), n = ut(i, s);
4874
4884
  t.target.x(n - this.dragDiffX);
4875
4885
  }
4876
4886
  }
@@ -4902,10 +4912,10 @@ class Fe {
4902
4912
  const i = e.width(), s = !!this.context.getOptions().bar.move.lock, n = !!this.context.getOptions().bar.move.byUnit, o = this.context.store.getTimeAxis().getCellWidth(), r = t.target.width(), a = t.target.x(), c = a + r, u = Math.max(0, -this.offsetX - a), d = Math.max(0, c - (-this.offsetX + i));
4903
4913
  this.autoMoveTimer = window.setInterval(() => {
4904
4914
  const l = t.target.width(), m = t.target.x(), p = m + l, g = -this.offsetX, y = g + i, x = this.context.store.getTimeAxis().getTotalWidth(), v = m <= g + this.EDGE_THRESHOLD, b = p >= y - this.EDGE_THRESHOLD;
4905
- if (v)
4915
+ if (this.draggingDirection === "left" && v)
4906
4916
  if (g <= 0)
4907
- this.draggingDirection === "left" && t.target.x(-u), this.stopAutoScroll(), s || (this.draggingDirection === "left" ? this.startAutoExpand("left", -u) : this.stopAutoExpand());
4908
- else if (this.draggingDirection === "left") {
4917
+ t.target.x(-u), this.stopAutoScroll(), s || this.startAutoExpand("left", -u);
4918
+ else {
4909
4919
  const w = n ? -o : -this.SCROLL_STEP;
4910
4920
  this.startAutoScroll(
4911
4921
  w,
@@ -4915,18 +4925,16 @@ class Fe {
4915
4925
  },
4916
4926
  () => t.target.x(t.target.x() - u)
4917
4927
  );
4918
- } else
4919
- this.stopAutoScroll();
4920
- else if (b)
4928
+ }
4929
+ else if (this.draggingDirection === "right" && b)
4921
4930
  if (y >= x)
4922
- this.draggingDirection === "right" && t.target.x(x - l + d), this.stopAutoScroll(), s || (this.draggingDirection === "right" ? this.startAutoExpand("right", 0, d) : this.stopAutoExpand());
4923
- else if (this.draggingDirection === "right") {
4931
+ t.target.x(x - l + d), this.stopAutoScroll(), s || this.startAutoExpand("right", 0, d);
4932
+ else {
4924
4933
  const w = n ? o : this.SCROLL_STEP;
4925
4934
  this.startAutoScroll(w, n, () => {
4926
4935
  t.target.x(t.target.x() + w);
4927
4936
  });
4928
- } else
4929
- this.stopAutoScroll();
4937
+ }
4930
4938
  else
4931
4939
  this.stopAutoExpand(), this.stopAutoScroll();
4932
4940
  this.emitUpdate("both");
@@ -4987,7 +4995,7 @@ class Fe {
4987
4995
  x.movementX > 0 ? this.draggingDirection = "right" : x.movementX < 0 && (this.draggingDirection = "left");
4988
4996
  const v = Math.max(((w = i.getPointerPosition()) == null ? void 0 : w.x) || 0, 0);
4989
4997
  let b = v - s;
4990
- n && (b = dt(b, o)), (d === void 0 || d !== b) && (e === "left" ? m - b - c >= o && v < a - this.EDGE_THRESHOLD && (this.slider.width(m - b - c), this.slider.x(l + b + c), this.emitUpdate("left")) : m + b + u >= o && v > this.EDGE_THRESHOLD && (this.slider.width(m + b + u), this.emitUpdate("right")), d = b);
4998
+ n && (b = ut(b, o)), (d === void 0 || d !== b) && (e === "left" ? m - b - c >= o && v < a - this.EDGE_THRESHOLD && (this.slider.width(m - b - c), this.slider.x(l + b + c), this.emitUpdate("left")) : m + b + u >= o && v > this.EDGE_THRESHOLD && (this.slider.width(m + b + u), this.emitUpdate("right")), d = b);
4991
4999
  }, g = () => {
4992
5000
  this.handleDragEnd(t), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", g);
4993
5001
  };
@@ -5070,7 +5078,7 @@ class Fe {
5070
5078
  n.start();
5071
5079
  }
5072
5080
  }
5073
- class Be {
5081
+ class ze {
5074
5082
  constructor(t, e, i, s, n, o, r) {
5075
5083
  h(this, "row");
5076
5084
  h(this, "slider");
@@ -5084,7 +5092,7 @@ class Be {
5084
5092
  id: i,
5085
5093
  listening: !1
5086
5094
  });
5087
- this.row.add(a), this.slider = new Fe(this.context, 0, n, this.task, this.width), this.row.add(this.slider.sliderGroup);
5095
+ this.row.add(a), this.slider = new Be(this.context, 0, n, this.task, this.width), this.row.add(this.slider.sliderGroup);
5088
5096
  }
5089
5097
  update(t, e, i) {
5090
5098
  this.slider.update(t, e, i);
@@ -5096,7 +5104,7 @@ class Be {
5096
5104
  this.row.destroy();
5097
5105
  }
5098
5106
  }
5099
- class ze {
5107
+ class Pe {
5100
5108
  constructor(t, e, i, s) {
5101
5109
  h(this, "tasks", []);
5102
5110
  // 当前渲染的任务列表
@@ -5142,7 +5150,7 @@ class ze {
5142
5150
  const o = `chart-row-${s.id}`;
5143
5151
  let r = this.rowsCache.get(o);
5144
5152
  const c = s.flatIndex * e + this.context.getOptions().header.height;
5145
- r ? (r.update(0, c, s), r.setOffset(this.offsetX, this.offsetY)) : (r = new Be(
5153
+ r ? (r.update(0, c, s), r.setOffset(this.offsetX, this.offsetY)) : (r = new ze(
5146
5154
  this.context,
5147
5155
  s,
5148
5156
  o,
@@ -5371,7 +5379,7 @@ class ze {
5371
5379
  this.rowsCache.clear(), this.rowsGroup.destroy(), this.rowBgGroup.destroy();
5372
5380
  }
5373
5381
  }
5374
- class zt {
5382
+ class Pt {
5375
5383
  constructor() {
5376
5384
  }
5377
5385
  static async createPattern(t) {
@@ -5512,7 +5520,7 @@ class zt {
5512
5520
  return d.src = a.toDataURL(), a.destroy(), d;
5513
5521
  }
5514
5522
  }
5515
- class Pe {
5523
+ class Ne {
5516
5524
  constructor(t, e) {
5517
5525
  // 状态变量
5518
5526
  h(this, "width", 0);
@@ -5573,7 +5581,7 @@ class Pe {
5573
5581
  }
5574
5582
  if (m > u)
5575
5583
  break;
5576
- !this.patternImage && this.context.getOptions().weekend.pattern && (this.patternImage = await zt.createPattern(
5584
+ !this.patternImage && this.context.getOptions().weekend.pattern && (this.patternImage = await Pt.createPattern(
5577
5585
  this.context.getOptions().weekend
5578
5586
  ));
5579
5587
  const x = new k.Rect({
@@ -5600,7 +5608,7 @@ class Pe {
5600
5608
  this.layer.batchDraw();
5601
5609
  }
5602
5610
  }
5603
- class Ne {
5611
+ class Ye {
5604
5612
  constructor(t, e, i) {
5605
5613
  h(this, "arrowAnimation");
5606
5614
  h(this, "todayLine");
@@ -5641,7 +5649,7 @@ class Ne {
5641
5649
  this.context.getOptions().today || {}
5642
5650
  );
5643
5651
  if (!t.show) return;
5644
- let e = R();
5652
+ let e = H();
5645
5653
  const i = this.context.store.getTimeAxis().getCellUnit();
5646
5654
  t.type === "block" && (e = e.startOf(i));
5647
5655
  const s = this.context.store.getTimeAxis().getTimeLeft(e), n = this.context.store.getTimeAxis().getCellWidth(), o = this.context.getOptions().header.height, r = B(t.backgroundColor).alpha(t.opacity).toHex(), a = (t.type === "block" ? s + n / 2 : s) + this.offsetX, c = [a, o, a, this.height], u = t.type === "line" ? t.width : n;
@@ -5686,8 +5694,8 @@ class Ne {
5686
5694
  fontFamily: b,
5687
5695
  padding: 5
5688
5696
  });
5689
- const L = this.todayTextGroup.findOne(".today-text-bg");
5690
- L == null || L.setAttrs({
5697
+ const O = this.todayTextGroup.findOne(".today-text-bg");
5698
+ O == null || O.setAttrs({
5691
5699
  width: C.width + 12,
5692
5700
  height: C.height + 8,
5693
5701
  fill: E
@@ -5716,7 +5724,7 @@ class Ne {
5716
5724
  (t = this.todayLine) == null || t.destroy(), (e = this.triangle) == null || e.destroy(), (i = this.todayTextGroup) == null || i.destroy(), (s = this.arrowAnimation) == null || s.stop(), this.arrowAnimation = void 0;
5717
5725
  }
5718
5726
  }
5719
- class Ye {
5727
+ class Ue {
5720
5728
  constructor(t, e) {
5721
5729
  // 状态变量
5722
5730
  h(this, "width", 0);
@@ -5769,9 +5777,9 @@ class Ye {
5769
5777
  for (let b = s; b <= n; b = b.add(1, "day")) {
5770
5778
  const w = t.find((C) => {
5771
5779
  if (X(C.date)) {
5772
- if (C.date.some((M) => R(M).isSame(b, "day")))
5780
+ if (C.date.some((M) => H(M).isSame(b, "day")))
5773
5781
  return C;
5774
- } else if (R(C.date).isSame(b, "day"))
5782
+ } else if (H(C.date).isSame(b, "day"))
5775
5783
  return C;
5776
5784
  });
5777
5785
  if (w) {
@@ -5782,13 +5790,13 @@ class Ye {
5782
5790
  break;
5783
5791
  !this.patternImage.has(w) && (w.pattern || this.context.getOptions().holiday.pattern) && this.patternImage.set(
5784
5792
  w,
5785
- await zt.createPattern({
5793
+ await Pt.createPattern({
5786
5794
  backgroundColor: this.context.getOptions().primaryColor,
5787
5795
  ...w,
5788
5796
  ...this.context.getOptions().holiday
5789
5797
  })
5790
5798
  );
5791
- const L = new k.Rect({
5799
+ const O = new k.Rect({
5792
5800
  name: "holiday-rect",
5793
5801
  x: C,
5794
5802
  y: M,
@@ -5806,25 +5814,25 @@ class Ye {
5806
5814
  opacity: w.opacity || this.context.getOptions().holiday.opacity
5807
5815
  }
5808
5816
  });
5809
- if (this.holidayGroup.add(L), (d = w.text) != null && d.show) {
5810
- if (X(w.date) && !R(w.date[0]).isSame(b, "day"))
5817
+ if (this.holidayGroup.add(O), (d = w.text) != null && d.show) {
5818
+ if (X(w.date) && !H(w.date[0]).isSame(b, "day"))
5811
5819
  continue;
5812
- const A = ((l = w.text) == null ? void 0 : l.fontSize) || 10, _ = ((m = w.text) == null ? void 0 : m.fontFamily) || "Arial", D = ((p = w.text) == null ? void 0 : p.content) || "", H = new k.Text({ fontSize: A, fontFamily: _ }).measureSize(D), W = ((g = w.text) == null ? void 0 : g.color) || "white", I = ((y = w.text) == null ? void 0 : y.backgroundColor) || w.backgroundColor || ((x = this.context.getOptions().holiday) == null ? void 0 : x.backgroundColor) || this.context.getOptions().primaryColor, G = new k.Group({
5820
+ const A = ((l = w.text) == null ? void 0 : l.fontSize) || 10, D = ((m = w.text) == null ? void 0 : m.fontFamily) || "Arial", _ = ((p = w.text) == null ? void 0 : p.content) || "", R = new k.Text({ fontSize: A, fontFamily: D }).measureSize(_), W = ((g = w.text) == null ? void 0 : g.color) || "white", I = ((y = w.text) == null ? void 0 : y.backgroundColor) || w.backgroundColor || ((x = this.context.getOptions().holiday) == null ? void 0 : x.backgroundColor) || this.context.getOptions().primaryColor, G = new k.Group({
5813
5821
  name: "holiday-text-group",
5814
5822
  x: C,
5815
5823
  y: M,
5816
5824
  opacity: (v = w.text) == null ? void 0 : v.opacity
5817
5825
  }), F = new k.Text({
5818
- text: D,
5826
+ text: _,
5819
5827
  fill: W,
5820
5828
  fontSize: A,
5821
- fontFamily: _,
5829
+ fontFamily: D,
5822
5830
  padding: 5
5823
5831
  }), z = new k.Rect({
5824
5832
  x: 0,
5825
5833
  y: 0,
5826
- width: H.width + 12,
5827
- height: H.height + 8,
5834
+ width: R.width + 12,
5835
+ height: R.height + 8,
5828
5836
  fill: I
5829
5837
  });
5830
5838
  G.add(z), G.add(F), this.holidayGroup.add(G);
@@ -5834,7 +5842,7 @@ class Ye {
5834
5842
  this.layer.batchDraw();
5835
5843
  }
5836
5844
  }
5837
- class Ue {
5845
+ class Xe {
5838
5846
  constructor(t, e) {
5839
5847
  // 状态变量
5840
5848
  h(this, "width", 0);
@@ -5882,7 +5890,7 @@ class Ue {
5882
5890
  if (!t || t.length === 0) return;
5883
5891
  const e = ((m = this.context.getOptions().flag) == null ? void 0 : m.backgroundColor) || this.context.getOptions().primaryColor, i = ((p = this.context.getOptions().flag) == null ? void 0 : p.opacity) || 1, s = ((g = this.context.getOptions().flag) == null ? void 0 : g.color) || (B(e).isDark() ? "white" : "black"), n = ((y = this.context.getOptions().flag) == null ? void 0 : y.fontFamily) || "Arial", o = ((x = this.context.getOptions().flag) == null ? void 0 : x.fontSize) || 10, r = Math.max(0, -this.offsetX), a = r + this.width, c = this.context.store.getTimeAxis().getCellWidth(), u = this.context.getOptions().header.height;
5884
5892
  this.context.getOptions().row.height, this.context.store.getDataManager().getVisibleSize(), t.forEach((v) => {
5885
- const b = R(v.date), w = this.context.store.getTimeAxis().getTimeLeft(b), C = u;
5893
+ const b = H(v.date), w = this.context.store.getTimeAxis().getTimeLeft(b), C = u;
5886
5894
  if (w + c < r || w > a)
5887
5895
  return;
5888
5896
  const E = [w, u, w, this.height], T = new k.Line({
@@ -5892,10 +5900,10 @@ class Ue {
5892
5900
  strokeWidth: 1
5893
5901
  });
5894
5902
  this.flagGroup.add(T);
5895
- const L = v.content || "";
5896
- if (L) {
5903
+ const O = v.content || "";
5904
+ if (O) {
5897
5905
  const A = new k.Text({
5898
- text: L,
5906
+ text: O,
5899
5907
  x: w + 5,
5900
5908
  // 添加一些内边距
5901
5909
  y: C + 5,
@@ -5905,14 +5913,14 @@ class Ue {
5905
5913
  fill: v.color || s,
5906
5914
  verticalAlign: "middle",
5907
5915
  align: "left"
5908
- }), _ = new k.Rect({
5916
+ }), D = new k.Rect({
5909
5917
  x: w,
5910
5918
  y: C,
5911
- width: A.measureSize(L).width + 12,
5912
- height: A.measureSize(L).height + 8,
5919
+ width: A.measureSize(O).width + 12,
5920
+ height: A.measureSize(O).height + 8,
5913
5921
  fill: v.backgroundColor || e
5914
5922
  });
5915
- this.flagGroup.add(_), this.flagGroup.add(A);
5923
+ this.flagGroup.add(D), this.flagGroup.add(A);
5916
5924
  } else if (v.flag)
5917
5925
  switch (v.flag) {
5918
5926
  case "banner":
@@ -5962,7 +5970,7 @@ class Ue {
5962
5970
  }), this.layer.batchDraw();
5963
5971
  }
5964
5972
  }
5965
- class Xe {
5973
+ class Ve {
5966
5974
  constructor(t, e, i) {
5967
5975
  h(this, "tasks", []);
5968
5976
  // 创建点组
@@ -6057,7 +6065,7 @@ class Xe {
6057
6065
  l.isMilestone() && (g += i / 2);
6058
6066
  const y = s + i * l.flatIndex;
6059
6067
  let x = !0, v = !0, b = this.context.store.getOptionManager().unpackFunc(this.context.getOptions().links.create.from, l);
6060
- if (lt(b) ? x = v = b : V(b) && (x = b === "S", v = b === "F"), x) {
6068
+ if (ct(b) ? x = v = b : V(b) && (x = b === "S", v = b === "F"), x) {
6061
6069
  const w = new k.Circle({
6062
6070
  id: `point-${l.id}-left`,
6063
6071
  x: m - g,
@@ -6101,11 +6109,11 @@ class Xe {
6101
6109
  */
6102
6110
  calculateLinks(t) {
6103
6111
  if (!this.context.getOptions().links.show) {
6104
- this.destroy();
6112
+ this.linksGroup.destroyChildren(), this.linkCache.clear();
6105
6113
  return;
6106
6114
  }
6107
6115
  if (this.tasks.length === 0) {
6108
- this.destroy();
6116
+ this.linksGroup.destroyChildren(), this.linkCache.clear();
6109
6117
  return;
6110
6118
  }
6111
6119
  const e = t != null && t.length ? t.reduce((s, n) => (s.push(...this.context.store.getLinkManager().getLinksByTaskId(n.id)), s), []) : this.context.store.getLinkManager().getLinks();
@@ -6119,14 +6127,14 @@ class Xe {
6119
6127
  if (s.valid === !1) return;
6120
6128
  const n = this.createId(s), o = this.context.store.getDataManager().getTaskById(s.from), r = this.context.store.getDataManager().getTaskById(s.to);
6121
6129
  if (!o) {
6122
- O.warn(
6130
+ L.warn(
6123
6131
  `No corresponding FROM task [${s.from}] was found for the link. Info:`,
6124
6132
  s
6125
6133
  ), s.valid = !1;
6126
6134
  return;
6127
6135
  }
6128
6136
  if (!r) {
6129
- O.warn(
6137
+ L.warn(
6130
6138
  `No corresponding TO task [${s.to}] was found for the link. Info:`,
6131
6139
  s
6132
6140
  ), s.valid = !1;
@@ -6138,7 +6146,7 @@ class Xe {
6138
6146
  if (!(this.context.store.getTimeAxis().getTimeLeft(((u = s.type) == null ? void 0 : u[0]) === "S" ? o.startTime : o.endTime) < a && this.context.store.getTimeAxis().getTimeLeft(((d = s.type) == null ? void 0 : d[1]) === "F" ? r.endTime : r.startTime) < a) && !(this.context.store.getTimeAxis().getTimeLeft(((l = s.type) == null ? void 0 : l[0]) === "S" ? o.startTime : o.endTime) > c && this.context.store.getTimeAxis().getTimeLeft(((m = s.type) == null ? void 0 : m[1]) === "F" ? r.endTime : r.startTime) > c) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, o) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, r)) {
6139
6147
  const v = this.getPoints(o, r, s);
6140
6148
  if (v.length <= 2)
6141
- O.warn("The link position has some error.", s);
6149
+ L.warn("The link position has some error.", s);
6142
6150
  else {
6143
6151
  const b = s.radius ?? this.context.getOptions().links.radius, w = ((p = s.arrow) == null ? void 0 : p.width) ?? this.context.getOptions().links.arrow.width, C = ((g = s.arrow) == null ? void 0 : g.height) ?? this.context.getOptions().links.arrow.height, M = s.width ?? this.context.getOptions().links.width;
6144
6152
  let E = this.linkCache.get(n);
@@ -6157,14 +6165,14 @@ class Xe {
6157
6165
  });
6158
6166
  E.add(I);
6159
6167
  }
6160
- const L = Math.floor(v.length / 2), A = L % 2 === 0 ? L : L - 1, _ = v.slice(0, A + 2), D = v.slice(A), H = E.findOne("Line");
6161
- if (H)
6162
- H.points(_), H.stroke(
6168
+ const O = Math.floor(v.length / 2), A = O % 2 === 0 ? O : O - 1, D = v.slice(0, A + 2), _ = v.slice(A), R = E.findOne("Line");
6169
+ if (R)
6170
+ R.points(D), R.stroke(
6163
6171
  s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
6164
- ), H.strokeWidth(M + (this.selectedMap.has(n) ? 2 : 0)), H.dash(s.dash || this.context.getOptions().links.dash);
6172
+ ), R.strokeWidth(M + (this.selectedMap.has(n) ? 2 : 0)), R.dash(s.dash || this.context.getOptions().links.dash);
6165
6173
  else {
6166
6174
  const I = new k.Line({
6167
- points: _,
6175
+ points: D,
6168
6176
  stroke: s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
6169
6177
  strokeWidth: M,
6170
6178
  lineCap: "round",
@@ -6187,14 +6195,14 @@ class Xe {
6187
6195
  }
6188
6196
  const W = E.findOne("Arrow");
6189
6197
  if (W)
6190
- W.points(D), W.stroke(
6198
+ W.points(_), W.stroke(
6191
6199
  s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
6192
6200
  ), W.strokeWidth(M + (this.selectedMap.has(n) ? 2 : 0)), W.pointerLength(C), W.pointerWidth(w), W.fill(
6193
6201
  ((y = s.arrow) == null ? void 0 : y.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
6194
6202
  ), W.lineJoin("round"), W.dash(s.dash || this.context.getOptions().links.dash);
6195
6203
  else {
6196
6204
  const I = new k.Arrow({
6197
- points: D,
6205
+ points: _,
6198
6206
  stroke: s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
6199
6207
  strokeWidth: M,
6200
6208
  pointerLength: C,
@@ -6295,7 +6303,7 @@ class Xe {
6295
6303
  {
6296
6304
  const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6297
6305
  if (isNaN(m))
6298
- O.error("Link's distance must be a Numeric");
6306
+ L.error("Link's distance must be a Numeric");
6299
6307
  else {
6300
6308
  const p = n + d + m, g = o - d - m, y = [
6301
6309
  Math.max(p, g),
@@ -6317,7 +6325,7 @@ class Xe {
6317
6325
  {
6318
6326
  const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6319
6327
  if (isNaN(m))
6320
- O.error("Link's distance must be a Numeric");
6328
+ L.error("Link's distance must be a Numeric");
6321
6329
  else {
6322
6330
  const p = n + d + m, g = r + d + m, y = [
6323
6331
  p <= g ? g : p,
@@ -6340,7 +6348,7 @@ class Xe {
6340
6348
  {
6341
6349
  const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6342
6350
  if (isNaN(m))
6343
- O.error("Link's distance must be a Numeric");
6351
+ L.error("Link's distance must be a Numeric");
6344
6352
  else {
6345
6353
  const p = s - d - m, g = o - d - m;
6346
6354
  l.push(
@@ -6363,7 +6371,7 @@ class Xe {
6363
6371
  {
6364
6372
  const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6365
6373
  if (isNaN(m))
6366
- O.error("Link's distance must be a Numeric");
6374
+ L.error("Link's distance must be a Numeric");
6367
6375
  else {
6368
6376
  const p = s - d - m, g = r + d + m, y = [
6369
6377
  Math.min(p, g),
@@ -6407,19 +6415,19 @@ class Xe {
6407
6415
  b.x <= M ? r = "S" : (r = "F", E = C + d);
6408
6416
  let T;
6409
6417
  if (i === "S" ? T = `${r}${(e.type || "FS")[1]}` : T = `${(e.type || "FS")[0]}${r}`, i === "S") {
6410
- const { allowLeft: L, allowRight: A } = this.isAllowStartDrop(l, e.to, T);
6418
+ const { allowLeft: O, allowRight: A } = this.isAllowStartDrop(l, e.to, T);
6411
6419
  this.templateArrow.points([
6412
6420
  E,
6413
6421
  u + c * l.flatIndex,
6414
6422
  ...s
6415
6423
  ]), A ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
6416
6424
  } else if (i === "F") {
6417
- const { allowLeft: L, allowRight: A } = this.isAllowEndDrop(l, e.from, T);
6425
+ const { allowLeft: O, allowRight: A } = this.isAllowEndDrop(l, e.from, T);
6418
6426
  this.templateArrow.points([
6419
6427
  ...s,
6420
6428
  E,
6421
6429
  u + c * l.flatIndex
6422
- ]), L ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
6430
+ ]), O ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
6423
6431
  }
6424
6432
  }
6425
6433
  }, p = () => {
@@ -6428,8 +6436,8 @@ class Xe {
6428
6436
  const w = J(e);
6429
6437
  if (r && l && (i === "S" ? (b = `${r}${(e.type || "FS")[1]}`, w.from = l.id) : i === "F" && (b = `${(e.type || "FS")[0]}${r}`, w.to = l.id)), b && l) {
6430
6438
  w.type = b;
6431
- let E = !1, T = !1, L;
6432
- i === "S" ? { allowLeft: E, allowRight: T, reason: L } = this.isAllowStartDrop(l, w.to, w.type, !0) : i === "F" && ({ allowLeft: E, allowRight: T, reason: L } = this.isAllowEndDrop(l, w.from, w.type, !0)), ((C = w.type) == null ? void 0 : C.slice(1)) === "S" && E || ((M = w.type) == null ? void 0 : M.slice(1)) === "F" && T ? (this.context.event.emit(S.UPDATE_LINK, w), this.context.store.getLinkManager().update(), this.calculateLinks()) : this.context.event.emit(S.ERROR, L || Y.LINK_NOT_ALLOWED);
6439
+ let E = !1, T = !1, O;
6440
+ i === "S" ? { allowLeft: E, allowRight: T, reason: O } = this.isAllowStartDrop(l, w.to, w.type, !0) : i === "F" && ({ allowLeft: E, allowRight: T, reason: O } = this.isAllowEndDrop(l, w.from, w.type, !0)), ((C = w.type) == null ? void 0 : C.slice(1)) === "S" && E || ((M = w.type) == null ? void 0 : M.slice(1)) === "F" && T ? (this.context.event.emit(S.UPDATE_LINK, w), this.context.store.getLinkManager().update(), this.calculateLinks()) : this.context.event.emit(S.ERROR, O || Y.LINK_NOT_ALLOWED);
6433
6441
  } else
6434
6442
  this.context.event.emit(S.ERROR, Y.TASK_NOT_FOUND);
6435
6443
  this.cleanupTempLink(), this.calculateLinks([l, this.context.store.getDataManager().getTaskById(e.from), this.context.store.getDataManager().getTaskById(e.to)].filter((E) => !!E)), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p);
@@ -6517,7 +6525,7 @@ class Xe {
6517
6525
  j(r) && (r = r(
6518
6526
  t.getEmitData(),
6519
6527
  this.context.store.getDataManager().getTaskById(e).getEmitData()
6520
- )), lt(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
6528
+ )), ct(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
6521
6529
  const a = this.validateChain(t.id, e, i, s);
6522
6530
  return {
6523
6531
  allowLeft: n && a.ok,
@@ -6533,7 +6541,7 @@ class Xe {
6533
6541
  j(r) && (r = r(
6534
6542
  t.getEmitData(),
6535
6543
  this.context.store.getDataManager().getTaskById(e).getEmitData()
6536
- )), lt(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
6544
+ )), ct(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
6537
6545
  const a = this.validateChain(e, t.id, i, s);
6538
6546
  return {
6539
6547
  allowLeft: n && a.ok,
@@ -6600,7 +6608,7 @@ class Xe {
6600
6608
  });
6601
6609
  }
6602
6610
  }
6603
- class Ve {
6611
+ class Ke {
6604
6612
  constructor(t, e, i) {
6605
6613
  h(this, "tasks", []);
6606
6614
  h(this, "chartBaselineGroup");
@@ -6775,7 +6783,7 @@ class Ve {
6775
6783
  radius: n.size / 2
6776
6784
  });
6777
6785
  this.indicatorGroup.add(p);
6778
- let g = `${ft(i.startDiff)}${i.unit} ${m}`;
6786
+ let g = `${pt(i.startDiff)}${i.unit} ${m}`;
6779
6787
  const y = s.compare.indicator[m].text;
6780
6788
  j(y) ? g = y(i.startDiff, { ...t.getEmitData(), baseline: e }) : V(y) && (g = y);
6781
6789
  const x = new k.Text({
@@ -6799,7 +6807,7 @@ class Ve {
6799
6807
  radius: n.size / 2
6800
6808
  });
6801
6809
  this.indicatorGroup.add(p);
6802
- let g = `${ft(i.endDiff)}${i.unit} ${m}`;
6810
+ let g = `${pt(i.endDiff)}${i.unit} ${m}`;
6803
6811
  const y = s.compare.indicator[m].text;
6804
6812
  j(y) ? g = y(i.endDiff, { ...t.getEmitData(), baseline: e }) : V(y) && (g = y);
6805
6813
  const x = new k.Text({
@@ -6826,7 +6834,7 @@ class Ve {
6826
6834
  });
6827
6835
  }
6828
6836
  }
6829
- class Ke {
6837
+ class je {
6830
6838
  constructor(t, e) {
6831
6839
  // Konva 元素
6832
6840
  h(this, "stage");
@@ -6848,7 +6856,7 @@ class Ke {
6848
6856
  container: this.container,
6849
6857
  width: this.container.clientWidth,
6850
6858
  height: this.container.clientHeight
6851
- }), this.bgLayer = new k.Layer(), this.weekendGroup = new Pe(this.context, this.bgLayer), this.holidayGroup = new Ye(this.context, this.bgLayer), this.flagGroup = new Ue(this.context, this.bgLayer), this.gridGroup = new $e(this.context, this.bgLayer), this.stage.add(this.bgLayer), this.axisLayer = new k.Layer(), this.headerLayer = new We(this.context, this.axisLayer), this.todayLayer = new Ne(this.context, this.bgLayer, this.axisLayer), this.stage.add(this.axisLayer), this.bodyLayer = new k.Layer(), this.linkGroup = new Xe(this.context, this.stage, this.bodyLayer), this.baselineGroup = new Ve(this.context, this.stage, this.bodyLayer), this.bodyGroup = new ze(this.context, this.stage, this.bodyLayer, this.bgLayer), this.stage.add(this.bodyLayer);
6859
+ }), this.bgLayer = new k.Layer(), this.weekendGroup = new Ne(this.context, this.bgLayer), this.holidayGroup = new Ue(this.context, this.bgLayer), this.flagGroup = new Xe(this.context, this.bgLayer), this.gridGroup = new Fe(this.context, this.bgLayer), this.stage.add(this.bgLayer), this.axisLayer = new k.Layer(), this.headerLayer = new $e(this.context, this.axisLayer), this.todayLayer = new Ye(this.context, this.bgLayer, this.axisLayer), this.stage.add(this.axisLayer), this.bodyLayer = new k.Layer(), this.linkGroup = new Ve(this.context, this.stage, this.bodyLayer), this.baselineGroup = new Ke(this.context, this.stage, this.bodyLayer), this.bodyGroup = new Pe(this.context, this.stage, this.bodyLayer, this.bgLayer), this.stage.add(this.bodyLayer);
6852
6860
  }
6853
6861
  /**
6854
6862
  * 调整大小
@@ -6875,8 +6883,8 @@ class Ke {
6875
6883
  this.headerLayer.destroy(), this.gridGroup.destroy(), this.bodyLayer.destroy(), this.todayLayer.destroy(), this.holidayGroup.destroy(), this.flagGroup.destroy(), this.weekendGroup.destroy(), this.linkGroup.destroy(), this.baselineGroup.destroy(), this.axisLayer.destroy(), this.bgLayer.destroy(), this.stage.destroy();
6876
6884
  }
6877
6885
  }
6878
- const je = '<svg style="transition: all 0.3s" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M8.293 12.707a1 1 0 0 1 0-1.414l5.657-5.657a1 1 0 1 1 1.414 1.414L10.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414z"/></g></svg>';
6879
- class qe {
6886
+ const qe = '<svg style="transition: all 0.3s" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M8.293 12.707a1 1 0 0 1 0-1.414l5.657-5.657a1 1 0 1 1 1.414 1.414L10.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414z"/></g></svg>';
6887
+ class Qe {
6880
6888
  constructor(t, e) {
6881
6889
  h(this, "line");
6882
6890
  h(this, "initialX", 0);
@@ -6886,9 +6894,17 @@ class qe {
6886
6894
  "border-left-color",
6887
6895
  this.root.store.getOptionManager().getOptions().border.color,
6888
6896
  "important"
6889
- ), this.line.style.cursor = "col-resize", this.collapseButton = document.createElement("div"), this.collapseButton.className = "x-gantt-collapse-button", this.collapseButton.style.position = "absolute", this.collapseButton.style.top = "50%", this.collapseButton.style.left = "0", this.collapseButton.style.transform = "translateY(-50%)", this.collapseButton.style.cursor = "pointer", this.collapseButton.style.width = "16px", this.collapseButton.style.height = "30px", this.collapseButton.style.backgroundColor = "#fff", this.collapseButton.style.borderRadius = "0 6px 6px 0", this.collapseButton.style.boxShadow = "0 0 2px rgba(0, 0, 0, 0.2)", this.collapseButton.style.display = "flex", this.collapseButton.style.alignItems = "center", this.collapseButton.style.justifyContent = "center", this.collapseButton.innerHTML = je, this.collapseButton.addEventListener("click", (i) => {
6897
+ ), this.line.style.cursor = "col-resize", this.root.store.getOptionManager().getOptions().collapse.show && (this.collapseButton = document.createElement("div"), this.collapseButton.className = "x-gantt-collapse-button", this.collapseButton.style.position = "absolute", this.collapseButton.style.top = "50%", this.collapseButton.style.left = "0", this.collapseButton.style.transform = "translateY(-50%)", this.collapseButton.style.cursor = "pointer", this.collapseButton.style.width = "16px", this.collapseButton.style.height = "30px", this.collapseButton.style.backgroundColor = this.root.store.getOptionManager().getOptions().collapse.backgroundColor || "#fff", this.collapseButton.style.borderRadius = `0 ${this.root.store.getOptionManager().getOptions().collapse.radius}px ${this.root.store.getOptionManager().getOptions().collapse.radius}px 0`, this.collapseButton.style.boxShadow = "0 0 2px rgba(0, 0, 0, 0.2)", this.collapseButton.style.display = "flex", this.collapseButton.style.alignItems = "center", this.collapseButton.style.justifyContent = "center", this.collapseButton.innerHTML = qe, this.collapseButton.addEventListener("click", (i) => {
6890
6898
  i.stopPropagation(), this.root.store.getColumnManager().collapse();
6891
- }), this.line.appendChild(this.collapseButton), this.container.appendChild(this.line), this.addDragEvents();
6899
+ }), this.line.appendChild(this.collapseButton)), this.container.appendChild(this.line), this.addDragEvents(), this.initEvents();
6900
+ }
6901
+ /**
6902
+ * 初始化事件
6903
+ */
6904
+ initEvents() {
6905
+ this.root.event.on(S.OPTIONS_UPDATE, () => {
6906
+ this.updateOptions();
6907
+ });
6892
6908
  }
6893
6909
  setOffset(t) {
6894
6910
  this.line.style.transform = `translateX(${t - 2}px)`, this.initialX = t, this.collapseButton && (this.root.store.getColumnManager().isCollapsed() ? this.collapseButton.querySelector("svg").style.transform = "rotate(180deg)" : this.collapseButton.querySelector("svg").style.transform = "rotate(0deg)");
@@ -6919,8 +6935,18 @@ class qe {
6919
6935
  };
6920
6936
  this.line.addEventListener("mousedown", n);
6921
6937
  }
6938
+ /**
6939
+ * 更新配置
6940
+ */
6941
+ updateOptions() {
6942
+ this.line.style.setProperty(
6943
+ "border-left-color",
6944
+ this.root.store.getOptionManager().getOptions().border.color,
6945
+ "important"
6946
+ ), this.collapseButton && (this.collapseButton.style.backgroundColor = this.root.store.getOptionManager().getOptions().collapse.backgroundColor || "#fff", this.collapseButton.style.borderRadius = `0 ${this.root.store.getOptionManager().getOptions().collapse.radius}px ${this.root.store.getOptionManager().getOptions().collapse.radius}px 0`);
6947
+ }
6922
6948
  }
6923
- class Qe {
6949
+ class Ze {
6924
6950
  /**
6925
6951
  * @param container 指示线的容器元素
6926
6952
  */
@@ -6952,6 +6978,8 @@ class Qe {
6952
6978
  this.hide();
6953
6979
  }), this.context.event.on(S.MOVE_GUIDELINE, (t) => {
6954
6980
  this.setLeft(t);
6981
+ }), this.context.event.on(S.OPTIONS_UPDATE, () => {
6982
+ this.updateOptions();
6955
6983
  });
6956
6984
  }
6957
6985
  /**
@@ -6994,8 +7022,18 @@ class Qe {
6994
7022
  getLeft() {
6995
7023
  return this.element.offsetLeft;
6996
7024
  }
7025
+ /**
7026
+ * 更新参数
7027
+ */
7028
+ updateOptions() {
7029
+ this.element.style.setProperty(
7030
+ "border-left",
7031
+ `1px dashed ${this.context.getOptions().border.color}`,
7032
+ "important"
7033
+ );
7034
+ }
6997
7035
  }
6998
- class Ze {
7036
+ class Je {
6999
7037
  constructor(t = 16) {
7000
7038
  h(this, "taskQueue", /* @__PURE__ */ new Map());
7001
7039
  // 使用 Map 避免同类型重复任务
@@ -7005,7 +7043,7 @@ class Ze {
7005
7043
  h(this, "delay");
7006
7044
  // 使用 debounce 来延迟执行,避免短时间内多次触发
7007
7045
  h(this, "debouncedFlush");
7008
- this.delay = t, this.debouncedFlush = Vt(() => {
7046
+ this.delay = t, this.debouncedFlush = Kt(() => {
7009
7047
  this.flushTaskQueue();
7010
7048
  }, t);
7011
7049
  }
@@ -7015,7 +7053,7 @@ class Ze {
7015
7053
  * @param handler 处理器配置
7016
7054
  */
7017
7055
  registerHandler(t, e) {
7018
- this.taskHandlers.set(t, e), O.debug(`RenderScheduler: 注册任务处理器 ${t}`);
7056
+ this.taskHandlers.set(t, e), L.debug(`RenderScheduler: 注册任务处理器 ${t}`);
7019
7057
  }
7020
7058
  /**
7021
7059
  * 注册任务处理器(简化版本,只传回调函数)
@@ -7035,7 +7073,7 @@ class Ze {
7035
7073
  scheduleTask(t, e = [], i = {}) {
7036
7074
  const s = this.taskHandlers.get(t);
7037
7075
  if (!s) {
7038
- O.warn(`RenderScheduler: 未找到任务类型 ${t} 的处理器`);
7076
+ L.warn(`RenderScheduler: 未找到任务类型 ${t} 的处理器`);
7039
7077
  return;
7040
7078
  }
7041
7079
  const n = {
@@ -7046,10 +7084,10 @@ class Ze {
7046
7084
  immediate: i.immediate ?? s.immediate ?? !1
7047
7085
  };
7048
7086
  if (n.immediate) {
7049
- O.debug(`RenderScheduler: 立即执行任务 ${t}`), this.executeTask(n);
7087
+ L.debug(`RenderScheduler: 立即执行任务 ${t}`), this.executeTask(n);
7050
7088
  return;
7051
7089
  }
7052
- this.taskQueue.set(t, n), O.debug(`RenderScheduler: 添加任务到队列 ${t}`), this.debouncedFlush();
7090
+ this.taskQueue.set(t, n), L.debug(`RenderScheduler: 添加任务到队列 ${t}`), this.debouncedFlush();
7053
7091
  }
7054
7092
  /**
7055
7093
  * 立即执行指定类型的任务(跳过队列)
@@ -7060,10 +7098,10 @@ class Ze {
7060
7098
  immediateExecuteTask(t, e = [], i = !1) {
7061
7099
  const s = this.taskHandlers.get(t);
7062
7100
  if (!s) {
7063
- O.warn(`RenderScheduler: 未找到任务类型 ${t} 的处理器`);
7101
+ L.warn(`RenderScheduler: 未找到任务类型 ${t} 的处理器`);
7064
7102
  return;
7065
7103
  }
7066
- O.debug(`RenderScheduler: 立即执行任务 ${t}`);
7104
+ L.debug(`RenderScheduler: 立即执行任务 ${t}`);
7067
7105
  const n = {
7068
7106
  type: t,
7069
7107
  refresh: i,
@@ -7077,7 +7115,7 @@ class Ze {
7077
7115
  * 立即执行所有队列中的任务
7078
7116
  */
7079
7117
  immediateFlushAll() {
7080
- O.debug("RenderScheduler: 立即执行所有队列任务"), this.cancelScheduled(), this.flushTaskQueue();
7118
+ L.debug("RenderScheduler: 立即执行所有队列任务"), this.cancelScheduled(), this.flushTaskQueue();
7081
7119
  }
7082
7120
  /**
7083
7121
  * 执行单个任务
@@ -7087,7 +7125,7 @@ class Ze {
7087
7125
  try {
7088
7126
  t.callback(...t.args || []);
7089
7127
  } catch (e) {
7090
- O.error(`RenderScheduler: 执行任务 ${t.type} 时出错:`, e);
7128
+ L.error(`RenderScheduler: 执行任务 ${t.type} 时出错:`, e);
7091
7129
  }
7092
7130
  }
7093
7131
  /**
@@ -7096,7 +7134,7 @@ class Ze {
7096
7134
  flushTaskQueue() {
7097
7135
  if (this.taskQueue.size === 0)
7098
7136
  return;
7099
- O.debug(
7137
+ L.debug(
7100
7138
  `RenderScheduler: 执行任务队列,任务数量: ${this.taskQueue.size}`
7101
7139
  );
7102
7140
  const t = Array.from(this.taskQueue.values()).sort((e, i) => e.immediate !== i.immediate ? e.immediate ? -1 : 1 : e.refresh !== i.refresh ? e.refresh ? -1 : 1 : 0);
@@ -7115,7 +7153,7 @@ class Ze {
7115
7153
  * @param taskType 任务类型
7116
7154
  */
7117
7155
  unregisterHandler(t) {
7118
- this.taskHandlers.delete(t), this.taskQueue.delete(t), O.debug(`RenderScheduler: 移除任务处理器 ${t}`);
7156
+ this.taskHandlers.delete(t), this.taskQueue.delete(t), L.debug(`RenderScheduler: 移除任务处理器 ${t}`);
7119
7157
  }
7120
7158
  /**
7121
7159
  * 获取当前队列中的任务数量
@@ -7133,10 +7171,10 @@ class Ze {
7133
7171
  * 销毁调度器
7134
7172
  */
7135
7173
  destroy() {
7136
- this.cancelScheduled(), this.taskHandlers.clear(), O.debug("RenderScheduler: 已销毁");
7174
+ this.cancelScheduled(), this.taskHandlers.clear(), L.debug("RenderScheduler: 已销毁");
7137
7175
  }
7138
7176
  }
7139
- class Je {
7177
+ class ti {
7140
7178
  constructor(t, e) {
7141
7179
  h(this, "scrollbar");
7142
7180
  h(this, "rootElement");
@@ -7206,12 +7244,12 @@ class Je {
7206
7244
  this.table.updateWidth(), this.updateSize();
7207
7245
  });
7208
7246
  var i;
7209
- this.context = t, this.container = e, this.rootElement = document.createElement("div"), this.rootElement.id = `x-gantt-${this._id}`, this.rootElement.className = "x-gantt", this.rootElement.style.overflow = "hidden", this.rootElement.style.display = "flex", this.rootElement.style.position = "relative", this.container.appendChild(this.rootElement), this.tableContainer = document.createElement("div"), this.tableContainer.className = "x-gantt-table", this.rootElement.appendChild(this.tableContainer), new Qe(this.context, this.container), this.middleLine = new qe(this.context, this.rootElement), this.chartContainer = document.createElement("div"), this.chartContainer.className = "x-gantt-chart", this.rootElement.appendChild(this.chartContainer), this.table = new Ge(this.context, this.tableContainer), this.chart = new Ke(this.context, this.chartContainer), this.scrollbar = new Ae(
7247
+ this.context = t, this.container = e, this.rootElement = document.createElement("div"), this.rootElement.id = `x-gantt-${this._id}`, this.rootElement.className = "x-gantt", this.rootElement.style.overflow = "hidden", this.rootElement.style.display = "flex", this.rootElement.style.position = "relative", this.container.appendChild(this.rootElement), this.tableContainer = document.createElement("div"), this.tableContainer.className = "x-gantt-table", this.rootElement.appendChild(this.tableContainer), new Ze(this.context, this.container), this.middleLine = new Qe(this.context, this.rootElement), this.chartContainer = document.createElement("div"), this.chartContainer.className = "x-gantt-chart", this.rootElement.appendChild(this.chartContainer), this.table = new We(this.context, this.tableContainer), this.chart = new je(this.context, this.chartContainer), this.scrollbar = new Ie(
7210
7248
  this.context,
7211
7249
  this.rootElement,
7212
7250
  this.context.store.getOptionManager().getOptions().scrollbar || {}
7213
7251
  // 传入配置项
7214
- ), this.renderScheduler = new Ze(16), this.setupTaskHandlers(), this.updateSize(), this.setupEventListeners(), (i = this.context.store.getOptionManager().getOptions().resize) != null && i.enabled && (typeof window.ResizeObserver > "u" ? O.warn(
7252
+ ), this.renderScheduler = new Je(16), this.setupTaskHandlers(), this.updateSize(), this.setupEventListeners(), (i = this.context.store.getOptionManager().getOptions().resize) != null && i.enabled && (typeof window.ResizeObserver > "u" ? L.warn(
7215
7253
  "Current environment does not support ResizeObserver, please include a polyfill to enable auto-resize feature."
7216
7254
  ) : (this.resizeObserver = new ResizeObserver(() => {
7217
7255
  this.updateSize(), this.renderScheduler.scheduleTask("VIEW_UPDATE", [!1]);
@@ -7281,7 +7319,7 @@ class Je {
7281
7319
  performRender(t = !1, e = !1) {
7282
7320
  this.setStyleValue();
7283
7321
  const { x: i, y: s } = this.scrollbar.getScrollPosition(), n = this.context.store.getOptionManager().getOptions().row.height, o = this.context.store.getOptionManager().getOptions().header.height, r = Math.floor(s / n), a = Math.ceil((this.height - o) / n), c = 2, u = Math.max(0, r), d = a + c, l = this.context.store.getDataManager().getVisibleTasks().slice(u, u + d);
7284
- this.updateSize(), e ? (this.table.refresh(s, l), this.chart.refresh(i, s, l, !0)) : t ? (this.table.refresh(s, l), this.chart.refresh(i, s, l)) : (this.table.render(s, l), this.chart.render(i, s, l)), this.isInitialized && (this.context.event.emit(S.LOADED), this.isInitialized = !1), O.debug("execute render");
7322
+ this.updateSize(), e ? (this.table.refresh(s, l), this.chart.refresh(i, s, l, !0)) : t ? (this.table.refresh(s, l), this.chart.refresh(i, s, l)) : (this.table.render(s, l), this.chart.render(i, s, l)), this.isInitialized && (this.context.event.emit(S.LOADED), this.isInitialized = !1), L.debug("execute render");
7285
7323
  }
7286
7324
  /**
7287
7325
  * 公共渲染方法,向后兼容
@@ -7302,16 +7340,16 @@ class Je {
7302
7340
  );
7303
7341
  }
7304
7342
  destroy() {
7305
- O.debug("Renderer destroy"), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0), this.renderScheduler.destroy(), this.scrollbar.destroy(), this.context.event.offAll();
7343
+ L.debug("Renderer destroy"), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0), this.renderScheduler.destroy(), this.scrollbar.destroy(), this.context.event.offAll();
7306
7344
  }
7307
7345
  }
7308
- class ti {
7346
+ class ei {
7309
7347
  constructor(t, e, i) {
7310
7348
  h(this, "_id", Q());
7311
7349
  h(this, "store");
7312
- h(this, "event", new qt());
7350
+ h(this, "event", new Qt());
7313
7351
  h(this, "renderer");
7314
- this.container = t, this.events = e, this.container.innerHTML = "", this.store = new _e(this, i), this.renderer = new Je(this, this.container), this.render(), this.registerEvents(), O.debug(
7352
+ this.container = t, this.events = e, this.container.innerHTML = "", this.store = new Ae(this, i), this.renderer = new ti(this, this.container), this.render(), this.registerEvents(), L.debug(
7315
7353
  "----Gantt initialized for element:",
7316
7354
  this._id,
7317
7355
  this.container
@@ -7336,10 +7374,10 @@ class ti {
7336
7374
  this.renderer.render();
7337
7375
  }
7338
7376
  updateOptions(t, e) {
7339
- this.setOptions(t, e), O.debug("GanttChart options updated"), this.render();
7377
+ this.setOptions(t, e), L.debug("GanttChart options updated"), this.render();
7340
7378
  }
7341
7379
  destroy() {
7342
- O.debug("Gantt destroying..."), this.event.offAll(), this.renderer.destroy(), this.container.innerHTML = "";
7380
+ L.debug("Gantt destroying..."), this.event.offAll(), this.renderer.destroy(), this.container.innerHTML = "";
7343
7381
  }
7344
7382
  /**
7345
7383
  * 跳转到指定日期。默认为今天
@@ -7347,7 +7385,7 @@ class ti {
7347
7385
  * @return {boolean} 是否成功跳转
7348
7386
  */
7349
7387
  jumpTo(t) {
7350
- const e = R(t);
7388
+ const e = H(t);
7351
7389
  if (!this.store.getTimeAxis().isInTimeAxis(e)) return !1;
7352
7390
  const i = this.store.getTimeAxis().getTimeLeft(e) - 100;
7353
7391
  return this.renderer.getScrollbar().scrollTo({ x: Math.max(i, 0) }), !0;
@@ -7459,12 +7497,12 @@ class ti {
7459
7497
  });
7460
7498
  }
7461
7499
  }
7462
- class oi {
7500
+ class ri {
7463
7501
  constructor(t, e) {
7464
7502
  h(this, "context");
7465
7503
  // 管理对外事件
7466
7504
  h(this, "events", /* @__PURE__ */ new Map());
7467
- e != null && e.logLevel && O.setOptions({
7505
+ e != null && e.logLevel && L.setOptions({
7468
7506
  showTimestamp: e.logLevel === "debug",
7469
7507
  level: {
7470
7508
  debug: 1,
@@ -7476,8 +7514,8 @@ class oi {
7476
7514
  });
7477
7515
  const i = typeof t == "string" ? document.querySelector(t) : t;
7478
7516
  if (!i)
7479
- throw O.exception(`Container ${t} not found or invalid.`);
7480
- i.innerHTML = "", i.classList.add("x-gantt-container"), this.context = new ti(i, this.events, e);
7517
+ throw L.exception(`Container ${t} not found or invalid.`);
7518
+ i.innerHTML = "", i.classList.add("x-gantt-container"), this.context = new ei(i, this.events, e);
7481
7519
  }
7482
7520
  // *** Public API Methods ***/
7483
7521
  /**
@@ -7531,7 +7569,7 @@ class oi {
7531
7569
  * @description 此方法通常不需要主动调用,初始化以及 `update` 中都会自动更新。 如果你需要强制刷新页面,可以在合适的时候调用此方法
7532
7570
  */
7533
7571
  render() {
7534
- this.context.render(), O.info("Gantt rendered successfully.");
7572
+ this.context.render(), L.info("Gantt rendered successfully.");
7535
7573
  }
7536
7574
  /**
7537
7575
  * 销毁甘特图实例,清理所有资源
@@ -7568,7 +7606,7 @@ class oi {
7568
7606
  * @warning 销毁后的实例不能再次使用,调用任何方法都可能导致错误
7569
7607
  */
7570
7608
  destroy() {
7571
- O.info("Gantt destroying..."), this.events.clear(), this.context.destroy(), O.info("Gantt destroyed successfully.");
7609
+ L.info("Gantt destroying..."), this.events.clear(), this.context.destroy(), L.info("Gantt destroyed successfully.");
7572
7610
  }
7573
7611
  /**
7574
7612
  * 跳转到指定日期
@@ -7819,12 +7857,12 @@ class oi {
7819
7857
  return this.context.store.getDataManager().deleteTaskById(t);
7820
7858
  }
7821
7859
  }
7822
- Kt();
7823
- const ri = Mt;
7860
+ jt();
7861
+ const ai = Ot;
7824
7862
  export {
7825
- oi as XGantt,
7863
+ ri as XGantt,
7826
7864
  B as colorjs,
7827
- li as dayjs,
7865
+ ci as dayjs,
7828
7866
  Q as generateId,
7829
- ri as version
7867
+ ai as version
7830
7868
  };