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