@hitachivantara/uikit-react-core 4.1.1 → 4.3.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.
Files changed (82) hide show
  1. package/dist/BreadCrumb/BreadCrumb.js +32 -20
  2. package/dist/BreadCrumb/BreadCrumb.js.map +1 -1
  3. package/dist/BreadCrumb/styles.js +3 -0
  4. package/dist/BreadCrumb/styles.js.map +1 -1
  5. package/dist/BreadCrumb/utils.js +3 -8
  6. package/dist/BreadCrumb/utils.js.map +1 -1
  7. package/dist/Dialog/Dialog.d.ts +1 -1
  8. package/dist/Dialog/Dialog.js +11 -13
  9. package/dist/Dialog/Dialog.js.map +1 -1
  10. package/dist/Dialog/DialogActions/DialogActions.js.map +1 -1
  11. package/dist/Dialog/DialogActions/styles.js +2 -9
  12. package/dist/Dialog/DialogActions/styles.js.map +1 -1
  13. package/dist/Dialog/DialogContent/DialogContent.js +19 -5
  14. package/dist/Dialog/DialogContent/DialogContent.js.map +1 -1
  15. package/dist/Dialog/DialogContent/styles.js +2 -3
  16. package/dist/Dialog/DialogContent/styles.js.map +1 -1
  17. package/dist/Dialog/DialogTitle/DialogTitle.js +1 -6
  18. package/dist/Dialog/DialogTitle/DialogTitle.js.map +1 -1
  19. package/dist/Dialog/DialogTitle/styles.js +1 -4
  20. package/dist/Dialog/DialogTitle/styles.js.map +1 -1
  21. package/dist/Dialog/styles.js +10 -6
  22. package/dist/Dialog/styles.js.map +1 -1
  23. package/dist/Dropdown/Dropdown.d.ts +4 -0
  24. package/dist/Dropdown/Dropdown.js +7 -1
  25. package/dist/Dropdown/Dropdown.js.map +1 -1
  26. package/dist/Dropdown/List/List.js +9 -4
  27. package/dist/Dropdown/List/List.js.map +1 -1
  28. package/dist/legacy/BreadCrumb/BreadCrumb.js +31 -19
  29. package/dist/legacy/BreadCrumb/BreadCrumb.js.map +1 -1
  30. package/dist/legacy/BreadCrumb/styles.js +3 -0
  31. package/dist/legacy/BreadCrumb/styles.js.map +1 -1
  32. package/dist/legacy/BreadCrumb/utils.js +2 -6
  33. package/dist/legacy/BreadCrumb/utils.js.map +1 -1
  34. package/dist/legacy/Dialog/Dialog.d.ts +1 -1
  35. package/dist/legacy/Dialog/Dialog.js +16 -18
  36. package/dist/legacy/Dialog/Dialog.js.map +1 -1
  37. package/dist/legacy/Dialog/DialogActions/DialogActions.js.map +1 -1
  38. package/dist/legacy/Dialog/DialogActions/styles.js +2 -9
  39. package/dist/legacy/Dialog/DialogActions/styles.js.map +1 -1
  40. package/dist/legacy/Dialog/DialogContent/DialogContent.js +19 -5
  41. package/dist/legacy/Dialog/DialogContent/DialogContent.js.map +1 -1
  42. package/dist/legacy/Dialog/DialogContent/styles.js +2 -3
  43. package/dist/legacy/Dialog/DialogContent/styles.js.map +1 -1
  44. package/dist/legacy/Dialog/DialogTitle/DialogTitle.js +1 -6
  45. package/dist/legacy/Dialog/DialogTitle/DialogTitle.js.map +1 -1
  46. package/dist/legacy/Dialog/DialogTitle/styles.js +1 -4
  47. package/dist/legacy/Dialog/DialogTitle/styles.js.map +1 -1
  48. package/dist/legacy/Dialog/styles.js +10 -6
  49. package/dist/legacy/Dialog/styles.js.map +1 -1
  50. package/dist/legacy/Dropdown/Dropdown.d.ts +4 -0
  51. package/dist/legacy/Dropdown/Dropdown.js +7 -1
  52. package/dist/legacy/Dropdown/Dropdown.js.map +1 -1
  53. package/dist/legacy/Dropdown/List/List.js +9 -4
  54. package/dist/legacy/Dropdown/List/List.js.map +1 -1
  55. package/dist/modern/BreadCrumb/BreadCrumb.js +12 -7
  56. package/dist/modern/BreadCrumb/BreadCrumb.js.map +1 -1
  57. package/dist/modern/BreadCrumb/styles.js +3 -0
  58. package/dist/modern/BreadCrumb/styles.js.map +1 -1
  59. package/dist/modern/BreadCrumb/utils.js +2 -2
  60. package/dist/modern/BreadCrumb/utils.js.map +1 -1
  61. package/dist/modern/Dialog/Dialog.d.ts +1 -1
  62. package/dist/modern/Dialog/Dialog.js +9 -7
  63. package/dist/modern/Dialog/Dialog.js.map +1 -1
  64. package/dist/modern/Dialog/DialogActions/DialogActions.js.map +1 -1
  65. package/dist/modern/Dialog/DialogActions/styles.js +2 -9
  66. package/dist/modern/Dialog/DialogActions/styles.js.map +1 -1
  67. package/dist/modern/Dialog/DialogContent/DialogContent.js +18 -10
  68. package/dist/modern/Dialog/DialogContent/DialogContent.js.map +1 -1
  69. package/dist/modern/Dialog/DialogContent/styles.js +2 -3
  70. package/dist/modern/Dialog/DialogContent/styles.js.map +1 -1
  71. package/dist/modern/Dialog/DialogTitle/DialogTitle.js +1 -8
  72. package/dist/modern/Dialog/DialogTitle/DialogTitle.js.map +1 -1
  73. package/dist/modern/Dialog/DialogTitle/styles.js +1 -4
  74. package/dist/modern/Dialog/DialogTitle/styles.js.map +1 -1
  75. package/dist/modern/Dialog/styles.js +10 -6
  76. package/dist/modern/Dialog/styles.js.map +1 -1
  77. package/dist/modern/Dropdown/Dropdown.d.ts +4 -0
  78. package/dist/modern/Dropdown/Dropdown.js +7 -1
  79. package/dist/modern/Dropdown/Dropdown.js.map +1 -1
  80. package/dist/modern/Dropdown/List/List.js +9 -4
  81. package/dist/modern/Dropdown/List/List.js.map +1 -1
  82. package/package.json +3 -3
@@ -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,iBAAiB,CAAC,GAAG3B,QAAQ,CAAC,IAAI,CAAC;;EAE1D;EACA;EACA;EACA,MAAM4B,YAAY,GAAG,CAACC,KAAK,EAAEC,MAAM,EAAEC,gBAAgB,GAAG,KAAK,KAAK;IAChE,IAAIA,gBAAgB,EAA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C/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 */\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;A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EAAA,GACF;AAEb,CAAC;AAED,wCAAAJ,QAAQ,CAAC8C,SAAS,GAAG;EACnB;AACF;AACA;EACE5C,SAAS,EAAEd,SAAS,CAAC2D,MAAM;EAC3B;AACF;AACA;EACE5C,EAAE,EAAEf,SAAS,CAAC2D,MAAM;EACpB;AACF;AACA;EACE9C,OAAO,EAAEb,SAAS,CAAC4D,KAAK,CAAC;IACvB;AACJ;AACA;IACIP,IAAI,EAAErD,SAAS,CAAC2D,MAAM;IACtB;AACJ;AACA;IACIJ,UAAU,EAAEvD,SAAS,CAAC2D,MAAM;IAC5B;AACJ;AACA;IACIL,KAAK,EAAEtD,SAAS,CAAC2D,MAAM;IACvB;AACJ;AACA;IACItC,UAAU,EAAErB,SAAS,CAAC2D,MAAM;IAC5B;AACJ;AACA;IACIH,WAAW,EAAExD,SAAS,CAAC2D;EACzB,CAAC,CAAC,CAACE,UAAU;EACb;AACF;AACA;EACE7C,QAAQ,EAAEhB,SAAS,CAAC+B,IAAI,CAAC8B,UAAU;EACnC;AACF;AACA;EACE5C,IAAI,EAAEjB,SAAS,CAAC8D,IAAI,CAACD,UAAU;EAC/B;AACF;AACA;EACE3C,OAAO,EAAElB,SAAS,CAAC+D,IAAI;EACvB;AACF;AACA;EACE5C,cAAc,EAAEnB,SAAS,CAAC2D,MAAM;EAChC;AACF;AACA;EACEvC,WAAW,EAAEpB,SAAS,CAAC2D,MAAM;EAC7B;AACF;AACA;EACEtC,UAAU,EAAErB,SAAS,CAAC8D,IAAI;EAC1B;AACF;AACA;EACExC,oBAAoB,EAAEtB,SAAS,CAAC8D;AAClC,CAAC;AAED,eAAe5D,UAAU,CAACO,MAAM,EAAE;EAAEuD,IAAI,EAAE;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, fullscreen && classes.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,EAAEF,UAAU,IAAIH,OAAO,CAACG,UAAU,CAAC;MAC1DG,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"}
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","height","flex","marginLeft","xs","fullscreen","position","width","bottom","left"],"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 height: 100,\n flex: 1,\n },\n spacing: {\n \"& > :not(:first-child)\": {\n marginLeft: theme.hv.spacing.xs,\n },\n },\n fullscreen: {\n position: \"fixed\",\n width: \"100%\",\n bottom: 0,\n left: 0,\n },\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,EAAC;IAC3DC,MAAM,EAAE,GAAG;IACXC,IAAI,EAAE;EACR,CAAC;EACDP,OAAO,EAAE;IACP,wBAAwB,EAAE;MACxBQ,UAAU,EAAEb,KAAK,CAACI,EAAE,CAACC,OAAO,CAACS;IAC/B;EACF,CAAC;EACDC,UAAU,EAAE;IACVC,QAAQ,EAAE,OAAO;IACjBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,eAAepB,MAAM"}
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
- classes,
11
- className,
12
- children,
13
- indentContent = false
14
- }) => {
15
- return /*#__PURE__*/_jsx(HvTypography, {
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 a string.
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 a string.\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,CAAC;EAAEC,OAAO;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,aAAa,GAAG;AAAM,CAAC,KAAK;EACnF,oBACE,KAAC,YAAY;IACX,SAAS,EAAET,aAAc;IACzB,SAAS,EAAEE,IAAI,CAACK,SAAS,EAAED,OAAO,CAACI,IAAI,EAA2BD,aAAa,IAAnCH,OAAO,CAACK,WAAW,CAAoB;IAAA,UAElFH;EAAQ,EACI;AAEnB,CAAC;AAED,wCAAAH,eAAe,CAACO,SAAS,GAAG;EAC1B;AACF;AACA;EACEL,SAAS,EAAER,SAAS,CAACc,MAAM;EAC3B;AACF;AACA;EACEP,OAAO,EAAEP,SAAS,CAACe,KAAK,CAAC;IACvB;AACJ;AACA;IACIJ,IAAI,EAAEX,SAAS,CAACc,MAAM;IACtB;AACJ;AACA;IACIF,WAAW,EAAEZ,SAAS,CAACc;EACzB,CAAC,CAAC,CAACE,UAAU;EACb;AACF;AACA;EACEN,aAAa,EAAEV,SAAS,CAACiB,IAAI;EAC7B;AACF;AACA;EACER,QAAQ,EAAET,SAAS,CAACkB,IAAI,CAACF;AAC3B,CAAC;AAED,eAAed,UAAU,CAACG,MAAM,EAAE;EAAEc,IAAI,EAAE;AAAkB,CAAC,CAAC,CAACb,eAAe,CAAC"}
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,11 +1,10 @@
1
1
  const styles = theme => ({
2
2
  root: {
3
3
  padding: theme.hvSpacing(0, "sm", "sm", "sm"),
4
- flex: "none"
4
+ flex: 1
5
5
  },
6
6
  textContent: {
7
- marginLeft: "42px",
8
- paddingRight: "62px",
7
+ margin: "0 42px",
9
8
  flex: 1,
10
9
  overflowY: "auto"
11
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","flex","textContent","marginLeft","paddingRight","overflowY"],"sources":["../../../../src/Dialog/DialogContent/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hvSpacing(0, \"sm\", \"sm\", \"sm\"),\n flex: \"none\",\n },\n textContent: {\n marginLeft: \"42px\",\n paddingRight: \"62px\",\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,UAAU,EAAE,MAAM;IAClBC,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE,CAAC;IACPI,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAeT,MAAM"}
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, fullscreen && "fullscreen")
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","fullscreen","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 const { fullscreen } = others;\n\n // prevent the `fullscreen` prop from being passed to the `DialogTitle` component\n // eslint-disable-next-line no-param-reassign\n delete others.fullscreen;\n\n const icon = customIcon || (showIcon && iconVariant(variant));\n\n return (\n <DialogTitle\n className={clsx(classes.root, className, fullscreen ? \"fullscreen\" : \"\")}\n {...others}\n >\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,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ER,SAAS,CAACuB,KAAK,CAAC;IACvB;AACJ;AACA;IACIL,IAAI,EAAElB,SAAS,CAACsB,MAAM;IACtB;AACJ;AACA;IACIH,gBAAgB,EAAEnB,SAAS,CAACsB,MAAM;IAClC;AACJ;AACA;IACIF,YAAY,EAAEpB,SAAS,CAACsB,MAAM;IAC9B;AACJ;AACA;IACIL,IAAI,EAAEjB,SAAS,CAACsB,MAAM;IACtB;AACJ;AACA;IACIE,WAAW,EAAExB,SAAS,CAACsB;EACzB,CAAC,CAAC,CAACG,UAAU;EACb;AACF;AACA;EACEd,OAAO,EAAEX,SAAS,CAAC0B,KAAK,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;EAC5E;AACF;AACA;EACEd,QAAQ,EAAEZ,SAAS,CAAC2B,IAAI;EACxB;AACF;AACA;EACEd,UAAU,EAAEb,SAAS,CAAC4B,IAAI;EAC1B;AACF;AACA;EACElB,QAAQ,EAAEV,SAAS,CAAC4B,IAAI,CAACH;AAC3B,CAAC;AAED,eAAetB,UAAU,CAACG,MAAM,EAAE;EAAEuB,IAAI,EAAE;AAAgB,CAAC,CAAC,CAACtB,aAAa,CAAC"}
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,WAAW,QAAQ,eAAe;AAC3C,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,MAAM,MAAM,UAAU;AAAC;AAAA;AAE9B,MAAMC,aAAa,GAAG,QAQhB;EAAA,IARiB;MACrBC,OAAO;MACPC,SAAS;MACTC,QAAQ;MACRC,O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AC5E;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,10 +1,7 @@
1
1
  const styles = theme => ({
2
2
  root: {
3
3
  padding: theme.hvSpacing("sm"),
4
- margin: 0,
5
- "&:not(.fullscreen)": {
6
- flex: 1
7
- }
4
+ margin: 0
8
5
  },
9
6
  messageContainer: {
10
7
  display: "flex",
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","margin","flex","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 \"&:not(.fullscreen)\": {\n flex: 1,\n },\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,CAAC;IACT,oBAAoB,EAAE;MACpBC,IAAI,EAAE;IACR;EACF,CAAC;EACDC,gBAAgB,EAAE;IAChBC,OAAO,EAAE,MAAM;IACfC,UAAU,EAAE;EACd,CAAC;EACDC,YAAY,EAAE;IACZC,UAAU,EAAEV,KAAK,CAACG,SAAS,CAAC,IAAI,CAAC;IACjC;IACAQ,WAAW,EAAG,eAAcX,KAAK,CAACG,SAAS,CAAC,IAAI,CAAE;EACpD,CAAC;EACDS,IAAI,EAAE;IACJD,WAAW,EAAEX,KAAK,CAACa,EAAE,CAACC,OAAO,CAACC,EAAE;IAChCC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAelB,MAAM"}
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: `${theme.hv.palette.atmosphere.atmo1}`,
8
- padding: "0px",
7
+ background: theme.hv.palette.atmosphere.atmo1,
8
+ padding: 0,
9
9
  overflow: "auto",
10
10
  boxShadow: theme.hv.shadows[1],
11
- "&:not(.fullscreen)": {
12
- maxHeight: "calc(100% - 200px)",
13
- display: "flex",
14
- flexDirection: "column"
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","display","flexDirection","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: \"0px\",\n overflow: \"auto\",\n boxShadow: theme.hv.shadows[1],\n \"&:not(.fullscreen)\": {\n maxHeight: \"calc(100% - 200px)\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n },\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,EAAG,GAAED,KAAK,CAACE,EAAE,CAACC,OAAO,CAACC,UAAU,CAACG,KAAM,EAAC;IAClDC,OAAO,EAAE,KAAK;IACdC,QAAQ,EAAE,MAAM;IAChBC,SAAS,EAAEV,KAAK,CAACE,EAAE,CAACS,OAAO,CAAC,CAAC,CAAC;IAC9B,oBAAoB,EAAE;MACpBC,SAAS,EAAE,oBAAoB;MAC/BC,OAAO,EAAE,MAAM;MACfC,aAAa,EAAE;IACjB;EACF,CAAC;EACDC,WAAW,EAAE;IACXP,OAAO,EAAE,CAAC;IACVQ,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAElB,KAAK,CAACmB,SAAS,CAAC,IAAI,CAAC;IAC1BC,KAAK,EAAEpB,KAAK,CAACmB,SAAS,CAAC,IAAI;EAC7B;AACF,CAAC,CAAC;AAEF,eAAepB,MAAM"}
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
  */
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- const _excluded = ["classes", "className", "id", "name", "required", "disabled", "readOnly", "label", "aria-label", "aria-labelledby", "description", "aria-describedby", "placeholder", "onChange", "status", "statusMessage", "aria-errormessage", "onCancel", "onToggle", "onClickOutside", "onFocus", "onBlur", "values", "multiSelect", "showSearch", "expanded", "defaultExpanded", "notifyChangesOnFirstRender", "labels", "hasTooltips", "disablePortal", "singleSelectionToggle", "placement", "variableWidth", "popperProps", "height", "virtualized", "baseDropdownProps", "listProps"];
3
+ const _excluded = ["classes", "className", "id", "name", "required", "disabled", "readOnly", "label", "aria-label", "aria-labelledby", "description", "aria-describedby", "placeholder", "onChange", "status", "statusMessage", "aria-errormessage", "onCancel", "onToggle", "onClickOutside", "onFocus", "onBlur", "values", "multiSelect", "showSearch", "expanded", "defaultExpanded", "notifyChangesOnFirstRender", "labels", "hasTooltips", "disablePortal", "singleSelectionToggle", "placement", "variableWidth", "popperProps", "height", "maxHeight", "virtualized", "baseDropdownProps", "listProps"];
4
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
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; }
6
6
  import React, { useEffect, useRef, useState } from "react";
@@ -65,6 +65,7 @@ const HvDropdown = props => {
65
65
  variableWidth = false,
66
66
  popperProps = {},
67
67
  height,
68
+ maxHeight,
68
69
  virtualized = false,
69
70
  baseDropdownProps = {},
70
71
  listProps = {}
@@ -271,6 +272,7 @@ const HvDropdown = props => {
271
272
  singleSelectionToggle: singleSelectionToggle,
272
273
  "aria-labelledby": hasLabel ? setId(elementId, "label") : undefined,
273
274
  height: height,
275
+ maxHeight: maxHeight,
274
276
  virtualized: virtualized
275
277
  }, listProps))
276
278
  })), canShowError && /*#__PURE__*/_jsx(HvWarningText, {
@@ -533,6 +535,10 @@ process.env.NODE_ENV !== "production" ? HvDropdown.propTypes = {
533
535
  * 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
534
536
  */
535
537
  height: PropTypes.number,
538
+ /**
539
+ * Experimental. Max height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class.
540
+ */
541
+ maxHeight: PropTypes.number,
536
542
  /**
537
543
  * Experimental. Uses dropdown in a virtualized form, where not all options are rendered initially. Good for use cases with a lot of options.
538
544
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","names":["React","useEffect","useRef","useState","PropTypes","clsx","withStyles","setId","useLabels","HvBaseDropdown","HvFormElement","HvLabel","HvInfoMessage","HvWarningText","HvTypography","useUniqueId","useControlled","isInvalid","List","getSelected","getSelectionLabel","styles","DEFAULT_LABELS","select","undefined","selectAll","cancelLabel","applyLabel","searchPlaceholder","multiSelectionConjunction","HvDropdown","props","classes","className","id","name","required","disabled","readOnly","label","ariaLabel","ariaLabelledBy","description","ariaDescribedBy","placeholder","onChange","status","statusMessage","ariaErrorMessage","onCancel","onToggle","onClickOutside","onFocus","onBlur","values","multiSelect","showSearch","expanded","defaultExpanded","notifyChangesOnFirstRender","labels","labelsProp","hasTooltips","disablePortal","singleSelectionToggle","placement","variableWidth","popperProps","height","virtualized","baseDropdownProps","listProps","others","elementId","validationState","setValidationState","validationMessage","isOpen","setIsOpen","Boolean","selectionLabel","setSelectionLabel","internalValues","setInternalValues","process","env","NODE_ENV","console","error","dropdownHeaderRef","handleToggle","_e","open","hasSelection","length","handleSelection","listValues","commitChanges","toggle","notifyChanges","selected","current","focus","preventScroll","handleCancel","evt","handleClickOutside","setFocusToContent","containerRef","inputs","getElementsByTagName","listItems","every","listItem","tabIndex","buildHeaderLabel","selectionDisabled","total","hasLabel","hasDescription","canShowError","isStateInvalid","errorMessageId","root","labelContainer","dropdown","arrow","header","dropdownHeader","dropdownHeaderInvalid","headerOpen","dropdownHeaderOpen","join","trim","rootList","dropdownListContainer","propTypes","string","shape","isRequired","node","bool","oneOf","func","arrayOf","oneOfType","number","searchValue","value","any","object"],"sources":["../../../src/Dropdown/Dropdown.js"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@mui/styles\";\nimport { setId, useLabels } from \"../utils\";\nimport {\n HvBaseDropdown,\n HvFormElement,\n HvLabel,\n HvInfoMessage,\n HvWarningText,\n HvTypography,\n useUniqueId,\n useControlled,\n} from \"..\";\nimport { isInvalid } from \"../Forms/FormElement/validationStates\";\nimport List from \"./List\";\nimport { getSelected, getSelectionLabel } from \"./utils\";\nimport styles from \"./styles\";\n\nconst DEFAULT_LABELS = {\n select: undefined,\n selectAll: \"All\",\n cancelLabel: \"Cancel\",\n applyLabel: \"Apply\",\n searchPlaceholder: \"Search\",\n multiSelectionConjunction: \"/\",\n};\n\n/**\n * A dropdown list is a graphical control element, similar to a list box, that allows the user to choose one value from a list.\n */\nconst HvDropdown = (props) => {\n const {\n classes,\n className,\n\n id,\n name,\n\n required = false,\n disabled = false,\n readOnly = false,\n\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n description,\n \"aria-describedby\": ariaDescribedBy,\n\n placeholder = \"Select...\",\n\n onChange,\n\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n\n onCancel,\n onToggle,\n onClickOutside,\n\n onFocus,\n onBlur,\n\n values,\n multiSelect = false,\n showSearch = false,\n expanded,\n defaultExpanded = false,\n notifyChangesOnFirstRender = false,\n labels: labelsProp,\n hasTooltips = false,\n disablePortal = false,\n singleSelectionToggle = true,\n placement,\n variableWidth = false,\n popperProps = {},\n height,\n virtualized = false,\n baseDropdownProps = {},\n listProps = {},\n ...others\n } = props;\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n\n const elementId = useUniqueId(id, \"hvdropdown\");\n\n const [validationState, setValidationState] = useControlled(status, \"standBy\");\n\n const [validationMessage] = useControlled(statusMessage, \"Required\");\n\n const [isOpen, setIsOpen] = useControlled(expanded, Boolean(defaultExpanded));\n const [selectionLabel, setSelectionLabel] = useState(\n getSelectionLabel(values, labels, placeholder, multiSelect)\n );\n const [internalValues, setInternalValues] = useState(values);\n\n useEffect(() => {\n setInternalValues(values);\n }, [values]);\n\n useEffect(() => {\n setSelectionLabel(getSelectionLabel(values, labels, placeholder, multiSelect));\n }, [labels, multiSelect, placeholder, values]);\n\n if (virtualized && !height && process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.error(\"Dropdown/List in virtualized mode requires a height. Please define it.\");\n }\n\n const dropdownHeaderRef = useRef();\n\n const handleToggle = (_e, open) => {\n onToggle?.(_e, open);\n\n setIsOpen(open);\n\n if (!open) {\n // also run built-in validation when closing without changes\n // as the user \"touched\" the input\n setValidationState(() => {\n // this will only run if status is uncontrolled\n if (required) {\n const hasSelection = getSelected(internalValues).length > 0;\n\n if (!hasSelection) {\n return \"invalid\";\n }\n }\n\n return \"valid\";\n });\n }\n };\n\n /**\n * Applies the selected values to the state\n *\n * @param {Array} listValues - An array containing the selected values.\n * @param {Boolean} commitChanges - If `true` the selection if finally committed the dropdown header text should reflect the new selection\n * @param {Boolean} toggle -If `true` the dropdown should toggle it's current state\n * @param {Boolean} notifyChanges -If `true` the dropdown will call onChange.\n */\n const handleSelection = (listValues, commitChanges, toggle, notifyChanges = true) => {\n const selected = getSelected(listValues);\n if (commitChanges) {\n setInternalValues(listValues);\n setSelectionLabel(getSelectionLabel(listValues, labels, placeholder, multiSelect));\n\n setValidationState(() => {\n // this will only run if status is uncontrolled\n if (required && selected.length === 0) {\n return \"invalid\";\n }\n\n return \"valid\";\n });\n }\n if (notifyChanges) onChange?.(multiSelect ? selected : selected[0]);\n if (toggle) {\n handleToggle(undefined, false);\n\n // focus-ring won't be visible even if using the keyboard:\n // https://github.com/WICG/focus-visible/issues/88\n dropdownHeaderRef.current?.focus({ preventScroll: true });\n }\n };\n\n /**\n * Handles the `Cancel` action. Both single and ranged modes are handled here.\n */\n const handleCancel = (evt) => {\n onCancel?.(evt);\n\n handleToggle(evt, false);\n\n // focus-ring won't be visible even if using the keyboard:\n // https://github.com/WICG/focus-visible/issues/88\n dropdownHeaderRef.current?.focus({ preventScroll: true });\n };\n\n const handleClickOutside = (evt) => {\n onClickOutside?.(evt);\n onCancel?.(evt);\n };\n\n const setFocusToContent = (containerRef) => {\n const inputs = containerRef?.getElementsByTagName(\"input\");\n if (inputs?.length > 0) {\n inputs[0].focus();\n return;\n }\n const listItems = containerRef != null ? [...containerRef.getElementsByTagName(\"li\")] : [];\n listItems.every((listItem) => {\n if (listItem.tabIndex >= 0) {\n listItem.focus();\n return false;\n }\n return true;\n });\n };\n\n const buildHeaderLabel = () => {\n const hasSelection = getSelected(internalValues).length > 0;\n return labels.select || !multiSelect ? (\n <HvTypography\n component=\"div\"\n noWrap\n variant={isOpen || hasSelection ? \"normalText\" : \"placeholderText\"}\n className={clsx(classes.placeholder, {\n [classes.selectionDisabled]: disabled,\n })}\n >\n {selectionLabel.selected}\n </HvTypography>\n ) : (\n <HvTypography\n component=\"div\"\n noWrap\n className={clsx(classes.placeholder, {\n [classes.selectionDisabled]: disabled,\n })}\n variant=\"normalText\"\n >\n <b>{selectionLabel.selected}</b>\n {` ${labels.multiSelectionConjunction} ${selectionLabel.total}`}\n </HvTypography>\n );\n };\n\n const hasLabel = label != null;\n const hasDescription = description != null;\n\n // the error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and required is true\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) || (status === undefined && required));\n\n const isStateInvalid = isInvalid(validationState);\n\n let errorMessageId;\n if (isStateInvalid) {\n errorMessageId = canShowError ? setId(elementId, \"error\") : ariaErrorMessage;\n }\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n className={clsx(className, classes.root)}\n {...others}\n >\n {(hasLabel || hasDescription) && (\n <div className={classes.labelContainer}>\n {hasLabel && (\n <HvLabel id={setId(elementId, \"label\")} label={label} className={classes.label} />\n )}\n\n {hasDescription && (\n <HvInfoMessage id={setId(elementId, \"description\")} className={classes.description}>\n {description}\n </HvInfoMessage>\n )}\n </div>\n )}\n <HvBaseDropdown\n id={setId(id, \"dropdown\")}\n classes={{\n root: classes.dropdown,\n arrow: classes.arrow,\n header: clsx(\n classes.dropdownHeader,\n isStateInvalid ? classes.dropdownHeaderInvalid : undefined\n ),\n headerOpen: classes.dropdownHeaderOpen,\n }}\n expanded={isOpen}\n disabled={disabled}\n readOnly={readOnly}\n disablePortal={disablePortal}\n placement={placement}\n popperProps={popperProps}\n placeholder={buildHeaderLabel()}\n onToggle={handleToggle}\n onClickOutside={handleClickOutside}\n onContainerCreation={setFocusToContent}\n role=\"combobox\"\n variableWidth={variableWidth}\n aria-label={ariaLabel}\n aria-labelledby={\n [label && setId(elementId, \"label\"), ariaLabelledBy].join(\" \").trim() || undefined\n }\n aria-invalid={isStateInvalid ? true : undefined}\n aria-errormessage={errorMessageId}\n aria-describedby={\n [description && setId(elementId, \"description\"), ariaDescribedBy].join(\" \").trim() ||\n undefined\n }\n onFocus={onFocus}\n onBlur={onBlur}\n dropdownHeaderRef={dropdownHeaderRef}\n {...baseDropdownProps}\n >\n <List\n id={setId(elementId, \"values\")}\n classes={{\n rootList: classes.rootList,\n dropdownListContainer: classes.dropdownListContainer,\n }}\n values={internalValues}\n multiSelect={multiSelect}\n showSearch={showSearch}\n onChange={handleSelection}\n onCancel={handleCancel}\n labels={labels}\n notifyChangesOnFirstRender={notifyChangesOnFirstRender}\n hasTooltips={hasTooltips}\n singleSelectionToggle={singleSelectionToggle}\n aria-labelledby={hasLabel ? setId(elementId, \"label\") : undefined}\n height={height}\n virtualized={virtualized}\n {...listProps}\n />\n </HvBaseDropdown>\n {canShowError && (\n <HvWarningText id={setId(elementId, \"error\")} disableBorder className={classes.error}>\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n};\n\nHvDropdown.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the component styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n\n /**\n * Styles applied to the container of the labels elements.\n */\n labelContainer: PropTypes.string,\n /**\n * Styles applied to the label element.\n */\n label: PropTypes.string,\n /**\n * Styles applied to the icon information text.\n */\n description: PropTypes.string,\n\n /**\n * Styles applied to the error area.\n */\n error: PropTypes.string,\n\n /**\n * Styles applied to the dropdown.\n */\n dropdown: PropTypes.string,\n\n /**\n * Styles applied to the arrow\n */\n arrow: PropTypes.string,\n /**\n * Styles applied for truncating the list elements.\n */\n placeholder: PropTypes.string,\n /**\n * Styles applied when the selection is disabled.\n */\n selectionDisabled: PropTypes.string,\n /**\n * Styles applied to the list.\n */\n rootList: PropTypes.string,\n /**\n * Styles applied to the dropdown header.\n */\n dropdownHeader: PropTypes.string,\n /**\n * Styles applied to the dropdown is invalid.\n */\n dropdownHeaderInvalid: PropTypes.string,\n /**\n * Styles applied to the dropdown is opened.\n */\n dropdownHeaderOpen: PropTypes.string,\n /**\n * Styles applied to the dropdown list.\n */\n dropdownListContainer: PropTypes.string,\n }).isRequired,\n\n /**\n * Id to be applied to the form element root node.\n */\n id: PropTypes.string,\n\n /**\n * The form element name.\n */\n name: PropTypes.string,\n\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be provided instead.\n */\n label: PropTypes.node,\n /**\n * @ignore\n */\n \"aria-label\": PropTypes.string,\n /**\n * @ignore\n */\n \"aria-labelledby\": PropTypes.string,\n /**\n * Provide additional descriptive text for the form element.\n */\n description: PropTypes.node,\n /**\n * @ignore\n */\n \"aria-describedby\": PropTypes.string,\n\n /**\n * The placeholder value when nothing is selected.\n */\n placeholder: PropTypes.string,\n\n /**\n * Indicates that the form element is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * Indicates that the form element is in read only mode.\n */\n readOnly: PropTypes.bool,\n /**\n * Indicates that user input is required on the form element.\n */\n required: PropTypes.bool,\n\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to the state.\n */\n status: PropTypes.oneOf([\"standBy\", \"valid\", \"invalid\"]),\n /**\n * The error message to show when the validation status is \"invalid\".\n *\n * Defaults to \"Required\" when the status is uncontrolled and no `aria-errormessage` is provided.\n */\n statusMessage: PropTypes.node,\n /**\n * Identifies the element that provides an error message for the dropdown.\n *\n * Will only be used when the validation status is invalid.\n */\n \"aria-errormessage\": PropTypes.string,\n\n /**\n * The callback fired when the value changes.\n */\n onChange: PropTypes.func,\n\n /**\n * The list to be rendered by the dropdown.\n */\n values: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n label: PropTypes.node.isRequired,\n searchValue: PropTypes.string,\n value: PropTypes.any,\n selected: PropTypes.bool,\n })\n ),\n /**\n * If `true` the dropdown is multiSelect, if `false` the dropdown is single select.\n */\n multiSelect: PropTypes.bool,\n /**\n * If `true` the dropdown is rendered with a search bar, if `false` there won't be a search bar.\n */\n showSearch: PropTypes.bool,\n /**\n * If `true` the dropdown starts opened if `false` it starts closed.\n */\n expanded: PropTypes.bool,\n /**\n * When uncontrolled, defines the initial expanded state.\n */\n defaultExpanded: PropTypes.bool,\n /**\n * If 'true' the dropdown will notify on the first render.\n */\n notifyChangesOnFirstRender: PropTypes.bool,\n /**\n * An object containing all the labels for the dropdown.\n */\n labels: PropTypes.shape({\n /**\n * Label for overwrite the default header behaviour.\n */\n select: PropTypes.string,\n /**\n * Label used for the All checkbox action.\n */\n selectAll: PropTypes.string,\n /**\n * Cancel button label.\n */\n cancelLabel: PropTypes.string,\n /**\n * Apply button label.\n */\n applyLabel: PropTypes.string,\n /**\n * The label used in the middle of the multiSelection count.\n */\n multiSelectionConjunction: PropTypes.string,\n }),\n /**\n * If `true` the dropdown will show tooltips when user mouseenter text in list\n */\n hasTooltips: PropTypes.bool,\n /**\n * Disable the portal behavior.\n * The children stay within it's parent DOM hierarchy.\n */\n disablePortal: PropTypes.bool,\n /**\n * If `true` the dropdown width depends size of content if `false` the width depends on the header size.\n * Defaults to `false`.\n */\n variableWidth: PropTypes.bool,\n /**\n * If `true`, selection can be toggled when single selection.\n */\n singleSelectionToggle: PropTypes.bool,\n /**\n * Placement of the dropdown.\n */\n placement: PropTypes.oneOf([\"left\", \"right\"]),\n /**\n * An object containing props to be wired to the popper component.\n */\n popperProps: PropTypes.shape(),\n\n /**\n * Callback called when the user cancels the changes.\n *\n * Called when the cancel button is used and when the user clicks outside the open container.\n *\n * @param {object} event The event source of the callback.\n */\n onCancel: PropTypes.func,\n /**\n * Callback called when dropdown changes the expanded state.\n *\n * @param {object} event The event source of the callback.\n * @param {boolean} open If the dropdown new state is open (`true`) or closed (`false`).\n */\n onToggle: PropTypes.func,\n /**\n * Callback called when the user clicks outside the open container.\n *\n * @param {object} event The event source of the callback.\n */\n onClickOutside: PropTypes.func,\n\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n\n /**\n * 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\n */\n height: PropTypes.number,\n /**\n * Experimental. Uses dropdown in a virtualized form, where not all options are rendered initially. Good for use cases with a lot of options.\n */\n virtualized: PropTypes.bool,\n /**\n * Extra props passed to the dropdown.\n */\n baseDropdownProps: PropTypes.object,\n /**\n * Extra props passed to the list.\n */\n listProps: PropTypes.object,\n};\n\nexport default withStyles(styles, { name: \"HvDropdown\" })(HvDropdown);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,KAAK,EAAEC,SAAS,QAAQ,UAAU;AAC3C,SACEC,cAAc,EACdC,aAAa,EACbC,OAAO,EACPC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,aAAa,QACR,IAAI;AACX,SAASC,SAAS,QAAQ,uCAAuC;AACjE,OAAOC,IAAI,MAAM,QAAQ;AACzB,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,SAAS;AACxD,OAAOC,MAAM,MAAM,UAAU;AAAC;AAAA;AAE9B,MAAMC,cAAc,GAAG;EACrBC,MAAM,EAAEC,SAAS;EACjBC,SAAS,EAAE,KAAK;EAChBC,WAAW,EAAE,QAAQ;EACrBC,UAAU,EAAE,OAAO;EACnBC,iBAAiB,EAAE,QAAQ;EAC3BC,yBAAyB,EAAE;AAC7B,CAAC;;AAED;AACA;AACA;AACA,MAAMC,UAAU,GAAIC,KAAK,IAAK;EAC5B,MAAM;MACJC,OAAO;MACPC,SAAS;MAETC,EAAE;MACFC,IAAI;MAEJC,QAAQ,GAAG,KAAK;MAChBC,QAAQ,GAAG,KAAK;MAChBC,QAAQ,GAAG,KAAK;MAEhBC,KAAK;MACL,YAAY,EAAEC,SAAS;MACvB,i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CAAC;EACF;AACF;AACA;EACE3E,WAAW,EAAE1D,SAAS,CAACyI,IAAI;EAC3B;AACF;AACA;AACA;EACE9E,aAAa,EAAE3D,SAAS,CAACyI,IAAI;EAC7B;AACF;AACA;AACA;EACE3E,aAAa,EAAE9D,SAAS,CAACyI,IAAI;EAC7B;AACF;AACA;EACE7E,qBAAqB,EAAE5D,SAAS,CAACyI,IAAI;EACrC;AACF;AACA;EACE5E,SAAS,EAAE7D,SAAS,CAAC0I,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;EAC7C;AACF;AACA;EACE3E,WAAW,EAAE/D,SAAS,CAACsI,KAAK,EAAE;EAE9B;AACF;AACA;AACA;AACA;AACA;AACA;EACEzF,QAAQ,EAAE7C,SAAS,CAAC2I,IAAI;EACxB;AACF;AACA;AACA;AACA;AACA;EACE7F,QAAQ,EAAE9C,SAAS,CAAC2I,IAAI;EACxB;AACF;AACA;AACA;AACA;EACE5F,cAAc,EAAE/C,SAAS,CAAC2I,IAAI;EAE9B;AACF;AACA;EACE3F,OAAO,EAAEhD,SAAS,CAAC2I,IAAI;EACvB;AACF;AACA;EACE1F,MAAM,EAAEjD,SAAS,CAAC2I,IAAI;EAEtB;AACF;AACA;EACE3E,MAAM,EAAEhE,SAAS,CAAC8I,MAAM;EACxB;AACF;AACA;EACE7E,WAAW,EAAEjE,SAAS,CAACyI,IAAI;EAC3B;AACF;AACA;EACEvE,iBAAiB,EAAElE,SAAS,CAACkJ,MAAM;EACnC;AACF;AACA;EACE/E,SAAS,EAAEnE,SAAS,CAACkJ;AACvB,CAAC;AAED,eAAehJ,UAAU,CAACe,MAAM,EAAE;EAAEc,IAAI,EAAE;AAAa,CAAC,CAAC,CAACL,UAAU,CAAC"}
1
+ {"version":3,"file":"Dropdown.js","names":["React","useEffect","useRef","useState","PropTypes","clsx","withStyles","setId","useLabels","HvBaseDropdown","HvFormElement","HvLabel","HvInfoMessage","HvWarningText","HvTypography","useUniqueId","useControlled","isInvalid","List","getSelected","getSelectionLabel","styles","DEFAULT_LABELS","select","undefined","selectAll","cancelLabel","applyLabel","searchPlaceholder","multiSelectionConjunction","HvDropdown","props","classes","className","id","name","required","disabled","readOnly","label","ariaLabel","ariaLabelledBy","description","ariaDescribedBy","placeholder","onChange","status","statusMessage","ariaErrorMessage","onCancel","onToggle","onClickOutside","onFocus","onBlur","values","multiSelect","showSearch","expanded","defaultExpanded","notifyChangesOnFirstRender","labels","labelsProp","hasTooltips","disablePortal","singleSelectionToggle","placement","variableWidth","popperProps","height","maxHeight","virtualized","baseDropdownProps","listProps","others","elementId","validationState","setValidationState","validationMessage","isOpen","setIsOpen","Boolean","selectionLabel","setSelectionLabel","internalValues","setInternalValues","process","env","NODE_ENV","console","error","dropdownHeaderRef","handleToggle","_e","open","hasSelection","length","handleSelection","listValues","commitChanges","toggle","notifyChanges","selected","current","focus","preventScroll","handleCancel","evt","handleClickOutside","setFocusToContent","containerRef","inputs","getElementsByTagName","listItems","every","listItem","tabIndex","buildHeaderLabel","selectionDisabled","total","hasLabel","hasDescription","canShowError","isStateInvalid","errorMessageId","root","labelContainer","dropdown","arrow","header","dropdownHeader","dropdownHeaderInvalid","headerOpen","dropdownHeaderOpen","join","trim","rootList","dropdownListContainer","propTypes","string","shape","isRequired","node","bool","oneOf","func","arrayOf","oneOfType","number","searchValue","value","any","object"],"sources":["../../../src/Dropdown/Dropdown.js"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@mui/styles\";\nimport { setId, useLabels } from \"../utils\";\nimport {\n HvBaseDropdown,\n HvFormElement,\n HvLabel,\n HvInfoMessage,\n HvWarningText,\n HvTypography,\n useUniqueId,\n useControlled,\n} from \"..\";\nimport { isInvalid } from \"../Forms/FormElement/validationStates\";\nimport List from \"./List\";\nimport { getSelected, getSelectionLabel } from \"./utils\";\nimport styles from \"./styles\";\n\nconst DEFAULT_LABELS = {\n select: undefined,\n selectAll: \"All\",\n cancelLabel: \"Cancel\",\n applyLabel: \"Apply\",\n searchPlaceholder: \"Search\",\n multiSelectionConjunction: \"/\",\n};\n\n/**\n * A dropdown list is a graphical control element, similar to a list box, that allows the user to choose one value from a list.\n */\nconst HvDropdown = (props) => {\n const {\n classes,\n className,\n\n id,\n name,\n\n required = false,\n disabled = false,\n readOnly = false,\n\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n description,\n \"aria-describedby\": ariaDescribedBy,\n\n placeholder = \"Select...\",\n\n onChange,\n\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n\n onCancel,\n onToggle,\n onClickOutside,\n\n onFocus,\n onBlur,\n\n values,\n multiSelect = false,\n showSearch = false,\n expanded,\n defaultExpanded = false,\n notifyChangesOnFirstRender = false,\n labels: labelsProp,\n hasTooltips = false,\n disablePortal = false,\n singleSelectionToggle = true,\n placement,\n variableWidth = false,\n popperProps = {},\n height,\n maxHeight,\n virtualized = false,\n baseDropdownProps = {},\n listProps = {},\n ...others\n } = props;\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n\n const elementId = useUniqueId(id, \"hvdropdown\");\n\n const [validationState, setValidationState] = useControlled(status, \"standBy\");\n\n const [validationMessage] = useControlled(statusMessage, \"Required\");\n\n const [isOpen, setIsOpen] = useControlled(expanded, Boolean(defaultExpanded));\n const [selectionLabel, setSelectionLabel] = useState(\n getSelectionLabel(values, labels, placeholder, multiSelect)\n );\n const [internalValues, setInternalValues] = useState(values);\n\n useEffect(() => {\n setInternalValues(values);\n }, [values]);\n\n useEffect(() => {\n setSelectionLabel(getSelectionLabel(values, labels, placeholder, multiSelect));\n }, [labels, multiSelect, placeholder, values]);\n\n if (virtualized && !height && process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.error(\"Dropdown/List in virtualized mode requires a height. Please define it.\");\n }\n\n const dropdownHeaderRef = useRef();\n\n const handleToggle = (_e, open) => {\n onToggle?.(_e, open);\n\n setIsOpen(open);\n\n if (!open) {\n // also run built-in validation when closing without changes\n // as the user \"touched\" the input\n setValidationState(() => {\n // this will only run if status is uncontrolled\n if (required) {\n const hasSelection = getSelected(internalValues).length > 0;\n\n if (!hasSelection) {\n return \"invalid\";\n }\n }\n\n return \"valid\";\n });\n }\n };\n\n /**\n * Applies the selected values to the state\n *\n * @param {Array} listValues - An array containing the selected values.\n * @param {Boolean} commitChanges - If `true` the selection if finally committed the dropdown header text should reflect the new selection\n * @param {Boolean} toggle -If `true` the dropdown should toggle it's current state\n * @param {Boolean} notifyChanges -If `true` the dropdown will call onChange.\n */\n const handleSelection = (listValues, commitChanges, toggle, notifyChanges = true) => {\n const selected = getSelected(listValues);\n if (commitChanges) {\n setInternalValues(listValues);\n setSelectionLabel(getSelectionLabel(listValues, labels, placeholder, multiSelect));\n\n setValidationState(() => {\n // this will only run if status is uncontrolled\n if (required && selected.length === 0) {\n return \"invalid\";\n }\n\n return \"valid\";\n });\n }\n if (notifyChanges) onChange?.(multiSelect ? selected : selected[0]);\n if (toggle) {\n handleToggle(undefined, false);\n\n // focus-ring won't be visible even if using the keyboard:\n // https://github.com/WICG/focus-visible/issues/88\n dropdownHeaderRef.current?.focus({ preventScroll: true });\n }\n };\n\n /**\n * Handles the `Cancel` action. Both single and ranged modes are handled here.\n */\n const handleCancel = (evt) => {\n onCancel?.(evt);\n\n handleToggle(evt, false);\n\n // focus-ring won't be visible even if using the keyboard:\n // https://github.com/WICG/focus-visible/issues/88\n dropdownHeaderRef.current?.focus({ preventScroll: true });\n };\n\n const handleClickOutside = (evt) => {\n onClickOutside?.(evt);\n onCancel?.(evt);\n };\n\n const setFocusToContent = (containerRef) => {\n const inputs = containerRef?.getElementsByTagName(\"input\");\n if (inputs?.length > 0) {\n inputs[0].focus();\n return;\n }\n const listItems = containerRef != null ? [...containerRef.getElementsByTagName(\"li\")] : [];\n listItems.every((listItem) => {\n if (listItem.tabIndex >= 0) {\n listItem.focus();\n return false;\n }\n return true;\n });\n };\n\n const buildHeaderLabel = () => {\n const hasSelection = getSelected(internalValues).length > 0;\n return labels.select || !multiSelect ? (\n <HvTypography\n component=\"div\"\n noWrap\n variant={isOpen || hasSelection ? \"normalText\" : \"placeholderText\"}\n className={clsx(classes.placeholder, {\n [classes.selectionDisabled]: disabled,\n })}\n >\n {selectionLabel.selected}\n </HvTypography>\n ) : (\n <HvTypography\n component=\"div\"\n noWrap\n className={clsx(classes.placeholder, {\n [classes.selectionDisabled]: disabled,\n })}\n variant=\"normalText\"\n >\n <b>{selectionLabel.selected}</b>\n {` ${labels.multiSelectionConjunction} ${selectionLabel.total}`}\n </HvTypography>\n );\n };\n\n const hasLabel = label != null;\n const hasDescription = description != null;\n\n // the error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and required is true\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) || (status === undefined && required));\n\n const isStateInvalid = isInvalid(validationState);\n\n let errorMessageId;\n if (isStateInvalid) {\n errorMessageId = canShowError ? setId(elementId, \"error\") : ariaErrorMessage;\n }\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n className={clsx(className, classes.root)}\n {...others}\n >\n {(hasLabel || hasDescription) && (\n <div className={classes.labelContainer}>\n {hasLabel && (\n <HvLabel id={setId(elementId, \"label\")} label={label} className={classes.label} />\n )}\n\n {hasDescription && (\n <HvInfoMessage id={setId(elementId, \"description\")} className={classes.description}>\n {description}\n </HvInfoMessage>\n )}\n </div>\n )}\n <HvBaseDropdown\n id={setId(id, \"dropdown\")}\n classes={{\n root: classes.dropdown,\n arrow: classes.arrow,\n header: clsx(\n classes.dropdownHeader,\n isStateInvalid ? classes.dropdownHeaderInvalid : undefined\n ),\n headerOpen: classes.dropdownHeaderOpen,\n }}\n expanded={isOpen}\n disabled={disabled}\n readOnly={readOnly}\n disablePortal={disablePortal}\n placement={placement}\n popperProps={popperProps}\n placeholder={buildHeaderLabel()}\n onToggle={handleToggle}\n onClickOutside={handleClickOutside}\n onContainerCreation={setFocusToContent}\n role=\"combobox\"\n variableWidth={variableWidth}\n aria-label={ariaLabel}\n aria-labelledby={\n [label && setId(elementId, \"label\"), ariaLabelledBy].join(\" \").trim() || undefined\n }\n aria-invalid={isStateInvalid ? true : undefined}\n aria-errormessage={errorMessageId}\n aria-describedby={\n [description && setId(elementId, \"description\"), ariaDescribedBy].join(\" \").trim() ||\n undefined\n }\n onFocus={onFocus}\n onBlur={onBlur}\n dropdownHeaderRef={dropdownHeaderRef}\n {...baseDropdownProps}\n >\n <List\n id={setId(elementId, \"values\")}\n classes={{\n rootList: classes.rootList,\n dropdownListContainer: classes.dropdownListContainer,\n }}\n values={internalValues}\n multiSelect={multiSelect}\n showSearch={showSearch}\n onChange={handleSelection}\n onCancel={handleCancel}\n labels={labels}\n notifyChangesOnFirstRender={notifyChangesOnFirstRender}\n hasTooltips={hasTooltips}\n singleSelectionToggle={singleSelectionToggle}\n aria-labelledby={hasLabel ? setId(elementId, \"label\") : undefined}\n height={height}\n maxHeight={maxHeight}\n virtualized={virtualized}\n {...listProps}\n />\n </HvBaseDropdown>\n {canShowError && (\n <HvWarningText id={setId(elementId, \"error\")} disableBorder className={classes.error}>\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n};\n\nHvDropdown.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the component styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n\n /**\n * Styles applied to the container of the labels elements.\n */\n labelContainer: PropTypes.string,\n /**\n * Styles applied to the label element.\n */\n label: PropTypes.string,\n /**\n * Styles applied to the icon information text.\n */\n description: PropTypes.string,\n\n /**\n * Styles applied to the error area.\n */\n error: PropTypes.string,\n\n /**\n * Styles applied to the dropdown.\n */\n dropdown: PropTypes.string,\n\n /**\n * Styles applied to the arrow\n */\n arrow: PropTypes.string,\n /**\n * Styles applied for truncating the list elements.\n */\n placeholder: PropTypes.string,\n /**\n * Styles applied when the selection is disabled.\n */\n selectionDisabled: PropTypes.string,\n /**\n * Styles applied to the list.\n */\n rootList: PropTypes.string,\n /**\n * Styles applied to the dropdown header.\n */\n dropdownHeader: PropTypes.string,\n /**\n * Styles applied to the dropdown is invalid.\n */\n dropdownHeaderInvalid: PropTypes.string,\n /**\n * Styles applied to the dropdown is opened.\n */\n dropdownHeaderOpen: PropTypes.string,\n /**\n * Styles applied to the dropdown list.\n */\n dropdownListContainer: PropTypes.string,\n }).isRequired,\n\n /**\n * Id to be applied to the form element root node.\n */\n id: PropTypes.string,\n\n /**\n * The form element name.\n */\n name: PropTypes.string,\n\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be provided instead.\n */\n label: PropTypes.node,\n /**\n * @ignore\n */\n \"aria-label\": PropTypes.string,\n /**\n * @ignore\n */\n \"aria-labelledby\": PropTypes.string,\n /**\n * Provide additional descriptive text for the form element.\n */\n description: PropTypes.node,\n /**\n * @ignore\n */\n \"aria-describedby\": PropTypes.string,\n\n /**\n * The placeholder value when nothing is selected.\n */\n placeholder: PropTypes.string,\n\n /**\n * Indicates that the form element is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * Indicates that the form element is in read only mode.\n */\n readOnly: PropTypes.bool,\n /**\n * Indicates that user input is required on the form element.\n */\n required: PropTypes.bool,\n\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to the state.\n */\n status: PropTypes.oneOf([\"standBy\", \"valid\", \"invalid\"]),\n /**\n * The error message to show when the validation status is \"invalid\".\n *\n * Defaults to \"Required\" when the status is uncontrolled and no `aria-errormessage` is provided.\n */\n statusMessage: PropTypes.node,\n /**\n * Identifies the element that provides an error message for the dropdown.\n *\n * Will only be used when the validation status is invalid.\n */\n \"aria-errormessage\": PropTypes.string,\n\n /**\n * The callback fired when the value changes.\n */\n onChange: PropTypes.func,\n\n /**\n * The list to be rendered by the dropdown.\n */\n values: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n label: PropTypes.node.isRequired,\n searchValue: PropTypes.string,\n value: PropTypes.any,\n selected: PropTypes.bool,\n })\n ),\n /**\n * If `true` the dropdown is multiSelect, if `false` the dropdown is single select.\n */\n multiSelect: PropTypes.bool,\n /**\n * If `true` the dropdown is rendered with a search bar, if `false` there won't be a search bar.\n */\n showSearch: PropTypes.bool,\n /**\n * If `true` the dropdown starts opened if `false` it starts closed.\n */\n expanded: PropTypes.bool,\n /**\n * When uncontrolled, defines the initial expanded state.\n */\n defaultExpanded: PropTypes.bool,\n /**\n * If 'true' the dropdown will notify on the first render.\n */\n notifyChangesOnFirstRender: PropTypes.bool,\n /**\n * An object containing all the labels for the dropdown.\n */\n labels: PropTypes.shape({\n /**\n * Label for overwrite the default header behaviour.\n */\n select: PropTypes.string,\n /**\n * Label used for the All checkbox action.\n */\n selectAll: PropTypes.string,\n /**\n * Cancel button label.\n */\n cancelLabel: PropTypes.string,\n /**\n * Apply button label.\n */\n applyLabel: PropTypes.string,\n /**\n * The label used in the middle of the multiSelection count.\n */\n multiSelectionConjunction: PropTypes.string,\n }),\n /**\n * If `true` the dropdown will show tooltips when user mouseenter text in list\n */\n hasTooltips: PropTypes.bool,\n /**\n * Disable the portal behavior.\n * The children stay within it's parent DOM hierarchy.\n */\n disablePortal: PropTypes.bool,\n /**\n * If `true` the dropdown width depends size of content if `false` the width depends on the header size.\n * Defaults to `false`.\n */\n variableWidth: PropTypes.bool,\n /**\n * If `true`, selection can be toggled when single selection.\n */\n singleSelectionToggle: PropTypes.bool,\n /**\n * Placement of the dropdown.\n */\n placement: PropTypes.oneOf([\"left\", \"right\"]),\n /**\n * An object containing props to be wired to the popper component.\n */\n popperProps: PropTypes.shape(),\n\n /**\n * Callback called when the user cancels the changes.\n *\n * Called when the cancel button is used and when the user clicks outside the open container.\n *\n * @param {object} event The event source of the callback.\n */\n onCancel: PropTypes.func,\n /**\n * Callback called when dropdown changes the expanded state.\n *\n * @param {object} event The event source of the callback.\n * @param {boolean} open If the dropdown new state is open (`true`) or closed (`false`).\n */\n onToggle: PropTypes.func,\n /**\n * Callback called when the user clicks outside the open container.\n *\n * @param {object} event The event source of the callback.\n */\n onClickOutside: PropTypes.func,\n\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n\n /**\n * 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\n */\n height: PropTypes.number,\n /**\n * Experimental. Max height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class.\n */\n maxHeight: PropTypes.number,\n /**\n * Experimental. Uses dropdown in a virtualized form, where not all options are rendered initially. Good for use cases with a lot of options.\n */\n virtualized: PropTypes.bool,\n /**\n * Extra props passed to the dropdown.\n */\n baseDropdownProps: PropTypes.object,\n /**\n * Extra props passed to the list.\n */\n listProps: PropTypes.object,\n};\n\nexport default withStyles(styles, { name: \"HvDropdown\" })(HvDropdown);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,KAAK,EAAEC,SAAS,QAAQ,UAAU;AAC3C,SACEC,cAAc,EACdC,aAAa,EACbC,OAAO,EACPC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,aAAa,QACR,IAAI;AACX,SAASC,SAAS,QAAQ,uCAAuC;AACjE,OAAOC,IAAI,MAAM,QAAQ;AACzB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5F,OAAO,EAAEhD,SAAS,CAAC4I,IAAI;EACvB;AACF;AACA;EACE3F,MAAM,EAAEjD,SAAS,CAAC4I,IAAI;EAEtB;AACF;AACA;EACE5E,MAAM,EAAEhE,SAAS,CAAC+I,MAAM;EACxB;AACF;AACA;EACE9E,SAAS,EAAEjE,SAAS,CAAC+I,MAAM;EAC3B;AACF;AACA;EACE7E,WAAW,EAAElE,SAAS,CAAC0I,IAAI;EAC3B;AACF;AACA;EACEvE,iBAAiB,EAAEnE,SAAS,CAACmJ,MAAM;EACnC;AACF;AACA;EACE/E,SAAS,EAAEpE,SAAS,CAACmJ;AACvB,CAAC;AAED,eAAejJ,UAAU,CAACe,MAAM,EAAE;EAAEc,IAAI,EAAE;AAAa,CAAC,CAAC,CAACL,UAAU,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
- const _excluded = ["id", "classes", "values", "multiSelect", "showSearch", "onChange", "onCancel", "labels", "notifyChangesOnFirstRender", "hasTooltips", "singleSelectionToggle", "height", "virtualized"];
3
+ const _excluded = ["id", "classes", "values", "multiSelect", "showSearch", "onChange", "onCancel", "labels", "notifyChangesOnFirstRender", "hasTooltips", "singleSelectionToggle", "height", "maxHeight", "virtualized"];
4
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
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; }
6
6
  import React, { useContext, useEffect, useMemo, useState } from "react";
@@ -48,6 +48,7 @@ const List = _ref => {
48
48
  hasTooltips = false,
49
49
  singleSelectionToggle,
50
50
  height: dropdownHeight,
51
+ maxHeight,
51
52
  virtualized = false
52
53
  } = _ref,
53
54
  others = _objectWithoutProperties(_ref, _excluded);
@@ -234,7 +235,7 @@ const List = _ref => {
234
235
  height: dropdownHeight
235
236
  }), {}, {
236
237
  maxWidth: width,
237
- maxHeight: `calc(${height}px - 32px - ${theme.spacing("xs")} - ${theme.spacing("sm")})`,
238
+ maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : `calc(${height}px - 32px - ${theme.spacing("xs")} - ${theme.spacing("sm")})`,
238
239
  overflow: "auto",
239
240
  padding: 5
240
241
  }),
@@ -244,7 +245,7 @@ const List = _ref => {
244
245
  overflow: "inherit",
245
246
  padding: 0
246
247
  }
247
- }), [width, height, dropdownHeight, theme])();
248
+ }), [width, height, maxHeight, dropdownHeight, theme])();
248
249
  return /*#__PURE__*/_jsxs("div", {
249
250
  className: classes.rootList,
250
251
  children: [/*#__PURE__*/_jsx("div", {
@@ -254,7 +255,7 @@ const List = _ref => {
254
255
  children: [showSearch && renderSearch(), showList && multiSelect && renderSelectAll(), showList && /*#__PURE__*/_jsx(HvList, _objectSpread({
255
256
  id: setId(id, "list"),
256
257
  classes: {
257
- root: clsx(classes.dropdownListContainer, dropdownHeight && maxSizeClasses.root, virtualized && maxSizeClasses.virtualized)
258
+ root: clsx(classes.dropdownListContainer, (dropdownHeight || maxHeight) && maxSizeClasses.root, virtualized && maxSizeClasses.virtualized)
258
259
  },
259
260
  values: list,
260
261
  multiSelect: multiSelect,
@@ -322,6 +323,10 @@ process.env.NODE_ENV !== "production" ? List.propTypes = {
322
323
  * 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
323
324
  */
324
325
  height: PropTypes.number,
326
+ /**
327
+ * Experimental. Max height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class.
328
+ */
329
+ maxHeight: PropTypes.number,
325
330
  /**
326
331
  * Experimental. Uses dropdown in a virtualized form, where not all options are rendered initially. Good for use cases with a lot of options.
327
332
  */