@corva/ui 0.81.0-2 → 0.81.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),n=require("react"),o=require("prop-types"),r=require("classnames"),
|
|
1
|
+
"use strict";var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),n=require("react"),o=require("prop-types"),r=require("classnames"),a=require("lodash"),i=require("@material-ui/core"),s=require("../../IconButton/index.js"),l=require("../../Button/index.js"),c=require("../../../icons/iconParkIcons.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../icons/customIcons/icons/AddMessage.js"),require("../../../icons/customIcons/icons/Attention.js"),require("../../../icons/customIcons/icons/Collapse.js"),require("../../../icons/customIcons/icons/Expand.js"),require("../../../icons/customIcons/icons/FolderClosed.js"),require("../../../icons/customIcons/icons/FolderOpened.js"),require("../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../icons/customIcons/icons/Search.js"),require("../../../icons/customIcons/icons/Wellhub.js");var p=d(o),u=d(r),f=i.makeStyles((function(e){var t,n;return i.createStyles({drawer:function(e){var t;return(t={height:"100%",position:"relative",width:e.openedDrawerWidth})["&.".concat("closed")]={width:"48px"},t},drawerPaper:(t={position:"relative",width:"100%",borderRadius:function(e){return"left"===e.anchor?"0 8px 0 0":"8px 0 0 0"},backgroundColor:e.palette.background.b5},t["&.".concat("closed")]={cursor:"pointer","&:hover":{backgroundColor:e.palette.background.b7,"& > $header":{backgroundColor:e.palette.background.b7}}},t["&.MuiDrawer-paperAnchorDockedLeft"]={borderRight:"none"},t["&.MuiDrawer-paperAnchorDockedRight"]={borderLeft:"none"},t),header:(n={cursor:"pointer",alignItems:"center",backgroundColor:e.palette.background.b5,borderBottom:"1px solid",borderBottomColor:"#ffffff14",display:"flex",fontSize:16,fontWeight:400,height:48,justifyContent:"center",left:0,letterSpacing:"1px",lineHeight:"22px",position:"absolute",right:0,textTransform:"capitalize",top:0},n["&.".concat("open")]={padding:e.spacing(1.5),justifyContent:"flex-start"},n),openToggleIconOpen:{transform:"rotate(180deg)"},openToggleContainer:function(e){var t,n=e.anchor;return(t={alignItems:"center",bottom:0,display:"flex",flex:"0 0",height:48,justifyContent:"center",padding:6,position:"absolute",width:"100%"})["&.".concat("open")]={justifyContent:"left"===n?"flex-end":"flex-start",paddingRight:6},t},contentWrapper:{marginTop:48,height:"calc(100% - 96px)",overflowY:"auto"},content:{padding:"16px 12px",display:"flex",flexDirection:"column"},selectAllButton:{textTransform:"none",fontSize:"10px",lineHeight:"14px",letterSpacing:"0.4px",marginLeft:16,"& .MuiButton-iconSizeMedium > *:first-child":{fontSize:"12px !important"},"& .MuiButton-startIcon":{marginRight:4}},headerIcon:{cursor:"pointer"},headerIconText:{cursor:"pointer",paddingLeft:7,letterSpacing:1}})})),h=function(o){var r,a=o.classes,d=o.anchor,p=o.children,h=o.drawerPaperClassName,g=o.expandedTooltipTitle,m=o.collapsedTooltipTitle,x=o.header,j=o.headerIcon,I=o.headerTitleIcon,b=o.isOpen,C=o.openedDrawerWidth,T=o.setIsOpen,w=o.size,q=o.allOptionsButtonShown,O=o.isAllOptionsSelected,S=o.onAllOptionsClick,_=n.useState(!1);_[0];var k=_[1],v=n.useRef(),A=f({anchor:d,openedDrawerWidth:C||{small:235,medium:354,large:473}[w]});n.useEffect((function(){var e=v.current,t=e.scrollHeight,n=e.clientHeight;k(t>n)}));var B="left"===d?c.RightIcon:c.LeftIcon;return t.jsxs(i.Drawer,e.__assign({"data-testid":"".concat("AppSideBar","_Drawer"),onClick:function(){b||T(!0)},className:u.default(A.drawer,!b&&"closed"),variant:"permanent",classes:{paper:u.default(A.drawerPaper,h,!b&&"closed")},anchor:d},{children:[t.jsxs("div",e.__assign({className:u.default(A.header,b&&"open"),onClick:function(){b&&T(!1)}},{children:[b&&t.jsxs(t.Fragment,{children:[I||t.jsx(c.LeftAlignmentIcon,{size:24}),t.jsx("div",e.__assign({"data-testid":"".concat("AppSideBar","_header"),className:A.headerIconText},{children:x})),q&&t.jsx(l,e.__assign({className:A.selectAllButton,onClick:function(e){e.stopPropagation(),S(e)},startIcon:O?t.jsx(c.CloseSmallIcon,{size:16}):t.jsx(c.CheckSmallIcon,{size:16})},{children:O?"Clear All":"Select All"}))]}),!b&&j]})),t.jsx("div",e.__assign({className:u.default(A.contentWrapper,a.contentWrapper),ref:v},{children:t.jsx("div",e.__assign({className:u.default(A.content,a.content)},{children:b&&p}))})),t.jsx(i.Box,e.__assign({className:u.default(A.openToggleContainer,(r={},r.open=b,r))},{children:t.jsx(i.Tooltip,e.__assign({title:b?g:m,placement:"bottom"},{children:t.jsx("div",{children:t.jsx(s,e.__assign({"aria-label":"toggle sidebar",onClick:function(){T(!b)}},{children:t.jsx(B,{size:24,"data-testid":"".concat("AppSideBar","_arrowButton"),className:u.default(b&&A.openToggleIconOpen)})}))})}))}))]}))},g={classes:p.default.shape({contentWrapper:p.default.shape({}),content:p.default.shape({})}),anchor:p.default.oneOf(["left","right"]),children:p.default.node.isRequired,drawerPaperClassName:p.default.string,expandedTooltipTitle:p.default.string,collapsedTooltipTitle:p.default.string,header:p.default.node,headerIcon:p.default.node,headerTitleIcon:p.default.node,isOpen:p.default.bool,openedDrawerWidth:p.default.oneOfType([p.default.string,p.default.number]),setIsOpen:p.default.func,size:p.default.oneOf(["small","medium","large"]),allOptionsButtonShown:p.default.bool,isAllOptionsSelected:p.default.bool,onAllOptionsClick:p.default.func};h.propTypes=g,h.defaultProps={classes:{contentWrapper:{},content:{}},anchor:"left",drawerPaperClassName:"",expandedTooltipTitle:"Collapse",collapsedTooltipTitle:"Expand",header:null,headerIcon:null,headerTitleIcon:null,isOpen:!1,openedDrawerWidth:0,setIsOpen:a.noop,size:"medium",allOptionsButtonShown:!1,isAllOptionsSelected:!1,onAllOptionsClick:a.noop},module.exports=h;
|
|
@@ -5,8 +5,12 @@ export interface AppSideBarProps extends PropTypes.InferProps<typeof appSideBarP
|
|
|
5
5
|
anchor: Anchor;
|
|
6
6
|
}
|
|
7
7
|
declare const AppSideBar: {
|
|
8
|
-
({ anchor, children, drawerPaperClassName, expandedTooltipTitle, collapsedTooltipTitle, header, headerIcon, headerTitleIcon, isOpen, openedDrawerWidth, setIsOpen, size, allOptionsButtonShown, isAllOptionsSelected, onAllOptionsClick, }: AppSideBarProps): JSX.Element;
|
|
8
|
+
({ classes, anchor, children, drawerPaperClassName, expandedTooltipTitle, collapsedTooltipTitle, header, headerIcon, headerTitleIcon, isOpen, openedDrawerWidth, setIsOpen, size, allOptionsButtonShown, isAllOptionsSelected, onAllOptionsClick, }: AppSideBarProps): JSX.Element;
|
|
9
9
|
propTypes: {
|
|
10
|
+
classes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
11
|
+
contentWrapper: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
12
|
+
content: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
13
|
+
}>>;
|
|
10
14
|
anchor: PropTypes.Requireable<string>;
|
|
11
15
|
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
12
16
|
drawerPaperClassName: PropTypes.Requireable<string>;
|
|
@@ -24,6 +28,10 @@ declare const AppSideBar: {
|
|
|
24
28
|
onAllOptionsClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
29
|
};
|
|
26
30
|
defaultProps: {
|
|
31
|
+
classes: {
|
|
32
|
+
contentWrapper: {};
|
|
33
|
+
content: {};
|
|
34
|
+
};
|
|
27
35
|
anchor: string;
|
|
28
36
|
drawerPaperClassName: string;
|
|
29
37
|
expandedTooltipTitle: string;
|
|
@@ -41,6 +49,10 @@ declare const AppSideBar: {
|
|
|
41
49
|
};
|
|
42
50
|
};
|
|
43
51
|
declare const appSideBarPropTypes: {
|
|
52
|
+
classes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
53
|
+
contentWrapper: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
54
|
+
content: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
55
|
+
}>>;
|
|
44
56
|
anchor: PropTypes.Requireable<string>;
|
|
45
57
|
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
46
58
|
drawerPaperClassName: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSideBar.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppSideBar/AppSideBar.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAwBnC,aAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/B,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC;IACvF,MAAM,EAAE,MAAM,CAAC;CAChB;AA4GD,QAAA,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"AppSideBar.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppSideBar/AppSideBar.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAwBnC,aAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/B,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC;IACvF,MAAM,EAAE,MAAM,CAAC;CAChB;AA4GD,QAAA,MAAM,UAAU;yPAiBb,eAAe,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwF/B,CAAC;AAEF,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;CAiBxB,CAAC;AAsBF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsxs as o,Fragment as t,jsx as n}from"react/jsx-runtime";import{useState as r,useRef as i,useEffect as a}from"react";import s from"prop-types";import
|
|
1
|
+
import{__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsxs as o,Fragment as t,jsx as n}from"react/jsx-runtime";import{useState as r,useRef as i,useEffect as a}from"react";import s from"prop-types";import c from"classnames";import{noop as l}from"lodash";import{makeStyles as p,createStyles as d,Drawer as m,Box as u,Tooltip as h}from"@material-ui/core";import f from"../../IconButton/index.js";import g from"../../Button/index.js";import{LeftAlignmentIcon as x,CloseSmallIcon as b,CheckSmallIcon as I,RightIcon as T,LeftIcon as C}from"../../../icons/iconParkIcons.js";import"../../../icons/customIcons/icons/AddMessage.js";import"../../../icons/customIcons/icons/Attention.js";import"../../../icons/customIcons/icons/Collapse.js";import"../../../icons/customIcons/icons/Expand.js";import"../../../icons/customIcons/icons/FolderClosed.js";import"../../../icons/customIcons/icons/FolderOpened.js";import"../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../icons/customIcons/icons/LessOrEqual.js";import"../../../icons/customIcons/icons/Search.js";import"../../../icons/customIcons/icons/Wellhub.js";var w=p((function(e){var o,t;return d({drawer:function(e){var o;return(o={height:"100%",position:"relative",width:e.openedDrawerWidth})["&.".concat("closed")]={width:"48px"},o},drawerPaper:(o={position:"relative",width:"100%",borderRadius:function(e){return"left"===e.anchor?"0 8px 0 0":"8px 0 0 0"},backgroundColor:e.palette.background.b5},o["&.".concat("closed")]={cursor:"pointer","&:hover":{backgroundColor:e.palette.background.b7,"& > $header":{backgroundColor:e.palette.background.b7}}},o["&.MuiDrawer-paperAnchorDockedLeft"]={borderRight:"none"},o["&.MuiDrawer-paperAnchorDockedRight"]={borderLeft:"none"},o),header:(t={cursor:"pointer",alignItems:"center",backgroundColor:e.palette.background.b5,borderBottom:"1px solid",borderBottomColor:"#ffffff14",display:"flex",fontSize:16,fontWeight:400,height:48,justifyContent:"center",left:0,letterSpacing:"1px",lineHeight:"22px",position:"absolute",right:0,textTransform:"capitalize",top:0},t["&.".concat("open")]={padding:e.spacing(1.5),justifyContent:"flex-start"},t),openToggleIconOpen:{transform:"rotate(180deg)"},openToggleContainer:function(e){var o,t=e.anchor;return(o={alignItems:"center",bottom:0,display:"flex",flex:"0 0",height:48,justifyContent:"center",padding:6,position:"absolute",width:"100%"})["&.".concat("open")]={justifyContent:"left"===t?"flex-end":"flex-start",paddingRight:6},o},contentWrapper:{marginTop:48,height:"calc(100% - 96px)",overflowY:"auto"},content:{padding:"16px 12px",display:"flex",flexDirection:"column"},selectAllButton:{textTransform:"none",fontSize:"10px",lineHeight:"14px",letterSpacing:"0.4px",marginLeft:16,"& .MuiButton-iconSizeMedium > *:first-child":{fontSize:"12px !important"},"& .MuiButton-startIcon":{marginRight:4}},headerIcon:{cursor:"pointer"},headerIconText:{cursor:"pointer",paddingLeft:7,letterSpacing:1}})})),O=function(s){var l,p=s.classes,d=s.anchor,O=s.children,j=s.drawerPaperClassName,k=s.expandedTooltipTitle,v=s.collapsedTooltipTitle,S=s.header,A=s.headerIcon,B=s.headerTitleIcon,W=s.isOpen,z=s.openedDrawerWidth,D=s.setIsOpen,N=s.size,y=s.allOptionsButtonShown,P=s.isAllOptionsSelected,M=s.onAllOptionsClick,R=r(!1);R[0];var L=R[1],E=i(),H=w({anchor:d,openedDrawerWidth:z||{small:235,medium:354,large:473}[N]});a((function(){var e=E.current,o=e.scrollHeight,t=e.clientHeight;L(o>t)}));var _="left"===d?T:C;return o(m,e({"data-testid":"".concat("AppSideBar","_Drawer"),onClick:function(){W||D(!0)},className:c(H.drawer,!W&&"closed"),variant:"permanent",classes:{paper:c(H.drawerPaper,j,!W&&"closed")},anchor:d},{children:[o("div",e({className:c(H.header,W&&"open"),onClick:function(){W&&D(!1)}},{children:[W&&o(t,{children:[B||n(x,{size:24}),n("div",e({"data-testid":"".concat("AppSideBar","_header"),className:H.headerIconText},{children:S})),y&&n(g,e({className:H.selectAllButton,onClick:function(e){e.stopPropagation(),M(e)},startIcon:n(P?b:I,{size:16})},{children:P?"Clear All":"Select All"}))]}),!W&&A]})),n("div",e({className:c(H.contentWrapper,p.contentWrapper),ref:E},{children:n("div",e({className:c(H.content,p.content)},{children:W&&O}))})),n(u,e({className:c(H.openToggleContainer,(l={},l.open=W,l))},{children:n(h,e({title:W?k:v,placement:"bottom"},{children:n("div",{children:n(f,e({"aria-label":"toggle sidebar",onClick:function(){D(!W)}},{children:n(_,{size:24,"data-testid":"".concat("AppSideBar","_arrowButton"),className:c(W&&H.openToggleIconOpen)})}))})}))}))]}))},j={classes:s.shape({contentWrapper:s.shape({}),content:s.shape({})}),anchor:s.oneOf(["left","right"]),children:s.node.isRequired,drawerPaperClassName:s.string,expandedTooltipTitle:s.string,collapsedTooltipTitle:s.string,header:s.node,headerIcon:s.node,headerTitleIcon:s.node,isOpen:s.bool,openedDrawerWidth:s.oneOfType([s.string,s.number]),setIsOpen:s.func,size:s.oneOf(["small","medium","large"]),allOptionsButtonShown:s.bool,isAllOptionsSelected:s.bool,onAllOptionsClick:s.func};O.propTypes=j,O.defaultProps={classes:{contentWrapper:{},content:{}},anchor:"left",drawerPaperClassName:"",expandedTooltipTitle:"Collapse",collapsedTooltipTitle:"Expand",header:null,headerIcon:null,headerTitleIcon:null,isOpen:!1,openedDrawerWidth:0,setIsOpen:l,size:"medium",allOptionsButtonShown:!1,isAllOptionsSelected:!1,onAllOptionsClick:l};export{O as default};
|