@corva/ui 0.52.0-rc.0 → 0.52.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.
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedTable.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualizedTable/VirtualizedTable.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AA4FnC,aAAK,8BAA8B,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAEtG,eAAO,MAAM,yBAAyB;sQAmBnC,8BAA8B,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+K9C,CAAA;AAED,QAAA,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCvC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaF,wBAAgE"}
1
+ {"version":3,"file":"VirtualizedTable.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualizedTable/VirtualizedTable.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AA4FnC,aAAK,8BAA8B,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAEtG,eAAO,MAAM,yBAAyB;sQAmBnC,8BAA8B,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6K9C,CAAA;AAED,QAAA,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCvC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaF,wBAAgE"}
@@ -1 +1 @@
1
- import{__assign as e,__spreadArray as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as r,Fragment as n,jsxs as i}from"react/jsx-runtime";import{useMemo as o,useEffect as a}from"react";import l from"prop-types";import s from"classnames";import{Table as u,Column as c,SortDirection as d}from"react-virtualized";import{withStyles as m,IconButton as h,Typography as f,Tooltip as g}from"@material-ui/core";import{Settings as p,Sort as b,ArrowUpward as y,ArrowDownward as w}from"@material-ui/icons";import{getUnitDisplay as S}from"../../utils/convert.js";function R(e,t){var r=e.find((function(e){return e.key===t}))||{},n=r.unitType,i=r.customUnit;return i?"(".concat(i,")"):n?"(".concat(S(n),")"):""}function x(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelClassName||""}function v(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelUnitClassName||""}var C=function(l){var m=l.columns,S=l.data,C=l.useColumnSetting,_=l.useFixedColumnWidth,z=l.onOpenSettingDlg,k=l.classes,T=l.width,q=l.height,I=l.headerHeight,N=l.rowHeight,L=l.showTopSettingIcon,D=l.customMuiStyles,H=l.isTopSettingIconShownAlways,B=l.CustomCellRenderer,W=l.customRowStyle,O=l.sort,j=l.sortBy,A=l.sortDirection,F=e(e({},k),D),K=o((function(){return{label:"",key:"setting",width:C?25:0}}),[C]),V=o((function(){return m.filter((function(e){return e.show}))}),[m]),M=o((function(){return C?t(t([],V,!0),[K],!1):V}),[V,C,K]),E=o((function(){var e;if(T<=0)return{};var t=((e={})[K.key]=K.width,e),r=[];return V.filter((function(e){return Number.isFinite(e.width)})).forEach((function(e){t[e.key]=e.width-1,r.push(e.width-1)})),V.filter((function(e){return!Number.isFinite(e.width)})).forEach((function(e){var n=r.reduce((function(e,t){return e+t}),0),i=Math.floor((T-n-K.width)/(V.length-r.length)),o=e.minWidth||65,a=i<o?o:i;t[e.key]=a-1,r.push(a-1)})),t}),[T,V,K]),G=o((function(){return Object.values(E).reduce((function(e,t){return e+t}),0)}),[E]),U=H||G-12.5>=T;a((function(){L(U)}),[U]);var P=function(t){var n=t.label,o=t.dataKey,a=j||A||O;return o===K.key?U?null:r(h,e({size:"small","aria-label":"customize columns",className:F.settingIcon,onClick:z},{children:r(p,{fontSize:"inherit"})})):i(f,e({variant:"body2",className:s(F.headerLabel,x(m,o))},{children:[n," ",r("span",e({className:s(F.unitLabel,v(m,o))},{children:R(m,o)})),a&&o!==j&&r(g,e({title:"Sort A-Z"},{children:r(b,{fontSize:"small",className:k.sortIcon})})),a&&o===j&&(A===d.ASC?r(y,{fontSize:"small",className:k.sortIcon}):r(w,{fontSize:"small",className:k.sortIcon}))]}))},Z=function(t){var n=t.dataKey,i=t.rowData;return B?r(B,{columnKey:n,value:i[n]}):r(f,e({variant:"body2",className:F.cellData},{children:i[n]}))};return r(n,{children:r(u,e({width:_?G:T,height:q,headerHeight:I,rowClassName:function(e){var t,r=e.index;return s(((t={})[F.oddRow]=r%2==1,t))},rowHeight:N,rowCount:S.length,rowGetter:function(e){var t=e.index;return S[t]},rowStyle:W||{},className:F.table,sort:O,sortBy:j,sortDirection:A},{children:M.map((function(e){return r(c,{width:E[e.key]||0,dataKey:e.key,label:e.label,headerRenderer:P,cellRenderer:Z},e.key)}))}))})},_={columns:l.arrayOf(l.shape({show:l.bool,minWidth:l.number,width:l.number,key:l.string,label:l.string})).isRequired,data:l.arrayOf(l.shape({})).isRequired,useColumnSetting:l.bool.isRequired,useFixedColumnWidth:l.bool.isRequired,headerHeight:l.number.isRequired,rowHeight:l.number.isRequired,width:l.number.isRequired,height:l.number.isRequired,onOpenSettingDlg:l.func.isRequired,showTopSettingIcon:l.func.isRequired,sort:l.func,sortBy:l.string,sortDirection:l.string,classes:l.shape({sortIcon:l.string}).isRequired,customMuiStyles:l.shape({table:l.string,oddRow:l.string,headerLabel:l.string,cellData:l.string,unitLabel:l.string,settingIcon:l.string}).isRequired,isTopSettingIconShownAlways:l.bool.isRequired,CustomCellRenderer:l.func,customRowStyle:l.func};C.propTypes=_,C.defaultProps={CustomCellRenderer:null,customRowStyle:null,sort:null,sortBy:null,sortDirection:null};var z=m((function(e){return{table:{"& .ReactVirtualized__Table__headerRow":{textTransform:"none",borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__row":{borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__Grid":{outline:"none"},"& .ReactVirtualized__Table__headerColumn":{outline:"none"}},oddRow:{backgroundColor:e.isLightTheme?"rgba(189, 189, 189, 0.1)":"#303030"},headerLabel:{lineHeight:"14px",fontSize:"12px",fontStyle:"normal",letterSpacing:"-0.25px",display:"flex",alignItems:"center",flexWrap:"wrap"},cellData:{lineHeight:"14px",fontSize:"12px",fontWeight:"normal",fontStyle:"normal",letterSpacing:"0.15px"},unitLabel:{fontSize:"10px",opacity:.5},settingIcon:{padding:"3px",fontSize:"20px"},sortIcon:{fontSize:"16px"}}}))(C);export{C as VirtualizedTableComponent,z as default};
1
+ import{__assign as e,__spreadArray as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useMemo as i,useEffect as o}from"react";import a from"prop-types";import l from"classnames";import{Table as s,Column as u,SortDirection as c}from"react-virtualized";import{withStyles as d,IconButton as m,Typography as h,Tooltip as f}from"@material-ui/core";import{Settings as g,Sort as p,ArrowUpward as b,ArrowDownward as y}from"@material-ui/icons";import{getUnitDisplay as w}from"../../utils/convert.js";function S(e,t){var r=e.find((function(e){return e.key===t}))||{},n=r.unitType,i=r.customUnit;return i?"(".concat(i,")"):n?"(".concat(w(n),")"):""}function R(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelClassName||""}function x(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelUnitClassName||""}var v=function(a){var d=a.columns,w=a.data,v=a.useColumnSetting,C=a.useFixedColumnWidth,_=a.onOpenSettingDlg,z=a.classes,k=a.width,T=a.height,q=a.headerHeight,I=a.rowHeight,N=a.showTopSettingIcon,L=a.customMuiStyles,D=a.isTopSettingIconShownAlways,H=a.CustomCellRenderer,B=a.customRowStyle,W=a.sort,O=a.sortBy,j=a.sortDirection,A=e(e({},z),L),F=i((function(){return{label:"",key:"setting",width:v?25:0}}),[v]),K=i((function(){return d.filter((function(e){return e.show}))}),[d]),V=i((function(){return v?t(t([],K,!0),[F],!1):K}),[K,v,F]),M=i((function(){var e;if(k<=0)return{};var t=((e={})[F.key]=F.width,e),r=[];return K.filter((function(e){return Number.isFinite(e.width)})).forEach((function(e){t[e.key]=e.width-1,r.push(e.width-1)})),K.filter((function(e){return!Number.isFinite(e.width)})).forEach((function(e){var n=r.reduce((function(e,t){return e+t}),0),i=Math.floor((k-n-F.width)/(K.length-r.length)),o=e.minWidth||65,a=i<o?o:i;t[e.key]=a-1,r.push(a-1)})),t}),[k,K,F]),E=i((function(){return Object.values(M).reduce((function(e,t){return e+t}),0)}),[M]),G=D||E-12.5>=k;o((function(){N(G)}),[G]);var U=function(t){var i=t.label,o=t.dataKey,a=O||j||W;return o===F.key?G?null:r(m,e({size:"small","aria-label":"customize columns",className:A.settingIcon,onClick:_},{children:r(g,{fontSize:"inherit"})})):n(h,e({variant:"body2",className:l(A.headerLabel,R(d,o))},{children:[i," ",r("span",e({className:l(A.unitLabel,x(d,o))},{children:S(d,o)})),a&&o!==O&&r(f,e({title:"Sort A-Z"},{children:r(p,{fontSize:"small",className:z.sortIcon})})),a&&o===O&&(j===c.ASC?r(b,{fontSize:"small",className:z.sortIcon}):r(y,{fontSize:"small",className:z.sortIcon}))]}))},P=function(t){var n=t.dataKey,i=t.rowData;return H?r(H,{columnKey:n,value:i[n]}):r(h,e({variant:"body2",className:A.cellData},{children:i[n]}))};return r(s,e({width:C?E:k,height:T,headerHeight:q,rowClassName:function(e){var t,r=e.index;return l(((t={})[A.oddRow]=r%2==1,t))},rowHeight:I,rowCount:w.length,rowGetter:function(e){var t=e.index;return w[t]},rowStyle:B||{},className:A.table,sort:W,sortBy:O,sortDirection:j},{children:V.map((function(e){return r(u,{width:M[e.key]||0,dataKey:e.key,label:e.label,headerRenderer:U,cellRenderer:P},e.key)}))}))},C={columns:a.arrayOf(a.shape({show:a.bool,minWidth:a.number,width:a.number,key:a.string,label:a.string})).isRequired,data:a.arrayOf(a.shape({})).isRequired,useColumnSetting:a.bool.isRequired,useFixedColumnWidth:a.bool.isRequired,headerHeight:a.number.isRequired,rowHeight:a.number.isRequired,width:a.number.isRequired,height:a.number.isRequired,onOpenSettingDlg:a.func.isRequired,showTopSettingIcon:a.func.isRequired,sort:a.func,sortBy:a.string,sortDirection:a.string,classes:a.shape({sortIcon:a.string}).isRequired,customMuiStyles:a.shape({table:a.string,oddRow:a.string,headerLabel:a.string,cellData:a.string,unitLabel:a.string,settingIcon:a.string}).isRequired,isTopSettingIconShownAlways:a.bool.isRequired,CustomCellRenderer:a.func,customRowStyle:a.func};v.propTypes=C,v.defaultProps={CustomCellRenderer:null,customRowStyle:null,sort:null,sortBy:null,sortDirection:null};var _=d((function(e){return{table:{"& .ReactVirtualized__Table__headerRow":{textTransform:"none",borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__row":{borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__Grid":{outline:"none"},"& .ReactVirtualized__Table__headerColumn":{outline:"none"}},oddRow:{backgroundColor:e.isLightTheme?"rgba(189, 189, 189, 0.1)":"#303030"},headerLabel:{lineHeight:"14px",fontSize:"12px",fontStyle:"normal",letterSpacing:"-0.25px",display:"flex",alignItems:"center",flexWrap:"wrap"},cellData:{lineHeight:"14px",fontSize:"12px",fontWeight:"normal",fontStyle:"normal",letterSpacing:"0.15px"},unitLabel:{fontSize:"10px",opacity:.5},settingIcon:{padding:"3px",fontSize:"20px"},sortIcon:{fontSize:"16px"}}}))(v);export{v as VirtualizedTableComponent,_ as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.52.0-rc.0",
3
+ "version": "0.52.0",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"