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.
- package/dist/components/DialogRef/index.js +1 -1
- package/dist/components/DialogRef/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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/dialogref.scss +17 -0
- package/dist/styles/components/progress.scss +27 -4
- package/lib/components/DialogRef/index.js +3 -2
- package/lib/components/DialogRef/index.js.map +1 -1
- package/lib/components/Progress/index.js +7 -5
- package/lib/components/Progress/index.js.map +1 -1
- package/package.json +1 -1
- package/types/components/DialogRef/index.d.ts +2 -0
- package/types/components/Progress/index.d.ts +6 -0
- package/types/components/Result/statusMap.d.ts +9 -0
- package/types/stories/Button.d.ts +29 -0
- package/types/stories/Header.d.ts +10 -0
- package/types/stories/Page.d.ts +10 -0
- package/CHANGELOG.md +0 -620
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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,E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