Liferay.Loader.define("@liferay/object-js-components-web@1.0.33/components/BuilderScreen/BuilderScreen",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/empty-state","@frontend-taglib-clay$clayui/list","liferay!frontend-js-react-web$classnames","frontend-js-components-web","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd","liferay!frontend-js-react-web$react-dnd-html5-backend","../../utils/array","../Card","../ManagementToolbarSearch","./BuilderListItem","./BuilderScreen.scss"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.BuilderScreen=function BuilderScreen({defaultSort:t,disableEdit:a,emptyState:y,filter:g,firstColumnHeader:p,hasDragAndDrop:j,objectColumns:_,onChangeColumnOrder:E,onDeleteColumn:v,onEditing:C,onEditingObjectFieldName:h,onVisibleEditModal:L,openModal:w,secondColumnHeader:D,thirdColumnHeader:M,title:q}){const[O,$]=(0,o.useState)(""),B=(0,o.useMemo)((()=>(0,f.filterArrayByQuery)(_,"fieldLabel",O)),[_,O]),F=O?B:_;return o.default.createElement(s.Card,{title:q},o.default.createElement(i.ManagementToolbar.Container,null,o.default.createElement(i.ManagementToolbar.ItemList,{expand:!0},o.default.createElement(b.ManagementToolbarSearch,{query:O,setQuery:$}),o.default.createElement(i.ManagementToolbar.Item,null,o.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("add"),className:"nav-btn nav-btn-monospaced",onClick:w,symbol:"plus"})))),F.length?o.default.createElement(n.default,null,F.map(((l,r)=>{var i;return o.default.createElement(o.default.Fragment,{key:null==l?void 0:l.objectFieldName},0===r&&o.default.createElement(n.default.Item,{flex:!0},o.default.createElement(n.default.ItemField,{className:(0,d.default)("lfr-object__object-builder-screen-first-column",!j&&"lfr-object__object-builder-screen-first-column--not-draggable"),expand:!0},p),o.default.createElement(n.default.ItemField,{className:(0,d.default)("lfr-object__object-builder-screen-second-column",!j&&"lfr-object__object-builder-screen-second-column--not-draggable"),expand:!0},o.default.createElement(n.default.ItemField,null,D)),M&&o.default.createElement(n.default.ItemField,{className:(0,d.default)("lfr-object__object-builder-screen-third-column",!j&&"lfr-object__object-builder-screen-third-column--not-draggable"),expand:!0},o.default.createElement(n.default.ItemField,null,M))),o.default.createElement(u.DndProvider,{backend:c.HTML5Backend},o.default.createElement(m.default,{disableEdit:a||g&&(null==l?void 0:l.disableEdit),hasDragAndDrop:j,index:r,label:null==l?void 0:l.fieldLabel,objectFieldName:l.objectFieldName,onChangeColumnOrder:E,onDeleteColumn:v,onEditing:C,onEditingObjectFieldName:h,onVisibleEditModal:L,secondColumnValue:t?"asc"===l.sortOrder?Liferay.Language.get("ascending"):Liferay.Language.get("descending"):g?null==l?void 0:l.objectFieldBusinessType:null==l?void 0:l.label[e],thirdColumnValues:null!==(i=null==l?void 0:l.valueList)&&void 0!==i?i:null==l?void 0:l.value})))}))):O?o.default.createElement("div",{className:"lfr-object__object-builder-screen-empty-state"},o.default.createElement(r.default,{description:Liferay.Language.get("sorry,-no-results-were-found"),title:Liferay.Language.get("no-results-found")})):o.default.createElement("div",{className:"lfr-object__object-builder-screen-empty-state"},o.default.createElement(r.default,{description:y.description,title:y.title},o.default.createElement(l.default,{displayType:"secondary",onClick:w},y.buttonText))))};var l=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/button")),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/empty-state")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/list")),d=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),i=a("frontend-js-components-web"),o=_interopRequireWildcard(a("liferay!frontend-js-react-web$react")),u=a("liferay!frontend-js-react-web$react-dnd"),c=a("liferay!frontend-js-react-web$react-dnd-html5-backend"),f=a("../../utils/array"),s=a("../Card"),b=a("../ManagementToolbarSearch"),m=_interopRequireDefault(a("./BuilderListItem"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}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 a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}a("./BuilderScreen.scss");const e=Liferay.ThemeDisplay.getDefaultLanguageId()}}));
//# sourceMappingURL=BuilderScreen.js.map