@dialiq/calendar-component 1.0.3 → 1.1.0

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/types.d.ts CHANGED
@@ -9,6 +9,9 @@ export interface Booking {
9
9
  [key: string]: any;
10
10
  };
11
11
  participants?: string[];
12
+ staff?: string;
13
+ room?: string;
14
+ className?: string;
12
15
  }
13
16
  export interface CreateBookingRequest {
14
17
  participants: string[];
@@ -21,6 +24,21 @@ export interface CreateBookingRequest {
21
24
  [key: string]: any;
22
25
  };
23
26
  }
27
+ export interface BusinessHours {
28
+ isClosed: boolean;
29
+ openTime?: string;
30
+ closeTime?: string;
31
+ }
32
+ export interface WeeklyBusinessHours {
33
+ Monday: BusinessHours;
34
+ Tuesday: BusinessHours;
35
+ Wednesday: BusinessHours;
36
+ Thursday: BusinessHours;
37
+ Friday: BusinessHours;
38
+ Saturday: BusinessHours;
39
+ Sunday: BusinessHours;
40
+ [key: string]: BusinessHours;
41
+ }
24
42
  export interface CalendarProps {
25
43
  businessId: string;
26
44
  resourceId?: string;
@@ -30,5 +48,7 @@ export interface CalendarProps {
30
48
  onBookingCreate?: (booking: Booking) => void;
31
49
  onBookingClick?: (booking: Booking) => void;
32
50
  participants?: string[];
51
+ timezone?: string;
52
+ businessHours?: WeeklyBusinessHours;
33
53
  }
34
54
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,C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,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC"}
@@ -0,0 +1,12 @@
1
+ import moment from 'moment-timezone';
2
+ import { Booking } from '../types';
3
+ export declare const getWeekDays: (currentDate: moment.Moment, view: "week" | "workWeek", businessHours?: any) => moment.Moment[];
4
+ export interface EventPosition {
5
+ top: number;
6
+ height: number;
7
+ left: number;
8
+ width: number;
9
+ }
10
+ export declare const calculateEventPositions: (bookings: Booking[], timezone: string) => Map<string, EventPosition>;
11
+ export declare const isMobile: () => boolean;
12
+ //# sourceMappingURL=calendarUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendarUtils.d.ts","sourceRoot":"","sources":["../../src/utils/calendarUtils.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,CAAC,MAAM,EAAE,MAAM,MAAM,GAAG,UAAU,EAAE,gBAAgB,GAAG,KAAG,MAAM,CAAC,MAAM,EAuBrH,CAAC;AAEF,MAAM,WAAW,aAAa;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,uBAAuB,GAAI,UAAU,OAAO,EAAE,EAAE,UAAU,MAAM,KAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CA4ExG,CAAC;AA2CF,eAAO,MAAM,QAAQ,QAAO,OAK3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialiq/calendar-component",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "A React calendar component with booking management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,6 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@rollup/plugin-commonjs": "^25.0.0",
31
+ "@rollup/plugin-json": "^6.1.0",
31
32
  "@rollup/plugin-node-resolve": "^15.0.0",
32
33
  "@rollup/plugin-typescript": "^11.0.0",
33
34
  "@types/node": "^20.19.25",
@@ -40,6 +41,8 @@
40
41
  "typescript": "^5.0.0"
41
42
  },
42
43
  "dependencies": {
43
- "date-fns": "^3.0.0"
44
+ "date-fns": "^3.0.0",
45
+ "moment": "^2.30.1",
46
+ "moment-timezone": "^0.6.0"
44
47
  }
45
- }
48
+ }