Liferay.Loader.define("@liferay/frontend-data-set-web@1.0.31/views/table/TableCell",["module","exports","require","liferay!frontend-js-react-web$react","../../FrontendDataSetContext","../../data_renderers/DefaultRenderer","../../utils/dataRenderers","./dnd_table/Cell"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=r?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),a=i(n("../../FrontendDataSetContext")),o=i(n("../../data_renderers/DefaultRenderer")),l=n("../../utils/dataRenderers"),u=i(n("./dnd_table/Cell"));function i(e){return e&&e.__esModule?e:{default:e}}function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function s(e){let{itemId:t,options:n,rootPropertyName:o,type:u,value:i,valuePath:d}=e,s=c(e,["itemId","options","rootPropertyName","type","value","valuePath"]);const[p,m]=(0,r.useState)((()=>(0,l.getInputRendererById)(u))),{itemsChanges:y,updateItem:v}=(0,r.useContext)(a.default);(0,r.useEffect)((()=>{m((()=>(0,l.getInputRendererById)(u)))}),[u]);let b=i;return y[t]&&void 0!==y[t][o]&&(b=y[t][o].value),r.default.createElement(p,f({},s,{itemId:t,options:n,updateItem:e=>v(t,o,d,e),value:b}))}var p=function({actions:e,inlineEditSettings:t,itemData:n,itemId:i,itemInlineChanges:d,options:f,rootPropertyName:c,value:p,valuePath:m,view:y}){const{customDataRenderers:v,inlineEditingSettings:b}=(0,r.useContext)(a.default),[g,O]=(0,r.useState)(!1),P=y.contentRenderer;let h=o.default;P&&(h=v&&v[P]?v[P]:(0,l.getDataRendererById)(P)),y.contentRendererModuleURL&&(h=null);const[R,j]=(0,r.useState)((()=>h));return(0,r.useEffect)((()=>{g||!y.contentRendererModuleURL||R||(O(!0),(0,l.getDataRendererByURL)(y.contentRendererModuleURL).then((e=>{j((()=>e)),O(!1)})).catch((()=>{j((()=>null)),O(!1)})))}),[y,g,R]),t&&(d||(null==b?void 0:b.alwaysOn))?r.default.createElement(u.default,{columnName:String(f.fieldName)},r.default.createElement(s,{actions:e,itemData:n,itemId:i,options:f,rootPropertyName:c,type:t.type,value:p,valuePath:m})):r.default.createElement(u.default,{columnName:String(f.fieldName)},R&&!g?r.default.createElement(R,{actions:e,itemData:n,itemId:i,options:f,rootPropertyName:c,value:p,valuePath:m}):r.default.createElement("span",{"aria-hidden":"true",className:"loading-animation loading-animation-sm"}))};t.default=p}}));
//# sourceMappingURL=TableCell.js.map