bromcom-ui 2.12.3-rc.2 → 2.12.3-rc.3-test.0

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 (327) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/{p-214834d8.entry.js → p-01e63843.entry.js} +1 -1
  4. package/dist/bromcom-ui/p-04594f76.entry.js +5 -0
  5. package/dist/bromcom-ui/{p-a5d58be8.js → p-052005c9.js} +1 -1
  6. package/dist/bromcom-ui/p-0e110a9f.entry.js +5 -0
  7. package/dist/bromcom-ui/p-0e5f1168.entry.js +5 -0
  8. package/dist/bromcom-ui/{p-8ea0e777.entry.js → p-10f511ff.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-1345d51b.entry.js +5 -0
  10. package/dist/bromcom-ui/{p-ebc7d5eb.entry.js → p-15402dac.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-ece578ef.entry.js → p-1b558b0f.entry.js} +1 -1
  12. package/dist/bromcom-ui/p-1baed29d.entry.js +5 -0
  13. package/dist/bromcom-ui/{p-b43e06b4.entry.js → p-1e61a44c.entry.js} +1 -1
  14. package/dist/bromcom-ui/p-1f93fd33.entry.js +5 -0
  15. package/dist/bromcom-ui/p-23759244.entry.js +5 -0
  16. package/dist/bromcom-ui/{p-271c5e3c.entry.js → p-25bbe3e6.entry.js} +1 -1
  17. package/dist/bromcom-ui/p-270e1b24.entry.js +5 -0
  18. package/dist/bromcom-ui/p-27596881.entry.js +5 -0
  19. package/dist/bromcom-ui/p-29791e4a.entry.js +5 -0
  20. package/dist/bromcom-ui/{p-f0e30624.entry.js → p-2b42d77e.entry.js} +1 -1
  21. package/dist/bromcom-ui/{p-27d9f02a.js → p-2bd0545e.js} +1 -1
  22. package/dist/bromcom-ui/{p-8e683b32.js → p-2cd6cdee.js} +1 -1
  23. package/dist/bromcom-ui/p-3179ce74.entry.js +7 -0
  24. package/dist/bromcom-ui/{p-d551a51d.entry.js → p-32c55505.entry.js} +1 -1
  25. package/dist/bromcom-ui/p-33166492.entry.js +5 -0
  26. package/dist/bromcom-ui/p-376a20ed.js +5 -0
  27. package/dist/bromcom-ui/p-3da7b6c0.entry.js +5 -0
  28. package/dist/bromcom-ui/p-41276d76.entry.js +5 -0
  29. package/dist/bromcom-ui/p-412abc6d.entry.js +5 -0
  30. package/dist/bromcom-ui/p-4393b33e.entry.js +5 -0
  31. package/dist/bromcom-ui/p-46db5206.js +5 -0
  32. package/dist/bromcom-ui/p-4834bc26.js +5 -0
  33. package/dist/bromcom-ui/p-4856568f.entry.js +5 -0
  34. package/dist/bromcom-ui/{p-3971c237.entry.js → p-507db92e.entry.js} +1 -1
  35. package/dist/bromcom-ui/p-534f958a.entry.js +5 -0
  36. package/dist/bromcom-ui/{p-856cb58c.entry.js → p-540fbc32.entry.js} +1 -1
  37. package/dist/bromcom-ui/{p-ba9eff2a.entry.js → p-59f7fa84.entry.js} +1 -1
  38. package/dist/bromcom-ui/{p-594a57c3.entry.js → p-5d670fd7.entry.js} +1 -1
  39. package/dist/bromcom-ui/p-65da044b.js +5 -0
  40. package/dist/bromcom-ui/{p-85eedabc.js → p-6657830f.js} +1 -1
  41. package/dist/bromcom-ui/p-6687afd7.entry.js +5 -0
  42. package/dist/bromcom-ui/{p-499d8454.js → p-6bea284a.js} +1 -1
  43. package/dist/bromcom-ui/p-6ceb315f.entry.js +5 -0
  44. package/dist/bromcom-ui/{p-1c801d0c.entry.js → p-77ef609e.entry.js} +1 -1
  45. package/dist/bromcom-ui/p-7c45705d.entry.js +5 -0
  46. package/dist/bromcom-ui/p-7dbfff1b.entry.js +5 -0
  47. package/dist/bromcom-ui/{p-1830cdf1.js → p-7e0e02b3.js} +1 -1
  48. package/dist/bromcom-ui/{p-6f861fed.js → p-7e44e6b5.js} +1 -1
  49. package/dist/bromcom-ui/{p-fae6b16a.entry.js → p-80edaf47.entry.js} +1 -1
  50. package/dist/bromcom-ui/p-822dda00.js +5 -0
  51. package/dist/bromcom-ui/{p-18dbbd45.entry.js → p-87192588.entry.js} +1 -1
  52. package/dist/bromcom-ui/{p-b72ad073.entry.js → p-881853bd.entry.js} +1 -1
  53. package/dist/bromcom-ui/p-8b6d3a37.js +5 -0
  54. package/dist/bromcom-ui/p-8b8dd8fe.entry.js +5 -0
  55. package/dist/bromcom-ui/{p-6f2e4c9b.js → p-8c018ae0.js} +1 -1
  56. package/dist/bromcom-ui/p-8cd80ac4.entry.js +5 -0
  57. package/dist/bromcom-ui/p-8f32198d.js +14 -0
  58. package/dist/bromcom-ui/p-904b0c28.entry.js +5 -0
  59. package/dist/bromcom-ui/{p-9c94733a.entry.js → p-9253d439.entry.js} +1 -1
  60. package/dist/bromcom-ui/{p-c3387cb1.entry.js → p-926b314d.entry.js} +1 -1
  61. package/dist/bromcom-ui/{p-4e31f894.entry.js → p-95a797b3.entry.js} +1 -1
  62. package/dist/bromcom-ui/{p-6b3a6d60.entry.js → p-974a427c.entry.js} +1 -1
  63. package/dist/bromcom-ui/{p-bdc78a44.entry.js → p-9b59c689.entry.js} +1 -1
  64. package/dist/bromcom-ui/p-9ebe6ef9.entry.js +5 -0
  65. package/dist/bromcom-ui/{p-e0369655.entry.js → p-9f5ee998.entry.js} +1 -1
  66. package/dist/bromcom-ui/{p-9bfba564.entry.js → p-a00b053e.entry.js} +1 -1
  67. package/dist/bromcom-ui/{p-d65bc842.js → p-a0d6d680.js} +1 -1
  68. package/dist/bromcom-ui/{p-5dea2654.entry.js → p-a0f44b56.entry.js} +1 -1
  69. package/dist/bromcom-ui/p-a2065e9e.entry.js +5 -0
  70. package/dist/bromcom-ui/p-a2e5bb35.entry.js +5 -0
  71. package/dist/bromcom-ui/{p-f210c256.entry.js → p-a31644e3.entry.js} +1 -1
  72. package/dist/bromcom-ui/p-a352f45e.entry.js +5 -0
  73. package/dist/bromcom-ui/{p-1c9314bd.entry.js → p-a486613b.entry.js} +1 -1
  74. package/dist/bromcom-ui/{p-626b805d.entry.js → p-a6aa173f.entry.js} +1 -1
  75. package/dist/bromcom-ui/{p-a2df6c19.js → p-aeb4be41.js} +1 -1
  76. package/dist/bromcom-ui/p-b1084320.entry.js +5 -0
  77. package/dist/bromcom-ui/p-b301fa40.entry.js +5 -0
  78. package/dist/bromcom-ui/p-b43e975b.entry.js +5 -0
  79. package/dist/bromcom-ui/p-b9a88f16.entry.js +5 -0
  80. package/dist/bromcom-ui/p-bbcb683f.entry.js +5 -0
  81. package/dist/bromcom-ui/p-bd50c28f.entry.js +5 -0
  82. package/dist/bromcom-ui/{p-2d0ff35e.js → p-beaec5b8.js} +1 -1
  83. package/dist/bromcom-ui/p-c1a992e7.entry.js +5 -0
  84. package/dist/bromcom-ui/p-c39e73dc.entry.js +5 -0
  85. package/dist/bromcom-ui/{p-69260d36.entry.js → p-c49b6287.entry.js} +1 -1
  86. package/dist/bromcom-ui/p-c503526a.entry.js +5 -0
  87. package/dist/bromcom-ui/p-c63f5261.entry.js +5 -0
  88. package/dist/bromcom-ui/{p-4d2bf0e7.js → p-c77541f4.js} +2 -2
  89. package/dist/bromcom-ui/{p-af8674da.js → p-cbcf6d9c.js} +1 -1
  90. package/dist/bromcom-ui/{p-bf0abe3f.entry.js → p-cf11cdde.entry.js} +1 -1
  91. package/dist/bromcom-ui/{p-2ed86248.entry.js → p-d19d45ed.entry.js} +1 -1
  92. package/dist/bromcom-ui/p-d2bd0293.entry.js +5 -0
  93. package/dist/bromcom-ui/{p-2aaeb247.entry.js → p-d59d9687.entry.js} +1 -1
  94. package/dist/bromcom-ui/{p-2d10739e.entry.js → p-dd24646a.entry.js} +1 -1
  95. package/dist/bromcom-ui/p-e0ab7b38.js +11 -0
  96. package/dist/bromcom-ui/p-e1b6f98e.entry.js +5 -0
  97. package/dist/bromcom-ui/p-e36c7523.entry.js +5 -0
  98. package/dist/bromcom-ui/p-e5532875.entry.js +5 -0
  99. package/dist/bromcom-ui/{p-7d18ce0e.entry.js → p-e8eaa3bb.entry.js} +1 -1
  100. package/dist/bromcom-ui/p-e94d2f48.js +5 -0
  101. package/dist/bromcom-ui/p-ead59725.entry.js +5 -0
  102. package/dist/bromcom-ui/{p-43c578cf.js → p-eca0acda.js} +1 -1
  103. package/dist/bromcom-ui/p-ede7ca76.entry.js +5 -0
  104. package/dist/bromcom-ui/p-eef8f7c7.entry.js +5 -0
  105. package/dist/bromcom-ui/p-effc088c.entry.js +5 -0
  106. package/dist/bromcom-ui/{p-b8678480.entry.js → p-fafa70ac.entry.js} +1 -1
  107. package/dist/bromcom-ui/p-fc787048.entry.js +5 -0
  108. package/dist/bromcom-ui/{p-df76af7c.entry.js → p-fec89309.entry.js} +1 -1
  109. package/dist/bromcom-ui/{p-d54ecc8a.entry.js → p-ff2b4565.entry.js} +1 -1
  110. package/dist/cjs/Overflow-5a73947b.js +2233 -0
  111. package/dist/cjs/bcm-accordion.cjs.entry.js +74 -0
  112. package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
  113. package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +4 -4
  114. package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +4 -4
  115. package/dist/cjs/bcm-attendance-actions.cjs.entry.js +330 -0
  116. package/dist/cjs/bcm-attendance.cjs.entry.js +35 -0
  117. package/dist/cjs/bcm-avatar_2.cjs.entry.js +210 -0
  118. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
  119. package/dist/cjs/bcm-button-group.cjs.entry.js +92 -0
  120. package/dist/cjs/bcm-button.cjs.entry.js +372 -0
  121. package/dist/cjs/bcm-caption.cjs.entry.js +4 -4
  122. package/dist/cjs/bcm-card.cjs.entry.js +2 -2
  123. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +415 -0
  124. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2529 -0
  125. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +194 -0
  126. package/dist/cjs/bcm-chip-group.cjs.entry.js +4 -4
  127. package/dist/cjs/bcm-chip.cjs.entry.js +91 -0
  128. package/dist/cjs/bcm-collapse-group.cjs.entry.js +43 -0
  129. package/dist/cjs/bcm-collapse.cjs.entry.js +62 -0
  130. package/dist/cjs/bcm-color-input.cjs.entry.js +77 -0
  131. package/dist/cjs/bcm-colorful_2.cjs.entry.js +251 -0
  132. package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
  133. package/dist/cjs/bcm-date_6.cjs.entry.js +15363 -0
  134. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -2
  135. package/dist/cjs/bcm-default.cjs.entry.js +2 -2
  136. package/dist/cjs/bcm-drawer.cjs.entry.js +96 -0
  137. package/dist/cjs/bcm-dropdown.cjs.entry.js +119 -0
  138. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +116 -0
  139. package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
  140. package/dist/cjs/bcm-input-2.cjs.entry.js +2 -2
  141. package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
  142. package/dist/cjs/bcm-input-dropdown.cjs.entry.js +4 -4
  143. package/dist/cjs/bcm-input_2.cjs.entry.js +550 -0
  144. package/dist/cjs/bcm-item.cjs.entry.js +72 -0
  145. package/dist/cjs/bcm-items.cjs.entry.js +49 -0
  146. package/dist/cjs/bcm-link.cjs.entry.js +51 -0
  147. package/dist/cjs/bcm-list_3.cjs.entry.js +1977 -0
  148. package/dist/cjs/bcm-menu.cjs.entry.js +151 -0
  149. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
  150. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
  151. package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
  152. package/dist/cjs/bcm-modal.cjs.entry.js +157 -0
  153. package/dist/cjs/bcm-number-input.cjs.entry.js +4 -4
  154. package/dist/cjs/bcm-old-input.cjs.entry.js +397 -0
  155. package/dist/cjs/bcm-old-tag_2.cjs.entry.js +145 -0
  156. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +115 -0
  157. package/dist/cjs/bcm-popconfirm.cjs.entry.js +101 -0
  158. package/dist/cjs/bcm-popover.cjs.entry.js +4 -4
  159. package/dist/cjs/bcm-progress.cjs.entry.js +162 -0
  160. package/dist/cjs/bcm-radio-group.cjs.entry.js +161 -0
  161. package/dist/cjs/bcm-radio.cjs.entry.js +65 -0
  162. package/dist/cjs/bcm-range.cjs.entry.js +2 -2
  163. package/dist/cjs/bcm-select.cjs.entry.js +1195 -0
  164. package/dist/cjs/bcm-shortcut.cjs.entry.js +65 -0
  165. package/dist/cjs/bcm-skeleton.cjs.entry.js +4 -4
  166. package/dist/cjs/bcm-step.cjs.entry.js +89 -0
  167. package/dist/cjs/bcm-stepper.cjs.entry.js +240 -0
  168. package/dist/cjs/bcm-switch.cjs.entry.js +151 -0
  169. package/dist/cjs/bcm-tab-group.cjs.entry.js +210 -0
  170. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +60 -0
  171. package/dist/cjs/bcm-tab-item.cjs.entry.js +91 -0
  172. package/dist/cjs/bcm-tab.cjs.entry.js +72 -0
  173. package/dist/cjs/bcm-table.cjs.entry.js +4 -4
  174. package/dist/cjs/bcm-tabs.cjs.entry.js +370 -0
  175. package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
  176. package/dist/cjs/bcm-text.cjs.entry.js +49 -0
  177. package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
  178. package/dist/cjs/bcm-toast.cjs.entry.js +2 -2
  179. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  180. package/dist/cjs/{generate-beac9c8d.js → generate-bff3fa38.js} +14 -14
  181. package/dist/cjs/{global-d4be0c46.js → global-825d9cd4.js} +1 -1
  182. package/dist/cjs/input-template-d05a507f.js +92 -0
  183. package/dist/cjs/json-parse-decarator-b9186302.js +40 -0
  184. package/dist/cjs/loader.cjs.js +3 -3
  185. package/dist/cjs/lodash-917168d7.js +17199 -0
  186. package/dist/cjs/{number-helper-46c7892f.js → number-helper-9bc46d37.js} +1 -1
  187. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
  188. package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
  189. package/dist/cjs/{package-e6628eb2.js → package-dda6f822.js} +1 -1
  190. package/dist/cjs/stepper-states-a565a45f.js +85 -0
  191. package/dist/cjs/tooltip-helper-2e1f4fda.js +158 -0
  192. package/dist/cjs/{validators-27568118.js → validators-c0eef77a.js} +1 -1
  193. package/dist/collection/components/molecules/tab-group/tab-group.js +1 -1
  194. package/dist/collection/components/molecules/tab-group/tab-item-header.js +6 -5
  195. package/dist/collection/components/molecules/tab-group/tab-item.js +1 -1
  196. package/dist/collection/components/third-parts/rc-picker/date.js +1 -1
  197. package/dist/collection/components/third-parts/rc-picker/rc-picker.css +221 -112
  198. package/dist/collection/components/third-parts/rc-picker/rc-picker.js +20 -1
  199. package/dist/components/bcm-date.js +1 -1
  200. package/dist/components/bcm-tab-group.js +1 -1
  201. package/dist/components/bcm-tab-item-header.js +6 -5
  202. package/dist/components/bcm-tab-item.js +1 -1
  203. package/dist/components/generate.js +1 -1
  204. package/dist/components/rc-picker.js +5 -2
  205. package/dist/esm/Overflow-40c63001.js +2217 -0
  206. package/dist/esm/{_commonjsHelpers-7002e5de.js → _commonjsHelpers-82aa9212.js} +1 -1
  207. package/dist/esm/bcm-accordion.entry.js +70 -0
  208. package/dist/esm/bcm-alert.entry.js +6 -6
  209. package/dist/esm/bcm-attendance-actions-comment.entry.js +10 -10
  210. package/dist/esm/bcm-attendance-actions-dropdown.entry.js +11 -11
  211. package/dist/esm/bcm-attendance-actions.entry.js +326 -0
  212. package/dist/esm/bcm-attendance.entry.js +31 -0
  213. package/dist/esm/bcm-autocomplete.entry.js +2 -2
  214. package/dist/esm/bcm-avatar_2.entry.js +205 -0
  215. package/dist/esm/bcm-breadcrumb.entry.js +5 -5
  216. package/dist/esm/bcm-button-group.entry.js +88 -0
  217. package/dist/esm/bcm-button.entry.js +368 -0
  218. package/dist/esm/bcm-caption.entry.js +12 -12
  219. package/dist/esm/bcm-card.entry.js +9 -9
  220. package/dist/esm/bcm-checkbox-group.entry.js +411 -0
  221. package/dist/esm/bcm-checkbox-lite_9.entry.js +2517 -0
  222. package/dist/esm/bcm-checkbox_2.entry.js +189 -0
  223. package/dist/esm/bcm-chip-group.entry.js +13 -13
  224. package/dist/esm/bcm-chip.entry.js +87 -0
  225. package/dist/esm/bcm-collapse-group.entry.js +39 -0
  226. package/dist/esm/bcm-collapse.entry.js +58 -0
  227. package/dist/esm/bcm-color-input.entry.js +73 -0
  228. package/dist/esm/bcm-colorful_2.entry.js +246 -0
  229. package/dist/esm/bcm-colorpicker.entry.js +4 -4
  230. package/dist/esm/bcm-date-picker.entry.js +6 -6
  231. package/dist/esm/bcm-date_6.entry.js +15354 -0
  232. package/dist/esm/bcm-datetime-picker.entry.js +10 -10
  233. package/dist/esm/bcm-default.entry.js +4 -4
  234. package/dist/esm/bcm-drawer.entry.js +92 -0
  235. package/dist/esm/bcm-dropdown.entry.js +115 -0
  236. package/dist/esm/bcm-error-layout.entry.js +2 -2
  237. package/dist/esm/bcm-expansion-panel.entry.js +112 -0
  238. package/dist/esm/bcm-form-2.entry.js +5 -5
  239. package/dist/esm/bcm-input-2.entry.js +6 -6
  240. package/dist/esm/bcm-input-custom.entry.js +5 -5
  241. package/dist/esm/bcm-input-dropdown.entry.js +12 -12
  242. package/dist/esm/bcm-input_2.entry.js +545 -0
  243. package/dist/esm/bcm-item.entry.js +68 -0
  244. package/dist/esm/bcm-items.entry.js +45 -0
  245. package/dist/esm/bcm-link.entry.js +47 -0
  246. package/dist/esm/bcm-list_3.entry.js +1971 -0
  247. package/dist/esm/bcm-menu.entry.js +147 -0
  248. package/dist/esm/bcm-message.entry.js +2 -2
  249. package/dist/esm/bcm-modal-2-footer.entry.js +11 -11
  250. package/dist/esm/bcm-modal-2-header.entry.js +10 -10
  251. package/dist/esm/bcm-modal-2.entry.js +11 -11
  252. package/dist/esm/bcm-modal.entry.js +153 -0
  253. package/dist/esm/bcm-notification.entry.js +2 -2
  254. package/dist/esm/bcm-number-input.entry.js +12 -12
  255. package/dist/esm/bcm-old-input.entry.js +393 -0
  256. package/dist/esm/bcm-old-tag_2.entry.js +140 -0
  257. package/dist/esm/bcm-overlay_2.entry.js +3 -3
  258. package/dist/esm/bcm-popconfirm-box.entry.js +111 -0
  259. package/dist/esm/bcm-popconfirm.entry.js +97 -0
  260. package/dist/esm/bcm-popover.entry.js +10 -10
  261. package/dist/esm/bcm-progress.entry.js +158 -0
  262. package/dist/esm/bcm-radio-group.entry.js +157 -0
  263. package/dist/esm/bcm-radio.entry.js +61 -0
  264. package/dist/esm/bcm-range.entry.js +6 -6
  265. package/dist/esm/bcm-react-number.entry.js +2 -2
  266. package/dist/esm/bcm-result.entry.js +2 -2
  267. package/dist/esm/bcm-select-group.entry.js +2 -2
  268. package/dist/esm/bcm-select-option.entry.js +2 -2
  269. package/dist/esm/bcm-select.entry.js +1191 -0
  270. package/dist/esm/bcm-shortcut.entry.js +61 -0
  271. package/dist/esm/bcm-skeleton.entry.js +10 -10
  272. package/dist/esm/bcm-step.entry.js +85 -0
  273. package/dist/esm/bcm-stepper.entry.js +236 -0
  274. package/dist/esm/bcm-switch.entry.js +147 -0
  275. package/dist/esm/bcm-tab-group.entry.js +206 -0
  276. package/dist/esm/bcm-tab-item-header.entry.js +56 -0
  277. package/dist/esm/bcm-tab-item.entry.js +87 -0
  278. package/dist/esm/bcm-tab-pane.entry.js +2 -2
  279. package/dist/esm/bcm-tab.entry.js +68 -0
  280. package/dist/esm/bcm-table.entry.js +11 -11
  281. package/dist/esm/bcm-tabs-content.entry.js +3 -3
  282. package/dist/esm/bcm-tabs.entry.js +366 -0
  283. package/dist/esm/bcm-tag.entry.js +7 -7
  284. package/dist/esm/bcm-text.entry.js +45 -0
  285. package/dist/esm/bcm-time-picker.entry.js +6 -6
  286. package/dist/esm/bcm-timeline-item.entry.js +2 -2
  287. package/dist/esm/bcm-timeline.entry.js +2 -2
  288. package/dist/esm/bcm-toast.entry.js +7 -7
  289. package/dist/esm/bromcom-ui.js +3 -3
  290. package/dist/esm/{caption-template-3cd42c3b.js → caption-template-d7953d13.js} +1 -1
  291. package/dist/esm/{color-helper-ba15b0d8.js → color-helper-74614f24.js} +2 -2
  292. package/dist/esm/{colors-ed4e7579.js → colors-dd598eea.js} +1 -1
  293. package/dist/esm/{element-dragger-b75266e6.js → element-dragger-89bb52fd.js} +1 -1
  294. package/dist/esm/{generate-b30859e0.js → generate-1281254a.js} +15 -15
  295. package/dist/esm/{global-7e00a8e5.js → global-c031697c.js} +1 -1
  296. package/dist/esm/{index-0d3a56ec.js → index-036974d7.js} +1 -1
  297. package/dist/esm/{index-00c8a8f7.js → index-f549811f.js} +1 -1
  298. package/dist/esm/input-template-b4045b25.js +90 -0
  299. package/dist/esm/json-parse-decarator-7d436ec7.js +38 -0
  300. package/dist/esm/{label-template-ef97aadb.js → label-template-a26f76c0.js} +1 -1
  301. package/dist/esm/loader.js +3 -3
  302. package/dist/esm/lodash-4197be99.js +17197 -0
  303. package/dist/esm/{number-helper-70d15d1b.js → number-helper-778c8f87.js} +1 -1
  304. package/dist/esm/old-bcm-popover-box.entry.js +10 -10
  305. package/dist/esm/old-bcm-popover.entry.js +5 -5
  306. package/dist/esm/{package-8f0a3af5.js → package-08ddc3fa.js} +1 -1
  307. package/dist/esm/{popover-placement-2bf3a181.js → popover-placement-d12fec40.js} +1 -1
  308. package/dist/esm/{slot-template-d3ae9f27.js → slot-template-2a19b2db.js} +1 -1
  309. package/dist/esm/stepper-states-325c754b.js +83 -0
  310. package/dist/esm/{string-helper-69203215.js → string-helper-3592bdc2.js} +1 -1
  311. package/dist/esm/tooltip-helper-9c64ad15.js +156 -0
  312. package/dist/esm/{utils-7727d09e.js → utils-57652744.js} +1 -1
  313. package/dist/esm/{validators-0ccb9921.js → validators-0c6e8dea.js} +1 -1
  314. package/dist/types/components/third-parts/rc-picker/rc-picker.d.ts +1 -0
  315. package/dist/types/components.d.ts +2 -0
  316. package/package.json +2 -2
  317. package/dist/bromcom-ui/p-053dc717.entry.js +0 -5
  318. package/dist/bromcom-ui/p-5b03442c.entry.js +0 -5
  319. package/dist/bromcom-ui/p-64fad38b.js +0 -11
  320. package/dist/bromcom-ui/p-6b9f10a7.entry.js +0 -5
  321. package/dist/bromcom-ui/p-81d248d8.js +0 -5
  322. package/dist/bromcom-ui/p-9d71cecb.entry.js +0 -5
  323. package/dist/bromcom-ui/p-a9388655.entry.js +0 -16
  324. package/dist/bromcom-ui/p-bddce313.js +0 -5
  325. package/dist/bromcom-ui/p-d7194c4d.entry.js +0 -5
  326. package/dist/cjs/bcm-accordion_63.cjs.entry.js +0 -46097
  327. package/dist/esm/bcm-accordion_63.entry.js +0 -46031
@@ -0,0 +1,2233 @@
1
+ /*!
2
+ * Built with Stencil
3
+ * Copyright (c) Bromcom.
4
+ */
5
+ 'use strict';
6
+
7
+ const index$1 = require('./index-e05a7c6f.js');
8
+ const index$2 = require('./index-95ae50d0.js');
9
+ const _commonjsHelpers = require('./_commonjsHelpers-ed84c3ca.js');
10
+
11
+ function useEvent(callback) {
12
+ var fnRef = index$1.react.useRef();
13
+ fnRef.current = callback;
14
+ var memoFn = index$1.react.useCallback(function () {
15
+ var _fnRef$current;
16
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
17
+ args[_key] = arguments[_key];
18
+ }
19
+ return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
20
+ }, []);
21
+ return memoFn;
22
+ }
23
+
24
+ function canUseDom() {
25
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
26
+ }
27
+
28
+ /**
29
+ * Wrap `React.useLayoutEffect` which will not throw warning message in test env
30
+ */
31
+ var useInternalLayoutEffect = canUseDom() ? index$1.react.useLayoutEffect : index$1.react.useEffect;
32
+ var useLayoutEffect = function useLayoutEffect(callback, deps) {
33
+ var firstMountRef = index$1.react.useRef(true);
34
+ useInternalLayoutEffect(function () {
35
+ return callback(firstMountRef.current);
36
+ }, deps);
37
+
38
+ // We tell react that first mount has passed
39
+ useInternalLayoutEffect(function () {
40
+ firstMountRef.current = false;
41
+ return function () {
42
+ firstMountRef.current = true;
43
+ };
44
+ }, []);
45
+ };
46
+ var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
47
+ useLayoutEffect(function (firstMount) {
48
+ if (!firstMount) {
49
+ return callback();
50
+ }
51
+ }, deps);
52
+ };
53
+
54
+ function _typeof$2(obj) {
55
+ "@babel/helpers - typeof";
56
+
57
+ return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
58
+ return typeof obj;
59
+ } : function (obj) {
60
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
61
+ }, _typeof$2(obj);
62
+ }
63
+
64
+ /**
65
+ * @license React
66
+ * react-is.production.min.js
67
+ *
68
+ * Copyright (c) Facebook, Inc. and its affiliates.
69
+ *
70
+ * This source code is licensed under the MIT license found in the
71
+ * LICENSE file in the root directory of this source tree.
72
+ */
73
+ var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
74
+ function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}var ContextConsumer=h;var ContextProvider=g;var Element$1=b;var ForwardRef=l;var Fragment=d;var Lazy=q;var Memo=p;var Portal=c;var Profiler=f;var StrictMode=e;var Suspense=m;
75
+ var SuspenseList=n;var isAsyncMode=function(){return !1};var isConcurrentMode=function(){return !1};var isContextConsumer=function(a){return v(a)===h};var isContextProvider=function(a){return v(a)===g};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b};var isForwardRef=function(a){return v(a)===l};var isFragment=function(a){return v(a)===d};var isLazy=function(a){return v(a)===q};var isMemo=function(a){return v(a)===p};
76
+ var isPortal=function(a){return v(a)===c};var isProfiler=function(a){return v(a)===f};var isStrictMode=function(a){return v(a)===e};var isSuspense=function(a){return v(a)===m};var isSuspenseList=function(a){return v(a)===n};
77
+ var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};var typeOf=v;
78
+
79
+ var reactIs_production_min = {
80
+ ContextConsumer: ContextConsumer,
81
+ ContextProvider: ContextProvider,
82
+ Element: Element$1,
83
+ ForwardRef: ForwardRef,
84
+ Fragment: Fragment,
85
+ Lazy: Lazy,
86
+ Memo: Memo,
87
+ Portal: Portal,
88
+ Profiler: Profiler,
89
+ StrictMode: StrictMode,
90
+ Suspense: Suspense,
91
+ SuspenseList: SuspenseList,
92
+ isAsyncMode: isAsyncMode,
93
+ isConcurrentMode: isConcurrentMode,
94
+ isContextConsumer: isContextConsumer,
95
+ isContextProvider: isContextProvider,
96
+ isElement: isElement,
97
+ isForwardRef: isForwardRef,
98
+ isFragment: isFragment,
99
+ isLazy: isLazy,
100
+ isMemo: isMemo,
101
+ isPortal: isPortal,
102
+ isProfiler: isProfiler,
103
+ isStrictMode: isStrictMode,
104
+ isSuspense: isSuspense,
105
+ isSuspenseList: isSuspenseList,
106
+ isValidElementType: isValidElementType,
107
+ typeOf: typeOf
108
+ };
109
+
110
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
111
+ });
112
+
113
+ var reactIs = _commonjsHelpers.createCommonjsModule(function (module) {
114
+
115
+ {
116
+ module.exports = reactIs_production_min;
117
+ }
118
+ });
119
+
120
+ function useMemo(getValue, condition, shouldUpdate) {
121
+ var cacheRef = index$1.react.useRef({});
122
+ if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
123
+ cacheRef.current.value = getValue();
124
+ cacheRef.current.condition = condition;
125
+ }
126
+ return cacheRef.current.value;
127
+ }
128
+
129
+ function fillRef(ref, node) {
130
+ if (typeof ref === 'function') {
131
+ ref(node);
132
+ } else if (_typeof$2(ref) === 'object' && ref && 'current' in ref) {
133
+ ref.current = node;
134
+ }
135
+ }
136
+
137
+ /**
138
+ * Merge refs into one ref function to support ref passing.
139
+ */
140
+ function composeRef() {
141
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
142
+ refs[_key] = arguments[_key];
143
+ }
144
+ var refList = refs.filter(function (ref) {
145
+ return ref;
146
+ });
147
+ if (refList.length <= 1) {
148
+ return refList[0];
149
+ }
150
+ return function (node) {
151
+ refs.forEach(function (ref) {
152
+ fillRef(ref, node);
153
+ });
154
+ };
155
+ }
156
+ function useComposeRef() {
157
+ for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
158
+ refs[_key2] = arguments[_key2];
159
+ }
160
+ return useMemo(function () {
161
+ return composeRef.apply(void 0, refs);
162
+ }, refs, function (prev, next) {
163
+ return prev.length !== next.length || prev.every(function (ref, i) {
164
+ return ref !== next[i];
165
+ });
166
+ });
167
+ }
168
+ function supportRef(nodeOrComponent) {
169
+ var _type$prototype, _nodeOrComponent$prot;
170
+ var type = reactIs.isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
171
+
172
+ // Function component node
173
+ if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== reactIs.ForwardRef) {
174
+ return false;
175
+ }
176
+
177
+ // Class component
178
+ if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== reactIs.ForwardRef) {
179
+ return false;
180
+ }
181
+ return true;
182
+ }
183
+ /* eslint-enable */
184
+
185
+ /* eslint-disable no-console */
186
+ var warned = {};
187
+
188
+ /**
189
+ * Pre warning enable you to parse content before console.error.
190
+ * Modify to null will prevent warning.
191
+ */
192
+ var preMessage = function preMessage(fn) {
193
+ };
194
+
195
+ /**
196
+ * Warning if condition not match.
197
+ * @param valid Condition
198
+ * @param message Warning message
199
+ * @example
200
+ * ```js
201
+ * warning(false, 'some error'); // print some error
202
+ * warning(true, 'some error'); // print nothing
203
+ * warning(1 === 2, 'some error'); // print some error
204
+ * ```
205
+ */
206
+ function warning(valid, message) {
207
+ }
208
+
209
+ /** @see Similar to {@link warning} */
210
+ function note(valid, message) {
211
+ }
212
+ function resetWarned() {
213
+ warned = {};
214
+ }
215
+ function call(method, valid, message) {
216
+ if (!valid && !warned[message]) {
217
+ method(false, message);
218
+ warned[message] = true;
219
+ }
220
+ }
221
+
222
+ /** @see Same as {@link warning}, but only warn once for the same message */
223
+ function warningOnce(valid, message) {
224
+ call(warning, valid, message);
225
+ }
226
+
227
+ /** @see Same as {@link warning}, but only warn once for the same message */
228
+ function noteOnce(valid, message) {
229
+ call(note, valid, message);
230
+ }
231
+ warningOnce.preMessage = preMessage;
232
+ warningOnce.resetWarned = resetWarned;
233
+ warningOnce.noteOnce = noteOnce;
234
+
235
+ function _extends$1() {
236
+ _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
237
+ for (var i = 1; i < arguments.length; i++) {
238
+ var source = arguments[i];
239
+ for (var key in source) {
240
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
241
+ target[key] = source[key];
242
+ }
243
+ }
244
+ }
245
+ return target;
246
+ };
247
+ return _extends$1.apply(this, arguments);
248
+ }
249
+
250
+ function toArray(children) {
251
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
252
+ var ret = [];
253
+ index$1.react.Children.forEach(children, function (child) {
254
+ if ((child === undefined || child === null) && !option.keepEmpty) {
255
+ return;
256
+ }
257
+ if (Array.isArray(child)) {
258
+ ret = ret.concat(toArray(child));
259
+ } else if (reactIs.isFragment(child) && child.props) {
260
+ ret = ret.concat(toArray(child.props.children, option));
261
+ } else {
262
+ ret.push(child);
263
+ }
264
+ });
265
+ return ret;
266
+ }
267
+
268
+ function _typeof$1(obj) {
269
+ "@babel/helpers - typeof";
270
+
271
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
272
+ return typeof obj;
273
+ } : function (obj) {
274
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
275
+ }, _typeof$1(obj);
276
+ }
277
+
278
+ function _toPrimitive$1(input, hint) {
279
+ if (_typeof$1(input) !== "object" || input === null) return input;
280
+ var prim = input[Symbol.toPrimitive];
281
+ if (prim !== undefined) {
282
+ var res = prim.call(input, hint || "default");
283
+ if (_typeof$1(res) !== "object") return res;
284
+ throw new TypeError("@@toPrimitive must return a primitive value.");
285
+ }
286
+ return (hint === "string" ? String : Number)(input);
287
+ }
288
+
289
+ function _toPropertyKey$1(arg) {
290
+ var key = _toPrimitive$1(arg, "string");
291
+ return _typeof$1(key) === "symbol" ? key : String(key);
292
+ }
293
+
294
+ function _defineProperty$1(obj, key, value) {
295
+ key = _toPropertyKey$1(key);
296
+ if (key in obj) {
297
+ Object.defineProperty(obj, key, {
298
+ value: value,
299
+ enumerable: true,
300
+ configurable: true,
301
+ writable: true
302
+ });
303
+ } else {
304
+ obj[key] = value;
305
+ }
306
+ return obj;
307
+ }
308
+
309
+ function ownKeys$1(object, enumerableOnly) {
310
+ var keys = Object.keys(object);
311
+ if (Object.getOwnPropertySymbols) {
312
+ var symbols = Object.getOwnPropertySymbols(object);
313
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
314
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
315
+ })), keys.push.apply(keys, symbols);
316
+ }
317
+ return keys;
318
+ }
319
+ function _objectSpread2$1(target) {
320
+ for (var i = 1; i < arguments.length; i++) {
321
+ var source = null != arguments[i] ? arguments[i] : {};
322
+ i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
323
+ _defineProperty$1(target, key, source[key]);
324
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
325
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
326
+ });
327
+ }
328
+ return target;
329
+ }
330
+
331
+ function isDOM(node) {
332
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element
333
+ // Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
334
+ return node instanceof HTMLElement || node instanceof SVGElement;
335
+ }
336
+
337
+ /**
338
+ * Return if a node is a DOM node. Else will return by `findDOMNode`
339
+ */
340
+ function findDOMNode(node) {
341
+ if (isDOM(node)) {
342
+ return node;
343
+ }
344
+ if (node instanceof index$1.react.Component) {
345
+ return index$1.reactDom.findDOMNode(node);
346
+ }
347
+ return null;
348
+ }
349
+
350
+ var CollectionContext = /*#__PURE__*/index$1.react.createContext(null);
351
+ /**
352
+ * Collect all the resize event from children ResizeObserver
353
+ */
354
+ function Collection(_ref) {
355
+ var children = _ref.children,
356
+ onBatchResize = _ref.onBatchResize;
357
+ var resizeIdRef = index$1.react.useRef(0);
358
+ var resizeInfosRef = index$1.react.useRef([]);
359
+ var onCollectionResize = index$1.react.useContext(CollectionContext);
360
+ var onResize = index$1.react.useCallback(function (size, element, data) {
361
+ resizeIdRef.current += 1;
362
+ var currentId = resizeIdRef.current;
363
+ resizeInfosRef.current.push({
364
+ size: size,
365
+ element: element,
366
+ data: data
367
+ });
368
+ Promise.resolve().then(function () {
369
+ if (currentId === resizeIdRef.current) {
370
+ onBatchResize === null || onBatchResize === void 0 || onBatchResize(resizeInfosRef.current);
371
+ resizeInfosRef.current = [];
372
+ }
373
+ });
374
+
375
+ // Continue bubbling if parent exist
376
+ onCollectionResize === null || onCollectionResize === void 0 || onCollectionResize(size, element, data);
377
+ }, [onBatchResize, onCollectionResize]);
378
+ return /*#__PURE__*/index$1.react.createElement(CollectionContext.Provider, {
379
+ value: onResize
380
+ }, children);
381
+ }
382
+
383
+ /**
384
+ * A collection of shims that provide minimal functionality of the ES6 collections.
385
+ *
386
+ * These implementations are not meant to be used outside of the ResizeObserver
387
+ * modules as they cover only a limited range of use cases.
388
+ */
389
+ /* eslint-disable require-jsdoc, valid-jsdoc */
390
+ var MapShim = (function () {
391
+ if (typeof Map !== 'undefined') {
392
+ return Map;
393
+ }
394
+ /**
395
+ * Returns index in provided array that matches the specified key.
396
+ *
397
+ * @param {Array<Array>} arr
398
+ * @param {*} key
399
+ * @returns {number}
400
+ */
401
+ function getIndex(arr, key) {
402
+ var result = -1;
403
+ arr.some(function (entry, index) {
404
+ if (entry[0] === key) {
405
+ result = index;
406
+ return true;
407
+ }
408
+ return false;
409
+ });
410
+ return result;
411
+ }
412
+ return /** @class */ (function () {
413
+ function class_1() {
414
+ this.__entries__ = [];
415
+ }
416
+ Object.defineProperty(class_1.prototype, "size", {
417
+ /**
418
+ * @returns {boolean}
419
+ */
420
+ get: function () {
421
+ return this.__entries__.length;
422
+ },
423
+ enumerable: true,
424
+ configurable: true
425
+ });
426
+ /**
427
+ * @param {*} key
428
+ * @returns {*}
429
+ */
430
+ class_1.prototype.get = function (key) {
431
+ var index = getIndex(this.__entries__, key);
432
+ var entry = this.__entries__[index];
433
+ return entry && entry[1];
434
+ };
435
+ /**
436
+ * @param {*} key
437
+ * @param {*} value
438
+ * @returns {void}
439
+ */
440
+ class_1.prototype.set = function (key, value) {
441
+ var index = getIndex(this.__entries__, key);
442
+ if (~index) {
443
+ this.__entries__[index][1] = value;
444
+ }
445
+ else {
446
+ this.__entries__.push([key, value]);
447
+ }
448
+ };
449
+ /**
450
+ * @param {*} key
451
+ * @returns {void}
452
+ */
453
+ class_1.prototype.delete = function (key) {
454
+ var entries = this.__entries__;
455
+ var index = getIndex(entries, key);
456
+ if (~index) {
457
+ entries.splice(index, 1);
458
+ }
459
+ };
460
+ /**
461
+ * @param {*} key
462
+ * @returns {void}
463
+ */
464
+ class_1.prototype.has = function (key) {
465
+ return !!~getIndex(this.__entries__, key);
466
+ };
467
+ /**
468
+ * @returns {void}
469
+ */
470
+ class_1.prototype.clear = function () {
471
+ this.__entries__.splice(0);
472
+ };
473
+ /**
474
+ * @param {Function} callback
475
+ * @param {*} [ctx=null]
476
+ * @returns {void}
477
+ */
478
+ class_1.prototype.forEach = function (callback, ctx) {
479
+ if (ctx === void 0) { ctx = null; }
480
+ for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
481
+ var entry = _a[_i];
482
+ callback.call(ctx, entry[1], entry[0]);
483
+ }
484
+ };
485
+ return class_1;
486
+ }());
487
+ })();
488
+
489
+ /**
490
+ * Detects whether window and document objects are available in current environment.
491
+ */
492
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
493
+
494
+ // Returns global object of a current environment.
495
+ var global$1 = (function () {
496
+ if (typeof global !== 'undefined' && global.Math === Math) {
497
+ return global;
498
+ }
499
+ if (typeof self !== 'undefined' && self.Math === Math) {
500
+ return self;
501
+ }
502
+ if (typeof window !== 'undefined' && window.Math === Math) {
503
+ return window;
504
+ }
505
+ // eslint-disable-next-line no-new-func
506
+ return Function('return this')();
507
+ })();
508
+
509
+ /**
510
+ * A shim for the requestAnimationFrame which falls back to the setTimeout if
511
+ * first one is not supported.
512
+ *
513
+ * @returns {number} Requests' identifier.
514
+ */
515
+ var requestAnimationFrame$1 = (function () {
516
+ if (typeof requestAnimationFrame === 'function') {
517
+ // It's required to use a bounded function because IE sometimes throws
518
+ // an "Invalid calling object" error if rAF is invoked without the global
519
+ // object on the left hand side.
520
+ return requestAnimationFrame.bind(global$1);
521
+ }
522
+ return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
523
+ })();
524
+
525
+ // Defines minimum timeout before adding a trailing call.
526
+ var trailingTimeout = 2;
527
+ /**
528
+ * Creates a wrapper function which ensures that provided callback will be
529
+ * invoked only once during the specified delay period.
530
+ *
531
+ * @param {Function} callback - Function to be invoked after the delay period.
532
+ * @param {number} delay - Delay after which to invoke callback.
533
+ * @returns {Function}
534
+ */
535
+ function throttle (callback, delay) {
536
+ var leadingCall = false, trailingCall = false, lastCallTime = 0;
537
+ /**
538
+ * Invokes the original callback function and schedules new invocation if
539
+ * the "proxy" was called during current request.
540
+ *
541
+ * @returns {void}
542
+ */
543
+ function resolvePending() {
544
+ if (leadingCall) {
545
+ leadingCall = false;
546
+ callback();
547
+ }
548
+ if (trailingCall) {
549
+ proxy();
550
+ }
551
+ }
552
+ /**
553
+ * Callback invoked after the specified delay. It will further postpone
554
+ * invocation of the original function delegating it to the
555
+ * requestAnimationFrame.
556
+ *
557
+ * @returns {void}
558
+ */
559
+ function timeoutCallback() {
560
+ requestAnimationFrame$1(resolvePending);
561
+ }
562
+ /**
563
+ * Schedules invocation of the original function.
564
+ *
565
+ * @returns {void}
566
+ */
567
+ function proxy() {
568
+ var timeStamp = Date.now();
569
+ if (leadingCall) {
570
+ // Reject immediately following calls.
571
+ if (timeStamp - lastCallTime < trailingTimeout) {
572
+ return;
573
+ }
574
+ // Schedule new call to be in invoked when the pending one is resolved.
575
+ // This is important for "transitions" which never actually start
576
+ // immediately so there is a chance that we might miss one if change
577
+ // happens amids the pending invocation.
578
+ trailingCall = true;
579
+ }
580
+ else {
581
+ leadingCall = true;
582
+ trailingCall = false;
583
+ setTimeout(timeoutCallback, delay);
584
+ }
585
+ lastCallTime = timeStamp;
586
+ }
587
+ return proxy;
588
+ }
589
+
590
+ // Minimum delay before invoking the update of observers.
591
+ var REFRESH_DELAY = 20;
592
+ // A list of substrings of CSS properties used to find transition events that
593
+ // might affect dimensions of observed elements.
594
+ var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
595
+ // Check if MutationObserver is available.
596
+ var mutationObserverSupported = typeof MutationObserver !== 'undefined';
597
+ /**
598
+ * Singleton controller class which handles updates of ResizeObserver instances.
599
+ */
600
+ var ResizeObserverController = /** @class */ (function () {
601
+ /**
602
+ * Creates a new instance of ResizeObserverController.
603
+ *
604
+ * @private
605
+ */
606
+ function ResizeObserverController() {
607
+ /**
608
+ * Indicates whether DOM listeners have been added.
609
+ *
610
+ * @private {boolean}
611
+ */
612
+ this.connected_ = false;
613
+ /**
614
+ * Tells that controller has subscribed for Mutation Events.
615
+ *
616
+ * @private {boolean}
617
+ */
618
+ this.mutationEventsAdded_ = false;
619
+ /**
620
+ * Keeps reference to the instance of MutationObserver.
621
+ *
622
+ * @private {MutationObserver}
623
+ */
624
+ this.mutationsObserver_ = null;
625
+ /**
626
+ * A list of connected observers.
627
+ *
628
+ * @private {Array<ResizeObserverSPI>}
629
+ */
630
+ this.observers_ = [];
631
+ this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
632
+ this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
633
+ }
634
+ /**
635
+ * Adds observer to observers list.
636
+ *
637
+ * @param {ResizeObserverSPI} observer - Observer to be added.
638
+ * @returns {void}
639
+ */
640
+ ResizeObserverController.prototype.addObserver = function (observer) {
641
+ if (!~this.observers_.indexOf(observer)) {
642
+ this.observers_.push(observer);
643
+ }
644
+ // Add listeners if they haven't been added yet.
645
+ if (!this.connected_) {
646
+ this.connect_();
647
+ }
648
+ };
649
+ /**
650
+ * Removes observer from observers list.
651
+ *
652
+ * @param {ResizeObserverSPI} observer - Observer to be removed.
653
+ * @returns {void}
654
+ */
655
+ ResizeObserverController.prototype.removeObserver = function (observer) {
656
+ var observers = this.observers_;
657
+ var index = observers.indexOf(observer);
658
+ // Remove observer if it's present in registry.
659
+ if (~index) {
660
+ observers.splice(index, 1);
661
+ }
662
+ // Remove listeners if controller has no connected observers.
663
+ if (!observers.length && this.connected_) {
664
+ this.disconnect_();
665
+ }
666
+ };
667
+ /**
668
+ * Invokes the update of observers. It will continue running updates insofar
669
+ * it detects changes.
670
+ *
671
+ * @returns {void}
672
+ */
673
+ ResizeObserverController.prototype.refresh = function () {
674
+ var changesDetected = this.updateObservers_();
675
+ // Continue running updates if changes have been detected as there might
676
+ // be future ones caused by CSS transitions.
677
+ if (changesDetected) {
678
+ this.refresh();
679
+ }
680
+ };
681
+ /**
682
+ * Updates every observer from observers list and notifies them of queued
683
+ * entries.
684
+ *
685
+ * @private
686
+ * @returns {boolean} Returns "true" if any observer has detected changes in
687
+ * dimensions of it's elements.
688
+ */
689
+ ResizeObserverController.prototype.updateObservers_ = function () {
690
+ // Collect observers that have active observations.
691
+ var activeObservers = this.observers_.filter(function (observer) {
692
+ return observer.gatherActive(), observer.hasActive();
693
+ });
694
+ // Deliver notifications in a separate cycle in order to avoid any
695
+ // collisions between observers, e.g. when multiple instances of
696
+ // ResizeObserver are tracking the same element and the callback of one
697
+ // of them changes content dimensions of the observed target. Sometimes
698
+ // this may result in notifications being blocked for the rest of observers.
699
+ activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
700
+ return activeObservers.length > 0;
701
+ };
702
+ /**
703
+ * Initializes DOM listeners.
704
+ *
705
+ * @private
706
+ * @returns {void}
707
+ */
708
+ ResizeObserverController.prototype.connect_ = function () {
709
+ // Do nothing if running in a non-browser environment or if listeners
710
+ // have been already added.
711
+ if (!isBrowser || this.connected_) {
712
+ return;
713
+ }
714
+ // Subscription to the "Transitionend" event is used as a workaround for
715
+ // delayed transitions. This way it's possible to capture at least the
716
+ // final state of an element.
717
+ document.addEventListener('transitionend', this.onTransitionEnd_);
718
+ window.addEventListener('resize', this.refresh);
719
+ if (mutationObserverSupported) {
720
+ this.mutationsObserver_ = new MutationObserver(this.refresh);
721
+ this.mutationsObserver_.observe(document, {
722
+ attributes: true,
723
+ childList: true,
724
+ characterData: true,
725
+ subtree: true
726
+ });
727
+ }
728
+ else {
729
+ document.addEventListener('DOMSubtreeModified', this.refresh);
730
+ this.mutationEventsAdded_ = true;
731
+ }
732
+ this.connected_ = true;
733
+ };
734
+ /**
735
+ * Removes DOM listeners.
736
+ *
737
+ * @private
738
+ * @returns {void}
739
+ */
740
+ ResizeObserverController.prototype.disconnect_ = function () {
741
+ // Do nothing if running in a non-browser environment or if listeners
742
+ // have been already removed.
743
+ if (!isBrowser || !this.connected_) {
744
+ return;
745
+ }
746
+ document.removeEventListener('transitionend', this.onTransitionEnd_);
747
+ window.removeEventListener('resize', this.refresh);
748
+ if (this.mutationsObserver_) {
749
+ this.mutationsObserver_.disconnect();
750
+ }
751
+ if (this.mutationEventsAdded_) {
752
+ document.removeEventListener('DOMSubtreeModified', this.refresh);
753
+ }
754
+ this.mutationsObserver_ = null;
755
+ this.mutationEventsAdded_ = false;
756
+ this.connected_ = false;
757
+ };
758
+ /**
759
+ * "Transitionend" event handler.
760
+ *
761
+ * @private
762
+ * @param {TransitionEvent} event
763
+ * @returns {void}
764
+ */
765
+ ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
766
+ var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
767
+ // Detect whether transition may affect dimensions of an element.
768
+ var isReflowProperty = transitionKeys.some(function (key) {
769
+ return !!~propertyName.indexOf(key);
770
+ });
771
+ if (isReflowProperty) {
772
+ this.refresh();
773
+ }
774
+ };
775
+ /**
776
+ * Returns instance of the ResizeObserverController.
777
+ *
778
+ * @returns {ResizeObserverController}
779
+ */
780
+ ResizeObserverController.getInstance = function () {
781
+ if (!this.instance_) {
782
+ this.instance_ = new ResizeObserverController();
783
+ }
784
+ return this.instance_;
785
+ };
786
+ /**
787
+ * Holds reference to the controller's instance.
788
+ *
789
+ * @private {ResizeObserverController}
790
+ */
791
+ ResizeObserverController.instance_ = null;
792
+ return ResizeObserverController;
793
+ }());
794
+
795
+ /**
796
+ * Defines non-writable/enumerable properties of the provided target object.
797
+ *
798
+ * @param {Object} target - Object for which to define properties.
799
+ * @param {Object} props - Properties to be defined.
800
+ * @returns {Object} Target object.
801
+ */
802
+ var defineConfigurable = (function (target, props) {
803
+ for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
804
+ var key = _a[_i];
805
+ Object.defineProperty(target, key, {
806
+ value: props[key],
807
+ enumerable: false,
808
+ writable: false,
809
+ configurable: true
810
+ });
811
+ }
812
+ return target;
813
+ });
814
+
815
+ /**
816
+ * Returns the global object associated with provided element.
817
+ *
818
+ * @param {Object} target
819
+ * @returns {Object}
820
+ */
821
+ var getWindowOf = (function (target) {
822
+ // Assume that the element is an instance of Node, which means that it
823
+ // has the "ownerDocument" property from which we can retrieve a
824
+ // corresponding global object.
825
+ var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
826
+ // Return the local global object if it's not possible extract one from
827
+ // provided element.
828
+ return ownerGlobal || global$1;
829
+ });
830
+
831
+ // Placeholder of an empty content rectangle.
832
+ var emptyRect = createRectInit(0, 0, 0, 0);
833
+ /**
834
+ * Converts provided string to a number.
835
+ *
836
+ * @param {number|string} value
837
+ * @returns {number}
838
+ */
839
+ function toFloat(value) {
840
+ return parseFloat(value) || 0;
841
+ }
842
+ /**
843
+ * Extracts borders size from provided styles.
844
+ *
845
+ * @param {CSSStyleDeclaration} styles
846
+ * @param {...string} positions - Borders positions (top, right, ...)
847
+ * @returns {number}
848
+ */
849
+ function getBordersSize(styles) {
850
+ var positions = [];
851
+ for (var _i = 1; _i < arguments.length; _i++) {
852
+ positions[_i - 1] = arguments[_i];
853
+ }
854
+ return positions.reduce(function (size, position) {
855
+ var value = styles['border-' + position + '-width'];
856
+ return size + toFloat(value);
857
+ }, 0);
858
+ }
859
+ /**
860
+ * Extracts paddings sizes from provided styles.
861
+ *
862
+ * @param {CSSStyleDeclaration} styles
863
+ * @returns {Object} Paddings box.
864
+ */
865
+ function getPaddings(styles) {
866
+ var positions = ['top', 'right', 'bottom', 'left'];
867
+ var paddings = {};
868
+ for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
869
+ var position = positions_1[_i];
870
+ var value = styles['padding-' + position];
871
+ paddings[position] = toFloat(value);
872
+ }
873
+ return paddings;
874
+ }
875
+ /**
876
+ * Calculates content rectangle of provided SVG element.
877
+ *
878
+ * @param {SVGGraphicsElement} target - Element content rectangle of which needs
879
+ * to be calculated.
880
+ * @returns {DOMRectInit}
881
+ */
882
+ function getSVGContentRect(target) {
883
+ var bbox = target.getBBox();
884
+ return createRectInit(0, 0, bbox.width, bbox.height);
885
+ }
886
+ /**
887
+ * Calculates content rectangle of provided HTMLElement.
888
+ *
889
+ * @param {HTMLElement} target - Element for which to calculate the content rectangle.
890
+ * @returns {DOMRectInit}
891
+ */
892
+ function getHTMLElementContentRect(target) {
893
+ // Client width & height properties can't be
894
+ // used exclusively as they provide rounded values.
895
+ var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
896
+ // By this condition we can catch all non-replaced inline, hidden and
897
+ // detached elements. Though elements with width & height properties less
898
+ // than 0.5 will be discarded as well.
899
+ //
900
+ // Without it we would need to implement separate methods for each of
901
+ // those cases and it's not possible to perform a precise and performance
902
+ // effective test for hidden elements. E.g. even jQuery's ':visible' filter
903
+ // gives wrong results for elements with width & height less than 0.5.
904
+ if (!clientWidth && !clientHeight) {
905
+ return emptyRect;
906
+ }
907
+ var styles = getWindowOf(target).getComputedStyle(target);
908
+ var paddings = getPaddings(styles);
909
+ var horizPad = paddings.left + paddings.right;
910
+ var vertPad = paddings.top + paddings.bottom;
911
+ // Computed styles of width & height are being used because they are the
912
+ // only dimensions available to JS that contain non-rounded values. It could
913
+ // be possible to utilize the getBoundingClientRect if only it's data wasn't
914
+ // affected by CSS transformations let alone paddings, borders and scroll bars.
915
+ var width = toFloat(styles.width), height = toFloat(styles.height);
916
+ // Width & height include paddings and borders when the 'border-box' box
917
+ // model is applied (except for IE).
918
+ if (styles.boxSizing === 'border-box') {
919
+ // Following conditions are required to handle Internet Explorer which
920
+ // doesn't include paddings and borders to computed CSS dimensions.
921
+ //
922
+ // We can say that if CSS dimensions + paddings are equal to the "client"
923
+ // properties then it's either IE, and thus we don't need to subtract
924
+ // anything, or an element merely doesn't have paddings/borders styles.
925
+ if (Math.round(width + horizPad) !== clientWidth) {
926
+ width -= getBordersSize(styles, 'left', 'right') + horizPad;
927
+ }
928
+ if (Math.round(height + vertPad) !== clientHeight) {
929
+ height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
930
+ }
931
+ }
932
+ // Following steps can't be applied to the document's root element as its
933
+ // client[Width/Height] properties represent viewport area of the window.
934
+ // Besides, it's as well not necessary as the <html> itself neither has
935
+ // rendered scroll bars nor it can be clipped.
936
+ if (!isDocumentElement(target)) {
937
+ // In some browsers (only in Firefox, actually) CSS width & height
938
+ // include scroll bars size which can be removed at this step as scroll
939
+ // bars are the only difference between rounded dimensions + paddings
940
+ // and "client" properties, though that is not always true in Chrome.
941
+ var vertScrollbar = Math.round(width + horizPad) - clientWidth;
942
+ var horizScrollbar = Math.round(height + vertPad) - clientHeight;
943
+ // Chrome has a rather weird rounding of "client" properties.
944
+ // E.g. for an element with content width of 314.2px it sometimes gives
945
+ // the client width of 315px and for the width of 314.7px it may give
946
+ // 314px. And it doesn't happen all the time. So just ignore this delta
947
+ // as a non-relevant.
948
+ if (Math.abs(vertScrollbar) !== 1) {
949
+ width -= vertScrollbar;
950
+ }
951
+ if (Math.abs(horizScrollbar) !== 1) {
952
+ height -= horizScrollbar;
953
+ }
954
+ }
955
+ return createRectInit(paddings.left, paddings.top, width, height);
956
+ }
957
+ /**
958
+ * Checks whether provided element is an instance of the SVGGraphicsElement.
959
+ *
960
+ * @param {Element} target - Element to be checked.
961
+ * @returns {boolean}
962
+ */
963
+ var isSVGGraphicsElement = (function () {
964
+ // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
965
+ // interface.
966
+ if (typeof SVGGraphicsElement !== 'undefined') {
967
+ return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
968
+ }
969
+ // If it's so, then check that element is at least an instance of the
970
+ // SVGElement and that it has the "getBBox" method.
971
+ // eslint-disable-next-line no-extra-parens
972
+ return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
973
+ typeof target.getBBox === 'function'); };
974
+ })();
975
+ /**
976
+ * Checks whether provided element is a document element (<html>).
977
+ *
978
+ * @param {Element} target - Element to be checked.
979
+ * @returns {boolean}
980
+ */
981
+ function isDocumentElement(target) {
982
+ return target === getWindowOf(target).document.documentElement;
983
+ }
984
+ /**
985
+ * Calculates an appropriate content rectangle for provided html or svg element.
986
+ *
987
+ * @param {Element} target - Element content rectangle of which needs to be calculated.
988
+ * @returns {DOMRectInit}
989
+ */
990
+ function getContentRect(target) {
991
+ if (!isBrowser) {
992
+ return emptyRect;
993
+ }
994
+ if (isSVGGraphicsElement(target)) {
995
+ return getSVGContentRect(target);
996
+ }
997
+ return getHTMLElementContentRect(target);
998
+ }
999
+ /**
1000
+ * Creates rectangle with an interface of the DOMRectReadOnly.
1001
+ * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
1002
+ *
1003
+ * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
1004
+ * @returns {DOMRectReadOnly}
1005
+ */
1006
+ function createReadOnlyRect(_a) {
1007
+ var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
1008
+ // If DOMRectReadOnly is available use it as a prototype for the rectangle.
1009
+ var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
1010
+ var rect = Object.create(Constr.prototype);
1011
+ // Rectangle's properties are not writable and non-enumerable.
1012
+ defineConfigurable(rect, {
1013
+ x: x, y: y, width: width, height: height,
1014
+ top: y,
1015
+ right: x + width,
1016
+ bottom: height + y,
1017
+ left: x
1018
+ });
1019
+ return rect;
1020
+ }
1021
+ /**
1022
+ * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
1023
+ * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
1024
+ *
1025
+ * @param {number} x - X coordinate.
1026
+ * @param {number} y - Y coordinate.
1027
+ * @param {number} width - Rectangle's width.
1028
+ * @param {number} height - Rectangle's height.
1029
+ * @returns {DOMRectInit}
1030
+ */
1031
+ function createRectInit(x, y, width, height) {
1032
+ return { x: x, y: y, width: width, height: height };
1033
+ }
1034
+
1035
+ /**
1036
+ * Class that is responsible for computations of the content rectangle of
1037
+ * provided DOM element and for keeping track of it's changes.
1038
+ */
1039
+ var ResizeObservation = /** @class */ (function () {
1040
+ /**
1041
+ * Creates an instance of ResizeObservation.
1042
+ *
1043
+ * @param {Element} target - Element to be observed.
1044
+ */
1045
+ function ResizeObservation(target) {
1046
+ /**
1047
+ * Broadcasted width of content rectangle.
1048
+ *
1049
+ * @type {number}
1050
+ */
1051
+ this.broadcastWidth = 0;
1052
+ /**
1053
+ * Broadcasted height of content rectangle.
1054
+ *
1055
+ * @type {number}
1056
+ */
1057
+ this.broadcastHeight = 0;
1058
+ /**
1059
+ * Reference to the last observed content rectangle.
1060
+ *
1061
+ * @private {DOMRectInit}
1062
+ */
1063
+ this.contentRect_ = createRectInit(0, 0, 0, 0);
1064
+ this.target = target;
1065
+ }
1066
+ /**
1067
+ * Updates content rectangle and tells whether it's width or height properties
1068
+ * have changed since the last broadcast.
1069
+ *
1070
+ * @returns {boolean}
1071
+ */
1072
+ ResizeObservation.prototype.isActive = function () {
1073
+ var rect = getContentRect(this.target);
1074
+ this.contentRect_ = rect;
1075
+ return (rect.width !== this.broadcastWidth ||
1076
+ rect.height !== this.broadcastHeight);
1077
+ };
1078
+ /**
1079
+ * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
1080
+ * from the corresponding properties of the last observed content rectangle.
1081
+ *
1082
+ * @returns {DOMRectInit} Last observed content rectangle.
1083
+ */
1084
+ ResizeObservation.prototype.broadcastRect = function () {
1085
+ var rect = this.contentRect_;
1086
+ this.broadcastWidth = rect.width;
1087
+ this.broadcastHeight = rect.height;
1088
+ return rect;
1089
+ };
1090
+ return ResizeObservation;
1091
+ }());
1092
+
1093
+ var ResizeObserverEntry = /** @class */ (function () {
1094
+ /**
1095
+ * Creates an instance of ResizeObserverEntry.
1096
+ *
1097
+ * @param {Element} target - Element that is being observed.
1098
+ * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
1099
+ */
1100
+ function ResizeObserverEntry(target, rectInit) {
1101
+ var contentRect = createReadOnlyRect(rectInit);
1102
+ // According to the specification following properties are not writable
1103
+ // and are also not enumerable in the native implementation.
1104
+ //
1105
+ // Property accessors are not being used as they'd require to define a
1106
+ // private WeakMap storage which may cause memory leaks in browsers that
1107
+ // don't support this type of collections.
1108
+ defineConfigurable(this, { target: target, contentRect: contentRect });
1109
+ }
1110
+ return ResizeObserverEntry;
1111
+ }());
1112
+
1113
+ var ResizeObserverSPI = /** @class */ (function () {
1114
+ /**
1115
+ * Creates a new instance of ResizeObserver.
1116
+ *
1117
+ * @param {ResizeObserverCallback} callback - Callback function that is invoked
1118
+ * when one of the observed elements changes it's content dimensions.
1119
+ * @param {ResizeObserverController} controller - Controller instance which
1120
+ * is responsible for the updates of observer.
1121
+ * @param {ResizeObserver} callbackCtx - Reference to the public
1122
+ * ResizeObserver instance which will be passed to callback function.
1123
+ */
1124
+ function ResizeObserverSPI(callback, controller, callbackCtx) {
1125
+ /**
1126
+ * Collection of resize observations that have detected changes in dimensions
1127
+ * of elements.
1128
+ *
1129
+ * @private {Array<ResizeObservation>}
1130
+ */
1131
+ this.activeObservations_ = [];
1132
+ /**
1133
+ * Registry of the ResizeObservation instances.
1134
+ *
1135
+ * @private {Map<Element, ResizeObservation>}
1136
+ */
1137
+ this.observations_ = new MapShim();
1138
+ if (typeof callback !== 'function') {
1139
+ throw new TypeError('The callback provided as parameter 1 is not a function.');
1140
+ }
1141
+ this.callback_ = callback;
1142
+ this.controller_ = controller;
1143
+ this.callbackCtx_ = callbackCtx;
1144
+ }
1145
+ /**
1146
+ * Starts observing provided element.
1147
+ *
1148
+ * @param {Element} target - Element to be observed.
1149
+ * @returns {void}
1150
+ */
1151
+ ResizeObserverSPI.prototype.observe = function (target) {
1152
+ if (!arguments.length) {
1153
+ throw new TypeError('1 argument required, but only 0 present.');
1154
+ }
1155
+ // Do nothing if current environment doesn't have the Element interface.
1156
+ if (typeof Element === 'undefined' || !(Element instanceof Object)) {
1157
+ return;
1158
+ }
1159
+ if (!(target instanceof getWindowOf(target).Element)) {
1160
+ throw new TypeError('parameter 1 is not of type "Element".');
1161
+ }
1162
+ var observations = this.observations_;
1163
+ // Do nothing if element is already being observed.
1164
+ if (observations.has(target)) {
1165
+ return;
1166
+ }
1167
+ observations.set(target, new ResizeObservation(target));
1168
+ this.controller_.addObserver(this);
1169
+ // Force the update of observations.
1170
+ this.controller_.refresh();
1171
+ };
1172
+ /**
1173
+ * Stops observing provided element.
1174
+ *
1175
+ * @param {Element} target - Element to stop observing.
1176
+ * @returns {void}
1177
+ */
1178
+ ResizeObserverSPI.prototype.unobserve = function (target) {
1179
+ if (!arguments.length) {
1180
+ throw new TypeError('1 argument required, but only 0 present.');
1181
+ }
1182
+ // Do nothing if current environment doesn't have the Element interface.
1183
+ if (typeof Element === 'undefined' || !(Element instanceof Object)) {
1184
+ return;
1185
+ }
1186
+ if (!(target instanceof getWindowOf(target).Element)) {
1187
+ throw new TypeError('parameter 1 is not of type "Element".');
1188
+ }
1189
+ var observations = this.observations_;
1190
+ // Do nothing if element is not being observed.
1191
+ if (!observations.has(target)) {
1192
+ return;
1193
+ }
1194
+ observations.delete(target);
1195
+ if (!observations.size) {
1196
+ this.controller_.removeObserver(this);
1197
+ }
1198
+ };
1199
+ /**
1200
+ * Stops observing all elements.
1201
+ *
1202
+ * @returns {void}
1203
+ */
1204
+ ResizeObserverSPI.prototype.disconnect = function () {
1205
+ this.clearActive();
1206
+ this.observations_.clear();
1207
+ this.controller_.removeObserver(this);
1208
+ };
1209
+ /**
1210
+ * Collects observation instances the associated element of which has changed
1211
+ * it's content rectangle.
1212
+ *
1213
+ * @returns {void}
1214
+ */
1215
+ ResizeObserverSPI.prototype.gatherActive = function () {
1216
+ var _this = this;
1217
+ this.clearActive();
1218
+ this.observations_.forEach(function (observation) {
1219
+ if (observation.isActive()) {
1220
+ _this.activeObservations_.push(observation);
1221
+ }
1222
+ });
1223
+ };
1224
+ /**
1225
+ * Invokes initial callback function with a list of ResizeObserverEntry
1226
+ * instances collected from active resize observations.
1227
+ *
1228
+ * @returns {void}
1229
+ */
1230
+ ResizeObserverSPI.prototype.broadcastActive = function () {
1231
+ // Do nothing if observer doesn't have active observations.
1232
+ if (!this.hasActive()) {
1233
+ return;
1234
+ }
1235
+ var ctx = this.callbackCtx_;
1236
+ // Create ResizeObserverEntry instance for every active observation.
1237
+ var entries = this.activeObservations_.map(function (observation) {
1238
+ return new ResizeObserverEntry(observation.target, observation.broadcastRect());
1239
+ });
1240
+ this.callback_.call(ctx, entries, ctx);
1241
+ this.clearActive();
1242
+ };
1243
+ /**
1244
+ * Clears the collection of active observations.
1245
+ *
1246
+ * @returns {void}
1247
+ */
1248
+ ResizeObserverSPI.prototype.clearActive = function () {
1249
+ this.activeObservations_.splice(0);
1250
+ };
1251
+ /**
1252
+ * Tells whether observer has active observations.
1253
+ *
1254
+ * @returns {boolean}
1255
+ */
1256
+ ResizeObserverSPI.prototype.hasActive = function () {
1257
+ return this.activeObservations_.length > 0;
1258
+ };
1259
+ return ResizeObserverSPI;
1260
+ }());
1261
+
1262
+ // Registry of internal observers. If WeakMap is not available use current shim
1263
+ // for the Map collection as it has all required methods and because WeakMap
1264
+ // can't be fully polyfilled anyway.
1265
+ var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
1266
+ /**
1267
+ * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
1268
+ * exposing only those methods and properties that are defined in the spec.
1269
+ */
1270
+ var ResizeObserver$1 = /** @class */ (function () {
1271
+ /**
1272
+ * Creates a new instance of ResizeObserver.
1273
+ *
1274
+ * @param {ResizeObserverCallback} callback - Callback that is invoked when
1275
+ * dimensions of the observed elements change.
1276
+ */
1277
+ function ResizeObserver(callback) {
1278
+ if (!(this instanceof ResizeObserver)) {
1279
+ throw new TypeError('Cannot call a class as a function.');
1280
+ }
1281
+ if (!arguments.length) {
1282
+ throw new TypeError('1 argument required, but only 0 present.');
1283
+ }
1284
+ var controller = ResizeObserverController.getInstance();
1285
+ var observer = new ResizeObserverSPI(callback, controller, this);
1286
+ observers.set(this, observer);
1287
+ }
1288
+ return ResizeObserver;
1289
+ }());
1290
+ // Expose public methods of ResizeObserver.
1291
+ [
1292
+ 'observe',
1293
+ 'unobserve',
1294
+ 'disconnect'
1295
+ ].forEach(function (method) {
1296
+ ResizeObserver$1.prototype[method] = function () {
1297
+ var _a;
1298
+ return (_a = observers.get(this))[method].apply(_a, arguments);
1299
+ };
1300
+ });
1301
+
1302
+ var index = (function () {
1303
+ // Export existing implementation if available.
1304
+ if (typeof global$1.ResizeObserver !== 'undefined') {
1305
+ return global$1.ResizeObserver;
1306
+ }
1307
+ return ResizeObserver$1;
1308
+ })();
1309
+
1310
+ // =============================== Const ===============================
1311
+ var elementListeners = new Map();
1312
+ function onResize(entities) {
1313
+ entities.forEach(function (entity) {
1314
+ var _elementListeners$get;
1315
+ var target = entity.target;
1316
+ (_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 || _elementListeners$get.forEach(function (listener) {
1317
+ return listener(target);
1318
+ });
1319
+ });
1320
+ }
1321
+
1322
+ // Note: ResizeObserver polyfill not support option to measure border-box resize
1323
+ var resizeObserver = new index(onResize);
1324
+
1325
+ // ============================== Observe ==============================
1326
+ function observe(element, callback) {
1327
+ if (!elementListeners.has(element)) {
1328
+ elementListeners.set(element, new Set());
1329
+ resizeObserver.observe(element);
1330
+ }
1331
+ elementListeners.get(element).add(callback);
1332
+ }
1333
+ function unobserve(element, callback) {
1334
+ if (elementListeners.has(element)) {
1335
+ elementListeners.get(element).delete(callback);
1336
+ if (!elementListeners.get(element).size) {
1337
+ resizeObserver.unobserve(element);
1338
+ elementListeners.delete(element);
1339
+ }
1340
+ }
1341
+ }
1342
+
1343
+ function _classCallCheck(instance, Constructor) {
1344
+ if (!(instance instanceof Constructor)) {
1345
+ throw new TypeError("Cannot call a class as a function");
1346
+ }
1347
+ }
1348
+
1349
+ function _defineProperties(target, props) {
1350
+ for (var i = 0; i < props.length; i++) {
1351
+ var descriptor = props[i];
1352
+ descriptor.enumerable = descriptor.enumerable || false;
1353
+ descriptor.configurable = true;
1354
+ if ("value" in descriptor) descriptor.writable = true;
1355
+ Object.defineProperty(target, _toPropertyKey$1(descriptor.key), descriptor);
1356
+ }
1357
+ }
1358
+ function _createClass(Constructor, protoProps, staticProps) {
1359
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1360
+ if (staticProps) _defineProperties(Constructor, staticProps);
1361
+ Object.defineProperty(Constructor, "prototype", {
1362
+ writable: false
1363
+ });
1364
+ return Constructor;
1365
+ }
1366
+
1367
+ function _setPrototypeOf(o, p) {
1368
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
1369
+ o.__proto__ = p;
1370
+ return o;
1371
+ };
1372
+ return _setPrototypeOf(o, p);
1373
+ }
1374
+
1375
+ function _inherits(subClass, superClass) {
1376
+ if (typeof superClass !== "function" && superClass !== null) {
1377
+ throw new TypeError("Super expression must either be null or a function");
1378
+ }
1379
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1380
+ constructor: {
1381
+ value: subClass,
1382
+ writable: true,
1383
+ configurable: true
1384
+ }
1385
+ });
1386
+ Object.defineProperty(subClass, "prototype", {
1387
+ writable: false
1388
+ });
1389
+ if (superClass) _setPrototypeOf(subClass, superClass);
1390
+ }
1391
+
1392
+ function _getPrototypeOf(o) {
1393
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
1394
+ return o.__proto__ || Object.getPrototypeOf(o);
1395
+ };
1396
+ return _getPrototypeOf(o);
1397
+ }
1398
+
1399
+ function _isNativeReflectConstruct() {
1400
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1401
+ if (Reflect.construct.sham) return false;
1402
+ if (typeof Proxy === "function") return true;
1403
+ try {
1404
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
1405
+ return true;
1406
+ } catch (e) {
1407
+ return false;
1408
+ }
1409
+ }
1410
+
1411
+ function _assertThisInitialized(self) {
1412
+ if (self === void 0) {
1413
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1414
+ }
1415
+ return self;
1416
+ }
1417
+
1418
+ function _possibleConstructorReturn(self, call) {
1419
+ if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
1420
+ return call;
1421
+ } else if (call !== void 0) {
1422
+ throw new TypeError("Derived constructors may only return object or undefined");
1423
+ }
1424
+ return _assertThisInitialized(self);
1425
+ }
1426
+
1427
+ function _createSuper(Derived) {
1428
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
1429
+ return function _createSuperInternal() {
1430
+ var Super = _getPrototypeOf(Derived),
1431
+ result;
1432
+ if (hasNativeReflectConstruct) {
1433
+ var NewTarget = _getPrototypeOf(this).constructor;
1434
+ result = Reflect.construct(Super, arguments, NewTarget);
1435
+ } else {
1436
+ result = Super.apply(this, arguments);
1437
+ }
1438
+ return _possibleConstructorReturn(this, result);
1439
+ };
1440
+ }
1441
+
1442
+ /**
1443
+ * Fallback to findDOMNode if origin ref do not provide any dom element
1444
+ */
1445
+ var DomWrapper = /*#__PURE__*/function (_React$Component) {
1446
+ _inherits(DomWrapper, _React$Component);
1447
+ var _super = _createSuper(DomWrapper);
1448
+ function DomWrapper() {
1449
+ _classCallCheck(this, DomWrapper);
1450
+ return _super.apply(this, arguments);
1451
+ }
1452
+ _createClass(DomWrapper, [{
1453
+ key: "render",
1454
+ value: function render() {
1455
+ return this.props.children;
1456
+ }
1457
+ }]);
1458
+ return DomWrapper;
1459
+ }(index$1.react.Component);
1460
+
1461
+ function SingleObserver(props, ref) {
1462
+ var children = props.children,
1463
+ disabled = props.disabled;
1464
+ var elementRef = index$1.react.useRef(null);
1465
+ var wrapperRef = index$1.react.useRef(null);
1466
+ var onCollectionResize = index$1.react.useContext(CollectionContext);
1467
+
1468
+ // =========================== Children ===========================
1469
+ var isRenderProps = typeof children === 'function';
1470
+ var mergedChildren = isRenderProps ? children(elementRef) : children;
1471
+
1472
+ // ============================= Size =============================
1473
+ var sizeRef = index$1.react.useRef({
1474
+ width: -1,
1475
+ height: -1,
1476
+ offsetWidth: -1,
1477
+ offsetHeight: -1
1478
+ });
1479
+
1480
+ // ============================= Ref ==============================
1481
+ var canRef = !isRenderProps && /*#__PURE__*/index$1.react.isValidElement(mergedChildren) && supportRef(mergedChildren);
1482
+ var originRef = canRef ? mergedChildren.ref : null;
1483
+ var mergedRef = useComposeRef(originRef, elementRef);
1484
+ var getDom = function getDom() {
1485
+ var _elementRef$current;
1486
+ return findDOMNode(elementRef.current) || (
1487
+ // Support `nativeElement` format
1488
+ elementRef.current && _typeof$1(elementRef.current) === 'object' ? findDOMNode((_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : _elementRef$current.nativeElement) : null) || findDOMNode(wrapperRef.current);
1489
+ };
1490
+ index$1.react.useImperativeHandle(ref, function () {
1491
+ return getDom();
1492
+ });
1493
+
1494
+ // =========================== Observe ============================
1495
+ var propsRef = index$1.react.useRef(props);
1496
+ propsRef.current = props;
1497
+
1498
+ // Handler
1499
+ var onInternalResize = index$1.react.useCallback(function (target) {
1500
+ var _propsRef$current = propsRef.current,
1501
+ onResize = _propsRef$current.onResize,
1502
+ data = _propsRef$current.data;
1503
+ var _target$getBoundingCl = target.getBoundingClientRect(),
1504
+ width = _target$getBoundingCl.width,
1505
+ height = _target$getBoundingCl.height;
1506
+ var offsetWidth = target.offsetWidth,
1507
+ offsetHeight = target.offsetHeight;
1508
+
1509
+ /**
1510
+ * Resize observer trigger when content size changed.
1511
+ * In most case we just care about element size,
1512
+ * let's use `boundary` instead of `contentRect` here to avoid shaking.
1513
+ */
1514
+ var fixedWidth = Math.floor(width);
1515
+ var fixedHeight = Math.floor(height);
1516
+ if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
1517
+ var size = {
1518
+ width: fixedWidth,
1519
+ height: fixedHeight,
1520
+ offsetWidth: offsetWidth,
1521
+ offsetHeight: offsetHeight
1522
+ };
1523
+ sizeRef.current = size;
1524
+
1525
+ // IE is strange, right?
1526
+ var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
1527
+ var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
1528
+ var sizeInfo = _objectSpread2$1(_objectSpread2$1({}, size), {}, {
1529
+ offsetWidth: mergedOffsetWidth,
1530
+ offsetHeight: mergedOffsetHeight
1531
+ });
1532
+
1533
+ // Let collection know what happened
1534
+ onCollectionResize === null || onCollectionResize === void 0 || onCollectionResize(sizeInfo, target, data);
1535
+ if (onResize) {
1536
+ // defer the callback but not defer to next frame
1537
+ Promise.resolve().then(function () {
1538
+ onResize(sizeInfo, target);
1539
+ });
1540
+ }
1541
+ }
1542
+ }, []);
1543
+
1544
+ // Dynamic observe
1545
+ index$1.react.useEffect(function () {
1546
+ var currentElement = getDom();
1547
+ if (currentElement && !disabled) {
1548
+ observe(currentElement, onInternalResize);
1549
+ }
1550
+ return function () {
1551
+ return unobserve(currentElement, onInternalResize);
1552
+ };
1553
+ }, [elementRef.current, disabled]);
1554
+
1555
+ // ============================ Render ============================
1556
+ return /*#__PURE__*/index$1.react.createElement(DomWrapper, {
1557
+ ref: wrapperRef
1558
+ }, canRef ? /*#__PURE__*/index$1.react.cloneElement(mergedChildren, {
1559
+ ref: mergedRef
1560
+ }) : mergedChildren);
1561
+ }
1562
+ var RefSingleObserver = /*#__PURE__*/index$1.react.forwardRef(SingleObserver);
1563
+
1564
+ var INTERNAL_PREFIX_KEY = 'rc-observer-key';
1565
+ function ResizeObserver(props, ref) {
1566
+ var children = props.children;
1567
+ var childNodes = typeof children === 'function' ? [children] : toArray(children);
1568
+ return childNodes.map(function (child, index) {
1569
+ var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index);
1570
+ return /*#__PURE__*/index$1.react.createElement(RefSingleObserver, _extends$1({}, props, {
1571
+ key: key,
1572
+ ref: index === 0 ? ref : undefined
1573
+ }), child);
1574
+ });
1575
+ }
1576
+ var RefResizeObserver = /*#__PURE__*/index$1.react.forwardRef(ResizeObserver);
1577
+ RefResizeObserver.Collection = Collection;
1578
+
1579
+ var raf = function raf(callback) {
1580
+ return +setTimeout(callback, 16);
1581
+ };
1582
+ var caf = function caf(num) {
1583
+ return clearTimeout(num);
1584
+ };
1585
+ if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
1586
+ raf = function raf(callback) {
1587
+ return window.requestAnimationFrame(callback);
1588
+ };
1589
+ caf = function caf(handle) {
1590
+ return window.cancelAnimationFrame(handle);
1591
+ };
1592
+ }
1593
+ var rafUUID = 0;
1594
+ var rafIds = new Map();
1595
+ function cleanup(id) {
1596
+ rafIds.delete(id);
1597
+ }
1598
+ var wrapperRaf = function wrapperRaf(callback) {
1599
+ var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
1600
+ rafUUID += 1;
1601
+ var id = rafUUID;
1602
+ function callRef(leftTimes) {
1603
+ if (leftTimes === 0) {
1604
+ // Clean up
1605
+ cleanup(id);
1606
+
1607
+ // Trigger
1608
+ callback();
1609
+ } else {
1610
+ // Next raf
1611
+ var realId = raf(function () {
1612
+ callRef(leftTimes - 1);
1613
+ });
1614
+
1615
+ // Bind real raf id
1616
+ rafIds.set(id, realId);
1617
+ }
1618
+ }
1619
+ callRef(times);
1620
+ return id;
1621
+ };
1622
+ wrapperRaf.cancel = function (id) {
1623
+ var realId = rafIds.get(id);
1624
+ cleanup(id);
1625
+ return caf(realId);
1626
+ };
1627
+
1628
+ function _extends() {
1629
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
1630
+ for (var i = 1; i < arguments.length; i++) {
1631
+ var source = arguments[i];
1632
+ for (var key in source) {
1633
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1634
+ target[key] = source[key];
1635
+ }
1636
+ }
1637
+ }
1638
+ return target;
1639
+ };
1640
+ return _extends.apply(this, arguments);
1641
+ }
1642
+
1643
+ function _typeof(obj) {
1644
+ "@babel/helpers - typeof";
1645
+
1646
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1647
+ return typeof obj;
1648
+ } : function (obj) {
1649
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1650
+ }, _typeof(obj);
1651
+ }
1652
+
1653
+ function _toPrimitive(input, hint) {
1654
+ if (_typeof(input) !== "object" || input === null) return input;
1655
+ var prim = input[Symbol.toPrimitive];
1656
+ if (prim !== undefined) {
1657
+ var res = prim.call(input, hint || "default");
1658
+ if (_typeof(res) !== "object") return res;
1659
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1660
+ }
1661
+ return (hint === "string" ? String : Number)(input);
1662
+ }
1663
+
1664
+ function _toPropertyKey(arg) {
1665
+ var key = _toPrimitive(arg, "string");
1666
+ return _typeof(key) === "symbol" ? key : String(key);
1667
+ }
1668
+
1669
+ function _defineProperty(obj, key, value) {
1670
+ key = _toPropertyKey(key);
1671
+ if (key in obj) {
1672
+ Object.defineProperty(obj, key, {
1673
+ value: value,
1674
+ enumerable: true,
1675
+ configurable: true,
1676
+ writable: true
1677
+ });
1678
+ } else {
1679
+ obj[key] = value;
1680
+ }
1681
+ return obj;
1682
+ }
1683
+
1684
+ function ownKeys(object, enumerableOnly) {
1685
+ var keys = Object.keys(object);
1686
+ if (Object.getOwnPropertySymbols) {
1687
+ var symbols = Object.getOwnPropertySymbols(object);
1688
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
1689
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1690
+ })), keys.push.apply(keys, symbols);
1691
+ }
1692
+ return keys;
1693
+ }
1694
+ function _objectSpread2(target) {
1695
+ for (var i = 1; i < arguments.length; i++) {
1696
+ var source = null != arguments[i] ? arguments[i] : {};
1697
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
1698
+ _defineProperty(target, key, source[key]);
1699
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
1700
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1701
+ });
1702
+ }
1703
+ return target;
1704
+ }
1705
+
1706
+ function _arrayWithHoles(arr) {
1707
+ if (Array.isArray(arr)) return arr;
1708
+ }
1709
+
1710
+ function _iterableToArrayLimit(arr, i) {
1711
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
1712
+ if (null != _i) {
1713
+ var _s,
1714
+ _e,
1715
+ _x,
1716
+ _r,
1717
+ _arr = [],
1718
+ _n = !0,
1719
+ _d = !1;
1720
+ try {
1721
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
1722
+ if (Object(_i) !== _i) return;
1723
+ _n = !1;
1724
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
1725
+ } catch (err) {
1726
+ _d = !0, _e = err;
1727
+ } finally {
1728
+ try {
1729
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
1730
+ } finally {
1731
+ if (_d) throw _e;
1732
+ }
1733
+ }
1734
+ return _arr;
1735
+ }
1736
+ }
1737
+
1738
+ function _arrayLikeToArray(arr, len) {
1739
+ if (len == null || len > arr.length) len = arr.length;
1740
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1741
+ return arr2;
1742
+ }
1743
+
1744
+ function _unsupportedIterableToArray(o, minLen) {
1745
+ if (!o) return;
1746
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1747
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1748
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1749
+ if (n === "Map" || n === "Set") return Array.from(o);
1750
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1751
+ }
1752
+
1753
+ function _nonIterableRest() {
1754
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1755
+ }
1756
+
1757
+ function _slicedToArray(arr, i) {
1758
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1759
+ }
1760
+
1761
+ function _objectWithoutPropertiesLoose(source, excluded) {
1762
+ if (source == null) return {};
1763
+ var target = {};
1764
+ var sourceKeys = Object.keys(source);
1765
+ var key, i;
1766
+ for (i = 0; i < sourceKeys.length; i++) {
1767
+ key = sourceKeys[i];
1768
+ if (excluded.indexOf(key) >= 0) continue;
1769
+ target[key] = source[key];
1770
+ }
1771
+ return target;
1772
+ }
1773
+
1774
+ function _objectWithoutProperties(source, excluded) {
1775
+ if (source == null) return {};
1776
+ var target = _objectWithoutPropertiesLoose(source, excluded);
1777
+ var key, i;
1778
+ if (Object.getOwnPropertySymbols) {
1779
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1780
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
1781
+ key = sourceSymbolKeys[i];
1782
+ if (excluded.indexOf(key) >= 0) continue;
1783
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1784
+ target[key] = source[key];
1785
+ }
1786
+ }
1787
+ return target;
1788
+ }
1789
+
1790
+ var _excluded$2 = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"];
1791
+ // Use shared variable to save bundle size
1792
+ var UNDEFINED = undefined;
1793
+ function InternalItem(props, ref) {
1794
+ var prefixCls = props.prefixCls,
1795
+ invalidate = props.invalidate,
1796
+ item = props.item,
1797
+ renderItem = props.renderItem,
1798
+ responsive = props.responsive,
1799
+ responsiveDisabled = props.responsiveDisabled,
1800
+ registerSize = props.registerSize,
1801
+ itemKey = props.itemKey,
1802
+ className = props.className,
1803
+ style = props.style,
1804
+ children = props.children,
1805
+ display = props.display,
1806
+ order = props.order,
1807
+ _props$component = props.component,
1808
+ Component = _props$component === void 0 ? 'div' : _props$component,
1809
+ restProps = _objectWithoutProperties(props, _excluded$2);
1810
+ var mergedHidden = responsive && !display;
1811
+ // ================================ Effect ================================
1812
+ function internalRegisterSize(width) {
1813
+ registerSize(itemKey, width);
1814
+ }
1815
+ index$1.react.useEffect(function () {
1816
+ return function () {
1817
+ internalRegisterSize(null);
1818
+ };
1819
+ }, []);
1820
+ // ================================ Render ================================
1821
+ var childNode = renderItem && item !== UNDEFINED ? renderItem(item) : children;
1822
+ var overflowStyle;
1823
+ if (!invalidate) {
1824
+ overflowStyle = {
1825
+ opacity: mergedHidden ? 0 : 1,
1826
+ height: mergedHidden ? 0 : UNDEFINED,
1827
+ overflowY: mergedHidden ? 'hidden' : UNDEFINED,
1828
+ order: responsive ? order : UNDEFINED,
1829
+ pointerEvents: mergedHidden ? 'none' : UNDEFINED,
1830
+ position: mergedHidden ? 'absolute' : UNDEFINED
1831
+ };
1832
+ }
1833
+ var overflowProps = {};
1834
+ if (mergedHidden) {
1835
+ overflowProps['aria-hidden'] = true;
1836
+ }
1837
+ var itemNode = /*#__PURE__*/index$1.react.createElement(Component, _extends({
1838
+ className: index$2.classnames(!invalidate && prefixCls, className),
1839
+ style: _objectSpread2(_objectSpread2({}, overflowStyle), style)
1840
+ }, overflowProps, restProps, {
1841
+ ref: ref
1842
+ }), childNode);
1843
+ if (responsive) {
1844
+ itemNode = /*#__PURE__*/index$1.react.createElement(RefResizeObserver, {
1845
+ onResize: function onResize(_ref) {
1846
+ var offsetWidth = _ref.offsetWidth;
1847
+ internalRegisterSize(offsetWidth);
1848
+ },
1849
+ disabled: responsiveDisabled
1850
+ }, itemNode);
1851
+ }
1852
+ return itemNode;
1853
+ }
1854
+ var Item = /*#__PURE__*/index$1.react.forwardRef(InternalItem);
1855
+ Item.displayName = 'Item';
1856
+
1857
+ function channelUpdate(callback) {
1858
+ if (typeof MessageChannel === 'undefined') {
1859
+ wrapperRaf(callback);
1860
+ } else {
1861
+ var channel = new MessageChannel();
1862
+ channel.port1.onmessage = function () {
1863
+ return callback();
1864
+ };
1865
+ channel.port2.postMessage(undefined);
1866
+ }
1867
+ }
1868
+
1869
+ /**
1870
+ * Batcher for record any `useEffectState` need update.
1871
+ */
1872
+ function useBatcher() {
1873
+ // Updater Trigger
1874
+ var updateFuncRef = index$1.react.useRef(null);
1875
+ // Notify update
1876
+ var notifyEffectUpdate = function notifyEffectUpdate(callback) {
1877
+ if (!updateFuncRef.current) {
1878
+ updateFuncRef.current = [];
1879
+ channelUpdate(function () {
1880
+ index$1.reactDom.unstable_batchedUpdates(function () {
1881
+ updateFuncRef.current.forEach(function (fn) {
1882
+ fn();
1883
+ });
1884
+ updateFuncRef.current = null;
1885
+ });
1886
+ });
1887
+ }
1888
+ updateFuncRef.current.push(callback);
1889
+ };
1890
+ return notifyEffectUpdate;
1891
+ }
1892
+ /**
1893
+ * Trigger state update by `useLayoutEffect` to save perf.
1894
+ */
1895
+ function useEffectState(notifyEffectUpdate, defaultValue) {
1896
+ // Value
1897
+ var _React$useState = index$1.react.useState(defaultValue),
1898
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1899
+ stateValue = _React$useState2[0],
1900
+ setStateValue = _React$useState2[1];
1901
+ // Set State
1902
+ var setEffectVal = useEvent(function (nextValue) {
1903
+ notifyEffectUpdate(function () {
1904
+ setStateValue(nextValue);
1905
+ });
1906
+ });
1907
+ return [stateValue, setEffectVal];
1908
+ }
1909
+
1910
+ var OverflowContext = /*#__PURE__*/index$1.react.createContext(null);
1911
+
1912
+ var _excluded$1 = ["component"],
1913
+ _excluded2 = ["className"],
1914
+ _excluded3 = ["className"];
1915
+ var InternalRawItem = function InternalRawItem(props, ref) {
1916
+ var context = index$1.react.useContext(OverflowContext);
1917
+ // Render directly when context not provided
1918
+ if (!context) {
1919
+ var _props$component = props.component,
1920
+ Component = _props$component === void 0 ? 'div' : _props$component,
1921
+ _restProps = _objectWithoutProperties(props, _excluded$1);
1922
+ return /*#__PURE__*/index$1.react.createElement(Component, _extends({}, _restProps, {
1923
+ ref: ref
1924
+ }));
1925
+ }
1926
+ var contextClassName = context.className,
1927
+ restContext = _objectWithoutProperties(context, _excluded2);
1928
+ var className = props.className,
1929
+ restProps = _objectWithoutProperties(props, _excluded3);
1930
+ // Do not pass context to sub item to avoid multiple measure
1931
+ return /*#__PURE__*/index$1.react.createElement(OverflowContext.Provider, {
1932
+ value: null
1933
+ }, /*#__PURE__*/index$1.react.createElement(Item, _extends({
1934
+ ref: ref,
1935
+ className: index$2.classnames(contextClassName, className)
1936
+ }, restContext, restProps)));
1937
+ };
1938
+ var RawItem = /*#__PURE__*/index$1.react.forwardRef(InternalRawItem);
1939
+ RawItem.displayName = 'RawItem';
1940
+
1941
+ var _excluded = ["prefixCls", "data", "renderItem", "renderRawItem", "itemKey", "itemWidth", "ssr", "style", "className", "maxCount", "renderRest", "renderRawRest", "suffix", "component", "itemComponent", "onVisibleChange"];
1942
+ var RESPONSIVE = 'responsive';
1943
+ var INVALIDATE = 'invalidate';
1944
+ function defaultRenderRest(omittedItems) {
1945
+ return "+ ".concat(omittedItems.length, " ...");
1946
+ }
1947
+ function Overflow(props, ref) {
1948
+ var _props$prefixCls = props.prefixCls,
1949
+ prefixCls = _props$prefixCls === void 0 ? 'rc-overflow' : _props$prefixCls,
1950
+ _props$data = props.data,
1951
+ data = _props$data === void 0 ? [] : _props$data,
1952
+ renderItem = props.renderItem,
1953
+ renderRawItem = props.renderRawItem,
1954
+ itemKey = props.itemKey,
1955
+ _props$itemWidth = props.itemWidth,
1956
+ itemWidth = _props$itemWidth === void 0 ? 10 : _props$itemWidth,
1957
+ ssr = props.ssr,
1958
+ style = props.style,
1959
+ className = props.className,
1960
+ maxCount = props.maxCount,
1961
+ renderRest = props.renderRest,
1962
+ renderRawRest = props.renderRawRest,
1963
+ suffix = props.suffix,
1964
+ _props$component = props.component,
1965
+ Component = _props$component === void 0 ? 'div' : _props$component,
1966
+ itemComponent = props.itemComponent,
1967
+ onVisibleChange = props.onVisibleChange,
1968
+ restProps = _objectWithoutProperties(props, _excluded);
1969
+ var fullySSR = ssr === 'full';
1970
+ var notifyEffectUpdate = useBatcher();
1971
+ var _useEffectState = useEffectState(notifyEffectUpdate, null),
1972
+ _useEffectState2 = _slicedToArray(_useEffectState, 2),
1973
+ containerWidth = _useEffectState2[0],
1974
+ setContainerWidth = _useEffectState2[1];
1975
+ var mergedContainerWidth = containerWidth || 0;
1976
+ var _useEffectState3 = useEffectState(notifyEffectUpdate, new Map()),
1977
+ _useEffectState4 = _slicedToArray(_useEffectState3, 2),
1978
+ itemWidths = _useEffectState4[0],
1979
+ setItemWidths = _useEffectState4[1];
1980
+ var _useEffectState5 = useEffectState(notifyEffectUpdate, 0),
1981
+ _useEffectState6 = _slicedToArray(_useEffectState5, 2),
1982
+ prevRestWidth = _useEffectState6[0],
1983
+ setPrevRestWidth = _useEffectState6[1];
1984
+ var _useEffectState7 = useEffectState(notifyEffectUpdate, 0),
1985
+ _useEffectState8 = _slicedToArray(_useEffectState7, 2),
1986
+ restWidth = _useEffectState8[0],
1987
+ setRestWidth = _useEffectState8[1];
1988
+ var _useEffectState9 = useEffectState(notifyEffectUpdate, 0),
1989
+ _useEffectState10 = _slicedToArray(_useEffectState9, 2),
1990
+ suffixWidth = _useEffectState10[0],
1991
+ setSuffixWidth = _useEffectState10[1];
1992
+ var _useState = index$1.react.useState(null),
1993
+ _useState2 = _slicedToArray(_useState, 2),
1994
+ suffixFixedStart = _useState2[0],
1995
+ setSuffixFixedStart = _useState2[1];
1996
+ var _useState3 = index$1.react.useState(null),
1997
+ _useState4 = _slicedToArray(_useState3, 2),
1998
+ displayCount = _useState4[0],
1999
+ setDisplayCount = _useState4[1];
2000
+ var mergedDisplayCount = index$1.react.useMemo(function () {
2001
+ if (displayCount === null && fullySSR) {
2002
+ return Number.MAX_SAFE_INTEGER;
2003
+ }
2004
+ return displayCount || 0;
2005
+ }, [displayCount, containerWidth]);
2006
+ var _useState5 = index$1.react.useState(false),
2007
+ _useState6 = _slicedToArray(_useState5, 2),
2008
+ restReady = _useState6[0],
2009
+ setRestReady = _useState6[1];
2010
+ var itemPrefixCls = "".concat(prefixCls, "-item");
2011
+ // Always use the max width to avoid blink
2012
+ var mergedRestWidth = Math.max(prevRestWidth, restWidth);
2013
+ // ================================= Data =================================
2014
+ var isResponsive = maxCount === RESPONSIVE;
2015
+ var shouldResponsive = data.length && isResponsive;
2016
+ var invalidate = maxCount === INVALIDATE;
2017
+ /**
2018
+ * When is `responsive`, we will always render rest node to get the real width of it for calculation
2019
+ */
2020
+ var showRest = shouldResponsive || typeof maxCount === 'number' && data.length > maxCount;
2021
+ var mergedData = index$1.react.useMemo(function () {
2022
+ var items = data;
2023
+ if (shouldResponsive) {
2024
+ if (containerWidth === null && fullySSR) {
2025
+ items = data;
2026
+ } else {
2027
+ items = data.slice(0, Math.min(data.length, mergedContainerWidth / itemWidth));
2028
+ }
2029
+ } else if (typeof maxCount === 'number') {
2030
+ items = data.slice(0, maxCount);
2031
+ }
2032
+ return items;
2033
+ }, [data, itemWidth, containerWidth, maxCount, shouldResponsive]);
2034
+ var omittedItems = index$1.react.useMemo(function () {
2035
+ if (shouldResponsive) {
2036
+ return data.slice(mergedDisplayCount + 1);
2037
+ }
2038
+ return data.slice(mergedData.length);
2039
+ }, [data, mergedData, shouldResponsive, mergedDisplayCount]);
2040
+ // ================================= Item =================================
2041
+ var getKey = index$1.react.useCallback(function (item, index) {
2042
+ var _ref;
2043
+ if (typeof itemKey === 'function') {
2044
+ return itemKey(item);
2045
+ }
2046
+ return (_ref = itemKey && (item === null || item === void 0 ? void 0 : item[itemKey])) !== null && _ref !== void 0 ? _ref : index;
2047
+ }, [itemKey]);
2048
+ var mergedRenderItem = index$1.react.useCallback(renderItem || function (item) {
2049
+ return item;
2050
+ }, [renderItem]);
2051
+ function updateDisplayCount(count, suffixFixedStartVal, notReady) {
2052
+ // React 18 will sync render even when the value is same in some case.
2053
+ // We take `mergedData` as deps which may cause dead loop if it's dynamic generate.
2054
+ // ref: https://github.com/ant-design/ant-design/issues/36559
2055
+ if (displayCount === count && (suffixFixedStartVal === undefined || suffixFixedStartVal === suffixFixedStart)) {
2056
+ return;
2057
+ }
2058
+ setDisplayCount(count);
2059
+ if (!notReady) {
2060
+ setRestReady(count < data.length - 1);
2061
+ onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(count);
2062
+ }
2063
+ if (suffixFixedStartVal !== undefined) {
2064
+ setSuffixFixedStart(suffixFixedStartVal);
2065
+ }
2066
+ }
2067
+ // ================================= Size =================================
2068
+ function onOverflowResize(_, element) {
2069
+ setContainerWidth(element.clientWidth);
2070
+ }
2071
+ function registerSize(key, width) {
2072
+ setItemWidths(function (origin) {
2073
+ var clone = new Map(origin);
2074
+ if (width === null) {
2075
+ clone.delete(key);
2076
+ } else {
2077
+ clone.set(key, width);
2078
+ }
2079
+ return clone;
2080
+ });
2081
+ }
2082
+ function registerOverflowSize(_, width) {
2083
+ setRestWidth(width);
2084
+ setPrevRestWidth(restWidth);
2085
+ }
2086
+ function registerSuffixSize(_, width) {
2087
+ setSuffixWidth(width);
2088
+ }
2089
+ // ================================ Effect ================================
2090
+ function getItemWidth(index) {
2091
+ return itemWidths.get(getKey(mergedData[index], index));
2092
+ }
2093
+ useLayoutEffect(function () {
2094
+ if (mergedContainerWidth && typeof mergedRestWidth === 'number' && mergedData) {
2095
+ var totalWidth = suffixWidth;
2096
+ var len = mergedData.length;
2097
+ var lastIndex = len - 1;
2098
+ // When data count change to 0, reset this since not loop will reach
2099
+ if (!len) {
2100
+ updateDisplayCount(0, null);
2101
+ return;
2102
+ }
2103
+ for (var i = 0; i < len; i += 1) {
2104
+ var currentItemWidth = getItemWidth(i);
2105
+ // Fully will always render
2106
+ if (fullySSR) {
2107
+ currentItemWidth = currentItemWidth || 0;
2108
+ }
2109
+ // Break since data not ready
2110
+ if (currentItemWidth === undefined) {
2111
+ updateDisplayCount(i - 1, undefined, true);
2112
+ break;
2113
+ }
2114
+ // Find best match
2115
+ totalWidth += currentItemWidth;
2116
+ if (
2117
+ // Only one means `totalWidth` is the final width
2118
+ lastIndex === 0 && totalWidth <= mergedContainerWidth ||
2119
+ // Last two width will be the final width
2120
+ i === lastIndex - 1 && totalWidth + getItemWidth(lastIndex) <= mergedContainerWidth) {
2121
+ // Additional check if match the end
2122
+ updateDisplayCount(lastIndex, null);
2123
+ break;
2124
+ } else if (totalWidth + mergedRestWidth > mergedContainerWidth) {
2125
+ // Can not hold all the content to show rest
2126
+ updateDisplayCount(i - 1, totalWidth - currentItemWidth - suffixWidth + restWidth);
2127
+ break;
2128
+ }
2129
+ }
2130
+ if (suffix && getItemWidth(0) + suffixWidth > mergedContainerWidth) {
2131
+ setSuffixFixedStart(null);
2132
+ }
2133
+ }
2134
+ }, [mergedContainerWidth, itemWidths, restWidth, suffixWidth, getKey, mergedData]);
2135
+ // ================================ Render ================================
2136
+ var displayRest = restReady && !!omittedItems.length;
2137
+ var suffixStyle = {};
2138
+ if (suffixFixedStart !== null && shouldResponsive) {
2139
+ suffixStyle = {
2140
+ position: 'absolute',
2141
+ left: suffixFixedStart,
2142
+ top: 0
2143
+ };
2144
+ }
2145
+ var itemSharedProps = {
2146
+ prefixCls: itemPrefixCls,
2147
+ responsive: shouldResponsive,
2148
+ component: itemComponent,
2149
+ invalidate: invalidate
2150
+ };
2151
+ // >>>>> Choice render fun by `renderRawItem`
2152
+ var internalRenderItemNode = renderRawItem ? function (item, index) {
2153
+ var key = getKey(item, index);
2154
+ return /*#__PURE__*/index$1.react.createElement(OverflowContext.Provider, {
2155
+ key: key,
2156
+ value: _objectSpread2(_objectSpread2({}, itemSharedProps), {}, {
2157
+ order: index,
2158
+ item: item,
2159
+ itemKey: key,
2160
+ registerSize: registerSize,
2161
+ display: index <= mergedDisplayCount
2162
+ })
2163
+ }, renderRawItem(item, index));
2164
+ } : function (item, index) {
2165
+ var key = getKey(item, index);
2166
+ return /*#__PURE__*/index$1.react.createElement(Item, _extends({}, itemSharedProps, {
2167
+ order: index,
2168
+ key: key,
2169
+ item: item,
2170
+ renderItem: mergedRenderItem,
2171
+ itemKey: key,
2172
+ registerSize: registerSize,
2173
+ display: index <= mergedDisplayCount
2174
+ }));
2175
+ };
2176
+ // >>>>> Rest node
2177
+ var restNode;
2178
+ var restContextProps = {
2179
+ order: displayRest ? mergedDisplayCount : Number.MAX_SAFE_INTEGER,
2180
+ className: "".concat(itemPrefixCls, "-rest"),
2181
+ registerSize: registerOverflowSize,
2182
+ display: displayRest
2183
+ };
2184
+ if (!renderRawRest) {
2185
+ var mergedRenderRest = renderRest || defaultRenderRest;
2186
+ restNode = /*#__PURE__*/index$1.react.createElement(Item, _extends({}, itemSharedProps, restContextProps), typeof mergedRenderRest === 'function' ? mergedRenderRest(omittedItems) : mergedRenderRest);
2187
+ } else if (renderRawRest) {
2188
+ restNode = /*#__PURE__*/index$1.react.createElement(OverflowContext.Provider, {
2189
+ value: _objectSpread2(_objectSpread2({}, itemSharedProps), restContextProps)
2190
+ }, renderRawRest(omittedItems));
2191
+ }
2192
+ var overflowNode = /*#__PURE__*/index$1.react.createElement(Component, _extends({
2193
+ className: index$2.classnames(!invalidate && prefixCls, className),
2194
+ style: style,
2195
+ ref: ref
2196
+ }, restProps), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /*#__PURE__*/index$1.react.createElement(Item, _extends({}, itemSharedProps, {
2197
+ responsive: isResponsive,
2198
+ responsiveDisabled: !shouldResponsive,
2199
+ order: mergedDisplayCount,
2200
+ className: "".concat(itemPrefixCls, "-suffix"),
2201
+ registerSize: registerSuffixSize,
2202
+ display: true,
2203
+ style: suffixStyle
2204
+ }), suffix));
2205
+ if (isResponsive) {
2206
+ overflowNode = /*#__PURE__*/index$1.react.createElement(RefResizeObserver, {
2207
+ onResize: onOverflowResize,
2208
+ disabled: !shouldResponsive
2209
+ }, overflowNode);
2210
+ }
2211
+ return overflowNode;
2212
+ }
2213
+ var ForwardOverflow = /*#__PURE__*/index$1.react.forwardRef(Overflow);
2214
+ ForwardOverflow.displayName = 'Overflow';
2215
+ ForwardOverflow.Item = RawItem;
2216
+ ForwardOverflow.RESPONSIVE = RESPONSIVE;
2217
+ ForwardOverflow.INVALIDATE = INVALIDATE;
2218
+
2219
+ exports.ForwardOverflow = ForwardOverflow;
2220
+ exports.RefResizeObserver = RefResizeObserver;
2221
+ exports._typeof = _typeof$2;
2222
+ exports.canUseDom = canUseDom;
2223
+ exports.composeRef = composeRef;
2224
+ exports.fillRef = fillRef;
2225
+ exports.findDOMNode = findDOMNode;
2226
+ exports.isDOM = isDOM;
2227
+ exports.supportRef = supportRef;
2228
+ exports.useComposeRef = useComposeRef;
2229
+ exports.useEvent = useEvent;
2230
+ exports.useLayoutEffect = useLayoutEffect;
2231
+ exports.useLayoutUpdateEffect = useLayoutUpdateEffect;
2232
+ exports.warningOnce = warningOnce;
2233
+ exports.wrapperRaf = wrapperRaf;