taro-react-uilib 1.0.4 → 1.0.23

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 (290) hide show
  1. package/dist/components/Animated/Animated.js +2 -0
  2. package/dist/components/Animated/Animated.js.map +1 -0
  3. package/dist/components/Animated/Fade/index.js +2 -0
  4. package/dist/components/Animated/Fade/index.js.map +1 -0
  5. package/dist/components/Animated/Slide/index.js +2 -0
  6. package/dist/components/Animated/Slide/index.js.map +1 -0
  7. package/dist/components/BankIcon/bank.js +2 -0
  8. package/dist/components/BankIcon/bank.js.map +1 -0
  9. package/dist/components/BankIcon/images/102.png.js +2 -0
  10. package/dist/components/BankIcon/images/102.png.js.map +1 -0
  11. package/dist/components/BankIcon/images/103.png.js +2 -0
  12. package/dist/components/BankIcon/images/103.png.js.map +1 -0
  13. package/dist/components/BankIcon/images/104.png.js +2 -0
  14. package/dist/components/BankIcon/images/104.png.js.map +1 -0
  15. package/dist/components/BankIcon/images/105.png.js +2 -0
  16. package/dist/components/BankIcon/images/105.png.js.map +1 -0
  17. package/dist/components/BankIcon/images/301.png.js +2 -0
  18. package/dist/components/BankIcon/images/301.png.js.map +1 -0
  19. package/dist/components/BankIcon/images/302.png.js +2 -0
  20. package/dist/components/BankIcon/images/302.png.js.map +1 -0
  21. package/dist/components/BankIcon/images/303.png.js +2 -0
  22. package/dist/components/BankIcon/images/303.png.js.map +1 -0
  23. package/dist/components/BankIcon/images/304.png.js +2 -0
  24. package/dist/components/BankIcon/images/304.png.js.map +1 -0
  25. package/dist/components/BankIcon/images/305.png.js +2 -0
  26. package/dist/components/BankIcon/images/305.png.js.map +1 -0
  27. package/dist/components/BankIcon/images/306.png.js +2 -0
  28. package/dist/components/BankIcon/images/306.png.js.map +1 -0
  29. package/dist/components/BankIcon/images/307.png.js +2 -0
  30. package/dist/components/BankIcon/images/307.png.js.map +1 -0
  31. package/dist/components/BankIcon/images/308.png.js +2 -0
  32. package/dist/components/BankIcon/images/308.png.js.map +1 -0
  33. package/dist/components/BankIcon/images/309.png.js +2 -0
  34. package/dist/components/BankIcon/images/309.png.js.map +1 -0
  35. package/dist/components/BankIcon/images/310.png.js +2 -0
  36. package/dist/components/BankIcon/images/310.png.js.map +1 -0
  37. package/dist/components/BankIcon/images/403.png.js +2 -0
  38. package/dist/components/BankIcon/images/403.png.js.map +1 -0
  39. package/dist/components/BankIcon/index.js +2 -0
  40. package/dist/components/BankIcon/index.js.map +1 -0
  41. package/dist/components/Button/index.js +2 -0
  42. package/dist/components/Button/index.js.map +1 -0
  43. package/dist/components/Captcha/index.js +2 -0
  44. package/dist/components/Captcha/index.js.map +1 -0
  45. package/dist/components/Dialog/Alert/index.js +2 -0
  46. package/dist/components/Dialog/Alert/index.js.map +1 -0
  47. package/dist/components/Dialog/Confirm/index.js +2 -0
  48. package/dist/components/Dialog/Confirm/index.js.map +1 -0
  49. package/dist/components/Dialog/index.js +2 -0
  50. package/dist/components/Dialog/index.js.map +1 -0
  51. package/dist/components/DialogComponent/index.js +2 -0
  52. package/dist/components/DialogComponent/index.js.map +1 -0
  53. package/dist/components/DialogRef/index.js +2 -0
  54. package/dist/components/DialogRef/index.js.map +1 -0
  55. package/dist/components/FormInput/index.js +2 -0
  56. package/dist/components/FormInput/index.js.map +1 -0
  57. package/dist/components/Image/index.js +2 -0
  58. package/dist/components/Image/index.js.map +1 -0
  59. package/dist/components/List/index.js +2 -0
  60. package/dist/components/List/index.js.map +1 -0
  61. package/dist/components/Loading/index.js +2 -0
  62. package/dist/components/Loading/index.js.map +1 -0
  63. package/dist/components/Mask/index.js +2 -0
  64. package/dist/components/Mask/index.js.map +1 -0
  65. package/dist/components/NumberKeyboard/index.js +2 -0
  66. package/dist/components/NumberKeyboard/index.js.map +1 -0
  67. package/dist/components/Page/index.js +2 -0
  68. package/dist/components/Page/index.js.map +1 -0
  69. package/dist/components/PasswordInput/index.js +2 -0
  70. package/dist/components/PasswordInput/index.js.map +1 -0
  71. package/dist/components/Picker/Picker.js +2 -0
  72. package/dist/components/Picker/Picker.js.map +1 -0
  73. package/dist/components/Picker/index.js +2 -0
  74. package/dist/components/Picker/index.js.map +1 -0
  75. package/dist/components/Popup/index.js +2 -0
  76. package/dist/components/Popup/index.js.map +1 -0
  77. package/dist/components/Progress/index.js +2 -0
  78. package/dist/components/Progress/index.js.map +1 -0
  79. package/dist/components/Tabbar/index.js +2 -0
  80. package/dist/components/Tabbar/index.js.map +1 -0
  81. package/dist/components/Tabbar/tabbar/TabItem.js +2 -0
  82. package/dist/components/Tabbar/tabbar/TabItem.js.map +1 -0
  83. package/dist/components/Tabbar/tabbar/Tabbar.js +2 -0
  84. package/dist/components/Tabbar/tabbar/Tabbar.js.map +1 -0
  85. package/dist/components/Toast/Toast.js +2 -0
  86. package/dist/components/Toast/Toast.js.map +1 -0
  87. package/dist/components/Toast/index.js +2 -0
  88. package/dist/components/Toast/index.js.map +1 -0
  89. package/dist/components/_virtual/ReactPropTypesSecret.js +2 -0
  90. package/dist/components/_virtual/ReactPropTypesSecret.js.map +1 -0
  91. package/dist/components/_virtual/_commonjsHelpers.js +2 -0
  92. package/dist/components/_virtual/_commonjsHelpers.js.map +1 -0
  93. package/dist/components/_virtual/checkPropTypes.js +2 -0
  94. package/dist/components/_virtual/checkPropTypes.js.map +1 -0
  95. package/dist/components/_virtual/factoryWithThrowingShims.js +2 -0
  96. package/dist/components/_virtual/factoryWithThrowingShims.js.map +1 -0
  97. package/dist/components/_virtual/factoryWithTypeCheckers.js +2 -0
  98. package/dist/components/_virtual/factoryWithTypeCheckers.js.map +1 -0
  99. package/dist/components/_virtual/has.js +2 -0
  100. package/dist/components/_virtual/has.js.map +1 -0
  101. package/dist/components/_virtual/index.js +2 -0
  102. package/dist/components/_virtual/index.js.map +1 -0
  103. package/dist/components/_virtual/index2.js +2 -0
  104. package/dist/components/_virtual/index2.js.map +1 -0
  105. package/dist/components/_virtual/react-is.development.js +2 -0
  106. package/dist/components/_virtual/react-is.development.js.map +1 -0
  107. package/dist/components/_virtual/react-is.production.min.js +2 -0
  108. package/dist/components/_virtual/react-is.production.min.js.map +1 -0
  109. package/dist/components/node_modules/@babel/runtime/helpers/esm/extends.js +2 -0
  110. package/dist/components/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
  111. package/dist/components/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +2 -0
  112. package/dist/components/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +1 -0
  113. package/dist/components/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +2 -0
  114. package/dist/components/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
  115. package/dist/components/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +2 -0
  116. package/dist/components/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -0
  117. package/dist/components/node_modules/dom-helpers/esm/addClass.js +2 -0
  118. package/dist/components/node_modules/dom-helpers/esm/addClass.js.map +1 -0
  119. package/dist/components/node_modules/dom-helpers/esm/hasClass.js +2 -0
  120. package/dist/components/node_modules/dom-helpers/esm/hasClass.js.map +1 -0
  121. package/dist/components/node_modules/dom-helpers/esm/removeClass.js +2 -0
  122. package/dist/components/node_modules/dom-helpers/esm/removeClass.js.map +1 -0
  123. package/dist/components/node_modules/object-assign/index.js +7 -0
  124. package/dist/components/node_modules/object-assign/index.js.map +1 -0
  125. package/dist/components/node_modules/prop-types/checkPropTypes.js +2 -0
  126. package/dist/components/node_modules/prop-types/checkPropTypes.js.map +1 -0
  127. package/dist/components/node_modules/prop-types/factoryWithThrowingShims.js +2 -0
  128. package/dist/components/node_modules/prop-types/factoryWithThrowingShims.js.map +1 -0
  129. package/dist/components/node_modules/prop-types/factoryWithTypeCheckers.js +2 -0
  130. package/dist/components/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -0
  131. package/dist/components/node_modules/prop-types/index.js +2 -0
  132. package/dist/components/node_modules/prop-types/index.js.map +1 -0
  133. package/dist/components/node_modules/prop-types/lib/ReactPropTypesSecret.js +2 -0
  134. package/dist/components/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +1 -0
  135. package/dist/components/node_modules/prop-types/lib/has.js +2 -0
  136. package/dist/components/node_modules/prop-types/lib/has.js.map +1 -0
  137. package/dist/components/node_modules/react-is/cjs/react-is.development.js +2 -0
  138. package/dist/components/node_modules/react-is/cjs/react-is.development.js.map +1 -0
  139. package/dist/components/node_modules/react-is/cjs/react-is.production.min.js +10 -0
  140. package/dist/components/node_modules/react-is/cjs/react-is.production.min.js.map +1 -0
  141. package/dist/components/node_modules/react-is/index.js +2 -0
  142. package/dist/components/node_modules/react-is/index.js.map +1 -0
  143. package/dist/components/node_modules/react-transition-group/esm/CSSTransition.js +2 -0
  144. package/dist/components/node_modules/react-transition-group/esm/CSSTransition.js.map +1 -0
  145. package/dist/components/node_modules/react-transition-group/esm/Transition.js +2 -0
  146. package/dist/components/node_modules/react-transition-group/esm/Transition.js.map +1 -0
  147. package/dist/components/node_modules/react-transition-group/esm/TransitionGroupContext.js +2 -0
  148. package/dist/components/node_modules/react-transition-group/esm/TransitionGroupContext.js.map +1 -0
  149. package/dist/components/node_modules/react-transition-group/esm/config.js +2 -0
  150. package/dist/components/node_modules/react-transition-group/esm/config.js.map +1 -0
  151. package/dist/components/node_modules/react-transition-group/esm/utils/PropTypes.js +2 -0
  152. package/dist/components/node_modules/react-transition-group/esm/utils/PropTypes.js.map +1 -0
  153. package/dist/components/node_modules/tslib/tslib.es6.js +2 -0
  154. package/dist/components/node_modules/tslib/tslib.es6.js.map +1 -0
  155. package/dist/components/src/hooks/index.js +2 -0
  156. package/dist/components/src/hooks/index.js.map +1 -0
  157. package/dist/components/src/index.js +2 -0
  158. package/dist/components/src/index.js.map +1 -0
  159. package/dist/components/src/utils/index.js +2 -0
  160. package/dist/components/src/utils/index.js.map +1 -0
  161. package/dist/index.js +2 -3010
  162. package/dist/index.js.map +1 -1
  163. package/dist/index.umd.js +9 -3018
  164. package/dist/index.umd.js.map +1 -1
  165. package/dist/styles/components/alert.scss +9 -4
  166. package/dist/styles/components/animated.scss +152 -0
  167. package/dist/styles/components/bankicon.scss +3 -1
  168. package/dist/styles/components/button.scss +23 -12
  169. package/dist/styles/components/captcha.scss +14 -2
  170. package/dist/styles/components/confirm.scss +16 -7
  171. package/dist/styles/components/dialog.scss +224 -0
  172. package/dist/styles/components/dialogref.scss +45 -168
  173. package/dist/styles/components/fade.scss +22 -0
  174. package/dist/styles/components/font/iconfont.ttf +0 -0
  175. package/dist/styles/components/font/iconfont.woff +0 -0
  176. package/dist/styles/components/font/iconfont.woff2 +0 -0
  177. package/dist/styles/components/forminput.scss +93 -57
  178. package/dist/styles/components/image.scss +1 -1
  179. package/dist/styles/components/images/backspace.png +0 -0
  180. package/dist/styles/components/images/loading.png +0 -0
  181. package/dist/styles/components/index.scss +9 -2
  182. package/dist/styles/components/list.scss +21 -18
  183. package/dist/styles/components/loading.scss +50 -9
  184. package/dist/styles/components/mask.scss +3 -2
  185. package/dist/styles/components/numberkeyboard.scss +48 -20
  186. package/dist/styles/components/page.scss +5 -4
  187. package/dist/styles/components/passwordinput.scss +2 -0
  188. package/dist/styles/components/picker.scss +147 -0
  189. package/dist/styles/components/popup.scss +77 -0
  190. package/dist/styles/components/scale.scss +27 -0
  191. package/dist/styles/components/scrollview.scss +4 -0
  192. package/dist/styles/components/slide.scss +105 -0
  193. package/dist/styles/components/tabbar.scss +42 -0
  194. package/dist/styles/components/toast.scss +9 -13
  195. package/dist/styles/index.scss +5 -5
  196. package/dist/styles/{components/dialogcomponent.scss → themes/animation.scss} +33 -74
  197. package/dist/styles/themes/default.scss +2 -2
  198. package/dist/styles/themes/variable.scss +3 -4
  199. package/lib/components/Animated/Animated.js +20 -0
  200. package/lib/components/Animated/Animated.js.map +1 -0
  201. package/lib/components/Animated/Fade/index.js +19 -0
  202. package/lib/components/Animated/Fade/index.js.map +1 -0
  203. package/lib/components/Animated/Scale/index.js +19 -0
  204. package/lib/components/Animated/Scale/index.js.map +1 -0
  205. package/lib/components/Animated/Slide/index.js +19 -0
  206. package/lib/components/Animated/Slide/index.js.map +1 -0
  207. package/lib/components/Animated/index.js +5 -0
  208. package/lib/components/Animated/index.js.map +1 -0
  209. package/lib/components/Button/index.js +27 -5
  210. package/lib/components/Button/index.js.map +1 -1
  211. package/lib/components/Captcha/index.js +17 -5
  212. package/lib/components/Captcha/index.js.map +1 -1
  213. package/lib/components/Dialog/Alert/index.js +3 -3
  214. package/lib/components/Dialog/Alert/index.js.map +1 -1
  215. package/lib/components/Dialog/Confirm/index.js +4 -4
  216. package/lib/components/Dialog/Confirm/index.js.map +1 -1
  217. package/lib/components/Dialog/index.js +1 -1
  218. package/lib/components/Dialog/index.js.map +1 -1
  219. package/lib/components/{Dialog/DialogComponent → DialogComponent}/index.js +1 -1
  220. package/lib/components/DialogComponent/index.js.map +1 -0
  221. package/lib/components/DialogRef/index.js +8 -7
  222. package/lib/components/DialogRef/index.js.map +1 -1
  223. package/lib/components/FormInput/index.js +32 -21
  224. package/lib/components/FormInput/index.js.map +1 -1
  225. package/lib/components/List/index.js +18 -15
  226. package/lib/components/List/index.js.map +1 -1
  227. package/lib/components/Loading/index.js +12 -10
  228. package/lib/components/Loading/index.js.map +1 -1
  229. package/lib/components/Mask/index.js +8 -8
  230. package/lib/components/Mask/index.js.map +1 -1
  231. package/lib/components/NumberKeyboard/index.js +12 -7
  232. package/lib/components/NumberKeyboard/index.js.map +1 -1
  233. package/lib/components/Page/index.js +7 -7
  234. package/lib/components/Page/index.js.map +1 -1
  235. package/lib/components/Picker/Picker.js +109 -0
  236. package/lib/components/Picker/Picker.js.map +1 -0
  237. package/lib/components/Picker/index.js +35 -0
  238. package/lib/components/Picker/index.js.map +1 -0
  239. package/lib/components/Popup/index.js +61 -0
  240. package/lib/components/Popup/index.js.map +1 -0
  241. package/lib/components/ScrollView/index.js +34 -0
  242. package/lib/components/ScrollView/index.js.map +1 -0
  243. package/lib/components/Tabbar/index.js +6 -0
  244. package/lib/components/Tabbar/index.js.map +1 -0
  245. package/lib/components/Tabbar/tabbar/TabItem.js +10 -0
  246. package/lib/components/Tabbar/tabbar/TabItem.js.map +1 -0
  247. package/lib/components/Tabbar/tabbar/Tabbar.js +74 -0
  248. package/lib/components/Tabbar/tabbar/Tabbar.js.map +1 -0
  249. package/lib/components/Toast/index.js +11 -3
  250. package/lib/components/Toast/index.js.map +1 -1
  251. package/lib/hooks/index.js +42 -1
  252. package/lib/hooks/index.js.map +1 -1
  253. package/lib/index.js +3 -0
  254. package/lib/index.js.map +1 -1
  255. package/lib/utils/index.js +18 -2
  256. package/lib/utils/index.js.map +1 -1
  257. package/package.json +134 -131
  258. package/types/components/Animated/Animated.d.ts +12 -0
  259. package/types/components/Animated/Fade/index.d.ts +9 -0
  260. package/types/components/Animated/Scale/index.d.ts +9 -0
  261. package/types/components/Animated/Slide/index.d.ts +11 -0
  262. package/types/components/Animated/index.d.ts +3 -0
  263. package/types/components/Button/index.d.ts +3 -2
  264. package/types/components/Captcha/index.d.ts +5 -3
  265. package/types/components/Dialog/index.d.ts +1 -1
  266. package/types/components/DialogComponent/index.d.ts +19 -0
  267. package/types/components/DialogRef/index.d.ts +4 -2
  268. package/types/components/FormInput/index.d.ts +9 -1
  269. package/types/components/List/index.d.ts +14 -6
  270. package/types/components/Loading/index.d.ts +6 -4
  271. package/types/components/Mask/index.d.ts +4 -4
  272. package/types/components/Page/index.d.ts +7 -5
  273. package/types/components/Picker/Picker.d.ts +23 -0
  274. package/types/components/Picker/index.d.ts +15 -0
  275. package/types/components/Popup/index.d.ts +10 -0
  276. package/types/components/ScrollView/index.d.ts +11 -0
  277. package/types/components/Tabbar/components/TabItem.d.ts +9 -0
  278. package/types/components/Tabbar/components/Tabbar.d.ts +30 -0
  279. package/types/components/Tabbar/index.d.ts +8 -0
  280. package/types/components/Tabbar/tabbar/TabItem.d.ts +9 -0
  281. package/types/components/Tabbar/tabbar/Tabbar.d.ts +30 -0
  282. package/types/hooks/index.d.ts +23 -0
  283. package/types/index.d.ts +3 -0
  284. package/types/utils/index.d.ts +1 -0
  285. package/dist/index.esm.js +0 -2995
  286. package/dist/index.esm.js.map +0 -1
  287. package/dist/styles/components/key.scss +0 -27
  288. package/lib/components/Dialog/DialogComponent/index.js.map +0 -1
  289. package/lib/components/NumberKeyboard/Key/index.js +0 -9
  290. package/lib/components/NumberKeyboard/Key/index.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as o,useState as a,useImperativeHandle as n,useEffect as r}from"react";import m from"react-dom";import s from"classnames";import{View as c}from"@tarojs/components";import l from"../Mask/index.js";import i from"../node_modules/react-transition-group/esm/CSSTransition.js";var d=o((function(o,d){var u=o.header,f=o.content,p=o.footer,x=o.className,E=void 0===x?"":x,h=o.visible,N=e(a(!1),2),g=N[0],v=N[1];n(d,(function(){return{close:function(){v(!1)}}})),r((function(){v(h)}),[h]);var b=s("xh-dialog",E),j=t.createElement(c,{className:b},t.createElement(l,null),t.createElement(i,{in:g,timeout:200,classNames:"scale",unmountOnExit:!0},t.createElement(c,{className:"xh-dialog-content"},t.createElement(c,{className:"xh-dialog-content-header"},u),t.createElement(c,{className:"xh-dialog-content-content"},f),t.createElement(c,{className:"xh-dialog-content-footer"},p))));return m.createPortal(j,document.body)}));export{d as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/DialogComponent/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useState,\n useImperativeHandle,\n forwardRef,\n useEffect,\n} from \"react\";\nimport ReactDOM from \"react-dom\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\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?: string | ReactNode;\n visible: boolean;\n} & XHComponentCommonProps;\n\nexport type DialogRef = {\n close: () => void;\n};\nconst DialogCom = forwardRef<DialogRef, DialogProps>((props, fromRef) => {\n const { header, content, footer, className = \"\", visible } = props;\n const [selfVisible, setSelfVisible] = useState(false);\n\n useImperativeHandle(fromRef, () => ({\n close: () => {\n console.log(\"closes\");\n setSelfVisible(false);\n },\n }));\n\n useEffect(() => {\n setSelfVisible(visible);\n }, [visible]);\n\n const dialogcls = classNames(\"xh-dialog\", className);\n\n const DialogMain = (\n <View className={dialogcls}>\n <Mask />\n <CSSTransition\n in={selfVisible}\n timeout={200}\n classNames=\"scale\"\n unmountOnExit\n >\n <View className=\"xh-dialog-content\">\n <View className=\"xh-dialog-content-header\">{header}</View>\n <View className=\"xh-dialog-content-content\">{content}</View>\n <View className=\"xh-dialog-content-footer\">{footer}</View>\n </View>\n </CSSTransition>\n </View>\n );\n\n return ReactDOM.createPortal(DialogMain, document.body);\n});\n\nexport default DialogCom;\n"],"names":["DialogCom","forwardRef","props","fromRef","header","content","footer","_a","className","visible","_b","__read","useState","selfVisible","setSelfVisible","useImperativeHandle","close","useEffect","dialogcls","classNames","DialogMain","React","createElement","View","Mask","CSSTransition","in","timeout","unmountOnExit","ReactDOM","createPortal","document","body"],"mappings":"gWAyBA,IAAMA,EAAYC,GAAmC,SAACC,EAAOC,GACnD,IAAAC,EAAqDF,EAAKE,OAAlDC,EAA6CH,EAAtCG,QAAEC,EAAoCJ,EAAKI,OAAjCC,EAA4BL,EAAKM,UAAjCA,OAAY,IAAAD,EAAA,GAAEA,EAAEE,EAAYP,EAAKO,QAC5DC,EAAAC,EAAgCC,GAAS,GAAM,GAA9CC,EAAWH,EAAA,GAAEI,OAEpBC,EAAoBZ,GAAS,WAAM,MAAC,CAClCa,MAAO,WAELF,GAAe,EAChB,EACD,IAEFG,GAAU,WACRH,EAAeL,EACjB,GAAG,CAACA,IAEJ,IAAMS,EAAYC,EAAW,YAAaX,GAEpCY,EACJC,EAAAC,cAACC,EAAK,CAAAf,UAAWU,GACfG,EAAAC,cAACE,EAAO,MACRH,EAAAC,cAACG,EAAa,CACZC,GAAIb,EACJc,QAAS,IACTR,WAAW,QACXS,eAAa,GAEbP,EAAAC,cAACC,EAAI,CAACf,UAAU,qBACda,EAAAC,cAACC,EAAK,CAAAf,UAAU,4BAA4BJ,GAC5CiB,EAAAC,cAACC,EAAK,CAAAf,UAAU,6BAA6BH,GAC7CgB,EAAAC,cAACC,EAAI,CAACf,UAAU,4BAA4BF,MAMpD,OAAOuB,EAASC,aAAaV,EAAYW,SAASC,KACpD"}
@@ -0,0 +1,2 @@
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 l from"../Button/index.js";import i 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,u=o.content,h=o.className,p=void 0===h?"":h,g=o.visible,x=o.showCancel,v=void 0===x||x,E=o.confirmText,N=void 0===E?"确定":E,b=o.cancelText,C=void 0===b?"取消":b,j=o.footer,T=void 0!==j&&j,k=o.onConfirm,w=o.onCancel,y=o.onClose,S=e(n(!1),2),_=S[0],B=S[1];a(f,(function(){return{close:M,open:q}}));var M=function(){y&&y(),B(!1)},q=function(){B(!0)};r((function(){g||y&&y(),B(g)}),[g]);var z=c("xh-dialog-ref",p,{show:_}),A=c("xh-dialog-ref-content-footer-button-button"),D=c("xh-dialog-ref-content-footer-button",{"xh-dialog-ref-content-footer-button-center":!v}),F=t.createElement(s,{className:D},v&&t.createElement(l,{type:"ghost",shape:"rectangle",preventTime:0,onClick:function(){w&&w(),M()},className:"xh-dialog-ref-content-footer-button-button"},C),t.createElement(l,{type:"ghost",shape:"rectangle",className:A,onClick:function(){k&&k()},preventTime:0},N));return t.createElement(s,{className:z},t.createElement(i,null),t.createElement(m,{in:_,timeout:200,classNames:"scale"},t.createElement(s,{className:"xh-dialog-ref-content"},t.createElement(s,{className:"xh-dialog-ref-content-header"},d),t.createElement(s,{className:"xh-dialog-ref-content-content"},u),T||t.createElement(s,{className:"xh-dialog-ref-content-footer"},F))))}));export{f as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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} & 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 } = 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 const comfirmCls = classNames(\"xh-dialog-ref-content-footer-button-button\");\n const footercls = classNames(\"xh-dialog-ref-content-footer-button\", {\n \"xh-dialog-ref-content-footer-button-center\": !showCancel,\n });\n const dialogFooter = (\n <View className={footercls}>\n {showCancel && (\n <Button\n type=\"ghost\"\n shape=\"rectangle\"\n preventTime={0}\n onClick={handleCancel}\n className=\"xh-dialog-ref-content-footer-button-button\"\n >\n {cancelText}\n </Button>\n )}\n <Button\n type=\"ghost\"\n shape=\"rectangle\"\n className={comfirmCls}\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=\"xh-dialog-ref-content\">\n <View className=\"xh-dialog-ref-content-header\">{header}</View>\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","__read","useState","selfVisible","setSelfVisible","useImperativeHandle","close","open","useEffect","dialogcls","classNames","show","comfirmCls","footercls","dialogFooter","React","createElement","View","Button","type","shape","preventTime","onClick","Mask","CSSTransition","in","timeout"],"mappings":"yWAgCA,IAAMA,EAAYC,GAAoC,SAACC,EAAOC,GAE1D,IAAAC,EAWEF,EAAKE,OAVPC,EAUEH,EAAKG,QATPC,EASEJ,EATYK,UAAdA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAQEN,EARKM,QACPC,EAOEP,EAAKQ,WAPPA,cAAiBD,EACjBE,EAMET,EANgBU,YAAlBA,OAAW,IAAAD,EAAG,KAAIA,EAClBE,EAKEX,EALeY,WAAjBA,OAAU,IAAAD,EAAG,KAAIA,EACjBE,EAIEb,SAJFc,OAAS,IAAAD,KACTE,EAGEf,YAFFgB,EAEEhB,WADFiB,EACEjB,UACEkB,EAAAC,EAAgCC,GAAS,GAAM,GAA9CC,EAAWH,EAAA,GAAEI,OAEpBC,EAAoBtB,GAAS,WAAM,MAAC,CAClCuB,MAAKA,EACLC,KAAIA,EACJ,IAEF,IAAMD,EAAQ,WACZP,GAAWA,IACXK,GAAe,EACjB,EAEMG,EAAO,WACXH,GAAe,EACjB,EAWAI,GAAU,WACHpB,GACHW,GAAWA,IAEbK,EAAehB,EACjB,GAAG,CAACA,IAEJ,IAAMqB,EAAYC,EAAW,gBAAiBvB,EAAW,CACvDwB,KAAMR,IAEFS,EAAaF,EAAW,8CACxBG,EAAYH,EAAW,sCAAuC,CAClE,8CAA+CpB,IAE3CwB,EACJC,EAAAC,cAACC,EAAK,CAAA9B,UAAW0B,GACdvB,GACCyB,EAAAC,cAACE,EAAM,CACLC,KAAK,QACLC,MAAM,YACNC,YAAa,EACbC,QA1Ba,WACnBxB,GAAYA,IACZQ,GACF,EAwBQnB,UAAU,8CAETO,GAGLqB,EAACC,cAAAE,EACC,CAAAC,KAAK,QACLC,MAAM,YACNjC,UAAWyB,EACXU,QAxCgB,WACpBzB,GAAaA,GAEf,EAsCMwB,YAAa,GAEZ7B,IAmBP,OAbEuB,EAAAC,cAACC,EAAK,CAAA9B,UAAWsB,GACfM,EAAAC,cAACO,EAAO,MACRR,EAAAC,cAACQ,EAAa,CAACC,GAAItB,EAAauB,QAAS,IAAKhB,WAAW,SACvDK,EAAAC,cAACC,EAAI,CAAC9B,UAAU,yBACd4B,EAAAC,cAACC,EAAK,CAAA9B,UAAU,gCAAgCH,GAChD+B,EAAAC,cAACC,EAAK,CAAA9B,UAAU,iCAAiCF,GAChDW,GACCmB,EAAAC,cAACC,EAAI,CAAC9B,UAAU,gCAAgC2B,KAO5D"}
@@ -0,0 +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 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,x=n.placeholder,v=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=e(n,["onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","readonly","withArrow","direction","border","mainExtra","padding"]);function V(e){var a=s(e.target.value);e.target.value=a,p&&p(a)}function k(e){var a=s(e.target.value);b&&b(a)}var q=l(null);r(u,(function(){return{focus:function(){q.current.focus()}}}));var z=c("xh-form-input",{column:"column"===j,border:R,padding:S});return"h5"!==process.env.TARO_ENV?t.createElement(m,{className:z},t.createElement(m,{className:"xh-form-input-main"},t.createElement(m,{className:"xh-form-input-main-left"},v&&t.createElement(m,{className:"xh-form-input-main-left-label"},v,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||x):t.createElement(i,a({},O,{ref:q,className:"xh-form-input-main-center-native",maxlength:f,name:L,placeholder:x,type:d,value:h,onBlur:k,onInput:V}))),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:z},t.createElement("div",{className:"xh-form-input-main"},t.createElement("div",{className:"xh-form-input-main-left"},v&&t.createElement("label",{className:"xh-form-input-main-left-label"},v,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||x):t.createElement("input",{ref:q,className:"xh-form-input-main-center-native",maxLength:f,name:L,pattern:g,placeholder:x,type:d,value:h,onBlur:k,onInput:V})),T&&t.createElement("div",{className:"xh-form-input-main-extra"},T)),t.createElement("div",{className:"xh-form-input-right"},N,B&&t.createElement("i",{className:"arrow"})))}));export{u as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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};\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 ...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 });\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 && <i 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","rest","__rest","handleChange","e","inputValue","inputRange","target","handleBlur","inputRef","useRef","useImperativeHandle","focus","current","wrapperCls","classNames","column","process","env","TARO_ENV","React","createElement","View","className","dangerouslySetInnerHTML","__html","Text","Input","ref","onInput","maxLength"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import{__read as t}from"../node_modules/tslib/tslib.es6.js";import e,{useState as r,useEffect as s,useMemo as o}from"react";import{Image as c}from"@tarojs/components";import{getImageInfo as a}from"@tarojs/taro";var i=function(i){var n=i.width,m=void 0===n?"":n,h=i.height,l=void 0===h?"":h,f=i.src,d=i.className,u=t(r({}),2),g=u[0],p=u[1];s((function(){"h5"===process.env.TARO_ENV||d||a({src:f,success:function(t){"getImageInfo:ok"===t.errMsg&&p({width:t.width,height:t.height})}})}),[]);var v=o((function(){var t=g||{};return m&&(t.width="".concat(m)),l&&(t.height="".concat(l)),t}),[m,l,g]);return"h5"!==process.env.TARO_ENV?e.createElement(c,{src:f,style:v,className:d}):e.createElement("img",{src:f,alt:"",style:v,className:d})};export{i as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Image/index.tsx"],"sourcesContent":["import React, { FC, useEffect, useMemo, useState } from \"react\";\nimport { Image } from \"@tarojs/components\";\nimport { getImageInfo } from \"@tarojs/taro\";\nimport \"./index.scss\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nexport type ImageProps = {\n width?: number;\n height?: number;\n src: string;\n} & XHComponentCommonProps;\n\nconst XHImage: FC<ImageProps> = props => {\n const { width = \"\", height = \"\", src, className } = props;\n const [defaultSize, setDefaultSize] = useState<{\n width?: number | string;\n height?: number | string;\n } | null>({});\n\n useEffect(() => {\n if (process.env.TARO_ENV !== \"h5\" && !className) {\n getImageInfo({\n src,\n success: res => {\n if (res.errMsg === \"getImageInfo:ok\") {\n console.log(res);\n setDefaultSize({ width: res.width, height: res.height });\n }\n },\n });\n } else {\n }\n }, []);\n\n const size = useMemo(() => {\n let computedSize = defaultSize || {};\n if (width) {\n (computedSize as any).width = `${width}`;\n }\n if (height) {\n (computedSize as any).height = `${height}`;\n }\n console.log(\"size\");\n\n return computedSize;\n }, [width, height, defaultSize]);\n\n return process.env.TARO_ENV !== \"h5\" ? (\n <Image src={src} style={size} className={className} />\n ) : (\n <img src={src} alt=\"\" style={size} className={className} />\n );\n};\n\nexport default XHImage;\n"],"names":["XHImage","props","_a","width","_b","height","src","className","_c","__read","useState","defaultSize","setDefaultSize","useEffect","process","env","TARO_ENV","getImageInfo","success","res","errMsg","size","useMemo","computedSize","concat","React","Image","style","createElement","alt"],"mappings":"mNAYM,IAAAA,EAA0B,SAAAC,GACtB,IAAAC,EAA4CD,EAAKE,MAAjDA,OAAQ,IAAAD,EAAA,GAAEA,EAAEE,EAAgCH,EAArBI,OAAXA,OAAM,IAAAD,EAAG,GAAEA,EAAEE,EAAmBL,EAAhBK,IAAEC,EAAcN,EAAKM,UACnDC,EAAAC,EAAgCC,EAG5B,CAAE,GAAC,GAHNC,EAAWH,EAAA,GAAEI,OAKpBC,GAAU,WACqB,OAAzBC,QAAQC,IAAIC,UAAsBT,GACpCU,EAAa,CACXX,IAAGA,EACHY,QAAS,SAAAC,GACY,oBAAfA,EAAIC,QAENR,EAAe,CAAET,MAAOgB,EAAIhB,MAAOE,OAAQc,EAAId,QAElD,GAIN,GAAE,IAEH,IAAMgB,EAAOC,GAAQ,WACnB,IAAIC,EAAeZ,GAAe,GASlC,OARIR,IACDoB,EAAqBpB,MAAQ,GAAGqB,OAAArB,IAE/BE,IACDkB,EAAqBlB,OAAS,GAAGmB,OAAAnB,IAI7BkB,CACR,GAAE,CAACpB,EAAOE,EAAQM,IAEnB,MAAgC,OAAzBG,QAAQC,IAAIC,SACjBS,gBAACC,EAAK,CAACpB,IAAKA,EAAKqB,MAAON,EAAMd,UAAWA,IAEzCkB,EAAKG,cAAA,MAAA,CAAAtB,IAAKA,EAAKuB,IAAI,GAAGF,MAAON,EAAMd,UAAWA,GAElD"}
@@ -0,0 +1,2 @@
1
+ import e from"react";import{View as t,Text as a}from"@tarojs/components";import i from"classnames";var o=function(o){var l=o.title,s=void 0===l?"":l,r=o.description,n=void 0===r?"":r,c=o.icon,m=o.extra,d=void 0===m?"":m,x=o.extraIcon,v=void 0===x?"":x,p=o.arrow,N=o.border,E=void 0===N||N,h=o.onClick,f=o.className,u=o.outline,C=void 0===u||u,b=o.condensed,g=void 0!==b&&b,k=o.descriptionColor,w=void 0===k?"":k,y=o.extraColor,j=void 0===y?"":y,I=o.ellipsis,q=void 0===I||I,z=o.padding,A=i("xh-list",{border:E},{outline:C},{condensed:g},{padding:void 0!==z&&z},f),B=i("xh-list-main",{ellipsis:q});return e.createElement(t,{className:A,onClick:function(e){h&&h(e)}},c&&e.createElement(t,{className:"xh-list-icon"},c),e.createElement(t,{className:B},s&&e.createElement(a,{className:"xh-list-main-title"},s),e.createElement(a,{className:"xh-list-main-description",style:{color:w}},n)),e.createElement(t,{className:"xh-list-extra"},e.createElement(t,{className:"xh-list-extra-info",style:{color:j}},d),e.createElement(t,{className:"xh-list-extra-icon"},v||p&&e.createElement(t,{className:"arrow"}))))};export{o as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/List/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport { View, Text, ITouchEvent } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type XHListProps = {\n title?: string;\n description?: string | ReactNode;\n icon?: ReactNode;\n extra?: string | ReactNode;\n extraIcon?: ReactNode;\n border?: boolean;\n arrow?: boolean;\n outline?: boolean;\n condensed?: boolean;\n onClick?: (e: ITouchEvent) => void;\n descriptionColor?: string;\n extraColor?: string;\n ellipsis?: boolean;\n padding?: boolean;\n} & XHComponentCommonProps;\n\nconst XHList: FC<XHListProps> = props => {\n const {\n title = \"\",\n description = \"\",\n icon,\n extra = \"\",\n extraIcon = \"\",\n arrow,\n border = true,\n onClick,\n className,\n outline = true,\n condensed = false,\n descriptionColor = \"\",\n extraColor = \"\",\n ellipsis = true,\n padding = false,\n } = props;\n\n const listcls = classNames(\n \"xh-list\",\n { border },\n { outline },\n { condensed },\n { padding },\n className\n );\n\n const mainCls = classNames(\"xh-list-main\", {\n ellipsis,\n });\n\n const handleClick = (e: ITouchEvent) => {\n onClick && onClick(e);\n };\n\n return (\n <View className={listcls} onClick={handleClick}>\n {icon && <View className=\"xh-list-icon\">{icon}</View>}\n <View className={mainCls}>\n {title && <Text className=\"xh-list-main-title\">{title}</Text>}\n <Text\n className=\"xh-list-main-description\"\n style={{ color: descriptionColor }}\n >\n {description}\n </Text>\n </View>\n <View className=\"xh-list-extra\">\n <View className=\"xh-list-extra-info\" style={{ color: extraColor }}>\n {extra}\n </View>\n <View className=\"xh-list-extra-icon\">\n {extraIcon ? extraIcon : arrow && <View className=\"arrow\" />}\n </View>\n </View>\n </View>\n );\n};\nexport default XHList;\n"],"names":["XHList","props","_a","title","_b","description","icon","_c","extra","_d","extraIcon","arrow","_e","border","onClick","className","_f","outline","_g","condensed","_h","descriptionColor","_j","extraColor","_k","ellipsis","_l","padding","listcls","classNames","mainCls","React","createElement","View","e","Text","style","color"],"mappings":"mGAwBM,IAAAA,EAA0B,SAAAC,GAE5B,IAAAC,EAeED,EAAKE,MAfPA,OAAQ,IAAAD,EAAA,GAAEA,EACVE,EAcEH,EAdcI,YAAhBA,OAAc,IAAAD,EAAA,GAAEA,EAChBE,EAaEL,EAAKK,KAZPC,EAYEN,EAAKO,MAZPA,aAAQ,GAAED,EACVE,EAWER,EAAKS,UAXPA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAUEV,EAAKU,MATPC,EASEX,EAAKY,OATPA,OAAS,IAAAD,GAAIA,EACbE,EAQEb,EAAKa,QAPPC,EAOEd,EAAKc,UANPC,EAMEf,EAAKgB,QANPA,OAAU,IAAAD,GAAIA,EACdE,EAKEjB,EAAKkB,UALPA,OAAY,IAAAD,GAAKA,EACjBE,EAIEnB,EAJmBoB,iBAArBA,OAAgB,IAAAD,EAAG,GAAEA,EACrBE,EAGErB,EAHasB,WAAfA,OAAU,IAAAD,EAAG,GAAEA,EACfE,EAEEvB,EAAKwB,SAFPA,OAAW,IAAAD,GAAIA,EACfE,EACEzB,EADa0B,QAGXC,EAAUC,EACd,UACA,CAAEhB,OAAMA,GACR,CAAEI,QAAOA,GACT,CAAEE,UAASA,GACX,CAAEQ,aARK,IAAAD,GAAQA,GASfX,GAGIe,EAAUD,EAAW,eAAgB,CACzCJ,SAAQA,IAOV,OACEM,EAACC,cAAAC,EAAK,CAAAlB,UAAWa,EAASd,QALR,SAACoB,GACnBpB,GAAWA,EAAQoB,EACrB,GAIK5B,GAAQyB,gBAACE,EAAI,CAAClB,UAAU,gBAAgBT,GACzCyB,EAAAC,cAACC,EAAI,CAAClB,UAAWe,GACd3B,GAAS4B,gBAACI,EAAI,CAACpB,UAAU,sBAAsBZ,GAChD4B,EAAAC,cAACG,EACC,CAAApB,UAAU,2BACVqB,MAAO,CAAEC,MAAOhB,IAEfhB,IAGL0B,EAAAC,cAACC,EAAI,CAAClB,UAAU,iBACdgB,EAAAC,cAACC,EAAI,CAAClB,UAAU,qBAAqBqB,MAAO,CAAEC,MAAOd,IAClDf,GAEHuB,EAACC,cAAAC,EAAK,CAAAlB,UAAU,sBACbL,GAAwBC,GAASoB,EAAAC,cAACC,EAAI,CAAClB,UAAU,YAK5D"}
@@ -0,0 +1,2 @@
1
+ import{__spreadArray as e,__read as a}from"../node_modules/tslib/tslib.es6.js";import t from"react";import r from"classnames";import{View as n}from"@tarojs/components";import s from"../Mask/index.js";var m=function(m){var o=m.mask,c=m.className,i=m.tip,l=void 0===i?"":i,d=m.color,p=void 0===d?"":d,f=r("xh-loading",c);return t.createElement(n,{className:f},t.createElement(s,{mask:o}),t.createElement(n,{className:"xh-loading-main"},t.createElement(n,{className:"xh-loading-main-spinner"},e([],a(Array(12).keys()),!1).map((function(e){return t.createElement(n,{className:r("xh-loading-main-spinner-circle","is-circle".concat(e+1)),key:"spinner".concat(e)},t.createElement(n,{className:"dot-rotate",style:{backgroundColor:p}}))}))),l&&t.createElement(n,{className:"xh-loading-main-tip"},l)))};export{m as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Loading/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport Mask, { MaskProps } from \"../Mask\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport \"./index.scss\";\n\nexport type LoadingProps = {\n mask?: MaskProps[\"mask\"];\n color?: string;\n tip?: string | ReactNode;\n} & XHComponentCommonProps;\n\nconst Loading: FC<LoadingProps> = ({\n mask,\n className,\n tip = \"\",\n color = \"\",\n}) => {\n const cls = classNames(\"xh-loading\", className);\n\n return (\n <View className={cls}>\n <Mask mask={mask} />\n <View className=\"xh-loading-main\">\n <View className=\"xh-loading-main-spinner\">\n {[...Array(12).keys()].map((index) => (\n <View\n className={classNames(\n \"xh-loading-main-spinner-circle\",\n `is-circle${index + 1}`\n )}\n key={`spinner${index}`}\n >\n <View\n className=\"dot-rotate\"\n style={{ backgroundColor: color }}\n ></View>\n </View>\n ))}\n </View>\n {tip && <View className=\"xh-loading-main-tip\">{tip}</View>}\n </View>\n </View>\n );\n};\n\nexport default Loading;\n"],"names":["Loading","_a","mask","className","_b","tip","_c","color","cls","classNames","React","createElement","View","Mask","__spreadArray","Array","keys","map","index","concat","key","style","backgroundColor"],"mappings":"wMAaM,IAAAA,EAA4B,SAACC,GACjC,IAAAC,SACAC,EAASF,EAAAE,UACTC,QAAAC,OAAM,IAAAD,EAAA,KACNE,EAAAL,EAAAM,MAAAA,OAAK,IAAAD,EAAG,GAAEA,EAEJE,EAAMC,EAAW,aAAcN,GAErC,OACEO,EAACC,cAAAC,EAAK,CAAAT,UAAWK,GACfE,EAAAC,cAACE,EAAI,CAACX,KAAMA,IACZQ,EAAAC,cAACC,EAAI,CAACT,UAAU,mBACdO,EAAAC,cAACC,EAAK,CAAAT,UAAU,2BACbW,OAAIC,MAAM,IAAIC,SAAM,GAAEC,KAAI,SAACC,GAAU,OACpCR,EAAAC,cAACC,EACC,CAAAT,UAAWM,EACT,iCACA,YAAAU,OAAYD,EAAQ,IAEtBE,IAAK,UAAAD,OAAUD,IAEfR,EAAAC,cAACC,EACC,CAAAT,UAAU,aACVkB,MAAO,CAAEC,gBAAiBf,KAG/B,KAEFF,GAAOK,EAAAC,cAACC,EAAI,CAACT,UAAU,uBAAuBE,IAIvD"}
@@ -0,0 +1,2 @@
1
+ import a from"react";import r from"classnames";import{View as n}from"@tarojs/components";var o=function(o){var t=o.closeOnClickMask,m=void 0===t||t,s=o.onClick,e=o.mask,c=r("xh-mask",{"xh-mask-normal":"normal"===e,"xh-mask-transparent":"transparent"===e});return a.createElement(n,{className:c,onClick:function(a){m&&s&&s(a)}})};export{o as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Mask/index.tsx"],"sourcesContent":["import React, { FC, MouseEvent } from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport \"./index.scss\";\n\nexport type MaskProps = {\n closeOnClickMask?: boolean;\n onClick?: (e: MouseEvent) => void;\n mask?: \"transparent\" | \"normal\";\n} & XHComponentCommonProps;\n\nconst Mask: FC<MaskProps> = props => {\n const { closeOnClickMask = true, onClick, mask } = props;\n\n const cls = classNames(\"xh-mask\", {\n \"xh-mask-normal\": mask === \"normal\",\n \"xh-mask-transparent\": mask === \"transparent\",\n });\n\n function handleClick(e: any): void {\n closeOnClickMask && onClick && onClick(e);\n }\n\n return <View className={cls} onClick={handleClick} />;\n};\n\nexport default Mask;\n"],"names":["Mask","props","_a","closeOnClickMask","onClick","mask","cls","classNames","React","createElement","View","className","e"],"mappings":"yFAYM,IAAAA,EAAsB,SAAAC,GAClB,IAAAC,EAA2CD,EAAKE,iBAAhDA,OAAgB,IAAAD,GAAOA,EAAEE,EAAkBH,EAAXG,QAAEC,EAASJ,OAE7CK,EAAMC,EAAW,UAAW,CAChC,iBAA2B,WAATF,EAClB,sBAAgC,gBAATA,IAOzB,OAAOG,EAAAC,cAACC,EAAI,CAACC,UAAWL,EAAKF,QAJ7B,SAAqBQ,GACnBT,GAAoBC,GAAWA,EAAQQ,EACxC,GAGH"}
@@ -0,0 +1,2 @@
1
+ import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as o}from"react";import r from"classnames";import{View as a}from"@tarojs/components";import s from"../node_modules/react-transition-group/esm/CSSTransition.js";var m=function(m){var l=m.onBlur,c=m.show,u=m.maxLength,i=void 0===u?Number.MAX_SAFE_INTEGER:u,d=m.showClose,p=void 0===d||d,v=m.closeOnClickSpace,b=void 0===v||v,f=m.onClose,y=m.onChange,h=m.value,x=m.className,E=e(n(h),2),k=E[0],N=E[1],C=function(){for(var e=[],t=1;t<=9;t++)e.push({text:t,value:t,type:"number"});return e.push({text:"",value:"",type:"none"},{text:0,value:0,type:"number"},{text:"",value:"",type:"delete"}),e}();function g(e){f&&f(e),l&&l(e)}o((function(){return b&&document.addEventListener("click",g),function(){document.removeEventListener("click",g)}}),[]),o((function(){N(h)}),[h]);var _=r("xh-number-keyboard",x);return t.createElement(s,{classNames:"slide-up",in:c,unmountOnExit:!0,timeout:200},t.createElement(a,{className:_},t.createElement(a,{className:"xh-number-keyboard-header"},p&&t.createElement(a,{className:"xh-number-keyboard-close",onClick:g},"完成")),t.createElement(a,{className:"xh-number-keyboard-body"},C.map((function(e,n){return t.createElement(a,{key:n,className:r("xh-number-keyboard-body-key",{none:"none"===e.type,delete:"delete"===e.type}),onClick:function(t){!function(e,t){var n=t.type,o=t.value;if("h5"===process.env.TARO_ENV&&e.stopImmediatePropagation(),"none"!==n){var r=k;"delete"===n?r=k.slice(0,k.length-1):r.length<i&&(r=k+o),N(r),y&&y(r)}}(t,e)}},e.text)})))))};export{m as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/NumberKeyboard/index.tsx"],"sourcesContent":["import React, { FC, useState, useEffect, MouseEvent } from \"react\";\nimport classNames from \"classnames\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { View } from \"@tarojs/components\";\n\nimport \"./index.scss\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nexport type NumberKeyboardType = \"default\" | \"custom\";\n\nexport type NumberKeyboardProps = {\n show: boolean;\n type?: NumberKeyboardType;\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} & XHComponentCommonProps;\n\nexport type KeyType = \"number\" | \"delete\" | \"string\" | \"none\";\n\nexport interface IKey {\n text: number | string;\n value: number | string;\n type: KeyType;\n}\n\nconst NumberKeyboard: FC<NumberKeyboardProps> = props => {\n const {\n onBlur,\n show,\n maxLength = Number.MAX_SAFE_INTEGER,\n showClose = true,\n closeOnClickSpace = true,\n onClose,\n onChange,\n value,\n className,\n } = props;\n const [input, setInput] = useState(value);\n const keys = getKeys();\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 function handleKeyPress(e, { type, value }: IKey): void {\n if (process.env.TARO_ENV === \"h5\") {\n e.stopImmediatePropagation();\n }\n if (type === \"none\") return;\n\n let newInput = input;\n\n if (type === \"delete\") {\n newInput = input.slice(0, input.length - 1);\n } else if (newInput.length < maxLength) {\n newInput = input + value;\n }\n\n setInput(newInput);\n\n onChange && onChange(newInput);\n }\n\n function getKeys(): IKey[] {\n const keys: IKey[] = [];\n\n for (let i = 1; i <= 9; i++) {\n keys.push({ text: i, value: i, type: \"number\" });\n }\n\n keys.push(\n { text: \"\", value: \"\", type: \"none\" },\n { text: 0, value: 0, type: \"number\" },\n { text: \"\", value: \"\", type: \"delete\" }\n );\n\n return keys;\n }\n const keyboardcls = classNames(\"xh-number-keyboard\", className);\n\n return (\n <CSSTransition classNames=\"slide-up\" in={show} unmountOnExit timeout={200}>\n <View className={keyboardcls}>\n <View className=\"xh-number-keyboard-header\">\n {showClose && (\n <View className=\"xh-number-keyboard-close\" onClick={handleClose}>\n 完成\n </View>\n )}\n </View>\n <View className=\"xh-number-keyboard-body\">\n {keys.map((key, index) => (\n <View\n key={index}\n className={classNames(\"xh-number-keyboard-body-key\", {\n none: key.type === \"none\",\n delete: key.type === \"delete\",\n })}\n onClick={e => {\n handleKeyPress(e, key);\n }}\n >\n {key.text}\n </View>\n ))}\n </View>\n </View>\n </CSSTransition>\n );\n};\n\nexport default NumberKeyboard;\n"],"names":["NumberKeyboard","props","onBlur","show","_a","maxLength","Number","MAX_SAFE_INTEGER","_b","showClose","_c","closeOnClickSpace","onClose","onChange","value","className","_d","__read","useState","input","setInput","keys","i","push","text","type","getKeys","handleClose","e","useEffect","document","addEventListener","removeEventListener","keyboardcls","classNames","React","createElement","CSSTransition","in","unmountOnExit","timeout","View","onClick","map","key","index","none","delete","process","env","TARO_ENV","stopImmediatePropagation","newInput","slice","length","handleKeyPress"],"mappings":"8PA8BM,IAAAA,EAA0C,SAAAC,GAE5C,IAAAC,EASED,EATIC,OACNC,EAQEF,EAAKE,KAPPC,EAOEH,EAAKI,UAPPA,OAAY,IAAAD,EAAAE,OAAOC,iBAAgBH,EACnCI,EAMEP,EANcQ,UAAhBA,OAAS,IAAAD,GAAOA,EAChBE,EAKET,EALsBU,kBAAxBA,OAAiB,IAAAD,GAAOA,EACxBE,EAIEX,EAJKW,QACPC,EAGEZ,EAAKY,SAFPC,EAEEb,EAFGa,MACLC,EACEd,EAAKc,UACHC,EAAAC,EAAoBC,EAASJ,GAAM,GAAlCK,EAAKH,EAAA,GAAEI,OACRC,EAwCN,WAGE,IAFA,IAAMA,EAAe,GAEZC,EAAI,EAAGA,GAAK,EAAGA,IACtBD,EAAKE,KAAK,CAAEC,KAAMF,EAAGR,MAAOQ,EAAGG,KAAM,WASvC,OANAJ,EAAKE,KACH,CAAEC,KAAM,GAAIV,MAAO,GAAIW,KAAM,QAC7B,CAAED,KAAM,EAAGV,MAAO,EAAGW,KAAM,UAC3B,CAAED,KAAM,GAAIV,MAAO,GAAIW,KAAM,WAGxBJ,CACR,CAtDYK,GAgBb,SAASC,EAAYC,GACnBhB,GAAWA,EAAQgB,GACnB1B,GAAUA,EAAO0B,EAClB,CAjBDC,GAAU,WAKR,OAJIlB,GACFmB,SAASC,iBAAiB,QAASJ,GAG9B,WACLG,SAASE,oBAAoB,QAASL,EACxC,CACD,GAAE,IAEHE,GAAU,WACRT,EAASN,EACX,GAAG,CAACA,IAyCJ,IAAMmB,EAAcC,EAAW,qBAAsBnB,GAErD,OACEoB,EAACC,cAAAC,EAAc,CAAAH,WAAW,WAAWI,GAAInC,EAAMoC,eAAc,EAAAC,QAAS,KACpEL,EAAAC,cAACK,EAAI,CAAC1B,UAAWkB,GACfE,EAACC,cAAAK,GAAK1B,UAAU,6BACbN,GACC0B,EAAAC,cAACK,EAAK,CAAA1B,UAAU,2BAA2B2B,QAASf,GAE7C,OAGXQ,EAAAC,cAACK,EAAI,CAAC1B,UAAU,2BACbM,EAAKsB,KAAI,SAACC,EAAKC,GAAU,OACxBV,EAAAC,cAACK,EAAI,CACHG,IAAKC,EACL9B,UAAWmB,EAAW,8BAA+B,CACnDY,KAAmB,SAAbF,EAAInB,KACVsB,OAAqB,WAAbH,EAAInB,OAEdiB,QAAS,SAAAd,IAtDrB,SAAwBA,EAAGxB,OAAEqB,EAAIrB,EAAAqB,KAAEX,EAAKV,EAAAU,MAItC,GAH6B,OAAzBkC,QAAQC,IAAIC,UACdtB,EAAEuB,2BAES,SAAT1B,EAAJ,CAEA,IAAI2B,EAAWjC,EAEF,WAATM,EACF2B,EAAWjC,EAAMkC,MAAM,EAAGlC,EAAMmC,OAAS,GAChCF,EAASE,OAASjD,IAC3B+C,EAAWjC,EAAQL,GAGrBM,EAASgC,GAETvC,GAAYA,EAASuC,EAZO,CAa7B,CAsCaG,CAAe3B,EAAGgB,EACpB,GAECA,EAAIpB,KAXiB,MAkBpC"}
@@ -0,0 +1,2 @@
1
+ import a from"react";import{View as e}from"@tarojs/components";import o from"classnames";import r from"../Loading/index.js";var m=function(m){var t=m.children,i=m.loading,n=void 0!==i&&i,l=m.className,s=void 0===l?"":l,c=m.mask,p=void 0===c?"normal":c,d=m.tip,f=m.loadingColor,g=o("xh-page",s);return a.createElement(e,{className:g},n&&a.createElement(e,{className:"loading-wrapper"},a.createElement(r,{mask:p,tip:d,color:f})),t)};export{m as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Page/index.tsx"],"sourcesContent":["import React, { FC, PropsWithChildren, ReactNode } from \"react\";\nimport { View } from \"@tarojs/components\";\nimport classname from \"classnames\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport \"./index.scss\";\nimport Loading, { LoadingProps } from \"../Loading\";\n\nexport interface PageProps extends PropsWithChildren<XHComponentCommonProps> {\n loading?: boolean;\n mask?: LoadingProps[\"mask\"];\n tip?: string | ReactNode;\n loadingColor?: string;\n}\n\nconst Page: FC<PageProps> = (props) => {\n const {\n children,\n loading = false,\n className = \"\",\n mask = \"normal\",\n tip,\n loadingColor,\n } = props;\n\n const classObj = classname(\"xh-page\", className);\n\n return (\n <View className={classObj}>\n {loading && (\n <View className=\"loading-wrapper\">\n <Loading mask={mask} tip={tip} color={loadingColor} />\n </View>\n )}\n {children}\n </View>\n );\n};\n\nexport default Page;\n"],"names":["Page","props","children","_a","loading","_b","className","_c","mask","tip","loadingColor","classObj","classname","React","createElement","View","Loading","color"],"mappings":"4HAcM,IAAAA,EAAsB,SAACC,GAEzB,IAAAC,EAMED,WALFE,EAKEF,EALaG,QAAfA,OAAO,IAAAD,GAAQA,EACfE,EAIEJ,EAAKK,UAJPA,OAAS,IAAAD,EAAG,GAAEA,EACdE,EAGEN,OAHFO,aAAO,SAAQD,EACfE,EAEER,EAFCQ,IACHC,EACET,eAEEU,EAAWC,EAAU,UAAWN,GAEtC,OACEO,EAACC,cAAAC,EAAK,CAAAT,UAAWK,GACdP,GACCS,EAAAC,cAACC,EAAK,CAAAT,UAAU,mBACdO,EAAAC,cAACE,EAAO,CAACR,KAAMA,EAAMC,IAAKA,EAAKQ,MAAOP,KAGzCR,EAGP"}
@@ -0,0 +1,2 @@
1
+ import a from"react";import e from"classnames";import{View as s}from"@tarojs/components";var t=function(t){var r=t.value,o=t.length,n=t.mask,m=void 0===n||n,c=t.onFocus,p=t.className;var i=e("xh-password-input",p);return a.createElement(s,{className:i},a.createElement(s,{className:"xh-password-input-list",onClick:function(a){a.stopPropagation(),c&&c(a)}},function(){for(var t=[],n=0;n<o;n++){var c=r[n];t.push(a.createElement(s,{key:n,className:"xh-password-input-item"},m?a.createElement(s,{className:e({"xh-password-input-mask":c})}):c))}return t}()))};export{t as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/PasswordInput/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport { ITouchEvent, View } from \"@tarojs/components\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type PasswordInputProps = {\n value: string;\n length: number;\n mask?: boolean;\n onFocus?: (e) => void;\n} & XHComponentCommonProps;\n\nconst PasswordInput: FC<PasswordInputProps> = (props) => {\n const { value, length, mask = true, onFocus, className } = props;\n\n function renderInputs(): ReactNode {\n const Inputs: any = [];\n\n for (let i = 0; i < length; i++) {\n const char = value[i];\n\n Inputs.push(\n <View key={i} className=\"xh-password-input-item\">\n {mask ? (\n <View className={classNames({ \"xh-password-input-mask\": char })} />\n ) : (\n char\n )}\n </View>\n );\n }\n\n return Inputs;\n }\n\n function handlerClick(e: ITouchEvent): void {\n e.stopPropagation();\n onFocus && onFocus(e);\n }\n const xhpasswordcls = classNames(\"xh-password-input\", className);\n\n return (\n <View className={xhpasswordcls}>\n <View className=\"xh-password-input-list\" onClick={handlerClick}>\n {renderInputs()}\n </View>\n </View>\n );\n};\n\nexport default PasswordInput;\n"],"names":["PasswordInput","props","value","length","_a","mask","onFocus","className","xhpasswordcls","classNames","React","createElement","View","onClick","e","stopPropagation","Inputs","i","char","push","key","renderInputs"],"mappings":"yFAcM,IAAAA,EAAwC,SAACC,GACrC,IAAAC,EAAmDD,EAAKC,MAAjDC,EAA4CF,EAAtCE,OAAEC,EAAoCH,EAAzBI,KAAXA,OAAI,IAAAD,GAAOA,EAAEE,EAAuBL,EAAhBK,QAAEC,EAAcN,EAAKM,UA0BhE,IAAMC,EAAgBC,EAAW,oBAAqBF,GAEtD,OACEG,EAACC,cAAAC,EAAK,CAAAL,UAAWC,GACfE,EAAAC,cAACC,EAAI,CAACL,UAAU,yBAAyBM,QAR7C,SAAsBC,GACpBA,EAAEC,kBACFT,GAAWA,EAAQQ,EACpB,GAvBD,WAGE,IAFA,IAAME,EAAc,GAEXC,EAAI,EAAGA,EAAId,EAAQc,IAAK,CAC/B,IAAMC,EAAOhB,EAAMe,GAEnBD,EAAOG,KACLT,gBAACE,EAAI,CAACQ,IAAKH,EAAGV,UAAU,0BACrBF,EACCK,EAACC,cAAAC,EAAK,CAAAL,UAAWE,EAAW,CAAE,yBAA0BS,SAM/D,CAED,OAAOF,CACR,CAWMK,IAIT"}
@@ -0,0 +1,2 @@
1
+ import{__read as e,__awaiter as t,__generator as n}from"../node_modules/tslib/tslib.es6.js";import r,{useState as a,useRef as o}from"react";import{View as c}from"@tarojs/components";import i from"classnames";import s from"../Popup/index.js";import l from"../Button/index.js";import{useTouch as m,useAsyncEffect as u}from"../src/hooks/index.js";var h=function(h){var p=h.visible,d=h.title,f=h.ItemComponent,v=h.Footer,k=h.data,x=h.onCancel,b=h.onConfirm,E=h.onClose,g=h.cancelText,y=void 0===g?"取消":g,N=h.confirmText,C=void 0===N?"确定":N,j=e(a(0),2),M=j[0],T=j[1],D=o(null),w=e(a(0),2),q=w[0],z=w[1],B=o(0),F=e(a(0),2),P=F[0],I=F[1],R=m();function S(e){T(M),x&&x(e),E&&E(e)}function Y(e,t){void 0===t&&(t=M);var n=function(e){return k[e]}(t);b&&b(n,t),E&&E(e)}u((function(){return t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return p?[4,D.current.getBoundingClientRect()]:[3,2];case 1:e=n.sent().height,t=e/k.length,I(t),n.label=2;case 2:return[2]}}))}))}),[p,k.length]);return r.createElement(s,{visible:p},r.createElement(c,{className:"xh-picker"},r.createElement(c,{className:"xh-picker-header"},r.createElement(r.Fragment,null,r.createElement(l,{className:"xh-picker-header-button picker-cancel",shape:"square",size:"mini",type:"ghost",onClick:S},y),d&&r.createElement("div",{className:"xh-picker-header-title"},d),r.createElement(l,{className:"xh-picker-header-button picker-confirm",shape:"square",size:"mini",type:"ghost",onClick:Y},C))),r.createElement(c,{className:"xh-picker-body"},r.createElement(c,{className:"xh-picker-body-view",ref:D,onTouchStart:function(e){e.preventDefault(),B.current=q,R.touchstart(e)},onTouchMove:function(e){e.preventDefault(),e.stopPropagation(),R.touchmove(e);var t=R.touchMoveDistance.y;if(0!==t){var n=t+B.current;Math.abs(n)<P/3||n>=P||n<=-P*k.length-30||z(n)}},onTouchEnd:function(e){R.touchend(e),e.preventDefault();var t=P*k.length,n=k.length-Math.round((t-Math.abs(q))/P);(n<0||q>0&&q<=P)&&(n=0),n>k.length-1&&(n=k.length-1),z(-n*P),T(n)},style:{transform:"translateY(".concat(q,"px)")},"catch-move":!0},k.map((function(e,t){var n="string"==typeof e?e:e.text,a=i("xh-picker-body-view-item",{active:M===t});return r.createElement(c,{className:a,onClick:function(e){return function(e,t){T(e),Y(t,e)}(t,e)},key:t},f?f({data:e}):n)}))),r.createElement(c,{className:"xh-picker-body-mask"},r.createElement(c,{className:"xh-picker-body-mask-top"}),r.createElement(c,{className:"xh-picker-body-mask-middle"}),r.createElement(c,{className:"xh-picker-body-mask-bottom"}))),r.createElement(c,{className:"xh-picker-footer"},v)))};export{h as default};
2
+ //# sourceMappingURL=Picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Picker.js","sources":["../../../src/components/Picker/Picker.tsx"],"sourcesContent":["import React, {\n PropsWithChildren,\n ReactNode,\n useRef,\n ReactElement,\n useState,\n MouseEventHandler,\n} from \"react\";\nimport { ITouchEvent, View } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport Popup from \"../Popup\";\nimport Button from \"../Button\";\nimport { useAsyncEffect, useTouch } from \"../../hooks\";\n\nexport interface PickerProps<T extends PickerValue>\n extends PropsWithChildren<{}> {\n visible: boolean;\n title?: string | ReactNode;\n data: T[];\n ItemComponent?: (props: { data: T }) => ReactNode;\n Footer?: ReactNode;\n onConfirm?: (value: T, index: number) => void;\n onCancel?: MouseEventHandler;\n onClose?: MouseEventHandler;\n cancelText?: string;\n confirmText?: string;\n}\n\ninterface PickerObjectValue {\n text: string;\n value: string | number;\n [key: string]: any;\n}\n\nexport type PickerValue = string | PickerObjectValue;\n\nconst Picker = <T extends PickerValue>(props: PickerProps<T>): ReactElement => {\n const {\n visible,\n title,\n ItemComponent,\n Footer,\n data,\n onCancel,\n onConfirm,\n onClose,\n cancelText = \"取消\",\n confirmText = \"确定\",\n } = props;\n\n const [selectIndex, setSelectIndex] = useState(0);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const threshold = 30; // 可拉超出的最高距离\n const [transformDistance, setTransformDistance] = useState(0); // 滚动区域translateY\n const lastTranslateY = useRef(0);\n const [perItemHeight, setPerItemHeight] = useState(0); // 每个item的高度\n const touch = useTouch();\n\n const renderItem = (): ReactNode => {\n return data.map((item, index) => {\n let text =\n typeof item === \"string\" ? item : (item as PickerObjectValue).text;\n const itemClass = classNames(\"xh-picker-body-view-item\", {\n active: selectIndex === index,\n });\n return (\n <View\n className={itemClass}\n onClick={e => handleSelect(index, e)}\n key={index}\n >\n {ItemComponent ? ItemComponent({ data: item }) : text}\n </View>\n );\n });\n };\n const renderHeader = (): ReactNode => {\n return (\n <React.Fragment>\n <Button\n className=\"xh-picker-header-button picker-cancel\"\n shape=\"square\"\n size=\"mini\"\n type=\"ghost\"\n onClick={handleCancel}\n >\n {cancelText}\n </Button>\n {title && <div className=\"xh-picker-header-title\">{title}</div>}\n <Button\n className=\"xh-picker-header-button picker-confirm\"\n shape=\"square\"\n size=\"mini\"\n type=\"ghost\"\n onClick={handleConfirm}\n >\n {confirmText}\n </Button>\n </React.Fragment>\n );\n };\n\n useAsyncEffect(async () => {\n if (visible) {\n const { height } = await rootRef.current!.getBoundingClientRect();\n const perheight = height / data.length;\n\n setPerItemHeight(perheight);\n }\n }, [visible, data.length]);\n\n function handleSelect(index: number, e: ITouchEvent): void {\n setSelectIndex(index);\n\n handleConfirm(e, index);\n }\n\n function getValue(index: number): T {\n return data[index];\n }\n\n function handleCancel(e): void {\n setSelectIndex(selectIndex);\n\n onCancel && onCancel(e);\n onClose && onClose(e);\n }\n\n function handleConfirm(e, index = selectIndex): void {\n const value = getValue(index);\n onConfirm && onConfirm(value, index);\n onClose && onClose(e);\n }\n\n const handleToucMove = (e: ITouchEvent) => {\n e.preventDefault();\n e.stopPropagation();\n // 试验\n touch.touchmove(e);\n const distanceY = touch.touchMoveDistance.y;\n if (distanceY === 0) return; // 点击事件\n console.log(distanceY);\n console.log(\"distanceY\");\n let finaltrans = distanceY + lastTranslateY.current;\n if (Math.abs(finaltrans) < perItemHeight / 3) return;\n if (finaltrans >= perItemHeight) return;\n if (finaltrans <= -perItemHeight * data.length - threshold) return;\n setTransformDistance(finaltrans);\n };\n\n const handleTouchStart = (e: ITouchEvent) => {\n e.preventDefault();\n lastTranslateY.current = transformDistance; // end的时候记录最后一次transiton\n // shiyan\n touch.touchstart(e);\n };\n\n const handleTouchEnd = (e: ITouchEvent) => {\n touch.touchend(e);\n e.preventDefault();\n const total = perItemHeight * data.length;\n let index =\n data.length -\n Math.round((total - Math.abs(transformDistance)) / perItemHeight);\n\n if (\n index < 0 ||\n (transformDistance > 0 && transformDistance <= perItemHeight) // 如果往上滚动到顶\n )\n index = 0;\n\n if (index > data.length - 1) index = data.length - 1;\n setTransformDistance(-(index * perItemHeight));\n setSelectIndex(index);\n };\n\n return (\n <Popup visible={visible}>\n <View className=\"xh-picker\">\n <View className=\"xh-picker-header\">{renderHeader()}</View>\n <View className=\"xh-picker-body\">\n <View\n className=\"xh-picker-body-view\"\n ref={rootRef}\n onTouchStart={handleTouchStart}\n onTouchMove={handleToucMove}\n onTouchEnd={handleTouchEnd}\n style={{\n transform: `translateY(${transformDistance}px)`,\n }}\n catch-move\n >\n {renderItem()}\n </View>\n <View className=\"xh-picker-body-mask\">\n <View className=\"xh-picker-body-mask-top\"></View>\n <View className=\"xh-picker-body-mask-middle\"></View>\n <View className=\"xh-picker-body-mask-bottom\"></View>\n </View>\n </View>\n <View className=\"xh-picker-footer\">{Footer}</View>\n </View>\n </Popup>\n );\n};\n\nexport default Picker;\n"],"names":["Picker","props","visible","title","ItemComponent","Footer","data","onCancel","onConfirm","onClose","_a","cancelText","_b","confirmText","_c","__read","useState","selectIndex","setSelectIndex","rootRef","useRef","_d","transformDistance","setTransformDistance","lastTranslateY","_e","perItemHeight","setPerItemHeight","touch","useTouch","handleCancel","e","handleConfirm","index","value","getValue","useAsyncEffect","__awaiter","current","getBoundingClientRect","height","sent","perheight","length","React","createElement","Popup","View","className","Fragment","Button","shape","size","type","onClick","ref","onTouchStart","preventDefault","touchstart","onTouchMove","stopPropagation","touchmove","distanceY","touchMoveDistance","y","finaltrans","Math","abs","onTouchEnd","touchend","total","round","style","transform","concat","map","item","text","itemClass","classNames","active","handleSelect","key"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import{__rest as e,__read as r,__assign as t}from"../node_modules/tslib/tslib.es6.js";import o,{useState as a}from"react";import i from"classnames";import s from"./Picker.js";var l=function(l){var n=l.className,c=l.children,m=e(l,["className","children"]),f=r(a(!1),2),d=f[0],p=f[1];return o.createElement("div",{className:i("xh-picker-field",n),onClick:function(){m.data.length<=0||p(!0)}},c,o.createElement(s,t({visible:d},m,{onClose:function(e){e.stopPropagation(),p(!1)}})))};export{l as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Picker/index.tsx"],"sourcesContent":["import React, {\n useState,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n MouseEvent,\n} from \"react\";\nimport classNames from \"classnames\";\nimport Picker, { PickerValue } from \"./Picker\";\n\nimport \"./index.scss\";\n\nexport interface PickerFieldProps<T extends PickerValue>\n extends PropsWithChildren<{}> {\n title?: ReactNode;\n data: T[];\n ItemComponent?: (props: { data: T }) => ReactNode;\n className?: string;\n onConfirm?: (value: T, index: number) => void;\n onCancel?: () => void;\n}\n\nconst PickerField = <T extends PickerValue>(\n props: PickerFieldProps<T>\n): ReactElement => {\n const { className, children, ...rest } = props;\n const [visible, setVisible] = useState(false);\n\n function handleClick(): void {\n if (rest.data.length <= 0) return;\n\n setVisible(true);\n }\n\n function handleClose(e: MouseEvent): void {\n e.stopPropagation();\n setVisible(false);\n }\n\n return (\n <div\n className={classNames(\"xh-picker-field\", className)}\n onClick={handleClick}\n >\n {children}\n <Picker\n visible={visible}\n {...rest}\n // onCancel={handleClose}\n onClose={handleClose}\n />\n </div>\n );\n};\n\nexport default PickerField;\n"],"names":["PickerField","props","className","children","rest","__rest","_a","__read","useState","visible","setVisible","React","createElement","classNames","onClick","data","length","Picker","__assign","onClose","e","stopPropagation"],"mappings":"+KAsBM,IAAAA,EAAc,SAClBC,GAEQ,IAAAC,EAAiCD,EAAxBC,UAAEC,EAAsBF,EAAdE,SAAKC,EAASC,EAAAJ,EAAnC,CAAA,YAAA,aACAK,EAAAC,EAAwBC,GAAS,GAAM,GAAtCC,EAAOH,EAAA,GAAEI,OAahB,OACEC,EAAAC,cAAA,MAAA,CACEV,UAAWW,EAAW,kBAAmBX,GACzCY,QAdJ,WACMV,EAAKW,KAAKC,QAAU,GAExBN,GAAW,EACZ,GAYIP,EACDQ,EAAAC,cAACK,EACCC,EAAA,CAAAT,QAASA,GACLL,EAAI,CAERe,QAfN,SAAqBC,GACnBA,EAAEC,kBACFX,GAAW,EACZ,KAgBH"}
@@ -0,0 +1,2 @@
1
+ import t,{useEffect as e}from"react";import o from"react-dom";import n from"classnames";import{View as r}from"@tarojs/components";import c from"../Animated/Slide/index.js";import i from"../Animated/Fade/index.js";import m from"../Mask/index.js";var p={top:"down",bottom:"up",left:"right",right:"left"},a=function(a){var d=a.visible,l=a.position,u=void 0===l?"bottom":l,s=a.children,f=a.onClose,h=p[u],v=n("xh-popup-content",{"xh-popup-content-left":"left"===u,"xh-popup-content-right":"right"===u,"xh-popup-content-top":"top"===u,"xh-popup-content-bottom":"bottom"===u});function b(){f&&f()}if(e((function(){return d?(document.body.style.touchAction="none",document.body.addEventListener("touchmove",(function(t){t.stopPropagation(),t.preventDefault()})),document.body.style.overflowY="hidden"):(document.body.style.touchAction="",document.body.removeEventListener("touchmove",(function(t){t.stopPropagation(),t.preventDefault()})),document.body.style.overflowY="auto"),function(){document.body.style.touchAction="",document.body.style.overflowY="auto"}}),[d]),"h5"!==process.env.TARO_ENV){var y=n("xh-popup",d?"visible":"hidden");return t.createElement(r,{className:y},t.createElement(m,{onClick:b}),t.createElement(r,{className:v},s))}return o.createPortal(t.createElement(i,{in:d},t.createElement("div",{className:"xh-popup"},t.createElement(m,{onClick:b}),t.createElement(c,{direction:h,in:d},t.createElement("div",{className:v},s)))),document.body)};export{a as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Popup/index.tsx"],"sourcesContent":["import React, { FC, PropsWithChildren, useEffect } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\n\nimport { Fade, Slide } from \"../Animated\";\nimport { SlideDirection } from \"../Animated/Slide\";\nimport Mask from \"../Mask\";\n\nimport \"./index.scss\";\n\nexport type PopupPosition = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface PopupProps extends PropsWithChildren<{}> {\n visible: boolean;\n position?: PopupPosition;\n onClose?: () => void;\n}\n\nconst positionMap = {\n top: \"down\",\n bottom: \"up\",\n left: \"right\",\n right: \"left\",\n};\n\nconst Popup: FC<PopupProps> = props => {\n const { visible, position = \"bottom\", children, onClose } = props;\n const direction = positionMap[position] as SlideDirection;\n const cls = classNames(\"xh-popup-content\", {\n \"xh-popup-content-left\": position === \"left\",\n \"xh-popup-content-right\": position === \"right\",\n \"xh-popup-content-top\": position === \"top\",\n \"xh-popup-content-bottom\": position === \"bottom\",\n });\n\n useEffect(() => {\n if (visible) {\n document.body.style.touchAction = \"none\";\n document.body.addEventListener(\"touchmove\", e => {\n e.stopPropagation();\n e.preventDefault();\n });\n document.body.style.overflowY = \"hidden\";\n } else {\n document.body.style.touchAction = \"\";\n document.body.removeEventListener(\"touchmove\", e => {\n e.stopPropagation();\n e.preventDefault();\n });\n document.body.style.overflowY = \"auto\";\n }\n\n return () => {\n document.body.style.touchAction = \"\";\n document.body.style.overflowY = \"auto\";\n };\n }, [visible]);\n\n function handleClickOnMask(): void {\n onClose && onClose();\n }\n if (process.env.TARO_ENV !== \"h5\") {\n const minicls = classNames(\"xh-popup\", visible ? \"visible\" : \"hidden\");\n return (\n <View className={minicls}>\n <Mask onClick={handleClickOnMask} />\n <View className={cls}>{children}</View>\n </View>\n );\n }\n return ReactDOM.createPortal(\n <Fade in={visible}>\n <div className=\"xh-popup\">\n <Mask onClick={handleClickOnMask} />\n <Slide direction={direction} in={visible}>\n <div className={cls}>{children}</div>\n </Slide>\n </div>\n </Fade>,\n document.body\n );\n};\n\nexport default Popup;\n"],"names":["positionMap","top","bottom","left","right","Popup","props","visible","_a","position","children","onClose","direction","cls","classNames","handleClickOnMask","useEffect","document","body","style","touchAction","addEventListener","e","stopPropagation","preventDefault","overflowY","removeEventListener","process","env","TARO_ENV","minicls","React","createElement","View","className","Mask","onClick","ReactDOM","createPortal","Fade","in","Slide"],"mappings":"qPAmBA,IAAMA,EAAc,CAClBC,IAAK,OACLC,OAAQ,KACRC,KAAM,QACNC,MAAO,QAGHC,EAAwB,SAAAC,GACpB,IAAAC,EAAoDD,EAAKC,QAAhDC,EAA2CF,EAAxBG,SAAnBA,OAAQ,IAAAD,EAAG,SAAQA,EAAEE,EAAsBJ,EAAKI,SAAjBC,EAAYL,EAAKK,QAC3DC,EAAYZ,EAAYS,GACxBI,EAAMC,EAAW,mBAAoB,CACzC,wBAAsC,SAAbL,EACzB,yBAAuC,UAAbA,EAC1B,uBAAqC,QAAbA,EACxB,0BAAwC,WAAbA,IA0B7B,SAASM,IACPJ,GAAWA,GACZ,CACD,GA1BAK,GAAU,WAiBR,OAhBIT,GACFU,SAASC,KAAKC,MAAMC,YAAc,OAClCH,SAASC,KAAKG,iBAAiB,aAAa,SAAAC,GAC1CA,EAAEC,kBACFD,EAAEE,gBACJ,IACAP,SAASC,KAAKC,MAAMM,UAAY,WAEhCR,SAASC,KAAKC,MAAMC,YAAc,GAClCH,SAASC,KAAKQ,oBAAoB,aAAa,SAAAJ,GAC7CA,EAAEC,kBACFD,EAAEE,gBACJ,IACAP,SAASC,KAAKC,MAAMM,UAAY,QAG3B,WACLR,SAASC,KAAKC,MAAMC,YAAc,GAClCH,SAASC,KAAKC,MAAMM,UAAY,MAClC,CACF,GAAG,CAAClB,IAKyB,OAAzBoB,QAAQC,IAAIC,SAAmB,CACjC,IAAMC,EAAUhB,EAAW,WAAYP,EAAU,UAAY,UAC7D,OACEwB,EAACC,cAAAC,EAAK,CAAAC,UAAWJ,GACfC,EAAAC,cAACG,EAAI,CAACC,QAASrB,IACfgB,EAACC,cAAAC,EAAK,CAAAC,UAAWrB,GAAMH,GAG5B,CACD,OAAO2B,EAASC,aACdP,gBAACQ,EAAI,CAACC,GAAIjC,GACRwB,EAAKC,cAAA,MAAA,CAAAE,UAAU,YACbH,EAAAC,cAACG,EAAI,CAACC,QAASrB,IACfgB,EAACC,cAAAS,GAAM7B,UAAWA,EAAW4B,GAAIjC,GAC/BwB,EAAAC,cAAA,MAAA,CAAKE,UAAWrB,GAAMH,MAI5BO,SAASC,KAEb"}
@@ -0,0 +1,2 @@
1
+ import e from"react";import r from"classnames";import{View as o}from"@tarojs/components";import{pxTransform as t}from"@tarojs/taro";var a=function(a){var s=a.percent,c=void 0===s?88:s,m=a.className,n=a.showPercent,l=void 0!==n&&n,p=a.doneColor,i=void 0===p?"":p,d=a.percentColor,g=void 0===d?"":d,h=a.height,f=r("xh-progress",m),v=r("progress-bar"),N=r("progress-bar-percent");return e.createElement(o,{className:f},e.createElement(o,{className:"progress",style:{height:h&&"".concat(t(h))}},e.createElement(o,{style:{width:"".concat(c,"%"),backgroundColor:i,color:g},className:v},l&&e.createElement(o,{className:N},"".concat(c,"%")))))};export{a as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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} & 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 } = props;\n const progresslcs = classNames(\"xh-progress\", className);\n\n const showPercentcls = classNames(\"progress-bar\");\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 <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 </View>\n </View>\n );\n};\n\nexport default Progress;\n"],"names":["Progress","props","_a","percent","className","_b","showPercent","_c","doneColor","_d","percentColor","height","progresslcs","classNames","showPercentcls","showbarPercentcls","React","createElement","View","style","concat","pxTransform","width","backgroundColor","color"],"mappings":"oIAeM,IAAAA,EAAoC,SAACC,GAEvC,IAAAC,EAMED,EANUE,QAAZA,OAAU,IAAAD,EAAA,KACVE,EAKEH,EAAKG,UAJPC,EAIEJ,cAJFK,cAAmBD,EACnBE,EAGEN,YAHFO,aAAY,GAAED,EACdE,EAEER,eAFFS,aAAe,GAAED,EACjBE,EACEV,EAAKU,OACHC,EAAcC,EAAW,cAAeT,GAExCU,EAAiBD,EAAW,gBAC5BE,EAAoBF,EAAW,wBACrC,OACEG,EAACC,cAAAC,EAAK,CAAAd,UAAWQ,GACfI,EAAAC,cAACC,EACC,CAAAd,UAAU,WACVe,MAAO,CAAER,OAAQA,GAAU,GAAGS,OAAAC,EAAYV,MAE1CK,EAACC,cAAAC,EACC,CAAAC,MAAO,CACLG,MAAO,GAAGF,OAAAjB,EAAU,KACpBoB,gBAAiBf,EACjBgB,MAAOd,GAETN,UAAWU,GAEVR,GACCU,EAACC,cAAAC,EAAK,CAAAd,UAAWW,GAAoB,GAAGK,OAAAjB,EAAU,QAM9D"}
@@ -0,0 +1,2 @@
1
+ import a from"./tabbar/Tabbar.js";import r from"./tabbar/TabItem.js";var t=a;t.Item=r;export{t as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Tabbar/index.tsx"],"sourcesContent":["import TabBarComponent, { TabProps } from \"./tabbar/Tabbar\";\nimport TabBarItem from \"./tabbar/TabItem\";\n\nexport interface TabBarComponent<P = {}> extends React.FC<P> {\n Item: typeof TabBarItem;\n}\n\nconst TabBar = TabBarComponent as TabBarComponent<TabProps>;\n\nTabBar.Item = TabBarItem;\n\nexport default TabBar;\n"],"names":["TabBar","TabBarComponent","Item","TabBarItem"],"mappings":"qEAOM,IAAAA,EAASC,EAEfD,EAAOE,KAAOC"}
@@ -0,0 +1,2 @@
1
+ import e from"react";var t=function(t){var a=t.children,r=t.title,m=t.TabItemComponent;return e.createElement("div",{className:"xh-tabbar-item"},m||r,a)};export{t as default};
2
+ //# sourceMappingURL=TabItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabItem.js","sources":["../../../../src/components/Tabbar/tabbar/TabItem.tsx"],"sourcesContent":["import React, { PropsWithChildren, ReactNode } from \"react\";\n\nimport \"./index.scss\";\n\nexport interface TabItemProps extends PropsWithChildren<{}> {\n title?: string;\n TabItemComponent?: ReactNode;\n children?: ReactNode;\n}\n\nconst TabItem = (props: TabItemProps) => {\n const { children, title, TabItemComponent } = props;\n\n return (\n <div className=\"xh-tabbar-item\">\n {TabItemComponent ? TabItemComponent : title}\n {children}\n </div>\n );\n};\n\nexport default TabItem;\n"],"names":["TabItem","props","children","title","TabItemComponent","React","createElement","className"],"mappings":"qBAUM,IAAAA,EAAU,SAACC,GACP,IAAAC,EAAsCD,EAAKC,SAAjCC,EAA4BF,EAAKE,MAA1BC,EAAqBH,mBAE9C,OACEI,EAAAC,cAAA,MAAA,CAAKC,UAAU,kBACZH,GAAsCD,EACtCD,EAGP"}
@@ -0,0 +1,2 @@
1
+ import{__read as t}from"../../node_modules/tslib/tslib.es6.js";import e,{useState as a,useEffect as n}from"react";import{createSelectorQuery as o}from"@tarojs/taro";import{View as r}from"@tarojs/components";import i from"classnames";import c from"./TabItem.js";var l=function(c){var l=c.children,m=void 0===l?[]:l,s=c.animated,b=void 0!==s&&s,v=c.initIndex,h=void 0===v?0:v,p=c.lineColor,f=void 0===p?"#F6AB00":p,u=c.titleActiveColor,d=void 0===u?"#333":u,x=c.titleInctiveColor,C=void 0===x?"#999":x,g=c.onChange,y=t(a(h),2),E=y[0],I=y[1],N=t(a(0),2),T=N[0],k=N[1],A=t(a(0),2),j=A[0],R=A[1];n((function(){var t=setTimeout((function(){var e=o();e.selectAll(".xh-tabbar-nav-item").boundingClientRect(),e.selectAll(".xh-tabbar-content-item").boundingClientRect(),e.exec((function(e){if(e[0][E]){var a=e[0][E].width;if(k(a),e[1][E]){var n=e[1][E].height;R(n),clearTimeout(t)}}}))}),300)}),[E,m]);var X;return e.createElement(r,{className:"xh-tabbar"},e.createElement(r,{className:"xh-tabbar-nav"},m.map((function(t,a){return e.createElement(r,{key:a,className:"xh-tabbar-nav-item",style:{color:E===a?d:C},onClick:function(){return function(t){I(t);var e=o();e.selectAll(".xh-tabbar-content-item").boundingClientRect(),e.exec((function(e){if(e[0][t]){var a=e[0][t].height;R(a)}})),g&&g(t)}(a)}},t.props.TabItemComponent?t.props.TabItemComponent:t.props.title)})),(X=T/2+E*T,e.createElement("div",{className:i("xh-tabbar-nav-line",{"xh-tabbar-nav-line-active":b}),style:{background:"".concat(f),transform:"translateX(".concat(X,"px) translate(-50%, -50%)"),WebkitTransform:"translateX(".concat(X,"px) translate(-50%, -50%)")}}))),e.createElement(r,{className:"xh-tabbar-content",style:{width:"".concat(100*m.length,"%"),height:j?"".concat(j,"px"):"auto"}},m.map((function(t,a){return e.createElement(r,{key:a,className:i("xh-tabbar-content-item",{"xh-tabbar-content-item-dispaly":E!==a&&!b,"xh-tabbar-content-item-active":E===a}),style:{transform:b?"translateX(-".concat(100*E,"%)"):""}},t.props.children)}))))};l.Item=c;export{l as default};
2
+ //# sourceMappingURL=Tabbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabbar.js","sources":["../../../../src/components/Tabbar/tabbar/Tabbar.tsx"],"sourcesContent":["import React, { FC, ReactElement, useEffect, useState } from \"react\";\nimport { createSelectorQuery } from \"@tarojs/taro\";\nimport { View } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport Item from \"./TabItem\";\n\nimport \"./index.scss\";\n\n/**\n * Tab切换\n *\n * @param children //子组件\n * @param animated //是否开启转场动画\n * @param selectIndex //默认选中第几个\n * @param lineColor //下划线颜色\n * @param titleActiveColor //标题选中态颜色\n * @param titleInctiveColor //标题默认态颜色\n * @param onChange //切换回调事件\n *\n */\n\nexport interface TabProps {\n children: ReactElement[];\n animated?: boolean;\n initIndex?: number;\n lineColor?: string;\n titleActiveColor?: string;\n titleInctiveColor?: string;\n onChange?: (index: number) => void;\n}\n\nexport interface TabsComponent<P = {}> extends FC<P> {\n Item: typeof Item;\n}\n\nconst XHTabs: TabsComponent<TabProps> = props => {\n const {\n children = [],\n animated = false,\n initIndex = 0,\n lineColor = \"#F6AB00\",\n titleActiveColor = \"#333\",\n titleInctiveColor = \"#999\",\n onChange,\n } = props;\n\n const [selectIndex, setSelectIndex] = useState(initIndex);\n const [tabWdith, setTabWdith] = useState(0);\n const [tabContentHeight, setTabContentHeight] = useState(0);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n const query = createSelectorQuery();\n query.selectAll(\".xh-tabbar-nav-item\").boundingClientRect();\n query.selectAll(\".xh-tabbar-content-item\").boundingClientRect();\n\n query.exec(res => {\n if (!res[0][selectIndex]) return;\n const width: number = res[0][selectIndex].width;\n setTabWdith(width);\n\n if (!res[1][selectIndex]) return;\n const height: number = res[1][selectIndex].height;\n setTabContentHeight(height);\n clearTimeout(timer);\n });\n }, 300);\n console.log(children.length);\n }, [selectIndex, children]);\n\n const handleClick = (index: number): void => {\n setSelectIndex(index);\n const query = createSelectorQuery();\n query.selectAll(\".xh-tabbar-content-item\").boundingClientRect();\n query.exec(res => {\n if (!res[0][index]) return;\n const height: number = res[0][index].height;\n setTabContentHeight(height);\n });\n\n onChange && onChange(index);\n };\n\n function renderLine(): ReactElement | null {\n const left: number = tabWdith / 2 + selectIndex * tabWdith;\n return (\n <div\n className={classNames(\"xh-tabbar-nav-line\", {\n \"xh-tabbar-nav-line-active\": animated,\n })}\n style={{\n background: `${lineColor}`,\n transform: `translateX(${left}px) translate(-50%, -50%)`,\n WebkitTransform: `translateX(${left}px) translate(-50%, -50%)`,\n }}\n />\n );\n }\n\n return (\n <View className=\"xh-tabbar\">\n <View className=\"xh-tabbar-nav\">\n {children.map((child, index) => (\n <View\n key={index}\n className=\"xh-tabbar-nav-item\"\n style={{\n color:\n selectIndex === index ? titleActiveColor : titleInctiveColor,\n }}\n onClick={() => handleClick(index)}\n >\n {child.props.TabItemComponent\n ? child.props.TabItemComponent\n : child.props.title}\n </View>\n ))}\n {renderLine()}\n </View>\n <View\n className=\"xh-tabbar-content\"\n style={{\n width: `${children.length * 100}%`,\n height: tabContentHeight ? `${tabContentHeight}px` : \"auto\",\n }}\n >\n {children.map((child, index) => (\n <View\n key={index}\n className={classNames(\"xh-tabbar-content-item\", {\n \"xh-tabbar-content-item-dispaly\":\n selectIndex !== index && !animated,\n \"xh-tabbar-content-item-active\": selectIndex === index,\n })}\n style={{\n transform: animated ? `translateX(-${selectIndex * 100}%)` : \"\",\n }}\n >\n {child.props.children}\n </View>\n ))}\n </View>\n </View>\n );\n};\n\nXHTabs.Item = Item;\n\nexport default XHTabs;\nexport const TabItem = Item;\n"],"names":["XHTabs","props","_a","children","_b","animated","_c","initIndex","_d","lineColor","_e","titleActiveColor","_f","titleInctiveColor","onChange","_g","__read","useState","selectIndex","setSelectIndex","_h","tabWdith","setTabWdith","_j","tabContentHeight","setTabContentHeight","useEffect","timer","setTimeout","query","createSelectorQuery","selectAll","boundingClientRect","exec","res","width","height","clearTimeout","left","React","createElement","View","className","map","child","index","key","style","color","onClick","handleClick","TabItemComponent","title","classNames","background","concat","transform","WebkitTransform","length","Item"],"mappings":"qQAmCM,IAAAA,EAAkC,SAAAC,GAEpC,IAAAC,EAOED,EAAKE,SAPPA,OAAW,IAAAD,EAAA,GAAEA,EACbE,EAMEH,EANcI,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAKEL,EAAKM,UALPA,OAAY,IAAAD,EAAA,EAACA,EACbE,EAIEP,YAJFQ,OAAY,IAAAD,EAAA,UAASA,EACrBE,EAGET,EAHuBU,iBAAzBA,OAAgB,IAAAD,EAAG,OAAMA,EACzBE,EAEEX,EAAKY,kBAFPA,OAAoB,IAAAD,EAAA,OAAMA,EAC1BE,EACEb,EAAKa,SAEHC,EAAAC,EAAgCC,EAASV,GAAU,GAAlDW,EAAWH,EAAA,GAAEI,OACdC,EAAAJ,EAA0BC,EAAS,GAAE,GAApCI,EAAQD,EAAA,GAAEE,OACXC,EAAAP,EAA0CC,EAAS,GAAE,GAApDO,EAAgBD,EAAA,GAAEE,OAEzBC,GAAU,WACR,IAAMC,EAAQC,YAAW,WACvB,IAAMC,EAAQC,IACdD,EAAME,UAAU,uBAAuBC,qBACvCH,EAAME,UAAU,2BAA2BC,qBAE3CH,EAAMI,MAAK,SAAAC,GACT,GAAKA,EAAI,GAAGhB,GAAZ,CACA,IAAMiB,EAAgBD,EAAI,GAAGhB,GAAaiB,MAG1C,GAFAb,EAAYa,GAEPD,EAAI,GAAGhB,GAAZ,CACA,IAAMkB,EAAiBF,EAAI,GAAGhB,GAAakB,OAC3CX,EAAoBW,GACpBC,aAAaV,EAHoB,CAJA,CAQnC,GACD,GAAE,IAEL,GAAG,CAACT,EAAaf,IAEjB,IAcQmC,EAeR,OACEC,EAACC,cAAAC,EAAK,CAAAC,UAAU,aACdH,EAAAC,cAACC,EAAI,CAACC,UAAU,iBACbvC,EAASwC,KAAI,SAACC,EAAOC,GAAU,OAC9BN,EAAAC,cAACC,EACC,CAAAK,IAAKD,EACLH,UAAU,qBACVK,MAAO,CACLC,MACE9B,IAAgB2B,EAAQlC,EAAmBE,GAE/CoC,QAAS,WAAM,OAxCL,SAACJ,GACnB1B,EAAe0B,GACf,IAAMhB,EAAQC,IACdD,EAAME,UAAU,2BAA2BC,qBAC3CH,EAAMI,MAAK,SAAAC,GACT,GAAKA,EAAI,GAAGW,GAAZ,CACA,IAAMT,EAAiBF,EAAI,GAAGW,GAAOT,OACrCX,EAAoBW,EAFO,CAG7B,IAEAtB,GAAYA,EAAS+B,EACvB,CA6ByBK,CAAYL,KAE1BD,EAAM3C,MAAMkD,iBACTP,EAAM3C,MAAMkD,iBACZP,EAAM3C,MAAMmD,WA9BlBd,EAAejB,EAAW,EAAIH,EAAcG,EAEhDkB,EACEC,cAAA,MAAA,CAAAE,UAAWW,EAAW,qBAAsB,CAC1C,4BAA6BhD,IAE/B0C,MAAO,CACLO,WAAY,GAAGC,OAAA9C,GACf+C,UAAW,cAAcD,OAAAjB,EAA+B,6BACxDmB,gBAAiB,cAAcF,OAAAjB,EAA+B,kCA0BlEC,EAAAC,cAACC,EACC,CAAAC,UAAU,oBACVK,MAAO,CACLZ,MAAO,GAAGoB,OAAkB,IAAlBpD,EAASuD,OAAe,KAClCtB,OAAQZ,EAAmB,GAAG+B,OAAA/B,EAAoB,MAAG,SAGtDrB,EAASwC,KAAI,SAACC,EAAOC,GAAU,OAC9BN,gBAACE,EAAI,CACHK,IAAKD,EACLH,UAAWW,EAAW,yBAA0B,CAC9C,iCACEnC,IAAgB2B,IAAUxC,EAC5B,gCAAiCa,IAAgB2B,IAEnDE,MAAO,CACLS,UAAWnD,EAAW,eAAAkD,OAA6B,IAAdrC,EAAiB,MAAO,KAG9D0B,EAAM3C,MAAME,SAEhB,KAIT,EAEAH,EAAO2D,KAAOA"}
@@ -0,0 +1,2 @@
1
+ import e,{useMemo as t}from"react";import o from"react-dom";import a from"classnames";import{View as r}from"@tarojs/components";import s from"../Mask/index.js";import n from"../Image/index.js";import m from"../node_modules/react-transition-group/esm/CSSTransition.js";var c=function(c){var i=c.title,l=c.className,u=void 0===l?"":l,d=c.icon,f=void 0===d?"success":d,p=c.image,E=void 0===p?"":p,g=a("xh-toast",u),v=a("iconfont",{success:"icon-success_toast",error:"icon-failure_toast",loading:"icon-loading_toast"}[f]),x=t((function(){return E?e.createElement(n,{src:E,width:24,height:24}):f?e.createElement("span",{className:v}):void 0}),[f,E]),h=e.createElement(r,{className:g},e.createElement(s,{mask:"transparent"}),e.createElement(m,{in:!0,timeout:200,classNames:"face",unmountOnExit:!0},e.createElement(r,{className:"xh-toast-content"},x,e.createElement(r,null,i))));return o.createPortal(h,document.body)};export{c as default};
2
+ //# sourceMappingURL=Toast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast.js","sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import React, { FC, useMemo } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport Mask from \"../Mask\";\nimport Image from \"../Image\";\n\nimport \"./index.scss\";\n\nexport type ToastProps = {\n title: string;\n duration?: number;\n /** 图标\n * 可选值:\n * - 'success': 显示成功图标,此时 title 文本最多显示 7 个汉字长度;\n * - 'error': 显示失败图标,此时 title 文本最多显示 7 个汉字长度;\n * - 'loading': 显示加载图标,此时 title 文本最多显示 7 个汉字长度;\n * - 'none': 不显示图标,此时 title 文本最多可显示两行 */\n icon?: \"success\" | \"error\" | \"loading\" | \"none\";\n /** 自定义图标的本地路径,image 的优先级高于 icon */\n image?: string;\n /** 是否显示透明蒙层,防止触摸穿透 */\n mask?: boolean;\n} & XHComponentCommonProps;\n\nconst ToastCom: FC<ToastProps> = (props) => {\n const { title, className = \"\", icon = \"success\", image = \"\" } = props;\n\n const toastcls = classNames(\"xh-toast\", className);\n\n // icon-success_toast\n // icon-alert_toast\n // icon-failure_toast\n // icon-loading_toast\n\n const classConfig = {\n success: \"icon-success_toast\",\n error: \"icon-failure_toast\",\n loading: \"icon-loading_toast\",\n };\n const cls = classNames(\"iconfont\", classConfig[icon]);\n const showIcon = useMemo(() => {\n if (image) return <Image src={image} width={24} height={24} />;\n if (icon) return <span className={cls}></span>;\n }, [icon, image]);\n\n const DialogMain = (\n <View className={toastcls}>\n <Mask mask=\"transparent\" />\n <CSSTransition in timeout={200} classNames=\"face\" unmountOnExit>\n <View className=\"xh-toast-content\">\n {showIcon}\n <View>{title}</View>\n </View>\n </CSSTransition>\n </View>\n );\n\n return ReactDOM.createPortal(DialogMain, document.body);\n};\n\nexport default ToastCom;\n"],"names":["ToastCom","props","title","_a","className","_b","icon","_c","image","toastcls","classNames","cls","success","error","loading","showIcon","useMemo","React","createElement","Image","src","width","height","DialogMain","View","Mask","mask","CSSTransition","in","timeout","unmountOnExit","ReactDOM","createPortal","document","body"],"mappings":"4QA2BM,IAAAA,EAA2B,SAACC,GACxB,IAAAC,EAAwDD,EAAKC,MAAtDC,EAAiDF,EAAKG,UAAtDA,OAAY,IAAAD,EAAA,KAAIE,EAAiCJ,EAAKK,KAAtCA,OAAO,IAAAD,EAAA,YAAWE,EAAeN,EAAKO,MAApBA,OAAQ,IAAAD,EAAA,KAEnDE,EAAWC,EAAW,WAAYN,GAYlCO,EAAMD,EAAW,WALH,CAClBE,QAAS,qBACTC,MAAO,qBACPC,QAAS,sBAEoCR,IACzCS,EAAWC,GAAQ,WACvB,OAAIR,EAAcS,EAACC,cAAAC,EAAM,CAAAC,IAAKZ,EAAOa,MAAO,GAAIC,OAAQ,KACpDhB,EAAaW,EAAMC,cAAA,OAAA,CAAAd,UAAWO,SAAlC,CACF,GAAG,CAACL,EAAME,IAEJe,EACJN,EAAAC,cAACM,EAAK,CAAApB,UAAWK,GACfQ,EAAAC,cAACO,EAAI,CAACC,KAAK,gBACXT,EAAAC,cAACS,EAAa,CAACC,IAAE,EAACC,QAAS,IAAKnB,WAAW,OAAOoB,eAAa,GAC7Db,EAAAC,cAACM,EAAI,CAACpB,UAAU,oBACbW,EACDE,EAACC,cAAAM,OAAMtB,MAMf,OAAO6B,EAASC,aAAaT,EAAYU,SAASC,KACpD"}
@@ -0,0 +1,2 @@
1
+ import{__awaiter as t,__generator as e,__assign as o,__rest as r}from"../node_modules/tslib/tslib.es6.js";import n from"react";import i from"react-dom";import{showToast as m}from"@tarojs/taro";import u from"./Toast.js";function a(a){for(var s=[],c=1;c<arguments.length;c++)s[c-1]=arguments[c];return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){return t={title:"",duration:3e3,mask:!0},"string"==typeof a||"number"==typeof a?(t.title="".concat(a),s.length&&(t.duration=s[0])):t=o(o({},t),a),[2,new Promise((function(e){if("h5"===process.env.TARO_ENV){var a=document.createElement("div"),s=setTimeout((function(){i.unmountComponentAtNode(a),clearTimeout(s),e()}),t.duration),c=t.title,f=r(t,["title"]);i.render(n.createElement(u,o({title:c},f)),a)}else m(o({icon:"none"},t)).then((function(o){if("showToast:ok"===o.errMsg)var r=setTimeout((function(){clearTimeout(r),e()}),t.duration)}))}))]}))}))}export{a as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Toast/index.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { showToast } from \"@tarojs/taro\";\nimport ToastComponent, { ToastProps } from \"./Toast\";\nimport \"./index.scss\";\n\nasync function Toast(\n message: string | number,\n duration?: number\n): Promise<void>;\nasync function Toast(props: ToastProps): Promise<void>;\nasync function Toast(\n arg: string | number | ToastProps,\n ...rest\n): Promise<void> {\n let defalutParam = {\n title: \"\",\n duration: 3000,\n mask: true,\n };\n if (typeof arg === \"string\" || typeof arg === \"number\") {\n defalutParam.title = `${arg}`;\n if (rest.length) {\n defalutParam.duration = rest[0];\n }\n } else {\n defalutParam = {\n ...defalutParam,\n ...arg,\n };\n }\n return new Promise(resolve => {\n if (process.env.TARO_ENV === \"h5\") {\n const div = document.createElement(\"div\");\n\n const timer = setTimeout(() => {\n ReactDOM.unmountComponentAtNode(div);\n clearTimeout(timer);\n resolve();\n }, defalutParam.duration);\n const { title, ...other } = defalutParam;\n ReactDOM.render(<ToastComponent title={title} {...other} />, div);\n } else {\n showToast({\n icon: \"none\",\n ...defalutParam,\n }).then(res => {\n if (res.errMsg === \"showToast:ok\") {\n const timer = setTimeout(() => {\n clearTimeout(timer);\n resolve();\n }, defalutParam.duration);\n }\n });\n }\n });\n}\n\nexport default Toast;\n"],"names":["Toast","arg","rest","_i","arguments","length","defalutParam","title","duration","mask","concat","__assign","Promise","resolve","process","env","TARO_ENV","div_1","document","createElement","timer_1","setTimeout","ReactDOM","unmountComponentAtNode","clearTimeout","other","__rest","render","React","ToastComponent","showToast","icon","then","res","errMsg","timer_2"],"mappings":"2NAWA,SAAeA,EACbC,OACA,IAAOC,EAAA,GAAAC,EAAA,EAAPA,EAAOC,UAAAC,OAAPF,IAAAD,EAAOC,EAAA,GAAAC,UAAAD,4EAkBP,OAhBIG,EAAe,CACjBC,MAAO,GACPC,SAAU,IACVC,MAAM,GAEW,iBAARR,GAAmC,iBAARA,GACpCK,EAAaC,MAAQ,GAAGG,OAAAT,GACpBC,EAAKG,SACPC,EAAaE,SAAWN,EAAK,KAG/BI,EACKK,EAAAA,EAAA,CAAA,EAAAL,GACAL,GAGP,CAAA,EAAO,IAAIW,SAAQ,SAAAC,GACjB,GAA6B,OAAzBC,QAAQC,IAAIC,SAAmB,CACjC,IAAMC,EAAMC,SAASC,cAAc,OAE7BC,EAAQC,YAAW,WACvBC,EAASC,uBAAuBN,GAChCO,aAAaJ,GACbP,GACF,GAAGP,EAAaE,UACRD,EAAoBD,EAAfC,MAAKkB,EAAKC,EAAKpB,EAAtB,CAAmB,UACzBgB,EAASK,OAAOC,EAAAT,cAACU,EAAelB,EAAA,CAAAJ,MAAOA,GAAWkB,IAAWR,EAC9D,MACCa,EAASnB,EAAA,CACPoB,KAAM,QACHzB,IACF0B,MAAK,SAAAC,GACN,GAAmB,iBAAfA,EAAIC,OACN,IAAMC,EAAQd,YAAW,WACvBG,aAAaW,GACbtB,GACF,GAAGP,EAAaE,SAEpB,GAEH,UACF"}
@@ -0,0 +1,2 @@
1
+ import e from"../node_modules/prop-types/lib/ReactPropTypesSecret.js";var o=e;export{o as default};
2
+ //# sourceMappingURL=ReactPropTypesSecret.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactPropTypesSecret.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ function r(r,t,e){return r(e={path:t,exports:{},require:function(r,t){return n(null==t&&e.path)}},e.exports),e.exports}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}export{n as commonjsRequire,r as createCommonjsModule};
2
+ //# sourceMappingURL=_commonjsHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e from"../node_modules/prop-types/checkPropTypes.js";var o=e;export{o as default};
2
+ //# sourceMappingURL=checkPropTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkPropTypes.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import o from"../node_modules/prop-types/factoryWithThrowingShims.js";var r=o;export{r as default};
2
+ //# sourceMappingURL=factoryWithThrowingShims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factoryWithThrowingShims.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e from"../node_modules/prop-types/factoryWithTypeCheckers.js";var o=e;export{o as default};
2
+ //# sourceMappingURL=factoryWithTypeCheckers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factoryWithTypeCheckers.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import o from"../node_modules/prop-types/lib/has.js";var e=o;export{e as default};
2
+ //# sourceMappingURL=has.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"has.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e from"../node_modules/react-is/index.js";export{default}from"../node_modules/react-is/index.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e from"../node_modules/object-assign/index.js";export{default}from"../node_modules/object-assign/index.js";
2
+ //# sourceMappingURL=index2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e from"../node_modules/react-is/cjs/react-is.development.js";export{default}from"../node_modules/react-is/cjs/react-is.development.js";
2
+ //# sourceMappingURL=react-is.development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-is.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import o from"../node_modules/react-is/cjs/react-is.production.min.js";export{default}from"../node_modules/react-is/cjs/react-is.production.min.js";
2
+ //# sourceMappingURL=react-is.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-is.production.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ function t(){return t=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},t.apply(this,arguments)}export{t as default};
2
+ //# sourceMappingURL=extends.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extends.js","sources":["../../../../../../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}"],"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this"],"mappings":"AAAe,SAASA,IActB,OAbAA,EAAWC,OAAOC,OAASD,OAAOC,OAAOC,OAAS,SAAUC,GAC1D,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAASF,UAAUD,GAEvB,IAAK,IAAII,KAAOD,EACVP,OAAOS,UAAUC,eAAeC,KAAKJ,EAAQC,KAC/CL,EAAOK,GAAOD,EAAOC,GAG1B,CAED,OAAOL,CACX,EACSJ,EAASa,MAAMC,KAAMR,UAC9B"}
@@ -0,0 +1,2 @@
1
+ import t from"./setPrototypeOf.js";function o(o,e){o.prototype=Object.create(e.prototype),o.prototype.constructor=o,t(o,e)}export{o as default};
2
+ //# sourceMappingURL=inheritsLoose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inheritsLoose.js","sources":["../../../../../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"],"sourcesContent":["import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}"],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","setPrototypeOf"],"mappings":"mCACe,SAASA,EAAeC,EAAUC,GAC/CD,EAASE,UAAYC,OAAOC,OAAOH,EAAWC,WAC9CF,EAASE,UAAUG,YAAcL,EACjCM,EAAeN,EAAUC,EAC3B"}
@@ -0,0 +1,2 @@
1
+ function e(e,n){if(null==e)return{};var r,t,f={},u=Object.keys(e);for(t=0;t<u.length;t++)r=u[t],n.indexOf(r)>=0||(f[r]=e[r]);return f}export{e as default};
2
+ //# sourceMappingURL=objectWithoutPropertiesLoose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectWithoutPropertiesLoose.js","sources":["../../../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}"],"names":["_objectWithoutPropertiesLoose","source","excluded","key","i","target","sourceKeys","Object","keys","length","indexOf"],"mappings":"AAAe,SAASA,EAA8BC,EAAQC,GAC5D,GAAc,MAAVD,EAAgB,MAAO,GAC3B,IAEIE,EAAKC,EAFLC,EAAS,CAAA,EACTC,EAAaC,OAAOC,KAAKP,GAG7B,IAAKG,EAAI,EAAGA,EAAIE,EAAWG,OAAQL,IACjCD,EAAMG,EAAWF,GACbF,EAASQ,QAAQP,IAAQ,IAC7BE,EAAOF,GAAOF,EAAOE,IAGvB,OAAOE,CACT"}
@@ -0,0 +1,2 @@
1
+ function t(e,o){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t(e,o)}export{t as default};
2
+ //# sourceMappingURL=setPrototypeOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setPrototypeOf.js","sources":["../../../../../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"],"sourcesContent":["export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}"],"names":["_setPrototypeOf","o","p","Object","setPrototypeOf","bind","__proto__"],"mappings":"AAAe,SAASA,EAAgBC,EAAGC,GAKzC,OAJAF,EAAkBG,OAAOC,eAAiBD,OAAOC,eAAeC,OAAS,SAAyBJ,EAAGC,GAEnG,OADAD,EAAEK,UAAYJ,EACPD,CACX,EACSD,EAAgBC,EAAGC,EAC5B"}
@@ -0,0 +1,2 @@
1
+ import s from"./hasClass.js";function a(a,t){a.classList?a.classList.add(t):s(a,t)||("string"==typeof a.className?a.className=a.className+" "+t:a.setAttribute("class",(a.className&&a.className.baseVal||"")+" "+t))}export{a as default};
2
+ //# sourceMappingURL=addClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addClass.js","sources":["../../../../../node_modules/dom-helpers/esm/addClass.js"],"sourcesContent":["import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}"],"names":["addClass","element","className","classList","add","hasClass","setAttribute","baseVal"],"mappings":"6BAQe,SAASA,EAASC,EAASC,GACpCD,EAAQE,UAAWF,EAAQE,UAAUC,IAAIF,GAAqBG,EAASJ,EAASC,KAA6C,iBAAtBD,EAAQC,UAAwBD,EAAQC,UAAYD,EAAQC,UAAY,IAAMA,EAAeD,EAAQK,aAAa,SAAUL,EAAQC,WAAaD,EAAQC,UAAUK,SAAW,IAAM,IAAML,GACvS"}
@@ -0,0 +1,2 @@
1
+ function s(s,a){return s.classList?!!a&&s.classList.contains(a):-1!==(" "+(s.className.baseVal||s.className)+" ").indexOf(" "+a+" ")}export{s as default};
2
+ //# sourceMappingURL=hasClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasClass.js","sources":["../../../../../node_modules/dom-helpers/esm/hasClass.js"],"sourcesContent":["/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}"],"names":["hasClass","element","className","classList","contains","baseVal","indexOf"],"mappings":"AAMe,SAASA,EAASC,EAASC,GACxC,OAAID,EAAQE,YAAoBD,GAAaD,EAAQE,UAAUC,SAASF,IACkC,KAAlG,KAAOD,EAAQC,UAAUG,SAAWJ,EAAQC,WAAa,KAAKI,QAAQ,IAAMJ,EAAY,IAClG"}
@@ -0,0 +1,2 @@
1
+ function s(s,e){return s.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function e(e,a){e.classList?e.classList.remove(a):"string"==typeof e.className?e.className=s(e.className,a):e.setAttribute("class",s(e.className&&e.className.baseVal||"",a))}export{e as default};
2
+ //# sourceMappingURL=removeClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeClass.js","sources":["../../../../../node_modules/dom-helpers/esm/removeClass.js"],"sourcesContent":["function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}"],"names":["replaceClassName","origClass","classToRemove","replace","RegExp","removeClass","element","className","classList","remove","setAttribute","baseVal"],"mappings":"AAAA,SAASA,EAAiBC,EAAWC,GACnC,OAAOD,EAAUE,QAAQ,IAAIC,OAAO,UAAYF,EAAgB,YAAa,KAAM,MAAMC,QAAQ,OAAQ,KAAKA,QAAQ,aAAc,GACtI,CASe,SAASE,EAAYC,EAASC,GACvCD,EAAQE,UACVF,EAAQE,UAAUC,OAAOF,GACa,iBAAtBD,EAAQC,UACxBD,EAAQC,UAAYP,EAAiBM,EAAQC,UAAWA,GAExDD,EAAQI,aAAa,QAASV,EAAiBM,EAAQC,WAAaD,EAAQC,UAAUI,SAAW,GAAIJ,GAEzG"}
@@ -0,0 +1,7 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+ var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;function n(r){if(null==r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}var o=function(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(r){return t[r]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(r){n[r]=r})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(r){return!1}}()?Object.assign:function(o,a){for(var c,i,f=n(o),s=1;s<arguments.length;s++){for(var l in c=Object(arguments[s]))t.call(c,l)&&(f[l]=c[l]);if(r){i=r(c);for(var u=0;u<i.length;u++)e.call(c,i[u])&&(f[i[u]]=c[i[u]])}}return f};export{o as __moduleExports,o as default};
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../node_modules/object-assign/index.js"],"sourcesContent":["/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n"],"names":["getOwnPropertySymbols","Object","hasOwnProperty","prototype","propIsEnumerable","propertyIsEnumerable","toObject","val","TypeError","objectAssign","assign","test1","String","getOwnPropertyNames","test2","i","fromCharCode","map","n","join","test3","split","forEach","letter","keys","err","shouldUseNative","target","source","from","symbols","to","s","arguments","length","key","call"],"mappings":";;;;;AAQA,IAAIA,EAAwBC,OAAOD,sBAC/BE,EAAiBD,OAAOE,UAAUD,eAClCE,EAAmBH,OAAOE,UAAUE,qBAExC,SAASC,EAASC,GACjB,GAAIA,QACH,MAAM,IAAIC,UAAU,yDAGrB,OAAOP,OAAOM,EACf,CA8CA,IAAAE,EA5CA,WACC,IACC,IAAKR,OAAOS,OACX,OAAO,EAMR,IAAIC,EAAQ,IAAIC,OAAO,OAEvB,GADAD,EAAM,GAAK,KACkC,MAAzCV,OAAOY,oBAAoBF,GAAO,GACrC,OAAO,EAKR,IADA,IAAIG,EAAQ,CAAA,EACHC,EAAI,EAAGA,EAAI,GAAIA,IACvBD,EAAM,IAAMF,OAAOI,aAAaD,IAAMA,EAKvC,GAAwB,eAHXd,OAAOY,oBAAoBC,GAAOG,KAAI,SAAUC,GAC5D,OAAOJ,EAAMI,EAChB,IACaC,KAAK,IACf,OAAO,EAIR,IAAIC,EAAQ,CAAA,EAIZ,MAHA,uBAAuBC,MAAM,IAAIC,SAAQ,SAAUC,GAClDH,EAAMG,GAAUA,CACnB,IAEI,yBADEtB,OAAOuB,KAAKvB,OAAOS,OAAO,CAAE,EAAEU,IAAQD,KAAK,GAS/C,CAHC,MAAOM,GAER,OAAO,CACP,CACF,CAEiBC,GAAoBzB,OAAOS,OAAS,SAAUiB,EAAQC,GAKtE,IAJA,IAAIC,EAEAC,EADAC,EAAKzB,EAASqB,GAGTK,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAG1C,IAAK,IAAIG,KAFTN,EAAO5B,OAAOgC,UAAUD,IAGnB9B,EAAekC,KAAKP,EAAMM,KAC7BJ,EAAGI,GAAON,EAAKM,IAIjB,GAAInC,EAAuB,CAC1B8B,EAAU9B,EAAsB6B,GAChC,IAAK,IAAId,EAAI,EAAGA,EAAIe,EAAQI,OAAQnB,IAC/BX,EAAiBgC,KAAKP,EAAMC,EAAQf,MACvCgB,EAAGD,EAAQf,IAAMc,EAAKC,EAAQf,IAGhC,CACD,CAED,OAAOgB,CACR"}
@@ -0,0 +1,2 @@
1
+ import e from"../../_virtual/ReactPropTypesSecret.js";import r from"../../_virtual/has.js";var t=function(){};if("production"!==process.env.NODE_ENV){var a=e,n={},o=r;t=function(e){var r="Warning: "+e;try{throw new Error(r)}catch(e){}}}function s(e,r,s,i,c){if("production"!==process.env.NODE_ENV)for(var f in e)if(o(e,f)){var p;try{if("function"!=typeof e[f]){var u=Error((i||"React class")+": "+s+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}p=e[f](r,f,i,s,null,a)}catch(e){p=e}if(!p||p instanceof Error||t((i||"React class")+": type specification of "+s+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in n)){n[p.message]=!0;var l=c?c():"";t("Failed "+s+" type: "+p.message+(null!=l?l:""))}}}s.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})};var i=s;export{i as __moduleExports,i as default};
2
+ //# sourceMappingURL=checkPropTypes.js.map