@coreui/react-pro 5.10.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/components/accordion/CAccordionBody.js +2 -2
- package/dist/cjs/components/accordion/CAccordionBody.js.map +1 -1
- package/dist/cjs/components/accordion/CAccordionButton.js +2 -2
- package/dist/cjs/components/accordion/CAccordionButton.js.map +1 -1
- package/dist/cjs/components/accordion/CAccordionItem.d.ts +5 -0
- package/dist/cjs/components/accordion/CAccordionItem.js +7 -4
- package/dist/cjs/components/accordion/CAccordionItem.js.map +1 -1
- package/dist/cjs/components/badge/CBadge.js +1 -1
- package/dist/cjs/components/badge/CBadge.js.map +1 -1
- package/dist/cjs/components/calendar/CCalendar.d.ts +57 -44
- package/dist/cjs/components/calendar/CCalendar.js +51 -187
- package/dist/cjs/components/calendar/CCalendar.js.map +1 -1
- package/dist/cjs/components/calendar/CCalendarNavigation.d.ts +21 -0
- package/dist/cjs/components/calendar/CCalendarNavigation.js +23 -0
- package/dist/cjs/components/calendar/CCalendarNavigation.js.map +1 -0
- package/dist/cjs/components/calendar/CCalendarPanel.d.ts +28 -0
- package/dist/cjs/components/calendar/CCalendarPanel.js +149 -0
- package/dist/cjs/components/calendar/CCalendarPanel.js.map +1 -0
- package/dist/cjs/components/calendar/types.d.ts +3 -0
- package/dist/cjs/components/calendar/utils.d.ts +175 -18
- package/dist/cjs/components/calendar/utils.js +312 -43
- package/dist/cjs/components/calendar/utils.js.map +1 -1
- package/dist/cjs/components/date-picker/CDatePicker.d.ts +1 -1
- package/dist/cjs/components/date-range-picker/CDateRangePicker.d.ts +2 -2
- package/dist/cjs/components/date-range-picker/CDateRangePicker.js +0 -2
- package/dist/cjs/components/date-range-picker/CDateRangePicker.js.map +1 -1
- package/dist/cjs/components/date-range-picker/utils.d.ts +16 -0
- package/dist/cjs/components/date-range-picker/utils.js +18 -2
- package/dist/cjs/components/date-range-picker/utils.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdown.d.ts +77 -20
- package/dist/cjs/components/dropdown/CDropdown.js +6 -3
- package/dist/cjs/components/dropdown/CDropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownMenu.js +1 -1
- package/dist/cjs/components/dropdown/CDropdownMenu.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownToggle.js +1 -1
- package/dist/cjs/components/dropdown/CDropdownToggle.js.map +1 -1
- package/dist/cjs/components/modal/CModal.js +0 -1
- package/dist/cjs/components/modal/CModal.js.map +1 -1
- package/dist/cjs/components/nav/CNavGroup.js +1 -1
- package/dist/cjs/components/nav/CNavGroup.js.map +1 -1
- package/dist/cjs/components/popover/CPopover.d.ts +75 -20
- package/dist/cjs/components/popover/CPopover.js +8 -21
- package/dist/cjs/components/popover/CPopover.js.map +1 -1
- package/dist/cjs/components/progress/CProgress.d.ts +1 -1
- package/dist/cjs/components/range-slider/CRangeSlider.js +6 -2
- package/dist/cjs/components/range-slider/CRangeSlider.js.map +1 -1
- package/dist/cjs/components/sidebar/CSidebar.d.ts +7 -2
- package/dist/cjs/components/sidebar/CSidebar.js +7 -6
- package/dist/cjs/components/sidebar/CSidebar.js.map +1 -1
- package/dist/cjs/components/smart-pagination/CSmartPagination.d.ts +4 -12
- package/dist/cjs/components/smart-pagination/CSmartPagination.js.map +1 -1
- package/dist/cjs/components/smart-table/CSmartTableHead.js +12 -25
- package/dist/cjs/components/smart-table/CSmartTableHead.js.map +1 -1
- package/dist/cjs/components/smart-table/types.d.ts +1 -1
- package/dist/cjs/components/time-picker/CTimePicker.d.ts +1 -1
- package/dist/cjs/components/time-picker/CTimePicker.js.map +1 -1
- package/dist/cjs/components/time-picker/types.d.ts +5 -0
- package/dist/cjs/components/time-picker/utils.d.ts +8 -11
- package/dist/cjs/components/time-picker/utils.js +8 -4
- package/dist/cjs/components/time-picker/utils.js.map +1 -1
- package/dist/cjs/components/tooltip/CTooltip.d.ts +67 -15
- package/dist/cjs/components/tooltip/CTooltip.js +8 -21
- package/dist/cjs/components/tooltip/CTooltip.js.map +1 -1
- package/dist/cjs/hooks/index.d.ts +2 -1
- package/dist/cjs/hooks/useClipboard.d.ts +12 -0
- package/dist/cjs/hooks/useClipboard.js +54 -0
- package/dist/cjs/hooks/useClipboard.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/node_modules/react-device-detect/dist/lib.js +1 -1
- package/dist/cjs/node_modules/react-device-detect/dist/lib.js.map +1 -1
- package/dist/cjs/node_modules/tslib/tslib.es6.js +40 -0
- package/dist/cjs/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +2 -1
- package/dist/cjs/utils/mergeClassNames.d.ts +2 -0
- package/dist/esm/components/accordion/CAccordionBody.js +2 -2
- package/dist/esm/components/accordion/CAccordionBody.js.map +1 -1
- package/dist/esm/components/accordion/CAccordionButton.js +2 -2
- package/dist/esm/components/accordion/CAccordionButton.js.map +1 -1
- package/dist/esm/components/accordion/CAccordionItem.d.ts +5 -0
- package/dist/esm/components/accordion/CAccordionItem.js +8 -5
- package/dist/esm/components/accordion/CAccordionItem.js.map +1 -1
- package/dist/esm/components/badge/CBadge.js +1 -1
- package/dist/esm/components/badge/CBadge.js.map +1 -1
- package/dist/esm/components/calendar/CCalendar.d.ts +57 -44
- package/dist/esm/components/calendar/CCalendar.js +52 -188
- package/dist/esm/components/calendar/CCalendar.js.map +1 -1
- package/dist/esm/components/calendar/CCalendarNavigation.d.ts +21 -0
- package/dist/esm/components/calendar/CCalendarNavigation.js +21 -0
- package/dist/esm/components/calendar/CCalendarNavigation.js.map +1 -0
- package/dist/esm/components/calendar/CCalendarPanel.d.ts +28 -0
- package/dist/esm/components/calendar/CCalendarPanel.js +147 -0
- package/dist/esm/components/calendar/CCalendarPanel.js.map +1 -0
- package/dist/esm/components/calendar/types.d.ts +3 -0
- package/dist/esm/components/calendar/utils.d.ts +175 -18
- package/dist/esm/components/calendar/utils.js +306 -44
- package/dist/esm/components/calendar/utils.js.map +1 -1
- package/dist/esm/components/date-picker/CDatePicker.d.ts +1 -1
- package/dist/esm/components/date-range-picker/CDateRangePicker.d.ts +2 -2
- package/dist/esm/components/date-range-picker/CDateRangePicker.js +0 -2
- package/dist/esm/components/date-range-picker/CDateRangePicker.js.map +1 -1
- package/dist/esm/components/date-range-picker/utils.d.ts +16 -0
- package/dist/esm/components/date-range-picker/utils.js +18 -2
- package/dist/esm/components/date-range-picker/utils.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdown.d.ts +77 -20
- package/dist/esm/components/dropdown/CDropdown.js +6 -3
- package/dist/esm/components/dropdown/CDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownMenu.js +1 -1
- package/dist/esm/components/dropdown/CDropdownMenu.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownToggle.js +1 -1
- package/dist/esm/components/dropdown/CDropdownToggle.js.map +1 -1
- package/dist/esm/components/modal/CModal.js +0 -1
- package/dist/esm/components/modal/CModal.js.map +1 -1
- package/dist/esm/components/nav/CNavGroup.js +1 -1
- package/dist/esm/components/nav/CNavGroup.js.map +1 -1
- package/dist/esm/components/popover/CPopover.d.ts +75 -20
- package/dist/esm/components/popover/CPopover.js +8 -21
- package/dist/esm/components/popover/CPopover.js.map +1 -1
- package/dist/esm/components/progress/CProgress.d.ts +1 -1
- package/dist/esm/components/range-slider/CRangeSlider.js +6 -2
- package/dist/esm/components/range-slider/CRangeSlider.js.map +1 -1
- package/dist/esm/components/sidebar/CSidebar.d.ts +7 -2
- package/dist/esm/components/sidebar/CSidebar.js +7 -6
- package/dist/esm/components/sidebar/CSidebar.js.map +1 -1
- package/dist/esm/components/smart-pagination/CSmartPagination.d.ts +4 -12
- package/dist/esm/components/smart-pagination/CSmartPagination.js.map +1 -1
- package/dist/esm/components/smart-table/CSmartTableHead.js +13 -26
- package/dist/esm/components/smart-table/CSmartTableHead.js.map +1 -1
- package/dist/esm/components/smart-table/types.d.ts +1 -1
- package/dist/esm/components/time-picker/CTimePicker.d.ts +1 -1
- package/dist/esm/components/time-picker/CTimePicker.js.map +1 -1
- package/dist/esm/components/time-picker/types.d.ts +5 -0
- package/dist/esm/components/time-picker/utils.d.ts +8 -11
- package/dist/esm/components/time-picker/utils.js +8 -4
- package/dist/esm/components/time-picker/utils.js.map +1 -1
- package/dist/esm/components/tooltip/CTooltip.d.ts +67 -15
- package/dist/esm/components/tooltip/CTooltip.js +8 -21
- package/dist/esm/components/tooltip/CTooltip.js.map +1 -1
- package/dist/esm/hooks/index.d.ts +2 -1
- package/dist/esm/hooks/useClipboard.d.ts +12 -0
- package/dist/esm/hooks/useClipboard.js +52 -0
- package/dist/esm/hooks/useClipboard.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/node_modules/react-device-detect/dist/lib.js +1 -1
- package/dist/esm/node_modules/react-device-detect/dist/lib.js.map +1 -1
- package/dist/esm/node_modules/tslib/tslib.es6.js +39 -1
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/esm/utils/index.d.ts +2 -1
- package/dist/esm/utils/mergeClassNames.d.ts +2 -0
- package/package.json +12 -10
- package/src/components/accordion/CAccordionBody.tsx +3 -3
- package/src/components/accordion/CAccordionButton.tsx +3 -2
- package/src/components/accordion/CAccordionItem.tsx +14 -5
- package/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap +0 -2
- package/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap +0 -2
- package/src/components/badge/CBadge.tsx +1 -1
- package/src/components/calendar/CCalendar.tsx +154 -489
- package/src/components/calendar/CCalendarNavigation.tsx +120 -0
- package/src/components/calendar/CCalendarPanel.tsx +306 -0
- package/src/components/calendar/types.ts +5 -0
- package/src/components/calendar/utils.ts +414 -109
- package/src/components/carousel/__tests__/CCarousel.spec.tsx +1 -2
- package/src/components/date-picker/CDatePicker.tsx +1 -1
- package/src/components/date-range-picker/CDateRangePicker.tsx +2 -4
- package/src/components/date-range-picker/utils.ts +23 -3
- package/src/components/dropdown/CDropdown.tsx +106 -26
- package/src/components/dropdown/CDropdownMenu.tsx +0 -1
- package/src/components/dropdown/CDropdownToggle.tsx +1 -1
- package/src/components/dropdown/__tests__/CDropdown.spec.tsx +43 -19
- package/src/components/modal/CModal.tsx +0 -2
- package/src/components/modal/__tests__/CModal.spec.tsx +33 -25
- package/src/components/nav/CNavGroup.tsx +5 -1
- package/src/components/nav/__tests__/__snapshots__/CNavGroup.spec.tsx.snap +4 -1
- package/src/components/popover/CPopover.tsx +103 -43
- package/src/components/popover/__tests__/CPopover.spec.tsx +1 -1
- package/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap +2 -3
- package/src/components/progress/CProgress.tsx +1 -1
- package/src/components/range-slider/CRangeSlider.tsx +7 -2
- package/src/components/sidebar/CSidebar.tsx +15 -5
- package/src/components/smart-pagination/CSmartPagination.tsx +4 -12
- package/src/components/smart-table/CSmartTableHead.tsx +10 -34
- package/src/components/smart-table/types.ts +7 -1
- package/src/components/time-picker/CTimePicker.tsx +3 -3
- package/src/components/time-picker/types.ts +7 -0
- package/src/components/time-picker/utils.ts +15 -13
- package/src/components/tooltip/CTooltip.tsx +94 -38
- package/src/components/tooltip/__tests__/__snapshots__/CTooltip.spec.tsx.snap +0 -1
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useClipboard.ts +38 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/mergeClassNames.ts +25 -0
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { __rest, __assign } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import React, { createContext, forwardRef, useRef, useContext, useState, useEffect } from 'react';
|
|
2
|
+
import React, { createContext, forwardRef, useId, useRef, useContext, useState, useEffect } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from '../../_virtual/index.js';
|
|
5
5
|
import { CAccordionContext } from './CAccordion.js';
|
|
6
6
|
|
|
7
7
|
var CAccordionItemContext = createContext({});
|
|
8
8
|
var CAccordionItem = forwardRef(function (_a, ref) {
|
|
9
|
-
var children = _a.children, className = _a.className, itemKey = _a.itemKey, rest = __rest(_a, ["children", "className", "itemKey"]);
|
|
10
|
-
var
|
|
9
|
+
var children = _a.children, className = _a.className, id = _a.id, itemKey = _a.itemKey, rest = __rest(_a, ["children", "className", "id", "itemKey"]);
|
|
10
|
+
var _id = id !== null && id !== void 0 ? id : useId();
|
|
11
|
+
var _itemKey = useRef(itemKey !== null && itemKey !== void 0 ? itemKey : _id);
|
|
11
12
|
var _b = useContext(CAccordionContext), _activeItemKey = _b._activeItemKey, alwaysOpen = _b.alwaysOpen, setActiveKey = _b.setActiveKey;
|
|
12
13
|
var _c = useState(Boolean(_activeItemKey === _itemKey.current)), visible = _c[0], setVisible = _c[1];
|
|
13
14
|
useEffect(function () {
|
|
14
|
-
!alwaysOpen && visible
|
|
15
|
+
if (!alwaysOpen && visible) {
|
|
16
|
+
setActiveKey(_itemKey.current);
|
|
17
|
+
}
|
|
15
18
|
}, [visible]);
|
|
16
19
|
useEffect(function () {
|
|
17
20
|
setVisible(Boolean(_activeItemKey === _itemKey.current));
|
|
18
21
|
}, [_activeItemKey]);
|
|
19
22
|
return (React.createElement("div", __assign({ className: classNames('accordion-item', className) }, rest, { ref: ref }),
|
|
20
|
-
React.createElement(CAccordionItemContext.Provider, { value: { setVisible: setVisible, visible: visible } }, children)));
|
|
23
|
+
React.createElement(CAccordionItemContext.Provider, { value: { id: _id, setVisible: setVisible, visible: visible } }, children)));
|
|
21
24
|
});
|
|
22
25
|
CAccordionItem.propTypes = {
|
|
23
26
|
children: PropTypes.node,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CAccordionItem.js","sources":["../../../../src/components/accordion/CAccordionItem.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"CAccordionItem.js","sources":["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AAA,CAAA,EAAK,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAM,EAAA,IAAI,EAAE,EAAA,GAAG,EAAE,GAAG,EAAA,CAAA;QACzE,KAAC,CAAA,aAAA,CAAA,qBAAqB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,UAAU,EAAA,UAAA,EAAE,OAAO,EAAA,OAAA,EAAE,IACpE,QAAQ,CACsB,CAC7B;AAEV,CAAC;AAGH,cAAc,CAAC,SAAS,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,SAAS,EAAE,SAAS,CAAC,MAAM;AAC3B,IAAA,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACnE;AAED,cAAc,CAAC,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -20,7 +20,7 @@ var CBadge = forwardRef(function (_a, ref) {
|
|
|
20
20
|
_b), shape, className) }, rest, { ref: ref }), children));
|
|
21
21
|
});
|
|
22
22
|
CBadge.propTypes = {
|
|
23
|
-
as: PropTypes.
|
|
23
|
+
as: PropTypes.elementType,
|
|
24
24
|
children: PropTypes.node,
|
|
25
25
|
className: PropTypes.string,
|
|
26
26
|
color: PropTypes.oneOfType([colorPropType, gradientsPropType]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CBadge.js","sources":["../../../../src/components/badge/CBadge.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;IAmDa,MAAM,GAA2D,UAAU,CAItF,UACE,EAWC,EACD,GAAG,EAAA;;AAXD,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,EAAA,GAAA,EAAA,CAAA,EAAsB,EAAlB,SAAS,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,MAAM,GAAA,EAAA,EACtB,SAAS,GAAA,EAAA,CAAA,SAA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AAC;AAC7B,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,SAAS,EAAE,kBAAkB;CAC9B;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
|
|
@@ -1,180 +1,193 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import type { DisabledDate, SelectionTypes } from './types';
|
|
3
3
|
export interface CCalendarProps {
|
|
4
4
|
/**
|
|
5
|
-
* A string that provides an accessible label for the button that navigates to the next month in the
|
|
5
|
+
* A string that provides an accessible label for the button that navigates to the next month in the React Calendar component. This label is read by screen readers to describe the action associated with the button. Customize for a more accessible calendar experience.
|
|
6
6
|
*
|
|
7
|
+
* @default 'Next month'
|
|
7
8
|
* @since 5.5.0
|
|
8
9
|
*/
|
|
9
10
|
ariaNavNextMonthLabel?: string;
|
|
10
11
|
/**
|
|
11
|
-
* A string that provides an accessible label for the button that navigates to the next year in the
|
|
12
|
+
* A string that provides an accessible label for the button that navigates to the next year in the React Calendar component. Screen readers utilize this label to inform users of the button's functionality, aiding in a more inclusive application.
|
|
12
13
|
*
|
|
14
|
+
* @default 'Next year'
|
|
13
15
|
* @since 5.5.0
|
|
14
16
|
*/
|
|
15
17
|
ariaNavNextYearLabel?: string;
|
|
16
18
|
/**
|
|
17
|
-
* A string that provides an accessible label for the button that navigates to the previous month in the
|
|
19
|
+
* A string that provides an accessible label for the button that navigates to the previous month in the React Calendar component. This label is announced by screen readers, ensuring clarity around the button's purpose.
|
|
18
20
|
*
|
|
21
|
+
* @default 'Previous month'
|
|
19
22
|
* @since 5.5.0
|
|
20
23
|
*/
|
|
21
24
|
ariaNavPrevMonthLabel?: string;
|
|
22
25
|
/**
|
|
23
|
-
* A string that provides an accessible label for the button that navigates to the previous year in the
|
|
26
|
+
* A string that provides an accessible label for the button that navigates to the previous year in the React Calendar component. Use it to enhance the experience for screen readers and further accessibility.
|
|
24
27
|
*
|
|
28
|
+
* @default 'Previous year'
|
|
25
29
|
* @since 5.5.0
|
|
26
30
|
*/
|
|
27
31
|
ariaNavPrevYearLabel?: string;
|
|
28
32
|
/**
|
|
29
|
-
*
|
|
33
|
+
* Defines the initial date or reference date for the React Calendar component. This date can be either a Date object or a string that can be converted into a valid date.
|
|
30
34
|
*/
|
|
31
35
|
calendarDate?: Date | string | null;
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
37
|
+
* Specifies how many individual calendars should be displayed side by side on desktop devices. Increasing this number allows your users to view multiple months (or years, etc.) simultaneously.
|
|
34
38
|
*/
|
|
35
39
|
calendars?: number;
|
|
36
40
|
/**
|
|
37
|
-
* A string of all
|
|
41
|
+
* A string of all classNames you want to apply to the outermost container of the React Calendar component. Use this to style or theme your calendar.
|
|
38
42
|
*/
|
|
39
43
|
className?: string;
|
|
40
44
|
/**
|
|
41
|
-
*
|
|
45
|
+
* Sets the format for day names. Accepts either a built-in format ('numeric' or '2-digit') or a custom function to return any desired string or number for the day.
|
|
42
46
|
*
|
|
43
47
|
* @default 'numeric'
|
|
44
48
|
* @since 4.3.0
|
|
45
49
|
*/
|
|
46
50
|
dayFormat?: 'numeric' | '2-digit' | ((date: Date) => string | number);
|
|
47
51
|
/**
|
|
48
|
-
*
|
|
52
|
+
* Specifies one or more dates that cannot be selected by the user. This is useful for disabling weekends, holidays, or any dates that you need to restrict within your React Calendar component.
|
|
49
53
|
*/
|
|
50
54
|
disabledDates?: DisabledDate | DisabledDate[];
|
|
51
55
|
/**
|
|
52
|
-
*
|
|
56
|
+
* Defines the initially selected ending date (applicable when using range selection). Accepts both Date objects and valid date strings.
|
|
53
57
|
*/
|
|
54
58
|
endDate?: Date | string | null;
|
|
55
59
|
/**
|
|
56
|
-
* Sets the day of
|
|
57
|
-
* - 0
|
|
58
|
-
* - 1
|
|
59
|
-
* - 2
|
|
60
|
-
* - 3
|
|
61
|
-
* - 4
|
|
62
|
-
* - 5
|
|
63
|
-
* - 6
|
|
60
|
+
* Sets the first day of the week. This can be adjusted for different locales or preferences:
|
|
61
|
+
* - `0` = Sunday
|
|
62
|
+
* - `1` = Monday
|
|
63
|
+
* - `2` = Tuesday
|
|
64
|
+
* - `3` = Wednesday
|
|
65
|
+
* - `4` = Thursday
|
|
66
|
+
* - `5` = Friday
|
|
67
|
+
* - `6` = Saturday
|
|
64
68
|
*
|
|
65
69
|
* @default 1
|
|
66
70
|
*/
|
|
67
71
|
firstDayOfWeek?: number;
|
|
68
72
|
/**
|
|
69
|
-
*
|
|
73
|
+
* Indicates the locale for the React Calendar component. If not explicitly provided, it inherits the locale settings from the browser.
|
|
70
74
|
*
|
|
71
75
|
* @default 'default'
|
|
72
76
|
*/
|
|
73
77
|
locale?: string;
|
|
74
78
|
/**
|
|
75
|
-
*
|
|
79
|
+
* The maximum date that can be selected. Any date beyond this value will be disabled within the calendar. This is often used to restrict future selections.
|
|
76
80
|
*/
|
|
77
81
|
maxDate?: Date | string | null;
|
|
78
82
|
/**
|
|
79
|
-
*
|
|
83
|
+
* The minimum date that can be selected. Any date before this value will be disabled in the calendar. Useful for preventing selection of past dates or creating limited booking windows.
|
|
80
84
|
*/
|
|
81
85
|
minDate?: Date | string | null;
|
|
82
86
|
/**
|
|
83
|
-
*
|
|
87
|
+
* Toggles display of arrow-based navigation (previous/next controls) in the React Calendar component. If set to `false`, you can build custom navigation or handle the navigation programmatically.
|
|
84
88
|
*/
|
|
85
89
|
navigation?: boolean;
|
|
86
90
|
/**
|
|
87
|
-
*
|
|
91
|
+
* Customizes the icon for navigating to the next view (month, year, etc.) depending on the current view. Accepts any valid `ReactNode`, enabling you to display text, images, or icons.
|
|
88
92
|
*/
|
|
89
93
|
navNextIcon?: ReactNode;
|
|
90
94
|
/**
|
|
91
|
-
*
|
|
95
|
+
* Customizes the icon for navigating multiple steps forward (double jump), e.g., skipping multiple months or years at once. Ideal for quick navigation through large date ranges.
|
|
92
96
|
*/
|
|
93
97
|
navNextDoubleIcon?: ReactNode;
|
|
94
98
|
/**
|
|
95
|
-
*
|
|
99
|
+
* Customizes the icon for navigating to the previous view in the calendar. Accepts any valid ReactNode to provide flexible styling or theming.
|
|
96
100
|
*/
|
|
97
101
|
navPrevIcon?: ReactNode;
|
|
98
102
|
/**
|
|
99
|
-
*
|
|
103
|
+
* Customizes the icon for a double jump backward (e.g., jumping multiple months or years at once). This feature simplifies larger date range navigation within your React Calendar component.
|
|
100
104
|
*/
|
|
101
105
|
navPrevDoubleIcon?: ReactNode;
|
|
102
106
|
/**
|
|
103
|
-
*
|
|
107
|
+
* Reorders the year and month navigation, rendering the year selector first. This offers a different layout for users, particularly useful if you want to prioritize quick year changes.
|
|
104
108
|
*
|
|
109
|
+
* @default false
|
|
105
110
|
* @since 4.3.0
|
|
106
111
|
*/
|
|
107
112
|
navYearFirst?: boolean;
|
|
108
113
|
/**
|
|
109
|
-
*
|
|
114
|
+
* Enables range selection mode in your React Calendar component, allowing users to select two dates for a range (start and end). Once enabled, the component will manage state for both dates.
|
|
110
115
|
*/
|
|
111
116
|
range?: boolean;
|
|
112
117
|
/**
|
|
113
|
-
*
|
|
118
|
+
* Sets whether days from adjacent months (shown at the start/end of the current view) are selectable. This only applies if `showAdjacementDays` is set to `true`.
|
|
114
119
|
*
|
|
120
|
+
* @default false
|
|
115
121
|
* @since 4.11.0
|
|
116
122
|
*/
|
|
117
123
|
selectAdjacementDays?: boolean;
|
|
118
124
|
/**
|
|
119
|
-
*
|
|
125
|
+
* Controls whether the calendar should display dates from previous or next months (non-selectable if `selectAdjacementDays` is `false`). This can make the calendar visually continuous.
|
|
120
126
|
*
|
|
127
|
+
* @default true
|
|
121
128
|
* @since 4.11.0
|
|
122
129
|
*/
|
|
123
130
|
showAdjacementDays?: boolean;
|
|
124
131
|
/**
|
|
125
|
-
*
|
|
132
|
+
* Toggles the display of week numbers (ISO 8601) in the calendar's left column. Particularly beneficial for applications where users need to see the week index for scheduling or reporting.
|
|
126
133
|
*
|
|
134
|
+
* @default false
|
|
127
135
|
* @since 5.0.0
|
|
128
136
|
*/
|
|
129
137
|
showWeekNumber?: boolean;
|
|
130
138
|
/**
|
|
131
|
-
*
|
|
139
|
+
* Indicates if the user's current selection is targeting the end date in range selection mode. Primarily used for controlled components where you need to manage which date (start or end) is currently active.
|
|
132
140
|
*/
|
|
133
141
|
selectEndDate?: boolean;
|
|
134
142
|
/**
|
|
135
|
-
*
|
|
143
|
+
* Specifies the selection type for the React Calendar component. Supports:
|
|
144
|
+
* - `day`: Regular day selection (default)
|
|
145
|
+
* - `week`: Select an entire week
|
|
146
|
+
* - `month`: Select an entire month
|
|
147
|
+
* - `year`: Select an entire year
|
|
136
148
|
*
|
|
149
|
+
* @default 'day'
|
|
137
150
|
* @since 5.0.0
|
|
138
151
|
*/
|
|
139
|
-
selectionType?:
|
|
152
|
+
selectionType?: SelectionTypes;
|
|
140
153
|
/**
|
|
141
|
-
*
|
|
154
|
+
* Defines the initially selected starting date. This date can be a Date object or a string convertible into a valid date. Useful when you want to show a pre-selected date.
|
|
142
155
|
*/
|
|
143
156
|
startDate?: Date | string | null;
|
|
144
157
|
/**
|
|
145
|
-
*
|
|
158
|
+
* Sets the format or length of the weekday names displayed in the calendar header. You can use numeric values like 2 (two-letter abbreviations) or built-in string formats like `'long'`, `'narrow'`, and `'short'`, or provide a custom function to fully control how weekdays are displayed.
|
|
146
159
|
*
|
|
147
160
|
* @default 2
|
|
148
161
|
*/
|
|
149
162
|
weekdayFormat?: number | 'long' | 'narrow' | 'short' | ((date: Date) => string | number);
|
|
150
163
|
/**
|
|
151
|
-
*
|
|
164
|
+
* Defines the label that appears above the week numbers column. For example, you might label it `'WK'` or `'Week #'`.
|
|
152
165
|
*
|
|
153
166
|
* @since 5.0.0
|
|
154
167
|
*/
|
|
155
168
|
weekNumbersLabel?: string;
|
|
156
169
|
/**
|
|
157
|
-
* Callback fired when the calendar date
|
|
170
|
+
* Callback fired when the calendar's reference date (i.e., the date indicating which month/year is currently displayed) changes. Receives the new `Date | string` as an argument for further handling.
|
|
158
171
|
*/
|
|
159
172
|
onCalendarDateChange?: (date: Date | string) => void;
|
|
160
173
|
/**
|
|
161
|
-
* Callback fired when the user hovers over
|
|
174
|
+
* Callback fired when the user hovers over a calendar cell. The argument is the date of the cell that the user is currently hovering.
|
|
162
175
|
*/
|
|
163
176
|
onDateHover?: (date: Date | string | null) => void;
|
|
164
177
|
/**
|
|
165
|
-
* Callback
|
|
178
|
+
* Callback triggered when the start date of the selection changes. Useful for updating other parts of your application or performing side effects based on the newly chosen start date.
|
|
166
179
|
*/
|
|
167
180
|
onStartDateChange?: (date: Date | string | null, formatedDate?: string | undefined) => void;
|
|
168
181
|
/**
|
|
169
|
-
* Callback
|
|
182
|
+
* Callback triggered when the end date of the selection changes. Handy for synchronizing the selected date range with external states or components.
|
|
170
183
|
*/
|
|
171
184
|
onEndDateChange?: (date: Date | string | null, formatedDate?: string | undefined) => void;
|
|
172
185
|
/**
|
|
173
|
-
* Callback fired when the selection
|
|
186
|
+
* Callback fired when toggling between selecting the start date and the end date in range selection mode. Receives a boolean indicating if the user is currently selecting the end date.
|
|
174
187
|
*/
|
|
175
188
|
onSelectEndChange?: (value: boolean) => void;
|
|
176
189
|
/**
|
|
177
|
-
* Callback fired when the view
|
|
190
|
+
* Callback fired when the calendar's view changes between days, months, or years. For instance, moving from day view to month view or from month view to year view.
|
|
178
191
|
*/
|
|
179
192
|
onViewChanged?: (view: string) => void;
|
|
180
193
|
}
|