@hitachivantara/uikit-react-core 4.1.0 → 4.2.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/BreadCrumb/BreadCrumb.js +32 -20
- package/dist/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/BreadCrumb/styles.js +3 -0
- package/dist/BreadCrumb/styles.js.map +1 -1
- package/dist/BreadCrumb/utils.js +3 -8
- package/dist/BreadCrumb/utils.js.map +1 -1
- package/dist/Dialog/Dialog.d.ts +1 -1
- package/dist/Dialog/Dialog.js +11 -13
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DialogActions/DialogActions.js.map +1 -1
- package/dist/Dialog/DialogActions/styles.js +2 -9
- package/dist/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/Dialog/DialogContent/DialogContent.js +19 -5
- package/dist/Dialog/DialogContent/DialogContent.js.map +1 -1
- package/dist/Dialog/DialogContent/styles.js +2 -3
- package/dist/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/Dialog/DialogTitle/DialogTitle.js +1 -6
- package/dist/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/Dialog/DialogTitle/styles.js +1 -4
- package/dist/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/Dialog/styles.js +10 -6
- package/dist/Dialog/styles.js.map +1 -1
- package/dist/Dropdown/Dropdown.d.ts +4 -0
- package/dist/Dropdown/List/List.js +9 -4
- package/dist/Dropdown/List/List.js.map +1 -1
- package/dist/SimpleGrid/SimpleGrid.d.ts +5 -2
- package/dist/SimpleGrid/SimpleGrid.js +6 -2
- package/dist/SimpleGrid/SimpleGrid.js.map +1 -1
- package/dist/legacy/BreadCrumb/BreadCrumb.js +31 -19
- package/dist/legacy/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/legacy/BreadCrumb/styles.js +3 -0
- package/dist/legacy/BreadCrumb/styles.js.map +1 -1
- package/dist/legacy/BreadCrumb/utils.js +2 -6
- package/dist/legacy/BreadCrumb/utils.js.map +1 -1
- package/dist/legacy/Dialog/Dialog.d.ts +1 -1
- package/dist/legacy/Dialog/Dialog.js +16 -18
- package/dist/legacy/Dialog/Dialog.js.map +1 -1
- package/dist/legacy/Dialog/DialogActions/DialogActions.js.map +1 -1
- package/dist/legacy/Dialog/DialogActions/styles.js +2 -9
- package/dist/legacy/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/legacy/Dialog/DialogContent/DialogContent.js +19 -5
- package/dist/legacy/Dialog/DialogContent/DialogContent.js.map +1 -1
- package/dist/legacy/Dialog/DialogContent/styles.js +2 -3
- package/dist/legacy/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/legacy/Dialog/DialogTitle/DialogTitle.js +1 -6
- package/dist/legacy/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/legacy/Dialog/DialogTitle/styles.js +1 -4
- package/dist/legacy/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/legacy/Dialog/styles.js +10 -6
- package/dist/legacy/Dialog/styles.js.map +1 -1
- package/dist/legacy/Dropdown/Dropdown.d.ts +4 -0
- package/dist/legacy/Dropdown/List/List.js +9 -4
- package/dist/legacy/Dropdown/List/List.js.map +1 -1
- package/dist/legacy/SimpleGrid/SimpleGrid.d.ts +5 -2
- package/dist/legacy/SimpleGrid/SimpleGrid.js +7 -2
- package/dist/legacy/SimpleGrid/SimpleGrid.js.map +1 -1
- package/dist/modern/BreadCrumb/BreadCrumb.js +12 -7
- package/dist/modern/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/modern/BreadCrumb/styles.js +3 -0
- package/dist/modern/BreadCrumb/styles.js.map +1 -1
- package/dist/modern/BreadCrumb/utils.js +2 -2
- package/dist/modern/BreadCrumb/utils.js.map +1 -1
- package/dist/modern/Dialog/Dialog.d.ts +1 -1
- package/dist/modern/Dialog/Dialog.js +9 -7
- package/dist/modern/Dialog/Dialog.js.map +1 -1
- package/dist/modern/Dialog/DialogActions/DialogActions.js.map +1 -1
- package/dist/modern/Dialog/DialogActions/styles.js +2 -9
- package/dist/modern/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/modern/Dialog/DialogContent/DialogContent.js +18 -10
- package/dist/modern/Dialog/DialogContent/DialogContent.js.map +1 -1
- package/dist/modern/Dialog/DialogContent/styles.js +2 -3
- package/dist/modern/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/modern/Dialog/DialogTitle/DialogTitle.js +1 -8
- package/dist/modern/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/modern/Dialog/DialogTitle/styles.js +1 -4
- package/dist/modern/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/modern/Dialog/styles.js +10 -6
- package/dist/modern/Dialog/styles.js.map +1 -1
- package/dist/modern/Dropdown/Dropdown.d.ts +4 -0
- package/dist/modern/Dropdown/List/List.js +9 -4
- package/dist/modern/Dropdown/List/List.js.map +1 -1
- package/dist/modern/SimpleGrid/SimpleGrid.d.ts +5 -2
- package/dist/modern/SimpleGrid/SimpleGrid.js +7 -2
- package/dist/modern/SimpleGrid/SimpleGrid.js.map +1 -1
- package/package.json +3 -3
|
@@ -14,6 +14,11 @@ import React from "react";
|
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import { withStyles } from "@mui/styles";
|
|
16
16
|
import useStyles from "./styles";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* SimpleGrid is a flexbox container where each child is treated as a column.
|
|
20
|
+
* Each column takes equal amount of space.
|
|
21
|
+
*/
|
|
17
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
23
|
var HvSimpleGrid = function HvSimpleGrid(_ref) {
|
|
19
24
|
var children = _ref.children,
|
|
@@ -41,7 +46,7 @@ process.env.NODE_ENV !== "production" ? HvSimpleGrid.propTypes = {
|
|
|
41
46
|
/**
|
|
42
47
|
* Spacing with pre-defined values according the values defined in the theme
|
|
43
48
|
*/
|
|
44
|
-
spacing: PropTypes.oneOf(["sm", "md", "lg", "xl"]),
|
|
49
|
+
spacing: PropTypes.oneOf(["xs", "sm", "md", "lg", "xl"]),
|
|
45
50
|
/**
|
|
46
51
|
* Provide an array to define responsive behavior:
|
|
47
52
|
*
|
|
@@ -55,7 +60,7 @@ process.env.NODE_ENV !== "production" ? HvSimpleGrid.propTypes = {
|
|
|
55
60
|
maxWidth: PropTypes.number,
|
|
56
61
|
minWidth: PropTypes.number,
|
|
57
62
|
cols: PropTypes.number,
|
|
58
|
-
spacing: PropTypes.oneOf(["sm", "md", "lg", "xl"])
|
|
63
|
+
spacing: PropTypes.oneOf(["xs", "sm", "md", "lg", "xl"])
|
|
59
64
|
})),
|
|
60
65
|
/**
|
|
61
66
|
* Number of how many columns the content will be displayed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleGrid.js","names":["React","PropTypes","withStyles","useStyles","HvSimpleGrid","children","breakpoints","spacing","cols","others","classes","container","propTypes","node","oneOf","arrayOf","shape","maxWidth","number","minWidth","name"],"sources":["../../../src/SimpleGrid/SimpleGrid.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport useStyles from \"./styles\";\n\nconst HvSimpleGrid = ({ children, breakpoints, spacing = \"sm\", cols, ...others }) => {\n const classes = useStyles({ breakpoints, cols, spacing })();\n return (\n <div className={classes.container} {...others}>\n {children}\n </div>\n );\n};\n\nHvSimpleGrid.propTypes = {\n /**\n * -\n */\n children: PropTypes.node,\n /**\n * Spacing with pre-defined values according the values defined in the theme\n */\n spacing: PropTypes.oneOf([\"sm\", \"md\", \"lg\", \"xl\"]),\n /**\n * Provide an array to define responsive behavior:\n *\n * maxWidth or minWidth: max-width or min-width at which media query will work\n *\n * cols: number of columns per row at given max-width\n *\n * spacing: optional spacing at given max-width, if not provided spacing from component prop will be used instead\n */\n breakpoints: PropTypes.arrayOf(\n PropTypes.shape({\n maxWidth: PropTypes.number,\n minWidth: PropTypes.number,\n cols: PropTypes.number,\n spacing: PropTypes.oneOf([\"sm\", \"md\", \"lg\", \"xl\"]),\n })\n ),\n /**\n * Number of how many columns the content will be displayed\n */\n cols: PropTypes.number,\n};\n\nexport default withStyles(useStyles, { name: \"HvSimpleGrid\" })(HvSimpleGrid);\n"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,SAAS,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"SimpleGrid.js","names":["React","PropTypes","withStyles","useStyles","HvSimpleGrid","children","breakpoints","spacing","cols","others","classes","container","propTypes","node","oneOf","arrayOf","shape","maxWidth","number","minWidth","name"],"sources":["../../../src/SimpleGrid/SimpleGrid.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport useStyles from \"./styles\";\n\n/**\n * SimpleGrid is a flexbox container where each child is treated as a column.\n * Each column takes equal amount of space.\n */\nconst HvSimpleGrid = ({ children, breakpoints, spacing = \"sm\", cols, ...others }) => {\n const classes = useStyles({ breakpoints, cols, spacing })();\n return (\n <div className={classes.container} {...others}>\n {children}\n </div>\n );\n};\n\nHvSimpleGrid.propTypes = {\n /**\n * -\n */\n children: PropTypes.node,\n /**\n * Spacing with pre-defined values according the values defined in the theme\n */\n spacing: PropTypes.oneOf([\"xs\", \"sm\", \"md\", \"lg\", \"xl\"]),\n /**\n * Provide an array to define responsive behavior:\n *\n * maxWidth or minWidth: max-width or min-width at which media query will work\n *\n * cols: number of columns per row at given max-width\n *\n * spacing: optional spacing at given max-width, if not provided spacing from component prop will be used instead\n */\n breakpoints: PropTypes.arrayOf(\n PropTypes.shape({\n maxWidth: PropTypes.number,\n minWidth: PropTypes.number,\n cols: PropTypes.number,\n spacing: PropTypes.oneOf([\"xs\", \"sm\", \"md\", \"lg\", \"xl\"]),\n })\n ),\n /**\n * Number of how many columns the content will be displayed\n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EAAE,IAAI,EAAE,IAAI,CAAC;EACzD,CAAC,CAAC,CACH;EACD;AACF;AACA;EACEN,IAAI,EAAEP,SAAS,CAACiB;AAClB,CAAC;AAED,eAAehB,UAAU,CAACC,SAAS,EAAE;EAAEiB,IAAI,EAAE;AAAe,CAAC,CAAC,CAAChB,YAAY,CAAC"}
|
|
@@ -8,13 +8,13 @@ import PropTypes from "prop-types";
|
|
|
8
8
|
import clsx from "clsx";
|
|
9
9
|
import { withStyles } from "@mui/styles";
|
|
10
10
|
import { DropRightXS } from "@hitachivantara/uikit-react-icons";
|
|
11
|
-
import startCase from "lodash/startCase";
|
|
12
11
|
import isNil from "lodash/isNil";
|
|
13
12
|
import { HvLink, HvTypography, HvOverflowTooltip } from "..";
|
|
14
|
-
import
|
|
13
|
+
import pathWithSubMenu from "./utils";
|
|
15
14
|
import styles from "./styles";
|
|
16
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
const capitalize = ([first, ...rest], lowerRest = false) => first.toUpperCase() + (lowerRest ? rest.join("").toLowerCase() : rest.join(""));
|
|
18
18
|
const Page = ({
|
|
19
19
|
Component,
|
|
20
20
|
onClick,
|
|
@@ -32,9 +32,9 @@ const Page = ({
|
|
|
32
32
|
noWrap: true,
|
|
33
33
|
component: "div",
|
|
34
34
|
variant: "highlightText",
|
|
35
|
-
className: classes.link,
|
|
35
|
+
className: clsx(classes.link, classes.label),
|
|
36
36
|
children: /*#__PURE__*/_jsx(HvOverflowTooltip, {
|
|
37
|
-
data:
|
|
37
|
+
data: elem.label
|
|
38
38
|
})
|
|
39
39
|
})
|
|
40
40
|
});
|
|
@@ -112,9 +112,10 @@ const BreadCrumb = props => {
|
|
|
112
112
|
classes: classes,
|
|
113
113
|
last: isLast,
|
|
114
114
|
children: /*#__PURE__*/React.isValidElement(elem) && elem || isLast && /*#__PURE__*/_jsx(HvTypography, {
|
|
115
|
-
|
|
115
|
+
noWrap: true,
|
|
116
|
+
className: clsx(classes.currentPage),
|
|
116
117
|
variant: "normalText",
|
|
117
|
-
children:
|
|
118
|
+
children: capitalize(elem.label)
|
|
118
119
|
}) || /*#__PURE__*/_jsx(Page, {
|
|
119
120
|
elem: elem,
|
|
120
121
|
classes: classes,
|
|
@@ -154,7 +155,11 @@ process.env.NODE_ENV !== "production" ? BreadCrumb.propTypes = {
|
|
|
154
155
|
/**
|
|
155
156
|
* Styles applied to the last element.
|
|
156
157
|
*/
|
|
157
|
-
currentPage: PropTypes.string
|
|
158
|
+
currentPage: PropTypes.string,
|
|
159
|
+
/**
|
|
160
|
+
* Styles applied to the list elements.
|
|
161
|
+
*/
|
|
162
|
+
label: PropTypes.string
|
|
158
163
|
}).isRequired,
|
|
159
164
|
/**
|
|
160
165
|
* List of breadcrumb.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadCrumb.js","names":["React","PropTypes","clsx","withStyles","DropRightXS","startCase","isNil","HvLink","HvTypography","HvOverflowTooltip","pathWithSubMenu","removeExtension","styles","Page","Component","onClick","elem","classes","path","a","link","label","propTypes","elementType","func","shape","string","isRequired","instanceOf","Object","PathElement","last","children","centerContainer","separatorContainer","bool","element","BreadCrumb","props","className","id","listRoute","maxVisible","url","component","dropDownMenuProps","others","maxVisibleElem","listPath","slice","baseUrl","match","urlWithoutDomain","replace","pathNames","split","filter","x","map","index","push","decodeURI","join","breadcrumbPath","length","root","orderedList","key","isLast","isValidElement","currentPage","undefined","arrayOf","number","name"],"sources":["../../../src/BreadCrumb/BreadCrumb.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@mui/styles\";\nimport { DropRightXS } from \"@hitachivantara/uikit-react-icons\";\nimport startCase from \"lodash/startCase\";\nimport isNil from \"lodash/isNil\";\nimport { HvLink, HvTypography, HvOverflowTooltip } from \"..\";\nimport { pathWithSubMenu, removeExtension } from \"./utils\";\nimport styles from \"./styles\";\n\nconst Page = ({ Component, onClick, elem, classes }) => (\n <HvLink\n route={elem.path}\n Component={Component}\n onClick={onClick}\n data={elem}\n classes={{ a: classes.a }}\n >\n <HvTypography noWrap component=\"div\" variant=\"highlightText\" className={classes.link}>\n <HvOverflowTooltip data={startCase(elem.label)} />\n </HvTypography>\n </HvLink>\n);\n\nPage.propTypes = {\n Component: PropTypes.elementType,\n onClick: PropTypes.func,\n elem: PropTypes.shape({\n path: PropTypes.string,\n label: PropTypes.string,\n }).isRequired,\n classes: PropTypes.instanceOf(Object).isRequired,\n};\n\nconst PathElement = ({ classes, last = false, children }) => (\n <li className={classes.centerContainer}>\n {children}\n {!last && <DropRightXS className={classes.separatorContainer} color=\"atmo5\" />}\n </li>\n);\n\nPathElement.propTypes = {\n last: PropTypes.bool,\n classes: PropTypes.instanceOf(Object).isRequired,\n children: PropTypes.element.isRequired,\n};\n\n/**\n * A breadcrumb is a graphical control element frequently used as a navigational aid.\n */\nconst BreadCrumb = (props) => {\n const {\n classes,\n className,\n id,\n listRoute = [],\n maxVisible,\n url,\n onClick,\n component = \"div\",\n dropDownMenuProps,\n ...others\n } = props;\n const maxVisibleElem = maxVisible < 2 ? 2 : maxVisible;\n let listPath = listRoute.slice();\n\n // build the listPath object list\n if (!isNil(url)) {\n listPath = [];\n\n // get the domain\n const baseUrl = url.match(/^.*\\/\\/[^/]+/, \"\");\n\n // get url without domain\n const urlWithoutDomain = url.replace(/^.*\\/\\/[^/]+/, \"\");\n\n const pathNames = urlWithoutDomain.split(\"/\").filter((x) => x);\n\n pathNames.map((elem, index) =>\n listPath.push({\n label: decodeURI(elem),\n path: `${baseUrl}/${pathNames.slice(0, index + 1).join(\"/\")}`,\n })\n );\n }\n\n const breadcrumbPath =\n listPath.length > maxVisibleElem\n ? pathWithSubMenu(id, classes, listPath, maxVisibleElem, dropDownMenuProps)\n : listPath;\n\n return (\n <nav id={id} className={clsx(classes.root, className)} {...others}>\n <ol className={classes.orderedList}>\n {listPath.map((elem, index) => {\n const key = `key_${index}`;\n const isLast = index === breadcrumbPath.length - 1;\n\n return (\n <PathElement classes={classes} key={key} last={isLast}>\n {(React.isValidElement(elem) && elem) ||\n (isLast && (\n <HvTypography className={classes.currentPage} variant=\"normalText\">\n {startCase(removeExtension(elem.label))}\n </HvTypography>\n )) || (\n <Page\n key={key}\n elem={elem}\n classes={classes}\n Component={onClick ? component : undefined}\n onClick={onClick}\n />\n )}\n </PathElement>\n );\n })}\n </ol>\n </nav>\n );\n};\n\nBreadCrumb.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the links.\n */\n link: PropTypes.string,\n /**\n * Styles applied to the list.\n */\n orderedList: PropTypes.string,\n /**\n * Styles applied to the last element.\n */\n currentPage: PropTypes.string,\n }).isRequired,\n /**\n * List of breadcrumb.\n */\n listRoute: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n path: PropTypes.string,\n })\n ),\n /**\n * URL to build the breadcrumb.\n */\n url: PropTypes.string,\n /**\n * Number of pages visible.\n */\n maxVisible: PropTypes.number,\n /**\n * The component used for the link node.\n * Either a string to use a DOM element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Function passed to the component. If defined the component prop is used as the link node.\n */\n onClick: PropTypes.func,\n /**\n * Props passed down to the DropDownMenu sub-menu component.\n */\n dropDownMenuProps: PropTypes.instanceOf(Object),\n};\n\nexport default withStyles(styles, { name: \"HvBreadCrumb\", index: 1 })(BreadCrumb);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,O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U,CAACf,SAAS,GAAG;EACrB;AACF;AACA;EACEiB,SAAS,EAAEtC,SAAS,CAACyB,MAAM;EAC3B;AACF;AACA;EACEc,EAAE,EAAEvC,SAAS,CAACyB,MAAM;EACpB;AACF;AACA;EACET,OAAO,EAAEhB,SAAS,CAACwB,KAAK,CAAC;IACvB;AACJ;AACA;IACIwC,IAAI,EAAEhE,SAAS,CAACyB,MAAM;IACtB;AACJ;AACA;IACIN,IAAI,EAAEnB,SAAS,CAACyB,MAAM;IACtB;AACJ;AACA;IACIwC,WAAW,EAAEjE,SAAS,CAACyB,MAAM;IAC7B;AACJ;AACA;IACI4C,WAAW,EAAErE,SAAS,CAACyB;EACzB,CAAC,CAAC,CAACC,UAAU;EACb;AACF;AACA;EACEc,SAAS,EAAExC,SAAS,CAACuE,OAAO,CAC1BvE,SAAS,CAACwB,KAAK,CAAC;IACdJ,KAAK,EAAEpB,SAAS,CAACyB,MAAM;IACvBR,IAAI,EAAEjB,SAAS,CAACyB;EAClB,CAAC,CAAC,CACH;EACD;AACF;AACA;EACEiB,GAAG,EAAE1C,SAAS,CAACyB,MAAM;EACrB;AACF;AACA;EACEgB,UAAU,EAAEzC,SAAS,CAACwE,MAAM;EAC5B;AACF;AACA;AACA;EACE7B,SAAS,EAAE3C,SAAS,CAACsB,WAAW;EAChC;AACF;AACA;EACER,OAAO,EAAEd,SAAS,CAACuB,IAAI;EACvB;AACF;AACA;EACEqB,iBAAiB,EAAE5C,SAAS,CAAC2B,UAAU,CAACC,MAAM;AAChD,CAAC;AAED,eAAe1B,UAAU,CAACS,MAAM,EAAE;EAAE8D,IAAI,EAAE,cAAc;EAAEf,KAAK,EAAE;AAAE,CAAC,CAAC,CAACtB,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"BreadCrumb.js","names":["React","PropTypes","clsx","withStyles","DropRightXS","isNil","HvLink","HvTypography","HvOverflowTooltip","pathWithSubMenu","styles","capitalize","first","rest","lowerRest","toUpperCase","join","toLowerCase","Page","Component","onClick","elem","classes","path","a","link","label","propTypes","elementType","func","shape","string","isRequired","instanceOf","Object","PathElement","last","children","centerContainer","separatorContainer","bool","element","BreadCrumb","props","className","id","listRoute","maxVisible","url","component","dropDownMenuProps","others","maxVisibleElem","listPath","slice","baseUrl","match","urlWithoutDomain","replace","pathNames","split","filter","x","map","index","push","decodeURI","breadcrumbPath","length","root","orderedList","key","isLast","isValidElement","currentPage","undefined","arrayOf","number","name"],"sources":["../../../src/BreadCrumb/BreadCrumb.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@mui/styles\";\nimport { DropRightXS } from \"@hitachivantara/uikit-react-icons\";\nimport isNil from \"lodash/isNil\";\nimport { HvLink, HvTypography, HvOverflowTooltip } from \"..\";\nimport pathWithSubMenu from \"./utils\";\nimport styles from \"./styles\";\n\nconst capitalize = ([first, ...rest], lowerRest = false) =>\n first.toUpperCase() + (lowerRest ? rest.join(\"\").toLowerCase() : rest.join(\"\"));\n\nconst Page = ({ Component, onClick, elem, classes }) => (\n <HvLink\n route={elem.path}\n Component={Component}\n onClick={onClick}\n data={elem}\n classes={{ a: classes.a }}\n >\n <HvTypography\n noWrap\n component=\"div\"\n variant=\"highlightText\"\n className={clsx(classes.link, classes.label)}\n >\n <HvOverflowTooltip data={elem.label} />\n </HvTypography>\n </HvLink>\n);\n\nPage.propTypes = {\n Component: PropTypes.elementType,\n onClick: PropTypes.func,\n elem: PropTypes.shape({\n path: PropTypes.string,\n label: PropTypes.string,\n }).isRequired,\n classes: PropTypes.instanceOf(Object).isRequired,\n};\n\nconst PathElement = ({ classes, last = false, children }) => (\n <li className={classes.centerContainer}>\n {children}\n {!last && <DropRightXS className={classes.separatorContainer} color=\"atmo5\" />}\n </li>\n);\n\nPathElement.propTypes = {\n last: PropTypes.bool,\n classes: PropTypes.instanceOf(Object).isRequired,\n children: PropTypes.element.isRequired,\n};\n\n/**\n * A breadcrumb is a graphical control element frequently used as a navigational aid.\n */\nconst BreadCrumb = (props) => {\n const {\n classes,\n className,\n id,\n listRoute = [],\n maxVisible,\n url,\n onClick,\n component = \"div\",\n dropDownMenuProps,\n ...others\n } = props;\n const maxVisibleElem = maxVisible < 2 ? 2 : maxVisible;\n let listPath = listRoute.slice();\n\n // build the listPath object list\n if (!isNil(url)) {\n listPath = [];\n\n // get the domain\n const baseUrl = url.match(/^.*\\/\\/[^/]+/, \"\");\n\n // get url without domain\n const urlWithoutDomain = url.replace(/^.*\\/\\/[^/]+/, \"\");\n\n const pathNames = urlWithoutDomain.split(\"/\").filter((x) => x);\n\n pathNames.map((elem, index) =>\n listPath.push({\n label: decodeURI(elem),\n path: `${baseUrl}/${pathNames.slice(0, index + 1).join(\"/\")}`,\n })\n );\n }\n\n const breadcrumbPath =\n listPath.length > maxVisibleElem\n ? pathWithSubMenu(id, classes, listPath, maxVisibleElem, dropDownMenuProps)\n : listPath;\n\n return (\n <nav id={id} className={clsx(classes.root, className)} {...others}>\n <ol className={classes.orderedList}>\n {listPath.map((elem, index) => {\n const key = `key_${index}`;\n const isLast = index === breadcrumbPath.length - 1;\n\n return (\n <PathElement classes={classes} key={key} last={isLast}>\n {(React.isValidElement(elem) && elem) ||\n (isLast && (\n <HvTypography noWrap className={clsx(classes.currentPage)} variant=\"normalText\">\n {capitalize(elem.label)}\n </HvTypography>\n )) || (\n <Page\n key={key}\n elem={elem}\n classes={classes}\n Component={onClick ? component : undefined}\n onClick={onClick}\n />\n )}\n </PathElement>\n );\n })}\n </ol>\n </nav>\n );\n};\n\nBreadCrumb.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the links.\n */\n link: PropTypes.string,\n /**\n * Styles applied to the list.\n */\n orderedList: PropTypes.string,\n /**\n * Styles applied to the last element.\n */\n currentPage: PropTypes.string,\n /**\n * Styles applied to the list elements.\n */\n label: PropTypes.string,\n }).isRequired,\n /**\n * List of breadcrumb.\n */\n listRoute: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n path: PropTypes.string,\n })\n ),\n /**\n * URL to build the breadcrumb.\n */\n url: PropTypes.string,\n /**\n * Number of pages visible.\n */\n maxVisible: PropTypes.number,\n /**\n * The component used for the link node.\n * Either a string to use a DOM element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Function passed to the component. If defined the component prop is used as the link node.\n */\n onClick: PropTypes.func,\n /**\n * Props passed down to the DropDownMenu sub-menu component.\n */\n dropDownMenuProps: PropTypes.instanceOf(Object),\n};\n\nexport default withStyles(styles, { name: \"HvBreadCrumb\", index: 1 })(BreadCrumb);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,OAAOC,KAAK,MAAM,cAAc;AAChC,SAASC,MAAM,EAAEC,YAAY,EAAEC,iBAAiB,QAAQ,IAAI;AAC5D,OAAOC,eAAe,MAAM,SAAS;AACrC,OAAOC,MAAM,MAAM,UAAU;AAAC;AAAA;AAE9B,MAAMC,UAAU,GAAG,CAAC,CAACC,KAAK,EAAE,GAAGC,IAAI,CAAC,EAAEC,SAAS,GAAG,KAAK,KACrDF,KAAK,CAACG,WAAW,EAAE,IAAID,SAAS,GAAGD,IAAI,CAACG,IAAI,CAAC,EAAE,CAAC,CAACC,WAAW,EAAE,GAAGJ,IAAI,CAACG,IAAI,CAAC,EAAE,CAAC,CAAC;AAEjF,MAAME,IAAI,GAAG,CAAC;EAAEC,SAAS;EAAEC,OAAO;EAAEC,IAAI;EAAEC;AAAQ,CAAC,kBACjD,KAAC,MAAM;EACL,KAAK,EAAED,IAAI,CAAC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CAAC8B,MAAM;IACtB;AACJ;AACA;IACIuC,WAAW,EAAErE,SAAS,CAAC8B,MAAM;IAC7B;AACJ;AACA;IACI2C,WAAW,EAAEzE,SAAS,CAAC8B,MAAM;IAC7B;AACJ;AACA;IACIL,KAAK,EAAEzB,SAAS,CAAC8B;EACnB,CAAC,CAAC,CAACC,UAAU;EACb;AACF;AACA;EACEc,SAAS,EAAE7C,SAAS,CAAC2E,OAAO,CAC1B3E,SAAS,CAAC6B,KAAK,CAAC;IACdJ,KAAK,EAAEzB,SAAS,CAAC8B,MAAM;IACvBR,IAAI,EAAEtB,SAAS,CAAC8B;EAClB,CAAC,CAAC,CACH;EACD;AACF;AACA;EACEiB,GAAG,EAAE/C,SAAS,CAAC8B,MAAM;EACrB;AACF;AACA;EACEgB,UAAU,EAAE9C,SAAS,CAAC4E,MAAM;EAC5B;AACF;AACA;AACA;EACE5B,SAAS,EAAEhD,SAAS,CAAC2B,WAAW;EAChC;AACF;AACA;EACER,OAAO,EAAEnB,SAAS,CAAC4B,IAAI;EACvB;AACF;AACA;EACEqB,iBAAiB,EAAEjD,SAAS,CAACgC,UAAU,CAACC,MAAM;AAChD,CAAC;AAED,eAAe/B,UAAU,CAACO,MAAM,EAAE;EAAEoE,IAAI,EAAE,cAAc;EAAEd,KAAK,EAAE;AAAE,CAAC,CAAC,CAACtB,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","display","alignItems","zIndex","centerContainer","link","maxWidth","color","hv","palette","accent","acce1","cursor","backgroundColor","atmosphere","atmo3","separatorContainer","orderedList","paddingLeft","marginLeft","spacing","currentPage","padding","a","textDecoration","borderRadius"],"sources":["../../../src/BreadCrumb/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n display: \"flex\",\n alignItems: \"center\",\n zIndex: 0,\n },\n centerContainer: {\n display: \"flex\",\n alignItems: \"center\",\n },\n link: {\n maxWidth: \"170px\",\n color: theme.hv.palette.accent.acce1,\n \"&:hover\": {\n cursor: \"pointer\",\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n },\n separatorContainer: {},\n orderedList: {\n display: \"flex\",\n paddingLeft: 0,\n marginLeft: `-${theme.spacing(\"xs\")}`,\n },\n currentPage: {\n padding: `8px ${theme.spacing(\"xs\")}`,\n },\n a: {\n padding: `8px ${theme.spacing(\"xs\")}`,\n textDecoration: \"none\",\n borderRadius: \"2px\",\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAK,KAAM;EACzBC,IAAI,EAAE;IACJC,OAAO,EAAE,MAAM;IACfC,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE;EACV,CAAC;EACDC,eAAe,EAAE;IACfH,OAAO,EAAE,MAAM;IACfC,UAAU,EAAE;EACd,CAAC;EACDG,IAAI,EAAE;IACJC,QAAQ,EAAE,OAAO;IACjBC,KAAK,EAAER,KAAK,CAACS,EAAE,CAACC,OAAO,CAACC,MAAM,CAACC,KAAK;IACpC,SAAS,EAAE;MACTC,MAAM,EAAE,SAAS;MACjBC,eAAe,EAAEd,KAAK,CAACS,EAAE,CAACC,OAAO,CAACK,UAAU,CAACC;IAC/C;EACF,CAAC;EACDC,kBAAkB,EAAE,CAAC,CAAC;EACtBC,WAAW,EAAE;IACXhB,OAAO,EAAE,MAAM;IACfiB,WAAW,EAAE,CAAC;IACdC,UAAU,EAAG,IAAGpB,KAAK,CAACqB,OAAO,CAAC,IAAI,CAAE;EACtC,CAAC;EACDC,WAAW,EAAE;IACXC,OAAO,EAAG,OAAMvB,KAAK,CAACqB,OAAO,CAAC,IAAI,CAAE;EACtC,CAAC;EACDG,CAAC,EAAE;IACDD,OAAO,EAAG,OAAMvB,KAAK,CAACqB,OAAO,CAAC,IAAI,CAAE,EAAC;IACrCI,cAAc,EAAE,MAAM;IACtBC,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE;MACTZ,eAAe,EAAEd,KAAK,CAACS,EAAE,CAACC,OAAO,CAACK,UAAU,CAACC;IAC/C,CAAC;IACD,SAAS,EAAE;MACTF,eAAe,EAAEd,KAAK,CAACS,EAAE,CAACC,OAAO,CAACK,UAAU,CAACC;IAC/C;EACF;AACF,CAAC,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","display","alignItems","zIndex","centerContainer","link","maxWidth","color","hv","palette","accent","acce1","cursor","backgroundColor","atmosphere","atmo3","separatorContainer","orderedList","paddingLeft","marginLeft","spacing","currentPage","padding","a","textDecoration","borderRadius","label","textTransform"],"sources":["../../../src/BreadCrumb/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n display: \"flex\",\n alignItems: \"center\",\n zIndex: 0,\n },\n centerContainer: {\n display: \"flex\",\n alignItems: \"center\",\n },\n link: {\n maxWidth: \"170px\",\n color: theme.hv.palette.accent.acce1,\n \"&:hover\": {\n cursor: \"pointer\",\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n },\n separatorContainer: {},\n orderedList: {\n display: \"flex\",\n paddingLeft: 0,\n marginLeft: `-${theme.spacing(\"xs\")}`,\n },\n currentPage: {\n padding: `8px ${theme.spacing(\"xs\")}`,\n },\n a: {\n padding: `8px ${theme.spacing(\"xs\")}`,\n textDecoration: \"none\",\n borderRadius: \"2px\",\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n },\n label: {\n textTransform: \"capitalize\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAK,KAAM;EACzBC,IAAI,EAAE;IACJC,OAAO,EAAE,MAAM;IACfC,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE;EACV,CAAC;EACDC,eAAe,EAAE;IACfH,OAAO,EAAE,MAAM;IACfC,UAAU,EAAE;EACd,CAAC;EACDG,IAAI,EAAE;IACJC,QAAQ,EAAE,OAAO;IACjBC,KAAK,EAAER,KAAK,CAACS,EAAE,CAACC,OAAO,CAACC,MAAM,CAACC,KAAK;IACpC,SAAS,EAAE;MACTC,MAAM,EAAE,SAAS;MACjBC,eAAe,EAAEd,KAAK,CAACS,EAAE,CAACC,OAAO,CAACK,UAAU,CAACC;IAC/C;EACF,CAAC;EACDC,kBAAkB,EAAE,CAAC,CAAC;EACtBC,WAAW,EAAE;IACXhB,OAAO,EAAE,MAAM;IACfiB,WAAW,EAAE,CAAC;IACdC,UAAU,EAAG,IAAGpB,KAAK,CAACqB,OAAO,CAAC,IAAI,CAAE;EACtC,CAAC;EACDC,WAAW,EAAE;IACXC,OAAO,EAAG,OAAMvB,KAAK,CAACqB,OAAO,CAAC,IAAI,CAAE;EACtC,CAAC;EACDG,CAAC,EAAE;IACDD,OAAO,EAAG,OAAMvB,KAAK,CAACqB,OAAO,CAAC,IAAI,CAAE,EAAC;IACrCI,cAAc,EAAE,MAAM;IACtBC,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE;MACTZ,eAAe,EAAEd,KAAK,CAACS,EAAE,CAACC,OAAO,CAACK,UAAU,CAACC;IAC/C,CAAC;IACD,SAAS,EAAE;MACTF,eAAe,EAAEd,KAAK,CAACS,EAAE,CAACC,OAAO,CAACK,UAAU,CAACC;IAC/C;EACF,CAAC;EACDW,KAAK,EAAE;IACLC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAEF,eAAe7B,MAAM"}
|
|
@@ -7,8 +7,7 @@ import { MoreOptionsHorizontal } from "@hitachivantara/uikit-react-icons";
|
|
|
7
7
|
import { HvDropDownMenu } from "..";
|
|
8
8
|
import { setId } from "../utils";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
|
-
export const pathWithSubMenu = (id, classes, listRoute, maxVisible, dropDownMenuProps) => {
|
|
10
|
+
const pathWithSubMenu = (id, classes, listRoute, maxVisible, dropDownMenuProps) => {
|
|
12
11
|
const nbrElemToSubMenu = listRoute.length - maxVisible;
|
|
13
12
|
const subMenuList = listRoute.slice(1, nbrElemToSubMenu + 1);
|
|
14
13
|
listRoute.splice(1, nbrElemToSubMenu, /*#__PURE__*/_jsx(HvDropDownMenu, _objectSpread({
|
|
@@ -21,4 +20,5 @@ export const pathWithSubMenu = (id, classes, listRoute, maxVisible, dropDownMenu
|
|
|
21
20
|
}, dropDownMenuProps)));
|
|
22
21
|
return listRoute;
|
|
23
22
|
};
|
|
23
|
+
export default pathWithSubMenu;
|
|
24
24
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["React","MoreOptionsHorizontal","HvDropDownMenu","setId","
|
|
1
|
+
{"version":3,"file":"utils.js","names":["React","MoreOptionsHorizontal","HvDropDownMenu","setId","pathWithSubMenu","id","classes","listRoute","maxVisible","dropDownMenuProps","nbrElemToSubMenu","length","subMenuList","slice","splice"],"sources":["../../../src/BreadCrumb/utils.js"],"sourcesContent":["import React from \"react\";\nimport { MoreOptionsHorizontal } from \"@hitachivantara/uikit-react-icons\";\nimport { HvDropDownMenu } from \"..\";\nimport { setId } from \"../utils\";\n\nconst pathWithSubMenu = (id, classes, listRoute, maxVisible, dropDownMenuProps) => {\n const nbrElemToSubMenu = listRoute.length - maxVisible;\n const subMenuList = listRoute.slice(1, nbrElemToSubMenu + 1);\n\n listRoute.splice(\n 1,\n nbrElemToSubMenu,\n <HvDropDownMenu\n id={setId(id, \"submenu\")}\n icon={<MoreOptionsHorizontal iconSize=\"S\" color=\"acce1\" />}\n dataList={subMenuList}\n {...dropDownMenuProps}\n />\n );\n\n return listRoute;\n};\n\nexport default pathWithSubMenu;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,qBAAqB,QAAQ,mCAAmC;AACzE,SAASC,cAAc,QAAQ,IAAI;AACnC,SAASC,KAAK,QAAQ,UAAU;AAAC;AAEjC,MAAMC,eAAe,GAAG,CAACC,EAAE,EAAEC,OAAO,EAAEC,SAAS,EAAEC,UAAU,EAAEC,iBAAiB,KAAK;EACjF,MAAMC,gBAAgB,GAAGH,SAAS,CAACI,MAAM,GAAGH,UAAU;EACtD,MAAMI,WAAW,GAAGL,SAAS,CAACM,KAAK,CAAC,CAAC,EAAEH,gBAAgB,GAAG,CAAC,CAAC;EAE5DH,SAAS,CAACO,MAAM,CACd,CAAC,EACDJ,gBAAgB,eAChB,KAAC,cAAc;IACb,EAAE,EAAEP,KAAK,CAACE,EAAE,EAAE,SAAS,CAAE;IACzB,IAAI,iEAAE,KAAC,qBAAqB;MAAC,QAAQ,EAAC,GAAG;MAAC,KAAK,EAAC;IAAO,EAAG,CAAC;IAC3D,QAAQ,EAAEO;EAAY,GAClBH,iBAAiB,EACrB,CACH;EAED,OAAOF,SAAS;AAClB,CAAC;AAED,eAAeH,eAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DialogProps, StandardProps } from "@mui/material";
|
|
2
2
|
|
|
3
|
-
export type HvDialogClassKey = "root" | "background" | "paper" | "closeButton";
|
|
3
|
+
export type HvDialogClassKey = "root" | "background" | "paper" | "fullscreen" | "closeButton";
|
|
4
4
|
|
|
5
5
|
export interface HvDialogProps extends StandardProps<DialogProps, HvDialogClassKey> {
|
|
6
6
|
/**
|
|
@@ -100,7 +100,7 @@ const HvDialog = _ref => {
|
|
|
100
100
|
open: open,
|
|
101
101
|
PaperProps: {
|
|
102
102
|
classes: {
|
|
103
|
-
root: clsx(classes.paper, fullscreen &&
|
|
103
|
+
root: clsx(classes.paper, fullscreen && classes.fullscreen)
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
fullScreen: fullscreen,
|
|
@@ -110,9 +110,9 @@ const HvDialog = _ref => {
|
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
onClose: (event, reason) => wrappedClose(event, reason),
|
|
113
|
-
onKeyDown: keyDownHandler
|
|
113
|
+
onKeyDown: keyDownHandler,
|
|
114
|
+
"aria-modal": true
|
|
114
115
|
}, others), {}, {
|
|
115
|
-
"aria-modal": true,
|
|
116
116
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
117
117
|
id: setId(id, "close"),
|
|
118
118
|
className: classes.closeButton,
|
|
@@ -120,9 +120,7 @@ const HvDialog = _ref => {
|
|
|
120
120
|
onClick: event => wrappedClose(event, undefined, true),
|
|
121
121
|
"aria-label": buttonTitle,
|
|
122
122
|
children: /*#__PURE__*/_jsx(CloseButtonTooltipWrapper, {})
|
|
123
|
-
}), children
|
|
124
|
-
fullscreen
|
|
125
|
-
})) : children]
|
|
123
|
+
}), children]
|
|
126
124
|
}));
|
|
127
125
|
};
|
|
128
126
|
process.env.NODE_ENV !== "production" ? HvDialog.propTypes = {
|
|
@@ -147,9 +145,13 @@ process.env.NODE_ENV !== "production" ? HvDialog.propTypes = {
|
|
|
147
145
|
*/
|
|
148
146
|
background: PropTypes.string,
|
|
149
147
|
/**
|
|
150
|
-
* Style applied to the component
|
|
148
|
+
* Style applied to the paper component.
|
|
151
149
|
*/
|
|
152
150
|
paper: PropTypes.string,
|
|
151
|
+
/**
|
|
152
|
+
* Style applied to the paper component when it's fullscreen.
|
|
153
|
+
*/
|
|
154
|
+
fullscreen: PropTypes.string,
|
|
153
155
|
/**
|
|
154
156
|
* Style applied to the close button.
|
|
155
157
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":["React","useCallback","useState","clsx","PropTypes","Dialog","withStyles","Close","isNil","Button","isKeypress","KeyboardCodes","setId","styles","withTooltip","getFocusableList","HvDialog","classes","className","id","children","open","onClose","firstFocusable","buttonTitle","fullscreen","disableBackdropClick","others","focusableQueue","setFocusableQueue","wrappedClose","event","reason","bypassValidation","measuredRef","node","focusableList","first","last","length","focus","element","document","getElementById","console","warn","keyDownHandler","Tab","target","shiftKey","preventDefault","Esc","onEscapeKeyDown","disableEscapeKeyDown","stopPropagation","closeButtonDisplay","CloseButtonTooltipWrapper","root","paper","background","closeButton","undefined","Children","map","c","cloneElement","propTypes","string","shape","isRequired","bool","func","name"],"sources":["../../../src/Dialog/Dialog.js"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { Dialog } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport isNil from \"lodash/isNil\";\nimport Button from \"../Button\";\nimport { isKeypress, KeyboardCodes, setId } from \"../utils\";\nimport styles from \"./styles\";\nimport withTooltip from \"../withTooltip\";\nimport { getFocusableList } from \"../utils/focusableElementFinder\";\n\n/**\n * The Dialog component provides a solid foundation for creating dialogs, popovers, lightboxes, etc.\n * It is created by the composition of DialogTitle, DialogContent and DialogActions components, passed as child elements.\n */\nconst HvDialog = ({\n classes,\n className,\n id,\n children,\n open,\n onClose,\n firstFocusable,\n buttonTitle = \"Close\",\n fullscreen = false,\n disableBackdropClick = false,\n ...others\n}) => {\n const [focusableQueue, setFocusableQueue] = useState(null);\n\n // Because the `disableBackdropClick` property was deprecated in MUI5\n // and we want to maintain that funcionality to the user we're wrapping\n // the onClose call here to make that check.\n const wrappedClose = (event, reason, bypassValidation = false) => {\n if (bypassValidation) {\n onClose?.(event, reason);\n } else if (!disableBackdropClick) {\n onClose?.(event, reason);\n }\n };\n\n const measuredRef = useCallback(\n (node) => {\n if (node) {\n const focusableList = getFocusableList(node);\n setFocusableQueue({\n first: focusableList[1],\n last: focusableList[focusableList.length - 2],\n });\n if (isNil(firstFocusable)) focusableList[1].focus();\n else {\n const element = document.getElementById(firstFocusable);\n if (element) element.focus();\n else {\n // eslint-disable-next-line no-console\n console.warn(`firstFocusable element ${firstFocusable} not found.`);\n focusableList[1].focus();\n }\n }\n }\n },\n [firstFocusable]\n );\n\n const keyDownHandler = (event) => {\n if (isKeypress(event, KeyboardCodes.Tab) && !isNil(event.target) && !isNil(focusableQueue)) {\n if (event.shiftKey && event.target === focusableQueue.first) {\n focusableQueue.last.focus();\n event.preventDefault();\n }\n if (!event.shiftKey && event.target === focusableQueue.last) {\n focusableQueue.first.focus();\n event.preventDefault();\n }\n }\n // Needed as this handler overrides the one in the material ui Modal.\n else if (isKeypress(event, KeyboardCodes.Esc)) {\n if (others.onEscapeKeyDown) {\n others.onEscapeKeyDown(event);\n }\n\n if (!others.disableEscapeKeyDown) {\n // Swallow the event, in case someone is listening for the escape key on the body.\n event.stopPropagation();\n\n wrappedClose(event, \"escapeKeyDown\", true);\n }\n }\n };\n\n const closeButtonDisplay = () => <Close role=\"presentation\" />;\n\n const CloseButtonTooltipWrapper = buttonTitle\n ? withTooltip(closeButtonDisplay, buttonTitle, \"top\")\n : closeButtonDisplay;\n\n return (\n <Dialog\n className={clsx(classes.root, className)}\n id={id}\n ref={measuredRef}\n open={open}\n PaperProps={{\n classes: {\n root: clsx(classes.paper, fullscreen ? \"fullscreen\" : \"\"),\n },\n }}\n fullScreen={fullscreen}\n BackdropProps={{\n classes: {\n root: classes.background,\n },\n }}\n onClose={(event, reason) => wrappedClose(event, reason)}\n onKeyDown={keyDownHandler}\n {...others}\n aria-modal\n >\n <Button\n id={setId(id, \"close\")}\n className={classes.closeButton}\n category=\"ghost\"\n onClick={(event) => wrappedClose(event, undefined, true)}\n aria-label={buttonTitle}\n >\n <CloseButtonTooltipWrapper />\n </Button>\n {children && typeof children === \"object\"\n ? React.Children.map(children, (c) => React.cloneElement(c, { fullscreen }))\n : children}\n </Dialog>\n );\n};\n\nHvDialog.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component.\n */\n root: PropTypes.string,\n /**\n * Style applied to the background (outside) of the component.\n */\n background: PropTypes.string,\n /**\n * Style applied to the component (root).\n */\n paper: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Components of the Dialog.\n */\n children: PropTypes.node.isRequired,\n /**\n * Current state of the Dialog.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n onClose: PropTypes.func,\n /**\n * Element id that should be focus when the Dialog opens.\n */\n firstFocusable: PropTypes.string,\n /**\n * Title for the button close.\n */\n buttonTitle: PropTypes.string,\n /**\n * Set the dialog to fullscreen mode.\n */\n fullscreen: PropTypes.bool,\n /**\n * Prevent closing the dialog when clicking on the backdrop.\n */\n disableBackdropClick: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvDialog\" })(HvDialog);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,KAAK,QAAQ,mCAAmC;AACzD,OAAOC,KAAK,MAAM,cAAc;AAChC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,UAAU,EAAEC,aAAa,EAAEC,KAAK,QAAQ,UAAU;AAC3D,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SAASC,gBAAgB,QAAQ,iCAAiC;;AAElE;AACA;AACA;AACA;AAHA;AAAA;AAIA,MAAMC,QAAQ,GAAG,QAYX;EAAA,IAZY;MAChBC,OAAO;MACPC,SAAS;MACTC,EAAE;MACFC,QAAQ;MACRC,IAAI;MACJC,OAAO;MACPC,cAAc;MACdC,WAAW,GAAG,OAAO;MACrBC,UAAU,GAAG,KAAK;MAClBC,oBAAoB,GAAG;IAEzB,CAAC;IADIC,MAAM;EAET,MAAM,CAACC,cAAc,EAAEC,iB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;EACzB,CAAC,CAAC,CAACE,UAAU;EACb;AACF;AACA;EACEjD,QAAQ,EAAEhB,SAAS,CAAC+B,IAAI,CAACkC,UAAU;EACnC;AACF;AACA;EACEhD,IAAI,EAAEjB,SAAS,CAACkE,IAAI,CAACD,UAAU;EAC/B;AACF;AACA;EACE/C,OAAO,EAAElB,SAAS,CAACmE,IAAI;EACvB;AACF;AACA;EACEhD,cAAc,EAAEnB,SAAS,CAAC+D,MAAM;EAChC;AACF;AACA;EACE3C,WAAW,EAAEpB,SAAS,CAAC+D,MAAM;EAC7B;AACF;AACA;EACE1C,UAAU,EAAErB,SAAS,CAACkE,IAAI;EAC1B;AACF;AACA;EACE5C,oBAAoB,EAAEtB,SAAS,CAACkE;AAClC,CAAC;AAED,eAAehE,UAAU,CAACO,MAAM,EAAE;EAAE2D,IAAI,EAAE;AAAW,CAAC,CAAC,CAACxD,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"Dialog.js","names":["React","useCallback","useState","clsx","PropTypes","Dialog","withStyles","Close","isNil","Button","isKeypress","KeyboardCodes","setId","styles","withTooltip","getFocusableList","HvDialog","classes","className","id","children","open","onClose","firstFocusable","buttonTitle","fullscreen","disableBackdropClick","others","focusableQueue","setFocusableQueue","wrappedClose","event","reason","bypassValidation","measuredRef","node","focusableList","first","last","length","focus","element","document","getElementById","console","warn","keyDownHandler","Tab","target","shiftKey","preventDefault","Esc","onEscapeKeyDown","disableEscapeKeyDown","stopPropagation","closeButtonDisplay","CloseButtonTooltipWrapper","root","paper","background","closeButton","undefined","propTypes","string","shape","isRequired","bool","func","name"],"sources":["../../../src/Dialog/Dialog.js"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { Dialog } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport isNil from \"lodash/isNil\";\nimport Button from \"../Button\";\nimport { isKeypress, KeyboardCodes, setId } from \"../utils\";\nimport styles from \"./styles\";\nimport withTooltip from \"../withTooltip\";\nimport { getFocusableList } from \"../utils/focusableElementFinder\";\n\n/**\n * The Dialog component provides a solid foundation for creating dialogs, popovers, lightboxes, etc.\n * It is created by the composition of DialogTitle, DialogContent and DialogActions components, passed as child elements.\n */\nconst HvDialog = ({\n classes,\n className,\n id,\n children,\n open,\n onClose,\n firstFocusable,\n buttonTitle = \"Close\",\n fullscreen = false,\n disableBackdropClick = false,\n ...others\n}) => {\n const [focusableQueue, setFocusableQueue] = useState(null);\n\n // Because the `disableBackdropClick` property was deprecated in MUI5\n // and we want to maintain that funcionality to the user we're wrapping\n // the onClose call here to make that check.\n const wrappedClose = (event, reason, bypassValidation = false) => {\n if (bypassValidation) {\n onClose?.(event, reason);\n } else if (!disableBackdropClick) {\n onClose?.(event, reason);\n }\n };\n\n const measuredRef = useCallback(\n (node) => {\n if (node) {\n const focusableList = getFocusableList(node);\n setFocusableQueue({\n first: focusableList[1],\n last: focusableList[focusableList.length - 2],\n });\n if (isNil(firstFocusable)) focusableList[1].focus();\n else {\n const element = document.getElementById(firstFocusable);\n if (element) element.focus();\n else {\n // eslint-disable-next-line no-console\n console.warn(`firstFocusable element ${firstFocusable} not found.`);\n focusableList[1].focus();\n }\n }\n }\n },\n [firstFocusable]\n );\n\n const keyDownHandler = (event) => {\n if (isKeypress(event, KeyboardCodes.Tab) && !isNil(event.target) && !isNil(focusableQueue)) {\n if (event.shiftKey && event.target === focusableQueue.first) {\n focusableQueue.last.focus();\n event.preventDefault();\n }\n if (!event.shiftKey && event.target === focusableQueue.last) {\n focusableQueue.first.focus();\n event.preventDefault();\n }\n }\n // Needed as this handler overrides the one in the material ui Modal.\n else if (isKeypress(event, KeyboardCodes.Esc)) {\n if (others.onEscapeKeyDown) {\n others.onEscapeKeyDown(event);\n }\n\n if (!others.disableEscapeKeyDown) {\n // Swallow the event, in case someone is listening for the escape key on the body.\n event.stopPropagation();\n\n wrappedClose(event, \"escapeKeyDown\", true);\n }\n }\n };\n\n const closeButtonDisplay = () => <Close role=\"presentation\" />;\n\n const CloseButtonTooltipWrapper = buttonTitle\n ? withTooltip(closeButtonDisplay, buttonTitle, \"top\")\n : closeButtonDisplay;\n\n return (\n <Dialog\n className={clsx(classes.root, className)}\n id={id}\n ref={measuredRef}\n open={open}\n PaperProps={{\n classes: {\n root: clsx(classes.paper, { [classes.fullscreen]: fullscreen }),\n },\n }}\n fullScreen={fullscreen}\n BackdropProps={{\n classes: {\n root: classes.background,\n },\n }}\n onClose={(event, reason) => wrappedClose(event, reason)}\n onKeyDown={keyDownHandler}\n aria-modal\n {...others}\n >\n <Button\n id={setId(id, \"close\")}\n className={classes.closeButton}\n category=\"ghost\"\n onClick={(event) => wrappedClose(event, undefined, true)}\n aria-label={buttonTitle}\n >\n <CloseButtonTooltipWrapper />\n </Button>\n {children}\n </Dialog>\n );\n};\n\nHvDialog.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component.\n */\n root: PropTypes.string,\n /**\n * Style applied to the background (outside) of the component.\n */\n background: PropTypes.string,\n /**\n * Style applied to the paper component.\n */\n paper: PropTypes.string,\n /**\n * Style applied to the paper component when it's fullscreen.\n */\n fullscreen: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Components of the Dialog.\n */\n children: PropTypes.node.isRequired,\n /**\n * Current state of the Dialog.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n onClose: PropTypes.func,\n /**\n * Element id that should be focus when the Dialog opens.\n */\n firstFocusable: PropTypes.string,\n /**\n * Title for the button close.\n */\n buttonTitle: PropTypes.string,\n /**\n * Set the dialog to fullscreen mode.\n */\n fullscreen: PropTypes.bool,\n /**\n * Prevent closing the dialog when clicking on the backdrop.\n */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AAAW,CAAC,CAAC,CAACpD,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogActions.js","names":["React","clsx","PropTypes","DialogActions","withStyles","styles","HvDialogActions","props","classes","className","children","fullscreen","others","root","spacing","propTypes","string","shape","isRequired","node","bool","name"],"sources":["../../../../src/Dialog/DialogActions/DialogActions.js"],"sourcesContent":["import React from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { DialogActions } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport styles from \"./styles\";\n\nconst HvDialogActions = (props) => {\n const { classes, className, children, fullscreen = false, ...others } = props;\n return (\n <DialogActions\n classes={{\n root: clsx(classes.root,
|
|
1
|
+
{"version":3,"file":"DialogActions.js","names":["React","clsx","PropTypes","DialogActions","withStyles","styles","HvDialogActions","props","classes","className","children","fullscreen","others","root","spacing","propTypes","string","shape","isRequired","node","bool","name"],"sources":["../../../../src/Dialog/DialogActions/DialogActions.js"],"sourcesContent":["import React from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { DialogActions } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport styles from \"./styles\";\n\nconst HvDialogActions = (props) => {\n const { classes, className, children, fullscreen = false, ...others } = props;\n return (\n <DialogActions\n classes={{\n root: clsx(classes.root, { [classes.fullscreen]: fullscreen }),\n spacing: classes.spacing,\n }}\n className={className}\n {...others}\n >\n {children}\n </DialogActions>\n );\n};\n\nHvDialogActions.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component (container for the actions).\n */\n root: PropTypes.string,\n /**\n * Style applied to the root of the component if disableSpacing is off.\n */\n spacing: PropTypes.string,\n /**\n * Style applied to the root of the component if fullscreen is on.\n */\n fullscreen: PropTypes.string,\n }).isRequired,\n /**\n * Actions of the Dialog.\n */\n children: PropTypes.node.isRequired,\n /**\n * Whether or not the dialog is in fullscreen mode.\n */\n fullscreen: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvDialogActions\" })(HvDialogActions);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,MAAM,MAAM,UAAU;AAAC;AAE9B,MAAMC,eAAe,GAAIC,KAAK,IAAK;EACjC,MAAM;MAAEC,OAAO;MAAEC,SAAS;MAAEC,QAAQ;MAAEC,UAAU,GAAG;IAAiB,CAAC,GAAGJ,KAAK;IAAhBK,MAAM,4BAAKL,KAAK;EAC7E,oBACE,KAAC,aAAa;IACZ,OAAO,EAAE;MACPM,IAAI,EAAEZ,IAAI,CAACO,OAAO,CAACK,IAAI,EAA0BF,UAAU,IAA/BH,OAAO,CAACG,UAAU,CAAgB;MAC9DG,OAAO,EAAEN,OAAO,CAACM;IACnB,CAAE;IACF,SAAS,EAAEL;EAAU,GACjBG,MAAM;IAAA,UAETF;EAAQ,GACK;AAEpB,CAAC;AAED,wCAAAJ,eAAe,CAACS,SAAS,GAAG;EAC1B;AACF;AACA;EACEN,SAAS,EAAEP,SAAS,CAACc,MAAM;EAC3B;AACF;AACA;EACER,OAAO,EAAEN,SAAS,CAACe,KAAK,CAAC;IACvB;AACJ;AACA;IACIJ,IAAI,EAAEX,SAAS,CAACc,MAAM;IACtB;AACJ;AACA;IACIF,OAAO,EAAEZ,SAAS,CAACc,MAAM;IACzB;AACJ;AACA;IACIL,UAAU,EAAET,SAAS,CAACc;EACxB,CAAC,CAAC,CAACE,UAAU;EACb;AACF;AACA;EACER,QAAQ,EAAER,SAAS,CAACiB,IAAI,CAACD,UAAU;EACnC;AACF;AACA;EACEP,UAAU,EAAET,SAAS,CAACkB;AACxB,CAAC;AAED,eAAehB,UAAU,CAACC,MAAM,EAAE;EAAEgB,IAAI,EAAE;AAAkB,CAAC,CAAC,CAACf,eAAe,CAAC"}
|
|
@@ -2,21 +2,14 @@ const styles = theme => ({
|
|
|
2
2
|
root: {
|
|
3
3
|
margin: "0",
|
|
4
4
|
padding: theme.hv.spacing.sm,
|
|
5
|
-
borderTop: `3px solid ${theme.hv.palette.atmosphere.atmo2}
|
|
6
|
-
height: 100,
|
|
7
|
-
flex: 1
|
|
5
|
+
borderTop: `3px solid ${theme.hv.palette.atmosphere.atmo2}`
|
|
8
6
|
},
|
|
9
7
|
spacing: {
|
|
10
8
|
"& > :not(:first-child)": {
|
|
11
9
|
marginLeft: theme.hv.spacing.xs
|
|
12
10
|
}
|
|
13
11
|
},
|
|
14
|
-
fullscreen: {
|
|
15
|
-
position: "fixed",
|
|
16
|
-
width: "100%",
|
|
17
|
-
bottom: 0,
|
|
18
|
-
left: 0
|
|
19
|
-
}
|
|
12
|
+
fullscreen: {}
|
|
20
13
|
});
|
|
21
14
|
export default styles;
|
|
22
15
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","margin","padding","hv","spacing","sm","borderTop","palette","atmosphere","atmo2","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","margin","padding","hv","spacing","sm","borderTop","palette","atmosphere","atmo2","marginLeft","xs","fullscreen"],"sources":["../../../../src/Dialog/DialogActions/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n margin: \"0\",\n padding: theme.hv.spacing.sm,\n borderTop: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n },\n spacing: {\n \"& > :not(:first-child)\": {\n marginLeft: theme.hv.spacing.xs,\n },\n },\n fullscreen: {},\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAK,KAAM;EACzBC,IAAI,EAAE;IACJC,MAAM,EAAE,GAAG;IACXC,OAAO,EAAEH,KAAK,CAACI,EAAE,CAACC,OAAO,CAACC,EAAE;IAC5BC,SAAS,EAAG,aAAYP,KAAK,CAACI,EAAE,CAACI,OAAO,CAACC,UAAU,CAACC,KAAM;EAC5D,CAAC;EACDL,OAAO,EAAE;IACP,wBAAwB,EAAE;MACxBM,UAAU,EAAEX,KAAK,CAACI,EAAE,CAACC,OAAO,CAACO;IAC/B;EACF,CAAC;EACDC,UAAU,EAAE,CAAC;AACf,CAAC,CAAC;AAEF,eAAed,MAAM"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
const _excluded = ["classes", "className", "children", "indentContent"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
1
6
|
import React from "react";
|
|
2
7
|
import PropTypes from "prop-types";
|
|
3
8
|
import { DialogContent } from "@mui/material";
|
|
@@ -6,17 +11,20 @@ import clsx from "clsx";
|
|
|
6
11
|
import HvTypography from "../../Typography";
|
|
7
12
|
import styles from "./styles";
|
|
8
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const HvDialogContent =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const HvDialogContent = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
classes,
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
indentContent = false
|
|
20
|
+
} = _ref,
|
|
21
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
return /*#__PURE__*/_jsx(HvTypography, _objectSpread(_objectSpread({
|
|
16
23
|
component: DialogContent,
|
|
17
|
-
className: clsx(className, classes.root, indentContent && classes.textContent)
|
|
24
|
+
className: clsx(className, classes.root, indentContent && classes.textContent)
|
|
25
|
+
}, others), {}, {
|
|
18
26
|
children: children
|
|
19
|
-
});
|
|
27
|
+
}));
|
|
20
28
|
};
|
|
21
29
|
process.env.NODE_ENV !== "production" ? HvDialogContent.propTypes = {
|
|
22
30
|
/**
|
|
@@ -32,7 +40,7 @@ process.env.NODE_ENV !== "production" ? HvDialogContent.propTypes = {
|
|
|
32
40
|
*/
|
|
33
41
|
root: PropTypes.string,
|
|
34
42
|
/**
|
|
35
|
-
* Style applied when the content is
|
|
43
|
+
* Style applied when the content is indented.
|
|
36
44
|
*/
|
|
37
45
|
textContent: PropTypes.string
|
|
38
46
|
}).isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContent.js","names":["React","PropTypes","DialogContent","withStyles","clsx","HvTypography","styles","HvDialogContent","classes","className","children","indentContent","root","textContent","propTypes","string","shape","isRequired","bool","node","name"],"sources":["../../../../src/Dialog/DialogContent/DialogContent.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { DialogContent } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport clsx from \"clsx\";\nimport HvTypography from \"../../Typography\";\nimport styles from \"./styles\";\n\nconst HvDialogContent = ({ classes, className, children, indentContent = false }) => {\n return (\n <HvTypography\n component={DialogContent}\n className={clsx(className, classes.root, { [classes.textContent]: indentContent })}\n >\n {children}\n </HvTypography>\n );\n};\n\nHvDialogContent.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component (container for the content).\n */\n root: PropTypes.string,\n /**\n * Style applied when the content is
|
|
1
|
+
{"version":3,"file":"DialogContent.js","names":["React","PropTypes","DialogContent","withStyles","clsx","HvTypography","styles","HvDialogContent","classes","className","children","indentContent","others","root","textContent","propTypes","string","shape","isRequired","bool","node","name"],"sources":["../../../../src/Dialog/DialogContent/DialogContent.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { DialogContent } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport clsx from \"clsx\";\nimport HvTypography from \"../../Typography\";\nimport styles from \"./styles\";\n\nconst HvDialogContent = ({ classes, className, children, indentContent = false, ...others }) => {\n return (\n <HvTypography\n component={DialogContent}\n className={clsx(className, classes.root, { [classes.textContent]: indentContent })}\n {...others}\n >\n {children}\n </HvTypography>\n );\n};\n\nHvDialogContent.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component (container for the content).\n */\n root: PropTypes.string,\n /**\n * Style applied when the content is indented.\n */\n textContent: PropTypes.string,\n }).isRequired,\n /**\n * Content should be indented in relationship to the Dialog title.\n */\n indentContent: PropTypes.bool,\n /**\n * Content to be rendered.\n */\n children: PropTypes.node.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvDialogContent\" })(HvDialogContent);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,MAAM,MAAM,UAAU;AAAC;AAE9B,MAAMC,eAAe,GAAG,QAAwE;EAAA,IAAvE;MAAEC,OAAO;MAAEC,SAAS;MAAEC,QAAQ;MAAEC,aAAa,GAAG;IAAiB,CAAC;IAARC,MAAM;EACvF,oBACE,KAAC,YAAY;IACX,SAAS,EAAEV,aAAc;IACzB,SAAS,EAAEE,IAAI,CAACK,SAAS,EAAED,OAAO,CAACK,IAAI,EAA2BF,aAAa,IAAnCH,OAAO,CAACM,WAAW;EAAoB,GAC/EF,MAAM;IAAA,UAETF;EAAQ,GACI;AAEnB,CAAC;AAED,wCAAAH,eAAe,CAACQ,SAAS,GAAG;EAC1B;AACF;AACA;EACEN,SAAS,EAAER,SAAS,CAACe,MAAM;EAC3B;AACF;AACA;EACER,OAAO,EAAEP,SAAS,CAACgB,KAAK,CAAC;IACvB;AACJ;AACA;IACIJ,IAAI,EAAEZ,SAAS,CAACe,MAAM;IACtB;AACJ;AACA;IACIF,WAAW,EAAEb,SAAS,CAACe;EACzB,CAAC,CAAC,CAACE,UAAU;EACb;AACF;AACA;EACEP,aAAa,EAAEV,SAAS,CAACkB,IAAI;EAC7B;AACF;AACA;EACET,QAAQ,EAAET,SAAS,CAACmB,IAAI,CAACF;AAC3B,CAAC;AAED,eAAef,UAAU,CAACG,MAAM,EAAE;EAAEe,IAAI,EAAE;AAAkB,CAAC,CAAC,CAACd,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","flex","textContent","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","flex","textContent","margin","overflowY"],"sources":["../../../../src/Dialog/DialogContent/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hvSpacing(0, \"sm\", \"sm\", \"sm\"),\n flex: 1,\n },\n textContent: {\n margin: \"0 42px\",\n flex: 1,\n overflowY: \"auto\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAK,KAAM;EACzBC,IAAI,EAAE;IACJC,OAAO,EAAEF,KAAK,CAACG,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IAC7CC,IAAI,EAAE;EACR,CAAC;EACDC,WAAW,EAAE;IACXC,MAAM,EAAE,QAAQ;IAChBF,IAAI,EAAE,CAAC;IACPG,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAeR,MAAM"}
|
|
@@ -24,16 +24,9 @@ const HvDialogTitle = _ref => {
|
|
|
24
24
|
} = _ref,
|
|
25
25
|
others = _objectWithoutProperties(_ref, _excluded);
|
|
26
26
|
const isString = typeof children === "string";
|
|
27
|
-
const {
|
|
28
|
-
fullscreen
|
|
29
|
-
} = others;
|
|
30
|
-
|
|
31
|
-
// prevent the `fullscreen` prop from being passed to the `DialogTitle` component
|
|
32
|
-
// eslint-disable-next-line no-param-reassign
|
|
33
|
-
delete others.fullscreen;
|
|
34
27
|
const icon = customIcon || showIcon && iconVariant(variant);
|
|
35
28
|
return /*#__PURE__*/_jsx(DialogTitle, _objectSpread(_objectSpread({
|
|
36
|
-
className: clsx(classes.root, className
|
|
29
|
+
className: clsx(classes.root, className)
|
|
37
30
|
}, others), {}, {
|
|
38
31
|
children: /*#__PURE__*/_jsxs("div", {
|
|
39
32
|
className: classes.messageContainer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTitle.js","names":["React","PropTypes","clsx","DialogTitle","withStyles","HvTypography","iconVariant","styles","HvDialogTitle","classes","className","children","variant","showIcon","customIcon","others","isString","
|
|
1
|
+
{"version":3,"file":"DialogTitle.js","names":["React","PropTypes","clsx","DialogTitle","withStyles","HvTypography","iconVariant","styles","HvDialogTitle","classes","className","children","variant","showIcon","customIcon","others","isString","icon","root","messageContainer","textWithIcon","propTypes","string","shape","closeButton","isRequired","oneOf","bool","node","name"],"sources":["../../../../src/Dialog/DialogTitle/DialogTitle.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { DialogTitle } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport HvTypography from \"../../Typography\";\nimport iconVariant from \"../../utils/iconVariant\";\nimport styles from \"./styles\";\n\nconst HvDialogTitle = ({\n classes,\n className,\n children,\n variant = \"default\",\n showIcon = true,\n customIcon = null,\n ...others\n}) => {\n const isString = typeof children === \"string\";\n\n const icon = customIcon || (showIcon && iconVariant(variant));\n\n return (\n <DialogTitle className={clsx(classes.root, className)} {...others}>\n <div className={classes.messageContainer}>\n {icon}\n <div className={clsx({ [classes.textWithIcon]: icon })}>\n {!isString && children}\n {isString && <HvTypography variant=\"xxsTitle\">{children}</HvTypography>}\n </div>\n </div>\n </DialogTitle>\n );\n};\n\nHvDialogTitle.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component (container for the title).\n */\n root: PropTypes.string,\n /**\n * Style applied to the container of the title\n */\n messageContainer: PropTypes.string,\n /**\n * Style applied to the text when the icon is present.\n */\n textWithIcon: PropTypes.string,\n /**\n * Style applied to the icon.\n */\n icon: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Variant of the Dialog.\n */\n variant: PropTypes.oneOf([\"success\", \"warning\", \"error\", \"info\", \"default\"]),\n /**\n * Controls if the associated icon to the variant should be shown.\n */\n showIcon: PropTypes.bool,\n /**\n * Custom icon to replace the variant default.\n */\n customIcon: PropTypes.node,\n /**\n * Node to be render.\n */\n children: PropTypes.node.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvDialogTitle\" })(HvDialogTitle);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC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ACA;IACIL,IAAI,EAAEhB,SAAS,CAACqB,MAAM;IACtB;AACJ;AACA;IACIE,WAAW,EAAEvB,SAAS,CAACqB;EACzB,CAAC,CAAC,CAACG,UAAU;EACb;AACF;AACA;EACEb,OAAO,EAAEX,SAAS,CAACyB,KAAK,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;EAC5E;AACF;AACA;EACEb,QAAQ,EAAEZ,SAAS,CAAC0B,IAAI;EACxB;AACF;AACA;EACEb,UAAU,EAAEb,SAAS,CAAC2B,IAAI;EAC1B;AACF;AACA;EACEjB,QAAQ,EAAEV,SAAS,CAAC2B,IAAI,CAACH;AAC3B,CAAC;AAED,eAAerB,UAAU,CAACG,MAAM,EAAE;EAAEsB,IAAI,EAAE;AAAgB,CAAC,CAAC,CAACrB,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","margin","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","margin","messageContainer","display","alignItems","textWithIcon","marginLeft","marginRight","icon","hv","spacing","md","width","height"],"sources":["../../../../src/Dialog/DialogTitle/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hvSpacing(\"sm\"),\n margin: 0,\n },\n messageContainer: {\n display: \"flex\",\n alignItems: \"center\",\n },\n textWithIcon: {\n marginLeft: theme.hvSpacing(\"xs\"),\n // 32px is the icon width\n marginRight: `calc(32px + ${theme.hvSpacing(\"xs\")})`,\n },\n icon: {\n marginRight: theme.hv.spacing.md,\n width: 48,\n height: 48,\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAK,KAAM;EACzBC,IAAI,EAAE;IACJC,OAAO,EAAEF,KAAK,CAACG,SAAS,CAAC,IAAI,CAAC;IAC9BC,MAAM,EAAE;EACV,CAAC;EACDC,gBAAgB,EAAE;IAChBC,OAAO,EAAE,MAAM;IACfC,UAAU,EAAE;EACd,CAAC;EACDC,YAAY,EAAE;IACZC,UAAU,EAAET,KAAK,CAACG,SAAS,CAAC,IAAI,CAAC;IACjC;IACAO,WAAW,EAAG,eAAcV,KAAK,CAACG,SAAS,CAAC,IAAI,CAAE;EACpD,CAAC;EACDQ,IAAI,EAAE;IACJD,WAAW,EAAEV,KAAK,CAACY,EAAE,CAACC,OAAO,CAACC,EAAE;IAChCC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAejB,MAAM"}
|
|
@@ -4,16 +4,20 @@ const styles = theme => ({
|
|
|
4
4
|
background: fade(theme.hv.palette.atmosphere.atmo4, 0.8)
|
|
5
5
|
},
|
|
6
6
|
paper: {
|
|
7
|
-
background:
|
|
8
|
-
padding:
|
|
7
|
+
background: theme.hv.palette.atmosphere.atmo1,
|
|
8
|
+
padding: 0,
|
|
9
9
|
overflow: "auto",
|
|
10
10
|
boxShadow: theme.hv.shadows[1],
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
maxHeight: "calc(100% - 200px)",
|
|
12
|
+
"@media (max-height:720px)": {
|
|
13
|
+
maxHeight: "calc(100% - 40px)" // "sm" margin
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
"&$fullscreen": {
|
|
17
|
+
maxHeight: "none"
|
|
15
18
|
}
|
|
16
19
|
},
|
|
20
|
+
fullscreen: {},
|
|
17
21
|
closeButton: {
|
|
18
22
|
padding: 0,
|
|
19
23
|
minWidth: "inherit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["fade","styles","theme","background","hv","palette","atmosphere","atmo4","paper","atmo1","padding","overflow","boxShadow","shadows","maxHeight","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["fade","styles","theme","background","hv","palette","atmosphere","atmo4","paper","atmo1","padding","overflow","boxShadow","shadows","maxHeight","fullscreen","closeButton","minWidth","position","top","hvSpacing","right"],"sources":["../../../src/Dialog/styles.js"],"sourcesContent":["import fade from \"../utils/hexToRgbA\";\n\nconst styles = (theme) => ({\n background: {\n background: fade(theme.hv.palette.atmosphere.atmo4, 0.8),\n },\n paper: {\n background: theme.hv.palette.atmosphere.atmo1,\n padding: 0,\n overflow: \"auto\",\n boxShadow: theme.hv.shadows[1],\n maxHeight: \"calc(100% - 200px)\",\n \"@media (max-height:720px)\": {\n maxHeight: \"calc(100% - 40px)\", // \"sm\" margin\n },\n \"&$fullscreen\": {\n maxHeight: \"none\",\n },\n },\n fullscreen: {},\n closeButton: {\n padding: 0,\n minWidth: \"inherit\",\n position: \"absolute\",\n top: theme.hvSpacing(\"sm\"),\n right: theme.hvSpacing(\"sm\"),\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,oBAAoB;AAErC,MAAMC,MAAM,GAAIC,KAAK,KAAM;EACzBC,UAAU,EAAE;IACVA,UAAU,EAAEH,IAAI,CAACE,KAAK,CAACE,EAAE,CAACC,OAAO,CAACC,UAAU,CAACC,KAAK,EAAE,GAAG;EACzD,CAAC;EACDC,KAAK,EAAE;IACLL,UAAU,EAAED,KAAK,CAACE,EAAE,CAACC,OAAO,CAACC,UAAU,CAACG,KAAK;IAC7CC,OAAO,EAAE,CAAC;IACVC,QAAQ,EAAE,MAAM;IAChBC,SAAS,EAAEV,KAAK,CAACE,EAAE,CAACS,OAAO,CAAC,CAAC,CAAC;IAC9BC,SAAS,EAAE,oBAAoB;IAC/B,2BAA2B,EAAE;MAC3BA,SAAS,EAAE,mBAAmB,CAAE;IAClC,CAAC;;IACD,cAAc,EAAE;MACdA,SAAS,EAAE;IACb;EACF,CAAC;EACDC,UAAU,EAAE,CAAC,CAAC;EACdC,WAAW,EAAE;IACXN,OAAO,EAAE,CAAC;IACVO,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAEjB,KAAK,CAACkB,SAAS,CAAC,IAAI,CAAC;IAC1BC,KAAK,EAAEnB,KAAK,CAACkB,SAAS,CAAC,IAAI;EAC7B;AACF,CAAC,CAAC;AAEF,eAAenB,MAAM"}
|
|
@@ -143,6 +143,10 @@ export interface HvDropdownProps
|
|
|
143
143
|
* Experimental. Height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class. Required in case virtualized is used
|
|
144
144
|
*/
|
|
145
145
|
height?: number;
|
|
146
|
+
/**
|
|
147
|
+
* Experimental. Max height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class.
|
|
148
|
+
*/
|
|
149
|
+
maxHeight?: number;
|
|
146
150
|
/**
|
|
147
151
|
* Experimental. Uses dropdown in a virtualized form, where not all options are rendered initially. Good for use cases with a lot of options.
|
|
148
152
|
*/
|