(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[611],{84093:function(e,l,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/poc/form-experiments/FormikControlled",function(){return n(15957)}])},95813:function(e,l,n){"use strict";n.d(l,{S:function(){return i}});let i={input:"default text",radio:"2",checkbox:!0,switch:!0,select:"2",multiselect:["2"],tags:["1"],date:"",number:12}},15957:function(e,l,n){"use strict";n.r(l),n.d(l,{FormikControlledPOC:function(){return o}});var i=n(24246),s=n(38355),t=n(3124),r=n.n(t),c=n(34090),d=n(95813);let{Title:a}=s.AntTypography,o=()=>(0,i.jsx)(c.J9,{initialValues:{...d.S},onSubmit:console.log,children:e=>{let{values:l,setFieldValue:n}=e;return(0,i.jsxs)(s.bue,{children:[(0,i.jsxs)(s.JGx,{span:12,children:[(0,i.jsx)(a,{level:2,children:"<Formik> + Controlled"}),(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsx)(s.j8w,{color:"green",children:"funcitonal"}),(0,i.jsx)(s.j8w,{color:"red",children:"high effort"})]}),(0,i.jsx)(c.l0,{children:(0,i.jsxs)(s.jqI,{vertical:!0,gap:16,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"input",children:"Input"}),(0,i.jsx)("div",{children:(0,i.jsx)(s.uFc,{id:"input",onChange:e=>n("input",e.target.value),defaultValue:l.input})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)(s.y02.Group,{name:"radio",onChange:e=>n("radio",e.target.value),defaultValue:l.radio,children:[(0,i.jsx)(s.y02,{value:"1",children:"Radio 1"}),(0,i.jsx)(s.y02,{value:"2",children:"Radio 2"})]})}),(0,i.jsx)("div",{children:(0,i.jsx)(s.E_O,{onChange:e=>n("checkbox",e.target.checked),defaultChecked:l.checkbox,children:"Checkbox"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"switch",children:"Switch"}),(0,i.jsx)("div",{children:(0,i.jsx)(s.rAg,{id:"switch",onChange:e=>n("switch",e),defaultChecked:l.switch})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"select",children:"Select"}),(0,i.jsx)("div",{children:(0,i.jsx)(s.WPr,{allowClear:!0,id:"select",defaultValue:l.select,onChange:e=>n("select",e),className:"w-full",options:[{value:"1",label:"Option 1"},{value:"2",label:"Option 2"}]})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"multiselect",children:"Multiselect"}),(0,i.jsx)("div",{children:(0,i.jsx)(s.WPr,{mode:"multiple",allowClear:!0,id:"multiselect",defaultValue:l.multiselect,onChange:e=>n("multiselect",e),className:"w-full",options:[{value:"1",label:"Option 1"},{value:"2",label:"Option 2"}]})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"tags",children:"Tags"}),(0,i.jsx)("div",{children:(0,i.jsx)(s.WPr,{mode:"tags",allowClear:!0,id:"tags",defaultValue:l.tags,onChange:e=>n("tags",e),className:"w-full",options:[{value:"1",label:"Option 1"},{value:"2",label:"Option 2"}]})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"date",children:"Date"}),(0,i.jsx)("div",{children:(0,i.jsx)(s.cv2,{id:"date",onChange:e=>n("date",e.toISOString())})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"number",children:"Number"}),(0,i.jsx)("div",{children:(0,i.jsx)(s.W7D,{id:"number",defaultValue:l.number,onChange:e=>n("number",e)})})]})]})})]}),(0,i.jsxs)(s.JGx,{span:8,offset:4,children:[(0,i.jsx)(a,{level:4,children:"Controlled Values"}),(0,i.jsx)(s.V4A,{style:{backgroundColor:r().FIDESUI_MINOS,color:r().FIDESUI_CORINTH},children:(0,i.jsx)("pre",{children:(0,i.jsxs)("code",{children:["{\n",Object.keys(l).map(e=>"  ".concat(e,": ").concat(l[e],"\n")),"}"]})})})]})]})}});l.default=o}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=84093)}),_N_E=e.O()}]);