Skip to content

Commit 8d6eb50

Browse files
Merge pull request #84 from linked-planet/dev
Dev
2 parents a44e8fd + 4f837cd commit 8d6eb50

File tree

5 files changed

+2302
-387
lines changed

5 files changed

+2302
-387
lines changed

library/src/components/timetable/TimeTableRows.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export default function TimeTableRows<
194194
}
195195
} else {
196196
// not yet rendered
197-
console.log("NOT YET RENDERED", i, refCollection.current)
197+
console.log("TimeTable - placeholder not yet rendered", i)
198198
return
199199
}
200200
}
@@ -270,6 +270,7 @@ export default function TimeTableRows<
270270
const ret = prev >= newOne ? newOne : prev
271271
if (ret === newOne) {
272272
allPlaceholderRendered.current = false
273+
groupRowsRenderedIdxRef.current = newOne
273274
}
274275
return ret
275276
})
@@ -319,7 +320,7 @@ export default function TimeTableRows<
319320
// we need to push through an initial rendering of the group rows
320321
// there fore we need to render one time until entries.length - 1
321322

322-
let start = groupRowsRenderedIdx
323+
let start = groupRowsRenderedIdx < 0 ? 0 : groupRowsRenderedIdx
323324

324325
// removal of too many rendered elements
325326
for (
@@ -328,7 +329,6 @@ export default function TimeTableRows<
328329
g++
329330
) {
330331
if (groupRowsRendered.current[g]) {
331-
console.log("REMOVING ", g, groupRowsRendered.current)
332332
delete groupRowsRendered.current[g]
333333
delete refCollection.current[g]
334334
renderedCells.current.delete(g)
@@ -398,6 +398,9 @@ export default function TimeTableRows<
398398
start,
399399
increment,
400400
entries,
401+
renderCells.current,
402+
startRender,
403+
groupRowsRenderedIdx,
401404
)
402405
return groupRowsRenderedIdx
403406
}
@@ -907,7 +910,8 @@ function GroupRows<G extends TimeTableGroup, I extends TimeSlotBooking>({
907910
: 1
908911
const groupHeaderHeight =
909912
rowHeight * rowCount +
910-
(timeSlotSelectionDisabled ? 0 : placeHolderHeight)
913+
(timeSlotSelectionDisabled ? 0 : placeHolderHeight) +
914+
(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)
911915
const GroupComponent = useGroupComponent(storeIdent)
912916

913917
const groupHeader = useMemo(() => {
@@ -940,7 +944,7 @@ function GroupRows<G extends TimeTableGroup, I extends TimeSlotBooking>({
940944
rowSpan={rowSpanGroupHeader}
941945
className={
942946
renderCells
943-
? `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 ${
947+
? `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 ${
944948
groupNumber % 2 === 0
945949
? "bg-surface"
946950
: "bg-surface-hovered"

library/src/components/tour/TourWrapper.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ export class TourStep {
2020
onPrepare,
2121
onInit,
2222
onExit,
23+
onPrevious,
2324
}: {
2425
step: TourStepProps
2526
onPrepare?: () => void
2627
onInit?: () => void
2728
onExit?: () => void
29+
onPrevious?: () => void
2830
}) {
2931
const content = (
3032
<div className={this.contentClassname}>{step.content}</div>
@@ -33,6 +35,7 @@ export class TourStep {
3335
this.onInit = onInit
3436
this.onPrepare = onPrepare
3537
this.onExit = onExit
38+
this.onPrevious = onPrevious
3639
}
3740

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

5255
onExit?(): void
56+
57+
onPrevious?(): void
5358
}
5459

5560
export interface TourProps {
@@ -160,6 +165,7 @@ export function Tour({
160165
next(1)
161166
break
162167
case "prev":
168+
steps[index]?.onPrevious?.()
163169
steps[index - 1]?.onInit?.()
164170
next(-1)
165171
break

0 commit comments

Comments
 (0)