Skip to content
Merged

Dev #84

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions library/src/components/timetable/TimeTableRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default function TimeTableRows<
}
} else {
// not yet rendered
console.log("NOT YET RENDERED", i, refCollection.current)
console.log("TimeTable - placeholder not yet rendered", i)
return
}
}
Expand Down Expand Up @@ -270,6 +270,7 @@ export default function TimeTableRows<
const ret = prev >= newOne ? newOne : prev
if (ret === newOne) {
allPlaceholderRendered.current = false
groupRowsRenderedIdxRef.current = newOne
}
return ret
})
Expand Down Expand Up @@ -319,7 +320,7 @@ export default function TimeTableRows<
// we need to push through an initial rendering of the group rows
// there fore we need to render one time until entries.length - 1

let start = groupRowsRenderedIdx
let start = groupRowsRenderedIdx < 0 ? 0 : groupRowsRenderedIdx

// removal of too many rendered elements
for (
Expand All @@ -328,7 +329,6 @@ export default function TimeTableRows<
g++
) {
if (groupRowsRendered.current[g]) {
console.log("REMOVING ", g, groupRowsRendered.current)
delete groupRowsRendered.current[g]
delete refCollection.current[g]
renderedCells.current.delete(g)
Expand Down Expand Up @@ -398,6 +398,9 @@ export default function TimeTableRows<
start,
increment,
entries,
renderCells.current,
startRender,
groupRowsRenderedIdx,
)
return groupRowsRenderedIdx
}
Expand Down Expand Up @@ -907,7 +910,8 @@ function GroupRows<G extends TimeTableGroup, I extends TimeSlotBooking>({
: 1
const groupHeaderHeight =
rowHeight * rowCount +
(timeSlotSelectionDisabled ? 0 : placeHolderHeight)
(timeSlotSelectionDisabled ? 0 : placeHolderHeight) +
(renderCells ? 0 : 2) // the +1 on the placeholder should improve the behavior of the rounding (that the time table scrolls a bit after scrolling in the time table)
const GroupComponent = useGroupComponent(storeIdent)

const groupHeader = useMemo(() => {
Expand Down Expand Up @@ -940,7 +944,7 @@ function GroupRows<G extends TimeTableGroup, I extends TimeSlotBooking>({
rowSpan={rowSpanGroupHeader}
className={
renderCells
? `border-border border-b-border m-0 p-0 sticky left-0 z-[4] select-none border-0 border-b-2 border-r-2 border-solid ${
? `border-border overflow-hidden box-border border-b-border m-0 p-0 sticky left-0 z-[4] select-none border-0 border-b-2 border-r-2 border-solid ${
groupNumber % 2 === 0
? "bg-surface"
: "bg-surface-hovered"
Expand Down
6 changes: 6 additions & 0 deletions library/src/components/tour/TourWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ export class TourStep {
onPrepare,
onInit,
onExit,
onPrevious,
}: {
step: TourStepProps
onPrepare?: () => void
onInit?: () => void
onExit?: () => void
onPrevious?: () => void
}) {
const content = (
<div className={this.contentClassname}>{step.content}</div>
Expand All @@ -33,6 +35,7 @@ export class TourStep {
this.onInit = onInit
this.onPrepare = onPrepare
this.onExit = onExit
this.onPrevious = onPrevious
}

set step(step: Step) {
Expand All @@ -50,6 +53,8 @@ export class TourStep {
onPrepare?(): void

onExit?(): void

onPrevious?(): void
}

export interface TourProps {
Expand Down Expand Up @@ -160,6 +165,7 @@ export function Tour({
next(1)
break
case "prev":
steps[index]?.onPrevious?.()
steps[index - 1]?.onInit?.()
next(-1)
break
Expand Down
Loading