iglooform 2.5.52 → 3.0.0-alpha

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 (512) hide show
  1. package/.dumi/overrides.less +70 -0
  2. package/.dumi/tmp/core/EmptyRoute.tsx +9 -0
  3. package/.dumi/tmp/core/defineApp.ts +17 -0
  4. package/.dumi/tmp/core/exportStaticRuntimePlugin.ts +11 -0
  5. package/.dumi/tmp/core/helmet.ts +10 -0
  6. package/.dumi/tmp/core/helmetContext.ts +4 -0
  7. package/.dumi/tmp/core/history.ts +66 -0
  8. package/.dumi/tmp/core/historyIntelli.ts +132 -0
  9. package/.dumi/tmp/core/plugin.ts +60 -0
  10. package/.dumi/tmp/core/pluginConfig.ts +292 -0
  11. package/.dumi/tmp/core/pluginConfigJoi.d.ts +54 -0
  12. package/.dumi/tmp/core/polyfill.ts +201 -0
  13. package/.dumi/tmp/core/route.tsx +50 -0
  14. package/.dumi/tmp/core/terminal.ts +37 -0
  15. package/.dumi/tmp/dumi/exports.ts +5 -0
  16. package/.dumi/tmp/dumi/locales/config.ts +87 -0
  17. package/.dumi/tmp/dumi/locales/runtime.tsx +39 -0
  18. package/.dumi/tmp/dumi/meta/atoms.ts +4 -0
  19. package/.dumi/tmp/dumi/meta/index.ts +255 -0
  20. package/.dumi/tmp/dumi/meta/runtime.ts +31 -0
  21. package/.dumi/tmp/dumi/meta/tabs.ts +5 -0
  22. package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +58 -0
  23. package/.dumi/tmp/dumi/theme/builtins/API.ts +4 -0
  24. package/.dumi/tmp/dumi/theme/builtins/Badge.ts +4 -0
  25. package/.dumi/tmp/dumi/theme/builtins/Container.ts +4 -0
  26. package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +4 -0
  27. package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +4 -0
  28. package/.dumi/tmp/dumi/theme/builtins/Table.ts +4 -0
  29. package/.dumi/tmp/dumi/theme/builtins/Tree.ts +4 -0
  30. package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +4 -0
  31. package/.dumi/tmp/dumi/theme/nprogress.css +59 -0
  32. package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +4 -0
  33. package/.dumi/tmp/dumi/theme/slots/Content.ts +4 -0
  34. package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +4 -0
  35. package/.dumi/tmp/dumi/theme/slots/Features.ts +4 -0
  36. package/.dumi/tmp/dumi/theme/slots/Footer.ts +4 -0
  37. package/.dumi/tmp/dumi/theme/slots/Header.ts +4 -0
  38. package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +4 -0
  39. package/.dumi/tmp/dumi/theme/slots/Hero.ts +4 -0
  40. package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +4 -0
  41. package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +4 -0
  42. package/.dumi/tmp/dumi/theme/slots/Logo.ts +4 -0
  43. package/.dumi/tmp/dumi/theme/slots/Navbar.ts +4 -0
  44. package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +4 -0
  45. package/.dumi/tmp/dumi/theme/slots/NotFound.ts +4 -0
  46. package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +4 -0
  47. package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +4 -0
  48. package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +4 -0
  49. package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +5 -0
  50. package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +4 -0
  51. package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +4 -0
  52. package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +4 -0
  53. package/.dumi/tmp/dumi/theme/slots/Toc.ts +4 -0
  54. package/.dumi/tmp/exports.ts +17 -0
  55. package/.dumi/tmp/plugin-antd/runtime.tsx +65 -0
  56. package/.dumi/tmp/plugin-antd/runtimeConfig.d.ts +6 -0
  57. package/.dumi/tmp/plugin-antd/types.d.ts +14 -0
  58. package/.dumi/tmp/plugin-html2sketch/index.ts +35 -0
  59. package/.dumi/tmp/testBrowser.tsx +90 -0
  60. package/.dumi/tmp/umi.ts +106 -0
  61. package/.dumirc.ts +27 -0
  62. package/es/admin-upload/float.d.ts +2 -2
  63. package/es/admin-upload/float.js +30 -42
  64. package/es/admin-upload/index.js +178 -242
  65. package/es/admin-upload/job-list.js +90 -105
  66. package/es/admin-upload/modal.d.ts +2 -2
  67. package/es/admin-upload/modal.js +31 -45
  68. package/es/admin-upload/style/index.js +1 -1
  69. package/es/admin-upload/style/index.less +6 -6
  70. package/es/alert-message/index.js +23 -36
  71. package/es/alert-message/style/index.js +1 -1
  72. package/es/alert-message/style/index.less +1 -1
  73. package/es/amount/index.js +17 -25
  74. package/es/amount/style/index.d.ts +0 -1
  75. package/es/amount/style/index.js +0 -1
  76. package/es/back-top/index.js +18 -32
  77. package/es/back-top/style/index.js +1 -1
  78. package/es/back-top/style/index.less +36 -25
  79. package/es/button/index.js +57 -88
  80. package/es/button/style/index.js +1 -1
  81. package/es/button/style/index.less +159 -109
  82. package/es/card-detail/card-group.d.ts +2 -2
  83. package/es/card-detail/card-group.js +14 -22
  84. package/es/card-detail/card-item.d.ts +2 -2
  85. package/es/card-detail/card-item.js +12 -23
  86. package/es/card-detail/card-page.js +18 -24
  87. package/es/card-detail/card.js +21 -32
  88. package/es/card-detail/index.js +4 -4
  89. package/es/card-detail/style/index.js +1 -1
  90. package/es/card-detail/style/index.less +4 -4
  91. package/es/card-detail/utils.d.ts +2 -2
  92. package/es/card-detail/utils.js +15 -21
  93. package/es/checkbox/index.d.ts +3 -2
  94. package/es/checkbox/index.js +73 -96
  95. package/es/checkbox/style/index.js +1 -1
  96. package/es/checkbox/style/index.less +42 -20
  97. package/es/claim-list/index.d.ts +1 -1
  98. package/es/claim-list/index.js +83 -129
  99. package/es/claim-list/style/index.js +1 -1
  100. package/es/claim-list/style/index.less +14 -8
  101. package/es/confirmation/index.js +29 -47
  102. package/es/confirmation/style/index.d.ts +0 -1
  103. package/es/confirmation/style/index.js +0 -1
  104. package/es/currency-context/style/index.d.ts +0 -1
  105. package/es/currency-context/style/index.js +0 -1
  106. package/es/date-picker/buddhist.js +31 -46
  107. package/es/date-picker/index.d.ts +2 -2
  108. package/es/date-picker/index.js +89 -118
  109. package/es/date-picker/style/index.js +1 -1
  110. package/es/date-picker/style/index.less +43 -22
  111. package/es/declaration/index.js +21 -34
  112. package/es/declaration/style/index.js +1 -1
  113. package/es/declaration/style/index.less +3 -3
  114. package/es/detail-panel/index.d.ts +2 -2
  115. package/es/detail-panel/index.js +48 -67
  116. package/es/detail-panel/style/index.js +1 -1
  117. package/es/detail-panel/style/index.less +3 -3
  118. package/es/documents/index.js +55 -73
  119. package/es/documents/style/index.js +1 -1
  120. package/es/filter/checkBox.d.ts +1 -1
  121. package/es/filter/checkBox.js +43 -64
  122. package/es/filter/customize.d.ts +1 -1
  123. package/es/filter/customize.js +8 -10
  124. package/es/filter/index.d.ts +1 -1
  125. package/es/filter/index.js +261 -359
  126. package/es/filter/radioBox.d.ts +1 -1
  127. package/es/filter/radioBox.js +26 -35
  128. package/es/filter/rangePicker.d.ts +1 -1
  129. package/es/filter/rangePicker.js +64 -83
  130. package/es/filter/style/index.js +1 -1
  131. package/es/filter/style/index.less +11 -11
  132. package/es/form/addable-section/index.js +71 -110
  133. package/es/form/addable-section/style/index.js +1 -1
  134. package/es/form/divider/index.js +11 -18
  135. package/es/form/divider/style/index.js +1 -1
  136. package/es/form/element/index.js +81 -140
  137. package/es/form/element/style/index.js +1 -1
  138. package/es/form/element/style/index.less +5 -5
  139. package/es/form/elements.js +15 -18
  140. package/es/form/hstep/index.js +53 -77
  141. package/es/form/hstep/style/index.js +1 -1
  142. package/es/form/hstep/style/index.less +2 -2
  143. package/es/form/hsteps/index.js +187 -245
  144. package/es/form/hsteps/style/index.js +1 -1
  145. package/es/form/index.js +133 -194
  146. package/es/form/login/index.js +24 -35
  147. package/es/form/login/style/index.js +1 -1
  148. package/es/form/login/style/index.less +1 -1
  149. package/es/form/page/index.js +42 -60
  150. package/es/form/page/style/index.js +1 -1
  151. package/es/form/pages/index.js +102 -139
  152. package/es/form/pages/style/index.js +1 -1
  153. package/es/form/render/index.js +12 -17
  154. package/es/form/render/style/index.js +1 -1
  155. package/es/form/section/index.js +58 -81
  156. package/es/form/section/style/index.js +1 -1
  157. package/es/form/step/index.js +57 -84
  158. package/es/form/step/style/index.js +1 -1
  159. package/es/form/step/style/index.less +3 -3
  160. package/es/form/steps/index.js +129 -174
  161. package/es/form/steps/style/index.js +1 -1
  162. package/es/form/style/index.js +1 -1
  163. package/es/form/style/index.less +1 -1
  164. package/es/form-context.d.ts +1 -1
  165. package/es/form-step-context.d.ts +1 -1
  166. package/es/free-form/addable-section/index.js +79 -137
  167. package/es/free-form/addable-section/style/index.js +1 -1
  168. package/es/free-form/element/index.js +63 -115
  169. package/es/free-form/element/style/index.js +1 -1
  170. package/es/free-form/element/style/index.less +4 -4
  171. package/es/free-form/index.d.ts +2 -2
  172. package/es/free-form/index.js +107 -157
  173. package/es/free-form/page/index.js +106 -144
  174. package/es/free-form/page/style/index.js +1 -1
  175. package/es/free-form/pages/index.js +17 -36
  176. package/es/free-form/pages/style/index.js +1 -1
  177. package/es/free-form/section/index.js +49 -87
  178. package/es/free-form/section/style/index.js +1 -1
  179. package/es/free-form/step/index.js +141 -197
  180. package/es/free-form/step/style/index.js +1 -1
  181. package/es/free-form/step/style/index.less +3 -3
  182. package/es/free-form/steps/index.d.ts +2 -2
  183. package/es/free-form/steps/index.js +37 -60
  184. package/es/free-form/steps/style/index.js +1 -1
  185. package/es/free-form/style/index.js +1 -1
  186. package/es/free-form/style/index.less +1 -1
  187. package/es/global-message/index.d.ts +1 -1
  188. package/es/global-message/index.js +23 -35
  189. package/es/global-message/style/index.js +1 -1
  190. package/es/global-message/style/index.less +4 -0
  191. package/es/home-menu/index.d.ts +1 -1
  192. package/es/home-menu/index.js +46 -63
  193. package/es/home-menu/style/index.js +1 -1
  194. package/es/home-menu/style/index.less +12 -7
  195. package/es/index.js +44 -44
  196. package/es/input/amount.js +28 -44
  197. package/es/input/credit-card.js +40 -78
  198. package/es/input/email.js +13 -16
  199. package/es/input/expiry-date.js +59 -96
  200. package/es/input/index.js +12 -12
  201. package/es/input/input-date.js +48 -88
  202. package/es/input/input-id.js +18 -31
  203. package/es/input/input-number.js +19 -35
  204. package/es/input/input.js +17 -27
  205. package/es/input/otp.d.ts +1 -1
  206. package/es/input/otp.js +51 -79
  207. package/es/input/password.js +15 -19
  208. package/es/input/phone-number.js +31 -50
  209. package/es/input/style/index.js +1 -1
  210. package/es/input/style/index.less +68 -70
  211. package/es/input/text-area.js +31 -55
  212. package/es/layout/defaultFooter.js +38 -43
  213. package/es/layout/defaultHeader.js +11 -16
  214. package/es/layout/footer.js +79 -85
  215. package/es/layout/header.js +61 -94
  216. package/es/layout/index.d.ts +2 -3
  217. package/es/layout/index.js +32 -48
  218. package/es/layout/style/index.js +1 -1
  219. package/es/layout/style/index.less +2 -2
  220. package/es/locale/en-US.js +1 -2
  221. package/es/locale/format-message.js +2 -6
  222. package/es/locale/formatted-message.js +2 -3
  223. package/es/locale/id-ID.js +1 -2
  224. package/es/locale/index.js +4 -4
  225. package/es/locale/locale-context.js +2 -4
  226. package/es/locale/locale-provider.d.ts +2 -1
  227. package/es/locale/locale-provider.js +20 -28
  228. package/es/locale/ms-MY.js +1 -2
  229. package/es/locale/th-TH.js +1 -2
  230. package/es/locale/vi-VN.js +1 -2
  231. package/es/locale/zh-CN.js +1 -2
  232. package/es/locale/zh-TW.js +1 -2
  233. package/es/login-page/index.d.ts +2 -2
  234. package/es/login-page/index.js +24 -29
  235. package/es/login-page/style/index.js +1 -1
  236. package/es/media/index.js +59 -104
  237. package/es/media/media.js +27 -45
  238. package/es/media/preview.js +103 -149
  239. package/es/media/style/index.js +1 -1
  240. package/es/media/style/index.less +6 -6
  241. package/es/mobile-insurer-detail/index.d.ts +1 -1
  242. package/es/mobile-insurer-detail/index.js +52 -59
  243. package/es/mobile-insurer-detail/style/index.js +1 -1
  244. package/es/mobile-insurer-list/index.d.ts +1 -1
  245. package/es/mobile-insurer-list/index.js +34 -37
  246. package/es/mobile-insurer-list/style/index.js +1 -1
  247. package/es/modal/index.d.ts +2 -2
  248. package/es/modal/index.js +136 -154
  249. package/es/modal/style/index.js +1 -1
  250. package/es/modal/style/index.less +59 -51
  251. package/es/platform/index.js +2 -2
  252. package/es/platform/platform-card/index.js +18 -29
  253. package/es/platform/platform-card/style/index.js +1 -1
  254. package/es/platform/switch-platform/index.js +29 -53
  255. package/es/platform/switch-platform/style/index.js +1 -1
  256. package/es/platform/switch-platform/style/index.less +1 -1
  257. package/es/policy-list/index.d.ts +1 -1
  258. package/es/policy-list/index.js +21 -30
  259. package/es/policy-list/policy-card.d.ts +1 -1
  260. package/es/policy-list/policy-card.js +107 -142
  261. package/es/policy-list/style/index.js +1 -1
  262. package/es/policy-list/style/index.less +1 -0
  263. package/es/radio/index.d.ts +2 -1
  264. package/es/radio/index.js +65 -85
  265. package/es/radio/radio-group-with-other.d.ts +3 -2
  266. package/es/radio/radio-group-with-other.js +30 -55
  267. package/es/radio/style/index.js +1 -1
  268. package/es/radio/style/index.less +63 -45
  269. package/es/search-box/index.js +66 -98
  270. package/es/search-box/style/index.js +1 -1
  271. package/es/search-box/style/index.less +2 -2
  272. package/es/select/attached-select.d.ts +3 -3
  273. package/es/select/attached-select.js +67 -107
  274. package/es/select/index.js +3 -3
  275. package/es/select/select.d.ts +3 -3
  276. package/es/select/select.js +33 -50
  277. package/es/select/style/index.js +1 -1
  278. package/es/select/style/index.less +154 -112
  279. package/es/select/time-select.js +64 -108
  280. package/es/status-box/index.d.ts +2 -3
  281. package/es/status-box/index.js +14 -16
  282. package/es/status-box/style/index.js +1 -1
  283. package/es/status-box/style/index.less +2 -2
  284. package/es/table/index.js +119 -168
  285. package/es/table/style/index.js +1 -1
  286. package/es/table/style/index.less +137 -109
  287. package/es/tabs/index.d.ts +4 -3
  288. package/es/tabs/index.js +12 -16
  289. package/es/tabs/style/index.js +1 -1
  290. package/es/types.d.ts +1 -2
  291. package/es/types.js +2 -1
  292. package/es/typography/index.d.ts +2 -1
  293. package/es/typography/index.js +11 -17
  294. package/es/typography/style/index.js +1 -1
  295. package/es/typography/style/index.less +4 -0
  296. package/es/upload/index.js +253 -335
  297. package/es/upload/style/index.js +1 -1
  298. package/es/upload/style/index.less +8 -6
  299. package/es/upload-photo/index.js +321 -450
  300. package/es/upload-photo/media.js +16 -29
  301. package/es/upload-photo/style/index.js +1 -1
  302. package/es/upload-photo/style/index.less +4 -4
  303. package/es/upload-preview/index.js +63 -85
  304. package/es/upload-preview/media.js +42 -77
  305. package/es/upload-preview/style/index.js +1 -1
  306. package/es/upload-preview/style/index.less +1 -1
  307. package/es/utils/form-methods.js +1 -1
  308. package/es/utils/form-utils.d.ts +9 -8
  309. package/es/utils/form-utils.js +162 -260
  310. package/es/utils/option-utils.d.ts +3 -2
  311. package/es/utils/option-utils.js +106 -163
  312. package/es/utils/tools.js +0 -8
  313. package/lib/admin-upload/float.d.ts +2 -2
  314. package/lib/admin-upload/float.js +27 -46
  315. package/lib/admin-upload/index.js +171 -251
  316. package/lib/admin-upload/job-list.js +82 -109
  317. package/lib/admin-upload/modal.d.ts +2 -2
  318. package/lib/admin-upload/modal.js +27 -52
  319. package/lib/admin-upload/style/index.less +6 -6
  320. package/lib/alert-message/index.js +21 -43
  321. package/lib/alert-message/style/index.less +1 -1
  322. package/lib/amount/index.js +15 -31
  323. package/lib/amount/style/index.d.ts +0 -1
  324. package/lib/back-top/index.js +17 -39
  325. package/lib/back-top/style/index.less +36 -25
  326. package/lib/button/index.js +54 -101
  327. package/lib/button/style/index.less +159 -109
  328. package/lib/card-detail/card-group.d.ts +2 -2
  329. package/lib/card-detail/card-group.js +11 -29
  330. package/lib/card-detail/card-item.d.ts +2 -2
  331. package/lib/card-detail/card-item.js +9 -27
  332. package/lib/card-detail/card-page.js +14 -29
  333. package/lib/card-detail/card.js +17 -37
  334. package/lib/card-detail/index.js +0 -5
  335. package/lib/card-detail/style/index.less +4 -4
  336. package/lib/card-detail/utils.d.ts +2 -2
  337. package/lib/card-detail/utils.js +13 -28
  338. package/lib/checkbox/index.d.ts +3 -2
  339. package/lib/checkbox/index.js +64 -107
  340. package/lib/checkbox/style/index.less +42 -20
  341. package/lib/claim-list/index.d.ts +1 -1
  342. package/lib/claim-list/index.js +75 -143
  343. package/lib/claim-list/style/index.less +14 -8
  344. package/lib/confirmation/index.js +22 -50
  345. package/lib/confirmation/style/index.d.ts +0 -1
  346. package/lib/currency-context/index.js +0 -3
  347. package/lib/currency-context/style/index.d.ts +0 -1
  348. package/lib/date-picker/buddhist.js +34 -61
  349. package/lib/date-picker/index.d.ts +2 -2
  350. package/lib/date-picker/index.js +98 -145
  351. package/lib/date-picker/style/index.less +43 -22
  352. package/lib/declaration/index.js +17 -42
  353. package/lib/declaration/style/index.less +3 -3
  354. package/lib/detail-panel/index.d.ts +2 -2
  355. package/lib/detail-panel/index.js +44 -77
  356. package/lib/detail-panel/style/index.less +3 -3
  357. package/lib/documents/index.js +56 -78
  358. package/lib/filter/checkBox.d.ts +1 -1
  359. package/lib/filter/checkBox.js +40 -74
  360. package/lib/filter/customize.d.ts +1 -1
  361. package/lib/filter/customize.js +6 -14
  362. package/lib/filter/index.d.ts +1 -1
  363. package/lib/filter/index.js +258 -382
  364. package/lib/filter/radioBox.d.ts +1 -1
  365. package/lib/filter/radioBox.js +24 -45
  366. package/lib/filter/rangePicker.d.ts +1 -1
  367. package/lib/filter/rangePicker.js +64 -96
  368. package/lib/filter/style/index.less +11 -11
  369. package/lib/form/addable-section/index.js +65 -121
  370. package/lib/form/divider/index.js +9 -24
  371. package/lib/form/element/index.js +73 -156
  372. package/lib/form/element/style/index.less +5 -5
  373. package/lib/form/elements.js +1 -24
  374. package/lib/form/hstep/index.js +44 -87
  375. package/lib/form/hstep/style/index.less +2 -2
  376. package/lib/form/hsteps/index.js +177 -257
  377. package/lib/form/index.js +124 -201
  378. package/lib/form/login/index.js +18 -46
  379. package/lib/form/login/style/index.less +1 -1
  380. package/lib/form/page/index.js +35 -69
  381. package/lib/form/pages/index.js +94 -148
  382. package/lib/form/render/index.js +15 -21
  383. package/lib/form/section/index.js +52 -92
  384. package/lib/form/step/index.js +50 -96
  385. package/lib/form/step/style/index.less +3 -3
  386. package/lib/form/steps/index.js +125 -179
  387. package/lib/form/style/index.less +1 -1
  388. package/lib/form-context.d.ts +1 -1
  389. package/lib/form-context.js +0 -4
  390. package/lib/form-step-context.d.ts +1 -1
  391. package/lib/form-step-context.js +0 -4
  392. package/lib/free-form/addable-section/index.js +73 -148
  393. package/lib/free-form/element/index.js +58 -131
  394. package/lib/free-form/element/style/index.less +4 -4
  395. package/lib/free-form/index.d.ts +2 -2
  396. package/lib/free-form/index.js +104 -164
  397. package/lib/free-form/page/index.js +99 -150
  398. package/lib/free-form/pages/index.js +18 -39
  399. package/lib/free-form/section/index.js +46 -94
  400. package/lib/free-form/step/index.js +135 -209
  401. package/lib/free-form/step/style/index.less +3 -3
  402. package/lib/free-form/steps/index.d.ts +2 -2
  403. package/lib/free-form/steps/index.js +34 -66
  404. package/lib/free-form/style/index.less +1 -1
  405. package/lib/global-message/index.d.ts +1 -1
  406. package/lib/global-message/index.js +22 -40
  407. package/lib/global-message/style/index.less +4 -0
  408. package/lib/home-menu/index.d.ts +1 -1
  409. package/lib/home-menu/index.js +43 -74
  410. package/lib/home-menu/style/index.less +12 -7
  411. package/lib/index.js +0 -50
  412. package/lib/input/amount.js +25 -50
  413. package/lib/input/credit-card.js +37 -85
  414. package/lib/input/email.js +11 -20
  415. package/lib/input/expiry-date.js +54 -102
  416. package/lib/input/index.js +0 -14
  417. package/lib/input/input-date.js +46 -98
  418. package/lib/input/input-id.js +15 -35
  419. package/lib/input/input-number.js +16 -39
  420. package/lib/input/input.js +14 -33
  421. package/lib/input/otp.d.ts +1 -1
  422. package/lib/input/otp.js +47 -87
  423. package/lib/input/password.js +14 -25
  424. package/lib/input/phone-number.js +27 -56
  425. package/lib/input/style/index.less +68 -70
  426. package/lib/input/text-area.js +27 -61
  427. package/lib/layout/defaultFooter.js +33 -49
  428. package/lib/layout/defaultHeader.js +10 -21
  429. package/lib/layout/footer.js +74 -93
  430. package/lib/layout/header.js +56 -110
  431. package/lib/layout/index.d.ts +2 -3
  432. package/lib/layout/index.js +26 -52
  433. package/lib/layout/style/index.less +2 -2
  434. package/lib/locale/en-US.js +1 -3
  435. package/lib/locale/format-message.js +1 -7
  436. package/lib/locale/formatted-message.js +1 -6
  437. package/lib/locale/id-ID.js +1 -3
  438. package/lib/locale/index.js +0 -5
  439. package/lib/locale/locale-context.js +1 -7
  440. package/lib/locale/locale-provider.d.ts +2 -1
  441. package/lib/locale/locale-provider.js +18 -49
  442. package/lib/locale/ms-MY.js +1 -3
  443. package/lib/locale/th-TH.js +1 -3
  444. package/lib/locale/vi-VN.js +1 -3
  445. package/lib/locale/zh-CN.js +1 -3
  446. package/lib/locale/zh-TW.js +1 -3
  447. package/lib/login-page/index.d.ts +2 -2
  448. package/lib/login-page/index.js +22 -34
  449. package/lib/media/index.js +57 -110
  450. package/lib/media/media.js +28 -51
  451. package/lib/media/preview.js +99 -159
  452. package/lib/media/style/index.less +6 -6
  453. package/lib/mobile-insurer-detail/index.d.ts +1 -1
  454. package/lib/mobile-insurer-detail/index.js +46 -62
  455. package/lib/mobile-insurer-list/index.d.ts +1 -1
  456. package/lib/mobile-insurer-list/index.js +30 -42
  457. package/lib/modal/index.d.ts +2 -2
  458. package/lib/modal/index.js +130 -163
  459. package/lib/modal/style/index.less +59 -51
  460. package/lib/platform/index.js +0 -3
  461. package/lib/platform/platform-card/index.js +15 -34
  462. package/lib/platform/switch-platform/index.js +26 -64
  463. package/lib/platform/switch-platform/style/index.less +1 -1
  464. package/lib/policy-list/index.d.ts +1 -1
  465. package/lib/policy-list/index.js +18 -35
  466. package/lib/policy-list/policy-card.d.ts +1 -1
  467. package/lib/policy-list/policy-card.js +101 -152
  468. package/lib/policy-list/style/index.less +1 -0
  469. package/lib/radio/index.d.ts +2 -1
  470. package/lib/radio/index.js +58 -97
  471. package/lib/radio/radio-group-with-other.d.ts +3 -2
  472. package/lib/radio/radio-group-with-other.js +26 -58
  473. package/lib/radio/style/index.less +63 -45
  474. package/lib/search-box/index.js +57 -103
  475. package/lib/search-box/style/index.less +2 -2
  476. package/lib/select/attached-select.d.ts +3 -3
  477. package/lib/select/attached-select.js +59 -118
  478. package/lib/select/index.js +0 -5
  479. package/lib/select/select.d.ts +3 -3
  480. package/lib/select/select.js +29 -61
  481. package/lib/select/style/index.less +154 -112
  482. package/lib/select/time-select.js +58 -115
  483. package/lib/status-box/index.d.ts +2 -3
  484. package/lib/status-box/index.js +12 -19
  485. package/lib/status-box/style/index.less +2 -2
  486. package/lib/table/index.js +115 -196
  487. package/lib/table/style/index.less +137 -109
  488. package/lib/tabs/index.d.ts +4 -3
  489. package/lib/tabs/index.js +11 -23
  490. package/lib/types.d.ts +1 -2
  491. package/lib/types.js +8 -1
  492. package/lib/typography/index.d.ts +2 -1
  493. package/lib/typography/index.js +10 -20
  494. package/lib/typography/style/index.less +4 -0
  495. package/lib/upload/index.js +242 -344
  496. package/lib/upload/style/index.less +8 -6
  497. package/lib/upload-photo/index.js +309 -467
  498. package/lib/upload-photo/media.js +18 -32
  499. package/lib/upload-photo/style/index.less +4 -4
  500. package/lib/upload-preview/index.js +55 -90
  501. package/lib/upload-preview/media.js +36 -87
  502. package/lib/upload-preview/style/index.less +1 -1
  503. package/lib/utils/agent-detect.js +0 -1
  504. package/lib/utils/form-methods.js +1 -1
  505. package/lib/utils/form-utils.d.ts +9 -8
  506. package/lib/utils/form-utils.js +168 -288
  507. package/lib/utils/option-utils.d.ts +3 -2
  508. package/lib/utils/option-utils.js +105 -173
  509. package/lib/utils/tools.js +0 -11
  510. package/package.json +15 -18
  511. package/lib/global.less +0 -63
  512. /package/{es → .dumi}/global.less +0 -0
@@ -1,118 +1,89 @@
1
- import "antd/es/dropdown/style";
2
- import _Dropdown from "antd/es/dropdown";
3
- import "antd/es/input/style";
4
- import _Input from "antd/es/input";
5
- import "antd/es/button/style";
6
- import _Button from "antd/es/button";
7
- import "antd/es/divider/style";
8
- import _Divider from "antd/es/divider";
9
- import "antd/es/space/style";
10
- import _Space from "antd/es/space";
11
- import "antd/es/menu/style";
12
- import _Menu from "antd/es/menu";
13
-
14
1
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
-
16
2
  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."); }
17
-
18
3
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
19
-
20
4
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
21
-
22
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
-
24
6
  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."); }
25
-
26
7
  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); }
27
-
28
- 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; }
29
-
30
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
31
-
8
+ 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; }
9
+ 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; } }
32
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
33
-
34
11
  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; }
35
-
36
12
  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; }
37
-
38
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
39
-
13
+ 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; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ 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); }
40
16
  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); }
41
-
42
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
43
- import moment from 'moment';
17
+ import moment from 'dayjs';
44
18
  import classname from 'classnames';
45
19
  import invariant from 'invariant';
46
20
  import { useState, useRef, useReducer, useContext, useEffect, useLayoutEffect } from 'react';
21
+ import { Space, Divider, Menu, Dropdown, Input, Button } from 'antd';
47
22
  import { FilterOutlined, SearchOutlined, ArrowDownOutlined, CrossOutlined } from 'iglooicon';
48
- import './style/index';
49
- import { LocaleContext } from '../locale';
50
- import RangePicker from './rangePicker';
51
- import CreateCheckBoxFilter from './checkBox';
52
- import CreteRadioBoxFilter from './radioBox';
53
- import CustomizeFilter from './customize';
54
- import Typography from '../typography';
55
- import Select from '../select';
23
+ import "./style/index";
24
+ import { LocaleContext } from "../locale";
25
+ import RangePicker from "./rangePicker";
26
+ import CreateCheckBoxFilter from "./checkBox";
27
+ import CreteRadioBoxFilter from "./radioBox";
28
+ import CustomizeFilter from "./customize";
29
+ import Typography from "../typography";
30
+ import Select from "../select";
31
+ import { jsx as _jsx } from "react/jsx-runtime";
32
+ import { jsxs as _jsxs } from "react/jsx-runtime";
56
33
  var defaultFormat = 'DD / MM / YYYY';
57
-
58
34
  function handleFilterDisable() {
59
35
  var all = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
60
36
  var disable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
61
-
62
37
  if (disable.length === 0) {
63
38
  return all;
64
39
  }
65
-
66
40
  return all.filter(function (item) {
67
41
  return !disable.includes(item);
68
42
  });
69
43
  }
70
-
71
44
  function getDefaultOptions(params) {
72
45
  return params.reduce(function (res, item) {
73
46
  var key = item.key,
74
- defaultChoosed = item.default,
75
- _item$disabled = item.disabled,
76
- disabled = _item$disabled === void 0 ? [] : _item$disabled,
77
- type = item.type,
78
- disabledDate = item.disabledDate; // 判定一下默认时间在不在 不可选时间中
47
+ defaultChoosed = item.default,
48
+ _item$disabled = item.disabled,
49
+ disabled = _item$disabled === void 0 ? [] : _item$disabled,
50
+ type = item.type,
51
+ disabledDate = item.disabledDate;
79
52
 
53
+ // 判定一下默认时间在不在 不可选时间中
80
54
  if (type === 'date' && typeof disabledDate === 'function' && defaultChoosed && defaultChoosed.length) {
81
55
  // 判定的时候需要以 '天'作为最小单位
82
56
  var begin = moment(defaultChoosed[0]).endOf('day');
83
57
  var end = moment(defaultChoosed[1]).endOf('day');
84
58
  invariant(!disabledDate(begin) && !disabledDate(end), 'The default date is within a non-selectable time range');
85
59
  }
86
-
87
60
  if (type === 'single') {
88
61
  invariant(_typeof(defaultChoosed) !== 'object', 'The radio default value can not be a object');
89
62
  invariant(disabled.indexOf(defaultChoosed) === -1, 'The default value cannot be in the non-selectable range');
90
63
  return defaultChoosed ? _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, defaultChoosed)) : res;
91
64
  }
92
-
93
65
  return defaultChoosed ? _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, handleFilterDisable(defaultChoosed, disabled))) : res;
94
66
  }, {});
95
- } // 在getDefaultOptions之后执行 就不用再判断 默认时间不合法的问题了
96
-
67
+ }
97
68
 
69
+ // 在getDefaultOptions之后执行 就不用再判断 默认时间不合法的问题了
98
70
  function getChoosedTags(params, choosed) {
99
71
  return params.reduce(function (res, item) {
100
72
  var key = item.key,
101
- type = item.type,
102
- _item$format = item.format,
103
- format = _item$format === void 0 ? defaultFormat : _item$format,
104
- options = item.options,
105
- _item$canNotDelete = item.canNotDelete,
106
- canNotDelete = _item$canNotDelete === void 0 ? false : _item$canNotDelete,
107
- filterItemTitle = item.filterItemTitle,
108
- tagTitle = item.tagTitle;
73
+ type = item.type,
74
+ _item$format = item.format,
75
+ format = _item$format === void 0 ? defaultFormat : _item$format,
76
+ options = item.options,
77
+ _item$canNotDelete = item.canNotDelete,
78
+ canNotDelete = _item$canNotDelete === void 0 ? false : _item$canNotDelete,
79
+ filterItemTitle = item.filterItemTitle,
80
+ tagTitle = item.tagTitle;
109
81
  var choosedOption = {
110
82
  label: '',
111
83
  key: '',
112
84
  type: '',
113
85
  optionValue: ''
114
86
  };
115
-
116
87
  if (choosed[key]) {
117
88
  switch (type) {
118
89
  case 'customize':
@@ -123,7 +94,6 @@ function getChoosedTags(params, choosed) {
123
94
  choosedOption.type = type;
124
95
  res.push(choosedOption);
125
96
  break;
126
-
127
97
  case 'date':
128
98
  var beginTime = moment(choosed[key][0]).format(format);
129
99
  var endTime = moment(choosed[key][1]).format(format);
@@ -131,14 +101,11 @@ function getChoosedTags(params, choosed) {
131
101
  choosedOption.key = key;
132
102
  choosedOption.type = type;
133
103
  choosedOption.optionValue = choosed[key];
134
-
135
104
  if (canNotDelete) {
136
105
  choosedOption.canNotDelete = canNotDelete;
137
106
  }
138
-
139
107
  res.push(choosedOption);
140
108
  break;
141
-
142
109
  case 'mult':
143
110
  options === null || options === void 0 ? void 0 : options.map(function (item) {
144
111
  var multChoosed = {
@@ -148,8 +115,7 @@ function getChoosedTags(params, choosed) {
148
115
  optionValue: ''
149
116
  };
150
117
  var label = item.label,
151
- value = item.value;
152
-
118
+ value = item.value;
153
119
  if (choosed[key].indexOf(value) !== -1) {
154
120
  multChoosed.key = key;
155
121
  multChoosed.label = label;
@@ -159,95 +125,78 @@ function getChoosedTags(params, choosed) {
159
125
  }
160
126
  });
161
127
  break;
162
-
163
128
  case 'single':
164
129
  options === null || options === void 0 ? void 0 : options.map(function (item) {
165
130
  var label = item.label,
166
- value = item.value;
167
-
131
+ value = item.value;
168
132
  if (choosed[key] === value) {
169
133
  choosedOption.key = key;
170
134
  choosedOption.label = label;
171
135
  choosedOption.type = type;
172
136
  choosedOption.optionValue = value;
173
-
174
137
  if (canNotDelete) {
175
138
  choosedOption.canNotDelete = canNotDelete;
176
139
  }
177
-
178
140
  res.push(choosedOption);
179
141
  }
180
142
  });
181
143
  break;
182
-
183
144
  default:
184
145
  break;
185
146
  }
186
147
  }
187
-
188
148
  return res;
189
149
  }, []);
190
150
  }
191
-
192
151
  function optionsChange(state, action) {
193
152
  var type = action.type,
194
- value = action.value;
195
-
153
+ value = action.value;
196
154
  switch (type) {
197
155
  case 'default':
198
156
  return value;
199
-
200
157
  case 'deleteOne':
201
158
  return value;
202
-
203
159
  case 'deleteAll':
204
160
  return value;
205
-
206
161
  default:
207
162
  break;
208
163
  }
209
-
210
164
  return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, type, value));
211
165
  }
212
-
213
166
  function dataPickerOpenStatusReducer(state, action) {
214
167
  var type = action.type,
215
- value = action.value;
168
+ value = action.value;
216
169
  return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, type, value));
217
170
  }
218
-
219
171
  function getCheckBoxSelectedAll(params) {
220
172
  return params.reduce(function (res, item) {
221
173
  var key = item.key,
222
- _item$options = item.options,
223
- options = _item$options === void 0 ? [] : _item$options,
224
- type = item.type;
174
+ _item$options = item.options,
175
+ options = _item$options === void 0 ? [] : _item$options,
176
+ type = item.type;
225
177
  var allSelected = options.map(function (option) {
226
178
  return option.value;
227
179
  });
228
180
  return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, allSelected));
229
181
  }, {});
230
182
  }
231
-
232
183
  function getTimePickerOPtionsKey(params) {
233
184
  return params.filter(function (item) {
234
185
  return item.type === 'date';
235
186
  }).map(function (item) {
236
187
  return item.key;
237
188
  });
238
- } // cbFucs :callBack functions
239
-
189
+ }
240
190
 
191
+ // cbFucs :callBack functions
241
192
  function deleteSomeOne(optionsConfirmed, optionItem, cbFucs) {
242
193
  var key = optionItem.key,
243
- type = optionItem.type,
244
- optionValue = optionItem.optionValue;
245
-
194
+ type = optionItem.type,
195
+ optionValue = optionItem.optionValue;
246
196
  switch (type) {
247
197
  case 'date':
248
198
  delete optionsConfirmed[key];
249
199
  break;
250
-
251
200
  case 'mult':
252
201
  // 通过useReducer之后的数据 和 optionsAllSelected[key] 存在引用关系处理一下
253
202
  optionsConfirmed[key] = optionsConfirmed[key].map(function (e) {
@@ -256,27 +205,22 @@ function deleteSomeOne(optionsConfirmed, optionItem, cbFucs) {
256
205
  var deletedIndex = optionsConfirmed[key].indexOf(optionValue);
257
206
  optionsConfirmed[key].splice(deletedIndex, 1);
258
207
  break;
259
-
260
208
  case 'single':
261
209
  delete optionsConfirmed[key];
262
210
  break;
263
-
264
211
  case 'customize':
265
212
  delete optionsConfirmed[key];
266
213
  break;
267
214
  }
268
-
269
215
  var cbArr = typeof cbFucs === 'function' ? [cbFucs] : cbFucs;
270
216
  cbArr.forEach(function (item) {
271
217
  item(optionsConfirmed);
272
218
  });
273
219
  }
274
-
275
220
  var getTextWidth = function getTextWidth(str) {
276
221
  if (typeof document === 'undefined') {
277
222
  return str.length * 12;
278
223
  }
279
-
280
224
  var ele = document.createElement('span');
281
225
  ele.style.fontSize = '12px';
282
226
  ele.style.opacity = '0';
@@ -285,23 +229,21 @@ var getTextWidth = function getTextWidth(str) {
285
229
  var width = ele.offsetWidth;
286
230
  document.body.removeChild(ele);
287
231
  return width + 8 * 2 + 8 + 24;
288
- }; // 将对象的数组属性排序, 这样通过JSON 字符串比较的时候才不会有顺序问题
289
-
232
+ };
290
233
 
234
+ // 将对象的数组属性排序, 这样通过JSON 字符串比较的时候才不会有顺序问题
291
235
  function sortObjArr(obj) {
292
236
  var keys = Object.keys(obj);
293
237
  return keys.reduce(function (res, item) {
294
238
  var prop = obj[item];
295
-
296
239
  if (Array.isArray(prop)) {
297
240
  return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, item, prop.sort()));
298
241
  }
299
-
300
242
  return res;
301
243
  }, {});
302
- } // 需要将日期的部分精确到天
303
-
244
+ }
304
245
 
246
+ // 需要将日期的部分精确到天
305
247
  function judgeChange(defaultOptions, newOptions, timePickerKey) {
306
248
  // 先将newOptions中的空数组去掉
307
249
  var newChoosedKeys = Object.keys(newOptions);
@@ -310,16 +252,13 @@ function judgeChange(defaultOptions, newOptions, timePickerKey) {
310
252
  delete newOptions[key];
311
253
  }
312
254
  });
313
-
314
255
  if (Object.keys(defaultOptions).length !== Object.keys(newOptions).length) {
315
256
  return true;
316
257
  }
317
-
318
258
  if (timePickerKey.length === 0) {
319
259
  return JSON.stringify(sortObjArr(defaultOptions)) !== JSON.stringify(sortObjArr(newOptions));
320
- } // 不再引库了
321
-
322
-
260
+ }
261
+ // 不再引库了
323
262
  var JsonDefault = JSON.parse(JSON.stringify(defaultOptions));
324
263
  var JsonNew = JSON.parse(JSON.stringify(newOptions));
325
264
  timePickerKey.forEach(function (item) {
@@ -329,7 +268,6 @@ function judgeChange(defaultOptions, newOptions, timePickerKey) {
329
268
  var date = [moment(beginTime).format('YYYY-MM-DD'), moment(endTime).format('YYYY-MM-DD')];
330
269
  JsonDefault[item] = date;
331
270
  }
332
-
333
271
  if (JsonNew[item]) {
334
272
  var _beginTime = JsonNew[item][0];
335
273
  var _endTime = JsonNew[item][1];
@@ -339,199 +277,192 @@ function judgeChange(defaultOptions, newOptions, timePickerKey) {
339
277
  });
340
278
  return JSON.stringify(sortObjArr(JsonDefault)) !== JSON.stringify(sortObjArr(JsonNew));
341
279
  }
342
-
343
280
  var FilterComponent = function FilterComponent(props) {
344
281
  var Option = Select.Option;
345
-
346
282
  var _useContext = useContext(LocaleContext),
347
- formatMessage = _useContext.formatMessage,
348
- currentLang = _useContext.currentLang;
349
-
283
+ formatMessage = _useContext.formatMessage,
284
+ currentLang = _useContext.currentLang;
350
285
  var showDefaultOptions = props.showDefaultOptions,
351
- _props$onFilter = props.onFilter,
352
- onFilter = _props$onFilter === void 0 ? function () {} : _props$onFilter,
353
- placeholder = props.placeholder,
354
- _props$parentFilterCa = props.parentFilterCallBack,
355
- parentFilterCallBack = _props$parentFilterCa === void 0 ? function () {} : _props$parentFilterCa,
356
- _props$deleteAllTagsT = props.deleteAllTagsType,
357
- deleteAllTagsType = _props$deleteAllTagsT === void 0 ? 'restFilters' : _props$deleteAllTagsT,
358
- _props$searchWithFilt = props.searchWithFilter,
359
- searchWithFilter = _props$searchWithFilt === void 0 ? false : _props$searchWithFilt,
360
- searchInputDefault = props.searchInputDefault,
361
- initValue = props.initValue,
362
- inputOnly = props.inputOnly,
363
- beforeOpenFilter = props.beforeOpenFilter,
364
- resetCallBack = props.resetCallBack;
286
+ _props$onFilter = props.onFilter,
287
+ onFilter = _props$onFilter === void 0 ? function () {} : _props$onFilter,
288
+ placeholder = props.placeholder,
289
+ _props$parentFilterCa = props.parentFilterCallBack,
290
+ parentFilterCallBack = _props$parentFilterCa === void 0 ? function () {} : _props$parentFilterCa,
291
+ _props$deleteAllTagsT = props.deleteAllTagsType,
292
+ deleteAllTagsType = _props$deleteAllTagsT === void 0 ? 'restFilters' : _props$deleteAllTagsT,
293
+ _props$searchWithFilt = props.searchWithFilter,
294
+ searchWithFilter = _props$searchWithFilt === void 0 ? false : _props$searchWithFilt,
295
+ searchInputDefault = props.searchInputDefault,
296
+ initValue = props.initValue,
297
+ inputOnly = props.inputOnly,
298
+ beforeOpenFilter = props.beforeOpenFilter,
299
+ resetCallBack = props.resetCallBack;
365
300
  var filterTitle = props.filterTitle,
366
- _props$filterItems = props.filterItems,
367
- filterItems = _props$filterItems === void 0 ? [] : _props$filterItems; // id controller
301
+ _props$filterItems = props.filterItems,
302
+ filterItems = _props$filterItems === void 0 ? [] : _props$filterItems;
368
303
 
304
+ // id controller
369
305
  var showIdSelect = props.showIdSelect,
370
- _props$idKeyTypes = props.idKeyTypes,
371
- idKeyTypes = _props$idKeyTypes === void 0 ? [] : _props$idKeyTypes,
372
- idKeyTypeDefault = props.idKeyTypeDefault;
373
-
306
+ _props$idKeyTypes = props.idKeyTypes,
307
+ idKeyTypes = _props$idKeyTypes === void 0 ? [] : _props$idKeyTypes,
308
+ idKeyTypeDefault = props.idKeyTypeDefault;
374
309
  var _useState = useState(idKeyTypeDefault),
375
- _useState2 = _slicedToArray(_useState, 2),
376
- idName = _useState2[0],
377
- setIdName = _useState2[1];
378
-
310
+ _useState2 = _slicedToArray(_useState, 2),
311
+ idName = _useState2[0],
312
+ setIdName = _useState2[1];
379
313
  invariant(!showIdSelect || idKeyTypes.length !== 0, 'must set idKeyTypes while showIdSelect is true');
380
- invariant(typeof onFilter === 'function', 'filterCallBack must be a function'); // option controller
314
+ invariant(typeof onFilter === 'function', 'filterCallBack must be a function');
381
315
 
382
- var dropDownContainerRef = useRef(); // 处理antd日期组件选择完还有高亮问题
316
+ // option controller
317
+ var dropDownContainerRef = useRef();
383
318
 
384
- var invisibleRef = useRef(); // 控制 展开框的关闭
319
+ // 处理antd日期组件选择完还有高亮问题
320
+ var invisibleRef = useRef();
385
321
 
386
- var openStatusTagRef = useRef(undefined); // 需要做高度动态效果,需要获取一下内容的高度
322
+ // 控制 展开框的关闭
323
+ var openStatusTagRef = useRef(undefined);
387
324
 
325
+ // 需要做高度动态效果,需要获取一下内容的高度
388
326
  var heightRef = useRef(undefined);
389
-
390
327
  var _useState3 = useState(48),
391
- _useState4 = _slicedToArray(_useState3, 2),
392
- openTagsHeight = _useState4[0],
393
- setOpenTagHeight = _useState4[1]; // 用来控制 search input的高亮和 切换
394
-
328
+ _useState4 = _slicedToArray(_useState3, 2),
329
+ openTagsHeight = _useState4[0],
330
+ setOpenTagHeight = _useState4[1];
395
331
 
396
- var searchInput = useRef(null); //inner options controller
332
+ // 用来控制 search input的高亮和 切换
333
+ var searchInput = useRef(null);
397
334
 
335
+ //inner options controller
398
336
  var _useState5 = useState(function () {
399
- return getDefaultOptions(filterItems);
400
- }),
401
- _useState6 = _slicedToArray(_useState5, 1),
402
- defaultOptions = _useState6[0];
403
-
337
+ return getDefaultOptions(filterItems);
338
+ }),
339
+ _useState6 = _slicedToArray(_useState5, 1),
340
+ defaultOptions = _useState6[0];
404
341
  var _useState7 = useState({}),
405
- _useState8 = _slicedToArray(_useState7, 2),
406
- optionsAllSelected = _useState8[0],
407
- setOptionsAllSelected = _useState8[1];
408
-
342
+ _useState8 = _slicedToArray(_useState7, 2),
343
+ optionsAllSelected = _useState8[0],
344
+ setOptionsAllSelected = _useState8[1];
409
345
  var _useReducer = useReducer(optionsChange, initValue ? _objectSpread({}, initValue) : _objectSpread({}, defaultOptions)),
410
- _useReducer2 = _slicedToArray(_useReducer, 2),
411
- optionsChanged = _useReducer2[0],
412
- dispatchOptionsChange = _useReducer2[1];
413
-
346
+ _useReducer2 = _slicedToArray(_useReducer, 2),
347
+ optionsChanged = _useReducer2[0],
348
+ dispatchOptionsChange = _useReducer2[1];
414
349
  var _useState9 = useState(initValue ? _objectSpread({}, initValue) : _objectSpread({}, defaultOptions)),
415
- _useState10 = _slicedToArray(_useState9, 2),
416
- confirmed = _useState10[0],
417
- setConfimed = _useState10[1]; //dropDown visible
418
-
350
+ _useState10 = _slicedToArray(_useState9, 2),
351
+ confirmed = _useState10[0],
352
+ setConfimed = _useState10[1];
419
353
 
354
+ //dropDown visible
420
355
  var _useState11 = useState(false),
421
- _useState12 = _slicedToArray(_useState11, 2),
422
- dropVisible = _useState12[0],
423
- setDropVisible = _useState12[1]; //filter button high light
424
-
356
+ _useState12 = _slicedToArray(_useState11, 2),
357
+ dropVisible = _useState12[0],
358
+ setDropVisible = _useState12[1];
425
359
 
360
+ //filter button high light
426
361
  var _useState13 = useState(false),
427
- _useState14 = _slicedToArray(_useState13, 2),
428
- hightLightFilterButton = _useState14[0],
429
- setHighLightFilter = _useState14[1]; // type-> 0:custom 1:last day 2:last 7 Days 3:last month 4:this month
430
-
362
+ _useState14 = _slicedToArray(_useState13, 2),
363
+ hightLightFilterButton = _useState14[0],
364
+ setHighLightFilter = _useState14[1];
431
365
 
366
+ // type-> 0:custom 1:last day 2:last 7 Days 3:last month 4:this month
432
367
  var _useState15 = useState(-1),
433
- _useState16 = _slicedToArray(_useState15, 2),
434
- timeRangeType = _useState16[0],
435
- setTimeRangeType = _useState16[1];
436
-
368
+ _useState16 = _slicedToArray(_useState15, 2),
369
+ timeRangeType = _useState16[0],
370
+ setTimeRangeType = _useState16[1];
437
371
  var _useState17 = useState(-1),
438
- _useState18 = _slicedToArray(_useState17, 2),
439
- confirmedTimeRange = _useState18[0],
440
- setConfirmTimeRange = _useState18[1]; //对时间比较的时候需要只精确到 “天”,预先拿到那些key是代表日期的
441
-
372
+ _useState18 = _slicedToArray(_useState17, 2),
373
+ confirmedTimeRange = _useState18[0],
374
+ setConfirmTimeRange = _useState18[1];
442
375
 
376
+ //对时间比较的时候需要只精确到 “天”,预先拿到那些key是代表日期的
443
377
  var _useState19 = useState(getTimePickerOPtionsKey(filterItems)),
444
- _useState20 = _slicedToArray(_useState19, 1),
445
- timePickerKey = _useState20[0];
446
-
378
+ _useState20 = _slicedToArray(_useState19, 1),
379
+ timePickerKey = _useState20[0];
447
380
  var _useReducer3 = useReducer(dataPickerOpenStatusReducer, timePickerKey.reduce(function (res, key) {
448
- res[key] = false;
449
- return res;
450
- }, {})),
451
- _useReducer4 = _slicedToArray(_useReducer3, 2),
452
- dataPickerOpenStatus = _useReducer4[0],
453
- setPickerOpenStatus = _useReducer4[1]; // 对于已选择部分在 ‘input’ 上的展开控制
454
-
455
-
381
+ res[key] = false;
382
+ return res;
383
+ }, {})),
384
+ _useReducer4 = _slicedToArray(_useReducer3, 2),
385
+ dataPickerOpenStatus = _useReducer4[0],
386
+ setPickerOpenStatus = _useReducer4[1];
387
+
388
+ // 对于已选择部分在 ‘input’ 上的展开控制
456
389
  var _useState21 = useState(false),
457
- _useState22 = _slicedToArray(_useState21, 2),
458
- inputExtend = _useState22[0],
459
- extendInputContent = _useState22[1];
460
-
390
+ _useState22 = _slicedToArray(_useState21, 2),
391
+ inputExtend = _useState22[0],
392
+ extendInputContent = _useState22[1];
461
393
  var _useState23 = useState([]),
462
- _useState24 = _slicedToArray(_useState23, 2),
463
- maxTagsWhenClosed = _useState24[0],
464
- setMaxTagsWhenClosed = _useState24[1];
465
-
394
+ _useState24 = _slicedToArray(_useState23, 2),
395
+ maxTagsWhenClosed = _useState24[0],
396
+ setMaxTagsWhenClosed = _useState24[1];
466
397
  var _useState25 = useState(false),
467
- _useState26 = _slicedToArray(_useState25, 2),
468
- oneLineCanShow = _useState26[0],
469
- setOneLineCanShow = _useState26[1]; // 不管是默认还是 之后手动选择的 filter的名字
470
-
398
+ _useState26 = _slicedToArray(_useState25, 2),
399
+ oneLineCanShow = _useState26[0],
400
+ setOneLineCanShow = _useState26[1];
471
401
 
402
+ // 不管是默认还是 之后手动选择的 filter的名字
472
403
  var _useState27 = useState(function () {
473
- return getChoosedTags(filterItems, defaultOptions);
474
- }),
475
- _useState28 = _slicedToArray(_useState27, 2),
476
- choosedTags = _useState28[0],
477
- setChoosedTags = _useState28[1]; // 如果没有filter选项 需要展示出input框
478
-
404
+ return getChoosedTags(filterItems, defaultOptions);
405
+ }),
406
+ _useState28 = _slicedToArray(_useState27, 2),
407
+ choosedTags = _useState28[0],
408
+ setChoosedTags = _useState28[1];
479
409
 
410
+ // 如果没有filter选项 需要展示出input框
480
411
  var _useState29 = useState(false),
481
- _useState30 = _slicedToArray(_useState29, 2),
482
- noFilters = _useState30[0],
483
- setNoFilters = _useState30[1]; // 这个状态标志着 此时只有不能删除的 filters(根据业务来的)
484
-
412
+ _useState30 = _slicedToArray(_useState29, 2),
413
+ noFilters = _useState30[0],
414
+ setNoFilters = _useState30[1];
485
415
 
416
+ // 这个状态标志着 此时只有不能删除的 filters(根据业务来的)
486
417
  var _useState31 = useState(false),
487
- _useState32 = _slicedToArray(_useState31, 2),
488
- onlyHaveCanNotDeleteTags = _useState32[0],
489
- setOnlyHaveCanNotDeleteTags = _useState32[1]; // 在onlyOneTagAndCanNotDelete状态下 开启input 输入框 进行search 搜索
490
-
418
+ _useState32 = _slicedToArray(_useState31, 2),
419
+ onlyHaveCanNotDeleteTags = _useState32[0],
420
+ setOnlyHaveCanNotDeleteTags = _useState32[1];
491
421
 
422
+ // 在onlyOneTagAndCanNotDelete状态下 开启input 输入框 进行search 搜索
492
423
  var _useState33 = useState(false),
493
- _useState34 = _slicedToArray(_useState33, 2),
494
- showSearchInputWhenHasTag = _useState34[0],
495
- setShowSearchInputWhenHasTag = _useState34[1]; // 删除tags的过程中 需要一直展示tags Input
496
-
424
+ _useState34 = _slicedToArray(_useState33, 2),
425
+ showSearchInputWhenHasTag = _useState34[0],
426
+ setShowSearchInputWhenHasTag = _useState34[1];
497
427
 
428
+ // 删除tags的过程中 需要一直展示tags Input
498
429
  var _useState35 = useState(false),
499
- _useState36 = _slicedToArray(_useState35, 2),
500
- stillHaveTagsToDelete = _useState36[0],
501
- setStillHaveTagsToDelete = _useState36[1];
502
-
430
+ _useState36 = _slicedToArray(_useState35, 2),
431
+ stillHaveTagsToDelete = _useState36[0],
432
+ setStillHaveTagsToDelete = _useState36[1];
503
433
  var _useState37 = useState(),
504
- _useState38 = _slicedToArray(_useState37, 2),
505
- searchInputValue = _useState38[0],
506
- setSearchInputValue = _useState38[1];
507
-
434
+ _useState38 = _slicedToArray(_useState37, 2),
435
+ searchInputValue = _useState38[0],
436
+ setSearchInputValue = _useState38[1];
508
437
  var _useState39 = useState(searchInputDefault !== undefined ? true : false),
509
- _useState40 = _slicedToArray(_useState39, 2),
510
- showSearchInputDefault = _useState40[0],
511
- setShowSearchInputDefault = _useState40[1]; // 处理options 中 data?.map data 初始化为[] 没有数据的情况
512
-
438
+ _useState40 = _slicedToArray(_useState39, 2),
439
+ showSearchInputDefault = _useState40[0],
440
+ setShowSearchInputDefault = _useState40[1];
513
441
 
442
+ // 处理options 中 data?.map data 初始化为[] 没有数据的情况
514
443
  useEffect(function () {
515
444
  setOptionsAllSelected(getCheckBoxSelectedAll(filterItems));
516
- }, [JSON.stringify(filterItems)]); // 设置tag框 高度改变动效
445
+ }, [JSON.stringify(filterItems)]);
517
446
 
447
+ // 设置tag框 高度改变动效
518
448
  useLayoutEffect(function () {
519
449
  var timer = setTimeout(function () {
520
450
  var _heightRef$current;
521
-
522
451
  setOpenTagHeight((_heightRef$current = heightRef.current) === null || _heightRef$current === void 0 ? void 0 : _heightRef$current.offsetHeight);
523
452
  }, 0);
524
453
  return function () {
525
454
  return clearTimeout(timer);
526
455
  };
527
- }, [inputExtend, JSON.stringify(confirmed)]); // 针对删除了所有可删除的filter tags情况,自动聚焦到seatch Input
456
+ }, [inputExtend, JSON.stringify(confirmed)]);
528
457
 
458
+ // 针对删除了所有可删除的filter tags情况,自动聚焦到seatch Input
529
459
  useLayoutEffect(function () {
530
460
  if (noFilters || showSearchInputWhenHasTag) {
531
461
  searchInput.current.focus();
532
462
  }
533
- }, [noFilters, showSearchInputWhenHasTag]); // filter 改变之后更新选中的tags
463
+ }, [noFilters, showSearchInputWhenHasTag]);
534
464
 
465
+ // filter 改变之后更新选中的tags
535
466
  useEffect(function () {
536
467
  if (hightLightFilterButton || showDefaultOptions || stillHaveTagsToDelete || initValue) {
537
468
  // 判定filter高亮
@@ -540,10 +471,10 @@ var FilterComponent = function FilterComponent(props) {
540
471
  } else {
541
472
  setHighLightFilter(false);
542
473
  }
543
-
544
474
  var tags = getChoosedTags(filterItems, confirmed);
545
- setChoosedTags(tags); // 选择的filter 数量控制 input和tags 框谁展示
475
+ setChoosedTags(tags);
546
476
 
477
+ // 选择的filter 数量控制 input和tags 框谁展示
547
478
  if (tags.length === 0) {
548
479
  setNoFilters(true);
549
480
  extendInputContent(false);
@@ -552,7 +483,6 @@ var FilterComponent = function FilterComponent(props) {
552
483
  setNoFilters(false);
553
484
  setShowSearchInputWhenHasTag(false);
554
485
  }
555
-
556
486
  if (tags.every(function (tag) {
557
487
  return tag.canNotDelete === true;
558
488
  })) {
@@ -560,111 +490,100 @@ var FilterComponent = function FilterComponent(props) {
560
490
  } else {
561
491
  setOnlyHaveCanNotDeleteTags(false);
562
492
  }
563
-
564
493
  var tagsWidth = tags.map(function (item) {
565
494
  return getTextWidth(item.label);
566
495
  });
567
- var maxTagContentWidth = showIdSelect ? 388 : 488; // 减去的是函数中算padding多加的
568
-
496
+ var maxTagContentWidth = showIdSelect ? 388 : 488;
497
+ // 减去的是函数中算padding多加的
569
498
  var ellipsisWidth = getTextWidth('...') - (8 * 2 + 8 + 24);
570
- var canShowTags = []; // -12:reduce函数中多加了一个12
499
+ var canShowTags = [];
571
500
 
501
+ // -12:reduce函数中多加了一个12
572
502
  var currentWidth = -12;
573
503
  var tagsOnelineWidth = tagsWidth.reduce(function (res, item) {
574
504
  // 12是每一个 tag之前的margin值
575
505
  return res += item + 12;
576
506
  }, currentWidth);
577
-
578
507
  if (tagsOnelineWidth <= maxTagContentWidth) {
579
508
  setMaxTagsWhenClosed(tags);
580
509
  setOneLineCanShow(true);
581
510
  return;
582
511
  }
583
-
584
512
  currentWidth = ellipsisWidth;
585
513
  setOneLineCanShow(false);
586
-
587
514
  for (var i = 0; i < tags.length; i++) {
588
515
  if (maxTagContentWidth >= currentWidth + tagsWidth[i]) {
589
516
  currentWidth += tagsWidth[i] + 12;
590
517
  canShowTags.push(tags[i]);
591
518
  }
592
519
  }
593
-
594
520
  setMaxTagsWhenClosed(canShowTags);
595
521
  }
596
- }, [hightLightFilterButton, showDefaultOptions, JSON.stringify(confirmed), currentLang]); // 用于关闭开启的 tag框
522
+ }, [hightLightFilterButton, showDefaultOptions, JSON.stringify(confirmed), currentLang]);
597
523
 
524
+ // 用于关闭开启的 tag框
598
525
  useEffect(function () {
599
526
  if (!inputExtend) return;
600
-
601
527
  function closeTagContent(e) {
602
528
  if (!openStatusTagRef.current) return;
603
-
604
529
  if (!openStatusTagRef.current.contains(e.target)) {
605
530
  extendInputContent(false);
606
531
  }
607
532
  }
608
-
609
533
  window.addEventListener('click', closeTagContent);
610
534
  return function () {
611
535
  window.removeEventListener('click', closeTagContent);
612
536
  };
613
537
  }, [inputExtend]);
614
-
615
- var menu = _jsx(_Menu, {
616
- children: _jsxs(_Menu.Item, {
617
- children: [_jsxs("div", {
538
+ var menu = /*#__PURE__*/_jsx(Menu, {
539
+ children: /*#__PURE__*/_jsxs(Menu.Item, {
540
+ children: [/*#__PURE__*/_jsxs("div", {
618
541
  className: "igloo-form-filter-drop-down-container-content",
619
- children: [_jsxs(_Space, {
620
- children: [_jsx(FilterOutlined, {
542
+ children: [/*#__PURE__*/_jsxs(Space, {
543
+ children: [/*#__PURE__*/_jsx(FilterOutlined, {
621
544
  style: {
622
545
  fontSize: '24px',
623
546
  color: '#666666'
624
547
  }
625
- }), _jsx(Typography, {
548
+ }), /*#__PURE__*/_jsx(Typography, {
626
549
  level: "h4",
627
550
  children: filterTitle
628
551
  })]
629
- }), _jsx(_Divider, {
552
+ }), /*#__PURE__*/_jsx(Divider, {
630
553
  style: {
631
554
  margin: '16px 0px'
632
555
  }
633
556
  }), filterItems.map(function (item) {
634
557
  var type = item.type,
635
- options = item.options,
636
- filterItemTitle = item.filterItemTitle,
637
- key = item.key,
638
- disabled = item.disabled,
639
- disabledDate = item.disabledDate,
640
- _item$format2 = item.format,
641
- format = _item$format2 === void 0 ? defaultFormat : _item$format2,
642
- dateRangeConfig = item.dateRangeConfig,
643
- render = item.render,
644
- tagTitle = item.tagTitle,
645
- onChangeProps = item.onChange;
646
-
558
+ options = item.options,
559
+ filterItemTitle = item.filterItemTitle,
560
+ key = item.key,
561
+ disabled = item.disabled,
562
+ disabledDate = item.disabledDate,
563
+ _item$format2 = item.format,
564
+ format = _item$format2 === void 0 ? defaultFormat : _item$format2,
565
+ dateRangeConfig = item.dateRangeConfig,
566
+ render = item.render,
567
+ tagTitle = item.tagTitle,
568
+ onChangeProps = item.onChange;
647
569
  switch (type) {
648
570
  case 'customize':
649
571
  invariant(typeof render === 'function', 'render is required of customize filter option');
650
572
  invariant(typeof tagTitle === 'function', 'tagTitle is required of customize filter option');
651
-
652
- var onChange = function onChange(value) {
573
+ var _onChange = function _onChange(value) {
653
574
  return dispatchOptionsChange({
654
575
  type: key,
655
576
  value: value
656
577
  });
657
578
  };
658
-
659
- return _jsx(CustomizeFilter, {
579
+ return /*#__PURE__*/_jsx(CustomizeFilter, {
660
580
  optionKey: key,
661
581
  value: optionsChanged[key],
662
- onChange: onChange,
582
+ onChange: _onChange,
663
583
  render: render
664
584
  }, key);
665
-
666
585
  case 'date':
667
- return _jsx(RangePicker, {
586
+ return /*#__PURE__*/_jsx(RangePicker, {
668
587
  title: filterItemTitle || formatMessage({
669
588
  id: 'Date'
670
589
  }),
@@ -681,10 +600,9 @@ var FilterComponent = function FilterComponent(props) {
681
600
  setPickerOpenStatus: setPickerOpenStatus,
682
601
  onChange: onChangeProps
683
602
  }, key);
684
-
685
603
  case 'mult':
686
604
  invariant(Array.isArray(options), 'options is required');
687
- return _jsx(CreateCheckBoxFilter, {
605
+ return /*#__PURE__*/_jsx(CreateCheckBoxFilter, {
688
606
  title: filterItemTitle,
689
607
  configList: options,
690
608
  optionKey: key,
@@ -695,10 +613,9 @@ var FilterComponent = function FilterComponent(props) {
695
613
  setConfirmValue: setConfimed,
696
614
  onChange: onChangeProps
697
615
  }, key);
698
-
699
616
  case 'single':
700
617
  invariant(Array.isArray(options), 'options is required');
701
- return _jsx(CreteRadioBoxFilter, {
618
+ return /*#__PURE__*/_jsx(CreteRadioBoxFilter, {
702
619
  title: filterItemTitle,
703
620
  configList: options,
704
621
  optionKey: key,
@@ -710,12 +627,12 @@ var FilterComponent = function FilterComponent(props) {
710
627
  }, key);
711
628
  }
712
629
  })]
713
- }), _jsxs("div", {
630
+ }), /*#__PURE__*/_jsxs("div", {
714
631
  className: "igloo-form-filter-drop-down-footer",
715
632
  onClick: function onClick(e) {
716
633
  return e.stopPropagation();
717
634
  },
718
- children: [_jsx("span", {
635
+ children: [/*#__PURE__*/_jsx("span", {
719
636
  onClick: function onClick() {
720
637
  typeof resetCallBack === 'function' && resetCallBack(_objectSpread({}, defaultOptions));
721
638
  setTimeout(function () {
@@ -726,15 +643,15 @@ var FilterComponent = function FilterComponent(props) {
726
643
  });
727
644
  }, 10);
728
645
  },
729
- children: _jsx(Typography, {
646
+ children: /*#__PURE__*/_jsx(Typography, {
730
647
  level: "h4",
731
648
  children: formatMessage({
732
649
  id: 'Reset All Filters'
733
650
  })
734
651
  })
735
- }), _jsxs(_Space, {
652
+ }), /*#__PURE__*/_jsxs(Space, {
736
653
  size: 16,
737
- children: [_jsx("span", {
654
+ children: [/*#__PURE__*/_jsx("span", {
738
655
  onClick: function onClick() {
739
656
  setDropVisible(false);
740
657
  dispatchOptionsChange({
@@ -743,32 +660,30 @@ var FilterComponent = function FilterComponent(props) {
743
660
  });
744
661
  setTimeRangeType(confirmedTimeRange);
745
662
  },
746
- children: _jsx(Typography, {
663
+ children: /*#__PURE__*/_jsx(Typography, {
747
664
  level: "h4",
748
665
  children: formatMessage({
749
666
  id: 'Cancel'
750
667
  })
751
668
  })
752
- }), _jsx(_Button, {
669
+ }), /*#__PURE__*/_jsx(Button, {
753
670
  onClick: function onClick() {
754
671
  setDropVisible(false);
755
672
  setShowSearchInputDefault(false);
756
673
  setConfimed(optionsChanged);
757
674
  setConfirmTimeRange(timeRangeType);
758
675
  setSearchInputValue('');
759
-
760
676
  if (typeof onFilter === 'function') {
761
677
  onFilter(_objectSpread({}, optionsChanged));
762
678
  typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, optionsChanged));
763
679
  }
764
-
765
680
  if (judgeChange(defaultOptions, optionsChanged, timePickerKey)) {
766
681
  setHighLightFilter(true);
767
682
  } else {
768
683
  setHighLightFilter(false);
769
684
  }
770
685
  },
771
- children: _jsx(Typography, {
686
+ children: /*#__PURE__*/_jsx(Typography, {
772
687
  level: "h4",
773
688
  style: {
774
689
  padding: '0px 35px'
@@ -782,10 +697,9 @@ var FilterComponent = function FilterComponent(props) {
782
697
  })]
783
698
  }, 1)
784
699
  });
785
-
786
- return _jsxs("div", {
700
+ return /*#__PURE__*/_jsxs("div", {
787
701
  className: "".concat(showIdSelect ? 'igloo-form-filter-with-select' : 'igloo-form-filter'),
788
- children: [_jsx(_Input, {
702
+ children: [/*#__PURE__*/_jsx(Input, {
789
703
  ref: invisibleRef,
790
704
  style: {
791
705
  width: '0',
@@ -793,29 +707,29 @@ var FilterComponent = function FilterComponent(props) {
793
707
  padding: '0px',
794
708
  border: '0px'
795
709
  }
796
- }), showIdSelect && idKeyTypes.length !== 0 && _jsx(Select, {
710
+ }), showIdSelect && idKeyTypes.length !== 0 && /*#__PURE__*/_jsx(Select, {
797
711
  className: "igloo-form-filter-id-select",
798
712
  onChange: function onChange(e) {
799
713
  return setIdName(String(e));
800
714
  },
801
715
  defaultValue: idKeyTypeDefault,
802
- suffixIcon: _jsx(ArrowDownOutlined, {
716
+ suffixIcon: /*#__PURE__*/_jsx(ArrowDownOutlined, {
803
717
  style: {
804
718
  fontSize: 24
805
719
  }
806
720
  }),
807
721
  children: idKeyTypes.map(function (item) {
808
- return _jsx(Option, {
722
+ return /*#__PURE__*/_jsx(Option, {
809
723
  value: item.value,
810
- children: _jsx(Typography, {
724
+ children: /*#__PURE__*/_jsx(Typography, {
811
725
  level: "body1",
812
726
  children: item.label
813
727
  })
814
728
  }, item.value);
815
729
  })
816
- }), (hightLightFilterButton || showDefaultOptions || stillHaveTagsToDelete) && !noFilters && !showSearchInputDefault && !showSearchInputWhenHasTag ? _jsxs("div", {
730
+ }), (hightLightFilterButton || showDefaultOptions || stillHaveTagsToDelete) && !noFilters && !showSearchInputDefault && !showSearchInputWhenHasTag ? /*#__PURE__*/_jsxs("div", {
817
731
  className: "igloo-filter-tag-position-reference",
818
- children: [_jsxs("div", {
732
+ children: [/*#__PURE__*/_jsxs("div", {
819
733
  ref: heightRef,
820
734
  className: classname({
821
735
  'tag-defalut-container-hide-status': inputExtend,
@@ -825,75 +739,73 @@ var FilterComponent = function FilterComponent(props) {
825
739
  onClick: function onClick(e) {
826
740
  e.stopPropagation();
827
741
  !oneLineCanShow && extendInputContent(true);
828
-
829
742
  if (onlyHaveCanNotDeleteTags) {
830
743
  setShowSearchInputWhenHasTag(true);
831
744
  }
832
745
  },
833
- children: [_jsx(SearchOutlined, {
746
+ children: [/*#__PURE__*/_jsx(SearchOutlined, {
834
747
  className: 'search-icon'
835
- }), _jsxs(_Space, {
748
+ }), /*#__PURE__*/_jsxs(Space, {
836
749
  size: [12, 8],
837
750
  className: "tag-container",
838
751
  style: {
839
752
  flex: '1'
840
753
  },
841
754
  children: [_toConsumableArray(inputExtend ? choosedTags : maxTagsWhenClosed).map(function (item, index) {
842
- return _jsxs("div", {
755
+ return /*#__PURE__*/_jsxs("div", {
843
756
  className: "tag-card",
844
- children: [_jsx(Typography, {
757
+ children: [/*#__PURE__*/_jsx(Typography, {
845
758
  level: "body3",
846
759
  children: item.label
847
- }), !item.canNotDelete && _jsx(CrossOutlined, {
760
+ }), !item.canNotDelete && /*#__PURE__*/_jsx(CrossOutlined, {
848
761
  className: "delete-icon",
849
762
  onClick: function onClick(e) {
850
763
  e.stopPropagation();
851
764
  var type = item.type;
852
-
853
765
  if (type === 'date') {
854
766
  setTimeRangeType(-1);
855
767
  }
856
-
857
768
  var statusCallBack = function statusCallBack(options) {
858
769
  dispatchOptionsChange({
859
770
  type: 'deleteOne',
860
771
  value: options
861
772
  });
862
773
  setConfimed(options);
863
- var tags = getChoosedTags(filterItems, options); // 删除过程中需要一直展示tags 不切换到 search input
774
+ var tags = getChoosedTags(filterItems, options);
864
775
 
776
+ // 删除过程中需要一直展示tags 不切换到 search input
865
777
  if (tags.length) {
866
778
  setStillHaveTagsToDelete(true);
867
779
  } else {
868
780
  setStillHaveTagsToDelete(false);
869
781
  }
870
782
  };
871
-
872
783
  var handleFilter = function handleFilter(confirmed) {
873
784
  typeof onFilter === 'function' && onFilter(_objectSpread({}, confirmed));
874
785
  typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, confirmed));
875
786
  };
876
-
877
787
  deleteSomeOne(confirmed, item, [statusCallBack, handleFilter]);
878
788
  }
879
789
  })]
880
790
  }, index);
881
- }), !oneLineCanShow && !inputExtend && _jsx("span", {
791
+ }), !oneLineCanShow && !inputExtend && /*#__PURE__*/_jsx("span", {
882
792
  children: "..."
883
793
  })]
884
- }), !onlyHaveCanNotDeleteTags && _jsx(CrossOutlined, {
794
+ }), !onlyHaveCanNotDeleteTags && /*#__PURE__*/_jsx(CrossOutlined, {
885
795
  className: "delete-all-icon",
886
796
  onClick: function onClick(e) {
887
797
  e.stopPropagation();
888
798
  setTimeRangeType(-1);
889
- extendInputContent(false); // 不管什么情况下的 删除全部 都不应该继续展示tags
799
+ extendInputContent(false);
890
800
 
891
- setStillHaveTagsToDelete(false); // 对于全部删除而言 只能使用 choosedTags
801
+ // 不管什么情况下的 删除全部 都不应该继续展示tags
802
+ setStillHaveTagsToDelete(false);
892
803
 
804
+ // 对于全部删除而言 只能使用 choosedTags
893
805
  var deleteAll = choosedTags.reduce(function (res, item) {
894
806
  var key = item.key,
895
- optionValue = item.optionValue,
896
- canNotDelete = item.canNotDelete;
807
+ optionValue = item.optionValue,
808
+ canNotDelete = item.canNotDelete;
897
809
  return canNotDelete ? _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, optionValue)) : res;
898
810
  }, {});
899
811
  var afterDeleteValue = deleteAllTagsType === 'restFilters' ? _objectSpread({}, defaultOptions) : deleteAll;
@@ -902,14 +814,13 @@ var FilterComponent = function FilterComponent(props) {
902
814
  value: afterDeleteValue
903
815
  });
904
816
  setConfimed(afterDeleteValue);
905
-
906
817
  if (typeof onFilter === 'function') {
907
818
  onFilter(_objectSpread({}, afterDeleteValue));
908
819
  typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, afterDeleteValue));
909
820
  }
910
821
  }
911
822
  })]
912
- }), _jsxs("div", {
823
+ }), /*#__PURE__*/_jsxs("div", {
913
824
  ref: openStatusTagRef,
914
825
  className: classname('tag-extend-container-hide-status', {
915
826
  'igloo-form-filter-has-select-tag-container': showIdSelect,
@@ -921,72 +832,70 @@ var FilterComponent = function FilterComponent(props) {
921
832
  },
922
833
  onClick: function onClick(e) {
923
834
  e.stopPropagation();
924
-
925
835
  if (onlyHaveCanNotDeleteTags) {
926
836
  setShowSearchInputWhenHasTag(true);
927
837
  }
928
838
  },
929
- children: [_jsx(SearchOutlined, {
839
+ children: [/*#__PURE__*/_jsx(SearchOutlined, {
930
840
  className: 'search-icon'
931
- }), _jsx(_Space, {
841
+ }), /*#__PURE__*/_jsx(Space, {
932
842
  size: [12, 8],
933
843
  className: "tag-container",
934
844
  style: {
935
845
  flex: '1'
936
846
  },
937
847
  children: _toConsumableArray(inputExtend ? choosedTags : maxTagsWhenClosed).map(function (item, index) {
938
- return _jsxs("div", {
848
+ return /*#__PURE__*/_jsxs("div", {
939
849
  className: "tag-card",
940
- children: [_jsx(Typography, {
850
+ children: [/*#__PURE__*/_jsx(Typography, {
941
851
  level: "body3",
942
852
  children: item.label
943
- }), !item.canNotDelete && _jsx(CrossOutlined, {
853
+ }), !item.canNotDelete && /*#__PURE__*/_jsx(CrossOutlined, {
944
854
  className: "delete-icon",
945
855
  onClick: function onClick(e) {
946
856
  e.stopPropagation();
947
857
  var type = item.type;
948
-
949
858
  if (type === 'date') {
950
859
  setTimeRangeType(-1);
951
860
  }
952
-
953
861
  var statusCallBack = function statusCallBack(options) {
954
862
  dispatchOptionsChange({
955
863
  type: 'deleteOne',
956
864
  value: options
957
865
  });
958
866
  setConfimed(options);
959
- var tags = getChoosedTags(filterItems, options); // 删除过程中需要一直展示tags 不切换到 search input
867
+ var tags = getChoosedTags(filterItems, options);
960
868
 
869
+ // 删除过程中需要一直展示tags 不切换到 search input
961
870
  if (tags.length) {
962
871
  setStillHaveTagsToDelete(true);
963
872
  } else {
964
873
  setStillHaveTagsToDelete(false);
965
874
  }
966
875
  };
967
-
968
876
  var handleFilter = function handleFilter(confirmed) {
969
877
  typeof onFilter === 'function' && onFilter(_objectSpread({}, confirmed));
970
878
  typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, confirmed));
971
879
  };
972
-
973
880
  deleteSomeOne(confirmed, item, [statusCallBack, handleFilter]);
974
881
  }
975
882
  })]
976
883
  }, index);
977
884
  })
978
- }), !onlyHaveCanNotDeleteTags && _jsx(CrossOutlined, {
885
+ }), !onlyHaveCanNotDeleteTags && /*#__PURE__*/_jsx(CrossOutlined, {
979
886
  className: "delete-all-icon",
980
887
  onClick: function onClick() {
981
888
  setTimeRangeType(-1);
982
- extendInputContent(false); // 不管什么情况下的 删除全部 都不应该继续展示tags
889
+ extendInputContent(false);
983
890
 
984
- setStillHaveTagsToDelete(false); // 对于全部删除而言 只能使用 choosedTags
891
+ // 不管什么情况下的 删除全部 都不应该继续展示tags
892
+ setStillHaveTagsToDelete(false);
985
893
 
894
+ // 对于全部删除而言 只能使用 choosedTags
986
895
  var deleteAll = choosedTags.reduce(function (res, item) {
987
896
  var key = item.key,
988
- optionValue = item.optionValue,
989
- canNotDelete = item.canNotDelete;
897
+ optionValue = item.optionValue,
898
+ canNotDelete = item.canNotDelete;
990
899
  return canNotDelete ? _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, optionValue)) : res;
991
900
  }, {});
992
901
  var afterDeleteValue = deleteAllTagsType === 'restFilters' ? _objectSpread({}, defaultOptions) : deleteAll;
@@ -995,7 +904,6 @@ var FilterComponent = function FilterComponent(props) {
995
904
  value: afterDeleteValue
996
905
  });
997
906
  setConfimed(afterDeleteValue);
998
-
999
907
  if (typeof onFilter === 'function') {
1000
908
  onFilter(_objectSpread({}, afterDeleteValue));
1001
909
  typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, afterDeleteValue));
@@ -1003,7 +911,7 @@ var FilterComponent = function FilterComponent(props) {
1003
911
  }
1004
912
  })]
1005
913
  })]
1006
- }) : _jsx(_Input, {
914
+ }) : /*#__PURE__*/_jsx(Input, {
1007
915
  ref: searchInput,
1008
916
  value: searchInputValue,
1009
917
  onChange: function onChange(e) {
@@ -1016,7 +924,7 @@ var FilterComponent = function FilterComponent(props) {
1016
924
  setShowSearchInputWhenHasTag(false);
1017
925
  }
1018
926
  },
1019
- prefix: _jsx(SearchOutlined, {
927
+ prefix: /*#__PURE__*/_jsx(SearchOutlined, {
1020
928
  style: {
1021
929
  fontSize: '24px',
1022
930
  color: '#999999',
@@ -1026,10 +934,8 @@ var FilterComponent = function FilterComponent(props) {
1026
934
  className: "".concat(showIdSelect ? 'igloo-form-filter-has-select-input' : 'igloo-form-filter-default-input'),
1027
935
  onPressEnter: function onPressEnter(e) {
1028
936
  var value = undefined;
1029
-
1030
937
  if (e.target.value) {
1031
938
  var _ref;
1032
-
1033
939
  value = searchWithFilter ? _objectSpread(_objectSpread(_defineProperty({}, idName || 'id', e.target.value), confirmed), {}, {
1034
940
  searchValue: e.target.value,
1035
941
  searchKey: idName
@@ -1040,15 +946,14 @@ var FilterComponent = function FilterComponent(props) {
1040
946
  searchKey: idName
1041
947
  });
1042
948
  }
1043
-
1044
949
  onFilter(value);
1045
950
  typeof parentFilterCallBack === 'function' && parentFilterCallBack(value);
1046
951
  }
1047
- }), !inputOnly && _jsx(_Dropdown, {
952
+ }), !inputOnly && /*#__PURE__*/_jsx(Dropdown, {
1048
953
  getPopupContainer: function getPopupContainer() {
1049
954
  return dropDownContainerRef.current;
1050
955
  },
1051
- overlay: dropVisible ? menu : _jsx(_Menu, {
956
+ overlay: dropVisible ? menu : /*#__PURE__*/_jsx(Menu, {
1052
957
  style: {
1053
958
  display: 'none'
1054
959
  }
@@ -1056,13 +961,11 @@ var FilterComponent = function FilterComponent(props) {
1056
961
  placement: 'bottomLeft',
1057
962
  overlayClassName: "igloo-form-filter-drop-down-container",
1058
963
  visible: dropVisible,
1059
- onVisibleChange: function onVisibleChange(visible) {
964
+ onOpenChange: function onOpenChange(visible) {
1060
965
  setDropVisible(visible);
1061
-
1062
966
  if (visible) {
1063
967
  typeof beforeOpenFilter === 'function' && beforeOpenFilter(_objectSpread({}, confirmed));
1064
968
  }
1065
-
1066
969
  setTimeout(function () {
1067
970
  if (dropVisible) {
1068
971
  setTimeRangeType(confirmedTimeRange);
@@ -1074,14 +977,14 @@ var FilterComponent = function FilterComponent(props) {
1074
977
  }, 0);
1075
978
  },
1076
979
  trigger: ['click'],
1077
- children: _jsx("div", {
980
+ children: /*#__PURE__*/_jsx("div", {
1078
981
  className: "igloo-form-filter-button-container",
1079
- children: _jsx(_Button, {
982
+ children: /*#__PURE__*/_jsx(Button, {
1080
983
  className: classname('igloo-form-filter-filter-button', {
1081
984
  'igloo-form-filter-filter-button-active': dropVisible,
1082
985
  'igloo-form-filter-filter-button-high-light': hightLightFilterButton
1083
986
  }),
1084
- icon: _jsx(FilterOutlined, {
987
+ icon: /*#__PURE__*/_jsx(FilterOutlined, {
1085
988
  style: {
1086
989
  fontSize: '24px'
1087
990
  }
@@ -1089,9 +992,9 @@ var FilterComponent = function FilterComponent(props) {
1089
992
  onClick: function onClick() {
1090
993
  setDropVisible(true);
1091
994
  },
1092
- children: _jsx("span", {
995
+ children: /*#__PURE__*/_jsx("span", {
1093
996
  className: "filter-text",
1094
- children: _jsx(Typography, {
997
+ children: /*#__PURE__*/_jsx(Typography, {
1095
998
  level: "body1",
1096
999
  children: formatMessage({
1097
1000
  id: 'Filter'
@@ -1100,11 +1003,10 @@ var FilterComponent = function FilterComponent(props) {
1100
1003
  })
1101
1004
  })
1102
1005
  })
1103
- }), _jsx("div", {
1006
+ }), /*#__PURE__*/_jsx("div", {
1104
1007
  className: "igloo-form-filter-drop-down",
1105
1008
  ref: dropDownContainerRef
1106
1009
  })]
1107
1010
  });
1108
1011
  };
1109
-
1110
1012
  export default FilterComponent;