@coreui/react-pro 4.2.0-beta.0 → 4.2.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/components/accordion/index.d.ts +7 -0
- package/dist/components/alert/index.d.ts +4 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/backdrop/index.d.ts +2 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button-group/index.d.ts +3 -0
- package/dist/components/calendar/CCalendar.d.ts +36 -12
- package/dist/components/callout/index.d.ts +2 -0
- package/dist/components/card/index.d.ts +12 -0
- package/dist/components/carousel/index.d.ts +4 -0
- package/dist/components/close-button/index.d.ts +2 -0
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/date-picker/CDatePicker.d.ts +13 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-range-picker/CDateRangePicker.d.ts +93 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/datepicker/index.d.ts +2 -0
- package/dist/components/daterangepicker/CDateRangePicker.d.ts +26 -11
- package/dist/components/daterangepicker/index.d.ts +2 -0
- package/dist/components/dropdown/index.d.ts +8 -0
- package/dist/components/footer/index.d.ts +2 -0
- package/dist/components/form/CForm.d.ts +2 -2
- package/dist/components/form/CFormCheck.d.ts +2 -1
- package/dist/components/form/CFormControlValidation.d.ts +46 -0
- package/dist/components/form/CFormControlWrapper.d.ts +31 -0
- package/dist/components/form/CFormInput.d.ts +6 -9
- package/dist/components/form/CFormRange.d.ts +7 -1
- package/dist/components/form/CFormSelect.d.ts +3 -10
- package/dist/components/form/CFormTextarea.d.ts +2 -9
- package/dist/components/form/index.d.ts +14 -0
- package/dist/components/grid/index.d.ts +4 -0
- package/dist/components/header/index.d.ts +7 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/index.d.ts +41 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/list-group/index.d.ts +3 -0
- package/dist/components/loading-button/index.d.ts +2 -0
- package/dist/components/modal/CModal.d.ts +3 -0
- package/dist/components/modal/index.d.ts +8 -0
- package/dist/components/multi-select/index.d.ts +2 -0
- package/dist/components/nav/index.d.ts +7 -0
- package/dist/components/navbar/index.d.ts +6 -0
- package/dist/components/offcanvas/index.d.ts +5 -0
- package/dist/components/pagination/index.d.ts +4 -0
- package/dist/components/picker/CPicker.d.ts +52 -7
- package/dist/components/placeholder/index.d.ts +2 -0
- package/dist/components/popover/CPopover.d.ts +2 -2
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/sidebar/index.d.ts +7 -0
- package/dist/components/smart-table/index.d.ts +2 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/table/index.d.ts +9 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/time-picker/CTimePicker.d.ts +45 -0
- package/dist/components/time-picker/CTimePickerRollCol.d.ts +11 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/timepicker/CTimePicker.d.ts +9 -13
- package/dist/components/timepicker/index.d.ts +2 -0
- package/dist/components/toast/index.d.ts +6 -0
- package/dist/components/tooltip/CTooltip.d.ts +6 -2
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/index.d.ts +0 -128
- package/dist/index.es.js +8368 -5764
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +8367 -5764
- package/dist/index.js.map +1 -1
- package/dist/{components/calendar/CCalendar.utils.d.ts → utils/calendar.d.ts} +5 -2
- package/dist/utils/hooks/useStateWithCallback.d.ts +2 -1
- package/dist/utils/time.d.ts +21 -0
- package/package.json +14 -11
- package/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap +2 -0
- package/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap +2 -0
- package/src/components/accordion/index.ts +15 -0
- package/src/components/alert/CAlert.tsx +14 -3
- package/src/components/alert/index.ts +5 -0
- package/src/components/avatar/index.ts +3 -0
- package/src/components/backdrop/CBackdrop.tsx +10 -3
- package/src/components/backdrop/index.ts +3 -0
- package/src/components/badge/index.ts +3 -0
- package/src/components/breadcrumb/index.ts +4 -0
- package/src/components/button/index.ts +3 -0
- package/src/components/button-group/index.ts +4 -0
- package/src/components/calendar/CCalendar.tsx +221 -131
- package/src/components/calendar/__tests__/CCalendar.spec.tsx +9 -0
- package/src/components/calendar/__tests__/__snapshots__/CCalendar.spec.tsx.snap +573 -0
- package/src/components/callout/index.ts +3 -0
- package/src/components/card/index.ts +25 -0
- package/src/components/carousel/index.ts +5 -0
- package/src/components/close-button/index.ts +3 -0
- package/src/components/collapse/CCollapse.tsx +1 -0
- package/src/components/collapse/index.ts +3 -0
- package/src/components/{datepicker → date-picker}/CDatePicker.tsx +3 -2
- package/src/components/date-picker/__tests__/CDatePicker.spec.tsx +9 -0
- package/src/components/date-picker/__tests__/__snapshots__/CDatePicker.spec.tsx.snap +617 -0
- package/src/components/date-picker/index.ts +3 -0
- package/src/components/date-range-picker/CDateRangePicker.tsx +495 -0
- package/src/components/date-range-picker/__tests__/CDateRangePicker.spec.tsx +9 -0
- package/src/components/date-range-picker/__tests__/__snapshots__/CDateRangePicker.spec.tsx.snap +1201 -0
- package/src/components/date-range-picker/index.ts +3 -0
- package/src/components/dropdown/CDropdownItem.tsx +1 -1
- package/src/components/dropdown/CDropdownMenu.tsx +14 -14
- package/src/components/dropdown/index.ts +17 -0
- package/src/components/footer/index.ts +3 -0
- package/src/components/form/CForm.tsx +2 -2
- package/src/components/form/CFormCheck.tsx +32 -7
- package/src/components/form/CFormControlValidation.tsx +97 -0
- package/src/components/form/CFormControlWrapper.tsx +85 -0
- package/src/components/form/CFormInput.tsx +75 -19
- package/src/components/form/CFormRange.tsx +18 -4
- package/src/components/form/CFormSelect.tsx +60 -32
- package/src/components/form/CFormTextarea.tsx +45 -17
- package/src/components/form/index.ts +29 -0
- package/src/components/grid/index.ts +5 -0
- package/src/components/header/index.ts +8 -0
- package/src/components/image/index.ts +3 -0
- package/src/components/index.ts +41 -0
- package/src/components/link/index.ts +3 -0
- package/src/components/list-group/index.ts +4 -0
- package/src/components/loading-button/index.ts +3 -0
- package/src/components/modal/CModal.tsx +3 -2
- package/src/components/modal/index.ts +9 -0
- package/src/components/multi-select/CMultiSelect.tsx +46 -38
- package/src/components/multi-select/index.ts +3 -0
- package/src/components/nav/CNavGroup.tsx +1 -0
- package/src/components/nav/index.ts +8 -0
- package/src/components/navbar/index.ts +7 -0
- package/src/components/offcanvas/COffcanvas.tsx +1 -0
- package/src/components/offcanvas/index.ts +6 -0
- package/src/components/pagination/index.ts +5 -0
- package/src/components/picker/CPicker.tsx +104 -32
- package/src/components/picker/__tests__/CPicker.spec.tsx +9 -0
- package/src/components/picker/__tests__/__snapshots__/CPicker.spec.tsx.snap +23 -0
- package/src/components/placeholder/index.ts +3 -0
- package/src/components/popover/CPopover.tsx +59 -57
- package/src/components/popover/index.ts +3 -0
- package/src/components/progress/index.ts +4 -0
- package/src/components/sidebar/index.ts +8 -0
- package/src/components/smart-table/CSmartTable.tsx +2 -2
- package/src/components/smart-table/index.ts +3 -0
- package/src/components/spinner/index.ts +3 -0
- package/src/components/table/index.ts +19 -0
- package/src/components/tabs/CTabPane.tsx +7 -3
- package/src/components/tabs/index.ts +4 -0
- package/src/components/{timepicker → time-picker}/CTimePicker.tsx +71 -98
- package/src/components/{timepicker → time-picker}/CTimePickerRollCol.tsx +7 -1
- package/src/components/time-picker/__tests__/CTimePicker.spec.tsx +9 -0
- package/src/components/time-picker/index.ts +3 -0
- package/src/components/toast/CToast.tsx +6 -1
- package/src/components/toast/index.ts +7 -0
- package/src/components/tooltip/CTooltip.tsx +63 -45
- package/src/components/tooltip/index.ts +3 -0
- package/src/index.ts +0 -258
- package/src/{components/calendar/CCalendar.utils.ts → utils/calendar.ts} +97 -10
- package/src/utils/hooks/useStateWithCallback.ts +6 -3
- package/src/utils/time.ts +84 -0
- package/dist/components/dropdown/CDropdownToggleCustom.d.ts +0 -15
- package/dist/components/timepicker/CTimePicker.utils.d.ts +0 -4
- package/src/components/daterangepicker/CDateRangePicker.tsx +0 -366
- package/src/components/timepicker/CTimePicker.utils.ts +0 -27
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
Several quick start options are available:
|
|
45
45
|
|
|
46
|
-
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.2.0
|
|
46
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.2.0.zip)
|
|
47
47
|
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
|
|
48
48
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
|
|
49
49
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CAccordion } from './CAccordion';
|
|
2
|
+
import { CAccordionBody } from './CAccordionBody';
|
|
3
|
+
import { CAccordionButton } from './CAccordionButton';
|
|
4
|
+
import { CAccordionCollapse } from './CAccordionCollapse';
|
|
5
|
+
import { CAccordionHeader } from './CAccordionHeader';
|
|
6
|
+
import { CAccordionItem } from './CAccordionItem';
|
|
7
|
+
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionCollapse, CAccordionHeader, CAccordionItem, };
|
|
@@ -4,6 +4,10 @@ export interface CCalendarProps {
|
|
|
4
4
|
* Default date of the component
|
|
5
5
|
*/
|
|
6
6
|
calendarDate?: Date | string;
|
|
7
|
+
/**
|
|
8
|
+
* The number of calendars that render on desktop devices.
|
|
9
|
+
*/
|
|
10
|
+
calendars?: number;
|
|
7
11
|
/**
|
|
8
12
|
* A string of all className you want applied to the component.
|
|
9
13
|
*/
|
|
@@ -18,21 +22,31 @@ export interface CCalendarProps {
|
|
|
18
22
|
endDate?: Date | string | null;
|
|
19
23
|
/**
|
|
20
24
|
* Sets the day of start week.
|
|
21
|
-
* 0 - Sunday,
|
|
25
|
+
* - 0 - Sunday,
|
|
26
|
+
* - 1 - Monday,
|
|
27
|
+
* - 2 - Tuesday,
|
|
28
|
+
* - 3 - Wednesday,
|
|
29
|
+
* - 4 - Thursday,
|
|
30
|
+
* - 5 - Friday,
|
|
31
|
+
* - 6 - Saturday,
|
|
32
|
+
*
|
|
33
|
+
* @default 1
|
|
22
34
|
*/
|
|
23
35
|
firstDayOfWeek?: number;
|
|
24
36
|
/**
|
|
25
|
-
* Sets the default locale for components. If not set, it is inherited from the
|
|
37
|
+
* Sets the default locale for components. If not set, it is inherited from the browser.
|
|
38
|
+
*
|
|
39
|
+
* @default 'default'
|
|
26
40
|
*/
|
|
27
41
|
locale?: string;
|
|
28
42
|
/**
|
|
29
43
|
* Max selectable date.
|
|
30
44
|
*/
|
|
31
|
-
maxDate?: Date;
|
|
45
|
+
maxDate?: Date | string | null;
|
|
32
46
|
/**
|
|
33
47
|
* Min selectable date.
|
|
34
48
|
*/
|
|
35
|
-
minDate?: Date;
|
|
49
|
+
minDate?: Date | string | null;
|
|
36
50
|
/**
|
|
37
51
|
* Show arrows navigation.
|
|
38
52
|
*/
|
|
@@ -40,19 +54,19 @@ export interface CCalendarProps {
|
|
|
40
54
|
/**
|
|
41
55
|
* The custom next icon.
|
|
42
56
|
*/
|
|
43
|
-
|
|
57
|
+
navNextIcon?: ReactNode;
|
|
44
58
|
/**
|
|
45
59
|
* The custom next double icon.
|
|
46
60
|
*/
|
|
47
|
-
|
|
61
|
+
navNextDoubleIcon?: ReactNode;
|
|
48
62
|
/**
|
|
49
63
|
* The custom prev icon.
|
|
50
64
|
*/
|
|
51
|
-
|
|
65
|
+
navPrevIcon?: ReactNode;
|
|
52
66
|
/**
|
|
53
67
|
* The custom prev double icon.
|
|
54
68
|
*/
|
|
55
|
-
|
|
69
|
+
navPrevDoubleIcon?: ReactNode;
|
|
56
70
|
/**
|
|
57
71
|
* Allow range selection.
|
|
58
72
|
*/
|
|
@@ -66,9 +80,11 @@ export interface CCalendarProps {
|
|
|
66
80
|
*/
|
|
67
81
|
startDate?: Date | string | null;
|
|
68
82
|
/**
|
|
69
|
-
* Set length of day name.
|
|
83
|
+
* Set length or format of day name.
|
|
84
|
+
*
|
|
85
|
+
* @default 2
|
|
70
86
|
*/
|
|
71
|
-
|
|
87
|
+
weekdayFormat?: number | 'long' | 'narrow' | 'short';
|
|
72
88
|
/**
|
|
73
89
|
* Callback fired when the user hovers over the calendar cell.
|
|
74
90
|
*/
|
|
@@ -80,10 +96,18 @@ export interface CCalendarProps {
|
|
|
80
96
|
/**
|
|
81
97
|
* Callback fired when the start date changed.
|
|
82
98
|
*/
|
|
83
|
-
onStartDateChange?: (date: Date | null) => void;
|
|
99
|
+
onStartDateChange?: (date: Date | null, formatedDate?: string | undefined) => void;
|
|
84
100
|
/**
|
|
85
101
|
* Callback fired when the end date changed.
|
|
86
102
|
*/
|
|
87
|
-
onEndDateChange?: (date: Date | null) => void;
|
|
103
|
+
onEndDateChange?: (date: Date | null, formatedDate?: string | undefined) => void;
|
|
104
|
+
/**
|
|
105
|
+
* Callback fired when the selection type changed.
|
|
106
|
+
*/
|
|
107
|
+
onSelectEndChange?: (value: boolean) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Callback fired when the view type of calendar changed.
|
|
110
|
+
*/
|
|
111
|
+
onViewChanged?: (view: string) => void;
|
|
88
112
|
}
|
|
89
113
|
export declare const CCalendar: React.ForwardRefExoticComponent<CCalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CCard } from './CCard';
|
|
2
|
+
import { CCardBody } from './CCardBody';
|
|
3
|
+
import { CCardFooter } from './CCardFooter';
|
|
4
|
+
import { CCardGroup } from './CCardGroup';
|
|
5
|
+
import { CCardHeader } from './CCardHeader';
|
|
6
|
+
import { CCardImage } from './CCardImage';
|
|
7
|
+
import { CCardImageOverlay } from './CCardImageOverlay';
|
|
8
|
+
import { CCardLink } from './CCardLink';
|
|
9
|
+
import { CCardSubtitle } from './CCardSubtitle';
|
|
10
|
+
import { CCardText } from './CCardText';
|
|
11
|
+
import { CCardTitle } from './CCardTitle';
|
|
12
|
+
export { CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CDateRangePickerProps } from '../date-range-picker/CDateRangePicker';
|
|
3
|
+
export interface CDatePickerProps extends Omit<CDateRangePickerProps, 'calendars' | 'endDate' | 'range' | 'onEndDateChange' | 'onStartDateChange' | 'ranges' | 'selectEndDate' | 'startDate'> {
|
|
4
|
+
/**
|
|
5
|
+
* Initial selected date.
|
|
6
|
+
*/
|
|
7
|
+
date?: Date | string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Callback fired when the date changed.
|
|
10
|
+
*/
|
|
11
|
+
onDateChange?: (date: Date | null, formatedDate?: string | undefined) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const CDatePicker: React.ForwardRefExoticComponent<CDatePickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { CCalendarProps } from '../calendar/CCalendar';
|
|
3
|
+
import { CPickerProps } from '../picker/CPicker';
|
|
4
|
+
import { Colors } from '../Types';
|
|
5
|
+
export interface CDateRangePickerProps extends Omit<CPickerProps, 'autoClose' | 'component' | 'dark' | 'placeholder' | 'variant'>, Omit<CCalendarProps, 'onCalendarCellHover' | 'onCalendarDateChange'> {
|
|
6
|
+
/**
|
|
7
|
+
* The number of calendars that render on desktop devices.
|
|
8
|
+
*/
|
|
9
|
+
calendars?: number;
|
|
10
|
+
/**
|
|
11
|
+
* A string of all className you want applied to the component.
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Toggle visibility or set the content of the cleaner button.
|
|
16
|
+
*/
|
|
17
|
+
cleaner?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Set date format.
|
|
20
|
+
* We use date-fns to format dates. Visit https://date-fns.org/v2.28.0/docs/format to check accepted patterns.
|
|
21
|
+
*/
|
|
22
|
+
format?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Toggle visibility or set the content of the input indicator.
|
|
25
|
+
*/
|
|
26
|
+
indicator?: ReactNode | boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Toggle the readonly state for the component.
|
|
29
|
+
*/
|
|
30
|
+
inputReadOnly?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Specifies short hints that are visible in start date and end date inputs.
|
|
33
|
+
*/
|
|
34
|
+
placeholder?: string | string[];
|
|
35
|
+
/**
|
|
36
|
+
* @ignore
|
|
37
|
+
*/
|
|
38
|
+
range?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Predefined date ranges the user can select from.
|
|
41
|
+
*/
|
|
42
|
+
ranges?: object;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the color context of the cancel button to one of CoreUI’s themed colors.
|
|
45
|
+
*
|
|
46
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
47
|
+
*/
|
|
48
|
+
rangesButtonsColor?: Colors;
|
|
49
|
+
/**
|
|
50
|
+
* Size the ranges button small or large.
|
|
51
|
+
*/
|
|
52
|
+
rangesButtonsSize?: 'sm' | 'lg';
|
|
53
|
+
/**
|
|
54
|
+
* Set the ranges button variant to an outlined button or a ghost button.
|
|
55
|
+
*/
|
|
56
|
+
rangesButtonsVariant?: 'outline' | 'ghost';
|
|
57
|
+
/**
|
|
58
|
+
* Default icon or character character that separates two dates.
|
|
59
|
+
*/
|
|
60
|
+
separator?: ReactNode | boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Size the component small or large.
|
|
63
|
+
*/
|
|
64
|
+
size?: 'sm' | 'lg';
|
|
65
|
+
/**
|
|
66
|
+
* Provide an additional time selection by adding select boxes to choose times.
|
|
67
|
+
*/
|
|
68
|
+
timepicker?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Toggle visibility or set the content of today button.
|
|
71
|
+
*
|
|
72
|
+
* @default 'Today'
|
|
73
|
+
*/
|
|
74
|
+
todayButton?: boolean | ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Sets the color context of the today button to one of CoreUI’s themed colors.
|
|
77
|
+
*
|
|
78
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
79
|
+
* @default 'primary'
|
|
80
|
+
*/
|
|
81
|
+
todayButtonColor?: Colors;
|
|
82
|
+
/**
|
|
83
|
+
* Size the today button small or large.
|
|
84
|
+
*
|
|
85
|
+
* @default 'sm'
|
|
86
|
+
*/
|
|
87
|
+
todayButtonSize?: 'sm' | 'lg';
|
|
88
|
+
/**
|
|
89
|
+
* Set the today button variant to an outlined button or a ghost button.
|
|
90
|
+
*/
|
|
91
|
+
todayButtonVariant?: 'outline' | 'ghost';
|
|
92
|
+
}
|
|
93
|
+
export declare const CDateRangePicker: React.ForwardRefExoticComponent<CDateRangePickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { CCalendarProps } from '../calendar/CCalendar';
|
|
3
|
-
import { CPickerProps } from '
|
|
3
|
+
import { CPickerProps } from '../picker/CPicker';
|
|
4
|
+
import { Colors } from '../Types';
|
|
4
5
|
export interface CDateRangePickerProps extends Omit<CPickerProps, 'autoClose' | 'component' | 'dark' | 'placeholder' | 'variant'>, Omit<CCalendarProps, 'onCalendarCellHover' | 'onCalendarDateChange'> {
|
|
5
6
|
/**
|
|
6
7
|
* The number of calendars that render on desktop devices.
|
|
7
8
|
*/
|
|
8
9
|
calendars?: number;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* A string of all className you want applied to the component.
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Cleaner icon.
|
|
15
|
-
*/
|
|
16
|
-
cleanerIcon?: ReactNode | boolean;
|
|
13
|
+
className?: string;
|
|
17
14
|
/**
|
|
18
|
-
*
|
|
15
|
+
* Toggle visibility or set the content of the cleaner button.
|
|
19
16
|
*/
|
|
20
|
-
|
|
17
|
+
cleaner?: boolean;
|
|
21
18
|
/**
|
|
22
|
-
*
|
|
19
|
+
* Toggle visibility or set the content of the input indicator.
|
|
23
20
|
*/
|
|
24
|
-
|
|
21
|
+
indicator?: ReactNode | boolean;
|
|
25
22
|
/**
|
|
26
23
|
* Toggle the readonly state for the component.
|
|
27
24
|
*/
|
|
@@ -38,6 +35,24 @@ export interface CDateRangePickerProps extends Omit<CPickerProps, 'autoClose' |
|
|
|
38
35
|
* Predefined date ranges the user can select from.
|
|
39
36
|
*/
|
|
40
37
|
ranges?: object;
|
|
38
|
+
/**
|
|
39
|
+
* Sets the color context of the cancel button to one of CoreUI’s themed colors.
|
|
40
|
+
*
|
|
41
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
42
|
+
*/
|
|
43
|
+
rangesButtonsColor?: Colors;
|
|
44
|
+
/**
|
|
45
|
+
* Size the ranges button small or large.
|
|
46
|
+
*/
|
|
47
|
+
rangesButtonsSize?: 'sm' | 'lg';
|
|
48
|
+
/**
|
|
49
|
+
* Set the ranges button variant to an outlined button or a ghost button.
|
|
50
|
+
*/
|
|
51
|
+
rangesButtonsVariant?: 'outline' | 'ghost';
|
|
52
|
+
/**
|
|
53
|
+
* Default icon or character character that separates two dates.
|
|
54
|
+
*/
|
|
55
|
+
separator?: ReactNode | boolean;
|
|
41
56
|
/**
|
|
42
57
|
* Size the component small or large.
|
|
43
58
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CDropdown } from './CDropdown';
|
|
2
|
+
import { CDropdownDivider } from './CDropdownDivider';
|
|
3
|
+
import { CDropdownHeader } from './CDropdownHeader';
|
|
4
|
+
import { CDropdownItem } from './CDropdownItem';
|
|
5
|
+
import { CDropdownItemPlain } from './CDropdownItemPlain';
|
|
6
|
+
import { CDropdownMenu } from './CDropdownMenu';
|
|
7
|
+
import { CDropdownToggle } from './CDropdownToggle';
|
|
8
|
+
export { CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
export interface CFormProps extends
|
|
1
|
+
import React, { FormHTMLAttributes } from 'react';
|
|
2
|
+
export interface CFormProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
3
3
|
/**
|
|
4
4
|
* A string of all className you want applied to the component.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { Colors, Shapes } from '../Types';
|
|
3
|
+
import { CFormControlValidationProps } from './CFormControlValidation';
|
|
3
4
|
export declare type ButtonObject = {
|
|
4
5
|
/**
|
|
5
6
|
* Sets the color context of the component to one of CoreUI’s themed colors.
|
|
@@ -22,7 +23,7 @@ export declare type ButtonObject = {
|
|
|
22
23
|
*/
|
|
23
24
|
variant?: 'outline' | 'ghost';
|
|
24
25
|
};
|
|
25
|
-
export interface CFormCheckProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
26
|
+
export interface CFormCheckProps extends CFormControlValidationProps, InputHTMLAttributes<HTMLInputElement> {
|
|
26
27
|
/**
|
|
27
28
|
* Create button-like checkboxes and radio buttons.
|
|
28
29
|
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export interface CFormControlValidationProps {
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
describedby?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Provide valuable, actionable feedback.
|
|
9
|
+
*
|
|
10
|
+
* @since 4.2.0
|
|
11
|
+
*/
|
|
12
|
+
feedback?: ReactNode | string;
|
|
13
|
+
/**
|
|
14
|
+
* Provide valuable, actionable feedback.
|
|
15
|
+
*
|
|
16
|
+
* @since 4.2.0
|
|
17
|
+
*/
|
|
18
|
+
feedbackInvalid?: ReactNode | string;
|
|
19
|
+
/**
|
|
20
|
+
* Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`.
|
|
21
|
+
*
|
|
22
|
+
* @since 4.2.0
|
|
23
|
+
*/
|
|
24
|
+
feedbackValid?: ReactNode | string;
|
|
25
|
+
/**
|
|
26
|
+
* Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`.
|
|
27
|
+
*
|
|
28
|
+
* @since 4.2.0
|
|
29
|
+
*/
|
|
30
|
+
floatingLabel?: ReactNode | string;
|
|
31
|
+
/**
|
|
32
|
+
* Set component validation state to invalid.
|
|
33
|
+
*/
|
|
34
|
+
invalid?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Display validation feedback in a styled tooltip.
|
|
37
|
+
*
|
|
38
|
+
* @since 4.2.0
|
|
39
|
+
*/
|
|
40
|
+
tooltipFeedback?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Set component validation state to valid.
|
|
43
|
+
*/
|
|
44
|
+
valid?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const CFormControlValidation: FC<CFormControlValidationProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { CFormControlValidationProps } from './CFormControlValidation';
|
|
3
|
+
export interface CFormControlWrapperProps extends CFormControlValidationProps {
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`.
|
|
10
|
+
*
|
|
11
|
+
* @since 4.2.0
|
|
12
|
+
*/
|
|
13
|
+
floatingLabel?: ReactNode | string;
|
|
14
|
+
/**
|
|
15
|
+
* @ignore
|
|
16
|
+
*/
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Add a caption for a component.
|
|
20
|
+
*
|
|
21
|
+
* @since 4.2.0
|
|
22
|
+
*/
|
|
23
|
+
label?: ReactNode | string;
|
|
24
|
+
/**
|
|
25
|
+
* Add helper text to the component.
|
|
26
|
+
*
|
|
27
|
+
* @since 4.2.0
|
|
28
|
+
*/
|
|
29
|
+
text?: ReactNode | string;
|
|
30
|
+
}
|
|
31
|
+
export declare const CFormControlWrapper: FC<CFormControlWrapperProps>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import React, { ChangeEventHandler, InputHTMLAttributes } from 'react';
|
|
2
|
-
|
|
2
|
+
import { CFormControlWrapperProps } from './CFormControlWrapper';
|
|
3
|
+
export interface CFormInputProps extends CFormControlWrapperProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
3
4
|
/**
|
|
4
5
|
* A string of all className you want applied to the component.
|
|
5
6
|
*/
|
|
6
7
|
className?: string;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Delay onChange event while typing. If set to true onChange event will be delayed 500ms, you can also provide the number of milliseconds you want to delay the onChange event.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
delay?: boolean | number;
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
+
* Toggle the disabled state for the component.
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
+
disabled?: boolean;
|
|
15
16
|
/**
|
|
16
17
|
* Method called immediately after the `value` prop changes.
|
|
17
18
|
*/
|
|
@@ -32,10 +33,6 @@ export interface CFormInputProps extends Omit<InputHTMLAttributes<HTMLInputEleme
|
|
|
32
33
|
* Specifies the type of component.
|
|
33
34
|
*/
|
|
34
35
|
type?: 'color' | 'file' | 'text' | string;
|
|
35
|
-
/**
|
|
36
|
-
* Set component validation state to valid.
|
|
37
|
-
*/
|
|
38
|
-
valid?: boolean;
|
|
39
36
|
/**
|
|
40
37
|
* The `value` attribute of component.
|
|
41
38
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ChangeEventHandler, InputHTMLAttributes } from 'react';
|
|
1
|
+
import React, { ChangeEventHandler, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export interface CFormRangeProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
/**
|
|
4
4
|
* A string of all className you want applied to the component.
|
|
@@ -8,6 +8,12 @@ export interface CFormRangeProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
8
8
|
* Toggle the disabled state for the component.
|
|
9
9
|
*/
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Add a caption for a component.
|
|
13
|
+
*
|
|
14
|
+
* @since 4.2.0
|
|
15
|
+
*/
|
|
16
|
+
label?: ReactNode | string;
|
|
11
17
|
/**
|
|
12
18
|
* Specifies the maximum value for the component.
|
|
13
19
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { ChangeEventHandler, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { CFormControlWrapperProps } from './CFormControlWrapper';
|
|
2
3
|
declare type Option = {
|
|
3
4
|
disabled?: boolean;
|
|
4
5
|
label?: string;
|
|
5
6
|
value?: string;
|
|
6
7
|
};
|
|
7
|
-
export interface CFormSelectProps extends Omit<InputHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
8
|
+
export interface CFormSelectProps extends CFormControlWrapperProps, Omit<InputHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
8
9
|
/**
|
|
9
10
|
* A string of all className you want applied to the component.
|
|
10
11
|
*/
|
|
@@ -13,10 +14,6 @@ export interface CFormSelectProps extends Omit<InputHTMLAttributes<HTMLSelectEle
|
|
|
13
14
|
* Specifies the number of visible options in a drop-down list.
|
|
14
15
|
*/
|
|
15
16
|
htmlSize?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Set component validation state to invalid.
|
|
18
|
-
*/
|
|
19
|
-
invalid?: boolean;
|
|
20
17
|
/**
|
|
21
18
|
* Method called immediately after the `value` prop changes.
|
|
22
19
|
*/
|
|
@@ -32,15 +29,11 @@ export interface CFormSelectProps extends Omit<InputHTMLAttributes<HTMLSelectEle
|
|
|
32
29
|
* Size the component small or large.
|
|
33
30
|
*/
|
|
34
31
|
size?: 'sm' | 'lg';
|
|
35
|
-
/**
|
|
36
|
-
* Set component validation state to valid.
|
|
37
|
-
*/
|
|
38
|
-
valid?: boolean;
|
|
39
32
|
/**
|
|
40
33
|
* The `value` attribute of component.
|
|
41
34
|
*
|
|
42
35
|
* @controllable onChange
|
|
43
|
-
|
|
36
|
+
*/
|
|
44
37
|
value?: string | string[] | number;
|
|
45
38
|
}
|
|
46
39
|
export declare const CFormSelect: React.ForwardRefExoticComponent<CFormSelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ChangeEventHandler, InputHTMLAttributes } from 'react';
|
|
2
|
-
|
|
2
|
+
import { CFormControlWrapperProps } from './CFormControlWrapper';
|
|
3
|
+
export interface CFormTextareaProps extends CFormControlWrapperProps, InputHTMLAttributes<HTMLTextAreaElement> {
|
|
3
4
|
/**
|
|
4
5
|
* A string of all className you want applied to the component.
|
|
5
6
|
*/
|
|
@@ -8,10 +9,6 @@ export interface CFormTextareaProps extends InputHTMLAttributes<HTMLTextAreaElem
|
|
|
8
9
|
* Toggle the disabled state for the component.
|
|
9
10
|
*/
|
|
10
11
|
disabled?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Set component validation state to invalid.
|
|
13
|
-
*/
|
|
14
|
-
invalid?: boolean;
|
|
15
12
|
/**
|
|
16
13
|
* Method called immediately after the `value` prop changes.
|
|
17
14
|
*/
|
|
@@ -24,10 +21,6 @@ export interface CFormTextareaProps extends InputHTMLAttributes<HTMLTextAreaElem
|
|
|
24
21
|
* Toggle the readonly state for the component.
|
|
25
22
|
*/
|
|
26
23
|
readOnly?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Set component validation state to valid.
|
|
29
|
-
*/
|
|
30
|
-
valid?: boolean;
|
|
31
24
|
/**
|
|
32
25
|
* The `value` attribute of component.
|
|
33
26
|
*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CForm } from './CForm';
|
|
2
|
+
import { CFormCheck } from './CFormCheck';
|
|
3
|
+
import { CFormFeedback } from './CFormFeedback';
|
|
4
|
+
import { CFormFloating } from './CFormFloating';
|
|
5
|
+
import { CFormInput } from './CFormInput';
|
|
6
|
+
import { CFormLabel } from './CFormLabel';
|
|
7
|
+
import { CFormRange } from './CFormRange';
|
|
8
|
+
import { CFormSelect } from './CFormSelect';
|
|
9
|
+
import { CFormSwitch } from './CFormSwitch';
|
|
10
|
+
import { CFormText } from './CFormText';
|
|
11
|
+
import { CFormTextarea } from './CFormTextarea';
|
|
12
|
+
import { CInputGroup } from './CInputGroup';
|
|
13
|
+
import { CInputGroupText } from './CInputGroupText';
|
|
14
|
+
export { CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CInputGroup, CInputGroupText, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CHeader } from './CHeader';
|
|
2
|
+
import { CHeaderBrand } from './CHeaderBrand';
|
|
3
|
+
import { CHeaderDivider } from './CHeaderDivider';
|
|
4
|
+
import { CHeaderNav } from './CHeaderNav';
|
|
5
|
+
import { CHeaderText } from './CHeaderText';
|
|
6
|
+
import { CHeaderToggler } from './CHeaderToggler';
|
|
7
|
+
export { CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler };
|