vxe-gantt 4.1.16 → 4.1.17

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.16";
2788
+ core_.VxeUI.ganttVersion = "4.1.17";
2789
2789
  const ymdFormat = 'yyyy-MM-dd';
2790
2790
  const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
2791
2791
  setConfig({
@@ -2894,7 +2894,7 @@ setIcon({
2894
2894
  const {
2895
2895
  log
2896
2896
  } = core_.VxeUI;
2897
- const version = `gantt v${"4.1.16"}`;
2897
+ const version = `gantt v${"4.1.17"}`;
2898
2898
  const warnLog = log.create('warn', version);
2899
2899
  const errLog = log.create('error', version);
2900
2900
  ;// ./packages/ui/src/depend.ts
@@ -4390,13 +4390,18 @@ const maxYHeight = 5e6;
4390
4390
  const {
4391
4391
  gridding
4392
4392
  } = taskViewOpts;
4393
+ const {
4394
+ type,
4395
+ startDay
4396
+ } = minScale;
4393
4397
  const dateList = [];
4394
4398
  if (!minViewDate || !maxViewDate) {
4395
4399
  return dateList;
4396
4400
  }
4397
4401
  const leftSize = -external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(gridding ? gridding.leftSpacing || 0 : 0);
4398
4402
  const rightSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(gridding ? gridding.rightSpacing || 0 : 0);
4399
- switch (minScale.type) {
4403
+ const currStep = 1; // XEUtils.toNumber(step || 1) || 1
4404
+ switch (type) {
4400
4405
  case 'year':
4401
4406
  {
4402
4407
  let currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(minViewDate, leftSize, 'first');
@@ -4404,7 +4409,7 @@ const maxYHeight = 5e6;
4404
4409
  while (currDate <= endDate) {
4405
4410
  const itemDate = currDate;
4406
4411
  dateList.push(itemDate);
4407
- currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(currDate, 1);
4412
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(currDate, currStep);
4408
4413
  }
4409
4414
  break;
4410
4415
  }
@@ -4415,7 +4420,7 @@ const maxYHeight = 5e6;
4415
4420
  while (currDate <= endDate) {
4416
4421
  const itemDate = currDate;
4417
4422
  dateList.push(itemDate);
4418
- currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(currDate, 1);
4423
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(currDate, currStep);
4419
4424
  }
4420
4425
  break;
4421
4426
  }
@@ -4426,18 +4431,18 @@ const maxYHeight = 5e6;
4426
4431
  while (currDate <= endDate) {
4427
4432
  const itemDate = currDate;
4428
4433
  dateList.push(itemDate);
4429
- currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(currDate, 1);
4434
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(currDate, currStep);
4430
4435
  }
4431
4436
  break;
4432
4437
  }
4433
4438
  case 'week':
4434
4439
  {
4435
- let currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(minViewDate, leftSize, minScale.startDay, minScale.startDay);
4436
- const endDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(maxViewDate, rightSize, minScale.startDay, minScale.startDay);
4440
+ let currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(minViewDate, leftSize, startDay, startDay);
4441
+ const endDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(maxViewDate, rightSize, startDay, startDay);
4437
4442
  while (currDate <= endDate) {
4438
4443
  const itemDate = currDate;
4439
4444
  dateList.push(itemDate);
4440
- currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(currDate, 1);
4445
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(currDate, currStep);
4441
4446
  }
4442
4447
  break;
4443
4448
  }
@@ -4449,7 +4454,7 @@ const maxYHeight = 5e6;
4449
4454
  while (currDate <= endDate) {
4450
4455
  const itemDate = currDate;
4451
4456
  dateList.push(itemDate);
4452
- currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(currDate, 1);
4457
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(currDate, currStep);
4453
4458
  }
4454
4459
  break;
4455
4460
  }
@@ -4457,7 +4462,7 @@ const maxYHeight = 5e6;
4457
4462
  case 'minute':
4458
4463
  case 'second':
4459
4464
  {
4460
- const gapTime = getStandardGapTime(minScale.type);
4465
+ const gapTime = getStandardGapTime(minScale.type) * currStep;
4461
4466
  let currTime = minViewDate.getTime() + leftSize * gapTime;
4462
4467
  const endTime = maxViewDate.getTime() + rightSize * gapTime;
4463
4468
  while (currTime <= endTime) {
@@ -4547,6 +4552,7 @@ const maxYHeight = 5e6;
4547
4552
  minute: {},
4548
4553
  second: {}
4549
4554
  };
4555
+ const isMinWeek = minScale.type === 'week';
4550
4556
  const handleData = (type, colMaps, minCol) => {
4551
4557
  if (minScale.type === type) {
4552
4558
  return;
@@ -4568,12 +4574,22 @@ const maxYHeight = 5e6;
4568
4574
  };
4569
4575
  for (let i = 0; i < scaleDateList.length; i++) {
4570
4576
  const itemDate = scaleDateList[i];
4571
- const [yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(itemDate, 'yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss').split('-');
4577
+ let [yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(itemDate, 'yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss').split('-');
4572
4578
  const e = itemDate.getDay();
4573
4579
  const E = e + 1;
4574
4580
  const q = Math.ceil((itemDate.getMonth() + 1) / 3);
4575
4581
  const W = `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined)}`;
4576
4582
  const WW = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().padStart(W, 2, '0');
4583
+ let wYear = yyyy;
4584
+ // 周维度,由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年,例如
4585
+ // '2024-12-31' 'yyyy-MM-dd W' >> '2024-12-31 1'
4586
+ // '2025-01-01' 'yyyy-MM-dd W' >> '2025-01-01 1'
4587
+ if (W === '1' && MM === '12') {
4588
+ wYear = `${Number(yyyy) + 1}`;
4589
+ if (isMinWeek) {
4590
+ yyyy = wYear;
4591
+ }
4592
+ }
4577
4593
  const dateObj = {
4578
4594
  date: itemDate,
4579
4595
  yy,
@@ -4789,9 +4805,7 @@ const maxYHeight = 5e6;
4789
4805
  fullCols.forEach(({
4790
4806
  dateObj
4791
4807
  }, i) => {
4792
- const yyyyW = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-W', {
4793
- firstDay: weekScale ? weekScale.startDay : undefined
4794
- });
4808
+ const yyyyW = `${dateObj.yyyy}-${dateObj.W}`;
4795
4809
  indexMaps[yyyyW] = i;
4796
4810
  });
4797
4811
  return (startValue, endValue) => {
@@ -6549,8 +6563,12 @@ function getViewTypeLevel(type) {
6549
6563
  type: conf
6550
6564
  } : conf;
6551
6565
  const {
6552
- type
6566
+ type,
6567
+ step
6553
6568
  } = sConf;
6569
+ if (step) {
6570
+ errLog('vxe.error.errProp', [`step=${step}`, 'step=1']);
6571
+ }
6554
6572
  if (!type || !viewTypeLevelMaps[type]) {
6555
6573
  errLog('vxe.error.errProp', [`type=${type}`, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(viewTypeLevelMaps).join(',')]);
6556
6574
  return;