@coreui/react-pro 4.13.1 → 5.0.0-alpha.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.
Files changed (55) hide show
  1. package/README.md +1 -1
  2. package/dist/components/calendar/CCalendar.d.ts +25 -7
  3. package/dist/components/calendar/utils.d.ts +12 -3
  4. package/dist/components/close-button/CCloseButton.d.ts +6 -0
  5. package/dist/components/date-range-picker/CDateRangePicker copy.d.ts +114 -0
  6. package/dist/components/multi-select/types.d.ts +2 -2
  7. package/dist/components/multi-select/utils.d.ts +2 -2
  8. package/dist/components/multi-select-new/CMultiSelect.d.ts +133 -0
  9. package/dist/components/multi-select-new/CMultiSelectNativeSelect.d.ts +7 -0
  10. package/dist/components/multi-select-new/CMultiSelectNew.d.ts +121 -0
  11. package/dist/components/multi-select-new/CMultiSelectOptions.d.ts +16 -0
  12. package/dist/components/multi-select-new/CMultiSelectSelection.d.ts +11 -0
  13. package/dist/components/multi-select-new/index.d.ts +2 -0
  14. package/dist/components/multi-select-new/types.d.ts +15 -0
  15. package/dist/components/multi-select-new/utils.d.ts +11 -0
  16. package/dist/components/nav/CNav.d.ts +1 -1
  17. package/dist/components/navbar/CNavbar.d.ts +1 -1
  18. package/dist/components/offcanvas/COffcanvas.d.ts +4 -0
  19. package/dist/components/picker/CPicker copy.d.ts +82 -0
  20. package/dist/components/picker copy/CPicker.d.ts +82 -0
  21. package/dist/components/smart-table/CSmartTableBody.d.ts +2 -1
  22. package/dist/components/smart-table/CSmartTableCleaner.d.ts +7 -0
  23. package/dist/components/smart-table/CSmartTableInterface.d.ts +1 -3
  24. package/dist/components/smart-table/types.d.ts +2 -2
  25. package/dist/components/smart-table/utils.d.ts +3 -1
  26. package/dist/hooks/index.d.ts +2 -1
  27. package/dist/index.es.js +523 -265
  28. package/dist/index.es.js.map +1 -1
  29. package/dist/index.js +523 -264
  30. package/dist/index.js.map +1 -1
  31. package/package.json +12 -12
  32. package/src/components/calendar/CCalendar.tsx +396 -193
  33. package/src/components/calendar/utils.ts +91 -4
  34. package/src/components/carousel/CCarousel.tsx +9 -5
  35. package/src/components/close-button/CCloseButton.tsx +9 -1
  36. package/src/components/date-range-picker/CDateRangePicker.tsx +65 -81
  37. package/src/components/dropdown/CDropdownMenu.tsx +1 -1
  38. package/src/components/multi-select/CMultiSelect.tsx +18 -10
  39. package/src/components/multi-select/CMultiSelectNativeSelect.tsx +1 -1
  40. package/src/components/multi-select/CMultiSelectOptions.tsx +1 -1
  41. package/src/components/multi-select/CMultiSelectSelection.tsx +4 -6
  42. package/src/components/multi-select/types.ts +2 -2
  43. package/src/components/multi-select/utils.ts +5 -5
  44. package/src/components/nav/CNav.tsx +2 -2
  45. package/src/components/navbar/CNavbar.tsx +2 -2
  46. package/src/components/offcanvas/COffcanvas.tsx +7 -0
  47. package/src/components/picker/CPicker.tsx +2 -11
  48. package/src/components/smart-table/CSmartTable.tsx +2 -1
  49. package/src/components/smart-table/CSmartTableBody.tsx +11 -5
  50. package/src/components/smart-table/CSmartTableInterface.tsx +1 -3
  51. package/src/components/smart-table/types.ts +2 -2
  52. package/src/components/smart-table/utils.ts +40 -5
  53. package/src/components/time-picker/CTimePicker.tsx +20 -37
  54. package/src/components/time-picker/utils.ts +5 -1
  55. package/src/hooks/index.ts +2 -1
package/README.md CHANGED
@@ -42,7 +42,7 @@
42
42
 
43
43
  Several quick start options are available:
44
44
 
45
- - [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.13.1.zip)
45
+ - [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v5.0.0-alpha.1.zip)
46
46
  - Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
47
47
  - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
48
48
  - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
@@ -3,7 +3,7 @@ export interface CCalendarProps {
3
3
  /**
4
4
  * Default date of the component
5
5
  */
6
- calendarDate?: Date | string;
6
+ calendarDate?: Date | string | null;
7
7
  /**
8
8
  * The number of calendars that render on desktop devices.
9
9
  */
@@ -80,6 +80,10 @@ export interface CCalendarProps {
80
80
  * @since 4.3.0
81
81
  */
82
82
  navYearFirst?: boolean;
83
+ /**
84
+ * Allow range selection.
85
+ */
86
+ range?: boolean;
83
87
  /**
84
88
  * Set whether days in adjacent months shown before or after the current month are selectable. This only applies if the `showAdjacementDays` option is set to true.
85
89
  *
@@ -93,13 +97,21 @@ export interface CCalendarProps {
93
97
  */
94
98
  showAdjacementDays?: boolean;
95
99
  /**
96
- * Allow range selection.
100
+ * Set whether to display week numbers in the calendar.
101
+ *
102
+ * @since 5.0.0-alpha.1
97
103
  */
98
- range?: boolean;
104
+ showWeekNumber?: boolean;
99
105
  /**
100
106
  * Toggle select mode between start and end date.
101
107
  */
102
108
  selectEndDate?: boolean;
109
+ /**
110
+ * Specify the type of date selection as day, week, month, or year.
111
+ *
112
+ * @since 5.0.0-alpha.1
113
+ */
114
+ selectionType?: 'day' | 'week' | 'month' | 'year';
103
115
  /**
104
116
  * Initial selected date.
105
117
  */
@@ -110,22 +122,28 @@ export interface CCalendarProps {
110
122
  * @default 2
111
123
  */
112
124
  weekdayFormat?: number | 'long' | 'narrow' | 'short' | ((date: Date) => string | number);
125
+ /**
126
+ * Label displayed over week numbers in the calendar.
127
+ *
128
+ * @since 5.0.0-alpha.1
129
+ */
130
+ weekNumbersLabel?: string;
113
131
  /**
114
132
  * Callback fired when the calendar date changed.
115
133
  */
116
- onCalendarDateChange?: (date: Date) => void;
134
+ onCalendarDateChange?: (date: Date | string) => void;
117
135
  /**
118
136
  * Callback fired when the user hovers over the calendar cell.
119
137
  */
120
- onDayHover?: (date: Date | null) => void;
138
+ onDateHover?: (date: Date | string | null) => void;
121
139
  /**
122
140
  * Callback fired when the start date changed.
123
141
  */
124
- onStartDateChange?: (date: Date | null, formatedDate?: string | undefined) => void;
142
+ onStartDateChange?: (date: Date | string | null, formatedDate?: string | undefined) => void;
125
143
  /**
126
144
  * Callback fired when the end date changed.
127
145
  */
128
- onEndDateChange?: (date: Date | null, formatedDate?: string | undefined) => void;
146
+ onEndDateChange?: (date: Date | string | null, formatedDate?: string | undefined) => void;
129
147
  /**
130
148
  * Callback fired when the selection type changed.
131
149
  */
@@ -1,15 +1,24 @@
1
+ export declare const convertIsoWeekToDate: (isoWeek: string) => Date;
2
+ export declare const convertToDateObject: (date: Date | string | null, selectionType?: 'day' | 'week' | 'month' | 'year') => Date;
1
3
  export declare const convertToLocalDate: (d: Date, locale: string, options?: {}) => string;
2
4
  export declare const convertToLocalTime: (d: Date, locale: string, options?: {}) => string;
3
5
  export declare const createGroupsInArray: <T>(arr: T[], numberOfGroups: number) => T[][];
6
+ export declare const getCalendarDate: (calendarDate: Date, order: number, view: 'days' | 'months' | 'years') => Date;
4
7
  export declare const getCurrentYear: () => number;
5
8
  export declare const getCurrentMonth: () => number;
9
+ export declare const getDateBySelectionType: (date: Date | null, selectionType: 'day' | 'week' | 'month' | 'year') => string | Date | null;
6
10
  export declare const getMonthName: (month: number, locale: string) => string;
7
11
  export declare const getMonthsNames: (locale: string) => string[];
8
12
  export declare const getYears: (year: number) => number[];
13
+ export declare const getDayNumber: (date: Date) => number;
14
+ export declare const getWeekNumber: (date: Date) => number;
9
15
  export declare const getMonthDetails: (year: number, month: number, firstDayOfWeek: number) => {
10
- date: Date;
11
- month: string;
12
- }[][];
16
+ weekNumber?: number | undefined;
17
+ days: {
18
+ date: Date;
19
+ month: string;
20
+ }[];
21
+ }[];
13
22
  export declare const isDisableDateInRange: (startDate?: Date | null, endDate?: Date | null, dates?: Date[] | Date[][] | (Date | Date[])[]) => boolean;
14
23
  export declare const isDateDisabled: (date: Date, min?: Date | null, max?: Date | null, dates?: Date[] | Date[][] | (Date | Date[])[]) => boolean | undefined;
15
24
  export declare const isDateInRange: (date: Date, start: Date | null, end: Date | null) => boolean | null;
@@ -4,12 +4,18 @@ export interface CCloseButtonProps extends HTMLAttributes<HTMLButtonElement> {
4
4
  * A string of all className you want applied to the base component.
5
5
  */
6
6
  className?: string;
7
+ /**
8
+ * Invert the default color.
9
+ */
10
+ dark?: boolean;
7
11
  /**
8
12
  * Toggle the disabled state for the component.
9
13
  */
10
14
  disabled?: boolean;
11
15
  /**
12
16
  * Change the default color to white.
17
+ *
18
+ * @deprecated 5.0.0
13
19
  */
14
20
  white?: boolean;
15
21
  }
@@ -0,0 +1,114 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { CCalendarProps } from '../calendar/CCalendar';
3
+ import { CFormControlWrapperProps } from '../form/CFormControlWrapper';
4
+ import { CPickerProps } from '../picker/CPicker';
5
+ import { Colors } from '../../types';
6
+ export interface CDateRangePickerProps extends Omit<CFormControlWrapperProps, 'floatingLabel'>, Omit<CPickerProps, 'autoClose' | 'component' | 'dark' | 'placeholder' | 'variant'>, Omit<CCalendarProps, 'onCalendarCellHover' | 'onCalendarDateChange'> {
7
+ /**
8
+ * The number of calendars that render on desktop devices.
9
+ */
10
+ calendars?: number;
11
+ /**
12
+ * A string of all className you want applied to the component.
13
+ */
14
+ className?: string;
15
+ /**
16
+ * If true the dropdown will be immediately closed after submitting the full date.
17
+ *
18
+ * @since 4.8.0
19
+ */
20
+ closeOnSelect?: boolean;
21
+ /**
22
+ * Toggle visibility or set the content of the cleaner button.
23
+ */
24
+ cleaner?: boolean;
25
+ /**
26
+ * Set date format.
27
+ * We use date-fns to format dates. Visit https://date-fns.org/v2.28.0/docs/format to check accepted patterns.
28
+ */
29
+ format?: string;
30
+ /**
31
+ * The id global attribute defines an identifier (ID) that must be unique in the whole document.
32
+ *
33
+ * The name attributes for input elements are generated based on the `id` property:
34
+ * - \{id\}-start-date
35
+ * - \{id\}-end-date
36
+ */
37
+ id?: string;
38
+ /**
39
+ * Toggle visibility or set the content of the input indicator.
40
+ */
41
+ indicator?: ReactNode | boolean;
42
+ /**
43
+ * Toggle the readonly state for the component.
44
+ */
45
+ inputReadOnly?: boolean;
46
+ /**
47
+ * Specifies short hints that are visible in start date and end date inputs.
48
+ */
49
+ placeholder?: string | string[];
50
+ /**
51
+ * @ignore
52
+ */
53
+ range?: boolean;
54
+ /**
55
+ * Predefined date ranges the user can select from.
56
+ */
57
+ ranges?: object;
58
+ /**
59
+ * Sets the color context of the cancel button to one of CoreUI’s themed colors.
60
+ *
61
+ * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
62
+ */
63
+ rangesButtonsColor?: Colors;
64
+ /**
65
+ * Size the ranges button small or large.
66
+ */
67
+ rangesButtonsSize?: 'sm' | 'lg';
68
+ /**
69
+ * Set the ranges button variant to an outlined button or a ghost button.
70
+ */
71
+ rangesButtonsVariant?: 'outline' | 'ghost';
72
+ /**
73
+ * When present, it specifies that date must be filled out before submitting the form.
74
+ *
75
+ * @since 4.10.0
76
+ */
77
+ required?: boolean;
78
+ /**
79
+ * Default icon or character character that separates two dates.
80
+ */
81
+ separator?: ReactNode | boolean;
82
+ /**
83
+ * Size the component small or large.
84
+ */
85
+ size?: 'sm' | 'lg';
86
+ /**
87
+ * Provide an additional time selection by adding select boxes to choose times.
88
+ */
89
+ timepicker?: boolean;
90
+ /**
91
+ * Toggle visibility or set the content of today button.
92
+ *
93
+ * @default 'Today'
94
+ */
95
+ todayButton?: boolean | ReactNode;
96
+ /**
97
+ * Sets the color context of the today button to one of CoreUI’s themed colors.
98
+ *
99
+ * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
100
+ * @default 'primary'
101
+ */
102
+ todayButtonColor?: Colors;
103
+ /**
104
+ * Size the today button small or large.
105
+ *
106
+ * @default 'sm'
107
+ */
108
+ todayButtonSize?: 'sm' | 'lg';
109
+ /**
110
+ * Set the today button variant to an outlined button or a ghost button.
111
+ */
112
+ todayButtonVariant?: 'outline' | 'ghost';
113
+ }
114
+ export declare const CDateRangePicker: React.ForwardRefExoticComponent<CDateRangePickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
@@ -2,7 +2,7 @@ export type Option = {
2
2
  custom?: boolean;
3
3
  disabled?: boolean;
4
4
  selected?: boolean;
5
- text: string;
5
+ label: string;
6
6
  value: number | string;
7
7
  [key: string]: number | string | any;
8
8
  };
@@ -13,7 +13,7 @@ export type OptionsGroup = {
13
13
  };
14
14
  export type SelectedOption = {
15
15
  disabled?: boolean;
16
- text: string;
16
+ label: string;
17
17
  value: number | string;
18
18
  [key: string]: number | string | any;
19
19
  };
@@ -1,7 +1,7 @@
1
1
  import type { Option, OptionsGroup, SelectedOption } from './types';
2
- export declare const createOption: (text: string, options: (Option | OptionsGroup)[]) => {
2
+ export declare const createOption: (label: string, options: (Option | OptionsGroup)[]) => {
3
3
  value: string;
4
- text: string;
4
+ label: string;
5
5
  custom: boolean;
6
6
  }[];
7
7
  export declare const filterOptionsList: (search: string, _options: (Option | OptionsGroup)[]) => any[];
@@ -0,0 +1,133 @@
1
+ import React, { HTMLAttributes, ReactNode } from 'react';
2
+ import { CFormControlWrapperProps } from '../form/CFormControlWrapper';
3
+ import type { Option } from './types';
4
+ export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'floatingClassName' | 'floatingLabel'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
5
+ /**
6
+ * Allow users to create options if they are not in the list of options.
7
+ *
8
+ * @since 4.11.0-next.0
9
+ */
10
+ allowCreateOptions?: boolean;
11
+ /**
12
+ * A string of all className you want applied to the base component.
13
+ */
14
+ className?: string;
15
+ /**
16
+ * Enables selection cleaner element.
17
+ */
18
+ cleaner?: boolean;
19
+ /**
20
+ * Clear current search on selecting an item.
21
+ *
22
+ * @since 4.11.0-next.0
23
+ */
24
+ clearSearchOnSelect?: boolean;
25
+ /**
26
+ * Toggle the disabled state for the component.
27
+ */
28
+ disabled?: boolean;
29
+ /**
30
+ * The id global attribute defines an identifier (ID) that must be unique in the whole document.
31
+ *
32
+ * The name and id attributes for the native select element are generated based on the `id` property:
33
+ * - <select id="\{id\}-multi-select" name="\{id\}-multi-select" />
34
+ */
35
+ id?: string;
36
+ /**
37
+ * When set, the options list will have a loading style: loading spinner and reduced opacity.
38
+ *
39
+ * @since 4.11.0-next.0
40
+ */
41
+ loading?: boolean;
42
+ /**
43
+ * It specifies that multiple options can be selected at once.
44
+ */
45
+ multiple?: boolean;
46
+ /**
47
+ * Execute a function when a user changes the selected option.
48
+ */
49
+ onChange?: (selected: Option[]) => void;
50
+ /**
51
+ * Execute a function when the filter value changed.
52
+ *
53
+ * @since 4.8.0
54
+ */
55
+ onFilterChange?: (value: string) => void;
56
+ /**
57
+ * List of option elements.
58
+ */
59
+ options: Option[];
60
+ /**
61
+ * Sets maxHeight of options list.
62
+ */
63
+ optionsMaxHeight?: number | string;
64
+ /**
65
+ * Sets option style.
66
+ */
67
+ optionsStyle?: 'checkbox' | 'text';
68
+ /**
69
+ * TODO:
70
+ *
71
+ * @since TODO: 4._.0
72
+ */
73
+ optionsTemplate?: (option: Option) => ReactNode;
74
+ /**
75
+ * TODO:
76
+ *
77
+ * @since TODO: 4._.0
78
+ */
79
+ optionsGroupsTemplate?: (option: Option) => ReactNode;
80
+ /**
81
+ * Specifies a short hint that is visible in the search input.
82
+ */
83
+ placeholder?: string;
84
+ /**
85
+ * @since XXXX
86
+ */
87
+ required?: boolean;
88
+ /**
89
+ * Enables search input element.
90
+ */
91
+ search?: boolean | 'external';
92
+ /**
93
+ * Sets the label for no results when filtering.
94
+ */
95
+ searchNoResultsLabel?: string | ReactNode;
96
+ /**
97
+ * Enables select all button.
98
+ */
99
+ selectAll?: boolean;
100
+ /**
101
+ * Sets the select all button label.
102
+ */
103
+ selectAllLabel?: string | ReactNode;
104
+ /**
105
+ * Sets the selection style.
106
+ */
107
+ selectionType?: 'counter' | 'tags' | 'text';
108
+ /**
109
+ * Sets the counter selection label.
110
+ */
111
+ selectionTypeCounterText?: string;
112
+ /**
113
+ * Size the component small or large.
114
+ */
115
+ size?: 'sm' | 'lg';
116
+ /**
117
+ * Enable virtual scroller for the options list.
118
+ *
119
+ * @since 4.8.0
120
+ */
121
+ virtualScroller?: boolean;
122
+ /**
123
+ * Toggle the visibility of multi select dropdown.
124
+ */
125
+ visible?: boolean;
126
+ /**
127
+ * Amount of visible items when virtualScroller is set to `true`.
128
+ *
129
+ * @since 4.8.0
130
+ */
131
+ visibleItems?: number;
132
+ }
133
+ export declare const CMultiSelectNew: React.ForwardRefExoticComponent<CMultiSelectProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import React, { InputHTMLAttributes } from 'react';
2
+ import type { Option } from './types';
3
+ export interface CMultiSelectNativeSelectProps extends Omit<InputHTMLAttributes<HTMLSelectElement>, 'options'> {
4
+ options?: Option[];
5
+ value?: string | number | string[];
6
+ }
7
+ export declare const CMultiSelectNativeSelect: React.ForwardRefExoticComponent<CMultiSelectNativeSelectProps & React.RefAttributes<HTMLSelectElement>>;
@@ -0,0 +1,121 @@
1
+ import React, { HTMLAttributes, ReactNode } from 'react';
2
+ import { CFormControlWrapperProps } from './../form/CFormControlWrapper';
3
+ import type { Option } from './types';
4
+ export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'floatingClassName' | 'floatingLabel'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
5
+ /**
6
+ * Allow users to create options if they are not in the list of options.
7
+ *
8
+ * @since 4.11.0-next.0
9
+ */
10
+ allowCreateOptions?: boolean;
11
+ /**
12
+ * A string of all className you want applied to the base component.
13
+ */
14
+ className?: string;
15
+ /**
16
+ * Enables selection cleaner element.
17
+ */
18
+ cleaner?: boolean;
19
+ /**
20
+ * Clear current search on selecting an item.
21
+ *
22
+ * @since 4.11.0-next.0
23
+ */
24
+ clearSearchOnSelect?: boolean;
25
+ /**
26
+ * Toggle the disabled state for the component.
27
+ */
28
+ disabled?: boolean;
29
+ /**
30
+ * The id global attribute defines an identifier (ID) that must be unique in the whole document.
31
+ *
32
+ * The name and id attributes for the native select element are generated based on the `id` property:
33
+ * - <select id="\{id\}-multi-select" name="\{id\}-multi-select" />
34
+ */
35
+ id?: string;
36
+ /**
37
+ * When set, the options list will have a loading style: loading spinner and reduced opacity.
38
+ *
39
+ * @since 4.11.0-next.0
40
+ */
41
+ loading?: boolean;
42
+ /**
43
+ * It specifies that multiple options can be selected at once.
44
+ */
45
+ multiple?: boolean;
46
+ /**
47
+ * Execute a function when a user changes the selected option.
48
+ */
49
+ onChange?: (selected: Option[]) => void;
50
+ /**
51
+ * Execute a function when the filter value changed.
52
+ *
53
+ * @since 4.8.0
54
+ */
55
+ onFilterChange?: (value: string) => void;
56
+ /**
57
+ * List of option elements.
58
+ */
59
+ options: Option[];
60
+ /**
61
+ * Sets maxHeight of options list.
62
+ */
63
+ optionsMaxHeight?: number | string;
64
+ /**
65
+ * Sets option style.
66
+ */
67
+ optionsStyle?: 'checkbox' | 'text';
68
+ /**
69
+ * Specifies a short hint that is visible in the search input.
70
+ */
71
+ placeholder?: string;
72
+ /**
73
+ * @since XXXX
74
+ */
75
+ required?: boolean;
76
+ /**
77
+ * Enables search input element.
78
+ */
79
+ search?: boolean | 'external';
80
+ /**
81
+ * Sets the label for no results when filtering.
82
+ */
83
+ searchNoResultsLabel?: string | ReactNode;
84
+ /**
85
+ * Enables select all button.
86
+ */
87
+ selectAll?: boolean;
88
+ /**
89
+ * Sets the select all button label.
90
+ */
91
+ selectAllLabel?: string | ReactNode;
92
+ /**
93
+ * Sets the selection style.
94
+ */
95
+ selectionType?: 'counter' | 'tags' | 'text';
96
+ /**
97
+ * Sets the counter selection label.
98
+ */
99
+ selectionTypeCounterText?: string;
100
+ /**
101
+ * Size the component small or large.
102
+ */
103
+ size?: 'sm' | 'lg';
104
+ /**
105
+ * Enable virtual scroller for the options list.
106
+ *
107
+ * @since 4.8.0
108
+ */
109
+ virtualScroller?: boolean;
110
+ /**
111
+ * Toggle the visibility of multi select dropdown.
112
+ */
113
+ visible?: boolean;
114
+ /**
115
+ * Amount of visible items when virtualScroller is set to `true`.
116
+ *
117
+ * @since 4.8.0
118
+ */
119
+ visibleItems?: number;
120
+ }
121
+ export declare const CMultiSelectNew: React.ForwardRefExoticComponent<CMultiSelectProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ import React, { HTMLAttributes, ReactNode } from 'react';
2
+ import type { Option } from './types';
3
+ export interface CMultiSelectOptionsProps extends HTMLAttributes<HTMLDivElement> {
4
+ handleOptionOnClick?: (option: Option) => void;
5
+ loading?: boolean;
6
+ options: Option[];
7
+ optionsMaxHeight?: number | string;
8
+ optionsStyle?: 'checkbox' | 'text';
9
+ optionsTemplate?: (option: Option) => ReactNode;
10
+ optionsGroupsTemplate?: (option: Option) => ReactNode;
11
+ searchNoResultsLabel?: string | ReactNode;
12
+ selected: Option[];
13
+ virtualScroller?: boolean;
14
+ visibleItems?: number;
15
+ }
16
+ export declare const CMultiSelectOptions: React.ForwardRefExoticComponent<CMultiSelectOptionsProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,11 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import type { SelectedOption } from './types';
3
+ export interface CMultiSelectSelectionProps extends HTMLAttributes<HTMLSpanElement> {
4
+ multiple?: boolean;
5
+ onRemove?: (option: SelectedOption) => void;
6
+ search?: boolean | 'external';
7
+ selected?: SelectedOption[];
8
+ selectionType?: 'counter' | 'tags' | 'text';
9
+ selectionTypeCounterText?: string;
10
+ }
11
+ export declare const CMultiSelectSelection: React.ForwardRefExoticComponent<CMultiSelectSelectionProps & React.RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,2 @@
1
+ import { CMultiSelectNew } from './CMultiSelect';
2
+ export { CMultiSelectNew };
@@ -0,0 +1,15 @@
1
+ export type Option = {
2
+ custom?: boolean;
3
+ disabled?: boolean;
4
+ label?: string;
5
+ options?: Option[];
6
+ selected?: boolean;
7
+ text: string;
8
+ value: number | string;
9
+ [key: string]: number | string | any;
10
+ };
11
+ export type SelectedOption = {
12
+ disabled?: boolean;
13
+ text: string;
14
+ value: number | string;
15
+ };
@@ -0,0 +1,11 @@
1
+ import type { Option, SelectedOption } from './types';
2
+ export declare const createOption: (text: string, options: Option[]) => {
3
+ value: string;
4
+ text: string;
5
+ custom: boolean;
6
+ }[];
7
+ export declare const filterOptionsList: (search: string, _options: Option[]) => Option[];
8
+ export declare const flattenArray: (options: Option[]) => Option[];
9
+ export declare const getNextSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
10
+ export declare const getPreviousSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
11
+ export declare const selectOptions: (options: Option[], selected: SelectedOption[], deselected?: Option[]) => SelectedOption[];
@@ -15,6 +15,6 @@ export interface CNavProps extends HTMLAttributes<HTMLDivElement | HTMLUListElem
15
15
  /**
16
16
  * Set the nav variant to tabs or pills.
17
17
  */
18
- variant?: 'tabs' | 'pills' | 'underline';
18
+ variant?: 'pills' | 'tabs' | 'underline';
19
19
  }
20
20
  export declare const CNav: React.ForwardRefExoticComponent<CNavProps & React.RefAttributes<HTMLDivElement | HTMLOListElement | HTMLUListElement>>;
@@ -12,7 +12,7 @@ export interface CNavbarProps extends HTMLAttributes<HTMLDivElement> {
12
12
  */
13
13
  color?: Colors;
14
14
  /**
15
- * Sets if the color of text should be colored for a light or dark dark background.
15
+ * Sets if the color of text should be colored for a light or dark background.
16
16
  */
17
17
  colorScheme?: 'dark' | 'light';
18
18
  /**
@@ -8,6 +8,10 @@ export interface COffcanvasProps extends HTMLAttributes<HTMLDivElement> {
8
8
  * A string of all className you want applied to the base component.
9
9
  */
10
10
  className?: string;
11
+ /**
12
+ * Sets a darker color scheme.
13
+ */
14
+ dark?: boolean;
11
15
  /**
12
16
  * Closes the offcanvas when escape key is pressed.
13
17
  */