@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
@@ -0,0 +1,82 @@
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
+ * Add custom elements to the footer.
67
+ */
68
+ footerContent?: ReactNode;
69
+ /**
70
+ * Callback fired when the cancel button has been clicked.
71
+ */
72
+ onCancel?: () => void;
73
+ /**
74
+ * Callback fired when the confirm button has been clicked.
75
+ */
76
+ onConfirm?: () => void;
77
+ /**
78
+ * The content of toggler.
79
+ */
80
+ toggler?: ReactNode;
81
+ }
82
+ export declare const CPicker: React.ForwardRefExoticComponent<CPickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
@@ -0,0 +1,82 @@
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
+ * Add custom elements to the footer.
67
+ */
68
+ footerContent?: ReactNode;
69
+ /**
70
+ * Callback fired when the cancel button has been clicked.
71
+ */
72
+ onCancel?: () => void;
73
+ /**
74
+ * Callback fired when the confirm button has been clicked.
75
+ */
76
+ onConfirm?: () => void;
77
+ /**
78
+ * The content of toggler.
79
+ */
80
+ toggler?: ReactNode;
81
+ }
82
+ export declare const CPicker: React.ForwardRefExoticComponent<CPickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
@@ -1,9 +1,10 @@
1
1
  import React, { MouseEvent, ReactNode } from 'react';
2
2
  import { CTableBodyProps } from '../table/CTableBody';
3
- import type { Item, ScopedColumns } from './types';
3
+ import type { Column, Item, ScopedColumns } from './types';
4
4
  export interface CSmartTableBodyProps extends CTableBodyProps {
5
5
  clickableRows?: boolean;
6
6
  columnNames: string[];
7
+ columns: (Column | string)[];
7
8
  currentItems: Item[];
8
9
  firstItemOnActivePageIndex: number;
9
10
  noItemsLabel?: string | ReactNode;
@@ -0,0 +1,7 @@
1
+ import React, { HTMLAttributes, ReactNode } from 'react';
2
+ interface CSmartTableCleanerProps extends HTMLAttributes<HTMLButtonElement> {
3
+ content?: string | ReactNode;
4
+ isFiltered?: string;
5
+ }
6
+ export declare const CSmartTableCleaner: React.ForwardRefExoticComponent<CSmartTableCleanerProps & React.RefAttributes<HTMLButtonElement>>;
7
+ export {};
@@ -100,9 +100,7 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
100
100
  itemsPerPageOptions?: number[];
101
101
  /**
102
102
  * Adds select element over table, which is used for control items per page in pagination. If you want to customize this element, pass object with optional values:
103
- * - label (String) - replaces default label text
104
- * - values (Array) - custom array of pagination values
105
- * - external (Boolean) - disables automatic 'itemsPerPage' change (use to change pages externaly by 'pagination-change' event).
103
+ * - external (Boolean) - disables automatic 'itemsPerPage' change.
106
104
  */
107
105
  itemsPerPageSelect?: boolean | ItemsPerPageSelect;
108
106
  /**
@@ -11,6 +11,8 @@ export type Column = {
11
11
  sorter?: boolean;
12
12
  _style?: any;
13
13
  _props?: CTableHeaderCellProps;
14
+ _colStyle?: any;
15
+ _colProps?: CTableDataCellProps;
14
16
  };
15
17
  export type ColumnFilter = {
16
18
  lazy?: boolean;
@@ -41,8 +43,6 @@ export type Item = {
41
43
  };
42
44
  export type ItemsPerPageSelect = {
43
45
  external?: boolean;
44
- label?: string;
45
- values?: Array<number>;
46
46
  };
47
47
  export type Pagination = {
48
48
  external?: boolean;
@@ -4,6 +4,7 @@ export declare const filterTable: (items: Item[], tableFilter: boolean | TableFi
4
4
  export declare const getClickedColumnName: (target: HTMLTextAreaElement, columnNames: string[]) => string;
5
5
  export declare const getColumnKey: (column: Column | string) => string;
6
6
  export declare const getColumnLabel: (column: Column | string) => string;
7
+ export declare const getColumnName: (column: string | Column) => string;
7
8
  export declare const getColumnNames: (columns: (string | Column)[] | undefined, items: Item[]) => string[];
8
9
  export declare const getColumns: (_columns: (Column | Group | string)[]) => (Column | string)[];
9
10
  export declare const countColumns: (columns: Column[], counter?: number) => number;
@@ -19,7 +20,8 @@ export declare const getColumnGroups: (columns: (string | Column)[] | undefined)
19
20
  export declare const getColumnNamesFromItems: (items: Item[]) => string[];
20
21
  export declare const getColumnSorterState: (key: string, sorterState: SorterValue | undefined) => string | number;
21
22
  export declare const getColumnValues: (items: Item[], key: string) => any[];
22
- export declare const getTableDataCellProps: (item: Item, colName: string) => any;
23
+ export declare const getTableDataCellProps: (column: Column | string, item: Item, colName: string) => {};
24
+ export declare const getTableDataCellStyles: (column: Column | string, item: Item, colName: string) => {};
23
25
  export declare const getTableHeaderCellProps: (column: Column | string) => import("../table/CTableHeaderCell").CTableHeaderCellProps;
24
26
  export declare const getTableHeaderCellStyles: (column: Column | string, columnSorter: boolean | Sorter | undefined) => any;
25
27
  export declare const isSortable: (i: number, columns: (string | Column)[] | undefined, columnSorter: Sorter | boolean | undefined, itemsDataColumns: string[], columnNames: string[]) => boolean | undefined;
@@ -1,4 +1,5 @@
1
+ import { useColorModes } from './useColorModes';
1
2
  import { useForkedRef } from './useForkedRef';
2
3
  import { usePopper } from './usePopper';
3
4
  import { useStateWithCallback } from './useStateWithCallback';
4
- export { useForkedRef, usePopper, useStateWithCallback };
5
+ export { useColorModes, useForkedRef, usePopper, useStateWithCallback };