@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
|
|
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
|
|
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
|
|
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;
|