react-align
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -24,5 +24,4 @@ import { CSSProperties, ReactNode } from 'react'; | ||
editorStyle?: CSSProperties; | ||
iconSize?: number; | ||
iconColor?: string; | ||
}; | ||
export default function GridItem({ className, children, id, index, extendable, extended, disabled, style, editorStyle, iconSize, iconColor, ...props }: ItemProps): JSX.Element; | ||
export default function GridItem({ className, children, id, index, extendable, extended, disabled, style, editorStyle, iconColor, ...props }: ItemProps): JSX.Element; |
@@ -1,2 +0,2 @@ | ||
import React, { CSSProperties } from 'react'; | ||
import React from 'react'; | ||
import Icons from './icons'; | ||
@@ -7,4 +7,2 @@ export declare type Icons = keyof typeof Icons; | ||
name: string | Icons; | ||
size?: number; | ||
style?: CSSProperties; | ||
onClick?: () => void; | ||
@@ -11,0 +9,0 @@ }; |
@@ -10,3 +10,2 @@ 'use strict'; | ||
var reactBeautifulDnd = require('react-beautiful-dnd'); | ||
var glamor = require('glamor'); | ||
@@ -48,3 +47,3 @@ var Context = /*#__PURE__*/React.createContext({ | ||
var css_248z = ".wrapper{height:100%}.section,.wrapper{display:flex;justify-content:space-between}.section{flex-direction:column}.area{border:1px solid transparent;border-radius:8px;box-sizing:border-box;display:flex;position:relative}.area-transition-in{transition:all .3s ease-in-out,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.area-transition-out{transition:all .3s ease-in-out .4s,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.item{border:1px solid transparent;border-radius:6px;box-sizing:border-box;margin:6px;min-height:40px;min-width:70px;position:relative}.stretch{flex:auto}.middle{flex-grow:0;flex:auto}.just-centered{justify-content:center}.just-end{justify-content:flex-end}.end{align-items:flex-end}.hide{display:none}.overlay{background:rgba(0,0,0,.6);bottom:0;box-sizing:border-box;left:0;position:absolute;right:0;top:0}.overlay-buttons{box-sizing:border-box;display:flex;justify-content:space-between;padding:6px}"; | ||
var css_248z = ".wrapper{height:100%}.section,.wrapper{display:flex;justify-content:space-between}.section{flex-direction:column}.area{border:0 solid transparent;border-radius:8px;box-sizing:border-box;display:flex;position:relative}.area-transition-in{transition:all .3s ease-in-out,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.area-transition-out{transition:all .3s ease-in-out .4s,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.item{border:0 solid transparent;border-radius:6px;margin:6px;position:relative}.stretch{flex:auto}.middle{flex-grow:0;flex:auto}.just-centered{justify-content:center}.just-end{justify-content:flex-end}.end{align-items:flex-end}.hide{display:none}.overlay{background:rgba(0,0,0,.6);box-sizing:border-box;height:100%;left:0;position:absolute;top:0;width:100%}.overlay-buttons{box-sizing:border-box;display:flex;justify-content:space-between;padding:6px}"; | ||
styleInject(css_248z); | ||
@@ -424,27 +423,11 @@ | ||
var IconStyles = function IconStyles(size) { | ||
return glamor.css({ | ||
cursor: 'pointer', | ||
width: size || 24 + 'px', | ||
height: size || 24 + 'px', | ||
' svg': { | ||
height: size || 24 + 'px', | ||
width: size || 24 + 'px' | ||
} | ||
}); | ||
}; | ||
var Icon = function Icon(_ref) { | ||
var className = _ref.className, | ||
name = _ref.name, | ||
size = _ref.size, | ||
style = _ref.style, | ||
onClick = _ref.onClick; | ||
var LocalIconComponent = Icons[name]; | ||
return React__default.createElement(LocalIconComponent, Object.assign({ | ||
className: className | ||
}, IconStyles(size), { | ||
style: style, | ||
return React__default.createElement(LocalIconComponent, { | ||
className: className, | ||
onClick: onClick | ||
})); | ||
}); | ||
}; | ||
@@ -519,9 +502,7 @@ | ||
style: { | ||
cursor: 'pointer' | ||
cursor: 'pointer', | ||
color: iconColor | ||
} | ||
}, React__default.createElement(Icon, { | ||
name: align === 'centered' ? vertical ? 'alignCenterV' : 'alignCenter' : align === 'end' ? vertical ? 'alignEndV' : 'alignEnd' : vertical ? 'alignStartV' : 'alignStart', | ||
style: { | ||
color: iconColor | ||
} | ||
name: align === 'centered' ? vertical ? 'alignCenterV' : 'alignCenter' : align === 'end' ? vertical ? 'alignEndV' : 'alignEnd' : vertical ? 'alignStartV' : 'alignStart' | ||
})))); | ||
@@ -544,9 +525,7 @@ }); | ||
editorStyle = _ref.editorStyle, | ||
iconSize = _ref.iconSize, | ||
_ref$iconColor = _ref.iconColor, | ||
iconColor = _ref$iconColor === void 0 ? 'rgb(255, 255, 255)' : _ref$iconColor, | ||
props = _objectWithoutPropertiesLoose(_ref, ["className", "children", "id", "index", "extendable", "extended", "disabled", "style", "editorStyle", "iconSize", "iconColor"]); | ||
props = _objectWithoutPropertiesLoose(_ref, ["className", "children", "id", "index", "extendable", "extended", "disabled", "style", "editorStyle", "iconColor"]); | ||
var end = props.end, | ||
vertical = props.vertical; | ||
var vertical = props.vertical; | ||
@@ -569,6 +548,7 @@ var _useAlignContext = useAlignContext(), | ||
return { | ||
alignItems: end ? 'end' : 'start', | ||
"float": end ? 'right' : 'left' | ||
alignItems: 'start', | ||
"float": 'left', | ||
color: iconColor | ||
}; | ||
}, [end]); | ||
}, [iconColor]); | ||
var ctx = React.useMemo(function () { | ||
@@ -598,3 +578,12 @@ return { | ||
opacity: snapshot.isDragging ? 0.5 : 1 | ||
}, editing ? editorStyle : style, provided.draggableProps.style), | ||
}, editing ? editorStyle : style, provided.draggableProps.style) | ||
}), React__default.createElement("div", { | ||
style: { | ||
display: 'inline-block', | ||
position: 'relative', | ||
minHeight: isHovered && !disabled ? '35px' : undefined, | ||
width: !vertical && extended ? '100%' : undefined, | ||
minWidth: isHovered && !disabled ? extendable ? '70px' : '35px' : undefined, | ||
height: vertical && extended ? '100%' : undefined | ||
}, | ||
onMouseEnter: function onMouseEnter() { | ||
@@ -606,9 +595,3 @@ return setHovered(true); | ||
} | ||
}), React__default.createElement("div", { | ||
style: { | ||
width: '100%', | ||
height: '100%', | ||
pointerEvents: editing ? 'none' : undefined | ||
} | ||
}, typeof children === 'function' ? children(ctx) : children), React__default.createElement("div", { | ||
}, typeof children === 'function' ? children(ctx) : children, React__default.createElement("div", { | ||
className: "overlay", | ||
@@ -622,7 +605,3 @@ style: { | ||
}, React__default.createElement("div", Object.assign({}, provided.dragHandleProps), React__default.createElement(Icon, { | ||
name: "moveArrows", | ||
size: iconSize, | ||
style: { | ||
color: iconColor | ||
} | ||
name: "moveArrows" | ||
})), extendable && React__default.createElement("div", { | ||
@@ -635,8 +614,4 @@ style: { | ||
}, React__default.createElement(Icon, { | ||
name: vertical ? 'verticalExtend' : 'horizontalExtend', | ||
size: iconSize, | ||
style: { | ||
color: iconColor | ||
} | ||
}))))); | ||
name: vertical ? 'verticalExtend' : 'horizontalExtend' | ||
})))))); | ||
}); | ||
@@ -643,0 +618,0 @@ } |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,r,i,o,a,l,s,c,d,h,u,p,g,f,v,m,y,x,w=require("react"),b=(e=w)&&"object"==typeof e&&"default"in e?e.default:e,E=require("react-beautiful-dnd"),O=require("glamor"),j=w.createContext({editing:!1,isDragging:!1}),z=function(){return w.useContext(j)};function M(){return(M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function k(){return(k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function V(){return(V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function D(){return(D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function H(){return(H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(){return(N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function L(){return(L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function R(){return(R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function I(){return(I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".wrapper{height:100%}.section,.wrapper{display:flex;justify-content:space-between}.section{flex-direction:column}.area{border:1px solid transparent;border-radius:8px;box-sizing:border-box;display:flex;position:relative}.area-transition-in{transition:all .3s ease-in-out,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.area-transition-out{transition:all .3s ease-in-out .4s,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.item{border:1px solid transparent;border-radius:6px;box-sizing:border-box;margin:6px;min-height:40px;min-width:70px;position:relative}.stretch{flex:auto}.middle{flex-grow:0;flex:auto}.just-centered{justify-content:center}.just-end{justify-content:flex-end}.end{align-items:flex-end}.hide{display:none}.overlay{background:rgba(0,0,0,.6);bottom:0;box-sizing:border-box;left:0;position:absolute;right:0;top:0}.overlay-buttons{box-sizing:border-box;display:flex;justify-content:space-between;padding:6px}");var W={horizontalExtend:function(e){return w.createElement("svg",C({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=w.createElement("path",{d:"M1 20.25V3.75M23 20.25V3.75M12 12h8.5M17.5 9l3 3-3 3M12 12H4M7 15l-3-3 3-3",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))},horizontalNormal:function(e){return w.createElement("svg",k({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=w.createElement("path",{d:"M1 12h5M3 9l3 3-3 3M23 12h-5M21 15l-3-3 3-3",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),r||(r=w.createElement("rect",{x:8.75,y:2.75,width:6.5,height:18.5,rx:1.25,stroke:"currentColor",strokeWidth:1.5})))},verticalExtend:function(e){return w.createElement("svg",V({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=w.createElement("path",{d:"M3.75 1h16.5M3.75 23h16.5M12 12v8.5M15 17.5l-3 3-3-3M12 12V4M9 7l3-3 3 3",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))},verticalNormal:function(e){return w.createElement("svg",D({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o||(o=w.createElement("path",{d:"M12 1v5M15 3l-3 3-3-3M12 23v-5M9 21l3-3 3 3",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),a||(a=w.createElement("rect",{x:21.25,y:8.75,width:6.5,height:18.5,rx:1.25,transform:"rotate(90 21.25 8.75)",stroke:"currentColor",strokeWidth:1.5})))},moveArrows:function(e){return w.createElement("svg",P({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=w.createElement("path",{d:"M14.651 19.098L12 21.749l-2.652-2.651M12 15v6.75M9.348 4.902L12 2.25l2.651 2.652M12 9V2.25M4.902 14.65L2.25 12l2.652-2.652M9 12H2.25M19.098 9.348l2.652 2.651-2.652 2.652M15 12h6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))},alignStart:function(e){return w.createElement("svg",H({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=w.createElement("rect",{width:24,height:24,rx:4,fill:"#000",fillOpacity:.5})),c||(c=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 5h14v14H5V5zM4 4h16v16H4V4zm2 6a1 1 0 012 0v4a1 1 0 11-2 0v-4zm3 0a1 1 0 012 0v4a1 1 0 11-2 0v-4zm4-1a1 1 0 00-1 1v4a1 1 0 102 0v-4a1 1 0 00-1-1z",fill:"currentColor"})))},alignCenter:function(e){return w.createElement("svg",N({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),d||(d=w.createElement("rect",{width:24,height:24,rx:4,fill:"#000",fillOpacity:.5})),h||(h=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 19H5V5h14v14zm1 1H4V4h16v16zm-4-6a1 1 0 11-2 0v-4a1 1 0 112 0v4zm-3 0a1 1 0 11-2 0v-4a1 1 0 112 0v4zm-4 1a1 1 0 001-1v-4a1 1 0 10-2 0v4a1 1 0 001 1z",fill:"currentColor"})))},alignEnd:function(e){return w.createElement("svg",S({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),u||(u=w.createElement("rect",{width:24,height:24,rx:4,fill:"#000",fillOpacity:.5})),p||(p=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 19H5V5h14v14zm1 1H4V4h16v16zm-2-6a1 1 0 11-2 0v-4a1 1 0 112 0v4zm-3 0a1 1 0 11-2 0v-4a1 1 0 112 0v4zm-4 1a1 1 0 001-1v-4a1 1 0 10-2 0v4a1 1 0 001 1z",fill:"currentColor"})))},alignStartV:function(e){return w.createElement("svg",L({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),g||(g=w.createElement("rect",{y:24,width:24,height:24,rx:4,transform:"rotate(-90 0 24)",fill:"#000",fillOpacity:.5})),f||(f=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 5v14H5V5h14zm1-1v16H4V4h16zm-6 2a1 1 0 110 2h-4a1 1 0 110-2h4zm0 3a1 1 0 110 2h-4a1 1 0 110-2h4zm1 4a1 1 0 00-1-1h-4a1 1 0 100 2h4a1 1 0 001-1z",fill:"currentColor"})))},alignCenterV:function(e){return w.createElement("svg",R({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),v||(v=w.createElement("rect",{y:24,width:24,height:24,rx:4,transform:"rotate(-90 0 24)",fill:"#000",fillOpacity:.5})),m||(m=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 5v14H5V5h14zm1-1v16H4V4h16zm-6 4a1 1 0 110 2h-4a1 1 0 110-2h4zm0 3a1 1 0 110 2h-4a1 1 0 110-2h4zm1 4a1 1 0 00-1-1h-4a1 1 0 100 2h4a1 1 0 001-1z",fill:"currentColor"})))},alignEndV:function(e){return w.createElement("svg",I({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),y||(y=w.createElement("rect",{y:24,width:24,height:24,rx:4,transform:"rotate(-90 0 24)",fill:"#000",fillOpacity:.5})),x||(x=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 19V5h14v14H5zm-1 1V4h16v16H4zm6-2a1 1 0 110-2h4a1 1 0 110 2h-4zm0-3a1 1 0 110-2h4a1 1 0 110 2h-4zm-1-4a1 1 0 001 1h4a1 1 0 100-2h-4a1 1 0 00-1 1z",fill:"currentColor"})))}},A=function(e){var t,n=e.style,r=e.onClick;return b.createElement(W[e.name],Object.assign({className:e.className},O.css({cursor:"pointer",width:(t=e.size)||"24px",height:t||"24px"," svg":{height:t||"24px",width:t||"24px"}}),{style:n,onClick:r}))},F=["start","centered","end"];exports.GridArea=function(e){var t=e.id,n=e.className,r=e.vertical,i=e.stretch,o=e.end,a=e.disabled,l=e.align,s=e.onAlignChange,c=e.children,d=e.style,h=e.editorStyle,u=e.iconColor,p=void 0===u?"#FFFFFF":u,g=z(),f=g.editing,v=g.onAlignChange,m=w.useCallback((function(){var e=F[(l?F.indexOf(l)+1:0)%F.length];null==s||s(e),null==v||v(t,e)}),[l,s,v,t]),y=w.useMemo((function(){return{position:"absolute",left:r?o?0:void 0:"50%",right:r?o?void 0:0:"50%",bottom:r||o?r?"50%":void 0:0,top:r?"50%":o?0:void 0,opacity:!a&&f&&l?1:0,pointerEvents:!a&&f&&l?"auto":"none",transition:"all 0.5s ease-in-out"}}),[r,o,a,f,l]),x=w.useMemo((function(){return b.Children.map(c,(function(e){return b.cloneElement(e,{end:o,vertical:r})}))}),[c,o,r]);return b.createElement(E.Droppable,{droppableId:t,direction:r?"vertical":"horizontal",isDropDisabled:a},(function(e,t){return b.createElement("div",Object.assign({ref:e.innerRef},e.droppableProps,{className:[n,"area",i&&"stretch",o&&"end","centered"===l?"just-centered":"end"===l?"just-end":"start",f?"area-transition-in":"area-transition-out"].filter(Boolean).join(" "),style:M({flexDirection:r?"column":"row",minHeight:b.Children.count(c)||f?"26px":"0px",minWidth:b.Children.count(c)||f?"46px":"0px",opacity:t.isDraggingOver?.8:1},f?h:d)}),x,e.placeholder,b.createElement("div",{style:y},b.createElement("div",{onClick:m,style:{cursor:"pointer"}},b.createElement(A,{name:"centered"===l?r?"alignCenterV":"alignCenter":"end"===l?r?"alignEndV":"alignEnd":r?"alignStartV":"alignStart",style:{color:p}}))))}))},exports.GridItem=function(e){var t=e.className,n=e.children,r=e.id,i=e.index,o=e.extendable,a=void 0!==o&&o,l=e.extended,s=void 0!==l&&l,c=e.disabled,d=void 0!==c&&c,h=e.style,u=e.editorStyle,p=e.iconSize,g=e.iconColor,f=void 0===g?"rgb(255, 255, 255)":g,v=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}(e,["className","children","id","index","extendable","extended","disabled","style","editorStyle","iconSize","iconColor"]),m=v.end,y=v.vertical,x=z(),O=x.editing,j=x.isDragging,C=x.onExtend,k=w.useState(!1),V=k[0],D=k[1],P=w.useCallback((function(){a&&(D(!1),null==C||C(r,!s))}),[a,C,s,r]),H=w.useMemo((function(){return{alignItems:m?"end":"start",float:m?"right":"left"}}),[m]),N=w.useMemo((function(){return{id:r,editing:O,isDragging:j,isHovered:V,extended:s,extendable:a,disabled:d,index:i}}),[d,O,a,s,r,i,j,V]);return b.createElement(E.Draggable,{draggableId:r,index:i,isDragDisabled:d},(function(e,r){return b.createElement("div",Object.assign({ref:e.innerRef},e.draggableProps,{className:t+" item",style:M({flex:s&&!r.isDragging?"auto":void 0,opacity:r.isDragging?.5:1},O?u:h,e.draggableProps.style),onMouseEnter:function(){return D(!0)},onMouseLeave:function(){return D(!1)}}),b.createElement("div",{style:{width:"100%",height:"100%",pointerEvents:O?"none":void 0}},"function"==typeof n?n(N):n),b.createElement("div",{className:"overlay",style:{display:d||!O||!V||!r.isDragging&&j?"none":"block"}},b.createElement("div",{className:"overlay-buttons",style:H},b.createElement("div",Object.assign({},e.dragHandleProps),b.createElement(A,{name:"moveArrows",size:p,style:{color:f}})),a&&b.createElement("div",{style:{cursor:"pointer",marginLeft:"8px"},onClick:P},b.createElement(A,{name:y?"verticalExtend":"horizontalExtend",size:p,style:{color:f}})))))}))},exports.GridSection=function(e){var t=e.className,n=e.horizontal,r=e.stretch,i=e.fixedWidth,o=e.fixedHeight,a=e.style,l=e.editorStyle,s=e.children,c=z();return b.createElement("div",{className:"section "+t+" "+(n?"horizontal":"")+" "+(r?"stretch":""),style:M({},c.editing?l:a,"number"==typeof o?{height:o+"px"}:{},"number"==typeof i?{width:i+"px"}:{})},s)},exports.GridWrapper=function(e){var t=e.className,n=e.editing,r=e.vertical,i=e.stretch,o=e.style,a=e.editorStyle,l=e.children,s=e.onMove,c=e.onAlignChange,d=e.onExtend,h=w.useState(!1),u=h[0],p=h[1],g=w.useCallback((function(){p(!0)}),[]),f=w.useCallback((function(e,t){p(!1),!e.destination||"DROP"!==e.reason||e.destination.droppableId===e.source.droppableId&&e.destination.index===e.source.index||null==s||s(e.draggableId,e.destination.droppableId,e.destination.index,e.source.droppableId,e.source.index)}),[s]);return b.createElement("div",{className:"wrapper "+t+" "+(r&&"vertical")+" "+(i&&"stretch"),style:n?a:o},b.createElement(E.DragDropContext,{onDragStart:g,onDragEnd:f},b.createElement(j.Provider,{value:{editing:!!n,onAlignChange:c,onExtend:d,isDragging:u}},l)))},exports.Icon=A; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,r,i,o,a,l,s,c,d,h,u,p,g,v,f,m,y,w,x=require("react"),b=(e=x)&&"object"==typeof e&&"default"in e?e.default:e,E=require("react-beautiful-dnd"),O=x.createContext({editing:!1,isDragging:!1}),j=function(){return x.useContext(O)};function M(){return(M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function z(){return(z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function k(){return(k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function V(){return(V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function D(){return(D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function H(){return(H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(){return(N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function L(){return(L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function R(){return(R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".wrapper{height:100%}.section,.wrapper{display:flex;justify-content:space-between}.section{flex-direction:column}.area{border:0 solid transparent;border-radius:8px;box-sizing:border-box;display:flex;position:relative}.area-transition-in{transition:all .3s ease-in-out,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.area-transition-out{transition:all .3s ease-in-out .4s,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.item{border:0 solid transparent;border-radius:6px;margin:6px;position:relative}.stretch{flex:auto}.middle{flex-grow:0;flex:auto}.just-centered{justify-content:center}.just-end{justify-content:flex-end}.end{align-items:flex-end}.hide{display:none}.overlay{background:rgba(0,0,0,.6);box-sizing:border-box;height:100%;left:0;position:absolute;top:0;width:100%}.overlay-buttons{box-sizing:border-box;display:flex;justify-content:space-between;padding:6px}");var W={horizontalExtend:function(e){return x.createElement("svg",C({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=x.createElement("path",{d:"M1 20.25V3.75M23 20.25V3.75M12 12h8.5M17.5 9l3 3-3 3M12 12H4M7 15l-3-3 3-3",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))},horizontalNormal:function(e){return x.createElement("svg",z({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=x.createElement("path",{d:"M1 12h5M3 9l3 3-3 3M23 12h-5M21 15l-3-3 3-3",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),r||(r=x.createElement("rect",{x:8.75,y:2.75,width:6.5,height:18.5,rx:1.25,stroke:"currentColor",strokeWidth:1.5})))},verticalExtend:function(e){return x.createElement("svg",k({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=x.createElement("path",{d:"M3.75 1h16.5M3.75 23h16.5M12 12v8.5M15 17.5l-3 3-3-3M12 12V4M9 7l3-3 3 3",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))},verticalNormal:function(e){return x.createElement("svg",V({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o||(o=x.createElement("path",{d:"M12 1v5M15 3l-3 3-3-3M12 23v-5M9 21l3-3 3 3",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),a||(a=x.createElement("rect",{x:21.25,y:8.75,width:6.5,height:18.5,rx:1.25,transform:"rotate(90 21.25 8.75)",stroke:"currentColor",strokeWidth:1.5})))},moveArrows:function(e){return x.createElement("svg",D({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=x.createElement("path",{d:"M14.651 19.098L12 21.749l-2.652-2.651M12 15v6.75M9.348 4.902L12 2.25l2.651 2.652M12 9V2.25M4.902 14.65L2.25 12l2.652-2.652M9 12H2.25M19.098 9.348l2.652 2.651-2.652 2.652M15 12h6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))},alignStart:function(e){return x.createElement("svg",H({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=x.createElement("rect",{width:24,height:24,rx:4,fill:"#000",fillOpacity:.5})),c||(c=x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 5h14v14H5V5zM4 4h16v16H4V4zm2 6a1 1 0 012 0v4a1 1 0 11-2 0v-4zm3 0a1 1 0 012 0v4a1 1 0 11-2 0v-4zm4-1a1 1 0 00-1 1v4a1 1 0 102 0v-4a1 1 0 00-1-1z",fill:"currentColor"})))},alignCenter:function(e){return x.createElement("svg",P({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),d||(d=x.createElement("rect",{width:24,height:24,rx:4,fill:"#000",fillOpacity:.5})),h||(h=x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 19H5V5h14v14zm1 1H4V4h16v16zm-4-6a1 1 0 11-2 0v-4a1 1 0 112 0v4zm-3 0a1 1 0 11-2 0v-4a1 1 0 112 0v4zm-4 1a1 1 0 001-1v-4a1 1 0 10-2 0v4a1 1 0 001 1z",fill:"currentColor"})))},alignEnd:function(e){return x.createElement("svg",N({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),u||(u=x.createElement("rect",{width:24,height:24,rx:4,fill:"#000",fillOpacity:.5})),p||(p=x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 19H5V5h14v14zm1 1H4V4h16v16zm-2-6a1 1 0 11-2 0v-4a1 1 0 112 0v4zm-3 0a1 1 0 11-2 0v-4a1 1 0 112 0v4zm-4 1a1 1 0 001-1v-4a1 1 0 10-2 0v4a1 1 0 001 1z",fill:"currentColor"})))},alignStartV:function(e){return x.createElement("svg",L({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),g||(g=x.createElement("rect",{y:24,width:24,height:24,rx:4,transform:"rotate(-90 0 24)",fill:"#000",fillOpacity:.5})),v||(v=x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 5v14H5V5h14zm1-1v16H4V4h16zm-6 2a1 1 0 110 2h-4a1 1 0 110-2h4zm0 3a1 1 0 110 2h-4a1 1 0 110-2h4zm1 4a1 1 0 00-1-1h-4a1 1 0 100 2h4a1 1 0 001-1z",fill:"currentColor"})))},alignCenterV:function(e){return x.createElement("svg",R({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),f||(f=x.createElement("rect",{y:24,width:24,height:24,rx:4,transform:"rotate(-90 0 24)",fill:"#000",fillOpacity:.5})),m||(m=x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 5v14H5V5h14zm1-1v16H4V4h16zm-6 4a1 1 0 110 2h-4a1 1 0 110-2h4zm0 3a1 1 0 110 2h-4a1 1 0 110-2h4zm1 4a1 1 0 00-1-1h-4a1 1 0 100 2h4a1 1 0 001-1z",fill:"currentColor"})))},alignEndV:function(e){return x.createElement("svg",S({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),y||(y=x.createElement("rect",{y:24,width:24,height:24,rx:4,transform:"rotate(-90 0 24)",fill:"#000",fillOpacity:.5})),w||(w=x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 19V5h14v14H5zm-1 1V4h16v16H4zm6-2a1 1 0 110-2h4a1 1 0 110 2h-4zm0-3a1 1 0 110-2h4a1 1 0 110 2h-4zm-1-4a1 1 0 001 1h4a1 1 0 100-2h-4a1 1 0 00-1 1z",fill:"currentColor"})))}},I=function(e){return b.createElement(W[e.name],{className:e.className,onClick:e.onClick})},A=["start","centered","end"];exports.GridArea=function(e){var t=e.id,n=e.className,r=e.vertical,i=e.stretch,o=e.end,a=e.disabled,l=e.align,s=e.onAlignChange,c=e.children,d=e.style,h=e.editorStyle,u=e.iconColor,p=void 0===u?"#FFFFFF":u,g=j(),v=g.editing,f=g.onAlignChange,m=x.useCallback((function(){var e=A[(l?A.indexOf(l)+1:0)%A.length];null==s||s(e),null==f||f(t,e)}),[l,s,f,t]),y=x.useMemo((function(){return{position:"absolute",left:r?o?0:void 0:"50%",right:r?o?void 0:0:"50%",bottom:r||o?r?"50%":void 0:0,top:r?"50%":o?0:void 0,opacity:!a&&v&&l?1:0,pointerEvents:!a&&v&&l?"auto":"none",transition:"all 0.5s ease-in-out"}}),[r,o,a,v,l]),w=x.useMemo((function(){return b.Children.map(c,(function(e){return b.cloneElement(e,{end:o,vertical:r})}))}),[c,o,r]);return b.createElement(E.Droppable,{droppableId:t,direction:r?"vertical":"horizontal",isDropDisabled:a},(function(e,t){return b.createElement("div",Object.assign({ref:e.innerRef},e.droppableProps,{className:[n,"area",i&&"stretch",o&&"end","centered"===l?"just-centered":"end"===l?"just-end":"start",v?"area-transition-in":"area-transition-out"].filter(Boolean).join(" "),style:M({flexDirection:r?"column":"row",minHeight:b.Children.count(c)||v?"26px":"0px",minWidth:b.Children.count(c)||v?"46px":"0px",opacity:t.isDraggingOver?.8:1},v?h:d)}),w,e.placeholder,b.createElement("div",{style:y},b.createElement("div",{onClick:m,style:{cursor:"pointer",color:p}},b.createElement(I,{name:"centered"===l?r?"alignCenterV":"alignCenter":"end"===l?r?"alignEndV":"alignEnd":r?"alignStartV":"alignStart"}))))}))},exports.GridItem=function(e){var t=e.className,n=e.children,r=e.id,i=e.index,o=e.extendable,a=void 0!==o&&o,l=e.extended,s=void 0!==l&&l,c=e.disabled,d=void 0!==c&&c,h=e.style,u=e.editorStyle,p=e.iconColor,g=void 0===p?"rgb(255, 255, 255)":p,v=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}(e,["className","children","id","index","extendable","extended","disabled","style","editorStyle","iconColor"]).vertical,f=j(),m=f.editing,y=f.isDragging,w=f.onExtend,O=x.useState(!1),C=O[0],z=O[1],k=x.useCallback((function(){a&&(z(!1),null==w||w(r,!s))}),[a,w,s,r]),V=x.useMemo((function(){return{alignItems:"start",float:"left",color:g}}),[g]),D=x.useMemo((function(){return{id:r,editing:m,isDragging:y,isHovered:C,extended:s,extendable:a,disabled:d,index:i}}),[d,m,a,s,r,i,y,C]);return b.createElement(E.Draggable,{draggableId:r,index:i,isDragDisabled:d},(function(e,r){return b.createElement("div",Object.assign({ref:e.innerRef},e.draggableProps,{className:t+" item",style:M({flex:s&&!r.isDragging?"auto":void 0,opacity:r.isDragging?.5:1},m?u:h,e.draggableProps.style)}),b.createElement("div",{style:{display:"inline-block",position:"relative",minHeight:C&&!d?"35px":void 0,width:!v&&s?"100%":void 0,minWidth:C&&!d?a?"70px":"35px":void 0,height:v&&s?"100%":void 0},onMouseEnter:function(){return z(!0)},onMouseLeave:function(){return z(!1)}},"function"==typeof n?n(D):n,b.createElement("div",{className:"overlay",style:{display:d||!m||!C||!r.isDragging&&y?"none":"block"}},b.createElement("div",{className:"overlay-buttons",style:V},b.createElement("div",Object.assign({},e.dragHandleProps),b.createElement(I,{name:"moveArrows"})),a&&b.createElement("div",{style:{cursor:"pointer",marginLeft:"8px"},onClick:k},b.createElement(I,{name:v?"verticalExtend":"horizontalExtend"}))))))}))},exports.GridSection=function(e){var t=e.className,n=e.horizontal,r=e.stretch,i=e.fixedWidth,o=e.fixedHeight,a=e.style,l=e.editorStyle,s=e.children,c=j();return b.createElement("div",{className:"section "+t+" "+(n?"horizontal":"")+" "+(r?"stretch":""),style:M({},c.editing?l:a,"number"==typeof o?{height:o+"px"}:{},"number"==typeof i?{width:i+"px"}:{})},s)},exports.GridWrapper=function(e){var t=e.className,n=e.editing,r=e.vertical,i=e.stretch,o=e.style,a=e.editorStyle,l=e.children,s=e.onMove,c=e.onAlignChange,d=e.onExtend,h=x.useState(!1),u=h[0],p=h[1],g=x.useCallback((function(){p(!0)}),[]),v=x.useCallback((function(e,t){p(!1),!e.destination||"DROP"!==e.reason||e.destination.droppableId===e.source.droppableId&&e.destination.index===e.source.index||null==s||s(e.draggableId,e.destination.droppableId,e.destination.index,e.source.droppableId,e.source.index)}),[s]);return b.createElement("div",{className:"wrapper "+t+" "+(r&&"vertical")+" "+(i&&"stretch"),style:n?a:o},b.createElement(E.DragDropContext,{onDragStart:g,onDragEnd:v},b.createElement(O.Provider,{value:{editing:!!n,onAlignChange:c,onExtend:d,isDragging:u}},l)))},exports.Icon=I; | ||
//# sourceMappingURL=react-align.cjs.production.min.js.map |
import React__default, { useContext, createContext, useState, useCallback, createElement, useMemo } from 'react'; | ||
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd'; | ||
import { css } from 'glamor'; | ||
@@ -40,3 +39,3 @@ var Context = /*#__PURE__*/createContext({ | ||
var css_248z = ".wrapper{height:100%}.section,.wrapper{display:flex;justify-content:space-between}.section{flex-direction:column}.area{border:1px solid transparent;border-radius:8px;box-sizing:border-box;display:flex;position:relative}.area-transition-in{transition:all .3s ease-in-out,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.area-transition-out{transition:all .3s ease-in-out .4s,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.item{border:1px solid transparent;border-radius:6px;box-sizing:border-box;margin:6px;min-height:40px;min-width:70px;position:relative}.stretch{flex:auto}.middle{flex-grow:0;flex:auto}.just-centered{justify-content:center}.just-end{justify-content:flex-end}.end{align-items:flex-end}.hide{display:none}.overlay{background:rgba(0,0,0,.6);bottom:0;box-sizing:border-box;left:0;position:absolute;right:0;top:0}.overlay-buttons{box-sizing:border-box;display:flex;justify-content:space-between;padding:6px}"; | ||
var css_248z = ".wrapper{height:100%}.section,.wrapper{display:flex;justify-content:space-between}.section{flex-direction:column}.area{border:0 solid transparent;border-radius:8px;box-sizing:border-box;display:flex;position:relative}.area-transition-in{transition:all .3s ease-in-out,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.area-transition-out{transition:all .3s ease-in-out .4s,min-height .5s ease-in-out .2s,min-width .5s ease-in-out .2s}.item{border:0 solid transparent;border-radius:6px;margin:6px;position:relative}.stretch{flex:auto}.middle{flex-grow:0;flex:auto}.just-centered{justify-content:center}.just-end{justify-content:flex-end}.end{align-items:flex-end}.hide{display:none}.overlay{background:rgba(0,0,0,.6);box-sizing:border-box;height:100%;left:0;position:absolute;top:0;width:100%}.overlay-buttons{box-sizing:border-box;display:flex;justify-content:space-between;padding:6px}"; | ||
styleInject(css_248z); | ||
@@ -416,27 +415,11 @@ | ||
var IconStyles = function IconStyles(size) { | ||
return css({ | ||
cursor: 'pointer', | ||
width: size || 24 + 'px', | ||
height: size || 24 + 'px', | ||
' svg': { | ||
height: size || 24 + 'px', | ||
width: size || 24 + 'px' | ||
} | ||
}); | ||
}; | ||
var Icon = function Icon(_ref) { | ||
var className = _ref.className, | ||
name = _ref.name, | ||
size = _ref.size, | ||
style = _ref.style, | ||
onClick = _ref.onClick; | ||
var LocalIconComponent = Icons[name]; | ||
return React__default.createElement(LocalIconComponent, Object.assign({ | ||
className: className | ||
}, IconStyles(size), { | ||
style: style, | ||
return React__default.createElement(LocalIconComponent, { | ||
className: className, | ||
onClick: onClick | ||
})); | ||
}); | ||
}; | ||
@@ -511,9 +494,7 @@ | ||
style: { | ||
cursor: 'pointer' | ||
cursor: 'pointer', | ||
color: iconColor | ||
} | ||
}, React__default.createElement(Icon, { | ||
name: align === 'centered' ? vertical ? 'alignCenterV' : 'alignCenter' : align === 'end' ? vertical ? 'alignEndV' : 'alignEnd' : vertical ? 'alignStartV' : 'alignStart', | ||
style: { | ||
color: iconColor | ||
} | ||
name: align === 'centered' ? vertical ? 'alignCenterV' : 'alignCenter' : align === 'end' ? vertical ? 'alignEndV' : 'alignEnd' : vertical ? 'alignStartV' : 'alignStart' | ||
})))); | ||
@@ -536,9 +517,7 @@ }); | ||
editorStyle = _ref.editorStyle, | ||
iconSize = _ref.iconSize, | ||
_ref$iconColor = _ref.iconColor, | ||
iconColor = _ref$iconColor === void 0 ? 'rgb(255, 255, 255)' : _ref$iconColor, | ||
props = _objectWithoutPropertiesLoose(_ref, ["className", "children", "id", "index", "extendable", "extended", "disabled", "style", "editorStyle", "iconSize", "iconColor"]); | ||
props = _objectWithoutPropertiesLoose(_ref, ["className", "children", "id", "index", "extendable", "extended", "disabled", "style", "editorStyle", "iconColor"]); | ||
var end = props.end, | ||
vertical = props.vertical; | ||
var vertical = props.vertical; | ||
@@ -561,6 +540,7 @@ var _useAlignContext = useAlignContext(), | ||
return { | ||
alignItems: end ? 'end' : 'start', | ||
"float": end ? 'right' : 'left' | ||
alignItems: 'start', | ||
"float": 'left', | ||
color: iconColor | ||
}; | ||
}, [end]); | ||
}, [iconColor]); | ||
var ctx = useMemo(function () { | ||
@@ -590,3 +570,12 @@ return { | ||
opacity: snapshot.isDragging ? 0.5 : 1 | ||
}, editing ? editorStyle : style, provided.draggableProps.style), | ||
}, editing ? editorStyle : style, provided.draggableProps.style) | ||
}), React__default.createElement("div", { | ||
style: { | ||
display: 'inline-block', | ||
position: 'relative', | ||
minHeight: isHovered && !disabled ? '35px' : undefined, | ||
width: !vertical && extended ? '100%' : undefined, | ||
minWidth: isHovered && !disabled ? extendable ? '70px' : '35px' : undefined, | ||
height: vertical && extended ? '100%' : undefined | ||
}, | ||
onMouseEnter: function onMouseEnter() { | ||
@@ -598,9 +587,3 @@ return setHovered(true); | ||
} | ||
}), React__default.createElement("div", { | ||
style: { | ||
width: '100%', | ||
height: '100%', | ||
pointerEvents: editing ? 'none' : undefined | ||
} | ||
}, typeof children === 'function' ? children(ctx) : children), React__default.createElement("div", { | ||
}, typeof children === 'function' ? children(ctx) : children, React__default.createElement("div", { | ||
className: "overlay", | ||
@@ -614,7 +597,3 @@ style: { | ||
}, React__default.createElement("div", Object.assign({}, provided.dragHandleProps), React__default.createElement(Icon, { | ||
name: "moveArrows", | ||
size: iconSize, | ||
style: { | ||
color: iconColor | ||
} | ||
name: "moveArrows" | ||
})), extendable && React__default.createElement("div", { | ||
@@ -627,8 +606,4 @@ style: { | ||
}, React__default.createElement(Icon, { | ||
name: vertical ? 'verticalExtend' : 'horizontalExtend', | ||
size: iconSize, | ||
style: { | ||
color: iconColor | ||
} | ||
}))))); | ||
name: vertical ? 'verticalExtend' : 'horizontalExtend' | ||
})))))); | ||
}); | ||
@@ -635,0 +610,0 @@ } |
{ | ||
"name": "react-align", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"author": "KaWaite", | ||
@@ -52,20 +52,20 @@ "module": "dist/react-align.esm.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.14.3", | ||
"@size-limit/preset-small-lib": "^4.11.0", | ||
"@babel/core": "^7.15.8", | ||
"@size-limit/preset-small-lib": "^6.0.3", | ||
"@svgr/rollup": "^5.5.0", | ||
"@types/react": "^17.0.8", | ||
"@types/react": "^17.0.33", | ||
"@types/react-beautiful-dnd": "^13.1.2", | ||
"@types/react-dom": "^17.0.5", | ||
"babel-loader": "^8.2.2", | ||
"cssnano": "^5.0.7", | ||
"husky": "^6.0.0", | ||
"postcss": "^8.3.6", | ||
"@types/react-dom": "^17.0.10", | ||
"babel-loader": "^8.2.3", | ||
"cssnano": "^5.0.8", | ||
"husky": "^7.0.4", | ||
"postcss": "^8.3.11", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-is": "^17.0.2", | ||
"rollup-plugin-postcss": "^4.0.0", | ||
"size-limit": "^4.11.0", | ||
"rollup-plugin-postcss": "^4.0.1", | ||
"size-limit": "^6.0.3", | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.2.0", | ||
"typescript": "^4.2.4" | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.4.4" | ||
}, | ||
@@ -76,2 +76,2 @@ "dependencies": { | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
173038
39
1826
1