@corva/ui 0.60.0-0 → 0.60.0-1
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/cjs-bundle/components/Template/TemplatePopover/Styles.js +1 -1
- package/cjs-bundle/components/Template/TemplatePopover/index.js +1 -1
- package/components/Chart/options.d.ts +7 -0
- package/components/Chart/options.d.ts.map +1 -1
- package/components/Template/TemplatePopover/Styles.d.ts.map +1 -1
- package/components/Template/TemplatePopover/Styles.js +1 -1
- package/components/Template/TemplatePopover/index.d.ts.map +1 -1
- package/components/Template/TemplatePopover/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core").makeStyles((function(e){return{paper:{background:"#414141",color:e.palette.text.primary,width:"360px",minHeight:"520px",padding:"24px 16px",marginLeft:e.spacing(1)},paperWrapper:{width:"100%",height:"100%"},titleWrapper:{display:"flex",alignItems:"baseline"},title:{fontSize:"20px",lineHeight:"23px",marginBottom:e.spacing(1),marginRight:e.spacing(1)},templateHeader:{display:"flex",alignItems:"center"},subtitle:{fontSize:"10px",color:"#9E9E9E",lineHeight:"12px",textTransform:"uppercase",fontWeight:500,letterSpacing:"0.4px",marginBottom:e.spacing(2),marginTop:e.spacing(2)},selectedGroup:{display:"flex",width:"calc(100% + 32px)",height:"48px",marginLeft:"-16px",cursor:"pointer"},selectedGroupUnSelected:{"&:hover":{backgroundColor:"rgb(75, 75, 75)"}},selectedGroupSelected:{backgroundColor:"rgb(84, 84, 84)"},noTemplateItem:{display:"flex",marginLeft:"16px"},selectedIcon:{marginRight:"8px",height:"100%"},selectedLabel:{width:"100%",fontSize:"16px",fontWeight:"500",lineHeight:"48px",color:"#FFFFFF"},noTemplateLabel:{left:"40px",top:"calc(50% - 10px)",fontSize:"16px",lineHeight:"140.6%",color:"#808080",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},templateList:{padding:0,marginLeft:"-16px",width:"calc(100% + 32px)"},templateListItem:{position:"relative",padding:"0 16px",height:"48px",cursor:"pointer"},templateListItemUnSelected:{"&:hover":{backgroundColor:"rgb(75, 75, 75)"},"&:hover $actionWrapper":{backgroundColor:"rgb(75, 75, 75)",visibility:"visible"}},templateListItemSelected:{backgroundColor:"rgb(84, 84, 84)","&:hover $actionWrapper":{backgroundColor:"rgb(84, 84, 84)",visibility:"visible"}},templateListItemName:{marginLeft:e.spacing(1),maxWidth:"160px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},templateListItemInput:{marginLeft:e.spacing(1),width:"225px"},actionWrapper:{position:"absolute",right:0,top:0,height:"100%",display:"flex",alignItems:"center",marginRight:"16px",visibility:"hidden"},actionWrapperEditing:{visibility:"visible"},actionIconButton:{padding:"6px","&:hover":{backgroundColor:"#333333"},"&:hover $actionIcon":{color:"#fff"}},actionIcon:{color:"#DADADA",fontSize:"20px"},addNewTemplateIcon:{marginLeft:"10px",fontSize:"20px",cursor:"pointer","&:hover":{color:"#008BA3"}}}}));exports.useTemplatePopoverStyles=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core").makeStyles((function(e){return{paper:{background:"#414141",color:e.palette.text.primary,width:"360px",minHeight:"520px",padding:"24px 16px",marginLeft:e.spacing(1)},paperWrapper:{width:"100%",height:"100%"},titleWrapper:{display:"flex",alignItems:"baseline"},title:{fontSize:"20px",lineHeight:"23px",marginBottom:e.spacing(1),marginRight:e.spacing(1)},templateHeader:{display:"flex",alignItems:"center"},subtitle:{fontSize:"10px",color:"#9E9E9E",lineHeight:"12px",textTransform:"uppercase",fontWeight:500,letterSpacing:"0.4px",marginBottom:e.spacing(2),marginTop:e.spacing(2)},selectedGroup:{display:"flex",width:"calc(100% + 32px)",height:"48px",marginLeft:"-16px",cursor:"pointer"},selectedGroupUnSelected:{"&:hover":{backgroundColor:"rgb(75, 75, 75)"}},selectedGroupSelected:{backgroundColor:"rgb(84, 84, 84)"},noTemplateItem:{display:"flex",marginLeft:"16px"},selectedIcon:{marginRight:"8px",height:"100%"},selectedLabel:{width:"100%",fontSize:"16px",fontWeight:"500",lineHeight:"48px",color:"#FFFFFF"},noTemplateLabel:{left:"40px",top:"calc(50% - 10px)",fontSize:"16px",lineHeight:"140.6%",color:"#808080",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},templateList:{padding:0,marginLeft:"-16px",width:"calc(100% + 32px)"},templateListItem:{position:"relative",padding:"0 16px",height:"48px",cursor:"pointer"},templateListItemUnSelected:{"&:hover":{backgroundColor:"rgb(75, 75, 75)"},"&:hover $actionWrapper":{backgroundColor:"rgb(75, 75, 75)",visibility:"visible"}},templateListItemSelected:{backgroundColor:"rgb(84, 84, 84)","&:hover $actionWrapper":{backgroundColor:"rgb(84, 84, 84)",visibility:"visible"}},templateListItemName:{marginLeft:e.spacing(1),maxWidth:"160px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},templateListItemInput:{marginLeft:e.spacing(1),width:"225px"},actionWrapper:{position:"absolute",right:0,top:0,height:"100%",display:"flex",alignItems:"center",marginRight:"16px",visibility:"hidden"},actionWrapperEditing:{visibility:"visible"},actionWrapperHidden:{visibility:"hidden !important"},actionIconButton:{padding:"6px","&:hover":{backgroundColor:"#333333"},"&:hover $actionIcon":{color:"#fff"}},actionIcon:{color:"#DADADA",fontSize:"20px"},addNewTemplateIcon:{marginLeft:"10px",fontSize:"20px",cursor:"pointer","&:hover":{color:"#008BA3"}}}}));exports.useTemplatePopoverStyles=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),a=require("react"),n=require("prop-types"),i=require("@material-ui/core"),l=require("@material-ui/icons"),r=require("classnames"),s=require("lodash"),o=require("../TemplateSharingDialog/index.js"),c=require("./Styles.js"),u=require("react/jsx-runtime");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p,m,f=d(e),h=d(t),g=d(n),j=d(r);function x(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),a=require("react"),n=require("prop-types"),i=require("@material-ui/core"),l=require("@material-ui/icons"),r=require("classnames"),s=require("lodash"),o=require("../TemplateSharingDialog/index.js"),c=require("./Styles.js"),u=require("react/jsx-runtime");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p,m,f=d(e),h=d(t),g=d(n),j=d(r);function x(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function T(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?x(Object(a),!0).forEach((function(t){h.default(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):x(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var y="USER",N="DEFAULT",S="SHARED",v=(p={},h.default(p,y,"No templates yet..."),h.default(p,N,"No templates yet..."),h.default(p,S,"No shared templates yet..."),p),b=(m={},h.default(m,y,"My Template"),h.default(m,N,"Default Templates"),h.default(m,S,"Shared With Me"),m);function C(e){var t,n=e.currentUser,r=e.open,d=e.anchorEl,p=e.anchorOrigin,m=e.transformOrigin,g=e.onClose,x=e.templates,C=e.activeTemplateId,I=e.getDefaultTemplates,q=e.getUserTemplates,E=e.getSharedTemplates,O=e.onAddNewTemplate,P=e.onTemplateDelete,R=e.onTemplateCopy,L=e.onTemplateEdit,k=e.onTemplateShare,D=e.onActiveTemplateChange,B=e.loading,z=e.classes,w=e.hasNameSlot,U=e.renderSlot,A=c.useTemplatePopoverStyles(),F=a.useState(x),W=f.default(F,2),M=W[0],G=W[1],H=a.useState(null),K=f.default(H,2),J=K[0],Q=K[1],V=a.useState({}),X=f.default(V,2),Y=X[0],Z=X[1];a.useEffect((function(){G(x)}),[x]);var $=a.useMemo((function(){return[{type:y,templatesList:q(M)},{type:N,templatesList:I(M)},{type:S,templatesList:E(M)}]}),[M]),_=function(e){return function(){D(e)}},ee=function(e,t){return function(a){a.stopPropagation(),t(e)}},te=function(e){return function(t){t.stopPropagation(),G(M.map((function(t){return t.id===e?T(T({},t),{},{isEditing:!0,prevName:t.name}):t})))}},ae=function(e){return function(t){t.stopPropagation(),G(M.map((function(t){return t.id===e?T(T({},t),{},{isEditing:!1}):t})));var a=M.find((function(t){return t.id===e}));L(s.omit(a,["prevName","isEditing"]))}},ne=function(e){return function(t){t.stopPropagation(),G(M.map((function(t){return t.id===e?T(T({},t),{},{name:t.prevName,isEditing:!1}):t})))}},ie=function(e){return function(t){if("Enter"===t.key){G(M.map((function(t){return t.id===e?T(T({},t),{},{isEditing:!1}):t})));var a=M.find((function(t){return t.id===e}));L(s.omit(a,["prevName","isEditing"]))}}},le=function(e){return function(t){t.stopPropagation();var a=M.find((function(t){return t.id===e}));Q(a)}},re=function(){Q(null)};return u.jsxs(i.Popover,{id:"app-settings-template-popper",classes:{paper:j.default(A.paper,z.paper)},open:r,anchorEl:d,onClose:g,anchorOrigin:p,transformOrigin:m,children:[u.jsxs("div",{className:A.paperWrapper,children:[u.jsxs("div",{className:A.titleWrapper,children:[u.jsx(i.Typography,{className:A.title,children:"Templates"}),B&&u.jsx(i.CircularProgress,{size:16})]}),u.jsx("div",{className:j.default(A.selectedGroup,(t={},h.default(t,A.selectedGroupSelected,-100===C),h.default(t,A.selectedGroupUnSelected,-100!==C),t)),onClick:_(-100),children:u.jsxs("div",{className:A.noTemplateItem,children:[-100===C?u.jsx(l.Check,{fontSize:"small",className:A.selectedIcon}):u.jsx(l.LayersClear,{fontSize:"small",className:A.selectedIcon}),u.jsx("div",{className:A.selectedLabel,children:"No Template Selected"})]})}),$.map((function(e){var t=e.type,n=e.templatesList;return u.jsxs(a.Fragment,{children:[u.jsxs("div",{className:A.templateHeader,children:[u.jsx(i.Typography,{className:A.subtitle,children:b[t]}),t===y&&u.jsx(i.Tooltip,{title:"Create Template",placement:"right",children:u.jsx(l.AddCircle,{fontSize:"small",color:"primary",className:A.addNewTemplateIcon,onClick:O})})]}),0===n.length?u.jsx(i.Typography,{className:A.noTemplateLabel,children:v[t]}):u.jsx(i.List,{className:A.templateList,children:n.map((function(e){var a,n,r;return u.jsx(i.Tooltip,{title:e.disabled?e.tooltipTitle:"",children:u.jsxs(i.ListItem,{className:j.default(A.templateListItem,(a={},h.default(a,A.templateListItemSelected,e.id===C),h.default(a,A.templateListItemUnSelected,e.id!==C),a)),onClick:e.disabled?null:_(e.id),disabled:null!==(n=e.disabled)&&void 0!==n&&n,children:[e.id===C?u.jsx(l.Check,T({fontSize:"small"},e.isEditing&&{color:"primary"})):u.jsx(l.Layers,T({fontSize:"small"},e.isEditing&&{color:"primary"})),e.isEditing?u.jsx(i.TextField,{autoFocus:!0,className:A.templateListItemInput,value:e.name,onClick:function(e){return e.stopPropagation()},onChange:(r=e.id,function(e){e.stopPropagation(),M.filter((function(e){return e.id!==r})).map((function(e){return e.name})).includes(e.target.value)?Z(T(T({},Y),{},h.default({},r,"Duplicated name"))):Z(T(T({},Y),{},h.default({},r,null))),G(M.map((function(t){return t.id===r?T(T({},t),{},{name:e.target.value}):t})))}),onKeyDown:ie(e.id),error:!!Y[e.id],helperText:Y[e.id]}):u.jsx(i.Typography,{className:A.templateListItemName,children:e.name}),e.isEditing?null:w&&U(s.get(e,["settings","data"],[])),e.isEditing?u.jsxs("div",{className:j.default(A.actionWrapper,A.actionWrapperEditing),children:[u.jsx(i.Tooltip,{title:"Save",children:u.jsx(i.IconButton,{className:A.actionIconButton,onClick:ae(e.id),children:u.jsx(l.Check,{fontSize:"small",color:"primary"})})}),u.jsx(i.Tooltip,{title:"Cancel",children:u.jsx(i.IconButton,{className:A.actionIconButton,onClick:ne(e.id),children:u.jsx(l.Close,{className:A.actionIcon,fontSize:"small"})})})]}):u.jsx("div",{className:j.default(A.actionWrapper,h.default({},A.actionWrapperHidden,e.disabled)),children:t===y?u.jsxs(u.Fragment,{children:[u.jsx(i.Tooltip,{title:"Delete",children:u.jsx(i.IconButton,{className:A.actionIconButton,onClick:ee(e.id,P),children:u.jsx(l.Delete,{className:A.actionIcon,fontSize:"small"})})}),u.jsx(i.Tooltip,{title:"Rename",children:u.jsx(i.IconButton,{className:A.actionIconButton,onClick:te(e.id),children:u.jsx(l.Edit,{className:A.actionIcon,fontSize:"small"})})}),u.jsx(i.Tooltip,{title:"Copy",children:u.jsx(i.IconButton,{className:A.actionIconButton,onClick:ee(e.id,R),children:u.jsx(l.FileCopy,{className:A.actionIcon,fontSize:"small"})})}),u.jsx(i.Tooltip,{title:"Share",children:u.jsx(i.IconButton,{className:A.actionIconButton,onClick:le(e.id),children:u.jsx(l.Share,{className:A.actionIcon,fontSize:"small"})})})]}):u.jsx(i.Tooltip,{title:"Copy To My Templates",children:u.jsx(i.IconButton,{className:A.actionIconButton,onClick:ee(e.id,R),children:u.jsx(l.FileCopy,{className:A.actionIcon,fontSize:"small"})})})})]})},"template-list-item-".concat(e.id))}))})]},"template-list-".concat(t))}))]}),u.jsx(o,{title:'Share "'.concat(s.get(J,"name"),'"'),open:!!J,onSave:function(e){J&&k(J.id,e),re()},onCancel:re,currentUser:n})]})}C.propTypes={open:g.default.bool.isRequired,anchorEl:g.default.node,anchorOrigin:g.default.shape({}),transformOrigin:g.default.shape({}),onClose:g.default.func.isRequired,templates:g.default.arrayOf(g.default.shape({id:g.default.number,name:g.default.string,settings:g.default.shape({}),shared:g.default.bool})).isRequired,activeTemplateId:g.default.number.isRequired,getDefaultTemplates:g.default.func.isRequired,getUserTemplates:g.default.func.isRequired,getSharedTemplates:g.default.func.isRequired,onAddNewTemplate:g.default.func.isRequired,onTemplateDelete:g.default.func.isRequired,onTemplateCopy:g.default.func.isRequired,onTemplateEdit:g.default.func.isRequired,onTemplateShare:g.default.func.isRequired,onActiveTemplateChange:g.default.func.isRequired,loading:g.default.bool,classes:g.default.shape({paper:g.default.string}),hasNameSlot:g.default.bool,renderSlot:g.default.func.isRequired,currentUser:g.default.shape({}).isRequired},C.defaultProps={loading:!1,classes:{},hasNameSlot:!1,anchorEl:null,anchorOrigin:{},transformOrigin:{}},module.exports=C;
|
|
@@ -99,14 +99,21 @@ declare function getChartOptions({ seriesCount, recordsCount, labelMinLength, la
|
|
|
99
99
|
enabled: boolean;
|
|
100
100
|
itemStyle: {
|
|
101
101
|
color: string;
|
|
102
|
+
fontSize: string;
|
|
103
|
+
fontWeight: string;
|
|
104
|
+
fontFamily: string;
|
|
102
105
|
};
|
|
103
106
|
itemHoverStyle: {
|
|
104
107
|
color: string;
|
|
105
108
|
};
|
|
106
109
|
layout: string;
|
|
110
|
+
itemDistance: number;
|
|
107
111
|
navigation: {
|
|
108
112
|
arrowSize: number;
|
|
109
113
|
};
|
|
114
|
+
symbolWidth: number;
|
|
115
|
+
symbolHeight: number;
|
|
116
|
+
symbolPadding: number;
|
|
110
117
|
};
|
|
111
118
|
credits: {
|
|
112
119
|
enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/options.js"],"names":[],"mappings":";AAgBA
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/options.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyFC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Template/TemplatePopover/Styles.js"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Template/TemplatePopover/Styles.js"],"names":[],"mappings":"AAEA,0GAwJI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyles as e}from"@material-ui/core";var t=e((function(e){return{paper:{background:"#414141",color:e.palette.text.primary,width:"360px",minHeight:"520px",padding:"24px 16px",marginLeft:e.spacing(1)},paperWrapper:{width:"100%",height:"100%"},titleWrapper:{display:"flex",alignItems:"baseline"},title:{fontSize:"20px",lineHeight:"23px",marginBottom:e.spacing(1),marginRight:e.spacing(1)},templateHeader:{display:"flex",alignItems:"center"},subtitle:{fontSize:"10px",color:"#9E9E9E",lineHeight:"12px",textTransform:"uppercase",fontWeight:500,letterSpacing:"0.4px",marginBottom:e.spacing(2),marginTop:e.spacing(2)},selectedGroup:{display:"flex",width:"calc(100% + 32px)",height:"48px",marginLeft:"-16px",cursor:"pointer"},selectedGroupUnSelected:{"&:hover":{backgroundColor:"rgb(75, 75, 75)"}},selectedGroupSelected:{backgroundColor:"rgb(84, 84, 84)"},noTemplateItem:{display:"flex",marginLeft:"16px"},selectedIcon:{marginRight:"8px",height:"100%"},selectedLabel:{width:"100%",fontSize:"16px",fontWeight:"500",lineHeight:"48px",color:"#FFFFFF"},noTemplateLabel:{left:"40px",top:"calc(50% - 10px)",fontSize:"16px",lineHeight:"140.6%",color:"#808080",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},templateList:{padding:0,marginLeft:"-16px",width:"calc(100% + 32px)"},templateListItem:{position:"relative",padding:"0 16px",height:"48px",cursor:"pointer"},templateListItemUnSelected:{"&:hover":{backgroundColor:"rgb(75, 75, 75)"},"&:hover $actionWrapper":{backgroundColor:"rgb(75, 75, 75)",visibility:"visible"}},templateListItemSelected:{backgroundColor:"rgb(84, 84, 84)","&:hover $actionWrapper":{backgroundColor:"rgb(84, 84, 84)",visibility:"visible"}},templateListItemName:{marginLeft:e.spacing(1),maxWidth:"160px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},templateListItemInput:{marginLeft:e.spacing(1),width:"225px"},actionWrapper:{position:"absolute",right:0,top:0,height:"100%",display:"flex",alignItems:"center",marginRight:"16px",visibility:"hidden"},actionWrapperEditing:{visibility:"visible"},actionIconButton:{padding:"6px","&:hover":{backgroundColor:"#333333"},"&:hover $actionIcon":{color:"#fff"}},actionIcon:{color:"#DADADA",fontSize:"20px"},addNewTemplateIcon:{marginLeft:"10px",fontSize:"20px",cursor:"pointer","&:hover":{color:"#008BA3"}}}}));export{t as useTemplatePopoverStyles};
|
|
1
|
+
import{makeStyles as e}from"@material-ui/core";var t=e((function(e){return{paper:{background:"#414141",color:e.palette.text.primary,width:"360px",minHeight:"520px",padding:"24px 16px",marginLeft:e.spacing(1)},paperWrapper:{width:"100%",height:"100%"},titleWrapper:{display:"flex",alignItems:"baseline"},title:{fontSize:"20px",lineHeight:"23px",marginBottom:e.spacing(1),marginRight:e.spacing(1)},templateHeader:{display:"flex",alignItems:"center"},subtitle:{fontSize:"10px",color:"#9E9E9E",lineHeight:"12px",textTransform:"uppercase",fontWeight:500,letterSpacing:"0.4px",marginBottom:e.spacing(2),marginTop:e.spacing(2)},selectedGroup:{display:"flex",width:"calc(100% + 32px)",height:"48px",marginLeft:"-16px",cursor:"pointer"},selectedGroupUnSelected:{"&:hover":{backgroundColor:"rgb(75, 75, 75)"}},selectedGroupSelected:{backgroundColor:"rgb(84, 84, 84)"},noTemplateItem:{display:"flex",marginLeft:"16px"},selectedIcon:{marginRight:"8px",height:"100%"},selectedLabel:{width:"100%",fontSize:"16px",fontWeight:"500",lineHeight:"48px",color:"#FFFFFF"},noTemplateLabel:{left:"40px",top:"calc(50% - 10px)",fontSize:"16px",lineHeight:"140.6%",color:"#808080",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},templateList:{padding:0,marginLeft:"-16px",width:"calc(100% + 32px)"},templateListItem:{position:"relative",padding:"0 16px",height:"48px",cursor:"pointer"},templateListItemUnSelected:{"&:hover":{backgroundColor:"rgb(75, 75, 75)"},"&:hover $actionWrapper":{backgroundColor:"rgb(75, 75, 75)",visibility:"visible"}},templateListItemSelected:{backgroundColor:"rgb(84, 84, 84)","&:hover $actionWrapper":{backgroundColor:"rgb(84, 84, 84)",visibility:"visible"}},templateListItemName:{marginLeft:e.spacing(1),maxWidth:"160px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},templateListItemInput:{marginLeft:e.spacing(1),width:"225px"},actionWrapper:{position:"absolute",right:0,top:0,height:"100%",display:"flex",alignItems:"center",marginRight:"16px",visibility:"hidden"},actionWrapperEditing:{visibility:"visible"},actionWrapperHidden:{visibility:"hidden !important"},actionIconButton:{padding:"6px","&:hover":{backgroundColor:"#333333"},"&:hover $actionIcon":{color:"#fff"}},actionIcon:{color:"#DADADA",fontSize:"20px"},addNewTemplateIcon:{marginLeft:"10px",fontSize:"20px",cursor:"pointer","&:hover":{color:"#008BA3"}}}}));export{t as useTemplatePopoverStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Template/TemplatePopover/index.js"],"names":[],"mappings":";AAkDA;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Template/TemplatePopover/index.js"],"names":[],"mappings":";AAkDA;;;;;;;;;;;;;;;;;;;;;;gBA+UC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{useState as n,useEffect as i,useMemo as a,Fragment as r}from"react";import
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{useState as n,useEffect as i,useMemo as a,Fragment as r}from"react";import l from"prop-types";import{Popover as o,Typography as c,CircularProgress as s,Tooltip as p,List as m,ListItem as d,TextField as u,IconButton as f}from"@material-ui/core";import{Check as h,LayersClear as g,AddCircle as N,Layers as y,Close as S,Delete as T,Edit as v,FileCopy as b,Share as O}from"@material-ui/icons";import C from"classnames";import{get as E,omit as I}from"lodash";import R from"../TemplateSharingDialog/index.js";import{useTemplatePopoverStyles as P}from"./Styles.js";import{jsxs as q,jsx as D,Fragment as j}from"react/jsx-runtime";var k,L;function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function w(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?z(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var U="USER",A="DEFAULT",B="SHARED",W=(t(k={},U,"No templates yet..."),t(k,A,"No templates yet..."),t(k,B,"No shared templates yet..."),k),x=(t(L={},U,"My Template"),t(L,A,"Default Templates"),t(L,B,"Shared With Me"),L);function F(l){var k,L=l.currentUser,z=l.open,F=l.anchorEl,G=l.anchorOrigin,H=l.transformOrigin,M=l.onClose,K=l.templates,J=l.activeTemplateId,Q=l.getDefaultTemplates,V=l.getUserTemplates,X=l.getSharedTemplates,Y=l.onAddNewTemplate,Z=l.onTemplateDelete,$=l.onTemplateCopy,_=l.onTemplateEdit,ee=l.onTemplateShare,te=l.onActiveTemplateChange,ne=l.loading,ie=l.classes,ae=l.hasNameSlot,re=l.renderSlot,le=P(),oe=n(K),ce=e(oe,2),se=ce[0],pe=ce[1],me=n(null),de=e(me,2),ue=de[0],fe=de[1],he=n({}),ge=e(he,2),Ne=ge[0],ye=ge[1];i((function(){pe(K)}),[K]);var Se=a((function(){return[{type:U,templatesList:V(se)},{type:A,templatesList:Q(se)},{type:B,templatesList:X(se)}]}),[se]),Te=function(e){return function(){te(e)}},ve=function(e,t){return function(n){n.stopPropagation(),t(e)}},be=function(e){return function(t){t.stopPropagation(),pe(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!0,prevName:t.name}):t})))}},Oe=function(e){return function(t){t.stopPropagation(),pe(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!1}):t})));var n=se.find((function(t){return t.id===e}));_(I(n,["prevName","isEditing"]))}},Ce=function(e){return function(t){t.stopPropagation(),pe(se.map((function(t){return t.id===e?w(w({},t),{},{name:t.prevName,isEditing:!1}):t})))}},Ee=function(e){return function(t){if("Enter"===t.key){pe(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!1}):t})));var n=se.find((function(t){return t.id===e}));_(I(n,["prevName","isEditing"]))}}},Ie=function(e){return function(t){t.stopPropagation();var n=se.find((function(t){return t.id===e}));fe(n)}},Re=function(){fe(null)};return q(o,{id:"app-settings-template-popper",classes:{paper:C(le.paper,ie.paper)},open:z,anchorEl:F,onClose:M,anchorOrigin:G,transformOrigin:H,children:[q("div",{className:le.paperWrapper,children:[q("div",{className:le.titleWrapper,children:[D(c,{className:le.title,children:"Templates"}),ne&&D(s,{size:16})]}),D("div",{className:C(le.selectedGroup,(k={},t(k,le.selectedGroupSelected,-100===J),t(k,le.selectedGroupUnSelected,-100!==J),k)),onClick:Te(-100),children:q("div",{className:le.noTemplateItem,children:[D(-100===J?h:g,{fontSize:"small",className:le.selectedIcon}),D("div",{className:le.selectedLabel,children:"No Template Selected"})]})}),Se.map((function(e){var n=e.type,i=e.templatesList;return q(r,{children:[q("div",{className:le.templateHeader,children:[D(c,{className:le.subtitle,children:x[n]}),n===U&&D(p,{title:"Create Template",placement:"right",children:D(N,{fontSize:"small",color:"primary",className:le.addNewTemplateIcon,onClick:Y})})]}),0===i.length?D(c,{className:le.noTemplateLabel,children:W[n]}):D(m,{className:le.templateList,children:i.map((function(e){var i,a,r;return D(p,{title:e.disabled?e.tooltipTitle:"",children:q(d,{className:C(le.templateListItem,(i={},t(i,le.templateListItemSelected,e.id===J),t(i,le.templateListItemUnSelected,e.id!==J),i)),onClick:e.disabled?null:Te(e.id),disabled:null!==(a=e.disabled)&&void 0!==a&&a,children:[e.id===J?D(h,w({fontSize:"small"},e.isEditing&&{color:"primary"})):D(y,w({fontSize:"small"},e.isEditing&&{color:"primary"})),e.isEditing?D(u,{autoFocus:!0,className:le.templateListItemInput,value:e.name,onClick:function(e){return e.stopPropagation()},onChange:(r=e.id,function(e){e.stopPropagation(),se.filter((function(e){return e.id!==r})).map((function(e){return e.name})).includes(e.target.value)?ye(w(w({},Ne),{},t({},r,"Duplicated name"))):ye(w(w({},Ne),{},t({},r,null))),pe(se.map((function(t){return t.id===r?w(w({},t),{},{name:e.target.value}):t})))}),onKeyDown:Ee(e.id),error:!!Ne[e.id],helperText:Ne[e.id]}):D(c,{className:le.templateListItemName,children:e.name}),e.isEditing?null:ae&&re(E(e,["settings","data"],[])),e.isEditing?q("div",{className:C(le.actionWrapper,le.actionWrapperEditing),children:[D(p,{title:"Save",children:D(f,{className:le.actionIconButton,onClick:Oe(e.id),children:D(h,{fontSize:"small",color:"primary"})})}),D(p,{title:"Cancel",children:D(f,{className:le.actionIconButton,onClick:Ce(e.id),children:D(S,{className:le.actionIcon,fontSize:"small"})})})]}):D("div",{className:C(le.actionWrapper,t({},le.actionWrapperHidden,e.disabled)),children:n===U?q(j,{children:[D(p,{title:"Delete",children:D(f,{className:le.actionIconButton,onClick:ve(e.id,Z),children:D(T,{className:le.actionIcon,fontSize:"small"})})}),D(p,{title:"Rename",children:D(f,{className:le.actionIconButton,onClick:be(e.id),children:D(v,{className:le.actionIcon,fontSize:"small"})})}),D(p,{title:"Copy",children:D(f,{className:le.actionIconButton,onClick:ve(e.id,$),children:D(b,{className:le.actionIcon,fontSize:"small"})})}),D(p,{title:"Share",children:D(f,{className:le.actionIconButton,onClick:Ie(e.id),children:D(O,{className:le.actionIcon,fontSize:"small"})})})]}):D(p,{title:"Copy To My Templates",children:D(f,{className:le.actionIconButton,onClick:ve(e.id,$),children:D(b,{className:le.actionIcon,fontSize:"small"})})})})]})},"template-list-item-".concat(e.id))}))})]},"template-list-".concat(n))}))]}),D(R,{title:'Share "'.concat(E(ue,"name"),'"'),open:!!ue,onSave:function(e){ue&&ee(ue.id,e),Re()},onCancel:Re,currentUser:L})]})}F.propTypes={open:l.bool.isRequired,anchorEl:l.node,anchorOrigin:l.shape({}),transformOrigin:l.shape({}),onClose:l.func.isRequired,templates:l.arrayOf(l.shape({id:l.number,name:l.string,settings:l.shape({}),shared:l.bool})).isRequired,activeTemplateId:l.number.isRequired,getDefaultTemplates:l.func.isRequired,getUserTemplates:l.func.isRequired,getSharedTemplates:l.func.isRequired,onAddNewTemplate:l.func.isRequired,onTemplateDelete:l.func.isRequired,onTemplateCopy:l.func.isRequired,onTemplateEdit:l.func.isRequired,onTemplateShare:l.func.isRequired,onActiveTemplateChange:l.func.isRequired,loading:l.bool,classes:l.shape({paper:l.string}),hasNameSlot:l.bool,renderSlot:l.func.isRequired,currentUser:l.shape({}).isRequired},F.defaultProps={loading:!1,classes:{},hasNameSlot:!1,anchorEl:null,anchorOrigin:{},transformOrigin:{}};export{F as default};
|