gantt-source_management 3.37.8 → 3.38.0

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.
@@ -539,87 +539,73 @@ class a {
539
539
  }
540
540
  }
541
541
  selectItemsIndividually(i) {
542
- if (
543
- ((this.data.isSelecting = !1),
544
- (this.data.selectionAreaLocal = this.getSelectionAreaLocal(i)),
545
- (this.data.currentPosition = i.currentPosition),
546
- (this.data.initialPosition = i.initialPosition),
547
- !this.data.items || i.type !== 'down'
548
- )
549
- )
550
- return;
542
+ this.data.isSelecting = false;
543
+ this.data.selectionAreaLocal = this.getSelectionAreaLocal(i);
544
+ this.data.currentPosition = i.currentPosition;
545
+ this.data.initialPosition = i.initialPosition;
546
+
547
+ if (!this.data.items) return;
551
548
  if (!this.canSelect()) return;
552
549
  if (!i.targetData) return;
553
- const s = this.merge({}, i.targetData),
554
- a = this.api.getItemData(s.id);
555
- if (!a)
556
- throw (
557
- (console.error(
558
- '"config.chart.items"',
559
- this.state.get("config.chart.items"),
560
- ),
561
- console.error(
562
- '"$data.chart.items"',
563
- this.state.get("$data.chart.items"),
564
- ),
565
- new Error(
566
- `Item with id"${s.id}"does not exists in"$data.chart.items".TIP:For performance reasons,state is mutable,so try not to modify items from the"state.get"method before you copy them(with"gstc.api.clone(items)"for example).`,
567
- ))
568
- );
569
- if (this.data.selected[e].includes(s.id)){
570
550
 
551
+ const s = this.merge({}, i.targetData);
552
+ const a = this.api.getItemData(s.id);
553
+ if (!a) {
554
+ console.error('"config.chart.items"', this.state.get("config.chart.items"));
555
+ console.error('"$data.chart.items"', this.state.get("$data.chart.items"));
556
+ throw new Error(`Item with id "${s.id}" does not exists in "$data.chart.items". TIP:For performance reasons, state is mutable, so try not to modify items from the "state.get" method before you copy them.`);
557
+ }
558
+
559
+ if (this.data.selected[e].includes(s.id)) {
560
+ if (i.type !== 'up') {
561
+ return;
562
+ }
563
+ if (i.isMoving) {
564
+ return;
565
+ }
571
566
  if (this.isMulti()) {
572
- // 多选模式下,从已选择列表中移除该项目
573
567
  this.data.selected[e] = this.data.selected[e].filter((itemId) => itemId !== s.id);
574
568
  this.data.automaticallySelected[e] = this.data.automaticallySelected[e].filter((itemId) => itemId !== s.id);
575
569
  } else {
576
- // 单选模式下,清空已选择列表
577
570
  this.data.selected[e] = [];
578
571
  this.data.selected[t] = [];
579
572
  this.data.automaticallySelected[e] = [];
580
573
  }
581
- // 记录最后一次选择的状态
582
- this.data.lastSelecting = {
583
- [e]: [...this.data.selected[e]],
584
- [t]: [...this.data.selected[t]],
585
- };
586
574
 
575
+ this.data.lastSelecting = {
576
+ [e]: [...this.data.selected[e]],
577
+ [t]: [...this.data.selected[t]]
578
+ };
587
579
 
588
- // 更新状态
589
580
  let c = this.state.multi(true);
590
581
  c = this.updateCells(c);
591
582
  c = this.updateItems(c);
592
583
  c.done();
593
-
584
+ this.updateData();
594
585
  return;
595
586
  }
587
+
596
588
  let { selected: l, automaticallySelected: n } = this.getSelectedItem(s);
597
- l.length > 1 && !this.data.multipleSelection && ((l = [s.id]), (n = [])),
598
- this.isMulti()
599
- ? a.selected
600
- ? (this.data.selected[e] = l.filter(
601
- (t) => t !== s.id && !n.includes(t),
602
- ))
603
- : (this.data.selected[e] = l)
604
- : ((this.data.selected[e] = l), (this.data.selected[t].length = 0)),
605
- (this.data.automaticallySelected[e] = n),
606
- (this.data.lastSelecting = {
607
- [e]: [],
608
- [t]: [],
609
- }),
610
- (this.data.selected = this.onSelected(
611
- this.api.mergeDeep({}, this.data.selected),
612
- this.api.mergeDeep({}, this.data.lastSelected),
613
- )
589
+ l.length > 1 && !this.data.multipleSelection && ((l = [s.id]), (n = []));
590
+ this.isMulti()
591
+ ? a.selected
592
+ ? (this.data.selected[e] = l.filter((t) => t !== s.id && !n.includes(t)))
593
+ : (this.data.selected[e] = l)
594
+ : ((this.data.selected[e] = l), (this.data.selected[t].length = 0));
595
+ this.data.automaticallySelected[e] = n;
596
+ this.data.lastSelecting = {
597
+ [e]: [],
598
+ [t]: [],
599
+ };
600
+ this.data.selected = this.onSelected(
601
+ this.api.mergeDeep({}, this.data.selected),
602
+ this.api.mergeDeep({}, this.data.lastSelected),
614
603
  );
615
- //
616
- this.data.selected[e] = [];
617
- this.data.selected[t] = [];
618
- this.data.automaticallySelected[e] = [];
619
- ////////
604
+
620
605
  let c = this.state.multi(!0);
621
606
  (c = this.updateCells(c)), (c = this.updateItems(c)), c.done();
622
607
  }
608
+
623
609
  removeMultiUnselected(t) {
624
610
  const e = this.data.selected[t].filter((e) =>
625
611
  this.data.selecting[t].includes(e),
package/dist/style.css CHANGED
@@ -655,10 +655,10 @@ body.gstc-scrolling * {
655
655
  height: 100%;
656
656
  }
657
657
  .gstc__chart-timeline-items-row-item.gstc__selecting {
658
- box-shadow: 0px 0px 1px 2px rgba(0,119,192,0.5);
658
+ box-shadow: 0px 0px 1px 2px rgba(255, 165, 0, 0.5);
659
659
  }
660
660
  .gstc__chart-timeline-items-row-item.gstc__selected {
661
- box-shadow: 0px 0px 1px 2px #0077c0;
661
+ box-shadow: 0px 0px 1px 2px #FFA500;
662
662
  cursor: grab;
663
663
  }
664
664
  .gstc__chart-timeline-items-row-item-dependency-line {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-source_management",
3
- "version": "3.37.8",
3
+ "version": "3.38.0",
4
4
  "description": "Gantt, Schedule, ",
5
5
  "main": "dist/gstc.wasm.esm.min.js",
6
6
  "module": "dist/gstc.wasm.esm.min.js",