@coreui/react-pro 5.11.0 → 5.12.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.
- package/README.md +1 -1
- package/dist/cjs/components/accordion/CAccordionBody.js +2 -2
- package/dist/cjs/components/accordion/CAccordionBody.js.map +1 -1
- package/dist/cjs/components/accordion/CAccordionItem.d.ts +4 -0
- package/dist/cjs/components/accordion/CAccordionItem.js +4 -4
- package/dist/cjs/components/accordion/CAccordionItem.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdown.d.ts +77 -20
- package/dist/cjs/components/dropdown/CDropdown.js +6 -3
- package/dist/cjs/components/dropdown/CDropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownMenu.js +1 -1
- package/dist/cjs/components/dropdown/CDropdownMenu.js.map +1 -1
- package/dist/cjs/components/popover/CPopover.d.ts +75 -20
- package/dist/cjs/components/popover/CPopover.js +8 -21
- package/dist/cjs/components/popover/CPopover.js.map +1 -1
- package/dist/cjs/components/smart-table/CSmartTableHead.js +3 -1
- package/dist/cjs/components/smart-table/CSmartTableHead.js.map +1 -1
- package/dist/cjs/components/smart-table/types.d.ts +1 -1
- package/dist/cjs/components/tooltip/CTooltip.d.ts +67 -15
- package/dist/cjs/components/tooltip/CTooltip.js +8 -21
- package/dist/cjs/components/tooltip/CTooltip.js.map +1 -1
- package/dist/cjs/hooks/useColorModes.js +5 -5
- package/dist/cjs/hooks/useColorModes.js.map +1 -1
- package/dist/esm/components/accordion/CAccordionBody.js +2 -2
- package/dist/esm/components/accordion/CAccordionBody.js.map +1 -1
- package/dist/esm/components/accordion/CAccordionItem.d.ts +4 -0
- package/dist/esm/components/accordion/CAccordionItem.js +4 -4
- package/dist/esm/components/accordion/CAccordionItem.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdown.d.ts +77 -20
- package/dist/esm/components/dropdown/CDropdown.js +6 -3
- package/dist/esm/components/dropdown/CDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownMenu.js +1 -1
- package/dist/esm/components/dropdown/CDropdownMenu.js.map +1 -1
- package/dist/esm/components/popover/CPopover.d.ts +75 -20
- package/dist/esm/components/popover/CPopover.js +8 -21
- package/dist/esm/components/popover/CPopover.js.map +1 -1
- package/dist/esm/components/smart-table/CSmartTableHead.js +3 -1
- package/dist/esm/components/smart-table/CSmartTableHead.js.map +1 -1
- package/dist/esm/components/smart-table/types.d.ts +1 -1
- package/dist/esm/components/tooltip/CTooltip.d.ts +67 -15
- package/dist/esm/components/tooltip/CTooltip.js +8 -21
- package/dist/esm/components/tooltip/CTooltip.js.map +1 -1
- package/dist/esm/hooks/useColorModes.js +5 -5
- package/dist/esm/hooks/useColorModes.js.map +1 -1
- package/package.json +4 -4
- package/src/components/accordion/CAccordionBody.tsx +3 -3
- package/src/components/accordion/CAccordionItem.tsx +9 -5
- package/src/components/dropdown/CDropdown.tsx +106 -26
- package/src/components/dropdown/CDropdownMenu.tsx +0 -1
- package/src/components/popover/CPopover.tsx +103 -43
- package/src/components/smart-table/CSmartTableHead.tsx +3 -0
- package/src/components/smart-table/types.ts +7 -1
- package/src/components/tooltip/CTooltip.tsx +94 -38
- package/src/hooks/useColorModes.ts +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSmartTableHead.js","sources":["../../../../src/components/smart-table/CSmartTableHead.tsx"],"sourcesContent":[null],"names":["forwardRef","CTableHead","__rest","useRef","useMemo","getColumns","getColumnGroups","getColumnSorterState","getColumnKey","__assign","CTableRow","CTableHeaderCell","getTableHeaderCellProps","CFormCheck","getTableHeaderCellStyles","getColumnLabel","getColumnValues","CFormInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0Ca,eAAe,GAC1BA,gBAAU,CACR,UACE,EAqBC,EACD,GAAG,EAAA;AArBD,IAAA,IAAA,EAA0B,GAAA,EAAA,CAAA,EAAA,EAAtB,SAAS,GAAA,EAAA,KAAA,KAAA,CAAA,GAAGC,qBA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WAAW,IAAI,UAAU,EAAE;4BAC3C,KAAK,CAAC,cAAc,EAAE;4BACtB,UAAU,CAACA,kBAAY,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC;;qBAElD;AACD,oBAAA,QAAQ,EAAE,CAAC;iBACZ,EAAC;oBAEF,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,UAAU,EAAA,EAAEO,oBAAc,CAAC,MAAM,CAAC,CAAO;AACvD,oBAAA,UAAU,IAAI,gBAAgB,CAAC,MAAM,CAAC,CACtB;AAEvB,aAAC,CAAC,CACQ;QACX,YAAY,KACX,KAAA,CAAA,aAAA,CAACL,mBAAS,EAAA,IAAA;YACP,UAAU,IAAI,KAAC,CAAA,aAAA,CAAAC,iCAAgB,EAAoB,IAAA,CAAA;AACnD,YAAA,QAAQ,CAAC,GAAG,CAAC,UAAC,MAAuB,EAAE,KAAa,EAAA;AACnD,gBAAA,QACE,KAAC,CAAA,aAAA,CAAAA,iCAAgB,EAAKF,kBAAA,CAAA,EAAA,EAAAG,6BAAuB,CAAC,MAAM,CAAC,EAAE,EAAA,GAAG,EAAE,KAAK,EAAA,CAAA,EAC9D,CACC,OAAO,MAAM,KAAK;AAChB,sBAAE,MAAM,CAAC,MAAM,KAAK;AAClB,0BAAE;0BACA,MAAM,CAAC;AACX,sBAAE,IAAI,KAER,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU,IAC/D,MAAM,CAAC,MAAM,CACXI,qBAAe,CAAC,KAAK,EAAER,kBAAY,CAAC,MAAM,CAAC,CAAC,EAC5C,UAAC,KAAU,EAAA;AACT,oBAAA,OAAA,0BAA0B;AAC1B,wBAAA,0BAA0B,CAACA,kBAAY,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"CSmartTableHead.js","sources":["../../../../src/components/smart-table/CSmartTableHead.tsx"],"sourcesContent":[null],"names":["forwardRef","CTableHead","__rest","useRef","useMemo","getColumns","getColumnGroups","getColumnSorterState","getColumnKey","__assign","CTableRow","CTableHeaderCell","getTableHeaderCellProps","CFormCheck","getTableHeaderCellStyles","getColumnLabel","getColumnValues","CFormInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0Ca,eAAe,GAC1BA,gBAAU,CACR,UACE,EAqBC,EACD,GAAG,EAAA;AArBD,IAAA,IAAA,EAA0B,GAAA,EAAA,CAAA,EAAA,EAAtB,SAAS,GAAA,EAAA,KAAA,KAAA,CAAA,GAAGC,qBAAU,GAAA,EAAA,EAC1B,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,0BAA0B,GAAA,EAAA,CAAA,0BAAA,EAC1B,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,mBAAmB,GAAA,EAAA,CAAA,mBAAA,EACnB,sBAAsB,GAAA,EAAA,CAAA,sBAAA,EACtB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,EAAA,GAAA,EAAA,CAAA,UAAiB,EAAjB,UAAU,mBAAG,IAAI,GAAA,EAAA,EACjB,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,qBAAqB,GAAA,EAAA,CAAA,qBAAA,EAClB,IAAI,GAAAC,gBAAA,CAAA,EAAA,EApBT,2UAqBC,CADQ;AAIT,IAAA,IAAM,oBAAoB,GAAGC,YAAM,CAAmB,IAAI,CAAC;AAC3D,IAAA,IAAM,QAAQ,GAAGC,a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6
|
children?: Column[];
|
|
7
|
-
filter?: boolean | ((values: any[], onChange: (value: any) => void) => ReactNode);
|
|
7
|
+
filter?: boolean | ((values: any[], onChange: (value: any) => void, state: ColumnFilterValue | undefined) => ReactNode);
|
|
8
8
|
group?: string;
|
|
9
9
|
key: string;
|
|
10
10
|
label?: string;
|
|
@@ -1,28 +1,45 @@
|
|
|
1
1
|
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { Options } from '@popperjs/core';
|
|
2
3
|
import type { Placements, Triggers } from '../../types';
|
|
3
4
|
export interface CTooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Enables or disables the CSS fade transition for the React Tooltip.
|
|
6
7
|
*
|
|
7
8
|
* @since 4.9.0
|
|
8
9
|
*/
|
|
9
10
|
animation?: boolean;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Adds a custom class name to the React Tooltip container. Useful for overriding default styles or applying additional design choices.
|
|
12
13
|
*/
|
|
13
14
|
className?: string;
|
|
14
15
|
/**
|
|
15
|
-
* Appends the
|
|
16
|
+
* Appends the React Tooltip to a specific element instead of the default `document.body`. You may pass:
|
|
17
|
+
* - A DOM element (`HTMLElement` or `DocumentFragment`)
|
|
18
|
+
* - A function that returns a single element
|
|
19
|
+
* - `null`
|
|
16
20
|
*
|
|
21
|
+
* @example
|
|
22
|
+
* <CTooltip container={document.getElementById('my-container')}>...</CTooltip>
|
|
23
|
+
*
|
|
24
|
+
* @default document.body
|
|
17
25
|
* @since 4.11.0
|
|
18
26
|
*/
|
|
19
27
|
container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null;
|
|
20
28
|
/**
|
|
21
|
-
* Content
|
|
29
|
+
* Content to be displayed within the React Tooltip. Can be a string or any valid React node.
|
|
22
30
|
*/
|
|
23
31
|
content: ReactNode | string;
|
|
24
32
|
/**
|
|
25
|
-
* The delay
|
|
33
|
+
* The delay (in milliseconds) before showing or hiding the React Tooltip.
|
|
34
|
+
* - If provided as a number, the delay is applied to both "show" and "hide".
|
|
35
|
+
* - If provided as an object, it should have distinct "show" and "hide" values.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* // Delays 300ms on both show and hide
|
|
39
|
+
* <CTooltip delay={300}>...</CTooltip>
|
|
40
|
+
*
|
|
41
|
+
* // Delays 500ms on show and 100ms on hide
|
|
42
|
+
* <CTooltip delay={{ show: 500, hide: 100 }}>...</CTooltip>
|
|
26
43
|
*
|
|
27
44
|
* @since 4.9.0
|
|
28
45
|
*/
|
|
@@ -31,35 +48,70 @@ export interface CTooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'con
|
|
|
31
48
|
hide: number;
|
|
32
49
|
};
|
|
33
50
|
/**
|
|
34
|
-
*
|
|
51
|
+
* Array of fallback placements for the React Tooltip to use when the preferred placement cannot be achieved. These placements are tried in order.
|
|
35
52
|
*
|
|
53
|
+
* @type 'top', 'right', 'bottom', 'left' | ('top', 'right', 'bottom', 'left')[]
|
|
36
54
|
* @since 4.9.0
|
|
37
55
|
*/
|
|
38
56
|
fallbackPlacements?: Placements | Placements[];
|
|
39
57
|
/**
|
|
40
|
-
*
|
|
58
|
+
* Adjusts the offset of the React Tooltip relative to its target. Expects a tuple `[x-axis, y-axis]`.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* // Offset the menu 0px in X and 10px in Y direction
|
|
62
|
+
* <CTooltip offset={[0, 10]}>...</CTooltip>
|
|
63
|
+
*
|
|
64
|
+
* // Offset the menu 5px in both X and Y direction
|
|
65
|
+
* <CTooltip offset={[5, 5]}>...</CTooltip>
|
|
41
66
|
*/
|
|
42
67
|
offset?: [number, number];
|
|
43
68
|
/**
|
|
44
|
-
* Callback fired
|
|
69
|
+
* Callback fired immediately after the React Tooltip is hidden.
|
|
45
70
|
*/
|
|
46
71
|
onHide?: () => void;
|
|
47
72
|
/**
|
|
48
|
-
* Callback fired
|
|
73
|
+
* Callback fired immediately after the React Tooltip is shown.
|
|
49
74
|
*/
|
|
50
75
|
onShow?: () => void;
|
|
51
76
|
/**
|
|
52
|
-
*
|
|
77
|
+
* Initial placement of the React Tooltip. Note that Popper.js modifiers may alter this placement automatically if there's insufficient space in the chosen position.
|
|
78
|
+
*/
|
|
79
|
+
placement?: 'auto' | 'top' | 'right' | 'bottom' | 'left';
|
|
80
|
+
/**
|
|
81
|
+
* Customize the Popper.js configuration used to position the React Tooltip. Pass either an object or a function returning a modified config. [Learn more](https://popper.js.org/docs/v2/constructors/#options)
|
|
53
82
|
*
|
|
54
|
-
* @
|
|
83
|
+
* @example
|
|
84
|
+
* <CTooltip
|
|
85
|
+
* popperConfig={(defaultConfig) => ({
|
|
86
|
+
* ...defaultConfig,
|
|
87
|
+
* strategy: 'fixed',
|
|
88
|
+
* modifiers: [
|
|
89
|
+
* ...defaultConfig.modifiers,
|
|
90
|
+
* { name: 'computeStyles', options: { adaptive: false } },
|
|
91
|
+
* ],
|
|
92
|
+
* })}
|
|
93
|
+
* >...</CTooltip>
|
|
94
|
+
*
|
|
95
|
+
* @since 5.5.0
|
|
55
96
|
*/
|
|
56
|
-
|
|
97
|
+
popperConfig?: Partial<Options> | ((defaultPopperConfig: Partial<Options>) => Partial<Options>);
|
|
57
98
|
/**
|
|
58
|
-
*
|
|
99
|
+
* Determines the events that toggle the visibility of the React Tooltip. Can be a single trigger or an array of triggers.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* // Hover-only tooltip
|
|
103
|
+
* <CTooltip trigger="hover">...</CTooltip>
|
|
104
|
+
*
|
|
105
|
+
* // Hover + click combined
|
|
106
|
+
* <CTooltip trigger={['hover', 'click']}>...</CTooltip>
|
|
107
|
+
*
|
|
108
|
+
* @type 'hover' | 'focus' | 'click' | ('hover' | 'focus' | 'click')[]
|
|
59
109
|
*/
|
|
60
|
-
|
|
110
|
+
trigger?: Triggers | Triggers[];
|
|
61
111
|
/**
|
|
62
|
-
*
|
|
112
|
+
* Controls the visibility of the React Tooltip.
|
|
113
|
+
* - `true` to show the tooltip.
|
|
114
|
+
* - `false` to hide the tooltip.
|
|
63
115
|
*/
|
|
64
116
|
visible?: boolean;
|
|
65
117
|
}
|
|
@@ -12,7 +12,7 @@ var useForkedRef = require('../../hooks/useForkedRef.js');
|
|
|
12
12
|
var props = require('../../props.js');
|
|
13
13
|
|
|
14
14
|
var CTooltip = React.forwardRef(function (_a, ref) {
|
|
15
|
-
var children = _a.children, _b = _a.animation, animation = _b === void 0 ? true : _b, className = _a.className, container = _a.container, content = _a.content, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.fallbackPlacements, fallbackPlacements = _d === void 0 ? ['top', 'right', 'bottom', 'left'] : _d, _e = _a.offset, offset = _e === void 0 ? [0, 6] : _e, onHide = _a.onHide, onShow = _a.onShow, _f = _a.placement, placement = _f === void 0 ? 'top' : _f, _g = _a.trigger, trigger = _g === void 0 ? ['hover', 'focus'] : _g, visible = _a.visible, rest = tslib_es6.__rest(_a, ["children", "animation", "className", "container", "content", "delay", "fallbackPlacements", "offset", "onHide", "onShow", "placement", "trigger", "visible"]);
|
|
15
|
+
var children = _a.children, _b = _a.animation, animation = _b === void 0 ? true : _b, className = _a.className, container = _a.container, content = _a.content, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.fallbackPlacements, fallbackPlacements = _d === void 0 ? ['top', 'right', 'bottom', 'left'] : _d, _e = _a.offset, offset = _e === void 0 ? [0, 6] : _e, onHide = _a.onHide, onShow = _a.onShow, _f = _a.placement, placement = _f === void 0 ? 'top' : _f, popperConfig = _a.popperConfig, _g = _a.trigger, trigger = _g === void 0 ? ['hover', 'focus'] : _g, visible = _a.visible, rest = tslib_es6.__rest(_a, ["children", "animation", "className", "container", "content", "delay", "fallbackPlacements", "offset", "onHide", "onShow", "placement", "popperConfig", "trigger", "visible"]);
|
|
16
16
|
var tooltipRef = React.useRef(null);
|
|
17
17
|
var togglerRef = React.useRef(null);
|
|
18
18
|
var forkedRef = useForkedRef.useForkedRef(ref, tooltipRef);
|
|
@@ -21,29 +21,15 @@ var CTooltip = React.forwardRef(function (_a, ref) {
|
|
|
21
21
|
var _j = React.useState(visible), _visible = _j[0], setVisible = _j[1];
|
|
22
22
|
var _k = usePopper.usePopper(), initPopper = _k.initPopper, destroyPopper = _k.destroyPopper, updatePopper = _k.updatePopper;
|
|
23
23
|
var _delay = typeof delay === 'number' ? { show: delay, hide: delay } : delay;
|
|
24
|
-
var
|
|
24
|
+
var defaultPopperConfig = {
|
|
25
25
|
modifiers: [
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
element: '.tooltip-arrow',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'flip',
|
|
34
|
-
options: {
|
|
35
|
-
fallbackPlacements: fallbackPlacements,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'offset',
|
|
40
|
-
options: {
|
|
41
|
-
offset: offset,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
26
|
+
{ name: 'arrow', options: { element: '.tooltip-arrow' } },
|
|
27
|
+
{ name: 'flip', options: { fallbackPlacements: fallbackPlacements } },
|
|
28
|
+
{ name: 'offset', options: { offset: offset } },
|
|
44
29
|
],
|
|
45
30
|
placement: getRTLPlacement.default(placement, togglerRef.current),
|
|
46
31
|
};
|
|
32
|
+
var computedPopperConfig = tslib_es6.__assign(tslib_es6.__assign({}, defaultPopperConfig), (typeof popperConfig === 'function' ? popperConfig(defaultPopperConfig) : popperConfig));
|
|
47
33
|
React.useEffect(function () {
|
|
48
34
|
if (visible) {
|
|
49
35
|
handleShow();
|
|
@@ -53,7 +39,7 @@ var CTooltip = React.forwardRef(function (_a, ref) {
|
|
|
53
39
|
}, [visible]);
|
|
54
40
|
React.useEffect(function () {
|
|
55
41
|
if (mounted && togglerRef.current && tooltipRef.current) {
|
|
56
|
-
initPopper(togglerRef.current, tooltipRef.current,
|
|
42
|
+
initPopper(togglerRef.current, tooltipRef.current, computedPopperConfig);
|
|
57
43
|
setTimeout(function () {
|
|
58
44
|
setVisible(true);
|
|
59
45
|
}, _delay.show);
|
|
@@ -123,6 +109,7 @@ CTooltip.propTypes = {
|
|
|
123
109
|
onHide: PropTypes.func,
|
|
124
110
|
onShow: PropTypes.func,
|
|
125
111
|
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
112
|
+
popperConfig: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
126
113
|
trigger: props.triggerPropType,
|
|
127
114
|
visible: PropTypes.bool,
|
|
128
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CTooltip.js","sources":["../../../../src/components/tooltip/CTooltip.tsx"],"sourcesContent":[null],"names":["forwardRef","__rest","useRef","useForkedRef","useId","useState","usePopper","getRTLPlacement","useEffect","executeAfterTransition","__assign","CConditionalPortal","classNames","fallbackPlacementsPropType","triggerPropType"],"mappings":";;;;;;;;;;;;;IA+
|
|
1
|
+
{"version":3,"file":"CTooltip.js","sources":["../../../../src/components/tooltip/CTooltip.tsx"],"sourcesContent":[null],"names":["forwardRef","__rest","useRef","useForkedRef","useId","useState","usePopper","getRTLPlacement","useEffect","executeAfterTransition","__assign","CConditionalPortal","classNames","fallbackPlacementsPropType","triggerPropType"],"mappings":";;;;;;;;;;;;;IA+Ia,QAAQ,GAAGA,gBAAU,CAChC,UACE,EAgBC,EACD,GAAG,EAAA;AAhBD,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,iBAAgB,EAAhB,SAAS,mBAAG,IAAI,GAAA,EAAA,EAChB,SAAS,eAAA,EACT,SAAS,eAAA,EACT,OAAO,aAAA,EACP,EAAA,GAAA,EAAA,CAAA,KAAS,EAAT,KAAK,mBAAG,CAAC,GAAA,EAAA,EACT,EAAuD,GAAA,EAAA,CAAA,kBAAA,EAAvD,kBAAkB,GAAG,EAAA,KA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S,CAAC,MAAM;QAChB,SAAS,CAAC,KAAK,CAAC;AACd,YAAA,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;AACjC,YAAA,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;SAClC,CAAC;KACH,CAAC;AACF,IAAA,kBAAkB,EAAEC,gCAA0B;AAC9C,IAAA,MAAM,EAAE,SAAS,CAAC,GAAG;IACrB,MAAM,EAAE,SAAS,CAAC,IAAI;IACtB,MAAM,EAAE,SAAS,CAAC,IAAI;AACtB,IAAA,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACtE,IAAA,YAAY,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;AACrE,IAAA,OAAO,EAAEC,qBAAe;IACxB,OAAO,EAAE,SAAS,CAAC,IAAI;CACxB;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
5
|
var getStoredTheme = function (localStorageItemName) {
|
|
6
|
-
return typeof
|
|
6
|
+
return typeof window !== 'undefined' && localStorage.getItem(localStorageItemName);
|
|
7
7
|
};
|
|
8
8
|
var setStoredTheme = function (localStorageItemName, colorMode) {
|
|
9
9
|
return localStorage.setItem(localStorageItemName, colorMode);
|
|
10
10
|
};
|
|
11
11
|
var getPreferredColorScheme = function (localStorageItemName) {
|
|
12
|
-
if (typeof
|
|
12
|
+
if (typeof window === 'undefined') {
|
|
13
13
|
return 'light';
|
|
14
14
|
}
|
|
15
15
|
var storedTheme = getStoredTheme(localStorageItemName);
|
|
16
16
|
if (storedTheme) {
|
|
17
17
|
return storedTheme;
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
20
20
|
};
|
|
21
21
|
var setTheme = function (colorMode) {
|
|
22
22
|
document.documentElement.dataset.coreuiTheme =
|
|
23
|
-
colorMode === 'auto' &&
|
|
23
|
+
colorMode === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
24
24
|
? 'dark'
|
|
25
25
|
: colorMode;
|
|
26
26
|
var event = new Event('ColorSchemeChange');
|
|
@@ -36,7 +36,7 @@ var useColorModes = function (localStorageItemName) {
|
|
|
36
36
|
}
|
|
37
37
|
}, [colorMode]);
|
|
38
38
|
React.useEffect(function () {
|
|
39
|
-
|
|
39
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function () {
|
|
40
40
|
var storedTheme = getStoredTheme(localStorageItemName);
|
|
41
41
|
if (storedTheme !== 'light' && storedTheme !== 'dark' && colorMode) {
|
|
42
42
|
setTheme(colorMode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useColorModes.js","sources":["../../../src/hooks/useColorModes.ts"],"sourcesContent":[null],"names":["useState","useEffect"],"mappings":";;;;AAQA,IAAM,cAAc,GAAG,UAAC,oBAA4B,EAAA;IAClD,OAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useColorModes.js","sources":["../../../src/hooks/useColorModes.ts"],"sourcesContent":[null],"names":["useState","useEffect"],"mappings":";;;;AAQA,IAAM,cAAc,GAAG,UAAC,oBAA4B,EAAA;IAClD,OAAA,OAAO,MAAM,KAAK,WAAW,IAAI,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC;AAA3E,CAA2E;AAE7E,IAAM,cAAc,GAAG,UAAC,oBAA4B,EAAE,SAAiB,EAAA;AACrE,IAAA,OAAA,YAAY,CAAC,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC;AAArD,CAAqD;AAEvD,IAAM,uBAAuB,GAAG,UAAC,oBAA4B,EAAA;AAC3D,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA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AK,MAAM,IAAI,SAAS,EAAE;gBAClE,QAAQ,CAAC,SAAS,CAAC;;AAEvB,SAAC,CAAC;AACJ,KAAC,CAAC;IAEF,OAAO;AACL,QAAA,SAAS,EAAA,SAAA;QACT,cAAc,EAAE,YAAM,EAAA,OAAA,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAA,EAAA;AACnE,QAAA,YAAY,EAAA,YAAA;KACb;AACH;;;;"}
|
|
@@ -7,8 +7,8 @@ import { CCollapse } from '../collapse/CCollapse.js';
|
|
|
7
7
|
|
|
8
8
|
var CAccordionBody = forwardRef(function (_a, ref) {
|
|
9
9
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
10
|
-
var
|
|
11
|
-
return (React.createElement(CCollapse, { className: "accordion-collapse", visible: visible },
|
|
10
|
+
var _b = useContext(CAccordionItemContext), id = _b.id, visible = _b.visible;
|
|
11
|
+
return (React.createElement(CCollapse, { className: "accordion-collapse", id: id, visible: visible },
|
|
12
12
|
React.createElement("div", __assign({ className: classNames('accordion-body', className) }, rest, { ref: ref }), children)));
|
|
13
13
|
});
|
|
14
14
|
CAccordionBody.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CAccordionBody.js","sources":["../../../../src/components/accordion/CAccordionBody.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;IAea,cAAc,GAAG,UAAU,CACtC,UAAC,EAAgC,EAAE,GAAG,EAAA;IAAnC,IAAA,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAK,IAAI,GAA9B,MAAA,CAAA,EAAA,EAAA,CAAA,UAAA,EAAA,WAAA,CAAgC,CAAF;
|
|
1
|
+
{"version":3,"file":"CAccordionBody.js","sources":["../../../../src/components/accordion/CAccordionBody.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;IAea,cAAc,GAAG,UAAU,CACtC,UAAC,EAAgC,EAAE,GAAG,EAAA;IAAnC,IAAA,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAK,IAAI,GAA9B,MAAA,CAAA,EAAA,EAAA,CAAA,UAAA,EAAA,WAAA,CAAgC,CAAF;IACvB,IAAA,EAAA,GAAkB,UAAU,CAAC,qBAAqB,CAAC,EAAjD,EAAE,GAAA,EAAA,CAAA,EAAA,EAAE,OAAO,GAAA,EAAA,CAAA,OAAsC;AAEzD,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAC,oBAAoB,EAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAA;AAChE,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAK,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAA,EAAM,IAAI,EAAE,EAAA,GAAG,EAAE,GAAG,EAAA,CAAA,EACxE,QAAQ,CACL,CACI;AAEhB,CAAC;AAGH,cAAc,CAAC,SAAS,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,SAAS,EAAE,SAAS,CAAC,MAAM;CAC5B;AAED,cAAc,CAAC,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -6,6 +6,10 @@ export interface CAccordionItemContextProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const CAccordionItemContext: React.Context<CAccordionItemContextProps>;
|
|
8
8
|
export interface CAccordionItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
/**
|
|
10
|
+
* The id global attribute defines an identifier (ID) that must be unique in the whole document.
|
|
11
|
+
*/
|
|
12
|
+
id?: string;
|
|
9
13
|
/**
|
|
10
14
|
* A string of all className you want applied to the base component.
|
|
11
15
|
*/
|
|
@@ -6,9 +6,9 @@ import { CAccordionContext } from './CAccordion.js';
|
|
|
6
6
|
|
|
7
7
|
var CAccordionItemContext = createContext({});
|
|
8
8
|
var CAccordionItem = forwardRef(function (_a, ref) {
|
|
9
|
-
var children = _a.children, className = _a.className, itemKey = _a.itemKey, rest = __rest(_a, ["children", "className", "itemKey"]);
|
|
10
|
-
var
|
|
11
|
-
var _itemKey = useRef(itemKey !== null && itemKey !== void 0 ? itemKey :
|
|
9
|
+
var children = _a.children, className = _a.className, id = _a.id, itemKey = _a.itemKey, rest = __rest(_a, ["children", "className", "id", "itemKey"]);
|
|
10
|
+
var _id = id !== null && id !== void 0 ? id : useId();
|
|
11
|
+
var _itemKey = useRef(itemKey !== null && itemKey !== void 0 ? itemKey : _id);
|
|
12
12
|
var _b = useContext(CAccordionContext), _activeItemKey = _b._activeItemKey, alwaysOpen = _b.alwaysOpen, setActiveKey = _b.setActiveKey;
|
|
13
13
|
var _c = useState(Boolean(_activeItemKey === _itemKey.current)), visible = _c[0], setVisible = _c[1];
|
|
14
14
|
useEffect(function () {
|
|
@@ -20,7 +20,7 @@ var CAccordionItem = forwardRef(function (_a, ref) {
|
|
|
20
20
|
setVisible(Boolean(_activeItemKey === _itemKey.current));
|
|
21
21
|
}, [_activeItemKey]);
|
|
22
22
|
return (React.createElement("div", __assign({ className: classNames('accordion-item', className) }, rest, { ref: ref }),
|
|
23
|
-
React.createElement(CAccordionItemContext.Provider, { value: { id:
|
|
23
|
+
React.createElement(CAccordionItemContext.Provider, { value: { id: _id, setVisible: setVisible, visible: visible } }, children)));
|
|
24
24
|
});
|
|
25
25
|
CAccordionItem.propTypes = {
|
|
26
26
|
children: PropTypes.node,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CAccordionItem.js","sources":["../../../../src/components/accordion/CAccordionItem.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;IAqBa,qBAAqB,GAAG,aAAa,CAAC,EAAgC;
|
|
1
|
+
{"version":3,"file":"CAccordionItem.js","sources":["../../../../src/components/accordion/CAccordionItem.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;IAqBa,qBAAqB,GAAG,aAAa,CAAC,EAAgC;IAiBtE,cAAc,GAAG,UAAU,CACtC,UAAC,EAA6C,EAAE,G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,qBAAqB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,UAAU,EAAA,UAAA,EAAE,OAAO,EAAA,OAAA,EAAE,IACpE,QAAQ,CACsB,CAC7B;AAEV,CAAC;AAGH,cAAc,CAAC,SAAS,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,SAAS,EAAE,SAAS,CAAC,MAAM;AAC3B,IAAA,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACnE;AAED,cAAc,CAAC,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -1,80 +1,137 @@
|
|
|
1
1
|
import React, { ElementType, HTMLAttributes, RefObject } from 'react';
|
|
2
|
+
import type { Options } from '@popperjs/core';
|
|
2
3
|
import { PolymorphicRefForwardingComponent } from '../../helpers';
|
|
3
4
|
import type { Placements } from '../../types';
|
|
4
5
|
import type { Alignments } from './types';
|
|
5
6
|
export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIElement> {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Specifies the alignment of the React Dropdown Menu within this React Dropdown.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Align dropdown menu to the end on large devices, otherwise start
|
|
12
|
+
* <CDropdown alignment={{ lg: 'end', xs: 'start' }}>
|
|
13
|
+
* <CDropdownToggle>Toggle dropdown</CDropdownToggle>
|
|
14
|
+
* <CDropdownMenu>
|
|
15
|
+
* <CDropdownItem>Action</CDropdownItem>
|
|
16
|
+
* <CDropdownItem>Another Action</CDropdownItem>
|
|
17
|
+
* </CDropdownMenu>
|
|
18
|
+
* </CDropdown>
|
|
8
19
|
*
|
|
9
20
|
* @type 'start' | 'end' | { xs: 'start' | 'end' } | { sm: 'start' | 'end' } | { md: 'start' | 'end' } | { lg: 'start' | 'end' } | { xl: 'start' | 'end'} | { xxl: 'start' | 'end'}
|
|
10
21
|
*/
|
|
11
22
|
alignment?: Alignments;
|
|
12
23
|
/**
|
|
13
|
-
*
|
|
24
|
+
* Determines the root node component (native HTML element or a custom React component) for the React Dropdown.
|
|
14
25
|
*/
|
|
15
26
|
as?: ElementType;
|
|
16
27
|
/**
|
|
17
|
-
*
|
|
18
|
-
* - `true` -
|
|
19
|
-
* - `false` -
|
|
20
|
-
* - `'inside'` -
|
|
21
|
-
* - `'outside'` -
|
|
28
|
+
* Configures automatic closing behavior for the React Dropdown:
|
|
29
|
+
* - `true` - Close on clicks inside or outside of the React Dropdown Menu.
|
|
30
|
+
* - `false` - Disable auto-close; manually call `hide` or `toggle` (also not closed by `Escape`).
|
|
31
|
+
* - `'inside'` - Close only when clicking inside the React Dropdown Menu.
|
|
32
|
+
* - `'outside'` - Close only when clicking outside the React Dropdown Menu.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Close only when user clicks outside of the menu
|
|
36
|
+
* <CDropdown autoClose="outside" />
|
|
22
37
|
*/
|
|
23
38
|
autoClose?: 'inside' | 'outside' | boolean;
|
|
24
39
|
/**
|
|
25
|
-
*
|
|
40
|
+
* Adds custom classes to the React Dropdown root element.
|
|
26
41
|
*/
|
|
27
42
|
className?: string;
|
|
28
43
|
/**
|
|
29
|
-
* Appends the
|
|
44
|
+
* Appends the React Dropdown Menu to a specific element. You can pass an HTML element or a function returning an element. Defaults to `document.body`.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Append the menu to a custom container
|
|
48
|
+
* const myContainer = document.getElementById('my-container')
|
|
49
|
+
*
|
|
50
|
+
* <CDropdown container={myContainer} />
|
|
30
51
|
*
|
|
31
52
|
* @since 4.11.0
|
|
32
53
|
*/
|
|
33
54
|
container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null;
|
|
34
55
|
/**
|
|
35
|
-
*
|
|
56
|
+
* Applies a darker color scheme to the React Dropdown Menu, often used within dark navbars.
|
|
36
57
|
*/
|
|
37
58
|
dark?: boolean;
|
|
38
59
|
/**
|
|
39
|
-
*
|
|
60
|
+
* Specifies the direction of the React Dropdown.
|
|
40
61
|
*/
|
|
41
62
|
direction?: 'center' | 'dropup' | 'dropup-center' | 'dropend' | 'dropstart';
|
|
42
63
|
/**
|
|
43
|
-
*
|
|
64
|
+
* Defines x and y offsets ([x, y]) for the React Dropdown Menu relative to its target.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Offset the menu 10px in X and 5px in Y direction
|
|
68
|
+
* <CDropdown offset={[10, 5]}>
|
|
69
|
+
* ...
|
|
70
|
+
* </CDropdown>
|
|
44
71
|
*/
|
|
45
72
|
offset?: [number, number];
|
|
46
73
|
/**
|
|
47
|
-
* Callback fired
|
|
74
|
+
* Callback fired right before the React Dropdown becomes hidden.
|
|
48
75
|
*
|
|
49
76
|
* @since 4.9.0
|
|
50
77
|
*/
|
|
51
78
|
onHide?: () => void;
|
|
52
79
|
/**
|
|
53
|
-
* Callback fired
|
|
80
|
+
* Callback fired immediately after the React Dropdown is displayed.
|
|
54
81
|
*/
|
|
55
82
|
onShow?: () => void;
|
|
56
83
|
/**
|
|
57
|
-
*
|
|
84
|
+
* Determines the placement of the React Dropdown Menu after Popper.js modifiers.
|
|
58
85
|
*
|
|
59
|
-
* @type 'auto' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end'
|
|
86
|
+
* @type 'auto' | 'auto-start' | 'auto-end' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end'
|
|
60
87
|
*/
|
|
61
88
|
placement?: Placements;
|
|
62
89
|
/**
|
|
63
|
-
*
|
|
90
|
+
* Enables or disables dynamic positioning via Popper.js for the React Dropdown Menu.
|
|
64
91
|
*/
|
|
65
92
|
popper?: boolean;
|
|
66
93
|
/**
|
|
67
|
-
*
|
|
94
|
+
* Provides a custom Popper.js configuration or a function that returns a modified Popper.js configuration for advanced positioning of the React Dropdown Menu. [Read more](https://popper.js.org/docs/v2/constructors/#options)
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* // Providing a custom popper config
|
|
98
|
+
* <CDropdown
|
|
99
|
+
* popperConfig={{
|
|
100
|
+
* modifiers: [
|
|
101
|
+
* {
|
|
102
|
+
* name: 'flip',
|
|
103
|
+
* options: { fallbackPlacements: ['bottom', 'top'] },
|
|
104
|
+
* },
|
|
105
|
+
* ],
|
|
106
|
+
* }}
|
|
107
|
+
* >...</CDropdown>
|
|
108
|
+
*
|
|
109
|
+
* @since 5.5.0
|
|
110
|
+
*/
|
|
111
|
+
popperConfig?: Partial<Options> | ((defaultPopperConfig: Partial<Options>) => Partial<Options>);
|
|
112
|
+
/**
|
|
113
|
+
* Renders the React Dropdown Menu using a React Portal, allowing it to escape the DOM hierarchy for improved positioning.
|
|
68
114
|
*
|
|
69
115
|
* @since 4.8.0
|
|
70
116
|
*/
|
|
71
117
|
portal?: boolean;
|
|
72
118
|
/**
|
|
73
|
-
*
|
|
119
|
+
* Defines the visual variant of the React Dropdown
|
|
74
120
|
*/
|
|
75
121
|
variant?: 'btn-group' | 'dropdown' | 'input-group' | 'nav-item';
|
|
76
122
|
/**
|
|
77
|
-
*
|
|
123
|
+
* Controls the visibility of the React Dropdown Menu:
|
|
124
|
+
* - `true` - Visible
|
|
125
|
+
* - `false` - Hidden
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* // Programmatically manage the dropdown visibility
|
|
129
|
+
* const [visible, setVisible] = useState(false)
|
|
130
|
+
*
|
|
131
|
+
* <CDropdown visible={visible}>
|
|
132
|
+
* ...
|
|
133
|
+
* </CDropdown>
|
|
134
|
+
*
|
|
78
135
|
*/
|
|
79
136
|
visible?: boolean;
|
|
80
137
|
}
|
|
@@ -12,7 +12,7 @@ import { getPlacement } from './utils.js';
|
|
|
12
12
|
var CDropdownContext = createContext({});
|
|
13
13
|
var CDropdown = forwardRef(function (_a, ref) {
|
|
14
14
|
var _b;
|
|
15
|
-
var children = _a.children, alignment = _a.alignment, _c = _a.as, as = _c === void 0 ? 'div' : _c, _d = _a.autoClose, autoClose = _d === void 0 ? true : _d, className = _a.className, container = _a.container, dark = _a.dark, direction = _a.direction, _e = _a.offset, offset = _e === void 0 ? [0, 2] : _e, onHide = _a.onHide, onShow = _a.onShow, _f = _a.placement, placement = _f === void 0 ? 'bottom-start' : _f, _g = _a.popper, popper = _g === void 0 ? true : _g, _h = _a.portal, portal = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'btn-group' : _j, _k = _a.visible, visible = _k === void 0 ? false : _k, rest = __rest(_a, ["children", "alignment", "as", "autoClose", "className", "container", "dark", "direction", "offset", "onHide", "onShow", "placement", "popper", "portal", "variant", "visible"]);
|
|
15
|
+
var children = _a.children, alignment = _a.alignment, _c = _a.as, as = _c === void 0 ? 'div' : _c, _d = _a.autoClose, autoClose = _d === void 0 ? true : _d, className = _a.className, container = _a.container, dark = _a.dark, direction = _a.direction, _e = _a.offset, offset = _e === void 0 ? [0, 2] : _e, onHide = _a.onHide, onShow = _a.onShow, _f = _a.placement, placement = _f === void 0 ? 'bottom-start' : _f, _g = _a.popper, popper = _g === void 0 ? true : _g, popperConfig = _a.popperConfig, _h = _a.portal, portal = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'btn-group' : _j, _k = _a.visible, visible = _k === void 0 ? false : _k, rest = __rest(_a, ["children", "alignment", "as", "autoClose", "className", "container", "dark", "direction", "offset", "onHide", "onShow", "placement", "popper", "popperConfig", "portal", "variant", "visible"]);
|
|
16
16
|
var dropdownRef = useRef(null);
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
18
|
var dropdownToggleRef = useRef(null);
|
|
@@ -37,7 +37,7 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
37
37
|
visible: _visible,
|
|
38
38
|
setVisible: setVisible,
|
|
39
39
|
};
|
|
40
|
-
var
|
|
40
|
+
var defaultPopperConfig = {
|
|
41
41
|
modifiers: [
|
|
42
42
|
{
|
|
43
43
|
name: 'offset',
|
|
@@ -48,13 +48,15 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
48
48
|
],
|
|
49
49
|
placement: getPlacement(placement, direction, alignment, isRTL(dropdownMenuRef.current)),
|
|
50
50
|
};
|
|
51
|
+
var computedPopperConfig = __assign(__assign({}, defaultPopperConfig), (typeof popperConfig === 'function' ? popperConfig(defaultPopperConfig) : popperConfig));
|
|
51
52
|
useEffect(function () {
|
|
52
53
|
setVisible(visible);
|
|
53
54
|
}, [visible]);
|
|
54
55
|
useEffect(function () {
|
|
55
56
|
if (_visible && dropdownToggleRef.current && dropdownMenuRef.current) {
|
|
56
57
|
dropdownToggleRef.current.focus();
|
|
57
|
-
popper &&
|
|
58
|
+
popper &&
|
|
59
|
+
initPopper(dropdownToggleRef.current, dropdownMenuRef.current, computedPopperConfig);
|
|
58
60
|
window.addEventListener('mouseup', handleMouseUp);
|
|
59
61
|
window.addEventListener('keyup', handleKeyup);
|
|
60
62
|
dropdownToggleRef.current.addEventListener('keydown', handleKeydown);
|
|
@@ -136,6 +138,7 @@ CDropdown.propTypes = {
|
|
|
136
138
|
onShow: PropTypes.func,
|
|
137
139
|
placement: placementPropType,
|
|
138
140
|
popper: PropTypes.bool,
|
|
141
|
+
popperConfig: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
139
142
|
portal: PropTypes.bool,
|
|
140
143
|
variant: PropTypes.oneOf(['btn-group', 'dropdown', 'input-group', 'nav-item']),
|
|
141
144
|
visible: PropTypes.bool,
|