taro-react-uilib 1.4.21-1 → 1.4.21

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.
@@ -1,2 +1,2 @@
1
- import e from"react";import{View as s,Image as t}from"@tarojs/components";import c from"classnames";import r from"../Button/index.js";var l={success:"https://s.xh1.cn/resources/images/public/success.png",empty:"https://s.xh1.cn/resources/images/public/empty.png",fail:"https://s.xh1.cn/resources/images/public/failure.png",networkErr:"https://s.xh1.cn/resources/images/public/error.png",wait:"https://s.xh1.cn/resources/images/public/ing.png",submitted:"https://s.xh1.cn/resources/images/public/success-info.png"},a=function(a){var n=a.className,m=a.status,o=a.title,u=a.desc,i=a.slot,p=a.action,h=a.onAction,x=a.full,g=c("xh-result",n,{full:void 0===x||x});return e.createElement(s,{className:g},"h5"===process.env.TARO_ENV?e.createElement("img",{src:l[m],alt:"",className:"xh-result-status"}):e.createElement(t,{src:l[m],className:"xh-result-status"}),e.createElement(s,{className:"xh-result-title"},o),e.createElement(s,{className:"xh-result-desc"},u),e.createElement(s,{className:"xh-result-slot"},i),p&&e.createElement(s,{className:c("xh-result-action",{hasSlot:i})},e.createElement(r,{onClick:function(){null==h||h()},hollow:!0,size:"full"},p)))};export{a as default};
1
+ import e from"react";import{View as s,Image as t}from"@tarojs/components";import c from"classnames";import r from"../Button/index.js";var a={success:"https://s.xh1.cn/resources/images/public/success.png",empty:"https://s.xh1.cn/resources/images/public/empty.png",fail:"https://s.xh1.cn/resources/images/public/failure.png",networkErr:"https://s.xh1.cn/resources/images/public/error.png",wait:"https://s.xh1.cn/resources/images/public/ing.png",submitted:"https://s.xh1.cn/resources/images/public/success-info.png",faceEmpty:"https://s.xh1.cn/resources/images/public/faceEmpty.png"},l=function(l){var n=l.className,m=l.status,u=l.title,o=l.desc,i=l.slot,p=l.action,h=l.onAction,g=l.full,x=c("xh-result",n,{full:void 0===g||g});return e.createElement(s,{className:x},"h5"===process.env.TARO_ENV?e.createElement("img",{src:a[m],alt:"",className:"xh-result-status"}):e.createElement(t,{src:a[m],className:"xh-result-status"}),e.createElement(s,{className:"xh-result-title"},u),e.createElement(s,{className:"xh-result-desc"},o),e.createElement(s,{className:"xh-result-slot"},i),p&&e.createElement(s,{className:c("xh-result-action",{hasSlot:i})},e.createElement(r,{onClick:function(){null==h||h()},hollow:!0,size:"full"},p)))};export{l as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Result/index.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport { Image, View } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport Button from \"../Button\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport \"./index.scss\";\n\nconst ImageMap = {\n success: \"https://s.xh1.cn/resources/images/public/success.png\",\n empty: \"https://s.xh1.cn/resources/images/public/empty.png\",\n fail: \"https://s.xh1.cn/resources/images/public/failure.png\",\n networkErr: \"https://s.xh1.cn/resources/images/public/error.png\",\n wait: \"https://s.xh1.cn/resources/images/public/ing.png\",\n submitted: \"https://s.xh1.cn/resources/images/public/success-info.png\",\n};\n\nexport type ResultStatus = keyof typeof ImageMap;\n\nexport type ResultProps = {\n status: ResultStatus;\n title: ReactNode;\n desc?: ReactNode;\n slot?: ReactNode;\n action?: string;\n full?: boolean;\n onAction?: () => void;\n} & XHComponentCommonProps;\n\nconst Result: React.FC<ResultProps> = props => {\n const {\n className,\n status,\n title,\n desc,\n slot,\n action,\n onAction,\n full = true,\n } = props;\n\n const resultCls = classNames(\"xh-result\", className, { full });\n\n const renderImage = () => {\n if (process.env.TARO_ENV === \"h5\") {\n return <img src={ImageMap[status]} alt=\"\" className=\"xh-result-status\" />;\n } else {\n return <Image src={ImageMap[status]} className=\"xh-result-status\" />;\n }\n };\n\n const handleAction = () => {\n onAction?.();\n };\n\n return (\n <View className={resultCls}>\n {renderImage()}\n <View className=\"xh-result-title\">{title}</View>\n <View className=\"xh-result-desc\">{desc}</View>\n <View className=\"xh-result-slot\">{slot}</View>\n {action && (\n <View className={classNames(\"xh-result-action\", { hasSlot: slot })}>\n <Button onClick={handleAction} hollow size=\"full\">\n {action}\n </Button>\n </View>\n )}\n </View>\n );\n};\n\nexport default Result;\n"],"names":["ImageMap","success","empty","fail","networkErr","wait","submitted","Result","props","className","status","title","desc","slot","action","onAction","_a","full","resultCls","classNames","React","createElement","View","process","env","TARO_ENV","src","alt","Image","hasSlot","Button","onClick","hollow","size"],"mappings":"sIAOA,IAAMA,EAAW,CACfC,QAAS,uDACTC,MAAO,qDACPC,KAAM,uDACNC,WAAY,qDACZC,KAAM,mDACNC,UAAW,6DAePC,EAAgC,SAAAC,GAElC,IAAAC,EAQED,YAPFE,EAOEF,EAAKE,OANPC,EAMEH,EANGG,MACLC,EAKEJ,OAJFK,EAIEL,EAAKK,KAHPC,EAGEN,EAHIM,OACNC,EAEEP,WADFQ,EACER,EADSS,KAGPC,EAAYC,EAAW,YAAaV,EAAW,CAAEQ,UAH9C,IAAAD,OAiBT,OACEI,EAACC,cAAAC,EAAK,CAAAb,UAAWS,GAZY,OAAzBK,QAAQC,IAAIC,SACPL,uBAAKM,IAAK1B,EAASU,GAASiB,IAAI,GAAGlB,UAAU,qBAE7CW,EAACC,cAAAO,EAAM,CAAAF,IAAK1B,EAASU,GAASD,UAAU,qBAW/CW,EAAAC,cAACC,EAAK,CAAAb,UAAU,mBAAmBE,GACnCS,EAAAC,cAACC,EAAK,CAAAb,UAAU,kBAAkBG,GAClCQ,EAAAC,cAACC,EAAK,CAAAb,UAAU,kBAAkBI,GACjCC,GACCM,EAAAC,cAACC,EAAI,CAACb,UAAWU,EAAW,mBAAoB,CAAEU,QAAShB,KACzDO,EAAAC,cAACS,EAAO,CAAAC,QAZK,WACnBhB,SAAAA,GACF,EAUuCiB,QAAO,EAAAC,KAAK,QACxCnB,IAMb"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Result/index.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport { Image, View } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport Button from \"../Button\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport \"./index.scss\";\n\nconst ImageMap = {\n success: \"https://s.xh1.cn/resources/images/public/success.png\",\n empty: \"https://s.xh1.cn/resources/images/public/empty.png\",\n fail: \"https://s.xh1.cn/resources/images/public/failure.png\",\n networkErr: \"https://s.xh1.cn/resources/images/public/error.png\",\n wait: \"https://s.xh1.cn/resources/images/public/ing.png\",\n submitted: \"https://s.xh1.cn/resources/images/public/success-info.png\",\n faceEmpty: \"https://s.xh1.cn/resources/images/public/faceEmpty.png\",\n};\n\nexport type ResultStatus = keyof typeof ImageMap;\n\nexport type ResultProps = {\n status: ResultStatus;\n title: ReactNode;\n desc?: ReactNode;\n slot?: ReactNode;\n action?: string;\n full?: boolean;\n onAction?: () => void;\n} & XHComponentCommonProps;\n\nconst Result: React.FC<ResultProps> = props => {\n const {\n className,\n status,\n title,\n desc,\n slot,\n action,\n onAction,\n full = true,\n } = props;\n\n const resultCls = classNames(\"xh-result\", className, { full });\n\n const renderImage = () => {\n if (process.env.TARO_ENV === \"h5\") {\n return <img src={ImageMap[status]} alt=\"\" className=\"xh-result-status\" />;\n } else {\n return <Image src={ImageMap[status]} className=\"xh-result-status\" />;\n }\n };\n\n const handleAction = () => {\n onAction?.();\n };\n\n return (\n <View className={resultCls}>\n {renderImage()}\n <View className=\"xh-result-title\">{title}</View>\n <View className=\"xh-result-desc\">{desc}</View>\n <View className=\"xh-result-slot\">{slot}</View>\n {action && (\n <View className={classNames(\"xh-result-action\", { hasSlot: slot })}>\n <Button onClick={handleAction} hollow size=\"full\">\n {action}\n </Button>\n </View>\n )}\n </View>\n );\n};\n\nexport default Result;\n"],"names":["ImageMap","success","empty","fail","networkErr","wait","submitted","faceEmpty","Result","props","className","status","title","desc","slot","action","onAction","_a","full","resultCls","classNames","React","createElement","View","process","env","TARO_ENV","src","alt","Image","hasSlot","Button","onClick","hollow","size"],"mappings":"sIAOA,IAAMA,EAAW,CACfC,QAAS,uDACTC,MAAO,qDACPC,KAAM,uDACNC,WAAY,qDACZC,KAAM,mDACNC,UAAW,4DACXC,UAAW,0DAePC,EAAgC,SAAAC,GAElC,IAAAC,EAQED,YAPFE,EAOEF,EAAKE,OANPC,EAMEH,EANGG,MACLC,EAKEJ,OAJFK,EAIEL,EAAKK,KAHPC,EAGEN,EAHIM,OACNC,EAEEP,WADFQ,EACER,EADSS,KAGPC,EAAYC,EAAW,YAAaV,EAAW,CAAEQ,UAH9C,IAAAD,OAiBT,OACEI,EAACC,cAAAC,EAAK,CAAAb,UAAWS,GAZY,OAAzBK,QAAQC,IAAIC,SACPL,uBAAKM,IAAK3B,EAASW,GAASiB,IAAI,GAAGlB,UAAU,qBAE7CW,EAACC,cAAAO,EAAM,CAAAF,IAAK3B,EAASW,GAASD,UAAU,qBAW/CW,EAAAC,cAACC,EAAK,CAAAb,UAAU,mBAAmBE,GACnCS,EAAAC,cAACC,EAAK,CAAAb,UAAU,kBAAkBG,GAClCQ,EAAAC,cAACC,EAAK,CAAAb,UAAU,kBAAkBI,GACjCC,GACCM,EAAAC,cAACC,EAAI,CAACb,UAAWU,EAAW,mBAAoB,CAAEU,QAAShB,KACzDO,EAAAC,cAACS,EAAO,CAAAC,QAZK,WACnBhB,SAAAA,GACF,EAUuCiB,QAAO,EAAAC,KAAK,QACxCnB,IAMb"}