taro-react-uilib 1.4.14 → 1.4.15-1

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 (34) hide show
  1. package/dist/components/FormInput/index.js +1 -1
  2. package/dist/components/FormInput/index.js.map +1 -1
  3. package/dist/components/Icon/index.js.map +1 -1
  4. package/dist/components/Step/Steps/index.js +1 -1
  5. package/dist/components/Step/Steps/index.js.map +1 -1
  6. package/dist/components/Step/index.js +1 -1
  7. package/dist/components/Step/index.js.map +1 -1
  8. package/dist/components/ThemeProvider/index.js.map +1 -1
  9. package/dist/index.esm.js +180 -0
  10. package/dist/index.esm.js.map +1 -0
  11. package/dist/index.js +2 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.umd.js +2 -2
  14. package/dist/index.umd.js.map +1 -1
  15. package/dist/styles/components/font/iconfont.ttf +0 -0
  16. package/dist/styles/components/font/iconfont.woff +0 -0
  17. package/dist/styles/components/font/iconfont.woff2 +0 -0
  18. package/dist/styles/components/forminput.scss +2 -1
  19. package/dist/styles/components/icon.scss +23 -0
  20. package/dist/styles/components/step.scss +25 -1
  21. package/lib/components/FormInput/index.js +1 -2
  22. package/lib/components/FormInput/index.js.map +1 -1
  23. package/lib/components/Icon/index.js.map +1 -1
  24. package/lib/components/Step/Steps/index.js +2 -1
  25. package/lib/components/Step/Steps/index.js.map +1 -1
  26. package/lib/components/Step/index.js +2 -2
  27. package/lib/components/Step/index.js.map +1 -1
  28. package/lib/components/ThemeProvider/index.js.map +1 -1
  29. package/package.json +1 -1
  30. package/types/components/Icon/index.d.ts +1 -1
  31. package/types/components/Step/Steps/index.d.ts +1 -0
  32. package/types/components/Step/index.d.ts +1 -0
  33. package/types/components/ThemeProvider/index.d.ts +6 -3
  34. package/CHANGELOG.md +0 -1095
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as a}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as n,useRef as l,useImperativeHandle as r}from"react";import{View as m,Text as o,Input as c}from"@tarojs/components";import i from"classnames";import{inputRange as s}from"../src/utils/index.js";var u=n((function(n,u){var p=n.onChange,f=n.maxlength,h=n.value,d=n.type,v=n.placeholder,x=n.label,E=n.labelHtml,N=n.RightComponent,b=n.onBlur,g=n.pattern,y=n.LeftComponent,w=n.LeftIcon,L=n.name,C=n.readonly,I=void 0!==C&&C,_=n.withArrow,B=void 0!==_&&_,H=n.direction,j=void 0===H?"row":H,A=n.border,R=void 0===A||A,T=n.mainExtra,M=n.padding,S=void 0!==M&&M,O=n.className,V=e(n,["onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","readonly","withArrow","direction","border","mainExtra","padding","className"]);function k(e){var a=s(e.target.value);e.target.value=a,p&&p(a)}function q(e){var a=s(e.target.value);b&&b(a)}var z=l(null);r(u,(function(){return{focus:function(){var e;null===(e=z.current)||void 0===e||e.focus()}}}));var D=i("xh-form-input",{column:"column"===j,border:R,padding:S,className:O});return"h5"!==process.env.TARO_ENV?t.createElement(m,{className:D},t.createElement(m,{className:"xh-form-input-main"},t.createElement(m,{className:"xh-form-input-main-left"},x&&t.createElement(m,{className:"xh-form-input-main-left-label"},x,w&&t.createElement(m,{className:"xh-form-input-main-left-label-icon"},w)),E&&t.createElement("label",{dangerouslySetInnerHTML:{__html:E},className:"label"}),t.createElement(m,null,y)),t.createElement(m,{className:"xh-form-input-main-center"},I?t.createElement(o,{className:i("xh-form-input-readonly",{"xh-form-input-placeholder":!h})},h||v):t.createElement(c,a({},V,{ref:z,className:"xh-form-input-main-center-native",maxlength:f,name:L,placeholder:v,type:d,value:h,onBlur:q,onInput:k}))),T&&t.createElement(m,{className:"xh-form-input-main-extra"},T)),t.createElement(m,{className:"xh-form-input-right"},N,B&&t.createElement(m,{className:"arrow"}))):t.createElement("div",{className:D},t.createElement("div",{className:"xh-form-input-main"},t.createElement("div",{className:"xh-form-input-main-left"},x&&t.createElement("label",{className:"xh-form-input-main-left-label"},x,w&&t.createElement("div",{className:"xh-form-input-main-left-label-icon"},w)),E&&t.createElement("label",{dangerouslySetInnerHTML:{__html:E},className:"label"}),t.createElement("div",null,y)),t.createElement("div",{className:"xh-form-input-main-center"},I?t.createElement("p",{className:i("xh-form-input-main-center-readonly",{"xh-form-input-main-placeholder":!h})},h||v):t.createElement("input",{ref:z,className:"xh-form-input-main-center-native",maxLength:f,name:L,pattern:g,placeholder:v,type:d,value:h,onBlur:q,onInput:k})),T&&t.createElement("div",{className:"xh-form-input-main-extra"},T)),t.createElement("div",{className:"xh-form-input-right"},N,B&&t.createElement("span",{className:"arrow"})))}));export{u as default};
1
+ import{__rest as e,__assign as a}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as n,useRef as l,useImperativeHandle as r}from"react";import{View as m,Text as o,Input as i}from"@tarojs/components";import c from"classnames";import{inputRange as s}from"../src/utils/index.js";var u=n((function(n,u){var p=n.onChange,f=n.maxlength,h=n.value,d=n.type,v=n.placeholder,x=n.label,E=n.labelHtml,N=n.RightComponent,b=n.onBlur,g=n.pattern,y=n.LeftComponent,w=n.LeftIcon,L=n.name,C=n.readonly,I=void 0!==C&&C,_=n.withArrow,B=void 0!==_&&_,H=n.direction,j=void 0===H?"row":H,A=n.border,R=void 0===A||A,T=n.mainExtra,M=n.padding,S=void 0!==M&&M,O=n.className,V=e(n,["onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","readonly","withArrow","direction","border","mainExtra","padding","className"]);function k(e){var a=s(e.target.value);e.target.value=a,p&&p(a)}function q(e){var a=s(e.target.value);b&&b(a)}var z=l(null);r(u,(function(){return{focus:function(){var e;null===(e=z.current)||void 0===e||e.focus()}}}));var D=c("xh-form-input",{column:"column"===j,border:R,padding:S},O);return"h5"!==process.env.TARO_ENV?t.createElement(m,{className:D},t.createElement(m,{className:"xh-form-input-main"},t.createElement(m,{className:"xh-form-input-main-left"},x&&t.createElement(m,{className:"xh-form-input-main-left-label"},x,w&&t.createElement(m,{className:"xh-form-input-main-left-label-icon"},w)),E&&t.createElement("label",{dangerouslySetInnerHTML:{__html:E},className:"label"}),t.createElement(m,null,y)),t.createElement(m,{className:"xh-form-input-main-center"},I?t.createElement(o,{className:c("xh-form-input-readonly",{"xh-form-input-placeholder":!h})},h||v):t.createElement(i,a({},V,{ref:z,className:"xh-form-input-main-center-native",maxlength:f,name:L,placeholder:v,type:d,value:h,onBlur:q,onInput:k}))),T&&t.createElement(m,{className:"xh-form-input-main-extra"},T)),t.createElement(m,{className:"xh-form-input-right"},N,B&&t.createElement(m,{className:"arrow"}))):t.createElement("div",{className:D},t.createElement("div",{className:"xh-form-input-main"},t.createElement("div",{className:"xh-form-input-main-left"},x&&t.createElement("label",{className:"xh-form-input-main-left-label"},x,w&&t.createElement("div",{className:"xh-form-input-main-left-label-icon"},w)),E&&t.createElement("label",{dangerouslySetInnerHTML:{__html:E},className:"label"}),t.createElement("div",null,y)),t.createElement("div",{className:"xh-form-input-main-center"},I?t.createElement("p",{className:c("xh-form-input-main-center-readonly",{"xh-form-input-main-placeholder":!h})},h||v):t.createElement("input",{ref:z,className:"xh-form-input-main-center-native",maxLength:f,name:L,pattern:g,placeholder:v,type:d,value:h,onBlur:q,onInput:k})),T&&t.createElement("div",{className:"xh-form-input-main-extra"},T)),t.createElement("div",{className:"xh-form-input-right"},N,B&&t.createElement("span",{className:"arrow"})))}));export{u as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/FormInput/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useRef,\n useImperativeHandle,\n forwardRef,\n} from \"react\";\nimport {\n Input,\n View,\n Text,\n InputProps,\n CommonEventFunction,\n} from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport { inputRange } from \"../../utils/index\";\n\nimport \"./index.scss\";\n\nexport type HTMLFormType =\n | \"tel\"\n | \"text\"\n | \"number\"\n | \"password\"\n | \"idcard\"\n | \"digit\"\n | \"safe-password\"\n | \"nickname\";\n\nexport type FormInputProps = {\n onChange?: (value: string) => void;\n onBlur?: (value: string) => void;\n /** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。\n * @supported weapp, h5, rn\n */\n onInput?: CommonEventFunction<InputProps.inputEventDetail>;\n\n /** 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\n * @supported weapp, h5, rn\n */\n onFocus?: CommonEventFunction<InputProps.inputForceEventDetail>;\n\n /** 输入框失去焦点时触发\n *\n * event.detail = {value: value}\n * @supported weapp, h5, rn\n */\n value?: string;\n maxlength?: number;\n placeholder?: string;\n type?: HTMLFormType;\n pattern?: string;\n RightComponent?: ReactNode;\n label?: string;\n labelHtml?: string;\n LeftComponent?: ReactNode;\n LeftIcon?: ReactNode;\n name?: string;\n readonly?: boolean;\n withArrow?: boolean;\n direction?: \"row\" | \"column\";\n border?: boolean;\n mainExtra?: ReactNode;\n padding?: boolean;\n password?: boolean;\n focus?: boolean;\n /** 设置键盘右下角按钮的文字\n * @default done\n * @supported weapp, rn\n */\n confirmType?: \"send\" | \"search\" | \"next\" | \"go\" | \"done\";\n /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上\n * @supported h5\n */\n nativeProps?: Record<string, unknown>;\n className?: string;\n};\n\nexport type FocusHandler = { focus: () => void };\n\nconst FormInput = forwardRef<FocusHandler, FormInputProps>((props, formRef) => {\n const {\n onChange,\n maxlength,\n value,\n type,\n placeholder,\n label,\n labelHtml,\n RightComponent,\n onBlur,\n pattern,\n LeftComponent,\n LeftIcon,\n name,\n readonly = false,\n withArrow = false,\n direction = \"row\",\n border = true,\n mainExtra,\n padding = false,\n className,\n ...rest\n } = props;\n\n function handleChange(e): any {\n let inputValue = inputRange(e.target.value);\n e.target.value = inputValue;\n onChange && onChange(inputValue);\n }\n\n function handleBlur(e): any {\n let inputValue = inputRange(e.target.value);\n onBlur && onBlur(inputValue);\n }\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(formRef, () => ({\n focus() {\n inputRef.current?.focus();\n },\n }));\n\n const wrapperCls = classNames(\"xh-form-input\", {\n column: direction === \"column\",\n border,\n padding,\n className,\n });\n\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View className={wrapperCls}>\n <View className=\"xh-form-input-main\">\n <View className=\"xh-form-input-main-left\">\n {label && (\n <View className=\"xh-form-input-main-left-label\">\n {label}\n {LeftIcon && (\n <View className=\"xh-form-input-main-left-label-icon\">\n {LeftIcon}\n </View>\n )}\n </View>\n )}\n {labelHtml && (\n <label\n dangerouslySetInnerHTML={{ __html: labelHtml }}\n className=\"label\"\n />\n )}\n <View>{LeftComponent}</View>\n </View>\n <View className=\"xh-form-input-main-center\">\n {readonly ? (\n <Text\n className={classNames(\"xh-form-input-readonly\", {\n \"xh-form-input-placeholder\": !value,\n })}\n >\n {value || placeholder}\n </Text>\n ) : (\n <Input\n {...rest}\n ref={inputRef}\n className=\"xh-form-input-main-center-native\"\n maxlength={maxlength}\n name={name}\n placeholder={placeholder}\n type={type as InputProps[\"type\"]}\n value={value}\n onBlur={handleBlur}\n onInput={handleChange}\n />\n )}\n </View>\n {mainExtra && (\n <View className=\"xh-form-input-main-extra\">{mainExtra}</View>\n )}\n </View>\n <View className=\"xh-form-input-right\">\n {RightComponent}\n {withArrow && <View className=\"arrow\" />}\n </View>\n </View>\n );\n }\n\n return (\n <div className={wrapperCls}>\n <div className=\"xh-form-input-main\">\n <div className=\"xh-form-input-main-left\">\n {label && (\n <label className=\"xh-form-input-main-left-label\">\n {label}\n {LeftIcon && (\n <div className=\"xh-form-input-main-left-label-icon\">\n {LeftIcon}\n </div>\n )}\n </label>\n )}\n {labelHtml && (\n <label\n dangerouslySetInnerHTML={{ __html: labelHtml }}\n className=\"label\"\n />\n )}\n <div>{LeftComponent}</div>\n </div>\n <div className=\"xh-form-input-main-center\">\n {readonly ? (\n <p\n className={classNames(\"xh-form-input-main-center-readonly\", {\n \"xh-form-input-main-placeholder\": !value,\n })}\n >\n {value || placeholder}\n </p>\n ) : (\n <input\n ref={inputRef}\n className=\"xh-form-input-main-center-native\"\n maxLength={maxlength}\n name={name}\n pattern={pattern}\n placeholder={placeholder}\n type={type}\n value={value}\n onBlur={handleBlur}\n onInput={handleChange}\n />\n )}\n </div>\n {mainExtra && (\n <div className=\"xh-form-input-main-extra\">{mainExtra}</div>\n )}\n </div>\n <div className=\"xh-form-input-right\">\n {RightComponent}\n {withArrow && <span className=\"arrow\" />}\n </div>\n </div>\n );\n});\nexport default FormInput;\n"],"names":["FormInput","forwardRef","props","formRef","onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","_a","readonly","_b","withArrow","_c","direction","_d","border","mainExtra","_e","padding","className","rest","__rest","handleChange","e","inputValue","inputRange","target","handleBlur","inputRef","useRef","useImperativeHandle","focus","current","wrapperCls","classNames","column","process","env","TARO_ENV","React","createElement","View","dangerouslySetInnerHTML","__html","Text","Input","ref","onInput","maxLength"],"mappings":"iSA+EA,IAAMA,EAAYC,GAAyC,SAACC,EAAOC,GAE/D,IAAAC,EAqBEF,EAAKE,SApBPC,EAoBEH,EApBOG,UACTC,EAmBEJ,EAAKI,MAlBPC,EAkBEL,EAlBEK,KACJC,EAiBEN,EAAKM,YAhBPC,EAgBEP,EAhBGO,MACLC,EAeER,EAAKQ,UAdPC,EAcET,EAdYS,eACdC,EAaEV,EAAKU,OAZPC,EAYEX,EAZKW,QACPC,EAWEZ,EAAKY,cAVPC,EAUEb,EAVMa,SACRC,EASEd,EATEc,KACJC,EAQEf,EARcgB,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAOEjB,EAAKkB,UAPPA,OAAY,IAAAD,GAAKA,EACjBE,EAMEnB,EANeoB,UAAjBA,OAAS,IAAAD,EAAG,MAAKA,EACjBE,EAKErB,EAAKsB,OALPA,OAAS,IAAAD,GAAIA,EACbE,EAIEvB,EAAKuB,UA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ACKzB,EAAI,CACR0B,IAAKlB,EACLT,UAAU,mCACVvB,UAAWA,EACXW,KAAMA,EACNR,YAAaA,EACbD,KAAMA,EACND,MAAOA,EACPM,OAAQwB,EACRoB,QAASzB,MAIdN,GACCuB,EAACC,cAAAC,EAAK,CAAAtB,UAAU,4BAA4BH,IAGhDuB,EAAAC,cAACC,EAAI,CAACtB,UAAU,uBACbjB,EACAS,GAAa4B,EAACC,cAAAC,EAAK,CAAAtB,UAAU,YAOpCoB,EAAAC,cAAA,MAAA,CAAKrB,UAAWc,GACdM,EAAKC,cAAA,MAAA,CAAArB,UAAU,sBACboB,EAAKC,cAAA,MAAA,CAAArB,UAAU,2BACZnB,GACCuC,EAAOC,cAAA,QAAA,CAAArB,UAAU,iCACdnB,EACAM,GACCiC,EAAAC,cAAA,MAAA,CAAKrB,UAAU,sCACZb,IAKRL,GACCsC,EACEC,cAAA,QAAA,CAAAE,wBAAyB,CAAEC,OAAQ1C,GACnCkB,UAAU,UAGdoB,EAAMC,cAAA,MAAA,KAAAnC,IAERkC,EAAAC,cAAA,MAAA,CAAKrB,UAAU,6BACZV,EACC8B,qBACEpB,UAAWe,EAAW,qCAAsC,CAC1D,kCAAmCrC,KAGpCA,GAASE,GAGZwC,EACEC,cAAA,QAAA,CAAAM,IAAKlB,EACLT,UAAU,mCACV6B,UAAWpD,EACXW,KAAMA,EACNH,QAASA,EACTL,YAAaA,EACbD,KAAMA,EACND,MAAOA,EACPM,OAAQwB,EACRoB,QAASzB,KAIdN,GACCuB,EAAAC,cAAA,MAAA,CAAKrB,UAAU,4BAA4BH,IAG/CuB,EAAKC,cAAA,MAAA,CAAArB,UAAU,uBACZjB,EACAS,GAAa4B,wBAAMpB,UAAU,WAItC"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/FormInput/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useRef,\n useImperativeHandle,\n forwardRef,\n} from \"react\";\nimport {\n Input,\n View,\n Text,\n InputProps,\n CommonEventFunction,\n} from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport { inputRange } from \"../../utils/index\";\n\nimport \"./index.scss\";\n\nexport type HTMLFormType =\n | \"tel\"\n | \"text\"\n | \"number\"\n | \"password\"\n | \"idcard\"\n | \"digit\"\n | \"safe-password\"\n | \"nickname\";\n\nexport type FormInputProps = {\n onChange?: (value: string) => void;\n onBlur?: (value: string) => void;\n /** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。\n * @supported weapp, h5, rn\n */\n onInput?: CommonEventFunction<InputProps.inputEventDetail>;\n\n /** 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\n * @supported weapp, h5, rn\n */\n onFocus?: CommonEventFunction<InputProps.inputForceEventDetail>;\n\n /** 输入框失去焦点时触发\n *\n * event.detail = {value: value}\n * @supported weapp, h5, rn\n */\n value?: string;\n maxlength?: number;\n placeholder?: string;\n type?: HTMLFormType;\n pattern?: string;\n RightComponent?: ReactNode;\n label?: string;\n labelHtml?: string;\n LeftComponent?: ReactNode;\n LeftIcon?: ReactNode;\n name?: string;\n readonly?: boolean;\n withArrow?: boolean;\n direction?: \"row\" | \"column\";\n border?: boolean;\n mainExtra?: ReactNode;\n padding?: boolean;\n password?: boolean;\n focus?: boolean;\n /** 设置键盘右下角按钮的文字\n * @default done\n * @supported weapp, rn\n */\n confirmType?: \"send\" | \"search\" | \"next\" | \"go\" | \"done\";\n /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上\n * @supported h5\n */\n nativeProps?: Record<string, unknown>;\n className?: string;\n};\n\nexport type FocusHandler = { focus: () => void };\n\nconst FormInput = forwardRef<FocusHandler, FormInputProps>((props, formRef) => {\n const {\n onChange,\n maxlength,\n value,\n type,\n placeholder,\n label,\n labelHtml,\n RightComponent,\n onBlur,\n pattern,\n LeftComponent,\n LeftIcon,\n name,\n readonly = false,\n withArrow = false,\n direction = \"row\",\n border = true,\n mainExtra,\n padding = false,\n className,\n ...rest\n } = props;\n\n function handleChange(e): any {\n let inputValue = inputRange(e.target.value);\n e.target.value = inputValue;\n onChange && onChange(inputValue);\n }\n\n function handleBlur(e): any {\n let inputValue = inputRange(e.target.value);\n onBlur && onBlur(inputValue);\n }\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(formRef, () => ({\n focus() {\n inputRef.current?.focus();\n },\n }));\n\n const wrapperCls = classNames(\n \"xh-form-input\",\n {\n column: direction === \"column\",\n border,\n padding,\n },\n className\n );\n\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View className={wrapperCls}>\n <View className=\"xh-form-input-main\">\n <View className=\"xh-form-input-main-left\">\n {label && (\n <View className=\"xh-form-input-main-left-label\">\n {label}\n {LeftIcon && (\n <View className=\"xh-form-input-main-left-label-icon\">\n {LeftIcon}\n </View>\n )}\n </View>\n )}\n {labelHtml && (\n <label\n dangerouslySetInnerHTML={{ __html: labelHtml }}\n className=\"label\"\n />\n )}\n <View>{LeftComponent}</View>\n </View>\n <View className=\"xh-form-input-main-center\">\n {readonly ? (\n <Text\n className={classNames(\"xh-form-input-readonly\", {\n \"xh-form-input-placeholder\": !value,\n })}\n >\n {value || placeholder}\n </Text>\n ) : (\n <Input\n {...rest}\n ref={inputRef}\n className=\"xh-form-input-main-center-native\"\n maxlength={maxlength}\n name={name}\n placeholder={placeholder}\n type={type as InputProps[\"type\"]}\n value={value}\n onBlur={handleBlur}\n onInput={handleChange}\n />\n )}\n </View>\n {mainExtra && (\n <View className=\"xh-form-input-main-extra\">{mainExtra}</View>\n )}\n </View>\n <View className=\"xh-form-input-right\">\n {RightComponent}\n {withArrow && <View className=\"arrow\" />}\n </View>\n </View>\n );\n }\n\n return (\n <div className={wrapperCls}>\n <div className=\"xh-form-input-main\">\n <div className=\"xh-form-input-main-left\">\n {label && (\n <label className=\"xh-form-input-main-left-label\">\n {label}\n {LeftIcon && (\n <div className=\"xh-form-input-main-left-label-icon\">\n {LeftIcon}\n </div>\n )}\n </label>\n )}\n {labelHtml && (\n <label\n dangerouslySetInnerHTML={{ __html: labelHtml }}\n className=\"label\"\n />\n )}\n <div>{LeftComponent}</div>\n </div>\n <div className=\"xh-form-input-main-center\">\n {readonly ? (\n <p\n className={classNames(\"xh-form-input-main-center-readonly\", {\n \"xh-form-input-main-placeholder\": !value,\n })}\n >\n {value || placeholder}\n </p>\n ) : (\n <input\n ref={inputRef}\n className=\"xh-form-input-main-center-native\"\n maxLength={maxlength}\n name={name}\n pattern={pattern}\n placeholder={placeholder}\n type={type}\n value={value}\n onBlur={handleBlur}\n onInput={handleChange}\n />\n )}\n </div>\n {mainExtra && (\n <div className=\"xh-form-input-main-extra\">{mainExtra}</div>\n )}\n </div>\n <div className=\"xh-form-input-right\">\n {RightComponent}\n {withArrow && <span className=\"arrow\" />}\n </div>\n </div>\n );\n});\nexport default FormInput;\n"],"names":["FormInput","forwardRef","props","formRef","onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","_a","readonly","_b","withArrow","_c","direction","_d","border","mainExtra","_e","padding","className","rest","__rest","handleChange","e","inputValue","inputRange","target","handleBlur","inputRef","useRef","useImperativeHandle","focus","current","wrapperCls","classNames","column","process","env","TARO_ENV","React","createElement","View","dangerouslySetInnerHTML","__html","Text","Input","ref","onInput","maxLength"],"mappings":"iSA+EA,IAAMA,EAAYC,GAAyC,SAACC,EAAOC,GAE/D,IAAAC,EAqBEF,EAAKE,SApBPC,EAoBEH,EApBOG,UACTC,EAmBEJ,EAAKI,MAlBPC,EAkBEL,EAlBEK,KACJC,EAiBEN,EAAKM,YAhBPC,EAgBEP,EAhBGO,MACLC,EAeER,EAAKQ,UAdPC,EAcET,EAdYS,eACdC,EAaEV,EAAKU,OAZPC,EAYEX,EAZKW,QACPC,EAWEZ,EAAKY,cAVPC,EAUEb,EAVMa,SACRC,EASEd,EATEc,KACJC,EAQEf,EARcgB,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAOEjB,EAAKkB,UAP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- {"version":3,"file":"index.js","sources":["../../../src/components/Icon/index.tsx"],"sourcesContent":["import React from \"react\";\nimport classNames from \"classnames\";\nimport { pxTransform } from \"@/utils\";\nimport type { StandardLonghandProperties } from \"csstype\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type XHIcon =\n | \"prompt\"\n | \"score\"\n | \"info\"\n | \"failure\"\n | \"success\"\n | \"loading\"\n | \"back\"\n | \"notice\"\n | \"scan\"\n | \"light\"\n | \"faceScan\"\n | \"delete\"\n | \"radioFull\"\n | \"checkboxFull\"\n | \"checkedSquare\"\n | \"checked2\"\n | \"arrowTop\"\n | \"notice2\"\n | \"position\"\n | \"contacts\"\n | \"billFull\"\n | \"bill2\"\n | \"bill3\"\n | \"bill4\"\n | \"edit\"\n | \"editFull\"\n | \"camera\"\n | \"close\"\n | \"gift\"\n | \"message\"\n | \"user\"\n | \"wenhao\"\n | \"kefu\"\n | \"play\"\n | \"arrowLeft\"\n | \"arrowRight\"\n | \"keyboardClose\"\n | \"add\"\n | \"tongxunlu\"\n | \"zhuyi\"\n | \"duigou\"\n | \"edit2\"\n | \"alipay\"\n | \"wechat\"\n | \"friendPay\"\n | \"pen\"\n | \"location\"\n | \"waiting\";\n\nexport type XHIconProps = {\n icon: XHIcon;\n size?: number;\n color?: StandardLonghandProperties[\"color\"];\n style?: React.CSSProperties;\n onClick?: () => void;\n} & XHComponentCommonProps;\n\nconst Icon: React.FC<XHIconProps> = props => {\n const { icon = \"\", size = 0, className, color, style, ...rest } = props;\n\n const fixIcon = icon && `xh-icon-${icon}`;\n const iconCls = classNames(\"xh-icon\", fixIcon, className);\n\n const finalStyle: React.CSSProperties = {\n ...style,\n fontSize: pxTransform(size),\n color,\n };\n\n return <span className={iconCls} {...{ style: finalStyle }} {...rest} />;\n};\n\nexport default Icon;\n"],"names":["Icon","props","_a","icon","_b","size","className","color","style","rest","__rest","fixIcon","concat","iconCls","classNames","finalStyle","__assign","fontSize","pxTransform","React","createElement"],"mappings":"6KAkEM,IAAAA,EAA8B,SAAAC,GAC1B,IAAAC,EAA0DD,EAAKE,KAA/DA,aAAO,GAAED,EAAEE,EAA+CH,EAAvCI,KAARA,OAAO,IAAAD,EAAA,IAAGE,EAAqCL,YAA1BM,EAA0BN,EAAKM,MAAxBC,EAAmBP,EAAKO,MAAdC,EAAIC,EAAKT,EAA5D,CAAA,OAAA,OAAA,YAAA,QAAA,UAEAU,EAAUR,GAAQ,WAAWS,OAAAT,GAC7BU,EAAUC,EAAW,UAAWH,EAASL,GAEzCS,EAAUC,EAAAA,EAAA,CAAA,EACXR,GAAK,CACRS,SAAUC,EAAYb,GACtBE,MAAKA,IAGP,OAAOY,EAAMC,cAAA,OAAAJ,EAAA,CAAAV,UAAWO,GAAa,CAAEL,MAAOO,GAAkBN,GAClE"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Icon/index.tsx"],"sourcesContent":["import React from \"react\";\nimport classNames from \"classnames\";\nimport { pxTransform } from \"@/utils\";\nimport type { StandardLonghandProperties } from \"csstype\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type XHIcon =\n | \"prompt\"\n | \"score\"\n | \"info\"\n | \"failure\"\n | \"success\"\n | \"loading\"\n | \"back\"\n | \"notice\"\n | \"scan\"\n | \"light\"\n | \"faceScan\"\n | \"delete\"\n | \"radioFull\"\n | \"checkboxFull\"\n | \"checkedSquare\"\n | \"checked2\"\n | \"arrowTop\"\n | \"notice2\"\n | \"position\"\n | \"contacts\"\n | \"billFull\"\n | \"bill2\"\n | \"bill3\"\n | \"bill4\"\n | \"edit\"\n | \"editFull\"\n | \"camera\"\n | \"close\"\n | \"gift\"\n | \"message\"\n | \"user\"\n | \"wenhao\"\n | \"kefu\"\n | \"play\"\n | \"arrowLeft\"\n | \"arrowRight\"\n | \"keyboardClose\"\n | \"add\"\n | \"tongxunlu\"\n | \"zhuyi\"\n | \"duigou\"\n | \"edit2\"\n | \"alipay\"\n | \"wechat\"\n | \"friendPay\"\n | \"pen\"\n | \"location\"\n | \"search\"\n | \"qa\"\n | \"thumbsUp\"\n | \"thumbsDown\"\n | \"thumbsUpFull\"\n | \"thumbsDownFull\"\n | \"waiting\"\n | (string & {});\n\nexport type XHIconProps = {\n icon: XHIcon;\n size?: number;\n color?: StandardLonghandProperties[\"color\"];\n style?: React.CSSProperties;\n onClick?: () => void;\n} & XHComponentCommonProps;\n\nconst Icon: React.FC<XHIconProps> = props => {\n const { icon = \"\", size = 0, className, color, style, ...rest } = props;\n\n const fixIcon = icon && `xh-icon-${icon}`;\n const iconCls = classNames(\"xh-icon\", fixIcon, className);\n\n const finalStyle: React.CSSProperties = {\n ...style,\n fontSize: pxTransform(size),\n color,\n };\n\n return <span className={iconCls} {...{ style: finalStyle }} {...rest} />;\n};\n\nexport default Icon;\n"],"names":["Icon","props","_a","icon","_b","size","className","color","style","rest","__rest","fixIcon","concat","iconCls","classNames","finalStyle","__assign","fontSize","pxTransform","React","createElement"],"mappings":"6KAyEM,IAAAA,EAA8B,SAAAC,GAC1B,IAAAC,EAA0DD,EAAKE,KAA/DA,aAAO,GAAED,EAAEE,EAA+CH,EAAvCI,KAARA,OAAO,IAAAD,EAAA,IAAGE,EAAqCL,YAA1BM,EAA0BN,EAAKM,MAAxBC,EAAmBP,EAAKO,MAAdC,EAAIC,EAAKT,EAA5D,CAAA,OAAA,OAAA,YAAA,QAAA,UAEAU,EAAUR,GAAQ,WAAWS,OAAAT,GAC7BU,EAAUC,EAAW,UAAWH,EAASL,GAEzCS,EAAUC,EAAAA,EAAA,CAAA,EACXR,GAAK,CACRS,SAAUC,EAAYb,GACtBE,MAAKA,IAGP,OAAOY,EAAMC,cAAA,OAAAJ,EAAA,CAAAV,UAAWO,GAAa,CAAEL,MAAOO,GAAkBN,GAClE"}
@@ -1,2 +1,2 @@
1
- import t from"react";import e from"classnames";import{View as s}from"@tarojs/components";var a=t.createElement("span",{className:"".concat("xh-step","-icon-dot")}),r=function(r){var n=r.direction,o=void 0===n?"horizontal":n,c=r.current,i=void 0===c?0:c,l=r.style,m=r.className,p=e("xh-steps","".concat("xh-steps","-").concat(o),m);return t.createElement(s,{className:p,style:l},t.Children.map(r.children,(function(e,s){var r;if(!t.isValidElement(e))return e;var n=e.props,c=n.status||"wait";s<i?c=n.status||"finish":s===i&&(c=n.status||"process");var l=null!==(r=n.icon)&&void 0!==r?r:a;return t.cloneElement(e,{status:c,icon:l,direction:o})})))};export{r as default};
1
+ import t from"react";import e from"classnames";import{View as s}from"@tarojs/components";var a=t.createElement("span",{className:"".concat("xh-step","-icon-dot")}),r=function(r){var n=r.direction,o=void 0===n?"horizontal":n,c=r.current,i=void 0===c?0:c,l=r.style,m=r.className,d=r.dashed,p=void 0!==d&&d,u=e("xh-steps","".concat("xh-steps","-").concat(o),m);return t.createElement(s,{className:u,style:l},t.Children.map(r.children,(function(e,s){var r;if(!t.isValidElement(e))return e;var n=e.props,c=n.status||"wait";s<i?c=n.status||"finish":s===i&&(c=n.status||"process");var l=null!==(r=n.icon)&&void 0!==r?r:a;return t.cloneElement(e,{status:c,icon:l,direction:o,dashed:p})})))};export{r as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Step/Steps/index.tsx"],"sourcesContent":["import React, { FC, ReactElement } from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport type { XHComponentCommonProps } from \"../../../types\";\n\nimport { StepProps } from \"..\";\n\nconst classPrefix = `xh-steps`;\nconst stepClassPrefix = `xh-step`;\n\nconst defaultIcon = <span className={`${stepClassPrefix}-icon-dot`} />;\n\nexport type StepsProps = {\n current?: number;\n direction?: \"horizontal\" | \"vertical\";\n children?: React.ReactNode;\n style?: React.CSSProperties & {\n \"--line-to-next-color\"?: string;\n \"--color-primary\"?: string;\n };\n} & XHComponentCommonProps;\n\nconst Steps: FC<StepsProps> = props => {\n const { direction = \"horizontal\", current = 0, style, className } = props;\n const classString = classNames(\n classPrefix,\n `${classPrefix}-${direction}`,\n className\n );\n\n return (\n <View className={classString} style={style}>\n {React.Children.map(\n props.children,\n (child: ReactElement<StepProps>, index) => {\n if (!React.isValidElement(child)) {\n return child;\n }\n const props = child.props;\n\n let status = props.status || \"wait\";\n if (index < current) {\n status = props.status || \"finish\";\n } else if (index === current) {\n status = props.status || \"process\";\n }\n\n const icon = props.icon ?? defaultIcon;\n\n return React.cloneElement(child, {\n status,\n icon,\n direction,\n });\n }\n )}\n </View>\n );\n};\n\nexport default Steps;\n"],"names":["defaultIcon","React","createElement","className","concat","Steps","props","_a","direction","_b","current","style","classString","classNames","View","Children","map","children","child","index","isValidElement","status","icon","cloneElement"],"mappings":"yFAOA,IAGMA,EAAcC,EAAMC,cAAA,OAAA,CAAAC,UAAW,GAAGC,OAFhB,UAE0C,eAY5DC,EAAwB,SAAAC,GACpB,IAAAC,EAA4DD,EAAKE,UAAjEA,OAAY,IAAAD,EAAA,aAAYA,EAAEE,EAAkCH,EAAvBI,QAAXA,OAAO,IAAAD,EAAG,EAACA,EAAEE,EAAqBL,EAAhBK,MAAER,EAAcG,EAAKH,UACnES,EAAcC,EAjBF,WAmBhB,GAAAT,OAnBgB,WAmBF,KAAAA,OAAII,GAClBL,GAGF,OACEF,EAACC,cAAAY,EAAK,CAAAX,UAAWS,EAAaD,MAAOA,GAClCV,EAAMc,SAASC,IACdV,EAAMW,UACN,SAACC,EAAgCC,SAC/B,IAAKlB,EAAMmB,eAAeF,GACxB,OAAOA,EAET,IAAMZ,EAAQY,EAAMZ,MAEhBe,EAASf,EAAMe,QAAU,OACzBF,EAAQT,EACVW,EAASf,EAAMe,QAAU,SAChBF,IAAUT,IACnBW,EAASf,EAAMe,QAAU,WAG3B,IAAMC,EAAiB,QAAVf,EAAAD,EAAMgB,YAAI,IAAAf,EAAAA,EAAIP,EAE3B,OAAOC,EAAMsB,aAAaL,EAAO,CAC/BG,OAAMA,EACNC,KAAIA,EACJd,UAASA,GAEZ,IAIT"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Step/Steps/index.tsx"],"sourcesContent":["import React, { FC, ReactElement } from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport type { XHComponentCommonProps } from \"../../../types\";\n\nimport { StepProps } from \"..\";\n\nconst classPrefix = `xh-steps`;\nconst stepClassPrefix = `xh-step`;\n\nconst defaultIcon = <span className={`${stepClassPrefix}-icon-dot`} />;\n\nexport type StepsProps = {\n current?: number;\n direction?: \"horizontal\" | \"vertical\";\n children?: React.ReactNode;\n style?: React.CSSProperties & {\n \"--line-to-next-color\"?: string;\n \"--color-primary\"?: string;\n };\n dashed?: boolean;\n} & XHComponentCommonProps;\n\nconst Steps: FC<StepsProps> = props => {\n const {\n direction = \"horizontal\",\n current = 0,\n style,\n className,\n dashed = false,\n } = props;\n const classString = classNames(\n classPrefix,\n `${classPrefix}-${direction}`,\n className\n );\n\n return (\n <View className={classString} style={style}>\n {React.Children.map(\n props.children,\n (child: ReactElement<StepProps>, index) => {\n if (!React.isValidElement(child)) {\n return child;\n }\n const props = child.props;\n\n let status = props.status || \"wait\";\n if (index < current) {\n status = props.status || \"finish\";\n } else if (index === current) {\n status = props.status || \"process\";\n }\n\n const icon = props.icon ?? defaultIcon;\n\n return React.cloneElement(child, {\n status,\n icon,\n direction,\n dashed,\n });\n }\n )}\n </View>\n );\n};\n\nexport default Steps;\n"],"names":["defaultIcon","React","createElement","className","concat","Steps","props","_a","direction","_b","current","style","_c","dashed","classString","classNames","View","Children","map","children","child","index","isValidElement","status","icon","cloneElement"],"mappings":"yFAOA,IAGMA,EAAcC,EAAMC,cAAA,OAAA,CAAAC,UAAW,GAAGC,OAFhB,UAE0C,eAa5DC,EAAwB,SAAAC,GAE1B,IAAAC,EAKED,EAAKE,UALPA,aAAY,aAAYD,EACxBE,EAIEH,EAJSI,QAAXA,OAAO,IAAAD,EAAG,EAACA,EACXE,EAGEL,EAHGK,MACLR,EAEEG,EAFOH,UACTS,EACEN,SADFO,OAAS,IAAAD,KAELE,EAAcC,EAxBF,WA0BhB,GAAAX,OA1BgB,WA0BF,KAAAA,OAAII,GAClBL,GAGF,OACEF,EAACC,cAAAc,EAAK,CAAAb,UAAWW,EAAaH,MAAOA,GAClCV,EAAMgB,SAASC,IACdZ,EAAMa,UACN,SAACC,EAAgCC,SAC/B,IAAKpB,EAAMqB,eAAeF,GACxB,OAAOA,EAET,IAAMd,EAAQc,EAAMd,MAEhBiB,EAASjB,EAAMiB,QAAU,OACzBF,EAAQX,EACVa,EAASjB,EAAMiB,QAAU,SAChBF,IAAUX,IACnBa,EAASjB,EAAMiB,QAAU,WAG3B,IAAMC,EAAiB,QAAVjB,EAAAD,EAAMkB,YAAI,IAAAjB,EAAAA,EAAIP,EAE3B,OAAOC,EAAMwB,aAAaL,EAAO,CAC/BG,OAAMA,EACNC,KAAIA,EACJhB,UAASA,EACTK,OAAMA,GAET,IAIT"}
@@ -1,2 +1,2 @@
1
- import e from"react";import t from"classnames";import{View as a}from"@tarojs/components";import c from"./Steps/index.js";var s=function(c){var s=c.title,n=c.description,o=c.icon,r=c.status,m=void 0===r?"wait":r,i=c.fancy,l=c.style,p=c.className,x=c.direction,f=c.prefix;return e.createElement(a,{className:t("".concat("xh-step"),"".concat("xh-step","-status-").concat(m),p),style:l},"vertical"===x&&f&&e.createElement(a,{className:"".concat("xh-step","-prefix")},f),e.createElement(a,{className:"".concat("xh-step","-indicator")},e.createElement(a,{className:t("".concat("xh-step","-icon-container"),{fancy:i})},o)),e.createElement(a,{className:"".concat("xh-step","-content")},e.createElement(a,{className:"".concat("xh-step","-title")},s),!!n&&e.createElement(a,{className:"".concat("xh-step","-description")},n)))};s.Steps=c;export{s as default};
1
+ import e from"react";import t from"classnames";import{View as a}from"@tarojs/components";import c from"./Steps/index.js";var s=function(c){var s=c.title,n=c.description,o=c.icon,r=c.status,m=void 0===r?"wait":r,i=c.fancy,l=c.style,p=c.className,x=c.direction,d=c.prefix,f=c.dashed;return e.createElement(a,{className:t("".concat("xh-step"),"".concat("xh-step","-status-").concat(m),p),style:l},"vertical"===x&&d&&e.createElement(a,{className:"".concat("xh-step","-prefix")},d),e.createElement(a,{className:t("".concat("xh-step","-indicator"),{dashed:f})},e.createElement(a,{className:t("".concat("xh-step","-icon-container"),{fancy:i})},o)),e.createElement(a,{className:"".concat("xh-step","-content")},e.createElement(a,{className:"".concat("xh-step","-title")},s),!!n&&e.createElement(a,{className:"".concat("xh-step","-description")},n)))};s.Steps=c;export{s as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Step/index.tsx"],"sourcesContent":["import React, { ReactNode, ForwardRefExoticComponent } from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport type { XHComponentCommonProps } from \"../../types\";\n\nimport Steps from \"./Steps\";\nimport \"./index.scss\";\n\nexport type StepProps = {\n icon?: string | ReactNode;\n title: string | ReactNode;\n description?: string | ReactNode;\n direction?: \"horizontal\" | \"vertical\";\n status?: \"wait\" | \"process\" | \"finish\" | \"error\";\n fancy?: boolean;\n style?: React.CSSProperties;\n prefix?: ReactNode;\n} & XHComponentCommonProps;\n\nconst classPrefix = \"xh-step\";\n\nconst Step: React.FC<StepProps> = props => {\n const {\n title,\n description,\n icon,\n status = \"wait\",\n fancy,\n style,\n className,\n direction,\n prefix,\n } = props;\n\n return (\n <View\n className={classNames(\n `${classPrefix}`,\n `${classPrefix}-status-${status}`,\n className\n )}\n style={style}\n >\n {direction === \"vertical\" && prefix && (\n <View className={`${classPrefix}-prefix`}>{prefix}</View>\n )}\n <View className={`${classPrefix}-indicator`}>\n <View\n className={classNames(`${classPrefix}-icon-container`, { fancy })}\n >\n {icon}\n </View>\n </View>\n <View className={`${classPrefix}-content`}>\n <View className={`${classPrefix}-title`}>{title}</View>\n {!!description && (\n <View className={`${classPrefix}-description`}>{description}</View>\n )}\n </View>\n </View>\n );\n};\n\nexport type HybridComponent = ForwardRefExoticComponent<StepProps> & {\n Steps: typeof Steps;\n};\n\nconst XHStep = Step as HybridComponent;\nXHStep.Steps = Steps;\n\nexport default XHStep;\n"],"names":["XHStep","props","title","description","icon","_a","status","fancy","style","className","direction","prefix","React","View","classNames","concat","createElement","Steps"],"mappings":"yHAmBA,IAgDMA,EA9C4B,SAAAC,GAE9B,IAAAC,EASED,EAAKC,MARPC,EAQEF,EAAKE,YAPPC,EAOEH,EAAKG,KANPC,EAMEJ,SANFK,OAAS,IAAAD,EAAA,OAAMA,EACfE,EAKEN,QAJFO,EAIEP,EAAKO,MAHPC,EAGER,YAFFS,EAEET,EAAKS,UADPC,EACEV,EAAKU,OAET,OACEC,gBAACC,EAAI,CACHJ,UAAWK,EACT,GAAAC,OAlBY,WAmBZ,GAAGA,OAnBS,UAmBa,YAAAA,OAAAT,GACzBG,GAEFD,MAAOA,GAEQ,aAAdE,GAA4BC,GAC3BC,EAACI,cAAAH,EAAK,CAAAJ,UAAW,GAAGM,OAzBR,sBAyB+BJ,GAE7CC,EAAAI,cAACH,EAAK,CAAAJ,UAAW,GAAAM,OA3BH,UA2B6B,eACzCH,EAAAI,cAACH,EACC,CAAAJ,UAAWK,EAAW,UA7BZ,UA6B0B,mBAAmB,CAAEP,MAAKA,KAE7DH,IAGLQ,EAAAI,cAACH,EAAK,CAAAJ,UAAW,GAAAM,OAlCH,UAkC2B,aACvCH,EAACI,cAAAH,GAAKJ,UAAW,UAnCL,UAmCmB,WAAWP,KACvCC,GACDS,EAACI,cAAAH,GAAKJ,UAAW,UArCP,UAqCqB,iBAAiBN,IAK1D,EAOAH,EAAOiB,MAAQA"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Step/index.tsx"],"sourcesContent":["import React, { ReactNode, ForwardRefExoticComponent } from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport type { XHComponentCommonProps } from \"../../types\";\n\nimport Steps from \"./Steps\";\nimport \"./index.scss\";\n\nexport type StepProps = {\n icon?: string | ReactNode;\n title: string | ReactNode;\n description?: string | ReactNode;\n direction?: \"horizontal\" | \"vertical\";\n status?: \"wait\" | \"process\" | \"finish\" | \"error\";\n fancy?: boolean;\n dashed?: boolean;\n style?: React.CSSProperties;\n prefix?: ReactNode;\n} & XHComponentCommonProps;\n\nconst classPrefix = \"xh-step\";\n\nconst Step: React.FC<StepProps> = props => {\n const {\n title,\n description,\n icon,\n status = \"wait\",\n fancy,\n style,\n className,\n direction,\n prefix,\n dashed,\n } = props;\n\n return (\n <View\n className={classNames(\n `${classPrefix}`,\n `${classPrefix}-status-${status}`,\n className\n )}\n style={style}\n >\n {direction === \"vertical\" && prefix && (\n <View className={`${classPrefix}-prefix`}>{prefix}</View>\n )}\n <View className={classNames(`${classPrefix}-indicator`, { dashed })}>\n <View\n className={classNames(`${classPrefix}-icon-container`, { fancy })}\n >\n {icon}\n </View>\n </View>\n <View className={`${classPrefix}-content`}>\n <View className={`${classPrefix}-title`}>{title}</View>\n {!!description && (\n <View className={`${classPrefix}-description`}>{description}</View>\n )}\n </View>\n </View>\n );\n};\n\nexport type HybridComponent = ForwardRefExoticComponent<StepProps> & {\n Steps: typeof Steps;\n};\n\nconst XHStep = Step as HybridComponent;\nXHStep.Steps = Steps;\n\nexport default XHStep;\n"],"names":["XHStep","props","title","description","icon","_a","status","fancy","style","className","direction","prefix","dashed","React","View","classNames","concat","createElement","Steps"],"mappings":"yHAoBA,IAiDMA,EA/C4B,SAAAC,GAE9B,IAAAC,EAUED,EAVGC,MACLC,EASEF,EATSE,YACXC,EAQEH,EAREG,KACJC,EAOEJ,EAPaK,OAAfA,OAAS,IAAAD,EAAA,OAAMA,EACfE,EAMEN,EANGM,MACLC,EAKEP,EAAKO,MAJPC,EAIER,EAAKQ,UAHPC,EAGET,EAAKS,UAFPC,EAEEV,EAFIU,OACNC,EACEX,EAAKW,OAET,OACEC,gBAACC,EAAI,CACHL,UAAWM,EACT,GAAAC,OAnBY,WAoBZ,GAAGA,OApBS,UAoBa,YAAAA,OAAAV,GACzBG,GAEFD,MAAOA,GAEQ,aAAdE,GAA4BC,GAC3BE,EAACI,cAAAH,EAAK,CAAAL,UAAW,GAAGO,OA1BR,sBA0B+BL,GAE7CE,EAAAI,cAACH,EAAI,CAACL,UAAWM,EAAW,GAAAC,OA5Bd,UA4B4B,cAAc,CAAEJ,OAAMA,KAC9DC,EAAAI,cAACH,EACC,CAAAL,UAAWM,EAAW,UA9BZ,UA8B0B,mBAAmB,CAAER,MAAKA,KAE7DH,IAGLS,EAAAI,cAACH,EAAK,CAAAL,UAAW,GAAAO,OAnCH,UAmC2B,aACvCH,EAACI,cAAAH,GAAKL,UAAW,UApCL,UAoCmB,WAAWP,KACvCC,GACDU,EAACI,cAAAH,GAAKL,UAAW,UAtCP,UAsCqB,iBAAiBN,IAK1D,EAOAH,EAAOkB,MAAQA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/ThemeProvider/index.tsx"],"sourcesContent":["import React, { createContext } from \"react\";\nimport cssVars from \"css-vars-ponyfill\";\n\nexport type ThemeValue = {\n \"--color-primary\"?: string;\n \"--color-primary-dark\"?: string;\n \"--color-primary-reverse\"?: string;\n \"--color-disabled\"?: string;\n \"--color-warning\"?: string;\n \"--color-warning-light\"?: string;\n \"--background-color\"?: string;\n \"--body-background-color\"?: string;\n \"--font-color\"?: string;\n \"--font-color-secondary\"?: string;\n \"--font-color-tertiary\"?: string;\n \"--border-color\"?: string;\n \"--btn-color\"?: string;\n \"--btn-shadow-primary\"?: string;\n \"--mask-color\"?: string;\n};\n\nexport type ThemeProviderProps = {\n value: ThemeValue;\n scoped?: boolean;\n};\n\nconst createTheme = (theme: { [key: string]: string }) => {\n return createContext({ ...theme });\n};\n\nexport const ThemeContext = createTheme({});\n\nconst ThemeProvider: React.FC<ThemeProviderProps> = ({\n children,\n value,\n scoped = false,\n}) => {\n let clonedElement = children;\n if (!scoped) {\n Object.keys(value).forEach(key => {\n document.body.style.setProperty(key, value[key]);\n });\n } else {\n clonedElement = React.Children.map(children, (child, index) => {\n if (index === 0) {\n return React.cloneElement(child as any, {\n style: value,\n });\n } else {\n return child;\n }\n });\n }\n\n cssVars({\n variables: value as { [key: string]: string },\n });\n\n return (\n <ThemeContext.Provider value={value}>{clonedElement}</ThemeContext.Provider>\n );\n};\n\nexport default ThemeProvider;\n"],"names":["ThemeContext","createContext","__assign","ThemeProvider","_a","children","value","_b","clonedElement","React","Children","map","child","index","cloneElement","style","Object","keys","forEach","key","document","body","setProperty","cssVars","variables","createElement","Provider"],"mappings":"sLA0BA,IAIaA,EAHJC,EAAaC,EAAA,GAGkB,KAElCC,EAA8C,SAACC,OACnDC,EAAQD,EAAAC,SACRC,EAAKF,EAAAE,MACLC,WAEIC,EAAgBH,EAqBpB,YAvBS,IAAAE,GAAKA,EAQZC,EAAgBC,EAAMC,SAASC,IAAIN,GAAU,SAACO,EAAOC,GACnD,OAAc,IAAVA,EACKJ,EAAMK,aAAaF,EAAc,CACtCG,MAAOT,IAGFM,CAEX,IAZAI,OAAOC,KAAKX,GAAOY,SAAQ,SAAAC,GACzBC,SAASC,KAAKN,MAAMO,YAAYH,EAAKb,EAAMa,GAC7C,IAaFI,EAAQ,CACNC,UAAWlB,IAIXG,EAAAgB,cAACzB,EAAa0B,SAAQ,CAACpB,MAAOA,GAAQE,EAE1C"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/ThemeProvider/index.tsx"],"sourcesContent":["import React, { createContext, PropsWithChildren } from \"react\";\nimport cssVars from \"css-vars-ponyfill\";\n\nexport type ThemeValue = {\n \"--color-primary\"?: string;\n \"--color-primary-dark\"?: string;\n \"--color-primary-reverse\"?: string;\n \"--color-disabled\"?: string;\n \"--color-warning\"?: string;\n \"--color-warning-light\"?: string;\n \"--background-color\"?: string;\n \"--body-background-color\"?: string;\n \"--font-color\"?: string;\n \"--font-color-secondary\"?: string;\n \"--font-color-tertiary\"?: string;\n \"--border-color\"?: string;\n \"--btn-color\"?: string;\n \"--btn-shadow-primary\"?: string;\n \"--mask-color\"?: string;\n \"--btn-color-disabled\"?: string;\n};\n\nexport type ThemeProviderProps = {\n value: ThemeValue & { [key: string]: string };\n scoped?: boolean;\n};\n\nconst createTheme = (theme: { [key: string]: string }) => {\n return createContext({ ...theme });\n};\n\nexport const ThemeContext = createTheme({});\n\nconst ThemeProvider: React.FC<PropsWithChildren<ThemeProviderProps>> = ({\n children,\n value,\n scoped = false,\n}) => {\n let clonedElement = children;\n if (!scoped) {\n Object.keys(value).forEach(key => {\n document.body.style.setProperty(key, value[key]);\n });\n } else {\n clonedElement = React.Children.map(children, (child, index) => {\n if (index === 0) {\n return React.cloneElement(child as any, {\n style: value,\n });\n } else {\n return child;\n }\n });\n }\n\n cssVars({\n variables: value as { [key: string]: string },\n });\n\n return (\n <ThemeContext.Provider value={value}>{clonedElement}</ThemeContext.Provider>\n );\n};\n\nexport default ThemeProvider;\n"],"names":["ThemeContext","createContext","__assign","ThemeProvider","_a","children","value","_b","clonedElement","React","Children","map","child","index","cloneElement","style","Object","keys","forEach","key","document","body","setProperty","cssVars","variables","createElement","Provider"],"mappings":"sLA2BA,IAIaA,EAHJC,EAAaC,EAAA,GAGkB,KAElCC,EAAiE,SAACC,OACtEC,EAAQD,EAAAC,SACRC,EAAKF,EAAAE,MACLC,WAEIC,EAAgBH,EAqBpB,YAvBS,IAAAE,GAAKA,EAQZC,EAAgBC,EAAMC,SAASC,IAAIN,GAAU,SAACO,EAAOC,GACnD,OAAc,IAAVA,EACKJ,EAAMK,aAAaF,EAAc,CACtCG,MAAOT,IAGFM,CAEX,IAZAI,OAAOC,KAAKX,GAAOY,SAAQ,SAAAC,GACzBC,SAASC,KAAKN,MAAMO,YAAYH,EAAKb,EAAMa,GAC7C,IAaFI,EAAQ,CACNC,UAAWlB,IAIXG,EAAAgB,cAACzB,EAAa0B,SAAQ,CAACpB,MAAOA,GAAQE,EAE1C"}