@hitachivantara/uikit-react-core 4.1.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BreadCrumb/BreadCrumb.js +32 -20
- package/dist/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/BreadCrumb/styles.js +3 -0
- package/dist/BreadCrumb/styles.js.map +1 -1
- package/dist/BreadCrumb/utils.js +3 -8
- package/dist/BreadCrumb/utils.js.map +1 -1
- package/dist/Dialog/Dialog.d.ts +1 -1
- package/dist/Dialog/Dialog.js +11 -13
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DialogActions/DialogActions.js.map +1 -1
- package/dist/Dialog/DialogActions/styles.js +2 -9
- package/dist/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/Dialog/DialogContent/DialogContent.js +19 -5
- package/dist/Dialog/DialogContent/DialogContent.js.map +1 -1
- package/dist/Dialog/DialogContent/styles.js +2 -3
- package/dist/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/Dialog/DialogTitle/DialogTitle.js +1 -6
- package/dist/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/Dialog/DialogTitle/styles.js +1 -4
- package/dist/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/Dialog/styles.js +10 -6
- package/dist/Dialog/styles.js.map +1 -1
- package/dist/Dropdown/Dropdown.d.ts +4 -0
- package/dist/Dropdown/List/List.js +9 -4
- package/dist/Dropdown/List/List.js.map +1 -1
- package/dist/legacy/BreadCrumb/BreadCrumb.js +31 -19
- package/dist/legacy/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/legacy/BreadCrumb/styles.js +3 -0
- package/dist/legacy/BreadCrumb/styles.js.map +1 -1
- package/dist/legacy/BreadCrumb/utils.js +2 -6
- package/dist/legacy/BreadCrumb/utils.js.map +1 -1
- package/dist/legacy/Dialog/Dialog.d.ts +1 -1
- package/dist/legacy/Dialog/Dialog.js +16 -18
- package/dist/legacy/Dialog/Dialog.js.map +1 -1
- package/dist/legacy/Dialog/DialogActions/DialogActions.js.map +1 -1
- package/dist/legacy/Dialog/DialogActions/styles.js +2 -9
- package/dist/legacy/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/legacy/Dialog/DialogContent/DialogContent.js +19 -5
- package/dist/legacy/Dialog/DialogContent/DialogContent.js.map +1 -1
- package/dist/legacy/Dialog/DialogContent/styles.js +2 -3
- package/dist/legacy/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/legacy/Dialog/DialogTitle/DialogTitle.js +1 -6
- package/dist/legacy/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/legacy/Dialog/DialogTitle/styles.js +1 -4
- package/dist/legacy/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/legacy/Dialog/styles.js +10 -6
- package/dist/legacy/Dialog/styles.js.map +1 -1
- package/dist/legacy/Dropdown/Dropdown.d.ts +4 -0
- package/dist/legacy/Dropdown/List/List.js +9 -4
- package/dist/legacy/Dropdown/List/List.js.map +1 -1
- package/dist/modern/BreadCrumb/BreadCrumb.js +12 -7
- package/dist/modern/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/modern/BreadCrumb/styles.js +3 -0
- package/dist/modern/BreadCrumb/styles.js.map +1 -1
- package/dist/modern/BreadCrumb/utils.js +2 -2
- package/dist/modern/BreadCrumb/utils.js.map +1 -1
- package/dist/modern/Dialog/Dialog.d.ts +1 -1
- package/dist/modern/Dialog/Dialog.js +9 -7
- package/dist/modern/Dialog/Dialog.js.map +1 -1
- package/dist/modern/Dialog/DialogActions/DialogActions.js.map +1 -1
- package/dist/modern/Dialog/DialogActions/styles.js +2 -9
- package/dist/modern/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/modern/Dialog/DialogContent/DialogContent.js +18 -10
- package/dist/modern/Dialog/DialogContent/DialogContent.js.map +1 -1
- package/dist/modern/Dialog/DialogContent/styles.js +2 -3
- package/dist/modern/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/modern/Dialog/DialogTitle/DialogTitle.js +1 -8
- package/dist/modern/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/modern/Dialog/DialogTitle/styles.js +1 -4
- package/dist/modern/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/modern/Dialog/styles.js +10 -6
- package/dist/modern/Dialog/styles.js.map +1 -1
- package/dist/modern/Dropdown/Dropdown.d.ts +4 -0
- package/dist/modern/Dropdown/List/List.js +9 -4
- package/dist/modern/Dropdown/List/List.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DialogProps, StandardProps } from "@mui/material";
|
|
2
2
|
|
|
3
|
-
export type HvDialogClassKey = "root" | "background" | "paper" | "closeButton";
|
|
3
|
+
export type HvDialogClassKey = "root" | "background" | "paper" | "fullscreen" | "closeButton";
|
|
4
4
|
|
|
5
5
|
export interface HvDialogProps extends StandardProps<DialogProps, HvDialogClassKey> {
|
|
6
6
|
/**
|
|
@@ -100,7 +100,7 @@ const HvDialog = _ref => {
|
|
|
100
100
|
open: open,
|
|
101
101
|
PaperProps: {
|
|
102
102
|
classes: {
|
|
103
|
-
root: clsx(classes.paper, fullscreen &&
|
|
103
|
+
root: clsx(classes.paper, fullscreen && classes.fullscreen)
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
fullScreen: fullscreen,
|
|
@@ -110,9 +110,9 @@ const HvDialog = _ref => {
|
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
onClose: (event, reason) => wrappedClose(event, reason),
|
|
113
|
-
onKeyDown: keyDownHandler
|
|
113
|
+
onKeyDown: keyDownHandler,
|
|
114
|
+
"aria-modal": true
|
|
114
115
|
}, others), {}, {
|
|
115
|
-
"aria-modal": true,
|
|
116
116
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
117
117
|
id: setId(id, "close"),
|
|
118
118
|
className: classes.closeButton,
|
|
@@ -120,9 +120,7 @@ const HvDialog = _ref => {
|
|
|
120
120
|
onClick: event => wrappedClose(event, undefined, true),
|
|
121
121
|
"aria-label": buttonTitle,
|
|
122
122
|
children: /*#__PURE__*/_jsx(CloseButtonTooltipWrapper, {})
|
|
123
|
-
}), children
|
|
124
|
-
fullscreen
|
|
125
|
-
})) : children]
|
|
123
|
+
}), children]
|
|
126
124
|
}));
|
|
127
125
|
};
|
|
128
126
|
process.env.NODE_ENV !== "production" ? HvDialog.propTypes = {
|
|
@@ -147,9 +145,13 @@ process.env.NODE_ENV !== "production" ? HvDialog.propTypes = {
|
|
|
147
145
|
*/
|
|
148
146
|
background: PropTypes.string,
|
|
149
147
|
/**
|
|
150
|
-
* Style applied to the component
|
|
148
|
+
* Style applied to the paper component.
|
|
151
149
|
*/
|
|
152
150
|
paper: PropTypes.string,
|
|
151
|
+
/**
|
|
152
|
+
* Style applied to the paper component when it's fullscreen.
|
|
153
|
+
*/
|
|
154
|
+
fullscreen: PropTypes.string,
|
|
153
155
|
/**
|
|
154
156
|
* Style applied to the close button.
|
|
155
157
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":["React","useCallback","useState","clsx","PropTypes","Dialog","withStyles","Close","isNil","Button","isKeypress","KeyboardCodes","setId","styles","withTooltip","getFocusableList","HvDialog","classes","className","id","children","open","onClose","firstFocusable","buttonTitle","fullscreen","disableBackdropClick","others","focusableQueue","setFocusableQueue","wrappedClose","event","reason","bypassValidation","measuredRef","node","focusableList","first","last","length","focus","element","document","getElementById","console","warn","keyDownHandler","Tab","target","shiftKey","preventDefault","Esc","onEscapeKeyDown","disableEscapeKeyDown","stopPropagation","closeButtonDisplay","CloseButtonTooltipWrapper","root","paper","background","closeButton","undefined","Children","map","c","cloneElement","propTypes","string","shape","isRequired","bool","func","name"],"sources":["../../../src/Dialog/Dialog.js"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { Dialog } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport isNil from \"lodash/isNil\";\nimport Button from \"../Button\";\nimport { isKeypress, KeyboardCodes, setId } from \"../utils\";\nimport styles from \"./styles\";\nimport withTooltip from \"../withTooltip\";\nimport { getFocusableList } from \"../utils/focusableElementFinder\";\n\n/**\n * The Dialog component provides a solid foundation for creating dialogs, popovers, lightboxes, etc.\n * It is created by the composition of DialogTitle, DialogContent and DialogActions components, passed as child elements.\n */\nconst HvDialog = ({\n classes,\n className,\n id,\n children,\n open,\n onClose,\n firstFocusable,\n buttonTitle = \"Close\",\n fullscreen = false,\n disableBackdropClick = false,\n ...others\n}) => {\n const [focusableQueue, setFocusableQueue] = useState(null);\n\n // Because the `disableBackdropClick` property was deprecated in MUI5\n // and we want to maintain that funcionality to the user we're wrapping\n // the onClose call here to make that check.\n const wrappedClose = (event, reason, bypassValidation = false) => {\n if (bypassValidation) {\n onClose?.(event, reason);\n } else if (!disableBackdropClick) {\n onClose?.(event, reason);\n }\n };\n\n const measuredRef = useCallback(\n (node) => {\n if (node) {\n const focusableList = getFocusableList(node);\n setFocusableQueue({\n first: focusableList[1],\n last: focusableList[focusableList.length - 2],\n });\n if (isNil(firstFocusable)) focusableList[1].focus();\n else {\n const element = document.getElementById(firstFocusable);\n if (element) element.focus();\n else {\n // eslint-disable-next-line no-console\n console.warn(`firstFocusable element ${firstFocusable} not found.`);\n focusableList[1].focus();\n }\n }\n }\n },\n [firstFocusable]\n );\n\n const keyDownHandler = (event) => {\n if (isKeypress(event, KeyboardCodes.Tab) && !isNil(event.target) && !isNil(focusableQueue)) {\n if (event.shiftKey && event.target === focusableQueue.first) {\n focusableQueue.last.focus();\n event.preventDefault();\n }\n if (!event.shiftKey && event.target === focusableQueue.last) {\n focusableQueue.first.focus();\n event.preventDefault();\n }\n }\n // Needed as this handler overrides the one in the material ui Modal.\n else if (isKeypress(event, KeyboardCodes.Esc)) {\n if (others.onEscapeKeyDown) {\n others.onEscapeKeyDown(event);\n }\n\n if (!others.disableEscapeKeyDown) {\n // Swallow the event, in case someone is listening for the escape key on the body.\n event.stopPropagation();\n\n wrappedClose(event, \"escapeKeyDown\", true);\n }\n }\n };\n\n const closeButtonDisplay = () => <Close role=\"presentation\" />;\n\n const CloseButtonTooltipWrapper = buttonTitle\n ? withTooltip(closeButtonDisplay, buttonTitle, \"top\")\n : closeButtonDisplay;\n\n return (\n <Dialog\n className={clsx(classes.root, className)}\n id={id}\n ref={measuredRef}\n open={open}\n PaperProps={{\n classes: {\n root: clsx(classes.paper, fullscreen ? \"fullscreen\" : \"\"),\n },\n }}\n fullScreen={fullscreen}\n BackdropProps={{\n classes: {\n root: classes.background,\n },\n }}\n onClose={(event, reason) => wrappedClose(event, reason)}\n onKeyDown={keyDownHandler}\n {...others}\n aria-modal\n >\n <Button\n id={setId(id, \"close\")}\n className={classes.closeButton}\n category=\"ghost\"\n onClick={(event) => wrappedClose(event, undefined, true)}\n aria-label={buttonTitle}\n >\n <CloseButtonTooltipWrapper />\n </Button>\n {children && typeof children === \"object\"\n ? React.Children.map(children, (c) => React.cloneElement(c, { fullscreen }))\n : children}\n </Dialog>\n );\n};\n\nHvDialog.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component.\n */\n root: PropTypes.string,\n /**\n * Style applied to the background (outside) of the component.\n */\n background: PropTypes.string,\n /**\n * Style applied to the component (root).\n */\n paper: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Components of the Dialog.\n */\n children: PropTypes.node.isRequired,\n /**\n * Current state of the Dialog.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n onClose: PropTypes.func,\n /**\n * Element id that should be focus when the Dialog opens.\n */\n firstFocusable: PropTypes.string,\n /**\n * Title for the button close.\n */\n buttonTitle: PropTypes.string,\n /**\n * Set the dialog to fullscreen mode.\n */\n fullscreen: PropTypes.bool,\n /**\n * Prevent closing the dialog when clicking on the backdrop.\n */\n disableBackdropClick: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvDialog\" })(HvDialog);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,KAAK,QAAQ,mCAAmC;AACzD,OAAOC,KAAK,MAAM,cAAc;AAChC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,UAAU,EAAEC,aAAa,EAAEC,KAAK,QAAQ,UAAU;AAC3D,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SAASC,gBAAgB,QAAQ,iCAAiC;;AAElE;AACA;AACA;AACA;AAHA;AAAA;AAIA,MAAMC,QAAQ,GAAG,QAYX;EAAA,IAZY;MAChBC,OAAO;MACPC,SAAS;MACTC,EAAE;MACFC,QAAQ;MACRC,IAAI;MACJC,OAAO;MACPC,cAAc;MACdC,WAAW,GAAG,OAAO;MACrBC,UAAU,GAAG,KAAK;MAClBC,oBAAoB,GAAG;IAEzB,CAAC;IADIC,MAAM;EAET,MAAM,CAACC,cAAc,EAAEC,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,EAAE;MACpBX,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGS,KAAK,EAAEC,MAAM,CAAC;IAC1B,CAAC,MAAM,IAAI,CAACN,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AAM;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;AACvB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,UAAU,QAAQ,aAAa;AACxC,S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,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,
|
|
1
|
+
{"version":3,"file":"DialogActions.js","names":["React","clsx","PropTypes","DialogActions","withStyles","styles","HvDialogActions","props","classes","className","children","fullscreen","others","root","spacing","propTypes","string","shape","isRequired","node","bool","name"],"sources":["../../../../src/Dialog/DialogActions/DialogActions.js"],"sourcesContent":["import React from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { DialogActions } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport styles from \"./styles\";\n\nconst HvDialogActions = (props) => {\n const { classes, className, children, fullscreen = false, ...others } = props;\n return (\n <DialogActions\n classes={{\n root: clsx(classes.root, { [classes.fullscreen]: fullscreen }),\n spacing: classes.spacing,\n }}\n className={className}\n {...others}\n >\n {children}\n </DialogActions>\n );\n};\n\nHvDialogActions.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component (container for the actions).\n */\n root: PropTypes.string,\n /**\n * Style applied to the root of the component if disableSpacing is off.\n */\n spacing: PropTypes.string,\n /**\n * Style applied to the root of the component if fullscreen is on.\n */\n fullscreen: PropTypes.string,\n }).isRequired,\n /**\n * Actions of the Dialog.\n */\n children: PropTypes.node.isRequired,\n /**\n * Whether or not the dialog is in fullscreen mode.\n */\n fullscreen: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvDialogActions\" })(HvDialogActions);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,MAAM,MAAM,UAAU;AAAC;AAE9B,MAAMC,eAAe,GAAIC,KAAK,IAAK;EACjC,MAAM;MAAEC,OAAO;MAAEC,SAAS;MAAEC,QAAQ;MAAEC,UAAU,GAAG;IAAiB,CAAC,GAAGJ,KAAK;IAAhBK,MAAM,4BAAKL,KAAK;EAC7E,oBACE,KAAC,aAAa;IACZ,OAAO,EAAE;MACPM,IAAI,EAAEZ,IAAI,CAACO,OAAO,CAACK,IAAI,EAA0BF,UAAU,IAA/BH,OAAO,CAACG,UAAU,CAAgB;MAC9DG,OAAO,EAAEN,OAAO,CAACM;IACnB,CAAE;IACF,SAAS,EAAEL;EAAU,GACjBG,MAAM;IAAA,UAETF;EAAQ,GACK;AAEpB,CAAC;AAED,wCAAAJ,eAAe,CAACS,SAAS,GAAG;EAC1B;AACF;AACA;EACEN,SAAS,EAAEP,SAAS,CAACc,MAAM;EAC3B;AACF;AACA;EACER,OAAO,EAAEN,SAAS,CAACe,KAAK,CAAC;IACvB;AACJ;AACA;IACIJ,IAAI,EAAEX,SAAS,CAACc,MAAM;IACtB;AACJ;AACA;IACIF,OAAO,EAAEZ,SAAS,CAACc,MAAM;IACzB;AACJ;AACA;IACIL,UAAU,EAAET,SAAS,CAACc;EACxB,CAAC,CAAC,CAACE,UAAU;EACb;AACF;AACA;EACER,QAAQ,EAAER,SAAS,CAACiB,IAAI,CAACD,UAAU;EACnC;AACF;AACA;EACEP,UAAU,EAAET,SAAS,CAACkB;AACxB,CAAC;AAED,eAAehB,UAAU,CAACC,MAAM,EAAE;EAAEgB,IAAI,EAAE;AAAkB,CAAC,CAAC,CAACf,eAAe,CAAC"}
|
|
@@ -2,21 +2,14 @@ const styles = theme => ({
|
|
|
2
2
|
root: {
|
|
3
3
|
margin: "0",
|
|
4
4
|
padding: theme.hv.spacing.sm,
|
|
5
|
-
borderTop: `3px solid ${theme.hv.palette.atmosphere.atmo2}
|
|
6
|
-
height: 100,
|
|
7
|
-
flex: 1
|
|
5
|
+
borderTop: `3px solid ${theme.hv.palette.atmosphere.atmo2}`
|
|
8
6
|
},
|
|
9
7
|
spacing: {
|
|
10
8
|
"& > :not(:first-child)": {
|
|
11
9
|
marginLeft: theme.hv.spacing.xs
|
|
12
10
|
}
|
|
13
11
|
},
|
|
14
|
-
fullscreen: {
|
|
15
|
-
position: "fixed",
|
|
16
|
-
width: "100%",
|
|
17
|
-
bottom: 0,
|
|
18
|
-
left: 0
|
|
19
|
-
}
|
|
12
|
+
fullscreen: {}
|
|
20
13
|
});
|
|
21
14
|
export default styles;
|
|
22
15
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","margin","padding","hv","spacing","sm","borderTop","palette","atmosphere","atmo2","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","margin","padding","hv","spacing","sm","borderTop","palette","atmosphere","atmo2","marginLeft","xs","fullscreen"],"sources":["../../../../src/Dialog/DialogActions/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n margin: \"0\",\n padding: theme.hv.spacing.sm,\n borderTop: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n },\n spacing: {\n \"& > :not(:first-child)\": {\n marginLeft: theme.hv.spacing.xs,\n },\n },\n fullscreen: {},\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAK,KAAM;EACzBC,IAAI,EAAE;IACJC,MAAM,EAAE,GAAG;IACXC,OAAO,EAAEH,KAAK,CAACI,EAAE,CAACC,OAAO,CAACC,EAAE;IAC5BC,SAAS,EAAG,aAAYP,KAAK,CAACI,EAAE,CAACI,OAAO,CAACC,UAAU,CAACC,KAAM;EAC5D,CAAC;EACDL,OAAO,EAAE;IACP,wBAAwB,EAAE;MACxBM,UAAU,EAAEX,KAAK,CAACI,EAAE,CAACC,OAAO,CAACO;IAC/B;EACF,CAAC;EACDC,UAAU,EAAE,CAAC;AACf,CAAC,CAAC;AAEF,eAAed,MAAM"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
const _excluded = ["classes", "className", "children", "indentContent"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1
6
|
import React from "react";
|
|
2
7
|
import PropTypes from "prop-types";
|
|
3
8
|
import { DialogContent } from "@mui/material";
|
|
@@ -6,17 +11,20 @@ import clsx from "clsx";
|
|
|
6
11
|
import HvTypography from "../../Typography";
|
|
7
12
|
import styles from "./styles";
|
|
8
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const HvDialogContent =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const HvDialogContent = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
classes,
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
indentContent = false
|
|
20
|
+
} = _ref,
|
|
21
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
return /*#__PURE__*/_jsx(HvTypography, _objectSpread(_objectSpread({
|
|
16
23
|
component: DialogContent,
|
|
17
|
-
className: clsx(className, classes.root, indentContent && classes.textContent)
|
|
24
|
+
className: clsx(className, classes.root, indentContent && classes.textContent)
|
|
25
|
+
}, others), {}, {
|
|
18
26
|
children: children
|
|
19
|
-
});
|
|
27
|
+
}));
|
|
20
28
|
};
|
|
21
29
|
process.env.NODE_ENV !== "production" ? HvDialogContent.propTypes = {
|
|
22
30
|
/**
|
|
@@ -32,7 +40,7 @@ process.env.NODE_ENV !== "production" ? HvDialogContent.propTypes = {
|
|
|
32
40
|
*/
|
|
33
41
|
root: PropTypes.string,
|
|
34
42
|
/**
|
|
35
|
-
* Style applied when the content is
|
|
43
|
+
* Style applied when the content is indented.
|
|
36
44
|
*/
|
|
37
45
|
textContent: PropTypes.string
|
|
38
46
|
}).isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContent.js","names":["React","PropTypes","DialogContent","withStyles","clsx","HvTypography","styles","HvDialogContent","classes","className","children","indentContent","root","textContent","propTypes","string","shape","isRequired","bool","node","name"],"sources":["../../../../src/Dialog/DialogContent/DialogContent.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { DialogContent } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport clsx from \"clsx\";\nimport HvTypography from \"../../Typography\";\nimport styles from \"./styles\";\n\nconst HvDialogContent = ({ classes, className, children, indentContent = false }) => {\n return (\n <HvTypography\n component={DialogContent}\n className={clsx(className, classes.root, { [classes.textContent]: indentContent })}\n >\n {children}\n </HvTypography>\n );\n};\n\nHvDialogContent.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component (container for the content).\n */\n root: PropTypes.string,\n /**\n * Style applied when the content is
|
|
1
|
+
{"version":3,"file":"DialogContent.js","names":["React","PropTypes","DialogContent","withStyles","clsx","HvTypography","styles","HvDialogContent","classes","className","children","indentContent","others","root","textContent","propTypes","string","shape","isRequired","bool","node","name"],"sources":["../../../../src/Dialog/DialogContent/DialogContent.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { DialogContent } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport clsx from \"clsx\";\nimport HvTypography from \"../../Typography\";\nimport styles from \"./styles\";\n\nconst HvDialogContent = ({ classes, className, children, indentContent = false, ...others }) => {\n return (\n <HvTypography\n component={DialogContent}\n className={clsx(className, classes.root, { [classes.textContent]: indentContent })}\n {...others}\n >\n {children}\n </HvTypography>\n );\n};\n\nHvDialogContent.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component (container for the content).\n */\n root: PropTypes.string,\n /**\n * Style applied when the content is indented.\n */\n textContent: PropTypes.string,\n }).isRequired,\n /**\n * Content should be indented in relationship to the Dialog title.\n */\n indentContent: PropTypes.bool,\n /**\n * Content to be rendered.\n */\n children: PropTypes.node.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvDialogContent\" })(HvDialogContent);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,MAAM,MAAM,UAAU;AAAC;AAE9B,MAAMC,eAAe,GAAG,QAAwE;EAAA,IAAvE;MAAEC,OAAO;MAAEC,SAAS;MAAEC,QAAQ;MAAEC,aAAa,GAAG;IAAiB,CAAC;IAARC,MAAM;EACvF,oBACE,KAAC,YAAY;IACX,SAAS,EAAEV,aAAc;IACzB,SAAS,EAAEE,IAAI,CAACK,SAAS,EAAED,OAAO,CAACK,IAAI,EAA2BF,aAAa,IAAnCH,OAAO,CAACM,WAAW;EAAoB,GAC/EF,MAAM;IAAA,UAETF;EAAQ,GACI;AAEnB,CAAC;AAED,wCAAAH,eAAe,CAACQ,SAAS,GAAG;EAC1B;AACF;AACA;EACEN,SAAS,EAAER,SAAS,CAACe,MAAM;EAC3B;AACF;AACA;EACER,OAAO,EAAEP,SAAS,CAACgB,KAAK,CAAC;IACvB;AACJ;AACA;IACIJ,IAAI,EAAEZ,SAAS,CAACe,MAAM;IACtB;AACJ;AACA;IACIF,WAAW,EAAEb,SAAS,CAACe;EACzB,CAAC,CAAC,CAACE,UAAU;EACb;AACF;AACA;EACEP,aAAa,EAAEV,SAAS,CAACkB,IAAI;EAC7B;AACF;AACA;EACET,QAAQ,EAAET,SAAS,CAACmB,IAAI,CAACF;AAC3B,CAAC;AAED,eAAef,UAAU,CAACG,MAAM,EAAE;EAAEe,IAAI,EAAE;AAAkB,CAAC,CAAC,CAACd,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","flex","textContent","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","flex","textContent","margin","overflowY"],"sources":["../../../../src/Dialog/DialogContent/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hvSpacing(0, \"sm\", \"sm\", \"sm\"),\n flex: 1,\n },\n textContent: {\n margin: \"0 42px\",\n flex: 1,\n overflowY: \"auto\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAK,KAAM;EACzBC,IAAI,EAAE;IACJC,OAAO,EAAEF,KAAK,CAACG,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IAC7CC,IAAI,EAAE;EACR,CAAC;EACDC,WAAW,EAAE;IACXC,MAAM,EAAE,QAAQ;IAChBF,IAAI,EAAE,CAAC;IACPG,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAeR,MAAM"}
|
|
@@ -24,16 +24,9 @@ const HvDialogTitle = _ref => {
|
|
|
24
24
|
} = _ref,
|
|
25
25
|
others = _objectWithoutProperties(_ref, _excluded);
|
|
26
26
|
const isString = typeof children === "string";
|
|
27
|
-
const {
|
|
28
|
-
fullscreen
|
|
29
|
-
} = others;
|
|
30
|
-
|
|
31
|
-
// prevent the `fullscreen` prop from being passed to the `DialogTitle` component
|
|
32
|
-
// eslint-disable-next-line no-param-reassign
|
|
33
|
-
delete others.fullscreen;
|
|
34
27
|
const icon = customIcon || showIcon && iconVariant(variant);
|
|
35
28
|
return /*#__PURE__*/_jsx(DialogTitle, _objectSpread(_objectSpread({
|
|
36
|
-
className: clsx(classes.root, className
|
|
29
|
+
className: clsx(classes.root, className)
|
|
37
30
|
}, others), {}, {
|
|
38
31
|
children: /*#__PURE__*/_jsxs("div", {
|
|
39
32
|
className: classes.messageContainer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTitle.js","names":["React","PropTypes","clsx","DialogTitle","withStyles","HvTypography","iconVariant","styles","HvDialogTitle","classes","className","children","variant","showIcon","customIcon","others","isString","
|
|
1
|
+
{"version":3,"file":"DialogTitle.js","names":["React","PropTypes","clsx","DialogTitle","withStyles","HvTypography","iconVariant","styles","HvDialogTitle","classes","className","children","variant","showIcon","customIcon","others","isString","icon","root","messageContainer","textWithIcon","propTypes","string","shape","closeButton","isRequired","oneOf","bool","node","name"],"sources":["../../../../src/Dialog/DialogTitle/DialogTitle.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { DialogTitle } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport HvTypography from \"../../Typography\";\nimport iconVariant from \"../../utils/iconVariant\";\nimport styles from \"./styles\";\n\nconst HvDialogTitle = ({\n classes,\n className,\n children,\n variant = \"default\",\n showIcon = true,\n customIcon = null,\n ...others\n}) => {\n const isString = typeof children === \"string\";\n\n const icon = customIcon || (showIcon && iconVariant(variant));\n\n return (\n <DialogTitle className={clsx(classes.root, className)} {...others}>\n <div className={classes.messageContainer}>\n {icon}\n <div className={clsx({ [classes.textWithIcon]: icon })}>\n {!isString && children}\n {isString && <HvTypography variant=\"xxsTitle\">{children}</HvTypography>}\n </div>\n </div>\n </DialogTitle>\n );\n};\n\nHvDialogTitle.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component (container for the title).\n */\n root: PropTypes.string,\n /**\n * Style applied to the container of the title\n */\n messageContainer: PropTypes.string,\n /**\n * Style applied to the text when the icon is present.\n */\n textWithIcon: PropTypes.string,\n /**\n * Style applied to the icon.\n */\n icon: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Variant of the Dialog.\n */\n variant: PropTypes.oneOf([\"success\", \"warning\", \"error\", \"info\", \"default\"]),\n /**\n * Controls if the associated icon to the variant should be shown.\n */\n showIcon: PropTypes.bool,\n /**\n * Custom icon to replace the variant default.\n */\n customIcon: PropTypes.node,\n /**\n * Node to be render.\n */\n children: PropTypes.node.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvDialogTitle\" })(HvDialogTitle);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,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,OAAO,GAAG,SAAS;MACnBC,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AQ,EAAEZ,SAAS,CAAC0B,IAAI;EACxB;AACF;AACA;EACEb,UAAU,EAAEb,SAAS,CAAC2B,IAAI;EAC1B;AACF;AACA;EACEjB,QAAQ,EAAEV,SAAS,CAAC2B,IAAI,CAACH;AAC3B,CAAC;AAED,eAAerB,UAAU,CAACG,MAAM,EAAE;EAAEsB,IAAI,EAAE;AAAgB,CAAC,CAAC,CAACrB,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","margin","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hvSpacing","margin","messageContainer","display","alignItems","textWithIcon","marginLeft","marginRight","icon","hv","spacing","md","width","height"],"sources":["../../../../src/Dialog/DialogTitle/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hvSpacing(\"sm\"),\n margin: 0,\n },\n messageContainer: {\n display: \"flex\",\n alignItems: \"center\",\n },\n textWithIcon: {\n marginLeft: theme.hvSpacing(\"xs\"),\n // 32px is the icon width\n marginRight: `calc(32px + ${theme.hvSpacing(\"xs\")})`,\n },\n icon: {\n marginRight: theme.hv.spacing.md,\n width: 48,\n height: 48,\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAIC,KAAK,KAAM;EACzBC,IAAI,EAAE;IACJC,OAAO,EAAEF,KAAK,CAACG,SAAS,CAAC,IAAI,CAAC;IAC9BC,MAAM,EAAE;EACV,CAAC;EACDC,gBAAgB,EAAE;IAChBC,OAAO,EAAE,MAAM;IACfC,UAAU,EAAE;EACd,CAAC;EACDC,YAAY,EAAE;IACZC,UAAU,EAAET,KAAK,CAACG,SAAS,CAAC,IAAI,CAAC;IACjC;IACAO,WAAW,EAAG,eAAcV,KAAK,CAACG,SAAS,CAAC,IAAI,CAAE;EACpD,CAAC;EACDQ,IAAI,EAAE;IACJD,WAAW,EAAEV,KAAK,CAACY,EAAE,CAACC,OAAO,CAACC,EAAE;IAChCC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAejB,MAAM"}
|
|
@@ -4,16 +4,20 @@ const styles = theme => ({
|
|
|
4
4
|
background: fade(theme.hv.palette.atmosphere.atmo4, 0.8)
|
|
5
5
|
},
|
|
6
6
|
paper: {
|
|
7
|
-
background:
|
|
8
|
-
padding:
|
|
7
|
+
background: theme.hv.palette.atmosphere.atmo1,
|
|
8
|
+
padding: 0,
|
|
9
9
|
overflow: "auto",
|
|
10
10
|
boxShadow: theme.hv.shadows[1],
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
maxHeight: "calc(100% - 200px)",
|
|
12
|
+
"@media (max-height:720px)": {
|
|
13
|
+
maxHeight: "calc(100% - 40px)" // "sm" margin
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
"&$fullscreen": {
|
|
17
|
+
maxHeight: "none"
|
|
15
18
|
}
|
|
16
19
|
},
|
|
20
|
+
fullscreen: {},
|
|
17
21
|
closeButton: {
|
|
18
22
|
padding: 0,
|
|
19
23
|
minWidth: "inherit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["fade","styles","theme","background","hv","palette","atmosphere","atmo4","paper","atmo1","padding","overflow","boxShadow","shadows","maxHeight","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["fade","styles","theme","background","hv","palette","atmosphere","atmo4","paper","atmo1","padding","overflow","boxShadow","shadows","maxHeight","fullscreen","closeButton","minWidth","position","top","hvSpacing","right"],"sources":["../../../src/Dialog/styles.js"],"sourcesContent":["import fade from \"../utils/hexToRgbA\";\n\nconst styles = (theme) => ({\n background: {\n background: fade(theme.hv.palette.atmosphere.atmo4, 0.8),\n },\n paper: {\n background: theme.hv.palette.atmosphere.atmo1,\n padding: 0,\n overflow: \"auto\",\n boxShadow: theme.hv.shadows[1],\n maxHeight: \"calc(100% - 200px)\",\n \"@media (max-height:720px)\": {\n maxHeight: \"calc(100% - 40px)\", // \"sm\" margin\n },\n \"&$fullscreen\": {\n maxHeight: \"none\",\n },\n },\n fullscreen: {},\n closeButton: {\n padding: 0,\n minWidth: \"inherit\",\n position: \"absolute\",\n top: theme.hvSpacing(\"sm\"),\n right: theme.hvSpacing(\"sm\"),\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,oBAAoB;AAErC,MAAMC,MAAM,GAAIC,KAAK,KAAM;EACzBC,UAAU,EAAE;IACVA,UAAU,EAAEH,IAAI,CAACE,KAAK,CAACE,EAAE,CAACC,OAAO,CAACC,UAAU,CAACC,KAAK,EAAE,GAAG;EACzD,CAAC;EACDC,KAAK,EAAE;IACLL,UAAU,EAAED,KAAK,CAACE,EAAE,CAACC,OAAO,CAACC,UAAU,CAACG,KAAK;IAC7CC,OAAO,EAAE,CAAC;IACVC,QAAQ,EAAE,MAAM;IAChBC,SAAS,EAAEV,KAAK,CAACE,EAAE,CAACS,OAAO,CAAC,CAAC,CAAC;IAC9BC,SAAS,EAAE,oBAAoB;IAC/B,2BAA2B,EAAE;MAC3BA,SAAS,EAAE,mBAAmB,CAAE;IAClC,CAAC;;IACD,cAAc,EAAE;MACdA,SAAS,EAAE;IACb;EACF,CAAC;EACDC,UAAU,EAAE,CAAC,CAAC;EACdC,WAAW,EAAE;IACXN,OAAO,EAAE,CAAC;IACVO,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAEjB,KAAK,CAACkB,SAAS,CAAC,IAAI,CAAC;IAC1BC,KAAK,EAAEnB,KAAK,CAACkB,SAAS,CAAC,IAAI;EAC7B;AACF,CAAC,CAAC;AAEF,eAAenB,MAAM"}
|
|
@@ -143,6 +143,10 @@ export interface HvDropdownProps
|
|
|
143
143
|
* Experimental. Height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class. Required in case virtualized is used
|
|
144
144
|
*/
|
|
145
145
|
height?: number;
|
|
146
|
+
/**
|
|
147
|
+
* Experimental. Max height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class.
|
|
148
|
+
*/
|
|
149
|
+
maxHeight?: number;
|
|
146
150
|
/**
|
|
147
151
|
* Experimental. Uses dropdown in a virtualized form, where not all options are rendered initially. Good for use cases with a lot of options.
|
|
148
152
|
*/
|
|
@@ -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
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","names":["React","useContext","useEffect","useMemo","useState","clsx","PropTypes","isNil","makeStyles","withStyles","useTheme","setId","HvActionBar","HvButton","HvCheckBox","HvList","HvInput","HvTypography","getSelected","styles","BaseDropdownContext","clone","values","map","value","cleanHidden","lst","item","isHidden","valuesExist","length","List","id","classes","multiSelect","showSearch","onChange","onCancel","labels","notifyChangesOnFirstRender","hasTooltips","singleSelectionToggle","height","dropdownHeight","virtualized","others","searchStr","setSearchStr","list","setList","allSelected","setAllSelected","anySelected","setAnySelected","width","theme","newLabels","selectAll","selectionConjunction","multiSelectionConjunction","updateSelectAll","listValues","nbrSelected","hasSelection","allSelect","handleSearch","str","results","filter","searchValue","label","stringValue","String","toLowerCase","indexOf","newList","elem","isResult","find","result","renderSearch","searchContainer","searchPlaceholder","event","handleSelectAll","selected","renderSelectAll","defaultLabel","selectAllContainer","container","selection","onSelection","renderActions","applyLabel","cancelLabel","showList","maxSizeClasses","root","maxWidth","maxHeight","spacing","overflow","padding","rootList","listBorderDown","listContainer","dropdownListContainer","propTypes","string","isRequired","instanceOf","Object","Array","bool","func","number","name"],"sources":["../../../../src/Dropdown/List/List.js"],"sourcesContent":["import React, { useContext, useEffect, useMemo, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport isNil from \"lodash/isNil\";\nimport { makeStyles, withStyles, useTheme } from \"@mui/styles\";\n\nimport { setId } from \"../../utils\";\nimport { HvActionBar, HvButton, HvCheckBox, HvList, HvInput, HvTypography } from \"../..\";\nimport { getSelected } from \"../utils\";\nimport styles from \"./styles\";\nimport BaseDropdownContext from \"../../BaseDropdown/BaseDropdownContext\";\n\n/**\n * The values property was being deeply cloned. That created a significant performance\n * hit when the values contained complex properties' values, like React Nodes.\n *\n * For minimizing the impact of removing the clone, a shallow clone of the array and its\n * objects is performed instead. That should have the same effect in the majority of the\n * cases, where the properties' values are primitive.\n */\nconst clone = (values) => values.map((value) => ({ ...value }));\n\n/**\n * Set all hidden's to false.\n */\nconst cleanHidden = (lst) => lst.map((item) => ({ ...item, isHidden: false }));\n\nconst valuesExist = (values) => !isNil(values) && values?.length > 0;\n\nconst List = ({\n id,\n classes,\n values = [],\n multiSelect = false,\n showSearch = false,\n onChange,\n onCancel,\n labels,\n notifyChangesOnFirstRender = false,\n hasTooltips = false,\n singleSelectionToggle,\n height: dropdownHeight,\n virtualized = false,\n ...others\n}) => {\n const [searchStr, setSearchStr] = useState(\"\");\n const [list, setList] = useState(clone(values));\n const [allSelected, setAllSelected] = useState(false);\n const [anySelected, setAnySelected] = useState(false);\n const { width, height } = useContext(BaseDropdownContext);\n const theme = useTheme();\n\n const newLabels = {\n selectAll: labels.selectAll,\n selectionConjunction: labels.multiSelectionConjunction,\n };\n\n /**\n * Update states associated with select all.\n */\n const updateSelectAll = (listValues) => {\n if (!listValues) return;\n const nbrSelected = getSelected(listValues).length;\n const hasSelection = nbrSelected > 0;\n const allSelect = nbrSelected === listValues.length;\n\n setAnySelected(hasSelection);\n setAllSelected(hasSelection && allSelect);\n };\n\n /**\n * After the first render, call onChange if notifyChangesOnFirstRender.\n */\n useEffect(() => {\n if (!valuesExist(values)) return;\n setList(clone(values));\n updateSelectAll(values);\n if (notifyChangesOnFirstRender) {\n onChange?.(values, false, false, true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [values]);\n\n /**\n * Sets the filtered values to the state.\n *\n * @param {String} str - The value that is being looked.\n */\n const handleSearch = (str) => {\n const results = list\n ? list.filter(({ searchValue, label, value }) => {\n let stringValue = \"\";\n if (typeof searchValue === \"string\" || searchValue instanceof String) {\n stringValue = searchValue.toLowerCase();\n } else if (typeof label === \"string\" || label instanceof String) {\n stringValue = label.toLowerCase();\n } else if (typeof value === \"string\" || value instanceof String) {\n stringValue = value.toLowerCase();\n }\n\n return stringValue.indexOf(str.toLowerCase()) >= 0;\n })\n : null;\n\n if (!isNil(results)) {\n const newList = list.map((elem) => {\n const isResult = results.find((result) => result.label === elem.label);\n return { ...elem, isHidden: !isResult };\n });\n\n setList(newList);\n setSearchStr(str);\n }\n return str;\n };\n\n /**\n * Create search element.\n *\n * @returns {*}\n */\n const renderSearch = () => (\n <div className={classes.searchContainer}>\n <HvInput\n id={setId(id, \"search\")}\n type=\"search\"\n value={searchStr}\n placeholder={labels.searchPlaceholder}\n onChange={(event, str) => handleSearch(str)}\n />\n </div>\n );\n\n /**\n * Select all the values inside the dropdown.\n *\n */\n const handleSelectAll = () => {\n const newList = list.map((elem) => ({ ...elem, selected: !anySelected }));\n setList(newList);\n updateSelectAll(newList);\n };\n\n /**\n * Create selecteAll component.\n *\n * @returns {*}\n */\n const renderSelectAll = () => {\n const { selectAll, multiSelectionConjunction } = labels;\n const nbrSelected = getSelected(list).length;\n\n const defaultLabel = (\n <HvTypography component=\"span\">\n {nbrSelected > 0 ? (\n <>\n <b>{nbrSelected}</b>\n {` ${multiSelectionConjunction} ${list.length}`}\n </>\n ) : (\n <>\n <b>{selectAll}</b>\n {` (${list.length})`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select-all\")}\n label={defaultLabel}\n onChange={() => handleSelectAll()}\n classes={{ container: classes.selection }}\n className={classes.selectAll}\n indeterminate={anySelected && !allSelected}\n checked={allSelected}\n />\n </div>\n );\n };\n\n /**\n * When selecting the state list is updated with the corresponding selection.\n *\n * @param listValues - elements selected.\n */\n const onSelection = (listValues) => {\n if (!multiSelect) {\n onChange(cleanHidden(listValues), true, true, true);\n } else {\n updateSelectAll(listValues);\n setList(clone(listValues));\n }\n };\n\n /**\n * Render action buttons.\n */\n const renderActions = () => {\n const { applyLabel, cancelLabel } = labels;\n return (\n <HvActionBar id={setId(id, \"actions\")}>\n <HvButton\n id={setId(id, \"actions-apply\")}\n onClick={() => onChange(cleanHidden(list), true, true, true)}\n category=\"ghost\"\n >\n {applyLabel}\n </HvButton>\n <HvButton id={setId(id, \"actions-cancel\")} onClick={onCancel} category=\"ghost\">\n {cancelLabel}\n </HvButton>\n </HvActionBar>\n );\n };\n\n const showList = valuesExist(values);\n\n const maxSizeClasses = useMemo(\n () =>\n makeStyles({\n root: {\n ...(dropdownHeight && { height: dropdownHeight }),\n maxWidth: width,\n maxHeight: `calc(${height}px - 32px - ${theme.spacing(\"xs\")} - ${theme.spacing(\"sm\")})`,\n overflow: \"auto\",\n padding: 5,\n },\n virtualized: {\n maxWidth: \"inherit\",\n maxHeight: \"inherit\",\n overflow: \"inherit\",\n padding: 0,\n },\n }),\n [width, height, dropdownHeight, theme]\n )();\n\n return (\n <div className={classes.rootList}>\n <div className={classes.listBorderDown} />\n <div className={classes.listContainer}>\n {showSearch && renderSearch()}\n {showList && multiSelect && renderSelectAll()}\n {showList && (\n <HvList\n id={setId(id, \"list\")}\n classes={{\n root: clsx(\n classes.dropdownListContainer,\n dropdownHeight && maxSizeClasses.root,\n virtualized && maxSizeClasses.virtualized\n ),\n }}\n values={list}\n multiSelect={multiSelect}\n useSelector={multiSelect}\n showSelectAll={false}\n onChange={onSelection}\n labels={newLabels}\n hasTooltips={hasTooltips}\n selectable\n condensed\n singleSelectionToggle={singleSelectionToggle}\n height={dropdownHeight}\n virtualized={virtualized}\n {...others}\n />\n )}\n </div>\n {showList && multiSelect ? renderActions() : null}\n </div>\n );\n};\n\nList.propTypes = {\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string.isRequired,\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes: PropTypes.instanceOf(Object).isRequired,\n /**\n * The list to be rendered.\n */\n values: PropTypes.instanceOf(Array),\n /**\n * If true renders a multi select list.\n */\n multiSelect: PropTypes.bool,\n /**\n * If true renders the search component.\n */\n showSearch: PropTypes.bool,\n /**\n * A function to be executed whenever a item is selected in the list\n * or the Apply button is activated (when `multiSelect` is `true`).\n */\n onChange: PropTypes.func,\n /**\n * A function to be executed whenever the Cancel button is activated.\n */\n onCancel: PropTypes.func,\n /**\n * An object containing all the labels for the dropdown.\n */\n labels: PropTypes.instanceOf(Object).isRequired,\n /**\n * If 'true' the dropdown will notify on the first render.\n */\n notifyChangesOnFirstRender: PropTypes.bool,\n /**\n * If `true` the dropdown will show tooltips when user mouseenter text in list\n */\n hasTooltips: PropTypes.bool,\n /**\n * If `true`, selection can be toggled when single selection.\n */\n singleSelectionToggle: PropTypes.bool.isRequired,\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\nexport default withStyles(styles, { name: \"HvDropdownList\" })(List);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACvE,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,cAAc;AAChC,SAASC,UAAU,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,aAAa;AAE9D,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,MAAM,EAAEC,OAAO,EAAEC,YAAY,QAAQ,OAAO;AACxF,SAASC,WAAW,QAAQ,UAAU;AACtC,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,mBAAmB,MAAM,wCAAwC;;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C;EACnC;AACF;AACA;EACE9E,WAAW,EAAE5B,SAAS,CAAC2G,IAAI;EAC3B;AACF;AACA;EACE9E,UAAU,EAAE7B,SAAS,CAAC2G,IAAI;EAC1B;AACF;AACA;AACA;EACE7E,QAAQ,EAAE9B,SAAS,CAAC4G,IAAI;EACxB;AACF;AACA;EACE7E,QAAQ,EAAE/B,SAAS,CAAC4G,IAAI;EACxB;AACF;AACA;EACE5E,MAAM,EAAEhC,SAAS,CAACwG,UAAU,CAACC,MAAM,CAAC,CAACF,UAAU;EAC/C;AACF;AACA;EACEtE,0BAA0B,EAAEjC,SAAS,CAAC2G,IAAI;EAC1C;AACF;AACA;EACEzE,WAAW,EAAElC,SAAS,CAAC2G,IAAI;EAC3B;AACF;AACA;EACExE,qBAAqB,EAAEnC,SAAS,CAAC2G,IAAI,CAACJ,UAAU;EAChD;AACF;AACA;EACEnE,MAAM,EAAEpC,SAAS,CAAC6G,MAAM;EACxB;AACF;AACA;EACEvE,WAAW,EAAEtC,SAAS,CAAC2G;AACzB,CAAC;AAED,eAAexG,UAAU,CAACU,MAAM,EAAE;EAAEiG,IAAI,EAAE;AAAiB,CAAC,CAAC,CAACrF,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"List.js","names":["React","useContext","useEffect","useMemo","useState","clsx","PropTypes","isNil","makeStyles","withStyles","useTheme","setId","HvActionBar","HvButton","HvCheckBox","HvList","HvInput","HvTypography","getSelected","styles","BaseDropdownContext","clone","values","map","value","cleanHidden","lst","item","isHidden","valuesExist","length","List","id","classes","multiSelect","showSearch","onChange","onCancel","labels","notifyChangesOnFirstRender","hasTooltips","singleSelectionToggle","height","dropdownHeight","maxHeight","virtualized","others","searchStr","setSearchStr","list","setList","allSelected","setAllSelected","anySelected","setAnySelected","width","theme","newLabels","selectAll","selectionConjunction","multiSelectionConjunction","updateSelectAll","listValues","nbrSelected","hasSelection","allSelect","handleSearch","str","results","filter","searchValue","label","stringValue","String","toLowerCase","indexOf","newList","elem","isResult","find","result","renderSearch","searchContainer","searchPlaceholder","event","handleSelectAll","selected","renderSelectAll","defaultLabel","selectAllContainer","container","selection","onSelection","renderActions","applyLabel","cancelLabel","showList","maxSizeClasses","root","maxWidth","spacing","overflow","padding","rootList","listBorderDown","listContainer","dropdownListContainer","propTypes","string","isRequired","instanceOf","Object","Array","bool","func","number","name"],"sources":["../../../../src/Dropdown/List/List.js"],"sourcesContent":["import React, { useContext, useEffect, useMemo, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport isNil from \"lodash/isNil\";\nimport { makeStyles, withStyles, useTheme } from \"@mui/styles\";\n\nimport { setId } from \"../../utils\";\nimport { HvActionBar, HvButton, HvCheckBox, HvList, HvInput, HvTypography } from \"../..\";\nimport { getSelected } from \"../utils\";\nimport styles from \"./styles\";\nimport BaseDropdownContext from \"../../BaseDropdown/BaseDropdownContext\";\n\n/**\n * The values property was being deeply cloned. That created a significant performance\n * hit when the values contained complex properties' values, like React Nodes.\n *\n * For minimizing the impact of removing the clone, a shallow clone of the array and its\n * objects is performed instead. That should have the same effect in the majority of the\n * cases, where the properties' values are primitive.\n */\nconst clone = (values) => values.map((value) => ({ ...value }));\n\n/**\n * Set all hidden's to false.\n */\nconst cleanHidden = (lst) => lst.map((item) => ({ ...item, isHidden: false }));\n\nconst valuesExist = (values) => !isNil(values) && values?.length > 0;\n\nconst List = ({\n id,\n classes,\n values = [],\n multiSelect = false,\n showSearch = false,\n onChange,\n onCancel,\n labels,\n notifyChangesOnFirstRender = false,\n hasTooltips = false,\n singleSelectionToggle,\n height: dropdownHeight,\n maxHeight,\n virtualized = false,\n ...others\n}) => {\n const [searchStr, setSearchStr] = useState(\"\");\n const [list, setList] = useState(clone(values));\n const [allSelected, setAllSelected] = useState(false);\n const [anySelected, setAnySelected] = useState(false);\n const { width, height } = useContext(BaseDropdownContext);\n const theme = useTheme();\n\n const newLabels = {\n selectAll: labels.selectAll,\n selectionConjunction: labels.multiSelectionConjunction,\n };\n\n /**\n * Update states associated with select all.\n */\n const updateSelectAll = (listValues) => {\n if (!listValues) return;\n const nbrSelected = getSelected(listValues).length;\n const hasSelection = nbrSelected > 0;\n const allSelect = nbrSelected === listValues.length;\n\n setAnySelected(hasSelection);\n setAllSelected(hasSelection && allSelect);\n };\n\n /**\n * After the first render, call onChange if notifyChangesOnFirstRender.\n */\n useEffect(() => {\n if (!valuesExist(values)) return;\n setList(clone(values));\n updateSelectAll(values);\n if (notifyChangesOnFirstRender) {\n onChange?.(values, false, false, true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [values]);\n\n /**\n * Sets the filtered values to the state.\n *\n * @param {String} str - The value that is being looked.\n */\n const handleSearch = (str) => {\n const results = list\n ? list.filter(({ searchValue, label, value }) => {\n let stringValue = \"\";\n if (typeof searchValue === \"string\" || searchValue instanceof String) {\n stringValue = searchValue.toLowerCase();\n } else if (typeof label === \"string\" || label instanceof String) {\n stringValue = label.toLowerCase();\n } else if (typeof value === \"string\" || value instanceof String) {\n stringValue = value.toLowerCase();\n }\n\n return stringValue.indexOf(str.toLowerCase()) >= 0;\n })\n : null;\n\n if (!isNil(results)) {\n const newList = list.map((elem) => {\n const isResult = results.find((result) => result.label === elem.label);\n return { ...elem, isHidden: !isResult };\n });\n\n setList(newList);\n setSearchStr(str);\n }\n return str;\n };\n\n /**\n * Create search element.\n *\n * @returns {*}\n */\n const renderSearch = () => (\n <div className={classes.searchContainer}>\n <HvInput\n id={setId(id, \"search\")}\n type=\"search\"\n value={searchStr}\n placeholder={labels.searchPlaceholder}\n onChange={(event, str) => handleSearch(str)}\n />\n </div>\n );\n\n /**\n * Select all the values inside the dropdown.\n *\n */\n const handleSelectAll = () => {\n const newList = list.map((elem) => ({ ...elem, selected: !anySelected }));\n setList(newList);\n updateSelectAll(newList);\n };\n\n /**\n * Create selecteAll component.\n *\n * @returns {*}\n */\n const renderSelectAll = () => {\n const { selectAll, multiSelectionConjunction } = labels;\n const nbrSelected = getSelected(list).length;\n\n const defaultLabel = (\n <HvTypography component=\"span\">\n {nbrSelected > 0 ? (\n <>\n <b>{nbrSelected}</b>\n {` ${multiSelectionConjunction} ${list.length}`}\n </>\n ) : (\n <>\n <b>{selectAll}</b>\n {` (${list.length})`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select-all\")}\n label={defaultLabel}\n onChange={() => handleSelectAll()}\n classes={{ container: classes.selection }}\n className={classes.selectAll}\n indeterminate={anySelected && !allSelected}\n checked={allSelected}\n />\n </div>\n );\n };\n\n /**\n * When selecting the state list is updated with the corresponding selection.\n *\n * @param listValues - elements selected.\n */\n const onSelection = (listValues) => {\n if (!multiSelect) {\n onChange(cleanHidden(listValues), true, true, true);\n } else {\n updateSelectAll(listValues);\n setList(clone(listValues));\n }\n };\n\n /**\n * Render action buttons.\n */\n const renderActions = () => {\n const { applyLabel, cancelLabel } = labels;\n return (\n <HvActionBar id={setId(id, \"actions\")}>\n <HvButton\n id={setId(id, \"actions-apply\")}\n onClick={() => onChange(cleanHidden(list), true, true, true)}\n category=\"ghost\"\n >\n {applyLabel}\n </HvButton>\n <HvButton id={setId(id, \"actions-cancel\")} onClick={onCancel} category=\"ghost\">\n {cancelLabel}\n </HvButton>\n </HvActionBar>\n );\n };\n\n const showList = valuesExist(values);\n\n const maxSizeClasses = useMemo(\n () =>\n makeStyles({\n root: {\n ...(dropdownHeight && { height: dropdownHeight }),\n maxWidth: width,\n maxHeight:\n maxHeight ??\n `calc(${height}px - 32px - ${theme.spacing(\"xs\")} - ${theme.spacing(\"sm\")})`,\n overflow: \"auto\",\n padding: 5,\n },\n virtualized: {\n maxWidth: \"inherit\",\n maxHeight: \"inherit\",\n overflow: \"inherit\",\n padding: 0,\n },\n }),\n [width, height, maxHeight, dropdownHeight, theme]\n )();\n\n return (\n <div className={classes.rootList}>\n <div className={classes.listBorderDown} />\n <div className={classes.listContainer}>\n {showSearch && renderSearch()}\n {showList && multiSelect && renderSelectAll()}\n {showList && (\n <HvList\n id={setId(id, \"list\")}\n classes={{\n root: clsx(\n classes.dropdownListContainer,\n (dropdownHeight || maxHeight) && maxSizeClasses.root,\n virtualized && maxSizeClasses.virtualized\n ),\n }}\n values={list}\n multiSelect={multiSelect}\n useSelector={multiSelect}\n showSelectAll={false}\n onChange={onSelection}\n labels={newLabels}\n hasTooltips={hasTooltips}\n selectable\n condensed\n singleSelectionToggle={singleSelectionToggle}\n height={dropdownHeight}\n virtualized={virtualized}\n {...others}\n />\n )}\n </div>\n {showList && multiSelect ? renderActions() : null}\n </div>\n );\n};\n\nList.propTypes = {\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string.isRequired,\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes: PropTypes.instanceOf(Object).isRequired,\n /**\n * The list to be rendered.\n */\n values: PropTypes.instanceOf(Array),\n /**\n * If true renders a multi select list.\n */\n multiSelect: PropTypes.bool,\n /**\n * If true renders the search component.\n */\n showSearch: PropTypes.bool,\n /**\n * A function to be executed whenever a item is selected in the list\n * or the Apply button is activated (when `multiSelect` is `true`).\n */\n onChange: PropTypes.func,\n /**\n * A function to be executed whenever the Cancel button is activated.\n */\n onCancel: PropTypes.func,\n /**\n * An object containing all the labels for the dropdown.\n */\n labels: PropTypes.instanceOf(Object).isRequired,\n /**\n * If 'true' the dropdown will notify on the first render.\n */\n notifyChangesOnFirstRender: PropTypes.bool,\n /**\n * If `true` the dropdown will show tooltips when user mouseenter text in list\n */\n hasTooltips: PropTypes.bool,\n /**\n * If `true`, selection can be toggled when single selection.\n */\n singleSelectionToggle: PropTypes.bool.isRequired,\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\nexport default withStyles(styles, { name: \"HvDropdownList\" })(List);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACvE,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,cAAc;AAChC,SAASC,UAAU,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,aAAa;AAE9D,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,MAAM,EAAEC,OAAO,EAAEC,YAAY,QAAQ,OAAO;AACxF,SAASC,WAAW,QAAQ,UAAU;AACtC,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,mBAAmB,MAAM,wCAAwC;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;AAAA;AAAA;AAQA,MAAMC,KAAK,GAAIC,MAAM,IAAKA,MAAM,CAACC,GAAG,CAAEC,KAAK,sBAAWA,KAAK,CAAG,CAAC;;AAE/D;AACA;AACA;AACA,MAAMC,WAAW,GAAIC,GAAG,IAAKA,GAAG,CAACH,GAAG,CAAEI,IAAI,oCAAWA,IAAI;EAAEC,QAAQ,EAAE;AAAK,EAAG,CAAC;AAE9E,MAAMC,WAAW,GAAIP,MAAM,IAAK,CAACf,KAAK,CAACe,MAAM,CAAC,IAAI,CAAAA,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEQ,MAAM,IAAG,CAAC;AAEpE,MAAMC,IAAI,GAAG,QAgBP;EAAA,IAhBQ;MACZC,EAAE;MACFC,OAAO;MACPX,MAAM,GAAG,EAAE;MACXY,WAAW,GAAG,KAAK;MACnBC,UAAU,GAAG,KAAK;MAClBC,QAAQ;MACRC,QAAQ;MACRC,MAAM;MACNC,0BAA0B,GAAG,KAAK;MAClCC,WAAW,GAAG,KA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F;AACA;EACEvE,SAAS,EAAEtC,SAAS,CAAC6G,MAAM;EAC3B;AACF;AACA;EACEtE,WAAW,EAAEvC,SAAS,CAAC2G;AACzB,CAAC;AAED,eAAexG,UAAU,CAACU,MAAM,EAAE;EAAEiG,IAAI,EAAE;AAAiB,CAAC,CAAC,CAACrF,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "A collection of React components for the Hitachi Vantara's Design System.",
|
|
5
5
|
"homepage": "https://github.com/lumada-design/hv-uikit-react",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@hitachivantara/uikit-common-themes": "^4.0.3",
|
|
48
|
-
"@hitachivantara/uikit-react-icons": "^4.0.
|
|
48
|
+
"@hitachivantara/uikit-react-icons": "^4.0.4",
|
|
49
49
|
"@popperjs/core": "2.11.5",
|
|
50
50
|
"@types/react-table": "^7.7.12",
|
|
51
51
|
"attr-accept": "^2.2.2",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "5212d5d63e44583064ade7cfd1ecfceec91ca7b9"
|
|
87
87
|
}
|