"use strict";var e=require("prop-types"),r=require("react-sortable-hoc"),a=require("@material-ui/core"),t=require("@material-ui/icons/DragIndicator"),i=require("react/jsx-runtime");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=l(e),o=l(t),s=a.makeStyles({draggableList:{borderNottom:"1px solid #e0e0e0",listStyle:"none",padding:"0"},draggableListItem:{cursor:"pointer",borderTop:"1px solid #e0e0e0",lineHeight:"1rem",zIndex:1500,display:"flex",alignItems:"center","&:hover $draggableListItemDraghandle":{opacity:1}},draggableListItemCheckBox:{padding:"8px"},draggableListItemDraghandle:{color:"#777",opacity:0}}),d=r.SortableHandle((function(){return i.jsx(o.default,{className:"c-draggable-list__item_draghandle",fontSize:"small"})})),c=r.SortableElement((function(e){var r=e.item,t=e.onClick,l=s();return i.jsxs("li",{className:l.draggableListItem,children:[i.jsx(d,{}),i.jsx(a.Checkbox,{className:l.draggableListItemCheckBox,color:"primary",checked:r.show,onClick:function(){return t(r)}}),i.jsx(a.Typography,{variant:"body2",children:r.customLabel||r.label||r})]})})),u=r.SortableContainer((function(e){var r=e.items,a=e.onClick,t=s();return i.jsx("ul",{className:t.draggableList,children:r.map((function(e,r){return i.jsx(c,{index:r,item:e,onClick:a,disabled:e.disabled},e.label)}))})}));function m(e){var a=e.items,t=e.onSort,l=e.onClick;return i.jsx(u,{useDragHandle:!0,items:a,onSortEnd:function(e){var i=e.oldIndex,l=e.newIndex,n=r.arrayMove(a,i,l);t(n)},onClick:l})}m.propTypes={items:n.default.arrayOf(n.default.shape({})).isRequired,onSort:n.default.func.isRequired,onClick:n.default.func.isRequired},module.exports=m;
//# sourceMappingURL=DraggableList.js.map
