taro-react-uilib 1.3.4-10 → 1.3.4-11
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.
- package/CHANGELOG.md +9 -0
- package/dist/components/AmountKeyboard/index.js +1 -1
- package/dist/components/AmountKeyboard/index.js.map +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/progress.scss +13 -1
- package/lib/components/AmountKeyboard/index.js +1 -1
- package/lib/components/AmountKeyboard/index.js.map +1 -1
- package/lib/components/Progress/index.js +4 -2
- package/lib/components/Progress/index.js.map +1 -1
- package/package.json +1 -1
- package/types/components/AmountKeyboard/index.d.ts +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [1.3.4-11](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.4-10...v1.3.4-11) (2023-08-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* 推荐金额区分、progress在小程序的兼容问题 ([6190b1a](https://code.xhdev.xyz/h5group/taro-uilib/commits/6190b1a91e8cdbd2cdaf9af1b3b3dce1349b6c15))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [1.3.4-10](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.4-9...v1.3.4-10) (2023-08-09)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as a,useCallback as o}from"react";import r from"classnames";import{View as l}from"@tarojs/components";import{pxTransform as m}from"../src/utils/index.js";import u from"../Badge/index.js";import c from"../Space/index.js";import i from"../node_modules/react-transition-group/esm/CSSTransition.js";var s=[{text:1,value:1,type:"number"},{text:2,value:2,type:"number"},{text:3,value:3,type:"number"},{text:"",value:"",type:"delete"},{text:4,value:4,type:"number"},{text:5,value:5,type:"number"},{text:6,value:6,type:"number"},{text:"",value:"",type:"none"},{text:7,value:7,type:"number"},{text:8,value:8,type:"number"},{text:9,value:9,type:"number"},{text:"",value:"",type:"none"},{text:"00",value:"00",type:"number"},{text:0,value:0,type:"number"},{text:"",value:"",type:"close"},{text:"",value:"",type:"none"}],p=function(p){var d=p.onBlur,y=p.show,v=p.maxLength,x=void 0===v?Number.MAX_SAFE_INTEGER:v,f=p.closeOnClickSpace,b=void 0===f||f,k=p.onClose,h=p.onChange,E=p.value,g=p.className,N=p.onConfirm,C=p.recommend,j=void 0===C?[]:C,S=p.header,_=p.disabled,L=void 0!==_&&_,w=p.tip,A=e(n(E),2),O=A[0],P=A[1];function T(e){k&&k(e),d&&d(e)}a((function(){return b&&document.addEventListener("click",T),function(){document.removeEventListener("click",T)}}),[]),a((function(){P(E)}),[E]);var B=o((function(e,t){var n=t.type,a=t.value;if("h5"===process.env.TARO_ENV&&e.stopImmediatePropagation(),!L&&"none"!==n)if("close"!==n){var o=O;"delete"===n?o=O.slice(0,O.length-1):o.replace(/^0+/g,"").length<x&&(o=O+a),o!==O&&(P(o),null==h||h(o))}else T(e)}),[O,L]),I=r("xh-amount-keyboard",g);return t.createElement(i,{classNames:"slide-up",in:y,unmountOnExit:!0,timeout:200},t.createElement(l,{className:I},t.createElement(l,{className:"xh-amount-keyboard-header"},t.createElement(l,{className:"xh-amount-keyboard-header-wrapper"},S||j.length>0&&t.createElement(l,{className:"xh-amount-keyboard-header-wrapper-text"},"猜您想借"," ",t.createElement(c,{style:{marginLeft:m(24)}},null==j?void 0:j.map((function(e,n){return t.createElement(l,{key:n,onClick:function(t){return function(e,t){e.stopPropagation(),null==N||N("".concat(t))}(t,e)}},t.createElement(u,{content:"¥".concat(e),key:n}))})))),w)),t.createElement(l,{className:"xh-amount-keyboard-body"},s.map((function(e,n){return t.createElement(l,{key:n,className:r("xh-amount-keyboard-body-key",{none:"none"===e.type,delete:"delete"===e.type,close:"close"===e.type}),onClick:function(t){B(t,e)}},e.text)})),t.createElement(l,{className:"xh-amount-keyboard-body-key confirm-fake",onClick:function(e){e.stopPropagation(),null==N||N(O)}},"确定"))))};export{p as default};
|
|
1
|
+
import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as a,useCallback as o}from"react";import r from"classnames";import{View as l}from"@tarojs/components";import{pxTransform as m}from"../src/utils/index.js";import u from"../Badge/index.js";import c from"../Space/index.js";import i from"../node_modules/react-transition-group/esm/CSSTransition.js";var s=[{text:1,value:1,type:"number"},{text:2,value:2,type:"number"},{text:3,value:3,type:"number"},{text:"",value:"",type:"delete"},{text:4,value:4,type:"number"},{text:5,value:5,type:"number"},{text:6,value:6,type:"number"},{text:"",value:"",type:"none"},{text:7,value:7,type:"number"},{text:8,value:8,type:"number"},{text:9,value:9,type:"number"},{text:"",value:"",type:"none"},{text:"00",value:"00",type:"number"},{text:0,value:0,type:"number"},{text:"",value:"",type:"close"},{text:"",value:"",type:"none"}],p=function(p){var d=p.onBlur,y=p.show,v=p.maxLength,x=void 0===v?Number.MAX_SAFE_INTEGER:v,f=p.closeOnClickSpace,b=void 0===f||f,k=p.onClose,h=p.onChange,E=p.value,g=p.className,N=p.onConfirm,C=p.recommend,j=void 0===C?[]:C,S=p.header,_=p.disabled,L=void 0!==_&&_,w=p.tip,A=e(n(E),2),O=A[0],P=A[1];function T(e){k&&k(e),d&&d(e)}a((function(){return b&&document.addEventListener("click",T),function(){document.removeEventListener("click",T)}}),[]),a((function(){P(E)}),[E]);var B=o((function(e,t){var n=t.type,a=t.value;if("h5"===process.env.TARO_ENV&&e.stopImmediatePropagation(),!L&&"none"!==n)if("close"!==n){var o=O;"delete"===n?o=O.slice(0,O.length-1):o.replace(/^0+/g,"").length<x&&(o=O+a),o!==O&&(P(o),null==h||h(o))}else T(e)}),[O,L]),I=r("xh-amount-keyboard",g);return t.createElement(i,{classNames:"slide-up",in:y,unmountOnExit:!0,timeout:200},t.createElement(l,{className:I},t.createElement(l,{className:"xh-amount-keyboard-header"},t.createElement(l,{className:"xh-amount-keyboard-header-wrapper"},S||j.length>0&&t.createElement(l,{className:"xh-amount-keyboard-header-wrapper-text"},"猜您想借"," ",t.createElement(c,{style:{marginLeft:m(24)}},null==j?void 0:j.map((function(e,n){return t.createElement(l,{key:n,onClick:function(t){return function(e,t){e.stopPropagation(),null==N||N("".concat(t),!0)}(t,e)}},t.createElement(u,{content:"¥".concat(e),key:n}))})))),w)),t.createElement(l,{className:"xh-amount-keyboard-body"},s.map((function(e,n){return t.createElement(l,{key:n,className:r("xh-amount-keyboard-body-key",{none:"none"===e.type,delete:"delete"===e.type,close:"close"===e.type}),onClick:function(t){B(t,e)}},e.text)})),t.createElement(l,{className:"xh-amount-keyboard-body-key confirm-fake",onClick:function(e){e.stopPropagation(),null==N||N(O)}},"确定"))))};export{p as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/AmountKeyboard/index.tsx"],"sourcesContent":["import React, {\n FC,\n useState,\n useEffect,\n MouseEvent,\n ReactNode,\n useCallback,\n} from \"react\";\nimport classNames from \"classnames\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { ITouchEvent, View } from \"@tarojs/components\";\nimport { pxTransform } from \"@/utils\";\n\nimport Badge from \"../Badge\";\nimport \"./index.scss\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport Space from \"../Space\";\n\nexport type NumberKeyboardProps = {\n show: boolean;\n showClose?: boolean;\n closeOnClickSpace?: boolean;\n maxLength?: number;\n onBlur?: (e: MouseEvent | Event) => void;\n onClose?: (e: MouseEvent | Event) => void;\n onChange?: (value: string) => void;\n value: string;\n header?: ReactNode;\n onConfirm?: (value: string) => void;\n recommend?: Array<number | string>;\n tip?: ReactNode;\n disabled?: boolean;\n} & XHComponentCommonProps;\n\nexport type KeyType = \"number\" | \"delete\" | \"string\" | \"none\" | \"close\";\n\nexport interface IKey {\n text: number | string;\n value: number | string;\n type: KeyType;\n}\n\nconst XHAmountKeys: IKey[] = [\n { text: 1, value: 1, type: \"number\" },\n { text: 2, value: 2, type: \"number\" },\n { text: 3, value: 3, type: \"number\" },\n { text: \"\", value: \"\", type: \"delete\" },\n { text: 4, value: 4, type: \"number\" },\n { text: 5, value: 5, type: \"number\" },\n { text: 6, value: 6, type: \"number\" },\n { text: \"\", value: \"\", type: \"none\" },\n { text: 7, value: 7, type: \"number\" },\n { text: 8, value: 8, type: \"number\" },\n { text: 9, value: 9, type: \"number\" },\n { text: \"\", value: \"\", type: \"none\" },\n { text: \"00\", value: \"00\", type: \"number\" },\n { text: 0, value: 0, type: \"number\" },\n { text: \"\", value: \"\", type: \"close\" },\n { text: \"\", value: \"\", type: \"none\" },\n];\n\nconst AmountKeyboard: FC<NumberKeyboardProps> = props => {\n const {\n onBlur,\n show,\n maxLength = Number.MAX_SAFE_INTEGER,\n closeOnClickSpace = true,\n onClose,\n onChange,\n value,\n className,\n onConfirm,\n recommend = [],\n header,\n disabled = false,\n tip,\n } = props;\n const [input, setInput] = useState(value);\n\n useEffect(() => {\n if (closeOnClickSpace) {\n document.addEventListener(\"click\", handleClose);\n }\n\n return () => {\n document.removeEventListener(\"click\", handleClose);\n };\n }, []);\n\n useEffect(() => {\n setInput(value);\n }, [value]);\n\n function handleClose(e): void {\n onClose && onClose(e);\n onBlur && onBlur(e);\n }\n\n const handleOnRecommand = (e: ITouchEvent, amount: number | string) => {\n e.stopPropagation();\n onConfirm?.(`${amount}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/AmountKeyboard/index.tsx"],"sourcesContent":["import React, {\n FC,\n useState,\n useEffect,\n MouseEvent,\n ReactNode,\n useCallback,\n} from \"react\";\nimport classNames from \"classnames\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { ITouchEvent, View } from \"@tarojs/components\";\nimport { pxTransform } from \"@/utils\";\n\nimport Badge from \"../Badge\";\nimport \"./index.scss\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport Space from \"../Space\";\n\nexport type NumberKeyboardProps = {\n show: boolean;\n showClose?: boolean;\n closeOnClickSpace?: boolean;\n maxLength?: number;\n onBlur?: (e: MouseEvent | Event) => void;\n onClose?: (e: MouseEvent | Event) => void;\n onChange?: (value: string) => void;\n value: string;\n header?: ReactNode;\n /**\n *\n * @param value 输入值\n * @param recommend 是否是点击推荐金额触发\n * @returns void\n */\n onConfirm?: (value: string, recommend?: boolean) => void;\n recommend?: Array<number | string>;\n tip?: ReactNode;\n disabled?: boolean;\n} & XHComponentCommonProps;\n\nexport type KeyType = \"number\" | \"delete\" | \"string\" | \"none\" | \"close\";\n\nexport interface IKey {\n text: number | string;\n value: number | string;\n type: KeyType;\n}\n\nconst XHAmountKeys: IKey[] = [\n { text: 1, value: 1, type: \"number\" },\n { text: 2, value: 2, type: \"number\" },\n { text: 3, value: 3, type: \"number\" },\n { text: \"\", value: \"\", type: \"delete\" },\n { text: 4, value: 4, type: \"number\" },\n { text: 5, value: 5, type: \"number\" },\n { text: 6, value: 6, type: \"number\" },\n { text: \"\", value: \"\", type: \"none\" },\n { text: 7, value: 7, type: \"number\" },\n { text: 8, value: 8, type: \"number\" },\n { text: 9, value: 9, type: \"number\" },\n { text: \"\", value: \"\", type: \"none\" },\n { text: \"00\", value: \"00\", type: \"number\" },\n { text: 0, value: 0, type: \"number\" },\n { text: \"\", value: \"\", type: \"close\" },\n { text: \"\", value: \"\", type: \"none\" },\n];\n\nconst AmountKeyboard: FC<NumberKeyboardProps> = props => {\n const {\n onBlur,\n show,\n maxLength = Number.MAX_SAFE_INTEGER,\n closeOnClickSpace = true,\n onClose,\n onChange,\n value,\n className,\n onConfirm,\n recommend = [],\n header,\n disabled = false,\n tip,\n } = props;\n const [input, setInput] = useState(value);\n\n useEffect(() => {\n if (closeOnClickSpace) {\n document.addEventListener(\"click\", handleClose);\n }\n\n return () => {\n document.removeEventListener(\"click\", handleClose);\n };\n }, []);\n\n useEffect(() => {\n setInput(value);\n }, [value]);\n\n function handleClose(e): void {\n onClose && onClose(e);\n onBlur && onBlur(e);\n }\n\n const handleOnRecommand = (e: ITouchEvent, amount: number | string) => {\n e.stopPropagation();\n onConfirm?.(`${amount}`, true);\n };\n\n const handleKeyPress = useCallback(\n (e, { type, value }: IKey): void => {\n if (process.env.TARO_ENV === \"h5\") {\n e.stopImmediatePropagation();\n }\n if (disabled) return;\n if (type === \"none\") return;\n\n if (type === \"close\") {\n handleClose(e);\n return;\n }\n let newInput = input;\n\n if (type === \"delete\") {\n newInput = input.slice(0, input.length - 1);\n } else if (newInput.replace(/^0+/g, \"\").length < maxLength) {\n newInput = input + value;\n }\n\n // 前后两个值相等就不触发onchange\n if (newInput === input) return;\n setInput(newInput);\n onChange?.(newInput);\n },\n [input, disabled]\n );\n\n const handleConfirm = (e: ITouchEvent) => {\n e.stopPropagation();\n onConfirm?.(input);\n };\n const keyboardcls = classNames(\"xh-amount-keyboard\", className);\n\n return (\n <CSSTransition classNames=\"slide-up\" in={show} unmountOnExit timeout={200}>\n <View className={keyboardcls}>\n <View className=\"xh-amount-keyboard-header\">\n <View className=\"xh-amount-keyboard-header-wrapper\">\n {header ||\n (recommend.length > 0 && (\n <View className=\"xh-amount-keyboard-header-wrapper-text\">\n 猜您想借{\" \"}\n <Space style={{ marginLeft: pxTransform(24) }}>\n {recommend?.map((amount, index) => (\n <View\n key={index}\n onClick={e => handleOnRecommand(e, amount)}\n >\n <Badge content={`¥${amount}`} key={index} />\n </View>\n ))}\n </Space>\n </View>\n ))}\n {tip}\n </View>\n </View>\n <View className=\"xh-amount-keyboard-body\">\n {XHAmountKeys.map((key, index) => (\n <View\n key={index}\n className={classNames(\"xh-amount-keyboard-body-key\", {\n none: key.type === \"none\",\n delete: key.type === \"delete\",\n close: key.type === \"close\",\n })}\n onClick={e => {\n handleKeyPress(e, key);\n }}\n >\n {key.text}\n </View>\n ))}\n <View\n className=\"xh-amount-keyboard-body-key confirm-fake\"\n onClick={handleConfirm}\n >\n 确定\n </View>\n </View>\n </View>\n </CSSTransition>\n );\n};\n\nexport default AmountKeyboard;\n"],"names":["XHAmountKeys","text","value","type","AmountKeyboard","props","onBlur","show","_a","maxLength","Number","MAX_SAFE_INTEGER","_b","closeOnClickSpace","onClose","onChange","className","onConfirm","_c","recommend","header","_d","disabled","tip","_e","__read","useState","input","setInput","handleClose","e","useEffect","document","addEventListener","removeEventListener","handleKeyPress","useCallback","process","env","TARO_ENV","stopImmediatePropagation","newInput","slice","length","replace","keyboardcls","classNames","React","createElement","CSSTransition","in","unmountOnExit","timeout","View","Space","style","marginLeft","pxTransform","map","amount","index","key","onClick","stopPropagation","concat","handleOnRecommand","Badge","content","none","delete","close"],"mappings":"qYAgDA,IAAMA,EAAuB,CAC3B,CAAEC,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,GAAIC,MAAO,GAAIC,KAAM,UAC7B,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,GAAIC,MAAO,GAAIC,KAAM,QAC7B,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,GAAIC,MAAO,GAAIC,KAAM,QAC7B,CAAEF,KAAM,KAAMC,MAAO,KAAMC,KAAM,UACjC,CAAEF,KAAM,EAAGC,MAAO,EAAGC,KAAM,UAC3B,CAAEF,KAAM,GAAIC,MAAO,GA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C,cAAAC,EAAc,CAAAH,WAAW,WAAWI,GAAI3C,EAAM4C,eAAc,EAAAC,QAAS,KACpEL,EAAAC,cAACK,EAAI,CAACrC,UAAW6B,GACfE,EAAAC,cAACK,EAAI,CAACrC,UAAU,6BACd+B,EAAAC,cAACK,EAAI,CAACrC,UAAU,qCACbI,GACED,EAAUwB,OAAS,GAClBI,EAAAC,cAACK,EAAI,CAACrC,UAAU,iDACT,IACL+B,EAACC,cAAAM,GAAMC,MAAO,CAAEC,WAAYC,EAAY,MACrCtC,aAAS,EAATA,EAAWuC,KAAI,SAACC,EAAQC,GAAU,OACjCb,EAACC,cAAAK,GACCQ,IAAKD,EACLE,QAAS,SAAAhC,GAAK,OApDV,SAACA,EAAgB6B,GACzC7B,EAAEiC,kBACF9C,SAAAA,EAAY,GAAG+C,OAAAL,IAAU,EAC3B,CAiDoCM,CAAkBnC,EAAG6B,KAEnCZ,EAACC,cAAAkB,GAAMC,QAAS,WAAIR,GAAUE,IAAKD,IALJ,MAW1CrC,IAGLwB,EAAAC,cAACK,EAAI,CAACrC,UAAU,2BACbhB,EAAa0D,KAAI,SAACG,EAAKD,GAAU,OAChCb,EAAAC,cAACK,EACC,CAAAQ,IAAKD,EACL5C,UAAW8B,EAAW,8BAA+B,CACnDsB,KAAmB,SAAbP,EAAI1D,KACVkE,OAAqB,WAAbR,EAAI1D,KACZmE,MAAoB,UAAbT,EAAI1D,OAEb2D,QAAS,SAAAhC,GACPK,EAAeL,EAAG+B,EACnB,GAEAA,EAAI5D,SAGT8C,EAAAC,cAACK,EAAI,CACHrC,UAAU,2CACV8C,QAhDY,SAAChC,GACrBA,EAAEiC,kBACF9C,SAAAA,EAAYU,EACd,GAgDe,QAKjB"}
|
|
@@ -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
|
|
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};
|
|
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(\"progress-bar\"
|
|
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,GAA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