@capillarytech/blaze-ui 6.0.1 → 6.0.4
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/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.css +21 -0
- package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.module.scss.js +8 -0
- package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.scss +17 -0
- package/CapEventCalendar/CalendarCanvas/index.d.ts +3 -52
- package/CapEventCalendar/CalendarCanvas/index.d.ts.map +1 -1
- package/CapEventCalendar/CalendarCanvas/index.js +31 -50
- package/CapEventCalendar/CalendarCanvas/utils.d.ts +5 -9
- package/CapEventCalendar/CalendarCanvas/utils.d.ts.map +1 -1
- package/CapEventCalendar/CalendarCanvas/utils.js +6 -6
- package/CapEventCalendar/components/DayDropdown/index.d.ts +3 -13
- package/CapEventCalendar/components/DayDropdown/index.d.ts.map +1 -1
- package/CapEventCalendar/components/DayDropdown/index.js +32 -14
- package/CapEventCalendar/components/MonthHeader/index.d.ts +3 -9
- package/CapEventCalendar/components/MonthHeader/index.d.ts.map +1 -1
- package/CapEventCalendar/components/MonthHeader/index.js +4 -9
- package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.css +20 -0
- package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.module.scss.js +7 -0
- package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.scss +15 -0
- package/CapEventCalendar/drawUtils.d.ts +9 -71
- package/CapEventCalendar/drawUtils.d.ts.map +1 -1
- package/CapEventCalendar/drawUtils.js +12 -4
- package/CapEventCalendar/index.d.ts +4 -80
- package/CapEventCalendar/index.d.ts.map +1 -1
- package/CapEventCalendar/index.js +60 -85
- package/CapEventCalendar/messages.d.ts +25 -0
- package/CapEventCalendar/messages.d.ts.map +1 -0
- package/CapEventCalendar/messages.js +28 -0
- package/CapEventCalendar/styles.css +9 -81
- package/CapEventCalendar/styles.module.scss.js +12 -0
- package/CapEventCalendar/styles.scss +34 -107
- package/CapEventCalendar/tests/types.d.ts +26 -0
- package/CapEventCalendar/tests/types.d.ts.map +1 -0
- package/CapEventCalendar/types.d.ts +188 -0
- package/CapEventCalendar/types.d.ts.map +1 -0
- package/CapEventCalendar/types.js +1 -0
- package/CapEventCalendar/utils.d.ts +11 -9
- package/CapEventCalendar/utils.d.ts.map +1 -1
- package/CapEventCalendar/utils.js +10 -7
- package/CapTabV3/tests/CapTabV3.mockData.d.ts +26 -26
- package/CapTabV3/tests/CapTabV3.mockData.d.ts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +223 -221
- package/package.json +1 -1
- package/utils/dayjs.d.ts +1 -0
- package/utils/dayjs.d.ts.map +1 -1
- package/utils/dayjs.js +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Color Palette */
|
|
2
|
+
/* Fonts */
|
|
3
|
+
/* Backward Compatibility Aliases */
|
|
4
|
+
/* Component Heights */
|
|
5
|
+
/* Border Radius */
|
|
6
|
+
/* Border Width */
|
|
7
|
+
/* Transition */
|
|
8
|
+
/* Timezones Footer */
|
|
9
|
+
.canvas-container {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
position: relative;
|
|
13
|
+
}
|
|
14
|
+
.tooltip-knob {
|
|
15
|
+
position: absolute;
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
.popover-knob {
|
|
19
|
+
position: absolute;
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import '../../styles/_variables.scss';
|
|
2
|
+
|
|
3
|
+
.canvas-container {
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tooltip-knob {
|
|
10
|
+
position: absolute;
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.popover-knob {
|
|
15
|
+
position: absolute;
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
@@ -1,54 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
displayMonths: any;
|
|
5
|
-
dayGrid: any;
|
|
6
|
-
formattedEvents: any;
|
|
7
|
-
todayTooltipProps: any;
|
|
8
|
-
dashLineOffsetY: any;
|
|
9
|
-
eventHeight: any;
|
|
10
|
-
eventRowGap: any;
|
|
11
|
-
textPadding: any;
|
|
12
|
-
eventStartYOffset: any;
|
|
13
|
-
minCanvasHeight: any;
|
|
14
|
-
canvasFont: any;
|
|
15
|
-
popoverPlacement: any;
|
|
16
|
-
carouselDate: any;
|
|
17
|
-
popoverContent: any;
|
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
propTypes: {
|
|
20
|
-
popoverContent: PropTypes.Requireable<any>;
|
|
21
|
-
todayTooltipProps: PropTypes.Requireable<object>;
|
|
22
|
-
dashLineOffsetY: PropTypes.Requireable<number>;
|
|
23
|
-
eventHeight: PropTypes.Requireable<number>;
|
|
24
|
-
eventRowGap: PropTypes.Requireable<number>;
|
|
25
|
-
textPadding: PropTypes.Requireable<number>;
|
|
26
|
-
eventStartYOffset: PropTypes.Requireable<number>;
|
|
27
|
-
minCanvasHeight: PropTypes.Requireable<number>;
|
|
28
|
-
canvasFont: PropTypes.Requireable<string>;
|
|
29
|
-
popoverPlacement: PropTypes.Requireable<string>;
|
|
30
|
-
};
|
|
31
|
-
defaultProps: {
|
|
32
|
-
popoverContent: {
|
|
33
|
-
({ title }: {
|
|
34
|
-
title: any;
|
|
35
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
propTypes: {
|
|
37
|
-
title: PropTypes.Requireable<string>;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
dashLineOffsetY: number;
|
|
41
|
-
eventHeight: number;
|
|
42
|
-
eventRowGap: number;
|
|
43
|
-
textPadding: number;
|
|
44
|
-
eventStartYOffset: number;
|
|
45
|
-
minCanvasHeight: number;
|
|
46
|
-
todayTooltipProps: {
|
|
47
|
-
title: string;
|
|
48
|
-
};
|
|
49
|
-
canvasFont: string;
|
|
50
|
-
popoverPlacement: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CalendarCanvasProps } from '../types';
|
|
3
|
+
declare const CalendarCanvas: React.FC<CalendarCanvasProps>;
|
|
53
4
|
export default CalendarCanvas;
|
|
54
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/CapEventCalendar/CalendarCanvas/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/CapEventCalendar/CalendarCanvas/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAcrF,OAAO,KAAK,EACV,mBAAmB,EAMpB,MAAM,UAAU,CAAC;AASlB,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4ejD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import { useState, useRef, useEffect, useLayoutEffect, useMemo } from "react";
|
|
4
3
|
import { FORMAT_TOKENS } from "../../utils/dayjs.js";
|
|
5
|
-
import {
|
|
4
|
+
import { FONT_SIZE_S, FONT_FAMILY, FONT_COLOR_01 } from "../../styles/_variables.js";
|
|
6
5
|
import { DATE_KEY_FORMAT } from "../constants.js";
|
|
7
6
|
import { drawHeadingText, drawDashedLines, drawLineSeperator, drawTodayLine, drawRoundRectWithText } from "../drawUtils.js";
|
|
8
7
|
import { getDaysOfMonth } from "../utils.js";
|
|
8
|
+
import styles from "./calendarCanvasStyles.module.scss.js";
|
|
9
9
|
import { toggleTooltip, togglePopover } from "./utils.js";
|
|
10
10
|
import dayjs from "dayjs";
|
|
11
11
|
const DefaultPopover = ({ title }) => /* @__PURE__ */ jsx("div", { children: title });
|
|
12
|
-
DefaultPopover.propTypes = {
|
|
13
|
-
title: PropTypes.string
|
|
14
|
-
};
|
|
15
12
|
const CalendarCanvas = ({
|
|
16
13
|
displayMonths,
|
|
17
14
|
dayGrid,
|
|
18
15
|
formattedEvents,
|
|
19
16
|
todayTooltipProps,
|
|
20
|
-
dashLineOffsetY,
|
|
21
|
-
eventHeight,
|
|
22
|
-
eventRowGap,
|
|
23
|
-
textPadding,
|
|
24
|
-
eventStartYOffset,
|
|
25
|
-
minCanvasHeight,
|
|
26
|
-
canvasFont
|
|
27
|
-
popoverPlacement,
|
|
17
|
+
dashLineOffsetY = 20,
|
|
18
|
+
eventHeight = 24,
|
|
19
|
+
eventRowGap = 12,
|
|
20
|
+
textPadding = 12,
|
|
21
|
+
eventStartYOffset = 40,
|
|
22
|
+
minCanvasHeight = 0,
|
|
23
|
+
canvasFont = `normal ${FONT_SIZE_S} ${FONT_FAMILY}`,
|
|
24
|
+
popoverPlacement = "leftTop",
|
|
28
25
|
carouselDate,
|
|
29
|
-
popoverContent
|
|
26
|
+
popoverContent = DefaultPopover
|
|
30
27
|
}) => {
|
|
31
28
|
const [width, setWidth] = useState(0);
|
|
32
29
|
const [height, setHeight] = useState(0);
|
|
@@ -62,12 +59,13 @@ const CalendarCanvas = ({
|
|
|
62
59
|
}
|
|
63
60
|
}, []);
|
|
64
61
|
useEffect(() => {
|
|
62
|
+
var _a;
|
|
65
63
|
if (width > 0 && height > 0) {
|
|
66
|
-
contextRef.current.scale(pixelRatio, pixelRatio);
|
|
64
|
+
(_a = contextRef.current) == null ? void 0 : _a.scale(pixelRatio, pixelRatio);
|
|
67
65
|
}
|
|
68
66
|
}, [width, height]);
|
|
69
67
|
const hidePopoverAndToolTip = () => {
|
|
70
|
-
toggleTooltip(false, isTooltipVisible, todayTooltipProps, rootTooltipRef);
|
|
68
|
+
toggleTooltip(false, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
|
|
71
69
|
togglePopover({ visible: false, rootPopoverRef, isPopoverVisible });
|
|
72
70
|
};
|
|
73
71
|
useEffect(() => {
|
|
@@ -87,6 +85,7 @@ const CalendarCanvas = ({
|
|
|
87
85
|
return false;
|
|
88
86
|
};
|
|
89
87
|
const handleDimension = () => {
|
|
88
|
+
if (!canvasContainerRef.current) return;
|
|
90
89
|
const minHeight = minCanvasHeight || canvasContainerRef.current.clientHeight;
|
|
91
90
|
const { y: rectY } = getRectInitDimension();
|
|
92
91
|
const estimatedHeight = rectY + eventStartYOffset + (eventHeight + eventRowGap) * totalEventRowsPerQuater.current;
|
|
@@ -187,10 +186,16 @@ const CalendarCanvas = ({
|
|
|
187
186
|
startX += rectWidth;
|
|
188
187
|
});
|
|
189
188
|
});
|
|
190
|
-
drawObject.current = { ...drawObject.current, day: dayObject };
|
|
189
|
+
drawObject.current = { ...drawObject.current ?? { day: {} }, day: dayObject };
|
|
191
190
|
return dayObject;
|
|
192
191
|
};
|
|
193
|
-
const updatePosition = ({
|
|
192
|
+
const updatePosition = ({
|
|
193
|
+
mouseX,
|
|
194
|
+
mouseY,
|
|
195
|
+
knob,
|
|
196
|
+
offsetX = 0
|
|
197
|
+
}) => {
|
|
198
|
+
if (!knob) return;
|
|
194
199
|
const { style: style2 } = knob;
|
|
195
200
|
if (mouseX) {
|
|
196
201
|
style2.display = "block";
|
|
@@ -221,7 +226,7 @@ const CalendarCanvas = ({
|
|
|
221
226
|
const handleTodayLine = ({ mouseX, mouseY } = {}) => {
|
|
222
227
|
const context = contextRef.current;
|
|
223
228
|
const currentDayObj = getTodayRectObj();
|
|
224
|
-
if (!currentDayObj) {
|
|
229
|
+
if (!currentDayObj || !context) {
|
|
225
230
|
return null;
|
|
226
231
|
}
|
|
227
232
|
const { y, midX, height: currentDayRectHeight } = currentDayObj;
|
|
@@ -262,7 +267,7 @@ const CalendarCanvas = ({
|
|
|
262
267
|
};
|
|
263
268
|
if (date) {
|
|
264
269
|
drawObject.current = {
|
|
265
|
-
...drawObject.current,
|
|
270
|
+
...drawObject.current ?? { day: {} },
|
|
266
271
|
day: { ...day, [date]: dayObject }
|
|
267
272
|
};
|
|
268
273
|
}
|
|
@@ -370,7 +375,7 @@ const CalendarCanvas = ({
|
|
|
370
375
|
isPopoverVisible,
|
|
371
376
|
popoverContent,
|
|
372
377
|
popoverPlacement,
|
|
373
|
-
popoverContentProps: { ...hoverEvent, ...hoverEvent.popoverProps }
|
|
378
|
+
popoverContentProps: { ...hoverEvent, ...hoverEvent.popoverProps ?? {} }
|
|
374
379
|
});
|
|
375
380
|
currentHoverEvent.current = {
|
|
376
381
|
...currentHoverEvent.current,
|
|
@@ -389,14 +394,14 @@ const CalendarCanvas = ({
|
|
|
389
394
|
mouseX: midX,
|
|
390
395
|
mouseY: mouseY / pixelRatio
|
|
391
396
|
});
|
|
392
|
-
toggleTooltip(mouseEvent, isTooltipVisible, todayTooltipProps, rootTooltipRef);
|
|
397
|
+
toggleTooltip(mouseEvent, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
|
|
393
398
|
}
|
|
394
399
|
} else {
|
|
395
|
-
toggleTooltip(void 0, isTooltipVisible, todayTooltipProps, rootTooltipRef);
|
|
400
|
+
toggleTooltip(void 0, isTooltipVisible, todayTooltipProps ?? {}, rootTooltipRef);
|
|
396
401
|
}
|
|
397
402
|
toggleCursor(isTodayLineHovered || currentHoverEvent.current);
|
|
398
403
|
};
|
|
399
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
404
|
+
return /* @__PURE__ */ jsxs("div", { className: styles["canvas-container"], ref: canvasContainerRef, children: [
|
|
400
405
|
/* @__PURE__ */ jsx(
|
|
401
406
|
"canvas",
|
|
402
407
|
{
|
|
@@ -408,34 +413,10 @@ const CalendarCanvas = ({
|
|
|
408
413
|
onMouseMove
|
|
409
414
|
}
|
|
410
415
|
),
|
|
411
|
-
/* @__PURE__ */ jsx("div", {
|
|
412
|
-
/* @__PURE__ */ jsx("div", {
|
|
416
|
+
/* @__PURE__ */ jsx("div", { className: styles["tooltip-knob"], id: "event-calendar-tool-tip-knob" }),
|
|
417
|
+
/* @__PURE__ */ jsx("div", { className: styles["popover-knob"], id: "event-calendar-popover-knob" })
|
|
413
418
|
] });
|
|
414
419
|
};
|
|
415
|
-
CalendarCanvas.propTypes = {
|
|
416
|
-
popoverContent: PropTypes.any,
|
|
417
|
-
todayTooltipProps: PropTypes.object,
|
|
418
|
-
dashLineOffsetY: PropTypes.number,
|
|
419
|
-
eventHeight: PropTypes.number,
|
|
420
|
-
eventRowGap: PropTypes.number,
|
|
421
|
-
textPadding: PropTypes.number,
|
|
422
|
-
eventStartYOffset: PropTypes.number,
|
|
423
|
-
minCanvasHeight: PropTypes.number,
|
|
424
|
-
canvasFont: PropTypes.string,
|
|
425
|
-
popoverPlacement: PropTypes.string
|
|
426
|
-
};
|
|
427
|
-
CalendarCanvas.defaultProps = {
|
|
428
|
-
popoverContent: DefaultPopover,
|
|
429
|
-
dashLineOffsetY: 20,
|
|
430
|
-
eventHeight: 24,
|
|
431
|
-
eventRowGap: 12,
|
|
432
|
-
textPadding: 12,
|
|
433
|
-
eventStartYOffset: 40,
|
|
434
|
-
minCanvasHeight: 0,
|
|
435
|
-
todayTooltipProps: { title: "Today" },
|
|
436
|
-
canvasFont: `normal ${FONT_SIZE_S} ${FONT_FAMILY}`,
|
|
437
|
-
popoverPlacement: "leftTop"
|
|
438
|
-
};
|
|
439
420
|
export {
|
|
440
421
|
CalendarCanvas as default
|
|
441
422
|
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
popoverContent: any;
|
|
7
|
-
popoverPlacement: any;
|
|
8
|
-
popoverContentProps: any;
|
|
9
|
-
}) => void;
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
2
|
+
import type { Root } from 'react-dom/client';
|
|
3
|
+
import type { TogglePopoverArgs } from '../types';
|
|
4
|
+
export declare const toggleTooltip: (visible: unknown, isTooltipVisible: MutableRefObject<boolean | null>, todayTooltipProps: Record<string, unknown>, rootTooltipRef: MutableRefObject<Root | null>) => void;
|
|
5
|
+
export declare const togglePopover: ({ visible, rootPopoverRef, isPopoverVisible, popoverContent, popoverPlacement, popoverContentProps, }: TogglePopoverArgs) => void;
|
|
10
6
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../components/CapEventCalendar/CalendarCanvas/utils.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../components/CapEventCalendar/CalendarCanvas/utils.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,aAAa,GACxB,SAAS,OAAO,EAChB,kBAAkB,gBAAgB,CAAC,OAAO,GAAG,IAAI,CAAC,EAClD,mBAAmB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,gBAAgB,gBAAgB,CAAC,IAAI,GAAG,IAAI,CAAC,SAkB9C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,uGAO3B,iBAAiB,SA4BnB,CAAC"}
|
|
@@ -9,7 +9,7 @@ const toggleTooltip = (visible, isTooltipVisible, todayTooltipProps, rootTooltip
|
|
|
9
9
|
}
|
|
10
10
|
if (visible) {
|
|
11
11
|
rootTooltipRef.current.render(
|
|
12
|
-
/* @__PURE__ */ jsx(CapTooltip, {
|
|
12
|
+
/* @__PURE__ */ jsx(CapTooltip, { open: true, ...todayTooltipProps, children: /* @__PURE__ */ jsx("div", {}) })
|
|
13
13
|
);
|
|
14
14
|
isTooltipVisible.current = true;
|
|
15
15
|
} else if (isTooltipVisible.current) {
|
|
@@ -31,18 +31,18 @@ const togglePopover = ({
|
|
|
31
31
|
if (!rootPopoverRef.current) {
|
|
32
32
|
rootPopoverRef.current = createRoot(knobElement);
|
|
33
33
|
}
|
|
34
|
-
if (visible) {
|
|
34
|
+
if (visible && popoverContent) {
|
|
35
35
|
const Component = popoverContent;
|
|
36
36
|
const body = (_a = document.getElementsByTagName("body")) == null ? void 0 : _a[0];
|
|
37
37
|
rootPopoverRef.current.render(
|
|
38
38
|
/* @__PURE__ */ jsx(
|
|
39
39
|
CapPopover,
|
|
40
40
|
{
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
open: true,
|
|
42
|
+
arrow: { pointAtCenter: true },
|
|
43
43
|
placement: popoverPlacement,
|
|
44
|
-
content: /* @__PURE__ */ jsx(Component, { ...popoverContentProps }),
|
|
45
|
-
|
|
44
|
+
content: /* @__PURE__ */ jsx(Component, { ...popoverContentProps ?? {} }),
|
|
45
|
+
classNames: { root: "event-calendar-popover-overlay" },
|
|
46
46
|
getPopupContainer: () => body,
|
|
47
47
|
children: /* @__PURE__ */ jsx("div", {})
|
|
48
48
|
}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
fetchDay: any;
|
|
5
|
-
dayLabels: any;
|
|
6
|
-
day: any;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
propTypes: {
|
|
9
|
-
fetchDay: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
-
day: PropTypes.Requireable<number>;
|
|
11
|
-
dayLabels: PropTypes.Requireable<any[]>;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DayDropdownProps } from '../../types';
|
|
3
|
+
declare const DayDropdown: React.FC<DayDropdownProps>;
|
|
14
4
|
export default DayDropdown;
|
|
15
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/CapEventCalendar/components/DayDropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/CapEventCalendar/components/DayDropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAiC3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import CapIcon from "../../../CapIcon/index.js";
|
|
6
|
-
import CapMenu from "../../../CapMenu/index.js";
|
|
7
|
-
import { CAP_G01 } from "../../../styles/_variables.js";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import CapUnifiedSelect from "../../../CapUnifiedSelect/index.js";
|
|
4
|
+
import { SELECT_TYPES } from "../../../CapUnifiedSelect/constants.js";
|
|
8
5
|
const DayDropdown = ({ fetchDay, dayLabels, day }) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
const options = useMemo(
|
|
7
|
+
() => dayLabels.map((label, index) => ({
|
|
8
|
+
label,
|
|
9
|
+
value: index,
|
|
10
|
+
key: index
|
|
11
|
+
})),
|
|
12
|
+
[dayLabels]
|
|
13
|
+
);
|
|
14
|
+
const selectedDayLabel = useMemo(() => {
|
|
15
|
+
return dayLabels[day] || "";
|
|
16
|
+
}, [dayLabels, day]);
|
|
17
|
+
const handleChange = (value) => {
|
|
18
|
+
if (typeof value === "number") {
|
|
19
|
+
fetchDay(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
CapUnifiedSelect,
|
|
24
|
+
{
|
|
25
|
+
className: "cap-event-calendar__day-dropdown",
|
|
26
|
+
type: SELECT_TYPES.SELECT,
|
|
27
|
+
options,
|
|
28
|
+
value: day,
|
|
29
|
+
onChange: handleChange,
|
|
30
|
+
showSearch: false,
|
|
31
|
+
"aria-label": selectedDayLabel,
|
|
32
|
+
size: "middle"
|
|
33
|
+
}
|
|
34
|
+
);
|
|
17
35
|
};
|
|
18
36
|
export {
|
|
19
37
|
DayDropdown as default
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
displayMonths: any;
|
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
propTypes: {
|
|
7
|
-
displayMonths: PropTypes.Requireable<any[]>;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MonthHeaderProps } from '../../types';
|
|
3
|
+
declare const MonthHeader: React.FC<MonthHeaderProps>;
|
|
10
4
|
export default MonthHeader;
|
|
11
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/CapEventCalendar/components/MonthHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/CapEventCalendar/components/MonthHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAS3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
month.name
|
|
6
|
-
] }, index + month)) });
|
|
7
|
-
MonthHeader.propTypes = {
|
|
8
|
-
displayMonths: PropTypes.array
|
|
9
|
-
};
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import CapLabelWithStatic from "../../../CapLabel/index.js";
|
|
3
|
+
import styles from "./monthHeaderStyles.module.scss.js";
|
|
4
|
+
const MonthHeader = ({ displayMonths }) => /* @__PURE__ */ jsx("div", { className: styles["month-header"], children: (displayMonths == null ? void 0 : displayMonths.length) && displayMonths.map((month, index) => /* @__PURE__ */ jsx(CapLabelWithStatic, { className: styles["month-header__label"], type: "label16", children: month.name }, index + month.name)) });
|
|
10
5
|
export {
|
|
11
6
|
MonthHeader as default
|
|
12
7
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* Color Palette */
|
|
2
|
+
/* Fonts */
|
|
3
|
+
/* Backward Compatibility Aliases */
|
|
4
|
+
/* Component Heights */
|
|
5
|
+
/* Border Radius */
|
|
6
|
+
/* Border Width */
|
|
7
|
+
/* Transition */
|
|
8
|
+
/* Timezones Footer */
|
|
9
|
+
.month-header {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
position: relative;
|
|
13
|
+
text-align: center;
|
|
14
|
+
top: 0;
|
|
15
|
+
margin-bottom: 0.714rem;
|
|
16
|
+
margin-top: 1.785rem;
|
|
17
|
+
}
|
|
18
|
+
.month-header__label {
|
|
19
|
+
width: 33.33%;
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@import '../../../styles/_variables.scss';
|
|
2
|
+
|
|
3
|
+
.month-header {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
position: relative;
|
|
7
|
+
text-align: center;
|
|
8
|
+
top: 0;
|
|
9
|
+
margin-bottom: 0.714rem;
|
|
10
|
+
margin-top: 1.785rem;
|
|
11
|
+
|
|
12
|
+
&__label {
|
|
13
|
+
width: 33.33%;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,72 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}) => void;
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
10
|
-
x: any;
|
|
11
|
-
y: any;
|
|
12
|
-
radius: any;
|
|
13
|
-
color: any;
|
|
14
|
-
}) => void;
|
|
15
|
-
export declare const drawDashedLines: ({ context, x, y, x1, y1 }: {
|
|
16
|
-
context: any;
|
|
17
|
-
x: any;
|
|
18
|
-
y: any;
|
|
19
|
-
x1: any;
|
|
20
|
-
y1: any;
|
|
21
|
-
}) => void;
|
|
22
|
-
export declare const drawTodayLine: ({ context, x, y, x1, y1, mouseX, mouseY }: {
|
|
23
|
-
context: any;
|
|
24
|
-
x: any;
|
|
25
|
-
y: any;
|
|
26
|
-
x1: any;
|
|
27
|
-
y1: any;
|
|
28
|
-
mouseX: any;
|
|
29
|
-
mouseY: any;
|
|
30
|
-
}) => any;
|
|
31
|
-
export declare const drawLineSeperator: ({ context, x, y, x1, y1 }: {
|
|
32
|
-
context: any;
|
|
33
|
-
x: any;
|
|
34
|
-
y: any;
|
|
35
|
-
x1: any;
|
|
36
|
-
y1: any;
|
|
37
|
-
}) => void;
|
|
38
|
-
export declare const drawRoundRect: ({ context, x, y, width, height, radius: radiusParam, openLeft, openRight, fillStyle, mouseX, mouseY, }: {
|
|
39
|
-
context: any;
|
|
40
|
-
x: any;
|
|
41
|
-
y: any;
|
|
42
|
-
width: any;
|
|
43
|
-
height: any;
|
|
44
|
-
radius: any;
|
|
45
|
-
openLeft: any;
|
|
46
|
-
openRight: any;
|
|
47
|
-
fillStyle: any;
|
|
48
|
-
mouseX: any;
|
|
49
|
-
mouseY: any;
|
|
50
|
-
}) => any;
|
|
51
|
-
export declare const doEllipsis: ({ context, text, maxWidth }: {
|
|
52
|
-
context: any;
|
|
53
|
-
text: any;
|
|
54
|
-
maxWidth: any;
|
|
55
|
-
}) => any;
|
|
56
|
-
export declare const drawRoundRectWithText: ({ context, x, y, width, height, bgColor, borderRadius, text, color, textPadding, openLeft, openRight, mouseX, mouseY, }: {
|
|
57
|
-
context: any;
|
|
58
|
-
x: any;
|
|
59
|
-
y: any;
|
|
60
|
-
width: any;
|
|
61
|
-
height: any;
|
|
62
|
-
bgColor: any;
|
|
63
|
-
borderRadius?: number;
|
|
64
|
-
text: any;
|
|
65
|
-
color: any;
|
|
66
|
-
textPadding: any;
|
|
67
|
-
openLeft: any;
|
|
68
|
-
openRight: any;
|
|
69
|
-
mouseX: any;
|
|
70
|
-
mouseY: any;
|
|
71
|
-
}) => any;
|
|
1
|
+
import type { DrawHeadingTextParams, DrawCircleParams, DrawDashedLinesParams, DrawTodayLineParams, DrawLineSeperatorParams, DrawRoundRectParams, DoEllipsisParams, DrawRoundRectWithTextParams } from './types';
|
|
2
|
+
export declare const drawHeadingText: ({ context, x, y, height, text }: DrawHeadingTextParams) => void;
|
|
3
|
+
export declare const drawCircle: ({ context, x, y, radius, color }: DrawCircleParams) => void;
|
|
4
|
+
export declare const drawDashedLines: ({ context, x, y, x1, y1 }: DrawDashedLinesParams) => void;
|
|
5
|
+
export declare const drawTodayLine: ({ context, x, y, x1, y1, mouseX, mouseY, }: DrawTodayLineParams) => boolean | void;
|
|
6
|
+
export declare const drawLineSeperator: ({ context, x, y, x1, y1 }: DrawLineSeperatorParams) => void;
|
|
7
|
+
export declare const drawRoundRect: ({ context, x, y, width, height, radius: radiusParam, openLeft, openRight, fillStyle, mouseX, mouseY, }: DrawRoundRectParams) => boolean | void;
|
|
8
|
+
export declare const doEllipsis: ({ context, text, maxWidth }: DoEllipsisParams) => string;
|
|
9
|
+
export declare const drawRoundRectWithText: ({ context, x, y, width, height, bgColor, borderRadius, text, color, textPadding, openLeft, openRight, mouseX, mouseY, }: DrawRoundRectWithTextParams) => boolean | void;
|
|
72
10
|
//# sourceMappingURL=drawUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawUtils.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/drawUtils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAI
|
|
1
|
+
{"version":3,"file":"drawUtils.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/drawUtils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,eAAe,GAAI,iCAAiC,qBAAqB,SAWrF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,kCAAkC,gBAAgB,SAO5E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,2BAA2B,qBAAqB,SAW/E,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,4CAQ3B,mBAAmB,KAAG,OAAO,GAAG,IAmBlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,2BAA2B,uBAAuB,SASnF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,wGAY3B,mBAAmB,KAAG,OAAO,GAAG,IA0ClC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,6BAA6B,gBAAgB,KAAG,MAa1E,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,yHAenC,2BAA2B,KAAG,OAAO,GAAG,IA0C1C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CAP_WHITE, CAP_G01, CAP_G06, CAP_G11, FONT_COLOR_05 } from "../styles/_variables.js";
|
|
2
2
|
const drawHeadingText = ({ context, x, y, height, text }) => {
|
|
3
3
|
context.beginPath();
|
|
4
4
|
context.fillStyle = CAP_WHITE;
|
|
@@ -27,7 +27,15 @@ const drawDashedLines = ({ context, x, y, x1, y1 }) => {
|
|
|
27
27
|
context.setLineDash([]);
|
|
28
28
|
context.closePath();
|
|
29
29
|
};
|
|
30
|
-
const drawTodayLine = ({
|
|
30
|
+
const drawTodayLine = ({
|
|
31
|
+
context,
|
|
32
|
+
x,
|
|
33
|
+
y,
|
|
34
|
+
x1,
|
|
35
|
+
y1,
|
|
36
|
+
mouseX,
|
|
37
|
+
mouseY
|
|
38
|
+
}) => {
|
|
31
39
|
context.beginPath();
|
|
32
40
|
const radius = 4;
|
|
33
41
|
drawCircle({
|
|
@@ -40,7 +48,7 @@ const drawTodayLine = ({ context, x, y, x1, y1, mouseX, mouseY }) => {
|
|
|
40
48
|
context.strokeStyle = FONT_COLOR_05;
|
|
41
49
|
context.moveTo(x, y);
|
|
42
50
|
context.lineTo(x1, y1);
|
|
43
|
-
if (mouseX) {
|
|
51
|
+
if (mouseX && mouseY) {
|
|
44
52
|
context.rect(x - 3, y, 6, y1);
|
|
45
53
|
return context.isPointInPath(mouseX, mouseY);
|
|
46
54
|
}
|
|
@@ -91,7 +99,7 @@ const drawRoundRect = ({
|
|
|
91
99
|
context.quadraticCurveTo(x, y + height, x, y + height - radius.bl);
|
|
92
100
|
context.lineTo(x, y + radius.tl);
|
|
93
101
|
context.quadraticCurveTo(x, y, x + radius.tl, y);
|
|
94
|
-
if (mouseX) {
|
|
102
|
+
if (mouseX && mouseY) {
|
|
95
103
|
return context.isPointInPath(mouseX, mouseY);
|
|
96
104
|
}
|
|
97
105
|
context.fill();
|