vxe-gantt 4.1.19 → 4.2.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/lib/index.umd.js CHANGED
@@ -2785,7 +2785,7 @@ const {
2785
2785
  setConfig,
2786
2786
  setIcon
2787
2787
  } = core_.VxeUI;
2788
- core_.VxeUI.ganttVersion = "4.1.19";
2788
+ core_.VxeUI.ganttVersion = "4.2.0";
2789
2789
  const ymdFormat = 'yyyy-MM-dd';
2790
2790
  const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
2791
2791
  setConfig({
@@ -2895,7 +2895,7 @@ setIcon({
2895
2895
  const {
2896
2896
  log
2897
2897
  } = core_.VxeUI;
2898
- const version = `gantt v${"4.1.19"}`;
2898
+ const version = `gantt v${"4.2.0"}`;
2899
2899
  const warnLog = log.create('warn', version);
2900
2900
  const errLog = log.create('error', version);
2901
2901
  ;// ./packages/ui/src/depend.ts
@@ -4099,7 +4099,9 @@ const gantt_body_viewType = 'body';
4099
4099
  } = taskViewOpts;
4100
4100
  const {
4101
4101
  rowClassName,
4102
- rowStyle
4102
+ rowStyle,
4103
+ cellClassName,
4104
+ cellStyle
4103
4105
  } = viewStyle || {};
4104
4106
  const {
4105
4107
  tableColumn,
@@ -4150,7 +4152,7 @@ const gantt_body_viewType = 'body';
4150
4152
  _rowIndex
4151
4153
  };
4152
4154
  trVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
4153
- key: treeConfig ? rowid : $rowIndex,
4155
+ key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex,
4154
4156
  class: ['vxe-gantt-view--body-row', {
4155
4157
  'row--stripe': stripe && (_rowIndex + 1) % 2 === 0,
4156
4158
  'is--new': isNewRow,
@@ -4335,6 +4337,38 @@ function createInternalData() {
4335
4337
  lastScrollLeft: 0
4336
4338
  };
4337
4339
  }
4340
+ function createReactData() {
4341
+ return {
4342
+ // 是否启用了横向 X 可视渲染方式加载
4343
+ scrollXLoad: false,
4344
+ // 是否启用了纵向 Y 可视渲染方式加载
4345
+ scrollYLoad: false,
4346
+ // 是否存在纵向滚动条
4347
+ overflowY: true,
4348
+ // 是否存在横向滚动条
4349
+ overflowX: true,
4350
+ // 纵向滚动条的宽度
4351
+ scrollbarWidth: 0,
4352
+ // 横向滚动条的高度
4353
+ scrollbarHeight: 0,
4354
+ // 最后滚动时间戳
4355
+ lastScrollTime: 0,
4356
+ lazScrollLoading: false,
4357
+ scrollVMLoading: false,
4358
+ scrollYHeight: 0,
4359
+ scrollYTop: 0,
4360
+ isScrollYBig: false,
4361
+ scrollXLeft: 0,
4362
+ scrollXWidth: 0,
4363
+ isScrollXBig: false,
4364
+ minViewDate: null,
4365
+ maxViewDate: null,
4366
+ tableData: [],
4367
+ tableColumn: [],
4368
+ headerGroups: [],
4369
+ viewCellWidth: 40
4370
+ };
4371
+ }
4338
4372
  const maxYHeight = 5e6;
4339
4373
  // const maxXWidth = 5e6
4340
4374
  /* harmony default export */ var gantt_view = (defineVxeComponent({
@@ -4372,36 +4406,7 @@ const maxYHeight = 5e6;
4372
4406
  const refScrollXSpaceElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
4373
4407
  const refScrollYSpaceElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
4374
4408
  const refColInfoElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
4375
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
4376
- // 是否启用了横向 X 可视渲染方式加载
4377
- scrollXLoad: false,
4378
- // 是否启用了纵向 Y 可视渲染方式加载
4379
- scrollYLoad: false,
4380
- // 是否存在纵向滚动条
4381
- overflowY: true,
4382
- // 是否存在横向滚动条
4383
- overflowX: true,
4384
- // 纵向滚动条的宽度
4385
- scrollbarWidth: 0,
4386
- // 横向滚动条的高度
4387
- scrollbarHeight: 0,
4388
- // 最后滚动时间戳
4389
- lastScrollTime: 0,
4390
- lazScrollLoading: false,
4391
- scrollVMLoading: false,
4392
- scrollYHeight: 0,
4393
- scrollYTop: 0,
4394
- isScrollYBig: false,
4395
- scrollXLeft: 0,
4396
- scrollXWidth: 0,
4397
- isScrollXBig: false,
4398
- minViewDate: null,
4399
- maxViewDate: null,
4400
- tableData: [],
4401
- tableColumn: [],
4402
- headerGroups: [],
4403
- viewCellWidth: 40
4404
- });
4409
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(createReactData());
4405
4410
  const internalData = createInternalData();
4406
4411
  const refMaps = {
4407
4412
  refElem,
@@ -5518,27 +5523,30 @@ const maxYHeight = 5e6;
5518
5523
  // if (footerTableElem) {
5519
5524
  // footerTableElem.style.transform = `translate(${xSpaceLeft}px, 0px)`
5520
5525
  // }
5526
+ const ySpaceWidth = scrollXWidth;
5521
5527
  const layoutList = ['header', 'body', 'footer'];
5522
5528
  layoutList.forEach(layout => {
5523
5529
  const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`]);
5524
5530
  if (xSpaceElem) {
5525
- xSpaceElem.style.width = scrollXLoad ? `${scrollXWidth}px` : '';
5531
+ xSpaceElem.style.width = scrollXLoad ? `${ySpaceWidth}px` : '';
5526
5532
  }
5527
5533
  });
5528
5534
  const scrollXSpaceEl = refScrollXSpaceElem.value;
5529
5535
  if (scrollXSpaceEl) {
5530
- scrollXSpaceEl.style.width = `${scrollXWidth}px`;
5536
+ scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
5531
5537
  }
5532
5538
  const beforeWrapper = getRefElem(elemStore['main-chart-before-wrapper']);
5533
5539
  const beforeSvgElem = beforeWrapper ? beforeWrapper.firstElementChild : null;
5534
5540
  if (beforeSvgElem) {
5535
- beforeSvgElem.style.width = `${scrollXWidth}px`;
5541
+ beforeSvgElem.style.width = `${ySpaceWidth}px`;
5536
5542
  }
5537
5543
  const afterWrapper = getRefElem(elemStore['main-chart-after-wrapper']);
5538
5544
  const afterSvgElem = afterWrapper ? afterWrapper.firstElementChild : null;
5539
5545
  if (afterSvgElem) {
5540
- afterSvgElem.style.width = `${scrollXWidth}px`;
5546
+ afterSvgElem.style.width = `${ySpaceWidth}px`;
5541
5547
  }
5548
+ reactData.scrollXLeft = xSpaceLeft;
5549
+ reactData.scrollXWidth = ySpaceWidth;
5542
5550
  calcScrollbar();
5543
5551
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
5544
5552
  };
@@ -5581,7 +5589,7 @@ const maxYHeight = 5e6;
5581
5589
  bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
5582
5590
  }
5583
5591
  if (bodyChartWrapperElem) {
5584
- bodyChartWrapperElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
5592
+ bodyChartWrapperElem.style.transform = `translateY(${scrollYTop}px)`;
5585
5593
  }
5586
5594
  const bodyYSpaceElem = getRefElem(elemStore['main-body-ySpace']);
5587
5595
  if (bodyYSpaceElem) {
@@ -5741,7 +5749,7 @@ const maxYHeight = 5e6;
5741
5749
  }
5742
5750
  });
5743
5751
  },
5744
- updateViewData() {
5752
+ updateViewData(force) {
5745
5753
  const $xeTable = internalData.xeTable;
5746
5754
  if ($xeTable) {
5747
5755
  const tableReactData = $xeTable.reactData;
@@ -5749,6 +5757,10 @@ const maxYHeight = 5e6;
5749
5757
  tableData
5750
5758
  } = tableReactData;
5751
5759
  reactData.tableData = tableData;
5760
+ if (force) {
5761
+ handleUpdateData();
5762
+ }
5763
+ handleRecalculateStyle();
5752
5764
  }
5753
5765
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
5754
5766
  },
@@ -6046,19 +6058,12 @@ const maxYHeight = 5e6;
6046
6058
  class: 'vxe-gantt-view--column-info'
6047
6059
  })])]);
6048
6060
  };
6049
- const tdFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
6050
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => reactData.tableData, () => {
6051
- tdFlag.value++;
6052
- });
6053
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => reactData.tableData.length, () => {
6054
- tdFlag.value++;
6055
- });
6056
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(tdFlag, () => {
6057
- handleUpdateData();
6058
- });
6059
6061
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
6060
6062
  globalEvents.on($xeGanttView, 'resize', handleGlobalResizeEvent);
6061
6063
  });
6064
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
6065
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, createReactData());
6066
+ });
6062
6067
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
6063
6068
  globalEvents.off($xeGanttView, 'keydown');
6064
6069
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, createInternalData());
@@ -6124,7 +6129,7 @@ function gantt_createInternalData() {
6124
6129
  }
6125
6130
  };
6126
6131
  }
6127
- function createReactData() {
6132
+ function gantt_createReactData() {
6128
6133
  return {
6129
6134
  tableLoading: false,
6130
6135
  proxyInited: false,
@@ -6219,7 +6224,7 @@ function getViewTypeLevel(type) {
6219
6224
  const {
6220
6225
  computeSize
6221
6226
  } = useFns.useSize(props);
6222
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(createReactData());
6227
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(gantt_createReactData());
6223
6228
  const internalData = gantt_createInternalData();
6224
6229
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6225
6230
  const refTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -8801,7 +8806,7 @@ function getViewTypeLevel(type) {
8801
8806
  gantt_globalEvents.on($xeGantt, 'keydown', handleGlobalKeydownEvent);
8802
8807
  });
8803
8808
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
8804
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, createReactData());
8809
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, gantt_createReactData());
8805
8810
  });
8806
8811
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
8807
8812
  gantt_globalEvents.off($xeGantt, 'keydown');