@elliemae/ds-global-header 1.60.0 → 2.0.0-alpha.12
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/cjs/GlobalHeader.js +16 -36
- package/cjs/GlobalHeaderContainer.js +10 -10
- package/cjs/GlobalHeaderContext.js +3 -6
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js +40 -39
- package/cjs/components/Breadcrumb/PureBreadcrumb.js +17 -14
- package/cjs/components/Breadcrumb/styles.js +34 -21
- package/cjs/components/Title/GlobalHeaderTitle.js +12 -12
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js +10 -20
- package/cjs/components/Toolbar/ToolbarItems.js +65 -71
- package/cjs/components/Toolbar/styles.js +13 -8
- package/cjs/config/useGetPropsWithDefaults.js +14 -10
- package/cjs/config/useGlobalHeader.js +22 -36
- package/cjs/config/useValidateProps.js +35 -32
- package/cjs/config/validateHelpers.js +12 -23
- package/cjs/defaultProps.js +5 -4
- package/cjs/index.d.js +0 -1
- package/cjs/index.js +1 -34
- package/cjs/outOfTheBox/AppPicker/AppPicker.js +66 -65
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js +44 -73
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +67 -50
- package/cjs/outOfTheBox/PopupMenu/styles.js +8 -7
- package/cjs/outOfTheBox/index.js +4 -16
- package/cjs/propTypes.js +3 -4
- package/cjs/styles.js +5 -4
- package/esm/GlobalHeader.js +9 -29
- package/esm/GlobalHeaderContainer.js +9 -9
- package/esm/GlobalHeaderContext.js +3 -6
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js +38 -37
- package/esm/components/Breadcrumb/PureBreadcrumb.js +15 -13
- package/esm/components/Breadcrumb/styles.js +34 -21
- package/esm/components/Title/GlobalHeaderTitle.js +12 -12
- package/esm/components/Toolbar/GlobalHeaderToolbar.js +9 -19
- package/esm/components/Toolbar/ToolbarItems.js +61 -68
- package/esm/components/Toolbar/styles.js +13 -8
- package/esm/config/useGetPropsWithDefaults.js +13 -9
- package/esm/config/useGlobalHeader.js +20 -32
- package/esm/config/useValidateProps.js +15 -12
- package/esm/config/validateHelpers.js +12 -19
- package/esm/defaultProps.js +5 -4
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -33
- package/esm/outOfTheBox/AppPicker/AppPicker.js +65 -63
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js +42 -69
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +65 -50
- package/esm/outOfTheBox/PopupMenu/styles.js +8 -7
- package/esm/outOfTheBox/index.js +0 -12
- package/esm/propTypes.js +3 -4
- package/esm/styles.js +5 -4
- package/package.json +123 -16
- package/types/GlobalHeader.d.ts +39 -0
- package/types/GlobalHeaderContainer.d.ts +3 -0
- package/types/GlobalHeaderContext.d.ts +3 -0
- package/types/components/Breadcrumb/GlobalHeaderBreadcrumb.d.ts +2 -0
- package/types/components/Breadcrumb/PureBreadcrumb.d.ts +3 -0
- package/types/components/Breadcrumb/styles.d.ts +5 -0
- package/types/components/Title/GlobalHeaderTitle.d.ts +2 -0
- package/types/components/Toolbar/GlobalHeaderToolbar.d.ts +2 -0
- package/types/components/Toolbar/ToolbarItems.d.ts +2 -0
- package/types/components/Toolbar/styles.d.ts +1 -0
- package/types/config/useGetPropsWithDefaults.d.ts +2 -0
- package/types/config/useGlobalHeader.d.ts +2 -0
- package/types/config/useValidateProps.d.ts +2 -0
- package/types/config/validateHelpers.d.ts +27 -0
- package/types/defaultProps.d.ts +2 -0
- package/types/index.d.d.ts +68 -0
- package/types/index.d.ts +2 -0
- package/types/outOfTheBox/AppPicker/AppPicker.d.ts +8 -0
- package/types/outOfTheBox/PopupMenu/PopupMenu.d.ts +3 -0
- package/types/outOfTheBox/PopupMenu/PopupMenuContent.d.ts +3 -0
- package/types/outOfTheBox/PopupMenu/styles.d.ts +4 -0
- package/types/outOfTheBox/index.d.ts +2 -0
- package/types/propTypes.d.ts +29 -0
- package/types/styles.d.ts +2 -0
- package/GlobalHeader/package.json +0 -10
- package/GlobalHeaderContainer/package.json +0 -10
- package/GlobalHeaderContext/package.json +0 -10
- package/cjs/GlobalHeader.js.map +0 -1
- package/cjs/GlobalHeaderContainer.js.map +0 -1
- package/cjs/GlobalHeaderContext.js.map +0 -1
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +0 -1
- package/cjs/components/Breadcrumb/PureBreadcrumb.js.map +0 -1
- package/cjs/components/Breadcrumb/styles.js.map +0 -1
- package/cjs/components/Title/GlobalHeaderTitle.js.map +0 -1
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js.map +0 -1
- package/cjs/components/Toolbar/ToolbarItems.js.map +0 -1
- package/cjs/components/Toolbar/styles.js.map +0 -1
- package/cjs/config/useGetPropsWithDefaults.js.map +0 -1
- package/cjs/config/useGlobalHeader.js.map +0 -1
- package/cjs/config/useValidateProps.js.map +0 -1
- package/cjs/config/validateHelpers.js.map +0 -1
- package/cjs/defaultProps.js.map +0 -1
- package/cjs/index.d.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/outOfTheBox/AppPicker/AppPicker.js.map +0 -1
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js.map +0 -1
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js.map +0 -1
- package/cjs/outOfTheBox/PopupMenu/styles.js.map +0 -1
- package/cjs/outOfTheBox/index.js.map +0 -1
- package/cjs/propTypes.js.map +0 -1
- package/cjs/styles.js.map +0 -1
- package/components/Breadcrumb/GlobalHeaderBreadcrumb/package.json +0 -10
- package/components/Breadcrumb/PureBreadcrumb/package.json +0 -10
- package/components/Breadcrumb/styles/package.json +0 -10
- package/components/Title/GlobalHeaderTitle/package.json +0 -10
- package/components/Toolbar/GlobalHeaderToolbar/package.json +0 -10
- package/components/Toolbar/ToolbarItems/package.json +0 -10
- package/components/Toolbar/styles/package.json +0 -10
- package/config/useGetPropsWithDefaults/package.json +0 -10
- package/config/useGlobalHeader/package.json +0 -10
- package/config/useValidateProps/package.json +0 -10
- package/config/validateHelpers/package.json +0 -10
- package/defaultProps/package.json +0 -10
- package/esm/GlobalHeader.js.map +0 -1
- package/esm/GlobalHeaderContainer.js.map +0 -1
- package/esm/GlobalHeaderContext.js.map +0 -1
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +0 -1
- package/esm/components/Breadcrumb/PureBreadcrumb.js.map +0 -1
- package/esm/components/Breadcrumb/styles.js.map +0 -1
- package/esm/components/Title/GlobalHeaderTitle.js.map +0 -1
- package/esm/components/Toolbar/GlobalHeaderToolbar.js.map +0 -1
- package/esm/components/Toolbar/ToolbarItems.js.map +0 -1
- package/esm/components/Toolbar/styles.js.map +0 -1
- package/esm/config/useGetPropsWithDefaults.js.map +0 -1
- package/esm/config/useGlobalHeader.js.map +0 -1
- package/esm/config/useValidateProps.js.map +0 -1
- package/esm/config/validateHelpers.js.map +0 -1
- package/esm/defaultProps.js.map +0 -1
- package/esm/index.d.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/outOfTheBox/AppPicker/AppPicker.js.map +0 -1
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js.map +0 -1
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js.map +0 -1
- package/esm/outOfTheBox/PopupMenu/styles.js.map +0 -1
- package/esm/outOfTheBox/index.js.map +0 -1
- package/esm/propTypes.js.map +0 -1
- package/esm/styles.js.map +0 -1
- package/outOfTheBox/AppPicker/AppPicker/package.json +0 -10
- package/outOfTheBox/PopupMenu/PopupMenu/package.json +0 -10
- package/outOfTheBox/PopupMenu/PopupMenuContent/package.json +0 -10
- package/outOfTheBox/PopupMenu/styles/package.json +0 -10
- package/outOfTheBox/package.json +0 -10
- package/propTypes/package.json +0 -10
- package/styles/package.json +0 -10
package/esm/index.js
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
1
|
export { GlobalHeader, GlobalHeaderWithSchema, GlobalHeader as default } from './GlobalHeader.js';
|
|
2
|
-
import 'react';
|
|
3
|
-
import 'react-desc';
|
|
4
|
-
import './propTypes.js';
|
|
5
|
-
import './components/Title/GlobalHeaderTitle.js';
|
|
6
|
-
import '@elliemae/ds-grid';
|
|
7
|
-
import './GlobalHeaderContext.js';
|
|
8
|
-
import './defaultProps.js';
|
|
9
|
-
import './components/Breadcrumb/GlobalHeaderBreadcrumb.js';
|
|
10
|
-
import './components/Breadcrumb/styles.js';
|
|
11
|
-
import 'styled-components';
|
|
12
|
-
import './components/Breadcrumb/PureBreadcrumb.js';
|
|
13
|
-
import '@elliemae/ds-icons';
|
|
14
|
-
import './components/Toolbar/GlobalHeaderToolbar.js';
|
|
15
|
-
import './components/Toolbar/ToolbarItems.js';
|
|
16
|
-
import './outOfTheBox/AppPicker/AppPicker.js';
|
|
17
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
18
|
-
import '@elliemae/ds-app-picker';
|
|
19
|
-
import './components/Toolbar/styles.js';
|
|
20
|
-
import './outOfTheBox/PopupMenu/PopupMenu.js';
|
|
21
|
-
import '@elliemae/ds-popover';
|
|
22
|
-
import './outOfTheBox/PopupMenu/PopupMenuContent.js';
|
|
23
|
-
import './outOfTheBox/PopupMenu/styles.js';
|
|
24
|
-
import './config/useGlobalHeader.js';
|
|
25
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
26
|
-
import 'uid';
|
|
27
|
-
import './config/useGetPropsWithDefaults.js';
|
|
28
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
29
|
-
import './GlobalHeaderContainer.js';
|
|
30
|
-
import './styles.js';
|
|
31
|
-
import './config/useValidateProps.js';
|
|
32
|
-
import './config/validateHelpers.js';
|
|
33
|
-
import '@babel/runtime/helpers/esm/typeof';
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,83 +1,85 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import { useState, useRef, useCallback, useMemo } from 'react';
|
|
3
4
|
import { DSAppPicker } from '@elliemae/ds-app-picker';
|
|
5
|
+
import { mergeRefs } from '@elliemae/ds-utilities';
|
|
4
6
|
import { MenuPicker } from '@elliemae/ds-icons';
|
|
5
7
|
import { Button } from '../../components/Toolbar/styles.js';
|
|
6
|
-
import '
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
9
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var buttonRef = useRef();
|
|
30
|
-
var handleTriggerKeyDown = useCallback(function (e) {
|
|
10
|
+
var _MenuPicker;
|
|
11
|
+
const AppPicker = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
label,
|
|
14
|
+
apps,
|
|
15
|
+
icon,
|
|
16
|
+
customApps,
|
|
17
|
+
sectionTitle,
|
|
18
|
+
customSectionTitle,
|
|
19
|
+
actionRef,
|
|
20
|
+
isOpen: userIsOpen,
|
|
21
|
+
onKeyDown: userOnKeyDown,
|
|
22
|
+
onClickOutside: userOnClickOutside,
|
|
23
|
+
renderTrigger: userRenderTrigger,
|
|
24
|
+
onClose,
|
|
25
|
+
triggerRef,
|
|
26
|
+
triggerOnClick
|
|
27
|
+
} = _ref;
|
|
28
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
29
|
+
const buttonRef = useRef(null);
|
|
30
|
+
const handleTriggerKeyDown = useCallback(e => {
|
|
31
31
|
if (e.code === 'Enter' || e.code === 'Space') {
|
|
32
32
|
setIsOpen(true);
|
|
33
33
|
}
|
|
34
34
|
}, []);
|
|
35
|
-
|
|
36
|
-
customHandleOnKeyDown(e);
|
|
37
|
-
|
|
35
|
+
const handleAppPickerOnKeyDown = useCallback(e => {
|
|
38
36
|
if (e.code === 'Escape') {
|
|
37
|
+
var _buttonRef$current;
|
|
38
|
+
|
|
39
39
|
setIsOpen(false);
|
|
40
|
+
buttonRef === null || buttonRef === void 0 ? void 0 : (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
40
41
|
}
|
|
41
|
-
}, [
|
|
42
|
-
|
|
42
|
+
}, []);
|
|
43
|
+
const handleOnClickOutside = useCallback(() => {
|
|
43
44
|
setIsOpen(false);
|
|
44
45
|
}, []);
|
|
45
|
-
|
|
46
|
+
const handleOnClick = useCallback(() => {
|
|
46
47
|
setIsOpen(true);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
onClick: handleOnClick,
|
|
48
|
+
}, []);
|
|
49
|
+
const renderTrigger = useMemo(() => _ref2 => {
|
|
50
|
+
let {
|
|
51
|
+
ref
|
|
52
|
+
} = _ref2;
|
|
53
|
+
return /*#__PURE__*/jsx("div", {
|
|
54
|
+
ref: ref,
|
|
55
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
56
|
+
onClick: triggerOnClick !== null && triggerOnClick !== void 0 ? triggerOnClick : handleOnClick,
|
|
56
57
|
onKeyDown: handleTriggerKeyDown,
|
|
57
|
-
ref: buttonRef,
|
|
58
|
+
ref: mergeRefs(buttonRef, triggerRef),
|
|
58
59
|
title: label,
|
|
59
|
-
"data-testid": "gh-toolbar-item"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return useMemo(function () {
|
|
67
|
-
return /*#__PURE__*/React.createElement(DSAppPicker, {
|
|
68
|
-
isOpen: isOpen,
|
|
69
|
-
apps: apps,
|
|
70
|
-
customApps: customApps,
|
|
71
|
-
sectionTitle: sectionTitle,
|
|
72
|
-
customSectionTitle: customSectionTitle,
|
|
73
|
-
onClickOutside: handleOnClickOutside,
|
|
74
|
-
renderTrigger: trigger,
|
|
75
|
-
triggerRef: buttonRef,
|
|
76
|
-
actionRef: actionRef,
|
|
77
|
-
onKeyDown: handleAppPickerOnKeyDown
|
|
60
|
+
"data-testid": "gh-toolbar-item",
|
|
61
|
+
children: _MenuPicker || (_MenuPicker = /*#__PURE__*/_jsx(MenuPicker, {
|
|
62
|
+
fill: "#FFF",
|
|
63
|
+
width: 20.73,
|
|
64
|
+
height: 20.73
|
|
65
|
+
}))
|
|
66
|
+
})
|
|
78
67
|
});
|
|
79
|
-
}, [
|
|
68
|
+
}, [triggerOnClick, handleOnClick, handleTriggerKeyDown, label]);
|
|
69
|
+
return /*#__PURE__*/_jsx(DSAppPicker, {
|
|
70
|
+
apps: apps,
|
|
71
|
+
customApps: customApps,
|
|
72
|
+
sectionTitle: sectionTitle,
|
|
73
|
+
customSectionTitle: customSectionTitle,
|
|
74
|
+
icon: icon,
|
|
75
|
+
onKeyDown: userOnKeyDown !== null && userOnKeyDown !== void 0 ? userOnKeyDown : handleAppPickerOnKeyDown,
|
|
76
|
+
actionRef: actionRef,
|
|
77
|
+
onClickOutside: userOnClickOutside !== null && userOnClickOutside !== void 0 ? userOnClickOutside : handleOnClickOutside,
|
|
78
|
+
renderTrigger: userRenderTrigger !== null && userRenderTrigger !== void 0 ? userRenderTrigger : renderTrigger,
|
|
79
|
+
isOpen: userIsOpen !== null && userIsOpen !== void 0 ? userIsOpen : isOpen,
|
|
80
|
+
onClose: onClose,
|
|
81
|
+
triggerRef: triggerRef
|
|
82
|
+
});
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
export { AppPicker };
|
|
83
|
-
//# sourceMappingURL=AppPicker.js.map
|
|
@@ -1,86 +1,59 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
4
|
+
import { DSPopperJS } from '@elliemae/ds-popperjs';
|
|
4
5
|
import { PopupMenuContent } from './PopupMenuContent.js';
|
|
5
6
|
import { Button } from '../../components/Toolbar/styles.js';
|
|
6
|
-
import '
|
|
7
|
-
import 'styled-components';
|
|
8
|
-
import '../../GlobalHeaderContext.js';
|
|
9
|
-
import '../../defaultProps.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
options = _ref.options,
|
|
14
|
-
closeOnClick = _ref.closeOnClick,
|
|
15
|
-
title = _ref.title,
|
|
16
|
-
onClick = _ref.onClick;
|
|
9
|
+
const PopupMenu = _ref => {
|
|
10
|
+
var _PopupMenuContent;
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
let {
|
|
13
|
+
Icon,
|
|
14
|
+
options,
|
|
15
|
+
closeOnClick,
|
|
16
|
+
title,
|
|
17
|
+
onClick
|
|
18
|
+
} = _ref;
|
|
19
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
20
|
+
const [buttonRef, setButtonRef] = useState(null);
|
|
21
|
+
const handleKeyPress = useCallback(e => {
|
|
25
22
|
if (e.code === 'Enter' || e.code === 'Space') {
|
|
26
23
|
setIsOpen(true);
|
|
27
24
|
}
|
|
28
25
|
}, []);
|
|
29
|
-
|
|
30
|
-
var _buttonRef$current;
|
|
31
|
-
|
|
26
|
+
const handleOnClose = useCallback(() => {
|
|
32
27
|
setIsOpen(false);
|
|
33
|
-
|
|
34
|
-
}, []);
|
|
35
|
-
|
|
28
|
+
buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.focus();
|
|
29
|
+
}, [buttonRef]);
|
|
30
|
+
const handleTriggerOnClick = useCallback(e => {
|
|
36
31
|
setIsOpen(true);
|
|
37
32
|
onClick(e);
|
|
38
33
|
}, [onClick]);
|
|
39
|
-
|
|
34
|
+
const handleItemClick = useCallback(() => {
|
|
40
35
|
if (closeOnClick) handleOnClose();
|
|
41
36
|
}, [closeOnClick, handleOnClose]);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
innerRef: ref,
|
|
63
|
-
fill: "#FFF",
|
|
64
|
-
size: "m"
|
|
65
|
-
}));
|
|
66
|
-
};
|
|
67
|
-
}, [Icon, handleKeyPress, handleTriggerOnClick, title]);
|
|
68
|
-
return useMemo(function () {
|
|
69
|
-
return /*#__PURE__*/React.createElement(Popover, {
|
|
70
|
-
isOpen: isOpen,
|
|
71
|
-
content: content,
|
|
72
|
-
onClickOutside: handleClickOutside,
|
|
73
|
-
placement: "bottom",
|
|
74
|
-
interactionType: "click",
|
|
75
|
-
showArrow: true,
|
|
76
|
-
style: {
|
|
77
|
-
padding: '0',
|
|
78
|
-
width: 'fit-content'
|
|
79
|
-
},
|
|
80
|
-
renderTrigger: trigger
|
|
81
|
-
});
|
|
82
|
-
}, [content, handleClickOutside, isOpen, trigger]);
|
|
37
|
+
const content = useMemo(() => _PopupMenuContent || (_PopupMenuContent = /*#__PURE__*/_jsx(PopupMenuContent, {
|
|
38
|
+
options: options,
|
|
39
|
+
onItemClick: handleItemClick,
|
|
40
|
+
onClose: handleOnClose
|
|
41
|
+
})), [options, handleItemClick, handleOnClose]);
|
|
42
|
+
return /*#__PURE__*/_jsx("div", {}, void 0, /*#__PURE__*/jsx(Button, {
|
|
43
|
+
onClick: handleTriggerOnClick,
|
|
44
|
+
onKeyPress: handleKeyPress,
|
|
45
|
+
title: title,
|
|
46
|
+
ref: setButtonRef,
|
|
47
|
+
"data-testid": "gh-toolbar-item",
|
|
48
|
+
children: Icon && /*#__PURE__*/_jsx(Icon, {
|
|
49
|
+
fill: "#FFF",
|
|
50
|
+
size: "m"
|
|
51
|
+
})
|
|
52
|
+
}), /*#__PURE__*/_jsx(DSPopperJS, {
|
|
53
|
+
referenceElement: buttonRef,
|
|
54
|
+
showPopover: isOpen,
|
|
55
|
+
closeContextMenu: handleOnClose
|
|
56
|
+
}, void 0, content));
|
|
83
57
|
};
|
|
84
58
|
|
|
85
59
|
export { PopupMenu };
|
|
86
|
-
//# sourceMappingURL=PopupMenu.js.map
|
|
@@ -1,66 +1,81 @@
|
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
10
|
import React, { useContext, useRef, useEffect, useMemo } from 'react';
|
|
2
|
-
import {
|
|
11
|
+
import { getDataProps, getAriaProps } from '@elliemae/ds-props-helpers';
|
|
12
|
+
import { ItemWrapper, Separator, List, Label } from './styles.js';
|
|
3
13
|
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
4
|
-
import '
|
|
5
|
-
import '../../defaultProps.js';
|
|
14
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
15
|
|
|
7
|
-
var
|
|
8
|
-
var options = _ref.options,
|
|
9
|
-
onItemClick = _ref.onItemClick,
|
|
10
|
-
onClose = _ref.onClose;
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
+
const PopupMenuContent = /*#__PURE__*/React.memo(_ref => {
|
|
20
|
+
let {
|
|
21
|
+
options,
|
|
22
|
+
onItemClick,
|
|
23
|
+
onClose
|
|
24
|
+
} = _ref;
|
|
25
|
+
const {
|
|
26
|
+
instanceUID
|
|
27
|
+
} = useContext(GlobalHeaderContext);
|
|
28
|
+
const menuRef = useRef(null);
|
|
29
|
+
useEffect(() => {
|
|
17
30
|
var _menuRef$current, _menuRef$current$firs;
|
|
18
31
|
|
|
19
32
|
(_menuRef$current = menuRef.current) === null || _menuRef$current === void 0 ? void 0 : (_menuRef$current$firs = _menuRef$current.firstChild) === null || _menuRef$current$firs === void 0 ? void 0 : _menuRef$current$firs.focus();
|
|
20
33
|
}, []);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
const content = useMemo(() => options.map(option => {
|
|
35
|
+
const {
|
|
36
|
+
type,
|
|
37
|
+
Icon,
|
|
38
|
+
label = '',
|
|
39
|
+
onClick,
|
|
40
|
+
Content
|
|
41
|
+
} = option;
|
|
42
|
+
|
|
43
|
+
const ariaAndDataProps = _objectSpread(_objectSpread({}, getAriaProps(option)), getDataProps(option));
|
|
28
44
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
const handleClick = e => {
|
|
46
|
+
onItemClick(e);
|
|
47
|
+
if (onClick) onClick(e);
|
|
48
|
+
};
|
|
33
49
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
50
|
+
const handleKeyDown = e => {
|
|
51
|
+
if (e.code === 'Escape') onClose();
|
|
52
|
+
};
|
|
37
53
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
key: "".concat(instanceUID, "-separator-").concat(label)
|
|
42
|
-
});
|
|
54
|
+
switch (type) {
|
|
55
|
+
case 'separator':
|
|
56
|
+
return /*#__PURE__*/jsx(Separator, _objectSpread({}, ariaAndDataProps), "".concat(instanceUID, "-separator-").concat(label));
|
|
43
57
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
case 'custom':
|
|
59
|
+
return /*#__PURE__*/jsx(ItemWrapper, _objectSpread(_objectSpread({
|
|
60
|
+
onClick: handleClick,
|
|
61
|
+
onKeyDown: handleKeyDown
|
|
62
|
+
}, ariaAndDataProps), {}, {
|
|
63
|
+
children: Content && /*#__PURE__*/_jsx(Content, {})
|
|
64
|
+
}), "".concat(instanceUID, "-popup-").concat(label));
|
|
50
65
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
}, [onClose, onItemClick, options, instanceUID]);
|
|
60
|
-
return /*#__PURE__*/
|
|
61
|
-
ref: menuRef
|
|
62
|
-
|
|
66
|
+
default:
|
|
67
|
+
return /*#__PURE__*/jsxs(ItemWrapper, _objectSpread(_objectSpread({
|
|
68
|
+
onClick: handleClick,
|
|
69
|
+
onKeyDown: handleKeyDown
|
|
70
|
+
}, ariaAndDataProps), {}, {
|
|
71
|
+
children: [Icon && /*#__PURE__*/_jsx(Icon, {}), Label && /*#__PURE__*/_jsx(Label, {}, void 0, label)]
|
|
72
|
+
}), "".concat(instanceUID, "-popup-").concat(label));
|
|
73
|
+
}
|
|
74
|
+
}), [onClose, onItemClick, options, instanceUID]);
|
|
75
|
+
return /*#__PURE__*/jsx(List, {
|
|
76
|
+
ref: menuRef,
|
|
77
|
+
children: content
|
|
78
|
+
});
|
|
63
79
|
});
|
|
64
80
|
|
|
65
81
|
export { PopupMenuContent };
|
|
66
|
-
//# sourceMappingURL=PopupMenuContent.js.map
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const List = /*#__PURE__*/styled.div.withConfig({
|
|
4
4
|
componentId: "sc-snqcgs-0"
|
|
5
5
|
})(["padding:5px 0px;"]);
|
|
6
|
-
|
|
6
|
+
const ItemWrapper = /*#__PURE__*/styled.button.withConfig({
|
|
7
7
|
componentId: "sc-snqcgs-1"
|
|
8
|
-
})(["display:flex;align-items:center;justify-content:center;width:100%;padding:0 20px;cursor:pointer;border:1px solid transparent;background-color:transparent;outline:none;:hover,:focus{border:", ";}"],
|
|
9
|
-
|
|
8
|
+
})(["display:flex;align-items:center;justify-content:center;width:100%;padding:0 20px;cursor:pointer;border:1px solid transparent;background-color:transparent;outline:none;:hover,:focus{border:", ";}"], _ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme
|
|
11
|
+
} = _ref;
|
|
10
12
|
return "1px solid ".concat(theme.colors.brand[600]);
|
|
11
13
|
});
|
|
12
|
-
|
|
14
|
+
const Label = /*#__PURE__*/styled.p.withConfig({
|
|
13
15
|
componentId: "sc-snqcgs-2"
|
|
14
16
|
})(["width:100%;font-size:14px;margin:10px;"]);
|
|
15
|
-
|
|
17
|
+
const Separator = /*#__PURE__*/styled.div.withConfig({
|
|
16
18
|
componentId: "sc-snqcgs-3"
|
|
17
19
|
})(["width:100%;border:none;border-bottom:1px solid #ccc;"]);
|
|
18
20
|
|
|
19
21
|
export { ItemWrapper, Label, List, Separator };
|
|
20
|
-
//# sourceMappingURL=styles.js.map
|
package/esm/outOfTheBox/index.js
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
1
|
export { AppPicker } from './AppPicker/AppPicker.js';
|
|
2
2
|
export { PopupMenu } from './PopupMenu/PopupMenu.js';
|
|
3
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
4
|
-
import 'react';
|
|
5
|
-
import '@elliemae/ds-app-picker';
|
|
6
|
-
import '@elliemae/ds-icons';
|
|
7
|
-
import '../components/Toolbar/styles.js';
|
|
8
|
-
import 'styled-components';
|
|
9
|
-
import '@elliemae/ds-popover';
|
|
10
|
-
import './PopupMenu/PopupMenuContent.js';
|
|
11
|
-
import './PopupMenu/styles.js';
|
|
12
|
-
import '../GlobalHeaderContext.js';
|
|
13
|
-
import '../defaultProps.js';
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
package/esm/propTypes.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { PropTypes } from 'react-desc';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const breadcrumbItem = PropTypes.shape({
|
|
4
4
|
label: PropTypes.string.description('breadrcrumb item label'),
|
|
5
5
|
hasNext: PropTypes.bool.description('whether the item has a child or not'),
|
|
6
6
|
isSelected: PropTypes.bool.description('whether the item is selected or not'),
|
|
7
7
|
onClick: PropTypes.func.description('Callback executed on click')
|
|
8
8
|
});
|
|
9
|
-
|
|
9
|
+
const toolbarItem = PropTypes.shape({
|
|
10
10
|
label: PropTypes.string.description('title tag description'),
|
|
11
11
|
type: PropTypes.oneOf(['ds-app-picker', 'ds-popup-menu']).description('use to select one of the out-of-the-box types of items'),
|
|
12
12
|
componentProps: PropTypes.object.description('props of out-of-the-box component'),
|
|
13
13
|
Icon: PropTypes.func.description('Icon to display'),
|
|
14
14
|
onClick: PropTypes.func.description('Callback executed on click')
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
const globalHeaderProps = {
|
|
17
17
|
Logo: PropTypes.func.description('Global Header Logo to render. Logo and LogoWithBrand are going to swap during window resizing.'),
|
|
18
18
|
LogoWithBrand: PropTypes.func.description('Global Header Logo With Brand title to render. Logo and LogoWithBrand are going to swap during window resizing.'),
|
|
19
19
|
breadcrumb: PropTypes.arrayOf(breadcrumbItem).description('Breadcrumb items to display. max 3 levels'),
|
|
@@ -21,4 +21,3 @@ var globalHeaderProps = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export { breadcrumbItem, globalHeaderProps, toolbarItem };
|
|
24
|
-
//# sourceMappingURL=propTypes.js.map
|
package/esm/styles.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { GridContainer } from '@elliemae/ds-grid';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const Wrapper = /*#__PURE__*/styled(GridContainer).withConfig({
|
|
5
5
|
componentId: "sc-1v5zxxm-0"
|
|
6
|
-
})(["background-image:linear-gradient(45deg,#0f364a 0%,#1b6392 54%,#164566 100%);color:", ";width:100%;height:40px;padding:0 24px 0 12px;"],
|
|
7
|
-
|
|
6
|
+
})(["background-image:linear-gradient(45deg,#0f364a 0%,#1b6392 54%,#164566 100%);color:", ";width:100%;height:40px;padding:0 24px 0 12px;"], _ref => {
|
|
7
|
+
let {
|
|
8
|
+
theme
|
|
9
|
+
} = _ref;
|
|
8
10
|
return theme.colors.neutral['000'];
|
|
9
11
|
});
|
|
10
12
|
|
|
11
13
|
export { Wrapper };
|
|
12
|
-
//# sourceMappingURL=styles.js.map
|