@alfalab/core-components-select 14.3.4 → 15.0.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 (452) hide show
  1. package/Component.desktop.d.ts +19 -0
  2. package/{Component.js → Component.desktop.js} +6 -6
  3. package/Component.mobile-ebda875c.d.ts +6 -0
  4. package/Component.mobile-f1f15074.d.ts +387 -0
  5. package/Component.mobile.d.ts +41 -0
  6. package/Component.mobile.js +62 -0
  7. package/Component.modal.mobile.d.ts +60 -0
  8. package/Component.modal.mobile.js +62 -0
  9. package/Component.responsive.d.ts +1 -1
  10. package/Component.responsive.js +26 -25
  11. package/components/arrow/Component.d.ts +2 -1
  12. package/components/arrow/Component.js +1 -1
  13. package/components/arrow/index.css +3 -3
  14. package/components/base-checkmark/Component.d.ts +2 -1
  15. package/components/base-checkmark/Component.js +1 -1
  16. package/components/base-checkmark/index.css +4 -4
  17. package/components/base-option/Component.js +1 -1
  18. package/components/base-option/index.css +13 -13
  19. package/components/base-select/Component.js +6 -6
  20. package/components/base-select/index.css +8 -8
  21. package/components/base-select/index.js +1 -1
  22. package/components/base-select-mobile/Component.d.ts +3 -3
  23. package/components/base-select-mobile/Component.js +13 -9
  24. package/components/base-select-mobile/footer/Component.d.ts +2 -1
  25. package/components/base-select-mobile/footer/Component.js +4 -4
  26. package/components/base-select-mobile/footer/index.css +5 -5
  27. package/components/base-select-mobile/footer/index.js +1 -1
  28. package/components/base-select-mobile/index.css +13 -11
  29. package/components/base-select-mobile/index.js +1 -2
  30. package/components/checkmark/Component.d.ts +2 -1
  31. package/components/checkmark/Component.js +1 -1
  32. package/components/checkmark/index.css +10 -10
  33. package/components/checkmark-mobile/Component.d.ts +2 -1
  34. package/components/checkmark-mobile/Component.js +1 -1
  35. package/components/checkmark-mobile/index.css +6 -6
  36. package/components/field/Component.d.ts +9 -1
  37. package/components/field/Component.js +19 -16
  38. package/components/field/index.css +38 -11
  39. package/components/field/index.js +0 -1
  40. package/components/index.d.ts +0 -2
  41. package/components/index.js +4 -19
  42. package/components/optgroup/Component.d.ts +2 -1
  43. package/components/optgroup/Component.js +1 -1
  44. package/components/optgroup/index.css +6 -6
  45. package/components/option/Component.js +1 -1
  46. package/components/option/index.css +20 -20
  47. package/components/options-list/Component.js +1 -1
  48. package/components/options-list/index.css +9 -9
  49. package/components/virtual-options-list/Component.js +1 -1
  50. package/components/virtual-options-list/index.css +15 -15
  51. package/cssm/Component.desktop.d.ts +19 -0
  52. package/cssm/{Component.js → Component.desktop.js} +6 -6
  53. package/cssm/Component.mobile-ebda875c.d.ts +6 -0
  54. package/cssm/Component.mobile-f1f15074.d.ts +387 -0
  55. package/cssm/Component.mobile.d.ts +41 -0
  56. package/cssm/Component.mobile.js +74 -0
  57. package/cssm/Component.modal.mobile.d.ts +60 -0
  58. package/cssm/Component.modal.mobile.js +74 -0
  59. package/cssm/Component.responsive.d.ts +1 -1
  60. package/cssm/Component.responsive.js +30 -33
  61. package/cssm/components/arrow/Component.d.ts +2 -1
  62. package/cssm/components/base-checkmark/Component.d.ts +2 -1
  63. package/cssm/components/base-select/Component.js +5 -5
  64. package/cssm/components/base-select/index.js +1 -1
  65. package/cssm/components/base-select-mobile/Component.d.ts +3 -3
  66. package/cssm/components/base-select-mobile/Component.js +12 -8
  67. package/cssm/components/base-select-mobile/footer/Component.d.ts +2 -1
  68. package/cssm/components/base-select-mobile/footer/Component.js +3 -3
  69. package/cssm/components/base-select-mobile/footer/index.js +1 -1
  70. package/cssm/components/base-select-mobile/index.js +1 -2
  71. package/cssm/components/base-select-mobile/index.module.css +4 -2
  72. package/cssm/components/checkmark/Component.d.ts +2 -1
  73. package/cssm/components/checkmark-mobile/Component.d.ts +2 -1
  74. package/cssm/components/field/Component.d.ts +9 -1
  75. package/cssm/components/field/Component.js +18 -15
  76. package/cssm/components/field/index.js +0 -1
  77. package/cssm/components/field/index.module.css +31 -4
  78. package/cssm/components/index.d.ts +0 -2
  79. package/cssm/components/index.js +7 -28
  80. package/cssm/components/optgroup/Component.d.ts +2 -1
  81. package/cssm/desktop-63dec22f.d.ts +6 -0
  82. package/cssm/desktop.d.ts +2 -0
  83. package/cssm/desktop.js +44 -0
  84. package/cssm/hook-97e6e688.d.ts +16 -0
  85. package/cssm/hook-97e6e688.js +110 -0
  86. package/{esm/hook-b4e70cb0.d.ts → cssm/hook-9ea9e32c.d.ts} +9 -7
  87. package/cssm/index-ebda875c.d.ts +20 -60
  88. package/cssm/index.d.ts +2 -5
  89. package/cssm/index.js +34 -61
  90. package/cssm/mobile-96988a65.d.ts +2 -0
  91. package/cssm/mobile.d.ts +5 -4
  92. package/cssm/mobile.js +15 -24
  93. package/cssm/presets/index.d.ts +1 -1
  94. package/cssm/presets/index.js +8 -36
  95. package/cssm/presets/useLazyLoading/hook.d.ts +1 -1
  96. package/cssm/presets/useLazyLoading/hook.js +900 -4
  97. package/cssm/presets/useSelectWithApply/hook.js +9 -48
  98. package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -42
  99. package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +2 -1
  100. package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +3 -3
  101. package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  102. package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +10 -49
  103. package/cssm/presets/useSelectWithLoading/hook.d.ts +1 -1
  104. package/cssm/shared.d.ts +5 -0
  105. package/cssm/shared.js +77 -0
  106. package/cssm/typings-9211a437.d.ts +95 -0
  107. package/cssm/typings-baf4875b.d.ts +52 -0
  108. package/desktop-63dec22f.d.ts +6 -0
  109. package/desktop.d.ts +2 -0
  110. package/{responsive.js → desktop.js} +5 -19
  111. package/esm/Component.desktop.d.ts +19 -0
  112. package/esm/{Component.js → Component.desktop.js} +6 -6
  113. package/esm/Component.mobile-ebda875c.d.ts +6 -0
  114. package/esm/Component.mobile-f1f15074.d.ts +387 -0
  115. package/esm/Component.mobile.d.ts +41 -0
  116. package/esm/Component.mobile.js +54 -0
  117. package/esm/Component.modal.mobile.d.ts +60 -0
  118. package/esm/Component.modal.mobile.js +54 -0
  119. package/esm/Component.responsive.d.ts +1 -1
  120. package/esm/Component.responsive.js +26 -25
  121. package/esm/components/arrow/Component.d.ts +2 -1
  122. package/esm/components/arrow/Component.js +1 -1
  123. package/esm/components/arrow/index.css +3 -3
  124. package/esm/components/base-checkmark/Component.d.ts +2 -1
  125. package/esm/components/base-checkmark/Component.js +1 -1
  126. package/esm/components/base-checkmark/index.css +4 -4
  127. package/esm/components/base-option/Component.js +1 -1
  128. package/esm/components/base-option/index.css +13 -13
  129. package/esm/components/base-select/Component.js +2 -2
  130. package/esm/components/base-select/index.css +8 -8
  131. package/esm/components/base-select/index.js +1 -1
  132. package/esm/components/base-select-mobile/Component.d.ts +3 -3
  133. package/esm/components/base-select-mobile/Component.js +9 -5
  134. package/esm/components/base-select-mobile/footer/Component.d.ts +2 -1
  135. package/esm/components/base-select-mobile/footer/Component.js +4 -4
  136. package/esm/components/base-select-mobile/footer/index.css +5 -5
  137. package/esm/components/base-select-mobile/footer/index.js +1 -1
  138. package/esm/components/base-select-mobile/index.css +13 -11
  139. package/esm/components/base-select-mobile/index.js +1 -2
  140. package/esm/components/checkmark/Component.d.ts +2 -1
  141. package/esm/components/checkmark/Component.js +1 -1
  142. package/esm/components/checkmark/index.css +10 -10
  143. package/esm/components/checkmark-mobile/Component.d.ts +2 -1
  144. package/esm/components/checkmark-mobile/Component.js +1 -1
  145. package/esm/components/checkmark-mobile/index.css +6 -6
  146. package/esm/components/field/Component.d.ts +9 -1
  147. package/esm/components/field/Component.js +19 -16
  148. package/esm/components/field/index.css +38 -11
  149. package/esm/components/field/index.js +0 -1
  150. package/esm/components/index.d.ts +0 -2
  151. package/esm/components/index.js +4 -17
  152. package/esm/components/optgroup/Component.d.ts +2 -1
  153. package/esm/components/optgroup/Component.js +1 -1
  154. package/esm/components/optgroup/index.css +6 -6
  155. package/esm/components/option/Component.js +1 -1
  156. package/esm/components/option/index.css +20 -20
  157. package/esm/components/options-list/Component.js +1 -1
  158. package/esm/components/options-list/index.css +9 -9
  159. package/esm/components/virtual-options-list/Component.js +1 -1
  160. package/esm/components/virtual-options-list/index.css +15 -15
  161. package/esm/desktop-63dec22f.d.ts +6 -0
  162. package/esm/desktop.d.ts +2 -0
  163. package/esm/{responsive.js → desktop.js} +4 -18
  164. package/esm/hook-326a5cea.d.ts +16 -0
  165. package/esm/hook-326a5cea.js +102 -0
  166. package/{cssm/hook-b4e70cb0.d.ts → esm/hook-9ea9e32c.d.ts} +9 -7
  167. package/esm/index-ebda875c.d.ts +20 -60
  168. package/esm/index.d.ts +2 -5
  169. package/esm/index.js +27 -29
  170. package/esm/mobile-96988a65.d.ts +2 -0
  171. package/esm/mobile.d.ts +5 -4
  172. package/esm/mobile.js +12 -16
  173. package/esm/presets/index.d.ts +1 -1
  174. package/esm/presets/index.js +6 -25
  175. package/esm/presets/useLazyLoading/hook.d.ts +1 -1
  176. package/esm/presets/useLazyLoading/hook.js +899 -4
  177. package/esm/presets/useSelectWithApply/hook.js +7 -33
  178. package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +2 -28
  179. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +2 -1
  180. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +4 -4
  181. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  182. package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  183. package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  184. package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  185. package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +8 -34
  186. package/esm/presets/useSelectWithLoading/hook.d.ts +1 -1
  187. package/esm/presets/useSelectWithLoading/hook.js +1 -1
  188. package/esm/presets/useSelectWithLoading/index.css +2 -2
  189. package/esm/shared.d.ts +5 -0
  190. package/esm/shared.js +37 -0
  191. package/esm/typings-9211a437.d.ts +95 -0
  192. package/esm/typings-baf4875b.d.ts +52 -0
  193. package/hook-6e94be9c.d.ts +16 -0
  194. package/hook-6e94be9c.js +110 -0
  195. package/{hook-b4e70cb0.d.ts → hook-9ea9e32c.d.ts} +9 -7
  196. package/index-ebda875c.d.ts +20 -60
  197. package/index.d.ts +2 -5
  198. package/index.js +28 -51
  199. package/mobile-96988a65.d.ts +2 -0
  200. package/mobile.d.ts +5 -4
  201. package/mobile.js +14 -18
  202. package/modern/Component.desktop.d.ts +19 -0
  203. package/modern/{Component.js → Component.desktop.js} +7 -4
  204. package/modern/Component.mobile-ebda875c.d.ts +6 -0
  205. package/modern/Component.mobile-f1f15074.d.ts +387 -0
  206. package/modern/Component.mobile.d.ts +41 -0
  207. package/modern/Component.mobile.js +61 -0
  208. package/modern/Component.modal.mobile.d.ts +60 -0
  209. package/modern/Component.modal.mobile.js +61 -0
  210. package/modern/Component.responsive.d.ts +1 -1
  211. package/modern/Component.responsive.js +26 -25
  212. package/modern/components/arrow/Component.d.ts +2 -1
  213. package/modern/components/arrow/Component.js +1 -1
  214. package/modern/components/arrow/index.css +3 -3
  215. package/modern/components/base-checkmark/Component.d.ts +2 -1
  216. package/modern/components/base-checkmark/Component.js +1 -1
  217. package/modern/components/base-checkmark/index.css +4 -4
  218. package/modern/components/base-option/Component.js +1 -1
  219. package/modern/components/base-option/index.css +13 -13
  220. package/modern/components/base-select/Component.js +2 -2
  221. package/modern/components/base-select/index.css +8 -8
  222. package/modern/components/base-select/index.js +1 -1
  223. package/modern/components/base-select-mobile/Component.d.ts +3 -3
  224. package/modern/components/base-select-mobile/Component.js +9 -5
  225. package/modern/components/base-select-mobile/footer/Component.d.ts +2 -1
  226. package/modern/components/base-select-mobile/footer/Component.js +4 -4
  227. package/modern/components/base-select-mobile/footer/index.css +5 -5
  228. package/modern/components/base-select-mobile/footer/index.js +1 -1
  229. package/modern/components/base-select-mobile/index.css +13 -11
  230. package/modern/components/base-select-mobile/index.js +1 -2
  231. package/modern/components/checkmark/Component.d.ts +2 -1
  232. package/modern/components/checkmark/Component.js +1 -1
  233. package/modern/components/checkmark/index.css +10 -10
  234. package/modern/components/checkmark-mobile/Component.d.ts +2 -1
  235. package/modern/components/checkmark-mobile/Component.js +1 -1
  236. package/modern/components/checkmark-mobile/index.css +6 -6
  237. package/modern/components/field/Component.d.ts +9 -1
  238. package/modern/components/field/Component.js +17 -14
  239. package/modern/components/field/index.css +38 -11
  240. package/modern/components/field/index.js +0 -1
  241. package/modern/components/index.d.ts +0 -2
  242. package/modern/components/index.js +4 -17
  243. package/modern/components/optgroup/Component.d.ts +2 -1
  244. package/modern/components/optgroup/Component.js +1 -1
  245. package/modern/components/optgroup/index.css +6 -6
  246. package/modern/components/option/Component.js +1 -1
  247. package/modern/components/option/index.css +20 -20
  248. package/modern/components/options-list/Component.js +1 -1
  249. package/modern/components/options-list/index.css +9 -9
  250. package/modern/components/virtual-options-list/Component.js +1 -1
  251. package/modern/components/virtual-options-list/index.css +15 -15
  252. package/modern/desktop-63dec22f.d.ts +6 -0
  253. package/modern/desktop.d.ts +2 -0
  254. package/modern/{responsive.js → desktop.js} +4 -18
  255. package/modern/{hook-b4e70cb0.d.ts → hook-9ea9e32c.d.ts} +9 -7
  256. package/modern/hook-e0fd0350.d.ts +16 -0
  257. package/modern/{Component-ecb2a41a.js → hook-e0fd0350.js} +3 -66
  258. package/modern/index-ebda875c.d.ts +20 -60
  259. package/modern/index.d.ts +2 -5
  260. package/modern/index.js +27 -29
  261. package/modern/mobile-96988a65.d.ts +2 -0
  262. package/modern/mobile.d.ts +5 -4
  263. package/modern/mobile.js +12 -16
  264. package/modern/presets/index.d.ts +1 -1
  265. package/modern/presets/index.js +6 -25
  266. package/modern/presets/useLazyLoading/hook.d.ts +1 -1
  267. package/modern/presets/useLazyLoading/hook.js +899 -4
  268. package/modern/presets/useSelectWithApply/hook.js +7 -33
  269. package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +2 -28
  270. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +2 -1
  271. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +4 -4
  272. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  273. package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  274. package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  275. package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  276. package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +8 -34
  277. package/modern/presets/useSelectWithLoading/hook.d.ts +1 -1
  278. package/modern/presets/useSelectWithLoading/hook.js +1 -1
  279. package/modern/presets/useSelectWithLoading/index.css +2 -2
  280. package/modern/shared.d.ts +5 -0
  281. package/modern/shared.js +36 -0
  282. package/modern/typings-9211a437.d.ts +95 -0
  283. package/modern/typings-baf4875b.d.ts +52 -0
  284. package/package.json +37 -12
  285. package/presets/index.d.ts +1 -1
  286. package/presets/index.js +6 -25
  287. package/presets/useLazyLoading/hook.d.ts +1 -1
  288. package/presets/useLazyLoading/hook.js +899 -4
  289. package/presets/useSelectWithApply/hook.js +7 -33
  290. package/presets/useSelectWithApply/options-list-with-apply/Component.js +2 -28
  291. package/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +2 -1
  292. package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +4 -4
  293. package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  294. package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  295. package/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  296. package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  297. package/presets/useSelectWithApply/options-list-with-apply/index.js +8 -34
  298. package/presets/useSelectWithLoading/hook.d.ts +1 -1
  299. package/presets/useSelectWithLoading/hook.js +1 -1
  300. package/presets/useSelectWithLoading/index.css +2 -2
  301. package/shared.d.ts +5 -0
  302. package/shared.js +63 -0
  303. package/src/Component.desktop.tsx +52 -0
  304. package/src/Component.mobile.tsx +149 -0
  305. package/src/Component.modal.mobile.tsx +144 -0
  306. package/src/Component.responsive.tsx +59 -0
  307. package/src/components/arrow/Component.tsx +12 -0
  308. package/src/components/arrow/index.module.css +15 -0
  309. package/src/components/arrow/index.ts +1 -0
  310. package/src/components/base-checkmark/Component.tsx +33 -0
  311. package/src/components/base-checkmark/index.module.css +18 -0
  312. package/src/components/base-checkmark/index.ts +1 -0
  313. package/src/components/base-option/Component.tsx +57 -0
  314. package/src/components/base-option/index.module.css +67 -0
  315. package/src/components/base-option/index.ts +1 -0
  316. package/src/components/base-select/Component.tsx +478 -0
  317. package/src/components/base-select/index.module.css +68 -0
  318. package/src/components/base-select/index.ts +1 -0
  319. package/src/components/base-select-mobile/Component.tsx +486 -0
  320. package/src/components/base-select-mobile/footer/Component.tsx +46 -0
  321. package/src/components/base-select-mobile/footer/index.module.css +23 -0
  322. package/src/components/base-select-mobile/footer/index.ts +1 -0
  323. package/src/components/base-select-mobile/index.module.css +48 -0
  324. package/src/components/base-select-mobile/index.ts +1 -0
  325. package/src/components/checkmark/Component.tsx +56 -0
  326. package/src/components/checkmark/index.module.css +48 -0
  327. package/src/components/checkmark/index.ts +1 -0
  328. package/src/components/checkmark-mobile/Component.tsx +18 -0
  329. package/src/components/checkmark-mobile/index.module.css +28 -0
  330. package/src/components/checkmark-mobile/index.ts +1 -0
  331. package/src/components/field/Component.tsx +110 -0
  332. package/src/components/field/index.module.css +60 -0
  333. package/src/components/field/index.ts +1 -0
  334. package/src/components/index.ts +8 -0
  335. package/src/components/native-select/Component.tsx +60 -0
  336. package/src/components/native-select/index.ts +1 -0
  337. package/src/components/optgroup/Component.tsx +15 -0
  338. package/src/components/optgroup/index.module.css +30 -0
  339. package/src/components/optgroup/index.ts +1 -0
  340. package/src/components/option/Component.tsx +65 -0
  341. package/src/components/option/index.module.css +108 -0
  342. package/src/components/option/index.ts +1 -0
  343. package/src/components/options-list/Component.tsx +140 -0
  344. package/src/components/options-list/index.module.css +40 -0
  345. package/src/components/options-list/index.ts +1 -0
  346. package/src/components/virtual-options-list/Component.tsx +217 -0
  347. package/src/components/virtual-options-list/index.module.css +76 -0
  348. package/src/components/virtual-options-list/index.ts +1 -0
  349. package/src/consts.ts +1 -0
  350. package/src/desktop.ts +1 -0
  351. package/src/index.ts +4 -0
  352. package/src/mobile.ts +5 -0
  353. package/src/presets/index.ts +3 -0
  354. package/src/presets/useLazyLoading/hook.tsx +309 -0
  355. package/src/presets/useSelectWithApply/hook.tsx +154 -0
  356. package/src/presets/useSelectWithApply/options-list-with-apply/Component.tsx +106 -0
  357. package/src/presets/useSelectWithApply/options-list-with-apply/footer/Component.tsx +37 -0
  358. package/src/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +11 -0
  359. package/src/presets/useSelectWithApply/options-list-with-apply/header/Component.tsx +26 -0
  360. package/src/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +9 -0
  361. package/src/presets/useSelectWithApply/options-list-with-apply/index.ts +1 -0
  362. package/src/presets/useSelectWithLoading/hook.tsx +40 -0
  363. package/src/shared.ts +5 -0
  364. package/src/typings.ts +691 -0
  365. package/src/utils.ts +154 -0
  366. package/src/vars.css +57 -0
  367. package/typings-9211a437.d.ts +95 -0
  368. package/typings-baf4875b.d.ts +52 -0
  369. package/Component-01f08370.d.ts +0 -108
  370. package/Component-01f08370.js +0 -165
  371. package/Component-3885b0d7.d.ts +0 -169
  372. package/Component.d.ts +0 -104
  373. package/Component.mobile-b2c0420d.d.ts +0 -93
  374. package/components/select-mobile/Component.d.ts +0 -0
  375. package/components/select-mobile/Component.js +0 -49
  376. package/components/select-mobile/index.d.ts +0 -1
  377. package/components/select-mobile/index.js +0 -49
  378. package/components/select-modal-mobile/Component.d.ts +0 -0
  379. package/components/select-modal-mobile/Component.js +0 -49
  380. package/components/select-modal-mobile/index.d.ts +0 -1
  381. package/components/select-modal-mobile/index.js +0 -49
  382. package/cssm/Component-3885b0d7.d.ts +0 -169
  383. package/cssm/Component-4727d474.d.ts +0 -108
  384. package/cssm/Component-4727d474.js +0 -175
  385. package/cssm/Component.d.ts +0 -104
  386. package/cssm/Component.mobile-b2c0420d.d.ts +0 -93
  387. package/cssm/components/select-mobile/Component.d.ts +0 -0
  388. package/cssm/components/select-mobile/Component.js +0 -66
  389. package/cssm/components/select-mobile/index.d.ts +0 -1
  390. package/cssm/components/select-mobile/index.js +0 -66
  391. package/cssm/components/select-modal-mobile/Component.d.ts +0 -0
  392. package/cssm/components/select-modal-mobile/Component.js +0 -66
  393. package/cssm/components/select-modal-mobile/index.d.ts +0 -1
  394. package/cssm/components/select-modal-mobile/index.js +0 -66
  395. package/cssm/getDataTestId-5c876d98.d.ts +0 -2
  396. package/cssm/getDataTestId-5c876d98.js +0 -8
  397. package/cssm/index-3885b0d7.d.ts +0 -3
  398. package/cssm/intersection-observer-9ec5cf59.d.ts +0 -1
  399. package/cssm/intersection-observer-9ec5cf59.js +0 -893
  400. package/cssm/responsive.d.ts +0 -2
  401. package/cssm/responsive.js +0 -67
  402. package/cssm/types-ebda875c.d.ts +0 -113
  403. package/esm/Component-3885b0d7.d.ts +0 -169
  404. package/esm/Component-5e2bc757.d.ts +0 -108
  405. package/esm/Component-5e2bc757.js +0 -155
  406. package/esm/Component.d.ts +0 -104
  407. package/esm/Component.mobile-b2c0420d.d.ts +0 -93
  408. package/esm/components/select-mobile/Component.d.ts +0 -0
  409. package/esm/components/select-mobile/Component.js +0 -41
  410. package/esm/components/select-mobile/index.d.ts +0 -1
  411. package/esm/components/select-mobile/index.js +0 -41
  412. package/esm/components/select-modal-mobile/Component.d.ts +0 -0
  413. package/esm/components/select-modal-mobile/Component.js +0 -41
  414. package/esm/components/select-modal-mobile/index.d.ts +0 -1
  415. package/esm/components/select-modal-mobile/index.js +0 -41
  416. package/esm/getDataTestId-fc7d4653.d.ts +0 -2
  417. package/esm/getDataTestId-fc7d4653.js +0 -6
  418. package/esm/index-3885b0d7.d.ts +0 -3
  419. package/esm/intersection-observer-6768cbd0.d.ts +0 -1
  420. package/esm/intersection-observer-6768cbd0.js +0 -891
  421. package/esm/presets/useLazyLoading/index.css +0 -8
  422. package/esm/responsive.d.ts +0 -2
  423. package/esm/types-ebda875c.d.ts +0 -113
  424. package/getDataTestId-18fbdb35.d.ts +0 -2
  425. package/getDataTestId-18fbdb35.js +0 -8
  426. package/index-3885b0d7.d.ts +0 -3
  427. package/intersection-observer-0413a170.d.ts +0 -1
  428. package/intersection-observer-0413a170.js +0 -893
  429. package/modern/Component-3885b0d7.d.ts +0 -169
  430. package/modern/Component-ecb2a41a.d.ts +0 -108
  431. package/modern/Component.d.ts +0 -104
  432. package/modern/Component.mobile-b2c0420d.d.ts +0 -93
  433. package/modern/components/select-mobile/Component.d.ts +0 -0
  434. package/modern/components/select-mobile/Component.js +0 -40
  435. package/modern/components/select-mobile/index.d.ts +0 -1
  436. package/modern/components/select-mobile/index.js +0 -40
  437. package/modern/components/select-modal-mobile/Component.d.ts +0 -0
  438. package/modern/components/select-modal-mobile/Component.js +0 -40
  439. package/modern/components/select-modal-mobile/index.d.ts +0 -1
  440. package/modern/components/select-modal-mobile/index.js +0 -40
  441. package/modern/getDataTestId-6120c308.d.ts +0 -2
  442. package/modern/getDataTestId-6120c308.js +0 -6
  443. package/modern/index-3885b0d7.d.ts +0 -3
  444. package/modern/intersection-observer-6768cbd0.d.ts +0 -1
  445. package/modern/intersection-observer-6768cbd0.js +0 -891
  446. package/modern/presets/useLazyLoading/index.css +0 -8
  447. package/modern/responsive.d.ts +0 -2
  448. package/modern/types-ebda875c.d.ts +0 -113
  449. package/presets/useLazyLoading/index.css +0 -8
  450. package/responsive.d.ts +0 -2
  451. package/types-ebda875c.d.ts +0 -113
  452. /package/{cssm/presets/useLazyLoading → src/presets/useSelectWithLoading}/index.module.css +0 -0
@@ -6,8 +6,6 @@ var tslib = require('tslib');
6
6
  var React = require('react');
7
7
  var coreComponentsSkeleton = require('@alfalab/core-components-skeleton/cssm');
8
8
  var components_option_Component = require('../../components/option/Component.js');
9
- var styles = require('./index.module.css');
10
- require('../../intersection-observer-9ec5cf59.js');
11
9
  require('classnames');
12
10
  require('../../components/checkmark/Component.js');
13
11
  require('@alfalab/core-components-badge/cssm');
@@ -22,7 +20,898 @@ require('../../components/option/index.module.css');
22
20
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
23
21
 
24
22
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
25
- var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
23
+
24
+ /**
25
+ * Copyright 2016 Google Inc. All Rights Reserved.
26
+ *
27
+ * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.
28
+ *
29
+ * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
30
+ *
31
+ */
32
+ (function () {
33
+ // Exit early if we're not running in a browser.
34
+ if (typeof window !== 'object') {
35
+ return;
36
+ }
37
+ // Exit early if all IntersectionObserver and IntersectionObserverEntry
38
+ // features are natively supported.
39
+ if ('IntersectionObserver' in window &&
40
+ 'IntersectionObserverEntry' in window &&
41
+ 'intersectionRatio' in window.IntersectionObserverEntry.prototype) {
42
+ // Minimal polyfill for Edge 15's lack of `isIntersecting`
43
+ // See: https://github.com/w3c/IntersectionObserver/issues/211
44
+ if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {
45
+ Object.defineProperty(window.IntersectionObserverEntry.prototype, 'isIntersecting', {
46
+ get: function () {
47
+ return this.intersectionRatio > 0;
48
+ }
49
+ });
50
+ }
51
+ return;
52
+ }
53
+ /**
54
+ * Returns the embedding frame element, if any.
55
+ * @param {!Document} doc
56
+ * @return {!Element}
57
+ */
58
+ function getFrameElement(doc) {
59
+ try {
60
+ return doc.defaultView && doc.defaultView.frameElement || null;
61
+ }
62
+ catch (e) {
63
+ // Ignore the error.
64
+ return null;
65
+ }
66
+ }
67
+ /**
68
+ * A local reference to the root document.
69
+ */
70
+ var document = (function (startDoc) {
71
+ var doc = startDoc;
72
+ var frame = getFrameElement(doc);
73
+ while (frame) {
74
+ doc = frame.ownerDocument;
75
+ frame = getFrameElement(doc);
76
+ }
77
+ return doc;
78
+ })(window.document);
79
+ /**
80
+ * An IntersectionObserver registry. This registry exists to hold a strong
81
+ * reference to IntersectionObserver instances currently observing a target
82
+ * element. Without this registry, instances without another reference may be
83
+ * garbage collected.
84
+ */
85
+ var registry = [];
86
+ /**
87
+ * The signal updater for cross-origin intersection. When not null, it means
88
+ * that the polyfill is configured to work in a cross-origin mode.
89
+ * @type {function(DOMRect|ClientRect, DOMRect|ClientRect)}
90
+ */
91
+ var crossOriginUpdater = null;
92
+ /**
93
+ * The current cross-origin intersection. Only used in the cross-origin mode.
94
+ * @type {DOMRect|ClientRect}
95
+ */
96
+ var crossOriginRect = null;
97
+ /**
98
+ * Creates the global IntersectionObserverEntry constructor.
99
+ * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry
100
+ * @param {Object} entry A dictionary of instance properties.
101
+ * @constructor
102
+ */
103
+ function IntersectionObserverEntry(entry) {
104
+ this.time = entry.time;
105
+ this.target = entry.target;
106
+ this.rootBounds = ensureDOMRect(entry.rootBounds);
107
+ this.boundingClientRect = ensureDOMRect(entry.boundingClientRect);
108
+ this.intersectionRect = ensureDOMRect(entry.intersectionRect || getEmptyRect());
109
+ this.isIntersecting = !!entry.intersectionRect;
110
+ // Calculates the intersection ratio.
111
+ var targetRect = this.boundingClientRect;
112
+ var targetArea = targetRect.width * targetRect.height;
113
+ var intersectionRect = this.intersectionRect;
114
+ var intersectionArea = intersectionRect.width * intersectionRect.height;
115
+ // Sets intersection ratio.
116
+ if (targetArea) {
117
+ // Round the intersection ratio to avoid floating point math issues:
118
+ // https://github.com/w3c/IntersectionObserver/issues/324
119
+ this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));
120
+ }
121
+ else {
122
+ // If area is zero and is intersecting, sets to 1, otherwise to 0
123
+ this.intersectionRatio = this.isIntersecting ? 1 : 0;
124
+ }
125
+ }
126
+ /**
127
+ * Creates the global IntersectionObserver constructor.
128
+ * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface
129
+ * @param {Function} callback The function to be invoked after intersection
130
+ * changes have queued. The function is not invoked if the queue has
131
+ * been emptied by calling the `takeRecords` method.
132
+ * @param {Object=} opt_options Optional configuration options.
133
+ * @constructor
134
+ */
135
+ function IntersectionObserver(callback, opt_options) {
136
+ var options = opt_options || {};
137
+ if (typeof callback != 'function') {
138
+ throw new Error('callback must be a function');
139
+ }
140
+ if (options.root &&
141
+ options.root.nodeType != 1 &&
142
+ options.root.nodeType != 9) {
143
+ throw new Error('root must be a Document or Element');
144
+ }
145
+ // Binds and throttles `this._checkForIntersections`.
146
+ this._checkForIntersections = throttle(this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);
147
+ // Private properties.
148
+ this._callback = callback;
149
+ this._observationTargets = [];
150
+ this._queuedEntries = [];
151
+ this._rootMarginValues = this._parseRootMargin(options.rootMargin);
152
+ // Public properties.
153
+ this.thresholds = this._initThresholds(options.threshold);
154
+ this.root = options.root || null;
155
+ this.rootMargin = this._rootMarginValues.map(function (margin) {
156
+ return margin.value + margin.unit;
157
+ }).join(' ');
158
+ /** @private @const {!Array<!Document>} */
159
+ this._monitoringDocuments = [];
160
+ /** @private @const {!Array<function()>} */
161
+ this._monitoringUnsubscribes = [];
162
+ }
163
+ /**
164
+ * The minimum interval within which the document will be checked for
165
+ * intersection changes.
166
+ */
167
+ IntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;
168
+ /**
169
+ * The frequency in which the polyfill polls for intersection changes.
170
+ * this can be updated on a per instance basis and must be set prior to
171
+ * calling `observe` on the first target.
172
+ */
173
+ IntersectionObserver.prototype.POLL_INTERVAL = null;
174
+ /**
175
+ * Use a mutation observer on the root element
176
+ * to detect intersection changes.
177
+ */
178
+ IntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;
179
+ /**
180
+ * Sets up the polyfill in the cross-origin mode. The result is the
181
+ * updater function that accepts two arguments: `boundingClientRect` and
182
+ * `intersectionRect` - just as these fields would be available to the
183
+ * parent via `IntersectionObserverEntry`. This function should be called
184
+ * each time the iframe receives intersection information from the parent
185
+ * window, e.g. via messaging.
186
+ * @return {function(DOMRect|ClientRect, DOMRect|ClientRect)}
187
+ */
188
+ IntersectionObserver._setupCrossOriginUpdater = function () {
189
+ if (!crossOriginUpdater) {
190
+ /**
191
+ * @param {DOMRect|ClientRect} boundingClientRect
192
+ * @param {DOMRect|ClientRect} intersectionRect
193
+ */
194
+ crossOriginUpdater = function (boundingClientRect, intersectionRect) {
195
+ if (!boundingClientRect || !intersectionRect) {
196
+ crossOriginRect = getEmptyRect();
197
+ }
198
+ else {
199
+ crossOriginRect = convertFromParentRect(boundingClientRect, intersectionRect);
200
+ }
201
+ registry.forEach(function (observer) {
202
+ observer._checkForIntersections();
203
+ });
204
+ };
205
+ }
206
+ return crossOriginUpdater;
207
+ };
208
+ /**
209
+ * Resets the cross-origin mode.
210
+ */
211
+ IntersectionObserver._resetCrossOriginUpdater = function () {
212
+ crossOriginUpdater = null;
213
+ crossOriginRect = null;
214
+ };
215
+ /**
216
+ * Starts observing a target element for intersection changes based on
217
+ * the thresholds values.
218
+ * @param {Element} target The DOM element to observe.
219
+ */
220
+ IntersectionObserver.prototype.observe = function (target) {
221
+ var isTargetAlreadyObserved = this._observationTargets.some(function (item) {
222
+ return item.element == target;
223
+ });
224
+ if (isTargetAlreadyObserved) {
225
+ return;
226
+ }
227
+ if (!(target && target.nodeType == 1)) {
228
+ throw new Error('target must be an Element');
229
+ }
230
+ this._registerInstance();
231
+ this._observationTargets.push({ element: target, entry: null });
232
+ this._monitorIntersections(target.ownerDocument);
233
+ this._checkForIntersections();
234
+ };
235
+ /**
236
+ * Stops observing a target element for intersection changes.
237
+ * @param {Element} target The DOM element to observe.
238
+ */
239
+ IntersectionObserver.prototype.unobserve = function (target) {
240
+ this._observationTargets =
241
+ this._observationTargets.filter(function (item) {
242
+ return item.element != target;
243
+ });
244
+ this._unmonitorIntersections(target.ownerDocument);
245
+ if (this._observationTargets.length == 0) {
246
+ this._unregisterInstance();
247
+ }
248
+ };
249
+ /**
250
+ * Stops observing all target elements for intersection changes.
251
+ */
252
+ IntersectionObserver.prototype.disconnect = function () {
253
+ this._observationTargets = [];
254
+ this._unmonitorAllIntersections();
255
+ this._unregisterInstance();
256
+ };
257
+ /**
258
+ * Returns any queue entries that have not yet been reported to the
259
+ * callback and clears the queue. This can be used in conjunction with the
260
+ * callback to obtain the absolute most up-to-date intersection information.
261
+ * @return {Array} The currently queued entries.
262
+ */
263
+ IntersectionObserver.prototype.takeRecords = function () {
264
+ var records = this._queuedEntries.slice();
265
+ this._queuedEntries = [];
266
+ return records;
267
+ };
268
+ /**
269
+ * Accepts the threshold value from the user configuration object and
270
+ * returns a sorted array of unique threshold values. If a value is not
271
+ * between 0 and 1 and error is thrown.
272
+ * @private
273
+ * @param {Array|number=} opt_threshold An optional threshold value or
274
+ * a list of threshold values, defaulting to [0].
275
+ * @return {Array} A sorted list of unique and valid threshold values.
276
+ */
277
+ IntersectionObserver.prototype._initThresholds = function (opt_threshold) {
278
+ var threshold = opt_threshold || [0];
279
+ if (!Array.isArray(threshold))
280
+ threshold = [threshold];
281
+ return threshold.sort().filter(function (t, i, a) {
282
+ if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {
283
+ throw new Error('threshold must be a number between 0 and 1 inclusively');
284
+ }
285
+ return t !== a[i - 1];
286
+ });
287
+ };
288
+ /**
289
+ * Accepts the rootMargin value from the user configuration object
290
+ * and returns an array of the four margin values as an object containing
291
+ * the value and unit properties. If any of the values are not properly
292
+ * formatted or use a unit other than px or %, and error is thrown.
293
+ * @private
294
+ * @param {string=} opt_rootMargin An optional rootMargin value,
295
+ * defaulting to '0px'.
296
+ * @return {Array<Object>} An array of margin objects with the keys
297
+ * value and unit.
298
+ */
299
+ IntersectionObserver.prototype._parseRootMargin = function (opt_rootMargin) {
300
+ var marginString = opt_rootMargin || '0px';
301
+ var margins = marginString.split(/\s+/).map(function (margin) {
302
+ var parts = /^(-?\d*\.?\d+)(px|%)$/.exec(margin);
303
+ if (!parts) {
304
+ throw new Error('rootMargin must be specified in pixels or percent');
305
+ }
306
+ return { value: parseFloat(parts[1]), unit: parts[2] };
307
+ });
308
+ // Handles shorthand.
309
+ margins[1] = margins[1] || margins[0];
310
+ margins[2] = margins[2] || margins[0];
311
+ margins[3] = margins[3] || margins[1];
312
+ return margins;
313
+ };
314
+ /**
315
+ * Starts polling for intersection changes if the polling is not already
316
+ * happening, and if the page's visibility state is visible.
317
+ * @param {!Document} doc
318
+ * @private
319
+ */
320
+ IntersectionObserver.prototype._monitorIntersections = function (doc) {
321
+ var win = doc.defaultView;
322
+ if (!win) {
323
+ // Already destroyed.
324
+ return;
325
+ }
326
+ if (this._monitoringDocuments.indexOf(doc) != -1) {
327
+ // Already monitoring.
328
+ return;
329
+ }
330
+ // Private state for monitoring.
331
+ var callback = this._checkForIntersections;
332
+ var monitoringInterval = null;
333
+ var domObserver = null;
334
+ // If a poll interval is set, use polling instead of listening to
335
+ // resize and scroll events or DOM mutations.
336
+ if (this.POLL_INTERVAL) {
337
+ monitoringInterval = win.setInterval(callback, this.POLL_INTERVAL);
338
+ }
339
+ else {
340
+ addEvent(win, 'resize', callback, true);
341
+ addEvent(doc, 'scroll', callback, true);
342
+ if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in win) {
343
+ domObserver = new win.MutationObserver(callback);
344
+ domObserver.observe(doc, {
345
+ attributes: true,
346
+ childList: true,
347
+ characterData: true,
348
+ subtree: true
349
+ });
350
+ }
351
+ }
352
+ this._monitoringDocuments.push(doc);
353
+ this._monitoringUnsubscribes.push(function () {
354
+ // Get the window object again. When a friendly iframe is destroyed, it
355
+ // will be null.
356
+ var win = doc.defaultView;
357
+ if (win) {
358
+ if (monitoringInterval) {
359
+ win.clearInterval(monitoringInterval);
360
+ }
361
+ removeEvent(win, 'resize', callback, true);
362
+ }
363
+ removeEvent(doc, 'scroll', callback, true);
364
+ if (domObserver) {
365
+ domObserver.disconnect();
366
+ }
367
+ });
368
+ // Also monitor the parent.
369
+ var rootDoc = (this.root && (this.root.ownerDocument || this.root)) || document;
370
+ if (doc != rootDoc) {
371
+ var frame = getFrameElement(doc);
372
+ if (frame) {
373
+ this._monitorIntersections(frame.ownerDocument);
374
+ }
375
+ }
376
+ };
377
+ /**
378
+ * Stops polling for intersection changes.
379
+ * @param {!Document} doc
380
+ * @private
381
+ */
382
+ IntersectionObserver.prototype._unmonitorIntersections = function (doc) {
383
+ var index = this._monitoringDocuments.indexOf(doc);
384
+ if (index == -1) {
385
+ return;
386
+ }
387
+ var rootDoc = (this.root && (this.root.ownerDocument || this.root)) || document;
388
+ // Check if any dependent targets are still remaining.
389
+ var hasDependentTargets = this._observationTargets.some(function (item) {
390
+ var itemDoc = item.element.ownerDocument;
391
+ // Target is in this context.
392
+ if (itemDoc == doc) {
393
+ return true;
394
+ }
395
+ // Target is nested in this context.
396
+ while (itemDoc && itemDoc != rootDoc) {
397
+ var frame = getFrameElement(itemDoc);
398
+ itemDoc = frame && frame.ownerDocument;
399
+ if (itemDoc == doc) {
400
+ return true;
401
+ }
402
+ }
403
+ return false;
404
+ });
405
+ if (hasDependentTargets) {
406
+ return;
407
+ }
408
+ // Unsubscribe.
409
+ var unsubscribe = this._monitoringUnsubscribes[index];
410
+ this._monitoringDocuments.splice(index, 1);
411
+ this._monitoringUnsubscribes.splice(index, 1);
412
+ unsubscribe();
413
+ // Also unmonitor the parent.
414
+ if (doc != rootDoc) {
415
+ var frame = getFrameElement(doc);
416
+ if (frame) {
417
+ this._unmonitorIntersections(frame.ownerDocument);
418
+ }
419
+ }
420
+ };
421
+ /**
422
+ * Stops polling for intersection changes.
423
+ * @param {!Document} doc
424
+ * @private
425
+ */
426
+ IntersectionObserver.prototype._unmonitorAllIntersections = function () {
427
+ var unsubscribes = this._monitoringUnsubscribes.slice(0);
428
+ this._monitoringDocuments.length = 0;
429
+ this._monitoringUnsubscribes.length = 0;
430
+ for (var i = 0; i < unsubscribes.length; i++) {
431
+ unsubscribes[i]();
432
+ }
433
+ };
434
+ /**
435
+ * Scans each observation target for intersection changes and adds them
436
+ * to the internal entries queue. If new entries are found, it
437
+ * schedules the callback to be invoked.
438
+ * @private
439
+ */
440
+ IntersectionObserver.prototype._checkForIntersections = function () {
441
+ if (!this.root && crossOriginUpdater && !crossOriginRect) {
442
+ // Cross origin monitoring, but no initial data available yet.
443
+ return;
444
+ }
445
+ var rootIsInDom = this._rootIsInDom();
446
+ var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();
447
+ this._observationTargets.forEach(function (item) {
448
+ var target = item.element;
449
+ var targetRect = getBoundingClientRect(target);
450
+ var rootContainsTarget = this._rootContainsTarget(target);
451
+ var oldEntry = item.entry;
452
+ var intersectionRect = rootIsInDom && rootContainsTarget &&
453
+ this._computeTargetAndRootIntersection(target, targetRect, rootRect);
454
+ var rootBounds = null;
455
+ if (!this._rootContainsTarget(target)) {
456
+ rootBounds = getEmptyRect();
457
+ }
458
+ else if (!crossOriginUpdater || this.root) {
459
+ rootBounds = rootRect;
460
+ }
461
+ var newEntry = item.entry = new IntersectionObserverEntry({
462
+ time: now(),
463
+ target: target,
464
+ boundingClientRect: targetRect,
465
+ rootBounds: rootBounds,
466
+ intersectionRect: intersectionRect
467
+ });
468
+ if (!oldEntry) {
469
+ this._queuedEntries.push(newEntry);
470
+ }
471
+ else if (rootIsInDom && rootContainsTarget) {
472
+ // If the new entry intersection ratio has crossed any of the
473
+ // thresholds, add a new entry.
474
+ if (this._hasCrossedThreshold(oldEntry, newEntry)) {
475
+ this._queuedEntries.push(newEntry);
476
+ }
477
+ }
478
+ else {
479
+ // If the root is not in the DOM or target is not contained within
480
+ // root but the previous entry for this target had an intersection,
481
+ // add a new record indicating removal.
482
+ if (oldEntry && oldEntry.isIntersecting) {
483
+ this._queuedEntries.push(newEntry);
484
+ }
485
+ }
486
+ }, this);
487
+ if (this._queuedEntries.length) {
488
+ this._callback(this.takeRecords(), this);
489
+ }
490
+ };
491
+ /**
492
+ * Accepts a target and root rect computes the intersection between then
493
+ * following the algorithm in the spec.
494
+ * TODO(philipwalton): at this time clip-path is not considered.
495
+ * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo
496
+ * @param {Element} target The target DOM element
497
+ * @param {Object} targetRect The bounding rect of the target.
498
+ * @param {Object} rootRect The bounding rect of the root after being
499
+ * expanded by the rootMargin value.
500
+ * @return {?Object} The final intersection rect object or undefined if no
501
+ * intersection is found.
502
+ * @private
503
+ */
504
+ IntersectionObserver.prototype._computeTargetAndRootIntersection =
505
+ function (target, targetRect, rootRect) {
506
+ // If the element isn't displayed, an intersection can't happen.
507
+ if (window.getComputedStyle(target).display == 'none')
508
+ return;
509
+ var intersectionRect = targetRect;
510
+ var parent = getParentNode(target);
511
+ var atRoot = false;
512
+ while (!atRoot && parent) {
513
+ var parentRect = null;
514
+ var parentComputedStyle = parent.nodeType == 1 ?
515
+ window.getComputedStyle(parent) : {};
516
+ // If the parent isn't displayed, an intersection can't happen.
517
+ if (parentComputedStyle.display == 'none')
518
+ return null;
519
+ if (parent == this.root || parent.nodeType == /* DOCUMENT */ 9) {
520
+ atRoot = true;
521
+ if (parent == this.root || parent == document) {
522
+ if (crossOriginUpdater && !this.root) {
523
+ if (!crossOriginRect ||
524
+ crossOriginRect.width == 0 && crossOriginRect.height == 0) {
525
+ // A 0-size cross-origin intersection means no-intersection.
526
+ parent = null;
527
+ parentRect = null;
528
+ intersectionRect = null;
529
+ }
530
+ else {
531
+ parentRect = crossOriginRect;
532
+ }
533
+ }
534
+ else {
535
+ parentRect = rootRect;
536
+ }
537
+ }
538
+ else {
539
+ // Check if there's a frame that can be navigated to.
540
+ var frame = getParentNode(parent);
541
+ var frameRect = frame && getBoundingClientRect(frame);
542
+ var frameIntersect = frame &&
543
+ this._computeTargetAndRootIntersection(frame, frameRect, rootRect);
544
+ if (frameRect && frameIntersect) {
545
+ parent = frame;
546
+ parentRect = convertFromParentRect(frameRect, frameIntersect);
547
+ }
548
+ else {
549
+ parent = null;
550
+ intersectionRect = null;
551
+ }
552
+ }
553
+ }
554
+ else {
555
+ // If the element has a non-visible overflow, and it's not the <body>
556
+ // or <html> element, update the intersection rect.
557
+ // Note: <body> and <html> cannot be clipped to a rect that's not also
558
+ // the document rect, so no need to compute a new intersection.
559
+ var doc = parent.ownerDocument;
560
+ if (parent != doc.body &&
561
+ parent != doc.documentElement &&
562
+ parentComputedStyle.overflow != 'visible') {
563
+ parentRect = getBoundingClientRect(parent);
564
+ }
565
+ }
566
+ // If either of the above conditionals set a new parentRect,
567
+ // calculate new intersection data.
568
+ if (parentRect) {
569
+ intersectionRect = computeRectIntersection(parentRect, intersectionRect);
570
+ }
571
+ if (!intersectionRect)
572
+ break;
573
+ parent = parent && getParentNode(parent);
574
+ }
575
+ return intersectionRect;
576
+ };
577
+ /**
578
+ * Returns the root rect after being expanded by the rootMargin value.
579
+ * @return {ClientRect} The expanded root rect.
580
+ * @private
581
+ */
582
+ IntersectionObserver.prototype._getRootRect = function () {
583
+ var rootRect;
584
+ if (this.root && !isDoc(this.root)) {
585
+ rootRect = getBoundingClientRect(this.root);
586
+ }
587
+ else {
588
+ // Use <html>/<body> instead of window since scroll bars affect size.
589
+ var doc = isDoc(this.root) ? this.root : document;
590
+ var html = doc.documentElement;
591
+ var body = doc.body;
592
+ rootRect = {
593
+ top: 0,
594
+ left: 0,
595
+ right: html.clientWidth || body.clientWidth,
596
+ width: html.clientWidth || body.clientWidth,
597
+ bottom: html.clientHeight || body.clientHeight,
598
+ height: html.clientHeight || body.clientHeight
599
+ };
600
+ }
601
+ return this._expandRectByRootMargin(rootRect);
602
+ };
603
+ /**
604
+ * Accepts a rect and expands it by the rootMargin value.
605
+ * @param {DOMRect|ClientRect} rect The rect object to expand.
606
+ * @return {ClientRect} The expanded rect.
607
+ * @private
608
+ */
609
+ IntersectionObserver.prototype._expandRectByRootMargin = function (rect) {
610
+ var margins = this._rootMarginValues.map(function (margin, i) {
611
+ return margin.unit == 'px' ? margin.value :
612
+ margin.value * (i % 2 ? rect.width : rect.height) / 100;
613
+ });
614
+ var newRect = {
615
+ top: rect.top - margins[0],
616
+ right: rect.right + margins[1],
617
+ bottom: rect.bottom + margins[2],
618
+ left: rect.left - margins[3]
619
+ };
620
+ newRect.width = newRect.right - newRect.left;
621
+ newRect.height = newRect.bottom - newRect.top;
622
+ return newRect;
623
+ };
624
+ /**
625
+ * Accepts an old and new entry and returns true if at least one of the
626
+ * threshold values has been crossed.
627
+ * @param {?IntersectionObserverEntry} oldEntry The previous entry for a
628
+ * particular target element or null if no previous entry exists.
629
+ * @param {IntersectionObserverEntry} newEntry The current entry for a
630
+ * particular target element.
631
+ * @return {boolean} Returns true if a any threshold has been crossed.
632
+ * @private
633
+ */
634
+ IntersectionObserver.prototype._hasCrossedThreshold =
635
+ function (oldEntry, newEntry) {
636
+ // To make comparing easier, an entry that has a ratio of 0
637
+ // but does not actually intersect is given a value of -1
638
+ var oldRatio = oldEntry && oldEntry.isIntersecting ?
639
+ oldEntry.intersectionRatio || 0 : -1;
640
+ var newRatio = newEntry.isIntersecting ?
641
+ newEntry.intersectionRatio || 0 : -1;
642
+ // Ignore unchanged ratios
643
+ if (oldRatio === newRatio)
644
+ return;
645
+ for (var i = 0; i < this.thresholds.length; i++) {
646
+ var threshold = this.thresholds[i];
647
+ // Return true if an entry matches a threshold or if the new ratio
648
+ // and the old ratio are on the opposite sides of a threshold.
649
+ if (threshold == oldRatio || threshold == newRatio ||
650
+ threshold < oldRatio !== threshold < newRatio) {
651
+ return true;
652
+ }
653
+ }
654
+ };
655
+ /**
656
+ * Returns whether or not the root element is an element and is in the DOM.
657
+ * @return {boolean} True if the root element is an element and is in the DOM.
658
+ * @private
659
+ */
660
+ IntersectionObserver.prototype._rootIsInDom = function () {
661
+ return !this.root || containsDeep(document, this.root);
662
+ };
663
+ /**
664
+ * Returns whether or not the target element is a child of root.
665
+ * @param {Element} target The target element to check.
666
+ * @return {boolean} True if the target element is a child of root.
667
+ * @private
668
+ */
669
+ IntersectionObserver.prototype._rootContainsTarget = function (target) {
670
+ var rootDoc = (this.root && (this.root.ownerDocument || this.root)) || document;
671
+ return (containsDeep(rootDoc, target) &&
672
+ (!this.root || rootDoc == target.ownerDocument));
673
+ };
674
+ /**
675
+ * Adds the instance to the global IntersectionObserver registry if it isn't
676
+ * already present.
677
+ * @private
678
+ */
679
+ IntersectionObserver.prototype._registerInstance = function () {
680
+ if (registry.indexOf(this) < 0) {
681
+ registry.push(this);
682
+ }
683
+ };
684
+ /**
685
+ * Removes the instance from the global IntersectionObserver registry.
686
+ * @private
687
+ */
688
+ IntersectionObserver.prototype._unregisterInstance = function () {
689
+ var index = registry.indexOf(this);
690
+ if (index != -1)
691
+ registry.splice(index, 1);
692
+ };
693
+ /**
694
+ * Returns the result of the performance.now() method or null in browsers
695
+ * that don't support the API.
696
+ * @return {number} The elapsed time since the page was requested.
697
+ */
698
+ function now() {
699
+ return window.performance && performance.now && performance.now();
700
+ }
701
+ /**
702
+ * Throttles a function and delays its execution, so it's only called at most
703
+ * once within a given time period.
704
+ * @param {Function} fn The function to throttle.
705
+ * @param {number} timeout The amount of time that must pass before the
706
+ * function can be called again.
707
+ * @return {Function} The throttled function.
708
+ */
709
+ function throttle(fn, timeout) {
710
+ var timer = null;
711
+ return function () {
712
+ if (!timer) {
713
+ timer = setTimeout(function () {
714
+ fn();
715
+ timer = null;
716
+ }, timeout);
717
+ }
718
+ };
719
+ }
720
+ /**
721
+ * Adds an event handler to a DOM node ensuring cross-browser compatibility.
722
+ * @param {Node} node The DOM node to add the event handler to.
723
+ * @param {string} event The event name.
724
+ * @param {Function} fn The event handler to add.
725
+ * @param {boolean} opt_useCapture Optionally adds the even to the capture
726
+ * phase. Note: this only works in modern browsers.
727
+ */
728
+ function addEvent(node, event, fn, opt_useCapture) {
729
+ if (typeof node.addEventListener == 'function') {
730
+ node.addEventListener(event, fn, opt_useCapture || false);
731
+ }
732
+ else if (typeof node.attachEvent == 'function') {
733
+ node.attachEvent('on' + event, fn);
734
+ }
735
+ }
736
+ /**
737
+ * Removes a previously added event handler from a DOM node.
738
+ * @param {Node} node The DOM node to remove the event handler from.
739
+ * @param {string} event The event name.
740
+ * @param {Function} fn The event handler to remove.
741
+ * @param {boolean} opt_useCapture If the event handler was added with this
742
+ * flag set to true, it should be set to true here in order to remove it.
743
+ */
744
+ function removeEvent(node, event, fn, opt_useCapture) {
745
+ if (typeof node.removeEventListener == 'function') {
746
+ node.removeEventListener(event, fn, opt_useCapture || false);
747
+ }
748
+ else if (typeof node.detatchEvent == 'function') {
749
+ node.detatchEvent('on' + event, fn);
750
+ }
751
+ }
752
+ /**
753
+ * Returns the intersection between two rect objects.
754
+ * @param {Object} rect1 The first rect.
755
+ * @param {Object} rect2 The second rect.
756
+ * @return {?Object|?ClientRect} The intersection rect or undefined if no
757
+ * intersection is found.
758
+ */
759
+ function computeRectIntersection(rect1, rect2) {
760
+ var top = Math.max(rect1.top, rect2.top);
761
+ var bottom = Math.min(rect1.bottom, rect2.bottom);
762
+ var left = Math.max(rect1.left, rect2.left);
763
+ var right = Math.min(rect1.right, rect2.right);
764
+ var width = right - left;
765
+ var height = bottom - top;
766
+ return (width >= 0 && height >= 0) && {
767
+ top: top,
768
+ bottom: bottom,
769
+ left: left,
770
+ right: right,
771
+ width: width,
772
+ height: height
773
+ } || null;
774
+ }
775
+ /**
776
+ * Shims the native getBoundingClientRect for compatibility with older IE.
777
+ * @param {Element} el The element whose bounding rect to get.
778
+ * @return {DOMRect|ClientRect} The (possibly shimmed) rect of the element.
779
+ */
780
+ function getBoundingClientRect(el) {
781
+ var rect;
782
+ try {
783
+ rect = el.getBoundingClientRect();
784
+ }
785
+ catch (err) {
786
+ // Ignore Windows 7 IE11 "Unspecified error"
787
+ // https://github.com/w3c/IntersectionObserver/pull/205
788
+ }
789
+ if (!rect)
790
+ return getEmptyRect();
791
+ // Older IE
792
+ if (!(rect.width && rect.height)) {
793
+ rect = {
794
+ top: rect.top,
795
+ right: rect.right,
796
+ bottom: rect.bottom,
797
+ left: rect.left,
798
+ width: rect.right - rect.left,
799
+ height: rect.bottom - rect.top
800
+ };
801
+ }
802
+ return rect;
803
+ }
804
+ /**
805
+ * Returns an empty rect object. An empty rect is returned when an element
806
+ * is not in the DOM.
807
+ * @return {ClientRect} The empty rect.
808
+ */
809
+ function getEmptyRect() {
810
+ return {
811
+ top: 0,
812
+ bottom: 0,
813
+ left: 0,
814
+ right: 0,
815
+ width: 0,
816
+ height: 0
817
+ };
818
+ }
819
+ /**
820
+ * Ensure that the result has all of the necessary fields of the DOMRect.
821
+ * Specifically this ensures that `x` and `y` fields are set.
822
+ *
823
+ * @param {?DOMRect|?ClientRect} rect
824
+ * @return {?DOMRect}
825
+ */
826
+ function ensureDOMRect(rect) {
827
+ // A `DOMRect` object has `x` and `y` fields.
828
+ if (!rect || 'x' in rect) {
829
+ return rect;
830
+ }
831
+ // A IE's `ClientRect` type does not have `x` and `y`. The same is the case
832
+ // for internally calculated Rect objects. For the purposes of
833
+ // `IntersectionObserver`, it's sufficient to simply mirror `left` and `top`
834
+ // for these fields.
835
+ return {
836
+ top: rect.top,
837
+ y: rect.top,
838
+ bottom: rect.bottom,
839
+ left: rect.left,
840
+ x: rect.left,
841
+ right: rect.right,
842
+ width: rect.width,
843
+ height: rect.height
844
+ };
845
+ }
846
+ /**
847
+ * Inverts the intersection and bounding rect from the parent (frame) BCR to
848
+ * the local BCR space.
849
+ * @param {DOMRect|ClientRect} parentBoundingRect The parent's bound client rect.
850
+ * @param {DOMRect|ClientRect} parentIntersectionRect The parent's own intersection rect.
851
+ * @return {ClientRect} The local root bounding rect for the parent's children.
852
+ */
853
+ function convertFromParentRect(parentBoundingRect, parentIntersectionRect) {
854
+ var top = parentIntersectionRect.top - parentBoundingRect.top;
855
+ var left = parentIntersectionRect.left - parentBoundingRect.left;
856
+ return {
857
+ top: top,
858
+ left: left,
859
+ height: parentIntersectionRect.height,
860
+ width: parentIntersectionRect.width,
861
+ bottom: top + parentIntersectionRect.height,
862
+ right: left + parentIntersectionRect.width
863
+ };
864
+ }
865
+ /**
866
+ * Checks to see if a parent element contains a child element (including inside
867
+ * shadow DOM).
868
+ * @param {Node} parent The parent element.
869
+ * @param {Node} child The child element.
870
+ * @return {boolean} True if the parent node contains the child node.
871
+ */
872
+ function containsDeep(parent, child) {
873
+ var node = child;
874
+ while (node) {
875
+ if (node == parent)
876
+ return true;
877
+ node = getParentNode(node);
878
+ }
879
+ return false;
880
+ }
881
+ /**
882
+ * Gets the parent node of an element or its host element if the parent node
883
+ * is a shadow root.
884
+ * @param {Node} node The node whose parent to get.
885
+ * @return {Node|null} The parent node or null if no parent exists.
886
+ */
887
+ function getParentNode(node) {
888
+ var parent = node.parentNode;
889
+ if (node.nodeType == /* DOCUMENT */ 9 && node != document) {
890
+ // If this node is a document node, look for the embedding frame.
891
+ return getFrameElement(node);
892
+ }
893
+ // If the parent has element that is assigned through shadow root slot
894
+ if (parent && parent.assignedSlot) {
895
+ parent = parent.assignedSlot.parentNode;
896
+ }
897
+ if (parent && parent.nodeType == 11 && parent.host) {
898
+ // If the parent is a shadow root, return the host element.
899
+ return parent.host;
900
+ }
901
+ return parent;
902
+ }
903
+ /**
904
+ * Returns true if `node` is a Document.
905
+ * @param {!Node} node
906
+ * @returns {boolean}
907
+ */
908
+ function isDoc(node) {
909
+ return node && node.nodeType === 9;
910
+ }
911
+ // Exposes the constructors globally.
912
+ window.IntersectionObserver = IntersectionObserver;
913
+ window.IntersectionObserverEntry = IntersectionObserverEntry;
914
+ }());
26
915
 
27
916
  var DEBOUNCE_TIMEOUT = 300;
28
917
  var actions = {
@@ -45,8 +934,15 @@ var actions = {
45
934
  return { type: 'RESET' };
46
935
  },
47
936
  };
937
+ var skeletonStyle = {
938
+ position: 'absolute',
939
+ top: '50%',
940
+ transform: 'translateY(-50%)',
941
+ height: '16px',
942
+ width: '50%',
943
+ };
48
944
  function useLazyLoading(_a) {
49
- var _b = _a.limit, limit = _b === void 0 ? 10 : _b, _c = _a.initialOffset, initialOffset = _c === void 0 ? 0 : _c, optionsFetcher = _a.optionsFetcher, _d = _a.skeleton, skeleton = _d === void 0 ? React__default.default.createElement(coreComponentsSkeleton.Skeleton, { className: styles__default.default.skeleton, visible: true }) : _d, _e = _a.Option, Option = _e === void 0 ? components_option_Component.Option : _e;
945
+ var _b = _a.limit, limit = _b === void 0 ? 10 : _b, _c = _a.initialOffset, initialOffset = _c === void 0 ? 0 : _c, optionsFetcher = _a.optionsFetcher, _d = _a.skeleton, skeleton = _d === void 0 ? React__default.default.createElement(coreComponentsSkeleton.Skeleton, { style: skeletonStyle, visible: true }) : _d, _e = _a.Option, Option = _e === void 0 ? components_option_Component.Option : _e;
50
946
  var initialOptions = [];
51
947
  var initialLoading = false;
52
948
  var lazyLoadingInitialState = {