@kashifsaadat/react-scheduler 0.0.10 → 0.0.11

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/dist/index.d.ts CHANGED
@@ -47,6 +47,11 @@ export declare type Config = {
47
47
  maxZoom?: (typeof allZoomLevel)[number];
48
48
  dateFormat?: string;
49
49
  timeFormat?: string;
50
+ /**
51
+ * Enable drag and resize functionality for tiles
52
+ * @default false
53
+ */
54
+ editable?: boolean;
50
55
  };
51
56
 
52
57
  declare type LangCodes = "en" | "pl" | "de" | "lt";
@@ -63,7 +68,7 @@ declare type ParsedDatesRange = {
63
68
  endDate: Date;
64
69
  };
65
70
 
66
- export declare const Scheduler: ({ data, config, startDate, onRangeChange, onVisibleViewportChange, onZoomChange, onTileClick, onFilterData, onClearFilterData, onItemClick, isLoading }: SchedulerProps) => JSX.Element;
71
+ export declare const Scheduler: ({ data, config, startDate, onRangeChange, onVisibleViewportChange, onZoomChange, onTileClick, onFilterData, onClearFilterData, onItemClick, onTileUpdate, isLoading }: SchedulerProps) => JSX.Element;
67
72
 
68
73
  export declare type SchedulerData = SchedulerRow[];
69
74
 
@@ -116,6 +121,12 @@ export declare type SchedulerProps = {
116
121
  onFilterData?: () => void;
117
122
  onClearFilterData?: () => void;
118
123
  onItemClick?: (data: SchedulerItemClickData) => void;
124
+ /**
125
+ * Callback when a tile is updated via drag or resize.
126
+ * Only called when config.editable is true.
127
+ * Returns the tile id, new start date, and new end date.
128
+ */
129
+ onTileUpdate?: (payload: TileUpdatePayload) => void;
119
130
  };
120
131
 
121
132
  declare type SchedulerRow = {
@@ -135,6 +146,12 @@ declare type Theme = {
135
146
  dark?: Partial<Record<ColorType, string>>;
136
147
  };
137
148
 
149
+ export declare type TileUpdatePayload = {
150
+ id: string;
151
+ startDate: Date;
152
+ endDate: Date;
153
+ };
154
+
138
155
  declare type Topbar = {
139
156
  filters: string;
140
157
  next: string;