iglooform 3.2.7 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (402) hide show
  1. package/.dumi/tmp/core/defineApp.ts +1 -1
  2. package/.dumi/tmp/core/helmet.ts +1 -1
  3. package/.dumi/tmp/core/history.ts +1 -1
  4. package/.dumi/tmp/core/historyIntelli.ts +1 -1
  5. package/.dumi/tmp/core/plugin.ts +2 -2
  6. package/.dumi/tmp/core/polyfill.ts +197 -197
  7. package/.dumi/tmp/core/route.tsx +33 -33
  8. package/.dumi/tmp/dumi/exports.ts +1 -1
  9. package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
  10. package/.dumi/tmp/dumi/meta/index.ts +33 -33
  11. package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
  12. package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
  13. package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
  14. package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
  15. package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
  16. package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
  17. package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
  18. package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
  19. package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
  20. package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
  21. package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
  22. package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
  23. package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
  24. package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
  25. package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
  26. package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
  27. package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
  28. package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
  29. package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
  30. package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
  31. package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
  32. package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
  33. package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
  34. package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
  35. package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
  36. package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
  37. package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
  38. package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
  39. package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
  40. package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
  41. package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
  42. package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
  43. package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
  44. package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
  45. package/.dumi/tmp/exports.ts +5 -5
  46. package/.dumi/tmp/testBrowser.tsx +3 -3
  47. package/.dumi/tmp/umi.ts +4 -4
  48. package/.dumirc.ts +1 -1
  49. package/es/form/index.js +3 -1
  50. package/es/form/step-items-selection/components/checkbox-group-items/index.js +110 -0
  51. package/es/form/step-items-selection/components/checkbox-group-items/style/index.js +1 -0
  52. package/es/form/step-items-selection/components/checkbox-group-items/style/index.less +9 -0
  53. package/es/form/step-items-selection/components/index.js +2 -0
  54. package/es/form/step-items-selection/components/item-info/index.js +62 -0
  55. package/es/form/step-items-selection/components/item-info/style/index.js +1 -0
  56. package/es/form/step-items-selection/components/item-info/style/index.less +31 -0
  57. package/es/form/step-items-selection/components/section-of-item-condition/hooks/index.js +1 -0
  58. package/es/form/step-items-selection/components/section-of-item-condition/hooks/useElements.d.ts +5 -0
  59. package/es/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js +73 -0
  60. package/es/form/step-items-selection/components/section-of-item-condition/index.js +89 -0
  61. package/es/form/step-items-selection/components/section-of-item-condition/style/index.js +1 -0
  62. package/es/form/step-items-selection/components/section-of-item-condition/style/index.less +17 -0
  63. package/es/form/step-items-selection/config.js +5 -0
  64. package/es/form/step-items-selection/index.js +227 -0
  65. package/es/form/step-items-selection/types.js +1 -0
  66. package/es/form/steps/index.js +86 -24
  67. package/es/input/input-number/basic.js +34 -0
  68. package/es/input/{input-number.js → input-number/index.js} +67 -31
  69. package/es/input/input-number/stepper/index.js +69 -0
  70. package/es/input/input-number/stepper/index.less +99 -0
  71. package/es/input/style/common.less +1 -0
  72. package/es/locale/en-US/messages.json +9 -3
  73. package/es/locale/id-ID/messages.json +9 -3
  74. package/es/locale/th-TH/messages.json +9 -3
  75. package/es/locale/vi-VN/messages.json +9 -3
  76. package/es/locale/zh-CN/messages.json +9 -3
  77. package/es/locale/zh-TW/messages.json +9 -3
  78. package/lib/form/index.js +3 -1
  79. package/lib/form/step-items-selection/components/checkbox-group-items/index.js +117 -0
  80. package/lib/form/step-items-selection/components/checkbox-group-items/style/index.js +3 -0
  81. package/lib/form/step-items-selection/components/checkbox-group-items/style/index.less +9 -0
  82. package/lib/form/step-items-selection/components/index.js +19 -0
  83. package/lib/form/step-items-selection/components/item-info/index.js +69 -0
  84. package/lib/form/step-items-selection/components/item-info/style/index.js +3 -0
  85. package/lib/form/step-items-selection/components/item-info/style/index.less +31 -0
  86. package/lib/form/step-items-selection/components/section-of-item-condition/hooks/index.js +16 -0
  87. package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useElements.d.ts +5 -0
  88. package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js +80 -0
  89. package/lib/form/step-items-selection/components/section-of-item-condition/index.js +96 -0
  90. package/lib/form/step-items-selection/components/section-of-item-condition/style/index.js +3 -0
  91. package/lib/form/step-items-selection/components/section-of-item-condition/style/index.less +17 -0
  92. package/lib/form/step-items-selection/config.js +16 -0
  93. package/lib/form/step-items-selection/index.js +234 -0
  94. package/lib/form/step-items-selection/types.js +5 -0
  95. package/lib/form/steps/index.js +84 -23
  96. package/lib/input/input-number/basic.js +42 -0
  97. package/lib/input/{input-number.js → input-number/index.js} +68 -32
  98. package/lib/input/input-number/stepper/index.js +75 -0
  99. package/lib/input/input-number/stepper/index.less +99 -0
  100. package/lib/input/style/common.less +1 -0
  101. package/lib/locale/en-US/messages.json +9 -3
  102. package/lib/locale/id-ID/messages.json +9 -3
  103. package/lib/locale/th-TH/messages.json +9 -3
  104. package/lib/locale/vi-VN/messages.json +9 -3
  105. package/lib/locale/zh-CN/messages.json +9 -3
  106. package/lib/locale/zh-TW/messages.json +9 -3
  107. package/package.json +1 -2
  108. package/.idea/codeStyles/Project.xml +0 -59
  109. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  110. package/.idea/iglooform.iml +0 -12
  111. package/.idea/modules.xml +0 -8
  112. package/.idea/prettier.xml +0 -6
  113. package/.idea/vcs.xml +0 -6
  114. package/es/admin-amount/style/index.d.ts +0 -0
  115. package/es/admin-upload/index.d.ts +0 -37
  116. package/es/admin-upload/style/index.d.ts +0 -1
  117. package/es/alert-message/style/index.d.ts +0 -1
  118. package/es/app/context.d.ts +0 -9
  119. package/es/app/index.d.ts +0 -8
  120. package/es/babel-plugin-import-option.d.ts +0 -7
  121. package/es/back-top/index.d.ts +0 -5
  122. package/es/back-top/style/index.d.ts +0 -1
  123. package/es/button/style/index.d.ts +0 -1
  124. package/es/card-detail/card-page.d.ts +0 -12
  125. package/es/card-detail/card.d.ts +0 -10
  126. package/es/card-detail/style/index.d.ts +0 -1
  127. package/es/checkbox/style/index.d.ts +0 -1
  128. package/es/claim-list/style/index.d.ts +0 -1
  129. package/es/config-provider.d.ts +0 -9
  130. package/es/confirmation/index.d.ts +0 -16
  131. package/es/confirmation/style/index.d.ts +0 -1
  132. package/es/currency-context/index.d.ts +0 -8
  133. package/es/currency-context/style/index.d.ts +0 -0
  134. package/es/date-picker/buddhist.d.ts +0 -6
  135. package/es/date-picker/index.d.ts +0 -13
  136. package/es/date-picker/style/index.d.ts +0 -1
  137. package/es/declaration/style/index.d.ts +0 -1
  138. package/es/detail-panel/style/index.d.ts +0 -1
  139. package/es/documents/index.d.ts +0 -15
  140. package/es/documents/style/index.d.ts +0 -1
  141. package/es/filter/index.d.ts +0 -52
  142. package/es/filter/style/index.d.ts +0 -1
  143. package/es/form/addable-section/index.d.ts +0 -20
  144. package/es/form/addable-section/style/index.d.ts +0 -1
  145. package/es/form/divider/style/index.d.ts +0 -1
  146. package/es/form/element/index.d.ts +0 -12
  147. package/es/form/element/style/index.d.ts +0 -1
  148. package/es/form/elements.d.ts +0 -8
  149. package/es/form/hstep/style/index.d.ts +0 -1
  150. package/es/form/hsteps/index.d.ts +0 -21
  151. package/es/form/hsteps/style/index.d.ts +0 -1
  152. package/es/form/index.d.ts +0 -4
  153. package/es/form/login/style/index.d.ts +0 -1
  154. package/es/form/messages.d.ts +0 -48
  155. package/es/form/page/style/index.d.ts +0 -1
  156. package/es/form/pages/style/index.d.ts +0 -1
  157. package/es/form/render/style/index.d.ts +0 -1
  158. package/es/form/section/index.d.ts +0 -16
  159. package/es/form/section/style/index.d.ts +0 -1
  160. package/es/form/step/style/index.d.ts +0 -1
  161. package/es/form/steps/index.d.ts +0 -10
  162. package/es/form/steps/style/index.d.ts +0 -1
  163. package/es/form/style/index.d.ts +0 -1
  164. package/es/form-context.d.ts +0 -28
  165. package/es/free-form/addable-section/index.d.ts +0 -19
  166. package/es/free-form/addable-section/style/index.d.ts +0 -1
  167. package/es/free-form/element/index.d.ts +0 -11
  168. package/es/free-form/element/style/index.d.ts +0 -1
  169. package/es/free-form/index.d.ts +0 -11
  170. package/es/free-form/messages.d.ts +0 -48
  171. package/es/free-form/page/style/index.d.ts +0 -1
  172. package/es/free-form/pages/style/index.d.ts +0 -1
  173. package/es/free-form/section/index.d.ts +0 -13
  174. package/es/free-form/section/style/index.d.ts +0 -1
  175. package/es/free-form/step/index.d.ts +0 -21
  176. package/es/free-form/step/style/index.d.ts +0 -1
  177. package/es/free-form/steps/index.d.ts +0 -12
  178. package/es/free-form/steps/style/index.d.ts +0 -1
  179. package/es/free-form/style/index.d.ts +0 -1
  180. package/es/home-menu/style/index.d.ts +0 -1
  181. package/es/hooks/ocr/index.d.ts +0 -3
  182. package/es/hooks/ocr/micro-blink.d.ts +0 -10
  183. package/es/index.d.ts +0 -49
  184. package/es/input/amount.d.ts +0 -14
  185. package/es/input/expiry-date.d.ts +0 -16
  186. package/es/input/input-date.d.ts +0 -8
  187. package/es/input/input-number.d.ts +0 -6
  188. package/es/input/phone-number.d.ts +0 -14
  189. package/es/input/style/amount/index.d.ts +0 -2
  190. package/es/input/style/index.d.ts +0 -2
  191. package/es/input/style/input-date/index.d.ts +0 -2
  192. package/es/input/style/otp/index.d.ts +0 -2
  193. package/es/input/style/phone-number/index.d.ts +0 -2
  194. package/es/input/style/text-area/index.d.ts +0 -2
  195. package/es/layout/defaultFooter.d.ts +0 -4
  196. package/es/layout/defaultHeader.d.ts +0 -4
  197. package/es/layout/style/index.d.ts +0 -1
  198. package/es/locale/en-US.d.ts +0 -2
  199. package/es/locale/format-message.d.ts +0 -10
  200. package/es/locale/formatted-message.d.ts +0 -6
  201. package/es/locale/id-ID.d.ts +0 -2
  202. package/es/locale/index.d.ts +0 -4
  203. package/es/locale/locale-context.d.ts +0 -12
  204. package/es/locale/locale-provider.d.ts +0 -13
  205. package/es/locale/ms-MY.d.ts +0 -2
  206. package/es/locale/th-TH.d.ts +0 -2
  207. package/es/locale/vi-VN.d.ts +0 -2
  208. package/es/locale/zh-CN.d.ts +0 -2
  209. package/es/locale/zh-TW.d.ts +0 -2
  210. package/es/login-page/index.d.ts +0 -7
  211. package/es/login-page/style/index.d.ts +0 -1
  212. package/es/media/file-icon.d.ts +0 -9
  213. package/es/media/index.d.ts +0 -29
  214. package/es/media/media.d.ts +0 -11
  215. package/es/media/preview.d.ts +0 -12
  216. package/es/media/style/index.d.ts +0 -1
  217. package/es/message/index.d.ts +0 -14
  218. package/es/message/style/index.d.ts +0 -1
  219. package/es/message/useMessage.d.ts +0 -6
  220. package/es/mobile-insurer-detail/style/index.d.ts +0 -1
  221. package/es/mobile-insurer-list/style/index.d.ts +0 -1
  222. package/es/modal/index.d.ts +0 -33
  223. package/es/modal/style/index.d.ts +0 -1
  224. package/es/modal/useModal.d.ts +0 -12
  225. package/es/ocr/index.d.ts +0 -15
  226. package/es/ocr/micro-blink/index.d.ts +0 -8
  227. package/es/ocr/micro-blink/style/index.d.ts +0 -1
  228. package/es/platform/index.d.ts +0 -2
  229. package/es/platform/platform-card/index.d.ts +0 -12
  230. package/es/platform/platform-card/style/index.d.ts +0 -1
  231. package/es/platform/switch-platform/index.d.ts +0 -12
  232. package/es/platform/switch-platform/style/index.d.ts +0 -1
  233. package/es/policy-list/style/index.d.ts +0 -1
  234. package/es/radio/index.d.ts +0 -24
  235. package/es/radio/radio-group-with-other.d.ts +0 -7
  236. package/es/radio/style/index.d.ts +0 -1
  237. package/es/search-box/style/index.d.ts +0 -1
  238. package/es/select/style/index.d.ts +0 -1
  239. package/es/status-box/style/index.d.ts +0 -1
  240. package/es/table/style/index.d.ts +0 -1
  241. package/es/tabs/index.d.ts +0 -15
  242. package/es/tabs/style/index.d.ts +0 -1
  243. package/es/types.d.ts +0 -187
  244. package/es/typography/style/index.d.ts +0 -1
  245. package/es/upload/index.d.ts +0 -16
  246. package/es/upload/style/index.d.ts +0 -1
  247. package/es/upload-photo/index.d.ts +0 -28
  248. package/es/upload-photo/media.d.ts +0 -7
  249. package/es/upload-photo/style/index.d.ts +0 -1
  250. package/es/upload-preview/index.d.ts +0 -9
  251. package/es/upload-preview/media.d.ts +0 -7
  252. package/es/upload-preview/style/index.d.ts +0 -1
  253. package/es/utils/agent-detect.d.ts +0 -1
  254. package/es/utils/form-utils.d.ts +0 -79
  255. package/es/utils/option-utils.d.ts +0 -29
  256. package/es/utils/tools.d.ts +0 -5
  257. package/es/utils/useAsyncEffect.d.ts +0 -3
  258. package/lib/admin-amount/style/index.d.ts +0 -0
  259. package/lib/admin-upload/index.d.ts +0 -37
  260. package/lib/admin-upload/style/index.d.ts +0 -1
  261. package/lib/alert-message/style/index.d.ts +0 -1
  262. package/lib/app/context.d.ts +0 -9
  263. package/lib/app/index.d.ts +0 -8
  264. package/lib/babel-plugin-import-option.d.ts +0 -7
  265. package/lib/back-top/index.d.ts +0 -5
  266. package/lib/back-top/style/index.d.ts +0 -1
  267. package/lib/button/style/index.d.ts +0 -1
  268. package/lib/card-detail/card-page.d.ts +0 -12
  269. package/lib/card-detail/card.d.ts +0 -10
  270. package/lib/card-detail/style/index.d.ts +0 -1
  271. package/lib/checkbox/style/index.d.ts +0 -1
  272. package/lib/claim-list/style/index.d.ts +0 -1
  273. package/lib/config-provider.d.ts +0 -9
  274. package/lib/confirmation/index.d.ts +0 -16
  275. package/lib/confirmation/style/index.d.ts +0 -1
  276. package/lib/currency-context/index.d.ts +0 -8
  277. package/lib/currency-context/style/index.d.ts +0 -0
  278. package/lib/date-picker/buddhist.d.ts +0 -6
  279. package/lib/date-picker/index.d.ts +0 -13
  280. package/lib/date-picker/style/index.d.ts +0 -1
  281. package/lib/declaration/style/index.d.ts +0 -1
  282. package/lib/detail-panel/style/index.d.ts +0 -1
  283. package/lib/documents/index.d.ts +0 -15
  284. package/lib/documents/style/index.d.ts +0 -1
  285. package/lib/filter/index.d.ts +0 -52
  286. package/lib/filter/style/index.d.ts +0 -1
  287. package/lib/form/addable-section/index.d.ts +0 -20
  288. package/lib/form/addable-section/style/index.d.ts +0 -1
  289. package/lib/form/divider/style/index.d.ts +0 -1
  290. package/lib/form/element/index.d.ts +0 -12
  291. package/lib/form/element/style/index.d.ts +0 -1
  292. package/lib/form/elements.d.ts +0 -8
  293. package/lib/form/hstep/style/index.d.ts +0 -1
  294. package/lib/form/hsteps/index.d.ts +0 -21
  295. package/lib/form/hsteps/style/index.d.ts +0 -1
  296. package/lib/form/index.d.ts +0 -4
  297. package/lib/form/login/style/index.d.ts +0 -1
  298. package/lib/form/messages.d.ts +0 -48
  299. package/lib/form/page/style/index.d.ts +0 -1
  300. package/lib/form/pages/style/index.d.ts +0 -1
  301. package/lib/form/render/style/index.d.ts +0 -1
  302. package/lib/form/section/index.d.ts +0 -16
  303. package/lib/form/section/style/index.d.ts +0 -1
  304. package/lib/form/step/style/index.d.ts +0 -1
  305. package/lib/form/steps/index.d.ts +0 -10
  306. package/lib/form/steps/style/index.d.ts +0 -1
  307. package/lib/form/style/index.d.ts +0 -1
  308. package/lib/form-context.d.ts +0 -28
  309. package/lib/free-form/addable-section/index.d.ts +0 -19
  310. package/lib/free-form/addable-section/style/index.d.ts +0 -1
  311. package/lib/free-form/element/index.d.ts +0 -11
  312. package/lib/free-form/element/style/index.d.ts +0 -1
  313. package/lib/free-form/index.d.ts +0 -11
  314. package/lib/free-form/messages.d.ts +0 -48
  315. package/lib/free-form/page/style/index.d.ts +0 -1
  316. package/lib/free-form/pages/style/index.d.ts +0 -1
  317. package/lib/free-form/section/index.d.ts +0 -13
  318. package/lib/free-form/section/style/index.d.ts +0 -1
  319. package/lib/free-form/step/index.d.ts +0 -21
  320. package/lib/free-form/step/style/index.d.ts +0 -1
  321. package/lib/free-form/steps/index.d.ts +0 -12
  322. package/lib/free-form/steps/style/index.d.ts +0 -1
  323. package/lib/free-form/style/index.d.ts +0 -1
  324. package/lib/home-menu/style/index.d.ts +0 -1
  325. package/lib/hooks/ocr/index.d.ts +0 -3
  326. package/lib/hooks/ocr/micro-blink.d.ts +0 -10
  327. package/lib/index.d.ts +0 -49
  328. package/lib/input/amount.d.ts +0 -14
  329. package/lib/input/expiry-date.d.ts +0 -16
  330. package/lib/input/input-date.d.ts +0 -8
  331. package/lib/input/input-number.d.ts +0 -6
  332. package/lib/input/phone-number.d.ts +0 -14
  333. package/lib/input/style/amount/index.d.ts +0 -2
  334. package/lib/input/style/index.d.ts +0 -2
  335. package/lib/input/style/input-date/index.d.ts +0 -2
  336. package/lib/input/style/otp/index.d.ts +0 -2
  337. package/lib/input/style/phone-number/index.d.ts +0 -2
  338. package/lib/input/style/text-area/index.d.ts +0 -2
  339. package/lib/layout/defaultFooter.d.ts +0 -4
  340. package/lib/layout/defaultHeader.d.ts +0 -4
  341. package/lib/layout/style/index.d.ts +0 -1
  342. package/lib/locale/en-US.d.ts +0 -2
  343. package/lib/locale/format-message.d.ts +0 -10
  344. package/lib/locale/formatted-message.d.ts +0 -6
  345. package/lib/locale/id-ID.d.ts +0 -2
  346. package/lib/locale/index.d.ts +0 -4
  347. package/lib/locale/locale-context.d.ts +0 -12
  348. package/lib/locale/locale-provider.d.ts +0 -13
  349. package/lib/locale/ms-MY.d.ts +0 -2
  350. package/lib/locale/th-TH.d.ts +0 -2
  351. package/lib/locale/vi-VN.d.ts +0 -2
  352. package/lib/locale/zh-CN.d.ts +0 -2
  353. package/lib/locale/zh-TW.d.ts +0 -2
  354. package/lib/login-page/index.d.ts +0 -7
  355. package/lib/login-page/style/index.d.ts +0 -1
  356. package/lib/media/file-icon.d.ts +0 -9
  357. package/lib/media/index.d.ts +0 -29
  358. package/lib/media/media.d.ts +0 -11
  359. package/lib/media/preview.d.ts +0 -12
  360. package/lib/media/style/index.d.ts +0 -1
  361. package/lib/message/index.d.ts +0 -14
  362. package/lib/message/style/index.d.ts +0 -1
  363. package/lib/message/useMessage.d.ts +0 -6
  364. package/lib/mobile-insurer-detail/style/index.d.ts +0 -1
  365. package/lib/mobile-insurer-list/style/index.d.ts +0 -1
  366. package/lib/modal/index.d.ts +0 -33
  367. package/lib/modal/style/index.d.ts +0 -1
  368. package/lib/modal/useModal.d.ts +0 -12
  369. package/lib/ocr/index.d.ts +0 -15
  370. package/lib/ocr/micro-blink/index.d.ts +0 -8
  371. package/lib/ocr/micro-blink/style/index.d.ts +0 -1
  372. package/lib/platform/index.d.ts +0 -2
  373. package/lib/platform/platform-card/index.d.ts +0 -12
  374. package/lib/platform/platform-card/style/index.d.ts +0 -1
  375. package/lib/platform/switch-platform/index.d.ts +0 -12
  376. package/lib/platform/switch-platform/style/index.d.ts +0 -1
  377. package/lib/policy-list/style/index.d.ts +0 -1
  378. package/lib/radio/index.d.ts +0 -24
  379. package/lib/radio/radio-group-with-other.d.ts +0 -7
  380. package/lib/radio/style/index.d.ts +0 -1
  381. package/lib/search-box/style/index.d.ts +0 -1
  382. package/lib/select/style/index.d.ts +0 -1
  383. package/lib/status-box/style/index.d.ts +0 -1
  384. package/lib/table/style/index.d.ts +0 -1
  385. package/lib/tabs/index.d.ts +0 -15
  386. package/lib/tabs/style/index.d.ts +0 -1
  387. package/lib/types.d.ts +0 -187
  388. package/lib/typography/style/index.d.ts +0 -1
  389. package/lib/upload/index.d.ts +0 -16
  390. package/lib/upload/style/index.d.ts +0 -1
  391. package/lib/upload-photo/index.d.ts +0 -28
  392. package/lib/upload-photo/media.d.ts +0 -7
  393. package/lib/upload-photo/style/index.d.ts +0 -1
  394. package/lib/upload-preview/index.d.ts +0 -9
  395. package/lib/upload-preview/media.d.ts +0 -7
  396. package/lib/upload-preview/style/index.d.ts +0 -1
  397. package/lib/utils/agent-detect.d.ts +0 -1
  398. package/lib/utils/form-utils.d.ts +0 -79
  399. package/lib/utils/option-utils.d.ts +0 -29
  400. package/lib/utils/tools.d.ts +0 -5
  401. package/lib/utils/useAsyncEffect.d.ts +0 -3
  402. package/yarn-error.log +0 -16168
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = require("react");
9
+ var _step = _interopRequireDefault(require("../step"));
10
+ var _formUtils = require("../../utils/form-utils");
11
+ var _formContext = _interopRequireDefault(require("../../form-context"));
12
+ var _locale = require("../../locale");
13
+ var _components = require("./components");
14
+ var _config = require("./config");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ var _excluded = ["name", "itemsData", "itemsDataConfig", "elements"];
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
20
+ 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; }
21
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
+ 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); }
23
+ 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; }
24
+ 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); } }
25
+ 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); }); }; }
26
+ 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; }
27
+ 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; }
28
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
+ 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."); }
30
+ 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); }
31
+ 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; }
32
+ 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; } }
33
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
34
+ var STEP_COUNT = 2;
35
+ var StepItemsSelection = function StepItemsSelection(props) {
36
+ var _form$getFieldValue;
37
+ var _useState = (0, _react.useState)(0),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ current = _useState2[0],
40
+ setCurrent = _useState2[1];
41
+ var _useState3 = (0, _react.useState)(false),
42
+ _useState4 = _slicedToArray(_useState3, 2),
43
+ shouldScrollState = _useState4[0],
44
+ setShouldScrollState = _useState4[1];
45
+ var _useContext = (0, _react.useContext)(_formContext.default),
46
+ form = _useContext.form;
47
+ var _useContext2 = (0, _react.useContext)(_locale.LocaleContext),
48
+ formatMessage = _useContext2.formatMessage;
49
+ var refs = (0, _react.useRef)([]);
50
+ var parentName = props.parentName,
51
+ config = props.config,
52
+ indexProp = props.index,
53
+ total = props.total,
54
+ preview = props.preview,
55
+ edit = props.edit,
56
+ handleNextProp = props.handleNext,
57
+ handleEditProp = props.handleEdit,
58
+ showLastIndex = props.showLastIndex,
59
+ shouldScrollProp = props.shouldScroll,
60
+ _props$currentStep = props.currentStep,
61
+ currentStep = _props$currentStep === void 0 ? 0 : _props$currentStep;
62
+ var nameProp = config.name,
63
+ _config$itemsData = config.itemsData,
64
+ itemsData = _config$itemsData === void 0 ? [] : _config$itemsData,
65
+ itemsDataConfig = config.itemsDataConfig,
66
+ elements = config.elements,
67
+ restConfig = _objectWithoutProperties(config, _excluded);
68
+ (0, _react.useEffect)(function () {
69
+ if (currentStep === undefined || currentStep === current) return;
70
+ setCurrent(currentStep);
71
+ }, [currentStep]);
72
+ var _elements = _slicedToArray(elements, 2),
73
+ step1 = _elements[0],
74
+ step2 = _elements[1];
75
+ var namePath = (0, _formUtils.calcNamePath)(parentName, nameProp);
76
+ var shouldScroll = shouldScrollProp || shouldScrollState;
77
+ var selectedIdList = (_form$getFieldValue = form === null || form === void 0 ? void 0 : form.getFieldValue((0, _formUtils.calcNamePath)(namePath, _config.KEY_STEP1))) !== null && _form$getFieldValue !== void 0 ? _form$getFieldValue : [];
78
+ var calculateStep2Values = function calculateStep2Values() {
79
+ var _ref, _ref2;
80
+ var step1Values = (_ref = form === null || form === void 0 ? void 0 : form.getFieldValue((0, _formUtils.calcNamePath)(namePath, _config.KEY_STEP1))) !== null && _ref !== void 0 ? _ref : [];
81
+ var step2Values = (_ref2 = form === null || form === void 0 ? void 0 : form.getFieldValue((0, _formUtils.calcNamePath)(namePath, _config.KEY_STEP2))) !== null && _ref2 !== void 0 ? _ref2 : [];
82
+ var newStep2Values = step1Values.map(function (item) {
83
+ var found = step2Values.find(function (item2) {
84
+ return item2[_config.KEY_ITEM_ID] === item;
85
+ });
86
+ return found;
87
+ });
88
+ form === null || form === void 0 ? void 0 : form.setFields([{
89
+ name: (0, _formUtils.calcNamePath)(namePath, _config.KEY_STEP2),
90
+ value: newStep2Values
91
+ }]);
92
+ };
93
+ var _handleNext = /*#__PURE__*/function () {
94
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(index) {
95
+ var _allFields$filter, allFields, fields, validateSuccess, _refs$current;
96
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
97
+ while (1) switch (_context.prev = _context.next) {
98
+ case 0:
99
+ if (!(index === 0)) {
100
+ _context.next = 17;
101
+ break;
102
+ }
103
+ allFields = (form === null || form === void 0 ? void 0 : form.getFieldsError()) || [];
104
+ fields = allFields === null || allFields === void 0 ? void 0 : (_allFields$filter = allFields.filter(function (_ref4) {
105
+ var name = _ref4.name;
106
+ return name.join().startsWith(namePath === null || namePath === void 0 ? void 0 : namePath.join());
107
+ })) === null || _allFields$filter === void 0 ? void 0 : _allFields$filter.map(function (_ref5) {
108
+ var name = _ref5.name;
109
+ return name;
110
+ });
111
+ _context.prev = 3;
112
+ _context.next = 6;
113
+ return form === null || form === void 0 ? void 0 : form.validateFields(fields);
114
+ case 6:
115
+ _context.next = 12;
116
+ break;
117
+ case 8:
118
+ _context.prev = 8;
119
+ _context.t0 = _context["catch"](3);
120
+ form === null || form === void 0 ? void 0 : form.scrollToField(_context.t0.errorFields[0].name);
121
+ return _context.abrupt("return");
122
+ case 12:
123
+ setCurrent(function (n) {
124
+ return n + 1;
125
+ });
126
+ setShouldScrollState(true);
127
+ // 对Steps从重新赋表单值
128
+ calculateStep2Values();
129
+ _context.next = 21;
130
+ break;
131
+ case 17:
132
+ _context.next = 19;
133
+ return handleNextProp === null || handleNextProp === void 0 ? void 0 : handleNextProp();
134
+ case 19:
135
+ validateSuccess = _context.sent;
136
+ if (validateSuccess !== undefined && validateSuccess === false) {
137
+ (_refs$current = refs.current) === null || _refs$current === void 0 ? void 0 : _refs$current.forEach(function (cu) {
138
+ return cu.unfold();
139
+ });
140
+ }
141
+ case 21:
142
+ case "end":
143
+ return _context.stop();
144
+ }
145
+ }, _callee, null, [[3, 8]]);
146
+ }));
147
+ return function handleNext(_x2) {
148
+ return _ref3.apply(this, arguments);
149
+ };
150
+ }();
151
+ var _handleEdit = function handleEdit(index) {
152
+ setCurrent(index);
153
+ setShouldScrollState(true);
154
+ typeof handleEditProp === 'function' && handleEditProp(indexProp);
155
+ };
156
+ var configOfStep1 = _objectSpread(_objectSpread({}, restConfig), {}, {
157
+ label: step1.label,
158
+ elements: [{
159
+ name: _config.KEY_STEP1,
160
+ requiredMessage: formatMessage({
161
+ id: 'Please select at least one item to continue.'
162
+ }),
163
+ render: function render(preview, _, value, onChange) {
164
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CheckboxGroupItems, {
165
+ itemsData: itemsData,
166
+ itemsDataConfig: itemsDataConfig,
167
+ value: value,
168
+ onChange: onChange,
169
+ preview: preview
170
+ });
171
+ }
172
+ }]
173
+ });
174
+ var elementsOfStep2 = (itemsData === null || itemsData === void 0 ? void 0 : itemsData.length) === 0 ? [{
175
+ name: _config.KEY_STEP2,
176
+ requiredMessage: formatMessage({
177
+ id: 'Select at least one item to continue'
178
+ }),
179
+ render: function render() {
180
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("em", {
181
+ children: "Data exception: No Items Data."
182
+ });
183
+ }
184
+ }] : itemsData.filter(function (item) {
185
+ return selectedIdList.includes(item[_config.KEY_ITEM_ID]);
186
+ }).map(function (item, index) {
187
+ return {
188
+ name: index,
189
+ render: function render(preview) {
190
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SectionOfItemCondition, {
191
+ ref: function ref(r) {
192
+ if (r && refs.current) {
193
+ refs.current[index] = r;
194
+ }
195
+ },
196
+ index: index,
197
+ itemData: item,
198
+ itemsDataConfig: itemsDataConfig,
199
+ elements: step2.elements,
200
+ parentName: (0, _formUtils.calcNamePath)(namePath, [_config.KEY_STEP2, index]),
201
+ preview: preview
202
+ });
203
+ }
204
+ };
205
+ });
206
+ var configOfStep2 = _objectSpread(_objectSpread({}, restConfig), {}, {
207
+ label: step2.label,
208
+ name: _config.KEY_STEP2,
209
+ elements: elementsOfStep2
210
+ });
211
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
212
+ children: [configOfStep1, configOfStep2].map(function (config, idx) {
213
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_step.default, {
214
+ config: config,
215
+ parentName: namePath,
216
+ index: indexProp + idx,
217
+ total: total,
218
+ preview: current > idx || preview,
219
+ edit: current === idx && edit,
220
+ handleNext: function handleNext() {
221
+ return _handleNext(idx);
222
+ },
223
+ handleEdit: function handleEdit() {
224
+ return _handleEdit(idx);
225
+ },
226
+ showLastIndex: showLastIndex,
227
+ shouldScroll: shouldScroll
228
+ }, idx);
229
+ })
230
+ });
231
+ };
232
+ StepItemsSelection.STEP_COUNT = STEP_COUNT;
233
+ var _default = StepItemsSelection;
234
+ exports.default = _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _invariant = _interopRequireDefault(require("invariant"));
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _step = _interopRequireDefault(require("../step"));
12
+ var _stepItemsSelection = _interopRequireDefault(require("../step-items-selection"));
12
13
  var _formUtils = require("../../utils/form-utils");
13
14
  var _formContext = _interopRequireDefault(require("../../form-context"));
14
15
  var _formStepContext = _interopRequireDefault(require("../../form-step-context"));
@@ -21,6 +22,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
22
  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; }
22
23
  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); } }
23
24
  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); }); }; }
25
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
+ 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; }
28
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
29
+ 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); }
30
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
31
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
32
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
33
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
24
34
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
35
  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."); }
26
36
  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); }
@@ -44,11 +54,14 @@ var Steps = function Steps(_ref) {
44
54
  _useState2 = _slicedToArray(_useState, 2),
45
55
  current = _useState2[0],
46
56
  setCurrent = _useState2[1];
47
- // const [last, setLast] = useState(0);
48
- var _useState3 = (0, _react.useState)(false),
57
+ var _useState3 = (0, _react.useState)(0),
49
58
  _useState4 = _slicedToArray(_useState3, 2),
50
- shouldScroll = _useState4[0],
51
- setShouldScroll = _useState4[1];
59
+ currentStepInner = _useState4[0],
60
+ setCurrentStepInner = _useState4[1];
61
+ var _useState5 = (0, _react.useState)(false),
62
+ _useState6 = _slicedToArray(_useState5, 2),
63
+ shouldScroll = _useState6[0],
64
+ setShouldScroll = _useState6[1];
52
65
  var _useReducer = (0, _react.useReducer)(function (r) {
53
66
  return r + 1;
54
67
  }, 0),
@@ -84,10 +97,6 @@ var Steps = function Steps(_ref) {
84
97
  });
85
98
  dependentField.length && registerDependencies(dependentField, dispatch);
86
99
  }, []);
87
- (0, _react.useEffect)(function () {
88
- if (currentStep === undefined || currentStep === current) return;
89
- setCurrent(currentStep);
90
- }, [currentStep]);
91
100
  var renderElements = elements.filter(function (_ref5) {
92
101
  var curName = _ref5.name,
93
102
  dependencies = _ref5.dependencies,
@@ -96,6 +105,33 @@ var Steps = function Steps(_ref) {
96
105
  shouldRenderCode = _ref5.shouldRenderCode;
97
106
  return (0, _formUtils.calcShouldRender)((0, _formUtils.calcNamePath)(_parentName, curName), _parentName, dependencies, asserts, shouldRender, shouldRenderCode, form);
98
107
  });
108
+ var realRenderElements = renderElements.reduce(function (prev, cur, index) {
109
+ var _prev = _toConsumableArray(prev);
110
+ if (cur.type === 'Step') {
111
+ _prev.push(_objectSpread(_objectSpread({}, cur), {}, {
112
+ index: index
113
+ }));
114
+ } else {
115
+ _prev.push.apply(_prev, _toConsumableArray(Array.from({
116
+ length: _stepItemsSelection.default.STEP_COUNT
117
+ }).map(function (_, idx) {
118
+ return _objectSpread(_objectSpread({}, cur), {}, {
119
+ index: index,
120
+ innerIndex: idx
121
+ });
122
+ })));
123
+ }
124
+ return _prev;
125
+ }, []);
126
+ (0, _react.useEffect)(function () {
127
+ if (currentStep === undefined || currentStep === current || !realRenderElements[currentStep]) return;
128
+ var _realRenderElements$c = realRenderElements[currentStep],
129
+ index = _realRenderElements$c.index,
130
+ _realRenderElements$c2 = _realRenderElements$c.innerIndex,
131
+ innerIndex = _realRenderElements$c2 === void 0 ? 0 : _realRenderElements$c2;
132
+ setCurrentStepInner(innerIndex);
133
+ setCurrent(index);
134
+ }, [currentStep]);
99
135
  var handleNext = /*#__PURE__*/function () {
100
136
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
101
137
  var _allFields$filter;
@@ -124,7 +160,7 @@ var Steps = function Steps(_ref) {
124
160
  _context.prev = 10;
125
161
  _context.t0 = _context["catch"](5);
126
162
  form === null || form === void 0 ? void 0 : form.scrollToField(_context.t0.errorFields[0].name);
127
- return _context.abrupt("return");
163
+ return _context.abrupt("return", false);
128
164
  case 14:
129
165
  if (!(validationRule && getRuleValidationApi)) {
130
166
  _context.next = 28;
@@ -141,7 +177,7 @@ var Steps = function Steps(_ref) {
141
177
  }
142
178
  form === null || form === void 0 ? void 0 : form.setFields(res);
143
179
  form === null || form === void 0 ? void 0 : form.scrollToField(res[0].name);
144
- return _context.abrupt("return");
180
+ return _context.abrupt("return", false);
145
181
  case 23:
146
182
  _context.next = 28;
147
183
  break;
@@ -194,29 +230,54 @@ var Steps = function Steps(_ref) {
194
230
  var registerSection = function registerSection(name, toggle) {
195
231
  sections.current.set(name, toggle);
196
232
  };
233
+ var getIndex = function getIndex(index) {
234
+ var prevElements = renderElements.slice(0, index);
235
+ if (prevElements.find(function (ele) {
236
+ return ele.type === 'StepItemsSelection';
237
+ })) {
238
+ return index + (_stepItemsSelection.default.STEP_COUNT - 1);
239
+ }
240
+ return index;
241
+ };
242
+ var total = (0, _react.useMemo)(function () {
243
+ return renderElements.reduce(function (prev, cur) {
244
+ if (cur.type === 'StepItemsSelection') {
245
+ return prev + _stepItemsSelection.default.STEP_COUNT;
246
+ }
247
+ return prev + 1;
248
+ }, 0);
249
+ }, [renderElements]);
197
250
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
198
251
  className: (0, _classnames.default)('igloo-steps-container', className),
199
252
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
200
253
  className: 'igloo-steps-content',
201
254
  children: renderElements.map(function (child, index) {
202
- (0, _invariant.default)(child.type === 'Step', 'Child of steps should be Step');
255
+ (0, _invariant.default)(child.type === 'Step' || child.type === 'StepItemsSelection', 'Child of steps should be Step or StepItemsSelection');
256
+ (0, _invariant.default)(renderElements.filter(function (item) {
257
+ return item.type === 'StepItemsSelection';
258
+ }).length <= 1, 'Only one StepItemsSelection is allowed');
203
259
  (0, _invariant.default)(!child.validationRule || getRuleValidationApi, 'Please provide getRuleValidationApi in Form props');
204
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_formStepContext.default.Provider, {
260
+ var stepProps = {
261
+ parentName: _parentName,
262
+ index: getIndex(index),
263
+ total: total,
264
+ preview: current > index,
265
+ edit: current === index,
266
+ handleNext: handleNext,
267
+ handleEdit: handleEdit,
268
+ showLastIndex: showLastIndex,
269
+ shouldScroll: shouldScroll
270
+ };
271
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_formStepContext.default.Provider, {
205
272
  value: {
206
273
  registerSection: registerSection
207
274
  },
208
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_step.default, {
275
+ children: [child.type === 'StepItemsSelection' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_stepItemsSelection.default, _objectSpread(_objectSpread({}, stepProps), {}, {
209
276
  config: child,
210
- parentName: _parentName,
211
- index: index,
212
- total: renderElements.length,
213
- preview: current > index,
214
- edit: current === index,
215
- handleNext: handleNext,
216
- handleEdit: handleEdit,
217
- showLastIndex: showLastIndex,
218
- shouldScroll: shouldScroll
219
- })
277
+ currentStep: currentStepInner
278
+ })), child.type === 'Step' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_step.default, _objectSpread(_objectSpread({}, stepProps), {}, {
279
+ config: child
280
+ }))]
220
281
  }, child.key || (Array.isArray(child.name) ? child.name.join() : child.name) || index);
221
282
  })
222
283
  })
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _antd = require("antd");
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _omit = _interopRequireDefault(require("omit.js"));
11
+ var _formMethods = _interopRequireDefault(require("../../utils/form-methods"));
12
+ require("../style/index");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ 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); }
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
+ 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; }
19
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
20
+ 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); }
21
+ var BasicInput = function BasicInput(props) {
22
+ var handleOnBlur = function handleOnBlur(e) {
23
+ var value = props.value,
24
+ onChange = props.onChange;
25
+ if (typeof value === 'string') {
26
+ if (value.endsWith('.')) {
27
+ e.target.value = value.replace('.', '');
28
+ }
29
+ if (value.endsWith('0') && value.includes('.')) {
30
+ e.target.value = value.replace(/[0]+$/, '');
31
+ }
32
+ onChange && onChange(e);
33
+ }
34
+ };
35
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, _objectSpread(_objectSpread({}, (0, _omit.default)(props, _formMethods.default)), {}, {
36
+ onBlur: handleOnBlur,
37
+ type: "number",
38
+ className: (0, _classnames.default)('igloo-input', props.className)
39
+ }));
40
+ };
41
+ var _default = BasicInput;
42
+ exports.default = _default;