import{__spreadArrays as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as l,useCallback as r}from"react";import{Accordion as o,AccordionItem as n,AccordionButton as a,AccordionIcon as i,AccordionPanel as m}from"../../../../node_modules/@chakra-ui/accordion/dist/esm/accordion.js";import{Box as c}from"../../../../node_modules/@chakra-ui/layout/dist/esm/box.js";import{Textarea as d}from"../../../../node_modules/@chakra-ui/textarea/dist/esm/textarea.js";import{FormControl as s}from"../../../../node_modules/@chakra-ui/form-control/dist/esm/form-control.js";import{FormLabel as u}from"../../../../node_modules/@chakra-ui/form-control/dist/esm/form-label.js";import{Input as p}from"../../../../node_modules/@chakra-ui/input/dist/esm/input.js";import{Button as f}from"../../../../node_modules/@chakra-ui/button/dist/esm/button.js";export default function(E){var x=E.bloc,h=E.register,g=x.properties,b=g.items,k=void 0===b?[]:b,j=g.heading,v=void 0===j?{text:"",color:""}:j,y=l(k),_=y[0],V=y[1],H=r((function(){var t=e(_,[{id:""+(_.length+1),title:{text:"",color:"inherit"},description:{text:"",color:"inherit"},widthPercentage:25}]);V(t)}),[V,_]);return t.createElement(t.Fragment,null,t.createElement("div",{className:"form-bloc-modal"},t.createElement(s,null,t.createElement(u,null,"Flex Heading"),t.createElement(p,{type:"text",name:"properties.heading.text",defaultValue:v.text,ref:h,placeholder:"Heading"})),t.createElement(s,null,t.createElement(u,null,"Flex Heading Color"),t.createElement(p,{type:"text",name:"properties.heading.color",defaultValue:v.color,ref:h,placeholder:"#efef"})),t.createElement("br",null),t.createElement(o,{allowToggle:!0},_.map((function(e,l){var r=e.id,o=e.description,f=e.title,E=e.widthPercentage;return t.createElement(n,{key:r},t.createElement(a,null,t.createElement(c,{flex:"1",textAlign:"left"},"Item "+(l+1)),t.createElement(i,null)),t.createElement(m,{pb:4},t.createElement(s,null,t.createElement(u,null,"Title"),t.createElement(p,{type:"text",name:"properties.items["+l+"].title.text",defaultValue:f.text,ref:h,placeholder:"Title"})),t.createElement(s,null,t.createElement(u,null,"Title Color Hex"),t.createElement(p,{type:"text",name:"properties.items["+l+"].title.color",defaultValue:f.color,ref:h,placeholder:"#efef"})),t.createElement(s,null,t.createElement(u,null,"Description"),t.createElement(d,{name:"properties.items["+l+"].description.text",defaultValue:o.text,ref:h,placeholder:"Description"})),t.createElement(s,null,t.createElement(u,null,"Description Color Hex"),t.createElement(p,{type:"text",name:"properties.items["+l+"].description.color",defaultValue:o.color,ref:h,placeholder:"#fff"})),t.createElement(s,null,t.createElement(u,null,"Item Width %"),t.createElement(p,{type:"text",name:"properties.items["+l+"].widthPercentage",defaultValue:E,ref:h,placeholder:"20"}))))}))),t.createElement("div",{className:"text-center pt-2"},t.createElement(f,{className:"btn-add panel-link",onClick:function(e){H(),e.preventDefault()}},"+"))))}
//# sourceMappingURL=DynamicFlexSetting.js.map
