@uiw/doc 4.13.8 → 4.13.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/web/CONTRIBUTORS.svg +3 -3
  3. package/web/asset-manifest.json +18 -18
  4. package/web/index.html +1 -1
  5. package/web/static/css/{main.74129d99.css → main.12b9013f.css} +2 -2
  6. package/web/static/css/main.12b9013f.css.map +1 -0
  7. package/web/static/js/2854.3e64c006.chunk.js +3 -0
  8. package/web/static/js/{2854.377c4863.chunk.js.LICENSE.txt → 2854.3e64c006.chunk.js.LICENSE.txt} +0 -0
  9. package/web/static/js/2854.3e64c006.chunk.js.map +1 -0
  10. package/web/static/js/{5393.8729db46.chunk.js → 5393.b105bd5e.chunk.js} +2 -2
  11. package/web/static/js/5393.b105bd5e.chunk.js.map +1 -0
  12. package/web/static/js/5468.462bf55f.chunk.js +2 -0
  13. package/web/static/js/5468.462bf55f.chunk.js.map +1 -0
  14. package/web/static/js/7313.c64ca191.chunk.js +2 -0
  15. package/web/static/js/7313.c64ca191.chunk.js.map +1 -0
  16. package/web/static/js/766.7ba76965.chunk.js +2 -0
  17. package/web/static/js/766.7ba76965.chunk.js.map +1 -0
  18. package/web/static/js/{8768.2b6b6aab.chunk.js → 8768.5facbb82.chunk.js} +2 -2
  19. package/web/static/js/{8768.2b6b6aab.chunk.js.map → 8768.5facbb82.chunk.js.map} +1 -1
  20. package/web/static/js/{main.b8836d2a.js → main.1a6d716d.js} +2 -2
  21. package/web/static/js/main.1a6d716d.js.map +1 -0
  22. package/web/static/css/main.74129d99.css.map +0 -1
  23. package/web/static/js/2854.377c4863.chunk.js +0 -3
  24. package/web/static/js/2854.377c4863.chunk.js.map +0 -1
  25. package/web/static/js/5393.8729db46.chunk.js.map +0 -1
  26. package/web/static/js/5468.ea87a4b5.chunk.js +0 -2
  27. package/web/static/js/5468.ea87a4b5.chunk.js.map +0 -1
  28. package/web/static/js/7313.18ac2eb2.chunk.js +0 -2
  29. package/web/static/js/7313.18ac2eb2.chunk.js.map +0 -1
  30. package/web/static/js/766.d3dd7e64.chunk.js +0 -2
  31. package/web/static/js/766.d3dd7e64.chunk.js.map +0 -1
  32. package/web/static/js/main.b8836d2a.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5393],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return b}});var r=t(50189),o=t(53782),i=t(11026),c=t(41473),s=t(64496),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,c=e.codeSandbox,s=(0,o.Z)(e,l),d=(0,r.Z)({},s);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@17.x/umd/react.development.js;https://unpkg.com/react-dom@17.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.1.3/index.js")}),c&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"^17.0.2","react-dom":"^17.0.2",uiw:"latest"},devDependencies:{"@kkt/less-modules":"~7.1.1",kkt:"~7.1.5"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(31996);function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(c.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var m="index_docinfo__3Vx8S",k="index_markdown__hcQCp",v=["inline","node"],x=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function b(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,c.useState)(""),h=(0,i.Z)(l,2),b=h[0],j=h[1],g=d.i8||"2.0.0";return(0,c.useEffect)((function(){n&&n().then((function(e){j(e)})).catch((function(){}))}),[]),b?(0,u.jsxs)("div",{children:[(0,u.jsx)(s.Z,{source:b,className:k,components:{code:function(e){var n=e.inline,i=e.node,c=(0,o.Z)(e,v),s=c,d=s.noPreview,a=s.bordered,l=s.noScroll,h=s.bgWhite,f=s.noCode,m=s.codePen,k=s.codeSandbox;if(n)return(0,u.jsx)("code",(0,r.Z)({},c));var b={noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:f,codePen:m,codeSandbox:k};return 0===Object.keys(b).filter((function(e){return void 0!==b[e]})).length?(0,u.jsx)("code",(0,r.Z)({},c)):(0,u.jsx)(p,{version:g,code:x(i.children),dependencies:t,noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:f,codePen:m,codeSandbox:k})}}}),(0,u.jsx)("div",{className:m,children:(0,u.jsx)(f,{path:a})})]}):null}},45171:function(e,n,t){"use strict";t.r(n);var r=t(27791),o=t(57135),i=t.n(o),c=(t(41473),t(31996)),s=t(86082),d=t(69286);n.default=function(){return(0,d.jsx)(s.Z,{path:"https://github.com/uiwjs/uiw/tree/master/packages/react-tree/README.md",dependencies:{Tree:c.Tree,Row:c.Row,Col:c.Col,Card:c.Card,Icon:c.Icon},renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(5468).then(t.bind(t,25468));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
- //# sourceMappingURL=5393.8729db46.chunk.js.map
1
+ (self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5393],{84934:function(e){function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=function(){return[]},n.resolve=n,n.id=84934,e.exports=n},86082:function(e,n,t){"use strict";t.d(n,{Z:function(){return b}});var r=t(50189),o=t(53782),i=t(11026),c=t(41473),s=t(64496),d=t(75752),a=t(64508),u=t(69286),l=["version","dependencies","codePen","codeSandbox"];function p(e){var n=e.version,t=e.dependencies,i=e.codePen,c=e.codeSandbox,s=(0,o.Z)(e,l),d=(0,r.Z)({},s);return i&&(d.codePenOption={title:"uiw".concat(n," - demo"),includeModule:["uiw"],js:(d.code||"").replace("_mount_",'document.getElementById("container")'),html:'<div id="container" style="padding: 24px"></div>',css_external:"https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.css"),js_external:"https://unpkg.com/react@17.x/umd/react.development.js;https://unpkg.com/react-dom@17.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@".concat(n,"/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.1.3/index.js")}),c&&(d.codeSandboxOption={files:{"sandbox.config.json":{content:'{\n "template": "node",\n "container": {\n "startScript": "start",\n "node": "14"\n }\n }'},"public/index.html":{content:'<div id="container"></div>'},"src/index.js":{content:(d.code||"").replace("_mount_",'document.getElementById("container")')},".kktrc.js":{content:'import lessModules from "@kkt/less-modules";\nexport default (conf, env, options) => {\nconf = lessModules(conf, env, options);\nreturn conf;\n};'},"package.json":{content:{name:"uiw-demo",description:"uiw v".concat(n," - demo"),dependencies:{react:"^17.0.2","react-dom":"^17.0.2",uiw:"latest"},devDependencies:{"@kkt/less-modules":"~7.1.1",kkt:"~7.1.5"},license:"MIT",scripts:{start:"kkt start",build:"kkt build",test:"kkt test --env=jsdom"},browserslist:[">0.2%","not dead","not ie <= 11","not op_mini all"]}}}}),(0,u.jsx)(a.Z,(0,r.Z)((0,r.Z)({},d),{},{dependencies:t,style:{marginBottom:0}}))}var h=t(31996);function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.path,t=/^http/.test(n||"")?n:"https://github.com/uiwjs/uiw/blob/master/".concat(n);return(0,u.jsxs)(c.Fragment,{children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",t&&(0,u.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,u.jsx)("br",{}),(0,u.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,u.jsx)(h.Divider,{type:"vertical"}),(0,u.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}var f="index_docinfo__3Vx8S",k="index_markdown__hcQCp",v=["inline","node"],x=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.forEach((function(n){"text"===n.type?t+=n.value:n.children&&Array.isArray(n.children)&&(t+=e(n.children))})),t};function b(e){var n=e.renderPage,t=e.dependencies,a=e.path,l=(0,c.useState)(""),h=(0,i.Z)(l,2),b=h[0],j=h[1],g=d.i8||"2.0.0";return(0,c.useEffect)((function(){n&&n().then((function(e){j(e)})).catch((function(){}))}),[]),b?(0,u.jsxs)("div",{children:[(0,u.jsx)(s.Z,{source:b,className:k,components:{code:function(e){var n=e.inline,i=e.node,c=(0,o.Z)(e,v),s=c,d=s.noPreview,a=s.bordered,l=s.noScroll,h=s.bgWhite,m=s.noCode,f=s.codePen,k=s.codeSandbox;if(n)return(0,u.jsx)("code",(0,r.Z)({},c));var b={noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:m,codePen:f,codeSandbox:k};return 0===Object.keys(b).filter((function(e){return void 0!==b[e]})).length?(0,u.jsx)("code",(0,r.Z)({},c)):(0,u.jsx)(p,{version:g,code:x(i.children),dependencies:t,noPreview:d,bordered:a,noScroll:l,bgWhite:h,noCode:m,codePen:f,codeSandbox:k})}}}),(0,u.jsx)("div",{className:f,children:(0,u.jsx)(m,{path:a})})]}):null}},45171:function(e,n,t){"use strict";t.r(n);var r=t(27791),o=t(57135),i=t.n(o),c=(t(41473),t(31996)),s=t(86082),d=t(69286);n.default=function(){return(0,d.jsx)(s.Z,{path:"https://github.com/uiwjs/uiw/tree/master/packages/react-tree/README.md",dependencies:{Tree:c.Tree,Row:c.Row,Col:c.Col,Card:c.Card,Icon:c.Icon,Form:c.Form,Button:c.Button},renderPage:(0,r.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.e(5468).then(t.bind(t,25468));case 2:return n=e.sent,e.abrupt("return",n.default||n);case 4:case"end":return e.stop()}}),e)})))})}}}]);
2
+ //# sourceMappingURL=5393.b105bd5e.chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/5393.b105bd5e.chunk.js","mappings":"wFAAA,SAASA,EAAoBC,GAC5B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBF,EAAM,KAEjD,MADAC,EAAEE,KAAO,mBACHF,EAEPF,EAAoBK,KAAO,WAAa,MAAO,IAC/CL,EAAoBM,QAAUN,EAC9BA,EAAoBO,GAAK,MACzBC,EAAOC,QAAUT,G,oNCEF,SAASU,EAAT,GAAqF,IAArEC,EAAoE,EAApEA,QAASC,EAA2D,EAA3DA,aAAcC,EAA6C,EAA7CA,QAASC,EAAoC,EAApCA,YAAgBC,GAAoB,YAC3FC,GAAuB,UAAQD,GAyDrC,OAxDIF,IACFG,EAAMC,cAAgB,CACpBC,MAAM,MAAD,OAAQP,EAAR,WACLQ,cAAe,CAAC,OAChBC,IAAKJ,EAAMZ,MAAQ,IAAIiB,QAAQ,UAAW,wCAC1CC,KAAM,mDACNC,aAAa,yBAAD,OAA2BZ,EAA3B,qBACZa,YAAY,yLAAD,OAA2Lb,EAA3L,qFAGXG,IACFE,EAAMS,kBAAoB,CACxBC,MAAO,CACL,sBAAuB,CACrBC,QAAQ,iKAQV,oBAAqB,CACnBA,QAAQ,8BAEV,eAAgB,CACdA,SAAUX,EAAMZ,MAAQ,IAAIiB,QAAQ,UAAW,yCAEjD,YAAa,CACXM,QAAQ,qJAEV,eAAgB,CACdA,QAAS,CACPC,KAAM,WACNC,YAAY,QAAD,OAAUlB,EAAV,WACXC,aAAc,CACZkB,MAAO,UACP,YAAa,UACbC,IAAK,UAEPC,gBAAiB,CACf,oBAAqB,SACrBC,IAAK,UAEPC,QAAS,MACTC,QAAS,CACPC,MAAO,YACPC,MAAO,YACPC,KAAM,wBAERC,aAAc,CAAC,QAAS,WAAY,eAAgB,yBAMvD,SAAC,KAAD,kBAAiBvB,GAAjB,IAAwBJ,aAAcA,EAAc4B,MAAO,CAAEC,aAAc,M,eC7DrE,SAAS,IAA2B,IAA1BzB,EAAyB,uDAAJ,GACpC0B,EAAS1B,EAAT0B,KACFC,EAAM,QAAQL,KAAKI,GAAQ,IAAMA,EAA3B,mDAA8EA,GAC1F,OACE,UAAC,EAAAE,SAAD,wGAEGD,IACC,cAAGE,KAAMF,EAAKG,OAAO,SAASC,IAAI,sBAAlC,+DAIF,mBACA,cAAGF,KAAK,sCAAsCC,OAAO,SAASC,IAAI,sBAAlE,uCAGA,SAAC,EAAAC,QAAD,CAASC,KAAK,cACd,cAAGH,OAAO,SAASC,IAAI,sBAAsBF,KAAK,0CAAlD,8BAGA,SAAC,EAAAG,QAAD,CAASC,KAAK,cACd,cAAGH,OAAO,SAASC,IAAI,sBAAsBF,KAAK,+BAAlD,qBAGA,SAAC,EAAAG,QAAD,CAASC,KAAK,cACd,cAAGH,OAAO,SAASC,IAAI,sBAAsBF,KAAK,+BAAlD,kBAGA,SAAC,EAAAG,QAAD,CAASC,KAAK,cACd,cAAGH,OAAO,SAASC,IAAI,sBAAsBF,KAAK,mCAAlD,uBAGA,SAAC,EAAAG,QAAD,CAASC,KAAK,cACd,cAAGH,OAAO,SAASC,IAAI,sBAAsBF,KAAK,sBAAlD,yCCtCN,MAA0B,uBAA1B,EAA4D,wB,oBCYtDK,EAAa,SAAbA,IAAuD,IAAzCC,EAAwC,uDAA1B,GAAI/C,EAAsB,uDAAP,GAQnD,OAPA+C,EAAKC,SAAQ,SAACC,GACM,SAAdA,EAAKJ,KACP7C,GAAQiD,EAAKC,MACJD,EAAKE,UAAYC,MAAMC,QAAQJ,EAAKE,YAC7CnD,GAAQ8C,EAAWG,EAAKE,cAGrBnD,GAGM,SAASsD,EAAc1C,GACpC,IAAQ2C,EAAmC3C,EAAnC2C,WAAY/C,EAAuBI,EAAvBJ,aAAc8B,EAAS1B,EAAT0B,KAClC,GAA0BkB,EAAAA,EAAAA,UAAS,IAAnC,eAAOC,EAAP,KAAcC,EAAd,KAEMnD,EAAUoD,EAAAA,IAAe,QAY/B,OAXAC,EAAAA,EAAAA,YAAU,WACJL,GACFA,IACGM,MAAK,SAACC,GACLJ,EAASI,MAEVC,OAAM,iBAGV,IAEEN,GAKH,4BACE,SAAC,IAAD,CACEO,OAAQP,EACRQ,UAAWC,EACXC,WAAY,CASVnE,KAAM,YAAiC,IAA9BoE,EAA6B,EAA7BA,OAAQnB,EAAqB,EAArBA,KAASrC,GAAY,YACpC,EAAiFA,EAAzEyD,EAAR,EAAQA,UAAWC,EAAnB,EAAmBA,SAAUC,EAA7B,EAA6BA,SAAUC,EAAvC,EAAuCA,QAASC,EAAhD,EAAgDA,OAAQhE,EAAxD,EAAwDA,QAASC,EAAjE,EAAiEA,YACjE,GAAI0D,EACF,OAAO,2BAAUxD,IAEnB,IAAM8D,EAAS,CACbL,UAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAhE,QAAAA,EACAC,YAAAA,GAEF,OAAgF,IAA5EiE,OAAO1E,KAAKyE,GAAQE,QAAO,SAACpD,GAAD,YAA2BqD,IAAjBH,EAAOlD,MAAqBsD,QAC5D,2BAAUlE,KAGjB,SAACN,EAAD,CACEC,QAASA,EACTP,KAAM8C,EAAWG,EAAKE,UACtB3C,aAAcA,EACR6D,UAAAA,EAAWC,SAAAA,EAAUC,SAAAA,EAAUC,QAAAA,EAASC,OAAAA,EAAQhE,QAAAA,EAASC,YAAAA,SAMzE,gBAAKuD,UAAWC,EAAhB,UACE,SAACa,EAAD,CAAQzC,KAAMA,SA9CX,O,yHCrCX,qBAAe,OACb,SAAC,IAAD,CACEA,KAAK,yEACL9B,aAAc,CAAEwE,KAAAA,EAAAA,KAAMC,IAAAA,EAAAA,IAAKC,IAAAA,EAAAA,IAAKC,KAAAA,EAAAA,KAAMC,KAAAA,EAAAA,KAAMC,KAAAA,EAAAA,KAAMC,OAAAA,EAAAA,QAClD/B,YAAU,iBAAE,oGACO,gCADP,cACJgC,EADI,yBAEHA,EAAGC,SAAWD,GAFX","sources":["../../node_modules/@babel/standalone|sync|nonrecursive","components/Markdown/Code.tsx","components/Markdown/Footer.tsx","webpack://website/./src/components/Markdown/index.module.less?6e49","components/Markdown/index.tsx","routes/components/tree/index.tsx"],"sourcesContent":["function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 84934;\nmodule.exports = webpackEmptyContext;","import CodePreview, { CodePreviewProps } from '@uiw/react-code-preview';\n\nexport interface CodeProps extends CodePreviewProps {\n code: string;\n version: string;\n codePen: boolean;\n codeSandbox?: boolean;\n dependencies: any;\n}\n\nexport default function Code({ version, dependencies, codePen, codeSandbox, ...other }: CodeProps) {\n const props: CodePreviewProps = { ...other };\n if (codePen) {\n props.codePenOption = {\n title: `uiw${version} - demo`,\n includeModule: ['uiw'],\n js: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n html: '<div id=\"container\" style=\"padding: 24px\"></div>',\n css_external: `https://unpkg.com/uiw@${version}/dist/uiw.min.css`,\n js_external: `https://unpkg.com/react@17.x/umd/react.development.js;https://unpkg.com/react-dom@17.x/umd/react-dom.development.js;https://unpkg.com/classnames@2.2.6/index.js;https://unpkg.com/uiw@${version}/dist/uiw.min.js;https://unpkg.com/@uiw/codepen-require-polyfill@1.1.3/index.js`,\n };\n }\n if (codeSandbox) {\n props.codeSandboxOption = {\n files: {\n 'sandbox.config.json': {\n content: `{\n \"template\": \"node\",\n \"container\": {\n \"startScript\": \"start\",\n \"node\": \"14\"\n }\n }`,\n },\n 'public/index.html': {\n content: `<div id=\"container\"></div>`,\n },\n 'src/index.js': {\n content: (props.code || '').replace('_mount_', 'document.getElementById(\"container\")'),\n },\n '.kktrc.js': {\n content: `import lessModules from \"@kkt/less-modules\";\\nexport default (conf, env, options) => {\\nconf = lessModules(conf, env, options);\\nreturn conf;\\n};`,\n },\n 'package.json': {\n content: {\n name: 'uiw-demo',\n description: `uiw v${version} - demo`,\n dependencies: {\n react: '^17.0.2',\n 'react-dom': '^17.0.2',\n uiw: 'latest',\n },\n devDependencies: {\n '@kkt/less-modules': '~7.1.1',\n kkt: '~7.1.5',\n },\n license: 'MIT',\n scripts: {\n start: 'kkt start',\n build: 'kkt build',\n test: 'kkt test --env=jsdom',\n },\n browserslist: ['>0.2%', 'not dead', 'not ie <= 11', 'not op_mini all'],\n },\n },\n },\n };\n }\n return <CodePreview {...props} dependencies={dependencies} style={{ marginBottom: 0 }} />;\n}\n","import React, { Fragment } from 'react';\nimport { Divider } from 'uiw';\n\nexport type FooterProps = {\n path?: string;\n};\n\nexport default function (props: FooterProps = {}) {\n const { path } = props;\n const url = /^http/.test(path || '') ? path : `https://github.com/uiwjs/uiw/blob/master/${path}`;\n return (\n <Fragment>\n 犯了错误还是想对文件做出贡献?\n {url && (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n 在Github上编辑本页!\n </a>\n )}\n <br />\n <a href=\"https://github.com/uiwjs/uiw/issues\" target=\"_blank\" rel=\"noopener noreferrer\">\n 反馈建议\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw/issues/new\">\n 提交bug\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/uiwjs/uiw\">\n Github\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt\">\n kkt\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/kktjs/kkt-ssr\">\n @kkt/ssr\n </a>\n <Divider type=\"vertical\" />\n <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://uiw.gitee.io\">\n 国内镜像\n </a>\n </Fragment>\n );\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"docinfo\":\"index_docinfo__3Vx8S\",\"markdown\":\"index_markdown__hcQCp\"};","import { useEffect, useState } from 'react';\nimport MarkdownPreview from '@uiw/react-markdown-preview';\nimport pkg from 'uiw/package.json';\nimport Code from './Code';\nimport Footer from './Footer';\nimport styles from './index.module.less';\n\nexport type CreatePageProps<T> = {\n dependencies?: T;\n path: string;\n renderPage?: () => Promise<string>;\n};\n\nconst getCodeStr = (data: any[] = [], code: string = '') => {\n data.forEach((node) => {\n if (node.type === 'text') {\n code += node.value;\n } else if (node.children && Array.isArray(node.children)) {\n code += getCodeStr(node.children);\n }\n });\n return code;\n};\n\nexport default function CreatePage<T>(props: CreatePageProps<T>) {\n const { renderPage, dependencies, path } = props;\n const [mdStr, setMdStr] = useState('');\n\n const version = pkg.version || '2.0.0';\n useEffect(() => {\n if (renderPage) {\n renderPage()\n .then((str) => {\n setMdStr(str);\n })\n .catch(() => {});\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!mdStr) {\n return null;\n }\n\n return (\n <div>\n <MarkdownPreview\n source={mdStr}\n className={styles.markdown}\n components={{\n /**\n * bordered 边框\n * bgWhite 设置代码预览背景白色,否则为格子背景。\n * noCode 不显示代码编辑器。\n * noPreview 不显示代码预览效果。\n * noScroll 预览区域不显示滚动条。\n * codePen 显示 Codepen 按钮,要特别注意 包导入的问题,实例中的 import 主要用于 Codepen 使用。\n */\n code: ({ inline, node, ...props }) => {\n const { noPreview, bordered, noScroll, bgWhite, noCode, codePen, codeSandbox } = props as any;\n if (inline) {\n return <code {...props} />;\n }\n const config = {\n noPreview,\n bordered,\n noScroll,\n bgWhite,\n noCode,\n codePen,\n codeSandbox,\n } as any;\n if (Object.keys(config).filter((name) => config[name] !== undefined).length === 0) {\n return <code {...props} />;\n }\n return (\n <Code\n version={version}\n code={getCodeStr(node.children)}\n dependencies={dependencies}\n {...{ noPreview, bordered, noScroll, bgWhite, noCode, codePen, codeSandbox }}\n />\n );\n },\n }}\n />\n <div className={styles.docinfo}>\n <Footer path={path} />\n </div>\n </div>\n );\n}\n","import React from 'react';\nimport { Tree, Row, Col, Card, Icon, Form, Button } from 'uiw';\nimport Markdown from '../../../components/Markdown';\n\nexport default () => (\n <Markdown\n path=\"https://github.com/uiwjs/uiw/tree/master/packages/react-tree/README.md\"\n dependencies={{ Tree, Row, Col, Card, Icon, Form, Button }}\n renderPage={async () => {\n const md = await import('uiw/node_modules/@uiw/react-tree/README.md');\n return md.default || md;\n }}\n />\n);\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","Code","version","dependencies","codePen","codeSandbox","other","props","codePenOption","title","includeModule","js","replace","html","css_external","js_external","codeSandboxOption","files","content","name","description","react","uiw","devDependencies","kkt","license","scripts","start","build","test","browserslist","style","marginBottom","path","url","Fragment","href","target","rel","Divider","type","getCodeStr","data","forEach","node","value","children","Array","isArray","CreatePage","renderPage","useState","mdStr","setMdStr","pkg","useEffect","then","str","catch","source","className","styles","components","inline","noPreview","bordered","noScroll","bgWhite","noCode","config","Object","filter","undefined","length","Footer","Tree","Row","Col","Card","Icon","Form","Button","md","default"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5468],{25468:function(n,e,l){l.r(e),e.default="Tree \u6811\u5f62\u63a7\u4ef6\n===\n\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-tree/file/README.md)\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-tree.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-tree)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-tree.svg?label=@uiw/react-tree)](https://npmjs.com/@uiw/react-tree)\n\n\u4f7f\u7528\u6811\u63a7\u4ef6\u53ef\u4ee5\u5b8c\u6574\u5c55\u73b0\u5176\u4e2d\u7684\u5c42\u7ea7\u5173\u7cfb\uff0c\u5e76\u5177\u6709\u5c55\u5f00\u6536\u8d77\u9009\u62e9\u7b49\u4ea4\u4e92\u529f\u80fd\u3002\n\n```jsx\nimport { Tree } from 'uiw';\n// or\nimport Tree from '@uiw/react-tree';\n```\n\n### \u57fa\u7840\u7528\u6cd5\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Tree, Card, Row, Col, } from 'uiw';\n\nconst data = [\n {\n label: '\u6e56\u5317\u7701',\n key: '0-0-0',\n children:[\n {\n label: '\u6b66\u6c49\u5e02',\n key: '0-1-0',\n children:[\n { label: '\u65b0\u6d32\u533a', key: '0-1-1' },\n { label: '\u6b66\u660c\u533a', key: '0-1-2' },\n {\n label: '\u6c49\u5357\u533a',\n key: '0-1-3',\n children:[\n { label: '\u6c49\u5357\u533a1', key: '0-1-3-1' },\n { label: '\u6c49\u5357\u533a2', key: '0-1-3-2' },\n { label: '\u6c49\u5357\u533a3', key: '0-1-3-3' },\n ]\n },\n ]\n },\n { label: '\u9ec4\u5188\u5e02', key: '0-2-0' },\n {\n label: '\u9ec4\u77f3\u5e02',\n key: '0-3-0',\n children:[\n { label: '\u9752\u5c71\u533a', key: '0-3-1' },\n { label: '\u9ec4\u9642\u533a', key: '0-3-2' },\n { label: '\u9752\u5c71\u533a', key: '0-3-3' },\n ]\n },\n ]\n },\n {\n label: '\u4e0a\u6d77\u5e02',\n key: '1-0-0',\n children:[\n { label: '\u9ec4\u6d66\u533a', key: '1-0-1' },\n { label: '\u5362\u6e7e\u533a', key: '1-0-2' },\n {\n label: '\u5f90\u6c47\u533a',\n key: '1-0-3',\n children:[\n { label: '\u534a\u6dde\u56ed\u8def\u8857\u9053', key: '1-1-0' },\n { label: '\u5357\u4eac\u4e1c\u8def\u8857\u9053', key: '1-2-0' },\n { label: '\u5916\u6ee9\u8857\u9053', key: '1-3-0' },\n ]\n },\n ]\n },\n {\n label: '\u5317\u4eac\u5e02',\n key: '2-0-0',\n children:[\n { label: '\u4e1c\u57ce\u533a', key: '2-1-0' },\n { label: '\u897f\u57ce\u533a', key: '2-2-0' },\n {\n label: '\u5d07\u6587\u533a',\n key: '2-3-0',\n children:[\n { label: '\u4e1c\u82b1\u5e02\u8857\u9053', key: '2-3-1' },\n { label: '\u4f53\u80b2\u9986\u8def\u8857\u9053', key: '2-3-2' },\n { label: '\u524d\u95e8\u8857\u9053', key: '2-3-3' },\n ]\n },\n ]\n }\n];\n\nconst Demo = () => (\n <div>\n <Row gutter={10}>\n <Col fixed>\n <Card title=\"\u5355\u9009\">\n <Tree\n defaultExpandAll={true}\n data={data}\n onExpand={(key, expanded, data, node) => {\n console.log('onExpand',key, expanded, data, node);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log('onSelected',key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n <Col fixed>\n <Card title=\"\u591a\u9009\uff0c\u5b50\u8282\u70b9\u4e0d\u53d7\u63a7\">\n <Tree\n autoExpandParent={true}\n data={data}\n multiple\n onExpand={(key, expanded, data, node) => {\n console.log(key, expanded, data, node);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n <Col fixed>\n <Card title=\"\u591a\u9009\uff0c\u5b50\u8282\u70b9\u53d7\u63a7\">\n <Tree\n data={data}\n multiple\n checkStrictly\n onExpand={(key, expanded, data, node) => {\n console.log(key, expanded, data, node);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n </Row>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u81ea\u5b9a\u4e49\u56fe\u6807\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Tree, Card, Row, Col, Icon } from 'uiw';\n\nconst data = [\n {\n label: '\u6e56\u5317\u7701',\n key: '0-0-0',\n children:[\n {\n label: '\u6b66\u6c49\u5e02',\n key: '0-1-0',\n children:[\n { label: '\u65b0\u6d32\u533a', key: '0-1-1' },\n { label: '\u6b66\u660c\u533a', key: '0-1-2' },\n {\n label: '\u6c49\u5357\u533a',\n key: '0-1-3',\n children:[\n { label: '\u6c49\u5357\u533a1', key: '0-1-3-1' },\n { label: '\u6c49\u5357\u533a2', key: '0-1-3-2' },\n { label: '\u6c49\u5357\u533a3', key: '0-1-3-3' },\n ]\n },\n ]\n },\n { label: '\u9ec4\u5188\u5e02', key: '0-2-0' },\n {\n label: '\u9ec4\u77f3\u5e02',\n key: '0-3-0',\n children:[\n { label: '\u9752\u5c71\u533a', key: '0-3-1' },\n { label: '\u9ec4\u9642\u533a', key: '0-3-2' },\n { label: '\u9752\u5c71\u533a', key: '0-3-3' },\n ]\n },\n ]\n },\n {\n label: '\u4e0a\u6d77\u5e02',\n key: '1-0-0',\n children:[\n { label: '\u9ec4\u6d66\u533a', key: '1-0-1' },\n { label: '\u5362\u6e7e\u533a', key: '1-0-2' },\n {\n label: '\u5f90\u6c47\u533a',\n key: '1-0-3',\n children:[\n { label: '\u534a\u6dde\u56ed\u8def\u8857\u9053', key: '1-1-0' },\n { label: '\u5357\u4eac\u4e1c\u8def\u8857\u9053', key: '1-2-0' },\n { label: '\u5916\u6ee9\u8857\u9053', key: '1-3-0' },\n ]\n },\n ]\n },\n {\n label: '\u5317\u4eac\u5e02',\n key: '2-0-0',\n children:[\n { label: '\u4e1c\u57ce\u533a', key: '2-1-0' },\n { label: '\u897f\u57ce\u533a', key: '2-2-0' },\n {\n label: '\u5d07\u6587\u533a',\n key: '2-3-0',\n children:[\n { label: '\u4e1c\u82b1\u5e02\u8857\u9053', key: '2-3-1' },\n { label: '\u4f53\u80b2\u9986\u8def\u8857\u9053', key: '2-3-2' },\n { label: '\u524d\u95e8\u8857\u9053', key: '2-3-3' },\n ]\n },\n ]\n }\n];\n\nconst Demo = () => (\n <div>\n <Row gutter={10}>\n <Col fixed>\n <Card title=\"\u6807\u9898\u4e2d\u6dfb\u52a0\u56fe\u6807\">\n <Tree\n data={data}\n renderTitle={(item, { selected, noChild }) => (\n <>\n <Icon style={{ display: '-webkit-inline-box' }} type={noChild ? 'smile-o' : 'apple'} />\n <span>{item.label}</span>\n </>\n )}\n onExpand={(key, expanded, data, node) => {\n console.log(key, expanded, data, node);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n <Col fixed>\n <Card title=\"\u66ff\u6362\u9ed8\u8ba4\u6298\u53e0\u56fe\u6807\">\n <Tree\n data={data}\n icon=\"right-circle-o\"\n onExpand={(key, expanded, data, node) => {\n console.log(key, expanded, data, node);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n <Col fixed>\n <Card title=\"\u81ea\u5b9a\u4e49\u5c55\u5f00\u56fe\u6807\">\n <Tree\n data={data}\n iconAnimation={false}\n icon={(data, { isOpen, noChild }) => {\n if(isOpen && !noChild) {\n return 'folder-open';\n } else if (!noChild) {\n return 'folder';\n }\n return 'file-text';\n }}\n onExpand={(key, expanded, data) => {\n console.log(key, expanded, data);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n </Row>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u81ea\u5b9a\u4e49\u9009\u4e2d\u6548\u679c\n\n\u901a\u8fc7\u8bbe\u7f6e `checkStrictly` \u7236\u8282\u70b9\u53d7\u5b50\u8282\u70b9\u63a7\u5236\uff0c\u8bbe\u7f6e `multiple` \u4e3a\u591a\u9009\uff0c\u8bbe\u7f6e `isSelected` \u53d6\u6d88\u9009\u4e2d\u6548\u679c\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 [`TreeChecked`](#/components/tree-checked) \u7ec4\u4ef6\u3002\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Tree, Card, Row, Col } from 'uiw';\n\nconst data = [\n {\n label: '\u6e56\u5317\u7701',\n key: '0-0-0',\n children:[\n {\n label: '\u6b66\u6c49\u5e02',\n key: '0-1-0',\n children:[\n { label: '\u65b0\u6d32\u533a', key: '0-1-1', disabled: true },\n { label: '\u6b66\u660c\u533a', key: '0-1-2' },\n {\n label: '\u6c49\u5357\u533a',\n key: '0-1-3',\n children:[\n { label: '\u6c49\u5357\u533a1', key: '0-1-3-1' },\n { label: '\u6c49\u5357\u533a2', key: '0-1-3-2' },\n { label: '\u6c49\u5357\u533a3', key: '0-1-3-3' },\n ]\n },\n ]\n },\n { label: '\u9ec4\u5188\u5e02', key: '0-2-0' },\n {\n label: '\u9ec4\u77f3\u5e02',\n key: '0-3-0',\n children:[\n { label: '\u9752\u5c71\u533a', key: '0-3-1' },\n { label: '\u9ec4\u9642\u533a', key: '0-3-2' },\n { label: '\u9752\u5c71\u533a', key: '0-3-3' },\n ]\n },\n ]\n },\n {\n label: '\u4e0a\u6d77\u5e02',\n key: '1-0-0',\n children:[\n { label: '\u9ec4\u6d66\u533a', key: '1-0-1' },\n { label: '\u5362\u6e7e\u533a', key: '1-0-2' },\n {\n label: '\u5f90\u6c47\u533a',\n key: '1-0-3',\n children:[\n { label: '\u534a\u6dde\u56ed\u8def\u8857\u9053', key: '1-1-0' },\n { label: '\u5357\u4eac\u4e1c\u8def\u8857\u9053', key: '1-2-0' },\n { label: '\u5916\u6ee9\u8857\u9053', key: '1-3-0' },\n ]\n },\n ]\n },\n {\n label: '\u5317\u4eac\u5e02',\n key: '2-0-0',\n children:[\n { label: '\u4e1c\u57ce\u533a', key: '2-1-0' },\n { label: '\u897f\u57ce\u533a', key: '2-2-0' },\n {\n label: '\u5d07\u6587\u533a',\n key: '2-3-0',\n children:[\n { label: '\u4e1c\u82b1\u5e02\u8857\u9053', key: '2-3-1' },\n { label: '\u4f53\u80b2\u9986\u8def\u8857\u9053', key: '2-3-2' },\n { label: '\u524d\u95e8\u8857\u9053', key: '2-3-3' },\n ]\n },\n ]\n },\n { label: '\u6fb3\u95e8', key: '3' },\n];\n\nconst Demo = () => (\n <div>\n <Tree\n data={data}\n selectedKeys={['0-1-1']}\n multiple\n isSelected={false}\n checkStrictly\n renderTitle={(item, { selected, isHalfChecked }) => {\n if(isHalfChecked) {\n return (\n <><Icon type=\"minus-square-o\" style={{ color: 'green' }} /> <span>{item.label}</span></>\n );\n }\n if (selected) {\n return (\n <><Icon type=\"check-square-o\" style={{ color: 'green' }} /> <span>{item.label}</span></>\n );\n }\n return (\n <><Icon type=\"square-o\" style={{ color: '#b6b6b6' }} /> <span>{item.label}</span></>\n );\n }}\n onExpand={(key, expanded, data, node) => {\n console.log(key, expanded, data, node);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n\n### \u8fde\u63a5\u7ebf\n\n\u5e26\u8fde\u63a5\u7ebf\u7684\u6811\uff0c\u901a\u8fc7\u8bbe\u7f6e `showLine`\u3002\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Tree, Card, Row, Col } from 'uiw';\n\nconst data = [\n {\n label: '\u6e56\u5317\u7701',\n key: '0-0-0',\n children:[\n {\n label: '\u6b66\u6c49\u5e02',\n key: '0-1-0',\n children:[\n { label: '\u65b0\u6d32\u533a', key: '0-1-1' },\n { label: '\u6b66\u660c\u533a', key: '0-1-2' },\n {\n label: '\u6c49\u5357\u533a',\n key: '0-1-3',\n children:[\n { label: '\u6c49\u5357\u533a1', key: '0-1-3-1' },\n { label: '\u6c49\u5357\u533a2', key: '0-1-3-2' },\n { label: '\u6c49\u5357\u533a3', key: '0-1-3-3' },\n ]\n },\n ]\n },\n { label: '\u9ec4\u5188\u5e02', key: '0-2-0' },\n {\n label: '\u9ec4\u77f3\u5e02',\n key: '0-3-0',\n children:[\n { label: '\u9752\u5c71\u533a', key: '0-3-1' },\n { label: '\u9ec4\u9642\u533a', key: '0-3-2' },\n { label: '\u9752\u5c71\u533a', key: '0-3-3' },\n ]\n },\n ]\n },\n {\n label: '\u4e0a\u6d77\u5e02',\n key: '1-0-0',\n children:[\n { label: '\u9ec4\u6d66\u533a', key: '1-0-1' },\n { label: '\u5362\u6e7e\u533a', key: '1-0-2' },\n {\n label: '\u5f90\u6c47\u533a',\n key: '1-0-3',\n children:[\n { label: '\u534a\u6dde\u56ed\u8def\u8857\u9053', key: '1-1-0' },\n { label: '\u5357\u4eac\u4e1c\u8def\u8857\u9053', key: '1-2-0' },\n { label: '\u5916\u6ee9\u8857\u9053', key: '1-3-0' },\n ]\n },\n ]\n },\n {\n label: '\u5317\u4eac\u5e02',\n key: '2-0-0',\n children:[\n { label: '\u4e1c\u57ce\u533a', key: '2-1-0' },\n { label: '\u897f\u57ce\u533a', key: '2-2-0' },\n {\n label: '\u5d07\u6587\u533a',\n key: '2-3-0',\n children:[\n { label: '\u4e1c\u82b1\u5e02\u8857\u9053', key: '2-3-1' },\n { label: '\u4f53\u80b2\u9986\u8def\u8857\u9053', key: '2-3-2' },\n { label: '\u524d\u95e8\u8857\u9053', key: '2-3-3' },\n ]\n },\n ]\n }\n];\n\nconst Demo = () => (\n <div>\n <Row gutter={10}>\n <Col fixed>\n <Card title=\"\u81ea\u5b9a\u4e49\u5c55\u5f00\u56fe\u6807\">\n <Tree\n data={data}\n showLine\n iconAnimation={false}\n icon={(data, {isOpen, noChild}) => {\n if(isOpen && !noChild) {\n return 'folder-open';\n } else if (!noChild) {\n return 'folder';\n }\n return 'file-text';\n }}\n onExpand={(key, expanded, data) => {\n console.log(key, expanded, data);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n <Col fixed>\n <Card title=\"\u81ea\u5b9a\u4e49\u5c55\u5f00\u56fe\u6807\">\n <Tree\n data={data}\n showLine\n icon={(data, {isOpen, noChild}) => {\n if(noChild) {\n return 'file-text';\n }\n }}\n onExpand={(key, expanded, data) => {\n console.log(key, expanded, data);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n </Row>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u9ed8\u8ba4\u5c55\u5f00\u6811\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Tree, Card, Row, Col } from 'uiw';\n\nconst data = [\n {\n label: '\u6e56\u5317\u7701',\n key: '0-0-0',\n children:[\n {\n label: '\u6b66\u6c49\u5e02',\n key: '0-1-0',\n children:[\n { label: '\u65b0\u6d32\u533a', key: '0-1-1' },\n { label: '\u6b66\u660c\u533a', key: '0-1-2' },\n {\n label: '\u6c49\u5357\u533a',\n key: '0-1-3',\n children:[\n { label: '\u6c49\u5357\u533a1', key: '0-1-3-1' },\n { label: '\u6c49\u5357\u533a2', key: '0-1-3-2' },\n { label: '\u6c49\u5357\u533a3', key: '0-1-3-3' },\n ]\n },\n ]\n },\n { label: '\u9ec4\u5188\u5e02', key: '0-2-0' },\n {\n label: '\u9ec4\u77f3\u5e02',\n key: '0-3-0',\n children:[\n { label: '\u9752\u5c71\u533a', key: '0-3-1' },\n { label: '\u9ec4\u9642\u533a', key: '0-3-2' },\n { label: '\u9752\u5c71\u533a', key: '0-3-3' },\n ]\n },\n ]\n },\n {\n label: '\u4e0a\u6d77\u5e02',\n key: '1-0-0',\n children:[\n { label: '\u9ec4\u6d66\u533a', key: '1-0-1' },\n { label: '\u5362\u6e7e\u533a', key: '1-0-2' },\n {\n label: '\u5f90\u6c47\u533a',\n key: '1-0-3',\n children:[\n { label: '\u534a\u6dde\u56ed\u8def\u8857\u9053', key: '1-1-0' },\n { label: '\u5357\u4eac\u4e1c\u8def\u8857\u9053', key: '1-2-0' },\n { label: '\u5916\u6ee9\u8857\u9053', key: '1-3-0' },\n ]\n },\n ]\n },\n {\n label: '\u5317\u4eac\u5e02',\n key: '2-0-0',\n children:[\n { label: '\u4e1c\u57ce\u533a', key: '2-1-0' },\n { label: '\u897f\u57ce\u533a', key: '2-2-0' },\n ]\n }\n];\n\nconst Demo = () => (\n <div>\n <Row gutter={10}>\n <Col fixed>\n <Card title=\"\u9ed8\u8ba4\u5c55\u5f00\u90e8\u5206\">\n <Tree\n data={data}\n showLine\n openKeys={['0-0-0', '0-1-0']}\n iconAnimation={false}\n icon={(data, {isOpen, noChild}) => {\n if(isOpen && !noChild) {\n return 'folder-open';\n } else if (!noChild) {\n return 'folder';\n }\n return 'file-text';\n }}\n onExpand={(key, expanded, data) => {\n console.log(key, expanded, data);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n <Col fixed>\n <Card title=\"\u5c55\u5f00\u6240\u6709\">\n <Tree\n data={data}\n showLine\n defaultExpandAll\n icon={(data, {isOpen, noChild}) => {\n if(noChild) {\n return 'file-text';\n }\n }}\n onExpand={(key, expanded, data) => {\n console.log(key, expanded, data);\n }}\n onSelected={(key, selected, item, evn) => {\n console.log(key, selected, item, evn);\n }}\n />\n </Card>\n </Col>\n </Row>\n </div>\n)\nReactDOM.render(<Demo />, _mount_);\n```\n\n\n### Form\u4e2d\u4f7f\u7528\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Tree, Row, Col, Form, Button } from 'uiw';\n\nconst data = [\n {\n label: '\u6e56\u5317\u7701',\n key: '0-0-0',\n children:[\n {\n label: '\u6b66\u6c49\u5e02',\n key: '0-1-0',\n children:[\n { label: '\u65b0\u6d32\u533a', key: '0-1-1' },\n { label: '\u6b66\u660c\u533a', key: '0-1-2' },\n {\n label: '\u6c49\u5357\u533a',\n key: '0-1-3',\n children:[\n { label: '\u6c49\u5357\u533a1', key: '0-1-3-1' },\n { label: '\u6c49\u5357\u533a2', key: '0-1-3-2' },\n { label: '\u6c49\u5357\u533a3', key: '0-1-3-3' },\n ]\n },\n ]\n },\n { label: '\u9ec4\u5188\u5e02', key: '0-2-0' },\n {\n label: '\u9ec4\u77f3\u5e02',\n key: '0-3-0',\n children:[\n { label: '\u9752\u5c71\u533a', key: '0-3-1' },\n { label: '\u9ec4\u9642\u533a', key: '0-3-2' },\n { label: '\u9752\u5c71\u533a', key: '0-3-3' },\n ]\n },\n ]\n },\n {\n label: '\u4e0a\u6d77\u5e02',\n key: '1-0-0',\n children:[\n { label: '\u9ec4\u6d66\u533a', key: '1-0-1' },\n { label: '\u5362\u6e7e\u533a', key: '1-0-2' },\n {\n label: '\u5f90\u6c47\u533a',\n key: '1-0-3',\n children:[\n { label: '\u534a\u6dde\u56ed\u8def\u8857\u9053', key: '1-1-0' },\n { label: '\u5357\u4eac\u4e1c\u8def\u8857\u9053', key: '1-2-0' },\n { label: '\u5916\u6ee9\u8857\u9053', key: '1-3-0' },\n ]\n },\n ]\n },\n {\n label: '\u5317\u4eac\u5e02',\n key: '2-0-0',\n children:[\n { label: '\u4e1c\u57ce\u533a', key: '2-1-0' },\n { label: '\u897f\u57ce\u533a', key: '2-2-0' },\n ]\n }\n];\n\nconst Demo = () => {\n return (\n <Form\n onChange={({ initial, current }) => {}}\n resetOnSubmit={false}\n onSubmitError={(error) => error && error.filed ? { ...error.filed } : null}\n onSubmit={({initial, current}) => {\n console.log('current: ', current);\n const ErrObj = {};\n if (current.tree === 'unknown') {\n ErrObj.radioGroup = '\u8bf7\u9009\u62e9\u6027\u522b\uff01';\n }\n if(Object.keys(ErrObj).length > 0) {\n const err = new Error();\n err.filed = ErrObj;\n throw err;\n }\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01', description: `\u586b\u5199\uff1a\u3010\u586b\u5199\u6210\u529f\u3011\uff01`\n });\n }}\n fields={{\n tree: {\n value: 'girl',\n label: '\u8bf7\u8f93\u5165\u5185\u5bb9',\n help: '\u5fc5\u987b\u9009\u62e9\u6027\u522b\uff01',\n initialValue: ['0-1-1'],\n children: <Tree\n // multiple \n checkStrictly\n data={data}\n />,\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row>\n <Col>{fields.tree}</Col>\n </Row>\n <Row>\n <Col>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n <Row>\n <Col>\n <pre style={{ padding: 10, marginTop: 10 }}>\n {JSON.stringify(state.current, null, 2)}\n </pre>\n </Col>\n </Row>\n </div>\n );\n }}\n </Form>\n )\n}\nReactDOM.render(<Demo />, _mount_);\n```\n\n\n## Props\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| data | \u5c55\u793a\u6570\u636e | Array | `TreeData[]` |\n| openKeys | \u8282\u70b9\u5c55\u5f00 `key` | Array | `[]` |\n| selectedKeys | \u8bbe\u7f6e\u9009\u4e2d\u7684\u6811\u8282\u70b9 | Array | `[]` |\n| autoExpandParent | \u662f\u5426\u81ea\u52a8\u5c55\u5f00\u7236\u8282\u70b9 | Boolean | `true` |\n| defaultExpandAll | \u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6811\u8282\u70b9 | Boolean | `false` |\n| iconAnimation | \u5c55\u5f00\u6536\u7f29\u56fe\u6807\uff0c\u53c2\u6570\u8bbe\u4e3a `false` \u7981\u7528\u52a8\u753b | Boolean | `true` |\n| isSelected | \u662f\u5426\u9009\u4e2d\u5f53\u524d\u8282\u70b9\u6837\u5f0f\u3002 | Boolean | `true` |\n| showLine | \u662f\u5426\u5c55\u793a\u8fde\u63a5\u7ebf | Boolean | `false` |\n| checkStrictly | \u5b50\u8282\u70b9\u53d7\u7236\u8282\u70b9\u63a7\u5236\u8bbe\u7f6e `true`\uff0c\u9700\u8981\u914d\u5408 `multiple` \u53c2\u6570\u4f7f\u7528\u3002 | Boolean | `false` |\n| multiple | \u652f\u6301\u70b9\u9009\u591a\u4e2a\u8282\u70b9 | Boolean | `false` |\n| icon | \u91cd\u65b0\u5b9a\u4e49\uff0c\u5c55\u5f00\u6536\u7f29\u56fe\u6807\uff0c\u5f53\u4e3a\u51fd\u6570\u65f6\u89c6\u4e3a\u81ea\u5b9a\u4e49\u56fe\u6807\uff0c\u5e76\u5c55\u793a\u975e\u6298\u53e0\u9879\u7684\u56fe\u6807\u3002 | ~~Function(data: object, noChild: bool)/String/Node~~ `@3.4.0+` Function(data: object, { selected: bool, noChild: bool })/String/Node| - |\n| renderTitle | \u91cd\u65b0\u5b9a\u4e49\u6bcf\u4e2a\u6807\u9898\u8282\u70b9\u7684\u663e\u793a | ~~Function(item, selected: bool, noChild: bool)~~ `@3.4.0+` Function(item: TreeData, node?: { selected?: boolean, noChild?: boolean, isHalfChecked?: boolean, openKeys?: TreeProps['openKeys'], selectedKeys?: TreeProps['selectedKeys'] }) => React.ReactElement; | - |\n| onSelected | \u70b9\u51fb\u9009\u62e9\u6811\u8282\u70b9\u89e6\u53d1 | Function(selectedKeys: array, key, selected: bool, data, e) | - |\n| onExpand | \u5c55\u5f00/\u6536\u8d77\u8282\u70b9\u65f6\u89e6\u53d1 | Function(key, expanded: bool, data, evn) | - |\n\n### data\n\n```json\n[\n {\n \"label\": \"\u6e56\u5317\u7701\",\n \"key\": \"0-0-0\",\n \"disabled\": false,\n \"children\":[]\n }\n ...\n]\n```\n"}}]);
2
+ //# sourceMappingURL=5468.462bf55f.chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/5468.462bf55f.chunk.js","mappings":"gHAAA","sources":["../../packages/react-tree/README.md"],"sourcesContent":["export default \"Tree 树形控件\\n===\\n\\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-tree/file/README.md)\\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-tree.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-tree)\\n[![npm version](https://img.shields.io/npm/v/@uiw/react-tree.svg?label=@uiw/react-tree)](https://npmjs.com/@uiw/react-tree)\\n\\n使用树控件可以完整展现其中的层级关系,并具有展开收起选择等交互功能。\\n\\n```jsx\\nimport { Tree } from 'uiw';\\n// or\\nimport Tree from '@uiw/react-tree';\\n```\\n\\n### 基础用法\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Tree, Card, Row, Col, } from 'uiw';\\n\\nconst data = [\\n {\\n label: '湖北省',\\n key: '0-0-0',\\n children:[\\n {\\n label: '武汉市',\\n key: '0-1-0',\\n children:[\\n { label: '新洲区', key: '0-1-1' },\\n { label: '武昌区', key: '0-1-2' },\\n {\\n label: '汉南区',\\n key: '0-1-3',\\n children:[\\n { label: '汉南区1', key: '0-1-3-1' },\\n { label: '汉南区2', key: '0-1-3-2' },\\n { label: '汉南区3', key: '0-1-3-3' },\\n ]\\n },\\n ]\\n },\\n { label: '黄冈市', key: '0-2-0' },\\n {\\n label: '黄石市',\\n key: '0-3-0',\\n children:[\\n { label: '青山区', key: '0-3-1' },\\n { label: '黄陂区', key: '0-3-2' },\\n { label: '青山区', key: '0-3-3' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '上海市',\\n key: '1-0-0',\\n children:[\\n { label: '黄浦区', key: '1-0-1' },\\n { label: '卢湾区', key: '1-0-2' },\\n {\\n label: '徐汇区',\\n key: '1-0-3',\\n children:[\\n { label: '半淞园路街道', key: '1-1-0' },\\n { label: '南京东路街道', key: '1-2-0' },\\n { label: '外滩街道', key: '1-3-0' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '北京市',\\n key: '2-0-0',\\n children:[\\n { label: '东城区', key: '2-1-0' },\\n { label: '西城区', key: '2-2-0' },\\n {\\n label: '崇文区',\\n key: '2-3-0',\\n children:[\\n { label: '东花市街道', key: '2-3-1' },\\n { label: '体育馆路街道', key: '2-3-2' },\\n { label: '前门街道', key: '2-3-3' },\\n ]\\n },\\n ]\\n }\\n];\\n\\nconst Demo = () => (\\n <div>\\n <Row gutter={10}>\\n <Col fixed>\\n <Card title=\\\"单选\\\">\\n <Tree\\n defaultExpandAll={true}\\n data={data}\\n onExpand={(key, expanded, data, node) => {\\n console.log('onExpand',key, expanded, data, node);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log('onSelected',key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n <Col fixed>\\n <Card title=\\\"多选,子节点不受控\\\">\\n <Tree\\n autoExpandParent={true}\\n data={data}\\n multiple\\n onExpand={(key, expanded, data, node) => {\\n console.log(key, expanded, data, node);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n <Col fixed>\\n <Card title=\\\"多选,子节点受控\\\">\\n <Tree\\n data={data}\\n multiple\\n checkStrictly\\n onExpand={(key, expanded, data, node) => {\\n console.log(key, expanded, data, node);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n </Row>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 自定义图标\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Tree, Card, Row, Col, Icon } from 'uiw';\\n\\nconst data = [\\n {\\n label: '湖北省',\\n key: '0-0-0',\\n children:[\\n {\\n label: '武汉市',\\n key: '0-1-0',\\n children:[\\n { label: '新洲区', key: '0-1-1' },\\n { label: '武昌区', key: '0-1-2' },\\n {\\n label: '汉南区',\\n key: '0-1-3',\\n children:[\\n { label: '汉南区1', key: '0-1-3-1' },\\n { label: '汉南区2', key: '0-1-3-2' },\\n { label: '汉南区3', key: '0-1-3-3' },\\n ]\\n },\\n ]\\n },\\n { label: '黄冈市', key: '0-2-0' },\\n {\\n label: '黄石市',\\n key: '0-3-0',\\n children:[\\n { label: '青山区', key: '0-3-1' },\\n { label: '黄陂区', key: '0-3-2' },\\n { label: '青山区', key: '0-3-3' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '上海市',\\n key: '1-0-0',\\n children:[\\n { label: '黄浦区', key: '1-0-1' },\\n { label: '卢湾区', key: '1-0-2' },\\n {\\n label: '徐汇区',\\n key: '1-0-3',\\n children:[\\n { label: '半淞园路街道', key: '1-1-0' },\\n { label: '南京东路街道', key: '1-2-0' },\\n { label: '外滩街道', key: '1-3-0' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '北京市',\\n key: '2-0-0',\\n children:[\\n { label: '东城区', key: '2-1-0' },\\n { label: '西城区', key: '2-2-0' },\\n {\\n label: '崇文区',\\n key: '2-3-0',\\n children:[\\n { label: '东花市街道', key: '2-3-1' },\\n { label: '体育馆路街道', key: '2-3-2' },\\n { label: '前门街道', key: '2-3-3' },\\n ]\\n },\\n ]\\n }\\n];\\n\\nconst Demo = () => (\\n <div>\\n <Row gutter={10}>\\n <Col fixed>\\n <Card title=\\\"标题中添加图标\\\">\\n <Tree\\n data={data}\\n renderTitle={(item, { selected, noChild }) => (\\n <>\\n <Icon style={{ display: '-webkit-inline-box' }} type={noChild ? 'smile-o' : 'apple'} />\\n <span>{item.label}</span>\\n </>\\n )}\\n onExpand={(key, expanded, data, node) => {\\n console.log(key, expanded, data, node);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n <Col fixed>\\n <Card title=\\\"替换默认折叠图标\\\">\\n <Tree\\n data={data}\\n icon=\\\"right-circle-o\\\"\\n onExpand={(key, expanded, data, node) => {\\n console.log(key, expanded, data, node);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n <Col fixed>\\n <Card title=\\\"自定义展开图标\\\">\\n <Tree\\n data={data}\\n iconAnimation={false}\\n icon={(data, { isOpen, noChild }) => {\\n if(isOpen && !noChild) {\\n return 'folder-open';\\n } else if (!noChild) {\\n return 'folder';\\n }\\n return 'file-text';\\n }}\\n onExpand={(key, expanded, data) => {\\n console.log(key, expanded, data);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n </Row>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 自定义选中效果\\n\\n通过设置 `checkStrictly` 父节点受子节点控制,设置 `multiple` 为多选,设置 `isSelected` 取消选中效果,也可以使用 [`TreeChecked`](#/components/tree-checked) 组件。\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Tree, Card, Row, Col } from 'uiw';\\n\\nconst data = [\\n {\\n label: '湖北省',\\n key: '0-0-0',\\n children:[\\n {\\n label: '武汉市',\\n key: '0-1-0',\\n children:[\\n { label: '新洲区', key: '0-1-1', disabled: true },\\n { label: '武昌区', key: '0-1-2' },\\n {\\n label: '汉南区',\\n key: '0-1-3',\\n children:[\\n { label: '汉南区1', key: '0-1-3-1' },\\n { label: '汉南区2', key: '0-1-3-2' },\\n { label: '汉南区3', key: '0-1-3-3' },\\n ]\\n },\\n ]\\n },\\n { label: '黄冈市', key: '0-2-0' },\\n {\\n label: '黄石市',\\n key: '0-3-0',\\n children:[\\n { label: '青山区', key: '0-3-1' },\\n { label: '黄陂区', key: '0-3-2' },\\n { label: '青山区', key: '0-3-3' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '上海市',\\n key: '1-0-0',\\n children:[\\n { label: '黄浦区', key: '1-0-1' },\\n { label: '卢湾区', key: '1-0-2' },\\n {\\n label: '徐汇区',\\n key: '1-0-3',\\n children:[\\n { label: '半淞园路街道', key: '1-1-0' },\\n { label: '南京东路街道', key: '1-2-0' },\\n { label: '外滩街道', key: '1-3-0' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '北京市',\\n key: '2-0-0',\\n children:[\\n { label: '东城区', key: '2-1-0' },\\n { label: '西城区', key: '2-2-0' },\\n {\\n label: '崇文区',\\n key: '2-3-0',\\n children:[\\n { label: '东花市街道', key: '2-3-1' },\\n { label: '体育馆路街道', key: '2-3-2' },\\n { label: '前门街道', key: '2-3-3' },\\n ]\\n },\\n ]\\n },\\n { label: '澳门', key: '3' },\\n];\\n\\nconst Demo = () => (\\n <div>\\n <Tree\\n data={data}\\n selectedKeys={['0-1-1']}\\n multiple\\n isSelected={false}\\n checkStrictly\\n renderTitle={(item, { selected, isHalfChecked }) => {\\n if(isHalfChecked) {\\n return (\\n <><Icon type=\\\"minus-square-o\\\" style={{ color: 'green' }} /> <span>{item.label}</span></>\\n );\\n }\\n if (selected) {\\n return (\\n <><Icon type=\\\"check-square-o\\\" style={{ color: 'green' }} /> <span>{item.label}</span></>\\n );\\n }\\n return (\\n <><Icon type=\\\"square-o\\\" style={{ color: '#b6b6b6' }} /> <span>{item.label}</span></>\\n );\\n }}\\n onExpand={(key, expanded, data, node) => {\\n console.log(key, expanded, data, node);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n\\n### 连接线\\n\\n带连接线的树,通过设置 `showLine`。\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Tree, Card, Row, Col } from 'uiw';\\n\\nconst data = [\\n {\\n label: '湖北省',\\n key: '0-0-0',\\n children:[\\n {\\n label: '武汉市',\\n key: '0-1-0',\\n children:[\\n { label: '新洲区', key: '0-1-1' },\\n { label: '武昌区', key: '0-1-2' },\\n {\\n label: '汉南区',\\n key: '0-1-3',\\n children:[\\n { label: '汉南区1', key: '0-1-3-1' },\\n { label: '汉南区2', key: '0-1-3-2' },\\n { label: '汉南区3', key: '0-1-3-3' },\\n ]\\n },\\n ]\\n },\\n { label: '黄冈市', key: '0-2-0' },\\n {\\n label: '黄石市',\\n key: '0-3-0',\\n children:[\\n { label: '青山区', key: '0-3-1' },\\n { label: '黄陂区', key: '0-3-2' },\\n { label: '青山区', key: '0-3-3' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '上海市',\\n key: '1-0-0',\\n children:[\\n { label: '黄浦区', key: '1-0-1' },\\n { label: '卢湾区', key: '1-0-2' },\\n {\\n label: '徐汇区',\\n key: '1-0-3',\\n children:[\\n { label: '半淞园路街道', key: '1-1-0' },\\n { label: '南京东路街道', key: '1-2-0' },\\n { label: '外滩街道', key: '1-3-0' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '北京市',\\n key: '2-0-0',\\n children:[\\n { label: '东城区', key: '2-1-0' },\\n { label: '西城区', key: '2-2-0' },\\n {\\n label: '崇文区',\\n key: '2-3-0',\\n children:[\\n { label: '东花市街道', key: '2-3-1' },\\n { label: '体育馆路街道', key: '2-3-2' },\\n { label: '前门街道', key: '2-3-3' },\\n ]\\n },\\n ]\\n }\\n];\\n\\nconst Demo = () => (\\n <div>\\n <Row gutter={10}>\\n <Col fixed>\\n <Card title=\\\"自定义展开图标\\\">\\n <Tree\\n data={data}\\n showLine\\n iconAnimation={false}\\n icon={(data, {isOpen, noChild}) => {\\n if(isOpen && !noChild) {\\n return 'folder-open';\\n } else if (!noChild) {\\n return 'folder';\\n }\\n return 'file-text';\\n }}\\n onExpand={(key, expanded, data) => {\\n console.log(key, expanded, data);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n <Col fixed>\\n <Card title=\\\"自定义展开图标\\\">\\n <Tree\\n data={data}\\n showLine\\n icon={(data, {isOpen, noChild}) => {\\n if(noChild) {\\n return 'file-text';\\n }\\n }}\\n onExpand={(key, expanded, data) => {\\n console.log(key, expanded, data);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n </Row>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 默认展开树\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Tree, Card, Row, Col } from 'uiw';\\n\\nconst data = [\\n {\\n label: '湖北省',\\n key: '0-0-0',\\n children:[\\n {\\n label: '武汉市',\\n key: '0-1-0',\\n children:[\\n { label: '新洲区', key: '0-1-1' },\\n { label: '武昌区', key: '0-1-2' },\\n {\\n label: '汉南区',\\n key: '0-1-3',\\n children:[\\n { label: '汉南区1', key: '0-1-3-1' },\\n { label: '汉南区2', key: '0-1-3-2' },\\n { label: '汉南区3', key: '0-1-3-3' },\\n ]\\n },\\n ]\\n },\\n { label: '黄冈市', key: '0-2-0' },\\n {\\n label: '黄石市',\\n key: '0-3-0',\\n children:[\\n { label: '青山区', key: '0-3-1' },\\n { label: '黄陂区', key: '0-3-2' },\\n { label: '青山区', key: '0-3-3' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '上海市',\\n key: '1-0-0',\\n children:[\\n { label: '黄浦区', key: '1-0-1' },\\n { label: '卢湾区', key: '1-0-2' },\\n {\\n label: '徐汇区',\\n key: '1-0-3',\\n children:[\\n { label: '半淞园路街道', key: '1-1-0' },\\n { label: '南京东路街道', key: '1-2-0' },\\n { label: '外滩街道', key: '1-3-0' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '北京市',\\n key: '2-0-0',\\n children:[\\n { label: '东城区', key: '2-1-0' },\\n { label: '西城区', key: '2-2-0' },\\n ]\\n }\\n];\\n\\nconst Demo = () => (\\n <div>\\n <Row gutter={10}>\\n <Col fixed>\\n <Card title=\\\"默认展开部分\\\">\\n <Tree\\n data={data}\\n showLine\\n openKeys={['0-0-0', '0-1-0']}\\n iconAnimation={false}\\n icon={(data, {isOpen, noChild}) => {\\n if(isOpen && !noChild) {\\n return 'folder-open';\\n } else if (!noChild) {\\n return 'folder';\\n }\\n return 'file-text';\\n }}\\n onExpand={(key, expanded, data) => {\\n console.log(key, expanded, data);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n <Col fixed>\\n <Card title=\\\"展开所有\\\">\\n <Tree\\n data={data}\\n showLine\\n defaultExpandAll\\n icon={(data, {isOpen, noChild}) => {\\n if(noChild) {\\n return 'file-text';\\n }\\n }}\\n onExpand={(key, expanded, data) => {\\n console.log(key, expanded, data);\\n }}\\n onSelected={(key, selected, item, evn) => {\\n console.log(key, selected, item, evn);\\n }}\\n />\\n </Card>\\n </Col>\\n </Row>\\n </div>\\n)\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n\\n### Form中使用\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Tree, Row, Col, Form, Button } from 'uiw';\\n\\nconst data = [\\n {\\n label: '湖北省',\\n key: '0-0-0',\\n children:[\\n {\\n label: '武汉市',\\n key: '0-1-0',\\n children:[\\n { label: '新洲区', key: '0-1-1' },\\n { label: '武昌区', key: '0-1-2' },\\n {\\n label: '汉南区',\\n key: '0-1-3',\\n children:[\\n { label: '汉南区1', key: '0-1-3-1' },\\n { label: '汉南区2', key: '0-1-3-2' },\\n { label: '汉南区3', key: '0-1-3-3' },\\n ]\\n },\\n ]\\n },\\n { label: '黄冈市', key: '0-2-0' },\\n {\\n label: '黄石市',\\n key: '0-3-0',\\n children:[\\n { label: '青山区', key: '0-3-1' },\\n { label: '黄陂区', key: '0-3-2' },\\n { label: '青山区', key: '0-3-3' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '上海市',\\n key: '1-0-0',\\n children:[\\n { label: '黄浦区', key: '1-0-1' },\\n { label: '卢湾区', key: '1-0-2' },\\n {\\n label: '徐汇区',\\n key: '1-0-3',\\n children:[\\n { label: '半淞园路街道', key: '1-1-0' },\\n { label: '南京东路街道', key: '1-2-0' },\\n { label: '外滩街道', key: '1-3-0' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '北京市',\\n key: '2-0-0',\\n children:[\\n { label: '东城区', key: '2-1-0' },\\n { label: '西城区', key: '2-2-0' },\\n ]\\n }\\n];\\n\\nconst Demo = () => {\\n return (\\n <Form\\n onChange={({ initial, current }) => {}}\\n resetOnSubmit={false}\\n onSubmitError={(error) => error && error.filed ? { ...error.filed } : null}\\n onSubmit={({initial, current}) => {\\n console.log('current: ', current);\\n const ErrObj = {};\\n if (current.tree === 'unknown') {\\n ErrObj.radioGroup = '请选择性别!';\\n }\\n if(Object.keys(ErrObj).length > 0) {\\n const err = new Error();\\n err.filed = ErrObj;\\n throw err;\\n }\\n Notify.success({\\n title: '提交成功!', description: `填写:【填写成功】!`\\n });\\n }}\\n fields={{\\n tree: {\\n value: 'girl',\\n label: '请输入内容',\\n help: '必须选择性别!',\\n initialValue: ['0-1-1'],\\n children: <Tree\\n // multiple \\n checkStrictly\\n data={data}\\n />,\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row>\\n <Col>{fields.tree}</Col>\\n </Row>\\n <Row>\\n <Col>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n <Row>\\n <Col>\\n <pre style={{ padding: 10, marginTop: 10 }}>\\n {JSON.stringify(state.current, null, 2)}\\n </pre>\\n </Col>\\n </Row>\\n </div>\\n );\\n }}\\n </Form>\\n )\\n}\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n\\n## Props\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| data | 展示数据 | Array | `TreeData[]` |\\n| openKeys | 节点展开 `key` | Array | `[]` |\\n| selectedKeys | 设置选中的树节点 | Array | `[]` |\\n| autoExpandParent | 是否自动展开父节点 | Boolean | `true` |\\n| defaultExpandAll | 默认展开所有树节点 | Boolean | `false` |\\n| iconAnimation | 展开收缩图标,参数设为 `false` 禁用动画 | Boolean | `true` |\\n| isSelected | 是否选中当前节点样式。 | Boolean | `true` |\\n| showLine | 是否展示连接线 | Boolean | `false` |\\n| checkStrictly | 子节点受父节点控制设置 `true`,需要配合 `multiple` 参数使用。 | Boolean | `false` |\\n| multiple | 支持点选多个节点 | Boolean | `false` |\\n| icon | 重新定义,展开收缩图标,当为函数时视为自定义图标,并展示非折叠项的图标。 | ~~Function(data: object, noChild: bool)/String/Node~~ `@3.4.0+` Function(data: object, { selected: bool, noChild: bool })/String/Node| - |\\n| renderTitle | 重新定义每个标题节点的显示 | ~~Function(item, selected: bool, noChild: bool)~~ `@3.4.0+` Function(item: TreeData, node?: { selected?: boolean, noChild?: boolean, isHalfChecked?: boolean, openKeys?: TreeProps['openKeys'], selectedKeys?: TreeProps['selectedKeys'] }) => React.ReactElement; | - |\\n| onSelected | 点击选择树节点触发 | Function(selectedKeys: array, key, selected: bool, data, e) | - |\\n| onExpand | 展开/收起节点时触发 | Function(key, expanded: bool, data, evn) | - |\\n\\n### data\\n\\n```json\\n[\\n {\\n \\\"label\\\": \\\"湖北省\\\",\\n \\\"key\\\": \\\"0-0-0\\\",\\n \\\"disabled\\\": false,\\n \\\"children\\\":[]\\n }\\n ...\\n]\\n```\\n\";"],"names":[],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7313],{67313:function(e,n,l){l.r(n),n.default="SearchSelect \u641c\u7d22\u9009\u62e9\u5668\n===\n\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-search-select/file/README.md)\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-search-select.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-search-select)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-search-select.svg?label=@uiw/react-search-select)](https://npmjs.com/@uiw/react-search-select)\n\n\u641c\u7d22\u9009\u62e9\u5668\n\n```jsx\nimport { SearchSelect, Row ,Col } from 'uiw';\n// or\nimport SearchSelect from '@uiw/react-search-select';\n```\n\n## \u57fa\u7840\u793a\u4f8b\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { SearchSelect,Row,Col } from 'uiw';\n\nconst Demo = () => {\n const selectOption=[\n { label: 'a1', value: 1 },\n { label: 'a2', value: 2 },\n { label: 'a3', value: 3 },\n { label: 'a4', value: 4 },\n { label: 'a5', value: 5 },\n { label: 'a6', value: 6 },\n { label: 'a7', value: 7 },\n { label: 'a8', value: 8 },\n ]\n\n const [option, setOption] = React.useState(selectOption);\n const [loading, setLoading] = React.useState(false);\n const [values, setValues] = React.useState([{label: 'a7', value: 7},{label: 'a8', value: 8}]);\n const [value, setValue] = React.useState([{label: 'a7', value: 7}]);\n\n function handleSearch(e) {\n setLoading(true)\n setTimeout(() => {\n const filterOpion= selectOption.filter(item=>!!item.label.includes(e.trim()))\n setOption([...filterOpion]);\n setLoading(false);\n }, 500);\n }\n\n return(\n <Row gutter={20}>\n <Row>\n <SearchSelect\n mode=\"multiple\"\n style={{ width: 176 }}\n showSearch={true}\n labelInValue={true}\n maxTagCount={6}\n allowClear\n value={values}\n disabled={false}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n onSearch={handleSearch}\n // onSelect={(value)=>console.log('onSelect',value)}\n loading={loading}\n option={option}\n onChange={(value) => {\n console.log('value', value)\n setValues(value)\n }}\n />\n </Row>\n <Row>\n <SearchSelect\n mode=\"single\"\n style={{ width: 176 }}\n showSearch={true}\n labelInValue={true}\n maxTagCount={6}\n allowClear\n value={value}\n disabled={false}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n onSearch={handleSearch}\n // onSelect={(value)=>console.log('onSelect',value)}\n loading={loading}\n option={option}\n onChange={(value) => {\n console.log('value', value)\n setValue(value)\n }}\n />\n </Row>\n </Row>\n );\n};\nReactDOM.render(<Demo />, _mount_);\n```\n\n### \u5728\u8868\u5355\u4e2d\u4f7f\u7528\n\n\u5728 [`<Form />`](#/components/form) \u8868\u5355\u4e2d\u5e94\u7528 `<SearchSelect />` \u7ec4\u4ef6\u3002\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true&noScroll=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Row, Col, SearchSelect, Button, Notify } from 'uiw';\n\nconst Demo = () => {\n const selectOption =[\n { label: 'a1', value: 1 },\n { label: 'a2', value: 2 },\n { label: 'a3', value: 3 },\n { label: 'a4', value: 4 },\n { label: 'a5', value: 5 },\n { label: 'a6', value: 6 },\n { label: 'a7', value: 7 },\n { label: 'a8', value: 8 },\n ];\n const [option, setOption] = React.useState(selectOption);\n const [loading, setLoading] = React.useState(false);\n\n function handleSearch(e) {\n setLoading(true)\n setTimeout(() => {\n const filterOpion= selectOption.filter(item=>!!item.label.includes(e.trim()))\n setOption([...filterOpion]);\n setLoading(false);\n }, 500);\n }\n\n return (\n <div>\n <Form\n onSubmitError={(error) => {\n if (error.filed) {\n return { ...error.filed };\n }\n return null;\n }}\n onSubmit={({initial, current}) => {\n const errorObj = {};\n if (!current.selectField) {\n errorObj.selectField = '\u9ed8\u8ba4\u9700\u8981\u9009\u62e9\u5185\u5bb9\uff0c\u9009\u62e9\u5165\u5185\u5bb9';\n }\n if(Object.keys(errorObj).length > 0) {\n const err = new Error();\n err.filed = errorObj;\n Notify.error({ title: '\u63d0\u4ea4\u5931\u8d25\uff01', description: '\u8bf7\u786e\u8ba4\u63d0\u4ea4\u8868\u5355\u662f\u5426\u6b63\u786e\uff01' });\n throw err;\n }\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01',\n description: `\u8868\u5355\u63d0\u4ea4\u6210\u529f\uff0c\u9009\u62e9\u503c\u4e3a\uff1a${current.selectField}\uff0c\u5c06\u81ea\u52a8\u586b\u5145\u521d\u59cb\u5316\u503c\uff01`,\n });\n }}\n fields={{\n selectField: {\n initialValue:[{label: 'a7', value: 7},{label: 'a8', value: 8}],\n children: (\n <SearchSelect\n allowClear\n labelInValue={true}\n showSearch={true}\n mode=\"multiple\"\n disabled={false}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n onSearch={handleSearch}\n onChange={(v)=>{\n console.log('onChange',v)\n }}\n option={option}\n loading={loading}\n />\n )\n },\n selectSingle: {\n initialValue:[{label: 'a7', value: 7}],\n children: (\n <SearchSelect\n mode=\"single\"\n labelInValue={true}\n showSearch={true}\n allowClear\n disabled={false}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n onSearch={handleSearch}\n onChange={(v)=>{\n console.log('onChange',v)\n }}\n option={option}\n loading={loading}\n />\n )\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row gutter={20}>\n <Col fixed>{fields.selectField}</Col>\n </Row>\n <Row gutter={20}>\n <Col fixed>{fields.selectSingle}</Col>\n </Row>\n <Row>\n <Col fixed>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n <Row>\n <Col>\n <pre style={{ padding: 10, marginTop: 10 }}>\n {JSON.stringify(state.current, null, 2)}\n </pre>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n );\n}\nReactDOM.render(<Demo />, _mount_);\n```\n\n## Props\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c | \u7248\u672c |\n| ---- | ---- | ---- | ---- | ---- |\n| allowClear | \u652f\u6301\u6e05\u9664 | Boolean | `false` | - |\n| disabled | \u7981\u7528\u9009\u62e9\u5668 | Boolean | `false` | - |\n| mode | \u9009\u62e9\u6a21\u5f0f: `multiple` `single` | String | `single` | - |\n| defaultValue | \u6307\u5b9a\u9ed8\u8ba4\u9009\u4e2d\u7684\u6761\u76ee | String/Number | - | - |\n| value | \u6307\u5b9a\u5f53\u524d\u9009\u4e2d\u7684\u6761\u76ee\uff0c\u591a\u9009\u65f6\u4e3a\u4e00\u4e2a\u6570\u7ec4 | String \\| Number \\| String[] \\| Number[] \\| LabeledValue \\| LabeledValue[] | - | - |\n| placeholder | \u9009\u62e9\u6846\u9ed8\u8ba4\u6587\u5b57 | String | - | - |\n| maxTagCount | \u591a\u9009\u6a21\u5f0f\u4e0b\u5c55\u793atag\u7684\u4e2a\u6570,\u9ed8\u8ba4\u6240\u6709 | number | - | - |\n| labelInValue | \u5f00\u542f\u4f1a\u628a Select \u7684 value \u7c7b\u578b\u4ece `string/number` \u53d8\u4e3a `{ value: string/number, label: string }` | Boolean | `false` | - |\n| showSearch | \u4f7f\u5355\u9009\u6a21\u5f0f\u53ef\u641c\u7d22 | Boolean | - | - |\n| size | \u9009\u62e9\u6846\u5c3a\u5bf8 | Enum{large, default, small } | `default` | - |\n| tagProps | \u5c06\u53c2\u6570\u4f20\u9012\u7ed9 [`<Tag>`](https://uiwjs.github.io/#/components/tag) \u7ec4\u4ef6 | `TagProps` | `{}` | `4.13.0` |\n| onChange | \u9009\u4e2d option\uff0c\u6216 input \u7684 value\uff0c\u8c03\u7528\u6b64\u51fd\u6570 | function(value:String \\| Number \\| String[] \\| Number[] \\| LabeledValue \\| LabeledValue[]) | - | - |\n| onSearch | \u6587\u672c\u6846\u503c\u53d8\u5316\u65f6\u56de\u8c03 | function(value: String) | - | - |\n| onSelect | \u88ab\u9009\u4e2d\u65f6\u8c03\u7528\uff0c\u53c2\u6570\u4e3a\u9009\u4e2d\u9879\u7684 value | function(value: String/Number ) | - | - |\n| loading | \u52a0\u8f7d\u4e2d\u72b6\u6001 | Boolean | `false` | - |\n"}}]);
2
+ //# sourceMappingURL=7313.c64ca191.chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/7313.c64ca191.chunk.js","mappings":"gHAAA","sources":["../../packages/react-search-select/README.md"],"sourcesContent":["export default \"SearchSelect 搜索选择器\\n===\\n\\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-search-select/file/README.md)\\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-search-select.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-search-select)\\n[![npm version](https://img.shields.io/npm/v/@uiw/react-search-select.svg?label=@uiw/react-search-select)](https://npmjs.com/@uiw/react-search-select)\\n\\n搜索选择器\\n\\n```jsx\\nimport { SearchSelect, Row ,Col } from 'uiw';\\n// or\\nimport SearchSelect from '@uiw/react-search-select';\\n```\\n\\n## 基础示例\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { SearchSelect,Row,Col } from 'uiw';\\n\\nconst Demo = () => {\\n const selectOption=[\\n { label: 'a1', value: 1 },\\n { label: 'a2', value: 2 },\\n { label: 'a3', value: 3 },\\n { label: 'a4', value: 4 },\\n { label: 'a5', value: 5 },\\n { label: 'a6', value: 6 },\\n { label: 'a7', value: 7 },\\n { label: 'a8', value: 8 },\\n ]\\n\\n const [option, setOption] = React.useState(selectOption);\\n const [loading, setLoading] = React.useState(false);\\n const [values, setValues] = React.useState([{label: 'a7', value: 7},{label: 'a8', value: 8}]);\\n const [value, setValue] = React.useState([{label: 'a7', value: 7}]);\\n\\n function handleSearch(e) {\\n setLoading(true)\\n setTimeout(() => {\\n const filterOpion= selectOption.filter(item=>!!item.label.includes(e.trim()))\\n setOption([...filterOpion]);\\n setLoading(false);\\n }, 500);\\n }\\n\\n return(\\n <Row gutter={20}>\\n <Row>\\n <SearchSelect\\n mode=\\\"multiple\\\"\\n style={{ width: 176 }}\\n showSearch={true}\\n labelInValue={true}\\n maxTagCount={6}\\n allowClear\\n value={values}\\n disabled={false}\\n placeholder=\\\"请输入选择\\\"\\n onSearch={handleSearch}\\n // onSelect={(value)=>console.log('onSelect',value)}\\n loading={loading}\\n option={option}\\n onChange={(value) => {\\n console.log('value', value)\\n setValues(value)\\n }}\\n />\\n </Row>\\n <Row>\\n <SearchSelect\\n mode=\\\"single\\\"\\n style={{ width: 176 }}\\n showSearch={true}\\n labelInValue={true}\\n maxTagCount={6}\\n allowClear\\n value={value}\\n disabled={false}\\n placeholder=\\\"请输入选择\\\"\\n onSearch={handleSearch}\\n // onSelect={(value)=>console.log('onSelect',value)}\\n loading={loading}\\n option={option}\\n onChange={(value) => {\\n console.log('value', value)\\n setValue(value)\\n }}\\n />\\n </Row>\\n </Row>\\n );\\n};\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n### 在表单中使用\\n\\n在 [`<Form />`](#/components/form) 表单中应用 `<SearchSelect />` 组件。\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true&noScroll=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Row, Col, SearchSelect, Button, Notify } from 'uiw';\\n\\nconst Demo = () => {\\n const selectOption =[\\n { label: 'a1', value: 1 },\\n { label: 'a2', value: 2 },\\n { label: 'a3', value: 3 },\\n { label: 'a4', value: 4 },\\n { label: 'a5', value: 5 },\\n { label: 'a6', value: 6 },\\n { label: 'a7', value: 7 },\\n { label: 'a8', value: 8 },\\n ];\\n const [option, setOption] = React.useState(selectOption);\\n const [loading, setLoading] = React.useState(false);\\n\\n function handleSearch(e) {\\n setLoading(true)\\n setTimeout(() => {\\n const filterOpion= selectOption.filter(item=>!!item.label.includes(e.trim()))\\n setOption([...filterOpion]);\\n setLoading(false);\\n }, 500);\\n }\\n\\n return (\\n <div>\\n <Form\\n onSubmitError={(error) => {\\n if (error.filed) {\\n return { ...error.filed };\\n }\\n return null;\\n }}\\n onSubmit={({initial, current}) => {\\n const errorObj = {};\\n if (!current.selectField) {\\n errorObj.selectField = '默认需要选择内容,选择入内容';\\n }\\n if(Object.keys(errorObj).length > 0) {\\n const err = new Error();\\n err.filed = errorObj;\\n Notify.error({ title: '提交失败!', description: '请确认提交表单是否正确!' });\\n throw err;\\n }\\n Notify.success({\\n title: '提交成功!',\\n description: `表单提交成功,选择值为:${current.selectField},将自动填充初始化值!`,\\n });\\n }}\\n fields={{\\n selectField: {\\n initialValue:[{label: 'a7', value: 7},{label: 'a8', value: 8}],\\n children: (\\n <SearchSelect\\n allowClear\\n labelInValue={true}\\n showSearch={true}\\n mode=\\\"multiple\\\"\\n disabled={false}\\n placeholder=\\\"请输入选择\\\"\\n onSearch={handleSearch}\\n onChange={(v)=>{\\n console.log('onChange',v)\\n }}\\n option={option}\\n loading={loading}\\n />\\n )\\n },\\n selectSingle: {\\n initialValue:[{label: 'a7', value: 7}],\\n children: (\\n <SearchSelect\\n mode=\\\"single\\\"\\n labelInValue={true}\\n showSearch={true}\\n allowClear\\n disabled={false}\\n placeholder=\\\"请输入选择\\\"\\n onSearch={handleSearch}\\n onChange={(v)=>{\\n console.log('onChange',v)\\n }}\\n option={option}\\n loading={loading}\\n />\\n )\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row gutter={20}>\\n <Col fixed>{fields.selectField}</Col>\\n </Row>\\n <Row gutter={20}>\\n <Col fixed>{fields.selectSingle}</Col>\\n </Row>\\n <Row>\\n <Col fixed>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n <Row>\\n <Col>\\n <pre style={{ padding: 10, marginTop: 10 }}>\\n {JSON.stringify(state.current, null, 2)}\\n </pre>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n );\\n}\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n## Props\\n\\n| 参数 | 说明 | 类型 | 默认值 | 版本 |\\n| ---- | ---- | ---- | ---- | ---- |\\n| allowClear | 支持清除 | Boolean | `false` | - |\\n| disabled | 禁用选择器 | Boolean | `false` | - |\\n| mode | 选择模式: `multiple` `single` | String | `single` | - |\\n| defaultValue | 指定默认选中的条目 | String/Number | - | - |\\n| value | 指定当前选中的条目,多选时为一个数组 | String \\\\| Number \\\\| String[] \\\\| Number[] \\\\| LabeledValue \\\\| LabeledValue[] | - | - |\\n| placeholder | 选择框默认文字 | String | - | - |\\n| maxTagCount | 多选模式下展示tag的个数,默认所有 | number | - | - |\\n| labelInValue | 开启会把 Select 的 value 类型从 `string/number` 变为 `{ value: string/number, label: string }` | Boolean | `false` | - |\\n| showSearch | 使单选模式可搜索 | Boolean | - | - |\\n| size | 选择框尺寸 | Enum{large, default, small } | `default` | - |\\n| tagProps | 将参数传递给 [`<Tag>`](https://uiwjs.github.io/#/components/tag) 组件 | `TagProps` | `{}` | `4.13.0` |\\n| onChange | 选中 option,或 input 的 value,调用此函数 | function(value:String \\\\| Number \\\\| String[] \\\\| Number[] \\\\| LabeledValue \\\\| LabeledValue[]) | - | - |\\n| onSearch | 文本框值变化时回调 | function(value: String) | - | - |\\n| onSelect | 被选中时调用,参数为选中项的 value | function(value: String/Number ) | - | - |\\n| loading | 加载中状态 | Boolean | `false` | - |\\n\";"],"names":[],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[766],{80766:function(e,n,l){l.r(n),n.default="SearchTree \u5e26\u641c\u7d22\u7684Tree\u9009\u62e9\u63a7\u4ef6\n===\n\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-search-tree/file/README.md)\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-search-tree.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-search-tree)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-search-tree.svg?label=@uiw/react-search-tree)](https://npmjs.com/@uiw/react-search-tree)\n\n\u4f7f\u7528\u6811\u9009\u62e9\u63a7\u4ef6\u53ef\u4ee5\u5b8c\u6574\u5c55\u73b0\u5176\u4e2d\u7684\u5c42\u7ea7\u5173\u7cfb\uff0c\u5e76\u5177\u6709\u9009\u4e2d\u72b6\u6001\u3002\u65b0\u7ec4\u4ef6 v4.11.7+ \u652f\u6301\u3002\n\n```jsx\nimport { SearchTree } from 'uiw';\n// or\nimport SearchTree from '@uiw/react-search-tree';\n```\n\n### \u57fa\u7840\u5b9e\u4f8b\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport React, { useState, useEffect, useRef } from 'react';\nimport ReactDOM from 'react-dom';\nimport { SearchTree } from 'uiw';\n\nconst data = [\n {\n label: '\u4e0a\u6d77\u5e02',\n key: 1,\n children:[\n { label: '\u9ec4\u6d66\u533a', key: 2 },\n { label: '\u5362\u6e7e\u533a', key: 3 },\n {\n label: '\u5f90\u6c47\u533a',\n key: 4,\n children:[\n { label: '\u534a\u6dde\u56ed\u8def\u8857\u9053', key: 6 },\n { label: '\u5357\u4eac\u4e1c\u8def\u8857\u9053', key: 7 },\n { label: '\u5916\u6ee9\u8857\u9053', key: 8 },\n ]\n },\n ]\n },\n {\n label: '\u5317\u4eac\u5e02',\n key: 9,\n children:[\n { label: '\u4e1c\u57ce\u533a', key: 10 },\n { label: '\u897f\u57ce\u533a', key: 11 },\n {\n label: '\u5d07\u6587\u533a',\n key: 12,\n children:[\n { label: '\u4e1c\u82b1\u5e02\u8857\u9053', key: 13 },\n { label: '\u4f53\u80b2\u9986\u8def\u8857\u9053', key: 14 },\n { label: '\u524d\u95e8\u8857\u9053', key: 15 },\n ]\n },\n ]\n },\n { label: '\u6fb3\u95e8', key: 16 },\n];\n\nconst datas =[\n { label: '\u4e0a\u6d77\u5e02', key: 0 },\n { label: '\u5317\u4eac\u5e02', key: 1 },\n { label: '\u6210\u90fd\u5e02', key: 2 },\n]\n\nconst Demo = () => {\n\nconst [value,valueSet]=useState([{ label: '\u9ec4\u6d66\u533a', key: 12 }])\nconst [values,valuesSet]=useState([{ label: '\u5317\u4eac\u5e02', key: 1 }])\nconst [valueSinge,valueSingeSet]=useState([{ label: '\u4e0a\u6d77\u5e02', key: '1-0-0' }])\n\nconst onChange=(selectd, selectedAll, isChecked)=>{\n console.log('SearchTree-> onChange',selectedAll, selectd, isChecked)\n valueSet(selectedAll)\n}\n\nconst onChanges=(selectd, selectedAll, isChecked)=>{\n console.log('SearchTree-> onChange',selectedAll, selectd, isChecked)\n valuesSet(selectedAll)\n}\n\nconst onChangeSinge=(selectd, selectedAll, isChecked)=>{\n console.log('SearchTree-> onChange', selectd, selectedAll, isChecked)\n valueSingeSet(selectedAll)\n}\n\n return (\n <>\n <Row>\n <Col >\n <label>\u591a\u9009</label>\n <SearchTree\n style={{ width:400 }}\n allowClear={true}\n onSearch={(searchValue)=>console.log('multiple',searchValue)}\n onChange={onChange}\n value={value}\n options={data}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n />\n </Col>\n </Row>\n <label>\u5355\u9009</label>\n <Row>\n <Col>\n <SearchTree\n style={{width:400}}\n multiple={false}\n allowClear={true}\n onSearch={(searchValue)=>console.log('singe',searchValue)}\n onChange={onChanges}\n value={values}\n options={datas}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n />\n </Col>\n <Col>\n <SearchTree\n style={{width:400}}\n multiple={false}\n allowClear={true}\n onSearch={(searchValue)=>console.log('singe',searchValue)}\n onChange={onChangeSinge}\n value={valueSinge}\n options={data}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n />\n </Col>\n </Row>\n </>\n )\n}\nReactDOM.render(<Demo />, _mount_);\n```\n\n## \u81ea\u5b9a\u4e49\u7a7a\u9009\u9879\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport React, { useState, useEffect, useRef } from 'react';\nimport { SearchTree } from 'uiw';\n\nconst Demo = () => {\n return(\n <>\n <SearchTree style={{ width:200 }} />\n <SearchTree\n style={{ width:200,marginTop:5 }}\n emptyOption={<span>\u6682\u65e0\u6570\u636e..</span>}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n />\n </>\n )\n}\n\nReactDOM.render(<Demo />, _mount_);\n```\n\n## Form\u4e2d\u4f7f\u7528\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport React, { useState, useEffect, useRef } from 'react';\nimport ReactDOM from 'react-dom';\nimport { Form, Button, SearchTree, Card, Row, Col } from 'uiw';;\n\n\nconst Demo = () => {\nconst form=useRef()\n\n const data = [\n {\n label: '\u4e0a\u6d77\u5e02',\n key: '1-0-0',\n children:[\n { label: '\u9ec4\u6d66\u533a', key: '1-0-1' },\n { label: '\u5362\u6e7e\u533a', key: '1-0-2' },\n {\n label: '\u5f90\u6c47\u533a',\n key: '1-0-3',\n children:[\n { label: '\u534a\u6dde\u56ed\u8def\u8857\u9053', key: '1-1-0' },\n { label: '\u5357\u4eac\u4e1c\u8def\u8857\u9053', key: '1-2-0' },\n { label: '\u5916\u6ee9\u8857\u9053', key: '1-3-0' },\n ]\n },\n ]\n },\n {\n label: '\u5317\u4eac\u5e02',\n key: '2-0-0',\n children:[\n { label: '\u4e1c\u57ce\u533a', key: '2-1-0' },\n { label: '\u897f\u57ce\u533a', key: '2-2-0' },\n {\n label: '\u5d07\u6587\u533a',\n key: '2-3-0',\n children:[\n { label: '\u4e1c\u82b1\u5e02\u8857\u9053', key: '2-3-1' },\n { label: '\u4f53\u80b2\u9986\u8def\u8857\u9053', key: '2-3-2' },\n { label: '\u524d\u95e8\u8857\u9053', key: '2-3-3' },\n ]\n },\n ]\n },\n { label: '\u6fb3\u95e8', key: '3' },\n ];\n\n const setValue=()=>{\n form.current.setFields({\n searchTree: [{ label: '\u4e1c\u57ce\u533a', key: '2-1-0' }, { label: '\u5916\u6ee9\u8857\u9053', key: '1-3-0' }],\n searchTreeSinge:[{ label: '\u524d\u95e8\u8857\u9053', key: '2-3-3' }]\n })\n }\n\n const resetValue=()=>{\n form.current.resetForm()\n }\n\n return (\n <div>\n <Form\n ref={form}\n onSubmitError={(error) => {\n if (error.filed) {\n return { ...error.filed };\n }\n return null;\n }}\n onSubmit={({initial, current}) => {\n const errorObj = {};\n if (!current.searchTree) {\n errorObj.searchTree = '\u9ed8\u8ba4\u9700\u8981\u9009\u62e9\u5185\u5bb9\uff0c\u9009\u62e9\u5165\u5185\u5bb9';\n }\n if(Object.keys(errorObj).length > 0) {\n const err = new Error();\n err.filed = errorObj;\n Notify.error({ title: '\u63d0\u4ea4\u5931\u8d25\uff01', description: '\u8bf7\u786e\u8ba4\u63d0\u4ea4\u8868\u5355\u662f\u5426\u6b63\u786e\uff01' });\n throw err;\n }\n Notify.success({\n title: '\u63d0\u4ea4\u6210\u529f\uff01',\n description: `\u8868\u5355\u63d0\u4ea4\u6210\u529f\uff0c\u9009\u62e9\u503c\u4e3a\uff1a${current.selectField}\uff0c\u5c06\u81ea\u52a8\u586b\u5145\u521d\u59cb\u5316\u503c\uff01`,\n });\n }}\n fields={{\n searchTree: {\n initialValue:[{ label: '\u4e1c\u82b1\u5e02\u8857\u9053', key: '2-3-1' },{ label: '\u524d\u95e8\u8857\u9053', key: '2-3-3' }],\n children: (\n <SearchTree\n allowClear={true}\n onSearch={(searchValue)=>console.log('SearchTree-> SearchTreeOption',searchValue)}\n onChange={(selectd, selectedAll, isChecked)=>console.log('SearchTree-> onChange', selectd, selectedAll, isChecked)}\n options={data}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n />\n )\n },\n searchTreeSinge: {\n initialValue:[{ label: '\u4e1c\u82b1\u5e02\u8857\u9053', key: '2-3-1' }],\n children: (\n <SearchTree\n multiple={false}\n allowClear={true}\n onSearch={(searchValue)=>console.log('SearchTree-> SearchTreeOption',searchValue)}\n onChange={(selectd, selectedAll, isChecked)=>console.log('SearchTree-> onChange', selectd, selectedAll, isChecked)}\n options={data}\n placeholder=\"\u8bf7\u8f93\u5165\u9009\u62e9\"\n />\n )\n },\n }}\n >\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row>\n <Col fixed>{fields.searchTree}</Col>\n </Row>\n <Row>\n <Col fixed>{fields.searchTreeSinge}</Col>\n </Row>\n <Row>\n <Col fixed>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n <Button onClick={setValue} type=\"primary\" >setValue</Button>\n <Button onClick={resetValue} type=\"primary\" >\u91cd\u7f6e</Button>\n </Col>\n </Row>\n <Row>\n <Col>\n <pre style={{ padding: 10, marginTop: 10 }}>\n {JSON.stringify(state.current, null, 2)}\n </pre>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>\n );\n}\nReactDOM.render(<Demo />, _mount_);\n```\n\n## Props\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| allowClear | \u652f\u6301\u6e05\u9664 | Boolean | `false` |\n| disabled | \u7981\u7528\u9009\u62e9\u5668 | Boolean | `false` |\n| multiple | \u662f\u5426\u53ef\u4ee5\u591a\u9009 | Boolean | `true` |\n| value | \u6307\u5b9a\u5f53\u524d\u9009\u4e2d\u7684\u6761\u76ee | [{label:string, key:string}] | - |\n| options | \u4e0b\u62c9\u6570\u636e\u6e90,\u53ef\u53c2\u8003Tree\u4e0b\u62c9\u6570\u636e\u6e90 | [{label:string, key:string, children: [{label:string, key:string}] }] | - |\n| placeholder | \u9009\u62e9\u6846\u9ed8\u8ba4\u6587\u5b57 | String | - |\n| size | \u9009\u62e9\u6846\u5c3a\u5bf8 | Enum{large, default, small } | `default` |\n| onChange | \u9009\u4e2d option\uff0c\u6216 input \u7684 value\uff0c\u8c03\u7528\u6b64\u51fd\u6570 | function(selectd, selectdAll, isChecked)=>void | - |\n| onSearch | \u6587\u672c\u6846\u503c\u53d8\u5316\u65f6\u56de\u8c03 | function(searchValue) | - |\n| loading | \u52a0\u8f7d\u4e2d\u72b6\u6001 | Boolean | `false` |\n| emptyOption | \u81ea\u5b9a\u4e49\u4e0b\u62c9\u9009\u9879\u4e3a\u7a7a\u65f6\u663e\u793a\u5185\u5bb9 | React.ReactNode | [Empty](https://uiwjs.github.io/#/components/empty) |\n\n"}}]);
2
+ //# sourceMappingURL=766.7ba76965.chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/766.7ba76965.chunk.js","mappings":"+GAAA","sources":["../../packages/react-search-tree/README.md"],"sourcesContent":["export default \"SearchTree 带搜索的Tree选择控件\\n===\\n\\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-search-tree/file/README.md)\\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-search-tree.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-search-tree)\\n[![npm version](https://img.shields.io/npm/v/@uiw/react-search-tree.svg?label=@uiw/react-search-tree)](https://npmjs.com/@uiw/react-search-tree)\\n\\n使用树选择控件可以完整展现其中的层级关系,并具有选中状态。新组件 v4.11.7+ 支持。\\n\\n```jsx\\nimport { SearchTree } from 'uiw';\\n// or\\nimport SearchTree from '@uiw/react-search-tree';\\n```\\n\\n### 基础实例\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport React, { useState, useEffect, useRef } from 'react';\\nimport ReactDOM from 'react-dom';\\nimport { SearchTree } from 'uiw';\\n\\nconst data = [\\n {\\n label: '上海市',\\n key: 1,\\n children:[\\n { label: '黄浦区', key: 2 },\\n { label: '卢湾区', key: 3 },\\n {\\n label: '徐汇区',\\n key: 4,\\n children:[\\n { label: '半淞园路街道', key: 6 },\\n { label: '南京东路街道', key: 7 },\\n { label: '外滩街道', key: 8 },\\n ]\\n },\\n ]\\n },\\n {\\n label: '北京市',\\n key: 9,\\n children:[\\n { label: '东城区', key: 10 },\\n { label: '西城区', key: 11 },\\n {\\n label: '崇文区',\\n key: 12,\\n children:[\\n { label: '东花市街道', key: 13 },\\n { label: '体育馆路街道', key: 14 },\\n { label: '前门街道', key: 15 },\\n ]\\n },\\n ]\\n },\\n { label: '澳门', key: 16 },\\n];\\n\\nconst datas =[\\n { label: '上海市', key: 0 },\\n { label: '北京市', key: 1 },\\n { label: '成都市', key: 2 },\\n]\\n\\nconst Demo = () => {\\n\\nconst [value,valueSet]=useState([{ label: '黄浦区', key: 12 }])\\nconst [values,valuesSet]=useState([{ label: '北京市', key: 1 }])\\nconst [valueSinge,valueSingeSet]=useState([{ label: '上海市', key: '1-0-0' }])\\n\\nconst onChange=(selectd, selectedAll, isChecked)=>{\\n console.log('SearchTree-> onChange',selectedAll, selectd, isChecked)\\n valueSet(selectedAll)\\n}\\n\\nconst onChanges=(selectd, selectedAll, isChecked)=>{\\n console.log('SearchTree-> onChange',selectedAll, selectd, isChecked)\\n valuesSet(selectedAll)\\n}\\n\\nconst onChangeSinge=(selectd, selectedAll, isChecked)=>{\\n console.log('SearchTree-> onChange', selectd, selectedAll, isChecked)\\n valueSingeSet(selectedAll)\\n}\\n\\n return (\\n <>\\n <Row>\\n <Col >\\n <label>多选</label>\\n <SearchTree\\n style={{ width:400 }}\\n allowClear={true}\\n onSearch={(searchValue)=>console.log('multiple',searchValue)}\\n onChange={onChange}\\n value={value}\\n options={data}\\n placeholder=\\\"请输入选择\\\"\\n />\\n </Col>\\n </Row>\\n <label>单选</label>\\n <Row>\\n <Col>\\n <SearchTree\\n style={{width:400}}\\n multiple={false}\\n allowClear={true}\\n onSearch={(searchValue)=>console.log('singe',searchValue)}\\n onChange={onChanges}\\n value={values}\\n options={datas}\\n placeholder=\\\"请输入选择\\\"\\n />\\n </Col>\\n <Col>\\n <SearchTree\\n style={{width:400}}\\n multiple={false}\\n allowClear={true}\\n onSearch={(searchValue)=>console.log('singe',searchValue)}\\n onChange={onChangeSinge}\\n value={valueSinge}\\n options={data}\\n placeholder=\\\"请输入选择\\\"\\n />\\n </Col>\\n </Row>\\n </>\\n )\\n}\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n## 自定义空选项\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport React, { useState, useEffect, useRef } from 'react';\\nimport { SearchTree } from 'uiw';\\n\\nconst Demo = () => {\\n return(\\n <>\\n <SearchTree style={{ width:200 }} />\\n <SearchTree\\n style={{ width:200,marginTop:5 }}\\n emptyOption={<span>暂无数据..</span>}\\n placeholder=\\\"请输入选择\\\"\\n />\\n </>\\n )\\n}\\n\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n## Form中使用\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport React, { useState, useEffect, useRef } from 'react';\\nimport ReactDOM from 'react-dom';\\nimport { Form, Button, SearchTree, Card, Row, Col } from 'uiw';;\\n\\n\\nconst Demo = () => {\\nconst form=useRef()\\n\\n const data = [\\n {\\n label: '上海市',\\n key: '1-0-0',\\n children:[\\n { label: '黄浦区', key: '1-0-1' },\\n { label: '卢湾区', key: '1-0-2' },\\n {\\n label: '徐汇区',\\n key: '1-0-3',\\n children:[\\n { label: '半淞园路街道', key: '1-1-0' },\\n { label: '南京东路街道', key: '1-2-0' },\\n { label: '外滩街道', key: '1-3-0' },\\n ]\\n },\\n ]\\n },\\n {\\n label: '北京市',\\n key: '2-0-0',\\n children:[\\n { label: '东城区', key: '2-1-0' },\\n { label: '西城区', key: '2-2-0' },\\n {\\n label: '崇文区',\\n key: '2-3-0',\\n children:[\\n { label: '东花市街道', key: '2-3-1' },\\n { label: '体育馆路街道', key: '2-3-2' },\\n { label: '前门街道', key: '2-3-3' },\\n ]\\n },\\n ]\\n },\\n { label: '澳门', key: '3' },\\n ];\\n\\n const setValue=()=>{\\n form.current.setFields({\\n searchTree: [{ label: '东城区', key: '2-1-0' }, { label: '外滩街道', key: '1-3-0' }],\\n searchTreeSinge:[{ label: '前门街道', key: '2-3-3' }]\\n })\\n }\\n\\n const resetValue=()=>{\\n form.current.resetForm()\\n }\\n\\n return (\\n <div>\\n <Form\\n ref={form}\\n onSubmitError={(error) => {\\n if (error.filed) {\\n return { ...error.filed };\\n }\\n return null;\\n }}\\n onSubmit={({initial, current}) => {\\n const errorObj = {};\\n if (!current.searchTree) {\\n errorObj.searchTree = '默认需要选择内容,选择入内容';\\n }\\n if(Object.keys(errorObj).length > 0) {\\n const err = new Error();\\n err.filed = errorObj;\\n Notify.error({ title: '提交失败!', description: '请确认提交表单是否正确!' });\\n throw err;\\n }\\n Notify.success({\\n title: '提交成功!',\\n description: `表单提交成功,选择值为:${current.selectField},将自动填充初始化值!`,\\n });\\n }}\\n fields={{\\n searchTree: {\\n initialValue:[{ label: '东花市街道', key: '2-3-1' },{ label: '前门街道', key: '2-3-3' }],\\n children: (\\n <SearchTree\\n allowClear={true}\\n onSearch={(searchValue)=>console.log('SearchTree-> SearchTreeOption',searchValue)}\\n onChange={(selectd, selectedAll, isChecked)=>console.log('SearchTree-> onChange', selectd, selectedAll, isChecked)}\\n options={data}\\n placeholder=\\\"请输入选择\\\"\\n />\\n )\\n },\\n searchTreeSinge: {\\n initialValue:[{ label: '东花市街道', key: '2-3-1' }],\\n children: (\\n <SearchTree\\n multiple={false}\\n allowClear={true}\\n onSearch={(searchValue)=>console.log('SearchTree-> SearchTreeOption',searchValue)}\\n onChange={(selectd, selectedAll, isChecked)=>console.log('SearchTree-> onChange', selectd, selectedAll, isChecked)}\\n options={data}\\n placeholder=\\\"请输入选择\\\"\\n />\\n )\\n },\\n }}\\n >\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row>\\n <Col fixed>{fields.searchTree}</Col>\\n </Row>\\n <Row>\\n <Col fixed>{fields.searchTreeSinge}</Col>\\n </Row>\\n <Row>\\n <Col fixed>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n <Button onClick={setValue} type=\\\"primary\\\" >setValue</Button>\\n <Button onClick={resetValue} type=\\\"primary\\\" >重置</Button>\\n </Col>\\n </Row>\\n <Row>\\n <Col>\\n <pre style={{ padding: 10, marginTop: 10 }}>\\n {JSON.stringify(state.current, null, 2)}\\n </pre>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>\\n );\\n}\\nReactDOM.render(<Demo />, _mount_);\\n```\\n\\n## Props\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| allowClear | 支持清除 | Boolean | `false` |\\n| disabled | 禁用选择器 | Boolean | `false` |\\n| multiple | 是否可以多选 | Boolean | `true` |\\n| value | 指定当前选中的条目 | [{label:string, key:string}] | - |\\n| options | 下拉数据源,可参考Tree下拉数据源 | [{label:string, key:string, children: [{label:string, key:string}] }] | - |\\n| placeholder | 选择框默认文字 | String | - |\\n| size | 选择框尺寸 | Enum{large, default, small } | `default` |\\n| onChange | 选中 option,或 input 的 value,调用此函数 | function(selectd, selectdAll, isChecked)=>void | - |\\n| onSearch | 文本框值变化时回调 | function(searchValue) | - |\\n| loading | 加载中状态 | Boolean | `false` |\\n| emptyOption | 自定义下拉选项为空时显示内容 | React.ReactNode | [Empty](https://uiwjs.github.io/#/components/empty) |\\n\\n\";"],"names":[],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8768],{78768:function(n,e,t){t.r(e),e.default="FileInput \u4e0a\u4f20\u8f93\u5165\u6846\n===\n\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-file-input/file/README.md)\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-file-input.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-file-input)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-file-input.svg?label=@uiw/react-file-input)](https://npmjs.com/@uiw/react-file-input)\n\n\u8fd9\u4e2a\u7ec4\u4ef6\u4ec5\u4ec5\u662f\u5bf9 `<input type=\"file\">` \u7684\u7f8e\u5316\uff0c\u4ed6\u662f\u57fa\u4e8e Input \u7ec4\u4ef6\u5c01\u88c5 \u3002\n\n```jsx\nimport { FileInput } from 'uiw';\n// or\nimport FileInput from '@uiw/react-file-input';\n```\n\n### \u57fa\u7840\u7528\u6cd5\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { FileInput, Button } from 'uiw';\n\nconst Demo = () => {\n const onChange = (e) => {\n console.log(e)\n }\n return (\n <div>\n <FileInput multiple=\"multiple\" style={{ maxWidth: 200 }} size=\"small\" onChange={onChange} />\n <br />\n <FileInput multiple=\"multiple\" style={{ maxWidth: 200 }} />\n <br />\n </div>\n )\n}\n\nReactDOM.render(\n <Demo />,\n _mount_\n);\n```\n\n### \u56fe\u7247\u5899\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { FileInput, Button } from 'uiw';\n\nconst Demo = () => {\n return (\n <div>\n <FileInput\n uploadType=\"card\"\n size=\"large\"\n showFileIcon={{\n showPreviewIcon: false,\n showRemoveIcon: true\n }}\n onPreview={(file) => console.log(file)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\n ]}\n onChange={(items) => console.log(items)}\n >\n <Icon type=\"plus\" />\n </FileInput>\n <br />\n <FileInput\n uploadType=\"card\"\n shape=\"circle\"\n showFileIcon={{\n showPreviewIcon: false,\n showRemoveIcon: true\n }}\n onPreview={(file) => console.log(file)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\n ]}\n onChange={(items) => console.log(items)}\n >\n <Icon type=\"plus\" />\n </FileInput>\n <br />\n <FileInput\n uploadType=\"card\"\n size=\"small\"\n showFileIcon={{\n showPreviewIcon: false,\n showRemoveIcon: true\n }}\n onPreview={(file) => console.log(file)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\n ]}\n onChange={(items) => console.log(items)}\n >\n <Icon type=\"plus\" />\n </FileInput>\n </div>\n )\n}\n\nReactDOM.render(\n <Demo />,\n _mount_\n);\n```\n\n### \u56fe\u7247\u9884\u89c8\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { FileInput, Overlay } from 'uiw';\n\nconst Demo=()=>{\n const [visible,visibleSet]=React.useState(false)\n const [curfile,curFileSet]=React.useState(null)\n console.log('curfile',curfile)\n\n return(\n <>\n <Overlay\n isOpen={visible}\n onClosed={()=>visibleSet(false)}\n >\n <img src={`${curfile?.dataURL}`} alt={`${curfile?.name}`} />\n </Overlay>\n <FileInput\n uploadType=\"picture\"\n size=\"large\"\n onPreview={(file) =>{\n visibleSet(true)\n curFileSet(file)\n }}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Icon type=\"plus\" />\n </FileInput>\n </>\n )\n}\n\nReactDOM.render(<Demo/> ,_mount_\n);\n```\n\n### \u56fe\u7247\u5217\u8868\u6837\u5f0f\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { FileInput, Button } from 'uiw';\n\nReactDOM.render(\n <div>\n <FileInput\n uploadType=\"picture\"\n size=\"large\"\n onPreview={() => console.log(234)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Button>\u65b0\u589e</Button>\n </FileInput>\n <br />\n <FileInput\n uploadType=\"picture\"\n shape=\"circle\"\n onPreview={() => console.log(234)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Button>\u65b0\u589e</Button>\n </FileInput>\n <br />\n <FileInput\n uploadType=\"picture\"\n size=\"small\"\n onPreview={() => console.log(234)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Button>\u65b0\u589e</Button>\n </FileInput>\n <br />\n <FileInput\n uploadType=\"text\"\n multiple\n maxNumber={2}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Button>\u65b0\u589e</Button>\n </FileInput>\n </div>,\n _mount_\n);\n```\n\n### \u5728`Form`\u8868\u5355\u4e2d\u4f7f\u7528\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Row, Col, Icon } from 'uiw';\n\nReactDOM.render(\n <div>\n <Form\n fields={{\n picture1: {\n label: '\u56fe\u7247\u5899',\n initialValue: [\n {\n dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png'\n }\n ],\n children: (\n <FileInput uploadType=\"card\">\n <Icon type=\"plus\" />\n </FileInput>\n )\n },\n picture2: {\n label: '\u56fe\u7247\u5217\u8868',\n initialValue: [\n {\n dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png'\n }\n ],\n children: (\n <FileInput uploadType=\"picture\">\n <Button>\u65b0\u589e</Button>\n </FileInput>\n )\n },\n picture3: {\n label: '\u56fe\u7247\u540d\u79f0\u5217\u8868',\n children: (\n <FileInput uploadType=\"text\">\n <Button>\u65b0\u589e</Button>\n </FileInput>\n )\n },\n }}>\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row>\n <Col>{fields.picture1}</Col>\n </Row>\n <Row>\n <Col>{fields.picture2}</Col>\n </Row>\n <Row>\n <Col>{fields.picture3}</Col>\n </Row>\n <Row>\n <Col>\n <pre style={{ padding: '10px 0 0 10px' }}>\n {JSON.stringify(state.current, null, 2)}\n </pre>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>,\n _mount_\n);\n```\n\n## Props\n\n- `uploadType: input` \u57fa\u7840\u8f93\u5165\u6846\u4e0a\u4f20\n\n- `uploadType: picture` \u56fe\u7247\u5217\u5c55\u793a\u5217\u8868\uff0c\u663e\u793a\u56fe\u7247\n\n- `uploadType: text` \u56fe\u7247\u5217\u5c55\u793a\u5217\u8868\uff0c\u4e0d\u663e\u793a\u56fe\u7247\n\n- `uploadType: card` \u56fe\u7247\u5899\u5217\u8868\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| uploadType | \u4e0a\u4f20\u5c55\u793a\u7c7b\u578b | `input`\u3001`picture`\u3001`text`\u3001`card` | `input` |\n| className | CSS\u7c7b\u540d\u79f0 | String | - |\n| multiple | \u662f\u5426\u591a\u9009\u4e0a\u4f20 | boolean | - |\n\n\n### Props uploadType input\u7c7b\u578b\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| dataLabel | input \u540e\u7f6e\u6587\u5b57 | `string` | `Browse` |\n\n\u66f4\u591a\u5c5e\u6027\u6587\u6863\u8bf7\u53c2\u8003 [Input](#/components/input)\u3002\n\n\n### Props uploadType \u975einput\u7c7b\u578b\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| value | \u9ed8\u8ba4\u56fe\u7247\u5217\u8868 | FileInputValue[] | - |\n| readonly | \u662f\u5426\u662f\u53ea\u8bfb\u6a21\u5f0f | boolean | false |\n| maxNumber | \u6587\u4ef6\u4e0a\u4f20\u6570\u91cf | boolean | false |\n| shape | \u56fe\u7247\u5c55\u793a\u5f62\u72b6 | `circle`\u3001`round` | `round` |\n| size | \u56fe\u7247\u5c55\u793a\u5927\u5c0f | `large`\u3001`middle`\u3001`small` | `middle` |\n| showFileIcon | \u8bbe\u7f6e\u56fe\u6807\u6309\u94ae\u662f\u5426\u5c55\u793a | {showPreviewIcon?: boolean,showRemoveIcon?: boolean} | {showPreviewIcon: true, showRemoveIcon: true} |\n| onChange | \u6587\u4ef6\u4e0a\u4f20\u56de\u8c03 | (value: FileInputValue[]) => void | - |\n| onPreview | \u9884\u89c8\u56fe\u6807\u65f6\u7684\u56de\u8c03 | (value: FileInputValue[]) => void | - |\n\n"}}]);
2
- //# sourceMappingURL=8768.2b6b6aab.chunk.js.map
1
+ "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8768],{78768:function(n,e,t){t.r(e),e.default="FileInput \u4e0a\u4f20\u8f93\u5165\u6846\n===\n\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-file-input/file/README.md)\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-file-input.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-file-input)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-file-input.svg?label=@uiw/react-file-input)](https://npmjs.com/@uiw/react-file-input)\n\n\u8fd9\u4e2a\u7ec4\u4ef6\u4ec5\u4ec5\u662f\u5bf9 `<input type=\"file\">` \u7684\u7f8e\u5316\uff0c\u4ed6\u662f\u57fa\u4e8e Input \u7ec4\u4ef6\u5c01\u88c5 \u3002\n\n```jsx\nimport { FileInput } from 'uiw';\n// or\nimport FileInput from '@uiw/react-file-input';\n```\n\n### \u57fa\u7840\u7528\u6cd5\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { FileInput, Button } from 'uiw';\n\nconst Demo = () => {\n const onChange = (e) => {\n console.log(e)\n }\n return (\n <div>\n <FileInput multiple=\"multiple\" style={{ maxWidth: 200 }} size=\"small\" onChange={onChange} />\n <br />\n <FileInput multiple=\"multiple\" style={{ maxWidth: 200 }} />\n <br />\n </div>\n )\n}\n\nReactDOM.render(\n <Demo />,\n _mount_\n);\n```\n\n### \u56fe\u7247\u5899\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { FileInput, Button } from 'uiw';\n\nconst Demo = () => {\n return (\n <div>\n <FileInput\n uploadType=\"card\"\n size=\"large\"\n showFileIcon={{\n showPreviewIcon: false,\n showRemoveIcon: true\n }}\n onPreview={(file) => console.log(file)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\n ]}\n onChange={(items) => console.log(items)}\n >\n <Icon type=\"plus\" />\n </FileInput>\n <br />\n <FileInput\n uploadType=\"card\"\n shape=\"circle\"\n showFileIcon={{\n showPreviewIcon: false,\n showRemoveIcon: true\n }}\n onPreview={(file) => console.log(file)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\n ]}\n onChange={(items) => console.log(items)}\n >\n <Icon type=\"plus\" />\n </FileInput>\n <br />\n <FileInput\n uploadType=\"card\"\n size=\"small\"\n showFileIcon={{\n showPreviewIcon: false,\n showRemoveIcon: true\n }}\n onPreview={(file) => console.log(file)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\n ]}\n onChange={(items) => console.log(items)}\n >\n <Icon type=\"plus\" />\n </FileInput>\n </div>\n )\n}\n\nReactDOM.render(\n <Demo />,\n _mount_\n);\n```\n\n### \u56fe\u7247\u9884\u89c8\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { FileInput, Overlay } from 'uiw';\n\nconst Demo=()=>{\n const [visible,visibleSet]=React.useState(false)\n const [curfile,curFileSet]=React.useState(null)\n console.log('curfile',curfile)\n\n return(\n <>\n <Overlay\n isOpen={visible}\n onClosed={()=>visibleSet(false)}\n >\n <img src={`${curfile?.dataURL}`} alt={`${curfile?.name}`} />\n </Overlay>\n <FileInput\n uploadType=\"picture\"\n size=\"large\"\n onPreview={(file) =>{\n visibleSet(true)\n curFileSet(file)\n }}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Icon type=\"plus\" />\n </FileInput>\n </>\n )\n}\n\nReactDOM.render(<Demo/> ,_mount_\n);\n```\n\n### \u56fe\u7247\u5217\u8868\u6837\u5f0f\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { FileInput, Button } from 'uiw';\n\nReactDOM.render(\n <div>\n <FileInput\n uploadType=\"picture\"\n size=\"large\"\n onPreview={() => console.log(234)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Button>\u65b0\u589e</Button>\n </FileInput>\n <br />\n <FileInput\n uploadType=\"picture\"\n shape=\"circle\"\n onPreview={() => console.log(234)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Button>\u65b0\u589e</Button>\n </FileInput>\n <br />\n <FileInput\n uploadType=\"picture\"\n size=\"small\"\n onPreview={() => console.log(234)}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Button>\u65b0\u589e</Button>\n </FileInput>\n <br />\n <FileInput\n uploadType=\"text\"\n multiple\n maxNumber={2}\n value={[\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\n ]}\n >\n <Button>\u65b0\u589e</Button>\n </FileInput>\n </div>,\n _mount_\n);\n```\n\n### \u5728`Form`\u8868\u5355\u4e2d\u4f7f\u7528\n\n\x3c!--rehype:bgWhite=true&codeSandbox=true&codePen=true--\x3e\n```jsx\nimport ReactDOM from 'react-dom';\nimport { Form, Row, Col, Icon } from 'uiw';\n\nReactDOM.render(\n <div>\n <Form\n onSubmit={({initial, current}) => {\n console.log('current',current)\n }}\n fields={{\n picture1: {\n label: '\u56fe\u7247\u5899',\n initialValue: [\n {\n dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png'\n }\n ],\n children: (\n <FileInput uploadType=\"card\">\n <Icon type=\"plus\" />\n </FileInput>\n )\n },\n picture2: {\n label: '\u56fe\u7247\u5217\u8868',\n initialValue: [\n {\n dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png'\n }\n ],\n children: (\n <FileInput uploadType=\"picture\">\n <Button>\u65b0\u589e</Button>\n </FileInput>\n )\n },\n picture3: {\n label: '\u56fe\u7247\u540d\u79f0\u5217\u8868',\n children: (\n <FileInput uploadType=\"text\">\n <Button>\u65b0\u589e</Button>\n </FileInput>\n )\n },\n }}>\n {({ fields, state, canSubmit }) => {\n return (\n <div>\n <Row>\n <Col>{fields.picture1}</Col>\n </Row>\n <Row>\n <Col>{fields.picture2}</Col>\n </Row>\n <Row>\n <Col>{fields.picture3}</Col>\n </Row>\n <Row gutter={10}>\n <Col>\n <Button disabled={!canSubmit()} type=\"primary\" htmlType=\"submit\">\u63d0\u4ea4</Button>\n </Col>\n </Row>\n <Row>\n <Col>\n <pre style={{ padding: '10px 0 0 10px' }}>\n {JSON.stringify(state.current, null, 2)}\n </pre>\n </Col>\n </Row>\n </div>\n )\n }}\n </Form>\n </div>,\n _mount_\n);\n```\n\n## Props\n\n- `uploadType: input` \u57fa\u7840\u8f93\u5165\u6846\u4e0a\u4f20\n\n- `uploadType: picture` \u56fe\u7247\u5217\u5c55\u793a\u5217\u8868\uff0c\u663e\u793a\u56fe\u7247\n\n- `uploadType: text` \u56fe\u7247\u5217\u5c55\u793a\u5217\u8868\uff0c\u4e0d\u663e\u793a\u56fe\u7247\n\n- `uploadType: card` \u56fe\u7247\u5899\u5217\u8868\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| uploadType | \u4e0a\u4f20\u5c55\u793a\u7c7b\u578b | `input`\u3001`picture`\u3001`text`\u3001`card` | `input` |\n| className | CSS\u7c7b\u540d\u79f0 | String | - |\n| multiple | \u662f\u5426\u591a\u9009\u4e0a\u4f20 | boolean | - |\n\n\n### Props uploadType input\u7c7b\u578b\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| dataLabel | input \u540e\u7f6e\u6587\u5b57 | `string` | `Browse` |\n\n\u66f4\u591a\u5c5e\u6027\u6587\u6863\u8bf7\u53c2\u8003 [Input](#/components/input)\u3002\n\n\n### Props uploadType \u975einput\u7c7b\u578b\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| value | \u9ed8\u8ba4\u56fe\u7247\u5217\u8868 | FileInputValue[] | - |\n| readonly | \u662f\u5426\u662f\u53ea\u8bfb\u6a21\u5f0f | boolean | false |\n| maxNumber | \u6587\u4ef6\u4e0a\u4f20\u6570\u91cf | boolean | false |\n| shape | \u56fe\u7247\u5c55\u793a\u5f62\u72b6 | `circle`\u3001`round` | `round` |\n| size | \u56fe\u7247\u5c55\u793a\u5927\u5c0f | `large`\u3001`middle`\u3001`small` | `middle` |\n| showFileIcon | \u8bbe\u7f6e\u56fe\u6807\u6309\u94ae\u662f\u5426\u5c55\u793a | {showPreviewIcon?: boolean,showRemoveIcon?: boolean} | {showPreviewIcon: true, showRemoveIcon: true} |\n| onChange | \u6587\u4ef6\u4e0a\u4f20\u56de\u8c03 | (value: FileInputValue[]) => void | - |\n| onPreview | \u9884\u89c8\u56fe\u6807\u65f6\u7684\u56de\u8c03 | (value: FileInputValue[]) => void | - |\n\n"}}]);
2
+ //# sourceMappingURL=8768.5facbb82.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/js/8768.2b6b6aab.chunk.js","mappings":"gHAAA","sources":["../../packages/react-file-input/README.md"],"sourcesContent":["export default \"FileInput 上传输入框\\n===\\n\\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-file-input/file/README.md)\\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-file-input.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-file-input)\\n[![npm version](https://img.shields.io/npm/v/@uiw/react-file-input.svg?label=@uiw/react-file-input)](https://npmjs.com/@uiw/react-file-input)\\n\\n这个组件仅仅是对 `<input type=\\\"file\\\">` 的美化,他是基于 Input 组件封装 。\\n\\n```jsx\\nimport { FileInput } from 'uiw';\\n// or\\nimport FileInput from '@uiw/react-file-input';\\n```\\n\\n### 基础用法\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { FileInput, Button } from 'uiw';\\n\\nconst Demo = () => {\\n const onChange = (e) => {\\n console.log(e)\\n }\\n return (\\n <div>\\n <FileInput multiple=\\\"multiple\\\" style={{ maxWidth: 200 }} size=\\\"small\\\" onChange={onChange} />\\n <br />\\n <FileInput multiple=\\\"multiple\\\" style={{ maxWidth: 200 }} />\\n <br />\\n </div>\\n )\\n}\\n\\nReactDOM.render(\\n <Demo />,\\n _mount_\\n);\\n```\\n\\n### 图片墙\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { FileInput, Button } from 'uiw';\\n\\nconst Demo = () => {\\n return (\\n <div>\\n <FileInput\\n uploadType=\\\"card\\\"\\n size=\\\"large\\\"\\n showFileIcon={{\\n showPreviewIcon: false,\\n showRemoveIcon: true\\n }}\\n onPreview={(file) => console.log(file)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\\n ]}\\n onChange={(items) => console.log(items)}\\n >\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"card\\\"\\n shape=\\\"circle\\\"\\n showFileIcon={{\\n showPreviewIcon: false,\\n showRemoveIcon: true\\n }}\\n onPreview={(file) => console.log(file)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\\n ]}\\n onChange={(items) => console.log(items)}\\n >\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"card\\\"\\n size=\\\"small\\\"\\n showFileIcon={{\\n showPreviewIcon: false,\\n showRemoveIcon: true\\n }}\\n onPreview={(file) => console.log(file)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\\n ]}\\n onChange={(items) => console.log(items)}\\n >\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n </div>\\n )\\n}\\n\\nReactDOM.render(\\n <Demo />,\\n _mount_\\n);\\n```\\n\\n### 图片预览\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport React from 'react';\\nimport ReactDOM from 'react-dom';\\nimport { FileInput, Overlay } from 'uiw';\\n\\nconst Demo=()=>{\\n const [visible,visibleSet]=React.useState(false)\\n const [curfile,curFileSet]=React.useState(null)\\n console.log('curfile',curfile)\\n\\n return(\\n <>\\n <Overlay\\n isOpen={visible}\\n onClosed={()=>visibleSet(false)}\\n >\\n <img src={`${curfile?.dataURL}`} alt={`${curfile?.name}`} />\\n </Overlay>\\n <FileInput\\n uploadType=\\\"picture\\\"\\n size=\\\"large\\\"\\n onPreview={(file) =>{\\n visibleSet(true)\\n curFileSet(file)\\n }}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n </>\\n )\\n}\\n\\nReactDOM.render(<Demo/> ,_mount_\\n);\\n```\\n\\n### 图片列表样式\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { FileInput, Button } from 'uiw';\\n\\nReactDOM.render(\\n <div>\\n <FileInput\\n uploadType=\\\"picture\\\"\\n size=\\\"large\\\"\\n onPreview={() => console.log(234)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Button>新增</Button>\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"picture\\\"\\n shape=\\\"circle\\\"\\n onPreview={() => console.log(234)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Button>新增</Button>\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"picture\\\"\\n size=\\\"small\\\"\\n onPreview={() => console.log(234)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Button>新增</Button>\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"text\\\"\\n multiple\\n maxNumber={2}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Button>新增</Button>\\n </FileInput>\\n </div>,\\n _mount_\\n);\\n```\\n\\n### 在`Form`表单中使用\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Row, Col, Icon } from 'uiw';\\n\\nReactDOM.render(\\n <div>\\n <Form\\n fields={{\\n picture1: {\\n label: '图片墙',\\n initialValue: [\\n {\\n dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png'\\n }\\n ],\\n children: (\\n <FileInput uploadType=\\\"card\\\">\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n )\\n },\\n picture2: {\\n label: '图片列表',\\n initialValue: [\\n {\\n dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png'\\n }\\n ],\\n children: (\\n <FileInput uploadType=\\\"picture\\\">\\n <Button>新增</Button>\\n </FileInput>\\n )\\n },\\n picture3: {\\n label: '图片名称列表',\\n children: (\\n <FileInput uploadType=\\\"text\\\">\\n <Button>新增</Button>\\n </FileInput>\\n )\\n },\\n }}>\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row>\\n <Col>{fields.picture1}</Col>\\n </Row>\\n <Row>\\n <Col>{fields.picture2}</Col>\\n </Row>\\n <Row>\\n <Col>{fields.picture3}</Col>\\n </Row>\\n <Row>\\n <Col>\\n <pre style={{ padding: '10px 0 0 10px' }}>\\n {JSON.stringify(state.current, null, 2)}\\n </pre>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>,\\n _mount_\\n);\\n```\\n\\n## Props\\n\\n- `uploadType: input` 基础输入框上传\\n\\n- `uploadType: picture` 图片列展示列表,显示图片\\n\\n- `uploadType: text` 图片列展示列表,不显示图片\\n\\n- `uploadType: card` 图片墙列表\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| uploadType | 上传展示类型 | `input`、`picture`、`text`、`card` | `input` |\\n| className | CSS类名称 | String | - |\\n| multiple | 是否多选上传 | boolean | - |\\n\\n\\n### Props uploadType input类型\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| dataLabel | input 后置文字 | `string` | `Browse` |\\n\\n更多属性文档请参考 [Input](#/components/input)。\\n\\n\\n### Props uploadType 非input类型\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| value | 默认图片列表 | FileInputValue[] | - |\\n| readonly | 是否是只读模式 | boolean | false |\\n| maxNumber | 文件上传数量 | boolean | false |\\n| shape | 图片展示形状 | `circle`、`round` | `round` |\\n| size | 图片展示大小 | `large`、`middle`、`small` | `middle` |\\n| showFileIcon | 设置图标按钮是否展示 | {showPreviewIcon?: boolean,showRemoveIcon?: boolean} | {showPreviewIcon: true, showRemoveIcon: true} |\\n| onChange | 文件上传回调 | (value: FileInputValue[]) => void | - |\\n| onPreview | 预览图标时的回调 | (value: FileInputValue[]) => void | - |\\n\\n\";"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"static/js/8768.5facbb82.chunk.js","mappings":"gHAAA","sources":["../../packages/react-file-input/README.md"],"sourcesContent":["export default \"FileInput 上传输入框\\n===\\n\\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-file-input/file/README.md)\\n[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-file-input.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-file-input)\\n[![npm version](https://img.shields.io/npm/v/@uiw/react-file-input.svg?label=@uiw/react-file-input)](https://npmjs.com/@uiw/react-file-input)\\n\\n这个组件仅仅是对 `<input type=\\\"file\\\">` 的美化,他是基于 Input 组件封装 。\\n\\n```jsx\\nimport { FileInput } from 'uiw';\\n// or\\nimport FileInput from '@uiw/react-file-input';\\n```\\n\\n### 基础用法\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { FileInput, Button } from 'uiw';\\n\\nconst Demo = () => {\\n const onChange = (e) => {\\n console.log(e)\\n }\\n return (\\n <div>\\n <FileInput multiple=\\\"multiple\\\" style={{ maxWidth: 200 }} size=\\\"small\\\" onChange={onChange} />\\n <br />\\n <FileInput multiple=\\\"multiple\\\" style={{ maxWidth: 200 }} />\\n <br />\\n </div>\\n )\\n}\\n\\nReactDOM.render(\\n <Demo />,\\n _mount_\\n);\\n```\\n\\n### 图片墙\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { FileInput, Button } from 'uiw';\\n\\nconst Demo = () => {\\n return (\\n <div>\\n <FileInput\\n uploadType=\\\"card\\\"\\n size=\\\"large\\\"\\n showFileIcon={{\\n showPreviewIcon: false,\\n showRemoveIcon: true\\n }}\\n onPreview={(file) => console.log(file)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\\n ]}\\n onChange={(items) => console.log(items)}\\n >\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"card\\\"\\n shape=\\\"circle\\\"\\n showFileIcon={{\\n showPreviewIcon: false,\\n showRemoveIcon: true\\n }}\\n onPreview={(file) => console.log(file)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\\n ]}\\n onChange={(items) => console.log(items)}\\n >\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"card\\\"\\n size=\\\"small\\\"\\n showFileIcon={{\\n showPreviewIcon: false,\\n showRemoveIcon: true\\n }}\\n onPreview={(file) => console.log(file)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4'}\\n ]}\\n onChange={(items) => console.log(items)}\\n >\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n </div>\\n )\\n}\\n\\nReactDOM.render(\\n <Demo />,\\n _mount_\\n);\\n```\\n\\n### 图片预览\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport React from 'react';\\nimport ReactDOM from 'react-dom';\\nimport { FileInput, Overlay } from 'uiw';\\n\\nconst Demo=()=>{\\n const [visible,visibleSet]=React.useState(false)\\n const [curfile,curFileSet]=React.useState(null)\\n console.log('curfile',curfile)\\n\\n return(\\n <>\\n <Overlay\\n isOpen={visible}\\n onClosed={()=>visibleSet(false)}\\n >\\n <img src={`${curfile?.dataURL}`} alt={`${curfile?.name}`} />\\n </Overlay>\\n <FileInput\\n uploadType=\\\"picture\\\"\\n size=\\\"large\\\"\\n onPreview={(file) =>{\\n visibleSet(true)\\n curFileSet(file)\\n }}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n </>\\n )\\n}\\n\\nReactDOM.render(<Demo/> ,_mount_\\n);\\n```\\n\\n### 图片列表样式\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { FileInput, Button } from 'uiw';\\n\\nReactDOM.render(\\n <div>\\n <FileInput\\n uploadType=\\\"picture\\\"\\n size=\\\"large\\\"\\n onPreview={() => console.log(234)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Button>新增</Button>\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"picture\\\"\\n shape=\\\"circle\\\"\\n onPreview={() => console.log(234)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Button>新增</Button>\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"picture\\\"\\n size=\\\"small\\\"\\n onPreview={() => console.log(234)}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Button>新增</Button>\\n </FileInput>\\n <br />\\n <FileInput\\n uploadType=\\\"text\\\"\\n multiple\\n maxNumber={2}\\n value={[\\n { dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png' }\\n ]}\\n >\\n <Button>新增</Button>\\n </FileInput>\\n </div>,\\n _mount_\\n);\\n```\\n\\n### 在`Form`表单中使用\\n\\n<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->\\n```jsx\\nimport ReactDOM from 'react-dom';\\nimport { Form, Row, Col, Icon } from 'uiw';\\n\\nReactDOM.render(\\n <div>\\n <Form\\n onSubmit={({initial, current}) => {\\n console.log('current',current)\\n }}\\n fields={{\\n picture1: {\\n label: '图片墙',\\n initialValue: [\\n {\\n dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png'\\n }\\n ],\\n children: (\\n <FileInput uploadType=\\\"card\\\">\\n <Icon type=\\\"plus\\\" />\\n </FileInput>\\n )\\n },\\n picture2: {\\n label: '图片列表',\\n initialValue: [\\n {\\n dataURL: 'https://avatars2.githubusercontent.com/u/1680273?s=40&v=4', name: 'uiw.png'\\n }\\n ],\\n children: (\\n <FileInput uploadType=\\\"picture\\\">\\n <Button>新增</Button>\\n </FileInput>\\n )\\n },\\n picture3: {\\n label: '图片名称列表',\\n children: (\\n <FileInput uploadType=\\\"text\\\">\\n <Button>新增</Button>\\n </FileInput>\\n )\\n },\\n }}>\\n {({ fields, state, canSubmit }) => {\\n return (\\n <div>\\n <Row>\\n <Col>{fields.picture1}</Col>\\n </Row>\\n <Row>\\n <Col>{fields.picture2}</Col>\\n </Row>\\n <Row>\\n <Col>{fields.picture3}</Col>\\n </Row>\\n <Row gutter={10}>\\n <Col>\\n <Button disabled={!canSubmit()} type=\\\"primary\\\" htmlType=\\\"submit\\\">提交</Button>\\n </Col>\\n </Row>\\n <Row>\\n <Col>\\n <pre style={{ padding: '10px 0 0 10px' }}>\\n {JSON.stringify(state.current, null, 2)}\\n </pre>\\n </Col>\\n </Row>\\n </div>\\n )\\n }}\\n </Form>\\n </div>,\\n _mount_\\n);\\n```\\n\\n## Props\\n\\n- `uploadType: input` 基础输入框上传\\n\\n- `uploadType: picture` 图片列展示列表,显示图片\\n\\n- `uploadType: text` 图片列展示列表,不显示图片\\n\\n- `uploadType: card` 图片墙列表\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| uploadType | 上传展示类型 | `input`、`picture`、`text`、`card` | `input` |\\n| className | CSS类名称 | String | - |\\n| multiple | 是否多选上传 | boolean | - |\\n\\n\\n### Props uploadType input类型\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| dataLabel | input 后置文字 | `string` | `Browse` |\\n\\n更多属性文档请参考 [Input](#/components/input)。\\n\\n\\n### Props uploadType 非input类型\\n\\n| 参数 | 说明 | 类型 | 默认值 |\\n|--------- |-------- |--------- |-------- |\\n| value | 默认图片列表 | FileInputValue[] | - |\\n| readonly | 是否是只读模式 | boolean | false |\\n| maxNumber | 文件上传数量 | boolean | false |\\n| shape | 图片展示形状 | `circle`、`round` | `round` |\\n| size | 图片展示大小 | `large`、`middle`、`small` | `middle` |\\n| showFileIcon | 设置图标按钮是否展示 | {showPreviewIcon?: boolean,showRemoveIcon?: boolean} | {showPreviewIcon: true, showRemoveIcon: true} |\\n| onChange | 文件上传回调 | (value: FileInputValue[]) => void | - |\\n| onPreview | 预览图标时的回调 | (value: FileInputValue[]) => void | - |\\n\\n\";"],"names":[],"sourceRoot":""}