Liferay.Loader.define("data-engine-js-components-web@1.0.112/js/custom/form-report/components/list/List",["module","exports","require","@frontend-taglib-clay$clayui/button","liferay!frontend-js-dependencies-web$moment/min/moment-with-locales","liferay!frontend-js-react-web$react","../../utils/data","../color/Color","../sidebar/SidebarContext"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function List({data:e,field:t,summary:r,totalEntries:u,type:d}){const{portletNamespace:s,toggleSidebar:f}=(0,o.useContext)(c.SidebarContext);(0,o.useEffect)((()=>{const e=document.querySelector("#".concat(s,"_entry_slidebar_0"));e&&e.focus()}));const formatDate=(e,t)=>{const r=themeDisplay.getLanguageId().split("_",1).join(""),a=(0,n.default)(e).locale(r).format("L");if(!t)return a;const o=(0,n.default)(e).locale(r).format("LT");return"".concat(a," ").concat(o)};return e=(0,l.removeEmptyValues)(e),o.default.createElement("div",{className:"field-list"},o.default.createElement("ul",{className:"entries-list"},Array.isArray(e)&&e.map(((e,r)=>o.default.createElement("li",{id:"".concat(s,"_entry_").concat(t?t.name:"slidebar","_").concat(r),index:r,key:r,tabIndex:0},((e,t)=>{switch(t){case"color":return o.default.createElement(i.default,{hexColor:e});case"date":return formatDate(e);case"date_time":return formatDate(e,!0);default:return e}})(e,d)))),5===e.length&&u>5?o.default.createElement("li",{id:"".concat(s).concat(t.name,"-see-more"),key:"see-more"},o.default.createElement(a.default,{displayType:"link",onClick:()=>f(t,r,u,d)},Liferay.Language.get("see-all-entries"))):null))};var a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),n=_interopRequireDefault(r("liferay!frontend-js-dependencies-web$moment/min/moment-with-locales")),o=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 n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),l=r("../../utils/data"),i=_interopRequireDefault(r("../color/Color")),c=r("../sidebar/SidebarContext");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}}}}));
//# sourceMappingURL=List.js.map