@patternfly/react-core 4.238.0 → 4.239.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.
- package/CHANGELOG.md +19 -0
- package/dist/esm/next/components/Dropdown/Dropdown.d.ts +25 -0
- package/dist/esm/next/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/esm/next/components/Dropdown/Dropdown.js +59 -0
- package/dist/esm/next/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/esm/next/components/Dropdown/DropdownGroup.d.ts +12 -0
- package/dist/esm/next/components/Dropdown/DropdownGroup.d.ts.map +1 -0
- package/dist/esm/next/components/Dropdown/DropdownGroup.js +10 -0
- package/dist/esm/next/components/Dropdown/DropdownGroup.js.map +1 -0
- package/dist/esm/next/components/Dropdown/DropdownItem.d.ts +12 -0
- package/dist/esm/next/components/Dropdown/DropdownItem.d.ts.map +1 -0
- package/dist/esm/next/components/Dropdown/DropdownItem.js +10 -0
- package/dist/esm/next/components/Dropdown/DropdownItem.js.map +1 -0
- package/dist/esm/next/components/Dropdown/DropdownList.d.ts +10 -0
- package/dist/esm/next/components/Dropdown/DropdownList.d.ts.map +1 -0
- package/dist/esm/next/components/Dropdown/DropdownList.js +10 -0
- package/dist/esm/next/components/Dropdown/DropdownList.js.map +1 -0
- package/dist/esm/next/components/Dropdown/index.d.ts +5 -0
- package/dist/esm/next/components/Dropdown/index.d.ts.map +1 -0
- package/dist/esm/next/components/Dropdown/index.js +5 -0
- package/dist/esm/next/components/Dropdown/index.js.map +1 -0
- package/dist/esm/next/components/index.d.ts +1 -0
- package/dist/esm/next/components/index.d.ts.map +1 -1
- package/dist/esm/next/components/index.js +1 -0
- package/dist/esm/next/components/index.js.map +1 -1
- package/dist/js/next/components/Dropdown/Dropdown.d.ts +25 -0
- package/dist/js/next/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/js/next/components/Dropdown/Dropdown.js +63 -0
- package/dist/js/next/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/js/next/components/Dropdown/DropdownGroup.d.ts +12 -0
- package/dist/js/next/components/Dropdown/DropdownGroup.d.ts.map +1 -0
- package/dist/js/next/components/Dropdown/DropdownGroup.js +14 -0
- package/dist/js/next/components/Dropdown/DropdownGroup.js.map +1 -0
- package/dist/js/next/components/Dropdown/DropdownItem.d.ts +12 -0
- package/dist/js/next/components/Dropdown/DropdownItem.d.ts.map +1 -0
- package/dist/js/next/components/Dropdown/DropdownItem.js +14 -0
- package/dist/js/next/components/Dropdown/DropdownItem.js.map +1 -0
- package/dist/js/next/components/Dropdown/DropdownList.d.ts +10 -0
- package/dist/js/next/components/Dropdown/DropdownList.d.ts.map +1 -0
- package/dist/js/next/components/Dropdown/DropdownList.js +14 -0
- package/dist/js/next/components/Dropdown/DropdownList.js.map +1 -0
- package/dist/js/next/components/Dropdown/index.d.ts +5 -0
- package/dist/js/next/components/Dropdown/index.d.ts.map +1 -0
- package/dist/js/next/components/Dropdown/index.js +8 -0
- package/dist/js/next/components/Dropdown/index.js.map +1 -0
- package/dist/js/next/components/index.d.ts +1 -0
- package/dist/js/next/components/index.d.ts.map +1 -1
- package/dist/js/next/components/index.js +1 -0
- package/dist/js/next/components/index.js.map +1 -1
- package/dist/umd/react-core.min.css +12305 -12305
- package/package.json +5 -5
- package/src/next/components/Dropdown/Dropdown.tsx +115 -0
- package/src/next/components/Dropdown/DropdownGroup.tsx +25 -0
- package/src/next/components/Dropdown/DropdownItem.tsx +24 -0
- package/src/next/components/Dropdown/DropdownList.tsx +21 -0
- package/src/next/components/Dropdown/examples/Dropdown.md +31 -0
- package/src/next/components/Dropdown/examples/DropdownBasic.tsx +54 -0
- package/src/next/components/Dropdown/examples/DropdownWithDescriptions.tsx +60 -0
- package/src/next/components/Dropdown/examples/DropdownWithGroups.tsx +65 -0
- package/src/next/components/Dropdown/examples/DropdownWithKebabToggle.tsx +62 -0
- package/src/next/components/Dropdown/index.ts +4 -0
- package/src/next/components/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.239.1 (2022-09-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 4.239.0 (2022-09-14)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **Dropdown next:** Added the next version of the dropdown component ([#7955](https://github.com/patternfly/patternfly-react/issues/7955)) ([c092c7c](https://github.com/patternfly/patternfly-react/commit/c092c7cfaf877c5783c9ad9db0a8010b8ea023eb))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# 4.238.0 (2022-09-14)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuProps } from '../../../components/Menu';
|
|
3
|
+
export interface DropdownProps extends MenuProps {
|
|
4
|
+
/** Anything which can be rendered in a dropdown. */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Classes applied to root element of dropdown. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Renderer for a custom dropdown toggle. Forwards a ref to the toggle. */
|
|
9
|
+
toggle: (toggleRef: React.RefObject<any>) => React.ReactNode;
|
|
10
|
+
/** Flag to indicate if menu is opened.*/
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
/** Function callback called when user selects item. */
|
|
13
|
+
onSelect?: (event?: React.MouseEvent<Element, MouseEvent>, itemId?: string | number) => void;
|
|
14
|
+
/** Callback to allow the dropdown component to change the open state of the menu.
|
|
15
|
+
* Triggered by clicking outside of the menu, or by pressing either tab or escape. */
|
|
16
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
17
|
+
/** Indicates if the menu should be without the outer box-shadow. */
|
|
18
|
+
isPlain?: boolean;
|
|
19
|
+
/** Indicates if the menu should be scrollable. */
|
|
20
|
+
isScrollable?: boolean;
|
|
21
|
+
/** Min width of the menu. */
|
|
22
|
+
minWidth?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const Dropdown: React.FunctionComponent<DropdownProps>;
|
|
25
|
+
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAqB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGxE,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,MAAM,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7D,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7F;yFACqF;IACrF,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAsF3D,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { Menu, MenuContent } from '../../../components/Menu';
|
|
5
|
+
import { Popper } from '../../../helpers/Popper/Popper';
|
|
6
|
+
export const Dropdown = (_a) => {
|
|
7
|
+
var { children, className, onSelect, isOpen, toggle, onOpenChange, isPlain, isScrollable, minWidth } = _a, props = __rest(_a, ["children", "className", "onSelect", "isOpen", "toggle", "onOpenChange", "isPlain", "isScrollable", "minWidth"]);
|
|
8
|
+
const localMenuRef = React.useRef();
|
|
9
|
+
const toggleRef = React.useRef();
|
|
10
|
+
const containerRef = React.useRef();
|
|
11
|
+
const menuRef = props.innerRef || localMenuRef;
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
const handleMenuKeys = (event) => {
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
|
+
if (!isOpen && ((_a = toggleRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
16
|
+
// toggle was clicked open, focus on first menu item
|
|
17
|
+
if (event.key === 'Enter') {
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
const firstElement = menuRef.current.querySelector('li > button:not(:disabled)');
|
|
20
|
+
firstElement && firstElement.focus();
|
|
21
|
+
}, 0);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Close the menu on tab or escape if onOpenChange is provided
|
|
25
|
+
if ((isOpen && onOpenChange && ((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) ||
|
|
26
|
+
((_c = toggleRef.current) === null || _c === void 0 ? void 0 : _c.contains(event.target))) {
|
|
27
|
+
if (event.key === 'Escape' || event.key === 'Tab') {
|
|
28
|
+
onOpenChange(!isOpen);
|
|
29
|
+
(_d = toggleRef.current) === null || _d === void 0 ? void 0 : _d.focus();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const handleClickOutside = (event) => {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
// If the event is not on the toggle and onOpenChange callback is provided, close the menu
|
|
36
|
+
if (isOpen && onOpenChange && !((_a = toggleRef === null || toggleRef === void 0 ? void 0 : toggleRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
37
|
+
if (isOpen && !((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) {
|
|
38
|
+
onOpenChange(false);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
window.addEventListener('keydown', handleMenuKeys);
|
|
43
|
+
window.addEventListener('click', handleClickOutside);
|
|
44
|
+
return () => {
|
|
45
|
+
window.removeEventListener('keydown', handleMenuKeys);
|
|
46
|
+
window.removeEventListener('click', handleClickOutside);
|
|
47
|
+
};
|
|
48
|
+
}, [isOpen, menuRef, onOpenChange]);
|
|
49
|
+
const menu = (React.createElement(Menu, Object.assign({ className: css(className), ref: menuRef, onSelect: (event, itemId) => onSelect(event, itemId), isPlain: isPlain, isScrollable: isScrollable }, (minWidth && {
|
|
50
|
+
style: {
|
|
51
|
+
'--pf-c-menu--MinWidth': minWidth
|
|
52
|
+
}
|
|
53
|
+
}), props),
|
|
54
|
+
React.createElement(MenuContent, null, children)));
|
|
55
|
+
return (React.createElement("div", { ref: containerRef },
|
|
56
|
+
React.createElement(Popper, { trigger: toggle(toggleRef), removeFindDomNode: true, popper: menu, appendTo: containerRef.current || undefined, isVisible: isOpen })));
|
|
57
|
+
};
|
|
58
|
+
Dropdown.displayName = 'Dropdown';
|
|
59
|
+
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,KA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,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EACpD,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,IACtB,CAAC,QAAQ,IAAI;QACf,KAAK,EAAE;YACL,uBAAuB,EAAE,QAAQ;SACX;KACzB,CAAC,EACE,KAAK;QAET,oBAAC,WAAW,QAAE,QAAQ,CAAe,CAChC,CACR,CAAC;IACF,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY;QACpB,oBAAC,MAAM,IACL,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,EAC1B,iBAAiB,QACjB,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,YAAY,CAAC,OAAO,IAAI,SAAS,EAC3C,SAAS,EAAE,MAAM,GACjB,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuGroupProps } from '../../../components/Menu';
|
|
3
|
+
export interface DropdownGroupProps extends Omit<MenuGroupProps, 'ref'> {
|
|
4
|
+
/** Anything which can be rendered in a dropdown group. */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Classes applied to root element of dropdown group */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Label of the dropdown group */
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const DropdownGroup: React.FunctionComponent<DropdownGroupProps>;
|
|
12
|
+
//# sourceMappingURL=DropdownGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownGroup.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAErE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC;IACrE,0DAA0D;IAC1D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAUrE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { MenuGroup } from '../../../components/Menu';
|
|
5
|
+
export const DropdownGroup = (_a) => {
|
|
6
|
+
var { children, className, label, labelHeadingLevel = 'h1' } = _a, props = __rest(_a, ["children", "className", "label", "labelHeadingLevel"]);
|
|
7
|
+
return (React.createElement(MenuGroup, Object.assign({ className: css(className), label: label, labelHeadingLevel: labelHeadingLevel }, props), children));
|
|
8
|
+
};
|
|
9
|
+
DropdownGroup.displayName = 'DropdownGroup';
|
|
10
|
+
//# sourceMappingURL=DropdownGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownGroup.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAWrE,MAAM,CAAC,MAAM,aAAa,GAAgD,CAAC,EAMtD,EAAE,EAAE;QANkD,EACzE,QAAQ,EACR,SAAS,EACT,KAAK,EACL,iBAAiB,GAAG,IAAI,OAEL,EADhB,KAAK,cALiE,uDAM1E,CADS;IACgB,OAAA,CACxB,oBAAC,SAAS,kBAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,IAAM,KAAK,GAChG,QAAQ,CACC,CACb,CAAA;CAAA,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuItemProps } from '../../../components/Menu';
|
|
3
|
+
export interface DropdownItemProps extends Omit<MenuItemProps, 'ref'> {
|
|
4
|
+
/** Anything which can be rendered in a dropdown item */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Classes applied to root element of dropdown item */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Description of the dropdown item */
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const DropdownItem: React.FunctionComponent<MenuItemProps>;
|
|
12
|
+
//# sourceMappingURL=DropdownItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownItem.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAY,MAAM,0BAA0B,CAAC;AAEnE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC;IACnE,wDAAwD;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAS/D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { MenuItem } from '../../../components/Menu';
|
|
5
|
+
export const DropdownItem = (_a) => {
|
|
6
|
+
var { children, className, description } = _a, props = __rest(_a, ["children", "className", "description"]);
|
|
7
|
+
return (React.createElement(MenuItem, Object.assign({ className: css(className), description: description }, props), children));
|
|
8
|
+
};
|
|
9
|
+
DropdownItem.displayName = 'DropdownItem';
|
|
10
|
+
//# sourceMappingURL=DropdownItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownItem.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAiB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAWnE,MAAM,CAAC,MAAM,YAAY,GAA2C,CAAC,EAKjD,EAAE,EAAE;QAL6C,EACnE,QAAQ,EACR,SAAS,EACT,WAAW,OAEO,EADf,KAAK,cAJ2D,wCAKpE,CADS;IACe,OAAA,CACvB,oBAAC,QAAQ,kBAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,WAAW,IAAM,KAAK,GACrE,QAAQ,CACA,CACZ,CAAA;CAAA,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuListProps } from '../../../components/Menu';
|
|
3
|
+
export interface DropdownListProps extends MenuListProps {
|
|
4
|
+
/** Anything which can be rendered in a dropdown list */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Classes applied to root element of dropdown list */
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DropdownList: React.FunctionComponent<MenuListProps>;
|
|
10
|
+
//# sourceMappingURL=DropdownList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownList.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAY,MAAM,0BAA0B,CAAC;AAEnE,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,wDAAwD;IACxD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAQ/D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { MenuList } from '../../../components/Menu';
|
|
5
|
+
export const DropdownList = (_a) => {
|
|
6
|
+
var { children, className } = _a, props = __rest(_a, ["children", "className"]);
|
|
7
|
+
return (React.createElement(MenuList, Object.assign({ className: css(className) }, props), children));
|
|
8
|
+
};
|
|
9
|
+
DropdownList.displayName = 'DropdownList';
|
|
10
|
+
//# sourceMappingURL=DropdownList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownList.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAiB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AASnE,MAAM,CAAC,MAAM,YAAY,GAA2C,CAAC,EAIjD,EAAE,EAAE;QAJ6C,EACnE,QAAQ,EACR,SAAS,OAES,EADf,KAAK,cAH2D,yBAIpE,CADS;IACe,OAAA,CACvB,oBAAC,QAAQ,kBAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,IAAM,KAAK,GAC3C,QAAQ,CACA,CACZ,CAAA;CAAA,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuProps } from '../../../components/Menu';
|
|
3
|
+
export interface DropdownProps extends MenuProps {
|
|
4
|
+
/** Anything which can be rendered in a dropdown. */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Classes applied to root element of dropdown. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Renderer for a custom dropdown toggle. Forwards a ref to the toggle. */
|
|
9
|
+
toggle: (toggleRef: React.RefObject<any>) => React.ReactNode;
|
|
10
|
+
/** Flag to indicate if menu is opened.*/
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
/** Function callback called when user selects item. */
|
|
13
|
+
onSelect?: (event?: React.MouseEvent<Element, MouseEvent>, itemId?: string | number) => void;
|
|
14
|
+
/** Callback to allow the dropdown component to change the open state of the menu.
|
|
15
|
+
* Triggered by clicking outside of the menu, or by pressing either tab or escape. */
|
|
16
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
17
|
+
/** Indicates if the menu should be without the outer box-shadow. */
|
|
18
|
+
isPlain?: boolean;
|
|
19
|
+
/** Indicates if the menu should be scrollable. */
|
|
20
|
+
isScrollable?: boolean;
|
|
21
|
+
/** Min width of the menu. */
|
|
22
|
+
minWidth?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const Dropdown: React.FunctionComponent<DropdownProps>;
|
|
25
|
+
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAqB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGxE,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,MAAM,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7D,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7F;yFACqF;IACrF,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAsF3D,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Dropdown = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const react_styles_1 = require("@patternfly/react-styles");
|
|
7
|
+
const Menu_1 = require("../../../components/Menu");
|
|
8
|
+
const Popper_1 = require("../../../helpers/Popper/Popper");
|
|
9
|
+
const Dropdown = (_a) => {
|
|
10
|
+
var { children, className, onSelect, isOpen, toggle, onOpenChange, isPlain, isScrollable, minWidth } = _a, props = tslib_1.__rest(_a, ["children", "className", "onSelect", "isOpen", "toggle", "onOpenChange", "isPlain", "isScrollable", "minWidth"]);
|
|
11
|
+
const localMenuRef = react_1.default.useRef();
|
|
12
|
+
const toggleRef = react_1.default.useRef();
|
|
13
|
+
const containerRef = react_1.default.useRef();
|
|
14
|
+
const menuRef = props.innerRef || localMenuRef;
|
|
15
|
+
react_1.default.useEffect(() => {
|
|
16
|
+
const handleMenuKeys = (event) => {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
|
+
if (!isOpen && ((_a = toggleRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
19
|
+
// toggle was clicked open, focus on first menu item
|
|
20
|
+
if (event.key === 'Enter') {
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
const firstElement = menuRef.current.querySelector('li > button:not(:disabled)');
|
|
23
|
+
firstElement && firstElement.focus();
|
|
24
|
+
}, 0);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Close the menu on tab or escape if onOpenChange is provided
|
|
28
|
+
if ((isOpen && onOpenChange && ((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) ||
|
|
29
|
+
((_c = toggleRef.current) === null || _c === void 0 ? void 0 : _c.contains(event.target))) {
|
|
30
|
+
if (event.key === 'Escape' || event.key === 'Tab') {
|
|
31
|
+
onOpenChange(!isOpen);
|
|
32
|
+
(_d = toggleRef.current) === null || _d === void 0 ? void 0 : _d.focus();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const handleClickOutside = (event) => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
// If the event is not on the toggle and onOpenChange callback is provided, close the menu
|
|
39
|
+
if (isOpen && onOpenChange && !((_a = toggleRef === null || toggleRef === void 0 ? void 0 : toggleRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
40
|
+
if (isOpen && !((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) {
|
|
41
|
+
onOpenChange(false);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
window.addEventListener('keydown', handleMenuKeys);
|
|
46
|
+
window.addEventListener('click', handleClickOutside);
|
|
47
|
+
return () => {
|
|
48
|
+
window.removeEventListener('keydown', handleMenuKeys);
|
|
49
|
+
window.removeEventListener('click', handleClickOutside);
|
|
50
|
+
};
|
|
51
|
+
}, [isOpen, menuRef, onOpenChange]);
|
|
52
|
+
const menu = (react_1.default.createElement(Menu_1.Menu, Object.assign({ className: react_styles_1.css(className), ref: menuRef, onSelect: (event, itemId) => onSelect(event, itemId), isPlain: isPlain, isScrollable: isScrollable }, (minWidth && {
|
|
53
|
+
style: {
|
|
54
|
+
'--pf-c-menu--MinWidth': minWidth
|
|
55
|
+
}
|
|
56
|
+
}), props),
|
|
57
|
+
react_1.default.createElement(Menu_1.MenuContent, null, children)));
|
|
58
|
+
return (react_1.default.createElement("div", { ref: containerRef },
|
|
59
|
+
react_1.default.createElement(Popper_1.Popper, { trigger: toggle(toggleRef), removeFindDomNode: true, popper: menu, appendTo: containerRef.current || undefined, isVisible: isOpen })));
|
|
60
|
+
};
|
|
61
|
+
exports.Dropdown = Dropdown;
|
|
62
|
+
exports.Dropdown.displayName = 'Dropdown';
|
|
63
|
+
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,2DAA+C;AAC/C,mDAAwE;AACxE,2DAAwD;AAwBjD,MAAM,QAAQ,GAA2C,CAAC,EAWjD,EAAE,EAAE;QAX6C,EAC/D,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,QAAQ,OAEM,EADX,KAAK,sBAVuD,gHAWhE,CADS;IAER,MAAM,YAAY,GAAG,eAAK,CAAC,MAAM,EAAkB,CAAC;IACpD,MAAM,SAAS,GAAG,eAAK,CAAC,MAAM,EAAqB,CAAC;IACpD,MAAM,YAAY,GAAG,eAAK,CAAC,MAAM,EAAkB,CAAC;IAEpD,MAAM,OAAO,GAAI,KAAK,CAAC,QAA4C,IAAI,YAAY,CAAC;IACpF,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,cAAc,GAAG,CAAC,KAAoB,EAAE,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Props extends Omit<MenuGroupProps, 'ref'> {
|
|
4
|
+
/** Anything which can be rendered in a dropdown group. */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Classes applied to root element of dropdown group */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Label of the dropdown group */
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const DropdownGroup: React.FunctionComponent<DropdownGroupProps>;
|
|
12
|
+
//# sourceMappingURL=DropdownGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownGroup.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAErE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC;IACrE,0DAA0D;IAC1D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAUrE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropdownGroup = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const react_styles_1 = require("@patternfly/react-styles");
|
|
7
|
+
const Menu_1 = require("../../../components/Menu");
|
|
8
|
+
const DropdownGroup = (_a) => {
|
|
9
|
+
var { children, className, label, labelHeadingLevel = 'h1' } = _a, props = tslib_1.__rest(_a, ["children", "className", "label", "labelHeadingLevel"]);
|
|
10
|
+
return (react_1.default.createElement(Menu_1.MenuGroup, Object.assign({ className: react_styles_1.css(className), label: label, labelHeadingLevel: labelHeadingLevel }, props), children));
|
|
11
|
+
};
|
|
12
|
+
exports.DropdownGroup = DropdownGroup;
|
|
13
|
+
exports.DropdownGroup.displayName = 'DropdownGroup';
|
|
14
|
+
//# sourceMappingURL=DropdownGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownGroup.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownGroup.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,2DAA+C;AAC/C,mDAAqE;AAW9D,MAAM,aAAa,GAAgD,CAAC,EAMtD,EAAE,EAAE;QANkD,EACzE,QAAQ,EACR,SAAS,EACT,KAAK,EACL,iBAAiB,GAAG,IAAI,OAEL,EADhB,KAAK,sBALiE,uDAM1E,CADS;IACgB,OAAA,CACxB,8BAAC,gBAAS,kBAAC,SAAS,EAAE,kBAAG,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,IAAM,KAAK,GAChG,QAAQ,CACC,CACb,CAAA;CAAA,CAAC;AAVW,QAAA,aAAa,iBAUxB;AACF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuItemProps } from '../../../components/Menu';
|
|
3
|
+
export interface DropdownItemProps extends Omit<MenuItemProps, 'ref'> {
|
|
4
|
+
/** Anything which can be rendered in a dropdown item */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Classes applied to root element of dropdown item */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Description of the dropdown item */
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const DropdownItem: React.FunctionComponent<MenuItemProps>;
|
|
12
|
+
//# sourceMappingURL=DropdownItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownItem.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAY,MAAM,0BAA0B,CAAC;AAEnE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC;IACnE,wDAAwD;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAS/D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropdownItem = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const react_styles_1 = require("@patternfly/react-styles");
|
|
7
|
+
const Menu_1 = require("../../../components/Menu");
|
|
8
|
+
const DropdownItem = (_a) => {
|
|
9
|
+
var { children, className, description } = _a, props = tslib_1.__rest(_a, ["children", "className", "description"]);
|
|
10
|
+
return (react_1.default.createElement(Menu_1.MenuItem, Object.assign({ className: react_styles_1.css(className), description: description }, props), children));
|
|
11
|
+
};
|
|
12
|
+
exports.DropdownItem = DropdownItem;
|
|
13
|
+
exports.DropdownItem.displayName = 'DropdownItem';
|
|
14
|
+
//# sourceMappingURL=DropdownItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownItem.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownItem.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,2DAA+C;AAC/C,mDAAmE;AAW5D,MAAM,YAAY,GAA2C,CAAC,EAKjD,EAAE,EAAE;QAL6C,EACnE,QAAQ,EACR,SAAS,EACT,WAAW,OAEO,EADf,KAAK,sBAJ2D,wCAKpE,CADS;IACe,OAAA,CACvB,8BAAC,eAAQ,kBAAC,SAAS,EAAE,kBAAG,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,WAAW,IAAM,KAAK,GACrE,QAAQ,CACA,CACZ,CAAA;CAAA,CAAC;AATW,QAAA,YAAY,gBASvB;AACF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuListProps } from '../../../components/Menu';
|
|
3
|
+
export interface DropdownListProps extends MenuListProps {
|
|
4
|
+
/** Anything which can be rendered in a dropdown list */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Classes applied to root element of dropdown list */
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DropdownList: React.FunctionComponent<MenuListProps>;
|
|
10
|
+
//# sourceMappingURL=DropdownList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownList.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAY,MAAM,0BAA0B,CAAC;AAEnE,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,wDAAwD;IACxD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa,CAQ/D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropdownList = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const react_styles_1 = require("@patternfly/react-styles");
|
|
7
|
+
const Menu_1 = require("../../../components/Menu");
|
|
8
|
+
const DropdownList = (_a) => {
|
|
9
|
+
var { children, className } = _a, props = tslib_1.__rest(_a, ["children", "className"]);
|
|
10
|
+
return (react_1.default.createElement(Menu_1.MenuList, Object.assign({ className: react_styles_1.css(className) }, props), children));
|
|
11
|
+
};
|
|
12
|
+
exports.DropdownList = DropdownList;
|
|
13
|
+
exports.DropdownList.displayName = 'DropdownList';
|
|
14
|
+
//# sourceMappingURL=DropdownList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownList.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/DropdownList.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,2DAA+C;AAC/C,mDAAmE;AAS5D,MAAM,YAAY,GAA2C,CAAC,EAIjD,EAAE,EAAE;QAJ6C,EACnE,QAAQ,EACR,SAAS,OAES,EADf,KAAK,sBAH2D,yBAIpE,CADS;IACe,OAAA,CACvB,8BAAC,eAAQ,kBAAC,SAAS,EAAE,kBAAG,CAAC,SAAS,CAAC,IAAM,KAAK,GAC3C,QAAQ,CACA,CACZ,CAAA;CAAA,CAAC;AARW,QAAA,YAAY,gBAQvB;AACF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./Dropdown"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./DropdownGroup"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./DropdownItem"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./DropdownList"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/next/components/Dropdown/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,0DAAgC;AAChC,yDAA+B;AAC/B,yDAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,qDAA2B"}
|