Liferay.Loader.define("data-engine-taglib@3.3.53/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"),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/form")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/layout")),u=a("data-engine-js-components-web"),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 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]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),d=_interopRequireDefault(a("../../../components/rules/RuleEditorModal")),i=_interopRequireDefault(a("../../../components/rules/RuleList")),c=_interopRequireDefault(a("../../../components/sidebar/Sidebar.es")),f=a("../../../eventTypes");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}}var _default=({title:e})=>{var t;const a=(0,u.useForm)(),{dataLayout:s}=(0,u.useFormState)({schema:["dataLayout"]}),[p,y]=(0,o.useState)(""),[m,b]=(0,o.useState)(-1),[E,R]=(0,o.useState)(!1),onAddRule=()=>{b(-1),R(!0)};return o.default.createElement(c.default,null,o.default.createElement(c.default.Header,null,o.default.createElement(c.default.Title,{className:"mb-3",title:e}),o.default.createElement(n.default.ContentRow,{className:"sidebar-section"},o.default.createElement(n.default.ContentCol,{expand:!0},o.default.createElement(r.default,{onSubmit:e=>e.preventDefault()},o.default.createElement(c.default.SearchInput,{onSearch:y}))),o.default.createElement(n.default.ContentCol,{className:"ml-2"},o.default.createElement(l.ClayButtonWithIcon,{displayType:"primary",onClick:onAddRule,symbol:"plus"})))),o.default.createElement(c.default.Body,null,o.default.createElement(i.default,{keywords:p,onAddRule:onAddRule,onDeleteRule:e=>{a({payload:e,type:f.EVENT_TYPES.RULE.DELETE})},onEditRule:e=>{b(e),R(!0)},rules:s.dataRules})),o.default.createElement(d.default,{onClose:()=>R(!1),onSaveRule:e=>{a(m<=-1?{payload:e,type:f.EVENT_TYPES.RULE.ADD}:{payload:{loc:m,rule:e},type:f.EVENT_TYPES.RULE.CHANGE})},rule:null===(t=s.dataRules)||void 0===t?void 0:t[m],showModal:E}))};t.default=_default}}));
//# sourceMappingURL=RulesSidebar.js.map