@coreui/react-pro 4.9.0 → 4.11.0-next.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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/dist/components/calendar/CCalendar.d.ts +12 -0
  3. package/dist/components/date-range-picker/CDateRangePicker.d.ts +6 -0
  4. package/dist/components/multi-select/CMultiSelect.d.ts +18 -1
  5. package/dist/components/multi-select/CMultiSelectOptions.d.ts +1 -0
  6. package/dist/components/multi-select/types.d.ts +1 -0
  7. package/dist/components/multi-select/utils.d.ts +5 -0
  8. package/dist/components/smart-table/CSmartTableInterface.d.ts +1 -1
  9. package/dist/components/time-picker/CTimePicker.d.ts +6 -0
  10. package/dist/index.es.js +126 -61
  11. package/dist/index.es.js.map +1 -1
  12. package/dist/index.js +126 -61
  13. package/dist/index.js.map +1 -1
  14. package/package.json +2 -2
  15. package/src/components/calendar/CCalendar.tsx +79 -44
  16. package/src/components/calendar/utils.ts +1 -0
  17. package/src/components/date-range-picker/CDateRangePicker.tsx +14 -0
  18. package/src/components/dropdown/CDropdown.tsx +33 -30
  19. package/src/components/multi-select/CMultiSelect.tsx +99 -14
  20. package/src/components/multi-select/CMultiSelectOptions.tsx +29 -16
  21. package/src/components/multi-select/types.ts +1 -0
  22. package/src/components/multi-select/utils.ts +42 -25
  23. package/src/components/smart-table/CSmartTableInterface.tsx +1 -1
  24. package/src/components/time-picker/CTimePicker.tsx +9 -0
  25. package/src/components/virtual-scroller/CVirtualScroller.tsx +8 -7
  26. package/dist/components/Types.d.ts +0 -14
  27. package/dist/components/multi-select/CMultiSelectCleaner.d.ts +0 -2
  28. package/dist/components/multi-select/CMultiSelectSearchInput.d.ts +0 -5
  29. package/dist/components/pagination/CSmartPagination.d.ts +0 -80
  30. package/dist/components/time-picker/CTimePicker copy.d.ts +0 -46
  31. package/dist/utils/calendar.d.ts +0 -23
  32. package/dist/utils/getNextSibling.d.ts +0 -2
  33. package/dist/utils/getPreviousSibling.d.ts +0 -2
  34. package/dist/utils/hooks/index.d.ts +0 -3
  35. package/dist/utils/hooks/useForkedRef.d.ts +0 -7
  36. package/dist/utils/hooks/useStateWithCallback.d.ts +0 -2
  37. package/dist/utils/isVisible.d.ts +0 -2
  38. package/dist/utils/time.d.ts +0 -21
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.9.0.zip)
45
+ - [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.11.0-next.0.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`
@@ -80,6 +80,18 @@ export interface CCalendarProps {
80
80
  * @since 4.3.0
81
81
  */
82
82
  navYearFirst?: boolean;
83
+ /**
84
+ * 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
+ *
86
+ * @since 4.11.0-next.0
87
+ */
88
+ selectAdjacementDays?: boolean;
89
+ /**
90
+ * Set whether to display dates in adjacent months (non-selectable) at the start and end of the current month.
91
+ *
92
+ * @since 4.11.0-next.0
93
+ */
94
+ showAdjacementDays?: boolean;
83
95
  /**
84
96
  * Allow range selection.
85
97
  */
@@ -69,6 +69,12 @@ export interface CDateRangePickerProps extends Omit<CFormControlWrapperProps, 'f
69
69
  * Set the ranges button variant to an outlined button or a ghost button.
70
70
  */
71
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;
72
78
  /**
73
79
  * Default icon or character character that separates two dates.
74
80
  */
@@ -2,6 +2,12 @@ import React, { HTMLAttributes, ReactNode } from 'react';
2
2
  import { CFormControlWrapperProps } from './../form/CFormControlWrapper';
3
3
  import type { Option } from './types';
4
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;
5
11
  /**
6
12
  * A string of all className you want applied to the base component.
7
13
  */
@@ -10,10 +16,22 @@ export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'float
10
16
  * Enables selection cleaner element.
11
17
  */
12
18
  cleaner?: boolean;
19
+ /**
20
+ * Clear current search on selecting an item.
21
+ *
22
+ * @since 4.11.0-next.0
23
+ */
24
+ clearSearchOnSelect?: boolean;
13
25
  /**
14
26
  * Toggle the disabled state for the component.
15
27
  */
16
28
  disabled?: boolean;
29
+ /**
30
+ * When set, the options list will have a loading style: loading spinner and reduced opacity.
31
+ *
32
+ * @since 4.11.0-next.0
33
+ */
34
+ loading?: boolean;
17
35
  /**
18
36
  * It specifies that multiple options can be selected at once.
19
37
  */
@@ -83,7 +101,6 @@ export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'float
83
101
  */
84
102
  visible?: boolean;
85
103
  /**
86
- *
87
104
  * Amount of visible items when virtualScroller is set to `true`.
88
105
  *
89
106
  * @since 4.8.0
@@ -2,6 +2,7 @@ import React, { HTMLAttributes, ReactNode } from 'react';
2
2
  import type { Option } from './types';
3
3
  export interface CMultiSelectOptionsProps extends HTMLAttributes<HTMLDivElement> {
4
4
  handleOptionOnClick?: (option: Option) => void;
5
+ loading?: boolean;
5
6
  options: Option[];
6
7
  optionsMaxHeight?: number | string;
7
8
  optionsStyle?: 'checkbox' | 'text';
@@ -1,4 +1,5 @@
1
1
  export type Option = {
2
+ custom?: boolean;
2
3
  disabled?: boolean;
3
4
  label?: string;
4
5
  options?: Option[];
@@ -1,4 +1,9 @@
1
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
+ }[];
2
7
  export declare const filterOptionsList: (search: string, _options: Option[]) => Option[];
3
8
  export declare const flattenArray: (options: Option[]) => Option[];
4
9
  export declare const getNextSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
@@ -106,7 +106,7 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
106
106
  */
107
107
  itemsPerPageSelect?: boolean | ItemsPerPageSelect;
108
108
  /**
109
- * When set, table will have loading style: loading spinner and reduced opacity. When 'small' prop is enabled spinner will be also smaller.
109
+ * When set, table will have loading style: loading spinner and reduced opacity.
110
110
  */
111
111
  loading?: boolean;
112
112
  /**
@@ -36,6 +36,12 @@ export interface CTimePickerProps extends Omit<CFormControlWrapperProps, 'floati
36
36
  * Specifies a short hint that is visible in the input.
37
37
  */
38
38
  placeholder?: string;
39
+ /**
40
+ * When present, it specifies that time must be filled out before submitting the form.
41
+ *
42
+ * @since 4.10.0
43
+ */
44
+ required?: boolean;
39
45
  /**
40
46
  * Show seconds.
41
47
  *