@nanoporetech-digital/components 2.10.1 → 2.11.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 (333) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/{date-utils-0ae9a12d.js → date-utils-b3af910d.js} +2 -2
  3. package/dist/cjs/date-utils-b3af910d.js.map +1 -0
  4. package/dist/cjs/{global-0d4f3b77.js → global-989678ec.js} +1 -8
  5. package/dist/cjs/global-989678ec.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/nano-components.cjs.js +2 -2
  8. package/dist/cjs/nano-datalist_3.cjs.entry.js +3 -1
  9. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  10. package/dist/cjs/nano-date-input.cjs.entry.js +13 -5
  11. package/dist/cjs/nano-date-input.cjs.entry.js.map +1 -1
  12. package/dist/cjs/nano-date-picker.cjs.entry.js +2 -2
  13. package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nano-details.cjs.entry.js +1 -2
  15. package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
  16. package/dist/cjs/nano-global-search-results.cjs.entry.js +1 -2
  17. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  18. package/dist/cjs/nano-grid_3.cjs.entry.js +1 -2
  19. package/dist/cjs/nano-grid_3.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nano-icon-button.cjs.entry.js +4 -0
  21. package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +1 -2
  23. package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nano-slides.cjs.entry.js +1 -2
  25. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nano-sticker.cjs.entry.js +2 -3
  27. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  28. package/dist/cjs/nano-tab-group.cjs.entry.js +4 -2
  29. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  30. package/dist/cjs/nano-tab.cjs.entry.js +5 -1
  31. package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
  32. package/dist/cjs/nano-tooltip.cjs.entry.js +1 -1
  33. package/dist/cjs/nano-tooltip.cjs.entry.js.map +1 -1
  34. package/dist/collection/components/accordion/accordion.js +1 -1
  35. package/dist/collection/components/alert/alert.js +1 -1
  36. package/dist/collection/components/algolia/algolia-filter.js +2 -2
  37. package/dist/collection/components/algolia/algolia-input.js +5 -5
  38. package/dist/collection/components/algolia/algolia-results.js +1 -1
  39. package/dist/collection/components/algolia/algolia.js +6 -6
  40. package/dist/collection/components/checkbox/checkbox-group.js +2 -2
  41. package/dist/collection/components/checkbox/checkbox.js +3 -3
  42. package/dist/collection/components/datalist/datalist.js +4 -2
  43. package/dist/collection/components/datalist/datalist.js.map +1 -1
  44. package/dist/collection/components/date-input/date-input.js +62 -11
  45. package/dist/collection/components/date-input/date-input.js.map +1 -1
  46. package/dist/collection/components/date-picker/date-picker.css +1 -1
  47. package/dist/collection/components/date-picker/date-picker.js +5 -5
  48. package/dist/collection/components/details/details.js +1 -2
  49. package/dist/collection/components/details/details.js.map +1 -1
  50. package/dist/collection/components/dialog/dialog.js +1 -1
  51. package/dist/collection/components/dropdown/dropdown.js +1 -1
  52. package/dist/collection/components/file-upload/file-upload.js +4 -4
  53. package/dist/collection/components/global-nav/global-nav.js +4 -4
  54. package/dist/collection/components/global-search-results/global-search-results.js +0 -1
  55. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  56. package/dist/collection/components/grid/grid-item.js +1 -1
  57. package/dist/collection/components/grid/grid.js +0 -1
  58. package/dist/collection/components/grid/grid.js.map +1 -1
  59. package/dist/collection/components/icon/icon.js +1 -1
  60. package/dist/collection/components/icon-button/icon-button.js +23 -1
  61. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  62. package/dist/collection/components/input/input.js +5 -5
  63. package/dist/collection/components/nav-item/nav-item.js +4 -4
  64. package/dist/collection/components/range/range.js +4 -4
  65. package/dist/collection/components/resize-observe/resize-observe.js +1 -2
  66. package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
  67. package/dist/collection/components/select/select.js +7 -7
  68. package/dist/collection/components/slides/slides.js +7 -8
  69. package/dist/collection/components/slides/slides.js.map +1 -1
  70. package/dist/collection/components/sticker/sticker.js +0 -1
  71. package/dist/collection/components/sticker/sticker.js.map +1 -1
  72. package/dist/collection/components/tabs/tab-group.js +5 -3
  73. package/dist/collection/components/tabs/tab-group.js.map +1 -1
  74. package/dist/collection/components/tabs/tab.js +5 -1
  75. package/dist/collection/components/tabs/tab.js.map +1 -1
  76. package/dist/collection/components/tooltip/tooltip.css +0 -1
  77. package/dist/collection/global/script/global.js +0 -7
  78. package/dist/collection/global/script/global.js.map +1 -1
  79. package/dist/collection/utils/date-utils.js +1 -1
  80. package/dist/collection/utils/date-utils.js.map +1 -1
  81. package/dist/components/datalist.js +3 -1
  82. package/dist/components/datalist.js.map +1 -1
  83. package/dist/components/date-picker.js +2 -2
  84. package/dist/components/date-picker.js.map +1 -1
  85. package/dist/components/grid.js +1 -2
  86. package/dist/components/grid.js.map +1 -1
  87. package/dist/components/icon-button.js +6 -1
  88. package/dist/components/icon-button.js.map +1 -1
  89. package/dist/components/index.js +0 -7
  90. package/dist/components/index.js.map +1 -1
  91. package/dist/components/nano-date-input.js +14 -4
  92. package/dist/components/nano-date-input.js.map +1 -1
  93. package/dist/components/nano-details.js +1 -2
  94. package/dist/components/nano-details.js.map +1 -1
  95. package/dist/components/nano-global-search-results.js +1 -2
  96. package/dist/components/nano-global-search-results.js.map +1 -1
  97. package/dist/components/nano-slides.js +1 -2
  98. package/dist/components/nano-slides.js.map +1 -1
  99. package/dist/components/nano-tab-group.js +4 -2
  100. package/dist/components/nano-tab-group.js.map +1 -1
  101. package/dist/components/nano-tab.js +5 -1
  102. package/dist/components/nano-tab.js.map +1 -1
  103. package/dist/components/resize-observe.js +1 -2
  104. package/dist/components/resize-observe.js.map +1 -1
  105. package/dist/components/sticker.js +2 -3
  106. package/dist/components/sticker.js.map +1 -1
  107. package/dist/components/tooltip.js +1 -1
  108. package/dist/components/tooltip.js.map +1 -1
  109. package/dist/custom-elements/index.js +41 -1938
  110. package/dist/custom-elements/index.js.map +1 -1
  111. package/dist/esm/{date-utils-e4b757ff.js → date-utils-839cb010.js} +2 -2
  112. package/dist/esm/date-utils-839cb010.js.map +1 -0
  113. package/dist/esm/{global-d5ec4d53.js → global-8047b4ff.js} +1 -8
  114. package/dist/esm/global-8047b4ff.js.map +1 -0
  115. package/dist/esm/loader.js +2 -2
  116. package/dist/esm/nano-components.js +2 -2
  117. package/dist/esm/nano-datalist_3.entry.js +3 -1
  118. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  119. package/dist/esm/nano-date-input.entry.js +13 -5
  120. package/dist/esm/nano-date-input.entry.js.map +1 -1
  121. package/dist/esm/nano-date-picker.entry.js +2 -2
  122. package/dist/esm/nano-date-picker.entry.js.map +1 -1
  123. package/dist/esm/nano-details.entry.js +1 -2
  124. package/dist/esm/nano-details.entry.js.map +1 -1
  125. package/dist/esm/nano-global-search-results.entry.js +1 -2
  126. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  127. package/dist/esm/nano-grid_3.entry.js +1 -2
  128. package/dist/esm/nano-grid_3.entry.js.map +1 -1
  129. package/dist/esm/nano-icon-button.entry.js +4 -0
  130. package/dist/esm/nano-icon-button.entry.js.map +1 -1
  131. package/dist/esm/nano-resize-observe_2.entry.js +1 -2
  132. package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
  133. package/dist/esm/nano-slides.entry.js +1 -2
  134. package/dist/esm/nano-slides.entry.js.map +1 -1
  135. package/dist/esm/nano-sticker.entry.js +2 -3
  136. package/dist/esm/nano-sticker.entry.js.map +1 -1
  137. package/dist/esm/nano-tab-group.entry.js +4 -2
  138. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  139. package/dist/esm/nano-tab.entry.js +5 -1
  140. package/dist/esm/nano-tab.entry.js.map +1 -1
  141. package/dist/esm/nano-tooltip.entry.js +1 -1
  142. package/dist/esm/nano-tooltip.entry.js.map +1 -1
  143. package/dist/esm-es5/date-utils-839cb010.js +5 -0
  144. package/dist/esm-es5/date-utils-839cb010.js.map +1 -0
  145. package/dist/esm-es5/{global-d5ec4d53.js → global-8047b4ff.js} +2 -2
  146. package/dist/esm-es5/global-8047b4ff.js.map +1 -0
  147. package/dist/esm-es5/loader.js +1 -1
  148. package/dist/esm-es5/loader.js.map +1 -1
  149. package/dist/esm-es5/nano-components.js +1 -1
  150. package/dist/esm-es5/nano-components.js.map +1 -1
  151. package/dist/esm-es5/nano-datalist_3.entry.js +1 -1
  152. package/dist/esm-es5/nano-datalist_3.entry.js.map +1 -1
  153. package/dist/esm-es5/nano-date-input.entry.js +1 -1
  154. package/dist/esm-es5/nano-date-input.entry.js.map +1 -1
  155. package/dist/esm-es5/nano-date-picker.entry.js +1 -1
  156. package/dist/esm-es5/nano-date-picker.entry.js.map +1 -1
  157. package/dist/esm-es5/nano-details.entry.js +1 -1
  158. package/dist/esm-es5/nano-details.entry.js.map +1 -1
  159. package/dist/esm-es5/nano-global-search-results.entry.js +1 -1
  160. package/dist/esm-es5/nano-global-search-results.entry.js.map +1 -1
  161. package/dist/esm-es5/nano-grid_3.entry.js +1 -1
  162. package/dist/esm-es5/nano-grid_3.entry.js.map +1 -1
  163. package/dist/esm-es5/nano-icon-button.entry.js +2 -2
  164. package/dist/esm-es5/nano-icon-button.entry.js.map +1 -1
  165. package/dist/esm-es5/nano-resize-observe_2.entry.js +1 -1
  166. package/dist/esm-es5/nano-resize-observe_2.entry.js.map +1 -1
  167. package/dist/esm-es5/nano-slides.entry.js +2 -2
  168. package/dist/esm-es5/nano-slides.entry.js.map +1 -1
  169. package/dist/esm-es5/nano-sticker.entry.js +1 -1
  170. package/dist/esm-es5/nano-sticker.entry.js.map +1 -1
  171. package/dist/esm-es5/nano-tab-group.entry.js +2 -2
  172. package/dist/esm-es5/nano-tab-group.entry.js.map +1 -1
  173. package/dist/esm-es5/nano-tab.entry.js +2 -2
  174. package/dist/esm-es5/nano-tab.entry.js.map +1 -1
  175. package/dist/esm-es5/nano-tooltip.entry.js +1 -1
  176. package/dist/esm-es5/nano-tooltip.entry.js.map +1 -1
  177. package/dist/nano-components/nano-components.esm.js +1 -1
  178. package/dist/nano-components/nano-components.esm.js.map +1 -1
  179. package/dist/nano-components/nano-components.js +1 -1
  180. package/dist/nano-components/p-0193a282.entry.js +5 -0
  181. package/dist/nano-components/p-0193a282.entry.js.map +1 -0
  182. package/dist/nano-components/p-0320410c.entry.js +5 -0
  183. package/dist/nano-components/p-0320410c.entry.js.map +1 -0
  184. package/dist/nano-components/p-2720ee8f.entry.js +5 -0
  185. package/dist/nano-components/p-2720ee8f.entry.js.map +1 -0
  186. package/dist/nano-components/p-32900c91.entry.js +5 -0
  187. package/dist/nano-components/p-32900c91.entry.js.map +1 -0
  188. package/dist/nano-components/p-33fce1a6.js +5 -0
  189. package/dist/nano-components/p-33fce1a6.js.map +1 -0
  190. package/dist/nano-components/p-371aebe7.system.entry.js +23 -0
  191. package/dist/nano-components/p-371aebe7.system.entry.js.map +1 -0
  192. package/dist/nano-components/p-41899a31.system.entry.js +5 -0
  193. package/dist/nano-components/p-41899a31.system.entry.js.map +1 -0
  194. package/dist/nano-components/p-53957ec6.system.js +5 -0
  195. package/dist/nano-components/{p-e7140887.system.js.map → p-53957ec6.system.js.map} +1 -1
  196. package/dist/nano-components/p-561500f0.system.entry.js +5 -0
  197. package/dist/nano-components/p-561500f0.system.entry.js.map +1 -0
  198. package/dist/nano-components/p-70272eae.js +5 -0
  199. package/dist/nano-components/p-70272eae.js.map +1 -0
  200. package/dist/nano-components/p-755d9227.entry.js +5 -0
  201. package/dist/nano-components/p-755d9227.entry.js.map +1 -0
  202. package/dist/nano-components/p-7bd25494.entry.js +5 -0
  203. package/dist/nano-components/p-7bd25494.entry.js.map +1 -0
  204. package/dist/nano-components/p-7c837460.entry.js +5 -0
  205. package/dist/nano-components/p-7c837460.entry.js.map +1 -0
  206. package/dist/nano-components/{p-93880c28.system.js → p-82e28afd.system.js} +2 -2
  207. package/dist/nano-components/p-82e28afd.system.js.map +1 -0
  208. package/dist/nano-components/p-8378428e.system.js +5 -0
  209. package/dist/nano-components/p-8378428e.system.js.map +1 -0
  210. package/dist/nano-components/p-8df4f125.system.entry.js +5 -0
  211. package/dist/nano-components/p-8df4f125.system.entry.js.map +1 -0
  212. package/dist/nano-components/{p-d0385948.system.entry.js → p-93596c3d.system.entry.js} +2 -2
  213. package/dist/nano-components/p-93596c3d.system.entry.js.map +1 -0
  214. package/dist/nano-components/{p-3e930ac7.entry.js → p-9d9b0b66.entry.js} +2 -2
  215. package/dist/nano-components/p-9d9b0b66.entry.js.map +1 -0
  216. package/dist/nano-components/p-9ffdf6cc.entry.js +5 -0
  217. package/dist/nano-components/{p-222d8095.entry.js.map → p-9ffdf6cc.entry.js.map} +1 -1
  218. package/dist/nano-components/p-a1444980.entry.js +5 -0
  219. package/dist/nano-components/p-a1444980.entry.js.map +1 -0
  220. package/dist/nano-components/p-aa84c727.system.entry.js +5 -0
  221. package/dist/nano-components/p-aa84c727.system.entry.js.map +1 -0
  222. package/dist/nano-components/p-ac5e3775.system.entry.js +5 -0
  223. package/dist/nano-components/p-ac5e3775.system.entry.js.map +1 -0
  224. package/dist/nano-components/p-b85cf493.system.entry.js +5 -0
  225. package/dist/nano-components/{p-e817ab4a.system.entry.js.map → p-b85cf493.system.entry.js.map} +1 -1
  226. package/dist/nano-components/{p-1030797a.entry.js → p-d37e1489.entry.js} +2 -2
  227. package/dist/nano-components/p-d37e1489.entry.js.map +1 -0
  228. package/dist/nano-components/p-d61ae833.system.entry.js +5 -0
  229. package/dist/nano-components/p-d61ae833.system.entry.js.map +1 -0
  230. package/dist/nano-components/p-d93274de.entry.js +5 -0
  231. package/dist/nano-components/p-d93274de.entry.js.map +1 -0
  232. package/dist/nano-components/p-da88981f.entry.js +23 -0
  233. package/dist/nano-components/p-da88981f.entry.js.map +1 -0
  234. package/dist/nano-components/p-e8a913ac.system.entry.js +5 -0
  235. package/dist/nano-components/p-e8a913ac.system.entry.js.map +1 -0
  236. package/dist/nano-components/p-e9a279ee.system.entry.js +5 -0
  237. package/dist/nano-components/p-e9a279ee.system.entry.js.map +1 -0
  238. package/dist/nano-components/p-faba2fc1.system.entry.js +5 -0
  239. package/dist/nano-components/p-faba2fc1.system.entry.js.map +1 -0
  240. package/dist/nano-components/p-ff026352.system.entry.js +5 -0
  241. package/dist/nano-components/p-ff026352.system.entry.js.map +1 -0
  242. package/dist/types/components/date-input/date-input.d.ts +6 -1
  243. package/dist/types/components/icon-button/icon-button.d.ts +2 -0
  244. package/dist/types/components/tabs/tab.d.ts +1 -0
  245. package/dist/types/components.d.ts +20 -0
  246. package/docs-json.json +54 -2
  247. package/package.json +2 -4
  248. package/dist/cjs/ResizeObserver.es-09b81a1b.js +0 -935
  249. package/dist/cjs/ResizeObserver.es-09b81a1b.js.map +0 -1
  250. package/dist/cjs/date-utils-0ae9a12d.js.map +0 -1
  251. package/dist/cjs/global-0d4f3b77.js.map +0 -1
  252. package/dist/cjs/intersection-observer-1822c787.js +0 -987
  253. package/dist/cjs/intersection-observer-1822c787.js.map +0 -1
  254. package/dist/components/ResizeObserver.es.js +0 -933
  255. package/dist/components/ResizeObserver.es.js.map +0 -1
  256. package/dist/components/intersection-observer.js +0 -985
  257. package/dist/components/intersection-observer.js.map +0 -1
  258. package/dist/esm/ResizeObserver.es-724af9fd.js +0 -933
  259. package/dist/esm/ResizeObserver.es-724af9fd.js.map +0 -1
  260. package/dist/esm/date-utils-e4b757ff.js.map +0 -1
  261. package/dist/esm/global-d5ec4d53.js.map +0 -1
  262. package/dist/esm/intersection-observer-dff9fb5b.js +0 -985
  263. package/dist/esm/intersection-observer-dff9fb5b.js.map +0 -1
  264. package/dist/esm-es5/ResizeObserver.es-724af9fd.js +0 -5
  265. package/dist/esm-es5/ResizeObserver.es-724af9fd.js.map +0 -1
  266. package/dist/esm-es5/date-utils-e4b757ff.js +0 -5
  267. package/dist/esm-es5/date-utils-e4b757ff.js.map +0 -1
  268. package/dist/esm-es5/global-d5ec4d53.js.map +0 -1
  269. package/dist/esm-es5/intersection-observer-dff9fb5b.js +0 -5
  270. package/dist/esm-es5/intersection-observer-dff9fb5b.js.map +0 -1
  271. package/dist/nano-components/p-00eaa36a.entry.js +0 -5
  272. package/dist/nano-components/p-00eaa36a.entry.js.map +0 -1
  273. package/dist/nano-components/p-1030797a.entry.js.map +0 -1
  274. package/dist/nano-components/p-11a2dcce.js +0 -5
  275. package/dist/nano-components/p-11a2dcce.js.map +0 -1
  276. package/dist/nano-components/p-1a30dfdd.system.entry.js +0 -5
  277. package/dist/nano-components/p-1a30dfdd.system.entry.js.map +0 -1
  278. package/dist/nano-components/p-222d8095.entry.js +0 -5
  279. package/dist/nano-components/p-241d90eb.system.entry.js +0 -5
  280. package/dist/nano-components/p-241d90eb.system.entry.js.map +0 -1
  281. package/dist/nano-components/p-2c8d7273.entry.js +0 -5
  282. package/dist/nano-components/p-2c8d7273.entry.js.map +0 -1
  283. package/dist/nano-components/p-3093915f.entry.js +0 -5
  284. package/dist/nano-components/p-3093915f.entry.js.map +0 -1
  285. package/dist/nano-components/p-325c1cad.entry.js +0 -5
  286. package/dist/nano-components/p-325c1cad.entry.js.map +0 -1
  287. package/dist/nano-components/p-32f396c0.system.entry.js +0 -5
  288. package/dist/nano-components/p-32f396c0.system.entry.js.map +0 -1
  289. package/dist/nano-components/p-35108e08.entry.js +0 -5
  290. package/dist/nano-components/p-35108e08.entry.js.map +0 -1
  291. package/dist/nano-components/p-3ccb176c.system.entry.js +0 -5
  292. package/dist/nano-components/p-3ccb176c.system.entry.js.map +0 -1
  293. package/dist/nano-components/p-3e930ac7.entry.js.map +0 -1
  294. package/dist/nano-components/p-42cebbfe.system.entry.js +0 -5
  295. package/dist/nano-components/p-42cebbfe.system.entry.js.map +0 -1
  296. package/dist/nano-components/p-5d17cfbb.system.entry.js +0 -23
  297. package/dist/nano-components/p-5d17cfbb.system.entry.js.map +0 -1
  298. package/dist/nano-components/p-5d5ea4ab.system.entry.js +0 -5
  299. package/dist/nano-components/p-5d5ea4ab.system.entry.js.map +0 -1
  300. package/dist/nano-components/p-6722447c.entry.js +0 -5
  301. package/dist/nano-components/p-6722447c.entry.js.map +0 -1
  302. package/dist/nano-components/p-6d138abf.entry.js +0 -5
  303. package/dist/nano-components/p-6d138abf.entry.js.map +0 -1
  304. package/dist/nano-components/p-76d9d1d4.entry.js +0 -5
  305. package/dist/nano-components/p-76d9d1d4.entry.js.map +0 -1
  306. package/dist/nano-components/p-866f083f.system.entry.js +0 -5
  307. package/dist/nano-components/p-866f083f.system.entry.js.map +0 -1
  308. package/dist/nano-components/p-88779174.system.entry.js +0 -5
  309. package/dist/nano-components/p-88779174.system.entry.js.map +0 -1
  310. package/dist/nano-components/p-93880c28.system.js.map +0 -1
  311. package/dist/nano-components/p-97b13ad2.entry.js +0 -5
  312. package/dist/nano-components/p-97b13ad2.entry.js.map +0 -1
  313. package/dist/nano-components/p-b430a9b6.system.js +0 -5
  314. package/dist/nano-components/p-b430a9b6.system.js.map +0 -1
  315. package/dist/nano-components/p-d0385948.system.entry.js.map +0 -1
  316. package/dist/nano-components/p-debd9efc.js +0 -5
  317. package/dist/nano-components/p-debd9efc.js.map +0 -1
  318. package/dist/nano-components/p-e195ab77.system.js +0 -5
  319. package/dist/nano-components/p-e195ab77.system.js.map +0 -1
  320. package/dist/nano-components/p-e7140887.system.js +0 -5
  321. package/dist/nano-components/p-e817ab4a.system.entry.js +0 -5
  322. package/dist/nano-components/p-f5d4d13b.system.js +0 -5
  323. package/dist/nano-components/p-f5d4d13b.system.js.map +0 -1
  324. package/dist/nano-components/p-f66958c1.js +0 -5
  325. package/dist/nano-components/p-f66958c1.js.map +0 -1
  326. package/dist/nano-components/p-f710c763.system.entry.js +0 -5
  327. package/dist/nano-components/p-f710c763.system.entry.js.map +0 -1
  328. package/dist/nano-components/p-f9c7d961.js +0 -5
  329. package/dist/nano-components/p-f9c7d961.js.map +0 -1
  330. package/dist/nano-components/p-ffc2063a.entry.js +0 -23
  331. package/dist/nano-components/p-ffc2063a.entry.js.map +0 -1
  332. package/dist/nano-components/p-fff27907.system.entry.js +0 -5
  333. package/dist/nano-components/p-fff27907.system.entry.js.map +0 -1
@@ -1,933 +0,0 @@
1
- /*!
2
- * Web Components for Nanopore digital Web Apps
3
- */
4
- /**
5
- * A collection of shims that provide minimal functionality of the ES6 collections.
6
- *
7
- * These implementations are not meant to be used outside of the ResizeObserver
8
- * modules as they cover only a limited range of use cases.
9
- */
10
- /* eslint-disable require-jsdoc, valid-jsdoc */
11
- var MapShim = (function () {
12
- if (typeof Map !== 'undefined') {
13
- return Map;
14
- }
15
- /**
16
- * Returns index in provided array that matches the specified key.
17
- *
18
- * @param {Array<Array>} arr
19
- * @param {*} key
20
- * @returns {number}
21
- */
22
- function getIndex(arr, key) {
23
- var result = -1;
24
- arr.some(function (entry, index) {
25
- if (entry[0] === key) {
26
- result = index;
27
- return true;
28
- }
29
- return false;
30
- });
31
- return result;
32
- }
33
- return /** @class */ (function () {
34
- function class_1() {
35
- this.__entries__ = [];
36
- }
37
- Object.defineProperty(class_1.prototype, "size", {
38
- /**
39
- * @returns {boolean}
40
- */
41
- get: function () {
42
- return this.__entries__.length;
43
- },
44
- enumerable: true,
45
- configurable: true
46
- });
47
- /**
48
- * @param {*} key
49
- * @returns {*}
50
- */
51
- class_1.prototype.get = function (key) {
52
- var index = getIndex(this.__entries__, key);
53
- var entry = this.__entries__[index];
54
- return entry && entry[1];
55
- };
56
- /**
57
- * @param {*} key
58
- * @param {*} value
59
- * @returns {void}
60
- */
61
- class_1.prototype.set = function (key, value) {
62
- var index = getIndex(this.__entries__, key);
63
- if (~index) {
64
- this.__entries__[index][1] = value;
65
- }
66
- else {
67
- this.__entries__.push([key, value]);
68
- }
69
- };
70
- /**
71
- * @param {*} key
72
- * @returns {void}
73
- */
74
- class_1.prototype.delete = function (key) {
75
- var entries = this.__entries__;
76
- var index = getIndex(entries, key);
77
- if (~index) {
78
- entries.splice(index, 1);
79
- }
80
- };
81
- /**
82
- * @param {*} key
83
- * @returns {void}
84
- */
85
- class_1.prototype.has = function (key) {
86
- return !!~getIndex(this.__entries__, key);
87
- };
88
- /**
89
- * @returns {void}
90
- */
91
- class_1.prototype.clear = function () {
92
- this.__entries__.splice(0);
93
- };
94
- /**
95
- * @param {Function} callback
96
- * @param {*} [ctx=null]
97
- * @returns {void}
98
- */
99
- class_1.prototype.forEach = function (callback, ctx) {
100
- if (ctx === void 0) { ctx = null; }
101
- for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
102
- var entry = _a[_i];
103
- callback.call(ctx, entry[1], entry[0]);
104
- }
105
- };
106
- return class_1;
107
- }());
108
- })();
109
-
110
- /**
111
- * Detects whether window and document objects are available in current environment.
112
- */
113
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
114
-
115
- // Returns global object of a current environment.
116
- var global$1 = (function () {
117
- if (typeof global !== 'undefined' && global.Math === Math) {
118
- return global;
119
- }
120
- if (typeof self !== 'undefined' && self.Math === Math) {
121
- return self;
122
- }
123
- if (typeof window !== 'undefined' && window.Math === Math) {
124
- return window;
125
- }
126
- // eslint-disable-next-line no-new-func
127
- return Function('return this')();
128
- })();
129
-
130
- /**
131
- * A shim for the requestAnimationFrame which falls back to the setTimeout if
132
- * first one is not supported.
133
- *
134
- * @returns {number} Requests' identifier.
135
- */
136
- var requestAnimationFrame$1 = (function () {
137
- if (typeof requestAnimationFrame === 'function') {
138
- // It's required to use a bounded function because IE sometimes throws
139
- // an "Invalid calling object" error if rAF is invoked without the global
140
- // object on the left hand side.
141
- return requestAnimationFrame.bind(global$1);
142
- }
143
- return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
144
- })();
145
-
146
- // Defines minimum timeout before adding a trailing call.
147
- var trailingTimeout = 2;
148
- /**
149
- * Creates a wrapper function which ensures that provided callback will be
150
- * invoked only once during the specified delay period.
151
- *
152
- * @param {Function} callback - Function to be invoked after the delay period.
153
- * @param {number} delay - Delay after which to invoke callback.
154
- * @returns {Function}
155
- */
156
- function throttle (callback, delay) {
157
- var leadingCall = false, trailingCall = false, lastCallTime = 0;
158
- /**
159
- * Invokes the original callback function and schedules new invocation if
160
- * the "proxy" was called during current request.
161
- *
162
- * @returns {void}
163
- */
164
- function resolvePending() {
165
- if (leadingCall) {
166
- leadingCall = false;
167
- callback();
168
- }
169
- if (trailingCall) {
170
- proxy();
171
- }
172
- }
173
- /**
174
- * Callback invoked after the specified delay. It will further postpone
175
- * invocation of the original function delegating it to the
176
- * requestAnimationFrame.
177
- *
178
- * @returns {void}
179
- */
180
- function timeoutCallback() {
181
- requestAnimationFrame$1(resolvePending);
182
- }
183
- /**
184
- * Schedules invocation of the original function.
185
- *
186
- * @returns {void}
187
- */
188
- function proxy() {
189
- var timeStamp = Date.now();
190
- if (leadingCall) {
191
- // Reject immediately following calls.
192
- if (timeStamp - lastCallTime < trailingTimeout) {
193
- return;
194
- }
195
- // Schedule new call to be in invoked when the pending one is resolved.
196
- // This is important for "transitions" which never actually start
197
- // immediately so there is a chance that we might miss one if change
198
- // happens amids the pending invocation.
199
- trailingCall = true;
200
- }
201
- else {
202
- leadingCall = true;
203
- trailingCall = false;
204
- setTimeout(timeoutCallback, delay);
205
- }
206
- lastCallTime = timeStamp;
207
- }
208
- return proxy;
209
- }
210
-
211
- // Minimum delay before invoking the update of observers.
212
- var REFRESH_DELAY = 20;
213
- // A list of substrings of CSS properties used to find transition events that
214
- // might affect dimensions of observed elements.
215
- var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
216
- // Check if MutationObserver is available.
217
- var mutationObserverSupported = typeof MutationObserver !== 'undefined';
218
- /**
219
- * Singleton controller class which handles updates of ResizeObserver instances.
220
- */
221
- var ResizeObserverController = /** @class */ (function () {
222
- /**
223
- * Creates a new instance of ResizeObserverController.
224
- *
225
- * @private
226
- */
227
- function ResizeObserverController() {
228
- /**
229
- * Indicates whether DOM listeners have been added.
230
- *
231
- * @private {boolean}
232
- */
233
- this.connected_ = false;
234
- /**
235
- * Tells that controller has subscribed for Mutation Events.
236
- *
237
- * @private {boolean}
238
- */
239
- this.mutationEventsAdded_ = false;
240
- /**
241
- * Keeps reference to the instance of MutationObserver.
242
- *
243
- * @private {MutationObserver}
244
- */
245
- this.mutationsObserver_ = null;
246
- /**
247
- * A list of connected observers.
248
- *
249
- * @private {Array<ResizeObserverSPI>}
250
- */
251
- this.observers_ = [];
252
- this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
253
- this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
254
- }
255
- /**
256
- * Adds observer to observers list.
257
- *
258
- * @param {ResizeObserverSPI} observer - Observer to be added.
259
- * @returns {void}
260
- */
261
- ResizeObserverController.prototype.addObserver = function (observer) {
262
- if (!~this.observers_.indexOf(observer)) {
263
- this.observers_.push(observer);
264
- }
265
- // Add listeners if they haven't been added yet.
266
- if (!this.connected_) {
267
- this.connect_();
268
- }
269
- };
270
- /**
271
- * Removes observer from observers list.
272
- *
273
- * @param {ResizeObserverSPI} observer - Observer to be removed.
274
- * @returns {void}
275
- */
276
- ResizeObserverController.prototype.removeObserver = function (observer) {
277
- var observers = this.observers_;
278
- var index = observers.indexOf(observer);
279
- // Remove observer if it's present in registry.
280
- if (~index) {
281
- observers.splice(index, 1);
282
- }
283
- // Remove listeners if controller has no connected observers.
284
- if (!observers.length && this.connected_) {
285
- this.disconnect_();
286
- }
287
- };
288
- /**
289
- * Invokes the update of observers. It will continue running updates insofar
290
- * it detects changes.
291
- *
292
- * @returns {void}
293
- */
294
- ResizeObserverController.prototype.refresh = function () {
295
- var changesDetected = this.updateObservers_();
296
- // Continue running updates if changes have been detected as there might
297
- // be future ones caused by CSS transitions.
298
- if (changesDetected) {
299
- this.refresh();
300
- }
301
- };
302
- /**
303
- * Updates every observer from observers list and notifies them of queued
304
- * entries.
305
- *
306
- * @private
307
- * @returns {boolean} Returns "true" if any observer has detected changes in
308
- * dimensions of it's elements.
309
- */
310
- ResizeObserverController.prototype.updateObservers_ = function () {
311
- // Collect observers that have active observations.
312
- var activeObservers = this.observers_.filter(function (observer) {
313
- return observer.gatherActive(), observer.hasActive();
314
- });
315
- // Deliver notifications in a separate cycle in order to avoid any
316
- // collisions between observers, e.g. when multiple instances of
317
- // ResizeObserver are tracking the same element and the callback of one
318
- // of them changes content dimensions of the observed target. Sometimes
319
- // this may result in notifications being blocked for the rest of observers.
320
- activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
321
- return activeObservers.length > 0;
322
- };
323
- /**
324
- * Initializes DOM listeners.
325
- *
326
- * @private
327
- * @returns {void}
328
- */
329
- ResizeObserverController.prototype.connect_ = function () {
330
- // Do nothing if running in a non-browser environment or if listeners
331
- // have been already added.
332
- if (!isBrowser || this.connected_) {
333
- return;
334
- }
335
- // Subscription to the "Transitionend" event is used as a workaround for
336
- // delayed transitions. This way it's possible to capture at least the
337
- // final state of an element.
338
- document.addEventListener('transitionend', this.onTransitionEnd_);
339
- window.addEventListener('resize', this.refresh);
340
- if (mutationObserverSupported) {
341
- this.mutationsObserver_ = new MutationObserver(this.refresh);
342
- this.mutationsObserver_.observe(document, {
343
- attributes: true,
344
- childList: true,
345
- characterData: true,
346
- subtree: true
347
- });
348
- }
349
- else {
350
- document.addEventListener('DOMSubtreeModified', this.refresh);
351
- this.mutationEventsAdded_ = true;
352
- }
353
- this.connected_ = true;
354
- };
355
- /**
356
- * Removes DOM listeners.
357
- *
358
- * @private
359
- * @returns {void}
360
- */
361
- ResizeObserverController.prototype.disconnect_ = function () {
362
- // Do nothing if running in a non-browser environment or if listeners
363
- // have been already removed.
364
- if (!isBrowser || !this.connected_) {
365
- return;
366
- }
367
- document.removeEventListener('transitionend', this.onTransitionEnd_);
368
- window.removeEventListener('resize', this.refresh);
369
- if (this.mutationsObserver_) {
370
- this.mutationsObserver_.disconnect();
371
- }
372
- if (this.mutationEventsAdded_) {
373
- document.removeEventListener('DOMSubtreeModified', this.refresh);
374
- }
375
- this.mutationsObserver_ = null;
376
- this.mutationEventsAdded_ = false;
377
- this.connected_ = false;
378
- };
379
- /**
380
- * "Transitionend" event handler.
381
- *
382
- * @private
383
- * @param {TransitionEvent} event
384
- * @returns {void}
385
- */
386
- ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
387
- var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
388
- // Detect whether transition may affect dimensions of an element.
389
- var isReflowProperty = transitionKeys.some(function (key) {
390
- return !!~propertyName.indexOf(key);
391
- });
392
- if (isReflowProperty) {
393
- this.refresh();
394
- }
395
- };
396
- /**
397
- * Returns instance of the ResizeObserverController.
398
- *
399
- * @returns {ResizeObserverController}
400
- */
401
- ResizeObserverController.getInstance = function () {
402
- if (!this.instance_) {
403
- this.instance_ = new ResizeObserverController();
404
- }
405
- return this.instance_;
406
- };
407
- /**
408
- * Holds reference to the controller's instance.
409
- *
410
- * @private {ResizeObserverController}
411
- */
412
- ResizeObserverController.instance_ = null;
413
- return ResizeObserverController;
414
- }());
415
-
416
- /**
417
- * Defines non-writable/enumerable properties of the provided target object.
418
- *
419
- * @param {Object} target - Object for which to define properties.
420
- * @param {Object} props - Properties to be defined.
421
- * @returns {Object} Target object.
422
- */
423
- var defineConfigurable = (function (target, props) {
424
- for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
425
- var key = _a[_i];
426
- Object.defineProperty(target, key, {
427
- value: props[key],
428
- enumerable: false,
429
- writable: false,
430
- configurable: true
431
- });
432
- }
433
- return target;
434
- });
435
-
436
- /**
437
- * Returns the global object associated with provided element.
438
- *
439
- * @param {Object} target
440
- * @returns {Object}
441
- */
442
- var getWindowOf = (function (target) {
443
- // Assume that the element is an instance of Node, which means that it
444
- // has the "ownerDocument" property from which we can retrieve a
445
- // corresponding global object.
446
- var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
447
- // Return the local global object if it's not possible extract one from
448
- // provided element.
449
- return ownerGlobal || global$1;
450
- });
451
-
452
- // Placeholder of an empty content rectangle.
453
- var emptyRect = createRectInit(0, 0, 0, 0);
454
- /**
455
- * Converts provided string to a number.
456
- *
457
- * @param {number|string} value
458
- * @returns {number}
459
- */
460
- function toFloat(value) {
461
- return parseFloat(value) || 0;
462
- }
463
- /**
464
- * Extracts borders size from provided styles.
465
- *
466
- * @param {CSSStyleDeclaration} styles
467
- * @param {...string} positions - Borders positions (top, right, ...)
468
- * @returns {number}
469
- */
470
- function getBordersSize(styles) {
471
- var positions = [];
472
- for (var _i = 1; _i < arguments.length; _i++) {
473
- positions[_i - 1] = arguments[_i];
474
- }
475
- return positions.reduce(function (size, position) {
476
- var value = styles['border-' + position + '-width'];
477
- return size + toFloat(value);
478
- }, 0);
479
- }
480
- /**
481
- * Extracts paddings sizes from provided styles.
482
- *
483
- * @param {CSSStyleDeclaration} styles
484
- * @returns {Object} Paddings box.
485
- */
486
- function getPaddings(styles) {
487
- var positions = ['top', 'right', 'bottom', 'left'];
488
- var paddings = {};
489
- for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
490
- var position = positions_1[_i];
491
- var value = styles['padding-' + position];
492
- paddings[position] = toFloat(value);
493
- }
494
- return paddings;
495
- }
496
- /**
497
- * Calculates content rectangle of provided SVG element.
498
- *
499
- * @param {SVGGraphicsElement} target - Element content rectangle of which needs
500
- * to be calculated.
501
- * @returns {DOMRectInit}
502
- */
503
- function getSVGContentRect(target) {
504
- var bbox = target.getBBox();
505
- return createRectInit(0, 0, bbox.width, bbox.height);
506
- }
507
- /**
508
- * Calculates content rectangle of provided HTMLElement.
509
- *
510
- * @param {HTMLElement} target - Element for which to calculate the content rectangle.
511
- * @returns {DOMRectInit}
512
- */
513
- function getHTMLElementContentRect(target) {
514
- // Client width & height properties can't be
515
- // used exclusively as they provide rounded values.
516
- var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
517
- // By this condition we can catch all non-replaced inline, hidden and
518
- // detached elements. Though elements with width & height properties less
519
- // than 0.5 will be discarded as well.
520
- //
521
- // Without it we would need to implement separate methods for each of
522
- // those cases and it's not possible to perform a precise and performance
523
- // effective test for hidden elements. E.g. even jQuery's ':visible' filter
524
- // gives wrong results for elements with width & height less than 0.5.
525
- if (!clientWidth && !clientHeight) {
526
- return emptyRect;
527
- }
528
- var styles = getWindowOf(target).getComputedStyle(target);
529
- var paddings = getPaddings(styles);
530
- var horizPad = paddings.left + paddings.right;
531
- var vertPad = paddings.top + paddings.bottom;
532
- // Computed styles of width & height are being used because they are the
533
- // only dimensions available to JS that contain non-rounded values. It could
534
- // be possible to utilize the getBoundingClientRect if only it's data wasn't
535
- // affected by CSS transformations let alone paddings, borders and scroll bars.
536
- var width = toFloat(styles.width), height = toFloat(styles.height);
537
- // Width & height include paddings and borders when the 'border-box' box
538
- // model is applied (except for IE).
539
- if (styles.boxSizing === 'border-box') {
540
- // Following conditions are required to handle Internet Explorer which
541
- // doesn't include paddings and borders to computed CSS dimensions.
542
- //
543
- // We can say that if CSS dimensions + paddings are equal to the "client"
544
- // properties then it's either IE, and thus we don't need to subtract
545
- // anything, or an element merely doesn't have paddings/borders styles.
546
- if (Math.round(width + horizPad) !== clientWidth) {
547
- width -= getBordersSize(styles, 'left', 'right') + horizPad;
548
- }
549
- if (Math.round(height + vertPad) !== clientHeight) {
550
- height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
551
- }
552
- }
553
- // Following steps can't be applied to the document's root element as its
554
- // client[Width/Height] properties represent viewport area of the window.
555
- // Besides, it's as well not necessary as the <html> itself neither has
556
- // rendered scroll bars nor it can be clipped.
557
- if (!isDocumentElement(target)) {
558
- // In some browsers (only in Firefox, actually) CSS width & height
559
- // include scroll bars size which can be removed at this step as scroll
560
- // bars are the only difference between rounded dimensions + paddings
561
- // and "client" properties, though that is not always true in Chrome.
562
- var vertScrollbar = Math.round(width + horizPad) - clientWidth;
563
- var horizScrollbar = Math.round(height + vertPad) - clientHeight;
564
- // Chrome has a rather weird rounding of "client" properties.
565
- // E.g. for an element with content width of 314.2px it sometimes gives
566
- // the client width of 315px and for the width of 314.7px it may give
567
- // 314px. And it doesn't happen all the time. So just ignore this delta
568
- // as a non-relevant.
569
- if (Math.abs(vertScrollbar) !== 1) {
570
- width -= vertScrollbar;
571
- }
572
- if (Math.abs(horizScrollbar) !== 1) {
573
- height -= horizScrollbar;
574
- }
575
- }
576
- return createRectInit(paddings.left, paddings.top, width, height);
577
- }
578
- /**
579
- * Checks whether provided element is an instance of the SVGGraphicsElement.
580
- *
581
- * @param {Element} target - Element to be checked.
582
- * @returns {boolean}
583
- */
584
- var isSVGGraphicsElement = (function () {
585
- // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
586
- // interface.
587
- if (typeof SVGGraphicsElement !== 'undefined') {
588
- return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
589
- }
590
- // If it's so, then check that element is at least an instance of the
591
- // SVGElement and that it has the "getBBox" method.
592
- // eslint-disable-next-line no-extra-parens
593
- return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
594
- typeof target.getBBox === 'function'); };
595
- })();
596
- /**
597
- * Checks whether provided element is a document element (<html>).
598
- *
599
- * @param {Element} target - Element to be checked.
600
- * @returns {boolean}
601
- */
602
- function isDocumentElement(target) {
603
- return target === getWindowOf(target).document.documentElement;
604
- }
605
- /**
606
- * Calculates an appropriate content rectangle for provided html or svg element.
607
- *
608
- * @param {Element} target - Element content rectangle of which needs to be calculated.
609
- * @returns {DOMRectInit}
610
- */
611
- function getContentRect(target) {
612
- if (!isBrowser) {
613
- return emptyRect;
614
- }
615
- if (isSVGGraphicsElement(target)) {
616
- return getSVGContentRect(target);
617
- }
618
- return getHTMLElementContentRect(target);
619
- }
620
- /**
621
- * Creates rectangle with an interface of the DOMRectReadOnly.
622
- * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
623
- *
624
- * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
625
- * @returns {DOMRectReadOnly}
626
- */
627
- function createReadOnlyRect(_a) {
628
- var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
629
- // If DOMRectReadOnly is available use it as a prototype for the rectangle.
630
- var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
631
- var rect = Object.create(Constr.prototype);
632
- // Rectangle's properties are not writable and non-enumerable.
633
- defineConfigurable(rect, {
634
- x: x, y: y, width: width, height: height,
635
- top: y,
636
- right: x + width,
637
- bottom: height + y,
638
- left: x
639
- });
640
- return rect;
641
- }
642
- /**
643
- * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
644
- * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
645
- *
646
- * @param {number} x - X coordinate.
647
- * @param {number} y - Y coordinate.
648
- * @param {number} width - Rectangle's width.
649
- * @param {number} height - Rectangle's height.
650
- * @returns {DOMRectInit}
651
- */
652
- function createRectInit(x, y, width, height) {
653
- return { x: x, y: y, width: width, height: height };
654
- }
655
-
656
- /**
657
- * Class that is responsible for computations of the content rectangle of
658
- * provided DOM element and for keeping track of it's changes.
659
- */
660
- var ResizeObservation = /** @class */ (function () {
661
- /**
662
- * Creates an instance of ResizeObservation.
663
- *
664
- * @param {Element} target - Element to be observed.
665
- */
666
- function ResizeObservation(target) {
667
- /**
668
- * Broadcasted width of content rectangle.
669
- *
670
- * @type {number}
671
- */
672
- this.broadcastWidth = 0;
673
- /**
674
- * Broadcasted height of content rectangle.
675
- *
676
- * @type {number}
677
- */
678
- this.broadcastHeight = 0;
679
- /**
680
- * Reference to the last observed content rectangle.
681
- *
682
- * @private {DOMRectInit}
683
- */
684
- this.contentRect_ = createRectInit(0, 0, 0, 0);
685
- this.target = target;
686
- }
687
- /**
688
- * Updates content rectangle and tells whether it's width or height properties
689
- * have changed since the last broadcast.
690
- *
691
- * @returns {boolean}
692
- */
693
- ResizeObservation.prototype.isActive = function () {
694
- var rect = getContentRect(this.target);
695
- this.contentRect_ = rect;
696
- return (rect.width !== this.broadcastWidth ||
697
- rect.height !== this.broadcastHeight);
698
- };
699
- /**
700
- * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
701
- * from the corresponding properties of the last observed content rectangle.
702
- *
703
- * @returns {DOMRectInit} Last observed content rectangle.
704
- */
705
- ResizeObservation.prototype.broadcastRect = function () {
706
- var rect = this.contentRect_;
707
- this.broadcastWidth = rect.width;
708
- this.broadcastHeight = rect.height;
709
- return rect;
710
- };
711
- return ResizeObservation;
712
- }());
713
-
714
- var ResizeObserverEntry = /** @class */ (function () {
715
- /**
716
- * Creates an instance of ResizeObserverEntry.
717
- *
718
- * @param {Element} target - Element that is being observed.
719
- * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
720
- */
721
- function ResizeObserverEntry(target, rectInit) {
722
- var contentRect = createReadOnlyRect(rectInit);
723
- // According to the specification following properties are not writable
724
- // and are also not enumerable in the native implementation.
725
- //
726
- // Property accessors are not being used as they'd require to define a
727
- // private WeakMap storage which may cause memory leaks in browsers that
728
- // don't support this type of collections.
729
- defineConfigurable(this, { target: target, contentRect: contentRect });
730
- }
731
- return ResizeObserverEntry;
732
- }());
733
-
734
- var ResizeObserverSPI = /** @class */ (function () {
735
- /**
736
- * Creates a new instance of ResizeObserver.
737
- *
738
- * @param {ResizeObserverCallback} callback - Callback function that is invoked
739
- * when one of the observed elements changes it's content dimensions.
740
- * @param {ResizeObserverController} controller - Controller instance which
741
- * is responsible for the updates of observer.
742
- * @param {ResizeObserver} callbackCtx - Reference to the public
743
- * ResizeObserver instance which will be passed to callback function.
744
- */
745
- function ResizeObserverSPI(callback, controller, callbackCtx) {
746
- /**
747
- * Collection of resize observations that have detected changes in dimensions
748
- * of elements.
749
- *
750
- * @private {Array<ResizeObservation>}
751
- */
752
- this.activeObservations_ = [];
753
- /**
754
- * Registry of the ResizeObservation instances.
755
- *
756
- * @private {Map<Element, ResizeObservation>}
757
- */
758
- this.observations_ = new MapShim();
759
- if (typeof callback !== 'function') {
760
- throw new TypeError('The callback provided as parameter 1 is not a function.');
761
- }
762
- this.callback_ = callback;
763
- this.controller_ = controller;
764
- this.callbackCtx_ = callbackCtx;
765
- }
766
- /**
767
- * Starts observing provided element.
768
- *
769
- * @param {Element} target - Element to be observed.
770
- * @returns {void}
771
- */
772
- ResizeObserverSPI.prototype.observe = function (target) {
773
- if (!arguments.length) {
774
- throw new TypeError('1 argument required, but only 0 present.');
775
- }
776
- // Do nothing if current environment doesn't have the Element interface.
777
- if (typeof Element === 'undefined' || !(Element instanceof Object)) {
778
- return;
779
- }
780
- if (!(target instanceof getWindowOf(target).Element)) {
781
- throw new TypeError('parameter 1 is not of type "Element".');
782
- }
783
- var observations = this.observations_;
784
- // Do nothing if element is already being observed.
785
- if (observations.has(target)) {
786
- return;
787
- }
788
- observations.set(target, new ResizeObservation(target));
789
- this.controller_.addObserver(this);
790
- // Force the update of observations.
791
- this.controller_.refresh();
792
- };
793
- /**
794
- * Stops observing provided element.
795
- *
796
- * @param {Element} target - Element to stop observing.
797
- * @returns {void}
798
- */
799
- ResizeObserverSPI.prototype.unobserve = function (target) {
800
- if (!arguments.length) {
801
- throw new TypeError('1 argument required, but only 0 present.');
802
- }
803
- // Do nothing if current environment doesn't have the Element interface.
804
- if (typeof Element === 'undefined' || !(Element instanceof Object)) {
805
- return;
806
- }
807
- if (!(target instanceof getWindowOf(target).Element)) {
808
- throw new TypeError('parameter 1 is not of type "Element".');
809
- }
810
- var observations = this.observations_;
811
- // Do nothing if element is not being observed.
812
- if (!observations.has(target)) {
813
- return;
814
- }
815
- observations.delete(target);
816
- if (!observations.size) {
817
- this.controller_.removeObserver(this);
818
- }
819
- };
820
- /**
821
- * Stops observing all elements.
822
- *
823
- * @returns {void}
824
- */
825
- ResizeObserverSPI.prototype.disconnect = function () {
826
- this.clearActive();
827
- this.observations_.clear();
828
- this.controller_.removeObserver(this);
829
- };
830
- /**
831
- * Collects observation instances the associated element of which has changed
832
- * it's content rectangle.
833
- *
834
- * @returns {void}
835
- */
836
- ResizeObserverSPI.prototype.gatherActive = function () {
837
- var _this = this;
838
- this.clearActive();
839
- this.observations_.forEach(function (observation) {
840
- if (observation.isActive()) {
841
- _this.activeObservations_.push(observation);
842
- }
843
- });
844
- };
845
- /**
846
- * Invokes initial callback function with a list of ResizeObserverEntry
847
- * instances collected from active resize observations.
848
- *
849
- * @returns {void}
850
- */
851
- ResizeObserverSPI.prototype.broadcastActive = function () {
852
- // Do nothing if observer doesn't have active observations.
853
- if (!this.hasActive()) {
854
- return;
855
- }
856
- var ctx = this.callbackCtx_;
857
- // Create ResizeObserverEntry instance for every active observation.
858
- var entries = this.activeObservations_.map(function (observation) {
859
- return new ResizeObserverEntry(observation.target, observation.broadcastRect());
860
- });
861
- this.callback_.call(ctx, entries, ctx);
862
- this.clearActive();
863
- };
864
- /**
865
- * Clears the collection of active observations.
866
- *
867
- * @returns {void}
868
- */
869
- ResizeObserverSPI.prototype.clearActive = function () {
870
- this.activeObservations_.splice(0);
871
- };
872
- /**
873
- * Tells whether observer has active observations.
874
- *
875
- * @returns {boolean}
876
- */
877
- ResizeObserverSPI.prototype.hasActive = function () {
878
- return this.activeObservations_.length > 0;
879
- };
880
- return ResizeObserverSPI;
881
- }());
882
-
883
- // Registry of internal observers. If WeakMap is not available use current shim
884
- // for the Map collection as it has all required methods and because WeakMap
885
- // can't be fully polyfilled anyway.
886
- var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
887
- /**
888
- * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
889
- * exposing only those methods and properties that are defined in the spec.
890
- */
891
- var ResizeObserver = /** @class */ (function () {
892
- /**
893
- * Creates a new instance of ResizeObserver.
894
- *
895
- * @param {ResizeObserverCallback} callback - Callback that is invoked when
896
- * dimensions of the observed elements change.
897
- */
898
- function ResizeObserver(callback) {
899
- if (!(this instanceof ResizeObserver)) {
900
- throw new TypeError('Cannot call a class as a function.');
901
- }
902
- if (!arguments.length) {
903
- throw new TypeError('1 argument required, but only 0 present.');
904
- }
905
- var controller = ResizeObserverController.getInstance();
906
- var observer = new ResizeObserverSPI(callback, controller, this);
907
- observers.set(this, observer);
908
- }
909
- return ResizeObserver;
910
- }());
911
- // Expose public methods of ResizeObserver.
912
- [
913
- 'observe',
914
- 'unobserve',
915
- 'disconnect'
916
- ].forEach(function (method) {
917
- ResizeObserver.prototype[method] = function () {
918
- var _a;
919
- return (_a = observers.get(this))[method].apply(_a, arguments);
920
- };
921
- });
922
-
923
- var index = (function () {
924
- // Export existing implementation if available.
925
- if (typeof global$1.ResizeObserver !== 'undefined') {
926
- return global$1.ResizeObserver;
927
- }
928
- return ResizeObserver;
929
- })();
930
-
931
- export { index as i };
932
-
933
- //# sourceMappingURL=ResizeObserver.es.js.map