touchstudy-core 0.1.155 → 0.1.156

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.
@@ -24493,6 +24493,7 @@ var AttendanceCourseTable = function AttendanceCourseTable(_ref) {
24493
24493
  return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.language;
24494
24494
  });
24495
24495
  var dataString = JSON.stringify(data);
24496
+ var containerRef = useRef(null);
24496
24497
  var handleCheckInLesson = function handleCheckInLesson(lesson, studentId) {
24497
24498
  if (isAdmin) return;
24498
24499
  onCheckInLesson(lesson, studentId);
@@ -24550,15 +24551,43 @@ var AttendanceCourseTable = function AttendanceCourseTable(_ref) {
24550
24551
  }, (attendance === null || attendance === void 0 ? void 0 : attendance.status) === StudentAttendanceStatus.Late ? React__default.createElement(AlertCircleFill, null) : (attendance === null || attendance === void 0 ? void 0 : attendance.status) === StudentAttendanceStatus.Attended ? React__default.createElement(CheckCircleFill, null) : React__default.createElement(CloseCircleFill, null))));
24551
24552
  };
24552
24553
  var columnCount = data.length;
24554
+ var multiGridRef = useRef(null);
24555
+ useEffect(function () {
24556
+ var handleResize = function handleResize() {
24557
+ var _multiGridRef$current;
24558
+ (_multiGridRef$current = multiGridRef.current) === null || _multiGridRef$current === void 0 ? void 0 : _multiGridRef$current.invalidateCellSizeAfterRender();
24559
+ };
24560
+ window.addEventListener("resize", handleResize);
24561
+ return function () {
24562
+ window.removeEventListener("resize", handleResize);
24563
+ };
24564
+ }, []);
24565
+ var columnWidth = function columnWidth(params, cache) {
24566
+ if (!containerRef.current || params.index < columnCount - 1) return cache.columnWidth(params);
24567
+ var containerWidth = containerRef.current.clientWidth;
24568
+ var currentWidth = cache.columnWidth(params);
24569
+ var totalWidth = 0;
24570
+ for (var index = 0; index < params.index; index++) {
24571
+ var elementWidth = cache.columnWidth({
24572
+ index: index
24573
+ });
24574
+ totalWidth += elementWidth;
24575
+ }
24576
+ if (totalWidth + currentWidth < containerWidth) return containerWidth - totalWidth;
24577
+ return currentWidth;
24578
+ };
24553
24579
  return React__default.createElement(VirtualTableView, {
24554
24580
  loading: false,
24581
+ multiGridRef: multiGridRef,
24582
+ containerRef: containerRef,
24555
24583
  containerProps: containerProps,
24556
24584
  listHeight: listHeight,
24557
24585
  listWidth: listWidth,
24558
24586
  renderItem: renderItem,
24559
24587
  columnCount: columnCount,
24560
24588
  itemsCount: 2,
24561
- dataString: dataString
24589
+ dataString: dataString,
24590
+ columnWidth: columnWidth
24562
24591
  });
24563
24592
  };
24564
24593