@coreui/react-pro 4.12.0-beta.1 → 4.12.0-beta.3
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/dropdown/CDropdown.d.ts +8 -1
- package/dist/components/dropdown/CDropdownMenu.d.ts +3 -4
- package/dist/components/multi-select/CMultiSelect.d.ts +2 -2
- package/dist/components/popover/CPopover.d.ts +22 -1
- package/dist/components/progress/CProgress.d.ts +6 -0
- package/dist/components/progress/CProgressStacked.d.ts +12 -0
- package/dist/components/progress/index.d.ts +2 -1
- package/dist/components/tooltip/CTooltip.d.ts +22 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/useColorModes.d.ts +3 -2
- package/dist/hooks/usePopper.d.ts +8 -0
- package/dist/index.es.js +6682 -7089
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +6300 -6723
- package/dist/index.js.map +1 -1
- package/dist/props.d.ts +1 -0
- package/dist/utils/getRTLPlacement.d.ts +3 -0
- package/dist/utils/index.d.ts +2 -1
- package/package.json +5 -5
- package/src/components/date-range-picker/CDateRangePicker.tsx +10 -7
- package/src/components/dropdown/CDropdown.tsx +130 -45
- package/src/components/dropdown/CDropdownMenu.tsx +41 -138
- package/src/components/dropdown/CDropdownToggle.tsx +6 -15
- package/src/components/dropdown/__tests__/__snapshots__/CDropdownMenu.spec.tsx.snap +0 -1
- package/src/components/multi-select/CMultiSelect.tsx +30 -39
- package/src/components/picker/CPicker.tsx +24 -34
- package/src/components/popover/CPopover.tsx +76 -51
- package/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap +0 -21
- package/src/components/progress/CProgress.tsx +43 -8
- package/src/components/progress/CProgressBar.tsx +5 -6
- package/src/components/progress/CProgressStacked.tsx +39 -0
- package/src/components/progress/index.ts +2 -1
- package/src/components/tooltip/CTooltip.tsx +77 -52
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useColorModes.ts +21 -11
- package/src/hooks/usePopper.ts +31 -0
- package/src/props.ts +5 -0
- package/src/utils/getRTLPlacement.ts +18 -0
- package/src/utils/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.12.0-beta.
|
|
45
|
+
- [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.12.0-beta.3.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`
|
|
@@ -46,8 +46,14 @@ export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIEl
|
|
|
46
46
|
* Sets a specified direction and location of the dropdown menu.
|
|
47
47
|
*/
|
|
48
48
|
direction?: 'center' | 'dropup' | 'dropup-center' | 'dropend' | 'dropstart';
|
|
49
|
+
/**
|
|
50
|
+
* Offset of the dropdown menu relative to its target.
|
|
51
|
+
*/
|
|
52
|
+
offset?: [number, number];
|
|
49
53
|
/**
|
|
50
54
|
* Callback fired when the component requests to be hidden.
|
|
55
|
+
*
|
|
56
|
+
* @since 4.9.0-beta.1
|
|
51
57
|
*/
|
|
52
58
|
onHide?: () => void;
|
|
53
59
|
/**
|
|
@@ -80,7 +86,8 @@ export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIEl
|
|
|
80
86
|
visible?: boolean;
|
|
81
87
|
}
|
|
82
88
|
interface ContextProps extends CDropdownProps {
|
|
83
|
-
dropdownToggleRef: RefObject<any
|
|
89
|
+
dropdownToggleRef: RefObject<any | undefined>;
|
|
90
|
+
dropdownMenuRef: RefObject<HTMLDivElement | HTMLUListElement | undefined>;
|
|
84
91
|
setVisible: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
85
92
|
portal: boolean;
|
|
86
93
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ElementType,
|
|
2
|
-
|
|
3
|
-
export interface CDropdownMenuProps extends HTMLAttributes<HTMLDivElement | HTMLUListElement>, Omit<PopperChildrenProps, 'arrowProps' | 'forceUpdate' | 'hasPopperEscaped' | 'isReferenceHidden' | 'placement' | 'ref' | 'style' | 'update'> {
|
|
1
|
+
import React, { ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
export interface CDropdownMenuProps extends HTMLAttributes<HTMLDivElement | HTMLUListElement> {
|
|
4
3
|
/**
|
|
5
4
|
* A string of all className you want applied to the base component.
|
|
6
5
|
*/
|
|
@@ -10,4 +9,4 @@ export interface CDropdownMenuProps extends HTMLAttributes<HTMLDivElement | HTML
|
|
|
10
9
|
*/
|
|
11
10
|
component?: string | ElementType;
|
|
12
11
|
}
|
|
13
|
-
export declare const CDropdownMenu:
|
|
12
|
+
export declare const CDropdownMenu: React.ForwardRefExoticComponent<CDropdownMenuProps & React.RefAttributes<HTMLDivElement | HTMLUListElement>>;
|
|
@@ -76,13 +76,13 @@ export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'float
|
|
|
76
76
|
/**
|
|
77
77
|
* Custom template for options.
|
|
78
78
|
*
|
|
79
|
-
* @since 4.12.0-beta.
|
|
79
|
+
* @since 4.12.0-beta.3
|
|
80
80
|
*/
|
|
81
81
|
optionsTemplate?: (option: Option) => ReactNode;
|
|
82
82
|
/**
|
|
83
83
|
* Custom template for options groups.
|
|
84
84
|
*
|
|
85
|
-
* @since 4.12.0-beta.
|
|
85
|
+
* @since 4.12.0-beta.3
|
|
86
86
|
*/
|
|
87
87
|
optionsGroupsTemplate?: (option: OptionsGroup) => ReactNode;
|
|
88
88
|
/**
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import type { Triggers } from '../../types';
|
|
2
|
+
import type { Placements, Triggers } from '../../types';
|
|
3
3
|
export interface CPopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'content'> {
|
|
4
|
+
/**
|
|
5
|
+
* Apply a CSS fade transition to the popover.
|
|
6
|
+
*
|
|
7
|
+
* @since 4.9.0-beta.1
|
|
8
|
+
*/
|
|
9
|
+
animation?: boolean;
|
|
4
10
|
/**
|
|
5
11
|
* A string of all className you want applied to the component.
|
|
6
12
|
*/
|
|
@@ -13,6 +19,21 @@ export interface CPopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'tit
|
|
|
13
19
|
* Offset of the popover relative to its target.
|
|
14
20
|
*/
|
|
15
21
|
offset?: [number, number];
|
|
22
|
+
/**
|
|
23
|
+
* The delay for displaying and hiding the popover (in milliseconds). When a numerical value is provided, the delay applies to both the hide and show actions. The object structure for specifying the delay is as follows: delay: `{ 'show': 500, 'hide': 100 }`.
|
|
24
|
+
*
|
|
25
|
+
* @since 4.9.0-beta.1
|
|
26
|
+
*/
|
|
27
|
+
delay?: number | {
|
|
28
|
+
show: number;
|
|
29
|
+
hide: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
|
|
33
|
+
*
|
|
34
|
+
* @since 4.9.0-beta.1
|
|
35
|
+
*/
|
|
36
|
+
fallbackPlacements?: Placements | Placements[];
|
|
16
37
|
/**
|
|
17
38
|
* Callback fired when the component requests to be hidden.
|
|
18
39
|
*/
|
|
@@ -9,6 +9,12 @@ export interface CProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'co
|
|
|
9
9
|
* Sets the height of the component. If you set that value the inner `<CProgressBar>` will automatically resize accordingly.
|
|
10
10
|
*/
|
|
11
11
|
height?: number;
|
|
12
|
+
/**
|
|
13
|
+
* A string of all className you want applied to the <CProgressBar/> component.
|
|
14
|
+
*
|
|
15
|
+
* @since 4.9.0
|
|
16
|
+
*/
|
|
17
|
+
progressBarClassName?: string;
|
|
12
18
|
/**
|
|
13
19
|
* Makes progress bar thinner.
|
|
14
20
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export interface CProgressStackedProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* A string of all className you want applied to the component.
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CProgressStackedContextProps {
|
|
9
|
+
stacked?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const CProgressStackedContext: React.Context<CProgressStackedContextProps>;
|
|
12
|
+
export declare const CProgressStacked: React.ForwardRefExoticComponent<CProgressStackedProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import type { Triggers } from '../../types';
|
|
2
|
+
import type { Placements, Triggers } from '../../types';
|
|
3
3
|
export interface CTooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {
|
|
4
|
+
/**
|
|
5
|
+
* Apply a CSS fade transition to the tooltip.
|
|
6
|
+
*
|
|
7
|
+
* @since 4.9.0-beta.1
|
|
8
|
+
*/
|
|
9
|
+
animation?: boolean;
|
|
4
10
|
/**
|
|
5
11
|
* A string of all className you want applied to the component.
|
|
6
12
|
*/
|
|
@@ -9,6 +15,21 @@ export interface CTooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'con
|
|
|
9
15
|
* Content node for your component.
|
|
10
16
|
*/
|
|
11
17
|
content: ReactNode | string;
|
|
18
|
+
/**
|
|
19
|
+
* The delay for displaying and hiding the tooltip (in milliseconds). When a numerical value is provided, the delay applies to both the hide and show actions. The object structure for specifying the delay is as follows: delay: `{ 'show': 500, 'hide': 100 }`.
|
|
20
|
+
*
|
|
21
|
+
* @since 4.9.0-beta.1
|
|
22
|
+
*/
|
|
23
|
+
delay?: number | {
|
|
24
|
+
show: number;
|
|
25
|
+
hide: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
|
|
29
|
+
*
|
|
30
|
+
* @since 4.9.0-beta.1
|
|
31
|
+
*/
|
|
32
|
+
fallbackPlacements?: Placements | Placements[];
|
|
12
33
|
/**
|
|
13
34
|
* Offset of the tooltip relative to its target.
|
|
14
35
|
*/
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useColorModes } from './useColorModes';
|
|
2
2
|
import { useForkedRef } from './useForkedRef';
|
|
3
|
+
import { usePopper } from './usePopper';
|
|
3
4
|
import { useStateWithCallback } from './useStateWithCallback';
|
|
4
|
-
export { useColorModes, useForkedRef, useStateWithCallback };
|
|
5
|
+
export { useColorModes, useForkedRef, usePopper, useStateWithCallback };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
1
2
|
interface UseColorModesOutput {
|
|
2
|
-
|
|
3
|
+
colorMode: string | undefined;
|
|
3
4
|
isColorModeSet: () => boolean;
|
|
4
|
-
setColorMode:
|
|
5
|
+
setColorMode: Dispatch<SetStateAction<string>>;
|
|
5
6
|
}
|
|
6
7
|
export declare const useColorModes: (localStorageItemName?: string) => UseColorModesOutput;
|
|
7
8
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Instance, Options } from '@popperjs/core';
|
|
2
|
+
interface UsePopperOutput {
|
|
3
|
+
popper: Instance | undefined;
|
|
4
|
+
initPopper: (reference: HTMLElement, popper: HTMLElement, options: Partial<Options>) => void;
|
|
5
|
+
destroyPopper: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const usePopper: () => UsePopperOutput;
|
|
8
|
+
export {};
|