@colisweb/rescript-toolkit 5.49.1 → 5.49.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "5.49.1",
3
+ "version": "5.49.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -49,6 +49,7 @@ type contentParams = {index: int}
49
49
  type timelinePointExtras = {
50
50
  className?: string,
51
51
  content?: contentParams => React.element,
52
+ onClick?: unit => unit,
52
53
  popoverContent?: React.element,
53
54
  popoverContentOptions?: Radix.Popover.Content.options,
54
55
  }
@@ -301,6 +302,7 @@ module Timeline = {
301
302
  | None =>
302
303
  <div
303
304
  className={"w-full h-[--markerHeight] text-center font-semibold text-sm"}
305
+ onClick={_ => extras.onClick->Option.forEach(fn => fn())}
304
306
  style={{
305
307
  "--markerHeight": switch marker {
306
308
  | Cluster(_) => markerWidth +. 10.
@@ -313,6 +315,7 @@ module Timeline = {
313
315
  <Toolkit__Ui_Popover
314
316
  triggerAsChild={true}
315
317
  trigger={<div
318
+ onClick={_ => extras.onClick->Option.forEach(fn => fn())}
316
319
  className={"w-full h-[--markerHeight] cursor-pointer text-center font-semibold text-sm"}
317
320
  style={{
318
321
  "--markerHeight": switch marker {
@@ -418,6 +421,7 @@ let make = (
418
421
  ~infosContainerClassName="",
419
422
  ~displayCurrentTime=false,
420
423
  ~centerOnMount=false,
424
+ ~initialScaleValue=0.,
421
425
  ) => {
422
426
  let containerRef = React.useRef(Js.Nullable.null)
423
427
  let (measuringScale, setMeasuringScale) = React.useState((): option<state> => None)
@@ -465,7 +469,7 @@ let make = (
465
469
  )
466
470
 
467
471
  let measuringScale = calculateMeasuringScale(
468
- ~containerWidth=containerWidth +. 600.,
472
+ ~containerWidth=containerWidth +. initialScaleValue,
469
473
  ~startHour=startHour.contents,
470
474
  ~endHour=endHour.contents,
471
475
  )