aloudata-gantt 0.0.9 → 0.0.10

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
@@ -5023,6 +5023,23 @@ var GanttStore = /*#__PURE__*/function () {
5023
5023
  this.setTranslateX(dayjs(this.getStartDate()).valueOf() / (target.value * 1000));
5024
5024
  }
5025
5025
  }
5026
+ }, {
5027
+ key: "setNewData",
5028
+ value: function setNewData(data) {
5029
+ var updateNodeInTree = function updateNodeInTree(treeList, obj) {
5030
+ if (!treeList || !treeList.length) {
5031
+ return;
5032
+ }
5033
+ for (var i = 0; i < treeList.length; i++) {
5034
+ if (treeList[i].record.id == data.id) {
5035
+ treeList[i].record = obj;
5036
+ break;
5037
+ }
5038
+ updateNodeInTree(treeList[i].children, obj);
5039
+ }
5040
+ };
5041
+ updateNodeInTree(this.data, data);
5042
+ }
5026
5043
  }, {
5027
5044
  key: "scrollToToday",
5028
5045
  value: function scrollToToday() {
@@ -5591,6 +5608,7 @@ __decorate([action], GanttStore.prototype, "handleResizeTableWidth", null);
5591
5608
  __decorate([action], GanttStore.prototype, "initWidth", null);
5592
5609
  __decorate([action], GanttStore.prototype, "setTranslateX", null);
5593
5610
  __decorate([action], GanttStore.prototype, "switchSight", null);
5611
+ __decorate([action], GanttStore.prototype, "setNewData", null);
5594
5612
  __decorate([action], GanttStore.prototype, "scrollToToday", null);
5595
5613
  __decorate([computed], GanttStore.prototype, "todayTranslateX", null);
5596
5614
  __decorate([computed], GanttStore.prototype, "scrollBarWidth", null);
@@ -6910,6 +6928,9 @@ var GanttComponent = function GanttComponent(props) {
6910
6928
  backToday: function backToday() {
6911
6929
  return store.scrollToToday();
6912
6930
  },
6931
+ setNewData: function setNewData(data) {
6932
+ return store.setNewData(data);
6933
+ },
6913
6934
  getWidthByDate: store.getWidthByDate
6914
6935
  };
6915
6936
  });
@@ -40,6 +40,7 @@ export interface GanttProps<RecordType = DefaultRecordType> {
40
40
  }
41
41
  export interface GanttRef {
42
42
  backToday: () => void;
43
+ setNewData: (data: any) => void;
43
44
  getWidthByDate: (startDate: Dayjs, endDate: Dayjs) => number;
44
45
  }
45
46
  declare const GanttComponent: <RecordType extends DefaultRecordType>(props: GanttProps<RecordType>) => JSX.Element;
@@ -63,6 +63,7 @@ declare class GanttStore {
63
63
  initWidth(): void;
64
64
  setTranslateX(translateX: number): void;
65
65
  switchSight(type: Gantt.Sight): void;
66
+ setNewData(data: Gantt.Record): void;
66
67
  scrollToToday(): void;
67
68
  getTranslateXByDate(date: string): number;
68
69
  get todayTranslateX(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aloudata-gantt",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "license": "MIT",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/types/index.d.ts",