diff --git a/library/src/components/timetable/TimeTable.tsx b/library/src/components/timetable/TimeTable.tsx index 563ac88d..4d57b986 100644 --- a/library/src/components/timetable/TimeTable.tsx +++ b/library/src/components/timetable/TimeTable.tsx @@ -494,6 +494,7 @@ const LPTimeTableImpl = ({ > slotsArray={slotsArray} + timeSlotMinutes={timeSlotMinutes} columnWidth={columnWidth} groupHeaderColumnWidth={groupHeaderColumnWidth} startDate={startDate} diff --git a/library/src/components/timetable/TimeTableHeader.tsx b/library/src/components/timetable/TimeTableHeader.tsx index e1fe56bf..1d92226f 100644 --- a/library/src/components/timetable/TimeTableHeader.tsx +++ b/library/src/components/timetable/TimeTableHeader.tsx @@ -6,7 +6,7 @@ dayjs.extend(weekOfYear) dayjs.extend(weekYear) dayjs.extend(localeData) import type React from "react" -import { Fragment } from "react" +import { Fragment, type RefObject, useRef } from "react" // if more locales then english and germans are needed, we need to enable them first here import "dayjs/locale/de" @@ -68,6 +68,7 @@ export type CustomHeaderRowTimeSlotProps< timeFrameOfDay: TimeFrameDay entries: TimeTableEntry[] slotsArray: readonly Dayjs[] + tableCellRef: RefObject } export type CustomHeaderRowHeaderProps< @@ -85,6 +86,7 @@ type TimeTableHeaderProps< I extends TimeSlotBooking, > = { slotsArray: readonly Dayjs[] + timeSlotMinutes: number groupHeaderColumnWidth: number | string columnWidth: number | string startDate: Dayjs @@ -106,11 +108,15 @@ type TimeTableHeaderProps< tableHeaderRef: React.Ref } +const headerCellBaseClassname = + "bg-surface border-transparent border-b-border after:border-border relative select-none border-0 border-b-2 border-solid p-0 pl-1 font-bold after:absolute after:bottom-[1px] after:right-0 after:top-0 after:h-full after:border-solid" + export const LPTimeTableHeader = function TimeTableHeader< G extends TimeTableGroup, I extends TimeSlotBooking, >({ slotsArray, + timeSlotMinutes, groupHeaderColumnWidth, columnWidth, startDate, @@ -276,7 +282,7 @@ export const LPTimeTableHeader = function TimeTableHeader< @@ -308,23 +314,18 @@ export const LPTimeTableHeader = function TimeTableHeader< i === slotsArray.length - 1 || !slotsArray[i + 1].isSame(slot, "day") return ( - - {customHeaderRow.timeSlot({ - timeSlot: slot, - timeSlotMinutes: 60, - isLastOfDay, - timeFrameOfDay: timeFrameDay, - viewType, - entries, - slotsArray, - })} - + /> ) })} @@ -333,3 +334,55 @@ export const LPTimeTableHeader = function TimeTableHeader< ) } + +function CustomHeaderRowCell< + G extends TimeTableGroup, + I extends TimeSlotBooking, +>({ + timeSlot, + timeSlotMinutes, + isLastOfDay, + viewType, + timeFrameOfDay, + entries, + slotsArray, + showTimeSlotHeader, + customHeaderRow, +}: { + timeSlot: Dayjs + timeSlotMinutes: number + isLastOfDay: boolean + viewType: TimeTableViewType + timeFrameOfDay: TimeFrameDay + entries: TimeTableEntry[] + slotsArray: readonly Dayjs[] + showTimeSlotHeader: boolean + customHeaderRow: { + timeSlot: (props: CustomHeaderRowTimeSlotProps) => JSX.Element + header: (props: CustomHeaderRowHeaderProps) => JSX.Element + } +}) { + const ref = useRef(null) + + return ( + + {customHeaderRow.timeSlot({ + timeSlot, + timeSlotMinutes, + isLastOfDay, + timeFrameOfDay, + viewType, + entries, + slotsArray, + tableCellRef: ref, + })} + + ) +} diff --git a/package-lock.json b/package-lock.json index 988b9503..7a21ec1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@atlaskit/empty-state": "^7.11.4", - "@atlaskit/icon": "^22.20.2", + "@atlaskit/icon": "^22.22.0", "@emotion/css": "^11.13.4", "@hello-pangea/dnd": "^17.0.0", "@radix-ui/react-accordion": "^1.2.1", @@ -35,7 +35,7 @@ "mime-types": "^2.1.35", "react-awesome-slider": "^4.1.0", "react-day-picker": "^8.10.1", - "react-intl": "^6.7.0", + "react-intl": "^6.7.1", "react-joyride": "^2.9.2", "react-router-dom": "^6.26.2", "react-select": "^5.8.1", @@ -55,21 +55,21 @@ "@atlaskit/tag": "^12.6.3", "@atlaskit/tag-group": "^10.6.0", "@atlaskit/textarea": "^5.6.2", - "@atlaskit/textfield": "^6.5.2", + "@atlaskit/textfield": "^6.5.3", "@atlaskit/theme": "^13.0.2", "@babel/generator": "^7.25.7", "@babel/parser": "^7.25.7", "@babel/traverse": "^7.25.7", "@babel/types": "^7.25.7", "@biomejs/biome": "^1.9.3", - "@formatjs/cli": "^6.2.12", + "@formatjs/cli": "^6.2.13", "@monaco-editor/react": "^4.6.0", "@total-typescript/ts-reset": "^0.6.1", - "@types/node": "^22.7.4", + "@types/node": "^22.7.5", "@types/react": "^18.3.11", "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^8.8.0", - "@typescript-eslint/parser": "^8.8.0", + "@typescript-eslint/eslint-plugin": "^8.8.1", + "@typescript-eslint/parser": "^8.8.1", "@vitejs/plugin-react-swc": "^3.7.1", "autoprefixer": "^10.4.20", "eslint-config-prettier": "^9.1.0", @@ -211,15 +211,15 @@ } }, "node_modules/@atlaskit/button": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/@atlaskit/button/-/button-20.2.4.tgz", - "integrity": "sha512-thBORFxQqw7tXMb/Hnr6nT1ZXDR2q0rlZ3bo49N1ufp0GU5im4zwu+Xb1GKTtBpF2C7xxhjioL9Aye69uUlWng==", + "version": "20.2.5", + "resolved": "https://registry.npmjs.org/@atlaskit/button/-/button-20.2.5.tgz", + "integrity": "sha512-y6MOeAcxRI1VRzH0gV9+DX00XMHcHzjtX3fY/xSuPC+ISJN417R6woBUmRz4iqamBzfyl50x2dggEsh98NFztw==", "license": "Apache-2.0", "dependencies": { "@atlaskit/analytics-next": "^10.1.0", "@atlaskit/ds-lib": "^3.0.0", "@atlaskit/focus-ring": "^1.6.0", - "@atlaskit/icon": "^22.20.0", + "@atlaskit/icon": "^22.21.0", "@atlaskit/interaction-context": "^2.1.0", "@atlaskit/platform-feature-flags": "^0.3.0", "@atlaskit/primitives": "^12.2.0", @@ -360,9 +360,9 @@ } }, "node_modules/@atlaskit/icon": { - "version": "22.20.2", - "resolved": "https://registry.npmjs.org/@atlaskit/icon/-/icon-22.20.2.tgz", - "integrity": "sha512-GJyxBkEWF0hDUKvBpsLhkwL3MZ5jZa1A2taUTuIR9VGorWDuAkQdNCKx56CSD75PfxK/GapHVbADmAUMjfuOGA==", + "version": "22.22.0", + "resolved": "https://registry.npmjs.org/@atlaskit/icon/-/icon-22.22.0.tgz", + "integrity": "sha512-4uUxjT37zvxyqIF0VyDJiSfDMSXu0IIAW61Osob5/S3JGEZ2yRR5zXKXRgCFI7iNTwqilFswNw1L1V7t1qB2rQ==", "license": "Apache-2.0", "dependencies": { "@atlaskit/platform-feature-flags": "^0.3.0", @@ -702,9 +702,9 @@ } }, "node_modules/@atlaskit/textfield": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/@atlaskit/textfield/-/textfield-6.5.2.tgz", - "integrity": "sha512-02JuJuySR9iJCJbT3d+p9XIsJU+pgjCEVqZx2ORdLzs0p1yCWdJiW7mhjjT7m8nsWrvrtL85fT+5llEnBwiN/g==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/@atlaskit/textfield/-/textfield-6.5.3.tgz", + "integrity": "sha512-Trd6YS8Y3UbvwEWOeUoAsWi3UuYbpKbdQty42jlVRXB3uLV8eZibFOvj1bgTQeYhg5Mb8Zvczx5/VeL3js9Q+Q==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -1900,9 +1900,9 @@ "license": "MIT" }, "node_modules/@formatjs/cli": { - "version": "6.2.12", - "resolved": "https://registry.npmjs.org/@formatjs/cli/-/cli-6.2.12.tgz", - "integrity": "sha512-bt1NEgkeYN8N9zWcpsPu3fZ57vv+biA+NtIQBlyOZnCp1bcvh+vNTXvmwF4C5qxqDtCylpOIb3yi3Ktgp4v0JQ==", + "version": "6.2.13", + "resolved": "https://registry.npmjs.org/@formatjs/cli/-/cli-6.2.13.tgz", + "integrity": "sha512-XoaQqsY8GNH7Td6lnAIB8NKP6Gl2qF9SLRmVLZq4pz/VF9+U4UW7LcaFetWPbPhmxEhaPXIRHGWno3c3YJQNMg==", "dev": true, "license": "MIT", "bin": { @@ -1989,9 +1989,9 @@ } }, "node_modules/@formatjs/intl": { - "version": "2.10.5", - "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.10.5.tgz", - "integrity": "sha512-f9qPNNgLrh2KvoFvHGIfcPTmNGbyy7lyyV4/P6JioDqtTE7Akdmgt+ZzVndr+yMLZnssUShyTMXxM/6aV9eVuQ==", + "version": "2.10.6", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.10.6.tgz", + "integrity": "sha512-UYnnJt94cI3lPJeu8WCUUPnBBzwW1Zui/oqbSGUaD5XpWOznklMbWic5JRThz9X2mOZIahPX6wN20VszXwssOA==", "license": "MIT", "dependencies": { "@formatjs/ecma402-abstract": "2.0.0", @@ -4170,9 +4170,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.7.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", - "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4253,17 +4253,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.0.tgz", - "integrity": "sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.1.tgz", + "integrity": "sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/type-utils": "8.8.0", - "@typescript-eslint/utils": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/scope-manager": "8.8.1", + "@typescript-eslint/type-utils": "8.8.1", + "@typescript-eslint/utils": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -4287,16 +4287,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.0.tgz", - "integrity": "sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.1.tgz", + "integrity": "sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/typescript-estree": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/scope-manager": "8.8.1", + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/typescript-estree": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1", "debug": "^4.3.4" }, "engines": { @@ -4316,14 +4316,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.0.tgz", - "integrity": "sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz", + "integrity": "sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0" + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4334,14 +4334,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.0.tgz", - "integrity": "sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.1.tgz", + "integrity": "sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.8.0", - "@typescript-eslint/utils": "8.8.0", + "@typescript-eslint/typescript-estree": "8.8.1", + "@typescript-eslint/utils": "8.8.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -4359,9 +4359,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.0.tgz", - "integrity": "sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz", + "integrity": "sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==", "dev": true, "license": "MIT", "engines": { @@ -4373,14 +4373,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.0.tgz", - "integrity": "sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz", + "integrity": "sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -4402,16 +4402,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.0.tgz", - "integrity": "sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.1.tgz", + "integrity": "sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/typescript-estree": "8.8.0" + "@typescript-eslint/scope-manager": "8.8.1", + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/typescript-estree": "8.8.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4425,13 +4425,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.0.tgz", - "integrity": "sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz", + "integrity": "sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/types": "8.8.1", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -5607,9 +5607,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.32", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.32.tgz", - "integrity": "sha512-M+7ph0VGBQqqpTT2YrabjNKSQ2fEl9PVx6AK3N558gDH9NO8O6XN9SXXFWRo9u9PbEg/bWq+tjXQr+eXmxubCw==", + "version": "1.5.33", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.33.tgz", + "integrity": "sha512-+cYTcFB1QqD4j4LegwLfpCNxifb6dDFUAwk6RsLusCwIaZI6or2f+q8rs5tTB2YC53HhOlIbEaqHMAAC8IOIwA==", "dev": true, "license": "ISC" }, @@ -6392,16 +6392,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/get-nonce": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", @@ -7353,14 +7343,11 @@ } }, "node_modules/loupe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", - "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.1" - } + "license": "MIT" }, "node_modules/lowlight": { "version": "3.1.0", @@ -8566,14 +8553,14 @@ } }, "node_modules/pkg-types": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.0.tgz", - "integrity": "sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.1.tgz", + "integrity": "sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==", "dev": true, "license": "MIT", "dependencies": { - "confbox": "^0.1.7", - "mlly": "^1.7.1", + "confbox": "^0.1.8", + "mlly": "^1.7.2", "pathe": "^1.1.2" } }, @@ -9181,14 +9168,14 @@ } }, "node_modules/react-intl": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.7.0.tgz", - "integrity": "sha512-f5QhjuKb+WEqiAbL5hDqUs2+sSRkF0vxkTbJ4A8ompt55XTyOHcrDlCXGq4o73ywFFrpgz+78C9IXegSLlya2A==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.7.1.tgz", + "integrity": "sha512-hT/r8m/XQfY8OShY7F/Y4sTNdCDMxUDY/QhPAFwWjIV5aht2bZX0x/iuZGfZo/Au8gjjbQ70W8H5bBnZf5cX3w==", "license": "BSD-3-Clause", "dependencies": { "@formatjs/ecma402-abstract": "2.0.0", "@formatjs/icu-messageformat-parser": "2.7.8", - "@formatjs/intl": "2.10.5", + "@formatjs/intl": "2.10.6", "@formatjs/intl-displaynames": "6.6.8", "@formatjs/intl-listformat": "7.5.7", "@types/hoist-non-react-statics": "^3.3.1", diff --git a/package.json b/package.json index ee7ebac6..ea64f07c 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ }, "dependencies": { "@atlaskit/empty-state": "^7.11.4", - "@atlaskit/icon": "^22.20.2", + "@atlaskit/icon": "^22.22.0", "@emotion/css": "^11.13.4", "@hello-pangea/dnd": "^17.0.0", "@radix-ui/react-accordion": "^1.2.1", @@ -102,7 +102,7 @@ "mime-types": "^2.1.35", "react-awesome-slider": "^4.1.0", "react-day-picker": "^8.10.1", - "react-intl": "^6.7.0", + "react-intl": "^6.7.1", "react-joyride": "^2.9.2", "react-router-dom": "^6.26.2", "react-select": "^5.8.1", @@ -122,21 +122,21 @@ "@atlaskit/tag": "^12.6.3", "@atlaskit/tag-group": "^10.6.0", "@atlaskit/textarea": "^5.6.2", - "@atlaskit/textfield": "^6.5.2", + "@atlaskit/textfield": "^6.5.3", "@atlaskit/theme": "^13.0.2", "@babel/generator": "^7.25.7", "@babel/parser": "^7.25.7", "@babel/traverse": "^7.25.7", "@babel/types": "^7.25.7", "@biomejs/biome": "^1.9.3", - "@formatjs/cli": "^6.2.12", + "@formatjs/cli": "^6.2.13", "@monaco-editor/react": "^4.6.0", "@total-typescript/ts-reset": "^0.6.1", - "@types/node": "^22.7.4", + "@types/node": "^22.7.5", "@types/react": "^18.3.11", "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^8.8.0", - "@typescript-eslint/parser": "^8.8.0", + "@typescript-eslint/eslint-plugin": "^8.8.1", + "@typescript-eslint/parser": "^8.8.1", "@vitejs/plugin-react-swc": "^3.7.1", "autoprefixer": "^10.4.20", "eslint-config-prettier": "^9.1.0", diff --git a/showcase/public/showcase-sources.txt b/showcase/public/showcase-sources.txt index d7e51115..1658838d 100644 --- a/showcase/public/showcase-sources.txt +++ b/showcase/public/showcase-sources.txt @@ -7508,7 +7508,7 @@ import ShowcaseWrapperItem, { type ShowcaseProps, } from "../../ShowCaseWrapperItem/ShowcaseWrapperItem" -import { Button, TimeTable } from "@linked-planet/ui-kit-ts" +import { Button, TimeTable, timeTableUtils } from "@linked-planet/ui-kit-ts" import CreateNewTimeTableItemDialog from "@linked-planet/ui-kit-ts/components/timetable/CreateNewItem" import ChevronLeftIcon from "@atlaskit/icon/glyph/chevron-left" @@ -7934,14 +7934,39 @@ function TestCustomHeaderRowTimeSlot< isLastOfDay, timeFrameOfDay, viewType, + slotsArray, entries, }: TimeTableTypes.CustomHeadeRowTimeSlotProps) { const groupItems = entries[1].items - const tsEnd = timeSlot.add(timeSlotMinutes, "minutes") - const timeSlotItems = groupItems.filter((it) => { - return it.startDate.isBefore(tsEnd) && it.endDate.isAfter(timeSlot) + + const startAndEndSlots = groupItems.map((it) => + timeTableUtils.getStartAndEndSlot( + it, + slotsArray, + timeFrameOfDay, + timeSlotMinutes, + viewType, + ), + ) + + const getLeftAndWidth = groupItems.map((it, i) => { + const startAndEnd = startAndEndSlots[i] + if (startAndEnd.status === "before" || startAndEnd.status === "after") { + return null + } + return timeTableUtils.getLeftAndWidth( + it, + startAndEnd.startSlot, + startAndEnd.endSlot, + slotsArray, + timeFrameOfDay, + viewType, + timeSlotMinutes, + ) }) - return
{timeSlotItems.length}
+ + console.log("GET LEFT AND WIDTH", getLeftAndWidth) + return
{startAndEndSlots.length}
} function CustomHeaderRowHeader< diff --git a/showcase/src/components/showcase/wrapper/TimeTableShowcase.tsx b/showcase/src/components/showcase/wrapper/TimeTableShowcase.tsx index 703ec35c..cf78010c 100644 --- a/showcase/src/components/showcase/wrapper/TimeTableShowcase.tsx +++ b/showcase/src/components/showcase/wrapper/TimeTableShowcase.tsx @@ -433,21 +433,35 @@ function TestCustomHeaderRowTimeSlot< viewType, slotsArray, entries, + tableCellRef, }: TimeTableTypes.CustomHeadeRowTimeSlotProps) { const groupItems = entries[1].items - const startAndEndSlots = groupItems.map((it) => - timeTableUtils.getStartAndEndSlot( - it, + const groupItemsOfCell: I[] = [] + const startAndEndInSlow: { + status: "in" | "before" | "after" + startSlot: number + endSlot: number + }[] = [] + for (let i = 0; i < groupItems.length; i++) { + const item = groupItems[i] + const startAndEnd = timeTableUtils.getStartAndEndSlot( + item, slotsArray, timeFrameOfDay, timeSlotMinutes, viewType, - ), - ) + ) + if (slotsArray[startAndEnd.startSlot] === timeSlot) { + groupItemsOfCell.push(item) + startAndEndInSlow.push(startAndEnd) + } + } + + console.log("GROUP ITEMS", groupItemsOfCell) - const getLeftAndWidth = groupItems.map((it, i) => { - const startAndEnd = startAndEndSlots[i] + const leftAndWidths = groupItemsOfCell.map((it, i) => { + const startAndEnd = startAndEndInSlow[i] if (startAndEnd.status === "before" || startAndEnd.status === "after") { return null } @@ -462,8 +476,26 @@ function TestCustomHeaderRowTimeSlot< ) }) - console.log("GET LEFT AND WIDTH", getLeftAndWidth) - return
{startAndEndSlots.length}
+ const cellWidth = tableCellRef.current?.offsetWidth ?? 70 + + const ret = leftAndWidths.map((it, i) => + it ? ( +
+ {groupItemsOfCell[i].title} +
+ ) : null, + ) + + console.log("RET", ret, leftAndWidths) + + return <>{ret} } function CustomHeaderRowHeader<