@kashifsaadat/react-scheduler 0.0.8

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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2023 Bitnoise
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,160 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+
3
+ declare const allZoomLevel: readonly [0, 1, 2];
4
+
5
+ declare type ColorType = "background" | "gridBackground" | "primary" | "secondary" | "tertiary" | "textPrimary" | "textSecondary" | "accent" | "disabled" | "border" | "placeholder" | "warning" | "button" | "tooltip" | "defaultTile" | "hover";
6
+
7
+ export declare type Config = {
8
+ zoom: ZoomLevel;
9
+ /**
10
+ * Dictates filter button behavior
11
+ * - `< 0` - filter button is hidden
12
+ * - `0` - filter button is visible, no filter had been applied
13
+ * - `> 0` - filter button visible - filters had been applied
14
+ */
15
+ filterButtonState?: number;
16
+ /**
17
+ * Language code: "en" | "pl" | "de"
18
+ */
19
+ lang?: LangCodes | string;
20
+ isFiltersButtonVisible?: boolean;
21
+ maxRecordsPerPage?: number;
22
+ /**
23
+ * property for changing behavior of showing tooltip hours
24
+ * true - will show taken hours same as business days
25
+ * false - will always show 0 taken hours on weekends in day view
26
+ * @default false
27
+ */
28
+ includeTakenHoursOnWeekendsInDayView?: boolean;
29
+ /**
30
+ * show tooltip when hovering over tiles items
31
+ * @default true
32
+ */
33
+ showTooltip?: boolean;
34
+ translations?: LocaleType[];
35
+ /**
36
+ * show toggle button for changing theme (light/dark)
37
+ */
38
+ showThemeToggle?: boolean;
39
+ /**
40
+ * default theme (light/dark)
41
+ * when theme toggle is displayed - this is a default value of the toggle
42
+ * @default "light"
43
+ */
44
+ defaultTheme?: "light" | "dark";
45
+ theme?: Theme;
46
+ minZoom?: (typeof allZoomLevel)[number];
47
+ maxZoom?: (typeof allZoomLevel)[number];
48
+ dateFormat?: string;
49
+ timeFormat?: string;
50
+ };
51
+
52
+ declare type LangCodes = "en" | "pl" | "de" | "lt";
53
+
54
+ declare type LocaleType = {
55
+ id: string;
56
+ lang: Translation;
57
+ translateCode: string;
58
+ dayjsTranslations: string | ILocale | undefined;
59
+ };
60
+
61
+ declare type ParsedDatesRange = {
62
+ startDate: Date;
63
+ endDate: Date;
64
+ };
65
+
66
+ export declare const Scheduler: ({ data, config, startDate, onRangeChange, onTileClick, onFilterData, onClearFilterData, onItemClick, isLoading }: SchedulerProps) => JSX.Element;
67
+
68
+ export declare type SchedulerData = SchedulerRow[];
69
+
70
+ declare type SchedulerItemClickData = Omit<SchedulerRow, "data">;
71
+
72
+ export declare type SchedulerProjectData = {
73
+ /**
74
+ * Unique Id of item
75
+ */
76
+ id: string;
77
+ /**
78
+ * Represents start date of from which tile will render
79
+ */
80
+ startDate: Date;
81
+ /**
82
+ * Represents end date to which tile will render
83
+ */
84
+ endDate: Date;
85
+ /**
86
+ * Indicates how much time is spent per day. Given in seconds and converted by Scheduler to hours/minutes
87
+ */
88
+ occupancy: number;
89
+ /**
90
+ * Title of item
91
+ */
92
+ title: string;
93
+ /**
94
+ * Subtitle of item. Optional
95
+ */
96
+ subtitle?: string;
97
+ /**
98
+ * Short description displayed on tile. Optional
99
+ */
100
+ description?: string;
101
+ /**
102
+ * Background color of the tile, given in rgb color model. If not given, default color (rgb(114, 141,226 )) is set. Optional
103
+ */
104
+ bgColor?: string;
105
+ };
106
+
107
+ export declare type SchedulerProps = {
108
+ data: SchedulerData;
109
+ isLoading?: boolean;
110
+ config?: Config;
111
+ startDate?: string;
112
+ onRangeChange?: (range: ParsedDatesRange) => void;
113
+ onTileClick?: (data: SchedulerProjectData) => void;
114
+ onFilterData?: () => void;
115
+ onClearFilterData?: () => void;
116
+ onItemClick?: (data: SchedulerItemClickData) => void;
117
+ };
118
+
119
+ declare type SchedulerRow = {
120
+ id: string;
121
+ label: SchedulerRowLabel;
122
+ data: SchedulerProjectData[];
123
+ };
124
+
125
+ declare type SchedulerRowLabel = {
126
+ icon: string;
127
+ title: string;
128
+ subtitle: string;
129
+ };
130
+
131
+ declare type Theme = {
132
+ light?: Partial<Record<ColorType, string>>;
133
+ dark?: Partial<Record<ColorType, string>>;
134
+ };
135
+
136
+ declare type Topbar = {
137
+ filters: string;
138
+ next: string;
139
+ prev: string;
140
+ today: string;
141
+ view: string;
142
+ };
143
+
144
+ declare type Translation = {
145
+ feelingEmpty: string;
146
+ free: string;
147
+ loadNext: string;
148
+ loadPrevious: string;
149
+ over: string;
150
+ taken: string;
151
+ topbar: Topbar;
152
+ search: string;
153
+ week: string;
154
+ };
155
+
156
+ export declare type ZoomLevel = ZoomLevelTuple[number];
157
+
158
+ declare type ZoomLevelTuple = typeof allZoomLevel;
159
+
160
+ export { }