Liferay.Loader.define("data-engine-taglib@3.3.26/data_layout_builder/js/plugins/rules-sidebar/components/RulesSidebar",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/layout","data-engine-js-components-web","liferay!frontend-js-react-web$react","../../../components/rules/RuleEditorModal","../../../components/rules/RuleList","../../../components/sidebar/Sidebar.es","../../../eventTypes"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=a("@frontend-taglib-clay$clayui/button"),n=y(a("@frontend-taglib-clay$clayui/form")),r=y(a("@frontend-taglib-clay$clayui/layout")),o=a("data-engine-js-components-web"),u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),d=y(a("../../../components/rules/RuleEditorModal")),i=y(a("../../../components/rules/RuleList")),c=y(a("../../../components/sidebar/Sidebar.es")),s=a("../../../eventTypes");function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function y(e){return e&&e.__esModule?e:{default:e}}var p=({title:e})=>{var t;const a=(0,o.useForm)(),{dataLayout:f}=(0,o.useFormState)({schema:["dataLayout"]}),[y,p]=(0,u.useState)(""),[m,b]=(0,u.useState)(-1),[E,v]=(0,u.useState)(!1),g=()=>{b(-1),v(!0)};return u.default.createElement(c.default,null,u.default.createElement(c.default.Header,null,u.default.createElement(c.default.Title,{className:"mb-3",title:e}),u.default.createElement(r.default.ContentRow,{className:"sidebar-section"},u.default.createElement(r.default.ContentCol,{expand:!0},u.default.createElement(n.default,{onSubmit:e=>e.preventDefault()},u.default.createElement(c.default.SearchInput,{onSearch:p}))),u.default.createElement(r.default.ContentCol,{className:"ml-2"},u.default.createElement(l.ClayButtonWithIcon,{displayType:"primary",onClick:g,symbol:"plus"})))),u.default.createElement(c.default.Body,null,u.default.createElement(i.default,{keywords:y,onAddRule:g,onDeleteRule:e=>{a({payload:e,type:s.EVENT_TYPES.RULE.DELETE})},onEditRule:e=>{b(e),v(!0)},rules:f.dataRules})),u.default.createElement(d.default,{onClose:()=>v(!1),onSaveRule:e=>{a(m<=-1?{payload:e,type:s.EVENT_TYPES.RULE.ADD}:{payload:{loc:m,rule:e},type:s.EVENT_TYPES.RULE.CHANGE})},rule:null===(t=f.dataRules)||void 0===t?void 0:t[m],showModal:E}))};t.default=p}}));
//# sourceMappingURL=RulesSidebar.js.map