@elliemae/ds-global-header 2.0.0-rc.13 → 2.0.0-rc.17
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/{index.d.js → GlobalHeaderTypes.js} +0 -0
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js +20 -10
- package/cjs/components/Breadcrumb/PureBreadcrumb.js +31 -8
- package/cjs/components/Breadcrumb/styles.js +9 -14
- package/cjs/components/Toolbar/ToolbarItems.js +39 -21
- package/cjs/components/Toolbar/styles.js +1 -6
- package/cjs/config/useGlobalHeader.js +1 -1
- package/cjs/config/useValidateProps.js +0 -17
- package/cjs/config/validateHelpers.js +2 -2
- package/cjs/outOfTheBox/AppPicker/AppPicker.js +32 -7
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js +51 -17
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +10 -5
- package/cjs/outOfTheBox/PopupMenu/styles.js +1 -1
- package/cjs/outOfTheBox/SearchToggle/SearchToggle.js +113 -0
- package/cjs/outOfTheBox/SearchToggle/styles.js +15 -0
- package/cjs/outOfTheBox/index.js +2 -0
- package/esm/{index.d.js → GlobalHeaderTypes.js} +0 -0
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js +18 -10
- package/esm/components/Breadcrumb/PureBreadcrumb.js +29 -8
- package/esm/components/Breadcrumb/styles.js +9 -14
- package/esm/components/Toolbar/ToolbarItems.js +37 -20
- package/esm/components/Toolbar/styles.js +1 -6
- package/esm/config/useGlobalHeader.js +1 -1
- package/esm/config/useValidateProps.js +0 -17
- package/esm/config/validateHelpers.js +2 -2
- package/esm/outOfTheBox/AppPicker/AppPicker.js +30 -7
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js +49 -17
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +10 -5
- package/esm/outOfTheBox/PopupMenu/styles.js +1 -1
- package/esm/outOfTheBox/SearchToggle/SearchToggle.js +103 -0
- package/esm/outOfTheBox/SearchToggle/styles.js +7 -0
- package/esm/outOfTheBox/index.js +1 -0
- package/package.json +19 -7
- package/types/GlobalHeader.d.ts +1 -1
- package/types/GlobalHeaderContainer.d.ts +1 -1
- package/types/GlobalHeaderContext.d.ts +1 -1
- package/types/{index.d.d.ts → GlobalHeaderTypes.d.ts} +16 -2
- package/types/components/Breadcrumb/PureBreadcrumb.d.ts +2 -2
- package/types/components/Breadcrumb/styles.d.ts +1 -1
- package/types/config/useGetPropsWithDefaults.d.ts +1 -1
- package/types/config/useGlobalHeader.d.ts +1 -1
- package/types/config/useValidateProps.d.ts +1 -1
- package/types/defaultProps.d.ts +1 -1
- package/types/outOfTheBox/AppPicker/AppPicker.d.ts +1 -1
- package/types/outOfTheBox/PopupMenu/PopupMenu.d.ts +2 -2
- package/types/outOfTheBox/PopupMenu/PopupMenuContent.d.ts +2 -2
- package/types/outOfTheBox/SearchToggle/SearchToggle.d.ts +2 -0
- package/types/outOfTheBox/SearchToggle/styles.d.ts +1 -0
- package/types/outOfTheBox/index.d.ts +1 -0
|
File without changes
|
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
7
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
8
|
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
9
|
require('core-js/modules/esnext.iterator.map.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
13
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
14
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
15
|
var React = require('react');
|
|
9
16
|
var dsGrid = require('@elliemae/ds-grid');
|
|
10
17
|
var styles = require('./styles.js');
|
|
@@ -14,8 +21,15 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
14
21
|
|
|
15
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
23
|
|
|
24
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
25
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
17
26
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
18
27
|
|
|
28
|
+
const _excluded = ["label"];
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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__default["default"](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
33
|
const GlobalHeaderBreadcrumb = () => {
|
|
20
34
|
const {
|
|
21
35
|
props: {
|
|
@@ -54,18 +68,14 @@ const GlobalHeaderBreadcrumb = () => {
|
|
|
54
68
|
showIconOnly: showIconOnly
|
|
55
69
|
}), breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.map(item => {
|
|
56
70
|
const {
|
|
57
|
-
label
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return /*#__PURE__*/_jsx__default["default"](PureBreadcrumb.PureBreadcrumb, {
|
|
71
|
+
label
|
|
72
|
+
} = item,
|
|
73
|
+
rest = _objectWithoutProperties__default["default"](item, _excluded);
|
|
74
|
+
|
|
75
|
+
return /*#__PURE__*/jsxRuntime.jsx(PureBreadcrumb.PureBreadcrumb, _objectSpread({
|
|
63
76
|
label: label,
|
|
64
|
-
hasNext: hasNext,
|
|
65
|
-
isSelected: isSelected,
|
|
66
|
-
onClick: onClick,
|
|
67
77
|
length: breadcrumb.length
|
|
68
|
-
}, "".concat(instanceUID, "-breadcrumb-item-").concat(label));
|
|
78
|
+
}, rest), "".concat(instanceUID, "-breadcrumb-item-").concat(label));
|
|
69
79
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
70
80
|
id: "global-header-flex-region",
|
|
71
81
|
ref: flexRegion
|
|
@@ -2,33 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
11
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
12
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
13
|
var React = require('react');
|
|
7
14
|
var dsIcons = require('@elliemae/ds-icons');
|
|
15
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
8
16
|
var styles = require('./styles.js');
|
|
17
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
18
|
|
|
10
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
20
|
|
|
21
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
12
22
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
23
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
13
24
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
25
|
|
|
15
26
|
var _ChevronSmallRight;
|
|
27
|
+
|
|
28
|
+
const _excluded = ["onClick", "isSelected", "length", "label", "hasNext", "id"];
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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__default["default"](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; }
|
|
16
33
|
const PureBreadcrumb = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
17
34
|
let {
|
|
18
35
|
onClick,
|
|
19
36
|
isSelected,
|
|
20
37
|
length,
|
|
21
38
|
label,
|
|
22
|
-
hasNext
|
|
23
|
-
|
|
24
|
-
|
|
39
|
+
hasNext,
|
|
40
|
+
id
|
|
41
|
+
} = _ref,
|
|
42
|
+
rest = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
43
|
+
|
|
44
|
+
return /*#__PURE__*/_jsx__default["default"](styles.BreadcrumbItem, {}, void 0, /*#__PURE__*/jsxRuntime.jsx(styles.LabelButton, _objectSpread(_objectSpread({
|
|
25
45
|
onClick: onClick,
|
|
26
46
|
"aria-selected": isSelected,
|
|
27
|
-
"data-testid": "gh-breadcrumb-btn"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
"data-testid": "gh-breadcrumb-btn",
|
|
48
|
+
id: id
|
|
49
|
+
}, dsPropsHelpers.getDataProps(rest)), {}, {
|
|
50
|
+
children: /*#__PURE__*/_jsx__default["default"](styles.Label, {
|
|
51
|
+
isSelected: !!isSelected,
|
|
52
|
+
isOnlyItem: length === 1
|
|
53
|
+
}, void 0, label)
|
|
54
|
+
})), hasNext && (_ChevronSmallRight || (_ChevronSmallRight = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronSmallRight, {
|
|
32
55
|
size: "m",
|
|
33
56
|
fill: "#FFF"
|
|
34
57
|
}))));
|
|
@@ -21,40 +21,35 @@ const BreadcrumbItem = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
|
21
21
|
})(["display:flex;align-items:center;height:100%;"]);
|
|
22
22
|
const LabelButton = /*#__PURE__*/styled__default["default"].button.withConfig({
|
|
23
23
|
componentId: "sc-1n5l527-2"
|
|
24
|
-
})(["width:fit-content;height:100%;margin:0;padding:0;border:1px solid transparent;background-color:transparent;outline:none;cursor:pointer;position:relative;&:focus{:
|
|
24
|
+
})(["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 => {
|
|
25
25
|
let {
|
|
26
26
|
theme
|
|
27
27
|
} = _ref2;
|
|
28
|
-
return theme.colors.brand[700];
|
|
29
|
-
}, _ref3 => {
|
|
30
|
-
let {
|
|
31
|
-
theme
|
|
32
|
-
} = _ref3;
|
|
33
28
|
return theme.colors.neutral['000'];
|
|
34
29
|
});
|
|
35
30
|
const Label = /*#__PURE__*/styled__default["default"].p.withConfig({
|
|
36
31
|
componentId: "sc-1n5l527-3"
|
|
37
|
-
})(["color:", ";", ";font-size:16px;text-transform:uppercase;border-bottom:", ";margin:3px 5px 0 5px;:hover{", ";}"],
|
|
32
|
+
})(["color:", ";", ";font-size:16px;text-transform:uppercase;border-bottom:", ";margin:3px 5px 0 5px;:hover{", ";}"], _ref3 => {
|
|
38
33
|
let {
|
|
39
34
|
theme
|
|
40
|
-
} =
|
|
35
|
+
} = _ref3;
|
|
41
36
|
return theme.colors.neutral['000'];
|
|
42
|
-
},
|
|
37
|
+
}, _ref4 => {
|
|
43
38
|
let {
|
|
44
39
|
theme,
|
|
45
40
|
isSelected
|
|
46
|
-
} =
|
|
41
|
+
} = _ref4;
|
|
47
42
|
return "-webkit-text-stroke: 0.4px ".concat(isSelected ? theme.colors.neutral['000'] : 'transparent');
|
|
48
|
-
},
|
|
43
|
+
}, _ref5 => {
|
|
49
44
|
let {
|
|
50
45
|
isSelected,
|
|
51
46
|
isOnlyItem
|
|
52
|
-
} =
|
|
47
|
+
} = _ref5;
|
|
53
48
|
return "2px solid ".concat(isSelected && !isOnlyItem ? '#FFF' : 'transparent');
|
|
54
|
-
},
|
|
49
|
+
}, _ref6 => {
|
|
55
50
|
let {
|
|
56
51
|
theme
|
|
57
|
-
} =
|
|
52
|
+
} = _ref6;
|
|
58
53
|
return "-webkit-text-stroke: 0.4px ".concat(theme.colors.neutral['000']);
|
|
59
54
|
});
|
|
60
55
|
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
8
|
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
9
|
require('core-js/modules/esnext.iterator.map.js');
|
|
9
10
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
@@ -14,14 +15,19 @@ require('core-js/modules/esnext.iterator.for-each.js');
|
|
|
14
15
|
var React = require('react');
|
|
15
16
|
var AppPicker = require('../../outOfTheBox/AppPicker/AppPicker.js');
|
|
16
17
|
var PopupMenu = require('../../outOfTheBox/PopupMenu/PopupMenu.js');
|
|
18
|
+
var SearchToggle = require('../../outOfTheBox/SearchToggle/SearchToggle.js');
|
|
17
19
|
var styles = require('./styles.js');
|
|
18
20
|
var GlobalHeaderContext = require('../../GlobalHeaderContext.js');
|
|
21
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
19
22
|
var jsxRuntime = require('react/jsx-runtime');
|
|
20
23
|
|
|
21
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
25
|
|
|
23
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
26
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
27
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
28
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
29
|
+
|
|
30
|
+
const _excluded = ["Icon", "type", "onClick", "componentProps", "label", "onKeyPress", "id"];
|
|
25
31
|
|
|
26
32
|
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; }
|
|
27
33
|
|
|
@@ -41,37 +47,49 @@ const ToolbarItems = () => {
|
|
|
41
47
|
type,
|
|
42
48
|
onClick,
|
|
43
49
|
componentProps,
|
|
44
|
-
label
|
|
45
|
-
|
|
50
|
+
label,
|
|
51
|
+
onKeyPress,
|
|
52
|
+
id
|
|
53
|
+
} = item,
|
|
54
|
+
otherProps = _objectWithoutProperties__default["default"](item, _excluded);
|
|
46
55
|
|
|
47
56
|
switch (type) {
|
|
48
57
|
case 'ds-popup-menu':
|
|
49
|
-
|
|
50
|
-
options,
|
|
51
|
-
closeOnClick
|
|
52
|
-
} = componentProps;
|
|
53
|
-
return /*#__PURE__*/_jsx__default["default"](PopupMenu.PopupMenu, {
|
|
54
|
-
onClick: onClick,
|
|
58
|
+
return /*#__PURE__*/jsxRuntime.jsx(PopupMenu.PopupMenu, _objectSpread(_objectSpread({
|
|
55
59
|
title: label,
|
|
56
60
|
Icon: Icon,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
onClick: onClick,
|
|
62
|
+
onKeyPress: onKeyPress,
|
|
63
|
+
id: id
|
|
64
|
+
}, otherProps), {}, {
|
|
65
|
+
componentProps: componentProps
|
|
66
|
+
}), "".concat(instanceUID, "-ds-popup-menu-").concat(label));
|
|
60
67
|
|
|
61
68
|
case 'ds-app-picker':
|
|
62
69
|
return /*#__PURE__*/jsxRuntime.jsx(AppPicker.AppPicker, _objectSpread({
|
|
63
|
-
label: label
|
|
64
|
-
|
|
70
|
+
label: label,
|
|
71
|
+
id: id,
|
|
72
|
+
componentProps: componentProps
|
|
73
|
+
}, otherProps), "".concat(instanceUID, "-ds-app-picker-").concat(label));
|
|
74
|
+
|
|
75
|
+
case 'ds-search-toggle':
|
|
76
|
+
return /*#__PURE__*/jsxRuntime.jsx(SearchToggle.SearchToggle, _objectSpread({
|
|
77
|
+
id: id,
|
|
78
|
+
componentProps: componentProps
|
|
79
|
+
}, otherProps), "".concat(instanceUID, "-ds-search-toggle-").concat(id));
|
|
65
80
|
|
|
66
81
|
default:
|
|
67
|
-
return /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/jsxRuntime.jsx(styles.Button, _objectSpread(_objectSpread({
|
|
68
83
|
onClick: onClick,
|
|
69
84
|
title: label,
|
|
70
|
-
"data-testid": "gh-toolbar-item"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
"data-testid": "gh-toolbar-item",
|
|
86
|
+
id: id
|
|
87
|
+
}, dsPropsHelpers.getDataProps(otherProps)), {}, {
|
|
88
|
+
children: _Icon || (_Icon = /*#__PURE__*/_jsx__default["default"](Icon, {
|
|
89
|
+
fill: "#FFF",
|
|
90
|
+
size: "m"
|
|
91
|
+
}))
|
|
92
|
+
}), "".concat(instanceUID, "-ds-toolbar-button-").concat(label));
|
|
75
93
|
}
|
|
76
94
|
}), [toolbar, instanceUID]);
|
|
77
95
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
@@ -10,7 +10,7 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
|
10
10
|
|
|
11
11
|
const Button = /*#__PURE__*/styled__default["default"].button.withConfig({
|
|
12
12
|
componentId: "sc-1gqj0i3-0"
|
|
13
|
-
})(["height:40px;width:40px;border:none;background-color:transparent;cursor:pointer;position:relative;outline:none;&:hover:not(:focus){background-color:", ";outline:none;}&:focus{:
|
|
13
|
+
})(["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 => {
|
|
14
14
|
let {
|
|
15
15
|
theme
|
|
16
16
|
} = _ref;
|
|
@@ -19,11 +19,6 @@ const Button = /*#__PURE__*/styled__default["default"].button.withConfig({
|
|
|
19
19
|
let {
|
|
20
20
|
theme
|
|
21
21
|
} = _ref2;
|
|
22
|
-
return theme.colors.brand[700];
|
|
23
|
-
}, _ref3 => {
|
|
24
|
-
let {
|
|
25
|
-
theme
|
|
26
|
-
} = _ref3;
|
|
27
22
|
return theme.colors.neutral['000'];
|
|
28
23
|
});
|
|
29
24
|
|
|
@@ -17,7 +17,7 @@ const useGlobalHeader = props => {
|
|
|
17
17
|
const globalHeaderToolbarGrid = React.useMemo(() => {
|
|
18
18
|
var _props$toolbar$length, _props$toolbar;
|
|
19
19
|
|
|
20
|
-
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('
|
|
20
|
+
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');
|
|
21
21
|
}, [props.toolbar]);
|
|
22
22
|
const globalHeaderBreadcrumbGrid = React.useMemo(() => {
|
|
23
23
|
var _props$breadcrumb$len, _props$breadcrumb;
|
|
@@ -35,21 +35,6 @@ const validateAppPickerItem = componentProps => {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const validateGenericToolbarItem = item => {
|
|
39
|
-
if (item.label && typeof item.label !== 'string') {
|
|
40
|
-
validateHelpers.throwToolbarItemGenericError('label', item.label);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (item.onClick && typeof item.onClick !== 'function') {
|
|
44
|
-
validateHelpers.throwToolbarItemGenericError('onClick', item.onClick);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (item.Icon && typeof item.Icon !== 'function') {
|
|
48
|
-
if (item.type === 'ds-app-picker') return;
|
|
49
|
-
validateHelpers.throwToolbarItemGenericError('Icon', item.Icon);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
38
|
const useValidateProps = props => {
|
|
54
39
|
const {
|
|
55
40
|
breadcrumb,
|
|
@@ -84,8 +69,6 @@ const useValidateProps = props => {
|
|
|
84
69
|
}
|
|
85
70
|
});
|
|
86
71
|
toolbar === null || toolbar === void 0 ? void 0 : toolbar.forEach(toolbarItem => {
|
|
87
|
-
validateGenericToolbarItem(toolbarItem);
|
|
88
|
-
|
|
89
72
|
if (toolbarItem.type) {
|
|
90
73
|
if (!validateHelpers.isValidToolbarType(toolbarItem.type)) {
|
|
91
74
|
validateHelpers.throwToolbarItemGenericError('type', toolbarItem.type);
|
|
@@ -10,7 +10,7 @@ const breadcrumbProps = {
|
|
|
10
10
|
};
|
|
11
11
|
const toolbarProps = {
|
|
12
12
|
label: 'string',
|
|
13
|
-
type: '"ds-app-picker" or "ds-popup-menu"',
|
|
13
|
+
type: '"ds-app-picker" or "ds-popup-menu" or "ds-search-toggle"',
|
|
14
14
|
componentProps: 'object',
|
|
15
15
|
Icon: 'react component',
|
|
16
16
|
onClick: 'function',
|
|
@@ -28,7 +28,7 @@ const getVariableType = arg => {
|
|
|
28
28
|
if (arg === undefined) return 'undefined';
|
|
29
29
|
return typeof arg;
|
|
30
30
|
};
|
|
31
|
-
const isValidToolbarType = string => string === 'ds-app-picker' || string === 'ds-popup-menu';
|
|
31
|
+
const isValidToolbarType = string => string === 'ds-app-picker' || string === 'ds-popup-menu' || string === 'ds-search-toggle';
|
|
32
32
|
const throwBreadcrumbItemError = (validPropKey, invalidProp) => {
|
|
33
33
|
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 "));
|
|
34
34
|
};
|
|
@@ -2,23 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
6
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
8
|
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
14
|
var React = require('react');
|
|
8
15
|
var dsAppPicker = require('@elliemae/ds-app-picker');
|
|
9
16
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
17
|
var dsIcons = require('@elliemae/ds-icons');
|
|
11
18
|
var styles = require('../../components/Toolbar/styles.js');
|
|
19
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
12
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
13
21
|
|
|
14
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
23
|
|
|
24
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
25
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
26
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
17
27
|
|
|
18
28
|
var _MenuPicker;
|
|
29
|
+
|
|
30
|
+
const _excluded = ["label", "id", "componentProps"];
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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__default["default"](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
35
|
const AppPicker = _ref => {
|
|
20
36
|
let {
|
|
21
37
|
label,
|
|
38
|
+
id,
|
|
39
|
+
componentProps
|
|
40
|
+
} = _ref,
|
|
41
|
+
otherProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
42
|
+
|
|
43
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
44
|
+
const buttonRef = React.useRef(null);
|
|
45
|
+
const {
|
|
22
46
|
apps,
|
|
23
47
|
icon,
|
|
24
48
|
customApps,
|
|
@@ -32,9 +56,7 @@ const AppPicker = _ref => {
|
|
|
32
56
|
onClose,
|
|
33
57
|
triggerRef,
|
|
34
58
|
triggerOnClick
|
|
35
|
-
} =
|
|
36
|
-
const [isOpen, setIsOpen] = React.useState(false);
|
|
37
|
-
const buttonRef = React.useRef(null);
|
|
59
|
+
} = componentProps;
|
|
38
60
|
const handleTriggerKeyDown = React.useCallback(e => {
|
|
39
61
|
if (e.code === 'Enter' || e.code === 'Space') {
|
|
40
62
|
setIsOpen(true);
|
|
@@ -60,19 +82,22 @@ const AppPicker = _ref => {
|
|
|
60
82
|
} = _ref2;
|
|
61
83
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
62
84
|
ref: ref,
|
|
63
|
-
children: /*#__PURE__*/jsxRuntime.jsx(styles.Button, {
|
|
85
|
+
children: /*#__PURE__*/jsxRuntime.jsx(styles.Button, _objectSpread(_objectSpread({
|
|
64
86
|
onClick: triggerOnClick !== null && triggerOnClick !== void 0 ? triggerOnClick : handleOnClick,
|
|
65
87
|
onKeyDown: handleTriggerKeyDown,
|
|
66
88
|
ref: dsUtilities.mergeRefs(buttonRef, triggerRef),
|
|
67
89
|
title: label,
|
|
68
90
|
"data-testid": "gh-toolbar-item",
|
|
91
|
+
id: id
|
|
92
|
+
}, dsPropsHelpers.getDataProps(otherProps)), {}, {
|
|
69
93
|
children: _MenuPicker || (_MenuPicker = /*#__PURE__*/_jsx__default["default"](dsIcons.MenuPicker, {
|
|
70
94
|
fill: "#FFF",
|
|
71
|
-
|
|
95
|
+
width: 20.73,
|
|
96
|
+
height: 20.73
|
|
72
97
|
}))
|
|
73
|
-
})
|
|
98
|
+
}))
|
|
74
99
|
});
|
|
75
|
-
}, [triggerOnClick, handleOnClick, handleTriggerKeyDown, label]);
|
|
100
|
+
}, [triggerOnClick, handleOnClick, handleTriggerKeyDown, triggerRef, label, id, otherProps]);
|
|
76
101
|
return /*#__PURE__*/_jsx__default["default"](dsAppPicker.DSAppPicker, {
|
|
77
102
|
apps: apps,
|
|
78
103
|
customApps: customApps,
|
|
@@ -2,65 +2,99 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
6
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
8
|
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
14
|
var React = require('react');
|
|
8
15
|
var dsPopperjs = require('@elliemae/ds-popperjs');
|
|
9
16
|
var PopupMenuContent = require('./PopupMenuContent.js');
|
|
10
17
|
var styles = require('../../components/Toolbar/styles.js');
|
|
18
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
11
19
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
20
|
|
|
13
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
22
|
|
|
23
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
24
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
25
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
16
26
|
|
|
27
|
+
const _excluded = ["Icon", "title", "onClick", "id", "componentProps"];
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
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__default["default"](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; }
|
|
17
32
|
const PopupMenu = _ref => {
|
|
18
33
|
var _PopupMenuContent;
|
|
19
34
|
|
|
20
35
|
let {
|
|
21
36
|
Icon,
|
|
22
|
-
options,
|
|
23
|
-
closeOnClick,
|
|
24
37
|
title,
|
|
25
|
-
onClick
|
|
26
|
-
|
|
38
|
+
onClick,
|
|
39
|
+
id,
|
|
40
|
+
componentProps
|
|
41
|
+
} = _ref,
|
|
42
|
+
otherProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
43
|
+
|
|
27
44
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
28
45
|
const [buttonRef, setButtonRef] = React.useState(null);
|
|
46
|
+
const {
|
|
47
|
+
onClickOutside = () => null,
|
|
48
|
+
onKeyPress,
|
|
49
|
+
popupOnKeyPress,
|
|
50
|
+
isOpen: userIsOpen,
|
|
51
|
+
options,
|
|
52
|
+
closeOnClick
|
|
53
|
+
} = componentProps;
|
|
29
54
|
const handleKeyPress = React.useCallback(e => {
|
|
30
55
|
if (e.code === 'Enter' || e.code === 'Space') {
|
|
31
56
|
setIsOpen(true);
|
|
32
57
|
}
|
|
33
|
-
|
|
58
|
+
|
|
59
|
+
if (onKeyPress) onKeyPress(e);
|
|
60
|
+
}, [onKeyPress]);
|
|
34
61
|
const handleOnClose = React.useCallback(() => {
|
|
35
|
-
|
|
62
|
+
if (userIsOpen === undefined) {
|
|
63
|
+
setIsOpen(false);
|
|
64
|
+
}
|
|
65
|
+
|
|
36
66
|
buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.focus();
|
|
37
|
-
}, [buttonRef]);
|
|
67
|
+
}, [buttonRef, userIsOpen]);
|
|
38
68
|
const handleTriggerOnClick = React.useCallback(e => {
|
|
39
|
-
setIsOpen(true);
|
|
69
|
+
if (userIsOpen === undefined) setIsOpen(true);
|
|
40
70
|
onClick(e);
|
|
41
|
-
}, [onClick]);
|
|
71
|
+
}, [onClick, userIsOpen]);
|
|
42
72
|
const handleItemClick = React.useCallback(() => {
|
|
43
|
-
if (closeOnClick) handleOnClose();
|
|
44
|
-
}, [closeOnClick, handleOnClose]);
|
|
73
|
+
if (closeOnClick && userIsOpen === undefined) handleOnClose();
|
|
74
|
+
}, [closeOnClick, handleOnClose, userIsOpen]);
|
|
45
75
|
const content = React.useMemo(() => _PopupMenuContent || (_PopupMenuContent = /*#__PURE__*/_jsx__default["default"](PopupMenuContent.PopupMenuContent, {
|
|
46
76
|
options: options,
|
|
47
77
|
onItemClick: handleItemClick,
|
|
48
|
-
onClose: handleOnClose
|
|
49
|
-
|
|
50
|
-
|
|
78
|
+
onClose: handleOnClose,
|
|
79
|
+
popupOnKeyPress: popupOnKeyPress
|
|
80
|
+
})), [options, handleItemClick, handleOnClose, popupOnKeyPress]);
|
|
81
|
+
return /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, /*#__PURE__*/jsxRuntime.jsx(styles.Button, _objectSpread(_objectSpread({
|
|
51
82
|
onClick: handleTriggerOnClick,
|
|
52
83
|
onKeyPress: handleKeyPress,
|
|
53
84
|
title: title,
|
|
54
85
|
ref: setButtonRef,
|
|
55
86
|
"data-testid": "gh-toolbar-item",
|
|
87
|
+
id: id
|
|
88
|
+
}, dsPropsHelpers.getDataProps(otherProps)), {}, {
|
|
56
89
|
children: Icon && /*#__PURE__*/_jsx__default["default"](Icon, {
|
|
57
90
|
fill: "#FFF",
|
|
58
91
|
size: "m"
|
|
59
92
|
})
|
|
60
|
-
}), /*#__PURE__*/_jsx__default["default"](dsPopperjs.DSPopperJS, {
|
|
93
|
+
})), /*#__PURE__*/_jsx__default["default"](dsPopperjs.DSPopperJS, {
|
|
61
94
|
referenceElement: buttonRef,
|
|
62
|
-
showPopover: isOpen,
|
|
63
|
-
closeContextMenu: handleOnClose
|
|
95
|
+
showPopover: userIsOpen !== null && userIsOpen !== void 0 ? userIsOpen : isOpen,
|
|
96
|
+
closeContextMenu: handleOnClose,
|
|
97
|
+
onClickOutside: onClickOutside
|
|
64
98
|
}, void 0, content));
|
|
65
99
|
};
|
|
66
100
|
|
|
@@ -30,7 +30,8 @@ const PopupMenuContent = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
30
30
|
let {
|
|
31
31
|
options,
|
|
32
32
|
onItemClick,
|
|
33
|
-
onClose
|
|
33
|
+
onClose,
|
|
34
|
+
popupOnKeyPress
|
|
34
35
|
} = _ref;
|
|
35
36
|
const {
|
|
36
37
|
instanceUID
|
|
@@ -47,7 +48,8 @@ const PopupMenuContent = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
47
48
|
Icon,
|
|
48
49
|
label = '',
|
|
49
50
|
onClick,
|
|
50
|
-
Content
|
|
51
|
+
Content,
|
|
52
|
+
id
|
|
51
53
|
} = option;
|
|
52
54
|
|
|
53
55
|
const ariaAndDataProps = _objectSpread(_objectSpread({}, dsPropsHelpers.getAriaProps(option)), dsPropsHelpers.getDataProps(option));
|
|
@@ -59,6 +61,7 @@ const PopupMenuContent = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
59
61
|
|
|
60
62
|
const handleKeyDown = e => {
|
|
61
63
|
if (e.code === 'Escape') onClose();
|
|
64
|
+
if (popupOnKeyPress) popupOnKeyPress(e);
|
|
62
65
|
};
|
|
63
66
|
|
|
64
67
|
switch (type) {
|
|
@@ -68,7 +71,8 @@ const PopupMenuContent = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
68
71
|
case 'custom':
|
|
69
72
|
return /*#__PURE__*/jsxRuntime.jsx(styles.ItemWrapper, _objectSpread(_objectSpread({
|
|
70
73
|
onClick: handleClick,
|
|
71
|
-
onKeyDown: handleKeyDown
|
|
74
|
+
onKeyDown: handleKeyDown,
|
|
75
|
+
id: id
|
|
72
76
|
}, ariaAndDataProps), {}, {
|
|
73
77
|
children: Content && /*#__PURE__*/_jsx__default["default"](Content, {})
|
|
74
78
|
}), "".concat(instanceUID, "-popup-").concat(label));
|
|
@@ -76,12 +80,13 @@ const PopupMenuContent = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
76
80
|
default:
|
|
77
81
|
return /*#__PURE__*/jsxRuntime.jsxs(styles.ItemWrapper, _objectSpread(_objectSpread({
|
|
78
82
|
onClick: handleClick,
|
|
79
|
-
onKeyDown: handleKeyDown
|
|
83
|
+
onKeyDown: handleKeyDown,
|
|
84
|
+
id: id
|
|
80
85
|
}, ariaAndDataProps), {}, {
|
|
81
86
|
children: [Icon && /*#__PURE__*/_jsx__default["default"](Icon, {}), styles.Label && /*#__PURE__*/_jsx__default["default"](styles.Label, {}, void 0, label)]
|
|
82
87
|
}), "".concat(instanceUID, "-popup-").concat(label));
|
|
83
88
|
}
|
|
84
|
-
}), [
|
|
89
|
+
}), [options, onItemClick, onClose, popupOnKeyPress, instanceUID]);
|
|
85
90
|
return /*#__PURE__*/jsxRuntime.jsx(styles.List, {
|
|
86
91
|
ref: menuRef,
|
|
87
92
|
children: content
|
|
@@ -10,7 +10,7 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
|
10
10
|
|
|
11
11
|
const List = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
12
12
|
componentId: "sc-snqcgs-0"
|
|
13
|
-
})(["padding:5px 0px;"]);
|
|
13
|
+
})(["padding:5px 0px;background:white;"]);
|
|
14
14
|
const ItemWrapper = /*#__PURE__*/styled__default["default"].button.withConfig({
|
|
15
15
|
componentId: "sc-snqcgs-1"
|
|
16
16
|
})(["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 => {
|