Liferay.Loader.define("data-engine-js-components-web@1.0.107/js/core/components/FieldRepeatableDND",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd","liferay!frontend-js-react-web$react-dnd-html5-backend","./FieldDragPreview.es"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=_interopRequireDefault(t("liferay!frontend-js-react-web$classnames")),n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=_getRequireWildcardCache();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}t.default=e,r&&r.set(e,t);return t}(t("liferay!frontend-js-react-web$react")),i=t("liferay!frontend-js-react-web$react-dnd"),d=t("liferay!frontend-js-react-web$react-dnd-html5-backend"),f=_interopRequireDefault(t("./FieldDragPreview.es"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=({children:e,field:r,index:t,nestedFieldIndex:l})=>{const c=(0,n.useRef)(null),[{isDragging:o},u,s]=(0,i.useDrag)({canDrop:()=>!0,item:{id:r.fieldName,index:t,nestedFieldIndex:l,preview:()=>n.default.createElement(f.default,{className:"lfr-forms__form-view-field-dragging",containerRef:c}),type:r.fieldName}});return(0,n.useEffect)((()=>{s((0,d.getEmptyImage)(),{captureDraggingState:!0})}),[s]),n.default.createElement("div",{className:(0,a.default)("lfr-forms__form-view-field-repeatable-dnd",{"lfr-forms__form-view-field-repeatable-dnd--dragging":o}),ref:e=>{u(e),c.current=e}},n.default.createElement("div",{className:"lfr-forms__form-view-field-topbar"},r.label),"function"==typeof e?e({field:r,index:t}):e)};r.default=_default}}));
//# sourceMappingURL=FieldRepeatableDND.js.map