@capillarytech/blaze-ui 6.1.0 → 6.1.2
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/.npmrc +3 -0
- package/CapCustomCheckboxList/styles.css +3 -3
- package/CapCustomCheckboxList/styles.scss +7 -8
- 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/CapProductSelection/index.d.ts +7 -29
- package/CapProductSelection/index.d.ts.map +1 -1
- package/CapProductSelection/index.js +52 -89
- package/CapProductSelection/messages.d.ts +76 -0
- package/CapProductSelection/messages.d.ts.map +1 -0
- package/CapProductSelection/messages.js +79 -0
- package/CapProductSelection/styles.css +81 -0
- package/CapProductSelection/styles.module.scss.js +8 -0
- package/CapProductSelection/styles.scss +82 -40
- package/CapProductSelection/tests/CapProductSelection.mockData.d.ts +36 -0
- package/CapProductSelection/tests/CapProductSelection.mockData.d.ts.map +1 -0
- package/CapProductSelection/types.d.ts +34 -0
- package/CapProductSelection/types.d.ts.map +1 -0
- package/CapProductSelection/types.js +1 -0
- package/CapRadioCard/index.d.ts.map +1 -1
- package/CapRadioCard/index.js +52 -20
- package/CapRadioCard/styles.css +25 -25
- package/CapRadioCard/styles.module.scss.js +14 -40
- package/CapRadioCard/styles.scss +20 -20
- package/CapRadioCard/types.d.ts +20 -0
- package/CapRadioCard/types.d.ts.map +1 -1
- package/CapStaticTemplates/index.d.ts +3 -1
- package/CapStaticTemplates/index.d.ts.map +1 -1
- package/CapStaticTemplates/index.js +185 -144
- package/CapStaticTemplates/messages.d.ts +32 -0
- package/CapStaticTemplates/messages.d.ts.map +1 -0
- package/CapStaticTemplates/messages.js +35 -0
- package/CapStaticTemplates/styles.css +220 -0
- package/CapStaticTemplates/styles.module.scss.js +55 -0
- package/CapStaticTemplates/styles.scss +291 -0
- package/CapStaticTemplates/tests/CapStaticTemplates.mockData.d.ts +54 -0
- package/CapStaticTemplates/tests/CapStaticTemplates.mockData.d.ts.map +1 -0
- package/CapStaticTemplates/types.d.ts +97 -0
- package/CapStaticTemplates/types.d.ts.map +1 -0
- package/CapStaticTemplates/types.js +1 -0
- package/CapTabV3/tests/CapTabV3.mockData.d.ts +26 -26
- package/CapTabV3/tests/CapTabV3.mockData.d.ts.map +1 -1
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -1
- package/index.js +227 -221
- package/package.json +1 -1
- package/styles/_variables.scss +2 -0
- package/utils/dayjs.d.ts +1 -0
- package/utils/dayjs.d.ts.map +1 -1
- package/utils/dayjs.js +1 -0
- package/CapProductSelection/style.d.ts +0 -3
- package/CapProductSelection/style.d.ts.map +0 -1
- package/CapProductSelection/style.js +0 -38
- package/CapStaticTemplates/style.d.ts +0 -13
- package/CapStaticTemplates/style.d.ts.map +0 -1
- package/CapStaticTemplates/style.js +0 -216
|
@@ -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();
|
|
@@ -1,81 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import './
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
calendarDate?: string;
|
|
6
|
-
events: any;
|
|
7
|
-
popoverContent: any;
|
|
8
|
-
onQuarterChange: any;
|
|
9
|
-
selectedQuarter: any;
|
|
10
|
-
calendarGridLineLabel: any;
|
|
11
|
-
dayLabels: any;
|
|
12
|
-
allQuartersLabel: any;
|
|
13
|
-
monthLabels: any;
|
|
14
|
-
todayTooltipProps: any;
|
|
15
|
-
dashLineOffsetY: any;
|
|
16
|
-
eventHeight: any;
|
|
17
|
-
eventRowGap: any;
|
|
18
|
-
textPadding: any;
|
|
19
|
-
eventStartYOffset: any;
|
|
20
|
-
minCanvasHeight: any;
|
|
21
|
-
canvasFont: any;
|
|
22
|
-
popoverPlacement: any;
|
|
23
|
-
emptyState: any;
|
|
24
|
-
emptyStateTitle: any;
|
|
25
|
-
emptyStateDescription: any;
|
|
26
|
-
emptyStateButtonLabel: any;
|
|
27
|
-
onEmptyStateButtonClick: any;
|
|
28
|
-
isButtonDisabled: any;
|
|
29
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
propTypes: {
|
|
31
|
-
calendarDate: PropTypes.Requireable<string>;
|
|
32
|
-
events: PropTypes.Requireable<any[]>;
|
|
33
|
-
popoverContent: PropTypes.Requireable<any>;
|
|
34
|
-
onQuarterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
|
-
selectedQuarter: PropTypes.Requireable<string>;
|
|
36
|
-
calendarGridLineLabel: PropTypes.Requireable<string>;
|
|
37
|
-
dayLabels: PropTypes.Requireable<any[]>;
|
|
38
|
-
allQuartersLabel: PropTypes.Requireable<any[]>;
|
|
39
|
-
monthLabels: PropTypes.Requireable<any[]>;
|
|
40
|
-
todayTooltipProps: PropTypes.Requireable<object>;
|
|
41
|
-
dashLineOffsetY: PropTypes.Requireable<number>;
|
|
42
|
-
eventHeight: PropTypes.Requireable<number>;
|
|
43
|
-
eventRowGap: PropTypes.Requireable<number>;
|
|
44
|
-
textPadding: PropTypes.Requireable<number>;
|
|
45
|
-
eventStartYOffset: PropTypes.Requireable<number>;
|
|
46
|
-
minCanvasHeight: PropTypes.Requireable<number>;
|
|
47
|
-
canvasFont: PropTypes.Requireable<string>;
|
|
48
|
-
popoverPlacement: PropTypes.Requireable<string>;
|
|
49
|
-
};
|
|
50
|
-
defaultProps: {
|
|
51
|
-
popoverContent: {
|
|
52
|
-
({ title }: {
|
|
53
|
-
title: any;
|
|
54
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
55
|
-
propTypes: {
|
|
56
|
-
title: PropTypes.Requireable<string>;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
dashLineOffsetY: number;
|
|
60
|
-
eventHeight: number;
|
|
61
|
-
eventRowGap: number;
|
|
62
|
-
textPadding: number;
|
|
63
|
-
eventStartYOffset: number;
|
|
64
|
-
minCanvasHeight: number;
|
|
65
|
-
todayTooltipProps: {
|
|
66
|
-
title: string;
|
|
67
|
-
};
|
|
68
|
-
allQuartersLabel: string[];
|
|
69
|
-
dayLabels: string[];
|
|
70
|
-
monthLabels: string[];
|
|
71
|
-
canvasFont: string;
|
|
72
|
-
calendarGridLineLabel: string;
|
|
73
|
-
popoverPlacement: string;
|
|
74
|
-
emptyStateTitle: string;
|
|
75
|
-
emptyStateDescription: string;
|
|
76
|
-
emptyStateButtonLabel: string;
|
|
77
|
-
isButtonDisabled: boolean;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
export default CapEventCalendar;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CapEventCalendarProps } from './types';
|
|
3
|
+
declare const _default: React.ComponentType<Omit<CapEventCalendarProps, "intl">>;
|
|
4
|
+
export default _default;
|
|
81
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAkBnD,OAAO,KAAK,EAAE,qBAAqB,EAAoC,MAAM,SAAS,CAAC;;AAyMvF,wBAA4C"}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
3
|
import { useState, useEffect } from "react";
|
|
4
|
+
import { injectIntl } from "react-intl";
|
|
5
5
|
import "../utils/dayjs.js";
|
|
6
6
|
import EmptyStateIllustrationForPromos from "../assets/images/EmptyStateIllustrationForPromos.png.js";
|
|
7
7
|
import CapIcon from "../CapIcon/index.js";
|
|
8
8
|
import CapIllustration from "../CapIllustration/index.js";
|
|
9
|
+
import CapLabelWithStatic from "../CapLabel/index.js";
|
|
9
10
|
import CapRow from "../CapRow/index.js";
|
|
10
11
|
import { FONT_SIZE_S, FONT_FAMILY } from "../styles/_variables.js";
|
|
11
12
|
import CalendarCanvas from "./CalendarCanvas/index.js";
|
|
12
13
|
import DayDropdown from "./components/DayDropdown/index.js";
|
|
13
14
|
import MonthHeader from "./components/MonthHeader/index.js";
|
|
14
|
-
import { QUARTERS,
|
|
15
|
-
import
|
|
15
|
+
import { QUARTERS, QUARTER_LABELS, DAY_LABELS, MONTH_LABELS } from "./constants.js";
|
|
16
|
+
import messages from "./messages.js";
|
|
17
|
+
import styles from "./styles.module.scss.js";
|
|
16
18
|
import { splitMonthsArrayToQuarterChunks, getMonthsForQuarter, formatDataToSuitCanvas, handleYearChange } from "./utils.js";
|
|
17
19
|
import dayjs from "dayjs";
|
|
18
20
|
const DefaultPopover = ({ title }) => /* @__PURE__ */ jsx("div", { children: title });
|
|
19
|
-
DefaultPopover.propTypes = {
|
|
20
|
-
title: PropTypes.string
|
|
21
|
-
};
|
|
22
21
|
const CapEventCalendar = ({
|
|
22
|
+
intl: { formatMessage },
|
|
23
23
|
calendarDate = dayjs().format(),
|
|
24
|
-
events,
|
|
25
|
-
popoverContent,
|
|
24
|
+
events = [],
|
|
25
|
+
popoverContent = DefaultPopover,
|
|
26
26
|
onQuarterChange,
|
|
27
27
|
selectedQuarter,
|
|
28
28
|
calendarGridLineLabel,
|
|
29
|
-
dayLabels,
|
|
30
|
-
allQuartersLabel,
|
|
31
|
-
monthLabels,
|
|
29
|
+
dayLabels = DAY_LABELS,
|
|
30
|
+
allQuartersLabel = QUARTER_LABELS,
|
|
31
|
+
monthLabels = MONTH_LABELS,
|
|
32
32
|
todayTooltipProps,
|
|
33
|
-
dashLineOffsetY,
|
|
34
|
-
eventHeight,
|
|
35
|
-
eventRowGap,
|
|
36
|
-
textPadding,
|
|
37
|
-
eventStartYOffset,
|
|
38
|
-
minCanvasHeight,
|
|
39
|
-
canvasFont
|
|
40
|
-
popoverPlacement,
|
|
33
|
+
dashLineOffsetY = 20,
|
|
34
|
+
eventHeight = 24,
|
|
35
|
+
eventRowGap = 12,
|
|
36
|
+
textPadding = 12,
|
|
37
|
+
eventStartYOffset = 40,
|
|
38
|
+
minCanvasHeight = 0,
|
|
39
|
+
canvasFont = `normal ${FONT_SIZE_S} ${FONT_FAMILY}`,
|
|
40
|
+
popoverPlacement = "leftTop",
|
|
41
41
|
emptyState,
|
|
42
42
|
emptyStateTitle,
|
|
43
43
|
emptyStateDescription,
|
|
44
44
|
emptyStateButtonLabel,
|
|
45
45
|
onEmptyStateButtonClick,
|
|
46
|
-
isButtonDisabled
|
|
46
|
+
isButtonDisabled = false
|
|
47
47
|
}) => {
|
|
48
48
|
const [carouselDate, setCarouselDate] = useState(calendarDate);
|
|
49
49
|
const [quarter, setQuarter] = useState(
|
|
@@ -54,25 +54,27 @@ const CapEventCalendar = ({
|
|
|
54
54
|
const [error, showError] = useState(false);
|
|
55
55
|
const [dayGrid, setDayGrid] = useState(1);
|
|
56
56
|
const [quarterMonths] = useState(splitMonthsArrayToQuarterChunks(monthLabels));
|
|
57
|
+
const resolvedCalendarGridLineLabel = calendarGridLineLabel || formatMessage(messages.calendarGridLineLabel);
|
|
58
|
+
const resolvedEmptyStateTitle = emptyStateTitle || formatMessage(messages.emptyStateTitle);
|
|
59
|
+
const resolvedEmptyStateDescription = emptyStateDescription || formatMessage(messages.emptyStateDescription);
|
|
60
|
+
const resolvedEmptyStateButtonLabel = emptyStateButtonLabel || formatMessage(messages.emptyStateButtonLabel);
|
|
61
|
+
const resolvedTodayTooltipProps = todayTooltipProps || {
|
|
62
|
+
title: formatMessage(messages.todayLabel)
|
|
63
|
+
};
|
|
57
64
|
useEffect(() => {
|
|
58
65
|
const _quarter = selectedQuarter ? QUARTERS[selectedQuarter] : quarter;
|
|
59
66
|
setDisplayMonths(
|
|
60
67
|
getMonthsForQuarter(_quarter, quarterMonths)
|
|
61
68
|
//show months of the quarter
|
|
62
69
|
);
|
|
63
|
-
setFormattedEvents(
|
|
64
|
-
formatDataToSuitCanvas(
|
|
65
|
-
events,
|
|
66
|
-
selectedQuarter ? QUARTERS[selectedQuarter] : quarter || dayjs().quarter()
|
|
67
|
-
)
|
|
68
|
-
);
|
|
70
|
+
setFormattedEvents(formatDataToSuitCanvas(events));
|
|
69
71
|
}, [events]);
|
|
70
72
|
const handleCarouselClick = (currentQuarter, date, increment, referenceDate) => {
|
|
71
73
|
if (increment) showError(false);
|
|
72
74
|
const values = handleYearChange(currentQuarter, date, increment, referenceDate);
|
|
73
75
|
if (values) {
|
|
74
76
|
setCarouselDate(values[1]);
|
|
75
|
-
onQuarterChange(values[0], dayjs(values[1]));
|
|
77
|
+
onQuarterChange == null ? void 0 : onQuarterChange(values[0], dayjs(values[1]));
|
|
76
78
|
if (values[2]) showError(true);
|
|
77
79
|
return values[0];
|
|
78
80
|
}
|
|
@@ -94,26 +96,30 @@ const CapEventCalendar = ({
|
|
|
94
96
|
const onClickQuarterRight = () => handleQuarterSelection(false);
|
|
95
97
|
const getIllustrationProps = (hasAccess) => ({
|
|
96
98
|
illustrationImage: EmptyStateIllustrationForPromos,
|
|
97
|
-
title:
|
|
99
|
+
title: resolvedEmptyStateTitle,
|
|
98
100
|
hasAccess,
|
|
99
|
-
description:
|
|
101
|
+
description: resolvedEmptyStateDescription,
|
|
100
102
|
descriptionPosition: "bottom",
|
|
101
|
-
buttonLabel:
|
|
103
|
+
buttonLabel: resolvedEmptyStateButtonLabel,
|
|
102
104
|
//prevents the required warning in the console
|
|
103
|
-
onClick: onEmptyStateButtonClick
|
|
105
|
+
onClick: onEmptyStateButtonClick ?? (() => {
|
|
106
|
+
}),
|
|
104
107
|
//prevents the required warning in the console
|
|
105
108
|
disabled: isButtonDisabled
|
|
106
109
|
});
|
|
107
110
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
108
|
-
/* @__PURE__ */ jsxs("div", { className: "event-calendar__header", children: [
|
|
109
|
-
/* @__PURE__ */ jsxs("div", { className: "event-calendar__header__left", children: [
|
|
111
|
+
/* @__PURE__ */ jsxs("div", { className: styles["event-calendar__header"], children: [
|
|
112
|
+
/* @__PURE__ */ jsxs("div", { className: styles["event-calendar__header__left"], children: [
|
|
110
113
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
111
114
|
/* @__PURE__ */ jsx(
|
|
112
115
|
CapIcon,
|
|
113
116
|
{
|
|
114
117
|
type: "chevron-left",
|
|
115
118
|
style: { cursor: "pointer" },
|
|
116
|
-
className: classNames({
|
|
119
|
+
className: classNames({
|
|
120
|
+
[styles["disable-left"]]: error,
|
|
121
|
+
[styles["carousel-icon"]]: true
|
|
122
|
+
}),
|
|
117
123
|
onClick: onClickQuarterLeft,
|
|
118
124
|
"data-testid": "event-calander-left-chevron"
|
|
119
125
|
}
|
|
@@ -122,30 +128,38 @@ const CapEventCalendar = ({
|
|
|
122
128
|
CapIcon,
|
|
123
129
|
{
|
|
124
130
|
type: "chevron-right",
|
|
125
|
-
className: "carousel-icon",
|
|
131
|
+
className: styles["carousel-icon"],
|
|
126
132
|
onClick: onClickQuarterRight,
|
|
127
133
|
"data-testid": "event-calander-right-chevron"
|
|
128
134
|
}
|
|
129
135
|
)
|
|
130
136
|
] }),
|
|
131
|
-
/* @__PURE__ */ jsxs(
|
|
132
|
-
/* @__PURE__ */ jsx("
|
|
133
|
-
dayjs(carouselDate).year()
|
|
137
|
+
/* @__PURE__ */ jsxs(CapRow, { className: styles["quarter-label"], align: "middle", justify: "center", children: [
|
|
138
|
+
/* @__PURE__ */ jsx(CapLabelWithStatic, { className: styles["quarter-label__text"], type: "label17", children: allQuartersLabel[quarter - 1] }),
|
|
139
|
+
/* @__PURE__ */ jsx(CapLabelWithStatic, { className: styles["quarter-label__text"], type: "label17", children: dayjs(carouselDate).year() })
|
|
134
140
|
] })
|
|
135
141
|
] }),
|
|
136
|
-
/* @__PURE__ */ jsxs(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
/* @__PURE__ */ jsxs(
|
|
143
|
+
CapRow,
|
|
144
|
+
{
|
|
145
|
+
className: styles["event-calendar__header__right"],
|
|
146
|
+
justify: "space-between",
|
|
147
|
+
align: "middle",
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ jsx(CapLabelWithStatic, { type: "label15", children: resolvedCalendarGridLineLabel }),
|
|
150
|
+
/* @__PURE__ */ jsx(DayDropdown, { fetchDay: handleDayGridSelection, day: dayGrid, dayLabels })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
)
|
|
140
154
|
] }),
|
|
141
|
-
emptyState && !formattedEvents.length && /* @__PURE__ */ jsx(CapRow, { children: /* @__PURE__ */ jsx(CapIllustration, { ...getIllustrationProps(true) }) }),
|
|
155
|
+
emptyState && !formattedEvents.length && /* @__PURE__ */ jsx(CapRow, { align: "middle", justify: "center", children: /* @__PURE__ */ jsx(CapIllustration, { ...getIllustrationProps(true) }) }),
|
|
142
156
|
formattedEvents.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
143
157
|
/* @__PURE__ */ jsx(MonthHeader, { displayMonths }),
|
|
144
158
|
/* @__PURE__ */ jsx(
|
|
145
159
|
CalendarCanvas,
|
|
146
160
|
{
|
|
147
161
|
...{
|
|
148
|
-
todayTooltipProps,
|
|
162
|
+
todayTooltipProps: resolvedTodayTooltipProps,
|
|
149
163
|
formattedEvents,
|
|
150
164
|
dayGrid,
|
|
151
165
|
displayMonths,
|
|
@@ -165,46 +179,7 @@ const CapEventCalendar = ({
|
|
|
165
179
|
] })
|
|
166
180
|
] });
|
|
167
181
|
};
|
|
168
|
-
|
|
169
|
-
calendarDate: PropTypes.string,
|
|
170
|
-
events: PropTypes.array,
|
|
171
|
-
popoverContent: PropTypes.any,
|
|
172
|
-
onQuarterChange: PropTypes.func,
|
|
173
|
-
selectedQuarter: PropTypes.string,
|
|
174
|
-
calendarGridLineLabel: PropTypes.string,
|
|
175
|
-
dayLabels: PropTypes.array,
|
|
176
|
-
allQuartersLabel: PropTypes.array,
|
|
177
|
-
monthLabels: PropTypes.array,
|
|
178
|
-
todayTooltipProps: PropTypes.object,
|
|
179
|
-
dashLineOffsetY: PropTypes.number,
|
|
180
|
-
eventHeight: PropTypes.number,
|
|
181
|
-
eventRowGap: PropTypes.number,
|
|
182
|
-
textPadding: PropTypes.number,
|
|
183
|
-
eventStartYOffset: PropTypes.number,
|
|
184
|
-
minCanvasHeight: PropTypes.number,
|
|
185
|
-
canvasFont: PropTypes.string,
|
|
186
|
-
popoverPlacement: PropTypes.string
|
|
187
|
-
};
|
|
188
|
-
CapEventCalendar.defaultProps = {
|
|
189
|
-
popoverContent: DefaultPopover,
|
|
190
|
-
dashLineOffsetY: 20,
|
|
191
|
-
eventHeight: 24,
|
|
192
|
-
eventRowGap: 12,
|
|
193
|
-
textPadding: 12,
|
|
194
|
-
eventStartYOffset: 40,
|
|
195
|
-
minCanvasHeight: 0,
|
|
196
|
-
todayTooltipProps: { title: "Today" },
|
|
197
|
-
allQuartersLabel: QUARTER_LABELS,
|
|
198
|
-
dayLabels: DAY_LABELS,
|
|
199
|
-
monthLabels: MONTH_LABELS,
|
|
200
|
-
canvasFont: `normal ${FONT_SIZE_S} ${FONT_FAMILY}`,
|
|
201
|
-
calendarGridLineLabel: "Calendar Grid Line",
|
|
202
|
-
popoverPlacement: "leftTop",
|
|
203
|
-
emptyStateTitle: "You have no events for this quarter",
|
|
204
|
-
emptyStateDescription: "Please create an event to view it here",
|
|
205
|
-
emptyStateButtonLabel: "Create Event",
|
|
206
|
-
isButtonDisabled: false
|
|
207
|
-
};
|
|
182
|
+
const index = injectIntl(CapEventCalendar);
|
|
208
183
|
export {
|
|
209
|
-
|
|
184
|
+
index as default
|
|
210
185
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const scope = "app.commonUtils.capUiLibrary.CapEventCalendar";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
calendarGridLineLabel: {
|
|
4
|
+
id: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
emptyStateTitle: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
};
|
|
11
|
+
emptyStateDescription: {
|
|
12
|
+
id: string;
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
};
|
|
15
|
+
emptyStateButtonLabel: {
|
|
16
|
+
id: string;
|
|
17
|
+
defaultMessage: string;
|
|
18
|
+
};
|
|
19
|
+
todayLabel: {
|
|
20
|
+
id: string;
|
|
21
|
+
defaultMessage: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
25
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../components/CapEventCalendar/messages.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,kDAAkD,CAAC;;;;;;;;;;;;;;;;;;;;;;;AAErE,wBAqBG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineMessages } from "react-intl";
|
|
2
|
+
const scope = "app.commonUtils.capUiLibrary.CapEventCalendar";
|
|
3
|
+
const messages = defineMessages({
|
|
4
|
+
calendarGridLineLabel: {
|
|
5
|
+
id: `${scope}.calendarGridLineLabel`,
|
|
6
|
+
defaultMessage: "Calendar Grid Line"
|
|
7
|
+
},
|
|
8
|
+
emptyStateTitle: {
|
|
9
|
+
id: `${scope}.emptyStateTitle`,
|
|
10
|
+
defaultMessage: "You have no events for this quarter"
|
|
11
|
+
},
|
|
12
|
+
emptyStateDescription: {
|
|
13
|
+
id: `${scope}.emptyStateDescription`,
|
|
14
|
+
defaultMessage: "Please create an event to view it here"
|
|
15
|
+
},
|
|
16
|
+
emptyStateButtonLabel: {
|
|
17
|
+
id: `${scope}.emptyStateButtonLabel`,
|
|
18
|
+
defaultMessage: "Create Event"
|
|
19
|
+
},
|
|
20
|
+
todayLabel: {
|
|
21
|
+
id: `${scope}.todayLabel`,
|
|
22
|
+
defaultMessage: "Today"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
messages as default,
|
|
27
|
+
scope
|
|
28
|
+
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/* Transition */
|
|
8
8
|
/* Timezones Footer */
|
|
9
9
|
.event-calendar {
|
|
10
|
-
height:
|
|
10
|
+
height: 50rem;
|
|
11
11
|
}
|
|
12
12
|
.event-calendar__header {
|
|
13
13
|
display: flex;
|
|
@@ -19,94 +19,22 @@
|
|
|
19
19
|
padding-top: 0.571rem;
|
|
20
20
|
}
|
|
21
21
|
.event-calendar__header__left .quarter-label {
|
|
22
|
-
width:
|
|
22
|
+
width: fit-content;
|
|
23
23
|
height: 1.428rem;
|
|
24
|
-
margin:
|
|
25
|
-
|
|
26
|
-
font-weight: 500;
|
|
27
|
-
font-stretch: normal;
|
|
28
|
-
font-style: normal;
|
|
29
|
-
line-height: 1.25;
|
|
30
|
-
letter-spacing: normal;
|
|
31
|
-
color: #091e42;
|
|
24
|
+
margin: 0.142rem 0 0.142rem 0.571rem;
|
|
25
|
+
gap: 0.857rem;
|
|
32
26
|
}
|
|
33
|
-
.event-calendar__header__left .quarter-
|
|
34
|
-
|
|
27
|
+
.event-calendar__header__left .quarter-label__text {
|
|
28
|
+
font-size: 1.143rem;
|
|
35
29
|
}
|
|
36
30
|
.event-calendar__header__left .disable-left {
|
|
37
|
-
color:
|
|
31
|
+
color: #97a0af !important;
|
|
38
32
|
cursor: not-allowed;
|
|
39
33
|
pointer-events: none;
|
|
40
34
|
}
|
|
41
35
|
.event-calendar__header__left .carousel-icon {
|
|
42
36
|
cursor: pointer;
|
|
43
37
|
}
|
|
44
|
-
.event-calendar__header__right
|
|
45
|
-
|
|
46
|
-
height: 1.428rem;
|
|
47
|
-
margin: 9px 0.571rem 11px 0;
|
|
48
|
-
font-size: 1rem;
|
|
49
|
-
font-weight: 500;
|
|
50
|
-
font-stretch: normal;
|
|
51
|
-
font-style: normal;
|
|
52
|
-
line-height: 1.43;
|
|
53
|
-
letter-spacing: normal;
|
|
54
|
-
color: #091e42;
|
|
55
|
-
}
|
|
56
|
-
.event-calendar__header .ant-btn-flat {
|
|
57
|
-
width: 140px !important;
|
|
58
|
-
height: 2.857rem !important;
|
|
59
|
-
margin: 0 0 0 0.571rem !important;
|
|
60
|
-
padding: 0.571rem !important;
|
|
61
|
-
border-radius: 0.285rem !important;
|
|
62
|
-
border: solid 1px #b3bac5 !important;
|
|
63
|
-
color: #091e42;
|
|
64
|
-
font-weight: normal;
|
|
65
|
-
}
|
|
66
|
-
.event-calendar__header .ant-btn-flat .cap-button-v2-suffix {
|
|
67
|
-
position: absolute;
|
|
68
|
-
right: 0.571rem;
|
|
69
|
-
}
|
|
70
|
-
.event-calendar__header .flat-btn:hover {
|
|
71
|
-
background-color: #ffffff !important;
|
|
72
|
-
}
|
|
73
|
-
.event-calendar__month-header {
|
|
74
|
-
display: flex;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
position: relative;
|
|
77
|
-
text-align: center;
|
|
78
|
-
top: 0;
|
|
79
|
-
margin-bottom: 10px;
|
|
80
|
-
margin-top: 25px;
|
|
81
|
-
}
|
|
82
|
-
.event-calendar__month-header__label {
|
|
83
|
-
width: 33.33%;
|
|
84
|
-
height: 1.428rem;
|
|
85
|
-
text-align: center;
|
|
86
|
-
color: #091e42;
|
|
87
|
-
font-size: 1rem;
|
|
88
|
-
font-weight: 500;
|
|
89
|
-
font-stretch: normal;
|
|
90
|
-
font-style: normal;
|
|
91
|
-
line-height: 1.43;
|
|
92
|
-
letter-spacing: normal;
|
|
93
|
-
}
|
|
94
|
-
.ant-dropdown-placement-bottomCenter .ant-dropdown-menu-item {
|
|
95
|
-
height: 2.857rem !important;
|
|
96
|
-
padding: 9px 0.571rem 11px 1.142rem !important;
|
|
97
|
-
background-color: #ffffff !important;
|
|
98
|
-
color: #091e42 !important;
|
|
99
|
-
font-size: 1rem;
|
|
100
|
-
}
|
|
101
|
-
.ant-dropdown-placement-bottomCenter .ant-dropdown-menu-item:hover {
|
|
102
|
-
background-color: #fefcf0 !important;
|
|
103
|
-
}
|
|
104
|
-
.ant-dropdown-placement-bottomCenter .ant-dropdown-menu-item-selected {
|
|
105
|
-
background-color: #e9f0fe !important;
|
|
106
|
-
border-left: 1px solid #2466ea !important;
|
|
107
|
-
color: #091e42 !important;
|
|
108
|
-
}
|
|
109
|
-
.ant-dropdown-placement-bottomCenter .ant-dropdown-menu-vertical {
|
|
110
|
-
width: 140px !important;
|
|
111
|
-
margin-left: 35px !important;
|
|
38
|
+
.event-calendar__header__right {
|
|
39
|
+
gap: 0.857rem;
|
|
112
40
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './styles.css';const styles = {
|
|
2
|
+
"event-calendar__header": "event-calendar__header",
|
|
3
|
+
"event-calendar__header__left": "event-calendar__header__left",
|
|
4
|
+
"quarter-label": "quarter-label",
|
|
5
|
+
"quarter-label__text": "quarter-label__text",
|
|
6
|
+
"disable-left": "disable-left",
|
|
7
|
+
"carousel-icon": "carousel-icon",
|
|
8
|
+
"event-calendar__header__right": "event-calendar__header__right"
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
styles as default
|
|
12
|
+
};
|