@nanoporetech-digital/components 5.2.1 → 5.3.1

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 (262) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/{_commonjsHelpers-9f2314fc.js → _commonjsHelpers-29614748.js} +1 -17
  3. package/dist/cjs/_commonjsHelpers-29614748.js.map +1 -0
  4. package/dist/cjs/algoliasearch-lite.esm.browser-992a2eff.js +922 -0
  5. package/dist/cjs/algoliasearch-lite.esm.browser-992a2eff.js.map +1 -0
  6. package/dist/cjs/component-store-21cb4901.js +328 -0
  7. package/dist/cjs/component-store-21cb4901.js.map +1 -0
  8. package/dist/cjs/events-db0a42ee.js +39 -0
  9. package/dist/cjs/events-db0a42ee.js.map +1 -0
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/nano-alert.cjs.entry.js +9 -2
  12. package/dist/cjs/nano-alert.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nano-algolia-filter.cjs.entry.js +1 -2
  14. package/dist/cjs/nano-algolia-filter.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nano-algolia-input.cjs.entry.js +8 -4
  16. package/dist/cjs/nano-algolia-input.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nano-algolia.cjs.entry.js +4 -4
  18. package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nano-components.cjs.js +1 -1
  20. package/dist/cjs/nano-datalist_3.cjs.entry.js +1 -1
  21. package/dist/cjs/nano-dialog.cjs.entry.js +23 -22
  22. package/dist/cjs/nano-dialog.cjs.entry.js.map +1 -1
  23. package/dist/cjs/nano-drawer.cjs.entry.js +169 -111
  24. package/dist/cjs/nano-drawer.cjs.entry.js.map +1 -1
  25. package/dist/cjs/nano-dropdown.cjs.entry.js +16 -2
  26. package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nano-global-nav.cjs.entry.js +5 -6
  28. package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nano-global-search-results.cjs.entry.js +2 -1
  30. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  31. package/dist/cjs/nano-slides.cjs.entry.js +1 -1
  32. package/dist/cjs/nano-sortable.cjs.entry.js +3 -15
  33. package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nano-sticker.cjs.entry.js +16 -9
  35. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  36. package/dist/cjs/nano-tab-group.cjs.entry.js +1 -2
  37. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  38. package/dist/cjs/{nano-table-10a40ab3.js → nano-table-3bfe9c30.js} +9 -10
  39. package/dist/cjs/nano-table-3bfe9c30.js.map +1 -0
  40. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  41. package/dist/cjs/{slot-a448c1a7.js → slot-2dd6ed1d.js} +20 -15
  42. package/dist/cjs/slot-2dd6ed1d.js.map +1 -0
  43. package/dist/cjs/{table.worker-f04588c1.js → table.worker-b3818c42.js} +2 -2
  44. package/dist/cjs/table.worker-b3818c42.js.map +1 -0
  45. package/dist/collection/components/alert/alert.css +15 -0
  46. package/dist/collection/components/alert/alert.js +10 -2
  47. package/dist/collection/components/alert/alert.js.map +1 -1
  48. package/dist/collection/components/algolia/algolia-interface.js.map +1 -1
  49. package/dist/collection/components/algolia/algolia.js +1 -1
  50. package/dist/collection/components/algolia/algolia.js.map +1 -1
  51. package/dist/collection/components/dialog/dialog.css +1 -17
  52. package/dist/collection/components/dialog/dialog.js +31 -20
  53. package/dist/collection/components/dialog/dialog.js.map +1 -1
  54. package/dist/collection/components/drawer/drawer.css +136 -67
  55. package/dist/collection/components/drawer/drawer.js +282 -154
  56. package/dist/collection/components/drawer/drawer.js.map +1 -1
  57. package/dist/collection/components/dropdown/dropdown.css +10 -0
  58. package/dist/collection/components/dropdown/dropdown.js +15 -1
  59. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  60. package/dist/collection/components/global-nav/global-nav.js +2 -2
  61. package/dist/collection/components/global-nav/global-nav.js.map +1 -1
  62. package/dist/collection/components/global-nav/style/global-nav.css +5 -1
  63. package/dist/collection/components/global-search-results/global-search-results.js +2 -1
  64. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  65. package/dist/collection/components/sticker/sticker.js +16 -9
  66. package/dist/collection/components/sticker/sticker.js.map +1 -1
  67. package/dist/collection/components/table/table.css +21 -12
  68. package/dist/collection/components/table/table.js +0 -1
  69. package/dist/collection/components/table/table.js.map +1 -1
  70. package/dist/collection/components/table/table.pin-service.js +6 -6
  71. package/dist/collection/components/table/table.pin-service.js.map +1 -1
  72. package/dist/collection/utils/events.js +17 -0
  73. package/dist/collection/utils/events.js.map +1 -1
  74. package/dist/collection/utils/slot.js +19 -14
  75. package/dist/collection/utils/slot.js.map +1 -1
  76. package/dist/collection/utils/store/get-set.js +6 -12
  77. package/dist/collection/utils/store/get-set.js.map +1 -1
  78. package/dist/components/_commonjsHelpers.js +1 -16
  79. package/dist/components/_commonjsHelpers.js.map +1 -1
  80. package/dist/components/algolia.js +2 -2
  81. package/dist/components/algolia.js.map +1 -1
  82. package/dist/components/algoliasearch-lite.esm.browser.js +920 -0
  83. package/dist/components/algoliasearch-lite.esm.browser.js.map +1 -0
  84. package/dist/components/component-store.js +68 -2001
  85. package/dist/components/component-store.js.map +1 -1
  86. package/dist/components/dropdown.js +16 -2
  87. package/dist/components/dropdown.js.map +1 -1
  88. package/dist/components/events.js +36 -0
  89. package/dist/components/events.js.map +1 -0
  90. package/dist/components/nano-alert.js +10 -2
  91. package/dist/components/nano-alert.js.map +1 -1
  92. package/dist/components/nano-algolia-input.js +6 -1
  93. package/dist/components/nano-algolia-input.js.map +1 -1
  94. package/dist/components/nano-dialog.js +21 -20
  95. package/dist/components/nano-dialog.js.map +1 -1
  96. package/dist/components/nano-drawer.js +205 -122
  97. package/dist/components/nano-drawer.js.map +1 -1
  98. package/dist/components/nano-global-nav.js +4 -4
  99. package/dist/components/nano-global-nav.js.map +1 -1
  100. package/dist/components/nano-global-search-results.js +2 -1
  101. package/dist/components/nano-global-search-results.js.map +1 -1
  102. package/dist/components/nano-sortable.js +1 -13
  103. package/dist/components/nano-sortable.js.map +1 -1
  104. package/dist/components/slot.js +19 -14
  105. package/dist/components/slot.js.map +1 -1
  106. package/dist/components/sticker.js +16 -9
  107. package/dist/components/sticker.js.map +1 -1
  108. package/dist/components/table.js +7 -8
  109. package/dist/components/table.js.map +1 -1
  110. package/dist/esm/{_commonjsHelpers-e401b2a2.js → _commonjsHelpers-04a0e019.js} +2 -17
  111. package/dist/esm/_commonjsHelpers-04a0e019.js.map +1 -0
  112. package/dist/esm/algoliasearch-lite.esm.browser-04891fdc.js +920 -0
  113. package/dist/esm/algoliasearch-lite.esm.browser-04891fdc.js.map +1 -0
  114. package/dist/esm/component-store-65d7e36a.js +326 -0
  115. package/dist/esm/component-store-65d7e36a.js.map +1 -0
  116. package/dist/esm/events-6a805b42.js +36 -0
  117. package/dist/esm/events-6a805b42.js.map +1 -0
  118. package/dist/esm/loader.js +1 -1
  119. package/dist/esm/nano-alert.entry.js +9 -2
  120. package/dist/esm/nano-alert.entry.js.map +1 -1
  121. package/dist/esm/nano-algolia-filter.entry.js +1 -2
  122. package/dist/esm/nano-algolia-filter.entry.js.map +1 -1
  123. package/dist/esm/nano-algolia-input.entry.js +7 -3
  124. package/dist/esm/nano-algolia-input.entry.js.map +1 -1
  125. package/dist/esm/nano-algolia.entry.js +4 -4
  126. package/dist/esm/nano-algolia.entry.js.map +1 -1
  127. package/dist/esm/nano-components.js +1 -1
  128. package/dist/esm/nano-datalist_3.entry.js +1 -1
  129. package/dist/esm/nano-dialog.entry.js +23 -22
  130. package/dist/esm/nano-dialog.entry.js.map +1 -1
  131. package/dist/esm/nano-drawer.entry.js +171 -113
  132. package/dist/esm/nano-drawer.entry.js.map +1 -1
  133. package/dist/esm/nano-dropdown.entry.js +16 -2
  134. package/dist/esm/nano-dropdown.entry.js.map +1 -1
  135. package/dist/esm/nano-global-nav.entry.js +5 -6
  136. package/dist/esm/nano-global-nav.entry.js.map +1 -1
  137. package/dist/esm/nano-global-search-results.entry.js +2 -1
  138. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  139. package/dist/esm/nano-slides.entry.js +1 -1
  140. package/dist/esm/nano-sortable.entry.js +1 -13
  141. package/dist/esm/nano-sortable.entry.js.map +1 -1
  142. package/dist/esm/nano-sticker.entry.js +16 -9
  143. package/dist/esm/nano-sticker.entry.js.map +1 -1
  144. package/dist/esm/nano-tab-group.entry.js +1 -2
  145. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  146. package/dist/esm/{nano-table-2bbcaa8d.js → nano-table-7fb21169.js} +9 -10
  147. package/dist/esm/nano-table-7fb21169.js.map +1 -0
  148. package/dist/esm/nano-table.entry.js +1 -1
  149. package/dist/esm/{slot-a4f6e2af.js → slot-8126e238.js} +20 -15
  150. package/dist/esm/slot-8126e238.js.map +1 -0
  151. package/dist/esm/{table.worker-7324ad73.js → table.worker-a37fa949.js} +2 -2
  152. package/dist/esm/table.worker-a37fa949.js.map +1 -0
  153. package/dist/nano-components/nano-components.css +1 -1
  154. package/dist/nano-components/nano-components.esm.js +1 -1
  155. package/dist/nano-components/nano-components.esm.js.map +1 -1
  156. package/dist/nano-components/p-00a18187.js +5 -0
  157. package/dist/nano-components/p-00a18187.js.map +1 -0
  158. package/dist/nano-components/p-0301e8f7.entry.js +5 -0
  159. package/dist/nano-components/p-0301e8f7.entry.js.map +1 -0
  160. package/dist/nano-components/p-27422aa9.entry.js +5 -0
  161. package/dist/nano-components/{p-6920ad69.entry.js.map → p-27422aa9.entry.js.map} +1 -1
  162. package/dist/nano-components/{p-0697795a.entry.js → p-31c23d6e.entry.js} +2 -2
  163. package/dist/nano-components/p-31c23d6e.entry.js.map +1 -0
  164. package/dist/nano-components/{p-39aec880.entry.js → p-35d3072e.entry.js} +2 -2
  165. package/dist/nano-components/p-487de04d.entry.js.map +1 -1
  166. package/dist/nano-components/p-570d2e50.entry.js +5 -0
  167. package/dist/nano-components/p-570d2e50.entry.js.map +1 -0
  168. package/dist/nano-components/{p-3eb6d833.entry.js → p-5a4b3fa9.entry.js} +2 -2
  169. package/dist/nano-components/p-653ae985.js +5 -0
  170. package/dist/nano-components/p-653ae985.js.map +1 -0
  171. package/dist/nano-components/p-676a4744.entry.js +5 -0
  172. package/dist/nano-components/{p-d0eefd52.entry.js.map → p-676a4744.entry.js.map} +1 -1
  173. package/dist/nano-components/p-8fe51abf.js +5 -0
  174. package/dist/nano-components/{p-4884b65a.entry.js → p-90cd4f56.entry.js} +2 -2
  175. package/dist/nano-components/p-90cd4f56.entry.js.map +1 -0
  176. package/dist/nano-components/p-9bfdee71.js +5 -0
  177. package/dist/nano-components/p-9bfdee71.js.map +1 -0
  178. package/dist/nano-components/p-a8d6ca38.entry.js +5 -0
  179. package/dist/nano-components/p-a8d6ca38.entry.js.map +1 -0
  180. package/dist/nano-components/p-ace7743c.entry.js +5 -0
  181. package/dist/nano-components/p-ace7743c.entry.js.map +1 -0
  182. package/dist/nano-components/p-bdb5b6fc.entry.js +5 -0
  183. package/dist/nano-components/p-bdb5b6fc.entry.js.map +1 -0
  184. package/dist/nano-components/{p-52ae36ec.js → p-c579d9aa.js} +2 -2
  185. package/dist/nano-components/p-cad86fb8.js +5 -0
  186. package/dist/nano-components/p-cad86fb8.js.map +1 -0
  187. package/dist/nano-components/p-dc565459.js +5 -0
  188. package/dist/nano-components/p-dc565459.js.map +1 -0
  189. package/dist/nano-components/p-ede12d35.entry.js +5 -0
  190. package/dist/nano-components/p-ede12d35.entry.js.map +1 -0
  191. package/dist/nano-components/p-f504b1df.entry.js +7 -0
  192. package/dist/nano-components/p-f504b1df.entry.js.map +1 -0
  193. package/dist/nano-components/{p-db370094.entry.js → p-f7a4c62b.entry.js} +2 -2
  194. package/dist/themes/london-calling.css.map +1 -1
  195. package/dist/themes/nanopore.cn.css.map +1 -1
  196. package/dist/themes/nanopore.css.map +1 -1
  197. package/dist/types/components/alert/alert.d.ts +1 -0
  198. package/dist/types/components/algolia/algolia-interface.d.ts +1 -1
  199. package/dist/types/components/algolia/algolia.d.ts +1 -1
  200. package/dist/types/components/dialog/dialog.d.ts +15 -4
  201. package/dist/types/components/drawer/drawer.d.ts +69 -50
  202. package/dist/types/components/sticker/sticker.d.ts +4 -4
  203. package/dist/types/components.d.ts +50 -28
  204. package/dist/types/types/algolia.d.ts +4 -0
  205. package/dist/types/types/scss.vars.d.ts +4 -0
  206. package/dist/types/utils/events.d.ts +7 -0
  207. package/dist/types/utils/slot.d.ts +3 -3
  208. package/docs-json.json +268 -61
  209. package/docs-vscode.json +28 -11
  210. package/hydrate/index.js +1338 -2240
  211. package/package.json +4 -4
  212. package/dist/cjs/_commonjsHelpers-9f2314fc.js.map +0 -1
  213. package/dist/cjs/algoliasearch.umd-689c1560.js +0 -15
  214. package/dist/cjs/algoliasearch.umd-689c1560.js.map +0 -1
  215. package/dist/cjs/component-store-f1dc1276.js +0 -2261
  216. package/dist/cjs/component-store-f1dc1276.js.map +0 -1
  217. package/dist/cjs/nano-table-10a40ab3.js.map +0 -1
  218. package/dist/cjs/slot-a448c1a7.js.map +0 -1
  219. package/dist/cjs/table.worker-f04588c1.js.map +0 -1
  220. package/dist/components/algoliasearch.umd.js +0 -13
  221. package/dist/components/algoliasearch.umd.js.map +0 -1
  222. package/dist/esm/_commonjsHelpers-e401b2a2.js.map +0 -1
  223. package/dist/esm/algoliasearch.umd-4f7efa84.js +0 -13
  224. package/dist/esm/algoliasearch.umd-4f7efa84.js.map +0 -1
  225. package/dist/esm/component-store-c23ebc9c.js +0 -2259
  226. package/dist/esm/component-store-c23ebc9c.js.map +0 -1
  227. package/dist/esm/nano-table-2bbcaa8d.js.map +0 -1
  228. package/dist/esm/slot-a4f6e2af.js.map +0 -1
  229. package/dist/esm/table.worker-7324ad73.js.map +0 -1
  230. package/dist/nano-components/p-0697795a.entry.js.map +0 -1
  231. package/dist/nano-components/p-17b099cc.entry.js +0 -5
  232. package/dist/nano-components/p-17b099cc.entry.js.map +0 -1
  233. package/dist/nano-components/p-1a0b5bc3.js +0 -5
  234. package/dist/nano-components/p-1a0b5bc3.js.map +0 -1
  235. package/dist/nano-components/p-4884b65a.entry.js.map +0 -1
  236. package/dist/nano-components/p-58cf5446.js +0 -5
  237. package/dist/nano-components/p-58cf5446.js.map +0 -1
  238. package/dist/nano-components/p-6920ad69.entry.js +0 -5
  239. package/dist/nano-components/p-69a3e911.js +0 -5
  240. package/dist/nano-components/p-7baa9e14.entry.js +0 -5
  241. package/dist/nano-components/p-7baa9e14.entry.js.map +0 -1
  242. package/dist/nano-components/p-9b533dc3.js +0 -5
  243. package/dist/nano-components/p-9b533dc3.js.map +0 -1
  244. package/dist/nano-components/p-a362bd23.entry.js +0 -5
  245. package/dist/nano-components/p-a362bd23.entry.js.map +0 -1
  246. package/dist/nano-components/p-b04fd7ca.entry.js +0 -5
  247. package/dist/nano-components/p-b04fd7ca.entry.js.map +0 -1
  248. package/dist/nano-components/p-b72df1aa.entry.js +0 -5
  249. package/dist/nano-components/p-b72df1aa.entry.js.map +0 -1
  250. package/dist/nano-components/p-ce5efc3f.entry.js +0 -5
  251. package/dist/nano-components/p-ce5efc3f.entry.js.map +0 -1
  252. package/dist/nano-components/p-d0eefd52.entry.js +0 -5
  253. package/dist/nano-components/p-e2b2b015.entry.js +0 -5
  254. package/dist/nano-components/p-e2b2b015.entry.js.map +0 -1
  255. package/dist/nano-components/p-ed6adde2.js +0 -7
  256. package/dist/nano-components/p-ed6adde2.js.map +0 -1
  257. package/dist/types/dom.ie.d.ts +0 -3
  258. /package/dist/nano-components/{p-39aec880.entry.js.map → p-35d3072e.entry.js.map} +0 -0
  259. /package/dist/nano-components/{p-3eb6d833.entry.js.map → p-5a4b3fa9.entry.js.map} +0 -0
  260. /package/dist/nano-components/{p-52ae36ec.js.map → p-8fe51abf.js.map} +0 -0
  261. /package/dist/nano-components/{p-69a3e911.js.map → p-c579d9aa.js.map} +0 -0
  262. /package/dist/nano-components/{p-db370094.entry.js.map → p-f7a4c62b.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["algoliaFilterCss","AlgoliaFilter","this","filterId","tplWillRnder","Promise","resolve","tplDidRnder","undefined","valueSet","valStr","value","vals","length","split","didValueChange","foundVals","setFieldValues","internalValue","then","_","valueChanged","nanoFilterChanged","emit","facetName","filterName","operator","appliedFilterChanged","filterChanged","updateContent","tplUpdate","handleFilterChange","indexResults","appliedFilters","foundValue","find","filter","name","values","handleChangeEvent","getFieldValues","outputTo","outputSlot","outputEle","el","templateStr","showFilter","origFilters","writeTask","innerHTML","tplRenderFn","orig","dyn","selected","Object","assign","dynFilters","nanoTplUpdated","fields","querySelectorAll","i","field","type","select","n","options","push","checked","found","disabled","includes","newVal","hasChanged","connectedCallback","templateSlot","querySelector","filterIds","replace","componentWillLoad","storeId","ComponentStore","init","storeMethod","globalStoreMethod","componentDidLoad","render","h","Host","class","ref","div","Wormhole"],"sources":["./src/components/algolia/algolia-filter.scss?tag=nano-algolia-filter&encapsulation=shadow","./src/components/algolia/algolia-filter.tsx"],"sourcesContent":[":host {\n display: none;\n\n ::slotted([slot='filter-template']) {\n display: none !important;\n }\n}\n\n:host(.show-filter) {\n display: block;\n}\n","import {\n Component,\n h,\n Element,\n Host,\n Prop,\n Watch,\n State,\n EventEmitter,\n Event,\n writeTask,\n Listen,\n} from '@stencil/core';\nimport {\n ComponentStore,\n StorageMethods,\n} from '../../utils/store/component-store';\nimport {\n SearchChangeEvent,\n Wormhole,\n WormholeConsumerConstructor,\n} from '../algolia/algolia-data';\nimport type {\n IndexResult,\n FilterChangeEventDetail,\n AlgoliaFacet,\n} from '../../interface';\n\n/**\n * Displays and syncs algolia filters\n * Must be nested within an nano-algolia component.\n * @slot filter-template - Template string (format from nano-algolia 'tplEngine' property).\n * @slot output - A placeholder for template output.\n */\n@Component({\n tag: 'nano-algolia-filter',\n shadow: true,\n styleUrl: 'algolia-filter.scss',\n})\nexport class AlgoliaFilter {\n @Element() el: HTMLNanoAlgoliaFilterElement;\n\n private templateStr: string;\n private templateSlot: HTMLElement;\n private outputSlot: HTMLElement;\n private outputEle: HTMLElement;\n private filterId: string = null;\n private tplDidRnder;\n private tplWillRnder = new Promise((resolve) => {\n this.tplDidRnder = resolve;\n });\n\n @State() changeEvent: SearchChangeEvent;\n @State() internalValue: Array<string> = [undefined];\n @State() showFilter: boolean = false;\n @State() indexResults: IndexResult = null;\n @State() filterChanged: string = null;\n @State() facets: AlgoliaFacet;\n @State() tplRenderFn: (...args: any[]) => string;\n @State() globalStoreMethod: StorageMethods;\n\n /**\n * Name of this filter - must match an appropriate algolia facet on a parent nano-algolia index to display\n */\n @Prop() filterName: string = null;\n\n /**\n * Set values of this filter. Will result in form elements being selected. '|' delimited string or array.\n */\n @Prop({ mutable: true }) value: string | Array<string> = '';\n\n /**\n * The internal operator joining filter values.\n */\n @Prop() operator: 'or' | 'and' = 'or';\n\n /**\n * Store search queries (against this ID) to the component store.\n * Use in conjunction with storeMethod\n */\n @Prop() storeId?: string;\n\n /**\n * The method of storage.\n * Either session storage, url hash (after the '#') or url query (after the '?').\n */\n @Prop() storeMethod: StorageMethods = 'session';\n\n /**\n * Emitted when the filter value changes\n */\n @Event() nanoFilterChanged!: EventEmitter<FilterChangeEventDetail>;\n\n /**\n * Emitted when templates are updated\n */\n @Event() nanoTplUpdated!: EventEmitter<HTMLNanoAlgoliaFilterElement>;\n\n // Public facing. When changed attempts to 'check' any relevant fields in the template.\n @Watch('value')\n valueSet() {\n const valStr = this.value as string;\n let vals;\n\n if (typeof valStr === 'string')\n vals = valStr.length ? valStr.split('|') : [];\n else vals = this.value as Array<string>;\n\n if (this.didValueChange(vals)) {\n const foundVals = this.setFieldValues(vals);\n // found in template, set the internal state (this emits the changed event)\n if (foundVals && foundVals.length) this.internalValue = vals;\n // not found in template, wait for it to render.\n else {\n this.tplWillRnder.then((_) => {\n this.setFieldValues(vals);\n this.internalValue = vals;\n });\n }\n }\n }\n\n // Value has changed and is reflected in template. Emit event.\n @Watch('internalValue')\n valueChanged() {\n this.value = this.internalValue;\n this.nanoFilterChanged.emit({\n filterId: this.filterId,\n facetName: this.filterName,\n value: this.internalValue,\n operator: this.operator,\n });\n }\n\n // New facets from algolia. Update template\n @Watch('facets')\n appliedFilterChanged() {\n if (\n this.filterName &&\n this.filterChanged &&\n (this.filterChanged !== this.filterId || this.operator === 'and')\n ) {\n this.updateContent();\n }\n }\n\n @Watch('tplRenderFn')\n tplUpdate() {\n this.updateContent();\n }\n\n @Watch('indexResults')\n handleFilterChange() {\n if (this.indexResults && this.indexResults.appliedFilters) {\n const foundValue = this.indexResults.appliedFilters.find(\n (filter) => filter.name === this.filterName\n );\n if (!foundValue) return;\n\n this.tplWillRnder.then((_) => {\n const foundVals = this.setFieldValues(foundValue.values);\n if (foundVals && foundVals.length) this.value = foundVals;\n });\n }\n this.updateContent();\n }\n\n @Listen('nanoChange')\n @Listen('change')\n handleChangeEvent() {\n const vals = this.getFieldValues();\n if (this.didValueChange(vals)) {\n this.internalValue = vals;\n return true;\n }\n return false;\n }\n\n private updateContent() {\n const outputTo = this.outputSlot || this.outputEle;\n if (!this.el) return;\n\n // there's no template so show output right away\n if (!this.templateStr) this.showFilter = true;\n // there's a template but no index set so hide filters atm\n else if (\n !this.filterName ||\n !outputTo ||\n (this.templateStr &&\n (!this.indexResults || !this.indexResults.origFilters[this.filterName]))\n ) {\n this.showFilter = false;\n }\n\n // there's no output element so nothing else to do\n if (!outputTo) return;\n\n // there's no index set atm but get any static filter values so we can apply them\n if (!this.indexResults) {\n if (this.templateStr) {\n writeTask(() => {\n outputTo.innerHTML = this.tplRenderFn(this.templateStr, {\n orig: {},\n dyn: {},\n selected:\n this.internalValue && this.internalValue.length\n ? this.internalValue\n : this.value,\n });\n if (!this.value || !this.value.length) this.handleChangeEvent();\n });\n } else if (!this.value || !this.value.length) this.handleChangeEvent();\n return;\n }\n\n // everything is in place - render as normal and set values\n writeTask(() => {\n outputTo.innerHTML = this.tplRenderFn(this.templateStr, {\n orig: { ...this.indexResults.origFilters[this.filterName] },\n dyn: { ...this.indexResults.dynFilters[this.filterName] },\n selected:\n this.internalValue && this.internalValue.length\n ? this.internalValue\n : this.value,\n });\n this.tplDidRnder();\n this.setFieldValues();\n\n if (!this.showFilter) this.showFilter = true;\n this.nanoTplUpdated.emit(this.el);\n });\n }\n\n // go through form elements and extract their current value\n private getFieldValues() {\n const values = [];\n const fields = this.outputSlot.querySelectorAll(\n 'input[type=\"checkbox\"], input[type=\"radio\"], select'\n );\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i] as HTMLInputElement;\n\n // If a multi-select, get all selections\n if (field.type === 'select-multiple') {\n const select: HTMLSelectElement = field as any;\n for (let n = 0; n < select.options.length; n++) {\n if (!select.options[n].selected || !select.options[n].value.length)\n continue;\n values.push(select.options[n].value);\n }\n } else if (\n (field.type !== 'checkbox' && field.type !== 'radio') ||\n (field.checked && field.value.length)\n ) {\n values.push(field.value);\n }\n }\n return values;\n }\n\n // go through form elements and select / check them as appropriate\n private setFieldValues(vals?: string[]): void | string[] {\n vals = vals || this.internalValue;\n if (!vals) return;\n\n const found = [];\n const fields = this.outputSlot.querySelectorAll(\n 'input[type=\"checkbox\"], input[type=\"radio\"], select, nano-select, nano-checkbox'\n );\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i] as HTMLInputElement;\n\n if (\n field.disabled ||\n field.type === 'file' ||\n field.type === 'reset' ||\n field.type === 'submit' ||\n field.type === 'button'\n )\n continue;\n\n if (field.type === 'select-multiple' || field.type === 'select-one') {\n const select: HTMLSelectElement = field as any;\n for (let n = 0; n < select.options.length; n++) {\n if (!vals.includes(select.options[n].value))\n select.options[n].selected = false;\n else {\n found.push(select.value);\n select.options[n].selected = true;\n if (field.type === 'select-one')\n select.value = select.options[n].value;\n }\n }\n } else if (\n ['checkbox', 'radio', 'tag', 'segment', 'segment-pill'].includes(\n field.type\n )\n ) {\n if (vals.includes(field.value)) {\n found.push(field.value);\n field.checked = true;\n } else if (!vals.length && !field.value.length) {\n field.checked = true;\n } else field.checked = false;\n }\n }\n return found;\n }\n\n private didValueChange(newVal: Array<string>) {\n if (!!this.internalValue && !newVal) return true;\n if (!this.internalValue && !newVal) return false;\n if (this.internalValue && newVal.length !== this.internalValue.length)\n return true;\n\n let hasChanged = false;\n for (let i = 0; i < newVal.length; i++) {\n if (\n !hasChanged &&\n (!this.internalValue || !this.internalValue.includes(newVal[i]))\n )\n hasChanged = true;\n }\n return hasChanged;\n }\n\n connectedCallback() {\n this.templateSlot = this.el.querySelector('[slot=\"filter-template\"]');\n this.outputSlot = this.el.querySelector('[slot=\"output\"]');\n this.filterId = this.filterName + '_' + filterIds++;\n\n if (!!this.templateSlot) {\n this.templateStr = this.templateSlot.innerHTML;\n this.templateStr = this.templateStr.replace(/=&gt;/gm, '=>');\n }\n }\n\n componentWillLoad() {\n if (this.storeId)\n ComponentStore.init(\n this,\n ['value'],\n this.storeMethod || this.globalStoreMethod,\n this.storeId\n );\n }\n\n componentDidLoad() {\n this.updateContent();\n\n if (\n this.templateStr &&\n this.filterName &&\n this.indexResults &&\n this.indexResults.origFilters[this.filterName]\n )\n this.showFilter = true;\n }\n\n render() {\n return (\n <Host\n class={{\n 'show-filter': this.showFilter,\n }}\n >\n <div ref={(div) => (this.outputEle = div)}>\n <slot name=\"output\" />\n </div>\n </Host>\n );\n }\n}\n\nWormhole(AlgoliaFilter as WormholeConsumerConstructor, [\n 'globalStoreMethod',\n 'indexResults',\n 'filterChanged',\n 'facets',\n 'tplRenderFn',\n 'changeEvent',\n]);\nlet filterIds = 0;\n"],"mappings":";;;+LAAA,MAAMA,EAAmB,gO,MCuCZC,EAAa,M,6HAOhBC,KAAAC,SAAmB,KAEnBD,KAAAE,aAAe,IAAIC,SAASC,IAClCJ,KAAKK,YAAcD,CAAO,I,8CAIY,CAACE,W,gBACV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Y,E"}
1
+ {"version":3,"names":["algoliaFilterCss","AlgoliaFilter","this","filterId","tplWillRnder","Promise","resolve","tplDidRnder","undefined","valueSet","valStr","value","vals","length","split","didValueChange","foundVals","setFieldValues","internalValue","then","_","valueChanged","nanoFilterChanged","emit","facetName","filterName","operator","appliedFilterChanged","filterChanged","updateContent","tplUpdate","handleFilterChange","indexResults","appliedFilters","foundValue","find","filter","name","values","handleChangeEvent","getFieldValues","outputTo","outputSlot","outputEle","el","templateStr","showFilter","origFilters","writeTask","innerHTML","tplRenderFn","orig","dyn","selected","Object","assign","dynFilters","nanoTplUpdated","fields","querySelectorAll","i","field","type","select","n","options","push","checked","found","disabled","includes","newVal","hasChanged","connectedCallback","templateSlot","querySelector","filterIds","replace","componentWillLoad","storeId","ComponentStore","init","storeMethod","globalStoreMethod","componentDidLoad","render","h","Host","class","ref","div","Wormhole"],"sources":["./src/components/algolia/algolia-filter.scss?tag=nano-algolia-filter&encapsulation=shadow","./src/components/algolia/algolia-filter.tsx"],"sourcesContent":[":host {\n display: none;\n\n ::slotted([slot='filter-template']) {\n display: none !important;\n }\n}\n\n:host(.show-filter) {\n display: block;\n}\n","import {\n Component,\n h,\n Element,\n Host,\n Prop,\n Watch,\n State,\n EventEmitter,\n Event,\n writeTask,\n Listen,\n} from '@stencil/core';\nimport {\n ComponentStore,\n StorageMethods,\n} from '../../utils/store/component-store';\nimport {\n SearchChangeEvent,\n Wormhole,\n WormholeConsumerConstructor,\n} from '../algolia/algolia-data';\nimport type {\n IndexResult,\n FilterChangeEventDetail,\n AlgoliaFacet,\n} from '../../interface';\n\n/**\n * Displays and syncs algolia filters\n * Must be nested within an nano-algolia component.\n * @slot filter-template - Template string (format from nano-algolia 'tplEngine' property).\n * @slot output - A placeholder for template output.\n */\n@Component({\n tag: 'nano-algolia-filter',\n shadow: true,\n styleUrl: 'algolia-filter.scss',\n})\nexport class AlgoliaFilter {\n @Element() el: HTMLNanoAlgoliaFilterElement;\n\n private templateStr: string;\n private templateSlot: HTMLElement;\n private outputSlot: HTMLElement;\n private outputEle: HTMLElement;\n private filterId: string = null;\n private tplDidRnder;\n private tplWillRnder = new Promise((resolve) => {\n this.tplDidRnder = resolve;\n });\n\n @State() changeEvent: SearchChangeEvent;\n @State() internalValue: Array<string> = [undefined];\n @State() showFilter: boolean = false;\n @State() indexResults: IndexResult = null;\n @State() filterChanged: string = null;\n @State() facets: AlgoliaFacet;\n @State() tplRenderFn: (...args: any[]) => string;\n @State() globalStoreMethod: StorageMethods;\n\n /**\n * Name of this filter - must match an appropriate algolia facet on a parent nano-algolia index to display\n */\n @Prop() filterName: string = null;\n\n /**\n * Set values of this filter. Will result in form elements being selected. '|' delimited string or array.\n */\n @Prop({ mutable: true }) value: string | Array<string> = '';\n\n /**\n * The internal operator joining filter values.\n */\n @Prop() operator: 'or' | 'and' = 'or';\n\n /**\n * Store search queries (against this ID) to the component store.\n * Use in conjunction with storeMethod\n */\n @Prop() storeId?: string;\n\n /**\n * The method of storage.\n * Either session storage, url hash (after the '#') or url query (after the '?').\n */\n @Prop() storeMethod: StorageMethods = 'session';\n\n /**\n * Emitted when the filter value changes\n */\n @Event() nanoFilterChanged!: EventEmitter<FilterChangeEventDetail>;\n\n /**\n * Emitted when templates are updated\n */\n @Event() nanoTplUpdated!: EventEmitter<HTMLNanoAlgoliaFilterElement>;\n\n // Public facing. When changed attempts to 'check' any relevant fields in the template.\n @Watch('value')\n valueSet() {\n const valStr = this.value as string;\n let vals;\n\n if (typeof valStr === 'string')\n vals = valStr.length ? valStr.split('|') : [];\n else vals = this.value as Array<string>;\n\n if (this.didValueChange(vals)) {\n const foundVals = this.setFieldValues(vals);\n // found in template, set the internal state (this emits the changed event)\n if (foundVals && foundVals.length) this.internalValue = vals;\n // not found in template, wait for it to render.\n else {\n this.tplWillRnder.then((_) => {\n this.setFieldValues(vals);\n this.internalValue = vals;\n });\n }\n }\n }\n\n // Value has changed and is reflected in template. Emit event.\n @Watch('internalValue')\n valueChanged() {\n this.value = this.internalValue;\n this.nanoFilterChanged.emit({\n filterId: this.filterId,\n facetName: this.filterName,\n value: this.internalValue,\n operator: this.operator,\n });\n }\n\n // New facets from algolia. Update template\n @Watch('facets')\n appliedFilterChanged() {\n if (\n this.filterName &&\n this.filterChanged &&\n (this.filterChanged !== this.filterId || this.operator === 'and')\n ) {\n this.updateContent();\n }\n }\n\n @Watch('tplRenderFn')\n tplUpdate() {\n this.updateContent();\n }\n\n @Watch('indexResults')\n handleFilterChange() {\n if (this.indexResults && this.indexResults.appliedFilters) {\n const foundValue = this.indexResults.appliedFilters.find(\n (filter) => filter.name === this.filterName\n );\n if (!foundValue) return;\n\n this.tplWillRnder.then((_) => {\n const foundVals = this.setFieldValues(foundValue.values);\n if (foundVals && foundVals.length) this.value = foundVals;\n });\n }\n this.updateContent();\n }\n\n @Listen('nanoChange')\n @Listen('change')\n handleChangeEvent() {\n const vals = this.getFieldValues();\n if (this.didValueChange(vals)) {\n this.internalValue = vals;\n return true;\n }\n return false;\n }\n\n private updateContent() {\n const outputTo = this.outputSlot || this.outputEle;\n if (!this.el) return;\n\n // there's no template so show output right away\n if (!this.templateStr) this.showFilter = true;\n // there's a template but no index set so hide filters atm\n else if (\n !this.filterName ||\n !outputTo ||\n (this.templateStr &&\n (!this.indexResults || !this.indexResults.origFilters[this.filterName]))\n ) {\n this.showFilter = false;\n }\n\n // there's no output element so nothing else to do\n if (!outputTo) return;\n\n // there's no index set atm but get any static filter values so we can apply them\n if (!this.indexResults) {\n if (this.templateStr) {\n writeTask(() => {\n outputTo.innerHTML = this.tplRenderFn(this.templateStr, {\n orig: {},\n dyn: {},\n selected:\n this.internalValue && this.internalValue.length\n ? this.internalValue\n : this.value,\n });\n if (!this.value || !this.value.length) this.handleChangeEvent();\n });\n } else if (!this.value || !this.value.length) this.handleChangeEvent();\n return;\n }\n\n // everything is in place - render as normal and set values\n writeTask(() => {\n outputTo.innerHTML = this.tplRenderFn(this.templateStr, {\n orig: { ...this.indexResults.origFilters[this.filterName] },\n dyn: { ...this.indexResults.dynFilters[this.filterName] },\n selected:\n this.internalValue && this.internalValue.length\n ? this.internalValue\n : this.value,\n });\n this.tplDidRnder();\n this.setFieldValues();\n\n if (!this.showFilter) this.showFilter = true;\n this.nanoTplUpdated.emit(this.el);\n });\n }\n\n // go through form elements and extract their current value\n private getFieldValues() {\n const values = [];\n const fields = this.outputSlot.querySelectorAll(\n 'input[type=\"checkbox\"], input[type=\"radio\"], select'\n );\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i] as HTMLInputElement;\n\n // If a multi-select, get all selections\n if (field.type === 'select-multiple') {\n const select: HTMLSelectElement = field as any;\n for (let n = 0; n < select.options.length; n++) {\n if (!select.options[n].selected || !select.options[n].value.length)\n continue;\n values.push(select.options[n].value);\n }\n } else if (\n (field.type !== 'checkbox' && field.type !== 'radio') ||\n (field.checked && field.value.length)\n ) {\n values.push(field.value);\n }\n }\n return values;\n }\n\n // go through form elements and select / check them as appropriate\n private setFieldValues(vals?: string[]): void | string[] {\n vals = vals || this.internalValue;\n if (!vals) return;\n\n const found = [];\n const fields = this.outputSlot.querySelectorAll(\n 'input[type=\"checkbox\"], input[type=\"radio\"], select, nano-select, nano-checkbox'\n );\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i] as HTMLInputElement;\n\n if (\n field.disabled ||\n field.type === 'file' ||\n field.type === 'reset' ||\n field.type === 'submit' ||\n field.type === 'button'\n )\n continue;\n\n if (field.type === 'select-multiple' || field.type === 'select-one') {\n const select: HTMLSelectElement = field as any;\n for (let n = 0; n < select.options.length; n++) {\n if (!vals.includes(select.options[n].value))\n select.options[n].selected = false;\n else {\n found.push(select.value);\n select.options[n].selected = true;\n if (field.type === 'select-one')\n select.value = select.options[n].value;\n }\n }\n } else if (\n ['checkbox', 'radio', 'tag', 'segment', 'segment-pill'].includes(\n field.type\n )\n ) {\n if (vals.includes(field.value)) {\n found.push(field.value);\n field.checked = true;\n } else if (!vals.length && !field.value.length) {\n field.checked = true;\n } else field.checked = false;\n }\n }\n return found;\n }\n\n private didValueChange(newVal: Array<string>) {\n if (!!this.internalValue && !newVal) return true;\n if (!this.internalValue && !newVal) return false;\n if (this.internalValue && newVal.length !== this.internalValue.length)\n return true;\n\n let hasChanged = false;\n for (let i = 0; i < newVal.length; i++) {\n if (\n !hasChanged &&\n (!this.internalValue || !this.internalValue.includes(newVal[i]))\n )\n hasChanged = true;\n }\n return hasChanged;\n }\n\n connectedCallback() {\n this.templateSlot = this.el.querySelector('[slot=\"filter-template\"]');\n this.outputSlot = this.el.querySelector('[slot=\"output\"]');\n this.filterId = this.filterName + '_' + filterIds++;\n\n if (!!this.templateSlot) {\n this.templateStr = this.templateSlot.innerHTML;\n this.templateStr = this.templateStr.replace(/=&gt;/gm, '=>');\n }\n }\n\n componentWillLoad() {\n if (this.storeId)\n ComponentStore.init(\n this,\n ['value'],\n this.storeMethod || this.globalStoreMethod,\n this.storeId\n );\n }\n\n componentDidLoad() {\n this.updateContent();\n\n if (\n this.templateStr &&\n this.filterName &&\n this.indexResults &&\n this.indexResults.origFilters[this.filterName]\n )\n this.showFilter = true;\n }\n\n render() {\n return (\n <Host\n class={{\n 'show-filter': this.showFilter,\n }}\n >\n <div ref={(div) => (this.outputEle = div)}>\n <slot name=\"output\" />\n </div>\n </Host>\n );\n }\n}\n\nWormhole(AlgoliaFilter as WormholeConsumerConstructor, [\n 'globalStoreMethod',\n 'indexResults',\n 'filterChanged',\n 'facets',\n 'tplRenderFn',\n 'changeEvent',\n]);\nlet filterIds = 0;\n"],"mappings":";;;uKAAA,MAAMA,EAAmB,gO,MCuCZC,EAAa,M,6HAOhBC,KAAAC,SAAmB,KAEnBD,KAAAE,aAAe,IAAIC,SAASC,IAClCJ,KAAKK,YAAcD,CAAO,I,8CAIY,CAACE,W,gBACV,M,kBACM,K,mBACJ,K,kGAQJ,K,WAK4B,G,cAKxB,K,wCAYK,S,CActCC,WACE,MAAMC,EAASR,KAAKS,MACpB,IAAIC,EAEJ,UAAWF,IAAW,SACp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gBAAkBqD,EAAQ,OAAO,KAC5C,IAAKrE,KAAKgB,gBAAkBqD,EAAQ,OAAO,MAC3C,GAAIrE,KAAKgB,eAAiBqD,EAAO1D,SAAWX,KAAKgB,cAAcL,OAC7D,OAAO,KAET,IAAI2D,EAAa,MACjB,IAAK,IAAIZ,EAAI,EAAGA,EAAIW,EAAO1D,OAAQ+C,IAAK,CACtC,IACGY,KACCtE,KAAKgB,gBAAkBhB,KAAKgB,cAAcoD,SAASC,EAAOX,KAE5DY,EAAa,I,CAEjB,OAAOA,C,CAGTC,oBACEvE,KAAKwE,aAAexE,KAAK0C,GAAG+B,cAAc,4BAC1CzE,KAAKwC,WAAaxC,KAAK0C,GAAG+B,cAAc,mBACxCzE,KAAKC,SAAWD,KAAKuB,WAAa,IAAMmD,IAExC,KAAM1E,KAAKwE,aAAc,CACvBxE,KAAK2C,YAAc3C,KAAKwE,aAAazB,UACrC/C,KAAK2C,YAAc3C,KAAK2C,YAAYgC,QAAQ,UAAW,K,EAI3DC,oBACE,GAAI5E,KAAK6E,QACPC,EAAeC,KACb/E,KACA,CAAC,SACDA,KAAKgF,aAAehF,KAAKiF,kBACzBjF,KAAK6E,Q,CAIXK,mBACElF,KAAK2B,gBAEL,GACE3B,KAAK2C,aACL3C,KAAKuB,YACLvB,KAAK8B,cACL9B,KAAK8B,aAAae,YAAY7C,KAAKuB,YAEnCvB,KAAK4C,WAAa,I,CAGtBuC,SACE,OACEC,EAACC,EAAI,CACHC,MAAO,CACL,cAAetF,KAAK4C,aAGtBwC,EAAA,OAAKG,IAAMC,GAASxF,KAAKyC,UAAY+C,GACnCJ,EAAA,QAAMjD,KAAK,Y,yMAOrBsD,EAAS1F,EAA8C,CACrD,oBACA,eACA,gBACA,SACA,cACA,gBAEF,IAAI2E,EAAY,E"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{r as t,c as i,h as s,a as e,g as h}from"./p-f6a8467a.js";import{a as n}from"./p-257432ff.js";import{d as o}from"./p-7bff5224.js";const r=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--stuck-left:initial;--stuck-right:initial;--stuck-z-index:var(--nano-layer-index-menubar, 10);--top-hide:translateY(-110%);--bottom-hide:translateY(110%);display:block;max-inline-size:100%}:host([sticky]){position:sticky;transition:0.3s ease transform;will-change:min-block-size}:host([sticky][stuck]){inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){transform:var(--bottom-hide)}:host([sticky][index="1"]){z-index:calc(var(--stuck-z-index) + 1)}:host([sticky][index="2"]){z-index:calc(var(--stuck-z-index) + 2)}:host([sticky][index="3"]){z-index:calc(var(--stuck-z-index) + 3)}:host([sticky][index="4"]){z-index:calc(var(--stuck-z-index) + 4)}:host([sticky][index="5"]){z-index:calc(var(--stuck-z-index) + 5)}.sticker{display:inherit;max-inline-size:inherit;inline-size:100%}.sticker:not(.stuck){inline-size:auto !important}.sticker.sticky{transition:0.3s ease all;position:relative}:host([index="1"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 1)}:host([index="2"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 2)}:host([index="3"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 3)}:host([index="4"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 4)}:host([index="5"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 5)}.sticker.stuck{position:fixed;inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index);transform:translateY(0)}:host([placed-top]) .sticker.stuck{inset-block-start:0}:host([placed-bottom]) .sticker.stuck{inset-block-end:0}:host([placed-top]) .sticker.stuck.hide{transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{transform:var(--bottom-hide)}.sticker-content{display:flex;flex-wrap:wrap}';function a(t){return t instanceof Document?window.pageYOffset:t.scrollTop}function c(t,i){const s=i instanceof Document?document.documentElement:i;return n(t,s)}const f=class{constructor(s){t(this,s);this.nanoStuck=i(this,"nanoStuck",7);this.nanoUnstuck=i(this,"nanoUnstuck",7);this.nanoHide=i(this,"nanoHide",7);this.nanoShow=i(this,"nanoShow",7);this.isRtl=false;this.scrollPosCache=0;this.scrollPosThresholdCache=0;this.cacheOffset=0;this.pauseResizeWatcher=false;this.listenForScrollParent=false;this.positions=[];this.pauseHide=false;this.hasBootstrapped=false;this.setupParentResizeListener=()=>{if(!window["ResizeObserver"])return;if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.parentSizeObserver=new ResizeObserver((t=>{for(const i of t){let t,s;if(i.contentRect.height)t=i.contentRect.height;if(i.contentRect.width)s=i.contentRect.width;if(typeof this.quietMode==="object"){if(s<this.quietMode.w||t<this.quietMode.h)this.quietModeIsOn=true;else this.quietModeIsOn=false}if(this.breakPointMin){if(s>this.breakPointMin)this.isSticky=true;else this.isSticky=false}if(this.breakPointMax){if(s<this.breakPointMax)this.isSticky=true;else this.isSticky=false}if(this.isRootSticker&&this.sticker&&this.autoResize)this.sticker.style.width=this.host.scrollWidth+"px"}}));const t=this.scrollParent instanceof Document?this.scrollParent.documentElement:this.scrollParent;if(t)this.parentSizeObserver.observe(t)};this.onStickToDisplayEvent=t=>{if(t.detail.sticker!==this.stickToEle)return;switch(t.type){case"nanoHide":this._offset=0;this.cacheOffset=this.offset;this.offset=0;if(!this.isStuck)this.moveTrigger(false);if(!this.isRootSticker&&this.quietModeIsOn){requestAnimationFrame((()=>{this.stickToEle.style.minHeight=this.stickToEleInitSize.height+(this.host.scrollHeight+(typeof this.cacheOffset==="object"?this.cacheOffset.v:this.cacheOffset))+"px";this.stickToEle.setTriggerPos(this.stickToEleInitSize.height*-1)}))}break;case"nanoShow":this._offset=this.stickToEleInitSize.height;this.offset=this.cacheOffset;this.moveTrigger(true);if(!this.isRootSticker&&this.quietModeIsOn){requestAnimationFrame((()=>{this.stickToEle.style.minHeight="";this.stickToEle.setTriggerPos(0)}))}break;case"nanoStuck":this.stickToEleInitSize=this.stickToEle.getBoundingClientRect();this._offset=this.stickToEleInitSize.height;break}};this.onStickEvent=async t=>{const i=t.detail?t.detail.sticker:null;if(!i||i.position!==this.position)return;const s=await i.getTriggerPos();if(t.type==="nanoStuck"&&i!==this.host&&i.scrollParent===this.host.scrollParent){this.stickerIndex++;if(!this.hideOnNewStickers)return;if(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top){this.multiStickerHide=true;this.stuckCounter++}}if(t.type==="nanoUnstuck"&&i!==this.host&&i.scrollParent===this.host.scrollParent){this.stickerIndex--;if(!this.hideOnNewStickers)return;if(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top){this.stuckCounter--;if(this.stuckCounter<1)this.multiStickerHide=false}}};this.onScroll=()=>{const t=a(this.scrollParent);if(t<this.scrollPosCache){if(!this.positions.includes("bottom"))this.handleScrollTo();else this.handleScrollAway(t)}if(t>this.scrollPosCache){if(!this.positions.includes("bottom"))this.handleScrollAway(t);else this.handleScrollTo()}this.scrollPosCache=t};this.isStuck=false;this.isRootSticker=true;this.hide=false;this.scrollHide=false;this.multiStickerHide=false;this.scrollingTo=false;this.quietModeIsOn=false;this.stuckCounter=0;this.stickerIndex=0;this.stickToEle=undefined;this.triggerPos=undefined;this.trigger=undefined;this._offset=0;this.autoResize=true;this.isSticky=true;this.offset=0;this.position="top";this.quietMode={h:600,w:600};this.hideOnNewStickers=true;this.breakPointMax=null;this.breakPointMin=null;this.scrollParent=undefined;this.stickTo=undefined}async isHiding(){return this.hide}async isSticking(){this.shouldStick();return this.isStuck}async setTriggerPos(t){return this._offset=t}async getTriggerPos(){return this.triggerPos}async pauseHiding(t){return this.pauseHide=t}updateTriggerOffset(){if(!this.trigger||!this.scrollParent||!this.listenForScrollParent)return;this.triggerPos=c(this.trigger,this.scrollParent)}stickerResizeListener(){if(!this.content||!window["ResizeObserver"])return;if(this.contentSizeObserver){this.contentSizeObserver.disconnect();this.contentSizeObserver=undefined}this.contentSizeObserver=new ResizeObserver((t=>{for(const i of t){if(this.pauseResizeWatcher)return;if(i.contentRect.height){if(this.position==="top")this.host.style.height=i.contentRect.height+"px";if(this.position==="bottom")this.host.style.minHeight=i.contentRect.height+"px"}}}));this.contentSizeObserver.observe(this.content)}quietModeChange(){if(this.quietMode==="on")requestAnimationFrame((()=>this.quietModeIsOn=true));else if(this.quietMode==="off")requestAnimationFrame((()=>this.quietModeIsOn=false))}setOffset(){this.trigger.setAttribute("style","");let t,i,s,e;const h=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!h)return;if(typeof this.offset==="object")({v:t,h:i}=this.offset);else t=i=this.offset;if(typeof this._offset==="object")({v:t=s,h:i=e}=this._offset);else s=e=this._offset;const n=s=>{const e=s.match(/(top|bottom)/)?t:i;o(s);h.style[s]=e+"px";if(e)this.host.style.setProperty("--hide-transform-amount",`(110% + ${e}px)`);else this.host.style.setProperty("--hide-transform-amount",null)};const o=h=>{const n=h.match(/(top|bottom)/)?t+s:i+e;this.trigger.style[h]=n*-1+"px";this.trigger.style.position="relative";this.trigger.style.height="1px"};if(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)n("right");if(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)n("left");if(this.positions.includes("top"))n("top");if(this.positions.includes("bottom"))n("bottom")}positionChange(){this.positions=this.position.split("-");this.setOffset()}async stuckChange(){if(this.isStuck){if(this.stickToEle){const t=this.host.children;this.slottedContent=Array.from(t);this.slottedContent.forEach((t=>{this.stickToEle.appendChild(t);t.style.order=this.stickerIndex+""}));this.nanoStuck.emit({sticker:this.stickToEle})}else this.nanoStuck.emit({sticker:this.host})}else{this.scrollHide=false;if(this.stickToEle){this.slottedContent.forEach((t=>{this.host.appendChild(t);t.style.order=""}));this.nanoUnstuck.emit({sticker:this.stickToEle})}else this.nanoUnstuck.emit({sticker:this.host})}}attachScrollListeners(){if(this.quietModeIsOn)this.scrollParent.addEventListener("scroll",this.onScroll,{passive:true,capture:false});else if(this.scrollParent){this.scrollParent.removeEventListener("scroll",this.onScroll);this.moveTrigger(true)}}handleParentEvents(t,i=null){if(!this.listenForScrollParent)return;if(i)this.manageListenersOnParent(false,i);if(this.scrollParent)this.manageListenersOnParent(!this.stickToEle)}stickToEleChange(t,i){if(this.stickToEle){this.stickToEle.addEventListener("nanoHide",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoShow",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoStuck",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoUnstuck",this.onStickToDisplayEvent)}if(i){i.removeEventListener("nanoHide",this.onStickToDisplayEvent);i.removeEventListener("nanoShow",this.onStickToDisplayEvent);i.removeEventListener("nanoStuck",this.onStickToDisplayEvent);i.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent)}}stickToChange(){if(typeof this.stickTo==="string")this.stickToEle=this.scrollParent.querySelector(this.stickTo);else if(!!this.stickTo)this.stickToEle=this.stickTo;else this.stickToEle=undefined}visibilityDecisionHandler(){if(this.multiStickerHide||this.scrollHide)this.hide=true;else this.hide=false}handleHideChange(){if(this.hide)this.nanoHide.emit({sticker:this.host});else this.nanoShow.emit({sticker:this.host})}setupIO(){if(this.io){this.io.disconnect();this.io=undefined}if(!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;let t=this.scrollParent;if(this.scrollParent instanceof Document)t=null;this.io=new window.IntersectionObserver((t=>{if(this.pauseResizeWatcher||!this.isSticky)return;this.shouldStick(t.slice(-1)[0])}),{root:t});this.io.observe(this.trigger)}manageListenersOnParent(t,i){const s=i||this.scrollParent;if(!s)return;if(!t){try{if(this.quietModeIsOn)s.removeEventListener("scroll",this.onScroll);s.removeEventListener("nanoStuck",this.onStickEvent);s.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(t){console.error("Events haven`t been added")}}else{s.addEventListener("nanoStuck",this.onStickEvent);s.addEventListener("nanoUnstuck",this.onStickEvent);if(this.quietModeIsOn)this.attachScrollListeners()}this.setupParentResizeListener()}handleScrollTo(){this.scrollPosThresholdCache=null;if(!this.scrollHide)return;if(this.scrollingTo!==true){this._offset=this.cacheOffset||this._offset}this.scrollingTo=true;this.scrollHide=false}handleScrollAway(t){if(this.scrollHide)return;if(!this.isStuck)return;if(this.scrollingTo!==false){this.cacheOffset=this._offset;this._offset=0}this.scrollingTo=false;if(!this.scrollPosThresholdCache)this.scrollPosThresholdCache=t;else if(!this.pauseHide&&Math.abs(t-this.scrollPosThresholdCache)>100)this.scrollHide=true}moveTrigger(t){if(this.positions.includes("bottom")&&!t||!this.positions.includes("bottom")&&t){this.host.parentNode.insertBefore(this.trigger,this.host)}else this.host.parentNode.insertBefore(this.trigger,this.host.nextSibling)}getScrollParent(){const t=/(auto|scroll)/;const i=(t,s)=>{if(t.parentNode===null){return s}return i(t.parentNode,s.concat([t]))};const s=(t,i)=>getComputedStyle(t,null).getPropertyValue(i);const e=t=>s(t,"overflow")+s(t,"overflow-y")+s(t,"overflow-x");const h=i=>t.test(e(i));const n=document.documentElement.getBoundingClientRect().height;const o=t=>{if(!(typeof t==="object"))return;const s=i(t,[]);return s.find((t=>h(t)&&t.getBoundingClientRect().height!==n))||document};return o(this.host)}shouldStick(t){let i;if(this.positions.includes("top")){if(!this.isRootSticker)i=c(this.trigger,this.scrollParent).top;else i=this.trigger.getBoundingClientRect().top;this.isStuck=i<-1}else if(this.positions.includes("bottom")){i=this.trigger.getBoundingClientRect().top;const s=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=i>s.height+s.top}}bootstrapGurantor(){this.hasBootstrapped=true;this.scrollParent=this.scrollParent||this.getScrollParent();this.isRootSticker=this.scrollParent instanceof Document;this.trigger=this.trigger||document.createElement("div");this.trigger.classList.add("sticker-trigger");this.positionChange();this.moveTrigger(true);this.quietModeChange();this.listenForScrollParent=true;this.handleParentEvents(true);this.stickerIndex=Array.from(this.scrollParent.querySelectorAll("nano-sticker")).filter((t=>t.position===this.position)).findIndex((t=>t===this.host));this.setOffset();this.stickerResizeListener();this.setupParentResizeListener();this.slottedContent=Array.from(this.host.children);this.slottedContent.forEach((t=>{t.style.order=this.stickerIndex+""}));this.updateTriggerOffset();this.stickToChange();this.setupIO();this.onStickToDisplayEvent=o(this.onStickToDisplayEvent,50)}connectedCallback(){this.isRtl=this.host.dir==="rtl"||this.host.ownerDocument.dir==="rtl";document.documentElement.addEventListener("nanoComponentsReady",(()=>{setTimeout((t=>this.bootstrapGurantor()),200)}));setTimeout((t=>{if(!this.hasBootstrapped)this.bootstrapGurantor()}),1e3)}disconnectedCallback(){if(this.io){this.io.disconnect();this.io=undefined}if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.scrollParent=null;this.hasBootstrapped=false}render(){return s(e,{sticky:!this.isRootSticker&&!this.stickToEle&&this.isSticky,hide:this.hide&&this.isStuck,siblings:this.stuckCounter,index:this.stickerIndex,stuck:this.isStuck&&this.isSticky,"placed-bottom":this.positions.includes("bottom"),"placed-top":this.positions.includes("top"),"placed-end":this.positions.includes("end"),"placed-start":this.positions.includes("start")},s("div",{class:{sticker:true,sticky:this.isRootSticker&&this.isSticky,stuck:this.isStuck&&this.isRootSticker&&this.isSticky,hide:this.isRootSticker&&this.hide&&this.isStuck},ref:t=>this.sticker=t},s("div",{class:"sticker-content",ref:t=>this.content=t},s("slot",null))))}get host(){return h(this)}static get watchers(){return{trigger:["updateTriggerOffset"],scrollParent:["updateTriggerOffset","handleParentEvents","setupIO"],position:["stickerResizeListener","positionChange"],quietMode:["quietModeChange"],offset:["setOffset"],_offset:["setOffset"],isStuck:["stuckChange"],quietModeIsOn:["attachScrollListeners"],stickToEle:["handleParentEvents","stickToEleChange"],stickTo:["stickToChange"],multiStickerHide:["visibilityDecisionHandler"],scrollHide:["visibilityDecisionHandler"],hide:["handleHideChange"]}}};f.style=r;export{f as nano_sticker};
5
- //# sourceMappingURL=p-0697795a.entry.js.map
4
+ import{r as t,c as i,h as s,a as e,g as h}from"./p-f6a8467a.js";import{a as n}from"./p-257432ff.js";import{d as o}from"./p-7bff5224.js";const r=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--stuck-left:initial;--stuck-right:initial;--stuck-z-index:var(--nano-layer-index-menubar, 10);--top-hide:translateY(-110%);--bottom-hide:translateY(110%);display:block;max-inline-size:100%}:host([sticky]){position:sticky;transition:0.3s ease transform;will-change:min-block-size}:host([sticky][stuck]){inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){transform:var(--bottom-hide)}:host([sticky][index="1"]){z-index:calc(var(--stuck-z-index) + 1)}:host([sticky][index="2"]){z-index:calc(var(--stuck-z-index) + 2)}:host([sticky][index="3"]){z-index:calc(var(--stuck-z-index) + 3)}:host([sticky][index="4"]){z-index:calc(var(--stuck-z-index) + 4)}:host([sticky][index="5"]){z-index:calc(var(--stuck-z-index) + 5)}.sticker{display:inherit;max-inline-size:inherit;inline-size:100%}.sticker:not(.stuck){inline-size:auto !important}.sticker.sticky{transition:0.3s ease all;position:relative}:host([index="1"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 1)}:host([index="2"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 2)}:host([index="3"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 3)}:host([index="4"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 4)}:host([index="5"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 5)}.sticker.stuck{position:fixed;inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index);transform:translateY(0)}:host([placed-top]) .sticker.stuck{inset-block-start:0}:host([placed-bottom]) .sticker.stuck{inset-block-end:0}:host([placed-top]) .sticker.stuck.hide{transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{transform:var(--bottom-hide)}.sticker-content{display:flex;flex-wrap:wrap}';function a(t){return t instanceof Document?window.pageYOffset:t.scrollTop}function c(t,i){const s=i instanceof Document?document.documentElement:i;return n(t,s)}const f=class{constructor(s){t(this,s);this.nanoStuck=i(this,"nanoStuck",7);this.nanoUnstuck=i(this,"nanoUnstuck",7);this.nanoHide=i(this,"nanoHide",7);this.nanoShow=i(this,"nanoShow",7);this.isRtl=false;this.scrollPosCache=0;this.scrollPosThresholdCache=0;this.cacheOffset=0;this.pauseResizeWatcher=false;this.listenForScrollParent=false;this.positions=[];this.pauseHide=false;this.hasBootstrapped=false;this.setupParentResizeListener=()=>{if(!window["ResizeObserver"])return;if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.parentSizeObserver=new ResizeObserver((t=>{for(const i of t){let t,s;if(i.contentRect.height)t=i.contentRect.height;if(i.contentRect.width)s=i.contentRect.width;if(typeof this.quietMode==="object"){if(s<this.quietMode.w||t<this.quietMode.h)this.quietModeIsOn=true;else this.quietModeIsOn=false}if(this.breakPointMin){if(s>this.breakPointMin)this.isSticky=true;else this.isSticky=false}if(this.breakPointMax){if(s<this.breakPointMax)this.isSticky=true;else this.isSticky=false}if(this.isRootSticker&&this.sticker&&this.autoResize)this.sticker.style.width=this.host.scrollWidth+"px"}}));const t=this.scrollParent instanceof Document?this.scrollParent.documentElement:this.scrollParent;if(t)this.parentSizeObserver.observe(t)};this.onStickToDisplayEvent=t=>{if(t.detail.sticker!==this.stickToEle)return;switch(t.type){case"nanoHide":this._offset=0;this.cacheOffset=this.offset;this.offset=0;if(!this.isStuck)this.moveTrigger(false);if(!this.isRootSticker&&this.quietModeIsOn){requestAnimationFrame((()=>{this.stickToEle.style.minHeight=this.stickToEleInitSize.height+(this.host.scrollHeight+(typeof this.cacheOffset==="object"?this.cacheOffset.v:this.cacheOffset))+"px";this.stickToEle.setTriggerPos(this.stickToEleInitSize.height*-1)}))}break;case"nanoShow":this._offset=this.stickToEleInitSize.height;this.offset=this.cacheOffset;this.moveTrigger(true);if(!this.isRootSticker&&this.quietModeIsOn){requestAnimationFrame((()=>{this.stickToEle.style.minHeight="";this.stickToEle.setTriggerPos(0)}))}break;case"nanoStuck":this.stickToEleInitSize=this.stickToEle.getBoundingClientRect();this._offset=this.stickToEleInitSize.height;break}};this.onStickEvent=async t=>{const i=t.detail?t.detail.sticker:null;if(!i||i.position!==this.position)return;const s=await i.getTriggerPos();if(t.type==="nanoStuck"&&i!==this.host&&i.scrollParent===this.host.scrollParent){this.stickerIndex++;if(!this.hideOnNewStickers)return;if(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top){this.multiStickerHide=true;this.stuckCounter++}}if(t.type==="nanoUnstuck"&&i!==this.host&&i.scrollParent===this.host.scrollParent){this.stickerIndex--;if(!this.hideOnNewStickers)return;if(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top){this.stuckCounter--;if(this.stuckCounter<1)this.multiStickerHide=false}}};this.onScroll=()=>{const t=a(this.scrollParent);if(t<this.scrollPosCache){if(!this.positions.includes("bottom"))this.handleScrollTo();else this.handleScrollAway(t)}if(t>this.scrollPosCache){if(!this.positions.includes("bottom"))this.handleScrollAway(t);else this.handleScrollTo()}this.scrollPosCache=t};this.isStuck=false;this.isRootSticker=true;this.hide=false;this.scrollHide=false;this.multiStickerHide=false;this.scrollingTo=false;this.quietModeIsOn=false;this.stuckCounter=0;this.stickerIndex=0;this.stickToEle=undefined;this.triggerPos=undefined;this.trigger=undefined;this._offset=0;this.autoResize=true;this.isSticky=true;this.offset=0;this.position="top";this.quietMode={h:600,w:600};this.hideOnNewStickers=true;this.breakPointMax=null;this.breakPointMin=null;this.scrollParent=undefined;this.stickTo=undefined}async isHiding(){return this.hide}async isSticking(){this.shouldStick();return this.isStuck}async setTriggerPos(t){return this._offset=t}async getTriggerPos(){return this.triggerPos}async pauseHiding(t){return this.pauseHide=t}updateTriggerOffset(){if(!this.trigger||!this.scrollParent||!this.listenForScrollParent)return;this.triggerPos=c(this.trigger,this.scrollParent)}stickerResizeListener(){if(!this.content||!window["ResizeObserver"])return;if(this.contentSizeObserver){this.contentSizeObserver.disconnect();this.contentSizeObserver=undefined}this.contentSizeObserver=new ResizeObserver((t=>{for(const i of t){if(this.pauseResizeWatcher)return;if(i.contentRect.height){if(this.position==="top")this.host.style.height=i.contentRect.height+"px";if(this.position==="bottom")this.host.style.minHeight=i.contentRect.height+"px"}}}));this.contentSizeObserver.observe(this.content)}quietModeChange(){if(this.quietMode==="on")requestAnimationFrame((()=>this.quietModeIsOn=true));else if(this.quietMode==="off")requestAnimationFrame((()=>this.quietModeIsOn=false))}setOffset(){this.trigger.setAttribute("style","");let t,i,s,e;const h=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!h)return;if(typeof this.offset==="object")({v:t,h:i}=this.offset);else t=i=this.offset;if(typeof this._offset==="object")({v:t=s,h:i=e}=this._offset);else s=e=this._offset;const n=s=>{const e=s.match(/(top|bottom)/)?t:i;o(s);h.style[s]=e+"px";if(e)this.host.style.setProperty("--hide-transform-amount",`(110% + ${e}px)`);else this.host.style.setProperty("--hide-transform-amount",null)};const o=h=>{const n=h.match(/(top|bottom)/)?t+s:i+e;this.trigger.style[h]=n*-1+"px";this.trigger.style.position="relative";this.trigger.style.minHeight="1px";this.trigger.style.maxHeight="1px";this.trigger.style.overflow="hidden"};if(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)n("right");if(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)n("left");if(this.positions.includes("top"))n("top");if(this.positions.includes("bottom"))n("bottom")}positionChange(){this.positions=this.position.split("-");this.setOffset()}async stuckChange(){if(this.isStuck){if(this.stickToEle){const t=this.host.children;this.slottedContent=Array.from(t);this.slottedContent.forEach((t=>{this.stickToEle.appendChild(t);t.style.order=this.stickerIndex+""}));this.nanoStuck.emit({sticker:this.stickToEle})}else this.nanoStuck.emit({sticker:this.host})}else{this.scrollHide=false;if(this.stickToEle){this.slottedContent.forEach((t=>{this.host.appendChild(t);t.style.order=""}));this.nanoUnstuck.emit({sticker:this.stickToEle})}else this.nanoUnstuck.emit({sticker:this.host})}}attachScrollListeners(){if(this.quietModeIsOn)this.scrollParent.addEventListener("scroll",this.onScroll,{passive:true,capture:false});else if(this.scrollParent){this.scrollParent.removeEventListener("scroll",this.onScroll);this.moveTrigger(true)}}handleParentEvents(t,i=null){if(!this.listenForScrollParent)return;if(i)this.manageListenersOnParent(false,i);if(this.scrollParent)this.manageListenersOnParent(!this.stickToEle)}stickToEleChange(t,i){if(this.stickToEle){this.stickToEle.addEventListener("nanoHide",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoShow",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoStuck",this.onStickToDisplayEvent);this.stickToEle.addEventListener("nanoUnstuck",this.onStickToDisplayEvent)}if(i){i.removeEventListener("nanoHide",this.onStickToDisplayEvent);i.removeEventListener("nanoShow",this.onStickToDisplayEvent);i.removeEventListener("nanoStuck",this.onStickToDisplayEvent);i.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent)}}stickToChange(){if(typeof this.stickTo==="string")this.stickToEle=this.scrollParent.querySelector(this.stickTo);else if(!!this.stickTo)this.stickToEle=this.stickTo;else this.stickToEle=undefined}visibilityDecisionHandler(){if(this.multiStickerHide||this.scrollHide)this.hide=true;else this.hide=false}handleHideChange(){if(this.hide)this.nanoHide.emit({sticker:this.host});else this.nanoShow.emit({sticker:this.host})}setupIO(){if(this.io){this.io.disconnect();this.io=undefined}if(!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;let t=this.scrollParent;if(this.scrollParent instanceof Document)t=null;this.io=new window.IntersectionObserver((t=>{if(this.pauseResizeWatcher||!this.isSticky)return;this.shouldStick(t.slice(-1)[0])}),{root:t});this.io.observe(this.trigger)}manageListenersOnParent(t,i){const s=i||this.scrollParent;if(!s)return;if(!t){try{if(this.quietModeIsOn)s.removeEventListener("scroll",this.onScroll);s.removeEventListener("nanoStuck",this.onStickEvent);s.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(t){console.error("Events haven`t been added")}}else{s.addEventListener("nanoStuck",this.onStickEvent);s.addEventListener("nanoUnstuck",this.onStickEvent);if(this.quietModeIsOn)this.attachScrollListeners()}this.setupParentResizeListener()}handleScrollTo(){this.scrollPosThresholdCache=null;if(!this.scrollHide)return;if(this.scrollingTo!==true){this._offset=this.cacheOffset||this._offset}this.scrollingTo=true;this.scrollHide=false}handleScrollAway(t){if(this.scrollHide)return;if(!this.isStuck)return;if(this.scrollingTo!==false){this.cacheOffset=this._offset;this._offset=0}this.scrollingTo=false;if(!this.scrollPosThresholdCache)this.scrollPosThresholdCache=t;else if(!this.pauseHide&&Math.abs(t-this.scrollPosThresholdCache)>100)this.scrollHide=true}moveTrigger(t){if(this.positions.includes("bottom")&&!t||!this.positions.includes("bottom")&&t){this.host.parentNode.insertBefore(this.trigger,this.host)}else this.host.parentNode.insertBefore(this.trigger,this.host.nextSibling)}getScrollParent(){const t=/(auto|scroll)/;const i=(t,s)=>{if(t.parentNode===null){return s}return i(t.parentNode,s.concat([t]))};const s=(t,i)=>getComputedStyle(t,null).getPropertyValue(i);const e=t=>s(t,"overflow")+s(t,"overflow-y")+s(t,"overflow-x");const h=i=>t.test(e(i));const n=document.documentElement.getBoundingClientRect().height;const o=t=>{if(!(typeof t==="object"))return;const s=i(t,[]);return s.find((t=>h(t)&&t.getBoundingClientRect().height!==n))||document};return o(this.host)}shouldStick(t){let i;if(this.positions.includes("top")){if(!this.isRootSticker){i=c(this.trigger,this.scrollParent).top}else{i=this.trigger.getBoundingClientRect().top}this.isStuck=i<-1}else if(this.positions.includes("bottom")){i=this.trigger.getBoundingClientRect().top;const s=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=!t.isIntersecting||i>s.height+s.top}}bootstrapGurantor(){this.hasBootstrapped=true;this.scrollParent=this.scrollParent||this.getScrollParent();this.isRootSticker=this.scrollParent instanceof Document;this.trigger=this.trigger||document.createElement("div");this.trigger.innerHTML="&nbsp;";this.trigger.classList.add("sticker-trigger");this.positionChange();this.moveTrigger(true);this.quietModeChange();this.listenForScrollParent=true;this.handleParentEvents(true);this.stickerIndex=Array.from(this.scrollParent.querySelectorAll("nano-sticker")).filter((t=>t.position===this.position)).findIndex((t=>t===this.host));this.setOffset();this.stickerResizeListener();this.setupParentResizeListener();this.slottedContent=Array.from(this.host.children);this.slottedContent.forEach((t=>{t.style.order=this.stickerIndex+""}));this.updateTriggerOffset();this.stickToChange();this.setupIO();this.onStickToDisplayEvent=o(this.onStickToDisplayEvent,50)}connectedCallback(){this.isRtl=this.host.dir==="rtl"||this.host.ownerDocument.dir==="rtl";document.documentElement.addEventListener("nanoComponentsReady",(()=>{setTimeout((t=>this.bootstrapGurantor()),200)}));setTimeout((t=>{if(!this.hasBootstrapped)this.bootstrapGurantor()}),1e3)}disconnectedCallback(){if(this.io){this.io.disconnect();this.io=undefined}if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.scrollParent=null;this.hasBootstrapped=false}render(){return s(e,{sticky:!this.isRootSticker&&!this.stickToEle&&this.isSticky,hide:this.hide&&this.isStuck,siblings:this.stuckCounter,index:this.stickerIndex,stuck:this.isStuck&&this.isSticky,"placed-bottom":this.positions.includes("bottom"),"placed-top":this.positions.includes("top"),"placed-end":this.positions.includes("end"),"placed-start":this.positions.includes("start")},s("div",{class:{sticker:true,sticky:this.isRootSticker&&this.isSticky,stuck:this.isStuck&&this.isRootSticker&&this.isSticky,hide:this.isRootSticker&&this.hide&&this.isStuck},ref:t=>this.sticker=t},s("div",{class:"sticker-content",ref:t=>this.content=t},s("slot",null))))}get host(){return h(this)}static get watchers(){return{trigger:["updateTriggerOffset"],scrollParent:["updateTriggerOffset","handleParentEvents","setupIO"],position:["stickerResizeListener","positionChange"],quietMode:["quietModeChange"],offset:["setOffset"],_offset:["setOffset"],isStuck:["stuckChange"],quietModeIsOn:["attachScrollListeners"],stickToEle:["handleParentEvents","stickToEleChange"],stickTo:["stickToChange"],multiStickerHide:["visibilityDecisionHandler"],scrollHide:["visibilityDecisionHandler"],hide:["handleHideChange"]}}};f.style=r;export{f as nano_sticker};
5
+ //# sourceMappingURL=p-31c23d6e.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stickerCss","_getScrollTop","ele","Document","window","pageYOffset","scrollTop","_getOffset","parent","parentEle","document","documentElement","getOffset","Sticker","this","isRtl","scrollPosCache","scrollPosThresholdCache","cacheOffset","pauseResizeWatcher","listenForScrollParent","positions","pauseHide","hasBootstrapped","setupParentResizeListener","parentSizeObserver","disconnect","undefined","ResizeObserver","entries","entry","height","width","contentRect","quietMode","w","h","quietModeIsOn","breakPointMin","isSticky","breakPointMax","isRootSticker","sticker","autoResize","style","host","scrollWidth","toWatch","scrollParent","observe","onStickToDisplayEvent","e","detail","stickToEle","type","_offset","offset","isStuck","moveTrigger","requestAnimationFrame","minHeight","stickToEleInitSize","scrollHeight","v","setTriggerPos","getBoundingClientRect","onStickEvent","async","position","incomingTriggerPos","getTriggerPos","stickerIndex","hideOnNewStickers","includes","triggerPos","top","multiStickerHide","stuckCounter","onScroll","y","handleScrollTo","handleScrollAway","hide","shouldStick","pause","updateTriggerOffset","trigger","stickerResizeListener","content","contentSizeObserver","quietModeChange","setOffset","setAttribute","_v","_h","setPos","pos","u","match","setTriggetPos","setProperty","maxHeight","overflow","positionChange","split","children","slottedContent","Array","from","forEach","child","appendChild","order","nanoStuck","emit","scrollHide","nanoUnstuck","attachScrollListeners","addEventListener","passive","capture","removeEventListener","handleParentEvents","_","oldParent","manageListenersOnParent","stickToEleChange","oldEle","stickToChange","stickTo","querySelector","visibilityDecisionHandler","handleHideChange","nanoHide","nanoShow","setupIO","io","root","IntersectionObserver","slice","addEvents","console","error","scrollingTo","currScroll","Math","abs","toInitial","parentNode","insertBefore","nextSibling","getScrollParent","regex","parents","_node","ps","concat","prop","getComputedStyle","getPropertyValue","scroll","test","docHeight","find","data","scrollAmt","parentBounding","rootBounds","isIntersecting","bootstrapGurantor","createElement","innerHTML","classList","add","querySelectorAll","filter","findIndex","debounce","connectedCallback","dir","ownerDocument","setTimeout","disconnectedCallback","render","Host","sticky","siblings","index","stuck","class","ref","div"],"sources":["./src/components/sticker/sticker.scss?tag=nano-sticker&encapsulation=shadow","./src/components/sticker/sticker.tsx"],"sourcesContent":["@import '../../global/style/nano-theme/layers';\n\n:host {\n /**\n * @prop --stuck-left: The left position when your sticker is stuck. This can be useful to force your sticker to fill the viewport for example. Defaults to initial\n * @prop --stuck-right: The right position when your sticker is stuck. This can be useful to force your sticker to fill the viewport for example. Defaults to initial\n * @prop --stuck-z-index: The z-index order to display your sticker. Can be useful when displaying multiple stickers simultaneously. Defaults to #{$layer-index-menubar};\n * @prop --top-hide: This is used for the hide transform animation (e.g. when quiet-mode is on). Defaults to translateY(-110%);\n * @prop --bottom-hide: This is used for the hide transform animation (e.g. when quiet-mode is on). Defaults to translateY(110%);\n */\n\n --stuck-left: initial;\n --stuck-right: initial;\n --stuck-z-index: #{$layer-index-menubar};\n --top-hide: translateY(-110%);\n --bottom-hide: translateY(110%);\n\n display: block;\n max-inline-size: 100%;\n}\n\n:host([sticky]) {\n position: sticky;\n transition: 0.3s ease transform;\n will-change: min-block-size;\n}\n\n:host([sticky][stuck]) {\n inset-inline: var(--stuck-left) var(--stuck-right);\n z-index: var(--stuck-z-index) !important;\n}\n\n:host([sticky][hide][placed-top]) {\n transform: var(--top-hide);\n}\n\n:host([sticky][hide][placed-bottom]) {\n transform: var(--bottom-hide);\n}\n\n:host([sticky][index='1']) {\n z-index: calc(var(--stuck-z-index) + 1);\n}\n\n:host([sticky][index='2']) {\n z-index: calc(var(--stuck-z-index) + 2);\n}\n\n:host([sticky][index='3']) {\n z-index: calc(var(--stuck-z-index) + 3);\n}\n\n:host([sticky][index='4']) {\n z-index: calc(var(--stuck-z-index) + 4);\n}\n\n:host([sticky][index='5']) {\n z-index: calc(var(--stuck-z-index) + 5);\n}\n\n.sticker {\n display: inherit;\n max-inline-size: inherit;\n inline-size: 100%;\n\n &:not(.stuck) {\n inline-size: auto !important;\n }\n\n &.sticky {\n transition: 0.3s ease all;\n position: relative;\n\n :host([index='1']) & {\n z-index: calc(var(--stuck-z-index) + 1);\n }\n\n :host([index='2']) & {\n z-index: calc(var(--stuck-z-index) + 2);\n }\n\n :host([index='3']) & {\n z-index: calc(var(--stuck-z-index) + 3);\n }\n\n :host([index='4']) & {\n z-index: calc(var(--stuck-z-index) + 4);\n }\n\n :host([index='5']) & {\n z-index: calc(var(--stuck-z-index) + 5);\n }\n }\n\n &.stuck {\n position: fixed;\n inset-inline: var(--stuck-left) var(--stuck-right);\n z-index: var(--stuck-z-index);\n transform: translateY(0);\n\n :host([placed-top]) & {\n inset-block-start: 0;\n }\n\n :host([placed-bottom]) & {\n inset-block-end: 0;\n }\n\n &.hide {\n :host([placed-top]) & {\n transform: var(--top-hide);\n }\n\n :host([placed-bottom]) & {\n transform: var(--bottom-hide);\n }\n }\n }\n}\n\n.sticker-content {\n display: flex;\n flex-wrap: wrap;\n}\n","import {\n Component,\n ComponentInterface,\n h,\n Host,\n Prop,\n State,\n Watch,\n Element,\n Event,\n EventEmitter,\n Method,\n} from '@stencil/core';\nimport { getOffset } from '../../utils/dom';\nimport { debounce } from '../../utils/throttle';\n\nfunction _getScrollTop(ele: HTMLElement | Document) {\n return ele instanceof Document ? window.pageYOffset : ele.scrollTop;\n}\n\nfunction _getOffset(ele: HTMLElement, parent: HTMLElement | Document) {\n const parentEle =\n parent instanceof Document ? document.documentElement : parent;\n return getOffset(ele, parentEle);\n}\n\ntype Positions = 'top' | 'bottom' | 'start' | 'end';\n\n/**\n * The Sticker component is a toolbox for 'sticking' items to scrolling containers.\n *\n */\n@Component({\n tag: 'nano-sticker',\n styleUrl: 'sticker.scss',\n shadow: true,\n})\nexport class Sticker implements ComponentInterface {\n private isRtl: boolean = false;\n private io: IntersectionObserver;\n private contentSizeObserver: ResizeObserver;\n private parentSizeObserver: ResizeObserver;\n private sticker: HTMLDivElement;\n private content: HTMLDivElement;\n private scrollPosCache = 0;\n private scrollPosThresholdCache = 0;\n private cacheOffset: number | { v: number; h: number } = 0;\n private slottedContent: Element[];\n private pauseResizeWatcher = false;\n private listenForScrollParent = false;\n private stickToEleInitSize?: DOMRect;\n private positions: Positions[] = [];\n private pauseHide: boolean = false;\n private hasBootstrapped = false;\n\n @Element() host: HTMLNanoStickerElement;\n\n // Internal State\n\n @State() isStuck = false;\n @State() isRootSticker = true;\n @State() hide = false;\n @State() scrollHide = false;\n @State() multiStickerHide = false;\n @State() scrollingTo = false;\n @State() quietModeIsOn = false;\n @State() stuckCounter = 0;\n @State() stickerIndex = 0;\n @State() stickToEle?: HTMLNanoStickerElement;\n @State() triggerPos: { top: number; left: number };\n @State() trigger: HTMLDivElement;\n @State() _offset: number | { v: number; h: number } = 0;\n\n // Public API\n\n /** Only applicable to root stickers. When applied the sticker will grow or shrink to the scrollParent size */\n @Prop() autoResize = true;\n\n /** Manually enable / disabled sticky behaviour */\n @Prop({ mutable: true }) isSticky = true;\n\n /** Distance the item should be stuck from the sticky edge. */\n @Prop({ mutable: true }) offset: number | { v: number; h: number } = 0;\n\n /** The edge of the scroll-parent to stick to */\n @Prop() position: 'top' | 'bottom' = 'top';\n // other opts I'd like one day. 'start' | 'end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'\n\n /** When applied, the sticker will hide when the scroll-parent\n * is scrolling away from the sticker's stuck position and show when scrolling toward it.\n * By default this will apply when the parent is below either the h or w dimensions */\n @Prop() quietMode: 'on' | 'off' | { h: number; w: number } = {\n h: 600,\n w: 600,\n };\n\n /** When applied stickers will hide upon new stickers being stuck to the same position */\n @Prop() hideOnNewStickers = true;\n\n /** The max width of the item to implement sticky behaviour. */\n @Prop() breakPointMax: null | number = null;\n\n /** The min width of the item to implement sticky behaviour. */\n @Prop() breakPointMin: null | number = null;\n\n /** Define which scroll element to listen & stick to.\n * By default, it will find traverse the DOM to find the closest. */\n @Prop({ mutable: true }) scrollParent?: HTMLElement | Document;\n\n /** Upon being stuck, attach the sticker to another sticker element.\n * JS query selector string or DOM element pointing to a `<nano-sticker>` */\n @Prop() stickTo: string | HTMLNanoStickerElement;\n\n // Broadcasted Events\n\n /** Emitted when a sticker is stuck */\n @Event() nanoStuck!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is unstuck */\n @Event() nanoUnstuck!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is hidden */\n @Event() nanoHide!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is showing */\n @Event() nanoShow!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n // Public methods\n\n /**\n * Method to return the visibility status of the sticker\n * @returns boolean\n */\n @Method()\n async isHiding() {\n return this.hide;\n }\n\n /**\n * Method to return the stuck status of the sticker\n * @returns boolean\n */\n @Method()\n async isSticking() {\n this.shouldStick();\n return this.isStuck;\n }\n\n /** @internal */\n @Method()\n async setTriggerPos(offset: number | { v: number; h: number }) {\n return (this._offset = offset);\n }\n\n /** @internal */\n @Method()\n async getTriggerPos() {\n return this.triggerPos;\n }\n\n /** @internal */\n @Method()\n async pauseHiding(pause: boolean) {\n return (this.pauseHide = pause);\n }\n\n // Watchers\n\n /** Keep a note of trigger position. Need this to track sticker order in the DOM */\n @Watch('trigger')\n @Watch('scrollParent')\n updateTriggerOffset() {\n if (!this.trigger || !this.scrollParent || !this.listenForScrollParent)\n return;\n this.triggerPos = _getOffset(this.trigger, this.scrollParent);\n }\n\n /** A root sticker is a fixed element Or this sticker is sticking to another.\n * We need a content resize watcher to make sure we maintain a correct placeholder size in the body */\n @Watch('position')\n stickerResizeListener() {\n if (!this.content || !window['ResizeObserver']) return;\n\n if (this.contentSizeObserver) {\n this.contentSizeObserver.disconnect();\n this.contentSizeObserver = undefined;\n }\n\n this.contentSizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (this.pauseResizeWatcher) return;\n\n if (entry.contentRect.height) {\n if (this.position === 'top')\n this.host.style.height = entry.contentRect.height + 'px';\n if (this.position === 'bottom')\n this.host.style.minHeight = entry.contentRect.height + 'px';\n }\n }\n });\n this.contentSizeObserver.observe(this.content);\n }\n\n @Watch('quietMode')\n quietModeChange() {\n if (this.quietMode === 'on')\n requestAnimationFrame(() => (this.quietModeIsOn = true));\n else if (this.quietMode === 'off')\n requestAnimationFrame(() => (this.quietModeIsOn = false));\n }\n\n /** offset is part of the public API but we also use it to manipulate trigger points */\n @Watch('offset')\n @Watch('_offset')\n setOffset() {\n this.trigger.setAttribute('style', '');\n let v: number, h: number, _v: number, _h: number;\n const sticker: HTMLElement =\n this.isRootSticker || this.stickToEle ? this.sticker : this.host;\n\n if (!sticker) return;\n\n if (typeof this.offset === 'object') ({ v, h } = this.offset);\n else v = h = this.offset;\n\n if (typeof this._offset === 'object') ({ v = _v, h = _h } = this._offset);\n else _v = _h = this._offset;\n\n const setPos = (pos: 'top' | 'bottom' | 'left' | 'right') => {\n const u = pos.match(/(top|bottom)/) ? v : h;\n setTriggetPos(pos);\n sticker.style[pos] = u + 'px';\n if (u)\n this.host.style.setProperty(\n '--hide-transform-amount',\n `(110% + ${u}px)`\n );\n else this.host.style.setProperty('--hide-transform-amount', null);\n };\n\n const setTriggetPos = (pos: 'top' | 'bottom' | 'left' | 'right') => {\n const u = pos.match(/(top|bottom)/) ? v + _v : h + _h;\n this.trigger.style[pos] = u * -1 + 'px';\n this.trigger.style.position = 'relative';\n this.trigger.style.minHeight = '1px';\n this.trigger.style.maxHeight = '1px';\n this.trigger.style.overflow = 'hidden';\n };\n\n if (\n (this.positions.includes('start') && this.isRtl) ||\n (this.positions.includes('end') && !this.isRtl)\n )\n setPos('right');\n\n if (\n (this.positions.includes('end') && this.isRtl) ||\n (this.positions.includes('start') && !this.isRtl)\n )\n setPos('left');\n\n if (this.positions.includes('top')) setPos('top');\n if (this.positions.includes('bottom')) setPos('bottom');\n }\n\n @Watch('position')\n positionChange() {\n this.positions = this.position.split('-') as Positions[];\n this.setOffset();\n }\n\n /** If this sticker is attached to a 'master' sticker (stickToEle),\n * here we move the content of this sticker in and out accordingly */\n @Watch('isStuck')\n async stuckChange() {\n if (this.isStuck) {\n if (this.stickToEle) {\n const content = this.host.children;\n this.slottedContent = Array.from(content);\n\n this.slottedContent.forEach((child: HTMLElement) => {\n this.stickToEle.appendChild(child);\n child.style.order = this.stickerIndex + '';\n });\n\n this.nanoStuck.emit({ sticker: this.stickToEle });\n } else this.nanoStuck.emit({ sticker: this.host });\n } else {\n this.scrollHide = false;\n\n if (this.stickToEle) {\n this.slottedContent.forEach((child: HTMLElement) => {\n this.host.appendChild(child);\n child.style.order = '';\n });\n this.nanoUnstuck.emit({ sticker: this.stickToEle });\n } else this.nanoUnstuck.emit({ sticker: this.host });\n }\n }\n\n /** attach scroll listener. 'hides' stickers when scrolling away from trigger and 'shows' when scrolling toward */\n @Watch('quietModeIsOn')\n attachScrollListeners() {\n if (this.quietModeIsOn)\n this.scrollParent.addEventListener('scroll', this.onScroll, {\n passive: true,\n capture: false,\n });\n else if (this.scrollParent) {\n this.scrollParent.removeEventListener('scroll', this.onScroll);\n this.moveTrigger(true);\n }\n }\n\n /** Add / remove parent scrolling listeners. If there's stickToEle we need to remove them */\n @Watch('scrollParent')\n @Watch('stickToEle')\n handleParentEvents(_, oldParent: null | HTMLElement = null) {\n if (!this.listenForScrollParent) return;\n if (oldParent) this.manageListenersOnParent(false, oldParent);\n if (this.scrollParent) this.manageListenersOnParent(!this.stickToEle);\n }\n\n /** Add remove specific listeners if we're sticking to a sticker.\n * We need to adjust triggers according to the status of the 'master' */\n @Watch('stickToEle')\n stickToEleChange(_, oldEle: null | HTMLNanoStickerElement) {\n if (this.stickToEle) {\n this.stickToEle.addEventListener('nanoHide', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener('nanoShow', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener('nanoStuck', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener(\n 'nanoUnstuck',\n this.onStickToDisplayEvent\n );\n }\n if (oldEle) {\n oldEle.removeEventListener('nanoHide', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoShow', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoStuck', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoUnstuck', this.onStickToDisplayEvent);\n }\n }\n\n /** Find and set the stickToEle from the public, selector string */\n @Watch('stickTo')\n stickToChange() {\n if (typeof this.stickTo === 'string')\n this.stickToEle = this.scrollParent.querySelector(this.stickTo);\n else if (!!this.stickTo) this.stickToEle = this.stickTo;\n else this.stickToEle = undefined;\n }\n\n /** 2 potential criteria for hiding. Multi-stickers or quiet mode. */\n @Watch('multiStickerHide')\n @Watch('scrollHide')\n visibilityDecisionHandler() {\n if (this.multiStickerHide || this.scrollHide) this.hide = true;\n else this.hide = false;\n }\n\n @Watch('hide')\n handleHideChange() {\n if (this.hide) this.nanoHide.emit({ sticker: this.host });\n else this.nanoShow.emit({ sticker: this.host });\n }\n\n @Watch('scrollParent')\n setupIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n if (!this.scrollParent || !this.hasBootstrapped || !this.trigger) return;\n\n this.isRootSticker = this.scrollParent instanceof Document;\n let root = this.scrollParent;\n if (this.scrollParent instanceof Document) root = null;\n\n this.io = new window.IntersectionObserver(\n (_) => {\n if (this.pauseResizeWatcher || !this.isSticky) return;\n this.shouldStick(_.slice(-1)[0]);\n },\n { root: root as HTMLElement }\n );\n\n this.io.observe(this.trigger);\n }\n\n // Private methods / handlers\n\n /** Assesses the public API quitemode and works out if it should be applied atm.\n * If 'small screen', or there is a breakpointmax / min it will add a resizeobserver to conditionally add behaviour */\n private setupParentResizeListener = () => {\n if (!window['ResizeObserver']) return;\n\n if (this.parentSizeObserver) {\n this.parentSizeObserver.disconnect();\n this.parentSizeObserver = undefined;\n }\n\n this.parentSizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n let height: number, width: number;\n if (entry.contentRect.height) height = entry.contentRect.height;\n if (entry.contentRect.width) width = entry.contentRect.width;\n\n if (typeof this.quietMode === 'object') {\n if (width < this.quietMode.w || height < this.quietMode.h)\n this.quietModeIsOn = true;\n else this.quietModeIsOn = false;\n }\n\n if (this.breakPointMin) {\n if (width > this.breakPointMin) this.isSticky = true;\n else this.isSticky = false;\n }\n\n if (this.breakPointMax) {\n if (width < this.breakPointMax) this.isSticky = true;\n else this.isSticky = false;\n }\n\n if (this.isRootSticker && this.sticker && this.autoResize)\n this.sticker.style.width = this.host.scrollWidth + 'px';\n }\n });\n\n const toWatch =\n this.scrollParent instanceof Document\n ? this.scrollParent.documentElement\n : this.scrollParent;\n if (toWatch) this.parentSizeObserver.observe(toWatch);\n };\n\n /** For stickTo stickers. We listen to the events from the 'master' sticker to amend the hide/show trigger\n * Main diffs from root-stickers / non is height being on 'master' */\n private onStickToDisplayEvent = (\n e: CustomEvent<{ sticker: HTMLNanoStickerElement }>\n ) => {\n if (e.detail.sticker !== this.stickToEle) return;\n\n switch (e.type) {\n case 'nanoHide':\n this._offset = 0;\n this.cacheOffset = this.offset;\n this.offset = 0;\n /** trigger moves down, underneath sticker if the main sticker hides */\n if (!this.isStuck) this.moveTrigger(false);\n\n /** If it's an actual 'position: sticky' element, we need to give the sticker an appropriate height.\n * This minimises content jumping around as items are added */\n if (!this.isRootSticker && this.quietModeIsOn) {\n requestAnimationFrame(() => {\n this.stickToEle.style.minHeight =\n this.stickToEleInitSize.height +\n (this.host.scrollHeight +\n (typeof this.cacheOffset === 'object'\n ? this.cacheOffset.v\n : this.cacheOffset)) +\n 'px';\n this.stickToEle.setTriggerPos(this.stickToEleInitSize.height * -1);\n });\n }\n break;\n case 'nanoShow':\n this._offset = this.stickToEleInitSize.height;\n this.offset = this.cacheOffset;\n this.moveTrigger(true);\n\n /** reset master sticker size */\n if (!this.isRootSticker && this.quietModeIsOn) {\n requestAnimationFrame(() => {\n this.stickToEle.style.minHeight = '';\n this.stickToEle.setTriggerPos(0);\n });\n }\n break;\n case 'nanoStuck':\n this.stickToEleInitSize = this.stickToEle.getBoundingClientRect();\n this._offset = this.stickToEleInitSize.height;\n break;\n }\n };\n\n /** Add or removes event listeners / observers on scrolling parent\n * for when the scrolling parent changes, or, this sticker is sticking to another */\n private manageListenersOnParent(\n addEvents: boolean,\n ele?: HTMLElement | Document\n ) {\n const scrollParent = ele || this.scrollParent;\n\n if (!scrollParent) return;\n\n if (!addEvents) {\n try {\n if (this.quietModeIsOn)\n scrollParent.removeEventListener('scroll', this.onScroll);\n scrollParent.removeEventListener('nanoStuck', this.onStickEvent);\n scrollParent.removeEventListener('nanoUnstuck', this.onStickEvent);\n } catch (e) {\n console.error('Events haven`t been added');\n }\n } else {\n scrollParent.addEventListener('nanoStuck', this.onStickEvent);\n scrollParent.addEventListener('nanoUnstuck', this.onStickEvent);\n\n if (this.quietModeIsOn) this.attachScrollListeners();\n }\n this.setupParentResizeListener();\n }\n\n /** Handler applied to scrolling parent. When 'hideOnNewStickers' is true, hide this sticker on subsequent stuck stickers. */\n private onStickEvent = async (\n e: CustomEvent<{ sticker: HTMLNanoStickerElement }>\n ) => {\n const sticker = e.detail ? e.detail.sticker : null;\n if (!sticker || sticker.position !== this.position) return;\n\n const incomingTriggerPos = await sticker.getTriggerPos();\n\n if (\n e.type === 'nanoStuck' &&\n sticker !== this.host &&\n sticker.scrollParent === this.host.scrollParent\n ) {\n this.stickerIndex++;\n\n if (!this.hideOnNewStickers) return;\n\n if (\n (this.positions.includes('top') &&\n this.triggerPos.top < incomingTriggerPos.top) ||\n (this.positions.includes('bottom') &&\n this.triggerPos.top > incomingTriggerPos.top)\n ) {\n this.multiStickerHide = true;\n this.stuckCounter++;\n }\n }\n\n if (\n e.type === 'nanoUnstuck' &&\n sticker !== this.host &&\n sticker.scrollParent === this.host.scrollParent\n ) {\n this.stickerIndex--;\n\n if (!this.hideOnNewStickers) return;\n\n if (\n (this.positions.includes('top') &&\n this.triggerPos.top < incomingTriggerPos.top) ||\n (this.positions.includes('bottom') &&\n this.triggerPos.top > incomingTriggerPos.top)\n ) {\n this.stuckCounter--;\n if (this.stuckCounter < 1) this.multiStickerHide = false;\n }\n }\n };\n\n /** Scroll handler applied to scrolling parent. Only applied when quietmode is on.\n * 'hides' stickers when scrolling over 100px away from trigger and 'shows' when scrolling toward */\n private onScroll = () => {\n const y: number = _getScrollTop(this.scrollParent);\n\n // scrolling up\n if (y < this.scrollPosCache) {\n if (!this.positions.includes('bottom')) this.handleScrollTo();\n else this.handleScrollAway(y);\n }\n\n // scrolling down\n if (y > this.scrollPosCache) {\n if (!this.positions.includes('bottom')) this.handleScrollAway(y);\n else this.handleScrollTo();\n }\n this.scrollPosCache = y;\n };\n\n /** Watch for scroll direction. Only applies when quietmode is on.\n * We need to addjust the position of the trigger when the sticker is hidden */\n private handleScrollTo() {\n this.scrollPosThresholdCache = null;\n if (!this.scrollHide) return;\n\n if (this.scrollingTo !== true) {\n this._offset = this.cacheOffset || this._offset;\n }\n this.scrollingTo = true;\n this.scrollHide = false;\n }\n\n private handleScrollAway(currScroll: number) {\n if (this.scrollHide) return;\n\n if (!this.isStuck) return;\n\n if (this.scrollingTo !== false) {\n this.cacheOffset = this._offset;\n this._offset = 0;\n }\n this.scrollingTo = false;\n\n if (!this.scrollPosThresholdCache)\n this.scrollPosThresholdCache = currScroll;\n else if (\n !this.pauseHide &&\n Math.abs(currScroll - this.scrollPosThresholdCache) > 100\n )\n this.scrollHide = true;\n }\n\n private moveTrigger(toInitial?: boolean) {\n if (\n (this.positions.includes('bottom') && !toInitial) ||\n (!this.positions.includes('bottom') && toInitial)\n ) {\n this.host.parentNode.insertBefore(this.trigger, this.host);\n } else\n this.host.parentNode.insertBefore(this.trigger, this.host.nextSibling);\n }\n\n /**\n * Gets the 'closest' scrolling parent\n * @returns either an element with `overflow: scroll | auto` or the parent Document\n */\n private getScrollParent(): HTMLElement | Document {\n const regex = /(auto|scroll)/;\n const parents = (_node: Node, ps: Node[]) => {\n if (_node.parentNode === null) {\n return ps;\n }\n return parents(_node.parentNode, ps.concat([_node]));\n };\n const style = (_node, prop) =>\n getComputedStyle(_node, null).getPropertyValue(prop);\n const overflow = (_node) =>\n style(_node, 'overflow') +\n style(_node, 'overflow-y') +\n style(_node, 'overflow-x');\n const scroll = (_node) => regex.test(overflow(_node));\n const docHeight = document.documentElement.getBoundingClientRect().height;\n\n const scrollParent = (_node: HTMLElement) => {\n if (!(typeof _node === 'object')) return;\n\n const ps = parents(_node, []);\n return (\n ps.find(\n (ele) =>\n scroll(ele) && ele.getBoundingClientRect().height !== docHeight\n ) || document\n );\n };\n\n return scrollParent(this.host);\n }\n\n private shouldStick(data?: IntersectionObserverEntry) {\n let scrollAmt: number;\n\n if (this.positions.includes('top')) {\n if (!this.isRootSticker) {\n scrollAmt = _getOffset(this.trigger, this.scrollParent).top;\n } else {\n scrollAmt = this.trigger.getBoundingClientRect().top;\n }\n this.isStuck = scrollAmt < -1;\n } else if (this.positions.includes('bottom')) {\n scrollAmt = this.trigger.getBoundingClientRect().top;\n const parentBounding =\n data && data.rootBounds\n ? data.rootBounds\n : (this.scrollParent instanceof Document\n ? document.documentElement\n : this.scrollParent\n ).getBoundingClientRect();\n this.isStuck =\n !data.isIntersecting ||\n scrollAmt > parentBounding.height + parentBounding.top;\n }\n }\n\n private bootstrapGurantor() {\n this.hasBootstrapped = true;\n\n this.scrollParent = this.scrollParent || this.getScrollParent();\n this.isRootSticker = this.scrollParent instanceof Document;\n\n this.trigger = this.trigger || document.createElement('div');\n this.trigger.innerHTML = '&nbsp;';\n this.trigger.classList.add('sticker-trigger');\n\n this.positionChange();\n this.moveTrigger(true);\n this.quietModeChange();\n\n this.listenForScrollParent = true;\n this.handleParentEvents(true);\n\n this.stickerIndex = Array.from(\n this.scrollParent.querySelectorAll('nano-sticker')\n )\n .filter(\n (sticker: HTMLNanoStickerElement) => sticker.position === this.position\n )\n .findIndex((sticker) => sticker === this.host);\n\n this.setOffset();\n this.stickerResizeListener();\n this.setupParentResizeListener();\n\n // bit of a hack ... add default 'order'. Required for 'stickTo' elements.\n this.slottedContent = Array.from(this.host.children);\n this.slottedContent.forEach((child: HTMLElement) => {\n child.style.order = this.stickerIndex + '';\n });\n\n this.updateTriggerOffset();\n this.stickToChange();\n this.setupIO();\n this.onStickToDisplayEvent = debounce(this.onStickToDisplayEvent, 50);\n }\n\n // Stencil methods\n\n connectedCallback() {\n this.isRtl =\n this.host.dir === 'rtl' ||\n (this.host.ownerDocument as Document).dir === 'rtl';\n\n // this is all horrible.... shrug\n document.documentElement.addEventListener('nanoComponentsReady', () => {\n setTimeout((_) => this.bootstrapGurantor(), 200);\n });\n setTimeout((_) => {\n if (!this.hasBootstrapped) this.bootstrapGurantor();\n }, 1000);\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n\n if (this.parentSizeObserver) {\n this.parentSizeObserver.disconnect();\n this.parentSizeObserver = undefined;\n }\n\n this.scrollParent = null;\n this.hasBootstrapped = false;\n }\n\n render() {\n return (\n <Host\n sticky={!this.isRootSticker && !this.stickToEle && this.isSticky}\n hide={this.hide && this.isStuck}\n siblings={this.stuckCounter}\n index={this.stickerIndex}\n stuck={this.isStuck && this.isSticky}\n placed-bottom={this.positions.includes('bottom')}\n placed-top={this.positions.includes('top')}\n placed-end={this.positions.includes('end')}\n placed-start={this.positions.includes('start')}\n >\n <div\n class={{\n sticker: true,\n sticky: this.isRootSticker && this.isSticky,\n stuck: this.isStuck && this.isRootSticker && this.isSticky,\n hide: this.isRootSticker && this.hide && this.isStuck,\n }}\n ref={(div) => (this.sticker = div)}\n >\n <div class=\"sticker-content\" ref={(div) => (this.content = div)}>\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":";;;wIAAA,MAAMA,EAAa,64DCgBnB,SAASC,EAAcC,GACrB,OAAOA,aAAeC,SAAWC,OAAOC,YAAcH,EAAII,SAC5D,CAEA,SAASC,EAAWL,EAAkBM,GACpC,MAAMC,EACJD,aAAkBL,SAAWO,SAASC,gBAAkBH,EAC1D,OAAOI,EAAUV,EAAKO,EACxB,C,MAaaI,EAAO,M,6KACVC,KAAAC,MAAiB,MAMjBD,KAAAE,eAAiB,EACjBF,KAAAG,wBAA0B,EAC1BH,KAAAI,YAAiD,EAEjDJ,KAAAK,mBAAqB,MACrBL,KAAAM,sBAAwB,MAExBN,KAAAO,UAAyB,GACzBP,KAAAQ,UAAqB,MACrBR,KAAAS,gBAAkB,MAqVlBT,KAAAU,0BAA4B,KAClC,IAAKpB,OAAO,kBAAmB,OAE/B,GAAIU,KAAKW,mBAAoB,CAC3BX,KAAKW,mBAAmBC,aACxBZ,KAAKW,mBAAqBE,S,CAG5Bb,KAAKW,mBAAqB,IAAIG,gBAAgBC,IAC5C,IAAK,MAAMC,KAASD,EAAS,CAC3B,IAAIE,EAAgBC,EACpB,GAAIF,EAAMG,YAAYF,OAAQA,EAASD,EAAMG,YAAYF,OACzD,GAAID,EAAMG,YAAYD,MAAOA,EAAQF,EAAMG,YAAYD,MAEvD,UAAWlB,KAAKoB,YAAc,SAAU,CACtC,GAAIF,EAAQlB,KAAKoB,UAAUC,GAAKJ,EAASjB,KAAKoB,UAAUE,EACtDtB,KAAKuB,cAAgB,UAClBvB,KAAKuB,cAAgB,K,CAG5B,GAAIvB,KAAKwB,cAAe,CACtB,GAAIN,EAAQlB,KAAKwB,cAAexB,KAAKyB,SAAW,UAC3CzB,KAAKyB,SAAW,K,CAGvB,GAAIzB,KAAK0B,cAAe,CACtB,GAAIR,EAAQlB,KAAK0B,cAAe1B,KAAKyB,SAAW,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oJ,EAAI,CACHC,QAAS3K,KAAK2B,gBAAkB3B,KAAKuC,YAAcvC,KAAKyB,SACxD2C,KAAMpE,KAAKoE,MAAQpE,KAAK2C,QACxBiI,SAAU5K,KAAK+D,aACf8G,MAAO7K,KAAKyD,aACZqH,MAAO9K,KAAK2C,SAAW3C,KAAKyB,SAAQ,gBACrBzB,KAAKO,UAAUoD,SAAS,UAAS,aACpC3D,KAAKO,UAAUoD,SAAS,OAAM,aAC9B3D,KAAKO,UAAUoD,SAAS,OAAM,eAC5B3D,KAAKO,UAAUoD,SAAS,UAEtCrC,EAAA,OACEyJ,MAAO,CACLnJ,QAAS,KACT+I,OAAQ3K,KAAK2B,eAAiB3B,KAAKyB,SACnCqJ,MAAO9K,KAAK2C,SAAW3C,KAAK2B,eAAiB3B,KAAKyB,SAClD2C,KAAMpE,KAAK2B,eAAiB3B,KAAKoE,MAAQpE,KAAK2C,SAEhDqI,IAAMC,GAASjL,KAAK4B,QAAUqJ,GAE9B3J,EAAA,OAAKyJ,MAAM,kBAAkBC,IAAMC,GAASjL,KAAK0E,QAAUuG,GACzD3J,EAAA,e"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- export{T as nano_table}from"./p-9b533dc3.js";import"./p-f6a8467a.js";import"./p-ee045579.js";import"./p-7bff5224.js";import"./p-9ebbb814.js";
5
- //# sourceMappingURL=p-39aec880.entry.js.map
4
+ export{T as nano_table}from"./p-00a18187.js";import"./p-f6a8467a.js";import"./p-ee045579.js";import"./p-7bff5224.js";import"./p-9ebbb814.js";
5
+ //# sourceMappingURL=p-35d3072e.entry.js.map