fix(attendance): align matrix pagination with modal width
This commit is contained in:
parent
7f6de0d286
commit
91ca6b55e8
@ -61,7 +61,8 @@ const weekdays = [
|
||||
const defaultWorkdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"];
|
||||
const matrixDateColumnWidth = 140;
|
||||
const matrixEmployeeColumnWidth = 160;
|
||||
const matrixModalHorizontalPadding = 96;
|
||||
const matrixModalMaxWidth = 1152;
|
||||
const matrixModalHorizontalPadding = 48;
|
||||
|
||||
type AttendancePeriodPreset = "month" | "custom";
|
||||
type EmployeeQuery = {
|
||||
@ -611,9 +612,10 @@ const DAYS_RU_FROM_INDEX: Record<number, string> = {
|
||||
};
|
||||
|
||||
function calculateMatrixEmployeesPerPage(width: number) {
|
||||
const modalWidth = Math.min(width * 0.95, matrixModalMaxWidth);
|
||||
const availableWidth = Math.max(
|
||||
0,
|
||||
width - matrixModalHorizontalPadding - matrixDateColumnWidth,
|
||||
modalWidth - matrixModalHorizontalPadding - matrixDateColumnWidth,
|
||||
);
|
||||
return Math.min(
|
||||
8,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user