Liferay.Loader.define("data-engine-js-components-web@1.0.55/js/custom/form/components/PartialResults",["module","exports","require","@frontend-taglib-clay$clayui/data-provider","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=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();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")),s=(a=r("../../form-report/index"))&&a.__esModule?a:{default:a};function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}r("./PartialResults.scss");var u=({reportDataURL:e})=>{var t;const[r,a]=(0,n.useState)((()=>"loading")),{resource:o}=(0,l.useResource)({fetch:fetch,link:e,onNetworkStatusChange:e=>{let t="idle";e<4?t="loading":5===e&&(t="error"),a(t)}}),{data:u,fields:i=[],formReportRecordsFieldValuesURL:d,lastModifiedDate:c,portletNamespace:f,totalItems:p=0}=null!==(t=o)&&void 0!==t?t:{};return(0,n.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")}}),[]),n.default.createElement(n.default.Fragment,null,"loading"!==r&&n.default.createElement(n.default.Fragment,null,n.default.createElement("div",{className:"lfr-de__partial-results-entries"},n.default.createElement("div",{className:"align-items-center"},n.default.createElement("span",{className:"lfr-de__partial-results-title text-truncate"},1===p?Liferay.Util.sub(Liferay.Language.get("x-entry"),[p]):Liferay.Util.sub(Liferay.Language.get("x-entries"),[p]))),n.default.createElement("div",{className:"align-items-center"},n.default.createElement("span",{className:"lfr-de__partial-results-subtitle text-truncate"},p>0?c:Liferay.Language.get("there-are-no-entries")))),n.default.createElement(s.default,{data:u,fields:i,formReportRecordsFieldValuesURL:d,portletNamespace:f})))};t.default=u}}));
//# sourceMappingURL=PartialResults.js.map