aloudata-gantt 0.0.3 → 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 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,7 +4877,7 @@ var GanttStore = /*#__PURE__*/function () {
4871
4877
  }, {
4872
4878
  key: "initWidth",
4873
4879
  value: function initWidth() {
4874
- this.tableWidth = this.totalColumnWidth || 500;
4880
+ this.tableWidth = this.customTableWidth;
4875
4881
  this.viewWidth = this.width - this.tableWidth;
4876
4882
  // 图表宽度不能小于 200
4877
4883
  if (this.viewWidth < 200) {
@@ -5439,6 +5445,7 @@ __decorate([observable], GanttStore.prototype, "scrolling", void 0);
5439
5445
  __decorate([observable], GanttStore.prototype, "scrollTop", void 0);
5440
5446
  __decorate([observable], GanttStore.prototype, "collapse", void 0);
5441
5447
  __decorate([observable], GanttStore.prototype, "tableWidth", void 0);
5448
+ __decorate([observable], GanttStore.prototype, "customTableWidth", void 0);
5442
5449
  __decorate([observable], GanttStore.prototype, "viewWidth", void 0);
5443
5450
  __decorate([observable], GanttStore.prototype, "width", void 0);
5444
5451
  __decorate([observable], GanttStore.prototype, "height", void 0);
@@ -5455,6 +5462,7 @@ __decorate([action], GanttStore.prototype, "toggleCollapse", null);
5455
5462
  __decorate([action], GanttStore.prototype, "setRowCollapse", null);
5456
5463
  __decorate([action], GanttStore.prototype, "setOnUpdate", null);
5457
5464
  __decorate([action], GanttStore.prototype, "setColumns", null);
5465
+ __decorate([action], GanttStore.prototype, "setCustomTableWidth", null);
5458
5466
  __decorate([action], GanttStore.prototype, "setDependencies", null);
5459
5467
  __decorate([action], GanttStore.prototype, "handlePanMove", null);
5460
5468
  __decorate([action], GanttStore.prototype, "handlePanEnd", null);
@@ -6702,6 +6710,7 @@ var Body = function Body(_ref) {
6702
6710
  var GanttComponent = function GanttComponent(props) {
6703
6711
  var data = props.data,
6704
6712
  columns = props.columns,
6713
+ customTableWidth = props.customTableWidth,
6705
6714
  _props$dependencies = props.dependencies,
6706
6715
  dependencies = _props$dependencies === void 0 ? [] : _props$dependencies,
6707
6716
  onUpdate = props.onUpdate,
@@ -6763,6 +6772,9 @@ var GanttComponent = function GanttComponent(props) {
6763
6772
  useEffect(function () {
6764
6773
  if (isRestDay) store.setIsRestDay(isRestDay);
6765
6774
  }, [isRestDay, store]);
6775
+ useEffect(function () {
6776
+ store.setCustomTableWidth(customTableWidth || 0);
6777
+ }, [customTableWidth, store]);
6766
6778
  useEffect(function () {
6767
6779
  if (unit) store.switchSight(unit);
6768
6780
  }, [unit, store]);
@@ -36,6 +36,7 @@ export interface GanttProps<RecordType = DefaultRecordType> {
36
36
  * 自定义日期筛选维度
37
37
  */
38
38
  customSights?: Gantt.SightConfig[];
39
+ customTableWidth?: number;
39
40
  }
40
41
  export interface GanttRef {
41
42
  backToday: () => void;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aloudata-gantt",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "license": "MIT",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/types/index.d.ts",