@capillarytech/blaze-ui 6.0.0 → 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/CapActionBar/styles.module.scss.js +1 -1
- package/CapAdvancedIcon/styles.module.scss.js +1 -1
- package/CapAlert/styles.module.scss.js +1 -1
- package/CapAppNotEnabled/styles.module.scss.js +1 -1
- package/CapAskAira/AudienceFilterBot/styles.module.scss.js +1 -1
- package/CapAskAira/CapAiMediaGeneration/styles.module.scss.js +1 -1
- package/CapAskAira/ConfigurationBot/PromptAttachmentButton.js +1 -1
- package/CapAskAira/ConfigurationBot/styles.module.scss.js +1 -1
- package/CapAskAira/ContentGenerationBot/styles.module.scss.js +1 -1
- package/CapAskAira/DocumentationBot/styles.module.scss.js +1 -1
- package/CapAskAira/DocumentationChatBot/styles.module.scss.js +1 -1
- package/CapAskAira/RuleGenerationBot/styles.module.scss.js +1 -1
- package/CapAskAira/RuleSummarizationBot/styles.module.scss.js +1 -1
- package/CapAskAira/styles.module.scss.js +1 -1
- package/CapBanner/styles.module.scss.js +1 -1
- package/CapBlock/styles.module.scss.js +1 -1
- package/CapButton/styles.module.scss.js +1 -1
- package/CapCSVFileUploader/styles.module.scss.js +1 -1
- package/CapCalendarDatePicker/styles.module.scss.js +1 -1
- package/CapCard/styles.module.scss.js +1 -1
- package/CapCardBox/styles.module.scss.js +1 -1
- package/CapCarousel/styles.module.scss.js +1 -1
- package/CapCheckbox/styles.module.scss.js +1 -1
- package/CapColorPicker/styles.module.scss.js +1 -1
- package/CapColoredTag/styles.module.scss.js +1 -1
- package/CapColumn/styles.module.scss.js +1 -1
- package/CapConditionPreview/styles.module.scss.js +1 -1
- package/CapCustomCard/styles.module.scss.js +1 -1
- package/CapCustomCarousel/styles.module.scss.js +1 -1
- package/CapCustomCheckboxList/styles.module.scss.js +1 -1
- package/CapCustomList/styles.module.scss.js +1 -1
- package/CapCustomSelect/styles.module.scss.js +1 -1
- package/CapDatePicker/styles.module.scss.js +1 -1
- package/CapDateRangePicker/styles.module.scss.js +1 -1
- package/CapDateTimePicker/styles.module.scss.js +1 -1
- package/CapDateTimeRangePicker/styles.module.scss.js +1 -1
- package/CapDnDGraph/reportingBlock.js +1 -1
- package/CapDropdown/styles.module.scss.js +1 -1
- package/CapEmptyDivWithBorder/styles.module.scss.js +1 -1
- package/CapError/styles.module.scss.js +1 -1
- package/CapErrorBoundary/styles.module.scss.js +1 -1
- package/CapErrorStateIllustration/styles.module.scss.js +1 -1
- 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/CapExpressionEditor/styles.module.scss.js +1 -1
- package/CapForm/styles.module.scss.js +1 -1
- package/CapFormItem/styles.module.scss.js +1 -1
- package/CapGraph/styles.module.scss.js +1 -1
- package/CapHamburgerMenu/styles.module.scss.js +1 -1
- package/CapHeader/styles.module.scss.js +1 -1
- package/CapHeading/styles.module.scss.js +1 -1
- package/CapIcon/styles.module.scss.js +1 -1
- package/CapIllustration/styles.module.scss.js +1 -1
- package/CapImage/styles.module.scss.js +1 -1
- package/CapImportMFEComponent/styles.module.scss.js +1 -1
- package/CapInfoNote/styles.module.scss.js +1 -1
- package/CapInput/styles.module.scss.js +1 -1
- package/CapLabel/styles.module.scss.js +1 -1
- package/CapLanguageProvider/index.d.ts +0 -1
- package/CapLanguageProvider/index.d.ts.map +1 -1
- package/CapLanguageProvider/index.js +0 -3
- package/CapLevelGraphRenderer/styles.module.scss.js +1 -1
- package/CapLink/styles.module.scss.js +1 -1
- package/CapList/styles.module.scss.js +1 -1
- package/CapListLayout/styles.module.scss.js +1 -1
- package/CapLogin/styles.module.scss.js +1 -1
- package/CapMenu/styles.module.scss.js +1 -1
- package/CapModal/styles.module.scss.js +1 -1
- package/CapMultiSelect/styles.module.scss.js +1 -1
- package/CapMultiSelectDatePicker/styles.module.scss.js +1 -1
- package/CapNavigation/styles.module.scss.js +1 -1
- package/CapNotification/styles.module.scss.js +1 -1
- package/CapNotificationDropdown/styles.module.scss.js +1 -1
- package/CapPopover/styles.module.scss.js +1 -1
- package/CapProgress/styles.module.scss.js +1 -1
- package/CapRadio/styles.module.scss.js +1 -1
- package/CapRadioButton/styles.module.scss.js +1 -1
- package/CapRadioCard/styles.module.scss.js +1 -1
- package/CapRadioGroup/styles.module.scss.js +1 -1
- package/CapReorderComponent/styles.module.scss.js +1 -1
- package/CapRoadMap/styles.module.scss.js +1 -1
- package/CapRow/styles.module.scss.js +1 -1
- package/CapSKUUploader/styles.module.scss.js +1 -1
- package/CapSecondaryTopBar/styles.module.scss.js +1 -1
- package/CapSelect/styles.module.scss.js +1 -1
- package/CapSelectFilter/{styles.module.css → styles.css} +3 -3
- package/CapSelectFilter/styles.module.scss.js +1 -1
- package/CapSelectFilter/styles.scss +3 -3
- package/CapShape/styles.module.scss.js +1 -1
- package/CapSideBar/_menuSearch.module.scss.js +1 -1
- package/CapSideBar/styles.module.scss.js +1 -1
- package/CapSlideBox/styles.module.scss.js +1 -1
- package/CapSlider/styles.module.scss.js +1 -1
- package/CapSnackBar/styles.module.scss.js +1 -1
- package/CapSomethingWentWrong/styles.module.scss.js +1 -1
- package/CapSplit/styles.module.scss.js +1 -1
- package/CapStatisticCard/styles.module.scss.js +1 -1
- package/CapStatus/styles.module.scss.js +1 -1
- package/CapSteps/styles.module.scss.js +1 -1
- package/CapStepsAccordian/styles.module.scss.js +1 -1
- package/CapSupportVideosWrapper/index.js +1 -1
- package/CapSupportVideosWrapper/styles.module.scss.js +1 -1
- package/CapSwitch/styles.module.scss.js +1 -1
- package/CapTab/styles.module.scss.js +1 -1
- package/CapTabV3/styles.module.scss.js +1 -1
- package/CapTabV3/tests/CapTabV3.mockData.d.ts +26 -26
- package/CapTabV3/tests/CapTabV3.mockData.d.ts.map +1 -1
- package/CapTable/styles.module.scss.js +1 -1
- package/CapTag/styles.module.scss.js +1 -1
- package/CapTagDropdown/styles.module.scss.js +1 -1
- package/CapTimePicker/styles.module.scss.js +1 -1
- package/CapTooltip/styles.module.scss.js +1 -1
- package/CapTooltipWithInfo/styles.module.scss.js +1 -1
- package/CapTopBar/CapOrgSelect.module.scss.js +1 -1
- package/CapTopBar/styles.module.scss.js +1 -1
- package/CapTree/styles.module.scss.js +1 -1
- package/CapTreeSelect/styles.module.scss.js +1 -1
- package/CapUnifiedSelect/styles.module.scss.js +1 -1
- package/CapUploader/styles.module.scss.js +1 -1
- package/CapUserProfile/styles.module.scss.js +1 -1
- package/assets/HOCs/ComponentWithLabelHOC/styles.module.scss.js +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +223 -221
- package/package.json +1 -2
- package/utils/dayjs.d.ts +1 -0
- package/utils/dayjs.d.ts.map +1 -1
- package/utils/dayjs.js +1 -0
- /package/CapActionBar/{styles.module.css → styles.css} +0 -0
- /package/CapAdvancedIcon/{styles.module.css → styles.css} +0 -0
- /package/CapAlert/{styles.module.css → styles.css} +0 -0
- /package/CapAppNotEnabled/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/AudienceFilterBot/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/CapAiMediaGeneration/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/ConfigurationBot/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/ContentGenerationBot/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/DocumentationBot/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/DocumentationChatBot/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/RuleGenerationBot/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/RuleSummarizationBot/{styles.module.css → styles.css} +0 -0
- /package/CapAskAira/{styles.module.css → styles.css} +0 -0
- /package/CapBanner/{styles.module.css → styles.css} +0 -0
- /package/CapBlock/{styles.module.css → styles.css} +0 -0
- /package/CapButton/{styles.module.css → styles.css} +0 -0
- /package/CapCSVFileUploader/{styles.module.css → styles.css} +0 -0
- /package/CapCalendarDatePicker/{styles.module.css → styles.css} +0 -0
- /package/CapCard/{styles.module.css → styles.css} +0 -0
- /package/CapCardBox/{styles.module.css → styles.css} +0 -0
- /package/CapCarousel/{styles.module.css → styles.css} +0 -0
- /package/CapCheckbox/{styles.module.css → styles.css} +0 -0
- /package/CapColorPicker/{styles.module.css → styles.css} +0 -0
- /package/CapColoredTag/{styles.module.css → styles.css} +0 -0
- /package/CapColumn/{styles.module.css → styles.css} +0 -0
- /package/CapConditionPreview/{styles.module.css → styles.css} +0 -0
- /package/CapCustomCard/{styles.module.css → styles.css} +0 -0
- /package/CapCustomCarousel/{styles.module.css → styles.css} +0 -0
- /package/CapCustomCheckboxList/{styles.module.css → styles.css} +0 -0
- /package/CapCustomList/{styles.module.css → styles.css} +0 -0
- /package/CapCustomSelect/{styles.module.css → styles.css} +0 -0
- /package/CapDatePicker/{styles.module.css → styles.css} +0 -0
- /package/CapDateRangePicker/{styles.module.css → styles.css} +0 -0
- /package/CapDateTimePicker/{styles.module.css → styles.css} +0 -0
- /package/CapDateTimeRangePicker/{styles.module.css → styles.css} +0 -0
- /package/CapDropdown/{styles.module.css → styles.css} +0 -0
- /package/CapEmptyDivWithBorder/{styles.module.css → styles.css} +0 -0
- /package/CapError/{styles.module.css → styles.css} +0 -0
- /package/CapErrorBoundary/{styles.module.css → styles.css} +0 -0
- /package/CapErrorStateIllustration/{styles.module.css → styles.css} +0 -0
- /package/CapExpressionEditor/{styles.module.css → styles.css} +0 -0
- /package/CapForm/{styles.module.css → styles.css} +0 -0
- /package/CapFormItem/{styles.module.css → styles.css} +0 -0
- /package/CapGraph/{styles.module.css → styles.css} +0 -0
- /package/CapHamburgerMenu/{styles.module.css → styles.css} +0 -0
- /package/CapHeader/{styles.module.css → styles.css} +0 -0
- /package/CapHeading/{styles.module.css → styles.css} +0 -0
- /package/CapIcon/{styles.module.css → styles.css} +0 -0
- /package/CapIllustration/{styles.module.css → styles.css} +0 -0
- /package/CapImage/{styles.module.css → styles.css} +0 -0
- /package/CapImportMFEComponent/{styles.module.css → styles.css} +0 -0
- /package/CapInfoNote/{styles.module.css → styles.css} +0 -0
- /package/CapInput/{styles.module.css → styles.css} +0 -0
- /package/CapLabel/{styles.module.css → styles.css} +0 -0
- /package/CapLevelGraphRenderer/{styles.module.css → styles.css} +0 -0
- /package/CapLink/{styles.module.css → styles.css} +0 -0
- /package/CapList/{styles.module.css → styles.css} +0 -0
- /package/CapListLayout/{styles.module.css → styles.css} +0 -0
- /package/CapLogin/{styles.module.css → styles.css} +0 -0
- /package/CapModal/{styles.module.css → styles.css} +0 -0
- /package/CapMultiSelect/{styles.module.css → styles.css} +0 -0
- /package/CapMultiSelectDatePicker/{styles.module.css → styles.css} +0 -0
- /package/CapNavigation/{styles.module.css → styles.css} +0 -0
- /package/CapNotification/{styles.module.css → styles.css} +0 -0
- /package/CapNotificationDropdown/{styles.module.css → styles.css} +0 -0
- /package/CapPopover/{styles.module.css → styles.css} +0 -0
- /package/CapProgress/{styles.module.css → styles.css} +0 -0
- /package/CapRadio/{styles.module.css → styles.css} +0 -0
- /package/CapRadioButton/{styles.module.css → styles.css} +0 -0
- /package/CapRadioCard/{styles.module.css → styles.css} +0 -0
- /package/CapRadioGroup/{styles.module.css → styles.css} +0 -0
- /package/CapReorderComponent/{styles.module.css → styles.css} +0 -0
- /package/CapRoadMap/{styles.module.css → styles.css} +0 -0
- /package/CapRow/{styles.module.css → styles.css} +0 -0
- /package/CapSKUUploader/{styles.module.css → styles.css} +0 -0
- /package/CapSecondaryTopBar/{styles.module.css → styles.css} +0 -0
- /package/CapSelect/{styles.module.css → styles.css} +0 -0
- /package/CapShape/{styles.module.css → styles.css} +0 -0
- /package/CapSideBar/{_menuSearch.module.css → _menuSearch.css} +0 -0
- /package/CapSideBar/{styles.module.css → styles.css} +0 -0
- /package/CapSlideBox/{styles.module.css → styles.css} +0 -0
- /package/CapSlider/{styles.module.css → styles.css} +0 -0
- /package/CapSnackBar/{styles.module.css → styles.css} +0 -0
- /package/CapSomethingWentWrong/{styles.module.css → styles.css} +0 -0
- /package/CapSplit/{styles.module.css → styles.css} +0 -0
- /package/CapStatisticCard/{styles.module.css → styles.css} +0 -0
- /package/CapStatus/{styles.module.css → styles.css} +0 -0
- /package/CapSteps/{styles.module.css → styles.css} +0 -0
- /package/CapStepsAccordian/{styles.module.css → styles.css} +0 -0
- /package/CapSupportVideosWrapper/{styles.module.css → styles.css} +0 -0
- /package/CapSwitch/{styles.module.css → styles.css} +0 -0
- /package/CapTab/{styles.module.css → styles.css} +0 -0
- /package/CapTabV3/{styles.module.css → styles.css} +0 -0
- /package/CapTable/{styles.module.css → styles.css} +0 -0
- /package/CapTag/{styles.module.css → styles.css} +0 -0
- /package/CapTagDropdown/{styles.module.css → styles.css} +0 -0
- /package/CapTimePicker/{styles.module.css → styles.css} +0 -0
- /package/CapTooltip/{styles.module.css → styles.css} +0 -0
- /package/CapTooltipWithInfo/{styles.module.css → styles.css} +0 -0
- /package/CapTopBar/{CapOrgSelect.module.css → CapOrgSelect.css} +0 -0
- /package/CapTopBar/{styles.module.css → styles.css} +0 -0
- /package/CapTree/{styles.module.css → styles.css} +0 -0
- /package/CapTreeSelect/{styles.module.css → styles.css} +0 -0
- /package/CapUnifiedSelect/{styles.module.css → styles.css} +0 -0
- /package/CapUploader/{styles.module.css → styles.css} +0 -0
- /package/CapUserProfile/{styles.module.css → styles.css} +0 -0
- /package/assets/HOCs/ComponentWithLabelHOC/{styles.module.css → styles.css} +0 -0
|
@@ -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();
|
|
@@ -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
|
};
|