@corva/ui 0.33.0-5 → 0.33.0-6

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
- import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/slicedToArray";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{Table as l,TableHead as o,TableRow as c,TableCell as u,TableBody as p}from"@material-ui/core";import{useState as d}from"react";import a from"@babel/runtime/helpers/objectWithoutProperties";import s from"prop-types";import{withSize as m}from"react-sizeme";import h from"./ResizableTableHeaderCell.js";import f from"./ResizableTableCell.js";function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function v(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var y=function(s){var m,b,y,O,j,w=s.children,P=s.size,g=a(s,["children","size"]),z=t(w,2),R=z[0],k=z[1],W=null==k||null===(m=k.props)||void 0===m?void 0:m.children,A=null==R||null===(b=R.props)||void 0===b||null===(y=b.children)||void 0===y||null===(O=y.props)||void 0===O||null===(j=O.children)||void 0===j?void 0:j.reduce((function(e,t){return Array.isArray(t)?e.push.apply(e,r(t)):e.push(t),e}),[]),C=1/((null==A?void 0:A.length)||1),D=null==A?void 0:A.map((function(e,r){return"cell".concat(r)})),T=d((function(){return null==D?void 0:D.reduce((function(r,t){return v(v({},r),{},e({},t,C))}),{})})),q=t(T,2),x=q[0],E=q[1],N=function(e){return E(e)};return n(l,v(v({},g),{},{children:[i(o,{children:i(c,{children:null==A?void 0:A.map((function(e,r){var t;return e?r===A.length-1?i(u,{children:null===(t=e.props)||void 0===t?void 0:t.children},e.key||r):i(h,{totalWidth:P.width,columnWidths:x,updateWidth:N,cellName:"cell".concat(r),nextCellName:"cell".concat(r+1),children:e},e.key||r):null}))})}),i(p,{children:null==W?void 0:W.map((function(e){var r,t;return i(c,{children:null==e||null===(r=e.props)||void 0===r||null===(t=r.children)||void 0===t?void 0:t.map((function(e,r){return e&&i(f,{totalWidth:P.width,widthRatio:x["cell".concat(r)],children:e},e.key||r)}))},e.key)}))})]}))};y.propTypes={children:s.node.isRequired,size:s.shape({width:s.number.isRequired}).isRequired};var O=m()(y);export default O;
1
+ import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/toConsumableArray";import n from"@babel/runtime/helpers/slicedToArray";import{jsxs as l,jsx as o}from"react/jsx-runtime";import{Table as t,TableHead as i,TableRow as p,TableCell as c,TableBody as u}from"@material-ui/core";import d from"@babel/runtime/helpers/objectWithoutProperties";import a from"prop-types";import s from"./ResizableTableHeaderCell.js";import m from"./ResizableTableCell.js";function b(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);e&&(l=l.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,l)}return n}function f(e){for(var n=1;n<arguments.length;n++){var l=null!=arguments[n]?arguments[n]:{};n%2?b(Object(l),!0).forEach((function(n){r(e,n,l[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):b(Object(l)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(l,r))}))}return e}var h=function(r){var a,b,h,y,v,O=r.children,j=d(r,["children"]),P=n(O,2),g=P[0],w=P[1],k=null==w||null===(a=w.props)||void 0===a?void 0:a.children,A=null==g||null===(b=g.props)||void 0===b||null===(h=b.children)||void 0===h||null===(y=h.props)||void 0===y||null===(v=y.children)||void 0===v?void 0:v.reduce((function(r,n){return Array.isArray(n)?r.push.apply(r,e(n)):r.push(n),r}),[]);return l(t,f(f({},j),{},{children:[o(i,{children:o(p,{children:null==A?void 0:A.map((function(r,e){var n;return r?e===A.length-1?o(c,f(f({},r.props),{},{children:null===(n=r.props)||void 0===n?void 0:n.children}),r.key||e):o(s,{cellName:"cell".concat(e),children:r},r.key||e):null}))})}),o(u,{children:null==k?void 0:k.map((function(r){var e,n;return o(p,{children:null==r||null===(e=r.props)||void 0===e||null===(n=e.children)||void 0===n?void 0:n.map((function(r,e){return r&&o(m,{children:r},r.key||e)}))},r.key)}))})]}))};h.propTypes={children:a.node.isRequired};export default h;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{jsx as r}from"react/jsx-runtime";import{makeStyles as t}from"@material-ui/core";import i from"prop-types";function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function n(r){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach((function(t){e(r,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}))}return r}var l=t({tableCellText:function(e){return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:e.width}}});function p(e){var t,i,o=e.children,p=e.widthRatio,c=e.totalWidth,u=l({width:p*c});return o?r(o.type,n(n({},o.props),{},{children:r("div",{className:u.tableCellText,children:null!==(t=null==o||null===(i=o.props)||void 0===i?void 0:i.children)&&void 0!==t?t:null})})):null}p.propTypes={children:i.node.isRequired,widthRatio:i.number.isRequired,totalWidth:i.number.isRequired};export default p;
1
+ import e from"@babel/runtime/helpers/defineProperty";import{jsx as r}from"react/jsx-runtime";import t from"prop-types";function n(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function i(e){var t,n,i=e.children;return i?r(i.type,o(o({},i.props),{},{children:r("div",{children:null!==(t=null==i||null===(n=i.props)||void 0===n?void 0:n.children)&&void 0!==t?t:null})})):null}i.propTypes={children:t.node.isRequired};export default i;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useState as n}from"react";import o from"prop-types";import a from"classnames";import{makeStyles as l}from"@material-ui/core/styles";import d from"react-draggable";function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function u(r){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach((function(t){e(r,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}))}return r}var c=l((function(e){return{resizableColumnHeader:{display:"flex",paddingRight:0,justifyContent:"space-between"},tableHeaderText:function(e){return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:0,maxWidth:e.width}},tableResizer:{width:6,borderRadius:10,opacity:.7,cursor:"col-resize",marginRight:-4,marginTop:-16,marginBottom:-16},hovered:{backgroundColor:e.palette.primary.main}}}));function p(o){var l,s,p=o.children,m=o.columnWidths,f=o.updateWidth,h=o.cellName,b=o.nextCellName,g=o.totalWidth,y=o.minWidth,v=c({width:m[h]*g}),O=n(!1),w=r(O,2),x=w[0],j=w[1];if(!p)return null;return t(p.type,u(u({width:m[h]*g},p.props),{},{children:i("div",{className:v.resizableColumnHeader,children:[t("div",{className:a(v.tableHeaderText),children:null!==(l=null==p||null===(s=p.props)||void 0===s?void 0:s.children)&&void 0!==l?l:null}),t(d,{axis:"x",defaultClassName:"DragHandle",defaultClassNameDragging:"DragHandleActive",onDrag:function(r,t){!function(r){var t,i=r/g,n=(m[h]+i)*g;n===Math.max(n,y)&&f(u(u({},m),{},(e(t={},h,m[h]+i),e(t,b,m[b]-i),t)))}(t.deltaX)},position:{x:0},zIndex:999,children:t("div",{className:a(v.tableResizer,x&&v.hovered),onMouseEnter:function(){return j(!0)},onMouseLeave:function(){return j(!1)}})})]})}))}p.propTypes={children:o.node.isRequired,columnWidths:o.shape({}).isRequired,updateWidth:o.func.isRequired,cellName:o.string.isRequired,nextCellName:o.string.isRequired,minWidth:o.number,totalWidth:o.number.isRequired},p.defaultProps={minWidth:50};export default p;
1
+ import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{TableCell as n}from"@material-ui/core";import{useState as i,useEffect as l}from"react";import a from"prop-types";import c from"classnames";import{makeStyles as u}from"@material-ui/core/styles";import p from"react-draggable";function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function d(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var m=u((function(e){return{resizableColumnHeader:{display:"flex",paddingRight:0,justifyContent:"space-between"},tableResizer:{width:6,borderRadius:10,opacity:.7,cursor:"col-resize",marginRight:-19,marginTop:-16,marginBottom:-16},hovered:{backgroundColor:e.palette.primary.main}}}));function f(e){var a,u,s=e.children,f=e.cellName,b=m(),y=i(!1),h=r(y,2),g=h[0],v=h[1],O=i(),j=r(O,2),w=j[0],P=j[1];if(l((function(){var e;P(null===(e=document.getElementById(f))||void 0===e?void 0:e.offsetWidth)})),!s)return null;return t(n,d(d({width:w,id:f},s.props),{},{children:o("div",{className:b.resizableColumnHeader,children:[t("div",{children:null!==(a=null==s||null===(u=s.props)||void 0===u?void 0:u.children)&&void 0!==a?a:null}),t(p,{axis:"x",onDrag:function(e,r){var t=r.deltaX;r.x,r.lastX;!function(e){P(w+e)}(t)},position:{x:0},zIndex:999,onStart:function(){P(w),v(!0)},onStop:function(){v(!1)},children:t("div",{className:c(b.tableResizer,g&&b.hovered),onMouseEnter:function(){return v(!0)},onMouseLeave:function(){return v(!1)}})})]})}))}f.propTypes={children:a.node.isRequired,cellName:a.string.isRequired};export default f;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.33.0-5",
3
+ "version": "0.33.0-6",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"