aloudata-gantt 0.0.8 → 0.0.9

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
@@ -301,14 +301,23 @@ function transverseData() {
301
301
  }
302
302
  return result;
303
303
  }
304
+ var hasHolidayLists = ['2023'];
304
305
  function getWeekday(first, last) {
305
306
  var _first = first.valueOf();
306
307
  var _last = last.valueOf();
307
308
  var count = 0;
308
309
  for (var i = _first; i <= _last; i += 24 * 3600 * 1000) {
309
- var d = dayjs(i).format("YYYY-MM-DD");
310
- if (!holiday[d]) {
311
- count++;
310
+ var year = dayjs(i).format("YYYY");
311
+ if (hasHolidayLists.includes(year)) {
312
+ var d = dayjs(i).format("YYYY-MM-DD");
313
+ if (!holiday[d]) {
314
+ count++;
315
+ }
316
+ } else {
317
+ var _d = new Date(i);
318
+ if (_d.getDay() >= 1 && _d.getDay() <= 5) {
319
+ count++;
320
+ }
312
321
  }
313
322
  }
314
323
  return count;
@@ -6070,10 +6079,6 @@ var Chart = function Chart() {
6070
6079
  translateX = store.translateX,
6071
6080
  chartElementRef = store.chartElementRef;
6072
6081
  var minorList = store.getMinorList();
6073
- console.log("**********************");
6074
- console.log({
6075
- minorList: minorList
6076
- });
6077
6082
  var handleMouseMove = useCallback(function (event) {
6078
6083
  event.persist();
6079
6084
  store.handleMouseMove(event);
@@ -6116,7 +6121,14 @@ var Chart = function Chart() {
6116
6121
  strokeWidth: '1px',
6117
6122
  y2: '10'
6118
6123
  }))), minorList.map(function (item) {
6119
- return item.isWeek || holiday[dayjs(item.key).format("YYYY-MM-DD")] ? /*#__PURE__*/React.createElement("g", {
6124
+ var isWeek = false;
6125
+ var year = dayjs(item.key).format("YYYY");
6126
+ if (hasHolidayLists.includes(year)) {
6127
+ isWeek = !!holiday[dayjs(item.key).format("YYYY-MM-DD")];
6128
+ } else {
6129
+ isWeek = item.isWeek;
6130
+ }
6131
+ return isWeek ? /*#__PURE__*/React.createElement("g", {
6120
6132
  key: item.key,
6121
6133
  stroke: '#f0f0f0'
6122
6134
  }, /*#__PURE__*/React.createElement("path", {
@@ -6933,4 +6945,4 @@ var GanttComponent = function GanttComponent(props) {
6933
6945
  }, /*#__PURE__*/React.createElement(SelectionIndicator$1, null), /*#__PURE__*/React.createElement(TableBody$1, null), /*#__PURE__*/React.createElement(Chart$1, null)), /*#__PURE__*/React.createElement(Divider$1, null), showBackToday && /*#__PURE__*/React.createElement(TimeIndicator$1, null), showUnitSwitch && /*#__PURE__*/React.createElement(TimeAxisScaleSelect$1, null), /*#__PURE__*/React.createElement(ScrollBar$1, null), scrollTop && /*#__PURE__*/React.createElement(ScrollTop$1, null)));
6934
6946
  };
6935
6947
 
6936
- export { Gantt, GanttComponent as default, flattenDeep, getMaxRange, getWeekday, transverseData };
6948
+ export { Gantt, GanttComponent as default, flattenDeep, getMaxRange, getWeekday, hasHolidayLists, transverseData };
@@ -11,4 +11,5 @@ export declare function getMaxRange(bar: Gantt.Bar): {
11
11
  width: number;
12
12
  };
13
13
  export declare function transverseData(data: Gantt.Record[], startDateKey: string, endDateKey: string): Gantt.Item<import("./types").DefaultRecordType>[];
14
+ export declare const hasHolidayLists: string[];
14
15
  export declare function getWeekday(first: Dayjs, last: Dayjs): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aloudata-gantt",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "license": "MIT",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/types/index.d.ts",