import{O as n,m as e,A as o,n as t,R as a,P as r,B as i,o as l,q as s,r as c,s as d,y as u,z as p,g as m}from"../../vendor.js";import{useRef as f}from"react";import{u as v}from"../../hooks.js";import{C as x}from"../Catalogue/index.js";import{O as j}from"../Option/index.js";import{E as h}from"../Element/index.js";import{E as k}from"../Editable/index.js";import{s as g}from"./index.settings.js";import{I as N}from"../Icon/index.js";import{T as b}from"../Text/index.js";var C=["element","className","onPrepend","onAppend","onRemove"];function E(n,e){var o=u(n);if(p){var t=p(n);e&&(t=m(t).call(t,(function(e){return d(n,e).enumerable}))),o.push.apply(o,t)}return o}function A(n){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?E(Object(o),!0).forEach((function(e){t(n,e,o[e])})):l?s(n,l(o)):E(Object(o)).forEach((function(e){c(n,e,d(o,e))}))}return n}var O=function(l){var s,c,d=l.element,u=l.className,p=l.onPrepend,m=l.onAppend,E=l.onRemove,O=n(l,C),z=f(),D=f(),P=f(),y=f(),I=v(),R=I.addElement,T=I.moveElement,q=I.getText,w=I.oakRef;return e.jsxs("div",A(A({},O),{},{className:o("oak-col",t({},"oak-col-"+d.size,d.size&&"fluid"!==d.size),u),children:[e.jsxs("div",{className:"oak-col-wrapper",children:[e.jsx("div",{className:"oak-divider oak-prepend",children:e.jsx(a,{placement:"right",container:(null==w?void 0:w.current)||".oak",text:e.jsx(b,{name:"core.tooltips.addColumn",default:"Add column"}),children:e.jsx("a",{href:"#",draggable:!1,onClick:function(n){n.preventDefault(),null==p||p()},children:e.jsx(N,{className:"oak-append-icon",children:"add"})})})}),e.jsx(r,{disabled:d.content.length>0,onDrop:function(n){null==T||T(n,d,{parent:d.content,position:"after"})},children:e.jsxs("div",{className:"oak-col-inner",children:[d.content.length>0&&e.jsx(x,{ref:D,onAppend:function(n){var e,o,t=(null===(e=n.construct)||void 0===e?void 0:e.call(n))||{};null==R||R(A(A({},t),{},{content:"function"==typeof t.content?t.content(q):t.content}),{parent:d.content,position:"before"}),null===(o=D.current)||void 0===o||o.close()},onPaste:function(n){var e;R(n,{parent:d.content,position:"before",normalizeOptions:{resetIds:!0}}),null===(e=D.current)||void 0===e||e.close()}}),(null===(s=d.content)||void 0===s?void 0:s.length)>0&&e.jsx("div",{className:"oak-col-content",children:null===(c=d.content)||void 0===c?void 0:i(c).call(c,(function(n,o){return e.jsx(h,{index:o,parent:d.content,element:n},n.id||o)}))}),e.jsx(x,{ref:P,onAppend:function(n){var e,o,t=(null===(e=n.construct)||void 0===e?void 0:e.call(n))||{};null==R||R(A(A({},t),{},{content:"function"==typeof t.content?t.content(q):t.content}),{parent:d.content,position:"after"}),null===(o=P.current)||void 0===o||o.close()},onPaste:function(n){var e;R(n,{parent:d.content,position:"after",normalizeOptions:{resetIds:!0}}),null===(e=P.current)||void 0===e||e.close()}})]})}),e.jsx("div",{className:"oak-divider oak-append",children:e.jsx(a,{placement:"left",container:(null==w?void 0:w.current)||".oak",text:e.jsx(b,{name:"core.tooltips.addColumn",default:"Add column"}),children:e.jsx("a",{href:"#",draggable:!1,onClick:function(n){n.preventDefault(),null==m||m()},children:e.jsx(N,{className:"oak-append-icon",children:"add"})})})}),e.jsxs("div",{className:"oak-options",children:[e.jsx(k,{ref:z,element:d,component:{settings:g},container:y,children:e.jsx(j,{className:"oak-edit",option:{icon:"edit"},onClick:function(n){var e;n.preventDefault(),null===(e=z.current)||void 0===e||e.toggle()},name:e.jsx(b,{name:"core.tooltips.edit",default:"Edit"})})}),e.jsx(j,{className:"oak-remove",option:{icon:"clear"},onClick:function(n){n.preventDefault(),null==E||E()},name:e.jsx(b,{name:"core.tooltips.remove",default:"Remove"})})]})]}),e.jsx("div",{ref:y})]}))};export{O as C};
//# sourceMappingURL=index.js.map
