awesome-timeline-react 0.1.13 → 0.1.15
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/README.md +7 -1
- package/dist/_tsup-dts-rollup.d.mts +53 -33
- package/dist/_tsup-dts-rollup.d.ts +53 -33
- package/dist/index.css +210 -206
- package/dist/index.css.map +1 -1
- package/dist/index.js +1923 -1851
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1910 -1833
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@ The following properties for Timeline component are available:
|
|
|
44
44
|
- `content`: `JSX.Element | string` (customizable content for each event)
|
|
45
45
|
- `classNames`: `string[]` (array of additional class names for customizing the event)
|
|
46
46
|
- `isResizable`: `boolean` (defines if event is resizable, overrides the default property `eventsResize`)
|
|
47
|
+
- `showPrompt`: `boolean` (defines if prompt will be shown after hover. Works only if `showEventPrompt` is set as true)
|
|
48
|
+
- `metadata`: `any` (some data that can be used by event prompt template)
|
|
47
49
|
|
|
48
50
|
- `staticEvents` – an array of objects that define static events for particular rows, meaning the events are not interactable by the user.
|
|
49
51
|
|
|
@@ -73,6 +75,10 @@ The following properties for Timeline component are available:
|
|
|
73
75
|
|
|
74
76
|
- `eventsResize` - property that define if events are resizeable (default as true)
|
|
75
77
|
|
|
78
|
+
- `showEventPrompt` - property that define if prompt for events will be shown after hover (defualt as true)
|
|
79
|
+
|
|
80
|
+
- `eventPromptTemplate` - function that can be passed for event prompt. Function receives currently hovered `event` object. It returns JSX Element so it can be customize in various ways. The example is in story.
|
|
81
|
+
|
|
76
82
|
## Awesome Features
|
|
77
83
|
|
|
78
84
|
One of the awesome features (currently hidden from the interface) is adjusting the granulation of the grid. To achieve this, click the wheel on the mouse. This will hide the scroll bar, and you can adjust the grid granulation by scrolling the wheel. Each scroll iteration adjusts the grid by ±15 minutes, depending on the scroll direction.
|
|
@@ -85,6 +91,6 @@ Here, we will store major features planned for future releases (from highest to
|
|
|
85
91
|
|
|
86
92
|
1. ~~Resize events~~ - published in 0.1.8 version
|
|
87
93
|
2. ~~Real time line~~ - published in 0.1.7 version
|
|
88
|
-
3. Customizable prompts after hovering over an event
|
|
94
|
+
3. ~~Customizable prompts after hovering over an event~~ - published in 0.1.14 version
|
|
89
95
|
4. Customizable second row of the time bar
|
|
90
96
|
5. Intersection observer with `display: none` property to further improve performance
|
|
@@ -28,6 +28,20 @@ export declare const default_alias_1: React_2.ForwardRefExoticComponent<
|
|
|
28
28
|
>;
|
|
29
29
|
|
|
30
30
|
export declare const default_alias_10: ({
|
|
31
|
+
id,
|
|
32
|
+
startPosition,
|
|
33
|
+
width,
|
|
34
|
+
top,
|
|
35
|
+
height,
|
|
36
|
+
}: {
|
|
37
|
+
id: string;
|
|
38
|
+
startPosition: CSSProperties["left"];
|
|
39
|
+
width: CSSProperties["width"];
|
|
40
|
+
top: CSSProperties["top"];
|
|
41
|
+
height: CSSProperties["height"];
|
|
42
|
+
}) => React_2.JSX.Element;
|
|
43
|
+
|
|
44
|
+
export declare const default_alias_11: ({
|
|
31
45
|
windowTime,
|
|
32
46
|
tick,
|
|
33
47
|
contentWidth,
|
|
@@ -41,16 +55,16 @@ export declare const default_alias_10: ({
|
|
|
41
55
|
additionalClassNames?: PartialRecord<keyof ModifableElements, string>;
|
|
42
56
|
}) => React_2.JSX.Element;
|
|
43
57
|
|
|
44
|
-
export declare const
|
|
58
|
+
export declare const default_alias_12: (monthIndex: number) => string;
|
|
45
59
|
|
|
46
|
-
export declare const
|
|
60
|
+
export declare const default_alias_13: (dayIndex: number) => string;
|
|
47
61
|
|
|
48
|
-
export declare const
|
|
62
|
+
export declare const default_alias_14: (
|
|
49
63
|
eventA: EventType,
|
|
50
64
|
eventB: EventType
|
|
51
65
|
) => 1 | -1;
|
|
52
66
|
|
|
53
|
-
export declare const
|
|
67
|
+
export declare const default_alias_15: ({
|
|
54
68
|
windowTime,
|
|
55
69
|
tick,
|
|
56
70
|
contentWidth,
|
|
@@ -65,7 +79,7 @@ export declare const default_alias_14: ({
|
|
|
65
79
|
hourBlocks: JSX.Element[];
|
|
66
80
|
};
|
|
67
81
|
|
|
68
|
-
export declare const
|
|
82
|
+
export declare const default_alias_16: ({
|
|
69
83
|
windowTime,
|
|
70
84
|
contentWidth,
|
|
71
85
|
}: {
|
|
@@ -76,7 +90,7 @@ export declare const default_alias_15: ({
|
|
|
76
90
|
blockWidth: number;
|
|
77
91
|
};
|
|
78
92
|
|
|
79
|
-
export declare const
|
|
93
|
+
export declare const default_alias_17: ({
|
|
80
94
|
bodyRef,
|
|
81
95
|
rowsContentRef,
|
|
82
96
|
}: {
|
|
@@ -84,7 +98,7 @@ export declare const default_alias_16: ({
|
|
|
84
98
|
rowsContentRef: React.MutableRefObject<HTMLDivElement[] | null>;
|
|
85
99
|
}) => void;
|
|
86
100
|
|
|
87
|
-
export declare const
|
|
101
|
+
export declare const default_alias_18: ({
|
|
88
102
|
rows,
|
|
89
103
|
windowTime,
|
|
90
104
|
tick,
|
|
@@ -95,7 +109,7 @@ export declare const default_alias_17: ({
|
|
|
95
109
|
bodyRef,
|
|
96
110
|
}: ProduceContentType) => React_2.JSX.Element[];
|
|
97
111
|
|
|
98
|
-
export declare const
|
|
112
|
+
export declare const default_alias_19: ({
|
|
99
113
|
windowTime,
|
|
100
114
|
setTick,
|
|
101
115
|
setCellWidth,
|
|
@@ -107,25 +121,27 @@ export declare const default_alias_18: ({
|
|
|
107
121
|
contentRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
108
122
|
}) => void;
|
|
109
123
|
|
|
110
|
-
export declare const default_alias_2:
|
|
111
|
-
|
|
124
|
+
export declare const default_alias_2: React_2.ForwardRefExoticComponent<
|
|
125
|
+
EventPromptType & React_2.RefAttributes<EventPromptActionsType>
|
|
126
|
+
>;
|
|
127
|
+
|
|
128
|
+
export declare const default_alias_3: ({
|
|
129
|
+
eventData,
|
|
112
130
|
startPosition,
|
|
113
131
|
width,
|
|
114
132
|
top,
|
|
115
|
-
props,
|
|
116
133
|
setEvents,
|
|
117
134
|
tick,
|
|
118
135
|
}: {
|
|
119
|
-
|
|
136
|
+
eventData: EventType;
|
|
120
137
|
startPosition: number;
|
|
121
138
|
width: number;
|
|
122
139
|
top: CSSProperties["top"];
|
|
123
|
-
props?: EventPropsType;
|
|
124
140
|
setEvents: React_2.Dispatch<React_2.SetStateAction<EventType[]>>;
|
|
125
141
|
tick: number | null;
|
|
126
142
|
}) => React_2.JSX.Element;
|
|
127
143
|
|
|
128
|
-
export declare const
|
|
144
|
+
export declare const default_alias_4: ({
|
|
129
145
|
contentWidth,
|
|
130
146
|
cellWidth,
|
|
131
147
|
lineClassName,
|
|
@@ -135,15 +151,15 @@ export declare const default_alias_3: ({
|
|
|
135
151
|
lineClassName?: string;
|
|
136
152
|
}) => React_2.JSX.Element;
|
|
137
153
|
|
|
138
|
-
export declare const
|
|
154
|
+
export declare const default_alias_5: () => React_2.JSX.Element;
|
|
139
155
|
|
|
140
|
-
export declare const
|
|
156
|
+
export declare const default_alias_6: React_2.ForwardRefExoticComponent<
|
|
141
157
|
RowContentProps & {
|
|
142
158
|
children?: React_2.ReactNode;
|
|
143
159
|
} & React_2.RefAttributes<HTMLDivElement>
|
|
144
160
|
>;
|
|
145
161
|
|
|
146
|
-
export declare const
|
|
162
|
+
export declare const default_alias_7: ({
|
|
147
163
|
name,
|
|
148
164
|
id,
|
|
149
165
|
}: {
|
|
@@ -151,7 +167,7 @@ export declare const default_alias_6: ({
|
|
|
151
167
|
id: string;
|
|
152
168
|
}) => React_2.JSX.Element;
|
|
153
169
|
|
|
154
|
-
export declare const
|
|
170
|
+
export declare const default_alias_8: ({
|
|
155
171
|
rows,
|
|
156
172
|
className,
|
|
157
173
|
}: {
|
|
@@ -159,7 +175,7 @@ export declare const default_alias_7: ({
|
|
|
159
175
|
className?: string;
|
|
160
176
|
}) => React_2.JSX.Element;
|
|
161
177
|
|
|
162
|
-
export declare const
|
|
178
|
+
export declare const default_alias_9: ({
|
|
163
179
|
tick,
|
|
164
180
|
windowTime,
|
|
165
181
|
}: {
|
|
@@ -167,20 +183,6 @@ export declare const default_alias_8: ({
|
|
|
167
183
|
windowTime: number[];
|
|
168
184
|
}) => React_2.JSX.Element;
|
|
169
185
|
|
|
170
|
-
export declare const default_alias_9: ({
|
|
171
|
-
id,
|
|
172
|
-
startPosition,
|
|
173
|
-
width,
|
|
174
|
-
top,
|
|
175
|
-
height,
|
|
176
|
-
}: {
|
|
177
|
-
id: string;
|
|
178
|
-
startPosition: CSSProperties["left"];
|
|
179
|
-
width: CSSProperties["width"];
|
|
180
|
-
top: CSSProperties["top"];
|
|
181
|
-
height: CSSProperties["height"];
|
|
182
|
-
}) => React_2.JSX.Element;
|
|
183
|
-
|
|
184
186
|
export declare const DragStartedContext: Context<DragStartedContext_2>;
|
|
185
187
|
|
|
186
188
|
declare type DragStartedContext_2 = {
|
|
@@ -188,11 +190,24 @@ declare type DragStartedContext_2 = {
|
|
|
188
190
|
setDragStarted: React.Dispatch<React.SetStateAction<boolean>>;
|
|
189
191
|
};
|
|
190
192
|
|
|
193
|
+
export declare type EventPromptActionsType = {
|
|
194
|
+
setDisplay: (value: string) => void;
|
|
195
|
+
setRight: (value: string) => void;
|
|
196
|
+
setBottom: (value: string) => void;
|
|
197
|
+
setEvent: (event: EventType) => void;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
declare type EventPromptType = {
|
|
201
|
+
template?: (event: EventType) => JSX.Element;
|
|
202
|
+
};
|
|
203
|
+
|
|
191
204
|
export declare type EventPropsType = {
|
|
192
205
|
isLocked?: boolean;
|
|
193
206
|
content?: JSX.Element | string;
|
|
194
207
|
classNames?: string[];
|
|
195
208
|
isResizable?: boolean;
|
|
209
|
+
showPrompt?: boolean;
|
|
210
|
+
metadata?: any;
|
|
196
211
|
};
|
|
197
212
|
|
|
198
213
|
export declare type EventType = {
|
|
@@ -209,6 +224,7 @@ declare type ExternalPropertiesType = {
|
|
|
209
224
|
onDrop?: (props: OnDropProps) => void;
|
|
210
225
|
onResize?: (props: OnResizeProps) => void;
|
|
211
226
|
eventsResize?: boolean;
|
|
227
|
+
eventPromptRef?: React.MutableRefObject<EventPromptActionsType | null>;
|
|
212
228
|
};
|
|
213
229
|
|
|
214
230
|
export declare type ModifableElements = {
|
|
@@ -287,6 +303,8 @@ declare const Timeline: ({
|
|
|
287
303
|
additionalClassNames,
|
|
288
304
|
showRTIndicator,
|
|
289
305
|
eventsResize,
|
|
306
|
+
eventPromptTemplate,
|
|
307
|
+
showEventPrompt,
|
|
290
308
|
}: TimelineType) => React_2.JSX.Element;
|
|
291
309
|
export { Timeline };
|
|
292
310
|
export { Timeline as Timeline_alias_1 };
|
|
@@ -304,6 +322,8 @@ export declare type TimelineType = {
|
|
|
304
322
|
additionalClassNames?: PartialRecord<keyof ModifableElements, string>;
|
|
305
323
|
showRTIndicator?: boolean;
|
|
306
324
|
eventsResize?: boolean;
|
|
325
|
+
eventPromptTemplate?: (event: EventType) => JSX.Element;
|
|
326
|
+
showEventPrompt?: boolean;
|
|
307
327
|
};
|
|
308
328
|
|
|
309
329
|
export {};
|
|
@@ -28,6 +28,20 @@ export declare const default_alias_1: React_2.ForwardRefExoticComponent<
|
|
|
28
28
|
>;
|
|
29
29
|
|
|
30
30
|
export declare const default_alias_10: ({
|
|
31
|
+
id,
|
|
32
|
+
startPosition,
|
|
33
|
+
width,
|
|
34
|
+
top,
|
|
35
|
+
height,
|
|
36
|
+
}: {
|
|
37
|
+
id: string;
|
|
38
|
+
startPosition: CSSProperties["left"];
|
|
39
|
+
width: CSSProperties["width"];
|
|
40
|
+
top: CSSProperties["top"];
|
|
41
|
+
height: CSSProperties["height"];
|
|
42
|
+
}) => React_2.JSX.Element;
|
|
43
|
+
|
|
44
|
+
export declare const default_alias_11: ({
|
|
31
45
|
windowTime,
|
|
32
46
|
tick,
|
|
33
47
|
contentWidth,
|
|
@@ -41,16 +55,16 @@ export declare const default_alias_10: ({
|
|
|
41
55
|
additionalClassNames?: PartialRecord<keyof ModifableElements, string>;
|
|
42
56
|
}) => React_2.JSX.Element;
|
|
43
57
|
|
|
44
|
-
export declare const
|
|
58
|
+
export declare const default_alias_12: (monthIndex: number) => string;
|
|
45
59
|
|
|
46
|
-
export declare const
|
|
60
|
+
export declare const default_alias_13: (dayIndex: number) => string;
|
|
47
61
|
|
|
48
|
-
export declare const
|
|
62
|
+
export declare const default_alias_14: (
|
|
49
63
|
eventA: EventType,
|
|
50
64
|
eventB: EventType
|
|
51
65
|
) => 1 | -1;
|
|
52
66
|
|
|
53
|
-
export declare const
|
|
67
|
+
export declare const default_alias_15: ({
|
|
54
68
|
windowTime,
|
|
55
69
|
tick,
|
|
56
70
|
contentWidth,
|
|
@@ -65,7 +79,7 @@ export declare const default_alias_14: ({
|
|
|
65
79
|
hourBlocks: JSX.Element[];
|
|
66
80
|
};
|
|
67
81
|
|
|
68
|
-
export declare const
|
|
82
|
+
export declare const default_alias_16: ({
|
|
69
83
|
windowTime,
|
|
70
84
|
contentWidth,
|
|
71
85
|
}: {
|
|
@@ -76,7 +90,7 @@ export declare const default_alias_15: ({
|
|
|
76
90
|
blockWidth: number;
|
|
77
91
|
};
|
|
78
92
|
|
|
79
|
-
export declare const
|
|
93
|
+
export declare const default_alias_17: ({
|
|
80
94
|
bodyRef,
|
|
81
95
|
rowsContentRef,
|
|
82
96
|
}: {
|
|
@@ -84,7 +98,7 @@ export declare const default_alias_16: ({
|
|
|
84
98
|
rowsContentRef: React.MutableRefObject<HTMLDivElement[] | null>;
|
|
85
99
|
}) => void;
|
|
86
100
|
|
|
87
|
-
export declare const
|
|
101
|
+
export declare const default_alias_18: ({
|
|
88
102
|
rows,
|
|
89
103
|
windowTime,
|
|
90
104
|
tick,
|
|
@@ -95,7 +109,7 @@ export declare const default_alias_17: ({
|
|
|
95
109
|
bodyRef,
|
|
96
110
|
}: ProduceContentType) => React_2.JSX.Element[];
|
|
97
111
|
|
|
98
|
-
export declare const
|
|
112
|
+
export declare const default_alias_19: ({
|
|
99
113
|
windowTime,
|
|
100
114
|
setTick,
|
|
101
115
|
setCellWidth,
|
|
@@ -107,25 +121,27 @@ export declare const default_alias_18: ({
|
|
|
107
121
|
contentRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
108
122
|
}) => void;
|
|
109
123
|
|
|
110
|
-
export declare const default_alias_2:
|
|
111
|
-
|
|
124
|
+
export declare const default_alias_2: React_2.ForwardRefExoticComponent<
|
|
125
|
+
EventPromptType & React_2.RefAttributes<EventPromptActionsType>
|
|
126
|
+
>;
|
|
127
|
+
|
|
128
|
+
export declare const default_alias_3: ({
|
|
129
|
+
eventData,
|
|
112
130
|
startPosition,
|
|
113
131
|
width,
|
|
114
132
|
top,
|
|
115
|
-
props,
|
|
116
133
|
setEvents,
|
|
117
134
|
tick,
|
|
118
135
|
}: {
|
|
119
|
-
|
|
136
|
+
eventData: EventType;
|
|
120
137
|
startPosition: number;
|
|
121
138
|
width: number;
|
|
122
139
|
top: CSSProperties["top"];
|
|
123
|
-
props?: EventPropsType;
|
|
124
140
|
setEvents: React_2.Dispatch<React_2.SetStateAction<EventType[]>>;
|
|
125
141
|
tick: number | null;
|
|
126
142
|
}) => React_2.JSX.Element;
|
|
127
143
|
|
|
128
|
-
export declare const
|
|
144
|
+
export declare const default_alias_4: ({
|
|
129
145
|
contentWidth,
|
|
130
146
|
cellWidth,
|
|
131
147
|
lineClassName,
|
|
@@ -135,15 +151,15 @@ export declare const default_alias_3: ({
|
|
|
135
151
|
lineClassName?: string;
|
|
136
152
|
}) => React_2.JSX.Element;
|
|
137
153
|
|
|
138
|
-
export declare const
|
|
154
|
+
export declare const default_alias_5: () => React_2.JSX.Element;
|
|
139
155
|
|
|
140
|
-
export declare const
|
|
156
|
+
export declare const default_alias_6: React_2.ForwardRefExoticComponent<
|
|
141
157
|
RowContentProps & {
|
|
142
158
|
children?: React_2.ReactNode;
|
|
143
159
|
} & React_2.RefAttributes<HTMLDivElement>
|
|
144
160
|
>;
|
|
145
161
|
|
|
146
|
-
export declare const
|
|
162
|
+
export declare const default_alias_7: ({
|
|
147
163
|
name,
|
|
148
164
|
id,
|
|
149
165
|
}: {
|
|
@@ -151,7 +167,7 @@ export declare const default_alias_6: ({
|
|
|
151
167
|
id: string;
|
|
152
168
|
}) => React_2.JSX.Element;
|
|
153
169
|
|
|
154
|
-
export declare const
|
|
170
|
+
export declare const default_alias_8: ({
|
|
155
171
|
rows,
|
|
156
172
|
className,
|
|
157
173
|
}: {
|
|
@@ -159,7 +175,7 @@ export declare const default_alias_7: ({
|
|
|
159
175
|
className?: string;
|
|
160
176
|
}) => React_2.JSX.Element;
|
|
161
177
|
|
|
162
|
-
export declare const
|
|
178
|
+
export declare const default_alias_9: ({
|
|
163
179
|
tick,
|
|
164
180
|
windowTime,
|
|
165
181
|
}: {
|
|
@@ -167,20 +183,6 @@ export declare const default_alias_8: ({
|
|
|
167
183
|
windowTime: number[];
|
|
168
184
|
}) => React_2.JSX.Element;
|
|
169
185
|
|
|
170
|
-
export declare const default_alias_9: ({
|
|
171
|
-
id,
|
|
172
|
-
startPosition,
|
|
173
|
-
width,
|
|
174
|
-
top,
|
|
175
|
-
height,
|
|
176
|
-
}: {
|
|
177
|
-
id: string;
|
|
178
|
-
startPosition: CSSProperties["left"];
|
|
179
|
-
width: CSSProperties["width"];
|
|
180
|
-
top: CSSProperties["top"];
|
|
181
|
-
height: CSSProperties["height"];
|
|
182
|
-
}) => React_2.JSX.Element;
|
|
183
|
-
|
|
184
186
|
export declare const DragStartedContext: Context<DragStartedContext_2>;
|
|
185
187
|
|
|
186
188
|
declare type DragStartedContext_2 = {
|
|
@@ -188,11 +190,24 @@ declare type DragStartedContext_2 = {
|
|
|
188
190
|
setDragStarted: React.Dispatch<React.SetStateAction<boolean>>;
|
|
189
191
|
};
|
|
190
192
|
|
|
193
|
+
export declare type EventPromptActionsType = {
|
|
194
|
+
setDisplay: (value: string) => void;
|
|
195
|
+
setRight: (value: string) => void;
|
|
196
|
+
setBottom: (value: string) => void;
|
|
197
|
+
setEvent: (event: EventType) => void;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
declare type EventPromptType = {
|
|
201
|
+
template?: (event: EventType) => JSX.Element;
|
|
202
|
+
};
|
|
203
|
+
|
|
191
204
|
export declare type EventPropsType = {
|
|
192
205
|
isLocked?: boolean;
|
|
193
206
|
content?: JSX.Element | string;
|
|
194
207
|
classNames?: string[];
|
|
195
208
|
isResizable?: boolean;
|
|
209
|
+
showPrompt?: boolean;
|
|
210
|
+
metadata?: any;
|
|
196
211
|
};
|
|
197
212
|
|
|
198
213
|
export declare type EventType = {
|
|
@@ -209,6 +224,7 @@ declare type ExternalPropertiesType = {
|
|
|
209
224
|
onDrop?: (props: OnDropProps) => void;
|
|
210
225
|
onResize?: (props: OnResizeProps) => void;
|
|
211
226
|
eventsResize?: boolean;
|
|
227
|
+
eventPromptRef?: React.MutableRefObject<EventPromptActionsType | null>;
|
|
212
228
|
};
|
|
213
229
|
|
|
214
230
|
export declare type ModifableElements = {
|
|
@@ -287,6 +303,8 @@ declare const Timeline: ({
|
|
|
287
303
|
additionalClassNames,
|
|
288
304
|
showRTIndicator,
|
|
289
305
|
eventsResize,
|
|
306
|
+
eventPromptTemplate,
|
|
307
|
+
showEventPrompt,
|
|
290
308
|
}: TimelineType) => React_2.JSX.Element;
|
|
291
309
|
export { Timeline };
|
|
292
310
|
export { Timeline as Timeline_alias_1 };
|
|
@@ -304,6 +322,8 @@ export declare type TimelineType = {
|
|
|
304
322
|
additionalClassNames?: PartialRecord<keyof ModifableElements, string>;
|
|
305
323
|
showRTIndicator?: boolean;
|
|
306
324
|
eventsResize?: boolean;
|
|
325
|
+
eventPromptTemplate?: (event: EventType) => JSX.Element;
|
|
326
|
+
showEventPrompt?: boolean;
|
|
307
327
|
};
|
|
308
328
|
|
|
309
329
|
export {};
|