taro-react-uilib 1.4.6 → 1.4.7-0

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{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as o,useState as n,useImperativeHandle as r,useEffect as a}from"react";import s from"classnames";import{View as c}from"@tarojs/components";import i from"../Button/index.js";import l from"../Mask/index.js";import m from"../node_modules/react-transition-group/esm/CSSTransition.js";var f=o((function(o,f){var d=o.header,p=o.content,u=o.className,h=void 0===u?"":u,v=o.visible,g=o.showCancel,x=void 0===g||g,E=o.confirmText,N=void 0===E?"确定":E,C=o.cancelText,b=void 0===C?"取消":C,j=o.footer,T=void 0!==j&&j,k=o.onConfirm,w=o.onCancel,y=o.onClose,z=o.portrait,S=void 0!==z&&z,_=o.tranparent,B=void 0!==_&&_,M=e(n(!1),2),q=M[0],A=M[1];r(f,(function(){return{close:D,open:F}}));var D=function(){y&&y(),A(!1)},F=function(){A(!0)};a((function(){v||y&&y(),A(v)}),[v]);var G=s("xh-dialog-ref",h,{show:q}),H=t.createElement(c,{className:s("xh-dialog-ref-content-footer-buttons",{portrait:S})},x&&t.createElement(i,{ghost:!0,size:"full",shape:"rectangle",preventTime:0,onClick:function(){w&&w(),D()},className:"xh-dialog-ref-content-footer-buttons-cancel"},b),t.createElement(i,{type:"primary",shape:"rectangle",size:"full",ghost:!0,className:"xh-dialog-ref-content-footer-buttons--confirm",onClick:function(){k&&k()},preventTime:0},N));return t.createElement(c,{className:G},t.createElement(l,null),t.createElement(m,{in:q,timeout:200,classNames:"scale"},t.createElement(c,{className:s("xh-dialog-ref-content",{tranparent:B})},d&&t.createElement(c,{className:"xh-dialog-ref-content-header"},d),t.createElement(c,{className:"xh-dialog-ref-content-content"},p),T||t.createElement(c,{className:"xh-dialog-ref-content-footer"},H))))}));export{f as default};
1
+ import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as o,useState as n,useImperativeHandle as a,useEffect as r}from"react";import c from"classnames";import{View as s}from"@tarojs/components";import i from"../Button/index.js";import l from"../Mask/index.js";import m from"../node_modules/react-transition-group/esm/CSSTransition.js";var f=o((function(o,f){var d=o.header,p=o.content,u=o.className,h=void 0===u?"":u,v=o.visible,g=o.showCancel,x=void 0===g||g,E=o.confirmText,N=void 0===E?"确定":E,C=o.cancelText,b=void 0===C?"取消":C,j=o.footer,T=void 0!==j&&j,y=o.onConfirm,k=o.onCancel,w=o.onClose,z=o.portrait,S=void 0!==z&&z,_=o.tranparent,B=void 0!==_&&_,M=o.fancy,q=void 0!==M&&M,A=e(n(!1),2),D=A[0],F=A[1];a(f,(function(){return{close:G,open:H}}));var G=function(){w&&w(),F(!1)},H=function(){F(!0)};r((function(){v||w&&w(),F(v)}),[v]);var I=c("xh-dialog-ref",h,{show:D}),J=t.createElement(s,{className:c("xh-dialog-ref-content-footer-buttons",{portrait:S,fancy:q})},x&&t.createElement(i,{ghost:!0,size:"full",shape:"rectangle",preventTime:0,onClick:function(){k&&k(),G()},className:"xh-dialog-ref-content-footer-buttons-cancel"},b),t.createElement(i,{type:"primary",shape:"rectangle",size:"full",ghost:!q,className:"xh-dialog-ref-content-footer-buttons-confirm",onClick:function(){y&&y()},preventTime:0},N));return t.createElement(s,{className:I},t.createElement(l,null),t.createElement(m,{in:D,timeout:200,classNames:"scale"},t.createElement(s,{className:c("xh-dialog-ref-content",{tranparent:B})},d&&t.createElement(s,{className:"xh-dialog-ref-content-header"},d),t.createElement(s,{className:"xh-dialog-ref-content-content"},p),T||t.createElement(s,{className:"xh-dialog-ref-content-footer"},J))))}));export{f as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/DialogRef/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useState,\n useImperativeHandle,\n forwardRef,\n useEffect,\n} from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\nimport Button from \"../Button\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport Mask from \"../Mask\";\nimport \"./index.scss\";\n\nexport type DialogProps = {\n header?: string | ReactNode;\n content: string | ReactNode;\n footer?: ReactNode;\n cancelText?: string;\n confirmText?: string;\n showCancel?: boolean;\n visible: boolean;\n onConfirm?: () => void;\n onCancel?: () => void;\n onClose?: () => void;\n tranparent?: boolean;\n portrait?: boolean;\n} & XHComponentCommonProps;\n\nexport type IDialogRef = {\n close: () => void;\n open: () => void;\n};\nconst DialogCom = forwardRef<IDialogRef, DialogProps>((props, fromRef) => {\n const {\n header,\n content,\n className = \"\",\n visible,\n showCancel = true,\n confirmText = \"确定\",\n cancelText = \"取消\",\n footer = false,\n onConfirm,\n onCancel,\n onClose,\n portrait = false,\n tranparent = false,\n } = props;\n const [selfVisible, setSelfVisible] = useState(false);\n\n useImperativeHandle(fromRef, () => ({\n close,\n open,\n }));\n\n const close = () => {\n onClose && onClose();\n setSelfVisible(false);\n };\n\n const open = () => {\n setSelfVisible(true);\n };\n\n const handleConfirm = () => {\n onConfirm && onConfirm();\n // close();\n };\n const handleCancel = () => {\n onCancel && onCancel();\n close();\n };\n\n useEffect(() => {\n if (!visible) {\n onClose && onClose();\n }\n setSelfVisible(visible);\n }, [visible]);\n\n const dialogcls = classNames(\"xh-dialog-ref\", className, {\n show: selfVisible,\n });\n\n const dialogFooter = (\n <View\n className={classNames(\"xh-dialog-ref-content-footer-buttons\", {\n portrait,\n })}\n >\n {showCancel && (\n <Button\n ghost\n size=\"full\"\n shape=\"rectangle\"\n preventTime={0}\n onClick={handleCancel}\n className=\"xh-dialog-ref-content-footer-buttons-cancel\"\n >\n {cancelText}\n </Button>\n )}\n <Button\n type=\"primary\"\n shape=\"rectangle\"\n size=\"full\"\n ghost\n className=\"xh-dialog-ref-content-footer-buttons--confirm\"\n onClick={handleConfirm}\n preventTime={0}\n >\n {confirmText}\n </Button>\n </View>\n );\n\n const DialogMain = (\n <View className={dialogcls}>\n <Mask />\n <CSSTransition in={selfVisible} timeout={200} classNames=\"scale\">\n <View className={classNames(\"xh-dialog-ref-content\", { tranparent })}>\n {header && (\n <View className=\"xh-dialog-ref-content-header\">{header}</View>\n )}\n <View className=\"xh-dialog-ref-content-content\">{content}</View>\n {footer || (\n <View className=\"xh-dialog-ref-content-footer\">{dialogFooter}</View>\n )}\n </View>\n </CSSTransition>\n </View>\n );\n return DialogMain;\n});\n\nexport default DialogCom;\n"],"names":["DialogCom","forwardRef","props","fromRef","header","content","_a","className","visible","_b","showCancel","_c","confirmText","_d","cancelText","_e","footer","onConfirm","onCancel","onClose","_f","portrait","_g","tranparent","_h","__read","useState","selfVisible","setSelfVisible","useImperativeHandle","close","open","useEffect","dialogcls","classNames","show","dialogFooter","React","createElement","View","Button","ghost","size","shape","preventTime","onClick","type","Mask","CSSTransition","in","timeout"],"mappings":"yWAkCA,IAAMA,EAAYC,GAAoC,SAACC,EAAOC,GAE1D,IAAAC,EAaEF,EAAKE,OAZPC,EAYEH,EAZKG,QACPC,EAWEJ,EAAKK,UAXPA,OAAS,IAAAD,EAAG,GAAEA,EACdE,EAUEN,UATFO,EASEP,EATeQ,WAAjBA,OAAa,IAAAD,KACbE,EAQET,EARgBU,YAAlBA,OAAc,IAAAD,EAAA,OACdE,EAOEX,EAPeY,WAAjBA,OAAa,IAAAD,EAAA,OACbE,EAMEb,EANYc,OAAdA,OAAS,IAAAD,KACTE,EAKEf,EAAKe,UAJPC,EAIEhB,EAJMgB,SACRC,EAGEjB,UAFFkB,EAEElB,EAFcmB,SAAhBA,OAAW,IAAAD,KACXE,EACEpB,EADgBqB,WAAlBA,OAAa,IAAAD,KAETE,EAAAC,EAAgCC,GAAS,GAAM,GAA9CC,EAAWH,EAAA,GAAEI,OAEpBC,EAAoB1B,GAAS,WAAM,MAAC,CAClC2B,MAAKA,EACLC,KAAIA,EACJ,IAEF,IAAMD,EAAQ,WACZX,GAAWA,IACXS,GAAe,EACjB,EAEMG,EAAO,WACXH,GAAe,EACjB,EAWAI,GAAU,WACHxB,GACHW,GAAWA,IAEbS,EAAepB,EACjB,GAAG,CAACA,IAEJ,IAAMyB,EAAYC,EAAW,gBAAiB3B,EAAW,CACvD4B,KAAMR,IAGFS,EACJC,EAACC,cAAAC,EACC,CAAAhC,UAAW2B,EAAW,uCAAwC,CAC5Db,SAAQA,KAGTX,GACC2B,EAACC,cAAAE,EACC,CAAAC,OACA,EAAAC,KAAK,OACLC,MAAM,YACNC,YAAa,EACbC,QA5Ba,WACnB3B,GAAYA,IACZY,GACF,EA0BQvB,UAAU,+CAETO,GAGLuB,EAAAC,cAACE,EAAM,CACLM,KAAK,UACLH,MAAM,YACND,KAAK,OACLD,OAAK,EACLlC,UAAU,gDACVsC,QA5CgB,WACpB5B,GAAaA,GAEf,EA0CM2B,YAAa,GAEZhC,IAqBP,OAfEyB,EAAAC,cAACC,EAAK,CAAAhC,UAAW0B,GACfI,EAAAC,cAACS,EAAO,MACRV,EAAAC,cAACU,EAAa,CAACC,GAAItB,EAAauB,QAAS,IAAKhB,WAAW,SACvDG,EAAAC,cAACC,EAAI,CAAChC,UAAW2B,EAAW,wBAAyB,CAAEX,WAAUA,KAC9DnB,GACCiC,EAAAC,cAACC,EAAI,CAAChC,UAAU,gCAAgCH,GAElDiC,EAAAC,cAACC,EAAK,CAAAhC,UAAU,iCAAiCF,GAChDW,GACCqB,EAAAC,cAACC,EAAI,CAAChC,UAAU,gCAAgC6B,KAO5D"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/DialogRef/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useState,\n useImperativeHandle,\n forwardRef,\n useEffect,\n} from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\nimport Button from \"../Button\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport Mask from \"../Mask\";\nimport \"./index.scss\";\n\nexport type DialogProps = {\n header?: string | ReactNode;\n content: string | ReactNode;\n footer?: ReactNode;\n cancelText?: string;\n confirmText?: string;\n showCancel?: boolean;\n visible: boolean;\n onConfirm?: () => void;\n onCancel?: () => void;\n onClose?: () => void;\n tranparent?: boolean;\n portrait?: boolean;\n fancy?: boolean;\n} & XHComponentCommonProps;\n\nexport type IDialogRef = {\n close: () => void;\n open: () => void;\n};\nconst DialogCom = forwardRef<IDialogRef, DialogProps>((props, fromRef) => {\n const {\n header,\n content,\n className = \"\",\n visible,\n showCancel = true,\n confirmText = \"确定\",\n cancelText = \"取消\",\n footer = false,\n onConfirm,\n onCancel,\n onClose,\n portrait = false,\n tranparent = false,\n fancy = false,\n } = props;\n const [selfVisible, setSelfVisible] = useState(false);\n\n useImperativeHandle(fromRef, () => ({\n close,\n open,\n }));\n\n const close = () => {\n onClose && onClose();\n setSelfVisible(false);\n };\n\n const open = () => {\n setSelfVisible(true);\n };\n\n const handleConfirm = () => {\n onConfirm && onConfirm();\n // close();\n };\n const handleCancel = () => {\n onCancel && onCancel();\n close();\n };\n\n useEffect(() => {\n if (!visible) {\n onClose && onClose();\n }\n setSelfVisible(visible);\n }, [visible]);\n\n const dialogcls = classNames(\"xh-dialog-ref\", className, {\n show: selfVisible,\n });\n\n const dialogFooter = (\n <View\n className={classNames(\"xh-dialog-ref-content-footer-buttons\", {\n portrait,\n fancy,\n })}\n >\n {showCancel && (\n <Button\n ghost\n size=\"full\"\n shape=\"rectangle\"\n preventTime={0}\n onClick={handleCancel}\n className=\"xh-dialog-ref-content-footer-buttons-cancel\"\n >\n {cancelText}\n </Button>\n )}\n <Button\n type=\"primary\"\n shape=\"rectangle\"\n size=\"full\"\n ghost={!fancy}\n className=\"xh-dialog-ref-content-footer-buttons-confirm\"\n onClick={handleConfirm}\n preventTime={0}\n >\n {confirmText}\n </Button>\n </View>\n );\n\n const DialogMain = (\n <View className={dialogcls}>\n <Mask />\n <CSSTransition in={selfVisible} timeout={200} classNames=\"scale\">\n <View className={classNames(\"xh-dialog-ref-content\", { tranparent })}>\n {header && (\n <View className=\"xh-dialog-ref-content-header\">{header}</View>\n )}\n <View className=\"xh-dialog-ref-content-content\">{content}</View>\n {footer || (\n <View className=\"xh-dialog-ref-content-footer\">{dialogFooter}</View>\n )}\n </View>\n </CSSTransition>\n </View>\n );\n return DialogMain;\n});\n\nexport default DialogCom;\n"],"names":["DialogCom","forwardRef","props","fromRef","header","content","_a","className","visible","_b","showCancel","_c","confirmText","_d","cancelText","_e","footer","onConfirm","onCancel","onClose","_f","portrait","_g","tranparent","_h","fancy","_j","__read","useState","selfVisible","setSelfVisible","useImperativeHandle","close","open","useEffect","dialogcls","classNames","show","dialogFooter","React","createElement","View","Button","ghost","size","shape","preventTime","onClick","type","Mask","CSSTransition","in","timeout"],"mappings":"yWAmCA,IAAMA,EAAYC,GAAoC,SAACC,EAAOC,GAE1D,IAAAC,EAcEF,EAAKE,OAbPC,EAaEH,EAAKG,QAZPC,EAYEJ,EAZYK,UAAdA,OAAY,IAAAD,EAAA,KACZE,EAWEN,EAXKM,QACPC,EAUEP,EAAKQ,WAVPA,OAAU,IAAAD,GAAOA,EACjBE,EASET,EATgBU,YAAlBA,OAAc,IAAAD,EAAA,OACdE,EAQEX,EAReY,WAAjBA,OAAU,IAAAD,EAAG,KAAIA,EACjBE,EAOEb,SAPFc,cAAcD,EACdE,EAMEf,YALFgB,EAKEhB,EAAKgB,SAJPC,EAIEjB,EAAKiB,QAHPC,EAGElB,EAHcmB,SAAhBA,OAAW,IAAAD,KACXE,EAEEpB,EAAKqB,WAFPA,cAAkBD,EAClBE,EACEtB,EAAKuB,MADPA,OAAK,IAAAD,GAAQA,EAETE,EAAAC,EAAgCC,GAAS,GAAM,GAA9CC,EAAWH,EAAA,GAAEI,OAEpBC,EAAoB5B,GAAS,WAAM,MAAC,CAClC6B,MAAKA,EACLC,KAAIA,EACJ,IAEF,IAAMD,EAAQ,WACZb,GAAWA,IACXW,GAAe,EACjB,EAEMG,EAAO,WACXH,GAAe,EACjB,EAWAI,GAAU,WACH1B,GACHW,GAAWA,IAEbW,EAAetB,EACjB,GAAG,CAACA,IAEJ,IAAM2B,EAAYC,EAAW,gBAAiB7B,EAAW,CACvD8B,KAAMR,IAGFS,EACJC,EAACC,cAAAC,EACC,CAAAlC,UAAW6B,EAAW,uCAAwC,CAC5Df,SAAQA,EACRI,MAAKA,KAGNf,GACC6B,EAACC,cAAAE,EACC,CAAAC,OACA,EAAAC,KAAK,OACLC,MAAM,YACNC,YAAa,EACbC,QA7Ba,WACnB7B,GAAYA,IACZc,GACF,EA2BQzB,UAAU,+CAETO,GAGLyB,EAAAC,cAACE,EAAM,CACLM,KAAK,UACLH,MAAM,YACND,KAAK,OACLD,OAAQlB,EACRlB,UAAU,+CACVwC,QA7CgB,WACpB9B,GAAaA,GAEf,EA2CM6B,YAAa,GAEZlC,IAqBP,OAfE2B,EAAAC,cAACC,EAAK,CAAAlC,UAAW4B,GACfI,EAAAC,cAACS,EAAO,MACRV,EAAAC,cAACU,EAAa,CAACC,GAAItB,EAAauB,QAAS,IAAKhB,WAAW,SACvDG,EAAAC,cAACC,EAAI,CAAClC,UAAW6B,EAAW,wBAAyB,CAAEb,WAAUA,KAC9DnB,GACCmC,EAAAC,cAACC,EAAI,CAAClC,UAAU,gCAAgCH,GAElDmC,EAAAC,cAACC,EAAK,CAAAlC,UAAU,iCAAiCF,GAChDW,GACCuB,EAAAC,cAACC,EAAI,CAAClC,UAAU,gCAAgC+B,KAO5D"}
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"classnames";import{View as r}from"@tarojs/components";import{pxTransform as o}from"@tarojs/taro";var s=function(s){var a=s.percent,c=void 0===a?88:a,n=s.className,l=s.showPercent,m=void 0!==l&&l,p=s.doneColor,i=void 0===p?"":p,d=s.percentColor,h=void 0===d?"":d,g=s.height,v=s.dots,E=void 0===v?[]:v,N=t("xh-progress",n,{dots:E.length>0}),f=t("progress-bar",{dots:E.length>0},{h5:"h5"===process.env.TARO_ENV}),u=t("progress-bar-percent");return e.createElement(r,{className:N},e.createElement(r,{className:"progress",style:{height:g&&"".concat(o(g))}},E.length>0?e.createElement(e.Fragment,null,E.map((function(t){return e.createElement(r,{style:{width:"".concat(t,"%")},key:t,"data-progress":t,className:f},"h5"!==process.env.TARO_ENV&&e.createElement(r,{className:"progress-bar-text"},t,"%"))})),e.createElement(r,{className:"progress-cover",style:{width:"".concat(c,"%")}})):e.createElement(r,{style:{width:"".concat(c,"%"),backgroundColor:i,color:h},className:f},m&&e.createElement(r,{className:u},"".concat(c,"%")))))};export{s as default};
1
+ import e from"react";import o from"classnames";import{View as r}from"@tarojs/components";import{pxTransform as t}from"@tarojs/taro";var s=function(s){var a=s.percent,c=void 0===a?88:a,l=s.className,n=s.showPercent,m=void 0!==n&&n,d=s.doneColor,i=void 0===d?"":d,p=s.percentColor,g=void 0===p?"":p,h=s.height,v=void 0===h?28:h,E=s.dots,N=void 0===E?[]:E,u=s.solid,f=void 0!==u&&u,b=s.backgroundColor,y=void 0===b?"":b,C=o("xh-progress",l,{dots:N.length>0}),k=o("progress-bar",{dots:N.length>0},{solid:f},{h5:"h5"===process.env.TARO_ENV}),w=o("progress-bar-percent",{solid:f});return e.createElement(r,{className:C,style:{height:v&&t(v)}},e.createElement(r,{className:o("progress",{solid:f}),style:{backgroundColor:y}},N.length>0?e.createElement(e.Fragment,null,N.map((function(o){return e.createElement(r,{style:{width:"".concat(o,"%")},key:o,"data-progress":o,className:k},"h5"!==process.env.TARO_ENV&&e.createElement(r,{className:"progress-bar-text"},o,"%"))})),e.createElement(r,{className:"progress-cover",style:{width:"".concat(c,"%")}})):e.createElement(r,{style:{width:"".concat(c,"%"),backgroundColor:i,color:g},className:k},m&&e.createElement(r,{className:w},"".concat(c,"%")))))};export{s as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Progress/index.tsx"],"sourcesContent":["import React from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { pxTransform } from \"@tarojs/taro\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport \"./index.scss\";\n\nexport type ProgressProps = {\n percent: number;\n showPercent?: boolean;\n doneColor?: string;\n percentColor?: string;\n height?: number;\n /**\n * @description 百分比,不要百分号\n */\n dots?: number[];\n} & XHComponentCommonProps;\n\nconst Progress: React.FC<ProgressProps> = props => {\n const {\n percent = 88,\n className,\n showPercent = false,\n doneColor = \"\",\n percentColor = \"\",\n height,\n dots = [],\n } = props;\n const progresslcs = classNames(\"xh-progress\", className, {\n dots: dots.length > 0,\n });\n\n const showPercentcls = classNames(\n \"progress-bar\",\n { dots: dots.length > 0 },\n { h5: process.env.TARO_ENV === \"h5\" }\n );\n const showbarPercentcls = classNames(\"progress-bar-percent\");\n return (\n <View className={progresslcs}>\n <View\n className=\"progress\"\n style={{ height: height && `${pxTransform(height)}` }}\n >\n {dots.length > 0 ? (\n <React.Fragment>\n {dots.map(item => (\n <View\n style={{\n width: `${item}%`,\n }}\n key={item}\n data-progress={item}\n className={showPercentcls}\n >\n {process.env.TARO_ENV !== \"h5\" && (\n <View className=\"progress-bar-text\">{item}%</View>\n )}\n </View>\n ))}\n <View className=\"progress-cover\" style={{ width: `${percent}%` }} />\n </React.Fragment>\n ) : (\n <View\n style={{\n width: `${percent}%`,\n backgroundColor: doneColor,\n color: percentColor,\n }}\n className={showPercentcls}\n >\n {showPercent && (\n <View className={showbarPercentcls}>{`${percent}%`}</View>\n )}\n </View>\n )}\n </View>\n </View>\n );\n};\n\nexport default Progress;\n"],"names":["Progress","props","_a","percent","className","_b","showPercent","_c","doneColor","_d","percentColor","height","_e","dots","progresslcs","classNames","length","showPercentcls","h5","process","env","TARO_ENV","showbarPercentcls","React","createElement","View","style","pxTransform","Fragment","map","item","width","concat","key","backgroundColor","color"],"mappings":"oIAmBM,IAAAA,EAAoC,SAAAC,GAEtC,IAAAC,EAOED,EAAKE,QAPPA,aAAU,GAAED,EACZE,EAMEH,YALFI,EAKEJ,EAAKK,YALPA,OAAc,IAAAD,GAAKA,EACnBE,EAIEN,EAJYO,UAAdA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAGER,eAHFS,OAAe,IAAAD,EAAA,GAAEA,EACjBE,EAEEV,EAFIU,OACNC,EACEX,EADOY,KAATA,OAAI,IAAAD,EAAG,GAAEA,EAELE,EAAcC,EAAW,cAAeX,EAAW,CACvDS,KAAMA,EAAKG,OAAS,IAGhBC,EAAiBF,EACrB,eACA,CAAEF,KAAMA,EAAKG,OAAS,GACtB,CAAEE,GAA6B,OAAzBC,QAAQC,IAAIC,WAEdC,EAAoBP,EAAW,wBACrC,OACEQ,EAACC,cAAAC,EAAK,CAAArB,UAAWU,GACfS,EAAAC,cAACC,EAAI,CACHrB,UAAU,WACVsB,MAAO,CAAEf,OAAQA,GAAU,UAAGgB,EAAYhB,MAEzCE,EAAKG,OAAS,EACbO,EAACC,cAAAD,EAAMK,SAAQ,KACZf,EAAKgB,KAAI,SAAAC,GAAQ,OAChBP,EAACC,cAAAC,EACC,CAAAC,MAAO,CACLK,MAAO,GAAGC,OAAAF,EAAO,MAEnBG,IAAKH,EACU,gBAAAA,EACf1B,UAAWa,GAEe,OAAzBE,QAAQC,IAAIC,UACXE,gBAACE,EAAI,CAACrB,UAAU,qBAAqB0B,EAAa,SAIxDP,EAACC,cAAAC,EAAK,CAAArB,UAAU,iBAAiBsB,MAAO,CAAEK,MAAO,GAAGC,OAAA7B,WAGtDoB,EAACC,cAAAC,EACC,CAAAC,MAAO,CACLK,MAAO,GAAGC,OAAA7B,EAAU,KACpB+B,gBAAiB1B,EACjB2B,MAAOzB,GAETN,UAAWa,GAEVX,GACCiB,EAAAC,cAACC,EAAI,CAACrB,UAAWkB,GAAoB,GAAAU,OAAG7B,EAAO,QAO7D"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Progress/index.tsx"],"sourcesContent":["import React from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { pxTransform } from \"@tarojs/taro\";\nimport type { StandardLonghandProperties } from \"csstype\";\n\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type ProgressProps = {\n percent: number;\n showPercent?: boolean;\n doneColor?: string;\n percentColor?: string;\n height?: number;\n /**\n * @description 百分比,不要百分号\n */\n dots?: number[];\n /**\n * 苗条模式\n */\n solid?: boolean;\n backgroundColor?: StandardLonghandProperties[\"color\"];\n} & XHComponentCommonProps;\n\nconst Progress: React.FC<ProgressProps> = props => {\n const {\n percent = 88,\n className,\n showPercent = false,\n doneColor = \"\",\n percentColor = \"\",\n height = 28,\n dots = [],\n solid = false,\n backgroundColor = \"\",\n } = props;\n const progresslcs = classNames(\"xh-progress\", className, {\n dots: dots.length > 0,\n });\n\n const showPercentcls = classNames(\n \"progress-bar\",\n { dots: dots.length > 0 },\n { solid },\n { h5: process.env.TARO_ENV === \"h5\" }\n );\n const showbarPercentcls = classNames(\"progress-bar-percent\", { solid });\n return (\n <View\n className={progresslcs}\n style={{\n height: height && pxTransform(height),\n }}\n >\n <View\n className={classNames(\"progress\", { solid })}\n style={{ backgroundColor }}\n >\n {dots.length > 0 ? (\n <React.Fragment>\n {dots.map(item => (\n <View\n style={{\n width: `${item}%`,\n }}\n key={item}\n data-progress={item}\n className={showPercentcls}\n >\n {process.env.TARO_ENV !== \"h5\" && (\n <View className=\"progress-bar-text\">{item}%</View>\n )}\n </View>\n ))}\n <View className=\"progress-cover\" style={{ width: `${percent}%` }} />\n </React.Fragment>\n ) : (\n <View\n style={{\n width: `${percent}%`,\n backgroundColor: doneColor,\n color: percentColor,\n }}\n className={showPercentcls}\n >\n {showPercent && (\n <View className={showbarPercentcls}>{`${percent}%`}</View>\n )}\n </View>\n )}\n </View>\n </View>\n );\n};\n\nexport default Progress;\n"],"names":["Progress","props","_a","percent","className","_b","showPercent","_c","doneColor","_d","percentColor","_e","height","_f","dots","_g","solid","_h","backgroundColor","progresslcs","classNames","length","showPercentcls","h5","process","env","TARO_ENV","showbarPercentcls","React","View","style","pxTransform","createElement","Fragment","map","item","width","concat","key","color"],"mappings":"oIA2BM,IAAAA,EAAoC,SAAAC,GAEtC,IAAAC,EASED,EAAKE,QATPA,aAAU,GAAED,EACZE,EAQEH,EAAKG,UAPPC,EAOEJ,EAPiBK,YAAnBA,OAAW,IAAAD,GAAQA,EACnBE,EAMEN,YANFO,OAAY,IAAAD,EAAA,KACZE,EAKER,EAAKS,aALPA,OAAY,IAAAD,EAAG,GAAEA,EACjBE,EAIEV,EAJSW,OAAXA,OAAS,IAAAD,EAAA,GAAEA,EACXE,EAGEZ,EAAKa,KAHPA,aAAO,GAAED,EACTE,EAEEd,EAFWe,MAAbA,OAAK,IAAAD,GAAQA,EACbE,EACEhB,kBADFiB,OAAkB,IAAAD,EAAA,KAEdE,EAAcC,EAAW,cAAehB,EAAW,CACvDU,KAAMA,EAAKO,OAAS,IAGhBC,EAAiBF,EACrB,eACA,CAAEN,KAAMA,EAAKO,OAAS,GACtB,CAAEL,MAAKA,GACP,CAAEO,GAA6B,OAAzBC,QAAQC,IAAIC,WAEdC,EAAoBP,EAAW,uBAAwB,CAAEJ,MAAKA,IACpE,OACEY,gBAACC,EAAI,CACHzB,UAAWe,EACXW,MAAO,CACLlB,OAAQA,GAAUmB,EAAYnB,KAGhCgB,EAAAI,cAACH,EAAI,CACHzB,UAAWgB,EAAW,WAAY,CAAEJ,MAAKA,IACzCc,MAAO,CAAEZ,gBAAeA,IAEvBJ,EAAKO,OAAS,EACbO,EAACI,cAAAJ,EAAMK,SAAQ,KACZnB,EAAKoB,KAAI,SAAAC,GAAQ,OAChBP,EAACI,cAAAH,EACC,CAAAC,MAAO,CACLM,MAAO,GAAGC,OAAAF,EAAO,MAEnBG,IAAKH,EACU,gBAAAA,EACf/B,UAAWkB,GAEe,OAAzBE,QAAQC,IAAIC,UACXE,gBAACC,EAAI,CAACzB,UAAU,qBAAqB+B,EAAa,SAIxDP,EAACI,cAAAH,EAAK,CAAAzB,UAAU,iBAAiB0B,MAAO,CAAEM,MAAO,GAAGC,OAAAlC,WAGtDyB,EAACI,cAAAH,EACC,CAAAC,MAAO,CACLM,MAAO,GAAGC,OAAAlC,EAAU,KACpBe,gBAAiBV,EACjB+B,MAAO7B,GAETN,UAAWkB,GAEVhB,GACCsB,EAAAI,cAACH,EAAI,CAACzB,UAAWuB,GAAoB,GAAAU,OAAGlC,EAAO,QAO7D"}