import{j as e}from"./jsx-runtime-Dfk2JFgj.js";import{r as h}from"./index-CWN_QRa1.js";import{u as m,k as l,l as _,L as v,I as n,R as f,S as k}from"./index-DNsi8NHw.js";import{B as r}from"./index-CIVavKlu.js";import{a as y}from"./CheckGroup-BpaEcK_0.js";import"./index-Cj3pldWQ.js";import"./index-DgIb9kCw.js";import"./index-DllfNvuz.js";import"./index-6WYjB5r3.js";import"./DefaultPropsProvider-BPu7lNPC.js";import"./index-Bk93qgka.js";import"./index-DnVHLn3F.js";import"./v4-CtRu48qb.js";import"./tiny-invariant-CopsF_GD.js";import"./iframe-BT4Dhm0c.js";const P={title:"Components/Modal",component:m,argTypes:{onClose:{table:{disable:!0}},size:{control:"radio",options:["extra-small","small","medium","large","full-screen"]},position:{control:"select",options:["right","left","center"]},closeButton:{control:"boolean"},disableAutoFocus:{control:"boolean"},disableEnforceFocus:{control:"boolean"},disableEscapeKeyDown:{control:"boolean"},disablePortal:{control:"boolean"},disableRestoreFocus:{control:"boolean"},disableScrollLock:{control:"boolean"},hideBackdrop:{control:"boolean"},keepMounted:{control:"boolean"}}},F=o=>{const t=l.useForm(),[i,a]=h.useState(!1),b=[{label:"Option_one",value:"1"},{label:"Option_two",value:"2"},{label:"Option_three",value:"3"}],g=[{label:"Option_one",value:"4"},{label:"Option_two",value:"6"},{label:"Option_three",value:"7"}];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[e.jsx("div",{style:{marginBottom:"10px"},children:"TESTING BACKGROUND"}),e.jsx(r,{variant:"primary",onClick:()=>a(!i),children:"Open Modal"})]}),e.jsx(m,{open:i,handleClose:()=>a(!i),loading:o.loading,title:o.title,position:o.position,size:o.size,disableAutoFocus:o.disableAutoFocus,disableEnforceFocus:o.disableEnforceFocus,disableEscapeKeyDown:o.disableEscapeKeyDown,disablePortal:o.disablePortal,disableRestoreFocus:o.disableRestoreFocus,disableScrollLock:o.disableScrollLock,hideBackdrop:o.hideBackdrop,keepMounted:o.keepMounted,closeButton:o.closeButton,footer:e.jsxs("div",{children:[e.jsx(r,{variant:"secondary",style:{marginRight:8},onClick:()=>{t.resetValues(),a(!i)},children:"close"}),e.jsx(r,{variant:"primary",isDisabled:o.loading,icon:"login",onClick:()=>{t.submit()},children:"submit_label"})]}),children:e.jsx("div",{style:{padding:"18px 35px"},children:e.jsx(l,{ref:t.ref,loading:o.loading,onSubmit:(d,x)=>{console.log("onSubmit",d,x)},onValidSubmit:d=>{console.log("onValidSumit",d)},children:e.jsxs("div",{children:[e.jsx("div",{style:{marginBottom:"32px"},children:e.jsx(_,{text:"clear_all",onClick:()=>{t.resetValues()}})}),e.jsx("div",{style:{marginBottom:"18px"},children:e.jsx(v,{subTitle:!0,children:"report_option"})}),e.jsx(l.Item,{name:"name",label:"username_label",rules:[{required:!0,message:"required_message"}],children:e.jsx(n,{type:"text",buttonText:"Button",icon:"person",placeholder:"username_label",iconPosition:"left"})}),e.jsx(l.Item,{name:"password",label:"password_label",rules:[{required:!0,message:"required_message"}],children:e.jsx(n,{type:"password",placeholder:"password_label",buttonText:"Button",icon:"key",iconPosition:"left"})}),e.jsx(l.Item,{name:"sex",label:"option_list",rules:[{required:!0,message:"required_message"}],children:e.jsx(f,{list:b,labelDir:"row",isDisabled:o.loading})}),e.jsx(l.Item,{name:"shopping_list",label:"option_list",rules:[{required:!0,message:"required_message"}],children:e.jsx(y,{list:g,labelDir:"column",isDisabled:o.loading})}),e.jsx(l.Item,{name:"subscription",label:"subscription_label",children:e.jsx(k,{id:"option5",name:"toggle",optionLabels:["YES","NO"]})})]})})})})]})},s=F.bind({});s.parameters={controls:{}};s.args={title:"A title ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",size:"small",position:"right",open:!0,loading:!1,closeButton:!0};var u,c,p;s.parameters={...s.parameters,docs:{...(u=s.parameters)==null?void 0:u.docs,source:{originalSource:`args => {
  const form = Form.useForm();
  const [isModalOpen, setIsModalOpen] = useState(false);
  const list = [{
    label: "Option_one",
    value: "1"
  }, {
    label: "Option_two",
    value: "2"
  }, {
    label: "Option_three",
    value: "3"
  }];
  const listCheck = [{
    label: "Option_one",
    value: "4"
  }, {
    label: "Option_two",
    value: "6"
  }, {
    label: "Option_three",
    value: "7"
  }];
  return <>
        <div style={{
      display: "flex",
      flexDirection: "column",
      alignItems: "center"
    }}>
            <div style={{
        marginBottom: "10px"
      }}>TESTING BACKGROUND</div>
            <Button variant="primary" onClick={() => setIsModalOpen(!isModalOpen)}>
                {'Open Modal'}
            </Button>
        </div>

        <Modal open={isModalOpen} handleClose={() => setIsModalOpen(!isModalOpen)} loading={args.loading} title={args.title} position={args.position} size={args.size} disableAutoFocus={args.disableAutoFocus} disableEnforceFocus={args.disableEnforceFocus} disableEscapeKeyDown={args.disableEscapeKeyDown} disablePortal={args.disablePortal} disableRestoreFocus={args.disableRestoreFocus} disableScrollLock={args.disableScrollLock} hideBackdrop={args.hideBackdrop} keepMounted={args.keepMounted} closeButton={args.closeButton} footer={<div>
                <Button variant="secondary" style={{
        marginRight: 8
      }} onClick={() => {
        form.resetValues();
        setIsModalOpen(!isModalOpen);
      }}>{'close'}</Button>
                <Button variant="primary" isDisabled={args.loading} icon="login" onClick={() => {
        form.submit();
      }}>{'submit_label'}</Button>
            </div>}>
            <div style={{
        padding: '18px 35px'
      }}>
                <Form ref={form.ref} loading={args.loading} onSubmit={(values, invalidValues) => {
          console.log("onSubmit", values, invalidValues);
        }} onValidSubmit={values => {
          console.log("onValidSumit", values);
        }}>
                    {/*                         <Header>
                            <Label title>{"report_setup"}</Label>
                        </Header> */}
                    <div>
                        <div style={{
              marginBottom: '32px'
            }}>
                            <Link text={'clear_all'} onClick={() => {
                form.resetValues();
              }} />
                        </div>
                        <div style={{
              marginBottom: '18px'
            }}>
                            <Label subTitle>{"report_option"}</Label>
                        </div>
                        <Form.Item name="name" label={"username_label"} rules={[{
              required: true,
              message: 'required_message'
            }]}>
                            <Input type="text" buttonText="Button" icon="person" placeholder={"username_label"} iconPosition="left" />
                        </Form.Item>
                        <Form.Item name="password" label={"password_label"} rules={[{
              required: true,
              message: 'required_message'
            }]}>
                            <Input type="password" placeholder={"password_label"} buttonText="Button" icon="key" iconPosition="left" />
                        </Form.Item>
                        <Form.Item name="sex" label={"option_list"} rules={[{
              required: true,
              message: 'required_message'
            }]}>
                            <RadioGroup list={list} labelDir='row' isDisabled={args.loading} />
                        </Form.Item>
                        <Form.Item name="shopping_list" label={"option_list"} rules={[{
              required: true,
              message: 'required_message'
            }]}>
                            <CheckGroup list={listCheck} labelDir='column' isDisabled={args.loading} />
                        </Form.Item>
                        <Form.Item name="subscription" label={"subscription_label"}>
                            <Switch id="option5" name="toggle" optionLabels={["YES", "NO"]} />
                        </Form.Item>
                    </div>
                </Form>
            </div>
        </Modal>
    </>;
}`,...(p=(c=s.parameters)==null?void 0:c.docs)==null?void 0:p.source}}};const A=["ReportSetup"];export{s as ReportSetup,A as __namedExportsOrder,P as default};
