Liferay.Loader.define("data-engine-js-components-web@1.0.79/js/custom/form/components/PartialResults",["module","exports","require","@frontend-taglib-clay$clayui/data-provider","frontend-js-web","liferay!frontend-js-react-web$react","../../form-report/index","./PartialResults.scss"],(function(e,t,r){var a;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=r("@frontend-taglib-clay$clayui/data-provider"),n=r("frontend-js-web"),s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=a?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=e[l]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=(a=r("../../form-report/index"))&&a.__esModule?a:{default:a};function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}r("./PartialResults.scss");var d=({dataEngineModule:e,reportDataURL:t})=>{var r;const[a,u]=(0,s.useState)((()=>"loading")),{resource:d}=(0,l.useResource)({fetch:fetch,link:t,onNetworkStatusChange:e=>{let t="idle";e<4?t="loading":5===e&&(t="error"),u(t)}}),{data:i,fields:c=[],formReportRecordsFieldValuesURL:f,lastModifiedDate:p,portletNamespace:m,totalItems:g=0}=null!==(r=d)&&void 0!==r?r:{};return(0,s.useEffect)((()=>{const e=document.querySelector(".portlet-forms"),t=document.querySelector(".locale-actions");return null==e||e.classList.add("lfr-de__partial-results--background"),null==t||t.classList.add("hide"),()=>{null==e||e.classList.remove("lfr-de__partial-results--background"),null==t||t.classList.remove("hide")}}),[]),s.default.createElement(s.default.Fragment,null,"loading"!==a&&s.default.createElement(s.default.Fragment,null,s.default.createElement("div",{className:"lfr-de__partial-results-entries"},s.default.createElement("div",{className:"align-items-center"},s.default.createElement("span",{className:"lfr-de__partial-results-title text-truncate"},1===g?(0,n.sub)(Liferay.Language.get("x-entry"),[g]):(0,n.sub)(Liferay.Language.get("x-entries"),[g]))),s.default.createElement("div",{className:"align-items-center"},s.default.createElement("span",{className:"lfr-de__partial-results-subtitle text-truncate"},g>0?p:Liferay.Language.get("there-are-no-entries")))),s.default.createElement(o.default,{data:i,dataEngineModule:e,fields:c,formReportRecordsFieldValuesURL:f,portletNamespace:m})))};t.default=d}}));
//# sourceMappingURL=PartialResults.js.map