@elliemae/ds-global-header 2.3.0-next.3 → 3.0.0-alpha.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/dist/cjs/GlobalHeader.js +57 -0
- package/dist/cjs/GlobalHeader.js.map +7 -0
- package/dist/cjs/GlobalHeaderContainer.js +41 -0
- package/dist/cjs/GlobalHeaderContainer.js.map +7 -0
- package/dist/cjs/GlobalHeaderContext.js +46 -0
- package/dist/cjs/GlobalHeaderContext.js.map +7 -0
- package/dist/cjs/GlobalHeaderTypes.js +27 -0
- package/dist/cjs/GlobalHeaderTypes.js.map +7 -0
- package/dist/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js +85 -0
- package/dist/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +7 -0
- package/dist/cjs/components/Breadcrumb/PureBreadcrumb.js +51 -0
- package/dist/cjs/components/Breadcrumb/PureBreadcrumb.js.map +7 -0
- package/dist/cjs/components/Breadcrumb/styles.js +83 -0
- package/dist/cjs/components/Breadcrumb/styles.js.map +7 -0
- package/dist/cjs/components/Title/GlobalHeaderTitle.js +48 -0
- package/dist/cjs/components/Title/GlobalHeaderTitle.js.map +7 -0
- package/dist/cjs/components/Toolbar/GlobalHeaderToolbar.js +49 -0
- package/dist/cjs/components/Toolbar/GlobalHeaderToolbar.js.map +7 -0
- package/dist/cjs/components/Toolbar/ToolbarItems.js +96 -0
- package/dist/cjs/components/Toolbar/ToolbarItems.js.map +7 -0
- package/dist/cjs/components/Toolbar/styles.js +61 -0
- package/dist/cjs/components/Toolbar/styles.js.map +7 -0
- package/dist/cjs/config/useGetPropsWithDefaults.js +43 -0
- package/dist/cjs/config/useGetPropsWithDefaults.js.map +7 -0
- package/dist/cjs/config/useGlobalHeader.js +53 -0
- package/dist/cjs/config/useGlobalHeader.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +109 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/config/validateHelpers.js +111 -0
- package/dist/cjs/config/validateHelpers.js.map +7 -0
- package/dist/cjs/defaultProps.js +41 -0
- package/dist/cjs/defaultProps.js.map +7 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/outOfTheBox/AppPicker/AppPicker.js +110 -0
- package/dist/cjs/outOfTheBox/AppPicker/AppPicker.js.map +7 -0
- package/dist/cjs/outOfTheBox/PopupMenu/PopupMenu.js +96 -0
- package/dist/cjs/outOfTheBox/PopupMenu/PopupMenu.js.map +7 -0
- package/dist/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +89 -0
- package/dist/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js.map +7 -0
- package/dist/cjs/outOfTheBox/PopupMenu/styles.js +67 -0
- package/dist/cjs/outOfTheBox/PopupMenu/styles.js.map +7 -0
- package/dist/cjs/outOfTheBox/SearchToggle/SearchToggle.js +108 -0
- package/dist/cjs/outOfTheBox/SearchToggle/SearchToggle.js.map +7 -0
- package/dist/cjs/outOfTheBox/SearchToggle/styles.js +82 -0
- package/dist/cjs/outOfTheBox/SearchToggle/styles.js.map +7 -0
- package/dist/cjs/outOfTheBox/index.js +30 -0
- package/dist/cjs/outOfTheBox/index.js.map +7 -0
- package/dist/cjs/propTypes.js +56 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/cjs/styles.js +43 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/esm/GlobalHeader.js +28 -0
- package/dist/esm/GlobalHeader.js.map +7 -0
- package/dist/esm/GlobalHeaderContainer.js +12 -0
- package/dist/esm/GlobalHeaderContainer.js.map +7 -0
- package/dist/esm/GlobalHeaderContext.js +17 -0
- package/dist/esm/GlobalHeaderContext.js.map +7 -0
- package/dist/esm/GlobalHeaderTypes.js +2 -0
- package/dist/esm/GlobalHeaderTypes.js.map +7 -0
- package/dist/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js +56 -0
- package/dist/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +7 -0
- package/dist/esm/components/Breadcrumb/PureBreadcrumb.js +22 -0
- package/dist/esm/components/Breadcrumb/PureBreadcrumb.js.map +7 -0
- package/dist/esm/components/Breadcrumb/styles.js +54 -0
- package/dist/esm/components/Breadcrumb/styles.js.map +7 -0
- package/dist/esm/components/Title/GlobalHeaderTitle.js +19 -0
- package/dist/esm/components/Title/GlobalHeaderTitle.js.map +7 -0
- package/dist/esm/components/Toolbar/GlobalHeaderToolbar.js +20 -0
- package/dist/esm/components/Toolbar/GlobalHeaderToolbar.js.map +7 -0
- package/dist/esm/components/Toolbar/ToolbarItems.js +67 -0
- package/dist/esm/components/Toolbar/ToolbarItems.js.map +7 -0
- package/dist/esm/components/Toolbar/styles.js +32 -0
- package/dist/esm/components/Toolbar/styles.js.map +7 -0
- package/dist/esm/config/useGetPropsWithDefaults.js +14 -0
- package/dist/esm/config/useGetPropsWithDefaults.js.map +7 -0
- package/dist/esm/config/useGlobalHeader.js +24 -0
- package/dist/esm/config/useGlobalHeader.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +88 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/config/validateHelpers.js +82 -0
- package/dist/esm/config/validateHelpers.js.map +7 -0
- package/{esm → dist/esm}/defaultProps.js +5 -3
- package/dist/esm/defaultProps.js.map +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/outOfTheBox/AppPicker/AppPicker.js +81 -0
- package/dist/esm/outOfTheBox/AppPicker/AppPicker.js.map +7 -0
- package/dist/esm/outOfTheBox/PopupMenu/PopupMenu.js +67 -0
- package/dist/esm/outOfTheBox/PopupMenu/PopupMenu.js.map +7 -0
- package/dist/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +60 -0
- package/dist/esm/outOfTheBox/PopupMenu/PopupMenuContent.js.map +7 -0
- package/dist/esm/outOfTheBox/PopupMenu/styles.js +38 -0
- package/dist/esm/outOfTheBox/PopupMenu/styles.js.map +7 -0
- package/dist/esm/outOfTheBox/SearchToggle/SearchToggle.js +79 -0
- package/dist/esm/outOfTheBox/SearchToggle/SearchToggle.js.map +7 -0
- package/dist/esm/outOfTheBox/SearchToggle/styles.js +53 -0
- package/dist/esm/outOfTheBox/SearchToggle/styles.js.map +7 -0
- package/dist/esm/outOfTheBox/index.js +5 -0
- package/dist/esm/outOfTheBox/index.js.map +7 -0
- package/dist/esm/propTypes.js +27 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/dist/esm/styles.js +14 -0
- package/dist/esm/styles.js.map +7 -0
- package/{types → dist/types}/GlobalHeader.d.ts +0 -0
- package/{types → dist/types}/GlobalHeaderContainer.d.ts +0 -0
- package/{types → dist/types}/GlobalHeaderContext.d.ts +0 -0
- package/{types → dist/types}/GlobalHeaderTypes.d.ts +0 -0
- package/{types → dist/types}/components/Breadcrumb/GlobalHeaderBreadcrumb.d.ts +0 -0
- package/{types → dist/types}/components/Breadcrumb/PureBreadcrumb.d.ts +0 -0
- package/{types → dist/types}/components/Breadcrumb/styles.d.ts +0 -0
- package/{types → dist/types}/components/Title/GlobalHeaderTitle.d.ts +0 -0
- package/{types → dist/types}/components/Toolbar/GlobalHeaderToolbar.d.ts +0 -0
- package/{types → dist/types}/components/Toolbar/ToolbarItems.d.ts +0 -0
- package/{types → dist/types}/components/Toolbar/styles.d.ts +0 -0
- package/{types → dist/types}/config/useGetPropsWithDefaults.d.ts +0 -0
- package/{types → dist/types}/config/useGlobalHeader.d.ts +0 -0
- package/{types → dist/types}/config/useValidateProps.d.ts +0 -0
- package/{types → dist/types}/config/validateHelpers.d.ts +0 -0
- package/{types → dist/types}/defaultProps.d.ts +0 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/{types → dist/types}/outOfTheBox/AppPicker/AppPicker.d.ts +0 -0
- package/{types → dist/types}/outOfTheBox/PopupMenu/PopupMenu.d.ts +0 -0
- package/{types → dist/types}/outOfTheBox/PopupMenu/PopupMenuContent.d.ts +0 -0
- package/{types → dist/types}/outOfTheBox/PopupMenu/styles.d.ts +0 -0
- package/{types → dist/types}/outOfTheBox/SearchToggle/SearchToggle.d.ts +0 -0
- package/{types → dist/types}/outOfTheBox/SearchToggle/styles.d.ts +0 -0
- package/{types → dist/types}/outOfTheBox/index.d.ts +0 -0
- package/{types → dist/types}/propTypes.d.ts +0 -0
- package/{types → dist/types}/styles.d.ts +1 -1
- package/package.json +81 -71
- package/cjs/GlobalHeader.js +0 -37
- package/cjs/GlobalHeaderContainer.js +0 -24
- package/cjs/GlobalHeaderContext.js +0 -20
- package/cjs/GlobalHeaderTypes.js +0 -2
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js +0 -85
- package/cjs/components/Breadcrumb/PureBreadcrumb.js +0 -60
- package/cjs/components/Breadcrumb/styles.js +0 -59
- package/cjs/components/Title/GlobalHeaderTitle.js +0 -29
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js +0 -30
- package/cjs/components/Toolbar/ToolbarItems.js +0 -107
- package/cjs/components/Toolbar/styles.js +0 -25
- package/cjs/config/useGetPropsWithDefaults.js +0 -31
- package/cjs/config/useGlobalHeader.js +0 -39
- package/cjs/config/useValidateProps.js +0 -92
- package/cjs/config/validateHelpers.js +0 -57
- package/cjs/defaultProps.js +0 -14
- package/cjs/index.js +0 -11
- package/cjs/outOfTheBox/AppPicker/AppPicker.js +0 -117
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js +0 -101
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +0 -96
- package/cjs/outOfTheBox/PopupMenu/styles.js +0 -32
- package/cjs/outOfTheBox/SearchToggle/SearchToggle.js +0 -113
- package/cjs/outOfTheBox/SearchToggle/styles.js +0 -15
- package/cjs/outOfTheBox/index.js +0 -13
- package/cjs/propTypes.js +0 -29
- package/cjs/styles.js +0 -21
- package/esm/GlobalHeader.js +0 -28
- package/esm/GlobalHeaderContainer.js +0 -16
- package/esm/GlobalHeaderContext.js +0 -16
- package/esm/GlobalHeaderTypes.js +0 -1
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js +0 -75
- package/esm/components/Breadcrumb/PureBreadcrumb.js +0 -49
- package/esm/components/Breadcrumb/styles.js +0 -48
- package/esm/components/Title/GlobalHeaderTitle.js +0 -21
- package/esm/components/Toolbar/GlobalHeaderToolbar.js +0 -22
- package/esm/components/Toolbar/ToolbarItems.js +0 -97
- package/esm/components/Toolbar/styles.js +0 -17
- package/esm/config/useGetPropsWithDefaults.js +0 -23
- package/esm/config/useGlobalHeader.js +0 -31
- package/esm/config/useValidateProps.js +0 -88
- package/esm/config/validateHelpers.js +0 -44
- package/esm/index.js +0 -1
- package/esm/outOfTheBox/AppPicker/AppPicker.js +0 -107
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js +0 -91
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +0 -86
- package/esm/outOfTheBox/PopupMenu/styles.js +0 -21
- package/esm/outOfTheBox/SearchToggle/SearchToggle.js +0 -103
- package/esm/outOfTheBox/SearchToggle/styles.js +0 -7
- package/esm/outOfTheBox/index.js +0 -3
- package/esm/propTypes.js +0 -23
- package/esm/styles.js +0 -13
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
6
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
11
|
-
import { useContext, useRef, useEffect } from 'react';
|
|
12
|
-
import { Grid } from '@elliemae/ds-grid';
|
|
13
|
-
import { Pipe } from './styles.js';
|
|
14
|
-
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
15
|
-
import { PureBreadcrumb } from './PureBreadcrumb.js';
|
|
16
|
-
import { jsx } from 'react/jsx-runtime';
|
|
17
|
-
|
|
18
|
-
const _excluded = ["label"];
|
|
19
|
-
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
-
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
const GlobalHeaderBreadcrumb = () => {
|
|
24
|
-
const {
|
|
25
|
-
props: {
|
|
26
|
-
breadcrumb
|
|
27
|
-
},
|
|
28
|
-
instanceUID,
|
|
29
|
-
showIconOnly,
|
|
30
|
-
setShowIconOnly,
|
|
31
|
-
globalHeaderBreadcrumbGrid
|
|
32
|
-
} = useContext(GlobalHeaderContext);
|
|
33
|
-
const breakpoint = useRef(null);
|
|
34
|
-
const flexRegion = useRef(null);
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
const evaluateShowIconOnly = () => {
|
|
37
|
-
if (flexRegion && flexRegion.current && (flexRegion === null || flexRegion === void 0 ? void 0 : flexRegion.current.offsetWidth) <= 0 && !breakpoint.current) {
|
|
38
|
-
setShowIconOnly(true);
|
|
39
|
-
breakpoint.current = window.innerWidth;
|
|
40
|
-
} else if (breakpoint && breakpoint.current !== null && window.innerWidth >= breakpoint.current) {
|
|
41
|
-
setShowIconOnly(false);
|
|
42
|
-
breakpoint.current = null;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
evaluateShowIconOnly();
|
|
47
|
-
window.addEventListener('resize', evaluateShowIconOnly);
|
|
48
|
-
return () => window.removeEventListener('resize', evaluateShowIconOnly);
|
|
49
|
-
}, [breakpoint, flexRegion, setShowIconOnly]);
|
|
50
|
-
return /*#__PURE__*/_jsx(Grid, {
|
|
51
|
-
height: "100%",
|
|
52
|
-
alignItems: "center",
|
|
53
|
-
justifyContent: "flex-start",
|
|
54
|
-
"aria-label": "breadcrumbs",
|
|
55
|
-
cols: globalHeaderBreadcrumbGrid,
|
|
56
|
-
role: "navigation"
|
|
57
|
-
}, void 0, /*#__PURE__*/_jsx(Pipe, {
|
|
58
|
-
showIconOnly: showIconOnly
|
|
59
|
-
}), breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.map(item => {
|
|
60
|
-
const {
|
|
61
|
-
label
|
|
62
|
-
} = item,
|
|
63
|
-
rest = _objectWithoutProperties(item, _excluded);
|
|
64
|
-
|
|
65
|
-
return /*#__PURE__*/jsx(PureBreadcrumb, _objectSpread({
|
|
66
|
-
label: label,
|
|
67
|
-
length: breadcrumb.length
|
|
68
|
-
}, rest), "".concat(instanceUID, "-breadcrumb-item-").concat(label));
|
|
69
|
-
}), /*#__PURE__*/jsx("div", {
|
|
70
|
-
id: "global-header-flex-region",
|
|
71
|
-
ref: flexRegion
|
|
72
|
-
}));
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export { GlobalHeaderBreadcrumb };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { ChevronSmallRight } from '@elliemae/ds-icons';
|
|
11
|
-
import { getDataProps } from '@elliemae/ds-props-helpers';
|
|
12
|
-
import { BreadcrumbItem, LabelButton, Label } from './styles.js';
|
|
13
|
-
import { jsx } from 'react/jsx-runtime';
|
|
14
|
-
|
|
15
|
-
var _ChevronSmallRight;
|
|
16
|
-
|
|
17
|
-
const _excluded = ["onClick", "isSelected", "length", "label", "hasNext", "id"];
|
|
18
|
-
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
-
const PureBreadcrumb = /*#__PURE__*/React.memo(_ref => {
|
|
23
|
-
let {
|
|
24
|
-
onClick,
|
|
25
|
-
isSelected,
|
|
26
|
-
length,
|
|
27
|
-
label,
|
|
28
|
-
hasNext,
|
|
29
|
-
id
|
|
30
|
-
} = _ref,
|
|
31
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
-
|
|
33
|
-
return /*#__PURE__*/_jsx(BreadcrumbItem, {}, void 0, /*#__PURE__*/jsx(LabelButton, _objectSpread(_objectSpread({
|
|
34
|
-
onClick: onClick,
|
|
35
|
-
"aria-selected": isSelected,
|
|
36
|
-
"data-testid": "gh-breadcrumb-btn",
|
|
37
|
-
id: id
|
|
38
|
-
}, getDataProps(rest)), {}, {
|
|
39
|
-
children: /*#__PURE__*/_jsx(Label, {
|
|
40
|
-
isSelected: !!isSelected,
|
|
41
|
-
isOnlyItem: length === 1
|
|
42
|
-
}, void 0, label)
|
|
43
|
-
})), hasNext && (_ChevronSmallRight || (_ChevronSmallRight = /*#__PURE__*/_jsx(ChevronSmallRight, {
|
|
44
|
-
size: "m",
|
|
45
|
-
fill: "#FFF"
|
|
46
|
-
}))));
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export { PureBreadcrumb };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const Pipe = /*#__PURE__*/styled.span.withConfig({
|
|
4
|
-
componentId: "sc-1n5l527-0"
|
|
5
|
-
})(["margin:0 7px 0 0;border-left:", ";height:20px;"], _ref => {
|
|
6
|
-
let {
|
|
7
|
-
showIconOnly
|
|
8
|
-
} = _ref;
|
|
9
|
-
return showIconOnly ? 'none' : '1px solid #fff';
|
|
10
|
-
});
|
|
11
|
-
const BreadcrumbItem = /*#__PURE__*/styled.div.withConfig({
|
|
12
|
-
componentId: "sc-1n5l527-1"
|
|
13
|
-
})(["display:flex;align-items:center;height:100%;"]);
|
|
14
|
-
const LabelButton = /*#__PURE__*/styled.button.withConfig({
|
|
15
|
-
componentId: "sc-1n5l527-2"
|
|
16
|
-
})(["width:fit-content;height:100%;margin:0;padding:0;border:1px solid transparent;background-color:transparent;outline:none;cursor:pointer;position:relative;&:focus{:before{content:'';position:absolute;z-index:2;top:2px;left:-5px;width:calc(100% + 10px);height:calc(100% - 4px);border:2px solid ", ";border-radius:4px;}}"], _ref2 => {
|
|
17
|
-
let {
|
|
18
|
-
theme
|
|
19
|
-
} = _ref2;
|
|
20
|
-
return theme.colors.neutral['000'];
|
|
21
|
-
});
|
|
22
|
-
const Label = /*#__PURE__*/styled.p.withConfig({
|
|
23
|
-
componentId: "sc-1n5l527-3"
|
|
24
|
-
})(["color:", ";", ";font-size:16px;text-transform:uppercase;border-bottom:", ";margin:3px 5px 0 5px;:hover{", ";}"], _ref3 => {
|
|
25
|
-
let {
|
|
26
|
-
theme
|
|
27
|
-
} = _ref3;
|
|
28
|
-
return theme.colors.neutral['000'];
|
|
29
|
-
}, _ref4 => {
|
|
30
|
-
let {
|
|
31
|
-
theme,
|
|
32
|
-
isSelected
|
|
33
|
-
} = _ref4;
|
|
34
|
-
return "-webkit-text-stroke: 0.4px ".concat(isSelected ? theme.colors.neutral['000'] : 'transparent');
|
|
35
|
-
}, _ref5 => {
|
|
36
|
-
let {
|
|
37
|
-
isSelected,
|
|
38
|
-
isOnlyItem
|
|
39
|
-
} = _ref5;
|
|
40
|
-
return "2px solid ".concat(isSelected && !isOnlyItem ? '#FFF' : 'transparent');
|
|
41
|
-
}, _ref6 => {
|
|
42
|
-
let {
|
|
43
|
-
theme
|
|
44
|
-
} = _ref6;
|
|
45
|
-
return "-webkit-text-stroke: 0.4px ".concat(theme.colors.neutral['000']);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export { BreadcrumbItem, Label, LabelButton, Pipe };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import { useContext } from 'react';
|
|
3
|
-
import { Grid } from '@elliemae/ds-grid';
|
|
4
|
-
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
5
|
-
|
|
6
|
-
const GlobalHeaderTitle = () => {
|
|
7
|
-
const {
|
|
8
|
-
props: {
|
|
9
|
-
Logo,
|
|
10
|
-
LogoWithBrand
|
|
11
|
-
},
|
|
12
|
-
showIconOnly
|
|
13
|
-
} = useContext(GlobalHeaderContext);
|
|
14
|
-
return /*#__PURE__*/_jsx(Grid, {
|
|
15
|
-
alignItems: "center",
|
|
16
|
-
pr: showIconOnly ? '0px' : '36px',
|
|
17
|
-
cols: showIconOnly ? ['auto'] : ['auto', '1fr']
|
|
18
|
-
}, void 0, Logo && showIconOnly && /*#__PURE__*/_jsx(Logo, {}), LogoWithBrand && !showIconOnly && /*#__PURE__*/_jsx(LogoWithBrand, {}));
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { GlobalHeaderTitle };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import { useContext } from 'react';
|
|
3
|
-
import { Grid } from '@elliemae/ds-grid';
|
|
4
|
-
import { ToolbarItems } from './ToolbarItems.js';
|
|
5
|
-
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
6
|
-
|
|
7
|
-
var _ToolbarItems;
|
|
8
|
-
const GlobalHeaderToolbar = () => {
|
|
9
|
-
const {
|
|
10
|
-
globalHeaderToolbarGrid
|
|
11
|
-
} = useContext(GlobalHeaderContext);
|
|
12
|
-
return /*#__PURE__*/_jsx(Grid, {
|
|
13
|
-
height: "100%",
|
|
14
|
-
alignItems: "center",
|
|
15
|
-
justifyContent: "center",
|
|
16
|
-
gutter: "xxs",
|
|
17
|
-
cols: globalHeaderToolbarGrid,
|
|
18
|
-
role: "toolbar"
|
|
19
|
-
}, void 0, _ToolbarItems || (_ToolbarItems = /*#__PURE__*/_jsx(ToolbarItems, {})));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { GlobalHeaderToolbar };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
6
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
11
|
-
import { useContext, useMemo } from 'react';
|
|
12
|
-
import { AppPicker } from '../../outOfTheBox/AppPicker/AppPicker.js';
|
|
13
|
-
import { PopupMenu } from '../../outOfTheBox/PopupMenu/PopupMenu.js';
|
|
14
|
-
import { SearchToggle } from '../../outOfTheBox/SearchToggle/SearchToggle.js';
|
|
15
|
-
import { Button } from './styles.js';
|
|
16
|
-
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
17
|
-
import { getDataProps } from '@elliemae/ds-props-helpers';
|
|
18
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
19
|
-
|
|
20
|
-
const _excluded = ["Icon", "type", "onClick", "componentProps", "label", "onKeyPress", "id", "CustomComponent"];
|
|
21
|
-
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
-
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
-
const ToolbarItems = () => {
|
|
26
|
-
const {
|
|
27
|
-
props: {
|
|
28
|
-
toolbar
|
|
29
|
-
},
|
|
30
|
-
instanceUID
|
|
31
|
-
} = useContext(GlobalHeaderContext);
|
|
32
|
-
const itemsList = useMemo(() => toolbar === null || toolbar === void 0 ? void 0 : toolbar.map(item => {
|
|
33
|
-
var _Icon;
|
|
34
|
-
|
|
35
|
-
const {
|
|
36
|
-
Icon,
|
|
37
|
-
type,
|
|
38
|
-
onClick,
|
|
39
|
-
componentProps,
|
|
40
|
-
label,
|
|
41
|
-
onKeyPress,
|
|
42
|
-
id,
|
|
43
|
-
CustomComponent
|
|
44
|
-
} = item,
|
|
45
|
-
otherProps = _objectWithoutProperties(item, _excluded);
|
|
46
|
-
|
|
47
|
-
switch (type) {
|
|
48
|
-
case 'ds-popup-menu':
|
|
49
|
-
return /*#__PURE__*/jsx(PopupMenu, _objectSpread(_objectSpread({
|
|
50
|
-
title: label,
|
|
51
|
-
Icon: Icon,
|
|
52
|
-
onClick: onClick,
|
|
53
|
-
onKeyPress: onKeyPress,
|
|
54
|
-
id: id
|
|
55
|
-
}, otherProps), {}, {
|
|
56
|
-
componentProps: componentProps
|
|
57
|
-
}), "".concat(instanceUID, "-ds-popup-menu-").concat(label));
|
|
58
|
-
|
|
59
|
-
case 'ds-app-picker':
|
|
60
|
-
return /*#__PURE__*/jsx(AppPicker, _objectSpread({
|
|
61
|
-
label: label,
|
|
62
|
-
id: id,
|
|
63
|
-
componentProps: componentProps
|
|
64
|
-
}, otherProps), "".concat(instanceUID, "-ds-app-picker-").concat(label));
|
|
65
|
-
|
|
66
|
-
case 'ds-search-toggle':
|
|
67
|
-
return /*#__PURE__*/jsx(SearchToggle, _objectSpread({
|
|
68
|
-
id: id,
|
|
69
|
-
componentProps: componentProps
|
|
70
|
-
}, otherProps), "".concat(instanceUID, "-ds-search-toggle-").concat(id));
|
|
71
|
-
|
|
72
|
-
case 'custom':
|
|
73
|
-
if (CustomComponent) return /*#__PURE__*/_jsx(CustomComponent, {
|
|
74
|
-
item: item
|
|
75
|
-
});
|
|
76
|
-
return null;
|
|
77
|
-
|
|
78
|
-
default:
|
|
79
|
-
return /*#__PURE__*/jsx(Button, _objectSpread(_objectSpread({
|
|
80
|
-
onClick: onClick,
|
|
81
|
-
title: label,
|
|
82
|
-
"data-testid": "gh-toolbar-item",
|
|
83
|
-
id: id
|
|
84
|
-
}, getDataProps(otherProps)), {}, {
|
|
85
|
-
children: _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {
|
|
86
|
-
fill: "#FFF",
|
|
87
|
-
size: "m"
|
|
88
|
-
}))
|
|
89
|
-
}), "".concat(instanceUID, "-ds-toolbar-button-").concat(label));
|
|
90
|
-
}
|
|
91
|
-
}), [toolbar, instanceUID]);
|
|
92
|
-
return /*#__PURE__*/jsx(Fragment, {
|
|
93
|
-
children: itemsList
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export { ToolbarItems };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const Button = /*#__PURE__*/styled.button.withConfig({
|
|
4
|
-
componentId: "sc-1gqj0i3-0"
|
|
5
|
-
})(["height:40px;width:40px;border:none;background-color:transparent;cursor:pointer;position:relative;outline:none;&:hover:not(:focus){background-color:", ";outline:none;}&:focus{:before{content:'';position:absolute;z-index:2;top:2px;left:2px;width:calc(100% - 4px);height:calc(100% - 4px);border:2px solid ", ";border-radius:4px;}}"], _ref => {
|
|
6
|
-
let {
|
|
7
|
-
theme
|
|
8
|
-
} = _ref;
|
|
9
|
-
return theme.colors.brand[700];
|
|
10
|
-
}, _ref2 => {
|
|
11
|
-
let {
|
|
12
|
-
theme
|
|
13
|
-
} = _ref2;
|
|
14
|
-
return theme.colors.neutral['000'];
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export { Button };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import { useMemo } from 'react';
|
|
8
|
-
import { defaultProps } from '../defaultProps.js';
|
|
9
|
-
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
const useGetPropsWithDefaults = props => {
|
|
14
|
-
const {
|
|
15
|
-
toolbar,
|
|
16
|
-
breadcrumb,
|
|
17
|
-
Logo,
|
|
18
|
-
LogoWithBrand
|
|
19
|
-
} = props;
|
|
20
|
-
return useMemo(() => _objectSpread(_objectSpread({}, defaultProps), props), [toolbar, breadcrumb, Logo, LogoWithBrand]);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export { useGetPropsWithDefaults };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
-
import React, { useState, useMemo } from 'react';
|
|
3
|
-
import { uid } from 'uid';
|
|
4
|
-
import { useGetPropsWithDefaults } from './useGetPropsWithDefaults.js';
|
|
5
|
-
|
|
6
|
-
const useGlobalHeader = props => {
|
|
7
|
-
const [showIconOnly, setShowIconOnly] = useState(false);
|
|
8
|
-
const instanceUID = useMemo(() => uid(5), []);
|
|
9
|
-
const globalHeaderToolbarGrid = useMemo(() => {
|
|
10
|
-
var _props$toolbar$length, _props$toolbar;
|
|
11
|
-
|
|
12
|
-
return new Array((_props$toolbar$length = props === null || props === void 0 ? void 0 : (_props$toolbar = props.toolbar) === null || _props$toolbar === void 0 ? void 0 : _props$toolbar.length) !== null && _props$toolbar$length !== void 0 ? _props$toolbar$length : 0).fill('auto');
|
|
13
|
-
}, [props.toolbar]);
|
|
14
|
-
const globalHeaderBreadcrumbGrid = useMemo(() => {
|
|
15
|
-
var _props$breadcrumb$len, _props$breadcrumb;
|
|
16
|
-
|
|
17
|
-
return ['auto', ...new Array((_props$breadcrumb$len = props === null || props === void 0 ? void 0 : (_props$breadcrumb = props.breadcrumb) === null || _props$breadcrumb === void 0 ? void 0 : _props$breadcrumb.length) !== null && _props$breadcrumb$len !== void 0 ? _props$breadcrumb$len : 0).fill('auto'), '1fr'];
|
|
18
|
-
}, [props.breadcrumb]);
|
|
19
|
-
const propsWithDefaults = useGetPropsWithDefaults(props);
|
|
20
|
-
const ctx = React.useMemo(() => ({
|
|
21
|
-
props: propsWithDefaults,
|
|
22
|
-
showIconOnly,
|
|
23
|
-
setShowIconOnly,
|
|
24
|
-
instanceUID,
|
|
25
|
-
globalHeaderToolbarGrid,
|
|
26
|
-
globalHeaderBreadcrumbGrid
|
|
27
|
-
}), [propsWithDefaults, showIconOnly, instanceUID, globalHeaderToolbarGrid, globalHeaderBreadcrumbGrid]);
|
|
28
|
-
return ctx;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { useGlobalHeader };
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
|
-
import { throwLogoError, throwBreadcrumbItemError, isValidToolbarType, throwToolbarItemGenericError, isObject, throwToolbarPopupItemError, throwToolbarAppPickerItemError } from './validateHelpers.js';
|
|
5
|
-
|
|
6
|
-
const validatePopupItem = componentProps => {
|
|
7
|
-
if (componentProps.options && !Array.isArray(componentProps.options)) {
|
|
8
|
-
throwToolbarPopupItemError('options', componentProps.options);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (componentProps.closeOnClick && typeof componentProps.closeOnClick !== 'boolean') {
|
|
12
|
-
throwToolbarPopupItemError('closeOnClick', componentProps.closeOnClick);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const validateAppPickerItem = componentProps => {
|
|
17
|
-
if (componentProps.apps && !Array.isArray(componentProps.apps)) {
|
|
18
|
-
throwToolbarAppPickerItemError('apps', componentProps.apps);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (componentProps.customApps && !Array.isArray(componentProps.customApps)) {
|
|
22
|
-
throwToolbarAppPickerItemError('customApps', componentProps.customApps);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (componentProps.sectionTitle && typeof componentProps.sectionTitle !== 'string') {
|
|
26
|
-
throwToolbarAppPickerItemError('sectionTitle', componentProps.sectionTitle);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (componentProps.customSectionTitle && typeof componentProps.customSectionTitle !== 'string') {
|
|
30
|
-
throwToolbarAppPickerItemError('customSectionTitle', componentProps.customSectionTitle);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const useValidateProps = props => {
|
|
35
|
-
const {
|
|
36
|
-
breadcrumb,
|
|
37
|
-
toolbar,
|
|
38
|
-
Logo,
|
|
39
|
-
LogoWithBrand
|
|
40
|
-
} = props;
|
|
41
|
-
|
|
42
|
-
if (Logo && typeof Logo !== 'function') {
|
|
43
|
-
throwLogoError('Logo', Logo);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (LogoWithBrand && typeof LogoWithBrand !== 'function') {
|
|
47
|
-
throwLogoError('LogoWithBrand', LogoWithBrand);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.forEach(breadcrumbItem => {
|
|
51
|
-
if (breadcrumbItem.label && typeof breadcrumbItem.label !== 'string') {
|
|
52
|
-
throwBreadcrumbItemError('label', breadcrumbItem.label);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (breadcrumbItem.onClick && typeof breadcrumbItem.onClick !== 'function') {
|
|
56
|
-
throwBreadcrumbItemError('onClick', breadcrumbItem.onClick);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (breadcrumbItem.hasNext && typeof breadcrumbItem.hasNext !== 'boolean') {
|
|
60
|
-
throwBreadcrumbItemError('hasNext', breadcrumbItem.hasNext);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (breadcrumbItem.isSelected && typeof breadcrumbItem.isSelected !== 'boolean') {
|
|
64
|
-
throwBreadcrumbItemError('isSelected', breadcrumbItem.isSelected);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
toolbar === null || toolbar === void 0 ? void 0 : toolbar.forEach(toolbarItem => {
|
|
68
|
-
if (toolbarItem.type) {
|
|
69
|
-
if (!isValidToolbarType(toolbarItem.type)) {
|
|
70
|
-
throwToolbarItemGenericError('type', toolbarItem.type);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (toolbarItem.componentProps && !isObject(toolbarItem.componentProps)) {
|
|
74
|
-
throwToolbarItemGenericError('componentProps', toolbarItem.componentProps);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (toolbarItem.type === 'ds-popup-menu') {
|
|
78
|
-
validatePopupItem(toolbarItem.componentProps);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (toolbarItem.type === 'ds-app-picker') {
|
|
82
|
-
validateAppPickerItem(toolbarItem.componentProps);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export { useValidateProps };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const breadcrumbProps = {
|
|
2
|
-
label: 'string',
|
|
3
|
-
onClick: 'function',
|
|
4
|
-
hasNext: 'boolean',
|
|
5
|
-
isSelected: 'boolean'
|
|
6
|
-
};
|
|
7
|
-
const toolbarProps = {
|
|
8
|
-
label: 'string',
|
|
9
|
-
type: '"ds-app-picker" or "ds-popup-menu" or "ds-search-toggle"',
|
|
10
|
-
componentProps: 'object',
|
|
11
|
-
Icon: 'react component',
|
|
12
|
-
onClick: 'function',
|
|
13
|
-
options: 'array',
|
|
14
|
-
closeOnClick: 'boolean',
|
|
15
|
-
apps: 'array',
|
|
16
|
-
customApps: 'array',
|
|
17
|
-
sectionTitle: 'string',
|
|
18
|
-
customSectionTitle: 'string'
|
|
19
|
-
};
|
|
20
|
-
const isObject = obj => typeof obj === 'object' && !!obj && !Array.isArray(obj);
|
|
21
|
-
const getVariableType = arg => {
|
|
22
|
-
if (Array.isArray(arg)) return 'array';
|
|
23
|
-
if (arg === null) return 'null';
|
|
24
|
-
if (arg === undefined) return 'undefined';
|
|
25
|
-
return typeof arg;
|
|
26
|
-
};
|
|
27
|
-
const isValidToolbarType = string => string === 'ds-app-picker' || string === 'ds-popup-menu' || string === 'ds-search-toggle' || string === 'custom';
|
|
28
|
-
const throwBreadcrumbItemError = (validPropKey, invalidProp) => {
|
|
29
|
-
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property for a breadcrumb item, please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(typeof invalidProp, ")\n Expected: (").concat(breadcrumbProps[validPropKey], ")\n "));
|
|
30
|
-
};
|
|
31
|
-
const throwToolbarPopupItemError = (validPropKey, invalidProp) => {
|
|
32
|
-
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property inside componentProps for a ds-popup-menu \n toolbar item, please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: (").concat(toolbarProps[validPropKey], ")\n "));
|
|
33
|
-
};
|
|
34
|
-
const throwToolbarAppPickerItemError = (validPropKey, invalidProp) => {
|
|
35
|
-
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property inside componentProps for a ds-app-picker \n toolbar item, please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: (").concat(toolbarProps[validPropKey], ")\n "));
|
|
36
|
-
};
|
|
37
|
-
const throwToolbarItemGenericError = (validPropKey, invalidProp) => {
|
|
38
|
-
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property for a toolbar item, please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: (").concat(toolbarProps[validPropKey], ")\n "));
|
|
39
|
-
};
|
|
40
|
-
const throwLogoError = (validPropKey, invalidProp) => {
|
|
41
|
-
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property for a global header, \n remember to provide both Logo and LogoWithBrand properties with a valid type.\n\n Received: ").concat(invalidProp, " (").concat(getVariableType(invalidProp), ").\n Expected: (react component).\n "));
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export { breadcrumbProps, getVariableType, isObject, isValidToolbarType, throwBreadcrumbItemError, throwLogoError, throwToolbarAppPickerItemError, throwToolbarItemGenericError, throwToolbarPopupItemError, toolbarProps };
|
package/esm/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { GlobalHeader, GlobalHeaderWithSchema, GlobalHeader as default } from './GlobalHeader.js';
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.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';
|
|
10
|
-
import { useState, useRef, useCallback, useMemo } from 'react';
|
|
11
|
-
import { DSAppPicker } from '@elliemae/ds-app-picker';
|
|
12
|
-
import { mergeRefs } from '@elliemae/ds-utilities';
|
|
13
|
-
import { MenuPicker } from '@elliemae/ds-icons';
|
|
14
|
-
import { Button } from '../../components/Toolbar/styles.js';
|
|
15
|
-
import { getDataProps } from '@elliemae/ds-props-helpers';
|
|
16
|
-
import { jsx } from 'react/jsx-runtime';
|
|
17
|
-
|
|
18
|
-
var _MenuPicker;
|
|
19
|
-
|
|
20
|
-
const _excluded = ["label", "id", "componentProps"];
|
|
21
|
-
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
-
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
-
const AppPicker = _ref => {
|
|
26
|
-
let {
|
|
27
|
-
label,
|
|
28
|
-
id,
|
|
29
|
-
componentProps
|
|
30
|
-
} = _ref,
|
|
31
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
-
|
|
33
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
34
|
-
const buttonRef = useRef(null);
|
|
35
|
-
const {
|
|
36
|
-
apps,
|
|
37
|
-
icon,
|
|
38
|
-
customApps,
|
|
39
|
-
sectionTitle,
|
|
40
|
-
customSectionTitle,
|
|
41
|
-
actionRef,
|
|
42
|
-
isOpen: userIsOpen,
|
|
43
|
-
onKeyDown: userOnKeyDown,
|
|
44
|
-
onClickOutside: userOnClickOutside,
|
|
45
|
-
renderTrigger: userRenderTrigger,
|
|
46
|
-
onClose,
|
|
47
|
-
triggerRef,
|
|
48
|
-
triggerOnClick
|
|
49
|
-
} = componentProps;
|
|
50
|
-
const handleTriggerKeyDown = useCallback(e => {
|
|
51
|
-
if (e.code === 'Enter' || e.code === 'Space') {
|
|
52
|
-
setIsOpen(true);
|
|
53
|
-
}
|
|
54
|
-
}, []);
|
|
55
|
-
const handleAppPickerOnKeyDown = useCallback(e => {
|
|
56
|
-
if (e.code === 'Escape') {
|
|
57
|
-
var _buttonRef$current;
|
|
58
|
-
|
|
59
|
-
setIsOpen(false);
|
|
60
|
-
buttonRef === null || buttonRef === void 0 ? void 0 : (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
61
|
-
}
|
|
62
|
-
}, []);
|
|
63
|
-
const handleOnClickOutside = useCallback(() => {
|
|
64
|
-
setIsOpen(false);
|
|
65
|
-
}, []);
|
|
66
|
-
const handleOnClick = useCallback(() => {
|
|
67
|
-
setIsOpen(true);
|
|
68
|
-
}, []);
|
|
69
|
-
const renderTrigger = useMemo(() => _ref2 => {
|
|
70
|
-
let {
|
|
71
|
-
ref
|
|
72
|
-
} = _ref2;
|
|
73
|
-
return /*#__PURE__*/jsx("div", {
|
|
74
|
-
ref: ref,
|
|
75
|
-
children: /*#__PURE__*/jsx(Button, _objectSpread(_objectSpread({
|
|
76
|
-
onClick: triggerOnClick !== null && triggerOnClick !== void 0 ? triggerOnClick : handleOnClick,
|
|
77
|
-
onKeyDown: handleTriggerKeyDown,
|
|
78
|
-
ref: mergeRefs(buttonRef, triggerRef),
|
|
79
|
-
title: label,
|
|
80
|
-
"data-testid": "gh-toolbar-item",
|
|
81
|
-
id: id
|
|
82
|
-
}, getDataProps(otherProps)), {}, {
|
|
83
|
-
children: _MenuPicker || (_MenuPicker = /*#__PURE__*/_jsx(MenuPicker, {
|
|
84
|
-
fill: "#FFF",
|
|
85
|
-
width: 20.73,
|
|
86
|
-
height: 20.73
|
|
87
|
-
}))
|
|
88
|
-
}))
|
|
89
|
-
});
|
|
90
|
-
}, [triggerOnClick, handleOnClick, handleTriggerKeyDown, triggerRef, label, id, otherProps]);
|
|
91
|
-
return /*#__PURE__*/_jsx(DSAppPicker, {
|
|
92
|
-
apps: apps,
|
|
93
|
-
customApps: customApps,
|
|
94
|
-
sectionTitle: sectionTitle,
|
|
95
|
-
customSectionTitle: customSectionTitle,
|
|
96
|
-
icon: icon,
|
|
97
|
-
onKeyDown: userOnKeyDown !== null && userOnKeyDown !== void 0 ? userOnKeyDown : handleAppPickerOnKeyDown,
|
|
98
|
-
actionRef: actionRef,
|
|
99
|
-
onClickOutside: userOnClickOutside !== null && userOnClickOutside !== void 0 ? userOnClickOutside : handleOnClickOutside,
|
|
100
|
-
renderTrigger: userRenderTrigger !== null && userRenderTrigger !== void 0 ? userRenderTrigger : renderTrigger,
|
|
101
|
-
isOpen: userIsOpen !== null && userIsOpen !== void 0 ? userIsOpen : isOpen,
|
|
102
|
-
onClose: onClose,
|
|
103
|
-
triggerRef: triggerRef
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export { AppPicker };
|