Liferay.Loader.define("@liferay/object-web@1.0.108/js/components/ObjectView/FilterScreen/FilterScreen",["module","exports","require","@frontend-taglib-clay$clayui/modal","@liferay/object-js-components-web","liferay!frontend-js-react-web$react","../../ModalAddFilter","../objectViewContext"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.FilterScreen=function(){var t;const[{filterOperators:r,objectFields:c,objectView:s,workflowStatusJSONArray:d},f]=(0,o.useViewContext)(),{objectViewFilterColumns:y}=s,[b,p]=(0,n.useState)(""),[g,j]=(0,n.useState)(!1),[O,m]=(0,n.useState)(!1),{observer:w,onClose:L}=(0,a.useModal)({onClose:()=>{j(!1),m(!1)}});return n.default.createElement(n.default.Fragment,null,n.default.createElement(i.BuilderScreen,{emptyState:{buttonText:Liferay.Language.get("new-filter"),description:Liferay.Language.get("start-creating-a-filter-to-display-specific-data"),title:Liferay.Language.get("no-filter-was-created-yet")},filter:!0,firstColumnHeader:Liferay.Language.get("filter-by"),objectColumns:null!==(t=y.map((e=>"createDate"===e.objectFieldName||"modifiedDate"===e.objectFieldName?u(u({},e),{},{disableEdit:!0}):e)))&&void 0!==t?t:[],onDeleteColumn:e=>{f({payload:{objectFieldName:e},type:o.TYPES.DELETE_OBJECT_VIEW_FILTER_COLUMN})},onEditing:j,onEditingObjectFieldName:p,onVisibleEditModal:m,openModal:()=>m(!0),secondColumnHeader:Liferay.Language.get("type"),thirdColumnHeader:Liferay.Language.get("value"),title:Liferay.Language.get("filters")}),O&&n.default.createElement(l.ModalAddFilter,{currentFilters:y,disableDateValues:!0,editingFilter:g,editingObjectFieldName:b,filterOperators:r,header:Liferay.Language.get("new-filter"),objectFields:g?c:c.filter((e=>{if("Picklist"===e.businessType||"createDate"===e.name||"modifiedDate"===e.name||"status"===e.name&&!e.hasFilter)return e})),observer:w,onClose:L,onSave:(e,t,r,a,i,n)=>{f(g?{payload:{filterType:i,objectFieldName:e,valueList:n},type:o.TYPES.EDIT_OBJECT_VIEW_FILTER_COLUMN}:{payload:{filterType:i,objectFieldName:e,valueList:n},type:o.TYPES.ADD_OBJECT_VIEW_FILTER_COLUMN})},validate:({checkedItems:t,disableDateValues:r,selectedFilterBy:a,selectedFilterType:i,setErrors:n})=>{n({});const l={};return a||(l.selectedFilterBy=e),i||r||"status"===(null==a?void 0:a.name)&&"Picklist"===(null==a?void 0:a.businessType)||(l.selectedFilterType=e),!i||"status"!==(null==a?void 0:a.name)&&"Picklist"!==(null==a?void 0:a.businessType)||t.length||(l.items=e),n(l),l},workflowStatusJSONArray:d}))};var a=r("@frontend-taglib-clay$clayui/modal"),i=r("@liferay/object-js-components-web"),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=a?Object.getOwnPropertyDescriptor(e,i):null;n&&(n.get||n.set)?Object.defineProperty(r,i,n):r[i]=e[i]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),l=r("../../ModalAddFilter"),o=r("../objectViewContext");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e=Liferay.Language.get("required")}}));
//# sourceMappingURL=FilterScreen.js.map