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