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