@coreui/react-pro 4.1.3 → 4.2.0-beta.1
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/calendar/CCalendar.d.ts +106 -0
- package/dist/components/calendar/CCalendar.utils.d.ts +21 -0
- package/dist/components/datepicker/CDatePicker.d.ts +13 -0
- package/dist/components/daterangepicker/CDateRangePicker.d.ts +65 -0
- package/dist/components/dropdown/CDropdown.d.ts +10 -1
- package/dist/components/dropdown/CDropdownToggle.d.ts +4 -0
- package/dist/components/dropdown/CDropdownToggleCustom.d.ts +15 -0
- package/dist/components/picker/CPicker.d.ts +78 -0
- package/dist/components/smart-table/CSmartTableInterface.d.ts +0 -9
- package/dist/components/timepicker/CTimePicker.d.ts +45 -0
- package/dist/components/timepicker/CTimePicker.utils.d.ts +17 -0
- package/dist/components/timepicker/CTimePickerRollCol.d.ts +11 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.es.js +2568 -718
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2849 -995
- package/dist/index.js.map +1 -1
- package/dist/utils/calendar.d.ts +21 -0
- package/dist/utils/time.d.ts +17 -0
- package/package.json +11 -8
- package/src/components/accordion/CAccordionButton.tsx +2 -1
- 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/calendar/CCalendar.tsx +528 -0
- 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/datepicker/CDatePicker.tsx +50 -0
- package/src/components/datepicker/__tests__/CDatePicker.spec.tsx +9 -0
- package/src/components/datepicker/__tests__/__snapshots__/CDatePicker.spec.tsx.snap +617 -0
- package/src/components/daterangepicker/CDateRangePicker.tsx +427 -0
- package/src/components/daterangepicker/__tests__/CDateRangePicker.spec.tsx +9 -0
- package/src/components/daterangepicker/__tests__/__snapshots__/CDateRangePicker.spec.tsx.snap +1201 -0
- package/src/components/dropdown/CDropdown.tsx +19 -24
- package/src/components/dropdown/CDropdownMenu.tsx +57 -3
- package/src/components/dropdown/CDropdownToggle.tsx +28 -5
- package/src/components/picker/CPicker.tsx +207 -0
- 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/smart-table/CSmartTable.tsx +44 -96
- package/src/components/smart-table/CSmartTableCleaner.tsx +3 -16
- package/src/components/smart-table/CSmartTableInterface.tsx +0 -9
- package/src/components/timepicker/CTimePicker.tsx +320 -0
- package/src/components/timepicker/CTimePickerRollCol.tsx +63 -0
- package/src/components/timepicker/__tests__/CTimePicker.spec.tsx +9 -0
- package/src/index.ts +8 -0
- package/src/utils/calendar.ts +193 -0
- package/src/utils/time.ts +58 -0
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.1.
|
|
46
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.2.0-beta.1.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,106 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export interface CCalendarProps {
|
|
3
|
+
/**
|
|
4
|
+
* Default date of the component
|
|
5
|
+
*/
|
|
6
|
+
calendarDate?: Date | string;
|
|
7
|
+
/**
|
|
8
|
+
* A string of all className you want applied to the component.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Specify the list of dates that cannot be selected.
|
|
13
|
+
*/
|
|
14
|
+
disabledDates?: Date[] | Date[][];
|
|
15
|
+
/**
|
|
16
|
+
* Initial selected to date (range).
|
|
17
|
+
*/
|
|
18
|
+
endDate?: Date | string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the day of start week.
|
|
21
|
+
* - 0 - Sunday,
|
|
22
|
+
* - 1 - Monday,
|
|
23
|
+
* - 2 - Tuesday,
|
|
24
|
+
* - 3 - Wednesday,
|
|
25
|
+
* - 4 - Thursday,
|
|
26
|
+
* - 5 - Friday,
|
|
27
|
+
* - 6 - Saturday,
|
|
28
|
+
* - 7 - Sunday
|
|
29
|
+
*
|
|
30
|
+
* @default 1
|
|
31
|
+
*/
|
|
32
|
+
firstDayOfWeek?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the default locale for components. If not set, it is inherited from the browser.
|
|
35
|
+
*
|
|
36
|
+
* @default 'default'
|
|
37
|
+
*/
|
|
38
|
+
locale?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Max selectable date.
|
|
41
|
+
*/
|
|
42
|
+
maxDate?: Date | string;
|
|
43
|
+
/**
|
|
44
|
+
* Min selectable date.
|
|
45
|
+
*/
|
|
46
|
+
minDate?: Date | string;
|
|
47
|
+
/**
|
|
48
|
+
* Show arrows navigation.
|
|
49
|
+
*/
|
|
50
|
+
navigation?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The custom next icon.
|
|
53
|
+
*/
|
|
54
|
+
navNextIcon?: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* The custom next double icon.
|
|
57
|
+
*/
|
|
58
|
+
navNextDoubleIcon?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* The custom prev icon.
|
|
61
|
+
*/
|
|
62
|
+
navPrevIcon?: ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* The custom prev double icon.
|
|
65
|
+
*/
|
|
66
|
+
navPrevDoubleIcon?: ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* Allow range selection.
|
|
69
|
+
*/
|
|
70
|
+
range?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Toggle select mode between start and end date.
|
|
73
|
+
*/
|
|
74
|
+
selectEndDate?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Initial selected date.
|
|
77
|
+
*/
|
|
78
|
+
startDate?: Date | string | null;
|
|
79
|
+
/**
|
|
80
|
+
* Set length or format of day name.
|
|
81
|
+
*
|
|
82
|
+
* @default 2
|
|
83
|
+
*/
|
|
84
|
+
weekdayFormat?: number | 'long' | 'narrow' | 'short';
|
|
85
|
+
/**
|
|
86
|
+
* Callback fired when the user hovers over the calendar cell.
|
|
87
|
+
*/
|
|
88
|
+
onCalendarCellHover?: (date: Date | null) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Callback fired when the calendar date changed.
|
|
91
|
+
*/
|
|
92
|
+
onCalendarDateChange?: (date: Date) => void;
|
|
93
|
+
/**
|
|
94
|
+
* Callback fired when the start date changed.
|
|
95
|
+
*/
|
|
96
|
+
onStartDateChange?: (date: Date | null) => void;
|
|
97
|
+
/**
|
|
98
|
+
* Callback fired when the end date changed.
|
|
99
|
+
*/
|
|
100
|
+
onEndDateChange?: (date: Date | null) => void;
|
|
101
|
+
/**
|
|
102
|
+
* Callback fired when the view type of calendar changed.
|
|
103
|
+
*/
|
|
104
|
+
onViewChanged?: (view: string) => void;
|
|
105
|
+
}
|
|
106
|
+
export declare const CCalendar: React.ForwardRefExoticComponent<CCalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const convertToLocalDate: (d: Date, locale: string, options?: {}) => string;
|
|
2
|
+
export declare const convertToLocalTime: (d: Date, locale: string, options?: {}) => string;
|
|
3
|
+
export declare const createGroupsInArray: (arr: any[], numberOfGroups: number) => any[][];
|
|
4
|
+
export declare const getCurrentYear: () => number;
|
|
5
|
+
export declare const getCurrentMonth: () => number;
|
|
6
|
+
export declare const getMonthName: (month: number, locale: string) => string;
|
|
7
|
+
export declare const getMonthsNames: (locale: string) => string[];
|
|
8
|
+
export declare const getYears: (year: number) => number[];
|
|
9
|
+
export declare const getMonthDetails: (year: number, month: number, firstDayOfWeek: number) => {
|
|
10
|
+
date: Date;
|
|
11
|
+
month: string;
|
|
12
|
+
}[][];
|
|
13
|
+
export declare const isDisabled: (date: Date, min?: Date | null | undefined, max?: Date | null | undefined, dates?: Date[] | Date[][] | undefined) => boolean | undefined;
|
|
14
|
+
export declare const isDateInRange: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
15
|
+
export declare const isDateSelected: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
16
|
+
export declare const isEndDate: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
17
|
+
export declare const isLastDayOfMonth: (date: Date) => boolean;
|
|
18
|
+
export declare const isSameDateAs: (date: Date, date2: Date) => boolean;
|
|
19
|
+
export declare const isStartDate: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
20
|
+
export declare const isToday: (date: Date) => boolean;
|
|
21
|
+
export declare const isValidDate: (date: string) => number | false;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CDateRangePickerProps } from '../daterangepicker/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) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const CDatePicker: React.ForwardRefExoticComponent<CDatePickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
* Toggle visibility or set the content of the input indicator.
|
|
20
|
+
*/
|
|
21
|
+
indicator?: ReactNode | boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Toggle the readonly state for the component.
|
|
24
|
+
*/
|
|
25
|
+
inputReadOnly?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Specifies short hints that are visible in start date and end date inputs.
|
|
28
|
+
*/
|
|
29
|
+
placeholder?: string | string[];
|
|
30
|
+
/**
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
range?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Predefined date ranges the user can select from.
|
|
36
|
+
*/
|
|
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;
|
|
56
|
+
/**
|
|
57
|
+
* Size the component small or large.
|
|
58
|
+
*/
|
|
59
|
+
size?: 'sm' | 'lg';
|
|
60
|
+
/**
|
|
61
|
+
* Provide an additional time selection by adding select boxes to choose times.
|
|
62
|
+
*/
|
|
63
|
+
timepicker?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare const CDateRangePicker: React.ForwardRefExoticComponent<CDateRangePickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ElementType, HTMLAttributes } from 'react';
|
|
1
|
+
import React, { ElementType, HTMLAttributes, RefObject } from 'react';
|
|
2
2
|
import { Placements } from '../Types';
|
|
3
3
|
export declare type Directions = 'start' | 'end';
|
|
4
4
|
export declare type Breakpoints = {
|
|
@@ -22,6 +22,14 @@ export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIEl
|
|
|
22
22
|
* @type 'start' | 'end' | { xs: 'start' | 'end' } | { sm: 'start' | 'end' } | { md: 'start' | 'end' } | { lg: 'start' | 'end' } | { xl: 'start' | 'end'} | { xxl: 'start' | 'end'}
|
|
23
23
|
*/
|
|
24
24
|
alignment?: Alignments;
|
|
25
|
+
/**
|
|
26
|
+
* Configure the auto close behavior of the dropdown:
|
|
27
|
+
* - `true` - the dropdown will be closed by clicking outside or inside the dropdown menu.
|
|
28
|
+
* - `false` - the dropdown will be closed by clicking the toggle button and manually calling hide or toggle method. (Also will not be closed by pressing esc key)
|
|
29
|
+
* - `'inside'` - the dropdown will be closed (only) by clicking inside the dropdown menu.
|
|
30
|
+
* - `'outside'` - the dropdown will be closed (only) by clicking outside the dropdown menu.
|
|
31
|
+
*/
|
|
32
|
+
autoClose?: 'inside' | 'outside' | boolean;
|
|
25
33
|
/**
|
|
26
34
|
* A string of all className you want applied to the base component.
|
|
27
35
|
*/
|
|
@@ -68,6 +76,7 @@ export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIEl
|
|
|
68
76
|
visible?: boolean;
|
|
69
77
|
}
|
|
70
78
|
interface ContextProps extends CDropdownProps {
|
|
79
|
+
dropdownToggleRef: RefObject<any> | undefined;
|
|
71
80
|
setVisible: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
72
81
|
}
|
|
73
82
|
export declare const CDropdownContext: React.Context<ContextProps>;
|
|
@@ -6,6 +6,10 @@ export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
|
|
|
6
6
|
* Enables pseudo element caret on toggler.
|
|
7
7
|
*/
|
|
8
8
|
caret?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Create a custom toggler which accepts any content.
|
|
11
|
+
*/
|
|
12
|
+
custom?: boolean;
|
|
9
13
|
/**
|
|
10
14
|
* Similarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of `.dropdown-toggle-split` className for proper spacing around the dropdown caret.
|
|
11
15
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { Triggers } from '../Types';
|
|
3
|
+
export interface CDropdownToggleCustomProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Toggle the disabled state for the component.
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Sets which event handlers you’d like provided to your toggle prop. You can specify one trigger or an array of them.
|
|
10
|
+
*
|
|
11
|
+
* @type 'hover' | 'focus' | 'click'
|
|
12
|
+
*/
|
|
13
|
+
trigger?: Triggers | Triggers[];
|
|
14
|
+
}
|
|
15
|
+
export declare const CDropdownToggleCustom: FC<CDropdownToggleCustomProps>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { CDropdownProps } from '../dropdown/CDropdown';
|
|
3
|
+
import { Colors } from '../Types';
|
|
4
|
+
export interface CPickerProps extends Omit<CDropdownProps, 'variant'> {
|
|
5
|
+
/**
|
|
6
|
+
* Toggle visibility or set the content of cancel button.
|
|
7
|
+
*
|
|
8
|
+
* @default 'Cancel'
|
|
9
|
+
*/
|
|
10
|
+
cancelButton?: boolean | ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the color context of the cancel button to one of CoreUI’s themed colors.
|
|
13
|
+
*
|
|
14
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
15
|
+
* @default 'primary'
|
|
16
|
+
*/
|
|
17
|
+
cancelButtonColor?: Colors;
|
|
18
|
+
/**
|
|
19
|
+
* Size the cancel button small or large.
|
|
20
|
+
*
|
|
21
|
+
* @default 'sm'
|
|
22
|
+
*/
|
|
23
|
+
cancelButtonSize?: 'sm' | 'lg';
|
|
24
|
+
/**
|
|
25
|
+
* Set the cancel button variant to an outlined button or a ghost button.
|
|
26
|
+
*
|
|
27
|
+
* @default 'ghost'
|
|
28
|
+
*/
|
|
29
|
+
cancelButtonVariant?: 'outline' | 'ghost';
|
|
30
|
+
/**
|
|
31
|
+
* Toggle visibility or set the content of confirm button.
|
|
32
|
+
*
|
|
33
|
+
* @default 'OK'
|
|
34
|
+
*/
|
|
35
|
+
confirmButton?: boolean | ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Sets the color context of the confirm button to one of CoreUI’s themed colors.
|
|
38
|
+
*
|
|
39
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
40
|
+
* @default 'primary'
|
|
41
|
+
*/
|
|
42
|
+
confirmButtonColor?: Colors;
|
|
43
|
+
/**
|
|
44
|
+
* Size the confirm button small or large.
|
|
45
|
+
*
|
|
46
|
+
* @default 'sm'
|
|
47
|
+
*/
|
|
48
|
+
confirmButtonSize?: 'sm' | 'lg';
|
|
49
|
+
/**
|
|
50
|
+
* Set the confirm button variant to an outlined button or a ghost button.
|
|
51
|
+
*/
|
|
52
|
+
confirmButtonVariant?: 'outline' | 'ghost';
|
|
53
|
+
/**
|
|
54
|
+
* Set container type for the component.
|
|
55
|
+
*/
|
|
56
|
+
container?: 'dropdown' | 'inline';
|
|
57
|
+
/**
|
|
58
|
+
* Toggle the disabled state for the component.
|
|
59
|
+
*/
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Toggle visibility of footer element or set the content of footer.
|
|
63
|
+
*/
|
|
64
|
+
footer?: boolean | ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* Callback fired when the cancel button has been clicked.
|
|
67
|
+
*/
|
|
68
|
+
onCancel?: () => void;
|
|
69
|
+
/**
|
|
70
|
+
* Callback fired when the confirm button has been clicked.
|
|
71
|
+
*/
|
|
72
|
+
onConfirm?: () => void;
|
|
73
|
+
/**
|
|
74
|
+
* The content of toggler.
|
|
75
|
+
*/
|
|
76
|
+
toggler?: ReactNode;
|
|
77
|
+
}
|
|
78
|
+
export declare const CPicker: React.ForwardRefExoticComponent<CPickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
@@ -49,8 +49,6 @@ export interface SorterValue {
|
|
|
49
49
|
export interface TableFilter {
|
|
50
50
|
lazy?: boolean;
|
|
51
51
|
external?: boolean;
|
|
52
|
-
label?: string;
|
|
53
|
-
placeholder?: string;
|
|
54
52
|
}
|
|
55
53
|
export interface NoItemsView {
|
|
56
54
|
noResults?: string;
|
|
@@ -63,14 +61,9 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
63
61
|
* @default 1
|
|
64
62
|
*/
|
|
65
63
|
activePage?: number;
|
|
66
|
-
/**
|
|
67
|
-
* A string of all className you want applied to the base component.
|
|
68
|
-
*/
|
|
69
|
-
className?: string;
|
|
70
64
|
/**
|
|
71
65
|
* When set, displays table cleaner above table, next to the table filter (or in place of table filter if `tableFilter` prop is not set)
|
|
72
66
|
* Cleaner resets `tableFilterValue`, `columnFilterValue`, `sorterValue`. If clean is possible it is clickable (`tabIndex="0"` `role="button"`, `color="danger"`), otherwise it is not clickable and transparent. Cleaner can be customized through the `cleaner` slot.
|
|
73
|
-
*
|
|
74
67
|
*/
|
|
75
68
|
cleaner?: boolean;
|
|
76
69
|
/**
|
|
@@ -264,8 +257,6 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
264
257
|
* When set, displays table filter above table, allowing filtering by specific column.
|
|
265
258
|
*
|
|
266
259
|
* Column filter can be customized, by passing prop as object with additional options as keys. Available options:
|
|
267
|
-
* - placeholder (String) - Sets custom table filter placeholder.
|
|
268
|
-
* - label (String) - Sets custom table filter label.
|
|
269
260
|
* - external (Boolean) - Disables automatic filtering inside component.
|
|
270
261
|
* - lazy (Boolean) - Set to true to trigger filter updates only on change event.
|
|
271
262
|
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { CPickerProps } from './../picker/CPicker';
|
|
3
|
+
export interface CTimePickerProps extends Omit<CPickerProps, 'autoClose' | 'component' | 'dark' | 'placeholder' | 'variant' | 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* A string of all className you want applied to the component.
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Toggle visibility or set the content of the cleaner button.
|
|
10
|
+
*/
|
|
11
|
+
cleaner?: ReactNode | boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Toggle visibility or set the content of the input indicator.
|
|
14
|
+
*/
|
|
15
|
+
indicator?: ReactNode | boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Toggle the readonly state for the component.
|
|
18
|
+
*/
|
|
19
|
+
inputReadOnly?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Sets the default locale for components. If not set, it is inherited from the browser.
|
|
22
|
+
*/
|
|
23
|
+
locale?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Callback fired when the time changed.
|
|
26
|
+
*/
|
|
27
|
+
onTimeChange?: (timeString: string, localeTimeString: string, date: Date) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Specifies a short hint that is visible in the input.
|
|
30
|
+
*/
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Size the component small or large.
|
|
34
|
+
*/
|
|
35
|
+
size?: 'sm' | 'lg';
|
|
36
|
+
/**
|
|
37
|
+
* Initial selected time.
|
|
38
|
+
*/
|
|
39
|
+
time?: Date | string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Set the time picker variant to a roll or select.
|
|
42
|
+
*/
|
|
43
|
+
variant?: 'roll' | 'select';
|
|
44
|
+
}
|
|
45
|
+
export declare const CTimePicker: React.ForwardRefExoticComponent<CTimePickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const convert12hTo24h: (abbr: 'am' | 'pm', hour: number) => number;
|
|
2
|
+
export declare const convert24hTo12h: (hour: number) => number;
|
|
3
|
+
export declare const convertTimeToDate: (time: Date | string | null | undefined) => Date | null;
|
|
4
|
+
export declare const getAmPm: (date: Date, locale: string) => "am" | "pm";
|
|
5
|
+
export declare const getListOfHours: (locale: string) => {
|
|
6
|
+
value: number;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const getMinutesOrSeconds: (locale: string) => {
|
|
10
|
+
value: number;
|
|
11
|
+
label: string;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const getSelectedHour: (date: Date | null, locale: string) => number;
|
|
14
|
+
export declare const getSelectedMinutes: (date: Date | null) => number;
|
|
15
|
+
export declare const getSelectedSeconds: (date: Date | null) => number;
|
|
16
|
+
export declare const isAmPm: (locale: string) => boolean;
|
|
17
|
+
export declare const isValidTime: (time: string) => number | false;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface Element {
|
|
3
|
+
value: number | string;
|
|
4
|
+
label: number | string;
|
|
5
|
+
}
|
|
6
|
+
export interface CTimePickerRollColProps {
|
|
7
|
+
elements: Element[];
|
|
8
|
+
onClick?: (value: number | string) => void;
|
|
9
|
+
selected?: number | string | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const CTimePickerRollCol: React.ForwardRefExoticComponent<CTimePickerRollColProps & React.RefAttributes<HTMLDivElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { CBreadcrumbItem } from './components/breadcrumb/CBreadcrumbItem';
|
|
|
15
15
|
import { CButton } from './components/button/CButton';
|
|
16
16
|
import { CButtonGroup } from './components/button-group/CButtonGroup';
|
|
17
17
|
import { CButtonToolbar } from './components/button-group/CButtonToolbar';
|
|
18
|
+
import { CCalendar } from './components/calendar/CCalendar';
|
|
18
19
|
import { CCallout } from './components/callout/CCallout';
|
|
19
20
|
import { CCard } from './components/card/CCard';
|
|
20
21
|
import { CCardBody } from './components/card/CCardBody';
|
|
@@ -32,6 +33,8 @@ import { CCarouselCaption } from './components/carousel/CCarouselCaption';
|
|
|
32
33
|
import { CCarouselItem } from './components/carousel/CCarouselItem';
|
|
33
34
|
import { CCollapse } from './components/collapse/CCollapse';
|
|
34
35
|
import { CCloseButton } from './components/close-button/CCloseButton';
|
|
36
|
+
import { CDatePicker } from './components/datepicker/CDatePicker';
|
|
37
|
+
import { CDateRangePicker } from './components/daterangepicker/CDateRangePicker';
|
|
35
38
|
import { CDropdown } from './components/dropdown/CDropdown';
|
|
36
39
|
import { CDropdownDivider } from './components/dropdown/CDropdownDivider';
|
|
37
40
|
import { CDropdownHeader } from './components/dropdown/CDropdownHeader';
|
|
@@ -115,11 +118,12 @@ import { CTableHeaderCell } from './components/table/CTableHeaderCell';
|
|
|
115
118
|
import { CTableRow } from './components/table/CTableRow';
|
|
116
119
|
import { CTabContent } from './components/tabs/CTabContent';
|
|
117
120
|
import { CTabPane } from './components/tabs/CTabPane';
|
|
121
|
+
import { CTimePicker } from './components/timepicker/CTimePicker';
|
|
118
122
|
import { CToast } from './components/toast/CToast';
|
|
119
123
|
import { CToastBody } from './components/toast/CToastBody';
|
|
120
124
|
import { CToastClose } from './components/toast/CToastClose';
|
|
121
125
|
import { CToastHeader } from './components/toast/CToastHeader';
|
|
122
126
|
import { CToaster } from './components/toast/CToaster';
|
|
123
127
|
import { CTooltip } from './components/tooltip/CTooltip';
|
|
124
|
-
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionCollapse, CAccordionHeader, CAccordionItem, CAlert, CAlertHeading, CAlertLink, CAvatar, CBadge, CBackdrop, CBreadcrumb, CBreadcrumbItem, CButton, CButtonGroup, CButtonToolbar, CCallout, CCard, CCardBody, CCardFooter, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCloseButton, CCollapse, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, CCol, CContainer, CRow, CFooter, CCardGroup, CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CImage, CInputGroup, CInputGroupText, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler, CLink, CListGroup, CListGroupItem, CLoadingButton, CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle, CMultiSelect, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler, CPagination, CPaginationItem, CPlaceholder, CPopover, CProgress, CProgressBar, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle, CSmartPagination, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarToggler, CSidebarHeader, CSidebarNav, CSmartTable, CSpinner, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTableRow, CTabContent, CTabPane, CToast, CToastBody, CToastClose, CToastHeader, CToaster, CTooltip, };
|
|
128
|
+
export { CAccordion, CAccordionBody, CAccordionButton, CAccordionCollapse, CAccordionHeader, CAccordionItem, CAlert, CAlertHeading, CAlertLink, CAvatar, CBadge, CBackdrop, CBreadcrumb, CBreadcrumbItem, CButton, CButtonGroup, CButtonToolbar, CCalendar, CCallout, CCard, CCardBody, CCardFooter, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCloseButton, CCollapse, CDatePicker, CDateRangePicker, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, CCol, CContainer, CRow, CFooter, CCardGroup, CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CImage, CInputGroup, CInputGroupText, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler, CLink, CListGroup, CListGroupItem, CLoadingButton, CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle, CMultiSelect, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler, CPagination, CPaginationItem, CPlaceholder, CPopover, CProgress, CProgressBar, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle, CSmartPagination, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarToggler, CSidebarHeader, CSidebarNav, CSmartTable, CSpinner, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTableRow, CTabContent, CTabPane, CTimePicker, CToast, CToastBody, CToastClose, CToastHeader, CToaster, CTooltip, };
|
|
125
129
|
export * from './components/';
|