funda-ui 4.7.624 → 4.7.625

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 (560) hide show
  1. package/README.md +2 -116
  2. package/package.json +1 -591
  3. package/.gitattributes +0 -2
  4. package/README_PUBLISH.md +0 -328
  5. package/logo.png +0 -0
  6. package/preview.png +0 -0
  7. package/publish/LICENSE +0 -21
  8. package/publish/README.md +0 -328
  9. package/publish/lib/cjs/Accordion/index.d.ts +0 -2
  10. package/publish/lib/cjs/Accordion/index.js +0 -667
  11. package/publish/lib/cjs/BackToTop/index.d.ts +0 -17
  12. package/publish/lib/cjs/BackToTop/index.js +0 -904
  13. package/publish/lib/cjs/CascadingSelect/index.d.ts +0 -80
  14. package/publish/lib/cjs/CascadingSelect/index.js +0 -3383
  15. package/publish/lib/cjs/CascadingSelectE2E/index.d.ts +0 -91
  16. package/publish/lib/cjs/CascadingSelectE2E/index.js +0 -3988
  17. package/publish/lib/cjs/Chatbox/index.d.ts +0 -101
  18. package/publish/lib/cjs/Chatbox/index.js +0 -7037
  19. package/publish/lib/cjs/Checkbox/index.d.ts +0 -28
  20. package/publish/lib/cjs/Checkbox/index.js +0 -673
  21. package/publish/lib/cjs/ColorPicker/index.d.ts +0 -27
  22. package/publish/lib/cjs/ColorPicker/index.js +0 -662
  23. package/publish/lib/cjs/Date/index.d.ts +0 -70
  24. package/publish/lib/cjs/Date/index.js +0 -6368
  25. package/publish/lib/cjs/DigitalClock/index.d.ts +0 -7
  26. package/publish/lib/cjs/DigitalClock/index.js +0 -402
  27. package/publish/lib/cjs/DragDropList/index.d.ts +0 -45
  28. package/publish/lib/cjs/DragDropList/index.js +0 -1586
  29. package/publish/lib/cjs/DropdownMenu/index.d.ts +0 -38
  30. package/publish/lib/cjs/DropdownMenu/index.js +0 -1507
  31. package/publish/lib/cjs/DynamicFields/index.d.ts +0 -40
  32. package/publish/lib/cjs/DynamicFields/index.js +0 -818
  33. package/publish/lib/cjs/EventCalendar/index.d.ts +0 -61
  34. package/publish/lib/cjs/EventCalendar/index.js +0 -3789
  35. package/publish/lib/cjs/EventCalendarTimeline/index.d.ts +0 -100
  36. package/publish/lib/cjs/EventCalendarTimeline/index.js +0 -6141
  37. package/publish/lib/cjs/File/index.d.ts +0 -40
  38. package/publish/lib/cjs/File/index.js +0 -1751
  39. package/publish/lib/cjs/HorizontalScrollContent/index.d.ts +0 -14
  40. package/publish/lib/cjs/HorizontalScrollContent/index.js +0 -426
  41. package/publish/lib/cjs/Input/index.d.ts +0 -59
  42. package/publish/lib/cjs/Input/index.js +0 -1486
  43. package/publish/lib/cjs/LiveSearch/index.d.ts +0 -70
  44. package/publish/lib/cjs/LiveSearch/index.js +0 -4180
  45. package/publish/lib/cjs/MasonryLayout/index.d.ts +0 -14
  46. package/publish/lib/cjs/MasonryLayout/index.js +0 -689
  47. package/publish/lib/cjs/ModalDialog/index.d.ts +0 -83
  48. package/publish/lib/cjs/ModalDialog/index.js +0 -1719
  49. package/publish/lib/cjs/ModeSwitch/index.d.ts +0 -17
  50. package/publish/lib/cjs/ModeSwitch/index.js +0 -202
  51. package/publish/lib/cjs/MultilevelDropdownMenu/index.d.ts +0 -20
  52. package/publish/lib/cjs/MultilevelDropdownMenu/index.js +0 -930
  53. package/publish/lib/cjs/MultipleCheckboxes/index.d.ts +0 -66
  54. package/publish/lib/cjs/MultipleCheckboxes/index.js +0 -2337
  55. package/publish/lib/cjs/MultipleSelect/index.d.ts +0 -65
  56. package/publish/lib/cjs/MultipleSelect/index.js +0 -4197
  57. package/publish/lib/cjs/NativeSelect/index.d.ts +0 -37
  58. package/publish/lib/cjs/NativeSelect/index.js +0 -2052
  59. package/publish/lib/cjs/NumberInput/index.d.ts +0 -40
  60. package/publish/lib/cjs/NumberInput/index.js +0 -1191
  61. package/publish/lib/cjs/Pagination/index.d.ts +0 -51
  62. package/publish/lib/cjs/Pagination/index.js +0 -612
  63. package/publish/lib/cjs/Radio/index.d.ts +0 -45
  64. package/publish/lib/cjs/Radio/index.js +0 -1838
  65. package/publish/lib/cjs/RangeSlider/index.d.ts +0 -22
  66. package/publish/lib/cjs/RangeSlider/index.js +0 -2696
  67. package/publish/lib/cjs/Refresher/index.d.ts +0 -22
  68. package/publish/lib/cjs/Refresher/index.js +0 -564
  69. package/publish/lib/cjs/RootPortal/index.d.ts +0 -9
  70. package/publish/lib/cjs/RootPortal/index.js +0 -148
  71. package/publish/lib/cjs/ScrollReveal/index.d.ts +0 -21
  72. package/publish/lib/cjs/ScrollReveal/index.js +0 -401
  73. package/publish/lib/cjs/Scrollbar/index.d.ts +0 -17
  74. package/publish/lib/cjs/Scrollbar/index.js +0 -1107
  75. package/publish/lib/cjs/SearchBar/index.d.ts +0 -41
  76. package/publish/lib/cjs/SearchBar/index.js +0 -701
  77. package/publish/lib/cjs/Select/index.d.ts +0 -107
  78. package/publish/lib/cjs/Select/index.js +0 -6540
  79. package/publish/lib/cjs/ShowMoreLess/index.d.ts +0 -36
  80. package/publish/lib/cjs/ShowMoreLess/index.js +0 -387
  81. package/publish/lib/cjs/SplitterPanel/index.d.ts +0 -20
  82. package/publish/lib/cjs/SplitterPanel/index.js +0 -800
  83. package/publish/lib/cjs/Stepper/index.d.ts +0 -26
  84. package/publish/lib/cjs/Stepper/index.js +0 -568
  85. package/publish/lib/cjs/Switch/index.d.ts +0 -25
  86. package/publish/lib/cjs/Switch/index.js +0 -630
  87. package/publish/lib/cjs/Table/index.d.ts +0 -12
  88. package/publish/lib/cjs/Table/index.js +0 -2311
  89. package/publish/lib/cjs/Tabs/index.d.ts +0 -3
  90. package/publish/lib/cjs/Tabs/index.js +0 -771
  91. package/publish/lib/cjs/TagInput/index.d.ts +0 -37
  92. package/publish/lib/cjs/TagInput/index.js +0 -1227
  93. package/publish/lib/cjs/Textarea/index.d.ts +0 -50
  94. package/publish/lib/cjs/Textarea/index.js +0 -1795
  95. package/publish/lib/cjs/Toast/index.d.ts +0 -3
  96. package/publish/lib/cjs/Toast/index.js +0 -1345
  97. package/publish/lib/cjs/Tooltip/index.d.ts +0 -38
  98. package/publish/lib/cjs/Tooltip/index.js +0 -1778
  99. package/publish/lib/cjs/Tree/index.d.ts +0 -78
  100. package/publish/lib/cjs/Tree/index.js +0 -2330
  101. package/publish/lib/cjs/Utils/anim.d.ts +0 -11
  102. package/publish/lib/cjs/Utils/anim.js +0 -846
  103. package/publish/lib/cjs/Utils/bodyScrollLock.d.ts +0 -8
  104. package/publish/lib/cjs/Utils/bodyScrollLock.js +0 -311
  105. package/publish/lib/cjs/Utils/buffer.d.ts +0 -67
  106. package/publish/lib/cjs/Utils/buffer.js +0 -343
  107. package/publish/lib/cjs/Utils/cls.d.ts +0 -15
  108. package/publish/lib/cjs/Utils/cls.js +0 -124
  109. package/publish/lib/cjs/Utils/convert.d.ts +0 -25
  110. package/publish/lib/cjs/Utils/convert.js +0 -109
  111. package/publish/lib/cjs/Utils/date.d.ts +0 -227
  112. package/publish/lib/cjs/Utils/date.js +0 -587
  113. package/publish/lib/cjs/Utils/dom.d.ts +0 -13
  114. package/publish/lib/cjs/Utils/dom.js +0 -215
  115. package/publish/lib/cjs/Utils/easing.d.ts +0 -29
  116. package/publish/lib/cjs/Utils/easing.js +0 -221
  117. package/publish/lib/cjs/Utils/extract.d.ts +0 -66
  118. package/publish/lib/cjs/Utils/extract.js +0 -195
  119. package/publish/lib/cjs/Utils/format-string.d.ts +0 -65
  120. package/publish/lib/cjs/Utils/format-string.js +0 -167
  121. package/publish/lib/cjs/Utils/formdata.d.ts +0 -13
  122. package/publish/lib/cjs/Utils/formdata.js +0 -131
  123. package/publish/lib/cjs/Utils/getElementProperty.d.ts +0 -52
  124. package/publish/lib/cjs/Utils/getElementProperty.js +0 -189
  125. package/publish/lib/cjs/Utils/guid.d.ts +0 -7
  126. package/publish/lib/cjs/Utils/guid.js +0 -67
  127. package/publish/lib/cjs/Utils/initDefaultOptions.d.ts +0 -10
  128. package/publish/lib/cjs/Utils/initDefaultOptions.js +0 -607
  129. package/publish/lib/cjs/Utils/inputsCalculation.d.ts +0 -28
  130. package/publish/lib/cjs/Utils/inputsCalculation.js +0 -188
  131. package/publish/lib/cjs/Utils/math.d.ts +0 -77
  132. package/publish/lib/cjs/Utils/math.js +0 -305
  133. package/publish/lib/cjs/Utils/object.d.ts +0 -18
  134. package/publish/lib/cjs/Utils/object.js +0 -120
  135. package/publish/lib/cjs/Utils/os.d.ts +0 -2
  136. package/publish/lib/cjs/Utils/os.js +0 -104
  137. package/publish/lib/cjs/Utils/performance.d.ts +0 -3
  138. package/publish/lib/cjs/Utils/performance.js +0 -94
  139. package/publish/lib/cjs/Utils/sanitize.d.ts +0 -14
  140. package/publish/lib/cjs/Utils/sanitize.js +0 -87
  141. package/publish/lib/cjs/Utils/time.d.ts +0 -40
  142. package/publish/lib/cjs/Utils/time.js +0 -177
  143. package/publish/lib/cjs/Utils/tree.d.ts +0 -40
  144. package/publish/lib/cjs/Utils/tree.js +0 -195
  145. package/publish/lib/cjs/Utils/useAutosizeTextArea.d.ts +0 -10
  146. package/publish/lib/cjs/Utils/useAutosizeTextArea.js +0 -231
  147. package/publish/lib/cjs/Utils/useBoundedDrag.d.ts +0 -125
  148. package/publish/lib/cjs/Utils/useBoundedDrag.js +0 -380
  149. package/publish/lib/cjs/Utils/useClickOutside.d.ts +0 -33
  150. package/publish/lib/cjs/Utils/useClickOutside.js +0 -166
  151. package/publish/lib/cjs/Utils/useComId.d.ts +0 -6
  152. package/publish/lib/cjs/Utils/useComId.js +0 -114
  153. package/publish/lib/cjs/Utils/useDebounce.d.ts +0 -20
  154. package/publish/lib/cjs/Utils/useDebounce.js +0 -138
  155. package/publish/lib/cjs/Utils/useDragDropPosition.d.ts +0 -166
  156. package/publish/lib/cjs/Utils/useDragDropPosition.js +0 -453
  157. package/publish/lib/cjs/Utils/useDraggable.d.ts +0 -62
  158. package/publish/lib/cjs/Utils/useDraggable.js +0 -348
  159. package/publish/lib/cjs/Utils/useHistoryTracker.d.ts +0 -166
  160. package/publish/lib/cjs/Utils/useHistoryTracker.js +0 -649
  161. package/publish/lib/cjs/Utils/useInterval.d.ts +0 -5
  162. package/publish/lib/cjs/Utils/useInterval.js +0 -168
  163. package/publish/lib/cjs/Utils/useIsMobile.d.ts +0 -2
  164. package/publish/lib/cjs/Utils/useIsMobile.js +0 -232
  165. package/publish/lib/cjs/Utils/useKeyPress.d.ts +0 -44
  166. package/publish/lib/cjs/Utils/useKeyPress.js +0 -200
  167. package/publish/lib/cjs/Utils/useSessionStorageListener.d.ts +0 -2
  168. package/publish/lib/cjs/Utils/useSessionStorageListener.js +0 -157
  169. package/publish/lib/cjs/Utils/useStreamController.d.ts +0 -71
  170. package/publish/lib/cjs/Utils/useStreamController.js +0 -494
  171. package/publish/lib/cjs/Utils/useThrottle.d.ts +0 -2
  172. package/publish/lib/cjs/Utils/useThrottle.js +0 -136
  173. package/publish/lib/cjs/Utils/useWindowScroll.d.ts +0 -12
  174. package/publish/lib/cjs/Utils/useWindowScroll.js +0 -217
  175. package/publish/lib/cjs/Utils/validate.d.ts +0 -53
  176. package/publish/lib/cjs/Utils/validate.js +0 -536
  177. package/publish/lib/cjs/Utils/viewport.d.ts +0 -7
  178. package/publish/lib/cjs/Utils/viewport.js +0 -64
  179. package/publish/lib/cjs/index.d.ts +0 -49
  180. package/publish/lib/cjs/index.js +0 -50
  181. package/publish/lib/css/BackToTop/index.css +0 -34
  182. package/publish/lib/css/CascadingSelect/index.css +0 -245
  183. package/publish/lib/css/CascadingSelectE2E/index.css +0 -245
  184. package/publish/lib/css/Chatbox/index.css +0 -774
  185. package/publish/lib/css/ColorPicker/index.css +0 -58
  186. package/publish/lib/css/Date/index.css +0 -434
  187. package/publish/lib/css/DragDropList/index.css +0 -188
  188. package/publish/lib/css/DropdownMenu/index.css +0 -151
  189. package/publish/lib/css/EventCalendar/index.css +0 -300
  190. package/publish/lib/css/EventCalendarTimeline/index.css +0 -694
  191. package/publish/lib/css/HorizontalScrollContent/index.css +0 -70
  192. package/publish/lib/css/LiveSearch/index.css +0 -88
  193. package/publish/lib/css/MultilevelDropdownMenu/index.css +0 -38
  194. package/publish/lib/css/MultipleSelect/index.css +0 -313
  195. package/publish/lib/css/RangeSlider/index.css +0 -150
  196. package/publish/lib/css/Scrollbar/index.css +0 -176
  197. package/publish/lib/css/Select/index.css +0 -434
  198. package/publish/lib/css/ShowMoreLess/index.css +0 -23
  199. package/publish/lib/css/SplitterPanel/index.css +0 -63
  200. package/publish/lib/css/Stepper/index.css +0 -250
  201. package/publish/lib/css/Table/index.css +0 -584
  202. package/publish/lib/css/TagInput/index.css +0 -91
  203. package/publish/lib/css/Toast/index.css +0 -149
  204. package/publish/lib/css/Tooltip/index.css +0 -198
  205. package/publish/lib/css/Tree/index.css +0 -237
  206. package/publish/lib/esm/Accordion/Accordion.tsx +0 -185
  207. package/publish/lib/esm/Accordion/AccordionItem.tsx +0 -248
  208. package/publish/lib/esm/Accordion/index.tsx +0 -2
  209. package/publish/lib/esm/BackToTop/index.scss +0 -47
  210. package/publish/lib/esm/BackToTop/index.tsx +0 -177
  211. package/publish/lib/esm/CascadingSelect/Group.tsx +0 -83
  212. package/publish/lib/esm/CascadingSelect/index.scss +0 -330
  213. package/publish/lib/esm/CascadingSelect/index.tsx +0 -1397
  214. package/publish/lib/esm/CascadingSelectE2E/Group.tsx +0 -87
  215. package/publish/lib/esm/CascadingSelectE2E/index.scss +0 -333
  216. package/publish/lib/esm/CascadingSelectE2E/index.tsx +0 -1684
  217. package/publish/lib/esm/Chatbox/PureLoader.tsx +0 -47
  218. package/publish/lib/esm/Chatbox/TypingEffect.tsx +0 -56
  219. package/publish/lib/esm/Chatbox/index.scss +0 -966
  220. package/publish/lib/esm/Chatbox/index.tsx +0 -1742
  221. package/publish/lib/esm/Chatbox/utils/func.ts +0 -180
  222. package/publish/lib/esm/Checkbox/index.tsx +0 -206
  223. package/publish/lib/esm/ColorPicker/index.scss +0 -91
  224. package/publish/lib/esm/ColorPicker/index.tsx +0 -204
  225. package/publish/lib/esm/Date/Calendar.tsx +0 -723
  226. package/publish/lib/esm/Date/index.scss +0 -567
  227. package/publish/lib/esm/Date/index.tsx +0 -1797
  228. package/publish/lib/esm/Date/localization/en_US.js +0 -13
  229. package/publish/lib/esm/Date/localization/zh_CN.js +0 -12
  230. package/publish/lib/esm/DigitalClock/index.tsx +0 -74
  231. package/publish/lib/esm/DragDropList/index.scss +0 -245
  232. package/publish/lib/esm/DragDropList/index.tsx +0 -504
  233. package/publish/lib/esm/DropdownMenu/Option.tsx +0 -55
  234. package/publish/lib/esm/DropdownMenu/index.scss +0 -205
  235. package/publish/lib/esm/DropdownMenu/index.tsx +0 -378
  236. package/publish/lib/esm/DynamicFields/index.tsx +0 -409
  237. package/publish/lib/esm/EventCalendar/index.scss +0 -407
  238. package/publish/lib/esm/EventCalendar/index.tsx +0 -1005
  239. package/publish/lib/esm/EventCalendarTimeline/index.scss +0 -926
  240. package/publish/lib/esm/EventCalendarTimeline/index.tsx +0 -2686
  241. package/publish/lib/esm/File/index.tsx +0 -477
  242. package/publish/lib/esm/HorizontalScrollContent/index.scss +0 -87
  243. package/publish/lib/esm/HorizontalScrollContent/index.tsx +0 -171
  244. package/publish/lib/esm/Input/index.tsx +0 -641
  245. package/publish/lib/esm/LiveSearch/index.scss +0 -129
  246. package/publish/lib/esm/LiveSearch/index.tsx +0 -1058
  247. package/publish/lib/esm/MasonryLayout/index.tsx +0 -326
  248. package/publish/lib/esm/ModalDialog/index.tsx +0 -572
  249. package/publish/lib/esm/ModeSwitch/index.tsx +0 -82
  250. package/publish/lib/esm/MultilevelDropdownMenu/ItemList.tsx +0 -265
  251. package/publish/lib/esm/MultilevelDropdownMenu/index.scss +0 -79
  252. package/publish/lib/esm/MultilevelDropdownMenu/index.tsx +0 -77
  253. package/publish/lib/esm/MultipleCheckboxes/index.tsx +0 -849
  254. package/publish/lib/esm/MultipleSelect/index.scss +0 -398
  255. package/publish/lib/esm/MultipleSelect/index.tsx +0 -769
  256. package/publish/lib/esm/MultipleSelect/utils/func.ts +0 -63
  257. package/publish/lib/esm/NativeSelect/index.tsx +0 -396
  258. package/publish/lib/esm/NativeSelect/utils/func.ts +0 -51
  259. package/publish/lib/esm/NumberInput/index.tsx +0 -425
  260. package/publish/lib/esm/Pagination/index.tsx +0 -286
  261. package/publish/lib/esm/Pagination/pagination-navigators.tsx +0 -60
  262. package/publish/lib/esm/Radio/index.tsx +0 -694
  263. package/publish/lib/esm/RangeSlider/index.scss +0 -186
  264. package/publish/lib/esm/RangeSlider/index.tsx +0 -241
  265. package/publish/lib/esm/Refresher/index.tsx +0 -121
  266. package/publish/lib/esm/RootPortal/index.tsx +0 -59
  267. package/publish/lib/esm/ScrollReveal/index.tsx +0 -148
  268. package/publish/lib/esm/Scrollbar/index.scss +0 -221
  269. package/publish/lib/esm/Scrollbar/index.tsx +0 -561
  270. package/publish/lib/esm/SearchBar/index.tsx +0 -252
  271. package/publish/lib/esm/Select/index.scss +0 -639
  272. package/publish/lib/esm/Select/index.tsx +0 -3104
  273. package/publish/lib/esm/Select/utils/func.ts +0 -98
  274. package/publish/lib/esm/ShowMoreLess/index.scss +0 -27
  275. package/publish/lib/esm/ShowMoreLess/index.tsx +0 -145
  276. package/publish/lib/esm/SplitterPanel/index.scss +0 -82
  277. package/publish/lib/esm/SplitterPanel/index.tsx +0 -174
  278. package/publish/lib/esm/Stepper/index.scss +0 -315
  279. package/publish/lib/esm/Stepper/index.tsx +0 -325
  280. package/publish/lib/esm/Switch/index.tsx +0 -149
  281. package/publish/lib/esm/Table/Table.tsx +0 -351
  282. package/publish/lib/esm/Table/TableBody.tsx +0 -41
  283. package/publish/lib/esm/Table/TableCaption.tsx +0 -34
  284. package/publish/lib/esm/Table/TableCell.tsx +0 -126
  285. package/publish/lib/esm/Table/TableColgroup.tsx +0 -38
  286. package/publish/lib/esm/Table/TableContext.tsx +0 -26
  287. package/publish/lib/esm/Table/TableFoot.tsx +0 -28
  288. package/publish/lib/esm/Table/TableHead.tsx +0 -28
  289. package/publish/lib/esm/Table/TableRow.tsx +0 -76
  290. package/publish/lib/esm/Table/index.scss +0 -418
  291. package/publish/lib/esm/Table/index.tsx +0 -14
  292. package/publish/lib/esm/Table/utils/DragHandleSprite.tsx +0 -46
  293. package/publish/lib/esm/Table/utils/SortSprite.tsx +0 -63
  294. package/publish/lib/esm/Table/utils/TableFilter.tsx +0 -56
  295. package/publish/lib/esm/Table/utils/ToggleSelection.tsx +0 -255
  296. package/publish/lib/esm/Table/utils/func.ts +0 -182
  297. package/publish/lib/esm/Table/utils/hooks/useTableDraggable.tsx +0 -342
  298. package/publish/lib/esm/Table/utils/hooks/useTableKeyPress.tsx +0 -255
  299. package/publish/lib/esm/Table/utils/hooks/useTableResponsive.tsx +0 -92
  300. package/publish/lib/esm/Table/utils/hooks/useTableSort.tsx +0 -187
  301. package/publish/lib/esm/Tabs/TabList.tsx +0 -50
  302. package/publish/lib/esm/Tabs/TabPanel.tsx +0 -44
  303. package/publish/lib/esm/Tabs/Tabs.tsx +0 -282
  304. package/publish/lib/esm/Tabs/index.tsx +0 -3
  305. package/publish/lib/esm/TagInput/index.scss +0 -126
  306. package/publish/lib/esm/TagInput/index.tsx +0 -379
  307. package/publish/lib/esm/Textarea/index.tsx +0 -621
  308. package/publish/lib/esm/Toast/Item.tsx +0 -165
  309. package/publish/lib/esm/Toast/Toast.tsx +0 -391
  310. package/publish/lib/esm/Toast/ToastContext.tsx +0 -104
  311. package/publish/lib/esm/Toast/__toast.vanilla.js +0 -422
  312. package/publish/lib/esm/Toast/index.scss +0 -197
  313. package/publish/lib/esm/Toast/index.tsx +0 -3
  314. package/publish/lib/esm/Toast/types.ts +0 -60
  315. package/publish/lib/esm/Toast/useToast.tsx +0 -72
  316. package/publish/lib/esm/Tooltip/index.scss +0 -272
  317. package/publish/lib/esm/Tooltip/index.tsx +0 -416
  318. package/publish/lib/esm/Tree/TreeList.tsx +0 -600
  319. package/publish/lib/esm/Tree/index.scss +0 -384
  320. package/publish/lib/esm/Tree/index.tsx +0 -661
  321. package/publish/lib/esm/Tree/init-height.tsx +0 -40
  322. package/publish/lib/esm/Tree/utils/func.ts +0 -15
  323. package/publish/lib/esm/Utils/hooks/useAutosizeTextArea.tsx +0 -131
  324. package/publish/lib/esm/Utils/hooks/useBoundedDrag.tsx +0 -301
  325. package/publish/lib/esm/Utils/hooks/useClickOutside.tsx +0 -69
  326. package/publish/lib/esm/Utils/hooks/useComId.tsx +0 -13
  327. package/publish/lib/esm/Utils/hooks/useDebounce.tsx +0 -40
  328. package/publish/lib/esm/Utils/hooks/useDragDropPosition.tsx +0 -417
  329. package/publish/lib/esm/Utils/hooks/useDraggable.tsx +0 -265
  330. package/publish/lib/esm/Utils/hooks/useHistoryTracker.tsx +0 -554
  331. package/publish/lib/esm/Utils/hooks/useInterval.tsx +0 -74
  332. package/publish/lib/esm/Utils/hooks/useIsMobile.tsx +0 -139
  333. package/publish/lib/esm/Utils/hooks/useKeyPress.tsx +0 -104
  334. package/publish/lib/esm/Utils/hooks/useSessionStorageListener.tsx +0 -45
  335. package/publish/lib/esm/Utils/hooks/useStreamController.tsx +0 -277
  336. package/publish/lib/esm/Utils/hooks/useThrottle.tsx +0 -39
  337. package/publish/lib/esm/Utils/hooks/useWindowScroll.tsx +0 -83
  338. package/publish/lib/esm/Utils/libs/anim.ts +0 -96
  339. package/publish/lib/esm/Utils/libs/buffer.ts +0 -262
  340. package/publish/lib/esm/Utils/libs/cls.ts +0 -64
  341. package/publish/lib/esm/Utils/libs/convert.ts +0 -59
  342. package/publish/lib/esm/Utils/libs/date.ts +0 -598
  343. package/publish/lib/esm/Utils/libs/dom.ts +0 -150
  344. package/publish/lib/esm/Utils/libs/easing.ts +0 -201
  345. package/publish/lib/esm/Utils/libs/extract.ts +0 -160
  346. package/publish/lib/esm/Utils/libs/format-string.ts +0 -116
  347. package/publish/lib/esm/Utils/libs/formdata.ts +0 -93
  348. package/publish/lib/esm/Utils/libs/getElementProperty.ts +0 -150
  349. package/publish/lib/esm/Utils/libs/guid.ts +0 -16
  350. package/publish/lib/esm/Utils/libs/initDefaultOptions.ts +0 -43
  351. package/publish/lib/esm/Utils/libs/inputsCalculation.ts +0 -160
  352. package/publish/lib/esm/Utils/libs/math.ts +0 -276
  353. package/publish/lib/esm/Utils/libs/object.ts +0 -68
  354. package/publish/lib/esm/Utils/libs/os.ts +0 -63
  355. package/publish/lib/esm/Utils/libs/performance.ts +0 -47
  356. package/publish/lib/esm/Utils/libs/sanitize.ts +0 -55
  357. package/publish/lib/esm/Utils/libs/time.ts +0 -139
  358. package/publish/lib/esm/Utils/libs/tree.ts +0 -119
  359. package/publish/lib/esm/Utils/libs/validate.ts +0 -434
  360. package/publish/lib/esm/Utils/libs/viewport.ts +0 -20
  361. package/publish/lib/esm/Utils/plugins/bodyScrollLock.ts +0 -286
  362. package/publish/lib/esm/index.js +0 -47
  363. package/publish/package.json +0 -1
  364. /package/{publish/Accordion → Accordion}/index.d.ts +0 -0
  365. /package/{publish/Accordion → Accordion}/index.js +0 -0
  366. /package/{publish/BackToTop → BackToTop}/index.css +0 -0
  367. /package/{publish/BackToTop → BackToTop}/index.d.ts +0 -0
  368. /package/{publish/BackToTop → BackToTop}/index.js +0 -0
  369. /package/{publish/CascadingSelect → CascadingSelect}/index.css +0 -0
  370. /package/{publish/CascadingSelect → CascadingSelect}/index.d.ts +0 -0
  371. /package/{publish/CascadingSelect → CascadingSelect}/index.js +0 -0
  372. /package/{publish/CascadingSelectE2E → CascadingSelectE2E}/index.css +0 -0
  373. /package/{publish/CascadingSelectE2E → CascadingSelectE2E}/index.d.ts +0 -0
  374. /package/{publish/CascadingSelectE2E → CascadingSelectE2E}/index.js +0 -0
  375. /package/{publish/Chatbox → Chatbox}/index.css +0 -0
  376. /package/{publish/Chatbox → Chatbox}/index.d.ts +0 -0
  377. /package/{publish/Chatbox → Chatbox}/index.js +0 -0
  378. /package/{publish/Checkbox → Checkbox}/index.d.ts +0 -0
  379. /package/{publish/Checkbox → Checkbox}/index.js +0 -0
  380. /package/{publish/ColorPicker → ColorPicker}/index.css +0 -0
  381. /package/{publish/ColorPicker → ColorPicker}/index.d.ts +0 -0
  382. /package/{publish/ColorPicker → ColorPicker}/index.js +0 -0
  383. /package/{publish/Date → Date}/index.css +0 -0
  384. /package/{publish/Date → Date}/index.d.ts +0 -0
  385. /package/{publish/Date → Date}/index.js +0 -0
  386. /package/{publish/DigitalClock → DigitalClock}/index.d.ts +0 -0
  387. /package/{publish/DigitalClock → DigitalClock}/index.js +0 -0
  388. /package/{publish/DragDropList → DragDropList}/index.css +0 -0
  389. /package/{publish/DragDropList → DragDropList}/index.d.ts +0 -0
  390. /package/{publish/DragDropList → DragDropList}/index.js +0 -0
  391. /package/{publish/DropdownMenu → DropdownMenu}/index.css +0 -0
  392. /package/{publish/DropdownMenu → DropdownMenu}/index.d.ts +0 -0
  393. /package/{publish/DropdownMenu → DropdownMenu}/index.js +0 -0
  394. /package/{publish/DynamicFields → DynamicFields}/index.d.ts +0 -0
  395. /package/{publish/DynamicFields → DynamicFields}/index.js +0 -0
  396. /package/{publish/EventCalendar → EventCalendar}/index.css +0 -0
  397. /package/{publish/EventCalendar → EventCalendar}/index.d.ts +0 -0
  398. /package/{publish/EventCalendar → EventCalendar}/index.js +0 -0
  399. /package/{publish/EventCalendarTimeline → EventCalendarTimeline}/index.css +0 -0
  400. /package/{publish/EventCalendarTimeline → EventCalendarTimeline}/index.d.ts +0 -0
  401. /package/{publish/EventCalendarTimeline → EventCalendarTimeline}/index.js +0 -0
  402. /package/{publish/File → File}/index.d.ts +0 -0
  403. /package/{publish/File → File}/index.js +0 -0
  404. /package/{publish/HorizontalScrollContent → HorizontalScrollContent}/index.css +0 -0
  405. /package/{publish/HorizontalScrollContent → HorizontalScrollContent}/index.d.ts +0 -0
  406. /package/{publish/HorizontalScrollContent → HorizontalScrollContent}/index.js +0 -0
  407. /package/{publish/Input → Input}/index.d.ts +0 -0
  408. /package/{publish/Input → Input}/index.js +0 -0
  409. /package/{publish/LiveSearch → LiveSearch}/index.css +0 -0
  410. /package/{publish/LiveSearch → LiveSearch}/index.d.ts +0 -0
  411. /package/{publish/LiveSearch → LiveSearch}/index.js +0 -0
  412. /package/{publish/MasonryLayout → MasonryLayout}/index.d.ts +0 -0
  413. /package/{publish/MasonryLayout → MasonryLayout}/index.js +0 -0
  414. /package/{publish/ModalDialog → ModalDialog}/index.d.ts +0 -0
  415. /package/{publish/ModalDialog → ModalDialog}/index.js +0 -0
  416. /package/{publish/ModeSwitch → ModeSwitch}/index.d.ts +0 -0
  417. /package/{publish/ModeSwitch → ModeSwitch}/index.js +0 -0
  418. /package/{publish/MultilevelDropdownMenu → MultilevelDropdownMenu}/index.css +0 -0
  419. /package/{publish/MultilevelDropdownMenu → MultilevelDropdownMenu}/index.d.ts +0 -0
  420. /package/{publish/MultilevelDropdownMenu → MultilevelDropdownMenu}/index.js +0 -0
  421. /package/{publish/MultipleCheckboxes → MultipleCheckboxes}/index.d.ts +0 -0
  422. /package/{publish/MultipleCheckboxes → MultipleCheckboxes}/index.js +0 -0
  423. /package/{publish/MultipleSelect → MultipleSelect}/index.css +0 -0
  424. /package/{publish/MultipleSelect → MultipleSelect}/index.d.ts +0 -0
  425. /package/{publish/MultipleSelect → MultipleSelect}/index.js +0 -0
  426. /package/{publish/NativeSelect → NativeSelect}/index.d.ts +0 -0
  427. /package/{publish/NativeSelect → NativeSelect}/index.js +0 -0
  428. /package/{publish/NumberInput → NumberInput}/index.d.ts +0 -0
  429. /package/{publish/NumberInput → NumberInput}/index.js +0 -0
  430. /package/{publish/Pagination → Pagination}/index.d.ts +0 -0
  431. /package/{publish/Pagination → Pagination}/index.js +0 -0
  432. /package/{publish/Radio → Radio}/index.d.ts +0 -0
  433. /package/{publish/Radio → Radio}/index.js +0 -0
  434. /package/{publish/RangeSlider → RangeSlider}/index.css +0 -0
  435. /package/{publish/RangeSlider → RangeSlider}/index.d.ts +0 -0
  436. /package/{publish/RangeSlider → RangeSlider}/index.js +0 -0
  437. /package/{publish/Refresher → Refresher}/index.d.ts +0 -0
  438. /package/{publish/Refresher → Refresher}/index.js +0 -0
  439. /package/{publish/RootPortal → RootPortal}/index.d.ts +0 -0
  440. /package/{publish/RootPortal → RootPortal}/index.js +0 -0
  441. /package/{publish/ScrollReveal → ScrollReveal}/index.d.ts +0 -0
  442. /package/{publish/ScrollReveal → ScrollReveal}/index.js +0 -0
  443. /package/{publish/Scrollbar → Scrollbar}/index.css +0 -0
  444. /package/{publish/Scrollbar → Scrollbar}/index.d.ts +0 -0
  445. /package/{publish/Scrollbar → Scrollbar}/index.js +0 -0
  446. /package/{publish/SearchBar → SearchBar}/index.d.ts +0 -0
  447. /package/{publish/SearchBar → SearchBar}/index.js +0 -0
  448. /package/{publish/Select → Select}/index.css +0 -0
  449. /package/{publish/Select → Select}/index.d.ts +0 -0
  450. /package/{publish/Select → Select}/index.js +0 -0
  451. /package/{publish/ShowMoreLess → ShowMoreLess}/index.css +0 -0
  452. /package/{publish/ShowMoreLess → ShowMoreLess}/index.d.ts +0 -0
  453. /package/{publish/ShowMoreLess → ShowMoreLess}/index.js +0 -0
  454. /package/{publish/SplitterPanel → SplitterPanel}/index.css +0 -0
  455. /package/{publish/SplitterPanel → SplitterPanel}/index.d.ts +0 -0
  456. /package/{publish/SplitterPanel → SplitterPanel}/index.js +0 -0
  457. /package/{publish/Stepper → Stepper}/index.css +0 -0
  458. /package/{publish/Stepper → Stepper}/index.d.ts +0 -0
  459. /package/{publish/Stepper → Stepper}/index.js +0 -0
  460. /package/{publish/Switch → Switch}/index.d.ts +0 -0
  461. /package/{publish/Switch → Switch}/index.js +0 -0
  462. /package/{publish/Table → Table}/index.css +0 -0
  463. /package/{publish/Table → Table}/index.d.ts +0 -0
  464. /package/{publish/Table → Table}/index.js +0 -0
  465. /package/{publish/Tabs → Tabs}/index.d.ts +0 -0
  466. /package/{publish/Tabs → Tabs}/index.js +0 -0
  467. /package/{publish/TagInput → TagInput}/index.css +0 -0
  468. /package/{publish/TagInput → TagInput}/index.d.ts +0 -0
  469. /package/{publish/TagInput → TagInput}/index.js +0 -0
  470. /package/{publish/Textarea → Textarea}/index.d.ts +0 -0
  471. /package/{publish/Textarea → Textarea}/index.js +0 -0
  472. /package/{publish/Toast → Toast}/index.css +0 -0
  473. /package/{publish/Toast → Toast}/index.d.ts +0 -0
  474. /package/{publish/Toast → Toast}/index.js +0 -0
  475. /package/{publish/Tooltip → Tooltip}/index.css +0 -0
  476. /package/{publish/Tooltip → Tooltip}/index.d.ts +0 -0
  477. /package/{publish/Tooltip → Tooltip}/index.js +0 -0
  478. /package/{publish/Tree → Tree}/index.css +0 -0
  479. /package/{publish/Tree → Tree}/index.d.ts +0 -0
  480. /package/{publish/Tree → Tree}/index.js +0 -0
  481. /package/{publish/Utils → Utils}/anim.d.ts +0 -0
  482. /package/{publish/Utils → Utils}/anim.js +0 -0
  483. /package/{publish/Utils → Utils}/bodyScrollLock.d.ts +0 -0
  484. /package/{publish/Utils → Utils}/bodyScrollLock.js +0 -0
  485. /package/{publish/Utils → Utils}/buffer.d.ts +0 -0
  486. /package/{publish/Utils → Utils}/buffer.js +0 -0
  487. /package/{publish/Utils → Utils}/cls.d.ts +0 -0
  488. /package/{publish/Utils → Utils}/cls.js +0 -0
  489. /package/{publish/Utils → Utils}/convert.d.ts +0 -0
  490. /package/{publish/Utils → Utils}/convert.js +0 -0
  491. /package/{publish/Utils → Utils}/date.d.ts +0 -0
  492. /package/{publish/Utils → Utils}/date.js +0 -0
  493. /package/{publish/Utils → Utils}/dom.d.ts +0 -0
  494. /package/{publish/Utils → Utils}/dom.js +0 -0
  495. /package/{publish/Utils → Utils}/easing.d.ts +0 -0
  496. /package/{publish/Utils → Utils}/easing.js +0 -0
  497. /package/{publish/Utils → Utils}/extract.d.ts +0 -0
  498. /package/{publish/Utils → Utils}/extract.js +0 -0
  499. /package/{publish/Utils → Utils}/format-string.d.ts +0 -0
  500. /package/{publish/Utils → Utils}/format-string.js +0 -0
  501. /package/{publish/Utils → Utils}/formdata.d.ts +0 -0
  502. /package/{publish/Utils → Utils}/formdata.js +0 -0
  503. /package/{publish/Utils → Utils}/getElementProperty.d.ts +0 -0
  504. /package/{publish/Utils → Utils}/getElementProperty.js +0 -0
  505. /package/{publish/Utils → Utils}/guid.d.ts +0 -0
  506. /package/{publish/Utils → Utils}/guid.js +0 -0
  507. /package/{publish/Utils → Utils}/initDefaultOptions.d.ts +0 -0
  508. /package/{publish/Utils → Utils}/initDefaultOptions.js +0 -0
  509. /package/{publish/Utils → Utils}/inputsCalculation.d.ts +0 -0
  510. /package/{publish/Utils → Utils}/inputsCalculation.js +0 -0
  511. /package/{publish/Utils → Utils}/math.d.ts +0 -0
  512. /package/{publish/Utils → Utils}/math.js +0 -0
  513. /package/{publish/Utils → Utils}/object.d.ts +0 -0
  514. /package/{publish/Utils → Utils}/object.js +0 -0
  515. /package/{publish/Utils → Utils}/os.d.ts +0 -0
  516. /package/{publish/Utils → Utils}/os.js +0 -0
  517. /package/{publish/Utils → Utils}/performance.d.ts +0 -0
  518. /package/{publish/Utils → Utils}/performance.js +0 -0
  519. /package/{publish/Utils → Utils}/sanitize.d.ts +0 -0
  520. /package/{publish/Utils → Utils}/sanitize.js +0 -0
  521. /package/{publish/Utils → Utils}/time.d.ts +0 -0
  522. /package/{publish/Utils → Utils}/time.js +0 -0
  523. /package/{publish/Utils → Utils}/tree.d.ts +0 -0
  524. /package/{publish/Utils → Utils}/tree.js +0 -0
  525. /package/{publish/Utils → Utils}/useAutosizeTextArea.d.ts +0 -0
  526. /package/{publish/Utils → Utils}/useAutosizeTextArea.js +0 -0
  527. /package/{publish/Utils → Utils}/useBoundedDrag.d.ts +0 -0
  528. /package/{publish/Utils → Utils}/useBoundedDrag.js +0 -0
  529. /package/{publish/Utils → Utils}/useClickOutside.d.ts +0 -0
  530. /package/{publish/Utils → Utils}/useClickOutside.js +0 -0
  531. /package/{publish/Utils → Utils}/useComId.d.ts +0 -0
  532. /package/{publish/Utils → Utils}/useComId.js +0 -0
  533. /package/{publish/Utils → Utils}/useDebounce.d.ts +0 -0
  534. /package/{publish/Utils → Utils}/useDebounce.js +0 -0
  535. /package/{publish/Utils → Utils}/useDragDropPosition.d.ts +0 -0
  536. /package/{publish/Utils → Utils}/useDragDropPosition.js +0 -0
  537. /package/{publish/Utils → Utils}/useDraggable.d.ts +0 -0
  538. /package/{publish/Utils → Utils}/useDraggable.js +0 -0
  539. /package/{publish/Utils → Utils}/useHistoryTracker.d.ts +0 -0
  540. /package/{publish/Utils → Utils}/useHistoryTracker.js +0 -0
  541. /package/{publish/Utils → Utils}/useInterval.d.ts +0 -0
  542. /package/{publish/Utils → Utils}/useInterval.js +0 -0
  543. /package/{publish/Utils → Utils}/useIsMobile.d.ts +0 -0
  544. /package/{publish/Utils → Utils}/useIsMobile.js +0 -0
  545. /package/{publish/Utils → Utils}/useKeyPress.d.ts +0 -0
  546. /package/{publish/Utils → Utils}/useKeyPress.js +0 -0
  547. /package/{publish/Utils → Utils}/useSessionStorageListener.d.ts +0 -0
  548. /package/{publish/Utils → Utils}/useSessionStorageListener.js +0 -0
  549. /package/{publish/Utils → Utils}/useStreamController.d.ts +0 -0
  550. /package/{publish/Utils → Utils}/useStreamController.js +0 -0
  551. /package/{publish/Utils → Utils}/useThrottle.d.ts +0 -0
  552. /package/{publish/Utils → Utils}/useThrottle.js +0 -0
  553. /package/{publish/Utils → Utils}/useWindowScroll.d.ts +0 -0
  554. /package/{publish/Utils → Utils}/useWindowScroll.js +0 -0
  555. /package/{publish/Utils → Utils}/validate.d.ts +0 -0
  556. /package/{publish/Utils → Utils}/validate.js +0 -0
  557. /package/{publish/Utils → Utils}/viewport.d.ts +0 -0
  558. /package/{publish/Utils → Utils}/viewport.js +0 -0
  559. /package/{publish/all.d.ts → all.d.ts} +0 -0
  560. /package/{publish/all.js → all.js} +0 -0
@@ -1,3988 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("react"), require("react-dom"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["react", "react-dom"], factory);
6
- else if(typeof exports === 'object')
7
- exports["RPB"] = factory(require("react"), require("react-dom"));
8
- else
9
- root["RPB"] = factory(root["React"], root["ReactDOM"]);
10
- })(this, (__WEBPACK_EXTERNAL_MODULE__787__, __WEBPACK_EXTERNAL_MODULE__156__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ var __webpack_modules__ = ({
13
-
14
- /***/ 909:
15
- /***/ (function(module, exports, __webpack_require__) {
16
-
17
- /* module decorator */ module = __webpack_require__.nmd(module);
18
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;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); }
19
- (function webpackUniversalModuleDefinition(root, factory) {
20
- if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787), __webpack_require__(156));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787), __webpack_require__(156)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
21
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
22
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
23
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
24
- })(this, function (__WEBPACK_EXTERNAL_MODULE__787__, __WEBPACK_EXTERNAL_MODULE__156__) {
25
- return (/******/function () {
26
- // webpackBootstrap
27
- /******/
28
- "use strict";
29
-
30
- /******/
31
- var __webpack_modules__ = {
32
- /***/787: /***/function _(module) {
33
- module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
34
-
35
- /***/
36
- },
37
-
38
- /***/156: /***/function _(module) {
39
- module.exports = __WEBPACK_EXTERNAL_MODULE__156__;
40
-
41
- /***/
42
- }
43
-
44
- /******/
45
- };
46
- /************************************************************************/
47
- /******/ // The module cache
48
- /******/
49
- var __webpack_module_cache__ = {};
50
- /******/
51
- /******/ // The require function
52
- /******/
53
- function __nested_webpack_require_1708__(moduleId) {
54
- /******/ // Check if module is in cache
55
- /******/var cachedModule = __webpack_module_cache__[moduleId];
56
- /******/
57
- if (cachedModule !== undefined) {
58
- /******/return cachedModule.exports;
59
- /******/
60
- }
61
- /******/ // Create a new module (and put it into the cache)
62
- /******/
63
- var module = __webpack_module_cache__[moduleId] = {
64
- /******/ // no module.id needed
65
- /******/ // no module.loaded needed
66
- /******/exports: {}
67
- /******/
68
- };
69
- /******/
70
- /******/ // Execute the module function
71
- /******/
72
- __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1708__);
73
- /******/
74
- /******/ // Return the exports of the module
75
- /******/
76
- return module.exports;
77
- /******/
78
- }
79
- /******/
80
- /************************************************************************/
81
- /******/ /* webpack/runtime/compat get default export */
82
- /******/
83
- (function () {
84
- /******/ // getDefaultExport function for compatibility with non-harmony modules
85
- /******/__nested_webpack_require_1708__.n = function (module) {
86
- /******/var getter = module && module.__esModule ? /******/function () {
87
- return module['default'];
88
- } : /******/function () {
89
- return module;
90
- };
91
- /******/
92
- __nested_webpack_require_1708__.d(getter, {
93
- a: getter
94
- });
95
- /******/
96
- return getter;
97
- /******/
98
- };
99
- /******/
100
- })();
101
- /******/
102
- /******/ /* webpack/runtime/define property getters */
103
- /******/
104
- (function () {
105
- /******/ // define getter functions for harmony exports
106
- /******/__nested_webpack_require_1708__.d = function (exports, definition) {
107
- /******/for (var key in definition) {
108
- /******/if (__nested_webpack_require_1708__.o(definition, key) && !__nested_webpack_require_1708__.o(exports, key)) {
109
- /******/Object.defineProperty(exports, key, {
110
- enumerable: true,
111
- get: definition[key]
112
- });
113
- /******/
114
- }
115
- /******/
116
- }
117
- /******/
118
- };
119
- /******/
120
- })();
121
- /******/
122
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
123
- /******/
124
- (function () {
125
- /******/__nested_webpack_require_1708__.o = function (obj, prop) {
126
- return Object.prototype.hasOwnProperty.call(obj, prop);
127
- };
128
- /******/
129
- })();
130
- /******/
131
- /******/ /* webpack/runtime/make namespace object */
132
- /******/
133
- (function () {
134
- /******/ // define __esModule on exports
135
- /******/__nested_webpack_require_1708__.r = function (exports) {
136
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
137
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
138
- value: 'Module'
139
- });
140
- /******/
141
- }
142
- /******/
143
- Object.defineProperty(exports, '__esModule', {
144
- value: true
145
- });
146
- /******/
147
- };
148
- /******/
149
- })();
150
- /******/
151
- /************************************************************************/
152
- var __webpack_exports__ = {};
153
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
154
- (function () {
155
- __nested_webpack_require_1708__.r(__webpack_exports__);
156
- /* harmony export */
157
- __nested_webpack_require_1708__.d(__webpack_exports__, {
158
- /* harmony export */"default": function _default() {
159
- return __WEBPACK_DEFAULT_EXPORT__;
160
- }
161
- /* harmony export */
162
- });
163
- /* harmony import */
164
- var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1708__(787);
165
- /* harmony import */
166
- var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1708__.n(react__WEBPACK_IMPORTED_MODULE_0__);
167
- /* harmony import */
168
- var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1708__(156);
169
- /* harmony import */
170
- var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1708__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
171
- var RootPortal = function RootPortal(props) {
172
- var containerClassName = props.containerClassName,
173
- show = props.show,
174
- children = props.children,
175
- _props$usePortal = props.usePortal,
176
- usePortal = _props$usePortal === void 0 ? true : _props$usePortal;
177
- var containerRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
178
-
179
- // Move HTML templates to tag end body </body>
180
- // render() don't use "Fragment", in order to avoid error "Failed to execute 'insertBefore' on 'Node'"
181
- // prevent "transform", "filter", "perspective" attribute destruction fixed viewport orientation
182
- // ###
183
- // ###
184
- // Use `containerRef.current` to ensure the correctness of the nextjs framework. It may report an error document as undefined
185
-
186
- (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
187
- if (usePortal) {
188
- containerRef.current = document.createElement('div');
189
- containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
190
- document.body.appendChild(containerRef.current);
191
- }
192
- return function () {
193
- if (usePortal && containerRef.current) {
194
- containerRef.current.remove();
195
- }
196
- };
197
- }, [usePortal]);
198
- if (!usePortal) {
199
- return show ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, children) : null;
200
- }
201
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, containerRef.current && show && /*#__PURE__*/(0, react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, containerRef.current));
202
- };
203
- /* harmony default export */
204
- var __WEBPACK_DEFAULT_EXPORT__ = RootPortal;
205
- })();
206
-
207
- /******/
208
- return __webpack_exports__;
209
- /******/
210
- }()
211
- );
212
- });
213
-
214
- /***/ }),
215
-
216
- /***/ 188:
217
- /***/ (function(module, exports, __webpack_require__) {
218
-
219
- /* module decorator */ module = __webpack_require__.nmd(module);
220
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "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; }, _typeof2(obj); }
221
- (function webpackUniversalModuleDefinition(root, factory) {
222
- if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
223
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
224
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
225
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
226
- })(this, function () {
227
- return (/******/function () {
228
- // webpackBootstrap
229
- /******/
230
- "use strict";
231
-
232
- /******/ // The require scope
233
- /******/
234
- var __nested_webpack_require_993__ = {};
235
- /******/
236
- /************************************************************************/
237
- /******/ /* webpack/runtime/define property getters */
238
- /******/
239
- (function () {
240
- /******/ // define getter functions for harmony exports
241
- /******/__nested_webpack_require_993__.d = function (exports, definition) {
242
- /******/for (var key in definition) {
243
- /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
244
- /******/Object.defineProperty(exports, key, {
245
- enumerable: true,
246
- get: definition[key]
247
- });
248
- /******/
249
- }
250
- /******/
251
- }
252
- /******/
253
- };
254
- /******/
255
- })();
256
- /******/
257
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
258
- /******/
259
- (function () {
260
- /******/__nested_webpack_require_993__.o = function (obj, prop) {
261
- return Object.prototype.hasOwnProperty.call(obj, prop);
262
- };
263
- /******/
264
- })();
265
- /******/
266
- /******/ /* webpack/runtime/make namespace object */
267
- /******/
268
- (function () {
269
- /******/ // define __esModule on exports
270
- /******/__nested_webpack_require_993__.r = function (exports) {
271
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
272
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
273
- value: 'Module'
274
- });
275
- /******/
276
- }
277
- /******/
278
- Object.defineProperty(exports, '__esModule', {
279
- value: true
280
- });
281
- /******/
282
- };
283
- /******/
284
- })();
285
- /******/
286
- /************************************************************************/
287
- var __webpack_exports__ = {};
288
- __nested_webpack_require_993__.r(__webpack_exports__);
289
- /* harmony export */
290
- __nested_webpack_require_993__.d(__webpack_exports__, {
291
- /* harmony export */"clsWrite": function clsWrite() {
292
- return (/* binding */_clsWrite
293
- );
294
- },
295
- /* harmony export */"combinedCls": function combinedCls() {
296
- return (/* binding */_combinedCls
297
- );
298
- }
299
- /* harmony export */
300
- });
301
- function _slicedToArray(arr, i) {
302
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
303
- }
304
- function _nonIterableRest() {
305
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
306
- }
307
- function _unsupportedIterableToArray(o, minLen) {
308
- if (!o) return;
309
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
310
- var n = Object.prototype.toString.call(o).slice(8, -1);
311
- if (n === "Object" && o.constructor) n = o.constructor.name;
312
- if (n === "Map" || n === "Set") return Array.from(o);
313
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
314
- }
315
- function _arrayLikeToArray(arr, len) {
316
- if (len == null || len > arr.length) len = arr.length;
317
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
318
- return arr2;
319
- }
320
- function _iterableToArrayLimit(arr, i) {
321
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
322
- if (null != _i) {
323
- var _s,
324
- _e,
325
- _x,
326
- _r,
327
- _arr = [],
328
- _n = !0,
329
- _d = !1;
330
- try {
331
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
332
- if (Object(_i) !== _i) return;
333
- _n = !1;
334
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
335
- } catch (err) {
336
- _d = !0, _e = err;
337
- } finally {
338
- try {
339
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
340
- } finally {
341
- if (_d) throw _e;
342
- }
343
- }
344
- return _arr;
345
- }
346
- }
347
- function _arrayWithHoles(arr) {
348
- if (Array.isArray(arr)) return arr;
349
- }
350
- function _typeof(obj) {
351
- "@babel/helpers - typeof";
352
-
353
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
354
- return typeof obj;
355
- } : function (obj) {
356
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
357
- }, _typeof(obj);
358
- }
359
- /**
360
- * Output of class name
361
- * @param {*} s - Any
362
- * @param {String} defaultCls - Default string
363
- * @param {?*} targetCls - Any
364
- * @returns {*}
365
- */
366
- function _clsWrite(s, defaultCls) {
367
- var targetCls = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
368
- return s || s === '' ? typeof targetCls === 'undefined' ? s : targetCls : defaultCls;
369
- }
370
-
371
- /**
372
- * Combined classnames
373
- * @param {*} args
374
- * @returns {String|undefined}
375
- */
376
- /* Usage:
377
-
378
- console.log(combinedCls('a-1', 'a-2', 'a-3', {
379
- 'p-1': null,
380
- 'p-2': undefined,
381
- 'p-3': true,
382
- 'p-4': false,
383
- 'p-5': 'kkk',
384
- 'p-6': 0,
385
- 'p-7': 1,
386
- 'p-8': '',
387
- undefined
388
- })); // a-1 a-2 a-3 p-3 p-5 p-7
389
- */
390
- function _combinedCls() {
391
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
392
- args[_key] = arguments[_key];
393
- }
394
- if (args) {
395
- var classes = [];
396
- for (var i = 0; i < args.length; i++) {
397
- var className = args[i];
398
- if (!className) {
399
- continue;
400
- }
401
- var type = _typeof(className);
402
- if (type === 'string' || type === 'number') {
403
- classes.push(className);
404
- } else if (type === 'object') {
405
- var _classes = Array.isArray(className) ? className : Object.entries(className).map(function (_ref) {
406
- var _ref2 = _slicedToArray(_ref, 2),
407
- key = _ref2[0],
408
- value = _ref2[1];
409
- return value ? key : null;
410
- });
411
- classes = _classes.length ? classes.concat(_classes.filter(function (c) {
412
- return !!c;
413
- })) : classes;
414
- }
415
- }
416
- return classes.join(' ').trim();
417
- }
418
- return undefined;
419
- }
420
-
421
- /******/
422
- return __webpack_exports__;
423
- /******/
424
- }()
425
- );
426
- });
427
-
428
- /***/ }),
429
-
430
- /***/ 79:
431
- /***/ (function(module, exports, __webpack_require__) {
432
-
433
- /* module decorator */ module = __webpack_require__.nmd(module);
434
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;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); }
435
- (function webpackUniversalModuleDefinition(root, factory) {
436
- if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
437
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
438
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
439
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
440
- })(this, function () {
441
- return (/******/function () {
442
- // webpackBootstrap
443
- /******/
444
- "use strict";
445
-
446
- /******/ // The require scope
447
- /******/
448
- var __nested_webpack_require_987__ = {};
449
- /******/
450
- /************************************************************************/
451
- /******/ /* webpack/runtime/define property getters */
452
- /******/
453
- (function () {
454
- /******/ // define getter functions for harmony exports
455
- /******/__nested_webpack_require_987__.d = function (exports, definition) {
456
- /******/for (var key in definition) {
457
- /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
458
- /******/Object.defineProperty(exports, key, {
459
- enumerable: true,
460
- get: definition[key]
461
- });
462
- /******/
463
- }
464
- /******/
465
- }
466
- /******/
467
- };
468
- /******/
469
- })();
470
- /******/
471
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
472
- /******/
473
- (function () {
474
- /******/__nested_webpack_require_987__.o = function (obj, prop) {
475
- return Object.prototype.hasOwnProperty.call(obj, prop);
476
- };
477
- /******/
478
- })();
479
- /******/
480
- /******/ /* webpack/runtime/make namespace object */
481
- /******/
482
- (function () {
483
- /******/ // define __esModule on exports
484
- /******/__nested_webpack_require_987__.r = function (exports) {
485
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
486
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
487
- value: 'Module'
488
- });
489
- /******/
490
- }
491
- /******/
492
- Object.defineProperty(exports, '__esModule', {
493
- value: true
494
- });
495
- /******/
496
- };
497
- /******/
498
- })();
499
- /******/
500
- /************************************************************************/
501
- var __webpack_exports__ = {};
502
- __nested_webpack_require_987__.r(__webpack_exports__);
503
- /* harmony export */
504
- __nested_webpack_require_987__.d(__webpack_exports__, {
505
- /* harmony export */"convertArrToValByBraces": function convertArrToValByBraces() {
506
- return (/* binding */_convertArrToValByBraces
507
- );
508
- },
509
- /* harmony export */"convertArrToValByBrackets": function convertArrToValByBrackets() {
510
- return (/* binding */_convertArrToValByBrackets
511
- );
512
- },
513
- /* harmony export */"convertStringByCommaToValByBraces": function convertStringByCommaToValByBraces() {
514
- return (/* binding */_convertStringByCommaToValByBraces
515
- );
516
- },
517
- /* harmony export */"convertStringByCommaToValByBrackets": function convertStringByCommaToValByBrackets() {
518
- return (/* binding */_convertStringByCommaToValByBrackets
519
- );
520
- }
521
- /* harmony export */
522
- });
523
- /**
524
- * Convert value to string separated by square brackets
525
- * @param {String} str such as: 1,2,3
526
- * @returns {String} such as: [1][2][3]
527
- */
528
- function _convertStringByCommaToValByBrackets(str) {
529
- if (typeof str === 'undefined' || str === null || str === '') {
530
- return '';
531
- }
532
- return str.split(',').map(function (v) {
533
- return v.toString().includes('[') && v.toString().includes(']') ? "".concat(v) : "[".concat(v, "]");
534
- }).join('');
535
- }
536
-
537
- /**
538
- * Convert array value to string separated by square brackets
539
- * @param {String[]} arr such as: ['1','2','3']
540
- * @returns {String} such as: [1][2][3]
541
- */
542
- function _convertArrToValByBrackets(arr) {
543
- if (!Array.isArray(arr)) return '';
544
- return arr.map(function (v) {
545
- return v.toString().includes('[') && v.toString().includes(']') ? "".concat(v) : "[".concat(v, "]");
546
- }).join('');
547
- }
548
-
549
- /**
550
- * Convert value to string separated by curly braces
551
- * @param {String} str such as: 1,2,3
552
- * @returns {String} such as: {1}{2}{3}
553
- */
554
- function _convertStringByCommaToValByBraces(str) {
555
- if (typeof str === 'undefined' || str === null || str === '') {
556
- return '';
557
- }
558
- return str.split(',').map(function (v) {
559
- return v.toString().includes('{') && v.toString().includes('}') ? "".concat(v) : "{".concat(v, "}");
560
- }).join('');
561
- }
562
-
563
- /**
564
- * Convert array value to string separated by curly braces
565
- * @param {String[]} arr such as: ['1','2','3']
566
- * @returns {String} such as: {1}{2}{3}
567
- */
568
- function _convertArrToValByBraces(arr) {
569
- if (!Array.isArray(arr)) return '';
570
- return arr.map(function (v) {
571
- return v.toString().includes('{') && v.toString().includes('}') ? "".concat(v) : "{".concat(v, "}");
572
- }).join('');
573
- }
574
-
575
- /******/
576
- return __webpack_exports__;
577
- /******/
578
- }()
579
- );
580
- });
581
-
582
- /***/ }),
583
-
584
- /***/ 135:
585
- /***/ (function(module, exports, __webpack_require__) {
586
-
587
- /* module decorator */ module = __webpack_require__.nmd(module);
588
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;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); }
589
- (function webpackUniversalModuleDefinition(root, factory) {
590
- if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
591
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
592
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
593
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
594
- })(this, function () {
595
- return (/******/function () {
596
- // webpackBootstrap
597
- /******/
598
- "use strict";
599
-
600
- /******/ // The require scope
601
- /******/
602
- var __nested_webpack_require_987__ = {};
603
- /******/
604
- /************************************************************************/
605
- /******/ /* webpack/runtime/define property getters */
606
- /******/
607
- (function () {
608
- /******/ // define getter functions for harmony exports
609
- /******/__nested_webpack_require_987__.d = function (exports, definition) {
610
- /******/for (var key in definition) {
611
- /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
612
- /******/Object.defineProperty(exports, key, {
613
- enumerable: true,
614
- get: definition[key]
615
- });
616
- /******/
617
- }
618
- /******/
619
- }
620
- /******/
621
- };
622
- /******/
623
- })();
624
- /******/
625
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
626
- /******/
627
- (function () {
628
- /******/__nested_webpack_require_987__.o = function (obj, prop) {
629
- return Object.prototype.hasOwnProperty.call(obj, prop);
630
- };
631
- /******/
632
- })();
633
- /******/
634
- /******/ /* webpack/runtime/make namespace object */
635
- /******/
636
- (function () {
637
- /******/ // define __esModule on exports
638
- /******/__nested_webpack_require_987__.r = function (exports) {
639
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
640
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
641
- value: 'Module'
642
- });
643
- /******/
644
- }
645
- /******/
646
- Object.defineProperty(exports, '__esModule', {
647
- value: true
648
- });
649
- /******/
650
- };
651
- /******/
652
- })();
653
- /******/
654
- /************************************************************************/
655
- var __webpack_exports__ = {};
656
- __nested_webpack_require_987__.r(__webpack_exports__);
657
- /* harmony export */
658
- __nested_webpack_require_987__.d(__webpack_exports__, {
659
- /* harmony export */"extractContentsOfBraces": function extractContentsOfBraces() {
660
- return (/* binding */_extractContentsOfBraces
661
- );
662
- },
663
- /* harmony export */"extractContentsOfBrackets": function extractContentsOfBrackets() {
664
- return (/* binding */_extractContentsOfBrackets
665
- );
666
- },
667
- /* harmony export */"extractContentsOfMixedCharactersWithBraces": function extractContentsOfMixedCharactersWithBraces() {
668
- return (/* binding */_extractContentsOfMixedCharactersWithBraces
669
- );
670
- },
671
- /* harmony export */"extractContentsOfMixedCharactersWithComma": function extractContentsOfMixedCharactersWithComma() {
672
- return (/* binding */_extractContentsOfMixedCharactersWithComma
673
- );
674
- },
675
- /* harmony export */"extractContentsOfParentheses": function extractContentsOfParentheses() {
676
- return (/* binding */_extractContentsOfParentheses
677
- );
678
- },
679
- /* harmony export */"extractorExist": function extractorExist() {
680
- return (/* binding */_extractorExist
681
- );
682
- }
683
- /* harmony export */
684
- });
685
- /**
686
- * Determine whether an extractor is included
687
- * @param {String} str => input string. such as 'a[1], b[2]', '{a[1]}'
688
- * @returns {Boolean}
689
- */
690
- function _extractorExist(str) {
691
- if (typeof str === 'undefined' || str === null || str === '') {
692
- return false;
693
- }
694
- var res = false;
695
- if (str !== null && str !== void 0 && str.match(/(\[.*?\])/gi)) {
696
- res = true;
697
- }
698
- return res;
699
- }
700
-
701
- /**
702
- * Extract the contents of square brackets
703
- * @param {String} str => input string. such as '[1,2] [f][c]'
704
- * @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
705
- * @returns {Array<string>|string} such as: ['1,2','f','c']
706
- */
707
- function _extractContentsOfBrackets(str) {
708
- var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
709
- if (typeof str === 'undefined' || str === null || str === '') {
710
- return !commaSeparated ? [] : '';
711
- }
712
- var res = str.match(/[^\[]+(?=(\[ \])|\])/g);
713
- if (commaSeparated) {
714
- return res === null ? '' : res.join(',').replace(/\,+$/, '');
715
- } else {
716
- return res === null ? '' : res;
717
- }
718
- }
719
-
720
- /**
721
- * Extract the contents of curly braces
722
- * @param {String} str => input string. such as '{1,2} {f}{c}'
723
- * @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
724
- * @returns {Array<string>|string} such as: ['1,2','f','c']
725
- */
726
- function _extractContentsOfBraces(str) {
727
- var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
728
- if (typeof str === 'undefined' || str === null || str === '') {
729
- return !commaSeparated ? [] : '';
730
- }
731
- var res = str.match(/[^\{]+(?=(\{ \})|\})/g);
732
- if (commaSeparated) {
733
- return res === null ? '' : res.join(',').replace(/\,+$/, '');
734
- } else {
735
- return res === null ? '' : res;
736
- }
737
- }
738
-
739
- /**
740
- * Extract the contents of parentheses
741
- * @param {String} str => input string. such as '(1,2) (f)(c)'
742
- * @param {Boolean} commaSeparated => flag to determine if the result should be comma separated or not
743
- * @returns {Array<string>|string} such as: ['1,2','f','c']
744
- */
745
- function _extractContentsOfParentheses(str) {
746
- var commaSeparated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
747
- if (typeof str === 'undefined' || str === null || str === '') {
748
- return !commaSeparated ? [] : '';
749
- }
750
- var res = str.match(/[^\(]+(?=(\( \))|\))/g);
751
- if (commaSeparated) {
752
- return res === null ? '' : res.join(',').replace(/\,+$/, '');
753
- } else {
754
- return res === null ? '' : res;
755
- }
756
- }
757
-
758
- /**
759
- * Parses a braces-separated string of `{label[value]}` pairs into an array of objects.
760
- *
761
- * Example:
762
- * Input: "{Poor[c]}{Sub-option 4[c-2]}{Empty[]}"
763
- * Input: "{{Poor[c]}{Sub-option 4[c-2]}{Empty[]}[]}"
764
- *
765
- * Output: [
766
- * { label: "Poor", value: "c" },
767
- * { label: "Sub-option 4", value: "c-2" },
768
- * { label: "Empty", value: "" }
769
- * ]
770
- *
771
- * @param {string} str - The input string containing one or more `{label[value]}` segments.
772
- * @returns {Array<{label: string, value: string}>} - An array of extracted label-value objects.
773
- */
774
- function _extractContentsOfMixedCharactersWithBraces(str) {
775
- // Fix the extra '{' at the beginning
776
- var cleaned = str.replace(/^{{/, '{');
777
-
778
- // Remove empty {} or {[]} tail
779
- var trimmed = cleaned.replace(/\{\[\]\}$/, '');
780
-
781
- // The match is like {label[value]}
782
- var pattern = /\{(.*?)\[(.*?)\]\}/g;
783
- var matches = Array.from(trimmed.matchAll(pattern));
784
- return matches.map(function (match) {
785
- return {
786
- label: match[1],
787
- value: match[2]
788
- };
789
- });
790
- }
791
-
792
- /**
793
- * Parses a comma-separated string of `label[value]` pairs into an array of objects.
794
- *
795
- * Example:
796
- * Input: "Poor[c],Sub-option 4[c-2],Empty[]"
797
- * Output: [
798
- * { label: "Poor", value: "c" },
799
- * { label: "Sub-option 4", value: "c-2" },
800
- * { label: "Empty", value: "" }
801
- * ]
802
- *
803
- * @param {string} str - A string containing label-value pairs in the format `label[value]`, separated by commas.
804
- * @returns {Array<{ label: string, value: string }>} - An array of parsed objects.
805
- */
806
- function _extractContentsOfMixedCharactersWithComma(str) {
807
- return str.split(",").map(function (item) {
808
- return item.trim();
809
- }).map(function (item) {
810
- var match = item.match(/^(.*?)\[(.*?)\]$/);
811
- if (match) {
812
- return {
813
- label: match[1],
814
- value: match[2]
815
- };
816
- }
817
- return null;
818
- }).filter(Boolean);
819
- }
820
-
821
- /******/
822
- return __webpack_exports__;
823
- /******/
824
- }()
825
- );
826
- });
827
-
828
- /***/ }),
829
-
830
- /***/ 933:
831
- /***/ (function(module, exports, __webpack_require__) {
832
-
833
- /* module decorator */ module = __webpack_require__.nmd(module);
834
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;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); }
835
- (function webpackUniversalModuleDefinition(root, factory) {
836
- if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
837
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
838
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
839
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
840
- })(this, function () {
841
- return (/******/function () {
842
- // webpackBootstrap
843
- /******/
844
- "use strict";
845
-
846
- /******/ // The require scope
847
- /******/
848
- var __nested_webpack_require_987__ = {};
849
- /******/
850
- /************************************************************************/
851
- /******/ /* webpack/runtime/define property getters */
852
- /******/
853
- (function () {
854
- /******/ // define getter functions for harmony exports
855
- /******/__nested_webpack_require_987__.d = function (exports, definition) {
856
- /******/for (var key in definition) {
857
- /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
858
- /******/Object.defineProperty(exports, key, {
859
- enumerable: true,
860
- get: definition[key]
861
- });
862
- /******/
863
- }
864
- /******/
865
- }
866
- /******/
867
- };
868
- /******/
869
- })();
870
- /******/
871
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
872
- /******/
873
- (function () {
874
- /******/__nested_webpack_require_987__.o = function (obj, prop) {
875
- return Object.prototype.hasOwnProperty.call(obj, prop);
876
- };
877
- /******/
878
- })();
879
- /******/
880
- /******/ /* webpack/runtime/make namespace object */
881
- /******/
882
- (function () {
883
- /******/ // define __esModule on exports
884
- /******/__nested_webpack_require_987__.r = function (exports) {
885
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
886
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
887
- value: 'Module'
888
- });
889
- /******/
890
- }
891
- /******/
892
- Object.defineProperty(exports, '__esModule', {
893
- value: true
894
- });
895
- /******/
896
- };
897
- /******/
898
- })();
899
- /******/
900
- /************************************************************************/
901
- var __webpack_exports__ = {};
902
- __nested_webpack_require_987__.r(__webpack_exports__);
903
- /* harmony export */
904
- __nested_webpack_require_987__.d(__webpack_exports__, {
905
- /* harmony export */"htmlToPlain": function htmlToPlain() {
906
- return (/* binding */_htmlToPlain
907
- );
908
- },
909
- /* harmony export */"multiSpacesToSingle": function multiSpacesToSingle() {
910
- return (/* binding */_multiSpacesToSingle
911
- );
912
- },
913
- /* harmony export */"onlyNumAndLetter": function onlyNumAndLetter() {
914
- return (/* binding */_onlyNumAndLetter
915
- );
916
- },
917
- /* harmony export */"removeFirstLastSlash": function removeFirstLastSlash() {
918
- return (/* binding */_removeFirstLastSlash
919
- );
920
- },
921
- /* harmony export */"removeFirstSlash": function removeFirstSlash() {
922
- return (/* binding */_removeFirstSlash
923
- );
924
- },
925
- /* harmony export */"removeTrailingSlash": function removeTrailingSlash() {
926
- return (/* binding */_removeTrailingSlash
927
- );
928
- },
929
- /* harmony export */"rmAllSpace": function rmAllSpace() {
930
- return (/* binding */_rmAllSpace
931
- );
932
- },
933
- /* harmony export */"rmSpec": function rmSpec() {
934
- return (/* binding */_rmSpec
935
- );
936
- },
937
- /* harmony export */"stripTagsAndContent": function stripTagsAndContent() {
938
- return (/* binding */_stripTagsAndContent
939
- );
940
- },
941
- /* harmony export */"trimAll": function trimAll() {
942
- return (/* binding */_trimAll
943
- );
944
- }
945
- /* harmony export */
946
- });
947
- /**
948
- * String formatting utility functions
949
- */
950
-
951
- /**
952
- * Remove all special characters except space from a string
953
- * @param {string} input - The input string to process
954
- * @returns {string} The processed string
955
- */
956
- function _rmSpec(input) {
957
- return input === null || input === void 0 ? void 0 : input.replace(/[^a-zA-Z0-9 \u4E00-\u9FFF]/g, "");
958
- }
959
-
960
- /**
961
- * Allow only numbers and letters in a string
962
- * @param {string} input - The input string to process
963
- * @returns {string} The processed string
964
- */
965
- function _onlyNumAndLetter(input) {
966
- return input === null || input === void 0 ? void 0 : input.replace(/[^a-zA-Z0-9 ]/g, "");
967
- }
968
-
969
- /**
970
- * Remove all spaces including those in the middle
971
- * @param {string} input - The input string to process
972
- * @returns {string} The processed string
973
- */
974
- function _rmAllSpace(input) {
975
- return input === null || input === void 0 ? void 0 : input.replace(/\s/g, "");
976
- }
977
-
978
- /**
979
- * Remove whitespace from both sides of a string
980
- * @param {string} input - The input string to process
981
- * @returns {string} The processed string
982
- */
983
- function _trimAll(input) {
984
- return input === null || input === void 0 ? void 0 : input.replace(/(^\s+)|(\s+$)/g, "");
985
- }
986
-
987
- /**
988
- * Replace multiple spaces with a single space
989
- * @param {string} input - The input string to process
990
- * @returns {string} The processed string
991
- */
992
- function _multiSpacesToSingle(input) {
993
- return input === null || input === void 0 ? void 0 : input.replace(/\s+(\W)/g, ' ');
994
- }
995
-
996
- /**
997
- * Convert HTML text to plain text (Remove html tag content)
998
- * @param {string} input - The input string to process
999
- * @returns {string} The processed string
1000
- */
1001
- /*
1002
- Examples:
1003
- console.log(htmlToPlain("<p>Hello <b>World</b></p>")); // Hello World
1004
- */
1005
- function _htmlToPlain(input) {
1006
- return input === null || input === void 0 ? void 0 : input.replace(/(<([^>]+)>)/ig, '');
1007
- }
1008
-
1009
- /**
1010
- * Strip HTML tags and their content
1011
- * !!!Important: It will remove nested tags
1012
- * @param {string} input - The input string to process
1013
- * @returns {string} The processed string
1014
- */
1015
- /*
1016
- Examples:
1017
- console.log(stripTagsAndContent("<p>Hello <b>World</b></p>")); // World
1018
- console.log(stripTagsAndContent("Hello <b>World</b>")); // Hello
1019
- */
1020
- function _stripTagsAndContent(input) {
1021
- return input === null || input === void 0 ? void 0 : input.replace(/<\/?[^>]+(>|$)(.*?)<\/?[^>]+(>|$)/ig, '');
1022
- }
1023
-
1024
- /**
1025
- * Remove first and last slash from a URL
1026
- * @param {string} input - The input URL to process
1027
- * @returns {string} The processed URL
1028
- */
1029
- function _removeFirstLastSlash(input) {
1030
- return input === null || input === void 0 ? void 0 : input.replace(/^\/|\/$/g, '');
1031
- }
1032
-
1033
- /**
1034
- * Remove trailing slash from a URL
1035
- * @param {string} input - The input URL to process
1036
- * @returns {string} The processed URL
1037
- */
1038
- function _removeTrailingSlash(input) {
1039
- return input === null || input === void 0 ? void 0 : input.replace(/\/+$/, '');
1040
- }
1041
-
1042
- /**
1043
- * Remove first slash from a URL
1044
- * @param {string} input - The input URL to process
1045
- * @returns {string} The processed URL
1046
- */
1047
- function _removeFirstSlash(input) {
1048
- return input === null || input === void 0 ? void 0 : input.replace(/\//, '');
1049
- }
1050
-
1051
- /******/
1052
- return __webpack_exports__;
1053
- /******/
1054
- }()
1055
- );
1056
- });
1057
-
1058
- /***/ }),
1059
-
1060
- /***/ 767:
1061
- /***/ (function(module, exports, __webpack_require__) {
1062
-
1063
- /* module decorator */ module = __webpack_require__.nmd(module);
1064
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "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; }, _typeof2(obj); }
1065
- (function webpackUniversalModuleDefinition(root, factory) {
1066
- if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1067
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1068
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1069
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
1070
- })(this, function () {
1071
- return (/******/function () {
1072
- // webpackBootstrap
1073
- /******/
1074
- "use strict";
1075
-
1076
- /******/ // The require scope
1077
- /******/
1078
- var __nested_webpack_require_993__ = {};
1079
- /******/
1080
- /************************************************************************/
1081
- /******/ /* webpack/runtime/define property getters */
1082
- /******/
1083
- (function () {
1084
- /******/ // define getter functions for harmony exports
1085
- /******/__nested_webpack_require_993__.d = function (exports, definition) {
1086
- /******/for (var key in definition) {
1087
- /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
1088
- /******/Object.defineProperty(exports, key, {
1089
- enumerable: true,
1090
- get: definition[key]
1091
- });
1092
- /******/
1093
- }
1094
- /******/
1095
- }
1096
- /******/
1097
- };
1098
- /******/
1099
- })();
1100
- /******/
1101
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
1102
- /******/
1103
- (function () {
1104
- /******/__nested_webpack_require_993__.o = function (obj, prop) {
1105
- return Object.prototype.hasOwnProperty.call(obj, prop);
1106
- };
1107
- /******/
1108
- })();
1109
- /******/
1110
- /******/ /* webpack/runtime/make namespace object */
1111
- /******/
1112
- (function () {
1113
- /******/ // define __esModule on exports
1114
- /******/__nested_webpack_require_993__.r = function (exports) {
1115
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1116
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
1117
- value: 'Module'
1118
- });
1119
- /******/
1120
- }
1121
- /******/
1122
- Object.defineProperty(exports, '__esModule', {
1123
- value: true
1124
- });
1125
- /******/
1126
- };
1127
- /******/
1128
- })();
1129
- /******/
1130
- /************************************************************************/
1131
- var __webpack_exports__ = {};
1132
- __nested_webpack_require_993__.r(__webpack_exports__);
1133
- /* harmony export */
1134
- __nested_webpack_require_993__.d(__webpack_exports__, {
1135
- /* harmony export */"getAbsoluteCoordinates": function getAbsoluteCoordinates() {
1136
- return (/* binding */_getAbsoluteCoordinates
1137
- );
1138
- },
1139
- /* harmony export */"getAbsolutePositionOfStage": function getAbsolutePositionOfStage() {
1140
- return (/* binding */_getAbsolutePositionOfStage
1141
- );
1142
- },
1143
- /* harmony export */"getOffset": function getOffset() {
1144
- return (/* binding */_getOffset
1145
- );
1146
- },
1147
- /* harmony export */"getPosition": function getPosition() {
1148
- return (/* binding */_getPosition
1149
- );
1150
- },
1151
- /* harmony export */"getTransitionDuration": function getTransitionDuration() {
1152
- return (/* binding */_getTransitionDuration
1153
- );
1154
- }
1155
- /* harmony export */
1156
- });
1157
- function _typeof(obj) {
1158
- "@babel/helpers - typeof";
1159
-
1160
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1161
- return typeof obj;
1162
- } : function (obj) {
1163
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1164
- }, _typeof(obj);
1165
- }
1166
- /**
1167
- * Get the -webkit-transition-duration property
1168
- *
1169
- * @param {HTMLElement} el - A DOM node containing one selector to match against.
1170
- * @return {number} - Returns a pure number.
1171
- */
1172
- function _getTransitionDuration(el) {
1173
- if (_typeof(el) === ( true ? "undefined" : 0)) {
1174
- return 0;
1175
- }
1176
- var style = window.getComputedStyle(el),
1177
- duration = style.webkitTransitionDuration,
1178
- delay = style.webkitTransitionDelay;
1179
- if (_typeof(duration) != ( true ? "undefined" : 0)) {
1180
- // fix miliseconds vs seconds
1181
- duration = duration.indexOf("ms") > -1 ? parseFloat(duration) : parseFloat(duration) * 1000;
1182
- delay = delay.indexOf("ms") > -1 ? parseFloat(delay) : parseFloat(delay) * 1000;
1183
- return duration;
1184
- } else {
1185
- return 0;
1186
- }
1187
- }
1188
-
1189
- /**
1190
- * Get an object's absolute position on the page
1191
- *
1192
- * @param {HTMLElement} el - A DOM node containing one selector to match against.
1193
- * @return {Json} - An object containing the properties top and left.
1194
- */
1195
- function _getAbsoluteCoordinates(el) {
1196
- var windowWidth = window.innerWidth,
1197
- leftPos = null,
1198
- topPos = null;
1199
- var pEl = el.parentElement;
1200
- if (!document.getElementsByTagName('body')[0].className.match(/rtl/)) {
1201
- leftPos = el.offsetLeft == 0 ? pEl.offsetLeft : el.offsetLeft;
1202
- topPos = el.offsetTop == 0 ? pEl.offsetTop : el.offsetTop;
1203
- } else {
1204
- // width and height in pixels, including padding and border
1205
- // Corresponds to outerWidth(), outerHeight()
1206
- leftPos = el.offsetLeft == 0 ? windowWidth - (pEl.offsetLeft + pEl.offsetWidth) : windowWidth - (el.offsetLeft + el.offsetWidth);
1207
- topPos = el.offsetTop == 0 ? windowWidth - (pEl.offsetTop + pEl.offsetHeight) : windowWidth - (el.offsetTop + el.offsetHeight);
1208
- }
1209
- return {
1210
- 'left': leftPos,
1211
- 'top': topPos
1212
- };
1213
- }
1214
-
1215
- /**
1216
- * Get the current coordinates of the first element in the set of matched elements, relative to the document.
1217
- *
1218
- * @param {Element} el - A DOM node containing one selector to match against.
1219
- * @return {Json} - An object containing the properties top and left.
1220
- */
1221
- function _getOffset(el) {
1222
- var res = {
1223
- top: 0,
1224
- left: 0
1225
- };
1226
- var box = el.getBoundingClientRect();
1227
- var top = 0,
1228
- left = 0;
1229
-
1230
- //Include scrollbar and border
1231
- top = box.top + window.pageYOffset - document.documentElement.clientTop;
1232
- left = box.left + window.pageXOffset - document.documentElement.clientLeft;
1233
- res = {
1234
- top: top,
1235
- left: left
1236
- };
1237
- return res;
1238
- }
1239
-
1240
- /**
1241
- * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
1242
- *
1243
- * @param {HTMLElement} el - A DOM node containing one selector to match against.
1244
- * @return {Json} - An object containing the properties top and left.
1245
- */
1246
- function _getPosition(el) {
1247
- var res = {
1248
- top: 0,
1249
- left: 0
1250
- };
1251
- var top = el.offsetTop ? el.offsetTop : 0,
1252
- left = el.offsetLeft ? el.offsetLeft : 0;
1253
- res = {
1254
- top: top,
1255
- left: left
1256
- };
1257
- return res;
1258
- }
1259
-
1260
- /**
1261
- * Get the absolute position of the stage element
1262
- *
1263
- * @param {HTMLElement} domElement - A DOM node
1264
- * @param {Number | string} left - left offset
1265
- * @param {Number | string} top - top offset
1266
- * @returns
1267
- */
1268
- function _getAbsolutePositionOfStage(domElement) {
1269
- var left = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1270
- var top = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1271
- if (!parseInt(left)) {
1272
- left = 0;
1273
- } else {
1274
- left = parseInt(left);
1275
- }
1276
- if (!parseInt(top)) {
1277
- top = 0;
1278
- } else {
1279
- top = parseInt(top);
1280
- }
1281
- var box = domElement.getBoundingClientRect();
1282
- var body = document.body;
1283
- var docElem = document.documentElement;
1284
- var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
1285
- var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
1286
- var clientTop = docElem.clientTop || body.clientTop || 0;
1287
- var clientLeft = docElem.clientLeft || body.clientLeft || 0;
1288
- var attr = {};
1289
- attr.y = box.top + scrollTop - clientTop + top;
1290
- attr.x = box.left + scrollLeft - clientLeft + left;
1291
- attr.width = box.width;
1292
- attr.height = box.height;
1293
- return attr;
1294
- }
1295
-
1296
- /******/
1297
- return __webpack_exports__;
1298
- /******/
1299
- }()
1300
- );
1301
- });
1302
-
1303
- /***/ }),
1304
-
1305
- /***/ 438:
1306
- /***/ (function(module, exports, __webpack_require__) {
1307
-
1308
- /* module decorator */ module = __webpack_require__.nmd(module);
1309
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "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; }, _typeof2(obj); }
1310
- (function webpackUniversalModuleDefinition(root, factory) {
1311
- if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1312
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1313
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1314
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
1315
- })(this, function () {
1316
- return (/******/function () {
1317
- // webpackBootstrap
1318
- /******/
1319
- "use strict";
1320
-
1321
- /******/ // The require scope
1322
- /******/
1323
- var __nested_webpack_require_993__ = {};
1324
- /******/
1325
- /************************************************************************/
1326
- /******/ /* webpack/runtime/define property getters */
1327
- /******/
1328
- (function () {
1329
- /******/ // define getter functions for harmony exports
1330
- /******/__nested_webpack_require_993__.d = function (exports, definition) {
1331
- /******/for (var key in definition) {
1332
- /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
1333
- /******/Object.defineProperty(exports, key, {
1334
- enumerable: true,
1335
- get: definition[key]
1336
- });
1337
- /******/
1338
- }
1339
- /******/
1340
- }
1341
- /******/
1342
- };
1343
- /******/
1344
- })();
1345
- /******/
1346
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
1347
- /******/
1348
- (function () {
1349
- /******/__nested_webpack_require_993__.o = function (obj, prop) {
1350
- return Object.prototype.hasOwnProperty.call(obj, prop);
1351
- };
1352
- /******/
1353
- })();
1354
- /******/
1355
- /******/ /* webpack/runtime/make namespace object */
1356
- /******/
1357
- (function () {
1358
- /******/ // define __esModule on exports
1359
- /******/__nested_webpack_require_993__.r = function (exports) {
1360
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1361
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
1362
- value: 'Module'
1363
- });
1364
- /******/
1365
- }
1366
- /******/
1367
- Object.defineProperty(exports, '__esModule', {
1368
- value: true
1369
- });
1370
- /******/
1371
- };
1372
- /******/
1373
- })();
1374
- /******/
1375
- /************************************************************************/
1376
- var __webpack_exports__ = {};
1377
- __nested_webpack_require_993__.r(__webpack_exports__);
1378
- /* harmony export */
1379
- __nested_webpack_require_993__.d(__webpack_exports__, {
1380
- /* harmony export */"addTreeDepth": function addTreeDepth() {
1381
- return (/* binding */_addTreeDepth
1382
- );
1383
- },
1384
- /* harmony export */"addTreeIndent": function addTreeIndent() {
1385
- return (/* binding */_addTreeIndent
1386
- );
1387
- },
1388
- /* harmony export */"convertTree": function convertTree() {
1389
- return (/* binding */_convertTree
1390
- );
1391
- },
1392
- /* harmony export */"flatTree": function flatTree() {
1393
- return (/* binding */_flatTree
1394
- );
1395
- },
1396
- /* harmony export */"getAllDepth": function getAllDepth() {
1397
- return (/* binding */_getAllDepth
1398
- );
1399
- }
1400
- /* harmony export */
1401
- });
1402
- function _typeof(obj) {
1403
- "@babel/helpers - typeof";
1404
-
1405
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1406
- return typeof obj;
1407
- } : function (obj) {
1408
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1409
- }, _typeof(obj);
1410
- }
1411
- var _excluded = ["children"];
1412
- function _objectWithoutProperties(source, excluded) {
1413
- if (source == null) return {};
1414
- var target = _objectWithoutPropertiesLoose(source, excluded);
1415
- var key, i;
1416
- if (Object.getOwnPropertySymbols) {
1417
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1418
- for (i = 0; i < sourceSymbolKeys.length; i++) {
1419
- key = sourceSymbolKeys[i];
1420
- if (excluded.indexOf(key) >= 0) continue;
1421
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1422
- target[key] = source[key];
1423
- }
1424
- }
1425
- return target;
1426
- }
1427
- function _objectWithoutPropertiesLoose(source, excluded) {
1428
- if (source == null) return {};
1429
- var target = {};
1430
- var sourceKeys = Object.keys(source);
1431
- var key, i;
1432
- for (i = 0; i < sourceKeys.length; i++) {
1433
- key = sourceKeys[i];
1434
- if (excluded.indexOf(key) >= 0) continue;
1435
- target[key] = source[key];
1436
- }
1437
- return target;
1438
- }
1439
- function ownKeys(object, enumerableOnly) {
1440
- var keys = Object.keys(object);
1441
- if (Object.getOwnPropertySymbols) {
1442
- var symbols = Object.getOwnPropertySymbols(object);
1443
- enumerableOnly && (symbols = symbols.filter(function (sym) {
1444
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1445
- })), keys.push.apply(keys, symbols);
1446
- }
1447
- return keys;
1448
- }
1449
- function _objectSpread(target) {
1450
- for (var i = 1; i < arguments.length; i++) {
1451
- var source = null != arguments[i] ? arguments[i] : {};
1452
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
1453
- _defineProperty(target, key, source[key]);
1454
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
1455
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1456
- });
1457
- }
1458
- return target;
1459
- }
1460
- function _defineProperty(obj, key, value) {
1461
- key = _toPropertyKey(key);
1462
- if (key in obj) {
1463
- Object.defineProperty(obj, key, {
1464
- value: value,
1465
- enumerable: true,
1466
- configurable: true,
1467
- writable: true
1468
- });
1469
- } else {
1470
- obj[key] = value;
1471
- }
1472
- return obj;
1473
- }
1474
- function _toPropertyKey(arg) {
1475
- var key = _toPrimitive(arg, "string");
1476
- return _typeof(key) === "symbol" ? key : String(key);
1477
- }
1478
- function _toPrimitive(input, hint) {
1479
- if (_typeof(input) !== "object" || input === null) return input;
1480
- var prim = input[Symbol.toPrimitive];
1481
- if (prim !== undefined) {
1482
- var res = prim.call(input, hint || "default");
1483
- if (_typeof(res) !== "object") return res;
1484
- throw new TypeError("@@toPrimitive must return a primitive value.");
1485
- }
1486
- return (hint === "string" ? String : Number)(input);
1487
- }
1488
- function _toConsumableArray(arr) {
1489
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
1490
- }
1491
- function _nonIterableSpread() {
1492
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1493
- }
1494
- function _unsupportedIterableToArray(o, minLen) {
1495
- if (!o) return;
1496
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1497
- var n = Object.prototype.toString.call(o).slice(8, -1);
1498
- if (n === "Object" && o.constructor) n = o.constructor.name;
1499
- if (n === "Map" || n === "Set") return Array.from(o);
1500
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1501
- }
1502
- function _iterableToArray(iter) {
1503
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1504
- }
1505
- function _arrayWithoutHoles(arr) {
1506
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
1507
- }
1508
- function _arrayLikeToArray(arr, len) {
1509
- if (len == null || len > arr.length) len = arr.length;
1510
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1511
- return arr2;
1512
- }
1513
- function _objectDestructuringEmpty(obj) {
1514
- if (obj == null) throw new TypeError("Cannot destructure " + obj);
1515
- }
1516
- function _extends() {
1517
- _extends = Object.assign ? Object.assign.bind() : function (target) {
1518
- for (var i = 1; i < arguments.length; i++) {
1519
- var source = arguments[i];
1520
- for (var key in source) {
1521
- if (Object.prototype.hasOwnProperty.call(source, key)) {
1522
- target[key] = source[key];
1523
- }
1524
- }
1525
- }
1526
- return target;
1527
- };
1528
- return _extends.apply(this, arguments);
1529
- }
1530
- /**
1531
- * Convert Tree
1532
- * @param {Array} arr - Flat array
1533
- * @param {?string | ?number} parentId - Parent id
1534
- * @param {?string} keyId - Key value of id.
1535
- * @param {?string} keyParentId - Key value of parent id.
1536
- * @returns Array
1537
- */
1538
- function _convertTree(arr) {
1539
- var parentId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1540
- var keyId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
1541
- var keyParentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'parent_id';
1542
- if (!parentId) {
1543
- // If there is no parent id (when recursing for the first time), all parents will be queried
1544
- return arr.filter(function (item) {
1545
- return !item[keyParentId];
1546
- }).map(function (item) {
1547
- // Query all child nodes by parent node ID
1548
- item.children = _convertTree(arr, item[keyId], keyId, keyParentId);
1549
- return item;
1550
- });
1551
- } else {
1552
- return arr.filter(function (item) {
1553
- return item[keyParentId] === parentId;
1554
- }).map(function (item) {
1555
- // Query all child nodes by parent node ID
1556
- item.children = _convertTree(arr, item[keyId], keyId, keyParentId);
1557
- return item;
1558
- });
1559
- }
1560
- }
1561
-
1562
- /**
1563
- * Flat tree
1564
- * @param {Array} arr - Hierarchical array
1565
- * @returns Array
1566
- */
1567
- function _flatTree(arr) {
1568
- var flatData = function flatData(_ref) {
1569
- var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
1570
- var _rest$children = rest.children,
1571
- children = _rest$children === void 0 ? [] : _rest$children;
1572
- return [_objectSpread({}, rest)].concat(_toConsumableArray(children.flatMap(flatData)));
1573
- };
1574
- var result = arr.flatMap(flatData);
1575
-
1576
- //remove children from item
1577
- result = result.map(function (item) {
1578
- delete item.children;
1579
- return item;
1580
- });
1581
- return result;
1582
- }
1583
-
1584
- /**
1585
- * Get all depth
1586
- * @param {Object} node
1587
- * @returns Number
1588
- */
1589
- function _getAllDepth(arr) {
1590
- var count = function count(children) {
1591
- return children.reduce(function (depth, child) {
1592
- return Math.max(depth, 1 + count(child.children)); // increment depth of children by 1, and compare it with accumulated depth of other children within the same element
1593
- }, 0); //default value 0 that's returned if there are no children
1594
- };
1595
-
1596
- return count(arr);
1597
- }
1598
-
1599
- /**
1600
- * Add depth to each item in the tree
1601
- * @param {Array} arr - Hierarchical array
1602
- * @param {?string} keyId - Key value of id.
1603
- * @param {?string} keyParentId - Key value of parent id.
1604
- * @param {?number} depth - Depth of the item.
1605
- * @returns Number
1606
- */
1607
- function _addTreeDepth(arr) {
1608
- var keyId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
1609
- var parentItem = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
1610
- var depth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1611
- return arr.reduce(function (acc, el) {
1612
- var children = el.children,
1613
- otherProps = _objectWithoutProperties(el, _excluded);
1614
- acc.push(_objectSpread(_objectSpread({}, otherProps), {}, {
1615
- parentItem: parentItem,
1616
- depth: depth
1617
- }));
1618
- if (children) {
1619
- return acc.concat(_addTreeDepth(children, keyId, el[keyId], depth + 1));
1620
- }
1621
- return acc;
1622
- }, []);
1623
- }
1624
-
1625
- /**
1626
- * Add indent placeholder
1627
- * @param {Array} arr - Flat array
1628
- * @param {?string} placeholder - String of placeholder
1629
- * @param {?string} lastPlaceholder - Last String of placeholder
1630
- * @param {?string} keyName - Key value of name.
1631
- * @returns Array
1632
- */
1633
- function _addTreeIndent(arr) {
1634
- var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '&nbsp;&nbsp;&nbsp;&nbsp;';
1635
- var lastPlaceholder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
1636
- var keyName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'label';
1637
- arr.forEach(function (item) {
1638
- var indent = '';
1639
- if (item.depth) {
1640
- Array(item.depth).fill(0).forEach(function (k, i) {
1641
- indent += placeholder;
1642
- if (i === item.depth - 1) {
1643
- item[keyName] = indent + lastPlaceholder + item[keyName];
1644
- }
1645
- });
1646
- }
1647
- });
1648
- }
1649
-
1650
- /******/
1651
- return __webpack_exports__;
1652
- /******/
1653
- }()
1654
- );
1655
- });
1656
-
1657
- /***/ }),
1658
-
1659
- /***/ 761:
1660
- /***/ (function(module, exports, __webpack_require__) {
1661
-
1662
- /* module decorator */ module = __webpack_require__.nmd(module);
1663
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;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); }
1664
- (function webpackUniversalModuleDefinition(root, factory) {
1665
- if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1666
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1667
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1668
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
1669
- })(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
1670
- return (/******/function () {
1671
- // webpackBootstrap
1672
- /******/
1673
- "use strict";
1674
-
1675
- /******/
1676
- var __webpack_modules__ = {
1677
- /***/787: /***/function _(module) {
1678
- module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
1679
-
1680
- /***/
1681
- }
1682
-
1683
- /******/
1684
- };
1685
- /************************************************************************/
1686
- /******/ // The module cache
1687
- /******/
1688
- var __webpack_module_cache__ = {};
1689
- /******/
1690
- /******/ // The require function
1691
- /******/
1692
- function __nested_webpack_require_1465__(moduleId) {
1693
- /******/ // Check if module is in cache
1694
- /******/var cachedModule = __webpack_module_cache__[moduleId];
1695
- /******/
1696
- if (cachedModule !== undefined) {
1697
- /******/return cachedModule.exports;
1698
- /******/
1699
- }
1700
- /******/ // Create a new module (and put it into the cache)
1701
- /******/
1702
- var module = __webpack_module_cache__[moduleId] = {
1703
- /******/ // no module.id needed
1704
- /******/ // no module.loaded needed
1705
- /******/exports: {}
1706
- /******/
1707
- };
1708
- /******/
1709
- /******/ // Execute the module function
1710
- /******/
1711
- __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1465__);
1712
- /******/
1713
- /******/ // Return the exports of the module
1714
- /******/
1715
- return module.exports;
1716
- /******/
1717
- }
1718
- /******/
1719
- /************************************************************************/
1720
- /******/ /* webpack/runtime/compat get default export */
1721
- /******/
1722
- (function () {
1723
- /******/ // getDefaultExport function for compatibility with non-harmony modules
1724
- /******/__nested_webpack_require_1465__.n = function (module) {
1725
- /******/var getter = module && module.__esModule ? /******/function () {
1726
- return module['default'];
1727
- } : /******/function () {
1728
- return module;
1729
- };
1730
- /******/
1731
- __nested_webpack_require_1465__.d(getter, {
1732
- a: getter
1733
- });
1734
- /******/
1735
- return getter;
1736
- /******/
1737
- };
1738
- /******/
1739
- })();
1740
- /******/
1741
- /******/ /* webpack/runtime/define property getters */
1742
- /******/
1743
- (function () {
1744
- /******/ // define getter functions for harmony exports
1745
- /******/__nested_webpack_require_1465__.d = function (exports, definition) {
1746
- /******/for (var key in definition) {
1747
- /******/if (__nested_webpack_require_1465__.o(definition, key) && !__nested_webpack_require_1465__.o(exports, key)) {
1748
- /******/Object.defineProperty(exports, key, {
1749
- enumerable: true,
1750
- get: definition[key]
1751
- });
1752
- /******/
1753
- }
1754
- /******/
1755
- }
1756
- /******/
1757
- };
1758
- /******/
1759
- })();
1760
- /******/
1761
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
1762
- /******/
1763
- (function () {
1764
- /******/__nested_webpack_require_1465__.o = function (obj, prop) {
1765
- return Object.prototype.hasOwnProperty.call(obj, prop);
1766
- };
1767
- /******/
1768
- })();
1769
- /******/
1770
- /******/ /* webpack/runtime/make namespace object */
1771
- /******/
1772
- (function () {
1773
- /******/ // define __esModule on exports
1774
- /******/__nested_webpack_require_1465__.r = function (exports) {
1775
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1776
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
1777
- value: 'Module'
1778
- });
1779
- /******/
1780
- }
1781
- /******/
1782
- Object.defineProperty(exports, '__esModule', {
1783
- value: true
1784
- });
1785
- /******/
1786
- };
1787
- /******/
1788
- })();
1789
- /******/
1790
- /************************************************************************/
1791
- var __webpack_exports__ = {};
1792
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
1793
- (function () {
1794
- __nested_webpack_require_1465__.r(__webpack_exports__);
1795
- /* harmony export */
1796
- __nested_webpack_require_1465__.d(__webpack_exports__, {
1797
- /* harmony export */"default": function _default() {
1798
- return __WEBPACK_DEFAULT_EXPORT__;
1799
- }
1800
- /* harmony export */
1801
- });
1802
- /* harmony import */
1803
- var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
1804
- /* harmony import */
1805
- var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1806
- function _toConsumableArray(arr) {
1807
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
1808
- }
1809
- function _nonIterableSpread() {
1810
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1811
- }
1812
- function _unsupportedIterableToArray(o, minLen) {
1813
- if (!o) return;
1814
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1815
- var n = Object.prototype.toString.call(o).slice(8, -1);
1816
- if (n === "Object" && o.constructor) n = o.constructor.name;
1817
- if (n === "Map" || n === "Set") return Array.from(o);
1818
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1819
- }
1820
- function _iterableToArray(iter) {
1821
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1822
- }
1823
- function _arrayWithoutHoles(arr) {
1824
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
1825
- }
1826
- function _arrayLikeToArray(arr, len) {
1827
- if (len == null || len > arr.length) len = arr.length;
1828
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1829
- return arr2;
1830
- }
1831
- /**
1832
- * Handles the event of clicking outside of the wrapped component
1833
- *
1834
- * @usage:
1835
-
1836
- const App = () => {
1837
-
1838
- const [show, setShow] = useState<boolean>(false);
1839
- const dropdownRef = useRef<HTMLDivElement>(null);
1840
-
1841
- useClickOutside({
1842
- enabled: show && dropdownRef.current,
1843
- isOutside: (event: any) => {
1844
- return event.target.closest(`.test__wrapper`) === null && event.target.closest(`.test__wrapper2`) === null;
1845
- },
1846
- handle: (event: any) => {
1847
- // do something
1848
- //...
1849
- },
1850
- spyElement: document
1851
- }, [show, dropdownRef]);
1852
- };
1853
-
1854
- */
1855
-
1856
- function useClickOutside(_ref, deps) {
1857
- var enabled = _ref.enabled,
1858
- isOutside = _ref.isOutside,
1859
- handle = _ref.handle,
1860
- _ref$spyElement = _ref.spyElement,
1861
- spyElement = _ref$spyElement === void 0 ? typeof document === 'undefined' ? null : document : _ref$spyElement;
1862
- var isOutsideRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(isOutside);
1863
- var handleRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(handle);
1864
- (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1865
- isOutsideRef.current = isOutside;
1866
-
1867
- // fix possible issue if clicking on a focusable element
1868
- handleRef.current = handle;
1869
- }, [isOutside, handle]);
1870
- (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1871
- if (enabled) {
1872
- var eventHandler = function eventHandler(event) {
1873
- var _isOutsideRef$current;
1874
- if ((_isOutsideRef$current = isOutsideRef.current) !== null && _isOutsideRef$current !== void 0 && _isOutsideRef$current.call(isOutsideRef, event)) {
1875
- var _handleRef$current;
1876
- (_handleRef$current = handleRef.current) === null || _handleRef$current === void 0 ? void 0 : _handleRef$current.call(handleRef, event);
1877
- }
1878
- };
1879
- spyElement === null || spyElement === void 0 ? void 0 : spyElement.addEventListener('pointerdown', eventHandler);
1880
- return function () {
1881
- spyElement === null || spyElement === void 0 ? void 0 : spyElement.removeEventListener('pointerdown', eventHandler);
1882
- };
1883
- }
1884
- }, [enabled].concat(_toConsumableArray(deps)));
1885
- }
1886
- /* harmony default export */
1887
- var __WEBPACK_DEFAULT_EXPORT__ = useClickOutside;
1888
- })();
1889
-
1890
- /******/
1891
- return __webpack_exports__;
1892
- /******/
1893
- }()
1894
- );
1895
- });
1896
-
1897
- /***/ }),
1898
-
1899
- /***/ 85:
1900
- /***/ (function(module, exports, __webpack_require__) {
1901
-
1902
- /* module decorator */ module = __webpack_require__.nmd(module);
1903
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;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); }
1904
- (function webpackUniversalModuleDefinition(root, factory) {
1905
- if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1906
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1907
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1908
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
1909
- })(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
1910
- return (/******/function () {
1911
- // webpackBootstrap
1912
- /******/
1913
- "use strict";
1914
-
1915
- /******/
1916
- var __webpack_modules__ = {
1917
- /***/787: /***/function _(module) {
1918
- module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
1919
-
1920
- /***/
1921
- }
1922
-
1923
- /******/
1924
- };
1925
- /************************************************************************/
1926
- /******/ // The module cache
1927
- /******/
1928
- var __webpack_module_cache__ = {};
1929
- /******/
1930
- /******/ // The require function
1931
- /******/
1932
- function __nested_webpack_require_1465__(moduleId) {
1933
- /******/ // Check if module is in cache
1934
- /******/var cachedModule = __webpack_module_cache__[moduleId];
1935
- /******/
1936
- if (cachedModule !== undefined) {
1937
- /******/return cachedModule.exports;
1938
- /******/
1939
- }
1940
- /******/ // Create a new module (and put it into the cache)
1941
- /******/
1942
- var module = __webpack_module_cache__[moduleId] = {
1943
- /******/ // no module.id needed
1944
- /******/ // no module.loaded needed
1945
- /******/exports: {}
1946
- /******/
1947
- };
1948
- /******/
1949
- /******/ // Execute the module function
1950
- /******/
1951
- __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1465__);
1952
- /******/
1953
- /******/ // Return the exports of the module
1954
- /******/
1955
- return module.exports;
1956
- /******/
1957
- }
1958
- /******/
1959
- /************************************************************************/
1960
- /******/ /* webpack/runtime/compat get default export */
1961
- /******/
1962
- (function () {
1963
- /******/ // getDefaultExport function for compatibility with non-harmony modules
1964
- /******/__nested_webpack_require_1465__.n = function (module) {
1965
- /******/var getter = module && module.__esModule ? /******/function () {
1966
- return module['default'];
1967
- } : /******/function () {
1968
- return module;
1969
- };
1970
- /******/
1971
- __nested_webpack_require_1465__.d(getter, {
1972
- a: getter
1973
- });
1974
- /******/
1975
- return getter;
1976
- /******/
1977
- };
1978
- /******/
1979
- })();
1980
- /******/
1981
- /******/ /* webpack/runtime/define property getters */
1982
- /******/
1983
- (function () {
1984
- /******/ // define getter functions for harmony exports
1985
- /******/__nested_webpack_require_1465__.d = function (exports, definition) {
1986
- /******/for (var key in definition) {
1987
- /******/if (__nested_webpack_require_1465__.o(definition, key) && !__nested_webpack_require_1465__.o(exports, key)) {
1988
- /******/Object.defineProperty(exports, key, {
1989
- enumerable: true,
1990
- get: definition[key]
1991
- });
1992
- /******/
1993
- }
1994
- /******/
1995
- }
1996
- /******/
1997
- };
1998
- /******/
1999
- })();
2000
- /******/
2001
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
2002
- /******/
2003
- (function () {
2004
- /******/__nested_webpack_require_1465__.o = function (obj, prop) {
2005
- return Object.prototype.hasOwnProperty.call(obj, prop);
2006
- };
2007
- /******/
2008
- })();
2009
- /******/
2010
- /******/ /* webpack/runtime/make namespace object */
2011
- /******/
2012
- (function () {
2013
- /******/ // define __esModule on exports
2014
- /******/__nested_webpack_require_1465__.r = function (exports) {
2015
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2016
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
2017
- value: 'Module'
2018
- });
2019
- /******/
2020
- }
2021
- /******/
2022
- Object.defineProperty(exports, '__esModule', {
2023
- value: true
2024
- });
2025
- /******/
2026
- };
2027
- /******/
2028
- })();
2029
- /******/
2030
- /************************************************************************/
2031
- var __webpack_exports__ = {};
2032
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
2033
- (function () {
2034
- __nested_webpack_require_1465__.r(__webpack_exports__);
2035
- /* harmony export */
2036
- __nested_webpack_require_1465__.d(__webpack_exports__, {
2037
- /* harmony export */"default": function _default() {
2038
- return __WEBPACK_DEFAULT_EXPORT__;
2039
- }
2040
- /* harmony export */
2041
- });
2042
- /* harmony import */
2043
- var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
2044
- /* harmony import */
2045
- var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2046
- /**
2047
- * Create an available ID
2048
- *
2049
- */
2050
-
2051
- var useComId = function useComId() {
2052
- return "ID-".concat((0, react__WEBPACK_IMPORTED_MODULE_0__.useId)().replace(/\:/g, "-"));
2053
- };
2054
- /* harmony default export */
2055
- var __WEBPACK_DEFAULT_EXPORT__ = useComId;
2056
- })();
2057
-
2058
- /******/
2059
- return __webpack_exports__;
2060
- /******/
2061
- }()
2062
- );
2063
- });
2064
-
2065
- /***/ }),
2066
-
2067
- /***/ 499:
2068
- /***/ (function(module, exports, __webpack_require__) {
2069
-
2070
- /* module decorator */ module = __webpack_require__.nmd(module);
2071
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;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); }
2072
- (function webpackUniversalModuleDefinition(root, factory) {
2073
- if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2074
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2075
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
2076
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
2077
- })(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
2078
- return (/******/function () {
2079
- // webpackBootstrap
2080
- /******/
2081
- "use strict";
2082
-
2083
- /******/
2084
- var __webpack_modules__ = {
2085
- /***/318: /***/function _(__unused_webpack_module, __webpack_exports__, __nested_webpack_require_1139__) {
2086
- /* harmony export */__nested_webpack_require_1139__.d(__webpack_exports__, {
2087
- /* harmony export */"debounce": function debounce() {
2088
- return (/* binding */_debounce
2089
- );
2090
- },
2091
- /* harmony export */"throttle": function throttle() {
2092
- return (/* binding */_throttle
2093
- );
2094
- }
2095
- /* harmony export */
2096
- });
2097
- /*
2098
- * Debounce
2099
- *
2100
- * @param {Function} fn - A function to be executed within the time limit.
2101
- * @param {Number} limit - Waiting time.
2102
- * @return {*} - Returns a new function.
2103
- */
2104
- function _debounce(fn) {
2105
- var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
2106
- var timer;
2107
- return function () {
2108
- clearTimeout(timer);
2109
- timer = setTimeout(function () {
2110
- fn.apply(this, arguments);
2111
- }, limit);
2112
- };
2113
- }
2114
-
2115
- /*
2116
- * Throttle
2117
- *
2118
- * @param {Function} fn - A function to be executed within the time limit.
2119
- * @param {Number} limit - Waiting time.
2120
- * @return {*} - Returns a new function.
2121
- */
2122
- function _throttle(fn) {
2123
- var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
2124
- var waiting = false;
2125
- return function () {
2126
- if (!waiting) {
2127
- fn.apply(this, arguments);
2128
- waiting = true;
2129
- setTimeout(function () {
2130
- waiting = false;
2131
- }, limit);
2132
- }
2133
- };
2134
- }
2135
-
2136
- /***/
2137
- },
2138
-
2139
- /***/787: /***/function _(module) {
2140
- module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
2141
-
2142
- /***/
2143
- }
2144
-
2145
- /******/
2146
- };
2147
- /************************************************************************/
2148
- /******/ // The module cache
2149
- /******/
2150
- var __webpack_module_cache__ = {};
2151
- /******/
2152
- /******/ // The require function
2153
- /******/
2154
- function __nested_webpack_require_3331__(moduleId) {
2155
- /******/ // Check if module is in cache
2156
- /******/var cachedModule = __webpack_module_cache__[moduleId];
2157
- /******/
2158
- if (cachedModule !== undefined) {
2159
- /******/return cachedModule.exports;
2160
- /******/
2161
- }
2162
- /******/ // Create a new module (and put it into the cache)
2163
- /******/
2164
- var module = __webpack_module_cache__[moduleId] = {
2165
- /******/ // no module.id needed
2166
- /******/ // no module.loaded needed
2167
- /******/exports: {}
2168
- /******/
2169
- };
2170
- /******/
2171
- /******/ // Execute the module function
2172
- /******/
2173
- __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_3331__);
2174
- /******/
2175
- /******/ // Return the exports of the module
2176
- /******/
2177
- return module.exports;
2178
- /******/
2179
- }
2180
- /******/
2181
- /************************************************************************/
2182
- /******/ /* webpack/runtime/compat get default export */
2183
- /******/
2184
- (function () {
2185
- /******/ // getDefaultExport function for compatibility with non-harmony modules
2186
- /******/__nested_webpack_require_3331__.n = function (module) {
2187
- /******/var getter = module && module.__esModule ? /******/function () {
2188
- return module['default'];
2189
- } : /******/function () {
2190
- return module;
2191
- };
2192
- /******/
2193
- __nested_webpack_require_3331__.d(getter, {
2194
- a: getter
2195
- });
2196
- /******/
2197
- return getter;
2198
- /******/
2199
- };
2200
- /******/
2201
- })();
2202
- /******/
2203
- /******/ /* webpack/runtime/define property getters */
2204
- /******/
2205
- (function () {
2206
- /******/ // define getter functions for harmony exports
2207
- /******/__nested_webpack_require_3331__.d = function (exports, definition) {
2208
- /******/for (var key in definition) {
2209
- /******/if (__nested_webpack_require_3331__.o(definition, key) && !__nested_webpack_require_3331__.o(exports, key)) {
2210
- /******/Object.defineProperty(exports, key, {
2211
- enumerable: true,
2212
- get: definition[key]
2213
- });
2214
- /******/
2215
- }
2216
- /******/
2217
- }
2218
- /******/
2219
- };
2220
- /******/
2221
- })();
2222
- /******/
2223
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
2224
- /******/
2225
- (function () {
2226
- /******/__nested_webpack_require_3331__.o = function (obj, prop) {
2227
- return Object.prototype.hasOwnProperty.call(obj, prop);
2228
- };
2229
- /******/
2230
- })();
2231
- /******/
2232
- /******/ /* webpack/runtime/make namespace object */
2233
- /******/
2234
- (function () {
2235
- /******/ // define __esModule on exports
2236
- /******/__nested_webpack_require_3331__.r = function (exports) {
2237
- /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2238
- /******/Object.defineProperty(exports, Symbol.toStringTag, {
2239
- value: 'Module'
2240
- });
2241
- /******/
2242
- }
2243
- /******/
2244
- Object.defineProperty(exports, '__esModule', {
2245
- value: true
2246
- });
2247
- /******/
2248
- };
2249
- /******/
2250
- })();
2251
- /******/
2252
- /************************************************************************/
2253
- var __webpack_exports__ = {};
2254
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
2255
- (function () {
2256
- __nested_webpack_require_3331__.r(__webpack_exports__);
2257
- /* harmony export */
2258
- __nested_webpack_require_3331__.d(__webpack_exports__, {
2259
- /* harmony export */"default": function _default() {
2260
- return __WEBPACK_DEFAULT_EXPORT__;
2261
- }
2262
- /* harmony export */
2263
- });
2264
- /* harmony import */
2265
- var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3331__(787);
2266
- /* harmony import */
2267
- var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3331__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2268
- /* harmony import */
2269
- var _libs_performance__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3331__(318);
2270
- function _slicedToArray(arr, i) {
2271
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
2272
- }
2273
- function _nonIterableRest() {
2274
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2275
- }
2276
- function _unsupportedIterableToArray(o, minLen) {
2277
- if (!o) return;
2278
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2279
- var n = Object.prototype.toString.call(o).slice(8, -1);
2280
- if (n === "Object" && o.constructor) n = o.constructor.name;
2281
- if (n === "Map" || n === "Set") return Array.from(o);
2282
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2283
- }
2284
- function _arrayLikeToArray(arr, len) {
2285
- if (len == null || len > arr.length) len = arr.length;
2286
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
2287
- return arr2;
2288
- }
2289
- function _iterableToArrayLimit(arr, i) {
2290
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
2291
- if (null != _i) {
2292
- var _s,
2293
- _e,
2294
- _x,
2295
- _r,
2296
- _arr = [],
2297
- _n = !0,
2298
- _d = !1;
2299
- try {
2300
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
2301
- if (Object(_i) !== _i) return;
2302
- _n = !1;
2303
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
2304
- } catch (err) {
2305
- _d = !0, _e = err;
2306
- } finally {
2307
- try {
2308
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
2309
- } finally {
2310
- if (_d) throw _e;
2311
- }
2312
- }
2313
- return _arr;
2314
- }
2315
- }
2316
- function _arrayWithHoles(arr) {
2317
- if (Array.isArray(arr)) return arr;
2318
- }
2319
- /**
2320
- * Listens for scrolls the window to a particular place in the document
2321
- *
2322
- * @usage:
2323
-
2324
- const App = () => {
2325
- const [scrollData, windowScrollUpdate] = useWindowScroll({
2326
- performance: ['debounce', 500], // "['debounce', 500]" or "['throttle', 500]"
2327
- handle: (scrollData) => {
2328
- // do something
2329
- console.log(scrollData);
2330
- }
2331
- });
2332
- };
2333
-
2334
- */
2335
-
2336
- var useWindowScroll = function useWindowScroll(_ref) {
2337
- var enabled = _ref.enabled,
2338
- performance = _ref.performance,
2339
- handle = _ref.handle;
2340
- var windowScrollUpdate;
2341
- var _performance = _slicedToArray(performance, 2),
2342
- performanceName = _performance[0],
2343
- performanceLimit = _performance[1];
2344
- var _useState = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)({
2345
- x: 0,
2346
- y: 0
2347
- }),
2348
- _useState2 = _slicedToArray(_useState, 2),
2349
- scrollData = _useState2[0],
2350
- setScrollData = _useState2[1];
2351
- var eventHandlerScroll = function eventHandlerScroll(e) {
2352
- var doc = document.documentElement;
2353
- var left = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
2354
- var top = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
2355
- var res = {
2356
- x: left,
2357
- y: top
2358
- };
2359
- setScrollData(res);
2360
- if (typeof handle === "function") handle(res);
2361
- };
2362
- if (performanceName === "debounce") windowScrollUpdate = (0, _libs_performance__WEBPACK_IMPORTED_MODULE_1__.debounce)(eventHandlerScroll, parseFloat(performanceLimit));
2363
- if (performanceName === "throttle") windowScrollUpdate = (0, _libs_performance__WEBPACK_IMPORTED_MODULE_1__.throttle)(eventHandlerScroll, parseFloat(performanceLimit));
2364
- (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2365
- window.addEventListener("scroll", windowScrollUpdate);
2366
- window.addEventListener("touchmove", windowScrollUpdate);
2367
- return function () {
2368
- window.removeEventListener("scroll", windowScrollUpdate);
2369
- window.removeEventListener("touchmove", windowScrollUpdate);
2370
- };
2371
- }, []);
2372
- return [scrollData, windowScrollUpdate];
2373
- };
2374
- /* harmony default export */
2375
- var __WEBPACK_DEFAULT_EXPORT__ = useWindowScroll;
2376
- })();
2377
-
2378
- /******/
2379
- return __webpack_exports__;
2380
- /******/
2381
- }()
2382
- );
2383
- });
2384
-
2385
- /***/ }),
2386
-
2387
- /***/ 787:
2388
- /***/ ((module) => {
2389
-
2390
- "use strict";
2391
- module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
2392
-
2393
- /***/ }),
2394
-
2395
- /***/ 156:
2396
- /***/ ((module) => {
2397
-
2398
- "use strict";
2399
- module.exports = __WEBPACK_EXTERNAL_MODULE__156__;
2400
-
2401
- /***/ })
2402
-
2403
- /******/ });
2404
- /************************************************************************/
2405
- /******/ // The module cache
2406
- /******/ var __webpack_module_cache__ = {};
2407
- /******/
2408
- /******/ // The require function
2409
- /******/ function __webpack_require__(moduleId) {
2410
- /******/ // Check if module is in cache
2411
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
2412
- /******/ if (cachedModule !== undefined) {
2413
- /******/ return cachedModule.exports;
2414
- /******/ }
2415
- /******/ // Create a new module (and put it into the cache)
2416
- /******/ var module = __webpack_module_cache__[moduleId] = {
2417
- /******/ id: moduleId,
2418
- /******/ loaded: false,
2419
- /******/ exports: {}
2420
- /******/ };
2421
- /******/
2422
- /******/ // Execute the module function
2423
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
2424
- /******/
2425
- /******/ // Flag the module as loaded
2426
- /******/ module.loaded = true;
2427
- /******/
2428
- /******/ // Return the exports of the module
2429
- /******/ return module.exports;
2430
- /******/ }
2431
- /******/
2432
- /************************************************************************/
2433
- /******/ /* webpack/runtime/compat get default export */
2434
- /******/ (() => {
2435
- /******/ // getDefaultExport function for compatibility with non-harmony modules
2436
- /******/ __webpack_require__.n = (module) => {
2437
- /******/ var getter = module && module.__esModule ?
2438
- /******/ () => (module['default']) :
2439
- /******/ () => (module);
2440
- /******/ __webpack_require__.d(getter, { a: getter });
2441
- /******/ return getter;
2442
- /******/ };
2443
- /******/ })();
2444
- /******/
2445
- /******/ /* webpack/runtime/define property getters */
2446
- /******/ (() => {
2447
- /******/ // define getter functions for harmony exports
2448
- /******/ __webpack_require__.d = (exports, definition) => {
2449
- /******/ for(var key in definition) {
2450
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
2451
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
2452
- /******/ }
2453
- /******/ }
2454
- /******/ };
2455
- /******/ })();
2456
- /******/
2457
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
2458
- /******/ (() => {
2459
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
2460
- /******/ })();
2461
- /******/
2462
- /******/ /* webpack/runtime/make namespace object */
2463
- /******/ (() => {
2464
- /******/ // define __esModule on exports
2465
- /******/ __webpack_require__.r = (exports) => {
2466
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2467
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2468
- /******/ }
2469
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
2470
- /******/ };
2471
- /******/ })();
2472
- /******/
2473
- /******/ /* webpack/runtime/node module decorator */
2474
- /******/ (() => {
2475
- /******/ __webpack_require__.nmd = (module) => {
2476
- /******/ module.paths = [];
2477
- /******/ if (!module.children) module.children = [];
2478
- /******/ return module;
2479
- /******/ };
2480
- /******/ })();
2481
- /******/
2482
- /************************************************************************/
2483
- var __webpack_exports__ = {};
2484
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
2485
- (() => {
2486
- "use strict";
2487
- // ESM COMPAT FLAG
2488
- __webpack_require__.r(__webpack_exports__);
2489
-
2490
- // EXPORTS
2491
- __webpack_require__.d(__webpack_exports__, {
2492
- "default": () => (/* binding */ src)
2493
- });
2494
-
2495
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
2496
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
2497
- var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
2498
- // EXTERNAL MODULE: ../RootPortal/dist/cjs/index.js
2499
- var cjs = __webpack_require__(909);
2500
- var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
2501
- // EXTERNAL MODULE: ../Utils/dist/cjs/useComId.js
2502
- var useComId = __webpack_require__(85);
2503
- var useComId_default = /*#__PURE__*/__webpack_require__.n(useComId);
2504
- // EXTERNAL MODULE: ../Utils/dist/cjs/useWindowScroll.js
2505
- var useWindowScroll = __webpack_require__(499);
2506
- var useWindowScroll_default = /*#__PURE__*/__webpack_require__.n(useWindowScroll);
2507
- // EXTERNAL MODULE: ../Utils/dist/cjs/useClickOutside.js
2508
- var useClickOutside = __webpack_require__(761);
2509
- var useClickOutside_default = /*#__PURE__*/__webpack_require__.n(useClickOutside);
2510
- // EXTERNAL MODULE: ../Utils/dist/cjs/extract.js
2511
- var extract = __webpack_require__(135);
2512
- // EXTERNAL MODULE: ../Utils/dist/cjs/convert.js
2513
- var convert = __webpack_require__(79);
2514
- // EXTERNAL MODULE: ../Utils/dist/cjs/getElementProperty.js
2515
- var getElementProperty = __webpack_require__(767);
2516
- // EXTERNAL MODULE: ../Utils/dist/cjs/tree.js
2517
- var tree = __webpack_require__(438);
2518
- // EXTERNAL MODULE: ../Utils/dist/cjs/format-string.js
2519
- var format_string = __webpack_require__(933);
2520
- // EXTERNAL MODULE: ../Utils/dist/cjs/cls.js
2521
- var cls = __webpack_require__(188);
2522
- ;// CONCATENATED MODULE: ./src/Group.tsx
2523
-
2524
-
2525
- function Group(props) {
2526
- var perColumnHeadersShow = props.perColumnHeadersShow,
2527
- level = props.level,
2528
- columnTitle = props.columnTitle,
2529
- data = props.data,
2530
- cleanNodeBtnClassName = props.cleanNodeBtnClassName,
2531
- cleanNodeBtnContent = props.cleanNodeBtnContent,
2532
- selectEv = props.selectEv;
2533
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, data.map(function (item, index) {
2534
- if (item.id.toString().indexOf('$EMPTY_ID_') < 0) {
2535
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2536
- key: index,
2537
- "data-opt": "true",
2538
- "data-index": index,
2539
- "data-id": item.id,
2540
- "data-value": JSON.stringify(item),
2541
- "data-level": level,
2542
- "data-query": item.queryId,
2543
- className: (0,cls.combinedCls)('casc-menu-e2e__opt', {
2544
- 'active': item.current
2545
- }),
2546
- dangerouslySetInnerHTML: {
2547
- __html: typeof item.label !== 'undefined' ? item.label : item.name // "item.label" usually uses hierarchical style
2548
- },
2549
-
2550
- onClick: function onClick(e) {
2551
- return selectEv === null || selectEv === void 0 ? void 0 : selectEv(e, item, index);
2552
- }
2553
- });
2554
- } else {
2555
- return columnTitle[level] === '' || perColumnHeadersShow === false ? null : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("h3", {
2556
- key: index,
2557
- className: "casc-menu-e2e__opt-header"
2558
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
2559
- dangerouslySetInnerHTML: {
2560
- __html: columnTitle[level]
2561
- }
2562
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2563
- className: "casc-menu-e2e__opt-header__clean"
2564
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
2565
- tabIndex: -1,
2566
- href: "#",
2567
- className: cleanNodeBtnClassName || 'btn btn-link p-0 m-0 text-decoration-none',
2568
- "data-opt": "true",
2569
- "data-opt-header": "true",
2570
- "data-index": index,
2571
- "data-id": item.id,
2572
- "data-value": JSON.stringify(item),
2573
- "data-level": level,
2574
- "data-query": item.queryId,
2575
- onClick: function onClick(e) {
2576
- return selectEv === null || selectEv === void 0 ? void 0 : selectEv(e, item, index);
2577
- }
2578
- }, cleanNodeBtnContent || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
2579
- width: "12px",
2580
- height: "12px",
2581
- viewBox: "0 0 16 16"
2582
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
2583
- fill: "inherit",
2584
- d: "M9.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L6.59 8 3.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z",
2585
- fillRule: "evenodd"
2586
- })))));
2587
- }
2588
- }));
2589
- }
2590
- ;// CONCATENATED MODULE: ./src/index.tsx
2591
- var _excluded = ["popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "searchable", "searchPlaceholder", "perColumnHeadersShow", "exceededSidePosOffset", "readOnly", "disabled", "required", "requiredLabel", "units", "iconLeft", "iconRight", "minLength", "maxLength", "value", "label", "placeholder", "name", "id", "extractValueByBraces", "destroyParentIdMatch", "columnTitle", "depth", "loader", "inputable", "displayResultArrow", "controlArrow", "valueType", "showCloseBtn", "style", "tabIndex", "triggerClassName", "triggerContent", "cleanNodeBtnClassName", "cleanNodeBtnContent", "fetchArray", "onFetch", "onChange", "onBlur", "onFocus", "formatInputResult"];
2592
- 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; }
2593
- 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); }
2594
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2595
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2596
- 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."); }
2597
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
2598
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
2599
- 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); } }
2600
- 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); }); }; }
2601
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2602
- 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."); }
2603
- 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); }
2604
- 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; }
2605
- 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; } }
2606
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2607
- 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; }
2608
- 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; }
2609
-
2610
-
2611
-
2612
-
2613
-
2614
-
2615
-
2616
-
2617
-
2618
-
2619
-
2620
-
2621
- var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, externalRef) {
2622
- var popupRef = props.popupRef,
2623
- wrapperClassName = props.wrapperClassName,
2624
- controlClassName = props.controlClassName,
2625
- controlExClassName = props.controlExClassName,
2626
- controlGroupWrapperClassName = props.controlGroupWrapperClassName,
2627
- controlGroupTextClassName = props.controlGroupTextClassName,
2628
- _props$searchable = props.searchable,
2629
- searchable = _props$searchable === void 0 ? false : _props$searchable,
2630
- _props$searchPlacehol = props.searchPlaceholder,
2631
- searchPlaceholder = _props$searchPlacehol === void 0 ? '' : _props$searchPlacehol,
2632
- _props$perColumnHeade = props.perColumnHeadersShow,
2633
- perColumnHeadersShow = _props$perColumnHeade === void 0 ? true : _props$perColumnHeade,
2634
- exceededSidePosOffset = props.exceededSidePosOffset,
2635
- readOnly = props.readOnly,
2636
- disabled = props.disabled,
2637
- required = props.required,
2638
- requiredLabel = props.requiredLabel,
2639
- units = props.units,
2640
- iconLeft = props.iconLeft,
2641
- iconRight = props.iconRight,
2642
- minLength = props.minLength,
2643
- maxLength = props.maxLength,
2644
- value = props.value,
2645
- label = props.label,
2646
- placeholder = props.placeholder,
2647
- name = props.name,
2648
- id = props.id,
2649
- extractValueByBraces = props.extractValueByBraces,
2650
- destroyParentIdMatch = props.destroyParentIdMatch,
2651
- columnTitle = props.columnTitle,
2652
- depth = props.depth,
2653
- loader = props.loader,
2654
- _props$inputable = props.inputable,
2655
- inputable = _props$inputable === void 0 ? false : _props$inputable,
2656
- displayResultArrow = props.displayResultArrow,
2657
- controlArrow = props.controlArrow,
2658
- valueType = props.valueType,
2659
- showCloseBtn = props.showCloseBtn,
2660
- style = props.style,
2661
- tabIndex = props.tabIndex,
2662
- triggerClassName = props.triggerClassName,
2663
- triggerContent = props.triggerContent,
2664
- cleanNodeBtnClassName = props.cleanNodeBtnClassName,
2665
- cleanNodeBtnContent = props.cleanNodeBtnContent,
2666
- fetchArray = props.fetchArray,
2667
- onFetch = props.onFetch,
2668
- onChange = props.onChange,
2669
- onBlur = props.onBlur,
2670
- onFocus = props.onFocus,
2671
- formatInputResult = props.formatInputResult,
2672
- attributes = _objectWithoutProperties(props, _excluded);
2673
- var DEPTH = depth || 1055; // the default value same as bootstrap
2674
- var POS_OFFSET = 0;
2675
- var EXCEEDED_SIDE_POS_OFFSET = Number(exceededSidePosOffset) || 15;
2676
- var VALUE_BY_BRACES = typeof extractValueByBraces === 'undefined' ? true : extractValueByBraces;
2677
- var uniqueID = useComId_default()();
2678
- var idRes = id || uniqueID;
2679
- var rootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
2680
- var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
2681
- var listRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
2682
- var MIN_SPACE_FOR_DROPDOWN = 200; // Minimum space needed to show dropdown below trigger
2683
-
2684
- // searchable
2685
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
2686
- _useState2 = _slicedToArray(_useState, 2),
2687
- columnSearchKeywords = _useState2[0],
2688
- setColumnSearchKeywords = _useState2[1];
2689
- var propExist = function propExist(p) {
2690
- return typeof p !== 'undefined' && p !== null && p !== '';
2691
- };
2692
- var resultInput = function resultInput(curData, curQueryIdsData) {
2693
- return VALUE_BY_BRACES ? (0,convert.convertArrToValByBraces)(curData.map(function (item, i) {
2694
- return "".concat(item, "[").concat(curQueryIdsData[i], "]");
2695
- })) : curData.map(function (item, i) {
2696
- return "".concat(item, "[").concat(curQueryIdsData[i], "]");
2697
- }).join(',');
2698
- };
2699
- var resultInputPureText = function resultInputPureText(inputStr) {
2700
- return VALUE_BY_BRACES ? "{".concat(inputStr, "[]}") : "".concat(inputStr, "[]");
2701
-
2702
- // value1: {{curLabel[curValue]}[]}
2703
- // value2: curLabel[curValue][]
2704
- };
2705
-
2706
- // exposes the following methods
2707
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(popupRef, function () {
2708
- return {
2709
- close: function close() {
2710
- cancel();
2711
- }
2712
- };
2713
- }, [popupRef]);
2714
-
2715
- // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2716
- // DO NOT USE `useState()` for `allData`,, `optData`, `dictionaryData`, `listData`, `selectedData`, `selectedDataByClick`,
2717
- // because the list uses vanilla JS DOM events which will cause the results of useState not to be displayed in real time.
2718
- // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2719
-
2720
- // current data depth (GLOBAL)
2721
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
2722
- _useState4 = _slicedToArray(_useState3, 2),
2723
- currentDataDepth = _useState4[0],
2724
- setCurrentDataDepth = _useState4[1];
2725
-
2726
- // all data from fetched data (GLOBAL)
2727
- var allData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
2728
-
2729
- // options data (GLOBAL)
2730
- var optData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
2731
-
2732
- // dictionary data
2733
- var dictionaryData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
2734
- var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
2735
- _useState6 = _slicedToArray(_useState5, 2),
2736
- loading = _useState6[0],
2737
- setLoading = _useState6[1];
2738
- var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
2739
- _useState8 = _slicedToArray(_useState7, 2),
2740
- columnTitleData = _useState8[0],
2741
- setColumnTitleData = _useState8[1];
2742
- var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
2743
- _useState10 = _slicedToArray(_useState9, 2),
2744
- hasErr = _useState10[0],
2745
- setHasErr = _useState10[1];
2746
- var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
2747
- _useState12 = _slicedToArray(_useState11, 2),
2748
- firstDataFeched = _useState12[0],
2749
- setFirstDataFeched = _useState12[1];
2750
- var _useState13 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(value || ''),
2751
- _useState14 = _slicedToArray(_useState13, 2),
2752
- changedVal = _useState14[0],
2753
- setChangedVal = _useState14[1];
2754
-
2755
- //for variable
2756
- var listData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
2757
- var selectedData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
2758
- labels: [],
2759
- values: [],
2760
- queryIds: []
2761
- });
2762
-
2763
- // destroy `queryId` match
2764
- var selectedDataByClick = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
2765
- labels: [],
2766
- values: [],
2767
- queryIds: []
2768
- });
2769
- var _useState15 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
2770
- _useState16 = _slicedToArray(_useState15, 2),
2771
- isShow = _useState16[0],
2772
- setIsShow = _useState16[1];
2773
-
2774
- // click outside
2775
- useClickOutside_default()({
2776
- enabled: isShow && rootRef.current && listRef.current,
2777
- isOutside: function isOutside(event) {
2778
- // close dropdown when other dropdown is opened
2779
- return rootRef.current !== event.target && !rootRef.current.contains(event.target) && listRef.current !== event.target && !listRef.current.contains(event.target);
2780
- },
2781
- handle: function handle(event) {
2782
- cancel();
2783
- }
2784
- }, [isShow, rootRef, listRef]);
2785
-
2786
- // Add function to the element that should be used as the scrollable area.
2787
- var _useWindowScroll = useWindowScroll_default()({
2788
- performance: ['debounce', 500],
2789
- // "['debounce', 500]" or "['throttle', 500]"
2790
- handle: function handle(scrollData) {
2791
- popwinPosInit(false);
2792
- }
2793
- }),
2794
- _useWindowScroll2 = _slicedToArray(_useWindowScroll, 2),
2795
- scrollData = _useWindowScroll2[0],
2796
- windowScrollUpdate = _useWindowScroll2[1];
2797
- function popwinPosInit() {
2798
- var showAct = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
2799
- if (rootRef.current === null || inputRef.current === null) return;
2800
-
2801
- // update modal position
2802
- var _modalRef = document.querySelector("#casc-menu-e2e__items-wrapper-".concat(idRes));
2803
- var _triggerRef = inputRef.current;
2804
-
2805
- // console.log(getAbsolutePositionOfStage(_triggerRef));
2806
-
2807
- if (_modalRef === null) return;
2808
- var _getAbsolutePositionO = (0,getElementProperty.getAbsolutePositionOfStage)(_triggerRef),
2809
- x = _getAbsolutePositionO.x;
2810
- var _getAbsolutePositionO2 = (0,getElementProperty.getAbsolutePositionOfStage)(_triggerRef),
2811
- y = _getAbsolutePositionO2.y,
2812
- width = _getAbsolutePositionO2.width,
2813
- height = _getAbsolutePositionO2.height;
2814
- var _triggerBox = _triggerRef.getBoundingClientRect();
2815
- var targetPos = '';
2816
-
2817
- // STEP 1:
2818
- //-----------
2819
- // display wrapper
2820
- if (showAct) _modalRef.classList.add('active');
2821
-
2822
- // STEP 2:
2823
- //-----------
2824
- // Detect position
2825
- if (window.innerHeight - _triggerBox.top > MIN_SPACE_FOR_DROPDOWN) {
2826
- targetPos = 'bottom';
2827
- } else {
2828
- targetPos = 'top';
2829
- }
2830
-
2831
- // STEP 3:
2832
- //-----------
2833
- // Adjust position
2834
- if (targetPos === 'top') {
2835
- _modalRef.style.left = x + 'px';
2836
- //_modalRef.style.top = y - POS_OFFSET - (listRef.current.clientHeight) - 2 + 'px';
2837
- _modalRef.style.top = 'auto';
2838
- _modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
2839
- _modalRef.style.setProperty('position', 'fixed', 'important');
2840
- _modalRef.classList.add('pos-top');
2841
- }
2842
- if (targetPos === 'bottom') {
2843
- _modalRef.style.left = x + 'px';
2844
- _modalRef.style.bottom = 'auto';
2845
- _modalRef.style.top = y + height + POS_OFFSET + 'px';
2846
- _modalRef.style.setProperty('position', 'absolute', 'important');
2847
- _modalRef.classList.remove('pos-top');
2848
- }
2849
-
2850
- // STEP 4:
2851
- //-----------
2852
- // Determine whether it exceeds the far right or left side of the screen
2853
- var _modalContent = _modalRef;
2854
- var _modalBox = _modalContent.getBoundingClientRect();
2855
- if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {
2856
- // 10 pixels is used to account for some bias in mobile devices
2857
- if (_modalBox.right + 10 > window.innerWidth) {
2858
- var _modalOffsetPosition = _modalBox.right - window.innerWidth + EXCEEDED_SIDE_POS_OFFSET;
2859
- _modalContent.dataset.offset = _modalOffsetPosition;
2860
- _modalContent.style.marginLeft = "-".concat(_modalOffsetPosition, "px");
2861
- // console.log('_modalPosition: ', _modalOffsetPosition)
2862
- }
2863
-
2864
- if (_modalBox.left - 10 < 0) {
2865
- var _modalOffsetPosition2 = Math.abs(_modalBox.left) + EXCEEDED_SIDE_POS_OFFSET;
2866
- _modalContent.dataset.offset = _modalOffsetPosition2;
2867
- _modalContent.style.marginLeft = "".concat(_modalOffsetPosition2, "px");
2868
- // console.log('_modalPosition: ', _modalOffsetPosition)
2869
- }
2870
- }
2871
- }
2872
-
2873
- function popwinPosHide() {
2874
- var _modalRef = document.querySelector("#casc-menu-e2e__items-wrapper-".concat(idRes));
2875
- if (_modalRef !== null) {
2876
- // remove classnames and styles
2877
- _modalRef.classList.remove('active');
2878
- }
2879
- }
2880
- function updateColDisplay(useFetch) {
2881
- var emptyAction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2882
- var level = arguments.length > 2 ? arguments[2] : undefined;
2883
- if (listRef.current === null) return;
2884
- var latestDisplayColIndex = 0;
2885
- var currentItemsInner = listRef.current.querySelector('.casc-menu-e2e__items-inner');
2886
- if (currentItemsInner !== null) {
2887
- var colItemsWrapper = [].slice.call(currentItemsInner.querySelectorAll('.casc-menu-e2e__items-col'));
2888
- colItemsWrapper.forEach(function (perCol) {
2889
- perCol.classList.remove('hide-col');
2890
- });
2891
- colItemsWrapper.some(function (perCol, i) {
2892
- var hasActive = [].slice.call(perCol.querySelectorAll('[data-opt]')).some(function (el) {
2893
- return el.classList.contains('active');
2894
- });
2895
- if (!hasActive) {
2896
- latestDisplayColIndex = i;
2897
- return true;
2898
- }
2899
- return false;
2900
- });
2901
-
2902
- // remove columns behind the current empty trigger
2903
- colItemsWrapper.forEach(function (perCol, i) {
2904
- if (!emptyAction) {
2905
- if (useFetch) {
2906
- if (i > latestDisplayColIndex && latestDisplayColIndex > 0) perCol.classList.add('hide-col');
2907
- } else {
2908
- if (i === latestDisplayColIndex && latestDisplayColIndex > 0) perCol.classList.add('hide-col');
2909
- }
2910
- } else {
2911
- if (typeof level !== 'undefined' && Number.isInteger(level)) {
2912
- if (i > level) perCol.classList.add('hide-col');
2913
- }
2914
- }
2915
- });
2916
- }
2917
- }
2918
- function cancel() {
2919
- // hide list
2920
- setIsShow(false);
2921
- popwinPosHide();
2922
- }
2923
- function activate() {
2924
- // show list
2925
- setIsShow(true);
2926
-
2927
- // update data depth
2928
- setCurrentDataDepth(0);
2929
-
2930
- // Execute the fetch task
2931
- if (!firstDataFeched) {
2932
- setLoading(true);
2933
- setFirstDataFeched(true);
2934
- doFetch(false, currentDataDepth, 0, false);
2935
- }
2936
-
2937
- // window position
2938
- setTimeout(function () {
2939
- popwinPosInit();
2940
- }, 0);
2941
- }
2942
- function fetchData(_x2, _x3, _x4) {
2943
- return _fetchData.apply(this, arguments);
2944
- } //
2945
- function _fetchData() {
2946
- _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_fetchArray, params, dataDepth) {
2947
- var parentId,
2948
- fetchFuncAsync,
2949
- fetchFuncMethod,
2950
- fetchCallback,
2951
- hierarchical,
2952
- indentation,
2953
- doubleIndent,
2954
- INDENT_PLACEHOLDER,
2955
- INDENT_LAST_PLACEHOLDER,
2956
- response,
2957
- _ORGIN_DATA,
2958
- _TEMP_ALL_DATA,
2959
- _EMPTY_SUPPORTED_DATA,
2960
- _temp_optData,
2961
- childList,
2962
- _args = arguments;
2963
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2964
- while (1) switch (_context.prev = _context.next) {
2965
- case 0:
2966
- parentId = _args.length > 3 && _args[3] !== undefined ? _args[3] : 0;
2967
- fetchFuncAsync = _fetchArray.fetchFuncAsync;
2968
- fetchFuncMethod = _fetchArray.fetchFuncMethod;
2969
- fetchCallback = _fetchArray.fetchCallback; //
2970
- hierarchical = _fetchArray.hierarchical;
2971
- indentation = _fetchArray.indentation;
2972
- doubleIndent = _fetchArray.doubleIndent;
2973
- INDENT_PLACEHOLDER = doubleIndent ? "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" : "&nbsp;&nbsp;&nbsp;&nbsp;";
2974
- INDENT_LAST_PLACEHOLDER = "".concat(typeof indentation !== 'undefined' && indentation !== '' ? "".concat(indentation, "&nbsp;&nbsp;") : '');
2975
- if (!(_typeof(fetchFuncAsync) === 'object')) {
2976
- _context.next = 34;
2977
- break;
2978
- }
2979
- //
2980
- setLoading(true);
2981
- _context.next = 13;
2982
- return fetchFuncAsync["".concat(fetchFuncMethod)].apply(fetchFuncAsync, _toConsumableArray(params.split(',')));
2983
- case 13:
2984
- response = _context.sent;
2985
- _ORGIN_DATA = response.data;
2986
- _TEMP_ALL_DATA = []; // loading
2987
- setLoading(false);
2988
- if (!(typeof _ORGIN_DATA[0] === 'undefined')) {
2989
- _context.next = 19;
2990
- break;
2991
- }
2992
- return _context.abrupt("return");
2993
- case 19:
2994
- // reset data structure
2995
- if (typeof fetchCallback === 'function') {
2996
- _ORGIN_DATA = fetchCallback(_ORGIN_DATA);
2997
- }
2998
-
2999
- // Determine whether the data structure matches
3000
- if (_ORGIN_DATA.length > 0 && typeof _ORGIN_DATA[0].id === 'undefined') {
3001
- console.warn('The data structure does not match, please refer to the example in the component documentation.');
3002
- setHasErr(true);
3003
- _ORGIN_DATA = [];
3004
- }
3005
-
3006
- // STEP 0-1: ===========
3007
- // Set hierarchical categories ( with sub-categories )
3008
- if (hierarchical) {
3009
- _ORGIN_DATA = (0,tree.addTreeDepth)(_ORGIN_DATA);
3010
- (0,tree.addTreeIndent)(_ORGIN_DATA, INDENT_PLACEHOLDER, INDENT_LAST_PLACEHOLDER, 'label');
3011
- }
3012
-
3013
- // STEP 0-2: ===========
3014
- // add data depth
3015
- _ORGIN_DATA.forEach(function (item) {
3016
- item.itemDepth = dataDepth;
3017
- });
3018
- if (dataDepth === 0) {
3019
- // STEP 1: ===========
3020
- // all data from fetched data
3021
- _TEMP_ALL_DATA = JSON.parse(JSON.stringify(_ORGIN_DATA));
3022
- allData.current = _TEMP_ALL_DATA;
3023
-
3024
- // STEP 2: ===========
3025
- // dictionary data (orginal)
3026
- dictionaryData.current = _TEMP_ALL_DATA;
3027
- }
3028
- if (dataDepth > 0) {
3029
- // STEP 1: ===========
3030
- // all data from fetched data
3031
- _TEMP_ALL_DATA = allData.current;
3032
- addChildrenOpt(_TEMP_ALL_DATA, parentId, _ORGIN_DATA);
3033
-
3034
- // STEP 2: ===========
3035
- // dictionary data (orginal)
3036
- dictionaryData.current = _TEMP_ALL_DATA;
3037
- }
3038
-
3039
- // STEP 3: ===========
3040
- // Add an empty item to each list to support empty item selection
3041
- _EMPTY_SUPPORTED_DATA = JSON.parse(JSON.stringify(_TEMP_ALL_DATA));
3042
- addEmptyOpt(_EMPTY_SUPPORTED_DATA, 0);
3043
-
3044
- // STEP 4: ===========
3045
- // Turn the data of each group into an array
3046
-
3047
- if (dataDepth === 0) {
3048
- _temp_optData = [_EMPTY_SUPPORTED_DATA];
3049
- optData.current = _temp_optData;
3050
- listData.current = _temp_optData;
3051
- }
3052
- if (dataDepth > 0) {
3053
- _temp_optData = listData.current;
3054
-
3055
- // Add an empty item to each list to support empty item selection
3056
- addEmptyOpt(_ORGIN_DATA, 0);
3057
- childList = _ORGIN_DATA;
3058
- _temp_optData[dataDepth] = childList;
3059
- optData.current = _temp_optData;
3060
- listData.current = optData.current;
3061
- }
3062
-
3063
- // STEP 5: ===========
3064
- //
3065
- onFetch === null || onFetch === void 0 ? void 0 : onFetch(_EMPTY_SUPPORTED_DATA, _ORGIN_DATA);
3066
-
3067
- // STEP 6: ===========
3068
- // update column display with DOM
3069
- updateColDisplay(true, false, undefined);
3070
- return _context.abrupt("return", [_ORGIN_DATA, _EMPTY_SUPPORTED_DATA]);
3071
- case 34:
3072
- return _context.abrupt("return", []);
3073
- case 35:
3074
- case "end":
3075
- return _context.stop();
3076
- }
3077
- }, _callee);
3078
- }));
3079
- return _fetchData.apply(this, arguments);
3080
- }
3081
- function doFetch(dataDepthMax) {
3082
- var dataDepth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3083
- var parentId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
3084
- var emptyAction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
3085
- // if empty selection is selected
3086
- if (emptyAction) return;
3087
-
3088
- // If the depth is max, no more requests
3089
- if (dataDepthMax) return;
3090
-
3091
- // other
3092
- if (typeof fetchArray[dataDepth] === 'undefined') return new Promise(function (resolve, reject) {
3093
- return resolve([[], []]);
3094
- });
3095
-
3096
- // data fetch action
3097
- var _oparams = fetchArray[dataDepth].fetchFuncMethodParams || [];
3098
- var _params = _oparams.map(function (item) {
3099
- return item !== '$QUERY_ID' ? item : parentId;
3100
- });
3101
- return fetchData(fetchArray[dataDepth], _params.join(','), dataDepth, parentId);
3102
- }
3103
- function handleFocus(event) {
3104
- var _rootRef$current;
3105
- (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
3106
-
3107
- //
3108
- handleDisplayOptions(null);
3109
-
3110
- //
3111
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
3112
- }
3113
- function handleBlur(event) {
3114
- var _rootRef$current2;
3115
- //----
3116
- //remove focus style
3117
- (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
3118
-
3119
- //
3120
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
3121
- }
3122
- function handleDisplayOptions(event) {
3123
- if (event) event.preventDefault();
3124
- if (isShow) return;
3125
- activate();
3126
- }
3127
- function handleClickItem(e, resValue, index, level, curData) {
3128
- e.preventDefault();
3129
- var maxDepth = fetchArray.length - 1;
3130
- var dataDepthMax = resValue.itemDepth === maxDepth;
3131
- var parentId = e.currentTarget.dataset.query;
3132
- var emptyAction = resValue.id.toString().indexOf('$EMPTY_ID_') < 0 ? false : true;
3133
-
3134
- // update data depth
3135
- //////////////////////////////////////////
3136
- setCurrentDataDepth(function (prevState) {
3137
- var _doFetch;
3138
- var _currentDataDepth = resValue.itemDepth + 1;
3139
-
3140
- // update column display with DOM
3141
- //////////////////////////////////////////
3142
- updateColDisplay(false, emptyAction, level);
3143
-
3144
- // Execute the fetch task
3145
- //////////////////////////////////////////
3146
- (_doFetch = doFetch(dataDepthMax, _currentDataDepth, parentId, emptyAction)) === null || _doFetch === void 0 ? void 0 : _doFetch.then(function (res) {
3147
- // if no data is available with request, close the modal
3148
- if (typeof res === 'undefined') {
3149
- updateColDisplay(false, true, level); // clean rest colums hardhanded
3150
- cancel();
3151
- }
3152
- });
3153
- return _currentDataDepth > maxDepth ? maxDepth : _currentDataDepth;
3154
- });
3155
-
3156
- //update selected data by clicked item
3157
- //////////////////////////////////////////
3158
- updateValueByClickedItem(resValue, level);
3159
-
3160
- // update value
3161
- //////////////////////////////////////////
3162
- var inputVal = updateValue(dictionaryData.current, resValue.id, level);
3163
-
3164
- // callback
3165
- //////////////////////////////////////////
3166
- if (typeof onChange === 'function') {
3167
- var curValString = valueType === 'value' ? inputVal[0] : inputVal[1];
3168
- var curValCallback = typeof formatInputResult === 'function' ? formatInputResult(VALUE_BY_BRACES ? (0,extract.extractContentsOfMixedCharactersWithBraces)(curValString) : (0,extract.extractContentsOfMixedCharactersWithComma)(curValString)) : curValString;
3169
- onChange(inputRef.current, resValue, index, level, curValCallback, cancel);
3170
- }
3171
-
3172
- // update data
3173
- //////////////////////////////////////////
3174
- var newData = curData; // such as: [Array(6), Array(3)]
3175
-
3176
- // remove Duplicate objects from JSON Array
3177
- newData = newData.filter(function (item, index, self) {
3178
- return index === self.findIndex(function (t) {
3179
- return JSON.stringify(t) === JSON.stringify(item);
3180
- });
3181
- });
3182
-
3183
- // All the elements from start(array.length - start) to the end of the array will be deleted.
3184
- newData.splice(level + 1);
3185
-
3186
- // When requesting a return asynchronously, a new column is added only under the currently clicked column,
3187
- // and the previous column cannot be affected.
3188
- // Make sure that subsequent asynchronous requests will only insert new columns towards the level+1 position.
3189
- listData.current = _toConsumableArray(newData);
3190
-
3191
- // active status
3192
- if (resValue.children) {
3193
- var childList = resValue.children;
3194
- markAllItems(childList);
3195
- newData[level + 1] = childList;
3196
- }
3197
- markCurrent(newData[level], index);
3198
-
3199
- // close modal
3200
- //////////////////////////////////////////
3201
- if (dataDepthMax && resValue.id.toString().indexOf('$EMPTY_ID_') < 0) {
3202
- //
3203
- cancel();
3204
- }
3205
-
3206
- // active current option with DOM
3207
- //////////////////////////////////////////
3208
- var currentItemsInner = e.currentTarget.closest('.casc-menu-e2e__items-inner');
3209
- if (currentItemsInner !== null) {
3210
- curData.forEach(function (v, col) {
3211
- var colItemsWrapper = currentItemsInner.querySelectorAll('.casc-menu-e2e__items-col');
3212
- colItemsWrapper.forEach(function (perCol) {
3213
- var _col = Number(perCol.dataset.col);
3214
- if (_col >= level) {
3215
- [].slice.call(perCol.querySelectorAll('[data-opt]')).forEach(function (node) {
3216
- node.classList.remove('active');
3217
- });
3218
- }
3219
- });
3220
- });
3221
-
3222
- // not header option
3223
- if (typeof e.currentTarget.dataset.optHeader === 'undefined') e.currentTarget.classList.add('active');
3224
- }
3225
- }
3226
-
3227
- /**
3228
- * Active the selected item
3229
- * @param arr
3230
- * @param index
3231
- * @returns
3232
- */
3233
- function markCurrent(arr, index) {
3234
- if (!Array.isArray(arr)) return;
3235
-
3236
- // click an item
3237
- //////////////////////////////////////////
3238
- for (var i = 0; i < arr.length; i++) {
3239
- if (i === index) {
3240
- arr[i].current = true;
3241
- } else {
3242
- arr[i].current = false;
3243
- }
3244
- }
3245
-
3246
- // return result
3247
- //////////////////////////////////////////
3248
- return arr;
3249
- }
3250
-
3251
- /**
3252
- * Deactivate all items
3253
- * @param arr
3254
- * @returns
3255
- */
3256
- function markAllItems(arr) {
3257
- for (var i = 0; i < arr.length; i++) {
3258
- arr[i].current = false;
3259
- if (arr[i].children) markAllItems(arr[i].children);
3260
- }
3261
- }
3262
- function updateValue(arr, targetVal) {
3263
- var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
3264
- var inputEl = inputRef.current;
3265
- var _valueData, _labelData, _queryIdsData;
3266
- if (targetVal.toString().indexOf('$EMPTY_ID_') >= 0) {
3267
- // If clearing the current column
3268
- //////////////////////////////////////////
3269
- _valueData = selectedData.current.values;
3270
- _labelData = selectedData.current.labels;
3271
- _queryIdsData = selectedData.current.queryIds;
3272
-
3273
- // update result to input
3274
- _valueData.splice(level);
3275
- _labelData.splice(level);
3276
- _queryIdsData.splice(level);
3277
-
3278
- //
3279
- selectedData.current = {
3280
- labels: _labelData,
3281
- values: _valueData,
3282
- queryIds: _queryIdsData
3283
- };
3284
- } else {
3285
- // click an item
3286
- //////////////////////////////////////////
3287
- //search JSON key that contains specific string
3288
- var _labels = queryResultOfJSON(arr, targetVal, 'value');
3289
- var _values = queryResultOfJSON(arr, targetVal, 'key');
3290
- var _queryIds = queryResultOfJSON(arr, targetVal, 'query');
3291
-
3292
- // update result to input
3293
- _valueData = _values ? _values.map(function (item) {
3294
- return item;
3295
- }) : [];
3296
- _labelData = _labels ? _labels.map(function (item) {
3297
- return item;
3298
- }) : [];
3299
- _queryIdsData = _queryIds ? _queryIds.map(function (item) {
3300
- return item;
3301
- }) : [];
3302
-
3303
- //
3304
- selectedData.current = {
3305
- labels: _labelData,
3306
- values: _valueData,
3307
- queryIds: _queryIdsData
3308
- };
3309
- }
3310
-
3311
- // update selected data
3312
- //////////////////////////////////////////
3313
- if (destroyParentIdMatch) {
3314
- _valueData = selectedDataByClick.current.values;
3315
- _labelData = selectedDataByClick.current.labels;
3316
- _queryIdsData = selectedDataByClick.current.queryIds;
3317
- }
3318
- var inputVal_0 = resultInput(_valueData, _queryIdsData);
3319
- var inputVal_1 = resultInput(_labelData, _queryIdsData);
3320
- if (valueType === 'value') {
3321
- if (inputEl !== null) setChangedVal(inputVal_0);
3322
- } else {
3323
- if (inputEl !== null) setChangedVal(inputVal_1);
3324
- }
3325
- return {
3326
- 0: inputVal_0,
3327
- 1: inputVal_1
3328
- };
3329
- }
3330
- function updateValueByClickedItem(targetData, level) {
3331
- //update selected data by clicked item
3332
- //////////////////////////////////////////
3333
- var _valueData = selectedDataByClick.current.values.slice(0, level + 1);
3334
- var _labelData = selectedDataByClick.current.labels.slice(0, level + 1);
3335
- var _queryIdsData = selectedDataByClick.current.queryIds.slice(0, level + 1);
3336
- _valueData.splice(level, 1, targetData.id);
3337
- _labelData.splice(level, 1, targetData.name);
3338
- if (Array.isArray(_queryIdsData)) _queryIdsData.splice(level, 1, targetData.queryId);
3339
- selectedDataByClick.current = {
3340
- labels: _labelData.filter(function (v) {
3341
- return v != '';
3342
- }),
3343
- values: _valueData.filter(function (v) {
3344
- return v.toString().indexOf('$EMPTY_ID_') < 0;
3345
- }),
3346
- queryIds: Array.isArray(_queryIdsData) ? _queryIdsData.filter(function (v) {
3347
- return v != undefined;
3348
- }) : _labelData.filter(function (v) {
3349
- return v != '';
3350
- })
3351
- };
3352
- }
3353
- function cleanValue() {
3354
- selectedData.current = {
3355
- labels: [],
3356
- values: [],
3357
- queryIds: []
3358
- };
3359
- selectedDataByClick.current = {
3360
- labels: [],
3361
- values: [],
3362
- queryIds: []
3363
- };
3364
- listData.current = [];
3365
- allData.current = [];
3366
- optData.current = [];
3367
- dictionaryData.current = [];
3368
- setChangedVal('');
3369
- setFirstDataFeched(false);
3370
- }
3371
- function chkValueExist(v) {
3372
- return typeof v !== 'undefined' && v !== '';
3373
- }
3374
- function initDefaultValue(defaultValue) {
3375
- var _doFetch2;
3376
- // STEP 1:
3377
- // Determine whether the splicing value of the default value is empty
3378
- //--------------------------------
3379
- if (chkValueExist(defaultValue)) {
3380
- // if the default value uses the pure string
3381
- if (!(0,extract.extractorExist)(defaultValue)) {
3382
- //Set a default value
3383
- selectedData.current = {
3384
- labels: [defaultValue],
3385
- values: [''],
3386
- queryIds: ['']
3387
- };
3388
- selectedDataByClick.current = {
3389
- labels: [defaultValue],
3390
- values: [''],
3391
- queryIds: ['']
3392
- };
3393
- setChangedVal(defaultValue);
3394
- return; // required RETURN
3395
- }
3396
-
3397
- //
3398
- var formattedDefaultValue = VALUE_BY_BRACES ? (0,extract.extractContentsOfBraces)(defaultValue) : defaultValue.split(',');
3399
- var emptyDefaultValueCheck = Array.isArray(formattedDefaultValue) ? formattedDefaultValue.every(function (item, index) {
3400
- if (item !== '[]') {
3401
- return false;
3402
- }
3403
- return true;
3404
- }) : true;
3405
- if (emptyDefaultValueCheck) {
3406
- cleanValue();
3407
- return; // required RETURN
3408
- }
3409
- }
3410
-
3411
- // STEP 2:
3412
- // change the value to trigger component rendering
3413
- //--------------------------------
3414
- if (!chkValueExist(defaultValue)) {
3415
- cleanValue();
3416
- return; // required RETURN
3417
- } else {
3418
- setChangedVal(defaultValue);
3419
- }
3420
-
3421
- // STEP 3:
3422
- // update the status of the first fetch
3423
- //--------------------------------
3424
- setFirstDataFeched(true);
3425
-
3426
- // STEP 4:
3427
- // do fetch
3428
- //--------------------------------
3429
- (_doFetch2 = doFetch(false, 0, 0, false)) === null || _doFetch2 === void 0 ? void 0 : _doFetch2.then(function (firstColResponse) {
3430
- var _ORGIN_DATA = firstColResponse[0];
3431
- var _CHILDREN_DATA = firstColResponse[1];
3432
- var activedIndex;
3433
- var allFetch = [];
3434
- var rowQueryAttr = valueType === 'value' ? 'id' : 'name';
3435
- var targetVal = defaultValue.match(/(\[.*?\])/gi).map(function (item, i) {
3436
- return VALUE_BY_BRACES ? (0,extract.extractContentsOfBraces)(defaultValue)[i].replace(item, '') : defaultValue.split(',')[i].replace(item, '');
3437
- });
3438
- var queryIds = (0,extract.extractContentsOfBrackets)(defaultValue);
3439
-
3440
- //
3441
- var _TEMP_ALL_DATA = [];
3442
-
3443
- //
3444
- var _allColumnsData = [];
3445
- var _allLables = [];
3446
- var _allValues = [];
3447
-
3448
- // loop over each column
3449
- //////////////////////////////////////////
3450
- var _loop = function _loop(col) {
3451
- if (col === 0) {
3452
- // STEP 1: ===========
3453
- //active item from current column
3454
- var newData = JSON.parse(JSON.stringify(_CHILDREN_DATA));
3455
- activedIndex = _CHILDREN_DATA.findIndex(function (item) {
3456
- return item[rowQueryAttr].toString() === targetVal[col].toString();
3457
- });
3458
- markAllItems(newData);
3459
- markCurrent(newData, activedIndex);
3460
-
3461
- // STEP 2: ===========
3462
- // all data from fetched data
3463
- _TEMP_ALL_DATA = _ORGIN_DATA;
3464
-
3465
- // STEP 3: ===========
3466
- // dictionary data (orginal)
3467
- // Same as the `STEP 2`
3468
-
3469
- // STEP 4: ===========
3470
- // update result data
3471
- if (activedIndex !== -1) {
3472
- _allLables.push(newData[activedIndex].name);
3473
- _allValues.push(newData[activedIndex].id);
3474
- }
3475
- _allColumnsData.push(newData);
3476
- }
3477
- if (col > 0) {
3478
- allFetch.push(doFetch(false, col, queryIds[col - 1], false));
3479
- }
3480
- };
3481
- for (var col = 0; col <= targetVal.length; col++) {
3482
- _loop(col);
3483
- }
3484
-
3485
- // fetch all columns except the first
3486
- //////////////////////////////////////////
3487
- Promise.all(allFetch).then(function (values) {
3488
- values.filter(function (v) {
3489
- return typeof v !== 'undefined';
3490
- }).forEach(function (colResponse, i) {
3491
- var _CURRENT_COL_DATA = colResponse[0];
3492
- var curDepth = i + 1;
3493
-
3494
- // STEP 1: ===========
3495
- //active item from current column
3496
- var newData = JSON.parse(JSON.stringify(_CURRENT_COL_DATA));
3497
- activedIndex = newData.findIndex(function (item) {
3498
- if (typeof targetVal[curDepth] !== 'undefined') {
3499
- return item[rowQueryAttr].toString() === targetVal[curDepth].toString();
3500
- }
3501
- });
3502
- markAllItems(newData);
3503
- markCurrent(newData, activedIndex);
3504
-
3505
- // STEP 2: ===========
3506
- // all data from fetched data
3507
- if (typeof values[curDepth] !== 'undefined') {
3508
- var childList = values[curDepth][0];
3509
-
3510
- // if the value of some column is not fetched
3511
- if (typeof newData[activedIndex] !== 'undefined') newData[activedIndex].children = childList;
3512
- }
3513
- _TEMP_ALL_DATA.forEach(function (item) {
3514
- if (item.id === queryIds[i]) item.children = newData;
3515
- });
3516
-
3517
- // STEP 3: ===========
3518
- // dictionary data (orginal)
3519
- dictionaryData.current = newData;
3520
-
3521
- // STEP 4: ===========
3522
- // update result data
3523
- if (activedIndex !== -1) {
3524
- _allLables.push(newData[activedIndex].name);
3525
- _allValues.push(newData[activedIndex].id);
3526
- }
3527
- _allColumnsData.push(newData);
3528
- return true;
3529
- });
3530
-
3531
- // STEP 5: ===========
3532
- // all data from fetched data
3533
- allData.current = _TEMP_ALL_DATA;
3534
-
3535
- // STEP 6: ===========
3536
- // dictionary data (orginal)
3537
- dictionaryData.current = _TEMP_ALL_DATA;
3538
-
3539
- // STEP 7: ===========
3540
- //update data
3541
- optData.current = _allColumnsData;
3542
- listData.current = _allColumnsData;
3543
-
3544
- // STEP 8: ===========
3545
- //Set a default value
3546
- selectedData.current = {
3547
- labels: _allLables,
3548
- values: _allValues,
3549
- queryIds: queryIds
3550
- };
3551
- selectedDataByClick.current = {
3552
- labels: _allLables,
3553
- values: _allValues,
3554
- queryIds: queryIds
3555
- };
3556
- });
3557
- });
3558
- }
3559
- function fillColumnTitle() {
3560
- var _Array;
3561
- var dataDepth = fetchArray.length;
3562
- var oldColumnTitleData = columnTitle ? columnTitle : [];
3563
- var newColumnTitleData = (_Array = new Array(dataDepth)) === null || _Array === void 0 ? void 0 : _Array.fill('');
3564
- oldColumnTitleData.forEach(function (item, index) {
3565
- newColumnTitleData[index] = item;
3566
- });
3567
-
3568
- //
3569
- if (oldColumnTitleData.length > dataDepth) {
3570
- newColumnTitleData.splice(dataDepth, oldColumnTitleData.length - dataDepth);
3571
- }
3572
- setColumnTitleData(newColumnTitleData);
3573
- }
3574
- function addChildrenOpt(obj, parentId, childrenData) {
3575
- // Traverse the results obtained by all fetch
3576
- obj.forEach(function (item) {
3577
- // !!!IMPORTANT:
3578
- // You need to put the contents of other columns after fetch into the "children" attribute
3579
- if (item.id === parentId) item.children = childrenData;
3580
- if (item.children) {
3581
- addChildrenOpt(item.children, parentId, childrenData);
3582
- }
3583
- });
3584
- }
3585
- function addEmptyOpt(obj, index) {
3586
- index++;
3587
- obj.unshift({
3588
- id: "$EMPTY_ID_" + index,
3589
- name: "",
3590
- itemDepth: obj.length === 0 ? 0 : obj[0].itemDepth
3591
- });
3592
- obj.forEach(function (item, depth) {
3593
- if (item.children) {
3594
- addEmptyOpt(item.children, index * (depth + 1));
3595
- }
3596
- });
3597
- }
3598
- function queryResultOfJSON(data, targetVal, returnType) {
3599
- var callbackValueNested = [];
3600
- var lastFirstLevelName = '';
3601
- var loop = true;
3602
- var resDepth = 0;
3603
- var rowQueryAttr = 'id';
3604
- var getIndexOf = function getIndexOf(arr, val) {
3605
- for (var i = 0; i < arr.length; i++) {
3606
- if (arr[i][rowQueryAttr].toString() === val.toString()) return i;
3607
- }
3608
- return -1;
3609
- };
3610
- var searchJsonStr = function searchJsonStr(list, depth) {
3611
- // `depth` is very important, it is used to accurately judge the final result
3612
- if (typeof depth === 'undefined') {
3613
- depth = 0;
3614
- } else {
3615
- depth++;
3616
- }
3617
- for (var i = 0; i < list.length; i++) {
3618
- var row = list[i];
3619
- var callbackValue = void 0;
3620
- if (returnType === 'key') callbackValue = row[rowQueryAttr].toString();
3621
- if (returnType === 'value') callbackValue = row.name.toString();
3622
- if (returnType === 'query') callbackValue = typeof row.queryId !== 'undefined' ? row.queryId.toString() : '';
3623
- if (loop) {
3624
- // get first-level item
3625
- if (getIndexOf(data, row[rowQueryAttr]) !== -1) {
3626
- callbackValueNested.push(callbackValue);
3627
- lastFirstLevelName = callbackValue;
3628
- }
3629
-
3630
- // get child-level item
3631
- if (row.children) {
3632
- callbackValueNested.push(callbackValue);
3633
- }
3634
- }
3635
-
3636
- //check the value
3637
- if (row[rowQueryAttr].toString() === targetVal.toString()) {
3638
- callbackValueNested.push(callbackValue);
3639
- loop = false;
3640
- resDepth = depth;
3641
- break;
3642
- }
3643
-
3644
- // Note: Recursion must be placed here
3645
- if (loop) {
3646
- if (row.children) {
3647
- searchJsonStr(row.children, depth);
3648
- }
3649
- }
3650
- }
3651
- };
3652
- searchJsonStr(data);
3653
-
3654
- // (1) Remove duplicate values
3655
- //------------------------------------------
3656
- callbackValueNested = callbackValueNested.filter(function (item, index, arr) {
3657
- return arr.indexOf(item, 0) === index;
3658
- });
3659
-
3660
- // (2) Delete needless first-level
3661
- //------------------------------------------
3662
- var resAll = callbackValueNested.slice(callbackValueNested.indexOf(lastFirstLevelName), callbackValueNested.length);
3663
-
3664
- // (3) Returns result
3665
- //------------------------------------------
3666
- if (resAll.length > 1) {
3667
- // Get first-level item
3668
- resAll.splice(1);
3669
-
3670
- // Get child-level item
3671
- var resChild = callbackValueNested.slice(-resDepth); // Get the last elements in reverse
3672
-
3673
- // Combine
3674
- resAll = resAll.concat(resChild);
3675
- }
3676
- return resAll;
3677
- }
3678
- function displayInfo(destroyParentId) {
3679
- var _data = destroyParentId ? selectedDataByClick.current : selectedData.current;
3680
- var formattedDefaultValue = changedVal !== '' ? VALUE_BY_BRACES ? (0,extract.extractContentsOfBraces)(changedVal) : changedVal.split(',') : [];
3681
- var _labels = Array.isArray(_data.labels) && _data.labels.length > 0 ? _data.labels : [];
3682
-
3683
- // Prevent value from being a pure string that does not include "[]"
3684
- if (formattedDefaultValue === '') formattedDefaultValue = [];
3685
-
3686
- // Sometimes the array may be empty due to rendering speed
3687
- if (_labels.length === 0) {
3688
- _labels = formattedDefaultValue.map(function (s) {
3689
- return s.toString().replace(/[\w\s]/gi, '').replace(/\[\]/g, '');
3690
- });
3691
- }
3692
- return _labels.length > 0 ? _labels.map(function (item, i, arr) {
3693
- if (arr.length - 1 === i) {
3694
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3695
- key: i
3696
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3697
- dangerouslySetInnerHTML: {
3698
- __html: item
3699
- }
3700
- }));
3701
- } else {
3702
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3703
- key: i
3704
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3705
- dangerouslySetInnerHTML: {
3706
- __html: item
3707
- }
3708
- }), arrowGenerator());
3709
- }
3710
- }) : '';
3711
- }
3712
- function arrowGenerator() {
3713
- return displayResultArrow ? displayResultArrow : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3714
- viewBox: "0 0 22 22",
3715
- width: "8px"
3716
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3717
- d: "m345.44 248.29l-194.29 194.28c-12.359 12.365-32.397 12.365-44.75 0-12.354-12.354-12.354-32.391 0-44.744l171.91-171.91-171.91-171.9c-12.354-12.359-12.354-32.394 0-44.748 12.354-12.359 32.391-12.359 44.75 0l194.29 194.28c6.177 6.18 9.262 14.271 9.262 22.366 0 8.099-3.091 16.196-9.267 22.373",
3718
- transform: "matrix(.03541-.00013.00013.03541 2.98 3.02)",
3719
- fill: "#a5a5a5"
3720
- }));
3721
- }
3722
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
3723
- // column titles
3724
- //--------------
3725
- fillColumnTitle();
3726
-
3727
- // Initialize default value (request parameters for each level)
3728
- //--------------
3729
- initDefaultValue(value);
3730
- }, [value]);
3731
-
3732
- // Automatically complete and truncate column Search Keywords each time the number of columns changes
3733
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
3734
- if (listData.current.length !== columnSearchKeywords.length) {
3735
- setColumnSearchKeywords(Array(listData.current.length).fill('').map(function (v, i) {
3736
- return columnSearchKeywords[i] || '';
3737
- }));
3738
- }
3739
- }, [listData.current.length]);
3740
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
3741
- return function () {
3742
- // update data depth
3743
- setCurrentDataDepth(0);
3744
- };
3745
- }, []);
3746
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3747
- className: (0,cls.clsWrite)(wrapperClassName, 'casc-menu-e2e__wrapper mb-3 position-relative', "casc-menu-e2e__wrapper ".concat(wrapperClassName)),
3748
- ref: rootRef,
3749
- "data-overlay-id": "casc-menu-e2e__items-wrapper-".concat(idRes)
3750
- }, label ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
3751
- htmlFor: idRes,
3752
- className: "form-label",
3753
- dangerouslySetInnerHTML: {
3754
- __html: "".concat(label)
3755
- }
3756
- }) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
3757
- htmlFor: idRes,
3758
- className: "form-label"
3759
- }, label)) : null, triggerContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3760
- className: (0,cls.clsWrite)(triggerClassName, 'casc-menu-e2e__trigger d-inline w-auto', "casc-menu-e2e__trigger ".concat(triggerClassName)),
3761
- onClick: handleDisplayOptions
3762
- }, triggerContent)) : null, !hasErr ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((cjs_default()), {
3763
- show: true,
3764
- containerClassName: "CascadingSelectE2E"
3765
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3766
- ref: listRef,
3767
- id: "casc-menu-e2e__items-wrapper-".concat(idRes),
3768
- className: "casc-menu-e2e__items-wrapper position-absolute border shadow small",
3769
- style: {
3770
- zIndex: DEPTH,
3771
- display: 'none'
3772
- }
3773
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
3774
- className: "casc-menu-e2e__items-inner"
3775
- }, loading ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3776
- className: "casc-menu-e2e__items-loader"
3777
- }, loader || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3778
- height: "12px",
3779
- width: "12px",
3780
- viewBox: "0 0 512 512"
3781
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3782
- fill: "inherit",
3783
- d: "M256,0c-23.357,0-42.297,18.932-42.297,42.288c0,23.358,18.94,42.288,42.297,42.288c23.357,0,42.279-18.93,42.279-42.288C298.279,18.932,279.357,0,256,0z"
3784
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3785
- fill: "inherit",
3786
- d: "M256,427.424c-23.357,0-42.297,18.931-42.297,42.288C213.703,493.07,232.643,512,256,512c23.357,0,42.279-18.93,42.279-42.288C298.279,446.355,279.357,427.424,256,427.424z"
3787
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3788
- fill: "inherit",
3789
- d: "M74.974,74.983c-16.52,16.511-16.52,43.286,0,59.806c16.52,16.52,43.287,16.52,59.806,0c16.52-16.511,16.52-43.286,0-59.806C118.261,58.463,91.494,58.463,74.974,74.983z"
3790
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3791
- fill: "inherit",
3792
- d: "M377.203,377.211c-16.503,16.52-16.503,43.296,0,59.815c16.519,16.52,43.304,16.52,59.806,0c16.52-16.51,16.52-43.295,0-59.815C420.489,360.692,393.722,360.7,377.203,377.211z"
3793
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3794
- fill: "inherit",
3795
- d: "M84.567,256c0.018-23.348-18.922-42.279-42.279-42.279c-23.357-0.009-42.297,18.932-42.279,42.288c-0.018,23.348,18.904,42.279,42.279,42.279C65.645,298.288,84.567,279.358,84.567,256z"
3796
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3797
- fill: "inherit",
3798
- d: "M469.712,213.712c-23.357,0-42.279,18.941-42.297,42.288c0,23.358,18.94,42.288,42.297,42.297c23.357,0,42.297-18.94,42.279-42.297C512.009,232.652,493.069,213.712,469.712,213.712z"
3799
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3800
- fill: "inherit",
3801
- d: "M74.991,377.22c-16.519,16.511-16.519,43.296,0,59.806c16.503,16.52,43.27,16.52,59.789,0c16.52-16.519,16.52-43.295,0-59.815C118.278,360.692,91.511,360.692,74.991,377.22z"
3802
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3803
- fill: "inherit",
3804
- d: "M437.026,134.798c16.52-16.52,16.52-43.304,0-59.824c-16.519-16.511-43.304-16.52-59.823,0c-16.52,16.52-16.503,43.295,0,59.815C393.722,151.309,420.507,151.309,437.026,134.798z"
3805
- }))))) : null, showCloseBtn ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
3806
- href: "#",
3807
- tabIndex: -1,
3808
- onClick: function onClick(e) {
3809
- e.preventDefault();
3810
- cancel();
3811
- },
3812
- className: "casc-menu-e2e__close position-absolute top-0 end-0 mt-0 mx-1"
3813
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3814
- width: "10px",
3815
- height: "10px",
3816
- viewBox: "0 0 1024 1024"
3817
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3818
- fill: "#000",
3819
- d: "M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z"
3820
- }))) : null, listData.current.map(function (item, level) {
3821
- if (item.length > 0) {
3822
- // filter data
3823
- var filteredItem = item;
3824
- if (searchable && columnSearchKeywords[level]) {
3825
- var keyword = columnSearchKeywords[level].toLowerCase();
3826
- filteredItem = item.filter(function (opt) {
3827
- return ((0,format_string.htmlToPlain)(opt.name) || '').toLowerCase().includes(keyword);
3828
- });
3829
- }
3830
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
3831
- key: level,
3832
- "data-col": level,
3833
- className: "casc-menu-e2e__items-col"
3834
- }, searchable && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3835
- className: "casc-menu-e2e__items-col-searchbox"
3836
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", {
3837
- type: "text",
3838
- placeholder: searchPlaceholder,
3839
- value: columnSearchKeywords[level] || '',
3840
- onChange: function onChange(e) {
3841
- var newKeywords = _toConsumableArray(columnSearchKeywords);
3842
- newKeywords[level] = e.target.value;
3843
- setColumnSearchKeywords(newKeywords);
3844
- }
3845
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Group, {
3846
- perColumnHeadersShow: perColumnHeadersShow,
3847
- level: level,
3848
- columnTitle: columnTitleData,
3849
- data: filteredItem // filter result
3850
- ,
3851
- cleanNodeBtnClassName: cleanNodeBtnClassName,
3852
- cleanNodeBtnContent: cleanNodeBtnContent,
3853
- selectEv: function selectEv(e, value, index) {
3854
- return handleClickItem(e, value, index, level, listData.current);
3855
- }
3856
- }));
3857
- } else {
3858
- return null;
3859
- }
3860
- })))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3861
- className: (0,cls.combinedCls)('casc-menu-e2e__val', {
3862
- 'inputable': inputable
3863
- }),
3864
- onClick: handleDisplayOptions
3865
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3866
- className: (0,cls.combinedCls)('position-relative', (0,cls.clsWrite)(controlGroupWrapperClassName, 'input-group'), {
3867
- 'has-left-content': propExist(iconLeft),
3868
- 'has-right-content': propExist(iconRight) || propExist(units)
3869
- })
3870
- }, propExist(iconLeft) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3871
- className: (0,cls.clsWrite)(controlGroupTextClassName, 'input-group-text')
3872
- }, iconLeft)) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3873
- className: "input-group-control-container flex-fill position-relative"
3874
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
3875
- ref: function ref(node) {
3876
- inputRef.current = node;
3877
- if (typeof externalRef === 'function') {
3878
- externalRef(node);
3879
- } else if (externalRef) {
3880
- externalRef.current = node;
3881
- }
3882
- },
3883
- id: idRes,
3884
- "data-overlay-id": "casc-menu-e2e__items-wrapper-".concat(idRes),
3885
- name: name,
3886
- className: (0,cls.combinedCls)((0,cls.clsWrite)(controlClassName, 'form-control'), controlExClassName, {
3887
- 'rounded': !propExist(iconLeft) && !propExist(iconRight) && !propExist(units),
3888
- 'rounded-start-0': propExist(iconLeft),
3889
- 'rounded-end-0': propExist(iconRight) || propExist(units)
3890
- }),
3891
- placeholder: placeholder,
3892
- value: function () {
3893
- var curValForamt = resultInputPureText(changedVal);
3894
- var curValCallback = '';
3895
-
3896
- // STEP 1
3897
- //============
3898
-
3899
- if (inputable) {
3900
- curValCallback = curValForamt;
3901
- } else {
3902
- curValCallback = destroyParentIdMatch ? valueType === 'value' ? resultInput(selectedDataByClick.current.values, selectedDataByClick.current.queryIds) : resultInput(selectedDataByClick.current.labels, selectedDataByClick.current.queryIds) : curValForamt;
3903
- }
3904
-
3905
- // STEP 2
3906
- //============
3907
- if (typeof formatInputResult === 'function') {
3908
- return formatInputResult(VALUE_BY_BRACES ? (0,extract.extractContentsOfMixedCharactersWithBraces)(curValCallback) : (0,extract.extractContentsOfMixedCharactersWithComma)(curValCallback));
3909
- } else {
3910
- return changedVal;
3911
- }
3912
- }()
3913
- // placeholder will not change if defaultValue is used
3914
- ,
3915
- onFocus: handleFocus,
3916
- onBlur: handleBlur,
3917
- autoComplete: "off",
3918
- disabled: disabled || null,
3919
- readOnly: readOnly || null,
3920
- required: required || null,
3921
- minLength: minLength || null,
3922
- maxLength: maxLength || null,
3923
- style: style,
3924
- tabIndex: tabIndex || 0,
3925
- onChange: inputable ? function (e) {
3926
- setChangedVal(e.target.value);
3927
- if (typeof onChange === 'function') {
3928
- onChange(e,
3929
- // input dom event
3930
- null,
3931
- // currentData
3932
- null,
3933
- // index
3934
- null,
3935
- // depth
3936
- e.target.value,
3937
- // value
3938
- cancel);
3939
- }
3940
- } : undefined
3941
- }, attributes)), destroyParentIdMatch ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, !inputable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3942
- className: "casc-menu-e2e__result"
3943
- }, displayInfo(true)) : null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, !inputable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3944
- className: "casc-menu-e2e__result"
3945
- }, displayInfo(false)) : null), required ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, requiredLabel || requiredLabel === '' ? requiredLabel : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3946
- className: "position-absolute end-0 top-0 my-2 mx-2 pe-3"
3947
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3948
- className: "text-danger"
3949
- }, "*"))) : ''), propExist(units) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3950
- className: (0,cls.clsWrite)(controlGroupTextClassName, 'input-group-text')
3951
- }, units)) : null, propExist(iconRight) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3952
- className: (0,cls.clsWrite)(controlGroupTextClassName, 'input-group-text')
3953
- }, iconRight)) : null), isShow ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3954
- className: "casc-menu-e2e__closemask",
3955
- onClick: function onClick(e) {
3956
- e.preventDefault();
3957
- cancel();
3958
- }
3959
- }) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3960
- className: "arrow",
3961
- style: {
3962
- pointerEvents: 'none'
3963
- }
3964
- }, controlArrow ? controlArrow : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3965
- width: "10px",
3966
- height: "10px",
3967
- viewBox: "0 -4.5 20 20"
3968
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", {
3969
- stroke: "none",
3970
- strokeWidth: "1",
3971
- fill: "none"
3972
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", {
3973
- transform: "translate(-180.000000, -6684.000000)",
3974
- className: "arrow-fill-g",
3975
- fill: "#a5a5a5"
3976
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", {
3977
- transform: "translate(56.000000, 160.000000)"
3978
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3979
- d: "M144,6525.39 L142.594,6524 L133.987,6532.261 L133.069,6531.38 L133.074,6531.385 L125.427,6524.045 L124,6525.414 C126.113,6527.443 132.014,6533.107 133.987,6535 C135.453,6533.594 134.024,6534.965 144,6525.39"
3980
- })))))))));
3981
- });
3982
- /* harmony default export */ const src = (CascadingSelectE2E);
3983
- })();
3984
-
3985
- /******/ return __webpack_exports__;
3986
- /******/ })()
3987
- ;
3988
- });