aloudata-gantt 0.0.2 → 0.0.4
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/index.esm.js +15 -5
- package/dist/types/Gantt.d.ts +1 -0
- package/dist/types/store.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4768,6 +4768,7 @@ var GanttStore = /*#__PURE__*/function () {
|
|
|
4768
4768
|
var bodyWidth = this.width;
|
|
4769
4769
|
var viewWidth = 704;
|
|
4770
4770
|
var tableWidth = 500;
|
|
4771
|
+
this.customTableWidth = 500;
|
|
4771
4772
|
this.viewWidth = viewWidth;
|
|
4772
4773
|
this.tableWidth = tableWidth;
|
|
4773
4774
|
this.translateX = translateX;
|
|
@@ -4820,6 +4821,11 @@ var GanttStore = /*#__PURE__*/function () {
|
|
|
4820
4821
|
value: function setColumns(columns) {
|
|
4821
4822
|
this.columns = columns;
|
|
4822
4823
|
}
|
|
4824
|
+
}, {
|
|
4825
|
+
key: "setCustomTableWidth",
|
|
4826
|
+
value: function setCustomTableWidth(customTableWidth) {
|
|
4827
|
+
this.customTableWidth = customTableWidth;
|
|
4828
|
+
}
|
|
4823
4829
|
}, {
|
|
4824
4830
|
key: "setDependencies",
|
|
4825
4831
|
value: function setDependencies(dependencies) {
|
|
@@ -4871,13 +4877,11 @@ var GanttStore = /*#__PURE__*/function () {
|
|
|
4871
4877
|
}, {
|
|
4872
4878
|
key: "initWidth",
|
|
4873
4879
|
value: function initWidth() {
|
|
4874
|
-
|
|
4875
|
-
console.log(this.tableWidth, this.viewWidth, this.width);
|
|
4876
|
-
this.tableWidth = this.totalColumnWidth > 0 ? this.totalColumnWidth : 200;
|
|
4880
|
+
this.tableWidth = this.customTableWidth;
|
|
4877
4881
|
this.viewWidth = this.width - this.tableWidth;
|
|
4878
4882
|
// 图表宽度不能小于 200
|
|
4879
|
-
if (this.viewWidth <
|
|
4880
|
-
this.viewWidth =
|
|
4883
|
+
if (this.viewWidth < 200) {
|
|
4884
|
+
this.viewWidth = 200;
|
|
4881
4885
|
this.tableWidth = this.width - this.viewWidth;
|
|
4882
4886
|
}
|
|
4883
4887
|
}
|
|
@@ -5441,6 +5445,7 @@ __decorate([observable], GanttStore.prototype, "scrolling", void 0);
|
|
|
5441
5445
|
__decorate([observable], GanttStore.prototype, "scrollTop", void 0);
|
|
5442
5446
|
__decorate([observable], GanttStore.prototype, "collapse", void 0);
|
|
5443
5447
|
__decorate([observable], GanttStore.prototype, "tableWidth", void 0);
|
|
5448
|
+
__decorate([observable], GanttStore.prototype, "customTableWidth", void 0);
|
|
5444
5449
|
__decorate([observable], GanttStore.prototype, "viewWidth", void 0);
|
|
5445
5450
|
__decorate([observable], GanttStore.prototype, "width", void 0);
|
|
5446
5451
|
__decorate([observable], GanttStore.prototype, "height", void 0);
|
|
@@ -5457,6 +5462,7 @@ __decorate([action], GanttStore.prototype, "toggleCollapse", null);
|
|
|
5457
5462
|
__decorate([action], GanttStore.prototype, "setRowCollapse", null);
|
|
5458
5463
|
__decorate([action], GanttStore.prototype, "setOnUpdate", null);
|
|
5459
5464
|
__decorate([action], GanttStore.prototype, "setColumns", null);
|
|
5465
|
+
__decorate([action], GanttStore.prototype, "setCustomTableWidth", null);
|
|
5460
5466
|
__decorate([action], GanttStore.prototype, "setDependencies", null);
|
|
5461
5467
|
__decorate([action], GanttStore.prototype, "handlePanMove", null);
|
|
5462
5468
|
__decorate([action], GanttStore.prototype, "handlePanEnd", null);
|
|
@@ -6704,6 +6710,7 @@ var Body = function Body(_ref) {
|
|
|
6704
6710
|
var GanttComponent = function GanttComponent(props) {
|
|
6705
6711
|
var data = props.data,
|
|
6706
6712
|
columns = props.columns,
|
|
6713
|
+
customTableWidth = props.customTableWidth,
|
|
6707
6714
|
_props$dependencies = props.dependencies,
|
|
6708
6715
|
dependencies = _props$dependencies === void 0 ? [] : _props$dependencies,
|
|
6709
6716
|
onUpdate = props.onUpdate,
|
|
@@ -6765,6 +6772,9 @@ var GanttComponent = function GanttComponent(props) {
|
|
|
6765
6772
|
useEffect(function () {
|
|
6766
6773
|
if (isRestDay) store.setIsRestDay(isRestDay);
|
|
6767
6774
|
}, [isRestDay, store]);
|
|
6775
|
+
useEffect(function () {
|
|
6776
|
+
store.setCustomTableWidth(customTableWidth || 0);
|
|
6777
|
+
}, [customTableWidth, store]);
|
|
6768
6778
|
useEffect(function () {
|
|
6769
6779
|
if (unit) store.switchSight(unit);
|
|
6770
6780
|
}, [unit, store]);
|
package/dist/types/Gantt.d.ts
CHANGED
package/dist/types/store.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare class GanttStore {
|
|
|
22
22
|
scrollTop: number;
|
|
23
23
|
collapse: boolean;
|
|
24
24
|
tableWidth: number;
|
|
25
|
+
customTableWidth: number;
|
|
25
26
|
viewWidth: number;
|
|
26
27
|
width: number;
|
|
27
28
|
height: number;
|
|
@@ -52,6 +53,7 @@ declare class GanttStore {
|
|
|
52
53
|
setRowCollapse(item: Gantt.Item, collapsed: boolean): void;
|
|
53
54
|
setOnUpdate(onUpdate: GanttProperties['onUpdate']): void;
|
|
54
55
|
setColumns(columns: Gantt.Column[]): void;
|
|
56
|
+
setCustomTableWidth(customTableWidth: number): void;
|
|
55
57
|
setDependencies(dependencies: Gantt.Dependence[]): void;
|
|
56
58
|
handlePanMove(translateX: number): void;
|
|
57
59
|
handlePanEnd(): void;
|