@pisell/materials 2.2.13 → 2.2.14

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 (342) hide show
  1. package/build/lowcode/assets-daily.json +13 -13
  2. package/build/lowcode/assets-dev.json +4 -4
  3. package/build/lowcode/assets-prod.json +13 -13
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +29 -27
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +22 -20
  11. package/es/components/button/index.d.ts +4 -3
  12. package/es/components/button/index.js +14 -3
  13. package/es/components/iconfont/index.d.ts +2 -1
  14. package/es/components/iconfont/index.js +1 -1
  15. package/es/components/page/index.css +0 -0
  16. package/es/components/page/index.d.ts +2 -2
  17. package/es/components/page/index.js +226 -186
  18. package/es/components/pisell-config-provider/context.d.ts +20 -0
  19. package/es/components/pisell-config-provider/context.js +36 -0
  20. package/es/components/pisell-config-provider/hooks/usePisellConfig.d.ts +5 -0
  21. package/es/components/pisell-config-provider/hooks/usePisellConfig.js +11 -0
  22. package/es/components/pisell-config-provider/index.d.ts +12 -0
  23. package/es/components/pisell-config-provider/index.js +36 -0
  24. package/es/components/pisellAlert/index.d.ts +22 -0
  25. package/es/components/pisellAlert/index.js +73 -0
  26. package/es/components/pisellAlert/index.less +149 -0
  27. package/es/components/pisellCard/index.d.ts +12 -0
  28. package/es/components/pisellCard/index.js +16 -0
  29. package/es/components/pisellCard/index.less +9 -0
  30. package/es/components/pisellCardList/index.d.ts +43 -0
  31. package/es/components/pisellCardList/index.js +72 -0
  32. package/es/components/pisellCardList/index.less +75 -0
  33. package/es/components/pisellCheckboxGroup/index.d.ts +34 -0
  34. package/es/components/pisellCheckboxGroup/index.js +173 -0
  35. package/es/components/pisellCheckboxGroup/index.less +36 -0
  36. package/es/components/pisellCheckboxGroup/mock.d.ts +4 -0
  37. package/es/components/pisellCheckboxGroup/mock.js +16 -0
  38. package/es/components/pisellContainer/components/Portal/index.d.ts +10 -0
  39. package/es/components/pisellContainer/components/Portal/index.js +7 -0
  40. package/es/components/pisellContainer/containers.d.ts +1 -0
  41. package/es/components/pisellContainer/containers.js +8 -0
  42. package/es/components/pisellContainer/index.d.ts +22 -0
  43. package/es/components/pisellContainer/index.js +19 -0
  44. package/es/components/pisellCountdown/index.d.ts +24 -0
  45. package/es/components/pisellCountdown/index.js +44 -0
  46. package/es/components/pisellCountdown/utils.d.ts +7 -0
  47. package/es/components/pisellCountdown/utils.js +50 -0
  48. package/es/components/pisellDatePicker/datePickerCpt.d.ts +22 -0
  49. package/es/components/pisellDatePicker/datePickerCpt.js +191 -0
  50. package/es/components/pisellDatePicker/detePickerCpt.less +22 -0
  51. package/es/components/pisellDatePicker/index.d.ts +3 -0
  52. package/es/components/pisellDatePicker/index.js +17 -0
  53. package/es/components/pisellEmpty/index.d.ts +16 -0
  54. package/es/components/pisellEmpty/index.js +38 -0
  55. package/es/components/pisellEmpty/index.less +34 -0
  56. package/es/components/pisellInformationEntry/Input/index.d.ts +8 -0
  57. package/es/components/pisellInformationEntry/Input/index.js +50 -0
  58. package/es/components/pisellInformationEntry/Input/index.less +14 -0
  59. package/es/components/pisellInformationEntry/Scan/index.d.ts +8 -0
  60. package/es/components/pisellInformationEntry/Scan/index.js +25 -0
  61. package/es/components/pisellInformationEntry/Scan/index.less +8 -0
  62. package/es/components/pisellInformationEntry/constants.d.ts +3 -0
  63. package/es/components/pisellInformationEntry/constants.js +21 -0
  64. package/es/components/pisellInformationEntry/index.d.ts +31 -0
  65. package/es/components/pisellInformationEntry/index.js +188 -0
  66. package/es/components/pisellInformationEntry/index.less +40 -0
  67. package/es/components/pisellInformationEntry/utils.d.ts +4 -0
  68. package/es/components/pisellInformationEntry/utils.js +38 -0
  69. package/es/components/pisellInput/components/BankCard/cardPng/AMEX.png +0 -0
  70. package/es/components/pisellInput/components/BankCard/cardPng/Discover.png +0 -0
  71. package/es/components/pisellInput/components/BankCard/cardPng/JCB.png +0 -0
  72. package/es/components/pisellInput/components/BankCard/cardPng/MasterCard.png +0 -0
  73. package/es/components/pisellInput/components/BankCard/cardPng/UnionPay.png +0 -0
  74. package/es/components/pisellInput/components/BankCard/cardPng/VISA.png +0 -0
  75. package/es/components/pisellInput/components/BankCard/index.d.ts +11 -0
  76. package/es/components/pisellInput/components/BankCard/index.js +82 -0
  77. package/es/components/pisellInput/components/BankCard/index.less +4 -0
  78. package/es/components/pisellInput/components/BankCard/utils.d.ts +11 -0
  79. package/es/components/pisellInput/components/BankCard/utils.js +65 -0
  80. package/es/components/pisellInput/components/Copy/index.d.ts +11 -0
  81. package/es/components/pisellInput/components/Copy/index.js +53 -0
  82. package/es/components/pisellInput/components/SecurityCode/card.png +0 -0
  83. package/es/components/pisellInput/components/SecurityCode/index.d.ts +12 -0
  84. package/es/components/pisellInput/components/SecurityCode/index.js +46 -0
  85. package/es/components/pisellInput/components/SecurityCode/index.less +4 -0
  86. package/es/components/pisellInput/index.d.ts +13 -0
  87. package/es/components/pisellInput/index.js +15 -0
  88. package/es/components/pisellLoading/index.d.ts +18 -0
  89. package/es/components/pisellLoading/index.js +45 -0
  90. package/es/components/pisellLoading/index.less +35 -0
  91. package/es/components/pisellMessage/index.d.ts +4 -0
  92. package/es/components/pisellMessage/index.js +5 -0
  93. package/es/components/pisellModal/components/Information/index.d.ts +21 -0
  94. package/es/components/pisellModal/components/Information/index.js +25 -0
  95. package/es/components/pisellModal/components/Information/index.less +16 -0
  96. package/es/components/pisellModal/components/IpadModal/index.d.ts +6 -0
  97. package/es/components/pisellModal/components/IpadModal/index.js +6 -0
  98. package/es/components/pisellModal/components/MobileModal/index.d.ts +9 -0
  99. package/es/components/pisellModal/components/MobileModal/index.js +27 -0
  100. package/es/components/pisellModal/components/MobileModal/index.less +60 -0
  101. package/es/components/pisellModal/components/PcModal/index.d.ts +30 -0
  102. package/es/components/pisellModal/components/PcModal/index.js +129 -0
  103. package/es/components/pisellModal/components/PcModal/index.less +105 -0
  104. package/es/components/pisellModal/components/functions/index.d.ts +12 -0
  105. package/es/components/pisellModal/components/functions/index.js +44 -0
  106. package/es/components/pisellModal/components/functions/index.less +25 -0
  107. package/es/components/pisellModal/components/index.d.ts +10 -0
  108. package/es/components/pisellModal/components/index.js +9 -0
  109. package/es/components/pisellModal/constants.d.ts +6 -0
  110. package/es/components/pisellModal/constants.js +6 -0
  111. package/es/components/pisellModal/index.d.ts +43 -0
  112. package/es/components/pisellModal/index.js +30 -0
  113. package/es/components/pisellRow/index.d.ts +22 -0
  114. package/es/components/pisellRow/index.js +67 -0
  115. package/es/components/pisellRow/index.less +13 -0
  116. package/es/components/pisellScan/index.d.ts +21 -0
  117. package/es/components/pisellScan/index.js +80 -0
  118. package/es/components/pisellScan/index.less +12 -0
  119. package/es/components/pisellText/components/Amount/index.d.ts +18 -0
  120. package/es/components/pisellText/components/Amount/index.js +25 -0
  121. package/es/components/pisellText/index.d.ts +8 -0
  122. package/es/components/pisellText/index.js +7 -0
  123. package/es/components/pisellToast/index.d.ts +16 -0
  124. package/es/components/pisellToast/index.js +32 -0
  125. package/es/components/pisellToast/index.less +26 -0
  126. package/es/components/pisellTooltip/index.d.ts +10 -0
  127. package/es/components/pisellTooltip/index.js +15 -0
  128. package/es/components/pisellTooltip/index.less +5 -0
  129. package/es/components/pisellWalletPassCard/bg.jpeg +0 -0
  130. package/es/components/pisellWalletPassCard/index.d.ts +54 -0
  131. package/es/components/pisellWalletPassCard/index.js +93 -0
  132. package/es/components/pisellWalletPassCard/index.less +100 -0
  133. package/es/hooks/useCssVariables.d.ts +8 -0
  134. package/es/hooks/useCssVariables.js +21 -0
  135. package/es/index.d.ts +23 -0
  136. package/es/index.js +26 -1
  137. package/es/locales/en-US.d.ts +9 -0
  138. package/es/locales/en-US.js +13 -1
  139. package/es/locales/index.js +3 -1
  140. package/es/locales/zh-CN.d.ts +9 -0
  141. package/es/locales/zh-CN.js +13 -1
  142. package/es/locales/zh-TW.d.ts +9 -0
  143. package/es/locales/zh-TW.js +13 -1
  144. package/es/utils/index.d.ts +1 -0
  145. package/es/utils/index.js +15 -1
  146. package/es/utils/locale.js +2 -1
  147. package/lib/components/button/index.d.ts +4 -3
  148. package/lib/components/button/index.js +13 -9
  149. package/lib/components/iconfont/index.d.ts +2 -1
  150. package/lib/components/iconfont/index.js +1 -1
  151. package/lib/components/page/index.css +0 -0
  152. package/lib/components/page/index.d.ts +2 -2
  153. package/lib/components/page/index.js +201 -161
  154. package/lib/components/pisell-config-provider/context.d.ts +20 -0
  155. package/lib/components/pisell-config-provider/context.js +49 -0
  156. package/lib/components/pisell-config-provider/hooks/usePisellConfig.d.ts +5 -0
  157. package/lib/components/pisell-config-provider/hooks/usePisellConfig.js +31 -0
  158. package/lib/components/pisell-config-provider/index.d.ts +12 -0
  159. package/lib/components/pisell-config-provider/index.js +69 -0
  160. package/lib/components/pisellAlert/index.d.ts +22 -0
  161. package/lib/components/pisellAlert/index.js +95 -0
  162. package/lib/components/pisellAlert/index.less +149 -0
  163. package/lib/components/pisellCard/index.d.ts +12 -0
  164. package/lib/components/pisellCard/index.js +48 -0
  165. package/lib/components/pisellCard/index.less +9 -0
  166. package/lib/components/pisellCardList/index.d.ts +43 -0
  167. package/lib/components/pisellCardList/index.js +108 -0
  168. package/lib/components/pisellCardList/index.less +75 -0
  169. package/lib/components/pisellCheckboxGroup/index.d.ts +34 -0
  170. package/lib/components/pisellCheckboxGroup/index.js +150 -0
  171. package/lib/components/pisellCheckboxGroup/index.less +36 -0
  172. package/lib/components/pisellCheckboxGroup/mock.d.ts +4 -0
  173. package/lib/components/pisellCheckboxGroup/mock.js +35 -0
  174. package/lib/components/pisellContainer/components/Portal/index.d.ts +10 -0
  175. package/lib/components/pisellContainer/components/Portal/index.js +40 -0
  176. package/lib/components/pisellContainer/containers.d.ts +1 -0
  177. package/lib/components/pisellContainer/containers.js +46 -0
  178. package/lib/components/pisellContainer/index.d.ts +22 -0
  179. package/lib/components/pisellContainer/index.js +49 -0
  180. package/lib/components/pisellCountdown/index.d.ts +24 -0
  181. package/lib/components/pisellCountdown/index.js +63 -0
  182. package/lib/components/pisellCountdown/utils.d.ts +7 -0
  183. package/lib/components/pisellCountdown/utils.js +60 -0
  184. package/lib/components/pisellDatePicker/datePickerCpt.d.ts +22 -0
  185. package/lib/components/pisellDatePicker/datePickerCpt.js +157 -0
  186. package/lib/components/pisellDatePicker/detePickerCpt.less +22 -0
  187. package/lib/components/pisellDatePicker/index.d.ts +3 -0
  188. package/lib/components/pisellDatePicker/index.js +48 -0
  189. package/lib/components/pisellEmpty/index.d.ts +16 -0
  190. package/lib/components/pisellEmpty/index.js +61 -0
  191. package/lib/components/pisellEmpty/index.less +34 -0
  192. package/lib/components/pisellInformationEntry/Input/index.d.ts +8 -0
  193. package/lib/components/pisellInformationEntry/Input/index.js +56 -0
  194. package/lib/components/pisellInformationEntry/Input/index.less +14 -0
  195. package/lib/components/pisellInformationEntry/Scan/index.d.ts +8 -0
  196. package/lib/components/pisellInformationEntry/Scan/index.js +64 -0
  197. package/lib/components/pisellInformationEntry/Scan/index.less +8 -0
  198. package/lib/components/pisellInformationEntry/constants.d.ts +3 -0
  199. package/lib/components/pisellInformationEntry/constants.js +49 -0
  200. package/lib/components/pisellInformationEntry/index.d.ts +31 -0
  201. package/lib/components/pisellInformationEntry/index.js +162 -0
  202. package/lib/components/pisellInformationEntry/index.less +40 -0
  203. package/lib/components/pisellInformationEntry/utils.d.ts +4 -0
  204. package/lib/components/pisellInformationEntry/utils.js +40 -0
  205. package/lib/components/pisellInput/components/BankCard/cardPng/AMEX.png +0 -0
  206. package/lib/components/pisellInput/components/BankCard/cardPng/Discover.png +0 -0
  207. package/lib/components/pisellInput/components/BankCard/cardPng/JCB.png +0 -0
  208. package/lib/components/pisellInput/components/BankCard/cardPng/MasterCard.png +0 -0
  209. package/lib/components/pisellInput/components/BankCard/cardPng/UnionPay.png +0 -0
  210. package/lib/components/pisellInput/components/BankCard/cardPng/VISA.png +0 -0
  211. package/lib/components/pisellInput/components/BankCard/index.d.ts +11 -0
  212. package/lib/components/pisellInput/components/BankCard/index.js +98 -0
  213. package/lib/components/pisellInput/components/BankCard/index.less +4 -0
  214. package/lib/components/pisellInput/components/BankCard/utils.d.ts +11 -0
  215. package/lib/components/pisellInput/components/BankCard/utils.js +103 -0
  216. package/lib/components/pisellInput/components/Copy/index.d.ts +11 -0
  217. package/lib/components/pisellInput/components/Copy/index.js +61 -0
  218. package/lib/components/pisellInput/components/SecurityCode/card.png +0 -0
  219. package/lib/components/pisellInput/components/SecurityCode/index.d.ts +12 -0
  220. package/lib/components/pisellInput/components/SecurityCode/index.js +74 -0
  221. package/lib/components/pisellInput/components/SecurityCode/index.less +4 -0
  222. package/lib/components/pisellInput/index.d.ts +13 -0
  223. package/lib/components/pisellInput/index.js +46 -0
  224. package/lib/components/pisellLoading/index.d.ts +18 -0
  225. package/lib/components/pisellLoading/index.js +69 -0
  226. package/lib/components/pisellLoading/index.less +35 -0
  227. package/lib/components/pisellMessage/index.d.ts +4 -0
  228. package/lib/components/pisellMessage/index.js +34 -0
  229. package/lib/components/pisellModal/components/Information/index.d.ts +21 -0
  230. package/lib/components/pisellModal/components/Information/index.js +54 -0
  231. package/lib/components/pisellModal/components/Information/index.less +16 -0
  232. package/lib/components/pisellModal/components/IpadModal/index.d.ts +6 -0
  233. package/lib/components/pisellModal/components/IpadModal/index.js +40 -0
  234. package/lib/components/pisellModal/components/MobileModal/index.d.ts +9 -0
  235. package/lib/components/pisellModal/components/MobileModal/index.js +67 -0
  236. package/lib/components/pisellModal/components/MobileModal/index.less +60 -0
  237. package/lib/components/pisellModal/components/PcModal/index.d.ts +30 -0
  238. package/lib/components/pisellModal/components/PcModal/index.js +143 -0
  239. package/lib/components/pisellModal/components/PcModal/index.less +105 -0
  240. package/lib/components/pisellModal/components/functions/index.d.ts +12 -0
  241. package/lib/components/pisellModal/components/functions/index.js +90 -0
  242. package/lib/components/pisellModal/components/functions/index.less +25 -0
  243. package/lib/components/pisellModal/components/index.d.ts +10 -0
  244. package/lib/components/pisellModal/components/index.js +52 -0
  245. package/lib/components/pisellModal/constants.d.ts +6 -0
  246. package/lib/components/pisellModal/constants.js +33 -0
  247. package/lib/components/pisellModal/index.d.ts +43 -0
  248. package/lib/components/pisellModal/index.js +63 -0
  249. package/lib/components/pisellRow/index.d.ts +22 -0
  250. package/lib/components/pisellRow/index.js +82 -0
  251. package/lib/components/pisellRow/index.less +13 -0
  252. package/lib/components/pisellScan/index.d.ts +21 -0
  253. package/lib/components/pisellScan/index.js +100 -0
  254. package/lib/components/pisellScan/index.less +12 -0
  255. package/lib/components/pisellText/components/Amount/index.d.ts +18 -0
  256. package/lib/components/pisellText/components/Amount/index.js +64 -0
  257. package/lib/components/pisellText/index.d.ts +8 -0
  258. package/lib/components/pisellText/index.js +41 -0
  259. package/lib/components/pisellToast/index.d.ts +16 -0
  260. package/lib/components/pisellToast/index.js +59 -0
  261. package/lib/components/pisellToast/index.less +26 -0
  262. package/lib/components/pisellTooltip/index.d.ts +10 -0
  263. package/lib/components/pisellTooltip/index.js +53 -0
  264. package/lib/components/pisellTooltip/index.less +5 -0
  265. package/lib/components/pisellWalletPassCard/bg.jpeg +0 -0
  266. package/lib/components/pisellWalletPassCard/index.d.ts +54 -0
  267. package/lib/components/pisellWalletPassCard/index.js +101 -0
  268. package/lib/components/pisellWalletPassCard/index.less +100 -0
  269. package/lib/hooks/useCssVariables.d.ts +8 -0
  270. package/lib/hooks/useCssVariables.js +36 -0
  271. package/lib/index.d.ts +23 -0
  272. package/lib/index.js +71 -0
  273. package/lib/locales/en-US.d.ts +9 -0
  274. package/lib/locales/en-US.js +13 -1
  275. package/lib/locales/index.js +3 -1
  276. package/lib/locales/zh-CN.d.ts +9 -0
  277. package/lib/locales/zh-CN.js +13 -1
  278. package/lib/locales/zh-TW.d.ts +9 -0
  279. package/lib/locales/zh-TW.js +13 -1
  280. package/lib/utils/index.d.ts +1 -0
  281. package/lib/utils/index.js +16 -0
  282. package/lib/utils/locale.js +2 -1
  283. package/lowcode/_utils/transform-meta.ts +31 -10
  284. package/lowcode/button/__screenshots__/pisell-modal-information.png +0 -0
  285. package/lowcode/button/meta.ts +30 -0
  286. package/lowcode/button/snippets.ts +28 -0
  287. package/lowcode/information-modal/meta.ts +1931 -0
  288. package/lowcode/modal/meta.ts +1 -1
  289. package/lowcode/page/meta.ts +8 -1
  290. package/lowcode/pisell-alert/meta.ts +117 -0
  291. package/lowcode/pisell-alert/snippets.ts +50 -0
  292. package/lowcode/pisell-card/__screenshots__/card-1.png +0 -0
  293. package/lowcode/pisell-card/meta.ts +100 -0
  294. package/lowcode/pisell-card/snippets.ts +10 -0
  295. package/lowcode/pisell-card-list/meta.ts +145 -0
  296. package/lowcode/pisell-card-list/snippets.ts +9 -0
  297. package/lowcode/pisell-checkbox-group/meta.ts +112 -0
  298. package/lowcode/pisell-checkbox-group/snippets.ts +13 -0
  299. package/lowcode/pisell-container/meta.ts +71 -0
  300. package/lowcode/pisell-container/snippets.ts +14 -0
  301. package/lowcode/pisell-countdown/meta.ts +71 -0
  302. package/lowcode/pisell-countdown/snippets.ts +12 -0
  303. package/lowcode/pisell-date-picker/meta.ts +76 -0
  304. package/lowcode/pisell-date-picker/snippets.ts +9 -0
  305. package/lowcode/pisell-empty/__screenshots__/empty-1.png +0 -0
  306. package/lowcode/pisell-empty/meta.ts +85 -0
  307. package/lowcode/pisell-empty/snippets.ts +10 -0
  308. package/lowcode/pisell-information-entry/meta.ts +131 -0
  309. package/lowcode/pisell-information-entry/snippets.ts +17 -0
  310. package/lowcode/pisell-input/__screenshots__/input-1.png +0 -0
  311. package/lowcode/pisell-input/meta.ts +193 -0
  312. package/lowcode/pisell-input/snippets.ts +11 -0
  313. package/lowcode/pisell-input.bank-card-input/__screenshots__/pisell-input.bank-card-input.png +0 -0
  314. package/lowcode/pisell-input.bank-card-input/meta.ts +62 -0
  315. package/lowcode/pisell-input.bank-card-input/snippets.ts +11 -0
  316. package/lowcode/pisell-input.copy/meta.ts +73 -0
  317. package/lowcode/pisell-input.copy/snippets.ts +10 -0
  318. package/lowcode/pisell-input.security-code/__screenshots__/pisell-input.security-code.png +0 -0
  319. package/lowcode/pisell-input.security-code/meta.ts +92 -0
  320. package/lowcode/pisell-input.security-code/snippets.ts +11 -0
  321. package/lowcode/pisell-loading/meta.ts +98 -0
  322. package/lowcode/pisell-loading/snippets.ts +11 -0
  323. package/lowcode/pisell-modal/__screenshots__/modal-1.png +0 -0
  324. package/lowcode/pisell-modal/__screenshots__/modal-2.png +0 -0
  325. package/lowcode/pisell-modal/meta.ts +200 -0
  326. package/lowcode/pisell-modal/snippets.ts +38 -0
  327. package/lowcode/pisell-modal.information/__screenshots__/pisell-modal.information.png +0 -0
  328. package/lowcode/pisell-modal.information/meta.ts +116 -0
  329. package/lowcode/pisell-modal.information/snippets.ts +17 -0
  330. package/lowcode/pisell-row/meta.ts +127 -0
  331. package/lowcode/pisell-row/snippets.ts +24 -0
  332. package/lowcode/pisell-scan/meta.ts +53 -0
  333. package/lowcode/pisell-scan/snippets.ts +13 -0
  334. package/lowcode/pisell-text/meta.ts +8117 -0
  335. package/lowcode/pisell-text.amount/meta.ts +61 -0
  336. package/lowcode/pisell-text.amount/snippets.ts +15 -0
  337. package/lowcode/pisell-tooltip/__screenshots__/tooltip-1.jpg +0 -0
  338. package/lowcode/pisell-tooltip/meta.ts +306 -0
  339. package/lowcode/pisell-tooltip/snippets.ts +12 -0
  340. package/lowcode/pisell-wallet-pass-card/meta.ts +189 -0
  341. package/lowcode/pisell-wallet-pass-card/snippets.ts +20 -0
  342. package/package.json +4 -3
@@ -0,0 +1,22 @@
1
+ .pisell-date-picker-type-input {
2
+ display: none;
3
+ }
4
+
5
+ .pisell-date-picker {
6
+ padding: 11px;
7
+ }
8
+
9
+ .pisell-lowcode-picker{
10
+ border-radius: 10px;
11
+ .pisell-lowcode-picker-input>input {
12
+ line-height: 1.5;
13
+ font-size: 16px;
14
+ border: none;
15
+ box-shadow: none!important;
16
+ }
17
+ }
18
+
19
+ .pisell-lowcode-picker .pisell-lowcode-picker-input>input::placeholder {
20
+ color: #D0D5DD !important;
21
+ font-size: 16px !important;
22
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const PisellDatePicker: (props: any) => import("react").JSX.Element;
3
+ export default PisellDatePicker;
@@ -0,0 +1,17 @@
1
+ import DatePickerCpt from "./datePickerCpt";
2
+ import { withMomentProps } from "../../utils/hoc";
3
+ import dayjs from 'dayjs';
4
+ import localeData from 'dayjs/plugin/localeData';
5
+ import weekday from 'dayjs/plugin/weekday';
6
+ dayjs.extend(weekday);
7
+ dayjs.extend(localeData);
8
+ var PisellDatePicker = withMomentProps(DatePickerCpt, ['defaultPickerValue', 'defaultValue', 'showTime.defaultValue', 'value']);
9
+
10
+ // const RangePicker = withMomentProps(OriginalRangePicker, [
11
+ // 'defaultPickerValue',
12
+ // 'defaultValue',
13
+ // 'showTime.defaultValue',
14
+ // 'value',
15
+ // ]);
16
+
17
+ export default PisellDatePicker;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { EmptyProps } from 'antd';
3
+ import { PisellContextType } from "../pisell-config-provider/context";
4
+ import './index.less';
5
+ export interface PisellEmptyProps extends EmptyProps {
6
+ /** 平台 */
7
+ platform?: PisellContextType['platform'];
8
+ /** 额外内容描述 */
9
+ extraDescription?: React.ReactNode;
10
+ /** 额外内容描述 */
11
+ icon?: React.ReactNode;
12
+ /** 自定义底部额外操作区域 */
13
+ footer?: React.ReactNode;
14
+ }
15
+ declare const PisellEmpty: (props: PisellEmptyProps) => React.JSX.Element;
16
+ export default PisellEmpty;
@@ -0,0 +1,38 @@
1
+ var _excluded = ["description", "extraDescription", "icon", "footer", "className"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import React from 'react';
6
+ import { Empty } from 'antd';
7
+ import classNames from 'classnames';
8
+ import Inbox01 from '@pisell/icon/es/Inbox01';
9
+ import { getText } from "../../locales";
10
+ import "./index.less";
11
+ // 额外描述
12
+ var PisellEmpty = function PisellEmpty(props) {
13
+ var _props$description = props.description,
14
+ description = _props$description === void 0 ? getText('pisell-empty-description-no-data') : _props$description,
15
+ extraDescription = props.extraDescription,
16
+ icon = props.icon,
17
+ footer = props.footer,
18
+ className = props.className,
19
+ others = _objectWithoutProperties(props, _excluded);
20
+ return /*#__PURE__*/React.createElement(Empty, _extends({}, others, {
21
+ className: classNames('pisell-empty-wrap', className),
22
+ image: /*#__PURE__*/React.createElement("div", {
23
+ className: "pisell-empty-icon-wrap"
24
+ }, icon || /*#__PURE__*/React.createElement(Inbox01, {
25
+ style: {
26
+ color: '#667085'
27
+ }
28
+ })),
29
+ description: /*#__PURE__*/React.createElement("div", {
30
+ className: "pisell-empty-wrap-description-wrap"
31
+ }, /*#__PURE__*/React.createElement("div", {
32
+ className: "pisell-empty-wrap-description"
33
+ }, description), /*#__PURE__*/React.createElement("div", {
34
+ className: "pisell-empty-wrap-extra-description"
35
+ }, extraDescription))
36
+ }), footer);
37
+ };
38
+ export default PisellEmpty;
@@ -0,0 +1,34 @@
1
+ .pisell-empty-wrap {
2
+ margin: 50px auto;
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: center;
6
+ .pisell-lowcode-empty-image {
7
+ height: auto;
8
+ margin-bottom: 0;
9
+ }
10
+ .pisell-empty-icon-wrap {
11
+ .anticon {
12
+ font-size: 44px !important;
13
+ }
14
+ }
15
+ .pisell-empty-wrap-description-wrap {
16
+ max-width: 300px;
17
+ .pisell-empty-wrap-description {
18
+ color: var(--Gray-500, #667085);
19
+ font-size: 14px;
20
+ font-style: normal;
21
+ font-weight: 600;
22
+ line-height: 20px; /* 142.857% */
23
+ margin: 12px 0;
24
+ }
25
+ .pisell-empty-wrap-extra-description {
26
+ color: var(--Gray-500, #667085);
27
+ text-align: center;
28
+ font-size: 14px;
29
+ font-style: normal;
30
+ font-weight: 400;
31
+ line-height: 20px; /* 142.857% */
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface PisellEntryInputProps {
4
+ onChange: (val: string) => void;
5
+ searchDescribe?: React.ReactNode;
6
+ }
7
+ declare const PisellEntryInput: (props: PisellEntryInputProps) => React.JSX.Element;
8
+ export default PisellEntryInput;
@@ -0,0 +1,50 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useState } from 'react';
8
+ import PisellInput from "../../pisellInput";
9
+ import Button from "../../button";
10
+ import Iconfont from "../../iconfont";
11
+ import "./index.less";
12
+ import { getText } from "../../../locales";
13
+ var PisellEntryInput = function PisellEntryInput(props) {
14
+ var onChange = props.onChange,
15
+ searchDescribe = props.searchDescribe;
16
+ var _useState = useState(''),
17
+ _useState2 = _slicedToArray(_useState, 2),
18
+ value = _useState2[0],
19
+ setValue = _useState2[1];
20
+ return /*#__PURE__*/React.createElement("div", {
21
+ className: "pisell-entry-input-wrap"
22
+ }, /*#__PURE__*/React.createElement("div", {
23
+ className: "pisell-entry-input-line"
24
+ }, /*#__PURE__*/React.createElement(PisellInput, {
25
+ autoFocus: true,
26
+ value: value,
27
+ onChange: function onChange(e) {
28
+ return setValue(e.target.value);
29
+ },
30
+ style: {
31
+ flex: 1
32
+ },
33
+ prefix: /*#__PURE__*/React.createElement(Iconfont, {
34
+ style: {
35
+ color: '#667085'
36
+ },
37
+ type: "pisell2-search-lg"
38
+ }),
39
+ allowClear: true
40
+ }), /*#__PURE__*/React.createElement(Button, {
41
+ size: "large",
42
+ onClick: function onClick() {
43
+ return onChange(value);
44
+ },
45
+ disabled: !value
46
+ }, getText('pisell-information-entry-input-search'))), /*#__PURE__*/React.createElement("div", {
47
+ className: "pisell-entry-input-describe"
48
+ }, searchDescribe));
49
+ };
50
+ export default PisellEntryInput;
@@ -0,0 +1,14 @@
1
+ .pisell-entry-input-wrap {
2
+ .pisell-entry-input-line {
3
+ display: flex;
4
+ gap: 10px;
5
+ }
6
+ .pisell-entry-input-describe {
7
+ color: var(--Gray-600, #475467);
8
+ font-size: 14px;
9
+ font-style: normal;
10
+ font-weight: 400;
11
+ line-height: 20px; /* 142.857% */
12
+ margin-top: 8px;
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface ScanProps {
4
+ onChange: (val: string) => void;
5
+ onCancel: () => void;
6
+ }
7
+ declare const Scan: (props: ScanProps) => React.JSX.Element;
8
+ export default Scan;
@@ -0,0 +1,25 @@
1
+ import React, { useRef } from 'react';
2
+ import PisellScan from "../../pisellScan";
3
+ import "./index.less";
4
+ import { getText } from "../../../locales";
5
+ var Scan = function Scan(props) {
6
+ var onChange = props.onChange,
7
+ onCancel = props.onCancel;
8
+ var scanRef = useRef(null);
9
+ return /*#__PURE__*/React.createElement(PisellScan, {
10
+ width: "100%",
11
+ height: "200px",
12
+ borderRadius: "12px",
13
+ onChange: onChange,
14
+ ref: scanRef
15
+ }, /*#__PURE__*/React.createElement("div", {
16
+ className: "pisell-scan-custom-action"
17
+ }, /*#__PURE__*/React.createElement("span", {
18
+ onClick: function onClick() {
19
+ var _scanRef$current, _scanRef$current$code;
20
+ (_scanRef$current = scanRef.current) === null || _scanRef$current === void 0 ? void 0 : (_scanRef$current$code = _scanRef$current.codeReader) === null || _scanRef$current$code === void 0 ? void 0 : _scanRef$current$code.reset();
21
+ onCancel();
22
+ }
23
+ }, getText('pisell-information-entry-scan-exit'))));
24
+ };
25
+ export default Scan;
@@ -0,0 +1,8 @@
1
+ .pisell-scan-custom-action {
2
+ color: #fff;
3
+ padding: 16px;
4
+ text-align: right;
5
+ font-size: 16px;
6
+ font-weight: 600;
7
+ line-height: 24px; /* 150% */
8
+ }
@@ -0,0 +1,3 @@
1
+ import { EntryModeType } from './index';
2
+ export declare const entryModeTextIcon: Record<EntryModeType['type'], any>;
3
+ export declare const passiveModeType: string[];
@@ -0,0 +1,21 @@
1
+ export var entryModeTextIcon = {
2
+ scanCode: {
3
+ icon: 'pisell2-a-qr-code-02',
4
+ text: 'Scan Bar/QR codes'
5
+ },
6
+ input: {
7
+ icon: 'pisell2-a-keyboard-011',
8
+ text: 'Enter coupon codes'
9
+ },
10
+ scanner: {
11
+ icon: 'pisell2-a-Scanner1',
12
+ text: 'Scanner ready'
13
+ },
14
+ nfc: {
15
+ icon: 'pisell2-a-NFC2',
16
+ text: 'NFC ready'
17
+ }
18
+ };
19
+
20
+ // 没有操作界面的输入模式
21
+ export var passiveModeType = ['scanner', 'nfc'];
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { PisellContextType } from '../pisell-config-provider/context';
3
+ import './index.less';
4
+ export declare type EntryModeType = {
5
+ /**
6
+ * 录入模式名称
7
+ * scanCode: 扫码录入
8
+ * input: 手动录入
9
+ * scanner: 扫码枪录入
10
+ * nfc: NFC录入
11
+ */
12
+ type: 'scanCode' | 'input' | 'scanner' | 'nfc';
13
+ /**
14
+ * 录入模式文案 没有使用默认文案
15
+ */
16
+ name?: string;
17
+ };
18
+ export interface PisellInformationEntryProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onChange'> {
19
+ /** 平台 */
20
+ platform?: PisellContextType['platform'];
21
+ /** 录入模式 */
22
+ entryModes: EntryModeType[];
23
+ /** 标题文案 */
24
+ title?: React.ReactNode;
25
+ /** 搜索框描述文案 */
26
+ searchDescribe?: React.ReactNode;
27
+ /** 录入信息值改变 */
28
+ onChange?: (val: string) => void;
29
+ }
30
+ declare const PisellInformationEntry: (props: PisellInformationEntryProps) => React.JSX.Element;
31
+ export default PisellInformationEntry;
@@ -0,0 +1,188 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["icon", "children"];
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
7
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
8
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
+ import React, { useEffect, useMemo, useState } from 'react';
18
+ import classNames from 'classnames';
19
+ import usePisellConfig from "../pisell-config-provider/hooks/usePisellConfig";
20
+ import PisellCard from "../pisellCard";
21
+ import Iconfont from "../iconfont";
22
+ import { entryModeTextIcon, passiveModeType } from "./constants";
23
+ import Scan from "./Scan";
24
+ import Button from "../button";
25
+ import Input from "./Input";
26
+ import { hasCamera } from "./utils";
27
+ import "./index.less";
28
+ var CardButton = function CardButton(props) {
29
+ var icon = props.icon,
30
+ children = props.children,
31
+ others = _objectWithoutProperties(props, _excluded);
32
+ return /*#__PURE__*/React.createElement(PisellCard, others, /*#__PURE__*/React.createElement("div", null, icon), /*#__PURE__*/React.createElement("div", null, children));
33
+ };
34
+ var PisellInformationEntry = function PisellInformationEntry(props) {
35
+ var propsPlatform = props.platform,
36
+ title = props.title,
37
+ _props$entryModes = props.entryModes,
38
+ entryModes = _props$entryModes === void 0 ? [] : _props$entryModes,
39
+ searchDescribe = props.searchDescribe,
40
+ onChange = props.onChange;
41
+ var config = usePisellConfig();
42
+ var platform = config.platform;
43
+ var _useState = useState(null),
44
+ _useState2 = _slicedToArray(_useState, 2),
45
+ currentType = _useState2[0],
46
+ setCurrentType = _useState2[1];
47
+
48
+ // 可用录入模式
49
+ var _useState3 = useState(entryModes),
50
+ _useState4 = _slicedToArray(_useState3, 2),
51
+ availableEntryModes = _useState4[0],
52
+ setAvailableEntryModes = _useState4[1];
53
+ useEffect(function () {
54
+ document.body.id = 'body';
55
+ }, []);
56
+ useEffect(function () {
57
+ var getEntryModes = /*#__PURE__*/function () {
58
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
59
+ var available;
60
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
61
+ while (1) switch (_context.prev = _context.next) {
62
+ case 0:
63
+ available = entryModes;
64
+ _context.next = 3;
65
+ return hasCamera();
66
+ case 3:
67
+ if (_context.sent) {
68
+ _context.next = 5;
69
+ break;
70
+ }
71
+ available = entryModes.filter(function (item) {
72
+ return item.type !== 'scanCode';
73
+ });
74
+ case 5:
75
+ if (available.length === 1) {
76
+ setCurrentType(available[0].type);
77
+ }
78
+ setAvailableEntryModes(available);
79
+ case 7:
80
+ case "end":
81
+ return _context.stop();
82
+ }
83
+ }, _callee);
84
+ }));
85
+ return function getEntryModes() {
86
+ return _ref.apply(this, arguments);
87
+ };
88
+ }();
89
+ getEntryModes();
90
+ }, [entryModes]);
91
+ var handleChange = function handleChange(val) {
92
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
93
+ };
94
+ var handleEntryClick = function handleEntryClick(type) {
95
+ if (passiveModeType.includes(type)) {
96
+ return;
97
+ }
98
+ setCurrentType(type);
99
+ };
100
+ var _useMemo = useMemo(function () {
101
+ var isHasScanCode = false;
102
+ var isHasInput = false;
103
+ var isHasScanner = false;
104
+ var isHasNfc = false;
105
+ availableEntryModes.forEach(function (item) {
106
+ if (item.type === 'scanCode') {
107
+ isHasScanCode = true;
108
+ }
109
+ if (item.type === 'input') {
110
+ isHasInput = true;
111
+ }
112
+ if (item.type === 'scanner') {
113
+ isHasScanner = true;
114
+ }
115
+ if (item.type === 'nfc') {
116
+ isHasNfc = true;
117
+ }
118
+ });
119
+ return {
120
+ isHasScanCode: isHasScanCode,
121
+ isHasInput: isHasInput,
122
+ isHasScanner: isHasScanner,
123
+ isHasNfc: isHasNfc
124
+ };
125
+ }, [availableEntryModes]),
126
+ isHasInput = _useMemo.isHasInput,
127
+ isHasNfc = _useMemo.isHasNfc,
128
+ isHasScanner = _useMemo.isHasScanner,
129
+ isHasScanCode = _useMemo.isHasScanCode;
130
+ var isShowEntryModes = useMemo(function () {
131
+ if (!currentType) {
132
+ return true;
133
+ }
134
+ if (availableEntryModes.length === 1 && passiveModeType.includes(availableEntryModes[0].type)) {
135
+ return true;
136
+ }
137
+ return false;
138
+ }, [currentType, availableEntryModes]);
139
+ return /*#__PURE__*/React.createElement("div", {
140
+ className: "pisell-information-entry-wrap"
141
+ }, /*#__PURE__*/React.createElement("div", {
142
+ className: "pisell-information-entry-title"
143
+ }, /*#__PURE__*/React.createElement("span", null, title), currentType && isHasScanCode && isHasInput && /*#__PURE__*/React.createElement("div", {
144
+ className: "pisell-information-entry-title-action-wrap"
145
+ }, isHasScanCode && /*#__PURE__*/React.createElement(Button, {
146
+ size: "large",
147
+ type: currentType === 'scanCode' ? 'primary' : 'default',
148
+ icon: /*#__PURE__*/React.createElement(Iconfont, {
149
+ type: entryModeTextIcon['scanCode'].icon
150
+ }),
151
+ onClick: function onClick() {
152
+ return handleEntryClick('scanCode');
153
+ }
154
+ }), isHasInput && /*#__PURE__*/React.createElement(Button, {
155
+ size: "large",
156
+ type: currentType === 'input' ? 'primary' : 'default',
157
+ icon: /*#__PURE__*/React.createElement(Iconfont, {
158
+ type: entryModeTextIcon['input'].icon
159
+ }),
160
+ onClick: function onClick() {
161
+ return handleEntryClick('input');
162
+ }
163
+ }))), isShowEntryModes && /*#__PURE__*/React.createElement("div", {
164
+ className: "pisell-information-entry-modes"
165
+ }, availableEntryModes.map(function (item) {
166
+ var detail = entryModeTextIcon[item.type];
167
+ return /*#__PURE__*/React.createElement(CardButton, {
168
+ bordered: !passiveModeType.includes(item.type),
169
+ icon: /*#__PURE__*/React.createElement(Iconfont, {
170
+ type: detail.icon,
171
+ className: "pisell-card-button-icon"
172
+ }),
173
+ className: classNames('pisell-information-entry-item', _defineProperty({}, 'pisell-entry-ready', passiveModeType.includes(item.type))),
174
+ onClick: function onClick() {
175
+ return handleEntryClick(item.type);
176
+ }
177
+ }, item.name || detail.text);
178
+ })), /*#__PURE__*/React.createElement("div", null, currentType === 'scanCode' && /*#__PURE__*/React.createElement(Scan, {
179
+ onChange: handleChange,
180
+ onCancel: function onCancel() {
181
+ return setCurrentType(null);
182
+ }
183
+ }), currentType === 'input' && /*#__PURE__*/React.createElement(Input, {
184
+ onChange: handleChange,
185
+ searchDescribe: searchDescribe
186
+ })));
187
+ };
188
+ export default PisellInformationEntry;
@@ -0,0 +1,40 @@
1
+ .pisell-information-entry-wrap {
2
+ .pisell-information-entry-title {
3
+ color: var(--Gray-900, #101828);
4
+ font-size: 18px;
5
+ font-style: normal;
6
+ font-weight: 600;
7
+ line-height: 28px; /* 155.556% */
8
+ margin-bottom: 10px;
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ gap: 20px;
13
+ .pisell-information-entry-title-action-wrap {
14
+ display: flex;
15
+ gap: 10px;
16
+ }
17
+ }
18
+ .pisell-information-entry-modes {
19
+ display: flex;
20
+ gap: 10px;
21
+ flex-wrap: wrap;
22
+ .pisell-information-entry-item {
23
+ flex: 1;
24
+ text-align: center;
25
+ cursor: pointer;
26
+ min-width: 165px;
27
+ .pisell-card-button-icon {
28
+ height: 48px;
29
+ font-size: 36px;
30
+ }
31
+ }
32
+ .pisell-entry-ready {
33
+ background: var(--Gray-50, #f9fafb);
34
+ cursor: inherit;
35
+ .pisell-card-button-icon {
36
+ font-size: 60px;
37
+ }
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 判断设备是否包含摄像头
3
+ */
4
+ export declare const hasCamera: () => Promise<boolean>;