ant-design/73128d56-async.f4a19020.js
2024-11-20 18:30:54 +00:00

5 lines
64 KiB
JavaScript

(("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd=("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd||[]).push([["73128d56"],{"0a09b904":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return u;}});var a=r("f19d2b93");r("1456d966");var t=r("e22febe0"),s=r("a9d1a279");let{Option:n}=s.Select,i={labelCol:{span:6},wrapperCol:{span:14}},o=e=>(console.log("Upload event:",e),Array.isArray(e))?e:null==e?void 0:e.fileList,d=e=>{console.log("Received values of form: ",e);};var u=()=>(0,a.jsxs)(s.Form,{name:"validate_other",...i,onFinish:d,initialValues:{"input-number":3,"checkbox-group":["A","B"],rate:3.5,"color-picker":null},style:{maxWidth:600},children:[(0,a.jsx)(s.Form.Item,{label:"Plain Text",children:(0,a.jsx)("span",{className:"ant-form-text",children:"China"})}),(0,a.jsx)(s.Form.Item,{name:"select",label:"Select",hasFeedback:!0,rules:[{required:!0,message:"Please select your country!"}],children:(0,a.jsxs)(s.Select,{placeholder:"Please select a country",children:[(0,a.jsx)(n,{value:"china",children:"China"}),(0,a.jsx)(n,{value:"usa",children:"U.S.A"})]})}),(0,a.jsx)(s.Form.Item,{name:"select-multiple",label:"Select[multiple]",rules:[{required:!0,message:"Please select your favourite colors!",type:"array"}],children:(0,a.jsxs)(s.Select,{mode:"multiple",placeholder:"Please select favourite colors",children:[(0,a.jsx)(n,{value:"red",children:"Red"}),(0,a.jsx)(n,{value:"green",children:"Green"}),(0,a.jsx)(n,{value:"blue",children:"Blue"})]})}),(0,a.jsxs)(s.Form.Item,{label:"InputNumber",children:[(0,a.jsx)(s.Form.Item,{name:"input-number",noStyle:!0,children:(0,a.jsx)(s.InputNumber,{min:1,max:10})}),(0,a.jsx)("span",{className:"ant-form-text",style:{marginInlineStart:8},children:"machines"})]}),(0,a.jsx)(s.Form.Item,{name:"switch",label:"Switch",valuePropName:"checked",children:(0,a.jsx)(s.Switch,{})}),(0,a.jsx)(s.Form.Item,{name:"slider",label:"Slider",children:(0,a.jsx)(s.Slider,{marks:{0:"A",20:"B",40:"C",60:"D",80:"E",100:"F"}})}),(0,a.jsx)(s.Form.Item,{name:"radio-group",label:"Radio.Group",children:(0,a.jsxs)(s.Radio.Group,{children:[(0,a.jsx)(s.Radio,{value:"a",children:"item 1"}),(0,a.jsx)(s.Radio,{value:"b",children:"item 2"}),(0,a.jsx)(s.Radio,{value:"c",children:"item 3"})]})}),(0,a.jsx)(s.Form.Item,{name:"radio-button",label:"Radio.Button",rules:[{required:!0,message:"Please pick an item!"}],children:(0,a.jsxs)(s.Radio.Group,{children:[(0,a.jsx)(s.Radio.Button,{value:"a",children:"item 1"}),(0,a.jsx)(s.Radio.Button,{value:"b",children:"item 2"}),(0,a.jsx)(s.Radio.Button,{value:"c",children:"item 3"})]})}),(0,a.jsx)(s.Form.Item,{name:"checkbox-group",label:"Checkbox.Group",children:(0,a.jsx)(s.Checkbox.Group,{children:(0,a.jsxs)(s.Row,{children:[(0,a.jsx)(s.Col,{span:8,children:(0,a.jsx)(s.Checkbox,{value:"A",style:{lineHeight:"32px"},children:"A"})}),(0,a.jsx)(s.Col,{span:8,children:(0,a.jsx)(s.Checkbox,{value:"B",style:{lineHeight:"32px"},disabled:!0,children:"B"})}),(0,a.jsx)(s.Col,{span:8,children:(0,a.jsx)(s.Checkbox,{value:"C",style:{lineHeight:"32px"},children:"C"})}),(0,a.jsx)(s.Col,{span:8,children:(0,a.jsx)(s.Checkbox,{value:"D",style:{lineHeight:"32px"},children:"D"})}),(0,a.jsx)(s.Col,{span:8,children:(0,a.jsx)(s.Checkbox,{value:"E",style:{lineHeight:"32px"},children:"E"})}),(0,a.jsx)(s.Col,{span:8,children:(0,a.jsx)(s.Checkbox,{value:"F",style:{lineHeight:"32px"},children:"F"})})]})})}),(0,a.jsx)(s.Form.Item,{name:"rate",label:"Rate",children:(0,a.jsx)(s.Rate,{})}),(0,a.jsx)(s.Form.Item,{name:"upload",label:"Upload",valuePropName:"fileList",getValueFromEvent:o,extra:"longgggggggggggggggggggggggggggggggggg",children:(0,a.jsx)(s.Upload,{name:"logo",action:"/upload.do",listType:"picture",children:(0,a.jsx)(s.Button,{icon:(0,a.jsx)(t.UploadOutlined,{}),children:"Click to upload"})})}),(0,a.jsx)(s.Form.Item,{label:"Dragger",children:(0,a.jsx)(s.Form.Item,{name:"dragger",valuePropName:"fileList",getValueFromEvent:o,noStyle:!0,children:(0,a.jsxs)(s.Upload.Dragger,{name:"files",action:"/upload.do",children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)(t.InboxOutlined,{})}),(0,a.jsx)("p",{className:"ant-upload-text",children:"Click or drag file to this area to upload"}),(0,a.jsx)("p",{className:"ant-upload-hint",children:"Support for a single or bulk upload."})]})})}),(0,a.jsx)(s.Form.Item,{name:"color-picker",label:"ColorPicker",rules:[{required:!0,message:"color is required!"}],children:(0,a.jsx)(s.ColorPicker,{})}),(0,a.jsx)(s.Form.Item,{wrapperCol:{span:12,offset:6},children:(0,a.jsxs)(s.Space,{children:[(0,a.jsx)(s.Button,{type:"primary",htmlType:"submit",children:"Submit"}),(0,a.jsx)(s.Button,{htmlType:"reset",children:"reset"})]})})]});},"1b4c3264":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return i;}});var a=r("f19d2b93");r("995a7c45");var t=r("e22febe0"),s=r("a9d1a279");let n=e=>{console.log("Received values of form:",e);};var i=()=>(0,a.jsxs)(s.Form,{name:"dynamic_form_nest_item",onFinish:n,style:{maxWidth:600},autoComplete:"off",children:[(0,a.jsx)(s.Form.List,{name:"users",children:(e,{add:l,remove:r})=>(0,a.jsxs)(a.Fragment,{children:[e.map(({key:e,name:l,...n})=>(0,a.jsxs)(s.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,a.jsx)(s.Form.Item,{...n,name:[l,"first"],rules:[{required:!0,message:"Missing first name"}],children:(0,a.jsx)(s.Input,{placeholder:"First Name"})}),(0,a.jsx)(s.Form.Item,{...n,name:[l,"last"],rules:[{required:!0,message:"Missing last name"}],children:(0,a.jsx)(s.Input,{placeholder:"Last Name"})}),(0,a.jsx)(t.MinusCircleOutlined,{onClick:()=>r(l)})]},e)),(0,a.jsx)(s.Form.Item,{children:(0,a.jsx)(s.Button,{type:"dashed",onClick:()=>l(),block:!0,icon:(0,a.jsx)(t.PlusOutlined,{}),children:"Add field"})})]})}),(0,a.jsx)(s.Form.Item,{children:(0,a.jsx)(s.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},"2c7da363":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("20627d2c");var t=r("a9d1a279"),s=()=>(0,a.jsxs)(t.Form,{style:{maxWidth:600},children:[(0,a.jsx)(t.Form.Item,{label:"Normal0",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",value:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"Fail0",validateStatus:"error",help:"Buggy!",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",value:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"FailDisabled0",validateStatus:"error",help:"Buggy!",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",disabled:!0,value:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"Normal1",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",value:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"Fail1",validateStatus:"error",help:"Buggy!",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",value:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"FailDisabled1",validateStatus:"error",help:"Buggy!",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",disabled:!0,value:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"Normal2",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",addonBefore:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"Fail2",validateStatus:"error",help:"Buggy!",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",addonBefore:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"FailDisabled2",validateStatus:"error",help:"Buggy!",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",disabled:!0,addonBefore:"Buggy!"})}),(0,a.jsx)(t.Form.Item,{label:"Normal3",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",prefix:"\u4EBA\u6C11\u5E01",value:"50"})}),(0,a.jsx)(t.Form.Item,{label:"Fail3",validateStatus:"error",help:"Buggy!",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",prefix:"\u4EBA\u6C11\u5E01",value:"50"})}),(0,a.jsx)(t.Form.Item,{label:"FailDisabled3",validateStatus:"error",help:"Buggy!",children:(0,a.jsx)(t.Input,{placeholder:"unavailable choice",disabled:!0,prefix:"\u4EBA\u6C11\u5E01",value:"50"})})]});},"37e24185":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("7eaf15dd");var t=r("a9d1a279"),s=()=>(0,a.jsx)(t.ConfigProvider,{theme:{components:{Form:{labelRequiredMarkColor:"pink",labelColor:"green",labelFontSize:16,labelHeight:34,labelColonMarginInlineStart:4,labelColonMarginInlineEnd:12,itemMarginBottom:18,inlineItemMarginBottom:18}}},children:(0,a.jsxs)(t.Form,{name:"component-token",labelCol:{span:8},wrapperCol:{span:16},style:{maxWidth:600},initialValues:{remember:!0},autoComplete:"off",children:[(0,a.jsx)(t.Form.Item,{label:"Username",name:"username",rules:[{required:!0,message:"Please input your username!"}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:"Password",name:"password",rules:[{required:!0,message:"Please input your password!"}],children:(0,a.jsx)(t.Input.Password,{})})]})});},"3db1ac08":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("522aada4");var t=r("a9d1a279"),s=()=>(0,a.jsxs)(t.Form,{name:"label-ellipsis",labelCol:{span:8},wrapperCol:{span:16},style:{maxWidth:600},children:[(0,a.jsx)(t.Form.Item,{label:(0,a.jsx)(t.Typography.Text,{ellipsis:!0,children:"longtextlongtextlongtextlongtextlongtextlongtextlongtext"}),name:"username",children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:(0,a.jsx)(t.Typography.Text,{ellipsis:!0,children:"longtext longtext longtext longtext longtext longtext longtext"}),name:"password",children:(0,a.jsx)(t.Input.Password,{})})]});},"47f5c134":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return i;}});var a=r("f19d2b93");r("622b79c5");var t=r("e22febe0"),s=r("a9d1a279");let n=e=>{console.log("Received values of form:",e);};var i=()=>(0,a.jsxs)(s.Form,{name:"dynamic_form_no_style",onFinish:n,style:{maxWidth:600},autoComplete:"off",children:[(0,a.jsx)(s.Form.Item,{label:"Users",children:(0,a.jsx)(s.Form.List,{name:"users",children:(e,{add:l,remove:r})=>(0,a.jsxs)(a.Fragment,{children:[e.map(e=>(0,a.jsxs)(s.Space,{style:{marginBottom:16},children:[(0,a.jsx)(s.Form.Item,{noStyle:!0,name:[e.name,"lastName"],rules:[{required:!0}],children:(0,a.jsx)(s.Input,{placeholder:"Last Name"})}),(0,a.jsx)(s.Form.Item,{noStyle:!0,name:[e.name,"firstName"],rules:[{required:!0}],children:(0,a.jsx)(s.Input,{placeholder:"First Name"})}),(0,a.jsx)(t.MinusCircleOutlined,{onClick:()=>{r(e.name);}})]},e.key)),(0,a.jsx)(s.Form.Item,{children:(0,a.jsx)(s.Button,{type:"dashed",onClick:()=>l(),block:!0,icon:(0,a.jsx)(t.PlusOutlined,{}),children:"Add field"})})]})})}),(0,a.jsx)(s.Form.Item,{children:(0,a.jsx)(s.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},"4875973b":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("f19d2b93");r("7bcbb822");var t=r("a9d1a279");let{Option:s}=t.Select,n={labelCol:{span:8},wrapperCol:{span:16}},i={wrapperCol:{offset:8,span:16}};var o=()=>{let[e]=t.Form.useForm();return(0,a.jsxs)(t.Form,{...n,form:e,name:"control-hooks",onFinish:e=>{console.log(e);},style:{maxWidth:600},children:[(0,a.jsx)(t.Form.Item,{name:"note",label:"Note",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{name:"gender",label:"Gender",rules:[{required:!0}],children:(0,a.jsxs)(t.Select,{placeholder:"Select a option and change input text above",onChange:l=>{switch(l){case"male":e.setFieldsValue({note:"Hi, man!"});break;case"female":e.setFieldsValue({note:"Hi, lady!"});break;case"other":e.setFieldsValue({note:"Hi there!"});}},allowClear:!0,children:[(0,a.jsx)(s,{value:"male",children:"male"}),(0,a.jsx)(s,{value:"female",children:"female"}),(0,a.jsx)(s,{value:"other",children:"other"})]})}),(0,a.jsx)(t.Form.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.gender!==l.gender,children:({getFieldValue:e})=>"other"===e("gender")?(0,a.jsx)(t.Form.Item,{name:"customizeGender",label:"Customize Gender",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}):null}),(0,a.jsx)(t.Form.Item,{...i,children:(0,a.jsxs)(t.Space,{children:[(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"}),(0,a.jsx)(t.Button,{htmlType:"button",onClick:()=>{e.resetFields();},children:"Reset"}),(0,a.jsx)(t.Button,{type:"link",htmlType:"button",onClick:()=>{e.setFieldsValue({note:"Hello world!",gender:"male"});},children:"Fill form"})]})})]});};},"4b6ab30d":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return u;}});var a=r("777fffbe"),t=r("f19d2b93");r("34873843");var s=r("e22febe0"),n=r("a9d1a279"),i=r("3835a2b7"),o=a._(r("16cb2bc0"));let d=(0,i.createStyles)(()=>({"custom-feedback-icons":(0,i.css)`
.ant-form-item-feedback-icon {
pointer-events: all;
}
`}));var u=()=>{let[e]=n.Form.useForm(),{styles:l}=d();return(0,t.jsxs)(n.Form,{name:"custom-feedback-icons",form:e,style:{maxWidth:600},feedbackIcons:({errors:e})=>({error:(0,t.jsx)(n.Tooltip,{title:null==e?void 0:e.map(e=>(0,t.jsx)("div",{children:e},(0,o.default)())),color:"red",children:(0,t.jsx)(s.CloseSquareFilled,{})},"tooltipKey")}),children:[(0,t.jsx)(n.Form.Item,{name:"custom-feedback-test-item",label:"Test",className:l["custom-feedback-icons"],rules:[{required:!0,type:"email"},{min:10}],help:"",hasFeedback:!0,children:(0,t.jsx)(n.Input,{})}),(0,t.jsx)(n.Form.Item,{name:"custom-feedback-test-item2",label:"Test",className:l["custom-feedback-icons"],rules:[{required:!0,type:"email"},{min:10}],help:"",hasFeedback:{icons:({errors:e})=>({error:(0,t.jsx)(n.Tooltip,{title:null==e?void 0:e.map(e=>(0,t.jsx)("div",{children:e},(0,o.default)())),color:"pink",children:(0,t.jsx)(s.AlertFilled,{})},"tooltipKey"),success:!1})},children:(0,t.jsx)(n.Input,{})}),(0,t.jsx)(n.Form.Item,{children:(0,t.jsx)(n.Button,{htmlType:"submit",children:"Submit"})})]});};},"4fae21d7":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return m;}});var a=r("777fffbe"),t=r("f19d2b93");r("630605db");var s=a._(r("5b220c3d")),n=r("a9d1a279");let i=s.default.createContext([]);function o(e){return Array.isArray(e)?e:[e];}let d=({prefix:e,children:l})=>{let r=s.default.useContext(i),a=s.default.useMemo(()=>[...r,...o(e)],[r,e]);return(0,t.jsx)(i.Provider,{value:a,children:l});},u=({name:e,...l})=>{let r=s.default.useContext(i),a=void 0!==e?[...r,...o(e)]:void 0;return(0,t.jsx)(n.Form.Item,{name:a,...l});};var m=()=>(0,t.jsxs)(n.Form,{name:"form_item_path",layout:"vertical",onFinish:e=>{console.log(e);},children:[(0,t.jsxs)(d,{prefix:["user"],children:[(0,t.jsxs)(d,{prefix:["name"],children:[(0,t.jsx)(u,{name:"firstName",label:"First Name",children:(0,t.jsx)(n.Input,{})}),(0,t.jsx)(u,{name:"lastName",label:"Last Name",children:(0,t.jsx)(n.Input,{})})]}),(0,t.jsx)(u,{name:"age",label:"Age",children:(0,t.jsx)(n.Input,{})})]}),(0,t.jsx)(n.Button,{type:"primary",htmlType:"submit",children:"Submit"})]});},"503ab682":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return d;}});var a=r("777fffbe"),t=r("f19d2b93");r("2f465293");var s=r("a9d1a279"),n=a._(r("072ab8a9"));let i=(0,n.default)("2024-01-01").valueOf(),o=e=>{console.log("Success:",e);};var d=()=>(0,t.jsxs)(s.Form,{name:"getValueProps",labelCol:{span:8},wrapperCol:{span:16},style:{maxWidth:600},initialValues:{date:i},onFinish:o,autoComplete:"off",children:[(0,t.jsx)(s.Form.Item,{label:"Date",name:"date",rules:[{required:!0}],getValueProps:e=>({value:e&&(0,n.default)(Number(e))}),normalize:e=>e&&`${(0,n.default)(e).valueOf()}`,children:(0,t.jsx)(s.DatePicker,{})}),(0,t.jsx)(s.Form.Item,{label:null,children:(0,t.jsx)(s.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},"5ba6697a":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return u;}});var a=r("f19d2b93");r("f90dca02");var t=r("a9d1a279");let{RangePicker:s}=t.DatePicker,n={labelCol:{xs:{span:24},sm:{span:8}},wrapperCol:{xs:{span:24},sm:{span:16}}},i={rules:[{type:"object",required:!0,message:"Please select time!"}]},o={rules:[{type:"array",required:!0,message:"Please select time!"}]},d=e=>{let l=e["range-picker"],r=e["range-time-picker"];console.log("Received values of form: ",{...e,"date-picker":e["date-picker"].format("YYYY-MM-DD"),"date-time-picker":e["date-time-picker"].format("YYYY-MM-DD HH:mm:ss"),"month-picker":e["month-picker"].format("YYYY-MM"),"range-picker":[l[0].format("YYYY-MM-DD"),l[1].format("YYYY-MM-DD")],"range-time-picker":[r[0].format("YYYY-MM-DD HH:mm:ss"),r[1].format("YYYY-MM-DD HH:mm:ss")],"time-picker":e["time-picker"].format("HH:mm:ss")});};var u=()=>(0,a.jsxs)(t.Form,{name:"time_related_controls",...n,onFinish:d,style:{maxWidth:600},children:[(0,a.jsx)(t.Form.Item,{name:"date-picker",label:"DatePicker",...i,children:(0,a.jsx)(t.DatePicker,{})}),(0,a.jsx)(t.Form.Item,{name:"date-time-picker",label:"DatePicker[showTime]",...i,children:(0,a.jsx)(t.DatePicker,{showTime:!0,format:"YYYY-MM-DD HH:mm:ss"})}),(0,a.jsx)(t.Form.Item,{name:"month-picker",label:"MonthPicker",...i,children:(0,a.jsx)(t.DatePicker,{picker:"month"})}),(0,a.jsx)(t.Form.Item,{name:"range-picker",label:"RangePicker",...o,children:(0,a.jsx)(s,{})}),(0,a.jsx)(t.Form.Item,{name:"range-time-picker",label:"RangePicker[showTime]",...o,children:(0,a.jsx)(s,{showTime:!0,format:"YYYY-MM-DD HH:mm:ss"})}),(0,a.jsx)(t.Form.Item,{name:"time-picker",label:"TimePicker",...i,children:(0,a.jsx)(t.TimePicker,{})}),(0,a.jsx)(t.Form.Item,{label:null,children:(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},"6377d3f3":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("f19d2b93");r("384ee047");var t=r("5b220c3d"),s=r("a9d1a279");let{Option:n}=s.Select,i=e=>{let{id:l,value:r={},onChange:i}=e,[o,d]=(0,t.useState)(0),[u,m]=(0,t.useState)("rmb"),c=e=>{null==i||i({number:o,currency:u,...r,...e});};return(0,a.jsxs)("span",{id:l,children:[(0,a.jsx)(s.Input,{type:"text",value:r.number||o,onChange:e=>{let l=parseInt(e.target.value||"0",10);Number.isNaN(o)||("number"in r||d(l),c({number:l}));},style:{width:100}}),(0,a.jsxs)(s.Select,{value:r.currency||u,style:{width:80,margin:"0 8px"},onChange:e=>{"currency"in r||m(e),c({currency:e});},children:[(0,a.jsx)(n,{value:"rmb",children:"RMB"}),(0,a.jsx)(n,{value:"dollar",children:"Dollar"})]})]});};var o=()=>(0,a.jsxs)(s.Form,{name:"customized_form_controls",layout:"inline",onFinish:e=>{console.log("Received values from form: ",e);},initialValues:{price:{number:0,currency:"rmb"}},children:[(0,a.jsx)(s.Form.Item,{name:"price",label:"Price",rules:[{validator:(e,l)=>l.number>0?Promise.resolve():Promise.reject(Error("Price must be greater than zero!"))}],children:(0,a.jsx)(i,{})}),(0,a.jsx)(s.Form.Item,{children:(0,a.jsx)(s.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},"65a4f691":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("f19d2b93");r("04391e00");var t=r("a9d1a279");let s={labelCol:{span:8},wrapperCol:{span:16}},n={required:"${label} is required!",types:{email:"${label} is not a valid email!",number:"${label} is not a valid number!"},number:{range:"${label} must be between ${min} and ${max}"}},i=e=>{console.log(e);};var o=()=>(0,a.jsxs)(t.Form,{...s,name:"nest-messages",onFinish:i,style:{maxWidth:600},validateMessages:n,children:[(0,a.jsx)(t.Form.Item,{name:["user","name"],label:"Name",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{name:["user","email"],label:"Email",rules:[{type:"email"}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{name:["user","age"],label:"Age",rules:[{type:"number",min:0,max:99}],children:(0,a.jsx)(t.InputNumber,{})}),(0,a.jsx)(t.Form.Item,{name:["user","website"],label:"Website",children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{name:["user","introduction"],label:"Introduction",children:(0,a.jsx)(t.Input.TextArea,{})}),(0,a.jsx)(t.Form.Item,{label:null,children:(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},"6788b7e0":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("817e6e70");var t=r("a9d1a279"),s=()=>(0,a.jsxs)(t.Form,{name:"trigger",style:{maxWidth:600},layout:"vertical",autoComplete:"off",children:[(0,a.jsx)(t.Alert,{message:"Use 'max' rule, continue type chars to see it"}),(0,a.jsx)(t.Form.Item,{hasFeedback:!0,label:"Field A",name:"field_a",validateTrigger:"onBlur",rules:[{max:3}],children:(0,a.jsx)(t.Input,{placeholder:"Validate required onBlur"})}),(0,a.jsx)(t.Form.Item,{hasFeedback:!0,label:"Field B",name:"field_b",validateDebounce:1e3,rules:[{max:3}],children:(0,a.jsx)(t.Input,{placeholder:"Validate required debounce after 1s"})}),(0,a.jsx)(t.Form.Item,{hasFeedback:!0,label:"Field C",name:"field_c",validateFirst:!0,rules:[{max:6},{max:3,message:"Continue input to exceed 6 chars"}],children:(0,a.jsx)(t.Input,{placeholder:"Validate one by one"})})]});},"69b980bc":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return n;}});var a=r("f19d2b93");r("b4310f30");var t=r("e22febe0"),s=r("a9d1a279"),n=()=>{let[e]=s.Form.useForm();return(0,a.jsxs)(s.Form,{labelCol:{span:6},wrapperCol:{span:18},form:e,name:"dynamic_form_complex",style:{maxWidth:600},autoComplete:"off",initialValues:{items:[{}]},children:[(0,a.jsx)(s.Form.List,{name:"items",children:(e,{add:l,remove:r})=>(0,a.jsxs)("div",{style:{display:"flex",rowGap:16,flexDirection:"column"},children:[e.map(e=>(0,a.jsxs)(s.Card,{size:"small",title:`Item ${e.name+1}`,extra:(0,a.jsx)(t.CloseOutlined,{onClick:()=>{r(e.name);}}),children:[(0,a.jsx)(s.Form.Item,{label:"Name",name:[e.name,"name"],children:(0,a.jsx)(s.Input,{})}),(0,a.jsx)(s.Form.Item,{label:"List",children:(0,a.jsx)(s.Form.List,{name:[e.name,"list"],children:(e,l)=>(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",rowGap:16},children:[e.map(e=>(0,a.jsxs)(s.Space,{children:[(0,a.jsx)(s.Form.Item,{noStyle:!0,name:[e.name,"first"],children:(0,a.jsx)(s.Input,{placeholder:"first"})}),(0,a.jsx)(s.Form.Item,{noStyle:!0,name:[e.name,"second"],children:(0,a.jsx)(s.Input,{placeholder:"second"})}),(0,a.jsx)(t.CloseOutlined,{onClick:()=>{l.remove(e.name);}})]},e.key)),(0,a.jsx)(s.Button,{type:"dashed",onClick:()=>l.add(),block:!0,children:"+ Add Sub Item"})]})})})]},e.key)),(0,a.jsx)(s.Button,{type:"dashed",onClick:()=>l(),block:!0,children:"+ Add Item"})]})}),(0,a.jsx)(s.Form.Item,{noStyle:!0,shouldUpdate:!0,children:()=>(0,a.jsx)(s.Typography,{children:(0,a.jsx)("pre",{children:JSON.stringify(e.getFieldsValue(),null,2)})})})]});};},"6bfc7484":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return m;}});var a=r("f19d2b93");r("0c71447d");var t=r("5b220c3d"),s=r("e22febe0"),n=r("a9d1a279");let{RangePicker:i}=n.DatePicker,{TextArea:o}=n.Input,d=e=>Array.isArray(e)?e:null==e?void 0:e.fileList,u=()=>{let[e,l]=(0,t.useState)(!0);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Checkbox,{checked:e,onChange:e=>l(e.target.checked),children:"Form disabled"}),(0,a.jsxs)(n.Form,{labelCol:{span:4},wrapperCol:{span:14},layout:"horizontal",disabled:e,style:{maxWidth:600},children:[(0,a.jsx)(n.Form.Item,{label:"Checkbox",name:"disabled",valuePropName:"checked",children:(0,a.jsx)(n.Checkbox,{children:"Checkbox"})}),(0,a.jsx)(n.Form.Item,{label:"Radio",children:(0,a.jsxs)(n.Radio.Group,{children:[(0,a.jsx)(n.Radio,{value:"apple",children:" Apple "}),(0,a.jsx)(n.Radio,{value:"pear",children:" Pear "})]})}),(0,a.jsx)(n.Form.Item,{label:"Input",children:(0,a.jsx)(n.Input,{})}),(0,a.jsx)(n.Form.Item,{label:"Select",children:(0,a.jsx)(n.Select,{children:(0,a.jsx)(n.Select.Option,{value:"demo",children:"Demo"})})}),(0,a.jsx)(n.Form.Item,{label:"TreeSelect",children:(0,a.jsx)(n.TreeSelect,{treeData:[{title:"Light",value:"light",children:[{title:"Bamboo",value:"bamboo"}]}]})}),(0,a.jsx)(n.Form.Item,{label:"Cascader",children:(0,a.jsx)(n.Cascader,{options:[{value:"zhejiang",label:"Zhejiang",children:[{value:"hangzhou",label:"Hangzhou"}]}]})}),(0,a.jsx)(n.Form.Item,{label:"DatePicker",children:(0,a.jsx)(n.DatePicker,{})}),(0,a.jsx)(n.Form.Item,{label:"RangePicker",children:(0,a.jsx)(i,{})}),(0,a.jsx)(n.Form.Item,{label:"InputNumber",children:(0,a.jsx)(n.InputNumber,{})}),(0,a.jsx)(n.Form.Item,{label:"TextArea",children:(0,a.jsx)(o,{rows:4})}),(0,a.jsx)(n.Form.Item,{label:"Switch",valuePropName:"checked",children:(0,a.jsx)(n.Switch,{})}),(0,a.jsx)(n.Form.Item,{label:"Upload",valuePropName:"fileList",getValueFromEvent:d,children:(0,a.jsx)(n.Upload,{action:"/upload.do",listType:"picture-card",children:(0,a.jsxs)("button",{style:{border:0,background:"none"},type:"button",children:[(0,a.jsx)(s.PlusOutlined,{}),(0,a.jsx)("div",{style:{marginTop:8},children:"Upload"})]})})}),(0,a.jsx)(n.Form.Item,{label:"Button",children:(0,a.jsx)(n.Button,{children:"Button"})}),(0,a.jsx)(n.Form.Item,{label:"Slider",children:(0,a.jsx)(n.Slider,{})}),(0,a.jsx)(n.Form.Item,{label:"ColorPicker",children:(0,a.jsx)(n.ColorPicker,{})}),(0,a.jsx)(n.Form.Item,{label:"Rate",children:(0,a.jsx)(n.Rate,{})})]})]});};var m=()=>(0,a.jsx)(u,{});},"7dfb9606":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return n;}});var a=r("f19d2b93");r("3e681b45");var t=r("5b220c3d"),s=r("a9d1a279"),n=()=>{let[e]=s.Form.useForm(),[l,r]=(0,t.useState)(),[n,i]=(0,t.useState)(!1),o=e=>{console.log("Received values of form: ",e),r(e),i(!1);};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Button,{type:"primary",onClick:()=>i(!0),children:"New Collection"}),(0,a.jsx)("pre",{children:JSON.stringify(l,null,2)}),(0,a.jsxs)(s.Modal,{open:n,title:"Create a new collection",okText:"Create",cancelText:"Cancel",okButtonProps:{autoFocus:!0,htmlType:"submit"},onCancel:()=>i(!1),destroyOnClose:!0,modalRender:l=>(0,a.jsx)(s.Form,{layout:"vertical",form:e,name:"form_in_modal",initialValues:{modifier:"public"},clearOnDestroy:!0,onFinish:e=>o(e),children:l}),children:[(0,a.jsx)(s.Form.Item,{name:"title",label:"Title",rules:[{required:!0,message:"Please input the title of collection!"}],children:(0,a.jsx)(s.Input,{})}),(0,a.jsx)(s.Form.Item,{name:"description",label:"Description",children:(0,a.jsx)(s.Input,{type:"textarea"})}),(0,a.jsx)(s.Form.Item,{name:"modifier",className:"collection-create-form_last-form-item",children:(0,a.jsxs)(s.Radio.Group,{children:[(0,a.jsx)(s.Radio,{value:"public",children:"Public"}),(0,a.jsx)(s.Radio,{value:"private",children:"Private"})]})})]})]});};},"7f970355":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return u;}});var a=r("f19d2b93");r("082dc265");var t=r("5b220c3d"),s=r("a9d1a279");let{Option:n}=s.Select,i=[{value:"zhejiang",label:"Zhejiang",children:[{value:"hangzhou",label:"Hangzhou",children:[{value:"xihu",label:"West Lake"}]}]},{value:"jiangsu",label:"Jiangsu",children:[{value:"nanjing",label:"Nanjing",children:[{value:"zhonghuamen",label:"Zhong Hua Men"}]}]}],o={labelCol:{xs:{span:24},sm:{span:8}},wrapperCol:{xs:{span:24},sm:{span:16}}},d={wrapperCol:{xs:{span:24,offset:0},sm:{span:16,offset:8}}};var u=()=>{let[e]=s.Form.useForm(),l=(0,a.jsx)(s.Form.Item,{name:"prefix",noStyle:!0,children:(0,a.jsxs)(s.Select,{style:{width:70},children:[(0,a.jsx)(n,{value:"86",children:"+86"}),(0,a.jsx)(n,{value:"87",children:"+87"})]})}),r=(0,a.jsx)(s.Form.Item,{name:"suffix",noStyle:!0,children:(0,a.jsxs)(s.Select,{style:{width:70},children:[(0,a.jsx)(n,{value:"USD",children:"$"}),(0,a.jsx)(n,{value:"CNY",children:"\xa5"})]})}),[u,m]=(0,t.useState)([]),c=u.map(e=>({label:e,value:e}));return(0,a.jsxs)(s.Form,{...o,form:e,name:"register",onFinish:e=>{console.log("Received values of form: ",e);},initialValues:{residence:["zhejiang","hangzhou","xihu"],prefix:"86"},style:{maxWidth:600},scrollToFirstError:!0,children:[(0,a.jsx)(s.Form.Item,{name:"email",label:"E-mail",rules:[{type:"email",message:"The input is not valid E-mail!"},{required:!0,message:"Please input your E-mail!"}],children:(0,a.jsx)(s.Input,{})}),(0,a.jsx)(s.Form.Item,{name:"password",label:"Password",rules:[{required:!0,message:"Please input your password!"}],hasFeedback:!0,children:(0,a.jsx)(s.Input.Password,{})}),(0,a.jsx)(s.Form.Item,{name:"confirm",label:"Confirm Password",dependencies:["password"],hasFeedback:!0,rules:[{required:!0,message:"Please confirm your password!"},({getFieldValue:e})=>({validator:(l,r)=>r&&e("password")!==r?Promise.reject(Error("The new password that you entered do not match!")):Promise.resolve()})],children:(0,a.jsx)(s.Input.Password,{})}),(0,a.jsx)(s.Form.Item,{name:"nickname",label:"Nickname",tooltip:"What do you want others to call you?",rules:[{required:!0,message:"Please input your nickname!",whitespace:!0}],children:(0,a.jsx)(s.Input,{})}),(0,a.jsx)(s.Form.Item,{name:"residence",label:"Habitual Residence",rules:[{type:"array",required:!0,message:"Please select your habitual residence!"}],children:(0,a.jsx)(s.Cascader,{options:i})}),(0,a.jsx)(s.Form.Item,{name:"phone",label:"Phone Number",rules:[{required:!0,message:"Please input your phone number!"}],children:(0,a.jsx)(s.Input,{addonBefore:l,style:{width:"100%"}})}),(0,a.jsx)(s.Form.Item,{name:"donation",label:"Donation",rules:[{required:!0,message:"Please input donation amount!"}],children:(0,a.jsx)(s.InputNumber,{addonAfter:r,style:{width:"100%"}})}),(0,a.jsx)(s.Form.Item,{name:"website",label:"Website",rules:[{required:!0,message:"Please input website!"}],children:(0,a.jsx)(s.AutoComplete,{options:c,onChange:e=>{e?m([".com",".org",".net"].map(l=>`${e}${l}`)):m([]);},placeholder:"website",children:(0,a.jsx)(s.Input,{})})}),(0,a.jsx)(s.Form.Item,{name:"intro",label:"Intro",rules:[{required:!0,message:"Please input Intro"}],children:(0,a.jsx)(s.Input.TextArea,{showCount:!0,maxLength:100})}),(0,a.jsx)(s.Form.Item,{name:"gender",label:"Gender",rules:[{required:!0,message:"Please select gender!"}],children:(0,a.jsxs)(s.Select,{placeholder:"select your gender",children:[(0,a.jsx)(n,{value:"male",children:"Male"}),(0,a.jsx)(n,{value:"female",children:"Female"}),(0,a.jsx)(n,{value:"other",children:"Other"})]})}),(0,a.jsx)(s.Form.Item,{label:"Captcha",extra:"We must make sure that your are a human.",children:(0,a.jsxs)(s.Row,{gutter:8,children:[(0,a.jsx)(s.Col,{span:12,children:(0,a.jsx)(s.Form.Item,{name:"captcha",noStyle:!0,rules:[{required:!0,message:"Please input the captcha you got!"}],children:(0,a.jsx)(s.Input,{})})}),(0,a.jsx)(s.Col,{span:12,children:(0,a.jsx)(s.Button,{children:"Get captcha"})})]})}),(0,a.jsx)(s.Form.Item,{name:"agreement",valuePropName:"checked",rules:[{validator:(e,l)=>l?Promise.resolve():Promise.reject(Error("Should accept agreement"))}],...d,children:(0,a.jsxs)(s.Checkbox,{children:["I have read the ",(0,a.jsx)("a",{href:"",children:"agreement"})]})}),(0,a.jsx)(s.Form.Item,{...d,children:(0,a.jsx)(s.Button,{type:"primary",htmlType:"submit",children:"Register"})})]});};},"815a1629":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return n;}});var a=r("f19d2b93");r("c413e601");var t=r("a9d1a279");let s=(0,a.jsx)(t.Form.Item,{label:(0,a.jsx)("a",{href:"https://github.com/ant-design/ant-design/issues/36459",children:"#36459"}),initialValue:["bamboo"],name:"select",style:{boxShadow:"0 0 3px red"},children:(0,a.jsx)(t.Select,{style:{width:"70%"},mode:"multiple",options:[{label:"Bamboo",value:"bamboo"},{label:"Little",value:"little"},{label:"Light",value:"light"}]})});var n=()=>{let e=e=>{console.log("Success:",e);},l=e=>{console.log("Failed:",e);};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.Form,{name:"col-24-debug",labelCol:{span:24},wrapperCol:{span:24},initialValues:{remember:!0},onFinish:e,onFinishFailed:l,style:{maxWidth:600},autoComplete:"off",children:[(0,a.jsx)(t.Form.Item,{label:"Username",name:"username",rules:[{required:!0,message:"Please input your username!"}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:"Password",name:"password",rules:[{required:!0,message:"Please input your password!"}],children:(0,a.jsx)(t.Input.Password,{})}),s,(0,a.jsx)(t.Form.Item,{children:(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]}),(0,a.jsxs)(t.Form,{name:"responsive",labelCol:{sm:24,xl:24},wrapperCol:{sm:24,xl:24},initialValues:{remember:!0},onFinish:e,onFinishFailed:l,autoComplete:"off",children:[(0,a.jsx)(t.Form.Item,{label:"Username",name:"username",rules:[{required:!0,message:"Please input your username!"}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:"Password",name:"password",rules:[{required:!0,message:"Please input your password!"}],children:(0,a.jsx)(t.Input.Password,{})}),(0,a.jsx)(t.Form.Item,{children:(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]}),(0,a.jsx)(t.Divider,{}),(0,a.jsxs)(t.Form,{layout:"vertical",children:[s,(0,a.jsx)(t.Form.Item,{label:"col12",name:"col12",labelCol:{span:12},wrapperCol:{span:12},children:(0,a.jsx)(t.Input,{})})]})]});};},"876123f4":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return n;}});var a=r("f19d2b93");r("b4c0095a");var t=r("e22febe0"),s=r("a9d1a279"),n=()=>(0,a.jsxs)(s.Form,{name:"login",initialValues:{remember:!0},style:{maxWidth:360},onFinish:e=>{console.log("Received values of form: ",e);},children:[(0,a.jsx)(s.Form.Item,{name:"username",rules:[{required:!0,message:"Please input your Username!"}],children:(0,a.jsx)(s.Input,{prefix:(0,a.jsx)(t.UserOutlined,{}),placeholder:"Username"})}),(0,a.jsx)(s.Form.Item,{name:"password",rules:[{required:!0,message:"Please input your Password!"}],children:(0,a.jsx)(s.Input,{prefix:(0,a.jsx)(t.LockOutlined,{}),type:"password",placeholder:"Password"})}),(0,a.jsx)(s.Form.Item,{children:(0,a.jsxs)(s.Flex,{justify:"space-between",align:"center",children:[(0,a.jsx)(s.Form.Item,{name:"remember",valuePropName:"checked",noStyle:!0,children:(0,a.jsx)(s.Checkbox,{children:"Remember me"})}),(0,a.jsx)("a",{href:"",children:"Forgot password"})]})}),(0,a.jsxs)(s.Form.Item,{children:[(0,a.jsx)(s.Button,{block:!0,type:"primary",htmlType:"submit",children:"Log in"}),"or ",(0,a.jsx)("a",{href:"",children:"Register now!"})]})]});},"90b8144d":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("777fffbe"),t=r("f19d2b93");r("7a0c6385");var s=a._(r("5b220c3d")),n=r("a9d1a279");let i=({form:e,children:l})=>{let[r,a]=s.default.useState(!1),i=n.Form.useWatch([],e);return s.default.useEffect(()=>{e.validateFields({validateOnly:!0}).then(()=>a(!0)).catch(()=>a(!1));},[e,i]),(0,t.jsx)(n.Button,{type:"primary",htmlType:"submit",disabled:!r,children:l});};var o=()=>{let[e]=n.Form.useForm();return(0,t.jsxs)(n.Form,{form:e,name:"validateOnly",layout:"vertical",autoComplete:"off",children:[(0,t.jsx)(n.Form.Item,{name:"name",label:"Name",rules:[{required:!0}],children:(0,t.jsx)(n.Input,{})}),(0,t.jsx)(n.Form.Item,{name:"age",label:"Age",rules:[{required:!0}],children:(0,t.jsx)(n.Input,{})}),(0,t.jsx)(n.Form.Item,{children:(0,t.jsxs)(n.Space,{children:[(0,t.jsx)(i,{form:e,children:"Submit"}),(0,t.jsx)(n.Button,{htmlType:"reset",children:"Reset"})]})})]});};},"961e3d0f":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return i;}});var a=r("f19d2b93");r("76d914db");var t=r("a9d1a279");let s=e=>{console.log("Success:",e);},n=e=>{console.log("Failed:",e);};var i=()=>(0,a.jsxs)(t.Form,{name:"basic",labelCol:{span:8},wrapperCol:{span:16},style:{maxWidth:600},initialValues:{remember:!0},onFinish:s,onFinishFailed:n,autoComplete:"off",children:[(0,a.jsx)(t.Form.Item,{label:"Username",name:"username",rules:[{required:!0,message:"Please input your username!"}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:"Password",name:"password",rules:[{required:!0,message:"Please input your password!"}],children:(0,a.jsx)(t.Input.Password,{})}),(0,a.jsx)(t.Form.Item,{name:"remember",valuePropName:"checked",label:null,children:(0,a.jsx)(t.Checkbox,{children:"Remember me"})}),(0,a.jsx)(t.Form.Item,{label:null,children:(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},"98a373ae":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return n;}});var a=r("f19d2b93");r("1a4d37a4");var t=r("5b220c3d"),s=r("a9d1a279"),n=()=>{let[e,l]=(0,t.useState)("default");return(0,a.jsxs)(s.Form,{labelCol:{span:4},wrapperCol:{span:14},layout:"horizontal",initialValues:{size:e},onValuesChange:({size:e})=>{l(e);},size:e,style:{maxWidth:600},children:[(0,a.jsx)(s.Form.Item,{label:"Form Size",name:"size",children:(0,a.jsxs)(s.Radio.Group,{children:[(0,a.jsx)(s.Radio.Button,{value:"small",children:"Small"}),(0,a.jsx)(s.Radio.Button,{value:"default",children:"Default"}),(0,a.jsx)(s.Radio.Button,{value:"large",children:"Large"})]})}),(0,a.jsx)(s.Form.Item,{label:"Input",children:(0,a.jsx)(s.Input,{})}),(0,a.jsx)(s.Form.Item,{label:"Select",children:(0,a.jsx)(s.Select,{children:(0,a.jsx)(s.Select.Option,{value:"demo",children:"Demo"})})}),(0,a.jsx)(s.Form.Item,{label:"TreeSelect",children:(0,a.jsx)(s.TreeSelect,{treeData:[{title:"Light",value:"light",children:[{title:"Bamboo",value:"bamboo"}]}]})}),(0,a.jsx)(s.Form.Item,{label:"Cascader",children:(0,a.jsx)(s.Cascader,{options:[{value:"zhejiang",label:"Zhejiang",children:[{value:"hangzhou",label:"Hangzhou"}]}]})}),(0,a.jsx)(s.Form.Item,{label:"DatePicker",children:(0,a.jsx)(s.DatePicker,{})}),(0,a.jsx)(s.Form.Item,{label:"InputNumber",children:(0,a.jsx)(s.InputNumber,{})}),(0,a.jsx)(s.Form.Item,{label:"Switch",valuePropName:"checked",children:(0,a.jsx)(s.Switch,{})}),(0,a.jsx)(s.Form.Item,{label:"Button",children:(0,a.jsx)(s.Button,{children:"Button"})})]});};},"9c9ca5a8":function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("f19d2b93");r("d6a9f41a");var t=r("e22febe0"),s=r("a9d1a279");let{Option:n}=s.Select,i={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:14}}};var o=()=>(0,a.jsxs)(s.Form,{...i,style:{maxWidth:600},children:[(0,a.jsx)(s.Form.Item,{label:"Fail",validateStatus:"error",help:"Should be combination of numbers & alphabets",children:(0,a.jsx)(s.Input,{placeholder:"unavailable choice",id:"error"})}),(0,a.jsx)(s.Form.Item,{label:"Warning",validateStatus:"warning",children:(0,a.jsx)(s.Input,{placeholder:"Warning",id:"warning",prefix:(0,a.jsx)(t.SmileOutlined,{})})}),(0,a.jsx)(s.Form.Item,{label:"Validating",hasFeedback:!0,validateStatus:"validating",help:"The information is being validated...",children:(0,a.jsx)(s.Input,{placeholder:"I'm the content is being validated",id:"validating"})}),(0,a.jsx)(s.Form.Item,{label:"Success",hasFeedback:!0,validateStatus:"success",children:(0,a.jsx)(s.Input,{placeholder:"I'm the content",id:"success"})}),(0,a.jsx)(s.Form.Item,{label:"Warning",hasFeedback:!0,validateStatus:"warning",children:(0,a.jsx)(s.Input,{placeholder:"Warning",id:"warning2"})}),(0,a.jsx)(s.Form.Item,{label:"Fail",hasFeedback:!0,validateStatus:"error",help:"Should be combination of numbers & alphabets",children:(0,a.jsx)(s.Input,{placeholder:"unavailable choice",id:"error2"})}),(0,a.jsx)(s.Form.Item,{label:"Success",hasFeedback:!0,validateStatus:"success",children:(0,a.jsx)(s.DatePicker,{style:{width:"100%"}})}),(0,a.jsx)(s.Form.Item,{label:"Warning",hasFeedback:!0,validateStatus:"warning",children:(0,a.jsx)(s.TimePicker,{style:{width:"100%"}})}),(0,a.jsx)(s.Form.Item,{label:"Error",hasFeedback:!0,validateStatus:"error",children:(0,a.jsx)(s.DatePicker.RangePicker,{style:{width:"100%"}})}),(0,a.jsx)(s.Form.Item,{label:"Error",hasFeedback:!0,validateStatus:"error",children:(0,a.jsxs)(s.Select,{placeholder:"I'm Select",allowClear:!0,children:[(0,a.jsx)(n,{value:"1",children:"Option 1"}),(0,a.jsx)(n,{value:"2",children:"Option 2"}),(0,a.jsx)(n,{value:"3",children:"Option 3"})]})}),(0,a.jsx)(s.Form.Item,{label:"Validating",hasFeedback:!0,validateStatus:"error",help:"Something breaks the rule.",children:(0,a.jsx)(s.Cascader,{placeholder:"I'm Cascader",options:[{value:"xx",label:"xx"}],allowClear:!0})}),(0,a.jsx)(s.Form.Item,{label:"Warning",hasFeedback:!0,validateStatus:"warning",help:"Need to be checked",children:(0,a.jsx)(s.TreeSelect,{placeholder:"I'm TreeSelect",treeData:[{value:"xx",label:"xx"}],allowClear:!0})}),(0,a.jsxs)(s.Form.Item,{label:"inline",style:{marginBottom:0},children:[(0,a.jsx)(s.Form.Item,{validateStatus:"error",help:"Please select right date",style:{display:"inline-block",width:"calc(50% - 12px)"},children:(0,a.jsx)(s.DatePicker,{})}),(0,a.jsx)("span",{style:{display:"inline-block",width:"24px",lineHeight:"32px",textAlign:"center"},children:"-"}),(0,a.jsx)(s.Form.Item,{style:{display:"inline-block",width:"calc(50% - 12px)"},children:(0,a.jsx)(s.DatePicker,{})})]}),(0,a.jsx)(s.Form.Item,{label:"Success",hasFeedback:!0,validateStatus:"success",children:(0,a.jsx)(s.InputNumber,{style:{width:"100%"}})}),(0,a.jsx)(s.Form.Item,{label:"Success",hasFeedback:!0,validateStatus:"success",children:(0,a.jsx)(s.Input,{allowClear:!0,placeholder:"with allowClear"})}),(0,a.jsx)(s.Form.Item,{label:"Warning",hasFeedback:!0,validateStatus:"warning",children:(0,a.jsx)(s.Input.Password,{placeholder:"with input password"})}),(0,a.jsx)(s.Form.Item,{label:"Error",hasFeedback:!0,validateStatus:"error",children:(0,a.jsx)(s.Input.Password,{allowClear:!0,placeholder:"with input password and allowClear"})}),(0,a.jsx)(s.Form.Item,{label:"Success",hasFeedback:!0,validateStatus:"success",children:(0,a.jsx)(s.Input.OTP,{})}),(0,a.jsx)(s.Form.Item,{label:"Warning",hasFeedback:!0,validateStatus:"warning",children:(0,a.jsx)(s.Input.OTP,{})}),(0,a.jsx)(s.Form.Item,{label:"Error",hasFeedback:!0,validateStatus:"error",children:(0,a.jsx)(s.Input.OTP,{})}),(0,a.jsx)(s.Form.Item,{label:"Fail",validateStatus:"error",hasFeedback:!0,children:(0,a.jsx)(s.Mentions,{})}),(0,a.jsx)(s.Form.Item,{label:"Fail",validateStatus:"error",hasFeedback:!0,help:"Should have something",children:(0,a.jsx)(s.Input.TextArea,{allowClear:!0,showCount:!0})})]});},a03716b3:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return i;}});var a=r("f19d2b93");r("53c3f798");var t=r("a9d1a279");let{RangePicker:s}=t.DatePicker,n={labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:14}}};var i=()=>{let[e]=t.Form.useForm(),l=t.Form.useWatch("variant",e);return(0,a.jsxs)(t.Form,{...n,form:e,variant:l||"filled",style:{maxWidth:600},initialValues:{variant:"filled"},children:[(0,a.jsx)(t.Form.Item,{label:"Form variant",name:"variant",children:(0,a.jsx)(t.Segmented,{options:["outlined","filled","borderless"]})}),(0,a.jsx)(t.Form.Item,{label:"Input",name:"Input",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:"InputNumber",name:"InputNumber",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(t.InputNumber,{style:{width:"100%"}})}),(0,a.jsx)(t.Form.Item,{label:"TextArea",name:"TextArea",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(t.Input.TextArea,{})}),(0,a.jsx)(t.Form.Item,{label:"Mentions",name:"Mentions",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(t.Mentions,{})}),(0,a.jsx)(t.Form.Item,{label:"Select",name:"Select",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(t.Select,{})}),(0,a.jsx)(t.Form.Item,{label:"Cascader",name:"Cascader",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(t.Cascader,{})}),(0,a.jsx)(t.Form.Item,{label:"TreeSelect",name:"TreeSelect",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(t.TreeSelect,{})}),(0,a.jsx)(t.Form.Item,{label:"DatePicker",name:"DatePicker",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(t.DatePicker,{})}),(0,a.jsx)(t.Form.Item,{label:"RangePicker",name:"RangePicker",rules:[{required:!0,message:"Please input!"}],children:(0,a.jsx)(s,{})}),(0,a.jsx)(t.Form.Item,{wrapperCol:{offset:6,span:16},children:(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});};},a55e1b4f:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("3f681966");var t=r("a9d1a279"),s=()=>{let[e]=t.Form.useForm();return(0,a.jsxs)(t.Form,{form:e,name:"dependencies",autoComplete:"off",style:{maxWidth:600},layout:"vertical",children:[(0,a.jsx)(t.Alert,{message:" Try modify `Password2` and then modify `Password`",type:"info",showIcon:!0}),(0,a.jsx)(t.Form.Item,{label:"Password",name:"password",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:"Confirm Password",name:"password2",dependencies:["password"],rules:[{required:!0},({getFieldValue:e})=>({validator:(l,r)=>r&&e("password")!==r?Promise.reject(Error("The new password that you entered do not match!")):Promise.resolve()})],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{noStyle:!0,dependencies:["password2"],children:()=>(0,a.jsxs)(t.Typography,{children:[(0,a.jsxs)("p",{children:["Only Update when ",(0,a.jsx)("code",{children:"password2"})," updated:"]}),(0,a.jsx)("pre",{children:JSON.stringify(e.getFieldsValue(),null,2)})]})})]});};},b0bd8e9e:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("7884e1f9");var t=r("a9d1a279"),s=()=>(0,a.jsxs)(t.Form,{name:"wrap",labelCol:{flex:"110px"},labelAlign:"left",labelWrap:!0,wrapperCol:{flex:1},colon:!1,style:{maxWidth:600},children:[(0,a.jsx)(t.Form.Item,{label:"Normal label",name:"username",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:"A super long label text",name:"password",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:" ",children:(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},b5049da1:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return i;}});var a=r("f19d2b93");r("73f951cb");var t=r("5b220c3d"),s=r("e22febe0"),n=r("a9d1a279"),i=()=>{let[e]=n.Form.useForm(),[l,r]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{r(!0);},[]),(0,a.jsxs)(n.Form,{form:e,name:"horizontal_login",layout:"inline",onFinish:e=>{console.log("Finish:",e);},children:[(0,a.jsx)(n.Form.Item,{name:"username",rules:[{required:!0,message:"Please input your username!"}],children:(0,a.jsx)(n.Input,{prefix:(0,a.jsx)(s.UserOutlined,{}),placeholder:"Username"})}),(0,a.jsx)(n.Form.Item,{name:"password",rules:[{required:!0,message:"Please input your password!"}],children:(0,a.jsx)(n.Input,{prefix:(0,a.jsx)(s.LockOutlined,{}),type:"password",placeholder:"Password"})}),(0,a.jsx)(n.Form.Item,{shouldUpdate:!0,children:()=>(0,a.jsx)(n.Button,{type:"primary",htmlType:"submit",disabled:!l||!e.isFieldsTouched(!0)||!!e.getFieldsError().filter(({errors:e})=>e.length).length,children:"Log in"})})]});};},b71181f2:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("3ff63ddc");var t=r("a9d1a279"),s=()=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.Form,{name:"layout-multiple-horizontal",layout:"horizontal",labelCol:{span:4},wrapperCol:{span:20},children:[(0,a.jsx)(t.Form.Item,{label:"horizontal",name:"horizontal",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{layout:"vertical",label:"vertical",name:"vertical",rules:[{required:!0}],labelCol:{span:24},wrapperCol:{span:24},children:(0,a.jsx)(t.Input,{})})]}),(0,a.jsx)("br",{}),(0,a.jsxs)(t.Form,{name:"layout-multiple-vertical",layout:"vertical",labelCol:{span:4},wrapperCol:{span:20},children:[(0,a.jsx)(t.Form.Item,{label:"vertical",name:"vertical",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{layout:"horizontal",label:"horizontal",name:"horizontal",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})})]})]});},bced356d:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("219b50b0");var t=r("a9d1a279"),s=()=>{let[e]=t.Form.useForm();return(0,a.jsxs)(t.Form,{form:e,scrollToFirstError:{behavior:"instant",block:"end",focus:!0},style:{paddingBlock:32},labelCol:{span:6},wrapperCol:{span:14},children:[(0,a.jsx)(t.Form.Item,{wrapperCol:{offset:6},children:(0,a.jsx)(t.Button,{onClick:()=>e.scrollToField("bio"),children:"Scroll to Bio"})}),(0,a.jsx)(t.Form.Item,{name:"username",label:"UserName",rules:[{required:!0}],children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{label:"Occupation",name:"occupation",children:(0,a.jsx)(t.Select,{options:[{label:"Designer",value:"designer"},{label:"Developer",value:"developer"},{label:"Product Manager",value:"product-manager"}]})}),(0,a.jsx)(t.Form.Item,{name:"motto",label:"Motto",children:(0,a.jsx)(t.Input.TextArea,{rows:4})}),(0,a.jsx)(t.Form.Item,{name:"bio",label:"Bio",rules:[{required:!0}],children:(0,a.jsx)(t.Input.TextArea,{rows:6})}),(0,a.jsx)(t.Form.Item,{wrapperCol:{offset:6},children:(0,a.jsxs)(t.Flex,{gap:"small",children:[(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"}),(0,a.jsx)(t.Button,{danger:!0,onClick:()=>e.resetFields(),children:"Reset"})]})})]});};},bd42b873:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("f19d2b93");r("da5b0a74");var t=r("5b220c3d"),s=r("a9d1a279");let{Paragraph:n}=s.Typography,i=({onChange:e,fields:l})=>(0,a.jsx)(s.Form,{name:"global_state",layout:"inline",fields:l,onFieldsChange:(l,r)=>{e(r);},children:(0,a.jsx)(s.Form.Item,{name:"username",label:"Username",rules:[{required:!0,message:"Username is required!"}],children:(0,a.jsx)(s.Input,{})})});var o=()=>{let[e,l]=(0,t.useState)([{name:["username"],value:"Ant Design"}]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i,{fields:e,onChange:e=>{l(e);}}),(0,a.jsx)(n,{style:{maxWidth:440,marginTop:24},children:(0,a.jsx)("pre",{style:{border:"none"},children:JSON.stringify(e,null,2)})})]});};},c260cfff:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("f19d2b93");r("c1fbc568");var t=r("5b220c3d"),s=r("a9d1a279");let n=e=>11===e?{validateStatus:"success",errorMsg:null}:{validateStatus:"error",errorMsg:"The prime between 8 and 12 is 11!"},i={labelCol:{span:7},wrapperCol:{span:12}};var o=()=>{let[e,l]=(0,t.useState)({value:11});return(0,a.jsx)(s.Form,{style:{maxWidth:600},children:(0,a.jsx)(s.Form.Item,{...i,label:"Prime between 8 & 12",validateStatus:e.validateStatus,help:e.errorMsg||"A prime is a natural number greater than 1 that has no positive divisors other than 1 and itself.",children:(0,a.jsx)(s.InputNumber,{min:8,max:12,value:e.value,onChange:e=>{l({...n(e),value:e});}})})});};},c47f4b77:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return i;}});var a=r("852bbaa9"),t=r("f19d2b93"),s=a._(r("5b220c3d"));r("5fc276af");var n=r("a9d1a279"),i=()=>{let[e]=n.Form.useForm(),l=s.default.useRef(null);return(0,t.jsxs)(n.Form,{form:e,initialValues:{list:["light"]},style:{maxWidth:600},children:[(0,t.jsx)(n.Form.Item,{name:"test",label:"test",children:(0,t.jsx)(n.Input,{ref:l})}),(0,t.jsx)(n.Form.List,{name:"list",children:e=>e.map(e=>(0,s.createElement)(n.Form.Item,{...e,key:e.key},(0,t.jsx)(n.Input,{ref:l})))}),(0,t.jsx)(n.Button,{htmlType:"button",onClick:()=>{e.getFieldInstance("test").focus();},children:"Focus Form.Item"}),(0,t.jsx)(n.Button,{onClick:()=>{e.getFieldInstance(["list",0]).focus();},children:"Focus Form.List"})]});};},ca2a05ad:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return n;}});var a=r("f19d2b93");r("85a63b01");var t=r("5b220c3d"),s=r("a9d1a279"),n=()=>{let[e]=s.Form.useForm(),[l,r]=(0,t.useState)("horizontal");return(0,a.jsxs)(s.Form,{layout:l,form:e,initialValues:{layout:l},onValuesChange:({layout:e})=>{r(e);},style:{maxWidth:"inline"===l?"none":600},children:[(0,a.jsx)(s.Form.Item,{label:"Form Layout",name:"layout",children:(0,a.jsxs)(s.Radio.Group,{value:l,children:[(0,a.jsx)(s.Radio.Button,{value:"horizontal",children:"Horizontal"}),(0,a.jsx)(s.Radio.Button,{value:"vertical",children:"Vertical"}),(0,a.jsx)(s.Radio.Button,{value:"inline",children:"Inline"})]})}),(0,a.jsx)(s.Form.Item,{label:"Field A",children:(0,a.jsx)(s.Input,{placeholder:"input placeholder"})}),(0,a.jsx)(s.Form.Item,{label:"Field B",children:(0,a.jsx)(s.Input,{placeholder:"input placeholder"})}),(0,a.jsx)(s.Form.Item,{children:(0,a.jsx)(s.Button,{type:"primary",children:"Submit"})})]});};},cc09b64f:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return i;}});var a=r("f19d2b93");r("b833bded");var t=r("a9d1a279");let{Option:s}=t.Select,n=e=>{console.log("Received values of form: ",e);};var i=()=>(0,a.jsxs)(t.Form,{name:"complex-form",onFinish:n,labelCol:{span:8},wrapperCol:{span:16},style:{maxWidth:600},children:[(0,a.jsx)(t.Form.Item,{label:"Username",children:(0,a.jsxs)(t.Space,{children:[(0,a.jsx)(t.Form.Item,{name:"username",noStyle:!0,rules:[{required:!0,message:"Username is required"}],children:(0,a.jsx)(t.Input,{style:{width:160},placeholder:"Please input"})}),(0,a.jsx)(t.Tooltip,{title:"Useful information",children:(0,a.jsx)(t.Typography.Link,{href:"#API",children:"Need Help?"})})]})}),(0,a.jsx)(t.Form.Item,{label:"Address",children:(0,a.jsxs)(t.Space.Compact,{children:[(0,a.jsx)(t.Form.Item,{name:["address","province"],noStyle:!0,rules:[{required:!0,message:"Province is required"}],children:(0,a.jsxs)(t.Select,{placeholder:"Select province",children:[(0,a.jsx)(s,{value:"Zhejiang",children:"Zhejiang"}),(0,a.jsx)(s,{value:"Jiangsu",children:"Jiangsu"})]})}),(0,a.jsx)(t.Form.Item,{name:["address","street"],noStyle:!0,rules:[{required:!0,message:"Street is required"}],children:(0,a.jsx)(t.Input,{style:{width:"50%"},placeholder:"Input street"})})]})}),(0,a.jsxs)(t.Form.Item,{label:"BirthDate",style:{marginBottom:0},children:[(0,a.jsx)(t.Form.Item,{name:"year",rules:[{required:!0}],style:{display:"inline-block",width:"calc(50% - 8px)"},children:(0,a.jsx)(t.Input,{placeholder:"Input birth year"})}),(0,a.jsx)(t.Form.Item,{name:"month",rules:[{required:!0}],style:{display:"inline-block",width:"calc(50% - 8px)",margin:"0 8px"},children:(0,a.jsx)(t.Input,{placeholder:"Input birth month"})})]}),(0,a.jsx)(t.Form.Item,{label:null,children:(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});},d385a937:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return m;}});var a=r("f19d2b93");r("76264deb");var t=r("5b220c3d"),s=r("e22febe0"),n=r("a9d1a279");let i={labelCol:{span:8},wrapperCol:{span:16}},o={wrapperCol:{offset:8,span:16}},d=({form:e,open:l})=>{let r=(0,t.useRef)();(0,t.useEffect)(()=>{r.current=l;},[l]);let a=r.current;(0,t.useEffect)(()=>{!l&&a&&e.resetFields();},[e,a,l]);},u=({open:e,onCancel:l})=>{let[r]=n.Form.useForm();return d({form:r,open:e}),(0,a.jsx)(n.Modal,{title:"Basic Drawer",open:e,onOk:()=>{r.submit();},onCancel:l,children:(0,a.jsxs)(n.Form,{form:r,layout:"vertical",name:"userForm",children:[(0,a.jsx)(n.Form.Item,{name:"name",label:"User Name",rules:[{required:!0}],children:(0,a.jsx)(n.Input,{})}),(0,a.jsx)(n.Form.Item,{name:"age",label:"User Age",rules:[{required:!0}],children:(0,a.jsx)(n.InputNumber,{})})]})});};var m=()=>{let[e,l]=(0,t.useState)(!1);return(0,a.jsxs)(n.Form.Provider,{onFormFinish:(e,{values:r,forms:a})=>{if("userForm"===e){let{basicForm:e}=a,t=e.getFieldValue("users")||[];e.setFieldsValue({users:[...t,r]}),l(!1);}},children:[(0,a.jsxs)(n.Form,{...i,name:"basicForm",onFinish:e=>{console.log("Finish:",e);},style:{maxWidth:600},children:[(0,a.jsx)(n.Form.Item,{name:"group",label:"Group Name",rules:[{required:!0}],children:(0,a.jsx)(n.Input,{})}),(0,a.jsx)(n.Form.Item,{name:"users",noStyle:!0}),(0,a.jsx)(n.Form.Item,{label:"User List",shouldUpdate:(e,l)=>e.users!==l.users,children:({getFieldValue:e})=>{let l=e("users")||[];return l.length?(0,a.jsx)(n.Flex,{vertical:!0,gap:8,children:l.map(e=>(0,a.jsxs)(n.Space,{children:[(0,a.jsx)(n.Avatar,{icon:(0,a.jsx)(s.UserOutlined,{})}),`${e.name} - ${e.age}`]},e.name))}):(0,a.jsxs)(n.Typography.Text,{className:"ant-form-text",type:"secondary",children:["( ",(0,a.jsx)(s.SmileOutlined,{})," No user yet. )"]});}}),(0,a.jsxs)(n.Form.Item,{...o,children:[(0,a.jsx)(n.Button,{htmlType:"submit",type:"primary",children:"Submit"}),(0,a.jsx)(n.Button,{htmlType:"button",style:{margin:"0 8px"},onClick:()=>{l(!0);},children:"Add User"})]})]}),(0,a.jsx)(u,{open:e,onCancel:()=>{l(!1);}})]});};},ea49f4e2:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("f19d2b93");r("1d97c650");var t=r("5b220c3d"),s=r("e22febe0"),n=r("a9d1a279");let i=(e,{required:l})=>(0,a.jsxs)(a.Fragment,{children:[l?(0,a.jsx)(n.Tag,{color:"error",children:"Required"}):(0,a.jsx)(n.Tag,{color:"warning",children:"optional"}),e]});var o=()=>{let[e]=n.Form.useForm(),[l,r]=(0,t.useState)("optional");return(0,a.jsxs)(n.Form,{form:e,layout:"vertical",initialValues:{requiredMarkValue:l},onValuesChange:({requiredMarkValue:e})=>{r(e);},requiredMark:"customize"===l?i:l,children:[(0,a.jsx)(n.Form.Item,{label:"Required Mark",name:"requiredMarkValue",children:(0,a.jsxs)(n.Radio.Group,{children:[(0,a.jsx)(n.Radio.Button,{value:!0,children:"Default"}),(0,a.jsx)(n.Radio.Button,{value:"optional",children:"Optional"}),(0,a.jsx)(n.Radio.Button,{value:!1,children:"Hidden"}),(0,a.jsx)(n.Radio.Button,{value:"customize",children:"Customize"})]})}),(0,a.jsx)(n.Form.Item,{label:"Field A",required:!0,tooltip:"This is a required field",children:(0,a.jsx)(n.Input,{placeholder:"input placeholder"})}),(0,a.jsx)(n.Form.Item,{label:"Field B",tooltip:{title:"Tooltip with customize icon",icon:(0,a.jsx)(s.InfoCircleOutlined,{})},children:(0,a.jsx)(n.Input,{placeholder:"input placeholder"})}),(0,a.jsx)(n.Form.Item,{children:(0,a.jsx)(n.Button,{type:"primary",children:"Submit"})})]});};},ec4fd198:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return o;}});var a=r("f19d2b93");r("9ed2e865");var t=r("5b220c3d"),s=r("a9d1a279");let n={labelCol:{span:4},wrapperCol:{span:8}},i={labelCol:{span:4},wrapperCol:{span:8,offset:4}};var o=()=>{let[e]=s.Form.useForm(),[l,r]=(0,t.useState)(!1);(0,t.useEffect)(()=>{e.validateFields(["nickname"]);},[l,e]);let o=async()=>{try{let l=await e.validateFields();console.log("Success:",l);}catch(e){console.log("Failed:",e);}};return(0,a.jsxs)(s.Form,{form:e,name:"dynamic_rule",style:{maxWidth:600},children:[(0,a.jsx)(s.Form.Item,{...n,name:"username",label:"Name",rules:[{required:!0,message:"Please input your name"}],children:(0,a.jsx)(s.Input,{placeholder:"Please input your name"})}),(0,a.jsx)(s.Form.Item,{...n,name:"nickname",label:"Nickname",rules:[{required:l,message:"Please input your nickname"}],children:(0,a.jsx)(s.Input,{placeholder:"Please input your nickname"})}),(0,a.jsx)(s.Form.Item,{...i,children:(0,a.jsx)(s.Checkbox,{checked:l,onChange:e=>{r(e.target.checked);},children:"Nickname is required"})}),(0,a.jsx)(s.Form.Item,{...i,children:(0,a.jsx)(s.Button,{type:"primary",onClick:o,children:"Check"})})]});};},ed6de1c1:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return d;}});var a=r("f19d2b93");r("9b1c034a");var t=r("5b220c3d"),s=r("e22febe0"),n=r("a9d1a279");let{Option:i}=n.Select,o=()=>{let{token:e}=n.theme.useToken(),[l]=n.Form.useForm(),[r,o]=(0,t.useState)(!1),d={maxWidth:"none",background:e.colorFillAlter,borderRadius:e.borderRadiusLG,padding:24};return(0,a.jsxs)(n.Form,{form:l,name:"advanced_search",style:d,onFinish:e=>{console.log("Received values of form: ",e);},children:[(0,a.jsx)(n.Row,{gutter:24,children:(()=>{let e=r?10:6,l=[];for(let r=0;r<e;r++)l.push((0,a.jsx)(n.Col,{span:8,children:r%3!=1?(0,a.jsx)(n.Form.Item,{name:`field-${r}`,label:`Field ${r}`,rules:[{required:!0,message:"Input something!"}],children:(0,a.jsx)(n.Input,{placeholder:"placeholder"})}):(0,a.jsx)(n.Form.Item,{name:`field-${r}`,label:`Field ${r}`,rules:[{required:!0,message:"Select something!"}],initialValue:"1",children:(0,a.jsxs)(n.Select,{children:[(0,a.jsx)(i,{value:"1",children:"longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong"}),(0,a.jsx)(i,{value:"2",children:"222"})]})})},r));return l;})()}),(0,a.jsx)("div",{style:{textAlign:"right"},children:(0,a.jsxs)(n.Space,{size:"small",children:[(0,a.jsx)(n.Button,{type:"primary",htmlType:"submit",children:"Search"}),(0,a.jsx)(n.Button,{onClick:()=>{l.resetFields();},children:"Clear"}),(0,a.jsxs)("a",{style:{fontSize:12},onClick:()=>{o(!r);},children:[(0,a.jsx)(s.DownOutlined,{rotate:r?180:0})," Collapse"]})]})})]});};var d=()=>{let{token:e}=n.theme.useToken(),l={lineHeight:"200px",textAlign:"center",background:e.colorFillAlter,borderRadius:e.borderRadiusLG,marginTop:16};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{}),(0,a.jsx)("div",{style:l,children:"Search Result List"})]});};},eed8fa9b:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("de2d61bb");var t=r("a9d1a279"),s=()=>{let[e]=t.Form.useForm(),l=t.Form.useWatch("name",e),r=t.Form.useWatch(e=>`name: ${e.name||""}`,e);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.Form,{form:e,layout:"vertical",autoComplete:"off",children:[(0,a.jsx)(t.Form.Item,{name:"name",label:"Name (Watch to trigger rerender)",children:(0,a.jsx)(t.Input,{})}),(0,a.jsx)(t.Form.Item,{name:"age",label:"Age (Not Watch)",children:(0,a.jsx)(t.InputNumber,{})})]}),(0,a.jsxs)(t.Typography,{children:[(0,a.jsxs)("pre",{children:["Name Value: ",l]}),(0,a.jsxs)("pre",{children:["Custom Value: ",r]})]})]});};},f7c51f5c:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return s;}});var a=r("f19d2b93");r("89b826e3");var t=r("a9d1a279"),s=()=>{let[e]=t.Form.useForm();return(0,a.jsxs)(t.Form,{form:e,layout:"vertical",onFinish:()=>{t.message.success("Submit success!");},onFinishFailed:()=>{t.message.error("Submit failed!");},autoComplete:"off",children:[(0,a.jsx)(t.Form.Item,{name:"url",label:"URL",rules:[{required:!0},{type:"url",warningOnly:!0},{type:"string",min:6}],children:(0,a.jsx)(t.Input,{placeholder:"input placeholder"})}),(0,a.jsx)(t.Form.Item,{children:(0,a.jsxs)(t.Space,{children:[(0,a.jsx)(t.Button,{type:"primary",htmlType:"submit",children:"Submit"}),(0,a.jsx)(t.Button,{htmlType:"button",onClick:()=>{e.setFieldsValue({url:"https://taobao.com/"});},children:"Fill"})]})})]});};},fc6cc44b:function(e,l,r){"use strict";r.d(l,"__esModule",{value:!0}),r.d(l,"default",{enumerable:!0,get:function(){return d;}});var a=r("f19d2b93"),t=r("5b220c3d");r("d18732fa");var s=r("e22febe0"),n=r("a9d1a279");let i={labelCol:{xs:{span:24},sm:{span:4}},wrapperCol:{xs:{span:24},sm:{span:20}}},o={wrapperCol:{xs:{span:24,offset:0},sm:{span:20,offset:4}}};var d=()=>(0,a.jsxs)(n.Form,{name:"dynamic_form_item",...o,onFinish:e=>{console.log("Received values of form:",e);},style:{maxWidth:600},children:[(0,a.jsx)(n.Form.List,{name:"names",rules:[{validator:async(e,l)=>{if(!l||l.length<2)return Promise.reject(Error("At least 2 passengers"));}}],children:(e,{add:l,remove:r},{errors:d})=>(0,a.jsxs)(a.Fragment,{children:[e.map((l,d)=>(0,t.createElement)(n.Form.Item,{...0===d?i:o,label:0===d?"Passengers":"",required:!1,key:l.key,children:[(0,a.jsx)(n.Form.Item,{...l,validateTrigger:["onChange","onBlur"],rules:[{required:!0,whitespace:!0,message:"Please input passenger's name or delete this field."}],noStyle:!0,children:(0,a.jsx)(n.Input,{placeholder:"passenger name",style:{width:"60%"}})}),e.length>1?(0,a.jsx)(s.MinusCircleOutlined,{className:"dynamic-delete-button",onClick:()=>r(l.name)}):null]})),(0,a.jsxs)(n.Form.Item,{children:[(0,a.jsx)(n.Button,{type:"dashed",onClick:()=>l(),style:{width:"60%"},icon:(0,a.jsx)(s.PlusOutlined,{}),children:"Add field"}),(0,a.jsx)(n.Button,{type:"dashed",onClick:()=>{l("The head item",0);},style:{width:"60%",marginTop:"20px"},icon:(0,a.jsx)(s.PlusOutlined,{}),children:"Add field at head"}),(0,a.jsx)(n.Form.ErrorList,{errors:d})]})]})}),(0,a.jsx)(n.Form.Item,{children:(0,a.jsx)(n.Button,{type:"primary",htmlType:"submit",children:"Submit"})})]});}}]);