@corva/ui 0.53.0-rc.0 → 0.53.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
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,
|
|
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};
|