@elliemae/ds-global-header 2.3.1 → 3.0.0-alpha.3
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 +110 -0
- package/dist/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +7 -0
- package/dist/cjs/components/Breadcrumb/PureBreadcrumb.js +79 -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 +122 -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 +54 -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 +139 -0
- package/dist/cjs/outOfTheBox/AppPicker/AppPicker.js.map +7 -0
- package/dist/cjs/outOfTheBox/PopupMenu/PopupMenu.js +122 -0
- package/dist/cjs/outOfTheBox/PopupMenu/PopupMenu.js.map +7 -0
- package/dist/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +97 -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 +134 -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 +83 -0
- package/dist/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +7 -0
- package/dist/esm/components/Breadcrumb/PureBreadcrumb.js +52 -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 +95 -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 +27 -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 +112 -0
- package/dist/esm/outOfTheBox/AppPicker/AppPicker.js.map +7 -0
- package/dist/esm/outOfTheBox/PopupMenu/PopupMenu.js +95 -0
- package/dist/esm/outOfTheBox/PopupMenu/PopupMenu.js.map +7 -0
- package/dist/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +70 -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 +107 -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/package.json +82 -73
- 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
- package/types/GlobalHeader.d.ts +0 -39
- package/types/GlobalHeaderContainer.d.ts +0 -3
- package/types/GlobalHeaderContext.d.ts +0 -3
- package/types/GlobalHeaderTypes.d.ts +0 -85
- package/types/components/Breadcrumb/GlobalHeaderBreadcrumb.d.ts +0 -2
- package/types/components/Breadcrumb/PureBreadcrumb.d.ts +0 -3
- package/types/components/Breadcrumb/styles.d.ts +0 -5
- package/types/components/Title/GlobalHeaderTitle.d.ts +0 -2
- package/types/components/Toolbar/GlobalHeaderToolbar.d.ts +0 -2
- package/types/components/Toolbar/ToolbarItems.d.ts +0 -2
- package/types/components/Toolbar/styles.d.ts +0 -1
- package/types/config/useGetPropsWithDefaults.d.ts +0 -2
- package/types/config/useGlobalHeader.d.ts +0 -2
- package/types/config/useValidateProps.d.ts +0 -2
- package/types/config/validateHelpers.d.ts +0 -27
- package/types/defaultProps.d.ts +0 -2
- package/types/index.d.ts +0 -2
- package/types/outOfTheBox/AppPicker/AppPicker.d.ts +0 -8
- package/types/outOfTheBox/PopupMenu/PopupMenu.d.ts +0 -3
- package/types/outOfTheBox/PopupMenu/PopupMenuContent.d.ts +0 -3
- package/types/outOfTheBox/PopupMenu/styles.d.ts +0 -4
- package/types/outOfTheBox/SearchToggle/SearchToggle.d.ts +0 -3
- package/types/outOfTheBox/SearchToggle/styles.d.ts +0 -1
- package/types/outOfTheBox/index.d.ts +0 -3
- package/types/propTypes.d.ts +0 -29
- package/types/styles.d.ts +0 -2
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
import * as React from "react";
|
|
30
|
+
import React2 from "react";
|
|
31
|
+
import { ChevronSmallRight } from "@elliemae/ds-icons";
|
|
32
|
+
import { getDataProps } from "@elliemae/ds-props-helpers";
|
|
33
|
+
import { BreadcrumbItem, LabelButton, Label } from "./styles";
|
|
34
|
+
const PureBreadcrumb = React2.memo((_a) => {
|
|
35
|
+
var _b = _a, { onClick, isSelected, length, label, hasNext, id } = _b, rest = __objRest(_b, ["onClick", "isSelected", "length", "label", "hasNext", "id"]);
|
|
36
|
+
return /* @__PURE__ */ React2.createElement(BreadcrumbItem, null, /* @__PURE__ */ React2.createElement(LabelButton, __spreadValues({
|
|
37
|
+
onClick,
|
|
38
|
+
"aria-selected": isSelected,
|
|
39
|
+
"data-testid": "gh-breadcrumb-btn",
|
|
40
|
+
id
|
|
41
|
+
}, getDataProps(rest)), /* @__PURE__ */ React2.createElement(Label, {
|
|
42
|
+
isSelected: !!isSelected,
|
|
43
|
+
isOnlyItem: length === 1
|
|
44
|
+
}, label)), hasNext && /* @__PURE__ */ React2.createElement(ChevronSmallRight, {
|
|
45
|
+
size: "m",
|
|
46
|
+
fill: "#FFF"
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
PureBreadcrumb
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=PureBreadcrumb.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/Breadcrumb/PureBreadcrumb.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ChevronSmallRight } from '@elliemae/ds-icons';\nimport { getDataProps } from '@elliemae/ds-props-helpers';\nimport { BreadcrumbItem, LabelButton, Label } from './styles';\nimport type { BreadcrumbItemT as Props } from '../../GlobalHeaderTypes';\n\nexport const PureBreadcrumb = React.memo(({ onClick, isSelected, length, label, hasNext, id, ...rest }: Props) => (\n <BreadcrumbItem>\n <LabelButton\n onClick={onClick}\n aria-selected={isSelected}\n data-testid=\"gh-breadcrumb-btn\"\n id={id}\n {...getDataProps(rest)}\n >\n <Label isSelected={!!isSelected} isOnlyItem={length === 1}>\n {label}\n </Label>\n </LabelButton>\n {hasNext && <ChevronSmallRight size=\"m\" fill=\"#FFF\" />}\n </BreadcrumbItem>\n));\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAGO,MAAM,iBAAiB,OAAM,KAAK,CAAC,OAAqE;AAArE,eAAE,WAAS,YAAY,QAAQ,OAAO,SAAS,OAA/C,IAAsD,iBAAtD,IAAsD,CAApD,WAAS,cAAY,UAAQ,SAAO,WAAS;AACvF,8CAAC,gBAAD,MACE,qCAAC,aAAD;AAAA,IACE;AAAA,IACA,iBAAe;AAAA,IACf,eAAY;AAAA,IACZ;AAAA,KACI,aAAa,QAEjB,qCAAC,OAAD;AAAA,IAAO,YAAY,CAAC,CAAC;AAAA,IAAY,YAAY,WAAW;AAAA,KACrD,SAGJ,WAAW,qCAAC,mBAAD;AAAA,IAAmB,MAAK;AAAA,IAAI,MAAK;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
const Pipe = styled.span`
|
|
4
|
+
margin: 0 7px 0 0;
|
|
5
|
+
border-left: ${({ showIconOnly }) => showIconOnly ? "none" : "1px solid #fff"};
|
|
6
|
+
height: 20px;
|
|
7
|
+
`;
|
|
8
|
+
const BreadcrumbItem = styled.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
height: 100%;
|
|
12
|
+
`;
|
|
13
|
+
const LabelButton = styled.button`
|
|
14
|
+
width: fit-content;
|
|
15
|
+
height: 100%;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
border: 1px solid transparent;
|
|
19
|
+
background-color: transparent;
|
|
20
|
+
outline: none;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
position: relative;
|
|
23
|
+
&:focus {
|
|
24
|
+
:before {
|
|
25
|
+
content: '';
|
|
26
|
+
position: absolute;
|
|
27
|
+
z-index: 2;
|
|
28
|
+
top: 2px;
|
|
29
|
+
left: -5px;
|
|
30
|
+
width: calc(100% + 10px);
|
|
31
|
+
height: calc(100% - 4px);
|
|
32
|
+
border: 2px solid ${({ theme }) => theme.colors.neutral["000"]};
|
|
33
|
+
border-radius: 4px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
const Label = styled.p`
|
|
38
|
+
color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
39
|
+
${({ theme, isSelected }) => `-webkit-text-stroke: 0.4px ${isSelected ? theme.colors.neutral["000"] : "transparent"}`};
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
border-bottom: ${({ isSelected, isOnlyItem }) => `2px solid ${isSelected && !isOnlyItem ? "#FFF" : "transparent"}`};
|
|
43
|
+
margin: 3px 5px 0 5px;
|
|
44
|
+
:hover {
|
|
45
|
+
${({ theme }) => `-webkit-text-stroke: 0.4px ${theme.colors.neutral["000"]}`};
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
export {
|
|
49
|
+
BreadcrumbItem,
|
|
50
|
+
Label,
|
|
51
|
+
LabelButton,
|
|
52
|
+
Pipe
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/Breadcrumb/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport type { LabelT, PipeT } from '../../GlobalHeaderTypes';\n\nexport const Pipe = styled.span<PipeT>`\n margin: 0 7px 0 0;\n border-left: ${({ showIconOnly }) => (showIconOnly ? 'none' : '1px solid #fff')};\n height: 20px;\n`;\n\nexport const BreadcrumbItem = styled.div`\n display: flex;\n align-items: center;\n height: 100%;\n`;\n\nexport const LabelButton = styled.button`\n width: fit-content;\n height: 100%;\n margin: 0;\n padding: 0;\n border: 1px solid transparent;\n background-color: transparent;\n outline: none;\n cursor: pointer;\n position: relative;\n &:focus {\n :before {\n content: '';\n position: absolute;\n z-index: 2;\n top: 2px;\n left: -5px;\n width: calc(100% + 10px);\n height: calc(100% - 4px);\n border: 2px solid ${({ theme }) => theme.colors.neutral['000']};\n border-radius: 4px;\n }\n }\n`;\n\nexport const Label = styled.p<LabelT>`\n color: ${({ theme }) => theme.colors.neutral['000']};\n ${({ theme, isSelected }) =>\n `-webkit-text-stroke: 0.4px ${isSelected ? theme.colors.neutral['000'] : 'transparent'}`};\n font-size: 16px;\n text-transform: uppercase;\n border-bottom: ${({ isSelected, isOnlyItem }) => `2px solid ${isSelected && !isOnlyItem ? '#FFF' : 'transparent'}`};\n margin: 3px 5px 0 5px;\n :hover {\n ${({ theme }) => `-webkit-text-stroke: 0.4px ${theme.colors.neutral['000']}`};\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGO,MAAM,OAAO,OAAO;AAAA;AAAA,iBAEV,CAAC,EAAE,mBAAoB,eAAe,SAAS;AAAA;AAAA;AAIzD,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAAA;AAM9B,MAAM,cAAc,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAmBR,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAMvD,MAAM,QAAQ,OAAO;AAAA,WACjB,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA,IAC3C,CAAC,EAAE,OAAO,iBACV,+BAA+B,aAAa,MAAM,OAAO,QAAQ,SAAS;AAAA;AAAA;AAAA,mBAG3D,CAAC,EAAE,YAAY,iBAAiB,aAAa,cAAc,CAAC,aAAa,SAAS;AAAA;AAAA;AAAA,MAG/F,CAAC,EAAE,YAAY,8BAA8B,MAAM,OAAO,QAAQ;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useContext } from "react";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
import { GlobalHeaderContext } from "../../GlobalHeaderContext";
|
|
5
|
+
const GlobalHeaderTitle = () => {
|
|
6
|
+
const {
|
|
7
|
+
props: { Logo, LogoWithBrand },
|
|
8
|
+
showIconOnly
|
|
9
|
+
} = useContext(GlobalHeaderContext);
|
|
10
|
+
return /* @__PURE__ */ React2.createElement(Grid, {
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
pr: showIconOnly ? "0px" : "36px",
|
|
13
|
+
cols: showIconOnly ? ["auto"] : ["auto", "1fr"]
|
|
14
|
+
}, Logo && showIconOnly && /* @__PURE__ */ React2.createElement(Logo, null), LogoWithBrand && !showIconOnly && /* @__PURE__ */ React2.createElement(LogoWithBrand, null));
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
GlobalHeaderTitle
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=GlobalHeaderTitle.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/Title/GlobalHeaderTitle.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { GlobalHeaderContext } from '../../GlobalHeaderContext';\n\nexport const GlobalHeaderTitle = (): JSX.Element => {\n const {\n props: { Logo, LogoWithBrand },\n showIconOnly,\n } = useContext(GlobalHeaderContext);\n\n return (\n <Grid alignItems=\"center\" pr={showIconOnly ? '0px' : '36px'} cols={showIconOnly ? ['auto'] : ['auto', '1fr']}>\n {Logo && showIconOnly && <Logo />}\n {LogoWithBrand && !showIconOnly && <LogoWithBrand />}\n </Grid>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEO,MAAM,oBAAoB,MAAmB;AAClD,QAAM;AAAA,IACJ,OAAO,EAAE,MAAM;AAAA,IACf;AAAA,MACE,WAAW;AAEf,SACE,qCAAC,MAAD;AAAA,IAAM,YAAW;AAAA,IAAS,IAAI,eAAe,QAAQ;AAAA,IAAQ,MAAM,eAAe,CAAC,UAAU,CAAC,QAAQ;AAAA,KACnG,QAAQ,gBAAgB,qCAAC,MAAD,OACxB,iBAAiB,CAAC,gBAAgB,qCAAC,eAAD;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useContext } from "react";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
import { ToolbarItems } from "./ToolbarItems";
|
|
5
|
+
import { GlobalHeaderContext } from "../../GlobalHeaderContext";
|
|
6
|
+
const GlobalHeaderToolbar = () => {
|
|
7
|
+
const { globalHeaderToolbarGrid } = useContext(GlobalHeaderContext);
|
|
8
|
+
return /* @__PURE__ */ React2.createElement(Grid, {
|
|
9
|
+
height: "100%",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
gutter: "xxs",
|
|
13
|
+
cols: globalHeaderToolbarGrid,
|
|
14
|
+
role: "toolbar"
|
|
15
|
+
}, /* @__PURE__ */ React2.createElement(ToolbarItems, null));
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
GlobalHeaderToolbar
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=GlobalHeaderToolbar.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/Toolbar/GlobalHeaderToolbar.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ToolbarItems } from './ToolbarItems';\nimport { GlobalHeaderContext } from '../../GlobalHeaderContext';\n\nexport const GlobalHeaderToolbar = (): JSX.Element => {\n const { globalHeaderToolbarGrid } = useContext(GlobalHeaderContext);\n return (\n <Grid\n height=\"100%\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gutter=\"xxs\"\n cols={globalHeaderToolbarGrid}\n role=\"toolbar\"\n >\n <ToolbarItems />\n </Grid>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEO,MAAM,sBAAsB,MAAmB;AACpD,QAAM,EAAE,4BAA4B,WAAW;AAC/C,SACE,qCAAC,MAAD;AAAA,IACE,QAAO;AAAA,IACP,YAAW;AAAA,IACX,gBAAe;AAAA,IACf,QAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAK;AAAA,KAEL,qCAAC,cAAD;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import * as React from "react";
|
|
33
|
+
import React2, { useContext, useMemo } from "react";
|
|
34
|
+
import { AppPicker, PopupMenu, SearchToggle } from "../../outOfTheBox";
|
|
35
|
+
import { Button } from "./styles";
|
|
36
|
+
import { GlobalHeaderContext } from "../../GlobalHeaderContext";
|
|
37
|
+
import { getDataProps } from "@elliemae/ds-props-helpers";
|
|
38
|
+
const ToolbarItems = () => {
|
|
39
|
+
const {
|
|
40
|
+
props: { toolbar },
|
|
41
|
+
instanceUID
|
|
42
|
+
} = useContext(GlobalHeaderContext);
|
|
43
|
+
console.log(`toolbar`, toolbar);
|
|
44
|
+
const itemsList = useMemo(() => toolbar?.map((item) => {
|
|
45
|
+
const _a = item, { Icon, type, onClick, componentProps, label, onKeyPress, id, CustomComponent } = _a, otherProps = __objRest(_a, ["Icon", "type", "onClick", "componentProps", "label", "onKeyPress", "id", "CustomComponent"]);
|
|
46
|
+
switch (type) {
|
|
47
|
+
case "ds-popup-menu":
|
|
48
|
+
return /* @__PURE__ */ React2.createElement(PopupMenu, __spreadProps(__spreadValues({
|
|
49
|
+
title: label,
|
|
50
|
+
Icon,
|
|
51
|
+
onClick,
|
|
52
|
+
onKeyPress,
|
|
53
|
+
id,
|
|
54
|
+
key: `${instanceUID}-ds-popup-menu-${label}`
|
|
55
|
+
}, otherProps), {
|
|
56
|
+
componentProps
|
|
57
|
+
}));
|
|
58
|
+
case "ds-app-picker":
|
|
59
|
+
return /* @__PURE__ */ React2.createElement(AppPicker, __spreadValues({
|
|
60
|
+
label,
|
|
61
|
+
key: `${instanceUID}-ds-app-picker-${label}`,
|
|
62
|
+
id,
|
|
63
|
+
componentProps
|
|
64
|
+
}, otherProps));
|
|
65
|
+
case "ds-search-toggle":
|
|
66
|
+
return /* @__PURE__ */ React2.createElement(SearchToggle, __spreadValues({
|
|
67
|
+
key: `${instanceUID}-ds-search-toggle-${id}`,
|
|
68
|
+
id,
|
|
69
|
+
componentProps
|
|
70
|
+
}, otherProps));
|
|
71
|
+
case "custom":
|
|
72
|
+
if (CustomComponent)
|
|
73
|
+
return /* @__PURE__ */ React2.createElement(CustomComponent, {
|
|
74
|
+
item
|
|
75
|
+
});
|
|
76
|
+
return null;
|
|
77
|
+
default:
|
|
78
|
+
return /* @__PURE__ */ React2.createElement(Button, __spreadValues({
|
|
79
|
+
onClick,
|
|
80
|
+
key: `${instanceUID}-ds-toolbar-button-${label}`,
|
|
81
|
+
title: label,
|
|
82
|
+
"data-testid": "gh-toolbar-item",
|
|
83
|
+
id
|
|
84
|
+
}, getDataProps(otherProps)), /* @__PURE__ */ React2.createElement(Icon, {
|
|
85
|
+
fill: "#FFF",
|
|
86
|
+
size: "m"
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
}), [toolbar, instanceUID]);
|
|
90
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, itemsList);
|
|
91
|
+
};
|
|
92
|
+
export {
|
|
93
|
+
ToolbarItems
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=ToolbarItems.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/Toolbar/ToolbarItems.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-case-declarations */\nimport React, { useContext, useMemo } from 'react';\nimport { AppPicker, PopupMenu, SearchToggle } from '../../outOfTheBox';\nimport { Button } from './styles';\nimport { GlobalHeaderContext } from '../../GlobalHeaderContext';\nimport { getDataProps } from '@elliemae/ds-props-helpers';\n\nexport const ToolbarItems = (): JSX.Element => {\n const {\n props: { toolbar },\n instanceUID,\n } = useContext(GlobalHeaderContext);\n\n console.log(`toolbar`, toolbar);\n const itemsList = useMemo(\n () =>\n toolbar?.map((item) => {\n const { Icon, type, onClick, componentProps, label, onKeyPress, id, CustomComponent, ...otherProps } = item;\n\n switch (type) {\n case 'ds-popup-menu':\n return (\n <PopupMenu\n title={label}\n Icon={Icon}\n onClick={onClick}\n onKeyPress={onKeyPress}\n id={id}\n key={`${instanceUID}-ds-popup-menu-${label}`}\n {...otherProps}\n componentProps={componentProps}\n />\n );\n case 'ds-app-picker':\n return (\n <AppPicker\n label={label}\n key={`${instanceUID}-ds-app-picker-${label}`}\n id={id}\n componentProps={componentProps}\n {...otherProps}\n />\n );\n case 'ds-search-toggle':\n return (\n <SearchToggle\n key={`${instanceUID}-ds-search-toggle-${id}`}\n id={id}\n componentProps={componentProps}\n {...otherProps}\n />\n );\n case 'custom':\n if (CustomComponent) return <CustomComponent item={item} />;\n return null;\n default:\n return (\n <Button\n onClick={onClick}\n key={`${instanceUID}-ds-toolbar-button-${label}`}\n title={label}\n data-testid=\"gh-toolbar-item\"\n id={id}\n {...getDataProps(otherProps)}\n >\n <Icon fill=\"#FFF\" size=\"m\" />\n </Button>\n );\n }\n }),\n [toolbar, instanceUID],\n );\n\n return <>{itemsList}</>;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AAEO,MAAM,eAAe,MAAmB;AAC7C,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,IACT;AAAA,MACE,WAAW;AAEf,UAAQ,IAAI,WAAW;AACvB,QAAM,YAAY,QAChB,MACE,SAAS,IAAI,CAAC,SAAS;AACrB,UAAuG,WAA/F,QAAM,MAAM,SAAS,gBAAgB,OAAO,YAAY,IAAI,oBAAmC,IAAf,uBAAe,IAAf,CAAhF,QAAM,QAAM,WAAS,kBAAgB,SAAO,cAAY,MAAI;AAEpE,YAAQ;AAAA,WACD;AACH,eACE,qCAAC,WAAD;AAAA,UACE,OAAO;AAAA,UACP;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,KAAK,GAAG,6BAA6B;AAAA,WACjC,aAPN;AAAA,UAQE;AAAA;AAAA,WAGD;AACH,eACE,qCAAC,WAAD;AAAA,UACE;AAAA,UACA,KAAK,GAAG,6BAA6B;AAAA,UACrC;AAAA,UACA;AAAA,WACI;AAAA,WAGL;AACH,eACE,qCAAC,cAAD;AAAA,UACE,KAAK,GAAG,gCAAgC;AAAA,UACxC;AAAA,UACA;AAAA,WACI;AAAA,WAGL;AACH,YAAI;AAAiB,iBAAO,qCAAC,iBAAD;AAAA,YAAiB;AAAA;AAC7C,eAAO;AAAA;AAEP,eACE,qCAAC,QAAD;AAAA,UACE;AAAA,UACA,KAAK,GAAG,iCAAiC;AAAA,UACzC,OAAO;AAAA,UACP,eAAY;AAAA,UACZ;AAAA,WACI,aAAa,cAEjB,qCAAC,MAAD;AAAA,UAAM,MAAK;AAAA,UAAO,MAAK;AAAA;AAAA;AAAA,MAKnC,CAAC,SAAS;AAGZ,SAAO,4DAAG;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
const Button = styled.button`
|
|
4
|
+
height: 40px;
|
|
5
|
+
width: 40px;
|
|
6
|
+
border: none;
|
|
7
|
+
background-color: transparent;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
position: relative;
|
|
10
|
+
outline: none;
|
|
11
|
+
&:hover:not(:focus) {
|
|
12
|
+
background-color: ${({ theme }) => theme.colors.brand[700]};
|
|
13
|
+
outline: none;
|
|
14
|
+
}
|
|
15
|
+
&:focus {
|
|
16
|
+
:before {
|
|
17
|
+
content: '';
|
|
18
|
+
position: absolute;
|
|
19
|
+
z-index: 2;
|
|
20
|
+
top: 2px;
|
|
21
|
+
left: 2px;
|
|
22
|
+
width: calc(100% - 4px);
|
|
23
|
+
height: calc(100% - 4px);
|
|
24
|
+
border: 2px solid ${({ theme }) => theme.colors.neutral["000"]};
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
export {
|
|
30
|
+
Button
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/Toolbar/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\n\nexport const Button = styled.button`\n height: 40px;\n width: 40px;\n border: none;\n background-color: transparent;\n cursor: pointer;\n position: relative;\n outline: none;\n &:hover:not(:focus) {\n background-color: ${({ theme }) => theme.colors.brand[700]};\n outline: none;\n }\n &:focus {\n :before {\n content: '';\n position: absolute;\n z-index: 2;\n top: 2px;\n left: 2px;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n border: 2px solid ${({ theme }) => theme.colors.neutral['000']};\n border-radius: 4px;\n }\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASL,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAYhC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
import { useMemo } from "react";
|
|
19
|
+
import { defaultProps } from "../defaultProps";
|
|
20
|
+
const useGetPropsWithDefaults = (props) => {
|
|
21
|
+
const { toolbar, breadcrumb, Logo, LogoWithBrand } = props;
|
|
22
|
+
return useMemo(() => __spreadValues(__spreadValues({}, defaultProps), props), [toolbar, breadcrumb, Logo, LogoWithBrand]);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
useGetPropsWithDefaults
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=useGetPropsWithDefaults.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useGetPropsWithDefaults.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\nimport type { GlobalHeaderPropsT } from '../GlobalHeaderTypes';\nimport { defaultProps } from '../defaultProps';\n\nexport const useGetPropsWithDefaults = (props: GlobalHeaderPropsT): GlobalHeaderPropsT => {\n const { toolbar, breadcrumb, Logo, LogoWithBrand } = props;\n\n return useMemo(\n () => ({\n ...defaultProps,\n ...props,\n }),\n [toolbar, breadcrumb, Logo, LogoWithBrand],\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AAEA;AAEO,MAAM,0BAA0B,CAAC,UAAkD;AACxF,QAAM,EAAE,SAAS,YAAY,MAAM,kBAAkB;AAErD,SAAO,QACL,MAAO,kCACF,eACA,QAEL,CAAC,SAAS,YAAY,MAAM;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useState, useMemo } from "react";
|
|
3
|
+
import { uid } from "uid";
|
|
4
|
+
import { useGetPropsWithDefaults } from "./useGetPropsWithDefaults";
|
|
5
|
+
const useGlobalHeader = (props) => {
|
|
6
|
+
const [showIconOnly, setShowIconOnly] = useState(false);
|
|
7
|
+
const instanceUID = useMemo(() => uid(5), []);
|
|
8
|
+
const globalHeaderToolbarGrid = useMemo(() => new Array(props?.toolbar?.length ?? 0).fill("auto"), [props.toolbar]);
|
|
9
|
+
const globalHeaderBreadcrumbGrid = useMemo(() => ["auto", ...new Array(props?.breadcrumb?.length ?? 0).fill("auto"), "1fr"], [props.breadcrumb]);
|
|
10
|
+
const propsWithDefaults = useGetPropsWithDefaults(props);
|
|
11
|
+
const ctx = React2.useMemo(() => ({
|
|
12
|
+
props: propsWithDefaults,
|
|
13
|
+
showIconOnly,
|
|
14
|
+
setShowIconOnly,
|
|
15
|
+
instanceUID,
|
|
16
|
+
globalHeaderToolbarGrid,
|
|
17
|
+
globalHeaderBreadcrumbGrid
|
|
18
|
+
}), [propsWithDefaults, showIconOnly, instanceUID, globalHeaderToolbarGrid, globalHeaderBreadcrumbGrid]);
|
|
19
|
+
return ctx;
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
useGlobalHeader
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useGlobalHeader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useGlobalHeader.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useMemo } from 'react';\nimport { uid } from 'uid';\nimport type { ContextT, GlobalHeaderPropsT } from '../GlobalHeaderTypes';\nimport { useGetPropsWithDefaults } from './useGetPropsWithDefaults';\n\nexport const useGlobalHeader = (props: GlobalHeaderPropsT): ContextT => {\n const [showIconOnly, setShowIconOnly] = useState<boolean>(false);\n\n const instanceUID = useMemo(() => uid(5), []);\n\n const globalHeaderToolbarGrid = useMemo(() => new Array(props?.toolbar?.length ?? 0).fill('auto'), [props.toolbar]);\n const globalHeaderBreadcrumbGrid = useMemo(\n () => ['auto', ...new Array(props?.breadcrumb?.length ?? 0).fill('auto'), '1fr'],\n [props.breadcrumb],\n );\n\n const propsWithDefaults = useGetPropsWithDefaults(props);\n\n const ctx = React.useMemo(\n () => ({\n props: propsWithDefaults,\n showIconOnly,\n setShowIconOnly,\n instanceUID,\n globalHeaderToolbarGrid,\n globalHeaderBreadcrumbGrid,\n }),\n [propsWithDefaults, showIconOnly, instanceUID, globalHeaderToolbarGrid, globalHeaderBreadcrumbGrid],\n );\n\n return ctx;\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA;AAEO,MAAM,kBAAkB,CAAC,UAAwC;AACtE,QAAM,CAAC,cAAc,mBAAmB,SAAkB;AAE1D,QAAM,cAAc,QAAQ,MAAM,IAAI,IAAI;AAE1C,QAAM,0BAA0B,QAAQ,MAAM,IAAI,MAAM,OAAO,SAAS,UAAU,GAAG,KAAK,SAAS,CAAC,MAAM;AAC1G,QAAM,6BAA6B,QACjC,MAAM,CAAC,QAAQ,GAAG,IAAI,MAAM,OAAO,YAAY,UAAU,GAAG,KAAK,SAAS,QAC1E,CAAC,MAAM;AAGT,QAAM,oBAAoB,wBAAwB;AAElD,QAAM,MAAM,OAAM,QAChB,MAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAEF,CAAC,mBAAmB,cAAc,aAAa,yBAAyB;AAG1E,SAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
throwToolbarPopupItemError,
|
|
4
|
+
throwToolbarAppPickerItemError,
|
|
5
|
+
throwToolbarItemGenericError,
|
|
6
|
+
throwLogoError,
|
|
7
|
+
throwBreadcrumbItemError,
|
|
8
|
+
isValidToolbarType,
|
|
9
|
+
isObject
|
|
10
|
+
} from "./validateHelpers";
|
|
11
|
+
const validatePopupItem = (componentProps) => {
|
|
12
|
+
if (componentProps.options && !Array.isArray(componentProps.options)) {
|
|
13
|
+
throwToolbarPopupItemError("options", componentProps.options);
|
|
14
|
+
}
|
|
15
|
+
if (componentProps.closeOnClick && typeof componentProps.closeOnClick !== "boolean") {
|
|
16
|
+
throwToolbarPopupItemError("closeOnClick", componentProps.closeOnClick);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const validateAppPickerItem = (componentProps) => {
|
|
20
|
+
if (componentProps.apps && !Array.isArray(componentProps.apps)) {
|
|
21
|
+
throwToolbarAppPickerItemError("apps", componentProps.apps);
|
|
22
|
+
}
|
|
23
|
+
if (componentProps.customApps && !Array.isArray(componentProps.customApps)) {
|
|
24
|
+
throwToolbarAppPickerItemError("customApps", componentProps.customApps);
|
|
25
|
+
}
|
|
26
|
+
if (componentProps.sectionTitle && typeof componentProps.sectionTitle !== "string") {
|
|
27
|
+
throwToolbarAppPickerItemError("sectionTitle", componentProps.sectionTitle);
|
|
28
|
+
}
|
|
29
|
+
if (componentProps.customSectionTitle && typeof componentProps.customSectionTitle !== "string") {
|
|
30
|
+
throwToolbarAppPickerItemError("customSectionTitle", componentProps.customSectionTitle);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const validateGenericToolbarItem = (item) => {
|
|
34
|
+
if (item.label && typeof item.label !== "string") {
|
|
35
|
+
throwToolbarItemGenericError("label", item.label);
|
|
36
|
+
}
|
|
37
|
+
if (item.onClick && typeof item.onClick !== "function") {
|
|
38
|
+
throwToolbarItemGenericError("onClick", item.onClick);
|
|
39
|
+
}
|
|
40
|
+
if (item.Icon && typeof item.Icon !== "function") {
|
|
41
|
+
if (item.type === "ds-app-picker")
|
|
42
|
+
return;
|
|
43
|
+
throwToolbarItemGenericError("Icon", item.Icon);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const useValidateProps = (props) => {
|
|
47
|
+
const { breadcrumb, toolbar, Logo, LogoWithBrand } = props;
|
|
48
|
+
if (Logo && typeof Logo !== "function") {
|
|
49
|
+
throwLogoError("Logo", Logo);
|
|
50
|
+
}
|
|
51
|
+
if (LogoWithBrand && typeof LogoWithBrand !== "function") {
|
|
52
|
+
throwLogoError("LogoWithBrand", LogoWithBrand);
|
|
53
|
+
}
|
|
54
|
+
breadcrumb?.forEach((breadcrumbItem) => {
|
|
55
|
+
if (breadcrumbItem.label && typeof breadcrumbItem.label !== "string") {
|
|
56
|
+
throwBreadcrumbItemError("label", breadcrumbItem.label);
|
|
57
|
+
}
|
|
58
|
+
if (breadcrumbItem.onClick && typeof breadcrumbItem.onClick !== "function") {
|
|
59
|
+
throwBreadcrumbItemError("onClick", breadcrumbItem.onClick);
|
|
60
|
+
}
|
|
61
|
+
if (breadcrumbItem.hasNext && typeof breadcrumbItem.hasNext !== "boolean") {
|
|
62
|
+
throwBreadcrumbItemError("hasNext", breadcrumbItem.hasNext);
|
|
63
|
+
}
|
|
64
|
+
if (breadcrumbItem.isSelected && typeof breadcrumbItem.isSelected !== "boolean") {
|
|
65
|
+
throwBreadcrumbItemError("isSelected", breadcrumbItem.isSelected);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
toolbar?.forEach((toolbarItem) => {
|
|
69
|
+
if (toolbarItem.type) {
|
|
70
|
+
if (!isValidToolbarType(toolbarItem.type)) {
|
|
71
|
+
throwToolbarItemGenericError("type", toolbarItem.type);
|
|
72
|
+
}
|
|
73
|
+
if (toolbarItem.componentProps && !isObject(toolbarItem.componentProps)) {
|
|
74
|
+
throwToolbarItemGenericError("componentProps", toolbarItem.componentProps);
|
|
75
|
+
}
|
|
76
|
+
if (toolbarItem.type === "ds-popup-menu") {
|
|
77
|
+
validatePopupItem(toolbarItem.componentProps);
|
|
78
|
+
}
|
|
79
|
+
if (toolbarItem.type === "ds-app-picker") {
|
|
80
|
+
validateAppPickerItem(toolbarItem.componentProps);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
useValidateProps
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { AppPickerProps, GlobalHeaderPropsT, PopupPropsT, ToolbarItemT } from '../GlobalHeaderTypes';\nimport {\n throwToolbarPopupItemError,\n throwToolbarAppPickerItemError,\n throwToolbarItemGenericError,\n throwLogoError,\n throwBreadcrumbItemError,\n isValidToolbarType,\n isObject,\n} from './validateHelpers';\n\nconst validatePopupItem = (componentProps: PopupPropsT): void => {\n if (componentProps.options && !Array.isArray(componentProps.options)) {\n throwToolbarPopupItemError('options', componentProps.options);\n }\n if (componentProps.closeOnClick && typeof componentProps.closeOnClick !== 'boolean') {\n throwToolbarPopupItemError('closeOnClick', componentProps.closeOnClick);\n }\n};\n\nconst validateAppPickerItem = (componentProps: AppPickerProps): void => {\n if (componentProps.apps && !Array.isArray(componentProps.apps)) {\n throwToolbarAppPickerItemError('apps', componentProps.apps);\n }\n if (componentProps.customApps && !Array.isArray(componentProps.customApps)) {\n throwToolbarAppPickerItemError('customApps', componentProps.customApps);\n }\n if (componentProps.sectionTitle && typeof componentProps.sectionTitle !== 'string') {\n throwToolbarAppPickerItemError('sectionTitle', componentProps.sectionTitle);\n }\n if (componentProps.customSectionTitle && typeof componentProps.customSectionTitle !== 'string') {\n throwToolbarAppPickerItemError('customSectionTitle', componentProps.customSectionTitle);\n }\n};\n\nconst validateGenericToolbarItem = (item: ToolbarItemT): void => {\n if (item.label && typeof item.label !== 'string') {\n throwToolbarItemGenericError('label', item.label);\n }\n if (item.onClick && typeof item.onClick !== 'function') {\n throwToolbarItemGenericError('onClick', item.onClick);\n }\n if (item.Icon && typeof item.Icon !== 'function') {\n if (item.type === 'ds-app-picker') return;\n throwToolbarItemGenericError('Icon', item.Icon);\n }\n};\n\nexport const useValidateProps = (props: GlobalHeaderPropsT): void => {\n const { breadcrumb, toolbar, Logo, LogoWithBrand } = props;\n\n if (Logo && typeof Logo !== 'function') {\n throwLogoError('Logo', Logo);\n }\n\n if (LogoWithBrand && typeof LogoWithBrand !== 'function') {\n throwLogoError('LogoWithBrand', LogoWithBrand);\n }\n\n breadcrumb?.forEach((breadcrumbItem) => {\n if (breadcrumbItem.label && typeof breadcrumbItem.label !== 'string') {\n throwBreadcrumbItemError('label', breadcrumbItem.label);\n }\n if (breadcrumbItem.onClick && typeof breadcrumbItem.onClick !== 'function') {\n throwBreadcrumbItemError('onClick', breadcrumbItem.onClick);\n }\n if (breadcrumbItem.hasNext && typeof breadcrumbItem.hasNext !== 'boolean') {\n throwBreadcrumbItemError('hasNext', breadcrumbItem.hasNext);\n }\n if (breadcrumbItem.isSelected && typeof breadcrumbItem.isSelected !== 'boolean') {\n throwBreadcrumbItemError('isSelected', breadcrumbItem.isSelected);\n }\n });\n\n toolbar?.forEach((toolbarItem) => {\n if (toolbarItem.type) {\n if (!isValidToolbarType(toolbarItem.type)) {\n throwToolbarItemGenericError('type', toolbarItem.type);\n }\n if (toolbarItem.componentProps && !isObject(toolbarItem.componentProps)) {\n throwToolbarItemGenericError('componentProps', toolbarItem.componentProps);\n }\n if (toolbarItem.type === 'ds-popup-menu') {\n validatePopupItem(toolbarItem.componentProps as PopupPropsT);\n }\n if (toolbarItem.type === 'ds-app-picker') {\n validateAppPickerItem(toolbarItem.componentProps as AppPickerProps);\n }\n }\n });\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,MAAM,oBAAoB,CAAC,mBAAsC;AAC/D,MAAI,eAAe,WAAW,CAAC,MAAM,QAAQ,eAAe,UAAU;AACpE,+BAA2B,WAAW,eAAe;AAAA;AAEvD,MAAI,eAAe,gBAAgB,OAAO,eAAe,iBAAiB,WAAW;AACnF,+BAA2B,gBAAgB,eAAe;AAAA;AAAA;AAI9D,MAAM,wBAAwB,CAAC,mBAAyC;AACtE,MAAI,eAAe,QAAQ,CAAC,MAAM,QAAQ,eAAe,OAAO;AAC9D,mCAA+B,QAAQ,eAAe;AAAA;AAExD,MAAI,eAAe,cAAc,CAAC,MAAM,QAAQ,eAAe,aAAa;AAC1E,mCAA+B,cAAc,eAAe;AAAA;AAE9D,MAAI,eAAe,gBAAgB,OAAO,eAAe,iBAAiB,UAAU;AAClF,mCAA+B,gBAAgB,eAAe;AAAA;AAEhE,MAAI,eAAe,sBAAsB,OAAO,eAAe,uBAAuB,UAAU;AAC9F,mCAA+B,sBAAsB,eAAe;AAAA;AAAA;AAIxE,MAAM,6BAA6B,CAAC,SAA6B;AAC/D,MAAI,KAAK,SAAS,OAAO,KAAK,UAAU,UAAU;AAChD,iCAA6B,SAAS,KAAK;AAAA;AAE7C,MAAI,KAAK,WAAW,OAAO,KAAK,YAAY,YAAY;AACtD,iCAA6B,WAAW,KAAK;AAAA;AAE/C,MAAI,KAAK,QAAQ,OAAO,KAAK,SAAS,YAAY;AAChD,QAAI,KAAK,SAAS;AAAiB;AACnC,iCAA6B,QAAQ,KAAK;AAAA;AAAA;AAIvC,MAAM,mBAAmB,CAAC,UAAoC;AACnE,QAAM,EAAE,YAAY,SAAS,MAAM,kBAAkB;AAErD,MAAI,QAAQ,OAAO,SAAS,YAAY;AACtC,mBAAe,QAAQ;AAAA;AAGzB,MAAI,iBAAiB,OAAO,kBAAkB,YAAY;AACxD,mBAAe,iBAAiB;AAAA;AAGlC,cAAY,QAAQ,CAAC,mBAAmB;AACtC,QAAI,eAAe,SAAS,OAAO,eAAe,UAAU,UAAU;AACpE,+BAAyB,SAAS,eAAe;AAAA;AAEnD,QAAI,eAAe,WAAW,OAAO,eAAe,YAAY,YAAY;AAC1E,+BAAyB,WAAW,eAAe;AAAA;AAErD,QAAI,eAAe,WAAW,OAAO,eAAe,YAAY,WAAW;AACzE,+BAAyB,WAAW,eAAe;AAAA;AAErD,QAAI,eAAe,cAAc,OAAO,eAAe,eAAe,WAAW;AAC/E,+BAAyB,cAAc,eAAe;AAAA;AAAA;AAI1D,WAAS,QAAQ,CAAC,gBAAgB;AAChC,QAAI,YAAY,MAAM;AACpB,UAAI,CAAC,mBAAmB,YAAY,OAAO;AACzC,qCAA6B,QAAQ,YAAY;AAAA;AAEnD,UAAI,YAAY,kBAAkB,CAAC,SAAS,YAAY,iBAAiB;AACvE,qCAA6B,kBAAkB,YAAY;AAAA;AAE7D,UAAI,YAAY,SAAS,iBAAiB;AACxC,0BAAkB,YAAY;AAAA;AAEhC,UAAI,YAAY,SAAS,iBAAiB;AACxC,8BAAsB,YAAY;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const breadcrumbProps = {
|
|
3
|
+
label: "string",
|
|
4
|
+
onClick: "function",
|
|
5
|
+
hasNext: "boolean",
|
|
6
|
+
isSelected: "boolean"
|
|
7
|
+
};
|
|
8
|
+
const toolbarProps = {
|
|
9
|
+
label: "string",
|
|
10
|
+
type: '"ds-app-picker" or "ds-popup-menu" or "ds-search-toggle"',
|
|
11
|
+
componentProps: "object",
|
|
12
|
+
Icon: "react component",
|
|
13
|
+
onClick: "function",
|
|
14
|
+
options: "array",
|
|
15
|
+
closeOnClick: "boolean",
|
|
16
|
+
apps: "array",
|
|
17
|
+
customApps: "array",
|
|
18
|
+
sectionTitle: "string",
|
|
19
|
+
customSectionTitle: "string"
|
|
20
|
+
};
|
|
21
|
+
const isObject = (obj) => typeof obj === "object" && !!obj && !Array.isArray(obj);
|
|
22
|
+
const getVariableType = (arg) => {
|
|
23
|
+
if (Array.isArray(arg))
|
|
24
|
+
return "array";
|
|
25
|
+
if (arg === null)
|
|
26
|
+
return "null";
|
|
27
|
+
if (arg === void 0)
|
|
28
|
+
return "undefined";
|
|
29
|
+
return typeof arg;
|
|
30
|
+
};
|
|
31
|
+
const isValidToolbarType = (string) => string === "ds-app-picker" || string === "ds-popup-menu" || string === "ds-search-toggle" || string === "custom";
|
|
32
|
+
const throwBreadcrumbItemError = (validPropKey, invalidProp) => {
|
|
33
|
+
throw new Error(`You are trying to pass a not valid "${validPropKey}" property for a breadcrumb item, please provide a valid type.
|
|
34
|
+
|
|
35
|
+
Received: ${invalidProp} (${typeof invalidProp})
|
|
36
|
+
Expected: (${breadcrumbProps[validPropKey]})
|
|
37
|
+
`);
|
|
38
|
+
};
|
|
39
|
+
const throwToolbarPopupItemError = (validPropKey, invalidProp) => {
|
|
40
|
+
throw new Error(`You are trying to pass a not valid "${validPropKey}" property inside componentProps for a ds-popup-menu
|
|
41
|
+
toolbar item, please provide a valid type.
|
|
42
|
+
|
|
43
|
+
Received: ${invalidProp} (${getVariableType(invalidProp)})
|
|
44
|
+
Expected: (${toolbarProps[validPropKey]})
|
|
45
|
+
`);
|
|
46
|
+
};
|
|
47
|
+
const throwToolbarAppPickerItemError = (validPropKey, invalidProp) => {
|
|
48
|
+
throw new Error(`You are trying to pass a not valid "${validPropKey}" property inside componentProps for a ds-app-picker
|
|
49
|
+
toolbar item, please provide a valid type.
|
|
50
|
+
|
|
51
|
+
Received: ${invalidProp} (${getVariableType(invalidProp)})
|
|
52
|
+
Expected: (${toolbarProps[validPropKey]})
|
|
53
|
+
`);
|
|
54
|
+
};
|
|
55
|
+
const throwToolbarItemGenericError = (validPropKey, invalidProp) => {
|
|
56
|
+
throw new Error(`You are trying to pass a not valid "${validPropKey}" property for a toolbar item, please provide a valid type.
|
|
57
|
+
|
|
58
|
+
Received: ${invalidProp} (${getVariableType(invalidProp)})
|
|
59
|
+
Expected: (${toolbarProps[validPropKey]})
|
|
60
|
+
`);
|
|
61
|
+
};
|
|
62
|
+
const throwLogoError = (validPropKey, invalidProp) => {
|
|
63
|
+
throw new Error(`You are trying to pass a not valid "${validPropKey}" property for a global header,
|
|
64
|
+
remember to provide both Logo and LogoWithBrand properties with a valid type.
|
|
65
|
+
|
|
66
|
+
Received: ${invalidProp} (${getVariableType(invalidProp)}).
|
|
67
|
+
Expected: (react component).
|
|
68
|
+
`);
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
breadcrumbProps,
|
|
72
|
+
getVariableType,
|
|
73
|
+
isObject,
|
|
74
|
+
isValidToolbarType,
|
|
75
|
+
throwBreadcrumbItemError,
|
|
76
|
+
throwLogoError,
|
|
77
|
+
throwToolbarAppPickerItemError,
|
|
78
|
+
throwToolbarItemGenericError,
|
|
79
|
+
throwToolbarPopupItemError,
|
|
80
|
+
toolbarProps
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=validateHelpers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/validateHelpers.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const breadcrumbProps = {\n label: 'string',\n onClick: 'function',\n hasNext: 'boolean',\n isSelected: 'boolean',\n};\n\nexport const toolbarProps = {\n label: 'string',\n type: '\"ds-app-picker\" or \"ds-popup-menu\" or \"ds-search-toggle\"',\n componentProps: 'object',\n Icon: 'react component',\n onClick: 'function',\n options: 'array',\n closeOnClick: 'boolean',\n apps: 'array',\n customApps: 'array',\n sectionTitle: 'string',\n customSectionTitle: 'string',\n};\n\nexport const isObject = (obj: unknown): boolean => typeof obj === 'object' && !!obj && !Array.isArray(obj);\n\nexport const getVariableType = (arg: unknown): string => {\n if (Array.isArray(arg)) return 'array';\n if (arg === null) return 'null';\n if (arg === undefined) return 'undefined';\n return typeof arg;\n};\n\nexport const isValidToolbarType = (string: unknown): boolean =>\n string === 'ds-app-picker' || string === 'ds-popup-menu' || string === 'ds-search-toggle' || string === 'custom';\n\nexport const throwBreadcrumbItemError = (validPropKey: keyof typeof breadcrumbProps, invalidProp: unknown): void => {\n throw new Error(\n `You are trying to pass a not valid \"${validPropKey}\" property for a breadcrumb item, please provide a valid type.\n\n Received: ${invalidProp} (${typeof invalidProp})\n Expected: (${breadcrumbProps[validPropKey]})\n `,\n );\n};\n\nexport const throwToolbarPopupItemError = (validPropKey: keyof typeof toolbarProps, invalidProp: unknown): void => {\n throw new Error(\n `You are trying to pass a not valid \"${validPropKey}\" property inside componentProps for a ds-popup-menu \n toolbar item, please provide a valid type.\n\n Received: ${invalidProp} (${getVariableType(invalidProp)})\n Expected: (${toolbarProps[validPropKey]})\n `,\n );\n};\n\nexport const throwToolbarAppPickerItemError = (validPropKey: keyof typeof toolbarProps, invalidProp: unknown): void => {\n throw new Error(\n `You are trying to pass a not valid \"${validPropKey}\" property inside componentProps for a ds-app-picker \n toolbar item, please provide a valid type.\n\n Received: ${invalidProp} (${getVariableType(invalidProp)})\n Expected: (${toolbarProps[validPropKey]})\n `,\n );\n};\n\nexport const throwToolbarItemGenericError = (validPropKey: keyof typeof toolbarProps, invalidProp: unknown): void => {\n throw new Error(\n `You are trying to pass a not valid \"${validPropKey}\" property for a toolbar item, please provide a valid type.\n\n Received: ${invalidProp} (${getVariableType(invalidProp)})\n Expected: (${toolbarProps[validPropKey]})\n `,\n );\n};\n\nexport const throwLogoError = (validPropKey: string, invalidProp: unknown): void => {\n throw new Error(\n `You are trying to pass a not valid \"${validPropKey}\" property for a global header, \n remember to provide both Logo and LogoWithBrand properties with a valid type.\n\n Received: ${invalidProp} (${getVariableType(invalidProp)}).\n Expected: (react component).\n `,\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,kBAAkB;AAAA,EAC7B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,YAAY;AAAA;AAGP,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAAA,EACd,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,oBAAoB;AAAA;AAGf,MAAM,WAAW,CAAC,QAA0B,OAAO,QAAQ,YAAY,CAAC,CAAC,OAAO,CAAC,MAAM,QAAQ;AAE/F,MAAM,kBAAkB,CAAC,QAAyB;AACvD,MAAI,MAAM,QAAQ;AAAM,WAAO;AAC/B,MAAI,QAAQ;AAAM,WAAO;AACzB,MAAI,QAAQ;AAAW,WAAO;AAC9B,SAAO,OAAO;AAAA;AAGT,MAAM,qBAAqB,CAAC,WACjC,WAAW,mBAAmB,WAAW,mBAAmB,WAAW,sBAAsB,WAAW;AAEnG,MAAM,2BAA2B,CAAC,cAA4C,gBAA+B;AAClH,QAAM,IAAI,MACR,uCAAuC;AAAA;AAAA,cAE7B,gBAAgB,OAAO;AAAA,eACtB,gBAAgB;AAAA;AAAA;AAKxB,MAAM,6BAA6B,CAAC,cAAyC,gBAA+B;AACjH,QAAM,IAAI,MACR,uCAAuC;AAAA;AAAA;AAAA,cAG7B,gBAAgB,gBAAgB;AAAA,eAC/B,aAAa;AAAA;AAAA;AAKrB,MAAM,iCAAiC,CAAC,cAAyC,gBAA+B;AACrH,QAAM,IAAI,MACR,uCAAuC;AAAA;AAAA;AAAA,cAG7B,gBAAgB,gBAAgB;AAAA,eAC/B,aAAa;AAAA;AAAA;AAKrB,MAAM,+BAA+B,CAAC,cAAyC,gBAA+B;AACnH,QAAM,IAAI,MACR,uCAAuC;AAAA;AAAA,cAE7B,gBAAgB,gBAAgB;AAAA,eAC/B,aAAa;AAAA;AAAA;AAKrB,MAAM,iBAAiB,CAAC,cAAsB,gBAA+B;AAClF,QAAM,IAAI,MACR,uCAAuC;AAAA;AAAA;AAAA,cAG7B,gBAAgB,gBAAgB;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
const emptyComp = () => null;
|
|
2
|
-
|
|
3
3
|
const defaultProps = {
|
|
4
4
|
breadcrumb: [],
|
|
5
5
|
toolbar: [],
|
|
6
6
|
LogoWithBrand: emptyComp,
|
|
7
7
|
Logo: emptyComp
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export {
|
|
10
|
+
defaultProps
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=defaultProps.js.map
|