@corva/ui 0.54.0-12 → 0.54.0-14
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.
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { PopoverProps } from '@material-ui/core';
|
|
4
4
|
interface AppSettingsPopoverProps extends PopoverProps, PropTypes.InferProps<typeof appSettingsPopoverPropTypes> {
|
|
5
5
|
}
|
|
6
|
-
declare function AppSettingsPopover({ Trigger,
|
|
6
|
+
declare function AppSettingsPopover({ Trigger, children, defaultScrollable, header, iconSettingsProps, maxHeight, modalActions, modalProps, ...popoverProps }: AppSettingsPopoverProps): JSX.Element;
|
|
7
7
|
declare namespace AppSettingsPopover {
|
|
8
8
|
var propTypes: {
|
|
9
9
|
Trigger: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
@@ -16,14 +16,18 @@ declare namespace AppSettingsPopover {
|
|
|
16
16
|
defaultScrollable: PropTypes.Requireable<boolean>;
|
|
17
17
|
maxHeight: PropTypes.Requireable<number>;
|
|
18
18
|
header: PropTypes.Requireable<string>;
|
|
19
|
+
modalActions: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
20
|
+
modalProps: PropTypes.Requireable<any>;
|
|
19
21
|
};
|
|
20
22
|
var defaultProps: {
|
|
23
|
+
defaultScrollable: boolean;
|
|
24
|
+
header: string;
|
|
21
25
|
iconSettingsProps: {
|
|
22
26
|
iconSize: string;
|
|
23
27
|
};
|
|
24
|
-
defaultScrollable: boolean;
|
|
25
28
|
maxHeight: any;
|
|
26
|
-
|
|
29
|
+
modalActions: any;
|
|
30
|
+
modalProps: {};
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
declare const appSettingsPopoverPropTypes: {
|
|
@@ -37,6 +41,8 @@ declare const appSettingsPopoverPropTypes: {
|
|
|
37
41
|
defaultScrollable: PropTypes.Requireable<boolean>;
|
|
38
42
|
maxHeight: PropTypes.Requireable<number>;
|
|
39
43
|
header: PropTypes.Requireable<string>;
|
|
44
|
+
modalActions: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
45
|
+
modalProps: PropTypes.Requireable<any>;
|
|
40
46
|
};
|
|
41
47
|
export default AppSettingsPopover;
|
|
42
48
|
//# sourceMappingURL=AppSettingsPopover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSettingsPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppSettingsPopover/AppSettingsPopover.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAc,YAAY,
|
|
1
|
+
{"version":3,"file":"AppSettingsPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppSettingsPopover/AppSettingsPopover.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAc,YAAY,EAAqB,MAAM,mBAAmB,CAAC;AAwFhF,UAAU,uBACR,SAAQ,YAAY,EAClB,SAAS,CAAC,UAAU,CAAC,OAAO,2BAA2B,CAAC;CAAG;AAE/D,iBAAS,kBAAkB,CAAC,EAC1B,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,UAAU,EACV,GAAG,YAAY,EAChB,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAoGvC;kBA9GQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;AAgH3B,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;CAWhC,CAAC;AAaF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as o,__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";import{useState as l}from"react";import n from"prop-types";import r from"classnames";import{makeStyles as c,useTheme as s,Popover as d}from"@material-ui/core";import{Settings as p,Close as m}from"@material-ui/icons";import{isNativeDetected as h}from"../../../utils/mobileDetect.js";import g from"../../IconButton/index.js";import u from"../../Modal/Modal.js";import b from"../../Button/index.js";var f=c((function(o){return{popoverPaper:{marginTop:function(o){return o.isScrollable?0:8},minWidth:286,width:286,overflowY:"hidden",backgroundColor:o.palette.background.b9,maxHeight:function(o){var e=o.maxHeight;return e?e-24:"calc(100% - 24px)"},"&.scrollable":{height:function(o){return o.maxHeight||"100%"}}},popoverHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",height:76,padding:"24px 16px 16px 16px",position:"absolute",left:0,right:0,zIndex:1,"&.scrollable":{background:"linear-gradient(to bottom, ".concat(o.palette.background.b9,", ").concat(o.palette.background.b9," 79%, rgba(65, 65, 65, 0) 100%)")}},headerTitle:{fontSize:20},popoverContentContainer:{marginTop:60,paddingTop:16,overflowX:"hidden",overflowY:"auto","&.scrollable":{height:"calc(100% - 60px)"}},popoverContent:{width:"100%"},shadow:{position:"absolute",bottom:0,width:"100%",height:16,background:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(o.palette.background.b9," 100%)")},modalRoot:{"& > div:first-child":{backgroundColor:"transparent !important"}},modalContentContainer:{height:h?"calc(100% - 16px)":"calc(100% - 126px)",maxHeight:h?"calc(100% - 16px)":"calc(100% - 126px)",maxWidth:"calc(100% - 16px)",width:"calc(100% - 16px)",marginTop:h?0:118},modalTitle:{padding:"12px 16px"},modalContent:{paddingTop:16,flexGrow:1},modalActions:{display:"flex",justifyContent:"flex-end",padding:"8px 16px"}}}));function x(n){var c,x=n.Trigger,v=n.children,C=n.defaultScrollable,T=n.header,S=n.iconSettingsProps,k=n.maxHeight,w=n.modalActions,H=n.modalProps,P=o(n,["Trigger","children","defaultScrollable","header","iconSettingsProps","maxHeight","modalActions","modalProps"]),N=l(null),y=N[0],j=N[1],A=l(!0),z=A[0],B=A[1],I=f({maxHeight:k,isScrollable:z,isNativeDetected:h}),M=s(),O=h||window.top.document.body.clientWidth<M.breakpoints.values.md,W=function(){j(null)},D=Boolean(y),E=function(o){return j(o.currentTarget)},R=w||t(b,e({variation:"secondary",onClick:W},{children:"CLOSE"}));return i(a,{children:[x?t(x,{onClick:E}):t(g,e({onClick:E,isActive:D},S,{children:t(p,{})})),!O&&i(d,e({open:D,anchorEl:y,onClose:W,anchorOrigin:{vertical:z?"top":"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},marginThreshold:12},P,{classes:e(e({},null==P?void 0:P.classes),{paper:r(I.popoverPaper,z&&"scrollable",null===(c=null==P?void 0:P.classes)||void 0===c?void 0:c.paper)})},{children:[i("div",e({className:r(I.popoverHeader,z&&"scrollable")},{children:[t("div",e({className:I.headerTitle},{children:T})),t(g,e({tooltipProps:{title:"Close"},onClick:W},{children:t(m,{})}))]})),t("div",e({className:r(I.popoverContentContainer,z&&"scrollable"),ref:function(o){o&&o.scrollHeight<=o.clientHeight&&!C&&B(!1)}},{children:t("div",e({className:I.popoverContent},{children:v}))})),t("div",{className:I.shadow})]})),O&&t(u,e({actions:R,actionsClassName:I.modalActions,contentClassName:I.modalContent,contentContainerClassName:I.modalContentContainer,rootClassName:I.modalRoot,isMobile:!1,isNative:!1,modalTitleClassName:I.modalTitle,onClose:W,open:D,stickyFooter:!0,title:T},H,{children:v}))]})}var v={Trigger:n.element,iconSettingsProps:n.shape({iconSize:n.string,tooltipProps:n.shape({title:n.string})}),defaultScrollable:n.bool,maxHeight:n.number,header:n.string,modalActions:n.node,modalProps:n.any};x.propTypes=v,x.defaultProps={defaultScrollable:!1,header:"Settings",iconSettingsProps:{iconSize:"small"},maxHeight:null,modalActions:null,modalProps:{}};export{x as default};
|