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.
- package/dist/plugins/selection.esm.min.js +43 -57
- package/dist/style.css +2 -2
- package/package.json +1 -1
|
@@ -539,87 +539,73 @@ class a {
|
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
541
|
selectItemsIndividually(i) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
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
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
}),
|
|
610
|
-
|
|
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(
|
|
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 #
|
|
661
|
+
box-shadow: 0px 0px 1px 2px #FFA500;
|
|
662
662
|
cursor: grab;
|
|
663
663
|
}
|
|
664
664
|
.gstc__chart-timeline-items-row-item-dependency-line {
|