@nanoporetech-digital/components 2.10.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/cjs/{date-utils-0ae9a12d.js → date-utils-b3af910d.js} +2 -2
  3. package/dist/cjs/date-utils-b3af910d.js.map +1 -0
  4. package/dist/cjs/{global-0d4f3b77.js → global-989678ec.js} +1 -8
  5. package/dist/cjs/global-989678ec.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/nano-algolia.cjs.entry.js +5 -1
  8. package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
  9. package/dist/cjs/nano-components.cjs.js +2 -2
  10. package/dist/cjs/nano-datalist_3.cjs.entry.js +4 -1
  11. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  12. package/dist/cjs/nano-date-input.cjs.entry.js +16 -5
  13. package/dist/cjs/nano-date-input.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nano-date-picker.cjs.entry.js +2 -2
  15. package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -1
  16. package/dist/cjs/nano-details.cjs.entry.js +1 -2
  17. package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
  18. package/dist/cjs/nano-field-validator.cjs.entry.js +100 -34
  19. package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nano-file-upload.cjs.entry.js +4 -1
  21. package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nano-global-search-results.cjs.entry.js +21 -6
  23. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nano-grid_3.cjs.entry.js +1 -2
  25. package/dist/cjs/nano-grid_3.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nano-icon-button.cjs.entry.js +4 -0
  27. package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
  28. package/dist/cjs/nano-input.cjs.entry.js +1 -1
  29. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  30. package/dist/cjs/nano-nav-item_2.cjs.entry.js +14 -2
  31. package/dist/cjs/nano-nav-item_2.cjs.entry.js.map +1 -1
  32. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +1 -2
  33. package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nano-slides.cjs.entry.js +1 -2
  35. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  36. package/dist/cjs/nano-sticker.cjs.entry.js +2 -3
  37. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  38. package/dist/cjs/nano-tab-group.cjs.entry.js +4 -2
  39. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  40. package/dist/cjs/nano-tab.cjs.entry.js +5 -1
  41. package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
  42. package/dist/cjs/nano-tooltip.cjs.entry.js +1 -1
  43. package/dist/cjs/nano-tooltip.cjs.entry.js.map +1 -1
  44. package/dist/collection/components/accordion/accordion.js +1 -1
  45. package/dist/collection/components/alert/alert.js +1 -1
  46. package/dist/collection/components/algolia/algolia-filter.js +2 -2
  47. package/dist/collection/components/algolia/algolia-input.js +5 -5
  48. package/dist/collection/components/algolia/algolia-results.js +1 -1
  49. package/dist/collection/components/algolia/algolia.js +12 -6
  50. package/dist/collection/components/algolia/algolia.js.map +1 -1
  51. package/dist/collection/components/checkbox/checkbox-group.js +2 -2
  52. package/dist/collection/components/checkbox/checkbox.js +3 -3
  53. package/dist/collection/components/datalist/datalist.js +5 -2
  54. package/dist/collection/components/datalist/datalist.js.map +1 -1
  55. package/dist/collection/components/date-input/date-input.js +65 -11
  56. package/dist/collection/components/date-input/date-input.js.map +1 -1
  57. package/dist/collection/components/date-picker/date-picker.css +1 -1
  58. package/dist/collection/components/date-picker/date-picker.js +5 -5
  59. package/dist/collection/components/details/details.js +1 -2
  60. package/dist/collection/components/details/details.js.map +1 -1
  61. package/dist/collection/components/dialog/dialog.js +1 -1
  62. package/dist/collection/components/dropdown/dropdown.js +1 -1
  63. package/dist/collection/components/field-validator/field-validator-interface.js +5 -0
  64. package/dist/collection/components/field-validator/field-validator-interface.js.map +1 -0
  65. package/dist/collection/components/field-validator/field-validator.js +167 -49
  66. package/dist/collection/components/field-validator/field-validator.js.map +1 -1
  67. package/dist/collection/components/file-upload/file-upload.js +10 -7
  68. package/dist/collection/components/file-upload/file-upload.js.map +1 -1
  69. package/dist/collection/components/global-nav/global-nav.js +4 -4
  70. package/dist/collection/components/global-search-results/global-search-results.css +7 -0
  71. package/dist/collection/components/global-search-results/global-search-results.js +19 -4
  72. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  73. package/dist/collection/components/grid/grid-item.js +1 -1
  74. package/dist/collection/components/grid/grid.js +0 -1
  75. package/dist/collection/components/grid/grid.js.map +1 -1
  76. package/dist/collection/components/icon/icon.js +1 -1
  77. package/dist/collection/components/icon-button/icon-button.js +23 -1
  78. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  79. package/dist/collection/components/input/input.css +1 -0
  80. package/dist/collection/components/input/input.js +5 -5
  81. package/dist/collection/components/nav-item/nav-item.js +4 -4
  82. package/dist/collection/components/range/range.js +4 -4
  83. package/dist/collection/components/resize-observe/resize-observe.js +1 -2
  84. package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
  85. package/dist/collection/components/select/select.css +2 -1
  86. package/dist/collection/components/select/select.js +20 -8
  87. package/dist/collection/components/select/select.js.map +1 -1
  88. package/dist/collection/components/slides/slides.js +7 -8
  89. package/dist/collection/components/slides/slides.js.map +1 -1
  90. package/dist/collection/components/sticker/sticker.js +0 -1
  91. package/dist/collection/components/sticker/sticker.js.map +1 -1
  92. package/dist/collection/components/tabs/tab-group.js +5 -3
  93. package/dist/collection/components/tabs/tab-group.js.map +1 -1
  94. package/dist/collection/components/tabs/tab.js +5 -1
  95. package/dist/collection/components/tabs/tab.js.map +1 -1
  96. package/dist/collection/components/tooltip/tooltip.css +0 -1
  97. package/dist/collection/global/script/global.js +0 -7
  98. package/dist/collection/global/script/global.js.map +1 -1
  99. package/dist/collection/utils/date-utils.js +1 -1
  100. package/dist/collection/utils/date-utils.js.map +1 -1
  101. package/dist/components/algolia.js +5 -1
  102. package/dist/components/algolia.js.map +1 -1
  103. package/dist/components/datalist.js +4 -1
  104. package/dist/components/datalist.js.map +1 -1
  105. package/dist/components/date-picker.js +2 -2
  106. package/dist/components/date-picker.js.map +1 -1
  107. package/dist/components/grid.js +1 -2
  108. package/dist/components/grid.js.map +1 -1
  109. package/dist/components/icon-button.js +6 -1
  110. package/dist/components/icon-button.js.map +1 -1
  111. package/dist/components/index.js +0 -7
  112. package/dist/components/index.js.map +1 -1
  113. package/dist/components/input.js +1 -1
  114. package/dist/components/input.js.map +1 -1
  115. package/dist/components/nano-date-input.js +17 -4
  116. package/dist/components/nano-date-input.js.map +1 -1
  117. package/dist/components/nano-details.js +1 -2
  118. package/dist/components/nano-details.js.map +1 -1
  119. package/dist/components/nano-field-validator.js +104 -36
  120. package/dist/components/nano-field-validator.js.map +1 -1
  121. package/dist/components/nano-file-upload.js +5 -2
  122. package/dist/components/nano-file-upload.js.map +1 -1
  123. package/dist/components/nano-global-search-results.js +21 -6
  124. package/dist/components/nano-global-search-results.js.map +1 -1
  125. package/dist/components/nano-slides.js +1 -2
  126. package/dist/components/nano-slides.js.map +1 -1
  127. package/dist/components/nano-tab-group.js +4 -2
  128. package/dist/components/nano-tab-group.js.map +1 -1
  129. package/dist/components/nano-tab.js +5 -1
  130. package/dist/components/nano-tab.js.map +1 -1
  131. package/dist/components/resize-observe.js +1 -2
  132. package/dist/components/resize-observe.js.map +1 -1
  133. package/dist/components/select.js +14 -2
  134. package/dist/components/select.js.map +1 -1
  135. package/dist/components/sticker.js +2 -3
  136. package/dist/components/sticker.js.map +1 -1
  137. package/dist/components/tooltip.js +1 -1
  138. package/dist/components/tooltip.js.map +1 -1
  139. package/dist/custom-elements/index.js +191 -1983
  140. package/dist/custom-elements/index.js.map +1 -1
  141. package/dist/esm/{date-utils-e4b757ff.js → date-utils-839cb010.js} +2 -2
  142. package/dist/esm/date-utils-839cb010.js.map +1 -0
  143. package/dist/esm/{global-d5ec4d53.js → global-8047b4ff.js} +1 -8
  144. package/dist/esm/global-8047b4ff.js.map +1 -0
  145. package/dist/esm/loader.js +2 -2
  146. package/dist/esm/nano-algolia.entry.js +5 -1
  147. package/dist/esm/nano-algolia.entry.js.map +1 -1
  148. package/dist/esm/nano-components.js +2 -2
  149. package/dist/esm/nano-datalist_3.entry.js +4 -1
  150. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  151. package/dist/esm/nano-date-input.entry.js +16 -5
  152. package/dist/esm/nano-date-input.entry.js.map +1 -1
  153. package/dist/esm/nano-date-picker.entry.js +2 -2
  154. package/dist/esm/nano-date-picker.entry.js.map +1 -1
  155. package/dist/esm/nano-details.entry.js +1 -2
  156. package/dist/esm/nano-details.entry.js.map +1 -1
  157. package/dist/esm/nano-field-validator.entry.js +100 -34
  158. package/dist/esm/nano-field-validator.entry.js.map +1 -1
  159. package/dist/esm/nano-file-upload.entry.js +4 -1
  160. package/dist/esm/nano-file-upload.entry.js.map +1 -1
  161. package/dist/esm/nano-global-search-results.entry.js +21 -6
  162. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  163. package/dist/esm/nano-grid_3.entry.js +1 -2
  164. package/dist/esm/nano-grid_3.entry.js.map +1 -1
  165. package/dist/esm/nano-icon-button.entry.js +4 -0
  166. package/dist/esm/nano-icon-button.entry.js.map +1 -1
  167. package/dist/esm/nano-input.entry.js +1 -1
  168. package/dist/esm/nano-input.entry.js.map +1 -1
  169. package/dist/esm/nano-nav-item_2.entry.js +14 -2
  170. package/dist/esm/nano-nav-item_2.entry.js.map +1 -1
  171. package/dist/esm/nano-resize-observe_2.entry.js +1 -2
  172. package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
  173. package/dist/esm/nano-slides.entry.js +1 -2
  174. package/dist/esm/nano-slides.entry.js.map +1 -1
  175. package/dist/esm/nano-sticker.entry.js +2 -3
  176. package/dist/esm/nano-sticker.entry.js.map +1 -1
  177. package/dist/esm/nano-tab-group.entry.js +4 -2
  178. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  179. package/dist/esm/nano-tab.entry.js +5 -1
  180. package/dist/esm/nano-tab.entry.js.map +1 -1
  181. package/dist/esm/nano-tooltip.entry.js +1 -1
  182. package/dist/esm/nano-tooltip.entry.js.map +1 -1
  183. package/dist/esm-es5/date-utils-839cb010.js +5 -0
  184. package/dist/esm-es5/date-utils-839cb010.js.map +1 -0
  185. package/dist/esm-es5/{global-d5ec4d53.js → global-8047b4ff.js} +2 -2
  186. package/dist/esm-es5/global-8047b4ff.js.map +1 -0
  187. package/dist/esm-es5/loader.js +1 -1
  188. package/dist/esm-es5/loader.js.map +1 -1
  189. package/dist/esm-es5/nano-algolia.entry.js +1 -1
  190. package/dist/esm-es5/nano-algolia.entry.js.map +1 -1
  191. package/dist/esm-es5/nano-components.js +1 -1
  192. package/dist/esm-es5/nano-components.js.map +1 -1
  193. package/dist/esm-es5/nano-datalist_3.entry.js +1 -1
  194. package/dist/esm-es5/nano-datalist_3.entry.js.map +1 -1
  195. package/dist/esm-es5/nano-date-input.entry.js +1 -1
  196. package/dist/esm-es5/nano-date-input.entry.js.map +1 -1
  197. package/dist/esm-es5/nano-date-picker.entry.js +1 -1
  198. package/dist/esm-es5/nano-date-picker.entry.js.map +1 -1
  199. package/dist/esm-es5/nano-details.entry.js +1 -1
  200. package/dist/esm-es5/nano-details.entry.js.map +1 -1
  201. package/dist/esm-es5/nano-field-validator.entry.js +1 -1
  202. package/dist/esm-es5/nano-field-validator.entry.js.map +1 -1
  203. package/dist/esm-es5/nano-file-upload.entry.js +1 -1
  204. package/dist/esm-es5/nano-file-upload.entry.js.map +1 -1
  205. package/dist/esm-es5/nano-global-search-results.entry.js +1 -1
  206. package/dist/esm-es5/nano-global-search-results.entry.js.map +1 -1
  207. package/dist/esm-es5/nano-grid_3.entry.js +1 -1
  208. package/dist/esm-es5/nano-grid_3.entry.js.map +1 -1
  209. package/dist/esm-es5/nano-icon-button.entry.js +2 -2
  210. package/dist/esm-es5/nano-icon-button.entry.js.map +1 -1
  211. package/dist/esm-es5/nano-input.entry.js +1 -1
  212. package/dist/esm-es5/nano-input.entry.js.map +1 -1
  213. package/dist/esm-es5/nano-nav-item_2.entry.js +1 -1
  214. package/dist/esm-es5/nano-nav-item_2.entry.js.map +1 -1
  215. package/dist/esm-es5/nano-resize-observe_2.entry.js +1 -1
  216. package/dist/esm-es5/nano-resize-observe_2.entry.js.map +1 -1
  217. package/dist/esm-es5/nano-slides.entry.js +2 -2
  218. package/dist/esm-es5/nano-slides.entry.js.map +1 -1
  219. package/dist/esm-es5/nano-sticker.entry.js +1 -1
  220. package/dist/esm-es5/nano-sticker.entry.js.map +1 -1
  221. package/dist/esm-es5/nano-tab-group.entry.js +2 -2
  222. package/dist/esm-es5/nano-tab-group.entry.js.map +1 -1
  223. package/dist/esm-es5/nano-tab.entry.js +2 -2
  224. package/dist/esm-es5/nano-tab.entry.js.map +1 -1
  225. package/dist/esm-es5/nano-tooltip.entry.js +1 -1
  226. package/dist/esm-es5/nano-tooltip.entry.js.map +1 -1
  227. package/dist/nano-components/nano-components.esm.js +1 -1
  228. package/dist/nano-components/nano-components.esm.js.map +1 -1
  229. package/dist/nano-components/nano-components.js +1 -1
  230. package/dist/nano-components/p-01667573.entry.js +5 -0
  231. package/dist/nano-components/{p-a81db037.entry.js.map → p-01667573.entry.js.map} +1 -1
  232. package/dist/nano-components/p-018b7047.entry.js +5 -0
  233. package/dist/nano-components/p-018b7047.entry.js.map +1 -0
  234. package/dist/nano-components/p-0193a282.entry.js +5 -0
  235. package/dist/nano-components/p-0193a282.entry.js.map +1 -0
  236. package/dist/nano-components/p-0320410c.entry.js +5 -0
  237. package/dist/nano-components/p-0320410c.entry.js.map +1 -0
  238. package/dist/nano-components/{p-c9a2d24c.entry.js → p-055f7d35.entry.js} +2 -2
  239. package/dist/nano-components/p-055f7d35.entry.js.map +1 -0
  240. package/dist/nano-components/p-2b478ca1.system.entry.js +5 -0
  241. package/dist/nano-components/p-2b478ca1.system.entry.js.map +1 -0
  242. package/dist/nano-components/p-32900c91.entry.js +5 -0
  243. package/dist/nano-components/p-32900c91.entry.js.map +1 -0
  244. package/dist/nano-components/p-33fce1a6.js +5 -0
  245. package/dist/nano-components/p-33fce1a6.js.map +1 -0
  246. package/dist/nano-components/p-371aebe7.system.entry.js +23 -0
  247. package/dist/nano-components/p-371aebe7.system.entry.js.map +1 -0
  248. package/dist/nano-components/p-41899a31.system.entry.js +5 -0
  249. package/dist/nano-components/p-41899a31.system.entry.js.map +1 -0
  250. package/dist/nano-components/{p-bc394857.system.entry.js → p-4558a9c6.system.entry.js} +2 -2
  251. package/dist/nano-components/p-4558a9c6.system.entry.js.map +1 -0
  252. package/dist/nano-components/p-53957ec6.system.js +5 -0
  253. package/dist/nano-components/{p-e7140887.system.js.map → p-53957ec6.system.js.map} +1 -1
  254. package/dist/nano-components/p-561500f0.system.entry.js +5 -0
  255. package/dist/nano-components/p-561500f0.system.entry.js.map +1 -0
  256. package/dist/nano-components/p-596c1711.system.entry.js +5 -0
  257. package/dist/nano-components/p-596c1711.system.entry.js.map +1 -0
  258. package/dist/nano-components/p-5f4fc2b4.entry.js +5 -0
  259. package/dist/nano-components/p-5f4fc2b4.entry.js.map +1 -0
  260. package/dist/nano-components/p-6a949280.system.entry.js +5 -0
  261. package/dist/nano-components/p-6a949280.system.entry.js.map +1 -0
  262. package/dist/nano-components/{p-bf9aa89d.system.entry.js → p-6af10533.system.entry.js} +3 -3
  263. package/dist/nano-components/p-6af10533.system.entry.js.map +1 -0
  264. package/dist/nano-components/p-70272eae.js +5 -0
  265. package/dist/nano-components/p-70272eae.js.map +1 -0
  266. package/dist/nano-components/{p-96150b2c.system.entry.js → p-72893d12.system.entry.js} +2 -2
  267. package/dist/nano-components/p-72893d12.system.entry.js.map +1 -0
  268. package/dist/nano-components/p-755d9227.entry.js +5 -0
  269. package/dist/nano-components/p-755d9227.entry.js.map +1 -0
  270. package/dist/nano-components/p-7bd25494.entry.js +5 -0
  271. package/dist/nano-components/p-7bd25494.entry.js.map +1 -0
  272. package/dist/nano-components/p-7c837460.entry.js +5 -0
  273. package/dist/nano-components/p-7c837460.entry.js.map +1 -0
  274. package/dist/nano-components/{p-93880c28.system.js → p-82e28afd.system.js} +2 -2
  275. package/dist/nano-components/p-82e28afd.system.js.map +1 -0
  276. package/dist/nano-components/p-8378428e.system.js +5 -0
  277. package/dist/nano-components/p-8378428e.system.js.map +1 -0
  278. package/dist/nano-components/p-8df4f125.system.entry.js +5 -0
  279. package/dist/nano-components/p-8df4f125.system.entry.js.map +1 -0
  280. package/dist/nano-components/{p-1b120f53.entry.js → p-91614b43.entry.js} +2 -2
  281. package/dist/nano-components/p-91614b43.entry.js.map +1 -0
  282. package/dist/nano-components/{p-d0385948.system.entry.js → p-93596c3d.system.entry.js} +2 -2
  283. package/dist/nano-components/p-93596c3d.system.entry.js.map +1 -0
  284. package/dist/nano-components/p-96d9b8b9.system.entry.js +5 -0
  285. package/dist/nano-components/{p-fc3702a0.system.entry.js.map → p-96d9b8b9.system.entry.js.map} +1 -1
  286. package/dist/nano-components/{p-3e930ac7.entry.js → p-9d9b0b66.entry.js} +2 -2
  287. package/dist/nano-components/p-9d9b0b66.entry.js.map +1 -0
  288. package/dist/nano-components/p-9ffdf6cc.entry.js +5 -0
  289. package/dist/nano-components/{p-222d8095.entry.js.map → p-9ffdf6cc.entry.js.map} +1 -1
  290. package/dist/nano-components/p-a1444980.entry.js +5 -0
  291. package/dist/nano-components/p-a1444980.entry.js.map +1 -0
  292. package/dist/nano-components/p-aa84c727.system.entry.js +5 -0
  293. package/dist/nano-components/p-aa84c727.system.entry.js.map +1 -0
  294. package/dist/nano-components/p-ac5e3775.system.entry.js +5 -0
  295. package/dist/nano-components/p-ac5e3775.system.entry.js.map +1 -0
  296. package/dist/nano-components/p-b85cf493.system.entry.js +5 -0
  297. package/dist/nano-components/{p-e817ab4a.system.entry.js.map → p-b85cf493.system.entry.js.map} +1 -1
  298. package/dist/nano-components/{p-4e2c0abb.entry.js → p-ccd6c206.entry.js} +2 -2
  299. package/dist/nano-components/p-ccd6c206.entry.js.map +1 -0
  300. package/dist/nano-components/{p-1030797a.entry.js → p-d37e1489.entry.js} +2 -2
  301. package/dist/nano-components/p-d37e1489.entry.js.map +1 -0
  302. package/dist/nano-components/p-da88981f.entry.js +23 -0
  303. package/dist/nano-components/p-da88981f.entry.js.map +1 -0
  304. package/dist/nano-components/p-e8a913ac.system.entry.js +5 -0
  305. package/dist/nano-components/p-e8a913ac.system.entry.js.map +1 -0
  306. package/dist/nano-components/p-ea54ee12.entry.js +5 -0
  307. package/dist/nano-components/p-ea54ee12.entry.js.map +1 -0
  308. package/dist/nano-components/p-faba2fc1.system.entry.js +5 -0
  309. package/dist/nano-components/p-faba2fc1.system.entry.js.map +1 -0
  310. package/dist/nano-components/p-ff026352.system.entry.js +5 -0
  311. package/dist/nano-components/p-ff026352.system.entry.js.map +1 -0
  312. package/dist/types/components/algolia/algolia.d.ts +1 -0
  313. package/dist/types/components/date-input/date-input.d.ts +6 -1
  314. package/dist/types/components/field-validator/field-validator-interface.d.ts +15 -0
  315. package/dist/types/components/field-validator/field-validator.d.ts +16 -19
  316. package/dist/types/components/file-upload/file-upload.d.ts +2 -1
  317. package/dist/types/components/global-search-results/global-search-results.d.ts +1 -0
  318. package/dist/types/components/icon-button/icon-button.d.ts +2 -0
  319. package/dist/types/components/select/select.d.ts +3 -1
  320. package/dist/types/components/tabs/tab.d.ts +1 -0
  321. package/dist/types/components.d.ts +43 -10
  322. package/dist/types/interface.d.ts +1 -0
  323. package/docs-json.json +98 -12
  324. package/docs-vscode.json +1 -1
  325. package/package.json +2 -4
  326. package/dist/cjs/ResizeObserver.es-09b81a1b.js +0 -935
  327. package/dist/cjs/ResizeObserver.es-09b81a1b.js.map +0 -1
  328. package/dist/cjs/date-utils-0ae9a12d.js.map +0 -1
  329. package/dist/cjs/global-0d4f3b77.js.map +0 -1
  330. package/dist/cjs/intersection-observer-1822c787.js +0 -987
  331. package/dist/cjs/intersection-observer-1822c787.js.map +0 -1
  332. package/dist/components/ResizeObserver.es.js +0 -933
  333. package/dist/components/ResizeObserver.es.js.map +0 -1
  334. package/dist/components/intersection-observer.js +0 -985
  335. package/dist/components/intersection-observer.js.map +0 -1
  336. package/dist/esm/ResizeObserver.es-724af9fd.js +0 -933
  337. package/dist/esm/ResizeObserver.es-724af9fd.js.map +0 -1
  338. package/dist/esm/date-utils-e4b757ff.js.map +0 -1
  339. package/dist/esm/global-d5ec4d53.js.map +0 -1
  340. package/dist/esm/intersection-observer-dff9fb5b.js +0 -985
  341. package/dist/esm/intersection-observer-dff9fb5b.js.map +0 -1
  342. package/dist/esm-es5/ResizeObserver.es-724af9fd.js +0 -5
  343. package/dist/esm-es5/ResizeObserver.es-724af9fd.js.map +0 -1
  344. package/dist/esm-es5/date-utils-e4b757ff.js +0 -5
  345. package/dist/esm-es5/date-utils-e4b757ff.js.map +0 -1
  346. package/dist/esm-es5/global-d5ec4d53.js.map +0 -1
  347. package/dist/esm-es5/intersection-observer-dff9fb5b.js +0 -5
  348. package/dist/esm-es5/intersection-observer-dff9fb5b.js.map +0 -1
  349. package/dist/nano-components/p-00eaa36a.entry.js +0 -5
  350. package/dist/nano-components/p-00eaa36a.entry.js.map +0 -1
  351. package/dist/nano-components/p-1030797a.entry.js.map +0 -1
  352. package/dist/nano-components/p-11451a4b.system.entry.js +0 -5
  353. package/dist/nano-components/p-11451a4b.system.entry.js.map +0 -1
  354. package/dist/nano-components/p-11a2dcce.js +0 -5
  355. package/dist/nano-components/p-11a2dcce.js.map +0 -1
  356. package/dist/nano-components/p-1a30dfdd.system.entry.js +0 -5
  357. package/dist/nano-components/p-1a30dfdd.system.entry.js.map +0 -1
  358. package/dist/nano-components/p-1b120f53.entry.js.map +0 -1
  359. package/dist/nano-components/p-222d8095.entry.js +0 -5
  360. package/dist/nano-components/p-241d90eb.system.entry.js +0 -5
  361. package/dist/nano-components/p-241d90eb.system.entry.js.map +0 -1
  362. package/dist/nano-components/p-2c8d7273.entry.js +0 -5
  363. package/dist/nano-components/p-2c8d7273.entry.js.map +0 -1
  364. package/dist/nano-components/p-3093915f.entry.js +0 -5
  365. package/dist/nano-components/p-3093915f.entry.js.map +0 -1
  366. package/dist/nano-components/p-325c1cad.entry.js +0 -5
  367. package/dist/nano-components/p-325c1cad.entry.js.map +0 -1
  368. package/dist/nano-components/p-32f396c0.system.entry.js +0 -5
  369. package/dist/nano-components/p-32f396c0.system.entry.js.map +0 -1
  370. package/dist/nano-components/p-35108e08.entry.js +0 -5
  371. package/dist/nano-components/p-35108e08.entry.js.map +0 -1
  372. package/dist/nano-components/p-3ccb176c.system.entry.js +0 -5
  373. package/dist/nano-components/p-3ccb176c.system.entry.js.map +0 -1
  374. package/dist/nano-components/p-3e930ac7.entry.js.map +0 -1
  375. package/dist/nano-components/p-42cebbfe.system.entry.js +0 -5
  376. package/dist/nano-components/p-42cebbfe.system.entry.js.map +0 -1
  377. package/dist/nano-components/p-45070c8f.entry.js +0 -5
  378. package/dist/nano-components/p-45070c8f.entry.js.map +0 -1
  379. package/dist/nano-components/p-4e2c0abb.entry.js.map +0 -1
  380. package/dist/nano-components/p-5d17cfbb.system.entry.js +0 -23
  381. package/dist/nano-components/p-5d17cfbb.system.entry.js.map +0 -1
  382. package/dist/nano-components/p-5d5ea4ab.system.entry.js +0 -5
  383. package/dist/nano-components/p-5d5ea4ab.system.entry.js.map +0 -1
  384. package/dist/nano-components/p-6d138abf.entry.js +0 -5
  385. package/dist/nano-components/p-6d138abf.entry.js.map +0 -1
  386. package/dist/nano-components/p-71bbb7ba.entry.js +0 -5
  387. package/dist/nano-components/p-71bbb7ba.entry.js.map +0 -1
  388. package/dist/nano-components/p-72ed603c.system.entry.js +0 -5
  389. package/dist/nano-components/p-72ed603c.system.entry.js.map +0 -1
  390. package/dist/nano-components/p-76d9d1d4.entry.js +0 -5
  391. package/dist/nano-components/p-76d9d1d4.entry.js.map +0 -1
  392. package/dist/nano-components/p-88779174.system.entry.js +0 -5
  393. package/dist/nano-components/p-88779174.system.entry.js.map +0 -1
  394. package/dist/nano-components/p-93880c28.system.js.map +0 -1
  395. package/dist/nano-components/p-96150b2c.system.entry.js.map +0 -1
  396. package/dist/nano-components/p-97b13ad2.entry.js +0 -5
  397. package/dist/nano-components/p-97b13ad2.entry.js.map +0 -1
  398. package/dist/nano-components/p-a81db037.entry.js +0 -5
  399. package/dist/nano-components/p-b430a9b6.system.js +0 -5
  400. package/dist/nano-components/p-b430a9b6.system.js.map +0 -1
  401. package/dist/nano-components/p-bc394857.system.entry.js.map +0 -1
  402. package/dist/nano-components/p-bf9aa89d.system.entry.js.map +0 -1
  403. package/dist/nano-components/p-c9a2d24c.entry.js.map +0 -1
  404. package/dist/nano-components/p-d0385948.system.entry.js.map +0 -1
  405. package/dist/nano-components/p-debd9efc.js +0 -5
  406. package/dist/nano-components/p-debd9efc.js.map +0 -1
  407. package/dist/nano-components/p-e195ab77.system.js +0 -5
  408. package/dist/nano-components/p-e195ab77.system.js.map +0 -1
  409. package/dist/nano-components/p-e7140887.system.js +0 -5
  410. package/dist/nano-components/p-e817ab4a.system.entry.js +0 -5
  411. package/dist/nano-components/p-f5d4d13b.system.js +0 -5
  412. package/dist/nano-components/p-f5d4d13b.system.js.map +0 -1
  413. package/dist/nano-components/p-f66958c1.js +0 -5
  414. package/dist/nano-components/p-f66958c1.js.map +0 -1
  415. package/dist/nano-components/p-f710c763.system.entry.js +0 -5
  416. package/dist/nano-components/p-f710c763.system.entry.js.map +0 -1
  417. package/dist/nano-components/p-f9c7d961.js +0 -5
  418. package/dist/nano-components/p-f9c7d961.js.map +0 -1
  419. package/dist/nano-components/p-fc3702a0.system.entry.js +0 -5
  420. package/dist/nano-components/p-ffc2063a.entry.js +0 -23
  421. package/dist/nano-components/p-ffc2063a.entry.js.map +0 -1
  422. package/dist/nano-components/p-fff27907.system.entry.js +0 -5
  423. package/dist/nano-components/p-fff27907.system.entry.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["node_modules/@stencil/store/dist/index.mjs","src/components/field-validator/field-validator.tsx"],"names":["appendToMap","map","propName","value","items","get","set","includes","push","debounce","fn","ms","timeoutId","args","_i","arguments","length","clearTimeout","setTimeout","apply","isConnected","maybeElement","cleanupElements","_a","keys","key","filter","stencilSubscription","getRenderingRef","elmsToUpdate","Map","dispose","clear","elm","elements","forceUpdate","reset","forEach","elms","createObservableMap","defaultState","shouldUpdate","a","b","states","Object","entries","handlers","cb","oldValue","state","Proxy","_","ownKeys","Array","from","getOwnPropertyDescriptor","enumerable","configurable","has","on","eventName","callback","removeFromArray","onChange","unSet","newValue","unReset","use","subscriptions","unsubs","reduce","subscription","unsub","array","item","index","indexOf","createStore","FieldValidator","exports","class_1","hostRef","_this","this","submitted","fields","internalValidate","validateOn","scrollToInvalid","_dirty","handleStoreChange","_key","_newVal","__awaiter","dirty","validateAllFields","sent","_valid","activeForm","checkValidity","nanoPayloadChange","emit","store","handleFieldChange","ev","setFieldValue","target","handleFormInvalid","preventDefault","submitForm","scrollToFirstInvalid","nanoInvalid","handleSubmit","e","prototype","userFormChange","userForm","defineProperty","_activeForm","form","removeEventListener","addEventListener","validateOnChange","field","tagName","cbg","closest","validationState","found","find","v","name","validityMessage","f","valid","invalid","attachSlotObserver","mo","MutationObserver","_entries","host","querySelector","setupFields","observe","childList","attributes","attributeFilter","subtree","querySelectorAll","fieldName","cb_1","type","checked","currentArr","isArray","__spreadArray","files","validate","newVal","validation","res","Promise","all","o","validityTarget","msg","setFieldError","_b","showError","setError","memo","undefined","invalidField","scrollIntoView","behavior","block","nanoSubmit","defaultPrevented","submit","connectedCallback","componentDidLoad","requestAnimationFrame","disconnectedCallback","disconnect","render","h","Host","ref"],"m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7B,KAAKe,WACPf,KAAKe,WAAWsB,oBACd,UACArC,KAAKwB,kBACL,OAIN3B,EAAAkC,UAAAsE,OAAA,WAAA,IAAAtG,EAAAC,KACE,OACEsG,EAACC,EAAI,KACFvG,KAAKiC,UAAYqE,EAAA,OAAA,OAChBtG,KAAKiC,UACLqE,EAAA,OAAA,CAAME,IAAK,SAACtD,GAAC,OAAMnD,EAAKgB,WAAamC,IACnCoD,EAAA,OAAA,6RAzae","sourcesContent":["import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(defaultState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n const unReset = on('reset', () => cb(defaultState[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","import {\n Component,\n Prop,\n h,\n Host,\n Element,\n ComponentInterface,\n State,\n Watch,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { createStore, ObservableMap } from '@stencil/store';\n\ntype NanoFormEles =\n | HTMLNanoInputElement\n | HTMLNanoCheckboxElement\n | HTMLNanoSelectElement\n | HTMLNanoDateInputElement\n | HTMLNanoFileUploadElement;\ntype NanoEvent = CustomEvent & { target: NanoFormEles };\ninterface ValueStore {\n [key: string]: any;\n}\n\ninterface ValidationState {\n fields: NanoFormEles[];\n valid: boolean;\n validityMessage: string;\n dirty: boolean;\n name: string | number;\n value: any;\n}\n\n/**\n * A toolbox for `nano-...` form fields and form validation.\n *\n * - Easy to add validation accross field dependencies - e.g. \"When Field1 contains '123' Field2 must contain '456'\"\n * - Easy access to whole form and individual field validity states\n * - Easy access to form data payload\n * - Scroll to invalid field on submit\n */\n@Component({\n tag: 'nano-field-validator',\n})\nexport class FieldValidator implements ComponentInterface {\n // Internal State\n\n @Element() host: HTMLNanoFieldValidatorElement;\n @State() store: ObservableMap<ValueStore>;\n @State() userForm: HTMLFormElement;\n @State() submitted = false;\n @Watch('userForm')\n userFormChange() {\n if (!!this.userForm) this.activeForm = this.userForm;\n }\n\n private get activeForm() {\n return this._activeForm;\n }\n private set activeForm(form: HTMLFormElement) {\n if (this._activeForm)\n this._activeForm.removeEventListener(\n 'invalid',\n this.handleFormInvalid,\n true\n );\n if (form) form.addEventListener('invalid', this.handleFormInvalid, true);\n this._activeForm = form;\n }\n private _activeForm: HTMLFormElement;\n private mo: MutationObserver;\n private fields: NanoFormEles[] = [];\n // annoyingly, whenever we attempt to checkValidty it fires `invalid` events.\n // this is used to prevent infinite loops / multiple calls\n private internalValidate = false;\n\n // Public API\n\n /** When should the fields perform validation. Will override / sync all nested `nano-...` controls */\n @Prop({ mutable: true }) validateOn?: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /** Sync up validateOn with all fields */\n @Watch('validateOn')\n validateOnChange() {\n this.fields.forEach((field) => {\n if (field.tagName === 'NANO-CHECKBOX') {\n const cbg = field.closest('nano-checkbox-group');\n if (cbg) cbg.validateOn = this.validateOn;\n } else {\n (field as Exclude<NanoFormEles, HTMLNanoCheckboxElement>).validateOn =\n this.validateOn;\n }\n });\n }\n\n /** Tries to scroll to the first invalid field on submit */\n @Prop() scrollToInvalid = true;\n\n /** Returns true if any nested fields have been changed @readonly */\n @Prop({ reflect: true })\n get dirty() {\n return this._dirty;\n }\n @State() _dirty = false;\n\n /** Returns true if all the nested fields are currently valid @readonly */\n @Prop({ reflect: true })\n get valid() {\n return this._valid;\n }\n @State() _valid: boolean;\n\n /** The current form payload as a reactive store. @readonly */\n @Prop()\n get payload() {\n return this.store.state;\n }\n\n /** Returns true if validation errors will be displayed to the user */\n @Prop()\n get showValidation() {\n return (this.validateOn === 'dirty' && this.dirty) || this.submitted;\n }\n\n /** Get the current validation state of all form fields. @readonly\n * ```\n {\n fields: NanoFormEles[];\n valid: boolean;\n validityMessage: string;\n dirty: boolean;\n name: string | number;\n value: any;\n }[]\n ```\n */\n @Prop() get validationState(): ValidationState[] {\n const validationState: ValidationState[] = [];\n\n this.fields.forEach(async (field) => {\n const found = validationState.find((v) => v.name === field.name);\n\n if (found) {\n found.validityMessage = field.validityMessage.length\n ? field.validityMessage\n : found.validityMessage;\n if (!found.fields.find((f) => f === field)) found.fields.push(field);\n if (found.valid && field.invalid) found.valid = false;\n return;\n }\n\n validationState.push({\n fields: [field],\n name: field.name,\n valid: !field.invalid,\n value: this.store.state[field.name],\n dirty: false,\n validityMessage: field.validityMessage,\n });\n });\n return validationState;\n }\n\n /** A validation callback method.\n * @param field - The field name currently being evaluated\n * @param value - The value of the field currently being evaluated\n * @param fields - an array of all currently observered form fields and values\n * @returns field names mapped to an object of status message and validity e.g.\n * ```js\n * {field1: {msg: `This is invalid!`}, field2: {msg: `This is valid!`, valid: true}}\n * ```\n */\n @Prop() validation: (\n field: string,\n value: string,\n fields: ValueStore\n ) => { [key: string]: { msg: string; valid?: boolean } };\n\n /** Fired whenever the payload changes */\n @Event() nanoPayloadChange: EventEmitter<ValueStore>;\n\n /**\n * Fired on valid form submission.\n * Note: if you wish to prevent a form from submitting, instead\n * of using / preventing the native `submit` event, use this event\n * ```js\n * ele.addEventListener('nanoSubmit', (e) => {\n * e.preventDefault()\n * })\n * ```\n */\n @Event() nanoSubmit: EventEmitter;\n\n /** Fire on invalid form submission attempt */\n @Event() nanoInvalid: EventEmitter;\n\n // private methods\n\n private attachSlotObserver() {\n if (!!this.mo) return;\n const mo = (this.mo = new MutationObserver((_entries) => {\n const form = this.host.querySelector('form');\n if (form !== this.activeForm) this.activeForm = form;\n this.setupFields();\n }));\n mo.observe(this.host, {\n childList: true,\n attributes: true,\n attributeFilter: ['name'],\n subtree: true,\n });\n }\n\n /** Checks for new `nano-...` fields and adds them to our watch array and value store */\n private setupFields() {\n let fields = Array.from(\n this.host.querySelectorAll<NanoFormEles>(`\n nano-input,\n nano-select,\n nano-file-upload,\n nano-date-input,\n nano-checkbox\n `)\n );\n fields = fields.filter((f) => !!f.name && !!f.name.length);\n\n // do we have any currently un-watched fields?\n if (!fields.filter((f) => !this.fields.includes(f)).length) return;\n\n // setup the initial store state / refresh on new fields\n this.fields = fields;\n this.validateOnChange();\n this.setFieldValue(this.fields);\n this.nanoPayloadChange.emit(this.store.state);\n }\n\n /** Loops through all `nano-...` fields and extracts their values into our store */\n private setFieldValue(fields: NanoFormEles[]) {\n fields.forEach((field) => {\n const fieldName = field.name;\n if (!fieldName.length) return;\n\n switch (field.tagName) {\n case 'NANO-CHECKBOX':\n let cb = field as HTMLNanoCheckboxElement;\n if (\n cb.type === 'radio' ||\n cb.type === 'segment' ||\n cb.type === 'segment-pill'\n ) {\n if (cb.checked) this.store.state[fieldName] = cb.value;\n else if (!cb.checked && cb.value === this.store.state[fieldName])\n this.store.state[fieldName] = '';\n } else if (\n this.fields.filter(\n (f) => f.name === fieldName && f.tagName === 'NANO-CHECKBOX'\n ).length > 1\n ) {\n const currentArr = Array.isArray(this.store.state[fieldName])\n ? this.store.state[fieldName]\n : [];\n if (cb.checked) {\n if (!this.store.state[fieldName].includes(cb.value)) {\n this.store.state[fieldName] = [...currentArr, cb.value];\n }\n } else {\n this.store.state[fieldName] = currentArr.filter(\n (v) => v !== cb.value\n );\n }\n } else this.store.state[fieldName] = cb.value;\n break;\n case 'NANO-FILE-UPLOAD':\n this.store.state[fieldName] = (\n field as HTMLNanoFileUploadElement\n ).files;\n break;\n default:\n this.store.state[fieldName] = field.value;\n break;\n }\n });\n }\n\n /** Checks for user defined validations */\n private async validate(key: string | number, newVal: any) {\n if (!this.validation) return;\n\n const res = this.validation(key as string, newVal, this.store.state);\n\n // no nothing - return\n if (!res) return;\n\n // stencil public methods are async\n // so we must to coerce our validation\n // collection loop into a promise\n await Promise.all(\n Object.entries(res).map(async ([key, o]) => {\n // switch on/off validation messages\n const field = this.fields.find((f) => f.name === key);\n let validityTarget: NanoFormEles | HTMLNanoCheckboxGroupElement = field;\n\n if (field.tagName === 'NANO-CHECKBOX') {\n const cbg = field.closest('nano-checkbox-group');\n validityTarget = cbg || field;\n }\n\n // status is now valid - clear the error\n if (validityTarget.validityMessage === o.msg && o.valid)\n await this.setFieldError(validityTarget, '');\n // status is invalid. Set the error\n else if (!o.valid) {\n await this.setFieldError(validityTarget, o.msg);\n }\n })\n );\n }\n\n /**\n * Utility to smooth out setting error messages\n * (it's a different method on `nano-checkbox` 'cos they don't show errors themselves)\n * @param field\n * @param msg\n */\n private async setFieldError(\n field: NanoFormEles | HTMLNanoCheckboxGroupElement,\n msg: string\n ) {\n if (field['showError'])\n await (field as Exclude<NanoFormEles, HTMLNanoCheckboxElement>).showError(\n msg\n );\n else await (field as HTMLNanoCheckboxElement).setError(msg);\n }\n\n /** Loops through all store entries and checks field validity */\n private async validateAllFields() {\n // This forces our loop to `await` and finish sequentially ... silly async stencil methods\n await Object.entries(this.store.state).reduce(\n async (memo, [key, value]) => {\n await memo;\n await this.validate(key, value);\n },\n undefined as any\n );\n }\n\n private scrollToFirstInvalid() {\n if (!this.scrollToInvalid) return;\n\n setTimeout(() => {\n const invalidField = this.validationState.find((f) => !f.valid);\n if (!invalidField) return;\n invalidField.fields[0].scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }, 200);\n }\n\n private submitForm() {\n const nanoSubmit = this.nanoSubmit.emit();\n if (nanoSubmit.defaultPrevented) return;\n this.activeForm.submit();\n }\n\n // Event handlers\n\n /** Fired whenever store values change and potentially checks validity */\n private handleStoreChange = async (_key: string | number, _newVal: any) => {\n if (this.validateOn === 'dirty' && this.dirty) {\n this.internalValidate = true;\n await this.validateAllFields();\n this._valid = this.activeForm.checkValidity();\n this.internalValidate = false;\n }\n this.nanoPayloadChange.emit(this.store.state);\n };\n\n /** Handles field value changes and passes to store */\n private handleFieldChange = (ev: NanoEvent) => {\n this._dirty = true;\n this.setFieldValue([ev.target]);\n };\n\n /** Handles default field validation events */\n private handleFormInvalid = async (ev: Event) => {\n ev.preventDefault();\n this._valid = false;\n\n if (this.internalValidate) return;\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n this.submitted = true;\n\n await this.validateAllFields();\n\n // kinda insane...but if we're only validating on submit, then if the form is currently\n // in an invalid state, when submitting, it will fire an invalid event and not\n // submit the form. So let's test to make sure it is really invalid, and submit if not\n if (this.validateOn === 'submit') {\n this.internalValidate = true;\n this._valid = this.activeForm.checkValidity();\n this.internalValidate = false;\n\n if (this._valid) {\n this.submitForm();\n return;\n }\n }\n\n this.scrollToFirstInvalid();\n this.nanoInvalid.emit();\n };\n\n /** stops default form submission, checks if valid, then submits manually */\n private handleSubmit = async (e: Event) => {\n e.preventDefault();\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n this.submitted = true;\n await this.validateAllFields();\n\n this.internalValidate = true;\n this._valid = this.activeForm.checkValidity();\n this.internalValidate = false;\n\n if (!this._valid) {\n this.scrollToFirstInvalid();\n return;\n }\n this.submitForm();\n };\n\n connectedCallback(): void {\n this.userForm = this.host.querySelector('form');\n }\n\n componentDidLoad() {\n requestAnimationFrame(() => {\n this.store = createStore<ValueStore>({});\n\n this.setupFields();\n this.attachSlotObserver();\n\n this.store.on('set', (key, value) => this.handleStoreChange(key, value));\n this.host.addEventListener('nanoChange', this.handleFieldChange);\n this.host.addEventListener('submit', this.handleSubmit);\n });\n }\n\n disconnectedCallback() {\n if (this.mo) this.mo.disconnect();\n this.store.dispose();\n this.host.removeEventListener('nanoChange', this.handleFieldChange);\n this.host.removeEventListener('submit', this.handleSubmit);\n if (this.activeForm)\n this.activeForm.removeEventListener(\n 'invalid',\n this.handleFormInvalid,\n true\n );\n }\n\n render() {\n return (\n <Host>\n {this.userForm && <slot />}\n {!this.userForm && (\n <form ref={(f) => (this.activeForm = f)}>\n <slot />\n </form>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- /*!
2
- * Web Components for Nanopore digital Web Apps
3
- */
4
- (function(){if(typeof window==="undefined"||typeof document==="undefined"||typeof HTMLElement==="undefined"){return}var e=false;try{var n=document.createElement("div");n.addEventListener("focus",(function(e){e.preventDefault();e.stopPropagation()}),true);n.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&typeof navigator.userAgent!=="undefined"&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/)){return e=false}e=true}}))}catch(r){}if(HTMLElement.prototype.nativeFocus===undefined&&!e){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var t=function(e){var n=e.parentNode;var t=[];var o=document.scrollingElement||document.documentElement;while(n&&n!==o){if(n.offsetHeight<n.scrollHeight||n.offsetWidth<n.scrollWidth){t.push([n,n.scrollTop,n.scrollLeft])}n=n.parentNode}n=o;t.push([n,n.scrollTop,n.scrollLeft]);return t};var o=function(e){for(var n=0;n<e.length;n++){e[n][0].scrollTop=e[n][1];e[n][0].scrollLeft=e[n][2]}e=[]};var i=function(e){if(e&&e.preventScroll){var n=t(this);if(typeof setTimeout==="function"){var i=this;setTimeout((function(){i.nativeFocus();o(n)}),0)}else{this.nativeFocus();o(n)}}else{this.nativeFocus()}};HTMLElement.prototype.focus=i}})();if(!("IntersectionObserver"in window)||!("IntersectionObserverEntry"in window)||!("intersectionRatio"in window.IntersectionObserverEntry.prototype)){__sc_import_nano_components("./p-f9c7d961.js")}if(!("scrollBehavior"in document.documentElement.style)){setTimeout((e=>{__sc_import_nano_components("./p-ea2de992.js").then((e=>{document.documentElement.style.scrollBehavior="smooth"}))}),0)}else document.documentElement.style.scrollBehavior="smooth";{const e=document.documentElement;const n=()=>{if(!e.classList.contains("hydrated"))return false;document.documentElement.dispatchEvent(new CustomEvent("nanoComponentsReady"));return true};if(!n()){let e=new MutationObserver((t=>{if(n()){e.disconnect();e=null}}));e.observe(document.documentElement,{childList:false,subtree:false,attributes:true})}}
5
- //# sourceMappingURL=p-11a2dcce.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["node_modules/focus-options-polyfill/index.js","src/global/script/global.ts"],"names":["window","document","HTMLElement","supportsPreventScrollOption","focusElem","createElement","addEventListener","event","preventDefault","stopPropagation","focus","Object","defineProperty","get","navigator","userAgent","match","e","prototype","nativeFocus","undefined","calcScrollableElements","element","parent","parentNode","scrollableElements","rootScrollingElement","scrollingElement","documentElement","offsetHeight","scrollHeight","offsetWidth","scrollWidth","push","scrollTop","scrollLeft","restoreScrollPosition","i","length","patchedFocus","args","preventScroll","evScrollableElements","this","setTimeout","thisElem","IntersectionObserverEntry","__sc_import_nano_components","style","_","scrollBehavior","docEle","docIsReady","classList","contains","dispatchEvent","CustomEvent","mutationO","MutationObserver","disconnect","observe","childList","subtree","attributes"],"mappings":";;;CACA,WACE,UACSA,SAAW,oBACXC,WAAa,oBACbC,cAAgB,YACvB,CACA,OAGF,IAAIC,EAA8B,MAClC,IACE,IAAIC,EAAYH,SAASI,cAAc,OACvCD,EAAUE,iBACR,SACA,SAASC,GACPA,EAAMC,iBACND,EAAME,oBAER,MAEFL,EAAUM,MACRC,OAAOC,eAAe,GAAI,gBAAiB,CACzCC,IAAK,WAEH,GACEC,kBACOA,UAAUC,YAAc,aAC/BD,UAAUC,WACVD,UAAUC,UAAUC,MAAM,gBAAiB,CACzC,OAAOb,EAA8B,MAGzCA,EAA8B,SAIpC,MAAOc,IAET,GACEf,YAAYgB,UAAUC,cAAgBC,YACrCjB,EACD,CACAD,YAAYgB,UAAUC,YAAcjB,YAAYgB,UAAUR,MAE1D,IAAIW,EAAyB,SAASC,GACpC,IAAIC,EAASD,EAAQE,WACrB,IAAIC,EAAqB,GACzB,IAAIC,EACFzB,SAAS0B,kBAAoB1B,SAAS2B,gBAExC,MAAOL,GAAUA,IAAWG,EAAsB,CAChD,GACEH,EAAOM,aAAeN,EAAOO,cAC7BP,EAAOQ,YAAcR,EAAOS,YAC5B,CACAP,EAAmBQ,KAAK,CACtBV,EACAA,EAAOW,UACPX,EAAOY,aAGXZ,EAASA,EAAOC,WAElBD,EAASG,EACTD,EAAmBQ,KAAK,CAACV,EAAQA,EAAOW,UAAWX,EAAOY,aAE1D,OAAOV,GAGT,IAAIW,EAAwB,SAASX,GACnC,IAAK,IAAIY,EAAI,EAAGA,EAAIZ,EAAmBa,OAAQD,IAAK,CAClDZ,EAAmBY,GAAG,GAAGH,UAAYT,EAAmBY,GAAG,GAC3DZ,EAAmBY,GAAG,GAAGF,WAAaV,EAAmBY,GAAG,GAE9DZ,EAAqB,IAGvB,IAAIc,EAAe,SAASC,GAC1B,GAAIA,GAAQA,EAAKC,cAAe,CAC9B,IAAIC,EAAuBrB,EAAuBsB,MAClD,UAAWC,aAAe,WAAY,CACpC,IAAIC,EAAWF,KACfC,YAAW,WACTC,EAAS1B,cACTiB,EAAsBM,KACrB,OACE,CACLC,KAAKxB,cACLiB,EAAsBM,QAGrB,CACHC,KAAKxB,gBAITjB,YAAYgB,UAAUR,MAAQ6B,IAhGlC,GCOA,KACI,yBAAAvC,WACA,8BAA+BA,WAC/B,sBAAuBA,OAAO8C,0BAAA5B,WAAA,CAEhC6B,+CAOF,KAAM,mBAAA9C,SAAA2B,gBAAAoB,OAAA,CACJJ,YAAYK,IACVF,yDAGE9C,SAAS2B,gBAAgBoB,MAAME,eAAiB,cAEjD,QACEjD,SAAA2B,gBAAAoB,MAAAE,eAAA,SAIc,CACnB,MAAMC,EAASlD,SAAA2B,gBACf,MAAMwB,EAAa,KACjB,IAAKD,EAAOE,UAAUC,SAAA,YAAsB,OAAO,MACnDrD,SAAS2B,gBAAA2B,cAAA,IAAAC,YAAA,wBAGT,OAAO,MAGT,IAAAJ,IAAA,CACE,IAAIK,EAAY,IAAAC,kBAAAT,IACd,GAAIG,IAAc,CAChBK,EAAUE,aACVF,EAAY,SAIhBA,EAAAG,QAAA3D,SAAA2B,gBAAA,CACEiC,UAAW,MACXC,QAAS,MACTC,WAAY","sourcesContent":["// focus - focusOptions - preventScroll polyfill\n(function() {\n if (\n typeof window === \"undefined\" ||\n typeof document === \"undefined\" ||\n typeof HTMLElement === \"undefined\"\n ) {\n return;\n }\n\n var supportsPreventScrollOption = false;\n try {\n var focusElem = document.createElement(\"div\");\n focusElem.addEventListener(\n \"focus\",\n function(event) {\n event.preventDefault();\n event.stopPropagation();\n },\n true\n );\n focusElem.focus(\n Object.defineProperty({}, \"preventScroll\", {\n get: function() {\n // Edge v18 gives a false positive for supporting inputs\n if (\n navigator &&\n typeof navigator.userAgent !== 'undefined' &&\n navigator.userAgent &&\n navigator.userAgent.match(/Edge\\/1[7-8]/)) {\n return supportsPreventScrollOption = false\n }\n\n supportsPreventScrollOption = true;\n }\n })\n );\n } catch (e) {}\n\n if (\n HTMLElement.prototype.nativeFocus === undefined &&\n !supportsPreventScrollOption\n ) {\n HTMLElement.prototype.nativeFocus = HTMLElement.prototype.focus;\n\n var calcScrollableElements = function(element) {\n var parent = element.parentNode;\n var scrollableElements = [];\n var rootScrollingElement =\n document.scrollingElement || document.documentElement;\n\n while (parent && parent !== rootScrollingElement) {\n if (\n parent.offsetHeight < parent.scrollHeight ||\n parent.offsetWidth < parent.scrollWidth\n ) {\n scrollableElements.push([\n parent,\n parent.scrollTop,\n parent.scrollLeft\n ]);\n }\n parent = parent.parentNode;\n }\n parent = rootScrollingElement;\n scrollableElements.push([parent, parent.scrollTop, parent.scrollLeft]);\n\n return scrollableElements;\n };\n\n var restoreScrollPosition = function(scrollableElements) {\n for (var i = 0; i < scrollableElements.length; i++) {\n scrollableElements[i][0].scrollTop = scrollableElements[i][1];\n scrollableElements[i][0].scrollLeft = scrollableElements[i][2];\n }\n scrollableElements = [];\n };\n\n var patchedFocus = function(args) {\n if (args && args.preventScroll) {\n var evScrollableElements = calcScrollableElements(this);\n if (typeof setTimeout === 'function') {\n var thisElem = this;\n setTimeout(function () {\n thisElem.nativeFocus();\n restoreScrollPosition(evScrollableElements);\n }, 0);\n } else {\n this.nativeFocus();\n restoreScrollPosition(evScrollableElements);\n }\n }\n else {\n this.nativeFocus();\n }\n };\n\n HTMLElement.prototype.focus = patchedFocus;\n }\n})();\n","import { Build } from '@stencil/core';\n\n// focus options\n\nimport 'focus-options-polyfill';\n\n// Intersection observer\n\nif (\n !('IntersectionObserver' in window) ||\n !('IntersectionObserverEntry' in window) ||\n !('intersectionRatio' in window.IntersectionObserverEntry.prototype)\n) {\n import(\n /* webpackChunkName: 'polyfills-intersection-observer' */ 'intersection-observer'\n );\n}\n\n// scroll-behaviour\n\nif (!('scrollBehavior' in document.documentElement.style)) {\n setTimeout((_) => {\n import(\n /* webpackChunkName: 'polyfills-scroll-behavior' */ 'scroll-behavior-polyfill'\n ).then((_) => {\n document.documentElement.style.scrollBehavior = 'smooth';\n });\n }, 0);\n} else document.documentElement.style.scrollBehavior = 'smooth';\n\n// fire global 'ready' event when everything is hydrated\n\nif (Build.isBrowser) {\n const docEle = document.documentElement;\n const docIsReady = () => {\n if (!docEle.classList.contains('hydrated')) return false;\n document.documentElement.dispatchEvent(\n new CustomEvent('nanoComponentsReady')\n );\n return true;\n };\n\n if (!docIsReady()) {\n let mutationO = new MutationObserver((_) => {\n if (docIsReady()) {\n mutationO.disconnect();\n mutationO = null;\n }\n });\n\n mutationO.observe(document.documentElement, {\n childList: false,\n subtree: false,\n attributes: true,\n });\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,s){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function r(t){try{h(s.next(t))}catch(e){o(e)}}function c(t){try{h(s["throw"](t))}catch(e){o(e)}}function h(t){t.done?i(t.value):n(t.value).then(r,c)}h((s=s.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},s,n,o,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(t){return function(e){return h([t,e])}}function h(r){if(s)throw new TypeError("Generator is already executing.");while(i)try{if(s=1,n&&(o=r[0]&2?n["return"]:r[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;if(n=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;n=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(r[0]===6&&i.label<o[1]){i.label=o[1];o=r;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(r);break}if(o[2])i.ops.pop();i.trys.pop();continue}r=e.call(t,i)}catch(c){r=[6,c];n=0}finally{s=o=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};
2
- /*!
3
- * Web Components for Nanopore digital Web Apps
4
- */System.register(["./p-f48be9f5.system.js","./p-b430a9b6.system.js","./p-1c216ca4.system.js","./p-1d13dbdf.system.js","./p-ef053a2f.system.js"],(function(t){"use strict";var e,i,s,n,o,r,c,h,a,l,u;return{setters:[function(t){e=t.r;i=t.c;s=t.h;n=t.e;o=t.g},function(t){r=t.i},function(t){c=t.r;h=t.h;a=t.b},function(t){l=t.a},function(t){u=t.d}],execute:function(){var f=':host{-webkit-box-sizing:border-box;box-sizing:border-box}*,*::before,*::after{-webkit-box-sizing:border-box;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-width:100%}:host([sticky]){position:-webkit-sticky;position:sticky;-webkit-transition:0.3s ease transform;transition:0.3s ease transform;will-change:min-height}:host([sticky][stuck]){left:var(--stuck-left);right:var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){-webkit-transform:var(--top-hide);transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){-webkit-transform:var(--bottom-hide);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-width:inherit;width:100%}.sticker:not(.stuck){width:auto !important}.sticker.sticky{-webkit-transition:0.3s ease all;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;left:var(--stuck-left);right:var(--stuck-right);z-index:var(--stuck-z-index);-webkit-transform:translateY(0);transform:translateY(0)}:host([placed-top]) .sticker.stuck{top:0}:host([placed-bottom]) .sticker.stuck{bottom:0}:host([placed-top]) .sticker.stuck.hide{-webkit-transform:var(--top-hide);transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{-webkit-transform:var(--bottom-hide);transform:var(--bottom-hide)}.sticker-content{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}';function d(t){return t instanceof Document?window.pageYOffset:t.scrollTop}function p(t,e){var i=e instanceof Document?document.documentElement:e;return l(t,i)}var k=t("nano_sticker",function(){function t(t){var s=this;e(this,t);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.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._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.setupParentResizeListener=function(){if(s.parentSizeObserver){s.parentSizeObserver.disconnect();s.parentSizeObserver=undefined}s.parentSizeObserver=new r((function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e];var o=void 0,r=void 0;if(n.contentRect.height)o=n.contentRect.height;if(n.contentRect.width)r=n.contentRect.width;if(typeof s.quietMode==="object"){if(r<s.quietMode.w||o<s.quietMode.h)s.quietModeIsOn=true;else s.quietModeIsOn=false}if(s.breakPointMin){if(r>s.breakPointMin)s.isSticky=true;else s.isSticky=false}if(s.breakPointMax){if(r<s.breakPointMax)s.isSticky=true;else s.isSticky=false}if(s.isRootSticker&&s.sticker&&s.autoResize)s.sticker.style.width=s.host.scrollWidth+"px"}}));var t=s.scrollParent instanceof Document?s.scrollParent.documentElement:s.scrollParent;if(t)s.parentSizeObserver.observe(t)};this.onStickToDisplayEvent=function(t){if(t.detail.sticker!==s.stickToEle)return;switch(t.type){case"nanoHide":s._offset=0;s.cacheOffset=s.offset;s.offset=0;if(!s.isStuck)s.moveTrigger(false);if(!s.isRootSticker&&s.quietModeIsOn){c((function(){s.stickToEle.style.minHeight=s.stickToEleInitSize.height+(s.host.scrollHeight+(typeof s.cacheOffset==="object"?s.cacheOffset.v:s.cacheOffset))+"px";s.stickToEle.setTriggerPos(s.stickToEleInitSize.height*-1)}))}break;case"nanoShow":s._offset=s.stickToEleInitSize.height;s.offset=s.cacheOffset;s.moveTrigger(true);if(!s.isRootSticker&&s.quietModeIsOn){c((function(){s.stickToEle.style.minHeight="";s.stickToEle.setTriggerPos(0)}))}break;case"nanoStuck":s.stickToEleInitSize=s.stickToEle.getBoundingClientRect();s._offset=s.stickToEleInitSize.height;break}};this.onStickEvent=function(t){return __awaiter(s,void 0,void 0,(function(){var e,i;return __generator(this,(function(s){switch(s.label){case 0:e=t.detail?t.detail.sticker:null;if(!e||e.position!==this.position)return[2];return[4,e.getTriggerPos()];case 1:i=s.sent();if(t.type==="nanoStuck"&&e!==this.host&&e.scrollParent===this.host.scrollParent){this.stickerIndex++;if(!this.hideOnNewStickers)return[2];if(this.positions.includes("top")&&this.triggerPos.top<i.top||this.positions.includes("bottom")&&this.triggerPos.top>i.top){this.multiStickerHide=true;this.stuckCounter++}}if(t.type==="nanoUnstuck"&&e!==this.host&&e.scrollParent===this.host.scrollParent){this.stickerIndex--;if(!this.hideOnNewStickers)return[2];if(this.positions.includes("top")&&this.triggerPos.top<i.top||this.positions.includes("bottom")&&this.triggerPos.top>i.top){this.stuckCounter--;if(this.stuckCounter<1)this.multiStickerHide=false}}return[2]}}))}))};this.onScroll=function(){var t=d(s.scrollParent);if(t<s.scrollPosCache){if(!s.positions.includes("bottom"))s.handleScrollTo();else s.handleScrollAway(t)}if(t>s.scrollPosCache){if(!s.positions.includes("bottom"))s.handleScrollAway(t);else s.handleScrollTo()}s.scrollPosCache=t}}t.prototype.isHiding=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.hide]}))}))};t.prototype.isSticking=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.shouldStick();return[2,this.isStuck]}))}))};t.prototype.setTriggerPos=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this._offset=t]}))}))};t.prototype.getTriggerPos=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.triggerPos]}))}))};t.prototype.pauseHiding=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.pauseHide=t]}))}))};t.prototype.updateTriggerOffset=function(){if(!this.trigger||!this.scrollParent||!this.listenForScrollParent)return;this.triggerPos=p(this.trigger,this.scrollParent)};t.prototype.stickerResizeListener=function(){var t=this;if(this.contentSizeObserver){this.contentSizeObserver.disconnect();this.contentSizeObserver=undefined}this.contentSizeObserver=new r((function(e){for(var i=0,s=e;i<s.length;i++){var n=s[i];if(t.pauseResizeWatcher)return;if(n.contentRect.height){if(t.position==="top")t.host.style.height=n.contentRect.height+"px";if(t.position==="bottom")t.host.style.minHeight=n.contentRect.height+"px"}}}));this.contentSizeObserver.observe(this.content)};t.prototype.quietModeChange=function(){var t=this;if(this.quietMode==="on")c((function(){return t.quietModeIsOn=true}));else if(this.quietMode==="off")c((function(){return t.quietModeIsOn=false}))};t.prototype.setOffset=function(){var t,e,i,s;var n=this;this.trigger.setAttribute("style","");var o,r,c,h;var l=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!l)return;if(typeof this.offset==="object")t=this.offset,o=t.v,r=t.h;else o=r=this.offset;if(typeof this._offset==="object")e=this._offset,i=e.v,o=i===void 0?c:i,s=e.h,r=s===void 0?h:s;else c=h=this._offset;var u=function(t){var e=t.match(/(top|bottom)/)?o:r;f(t);l.style[t]=e+"px";if(!a())return;if(e)n.host.style.setProperty("--hide-transform-amount","(110% + "+e+"px)");else n.host.style.setProperty("--hide-transform-amount",null)};var f=function(t){var e=t.match(/(top|bottom)/)?o+c:r+h;n.trigger.style[t]=e*-1+"px";n.trigger.style.position="relative";n.trigger.style.height="1px"};if(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)u("right");if(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)u("left");if(this.positions.includes("top"))u("top");if(this.positions.includes("bottom"))u("bottom")};t.prototype.positionChange=function(){this.positions=this.position.split("-");this.setOffset()};t.prototype.stuckChange=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){if(this.isStuck){if(this.stickToEle){t=h(this.host)?this.host.children:this.content.children;this.slottedContent=Array.from(t);this.slottedContent.forEach((function(t){if(h(e.host))e.stickToEle.appendChild(t);else e.stickToEle.querySelector(".sticker-content").appendChild(t);t.style.order=e.stickerIndex+""}));this.nanoStuck.emit({sticker:this.stickToEle})}else this.nanoStuck.emit({sticker:this.host})}else{this.scrollHide=false;if(this.stickToEle){this.slottedContent.forEach((function(t){e.host.appendChild(t);t.style.order=""}));this.nanoUnstuck.emit({sticker:this.stickToEle})}else this.nanoUnstuck.emit({sticker:this.host})}return[2]}))}))};t.prototype.attachScrollListeners=function(){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)}};t.prototype.handleParentEvents=function(t,e){if(e===void 0){e=null}if(!this.listenForScrollParent)return;if(e)this.manageListenersOnParent(false,e);if(this.scrollParent)this.manageListenersOnParent(!this.stickToEle)};t.prototype.stickToEleChange=function(t,e){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(e){e.removeEventListener("nanoHide",this.onStickToDisplayEvent);e.removeEventListener("nanoShow",this.onStickToDisplayEvent);e.removeEventListener("nanoStuck",this.onStickToDisplayEvent);e.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent)}};t.prototype.stickToChange=function(){if(this.stickTo)this.stickToEle=this.scrollParent.querySelector(this.stickTo);else this.stickToEle=undefined};t.prototype.visibilityDecisionHandler=function(){if(this.multiStickerHide||this.scrollHide)this.hide=true;else this.hide=false};t.prototype.handleHideChange=function(){if(this.hide)this.nanoHide.emit({sticker:this.host});else this.nanoShow.emit({sticker:this.host})};t.prototype.setupIO=function(){var t=this;if(this.io){this.io.disconnect();this.io=undefined}if(!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;var e=this.scrollParent;if(this.scrollParent instanceof Document)e=null;this.io=new window.IntersectionObserver((function(e){if(t.pauseResizeWatcher||!t.isSticky)return;t.shouldStick(e.slice(-1)[0])}),{root:e});this.io.observe(this.trigger)};t.prototype.manageListenersOnParent=function(t,e){var i=e||this.scrollParent;if(!i)return;if(!t){try{if(this.quietModeIsOn)i.removeEventListener("scroll",this.onScroll);i.removeEventListener("nanoStuck",this.onStickEvent);i.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(s){console.error("Events haven`t been added")}}else{i.addEventListener("nanoStuck",this.onStickEvent);i.addEventListener("nanoUnstuck",this.onStickEvent);if(this.quietModeIsOn)this.attachScrollListeners()}this.setupParentResizeListener()};t.prototype.handleScrollTo=function(){this.scrollPosThresholdCache=null;if(!this.scrollHide)return;if(this.scrollingTo!==true){this._offset=this.cacheOffset||this._offset}this.scrollingTo=true;this.scrollHide=false};t.prototype.handleScrollAway=function(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};t.prototype.moveTrigger=function(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)};t.prototype.getScrollParent=function(){var t=/(auto|scroll)/;var e=function(t,i){if(t.parentNode===null){return i}return e(t.parentNode,i.concat([t]))};var i=function(t,e){return getComputedStyle(t,null).getPropertyValue(e)};var s=function(t){return i(t,"overflow")+i(t,"overflow-y")+i(t,"overflow-x")};var n=function(e){return t.test(s(e))};var o=document.documentElement.getBoundingClientRect().height;var r=function(t){if(!(t instanceof HTMLElement))return;var i=e(t,[]);return i.find((function(t){return n(t)&&t.getBoundingClientRect().height!==o}))||document};return r(this.host)};t.prototype.shouldStick=function(t){var e;if(this.positions.includes("top")){if(!this.isRootSticker)e=p(this.trigger,this.scrollParent).top;else e=this.trigger.getBoundingClientRect().top;this.isStuck=e<-1}else if(this.positions.includes("bottom")){e=this.trigger.getBoundingClientRect().top;var i=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=e>i.height+i.top}};t.prototype.bootstrapGurantor=function(){var t=this;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((function(e){return e.position===t.position})).findIndex((function(e){return e===t.host}));this.setOffset();this.stickerResizeListener();this.setupParentResizeListener();this.slottedContent=Array.from(this.host.children);this.slottedContent.forEach((function(e){e.style.order=t.stickerIndex+""}));this.updateTriggerOffset();this.stickToChange();this.setupIO();this.onStickToDisplayEvent=u(this.onStickToDisplayEvent,50)};t.prototype.connectedCallback=function(){var t=this;this.isRtl=this.host.dir==="rtl"||this.host.ownerDocument.dir==="rtl";document.documentElement.addEventListener("nanoComponentsReady",(function(){setTimeout((function(e){return t.bootstrapGurantor()}),200)}));setTimeout((function(e){if(!t.hasBootstrapped)t.bootstrapGurantor()}),1e3)};t.prototype.disconnectedCallback=function(){if(this.io){this.io.disconnect();this.io=undefined}if(this.parentSizeObserver){this.parentSizeObserver.disconnect();this.parentSizeObserver=undefined}this.scrollParent=null;this.hasBootstrapped=false};t.prototype.render=function(){var t=this;return s(n,{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:function(e){return t.sticker=e}},s("div",{class:"sticker-content",ref:function(e){return t.content=e}},s("slot",null))))};Object.defineProperty(t.prototype,"host",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){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"]}},enumerable:false,configurable:true});return t}());k.style=f}}}));
5
- //# sourceMappingURL=p-1a30dfdd.system.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/sticker/sticker.scss?tag=nano-sticker&encapsulation=shadow","src/components/sticker/sticker.tsx"],"names":["stickerCss","_getScrollTop","ele","Document","window","pageYOffset","scrollTop","_getOffset","parent","parentEle","document","documentElement","getOffset","Sticker","exports","class_1","hostRef","_this","this","isRtl","scrollPosCache","scrollPosThresholdCache","cacheOffset","pauseResizeWatcher","listenForScrollParent","positions","pauseHide","hasBootstrapped","isStuck","isRootSticker","hide","scrollHide","multiStickerHide","scrollingTo","quietModeIsOn","stuckCounter","stickerIndex","_offset","autoResize","isSticky","offset","position","quietMode","h","w","hideOnNewStickers","breakPointMax","breakPointMin","setupParentResizeListener","parentSizeObserver","disconnect","undefined","ResizeObserver","entries","_i","entries_1","length","entry","height","width","contentRect","sticker","style","host","scrollWidth","toWatch","scrollParent","observe","onStickToDisplayEvent","e","detail","stickToEle","type","moveTrigger","raf","minHeight","stickToEleInitSize","scrollHeight","v","setTriggerPos","getBoundingClientRect","onStickEvent","__awaiter","getTriggerPos","incomingTriggerPos","_a","sent","includes","triggerPos","top","onScroll","y","handleScrollTo","handleScrollAway","prototype","isHiding","isSticking","shouldStick","pauseHiding","pause","updateTriggerOffset","trigger","stickerResizeListener","contentSizeObserver","entries_2","content","quietModeChange","setOffset","setAttribute","_v","_h","_b","_c","_d","setPos","pos","u","match","setTriggetPos","browserCanUseCssVariables","setProperty","positionChange","split","stuckChange","hasShadowDom","children","slottedContent","Array","from","forEach","child","appendChild","querySelector","order","nanoStuck","emit","nanoUnstuck","attachScrollListeners","addEventListener","passive","capture","removeEventListener","handleParentEvents","_","oldParent","manageListenersOnParent","stickToEleChange","oldEle","stickToChange","stickTo","visibilityDecisionHandler","handleHideChange","nanoHide","nanoShow","setupIO","io","root","IntersectionObserver","slice","addEvents","console","error","currScroll","Math","abs","toInitial","parentNode","insertBefore","nextSibling","getScrollParent","regex","parents","_node","ps","concat","prop","getComputedStyle","getPropertyValue","overflow","scroll","test","docHeight","HTMLElement","find","data","scrollAmt","parentBounding","rootBounds","bootstrapGurantor","createElement","classList","add","querySelectorAll","filter","findIndex","debounce","connectedCallback","dir","ownerDocument","setTimeout","disconnectedCallback","render","Host","sticky","siblings","index","stuck","placed-bottom","placed-top","placed-end","placed-start","class","ref","div"],"mappings":";;;6WAAA,IAAMA,EAAa,2tECsBnB,SAASC,EAAcC,GACrB,OAAOA,aAAeC,SAAWC,OAAOC,YAAcH,EAAII,UAG5D,SAASC,EAAWL,EAAkBM,GACpC,IAAIC,EACFD,aAAkBL,SAAWO,SAASC,gBAAkBH,EAC1D,OAAOI,EAAUV,EAAKO,OAcXI,EAAOC,EAAA,eAAA,WALpB,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,mKAMUA,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,MAMjBT,KAAAU,QAAU,MACVV,KAAAW,cAAgB,KAChBX,KAAAY,KAAO,MACPZ,KAAAa,WAAa,MACbb,KAAAc,iBAAmB,MACnBd,KAAAe,YAAc,MACdf,KAAAgB,cAAgB,MAChBhB,KAAAiB,aAAe,EACfjB,KAAAkB,aAAe,EAIflB,KAAAmB,QA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\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-width: 100%;\n}\n\n:host([sticky]) {\n position: sticky;\n transition: 0.3s ease transform;\n will-change: min-height;\n}\n\n:host([sticky][stuck]) {\n left: var(--stuck-left);\n right: 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-width: inherit;\n width: 100%;\n\n &:not(.stuck) {\n width: 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 left: var(--stuck-left);\n right: var(--stuck-right);\n z-index: var(--stuck-z-index);\n transform: translateY(0);\n\n :host([placed-top]) & {\n top: 0;\n }\n\n :host([placed-bottom]) & {\n bottom: 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 ResizeObserver from 'resize-observer-polyfill';\nimport {\n browserCanUseCssVariables,\n debounce,\n getOffset,\n hasShadowDom,\n raf,\n} from '../../utils';\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 let 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 * A JS query selector that returns a <nano-sticker> */\n @Prop() stickTo: string;\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.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') raf(() => (this.quietModeIsOn = true));\n else if (this.quietMode === 'off') raf(() => (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 let 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 let u = pos.match(/(top|bottom)/) ? v : h;\n setTriggetPos(pos);\n sticker.style[pos] = u + 'px';\n if (!browserCanUseCssVariables()) return;\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 let 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.height = '1px';\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 let content = hasShadowDom(this.host)\n ? this.host.children\n : this.content.children;\n this.slottedContent = Array.from(content);\n\n this.slottedContent.forEach((child: HTMLElement) => {\n if (hasShadowDom(this.host)) this.stickToEle.appendChild(child);\n else\n this.stickToEle\n .querySelector('.sticker-content')\n .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 (this.stickTo)\n this.stickToEle = this.scrollParent.querySelector(this.stickTo);\n else this.stickToEle = undefined;\n }\n\n /** 2 potential criteria for hiding. Multi-stickers or quietmode. */\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 'smallscreen', or there is a breakpointmax / min it will add a resizeobserver to conditionally add behaviour */\n private setupParentResizeListener = () => {\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 let 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 ammend the hide/show trigger\n * Main diffs from rootstickers / 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 raf(() => {\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 raf(() => {\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 let 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 let 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 let 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 /** Gets the 'closest' scrolling parent */\n private getScrollParent() {\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 (!(_node instanceof HTMLElement)) 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 scrollAmt = this.trigger.getBoundingClientRect().top;\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 = 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.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 metthods\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"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/file-upload/file-upload.scss?tag=nano-file-upload&encapsulation=scoped","src/components/file-upload/file-upload.tsx"],"names":["fileUploadCss","fileInputIds","getDataTransfer","DataTransfer","_a","ClipboardEvent","clipboardData","_b","FileUpload","[object Object]","hostRef","this","fileInputId","canChangeFileList","removeFiles","errorMessage","isDragging","fileList","maxFileSize","maxFiles","placeholder","hideLabel","required","disabled","clearInput","showInlineError","validateOn","_invalid","onClearClick","value","onBlur","hasFocus","validate","showInlineValidation","nanoBlur","emit","onFocus","nanoFocus","inputEl","setCustomValidity","error","validity","valid","validationMessage","forEach","fileItem","checkFileSize","file","size","checkFileType","type","accept","length","onInvalid","ev","preventDefault","onFileChoose","e","files","target","addNewFiles","onFileRemoveFileClick","push","closest","classList","remove","onFileRemoveAnim","filter","find","rmFile","onInputChange","nanoChange","onDragStop","stopPropagation","onDragStart","onDrop","dataTransfer","FileUploadInput","eleType","listId","labelId","moreId","hasHelperSlot","h","class","htmlFor","id","onDragEnd","onDragLeave","onDragEnter","onDragOver","label","hasLabelSlot","name","tabindex","onClick","aria-labelledby","multiple","undefined","form","ref","input","publicInputEl","onChange","onReset","tabIndex","button","dropArea","map","key","onAnimationEnd","_","content","placement","iconName","href","location","arrToFileList","setTimeout","requestAnimationFrame","invalid","validityMessage","Array","from","objectURL","URL","createObjectURL","val","validateFirst","isValid","focus","Promise","resolve","message","composedPath","every","node","host","document","querySelector","i","len","items","add","match","nanoValidate","originalEvent","mo","disconnect","MutationObserver","processSlottedContent","observe","childList","subtree","querySelectorAll","newFiles","findFile","slotChangeObserver","Host","file-upload","file-upload--dragging","file-upload--focus","file-upload--invalid"],"mappings":";;;gEAAA,MAAMA,EAAgB,i1dCsBtB,IAAIC,EAAe,EAEnB,IAAIC,EAAkB,IAAM,IAAIC,aAChC,IACED,IACA,MAAAE,GACA,IACEF,EAAkB,IAAM,IAAIG,eAAe,IAAIC,cAC/CJ,IACA,MAAAK,GACAL,EAAkB,UAsBTM,EAAU,MALvBC,YAAAC,uKASUC,KAAAC,YAAc,oBAAoBX,MAClCU,KAAAE,oBAAsBX,EACtBS,KAAAG,YAAgC,GAI/BH,KAAAI,aAAuB,GACvBJ,KAAAK,WAAa,MACbL,KAAAM,SAA6B,GAgC9BN,KAAAO,YAAsB,EAGtBP,KAAAQ,SAAmB,EAMnBR,KAAAS,YAAsB,mBAGtBT,KAAAU,UAAsB,MAGtBV,KAAAW,SAAW,MAGMX,KAAAY,SAAW,MAI5BZ,KAAAa,WAAa,MAGIb,KAAAc,gBAAkB,KAGlBd,KAAAe,WACvB,SAqBOf,KAAAgB,SAAW,MA+HZhB,KAAAiB,aAAe,KACrBjB,KAAKkB,MAAQ,IAGPlB,KAAAmB,OAAS,KACfnB,KAAKoB,SAAW,MAChBpB,KAAKqB,WACL,GAAIrB,KAAKe,aAAe,QAASf,KAAKsB,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K8H,KAAKiB,iBAAiB,kBACjD/I,KAAKuE,gBAAkBvE,KAAK8H,KAAKE,cAAc,mBAGzClI,YAAYiD,GAClB,MAAMzC,EAA6ByG,MAAMC,KAAKjE,GAAOkD,KAAK7D,IACjD,CACLA,KAAMA,EACNqE,SAAUS,IAAIC,gBAAgB/E,GAC9BL,MAAO,KACPC,kBAAmB,SAMvB,GAAIhC,KAAKE,mBAAqBF,KAAKQ,SAAW,EAAG,CAC/C,MAAMwI,EAAW1I,EAASkD,QACvByF,IACEjJ,KAAKM,SAASmD,MAAMrB,GAASA,EAAKA,KAAK8C,OAAS+D,EAAS7G,KAAK8C,SAEnElF,KAAKM,SAAW,IAAIN,KAAKM,YAAa0I,QACjChJ,KAAKM,SAAWA,EA0DzBR,uBACE,GAAIE,KAAKwI,GAAIxI,KAAKwI,GAAGC,aAGvB3I,mBACEE,KAAKkJ,qBAGPpJ,oBACEE,KAAK2I,wBA8LP7I,SACE,OACE0E,EAAC2E,EAAI,KACH3E,EAAA,MAAA,CACEC,MAAO,CACL2E,cAAe,KACfC,wBAAyBrJ,KAAKK,WAC9BiJ,qBAAsBtJ,KAAKoB,SAC3BmI,uBAAwBvJ,KAAKgB,WAG9BhB,KAAKQ,SAAW,EAAIgE,EAACxE,KAAKgG,SAAQ,MAAMxB,EAACxE,KAAK+F,OAAM","sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../../global/style/nano-theme/base';\n@import '../../global/style/nano-theme/button';\n\n:host {\n /**\n * @prop --invalid-msg-color: Default value #{nano-color(danger, base)};\n * @prop --invalid-msg-font-size: Default value #{$input-help-font-size};\n\n * @prop --help-msg-color: Default value #{$input-help-color};\n\n * @prop --label-color: Default value #{$label-color};\n * @prop --label-color--invalid: Default value #{$label-color-invalid};\n * @prop --label-font-size: Default value #{$label-font-size};\n * @prop --label-padding: Default value #{$input-padding-bottom};\n * @prop --label-color--invalid: Default value #{$label-color-invalid};\n\n * @prop --drop-bg: Default value #{map.get($colors, blue--faded)};\n * @prop --drop-text: Default value #{map.get($colors, dimgrey)};\n * @prop --drop-height: Default value 3.5em;\n * @prop --drop-border-tint: Default value #{nano-color(primary, base, null, true)};\n * @prop --drop-border-width: Default value 2px;\n * @prop --drop-border-radius: Default value 5px;\n * @prop --drop-bg--invalid: Default value #{$input-background-color--invalid};\n * @prop --drop-border--invalid: Default value #{nano-color(danger, base, null, true)};\n\n * @prop --btn-bg: Default value #{nano-color(primary, base)};\n * @prop --btn-text: Default value #{nano-color(primary, contrast)};\n * @prop --btn-icon-size: Default value var(--nano-btn-icon-size, 1.4em);\n * @prop --btn-padding-top: Default value var(--nano-btn-padding-top, .5em);\n * @prop --btn-padding-bottom: Default value var(--nano-btn-padding-bottom, .5em);\n * @prop --btn-padding-start: Default value var(--nano-btn-padding-start, 1em);\n * @prop --btn-padding-end: Default value var(--nano-btn-padding-end, 1em);\n */\n\n min-height: 1rem;\n display: block;\n\n --invalid-msg-color: #{nano-color(danger, base)};\n --invalid-msg-font-size: #{$input-help-font-size};\n --help-msg-color: #{$input-help-color};\n --label-color: #{$label-color};\n --label-font-size: #{$label-font-size};\n --label-padding: #{$input-padding-bottom};\n --label-color--invalid: #{$label-color-invalid};\n --drop-bg: #{map.get($colors, blue--faded)};\n --drop-text: #{darken(map.get($colors, dimgrey), 11%)};\n --drop-height: 3.5em;\n --drop-border-tint: #{nano-color(primary, base, null, true)};\n --drop-border-width: 2px;\n --drop-border-radius: 5px;\n --drop-bg--invalid: #{$input-background-color--invalid};\n --drop-border--invalid: #{nano-color(danger, base, null, true)};\n --btn-bg: #{nano-color(primary, base)};\n --btn-text: #{nano-color(primary, contrast)};\n --btn-icon-size: var(--nano-btn-icon-size, 1.4em);\n --btn-padding-top: var(--nano-btn-padding-top, 0.5em);\n --btn-padding-bottom: var(--nano-btn-padding-bottom, 0.5em);\n --btn-padding-start: var(--nano-btn-padding-start, 1em);\n --btn-padding-end: var(--nano-btn-padding-end, 1em);\n}\n\n:host([disabled]:not([disabled='false'])) {\n opacity: 0.7;\n\n * {\n pointer-events: none !important;\n }\n}\n\n.file-upload {\n $self: &;\n\n /* Common */\n\n &__label {\n font-size: var(--label-font-size);\n padding: 0 0 var(--label-padding);\n margin: 0;\n line-height: 1;\n\n :host([invalid]:not([invalid='false'])) & {\n color: var(--label-color--invalid);\n }\n }\n\n &__input {\n @include visually-hide();\n }\n\n &__error,\n &__help,\n &__more,\n &__label {\n display: block;\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n &__more {\n height: 1em;\n\n @include margin(\n calc(var(--label-padding) / 2),\n 0,\n var(--label-padding),\n 3px\n );\n\n position: relative;\n }\n\n &__error,\n &__help {\n top: 0;\n left: 0;\n position: absolute;\n font-size: var(--invalid-msg-font-size);\n line-height: 1.2;\n transition: 0.3s ease-out opacity;\n\n .file-upload--invalid & {\n opacity: 1;\n }\n }\n\n &__error {\n color: var(--invalid-msg-color);\n font-stretch: condensed;\n opacity: 0;\n\n .file-upload--invalid & {\n opacity: 1;\n }\n }\n\n &__help {\n font-style: italic;\n opacity: 1;\n color: var(--help-msg-color);\n\n .file-upload--invalid & {\n opacity: 0;\n }\n }\n\n /* Drop area / Multi file upload */\n\n &__drop {\n position: relative;\n width: 100%;\n display: inline-block;\n }\n\n &__drop-area {\n flex-direction: column;\n background-color: var(--drop-bg);\n color: var(--drop-text);\n min-height: var(--drop-height);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 0.9em;\n position: relative;\n transition: background-color 0.15s ease-in-out;\n padding: 0.5rem;\n\n :host([disabled]:not([disabled='false'])) & {\n opacity: 0.7;\n }\n\n .file-upload--invalid & {\n background-color: var(--drop-bg--invalid);\n }\n\n .file-upload--dragging & {\n background-color: #{map.get($colors, white)};\n }\n\n &::after {\n content: '';\n position: absolute;\n border-radius: var(--drop-border-radius);\n border-width: var(--drop-border-width);\n border-color: rgba(var(--drop-border-tint), 0.5);\n border-style: dashed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n transition:\n top 0.1s ease-in-out,\n bottom 0.1s ease-in-out,\n left 0.1s ease-in-out,\n right 0.1s ease-in-out;\n\n .file-upload--invalid & {\n border-color: rgba(var(--drop-border--invalid), 1);\n }\n\n .file-upload--dragging & {\n top: 5px;\n bottom: 5px;\n left: 5px;\n right: 5px;\n }\n }\n\n span {\n color: rgba(var(--drop-border-tint), 1);\n text-decoration: underline;\n border-radius: 2px;\n z-index: 1;\n cursor: pointer;\n position: relative;\n\n .file-upload--focus & {\n box-shadow: #{$control-focus-style};\n }\n }\n }\n\n &__list {\n list-style: none;\n margin: 0;\n padding: 0;\n\n &-wrap {\n position: relative;\n top: -4px;\n }\n\n &-item {\n width: 100%;\n margin: 0 0 2px;\n display: flex;\n align-items: center;\n transform: translateZ(0);\n animation: hideListItem 0.3s ease-in-out forwards;\n\n @keyframes hideListItem {\n 0% {\n opacity: 1;\n transform: translateY(0);\n transform: translateZ(0);\n }\n\n 100% {\n opacity: 0;\n transform: translateY(10px);\n transform: translateZ(0);\n }\n }\n\n &--active {\n animation: showListItem 0.3s ease-in-out forwards;\n\n @keyframes showListItem {\n 0% {\n opacity: 0;\n transform: translateY(10px);\n transform: translateZ(0);\n }\n\n 100% {\n opacity: 1;\n transform: translateY(0);\n transform: translateZ(0);\n }\n }\n }\n }\n\n .list-title {\n background: var(--nano-color-blue--faded);\n border-radius: 5px;\n padding: 5px 5px;\n margin-right: 2px;\n display: block;\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n font-size: 0.9em;\n color: var(--help-msg-color);\n }\n\n .list-button {\n background: var(--nano-color-blue--faded);\n border-radius: 5px;\n margin: 2px;\n }\n\n .list-error {\n --color: rgba(var(--drop-border--invalid), 1);\n }\n }\n\n /* Button display / Single file upload */\n\n &__button {\n @include button-base;\n @include button-standard(\n var(--btn-bg),\n var(--btn-text),\n #{nano-color(primary, shade)}\n );\n\n --nano-btn-icon-size: var(--btn-icon-size);\n --nano-btn-line-height: var(--btn-icon-size);\n --nano-btn-padding-top: var(--btn-padding-top);\n --nano-btn-padding-bottom: var(--btn-padding-bottom);\n --nano-btn-padding-start: var(--btn-padding-start);\n --nano-btn-padding-end: var(--btn-padding-end);\n\n max-width: 100%;\n font-size: 0.9em;\n\n :host([disabled]:not([disabled='false'])) & {\n opacity: 0.4;\n }\n\n .file-upload--dragging & {\n --nano-btn-border-style: dashed;\n }\n #{$self}__clear-btn {\n @include margin(0);\n\n font-size: inherit;\n padding: 0;\n border: 0;\n outline: none;\n background-color: transparent;\n display: flex;\n align-items: stretch;\n width: auto;\n color: var(--clear-btn-color);\n\n :host(.is-invalid) & {\n color: var(--clear-btn-color--invalid);\n }\n\n nano-icon {\n @include margin(0, 0, 0, 0.4rem);\n }\n }\n #{$self}__btn-content {\n display: flex;\n align-items: center;\n\n span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n }\n }\n}\n","import {\n Component,\n Prop,\n h,\n Host,\n Element,\n ComponentInterface,\n State,\n Event,\n EventEmitter,\n Watch,\n VNode,\n Method,\n Listen,\n} from '@stencil/core';\nimport {\n ControlValidity,\n ControlValidityEventDetail,\n FileInputChangeEventDetail,\n FileWithUrl,\n} from '../../interface';\n\nlet fileInputIds = 0;\n\nlet getDataTransfer = () => new DataTransfer();\ntry {\n getDataTransfer();\n} catch {\n try {\n getDataTransfer = () => new ClipboardEvent('').clipboardData;\n getDataTransfer();\n } catch {\n getDataTransfer = null;\n }\n}\n\ninterface FileValidation {\n file: File;\n valid: boolean;\n validationMessage?: string;\n location?: string;\n}\n/**\n * A better UI experience for `input type=\"file\"` form controls.\n *\n * - Drag and Drop\n * - Validation options\n * - Preview and manage multiple files\n */\n@Component({\n tag: 'nano-file-upload',\n styleUrl: 'file-upload.scss',\n scoped: true,\n})\nexport class FileUpload implements ComponentInterface {\n private inputEl: HTMLInputElement;\n private publicInputEl: HTMLInputElement;\n private mo!: MutationObserver;\n private fileInputId = `nano-file-upload-${fileInputIds++}`;\n private canChangeFileList = !!getDataTransfer;\n private removeFiles: FileValidation[] = [];\n\n @State() hasHelperSlot: boolean;\n @State() hasLabelSlot: boolean;\n @State() errorMessage: string = '';\n @State() isDragging = false;\n @State() fileList: FileValidation[] = [];\n @Watch('fileList')\n fileListChange() {\n if (this.canChangeFileList) {\n this.publicInputEl.value = '';\n this.inputEl.files = this.arrToFileList(\n this.fileList.map((file) => file.file)\n );\n setTimeout(() => {\n this.nanoChange.emit({ value: this.value, files: this.files });\n }, 20);\n }\n }\n @State() hasFocus: boolean;\n\n @Element() host: HTMLNanoFileUploadElement;\n\n // public props\n\n /** Name of the form control. Submitted with the form as part of a name/value pair. */\n @Prop() name!: string;\n\n /** The accept attribute value is a string that defines the file types the file input should accept.\n * E.g. for a MS Word file: `.doc, .docx,application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document` */\n @Prop() accept?: string;\n\n /** Specifies which camera to use for capture of image or video data. `user` for the user-facing camera and/or microphone.\n * `environment` specifies the the outward-facing camera and/or microphone. If the requested facing mode isn't available,\n * the user agent may fall back to its preferred default mode. */\n @Prop() capture?: 'user' | 'environment';\n\n /** The maximum file size allowed per file (Megabytes) */\n @Prop() maxFileSize: number = 1;\n\n /** The maximum file size allowed per file (bytes). */\n @Prop() maxFiles: number = 1;\n\n /** String to place within a label element. */\n @Prop() label!: string;\n\n /** Placeholder only used within single file uploads. */\n @Prop() placeholder: string = 'Choose a file...';\n\n /** Visually hide the label - but make it accessible. */\n @Prop() hideLabel?: boolean = false;\n\n /** If `true`, the user must select a file to upload before submitting a form. */\n @Prop() required = false;\n\n /** If `true`, the user cannot interact with the select. */\n @Prop({ reflect: true }) disabled = false;\n\n /** If `true`, a clear icon will appear in the input when there is a value.\n * Clicking it clears the input. Only used within single file uploads. */\n @Prop() clearInput = false;\n\n /** Whether to show validation errors underneath input */\n @Prop({ reflect: true }) showInlineError = true;\n\n /** When should the field perform validation */\n @Prop({ mutable: true }) validateOn?: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submit';\n\n /** The form element to associate with this input (its form owner). Must be the id of a form. */\n @Prop() form?: string | null;\n\n @Watch('maxFiles')\n @Watch('maxFileSize')\n @Watch('capture')\n @Watch('accept')\n @Watch('required')\n @Watch('disabled')\n @Watch('fileList')\n protected shouldValidate() {\n if (!this.inputEl) return;\n\n this.validate();\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.showInlineValidation();\n });\n }\n\n @State() _invalid = false;\n /** This will be true when the control is in an invalid state.\n * Validity is determined by the `required` prop. Or if custom validity message is set. @readonly */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.inputEl) return '';\n return this.inputEl.validationMessage;\n }\n\n /** A File array that lists every selected file.\n * Has an added `objectURL` property returning a `DOMString`\n * containing an object URL that can be used to reference the contents of the specified source\n * This list has no more than one member unless the multiple attribute is specified. @readonly */\n @Prop()\n get files(): FileWithUrl[] {\n return this.inputEl\n ? Array.from(this.inputEl.files).map((file: FileWithUrl) => {\n file.objectURL = URL.createObjectURL(file);\n return file;\n })\n : [];\n }\n\n /** A file input's value attribute contains a DOMString that represents the path to the selected file(s).\n * If the user selected multiple files, the value represents the first file in the list of files they selected.\n * You can reset the file-upload control by setting the value to an emptry string e.g. `var input.value = ''` */\n @Prop()\n get value() {\n return this.inputEl ? this.inputEl.value : '';\n }\n set value(val: string) {\n if (val === '' && this.inputEl) {\n this.fileList = [];\n this.inputEl.value = '';\n }\n }\n\n // Events\n\n /** Emitted when the value has changed. */\n @Event() nanoChange!: EventEmitter<FileInputChangeEventDetail>;\n\n /** Emited when the checkbox is focused */\n @Event() nanoFocus: EventEmitter;\n\n /** Emited when the checkbox is blurred */\n @Event() nanoBlur: EventEmitter;\n\n /** Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`. */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n // Public methods\n\n /** Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }` */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n if (validateFirst) {\n this.validate();\n this.showInlineValidation();\n }\n return {\n isValid: !this.invalid,\n errorMessage: this.inputEl.validationMessage,\n };\n }\n\n /** Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`. */\n @Method()\n async setFocus() {\n if (this.inputEl) this.inputEl.focus();\n }\n\n /** Returns the native `<input>` element used under the hood */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.inputEl!);\n }\n\n /** Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.\n * @param message */\n @Method()\n async showError(message: string) {\n if (this.inputEl) {\n this.inputEl.setCustomValidity(message);\n this.validate();\n this.showInlineValidation();\n }\n }\n\n // Listeners\n\n @Listen('click', { target: 'window' })\n globalClickHandler(e: Event) {\n if (!this.hasFocus) return;\n if (e.composedPath().every((node) => node !== this.host)) this.onBlur();\n }\n\n @Listen('keydown', { target: 'window' })\n globalKeydownHandler(e: KeyboardEvent) {\n if (!this.hasFocus || e.key !== 'Tab') return;\n if (e.target !== this.inputEl) this.onBlur();\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.host.closest('form');\n if (!form || e.target !== this.host.closest('form')) return;\n\n this.value = '';\n }\n\n // Private methods\n\n private onClearClick = () => {\n this.value = '';\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.validate();\n if (this.validateOn === 'dirty') this.showInlineValidation();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.nanoFocus.emit();\n };\n\n private arrToFileList(files: File[]): FileList {\n const fileList = getDataTransfer();\n for (var i = 0, len = files.length; i < len; i++)\n fileList.items.add(files[i]);\n return fileList.files;\n }\n\n private checkFileSize(size: number): boolean {\n return size / 1000000 <= this.maxFileSize;\n }\n\n private checkFileType(type: string): boolean {\n if (!this.accept) return true;\n return this.accept.match(type) && this.accept.match(type).length > 0;\n }\n\n private validate = () => {\n this.errorMessage = '';\n this.inputEl.setCustomValidity('');\n let error: string;\n\n if (!this.inputEl.validity.valid) {\n error = this.inputEl.validationMessage;\n } else {\n this.fileList.forEach((fileItem) => {\n error = null;\n if (!this.checkFileSize(fileItem.file.size)) {\n error =\n 'Maximum file size exceeded. Max file size is ' +\n this.maxFileSize +\n 'Mb';\n } else if (!this.checkFileType(fileItem.file.type))\n error = `File type is not allowed (${this.accept})`;\n\n fileItem.validationMessage = error;\n fileItem.valid = !error;\n });\n if (this.fileList.length > this.maxFiles)\n error = `Maxinum number of files exceeded (${this.maxFiles})`;\n }\n\n if (!!error) this.inputEl.setCustomValidity(error);\n };\n\n private showInlineValidation(ev?: Event) {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n this._invalid = false;\n this.errorMessage = '';\n\n if (!this.inputEl.validity.valid) {\n this.errorMessage = this.inputEl.validationMessage;\n this._invalid = true;\n }\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.inputEl.validationMessage,\n originalEvent: ev,\n });\n }\n\n private slotChangeObserver() {\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.host, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have slot content\n this.hasLabelSlot = !!this.host.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.host.querySelector('[slot=\"helper\"]');\n }\n\n private addNewFiles(files: FileList) {\n const fileList: FileValidation[] = Array.from(files).map((file) => {\n return {\n file: file,\n location: URL.createObjectURL(file),\n valid: true,\n validationMessage: null,\n };\n });\n\n // if we have a list and we're in a browser that can amend files\n // append files to the list, otherwise replace\n if (this.canChangeFileList && this.maxFiles > 1) {\n const newFiles = fileList.filter(\n (findFile) =>\n !this.fileList.find((file) => file.file.name === findFile.file.name)\n );\n this.fileList = [...this.fileList, ...newFiles];\n } else this.fileList = fileList;\n }\n\n // event handlers & hooks\n\n private onInvalid = (ev: Event) => {\n if (this.showInlineError) ev.preventDefault();\n this.validate();\n this.showInlineValidation(ev);\n };\n\n private onFileChoose = (e: Event) => {\n const files = (e.target as HTMLInputElement).files;\n if (files && files.length)\n this.addNewFiles((e.target as HTMLInputElement).files);\n };\n\n private onFileRemoveFileClick = (e: Event, file: FileValidation) => {\n if (!this.canChangeFileList) return;\n this.removeFiles.push(file);\n\n (e.target as HTMLElement)\n .closest('.file-upload__list-item--active')\n .classList.remove('file-upload__list-item--active');\n };\n\n private onFileRemoveAnim = () => {\n if (!this.canChangeFileList || !this.removeFiles.length) return;\n this.fileList = this.fileList.filter(\n (fileItem) => !this.removeFiles.find((rmFile) => rmFile === fileItem)\n );\n this.removeFiles = [];\n };\n\n private onInputChange = () => {\n this.nanoChange.emit({ value: this.value, files: this.files });\n };\n\n private onDragStop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.isDragging = false;\n };\n\n private onDragStart = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n this.isDragging = true;\n };\n\n private onDrop = (e: DragEvent) => {\n this.onDragStop(e);\n if (e.dataTransfer.files && e.dataTransfer.files.length)\n this.addNewFiles(e.dataTransfer.files);\n };\n\n // Component lifecycle\n\n disconnectedCallback() {\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n private FileUploadInput = (\n eleType: 'drop' | 'btn',\n listId?: string\n ): VNode[] => {\n const labelId = this.fileInputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot\n ? this.fileInputId + '-more'\n : '';\n\n return [\n <div class={'file-upload__' + eleType + '-wrap'}>\n <label\n class={`file-upload__` + eleType}\n htmlFor={this.fileInputId}\n id={labelId}\n onDrop={(e) => {\n this.onDrop(e);\n this.onDragStop(e);\n }}\n onDragEnd={this.onDragStop}\n onDragLeave={this.onDragStop}\n onDragEnter={this.onDragStart}\n onDragOver={this.onDragStart}\n >\n {(!!this.label || (this.hasLabelSlot && eleType !== 'drop')) && (\n <div\n class={`file-upload__label ${\n this.hideLabel ? 'visually-hide' : ''\n }`}\n >\n {!!this.label && !!this.label.length ? this.label : ''}\n {!this.label && this.hasLabelSlot && eleType !== 'drop' && (\n <slot name=\"label\" />\n )}\n </div>\n )}\n {eleType === 'drop' && (\n <div class=\"file-upload__drop-area\">\n <div>{this.hasLabelSlot && <slot name=\"label\" />}</div>\n <div>\n Drag and drop or&nbsp;<span>browse</span>\n </div>\n </div>\n )}\n {eleType === 'btn' && (\n <div\n class={`file-upload__button button--keyline button--icon-start ${\n this.hasFocus ? 'button--focus' : ''\n }`}\n >\n <div class={`file-upload__btn-content`}>\n <nano-icon name=\"regular/cloud-upload\" />\n <span>\n {!!this.fileList.length\n ? this.fileList[0].file.name\n : this.placeholder}\n </span>\n {!!this.value && this.clearInput && !this.disabled && (\n <button\n type=\"button\"\n class=\"icon file-upload__clear-btn\"\n tabindex=\"-1\"\n onClick={this.onClearClick}\n >\n <nano-icon name=\"light/times\"></nano-icon>\n </button>\n )}\n </div>\n </div>\n )}\n <input\n aria-labelledby={labelId + ' ' + moreId + ' ' + listId}\n type=\"file\"\n id={this.fileInputId}\n accept={this.accept}\n class=\"file-upload__input\"\n multiple={this.maxFiles > 1}\n disabled={this.disabled}\n name={this.canChangeFileList ? undefined : this.name}\n form={this.form}\n ref={(input) => {\n if (this.canChangeFileList) {\n this.publicInputEl = input;\n return;\n }\n this.inputEl = input;\n }}\n onChange={this.onFileChoose}\n onFocus={this.onFocus}\n onReset={this.onInputChange}\n />\n </label>\n <input\n name={!this.canChangeFileList ? undefined : this.name}\n form={this.form}\n ref={(input) => {\n if (!this.canChangeFileList) return;\n this.inputEl = input;\n }}\n type=\"file\"\n id={this.fileInputId + '-hidden'}\n tabIndex={-1}\n multiple={true}\n class=\"file-upload__input\"\n disabled={this.disabled}\n required={this.required}\n accept={this.accept}\n onInvalid={this.onInvalid}\n onChange={this.onInputChange}\n />\n </div>,\n this.showInlineError || this.hasHelperSlot ? (\n <div class=\"file-upload__more\" id={moreId}>\n {this.showInlineError && !!this.errorMessage.length ? (\n <div class=\"file-upload__error\">{this.errorMessage}</div>\n ) : (\n ''\n )}\n <div class=\"file-upload__help\">\n <slot name=\"helper\" />\n </div>\n </div>\n ) : (\n ''\n ),\n ];\n };\n\n private button = (): VNode[] => {\n return this.FileUploadInput('btn');\n };\n\n private dropArea = (): VNode[] => {\n const listId = this.fileInputId + '-list';\n return [\n this.FileUploadInput('drop', listId),\n <output class=\"file-upload__list-wrap\" id={listId}>\n {!!this.fileList && this.fileList.length > 0 && (\n <ul class=\"file-upload__list list\">\n {this.fileList.map((file) => {\n return (\n <li\n key={file.file.name}\n class=\"file-upload__list-item file-upload__list-item--active list-item\"\n onAnimationEnd={(_) => this.onFileRemoveAnim()}\n >\n <span class=\"list-title\">{file.file.name}</span>\n {!file.valid && (\n <nano-tooltip\n content={file.validationMessage}\n placement=\"left\"\n >\n <nano-icon-button\n class=\"list-button list-error\"\n iconName=\"light/exclamation-triangle\"\n label=\"File error\"\n />\n </nano-tooltip>\n )}\n {this.canChangeFileList && (\n <nano-icon-button\n class=\"list-button list-button--view\"\n type=\"button\"\n iconName=\"light/eye\"\n label=\"View file\"\n target=\"_blank\"\n href={file.location}\n />\n )}\n {this.canChangeFileList && (\n <nano-icon-button\n onClick={(e) => this.onFileRemoveFileClick(e, file)}\n class=\"list-button list-button--remove\"\n iconName=\"light/times\"\n label=\"Remove file\"\n />\n )}\n </li>\n );\n })}\n </ul>\n )}\n </output>,\n ];\n };\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'file-upload': true,\n 'file-upload--dragging': this.isDragging,\n 'file-upload--focus': this.hasFocus,\n 'file-upload--invalid': this._invalid,\n }}\n >\n {this.maxFiles > 1 ? <this.dropArea /> : <this.button />}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- /*!
2
- * Web Components for Nanopore digital Web Apps
3
- */
4
- import{h as e,r as t,c as a,e as i,g as s}from"./p-b5c33aff.js";import{b as o,D as n,i as d,p as r,d as l,s as c,e as h,f as u,g as b,h as f,j as p,k as _,a as v}from"./p-f66958c1.js";import{c as x}from"./p-d99437a6.js";import{f as g}from"./p-f8f89998.js";var w;(function(e){e[e["Sunday"]=0]="Sunday";e[e["Monday"]=1]="Monday";e[e["Tuesday"]=2]="Tuesday";e[e["Wednesday"]=3]="Wednesday";e[e["Thursday"]=4]="Thursday";e[e["Friday"]=5]="Friday";e[e["Saturday"]=6]="Saturday"})(w||(w={}));function y(e,t){if(e==null||t==null){return false}return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function m(e,t){var a=new Date(e);a.setDate(a.getDate()+t);return a}function k(e,t=w.Monday){var a=new Date(e);var i=a.getDay();var s=(i<t?7:0)+i-t;a.setDate(a.getDate()-s);return a}function D(e,t=w.Monday){var a=new Date(e);var i=a.getDay();var s=(i<t?-7:0)+6-(i-t);a.setDate(a.getDate()+s);return a}function z(e){return new Date(e.getFullYear(),e.getMonth(),1)}function M(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function S(e,t,a){return C(e,t,a)===e}function C(e,t,a){const i=e.getTime();if(t&&t instanceof Date&&i<t.getTime()){return t}if(a&&a instanceof Date&&i>a.getTime()){return a}return e}function N(e,t){const a=[];let i=e;while(!y(i,t)){a.push(i);i=m(i,1)}a.push(i);return a}function T(e,t=w.Monday){const a=k(z(e),t);const i=D(M(e),t);return N(a,i)}const F=({focusedDay:t,today:a,day:i,onDaySelect:s,onKeyboardNavigation:o,focusedDayRef:n,inRange:d,disabled:r,isSelected:l})=>{const c=y(i,a);const h=y(i,t);const u=i.getMonth()!==t.getMonth()||r;const b=!d;function f(e){s(e,i)}return e("button",{class:{"duet-date__day":true,"is-outside":b,"is-disabled":u,"is-today":c},tabIndex:h?0:-1,onClick:f,onKeyDown:o,disabled:b,type:"button","aria-pressed":l?"true":"false",ref:e=>{if(h&&e&&n){n(e)}}},e("span",{"aria-hidden":"true"},i.getDate()),e("span",{class:"duet-date__vhidden"},i.toLocaleDateString(undefined,{day:"numeric",month:"long"})))};function j(e,t){const a=[];for(let i=0;i<e.length;i+=t){a.push(e.slice(i,i+t))}return a}function L(e,t,a){return e.map(((i,s)=>{const o=(s+t)%e.length;return a(e[o])}))}const A=({selectedDate:t,focusedDate:a,labelledById:i,localization:s,firstDayOfWeek:o,min:n,max:d,onDateSelect:r,onKeyboardNavigation:l,focusedDayRef:c,onMouseDown:h,onFocusIn:u,isDateDisabled:b})=>{const f=new Date;const p=T(a,o);return e("table",{class:"duet-date__table",role:"grid","aria-labelledby":i,onFocusin:u,onMouseDown:h},e("thead",null,e("tr",null,L(s.dayNames,o,(t=>e("th",{class:"duet-date__table-header",scope:"col"},e("span",{"aria-hidden":"true"},t.substr(0,2)),e("span",{class:"duet-date__vhidden"},t)))))),e("tbody",null,j(p,7).map((i=>e("tr",{class:"duet-date__row"},i.map((i=>e("td",{class:"duet-date__cell",role:"gridcell","aria-selected":y(i,t)?"true":undefined},e(F,{day:i,today:f,focusedDay:a,inRange:S(i,n,d),onDaySelect:r,onKeyboardNavigation:l,focusedDayRef:c,disabled:b(i),isSelected:y(i,t)})))))))))};const Y={buttonLabel:"Choose date",placeholder:"YYYY-MM-DD",selectedDateMessage:"Selected date is",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",monthSelectLabel:"Month",yearSelectLabel:"Year",closeLabel:"Close window",keyboardInstruction:"You can use arrow keys to navigate dates",calendarHeading:"Choose a date",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};const I=':host{-webkit-box-sizing:border-box;box-sizing:border-box}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hidden]{display:none !important}:host{--background:var(--nano-layer-bg, #fff);--active-color:var(--nano-color-base, var(--nano-color-primary, #007495));--active-text-color:var(\n --nano-color-contrast,\n var(--nano-color-primary-contrast, #fff)\n );--focus-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8)));--inactive-color:var(--nano-button-color, #f0efed);display:block;font-size:16px}:host(.nano-color){--active-color:var(--nano-color-base, var(--nano-color-primary, #007495));--active-text-color:var(--nano-color-contrast);--focus-shadow:0 0 0 0.1875rem rgba(var(--nano-color-tint-rgb), 0.56)}.duet-date *,.duet-date *::before,.duet-date *::after{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0}.duet-date{-webkit-box-sizing:border-box;box-sizing:border-box;color:currentColor;display:block;margin:0;position:relative;text-align:left;width:100%}.duet-date__dialog{display:-webkit-box;display:-ms-flexbox;display:flex;top:100%;max-width:100%;width:100%}.duet-date__dialog.is-left{left:auto;right:0;width:auto}.duet-date__dialog-content{background:var(--background);min-width:290px;padding:16px 16px 20px;position:relative;-webkit-transform:none;transform:none;max-width:100%;width:100%}.duet-date__table{border-collapse:collapse;border-spacing:0;font-size:1em;line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75em;font-weight:600;letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;cursor:pointer;display:inline-block;font-size:0.875em;font-variant-numeric:tabular-nums;line-height:1.25;position:relative;text-align:center;vertical-align:middle;z-index:1;-webkit-transition:0.15s ease all;transition:0.15s ease all;height:2.5em;width:2.5em}.duet-date__day.is-today{-webkit-box-shadow:0 0 0 1px var(--active-color);box-shadow:0 0 0 1px var(--active-color);position:relative}.duet-date__day:hover::before,.duet-date__day.is-today::before{content:"";background:var(--active-color);border-radius:50%;bottom:0;left:0;opacity:0.16;position:absolute;right:0;top:0}[aria-selected=true] .duet-date__day{background:var(--active-color);color:var(--active-text-color);-webkit-box-shadow:none;box-shadow:none;outline:0}.duet-date__day:active{background:var(--active-color);-webkit-box-shadow:var(--focus-shadow);box-shadow:var(--focus-shadow);color:var(--active-text-color)}.duet-date__day:focus{-webkit-box-shadow:var(--focus-shadow);box-shadow:var(--focus-shadow);outline:0}.duet-date__day.is-disabled{background:transparent;-webkit-box-shadow:none;box-shadow:none;cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--inactive-color);-webkit-box-shadow:none;box-shadow:none;cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{background:var(--inactive-color);-moz-appearance:none;-webkit-appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;appearance:none;border:0;border-radius:50%;cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:distribute;justify-content:space-around;margin-left:8px;padding:0;-webkit-transition:background-color 300ms ease;transition:background-color 300ms ease;font-size:0.9em;height:2.2em;width:2.2em}.duet-date__prev:focus,.duet-date__next:focus{-webkit-box-shadow:var(--focus-shadow);box-shadow:var(--focus-shadow);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{-webkit-box-shadow:none;box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__prev nano-icon,.duet-date__next nano-icon{margin:0 auto}.duet-date__select{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.duet-date__select span{margin-right:unset;-webkit-margin-end:4px;margin-inline-end:4px}}.duet-date__select select{cursor:pointer;font-size:1em;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select.focus-visible:focus+.duet-date__select-label{-webkit-box-shadow:var(--focus-shadow);box-shadow:var(--focus-shadow)}.duet-date__select-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:4px;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:1.25em;font-weight:600;line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__select-label nano-icon{font-size:0.55em}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}';function O(e,t){var a=[];for(var i=e;i<=t;i++){a.push(i)}return a}let R=class{constructor(e){t(this,e);this.nanoDatePicked=a(this,"nanoDatePicked",7);this.monthSelectId=o("NanoDateMonth");this.yearSelectId=o("NanoDateYear");this.dialogLabelId=o("NanoDateLabel");this.initialTouchX=null;this.initialTouchY=null;this.activeFocus=false;this.focusedDay=new Date;this.selectedDate="";this.min="";this.max="";this.firstDayOfWeek=n.Monday;this.localization=Y;this.isDateDisabled=()=>false;this.isModal=false;this.enableActiveFocus=()=>{this.activeFocus=true};this.disableActiveFocus=()=>{this.activeFocus=false};this.handleTouchStart=e=>{const t=e.changedTouches[0];this.initialTouchX=t.pageX;this.initialTouchY=t.pageY};this.handleTouchMove=e=>{e.preventDefault()};this.handleTouchEnd=e=>{const t=e.changedTouches[0];const a=t.pageX-this.initialTouchX;const i=t.pageY-this.initialTouchY;const s=70;const o=Math.abs(a)>=s&&Math.abs(i)<=s;if(o){this.addMonths(a<0?1:-1)}this.initialTouchY=null;this.initialTouchX=null};this.handleNextMonthClick=e=>{e.preventDefault();this.addMonths(1)};this.handlePreviousMonthClick=e=>{e.preventDefault();this.addMonths(-1)};this.handleKeyboardNavigation=e=>{if(e.key==="Tab"&&!e.shiftKey&&this.isModal){e.preventDefault();let t=this.firstFocusEle||this.firstFocusableElement;t.focus();return}var t=true;switch(e.key){case"ArrowRight":this.addDays(1);break;case"ArrowLeft":this.addDays(-1);break;case"ArrowDown":this.addDays(7);break;case"ArrowUp":this.addDays(-7);break;case"PageUp":if(e.shiftKey){this.addYears(-1)}else{this.addMonths(-1)}break;case"PageDown":if(e.shiftKey){this.addYears(1)}else{this.addMonths(1)}break;case"Home":this.startOfWeek();break;case"End":this.endOfWeek();break;default:t=false}if(t){e.preventDefault();this.enableActiveFocus()}};this.handleDaySelect=(e,t)=>{const a=!this.isDateDisabled(t);const i=d(t,r(this.min),r(this.max));if(!i||!a){return}if(t.getMonth()===this.focusedDay.getMonth()){this.setValue(t)}else{this.setFocusedDay(t)}};this.handleMonthSelect=e=>{this.setMonth(parseInt(e.target.value,10))};this.handleYearSelect=e=>{this.setYear(parseInt(e.target.value,10))};this.processFocusedDayNode=e=>{this.focusedDayNode=e;if(this.activeFocus){setTimeout((()=>e.focus()),0)}}}async setFocus(e=false,t=false){this.setFocusedDay(r(this.selectedDate)||new Date);if(e){setTimeout((e=>this.focusedDayNode.focus()),20);return}clearTimeout(this.focusTimeoutId);this.focusTimeoutId=setTimeout((()=>{if(t)g.force(this.monthSelectNode);this.monthSelectNode.focus()}),20)}handleSelectedDateChange(){this.setFocus(true)}addDays(e){this.setFocusedDay(l(this.focusedDay,e))}addMonths(e){this.setMonth(this.focusedDay.getMonth()+e)}addYears(e){this.setYear(this.focusedDay.getFullYear()+e)}startOfWeek(){this.setFocusedDay(c(this.focusedDay,this.firstDayOfWeek))}endOfWeek(){this.setFocusedDay(h(this.focusedDay,this.firstDayOfWeek))}setMonth(e){const t=u(b(this.focusedDay),e);const a=f(t);const i=u(this.focusedDay,e);this.setFocusedDay(p(i,t,a))}setYear(e){const t=_(b(this.focusedDay),e);const a=f(t);const i=_(this.focusedDay,e);this.setFocusedDay(p(i,t,a))}setFocusedDay(e){this.focusedDay=p(e,r(this.min),r(this.max))}setValue(e){this.selectedDate=v(e);this.nanoDatePicked.emit({value:this.selectedDate,valueAsDate:e})}connectedCallback(){if(this.yearSelectNode)g.observe(this.yearSelectNode);if(this.monthSelectNode)g.observe(this.monthSelectNode)}componentWillLoad(){this.handleSelectedDateChange()}componentDidLoad(){this.connectedCallback()}disconnectedCallback(){g.unobserve(this.yearSelectNode);g.unobserve(this.monthSelectNode)}render(){const t=r(this.selectedDate);const a=(t||this.focusedDay).getFullYear();const s=this.focusedDay.getMonth();const o=this.focusedDay.getFullYear();const n=r(this.min);const l=r(this.max);const c=n!=null&&n.getMonth()===s&&n.getFullYear()===o;const h=l!=null&&l.getMonth()===s&&l.getFullYear()===o;let u=a-10;let p=a+10;if(n)u=n.getFullYear();if(l)p=l.getFullYear();return e(i,{class:Object.assign({},x(this.color))},e("div",{class:"duet-date"},e("div",{class:{"duet-date__dialog":true,"is-active":true},onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},e("div",{class:"duet-date__dialog-content"},e("div",{class:"duet-date__vhidden duet-date__instructions","aria-live":"polite"},this.localization.keyboardInstruction),e("div",{class:"duet-date__header",onFocusin:this.disableActiveFocus},e("div",null,e("h2",{id:this.dialogLabelId,class:"duet-date__vhidden","aria-live":"polite"},this.localization.monthNames[s]," ",this.focusedDay.getFullYear()),e("label",{htmlFor:this.monthSelectId,class:"duet-date__vhidden"},this.localization.monthSelectLabel),e("div",{class:"duet-date__select"},e("select",{id:this.monthSelectId,class:"duet-date__select--month",ref:e=>this.firstFocusableElement=this.monthSelectNode=e,onChange:this.handleMonthSelect},this.localization.monthNames.map(((t,a)=>e("option",{key:t,value:a,selected:a===s,disabled:!d(new Date(o,a,1),n?b(n):null,l?f(l):null)},t)))),e("div",{class:"duet-date__select-label","aria-hidden":"true"},e("span",null,this.localization.monthNamesShort[s]),e("nano-icon",{name:"light/chevron-down"}))),e("label",{htmlFor:this.yearSelectId,class:"duet-date__vhidden"},this.localization.yearSelectLabel),e("div",{class:"duet-date__select"},e("select",{id:this.yearSelectId,class:"duet-date__select--year",onChange:this.handleYearSelect,ref:e=>this.yearSelectNode=e},O(u,p).map((t=>e("option",{key:t,selected:t===o},t)))),e("div",{class:"duet-date__select-label","aria-hidden":"true"},e("span",null,this.focusedDay.getFullYear()),e("nano-icon",{name:"light/chevron-down"})))),e("div",{class:"duet-date__nav"},e("button",{class:"duet-date__prev",onClick:this.handlePreviousMonthClick,disabled:c,type:"button"},e("nano-icon",{name:"light/chevron-left"}),e("span",{class:"duet-date__vhidden"},this.localization.prevMonthLabel)),e("button",{class:"duet-date__next",onClick:this.handleNextMonthClick,disabled:h,type:"button"},e("nano-icon",{name:"light/chevron-right"}),e("span",{class:"duet-date__vhidden"},this.localization.nextMonthLabel)))),e("div",null,e(A,{selectedDate:t,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,localization:this.localization,firstDayOfWeek:this.firstDayOfWeek,focusedDayRef:this.processFocusedDayNode,min:n,max:l,isDateDisabled:this.isDateDisabled}))))))}get host(){return s(this)}static get watchers(){return{selectedDate:["handleSelectedDateChange"]}}};R.style=I;export{R as nano_date_picker};
5
- //# sourceMappingURL=p-222d8095.entry.js.map
@@ -1,5 +0,0 @@
1
- var __spreadArray=this&&this.__spreadArray||function(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t};
2
- /*!
3
- * Web Components for Nanopore digital Web Apps
4
- */System.register(["./p-f48be9f5.system.js","./p-b430a9b6.system.js","./p-ef053a2f.system.js"],(function(t){"use strict";var e,i,n,r,s,a,o,c;return{setters:[function(t){e=t.r;i=t.c;n=t.i;r=t.h;s=t.e;a=t.g},function(t){o=t.i},function(t){c=t.d}],execute:function(){var l=t("nano_resize_observe",function(){function t(t){var n=this;e(this,t);this.nanoResizeStateChange=i(this,"nanoResizeStateChange",7);this.classNames=[];this.assessChanges=function(){if(!n.currentWidth&&!n.currentHeight)return;var t={h:new Map,w:new Map};var e=false;Object.keys(n.appliedStates).forEach((function(i){var r;if(i==="h")r=n.currentHeight;else r=n.currentWidth;n.appliedStates[i].forEach((function(n,s){if(r>=s&&n.applied===false){n.applied=true;t[i].set(s,n);e=true}else if(r<s&&n.applied===true){n.applied=false;t[i].set(s,n);e=true}}))}));if(e)n.applyChanges(t);else if(!n.classNames.includes("is-ready"))n.classNames=["is-ready"]}}t.prototype.dimensionChanged=function(){this.assessChanges()};t.prototype.statesChanged=function(){var t=this;if(!this.states)return;if(!this.ro)this.attachRO();var e=function(t){var e=t.split(/(\d+)/).filter((function(t){return t.length}));return{bp:parseInt(e[0]),dir:e[1]}};this.appliedStates={h:new Map,w:new Map};this.states.split(",").map((function(i){i=i.trim();if(i.includes(" ")){var n=i.split(" "),r=n[0],s=n.slice(1);var a=e(r),o=a.bp,c=a.dir;t.appliedStates[c].set(o,{states:s,applied:false})}else{var l=e(i),o=l.bp,c=l.dir;t.appliedStates[c].set(o,{applied:false})}}))};t.prototype.applyChanges=function(t){var e=__spreadArray([],this.classNames);Object.keys(t).forEach((function(i){t[i].forEach((function(t){if(!t.states)return;t.states.map((function(i){if(t.applied)e.push(i);else e=e.filter((function(t){return t!==i}))}))}))}));this.classNames=__spreadArray(["is-ready"],e);this.nanoResizeStateChange.emit(this.toSimpleObj(t))};t.prototype.toSimpleObj=function(t){var e={};Object.keys(t).forEach((function(i){t[i].forEach((function(t,n){e[n+i]=t.applied}))}));return e};t.prototype.attachRO=function(){var t=this;this.ro=new o((function(e){for(var i=0,n=e;i<n.length;i++){var r=n[i];t.currentWidth=r.contentRect.width;t.currentHeight=r.contentRect.height}}));this.ro.observe(this.host)};t.prototype.connectedCallback=function(){this.assessChanges=c(this.assessChanges,50)};t.prototype.componentDidLoad=function(){var t=this;if(!this.states)return;if(!this.currentWidth||!this.currentHeight){n((function(){var e=t.host.getBoundingClientRect(),i=e.width,n=e.height;t.currentWidth=i;t.currentHeight=n}))}this.statesChanged()};t.prototype.disconnectedCallback=function(){if(this.ro)this.ro.disconnect()};t.prototype.render=function(){var t;return r(s,{class:(t={},t[this.classNames.join(" ")]=true,t)},r("slot",null))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{currentHeight:["dimensionChanged"],currentWidth:["dimensionChanged"],states:["statesChanged"]}},enumerable:false,configurable:true});return t}());l.style=":host { display: inline-block } div { height: 100%; }";var h=":host{-webkit-box-sizing:border-box;box-sizing:border-box}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hidden]{display:none !important}:host{--base-color-rgb:var(--nano-skeleton-base-rgb, 228, 230, 232);--color:var(--nano-skeleton-color, rgba(var(--base-color-rgb), 1));--tint:var(--nano-skeleton-tint, rgba(var(--base-color-rgb), 0.5));display:block;position:relative;border-radius:0.25rem;height:1em}.skeleton{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;height:100%;border-radius:inherit}.skeleton__indicator{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;background:var(--color);border-radius:inherit}.skeleton.animate .skeleton__indicator{background:-webkit-gradient(linear, right top, left top, from(var(--tint)), color-stop(var(--color)), color-stop(var(--color)), to(var(--tint)));background:linear-gradient(270deg, var(--tint), var(--color), var(--color), var(--tint));background-size:400% 100%;-webkit-animation:loader 6s ease-in-out infinite;animation:loader 6s ease-in-out infinite}@-webkit-keyframes loader{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes loader{0%{background-position:200% 0}to{background-position:-200% 0}}";var u=t("nano_skeleton",function(){function t(t){e(this,t);this.animated=true}t.prototype.render=function(){return r("div",{class:{skeleton:true,animate:this.animated}},r("div",{class:"skeleton__indicator"}))};return t}());u.style=h}}}));
5
- //# sourceMappingURL=p-241d90eb.system.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/resize-observe/resize-observe.tsx","src/components/skeleton/skeleton.scss?tag=nano-skeleton&encapsulation=shadow","src/components/skeleton/skeleton.tsx"],"names":["ResizeObserve","exports","class_1","hostRef","_this","this","classNames","assessChanges","currentWidth","currentHeight","changedStates","h","Map","w","hasChanged","Object","keys","appliedStates","forEach","dimType","dim","state","bp","applied","set","applyChanges","includes","prototype","dimensionChanged","statesChanged","states","ro","attachRO","toBpDir","bpDir","bpDirSpl","split","filter","bs","length","parseInt","dir","map","st","trim","_a","key","classes","slice","_b","_c","changes","__spreadArray","push","cl","nanoResizeStateChange","emit","toSimpleObj","stateMaps","retObj","ResizeObserver","entries","_i","entries_1","entry","contentRect","width","height","observe","host","connectedCallback","debounce","componentDidLoad","readTask","getBoundingClientRect","disconnectedCallback","disconnect","render","Host","class","join","skeletonCss","Skeleton","class_2","animated","skeleton","animate"],"mappings":";;;6QAiCaA,EAAaC,EAAA,sBAAA,WAL1B,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,4EAYWA,KAAAC,WAAuB,GA2CxBD,KAAAE,cAAgB,WACtB,IAAKH,EAAKI,eAAiBJ,EAAKK,cAAe,OAC/C,IAAMC,EAA2B,CAAEC,EAAG,IAAIC,IAAOC,EAAG,IAAID,KACxD,IAAIE,EAAa,MAEjBC,OAAOC,KAAKZ,EAAKa,eAAeC,SAAQ,SAACC,GACvC,IAAIC,EACJ,GAAID,IAAY,IAAKC,EAAMhB,EAAKK,mBAC3BW,EAAMhB,EAAKI,aAEhBJ,EAAKa,cAAcE,GAASD,SAC1B,SAACG,EAA4BC,GAC3B,GAAIF,GAAOE,GAAMD,EAAME,UAAY,MAAO,CACxCF,EAAME,QAAU,KAChBb,EAAcS,GAASK,IAAIF,EAAID,GAC/BP,EAAa,UACR,GAAIM,EAAME,GAAMD,EAAME,UAAY,KAAM,CAC7CF,EAAME,QAAU,MAChBb,EAAcS,GAASK,IAAIF,EAAID,GAC/BP,EAAa,YAKr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C,WAAW0E,KAAK,MAAO,SAG/BrE,EAAA,OAAA,8TA7IkB,oECjC1B,IAAMsE,EAAc,qsCCYPC,EAAQjF,EAAA,gBAAA,WALrB,SAAAkF,EAAAhF,aAOUE,KAAA+E,SAAW,KAEnBD,EAAAxD,UAAAkD,OAAA,WACE,OACElE,EAAA,MAAA,CACEoE,MAAO,CACLM,SAAU,KACVC,QAASjF,KAAK+E,WAGhBzE,EAAA,MAAA,CAAKoE,MAAM,mCAZE","sourcesContent":["import {\n Component,\n h,\n Prop,\n Element,\n Host,\n State,\n Watch,\n ComponentInterface,\n Event,\n EventEmitter,\n readTask,\n} from '@stencil/core';\nimport ResizeObserver from 'resize-observer-polyfill';\nimport { debounce } from '../../utils';\nimport type { ResizeStateChangeEventDetail } from '../../interface';\n\ntype ResizeObserverState = { states?: string[]; applied?: boolean };\ninterface StateMaps {\n h: Map<number, ResizeObserverState>;\n w: Map<number, ResizeObserverState>;\n}\n\n/**\n * A Resize-Observer utility component.\n * Takes a string list of sizes and optional class-names. Adds class-names and fires `nanoResizeStateChange` events when the component reaches those sizes.\n * @slot - Main slot for any content.\n */\n@Component({\n tag: 'nano-resize-observe',\n shadow: true,\n styles: `:host { display: inline-block } div { height: 100%; }`,\n})\nexport class ResizeObserve implements ComponentInterface {\n private ro: ResizeObserver;\n private appliedStates: StateMaps;\n\n @Element() host: HTMLNanoResizeObserveElement;\n @State() currentWidth: number;\n @State() currentHeight: number;\n @State() classNames: string[] = [];\n\n /** string list of sizes and optional class-names. Adds class-names and fires nanoResizeStateChange events. Upon hitting breakpoints.\n * Format: `states=\"800w, 300h class1 class2\"` */\n @Prop() states: string;\n\n /** A resize break point is switched on or off */\n @Event() nanoResizeStateChange!: EventEmitter<ResizeStateChangeEventDetail>;\n\n @Watch('currentHeight')\n @Watch('currentWidth')\n dimensionChanged() {\n this.assessChanges();\n }\n\n @Watch('states')\n statesChanged() {\n if (!this.states) return;\n if (!this.ro) this.attachRO();\n\n const toBpDir = (bpDir: string) => {\n const bpDirSpl = bpDir.split(/(\\d+)/).filter((bs) => bs.length);\n return { bp: parseInt(bpDirSpl[0]), dir: bpDirSpl[1] };\n };\n this.appliedStates = { h: new Map(), w: new Map() };\n\n // parse state string\n this.states.split(',').map((st) => {\n st = st.trim();\n if (st.includes(' ')) {\n const [key, ...classes] = st.split(' ');\n const { bp, dir } = toBpDir(key);\n this.appliedStates[dir as keyof StateMaps].set(bp, {\n states: classes,\n applied: false,\n });\n } else {\n const { bp, dir } = toBpDir(st);\n this.appliedStates[dir as keyof StateMaps].set(bp, { applied: false });\n }\n });\n }\n\n private assessChanges = () => {\n if (!this.currentWidth && !this.currentHeight) return;\n const changedStates: StateMaps = { h: new Map(), w: new Map() };\n let hasChanged = false;\n\n Object.keys(this.appliedStates).forEach((dimType) => {\n let dim: number;\n if (dimType === 'h') dim = this.currentHeight;\n else dim = this.currentWidth;\n\n this.appliedStates[dimType].forEach(\n (state: ResizeObserverState, bp: number) => {\n if (dim >= bp && state.applied === false) {\n state.applied = true;\n changedStates[dimType].set(bp, state);\n hasChanged = true;\n } else if (dim < bp && state.applied === true) {\n state.applied = false;\n changedStates[dimType].set(bp, state);\n hasChanged = true;\n }\n }\n );\n });\n if (hasChanged) this.applyChanges(changedStates);\n else if (!this.classNames.includes('is-ready'))\n this.classNames = ['is-ready'];\n };\n\n private applyChanges(changes: StateMaps) {\n let classNames = [...this.classNames];\n Object.keys(changes).forEach((dimType: keyof StateMaps) => {\n changes[dimType].forEach((state) => {\n if (!state.states) return;\n state.states.map((st) => {\n if (state.applied) classNames.push(st);\n else classNames = classNames.filter((cl) => cl !== st);\n });\n });\n });\n this.classNames = ['is-ready', ...classNames];\n this.nanoResizeStateChange.emit(this.toSimpleObj(changes));\n }\n\n private toSimpleObj(stateMaps: StateMaps) {\n const retObj = {};\n Object.keys(stateMaps).forEach((dimType: keyof StateMaps) => {\n stateMaps[dimType].forEach((state: ResizeObserverState, bp: number) => {\n retObj[bp + dimType] = state.applied;\n });\n });\n return retObj;\n }\n\n private attachRO() {\n this.ro = new ResizeObserver((entries) => {\n for (const entry of entries) {\n this.currentWidth = entry.contentRect.width;\n this.currentHeight = entry.contentRect.height;\n }\n });\n this.ro.observe(this.host);\n }\n\n connectedCallback() {\n this.assessChanges = debounce(this.assessChanges, 50);\n }\n\n componentDidLoad() {\n if (!this.states) return;\n if (!this.currentWidth || !this.currentHeight) {\n readTask(() => {\n const { width, height } = this.host.getBoundingClientRect();\n this.currentWidth = width;\n this.currentHeight = height;\n });\n }\n this.statesChanged();\n }\n\n disconnectedCallback() {\n if (this.ro) this.ro.disconnect();\n }\n\n render() {\n return (\n <Host\n class={{\n [this.classNames.join(' ')]: true,\n }}\n >\n <slot />\n </Host>\n );\n }\n}\n","@import '../../global/style/nano-theme/components';\n\n:host {\n /**\n * @prop --base-color-rgb: default #{$skeleton-color-rgb};\n * @prop --color: default var(--nano-skeleton-color, rgba(var(--base-color-rgb), 1));\n * @prop --tint: default var(--nano-skeleton-tint, rgba(var(--base-color-rgb), .3));\n */\n\n --base-color-rgb: #{$skeleton-color-rgb};\n --color: var(--nano-skeleton-color, rgba(var(--base-color-rgb), 1));\n --tint: var(--nano-skeleton-tint, rgba(var(--base-color-rgb), 0.5));\n\n display: block;\n position: relative;\n border-radius: 0.25rem;\n height: 1em;\n}\n\n.skeleton {\n display: flex;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n}\n\n.skeleton__indicator {\n flex: 1 1 auto;\n background: var(--color);\n border-radius: inherit;\n}\n\n.skeleton.animate .skeleton__indicator {\n background:\n linear-gradient(\n 270deg,\n var(--tint),\n var(--color),\n var(--color),\n var(--tint)\n );\n background-size: 400% 100%;\n animation: loader 6s ease-in-out infinite;\n}\n\n@keyframes loader {\n 0% {\n background-position: 200% 0;\n }\n\n to {\n background-position: -200% 0;\n }\n}\n","import { Component, Prop, h, ComponentInterface } from '@stencil/core';\n\n/**\n * Skeletons are used to show where content will eventually be drawn.\n * Simple containers for scaffolding layouts that mimic what users will see when content has finished loading.\n * Prevents large areas of empty space during asynchronous operations.\n */\n@Component({\n tag: 'nano-skeleton',\n styleUrl: 'skeleton.scss',\n shadow: true,\n})\nexport class Skeleton implements ComponentInterface {\n /** When `true`, the skeleton will animate. */\n @Prop() animated = true;\n\n render() {\n return (\n <div\n class={{\n skeleton: true,\n animate: this.animated,\n }}\n >\n <div class=\"skeleton__indicator\" />\n </div>\n );\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- /*!
2
- * Web Components for Nanopore digital Web Apps
3
- */
4
- import{r as i,c as r,h as t,e as d,g as o}from"./p-b5c33aff.js";import{i as s}from"./p-debd9efc.js";import{d as n}from"./p-1da5f8df.js";const g=':host{-webkit-box-sizing:border-box;box-sizing:border-box}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hidden]{display:none !important}:host{--grid-col-gap:var(--nano-spacing-medium, 16px);--grid-row-gap:var(--nano-spacing-medium, 16px);--current-grid-size:"\'grid size: sm\'";display:block;opacity:0;-webkit-transition:0.2s ease opacity;transition:0.2s ease opacity}:host .grid{display:grid;grid-gap:var(--grid-row-gap) var(--grid-col-gap);height:inherit;min-height:inherit}:host .grid::slotted(*){border:0 solid transparent;background-clip:padding-box;border-width:var(--grid-row-gap) calc(var(--grid-col-gap) / 2)}:host(.ready){opacity:1}:host(.has-grid) .grid{display:-ms-grid;display:grid}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-1),:host(.has-grid) .grid::slotted(.nano-grid-col-start-1){-ms-grid-column:1 !important;grid-column-start:1 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-1),:host(.has-grid) .grid::slotted(.nano-grid-row-start-1){-ms-grid-row:1 !important;grid-row-start:1 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-1),:host(.has-grid) .grid::slotted(.nano-grid-col-span-1){-ms-grid-column-span:1 !important;grid-column-end:span 1 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-1),:host(.has-grid) .grid::slotted(.nano-grid-row-span-1){-ms-grid-row-span:1 !important;grid-row-end:span 1 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-2),:host(.has-grid) .grid::slotted(.nano-grid-col-start-2){-ms-grid-column:2 !important;grid-column-start:2 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-2),:host(.has-grid) .grid::slotted(.nano-grid-row-start-2){-ms-grid-row:2 !important;grid-row-start:2 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-2),:host(.has-grid) .grid::slotted(.nano-grid-col-span-2){-ms-grid-column-span:2 !important;grid-column-end:span 2 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-2),:host(.has-grid) .grid::slotted(.nano-grid-row-span-2){-ms-grid-row-span:2 !important;grid-row-end:span 2 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-3),:host(.has-grid) .grid::slotted(.nano-grid-col-start-3){-ms-grid-column:3 !important;grid-column-start:3 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-3),:host(.has-grid) .grid::slotted(.nano-grid-row-start-3){-ms-grid-row:3 !important;grid-row-start:3 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-3),:host(.has-grid) .grid::slotted(.nano-grid-col-span-3){-ms-grid-column-span:3 !important;grid-column-end:span 3 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-3),:host(.has-grid) .grid::slotted(.nano-grid-row-span-3){-ms-grid-row-span:3 !important;grid-row-end:span 3 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-4),:host(.has-grid) .grid::slotted(.nano-grid-col-start-4){-ms-grid-column:4 !important;grid-column-start:4 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-4),:host(.has-grid) .grid::slotted(.nano-grid-row-start-4){-ms-grid-row:4 !important;grid-row-start:4 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-4),:host(.has-grid) .grid::slotted(.nano-grid-col-span-4){-ms-grid-column-span:4 !important;grid-column-end:span 4 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-4),:host(.has-grid) .grid::slotted(.nano-grid-row-span-4){-ms-grid-row-span:4 !important;grid-row-end:span 4 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-5),:host(.has-grid) .grid::slotted(.nano-grid-col-start-5){-ms-grid-column:5 !important;grid-column-start:5 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-5),:host(.has-grid) .grid::slotted(.nano-grid-row-start-5){-ms-grid-row:5 !important;grid-row-start:5 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-5),:host(.has-grid) .grid::slotted(.nano-grid-col-span-5){-ms-grid-column-span:5 !important;grid-column-end:span 5 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-5),:host(.has-grid) .grid::slotted(.nano-grid-row-span-5){-ms-grid-row-span:5 !important;grid-row-end:span 5 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-6),:host(.has-grid) .grid::slotted(.nano-grid-col-start-6){-ms-grid-column:6 !important;grid-column-start:6 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-6),:host(.has-grid) .grid::slotted(.nano-grid-row-start-6){-ms-grid-row:6 !important;grid-row-start:6 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-6),:host(.has-grid) .grid::slotted(.nano-grid-col-span-6){-ms-grid-column-span:6 !important;grid-column-end:span 6 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-6),:host(.has-grid) .grid::slotted(.nano-grid-row-span-6){-ms-grid-row-span:6 !important;grid-row-end:span 6 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-7),:host(.has-grid) .grid::slotted(.nano-grid-col-start-7){-ms-grid-column:7 !important;grid-column-start:7 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-7),:host(.has-grid) .grid::slotted(.nano-grid-row-start-7){-ms-grid-row:7 !important;grid-row-start:7 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-7),:host(.has-grid) .grid::slotted(.nano-grid-col-span-7){-ms-grid-column-span:7 !important;grid-column-end:span 7 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-7),:host(.has-grid) .grid::slotted(.nano-grid-row-span-7){-ms-grid-row-span:7 !important;grid-row-end:span 7 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-8),:host(.has-grid) .grid::slotted(.nano-grid-col-start-8){-ms-grid-column:8 !important;grid-column-start:8 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-8),:host(.has-grid) .grid::slotted(.nano-grid-row-start-8){-ms-grid-row:8 !important;grid-row-start:8 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-8),:host(.has-grid) .grid::slotted(.nano-grid-col-span-8){-ms-grid-column-span:8 !important;grid-column-end:span 8 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-8),:host(.has-grid) .grid::slotted(.nano-grid-row-span-8){-ms-grid-row-span:8 !important;grid-row-end:span 8 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-9),:host(.has-grid) .grid::slotted(.nano-grid-col-start-9){-ms-grid-column:9 !important;grid-column-start:9 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-9),:host(.has-grid) .grid::slotted(.nano-grid-row-start-9){-ms-grid-row:9 !important;grid-row-start:9 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-9),:host(.has-grid) .grid::slotted(.nano-grid-col-span-9){-ms-grid-column-span:9 !important;grid-column-end:span 9 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-9),:host(.has-grid) .grid::slotted(.nano-grid-row-span-9){-ms-grid-row-span:9 !important;grid-row-end:span 9 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-10),:host(.has-grid) .grid::slotted(.nano-grid-col-start-10){-ms-grid-column:10 !important;grid-column-start:10 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-10),:host(.has-grid) .grid::slotted(.nano-grid-row-start-10){-ms-grid-row:10 !important;grid-row-start:10 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-10),:host(.has-grid) .grid::slotted(.nano-grid-col-span-10){-ms-grid-column-span:10 !important;grid-column-end:span 10 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-10),:host(.has-grid) .grid::slotted(.nano-grid-row-span-10){-ms-grid-row-span:10 !important;grid-row-end:span 10 !important}:host(.has-grid) .grid::slotted(*){border-width:calc(var(--grid-row-gap) / 2) calc(var(--grid-col-gap) / 2)}:host([is-legacy]){overflow:hidden}:host([is-legacy]) .grid{margin-bottom:calc(var(--grid-row-gap) * -0.5);margin-top:calc(var(--grid-row-gap) * -0.5);margin-left:calc(var(--grid-col-gap) * -0.5);margin-right:calc(var(--grid-col-gap) * -0.5)}nano-grid :host-context[is-legacy]{overflow:visible}nano-grid :host-context[is-legacy] .grid::slotted(:first-child){border-top-width:calc(var(--grid-row-gap) / 2)}nano-grid :host-context[is-legacy] .grid::slotted(:last-child){border-bottom-width:calc(var(--grid-row-gap) / 2)}:host([content-panel]:not([content-panel=false])){display:-ms-flexbox;-ms-flex-direction:column}:host([content-panel]:not([content-panel=false])) .grid{-ms-grid-rows:auto 1fr;grid-template-rows:auto 1fr}:host([full-height]:not([full-height=false])){height:100%}:host([full-height]:not([full-height=false])) .grid{-ms-grid-rows:1fr;grid-template-rows:1fr}:host([full-height]:not([full-height=false])) .grid::slotted(*){min-height:100%}:host([show-helper]:not([show-helper=false])) .grid{position:relative}:host([show-helper]:not([show-helper=false])) .grid::after{content:"";position:absolute;left:0;right:0;bottom:0;top:0;pointer-events:none;background-image:repeating-linear-gradient(to right, rgba(126, 195, 241, 0.25), rgba(126, 195, 241, 0.25) var(--col-width), transparent var(--col-width), transparent var(--repeat-width));background-size:calc(100% + var(--grid-col-gap)) 100%;z-index:100}:host([show-helper]:not([show-helper=false])) .grid::before{content:var(--current-grid-size);font-size:30px;position:absolute;width:100%;left:0;text-align:center;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:rgba(0, 0, 0, 0.2);text-transform:uppercase;z-index:99;pointer-events:none}:host(.nano-grid-1){--current-grid-size:"grid size: 1";--col-width:calc(100% - var(--grid-col-gap));--repeat-width:calc(100% / 1)}:host(.nano-grid-1) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[1];grid-template-columns:repeat(1, minmax(var(--col-width), 1fr))}:host(.nano-grid-1) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(2)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(3)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(4)){-ms-grid-row:4;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(5)){-ms-grid-row:5;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(6)){-ms-grid-row:6;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(7)){-ms-grid-row:7;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(8)){-ms-grid-row:8;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(9)){-ms-grid-row:9;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(10)){-ms-grid-row:10;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(11)){-ms-grid-row:11;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(12)){-ms-grid-row:12;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(13)){-ms-grid-row:13;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(14)){-ms-grid-row:14;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(15)){-ms-grid-row:15;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(16)){-ms-grid-row:16;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(17)){-ms-grid-row:17;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(18)){-ms-grid-row:18;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(19)){-ms-grid-row:19;-ms-grid-column:1}:host(.nano-grid-1) .grid::slotted(:nth-child(20)){-ms-grid-row:20;-ms-grid-column:1}:host(.nano-grid-2){--current-grid-size:"grid size: 2";--col-width:calc(50% - var(--grid-col-gap));--repeat-width:calc(100% / 2)}:host(.nano-grid-2) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[2];grid-template-columns:repeat(2, minmax(var(--col-width), 1fr))}:host(.nano-grid-2) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(3)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(4)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(5)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(6)){-ms-grid-row:3;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(7)){-ms-grid-row:4;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(8)){-ms-grid-row:4;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(9)){-ms-grid-row:5;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(10)){-ms-grid-row:5;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(11)){-ms-grid-row:6;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(12)){-ms-grid-row:6;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(13)){-ms-grid-row:7;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(14)){-ms-grid-row:7;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(15)){-ms-grid-row:8;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(16)){-ms-grid-row:8;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(17)){-ms-grid-row:9;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(18)){-ms-grid-row:9;-ms-grid-column:2}:host(.nano-grid-2) .grid::slotted(:nth-child(19)){-ms-grid-row:10;-ms-grid-column:1}:host(.nano-grid-2) .grid::slotted(:nth-child(20)){-ms-grid-row:10;-ms-grid-column:2}:host(.nano-grid-3){--current-grid-size:"grid size: 3";--col-width:calc(33.3333333333% - var(--grid-col-gap));--repeat-width:calc(100% / 3)}:host(.nano-grid-3) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[3];grid-template-columns:repeat(3, minmax(var(--col-width), 1fr))}:host(.nano-grid-3) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-3) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-3) .grid::slotted(:nth-child(3)){-ms-grid-row:1;-ms-grid-column:3}:host(.nano-grid-3) .grid::slotted(:nth-child(4)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-3) .grid::slotted(:nth-child(5)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-3) .grid::slotted(:nth-child(6)){-ms-grid-row:2;-ms-grid-column:3}:host(.nano-grid-3) .grid::slotted(:nth-child(7)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-3) .grid::slotted(:nth-child(8)){-ms-grid-row:3;-ms-grid-column:2}:host(.nano-grid-3) .grid::slotted(:nth-child(9)){-ms-grid-row:3;-ms-grid-column:3}:host(.nano-grid-3) .grid::slotted(:nth-child(10)){-ms-grid-row:4;-ms-grid-column:1}:host(.nano-grid-3) .grid::slotted(:nth-child(11)){-ms-grid-row:4;-ms-grid-column:2}:host(.nano-grid-3) .grid::slotted(:nth-child(12)){-ms-grid-row:4;-ms-grid-column:3}:host(.nano-grid-3) .grid::slotted(:nth-child(13)){-ms-grid-row:5;-ms-grid-column:1}:host(.nano-grid-3) .grid::slotted(:nth-child(14)){-ms-grid-row:5;-ms-grid-column:2}:host(.nano-grid-3) .grid::slotted(:nth-child(15)){-ms-grid-row:5;-ms-grid-column:3}:host(.nano-grid-3) .grid::slotted(:nth-child(16)){-ms-grid-row:6;-ms-grid-column:1}:host(.nano-grid-3) .grid::slotted(:nth-child(17)){-ms-grid-row:6;-ms-grid-column:2}:host(.nano-grid-3) .grid::slotted(:nth-child(18)){-ms-grid-row:6;-ms-grid-column:3}:host(.nano-grid-3) .grid::slotted(:nth-child(19)){-ms-grid-row:7;-ms-grid-column:1}:host(.nano-grid-3) .grid::slotted(:nth-child(20)){-ms-grid-row:7;-ms-grid-column:2}:host(.nano-grid-4){--current-grid-size:"grid size: 4";--col-width:calc(25% - var(--grid-col-gap));--repeat-width:calc(100% / 4)}:host(.nano-grid-4) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[4];grid-template-columns:repeat(4, minmax(var(--col-width), 1fr))}:host(.nano-grid-4) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-4) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-4) .grid::slotted(:nth-child(3)){-ms-grid-row:1;-ms-grid-column:3}:host(.nano-grid-4) .grid::slotted(:nth-child(4)){-ms-grid-row:1;-ms-grid-column:4}:host(.nano-grid-4) .grid::slotted(:nth-child(5)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-4) .grid::slotted(:nth-child(6)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-4) .grid::slotted(:nth-child(7)){-ms-grid-row:2;-ms-grid-column:3}:host(.nano-grid-4) .grid::slotted(:nth-child(8)){-ms-grid-row:2;-ms-grid-column:4}:host(.nano-grid-4) .grid::slotted(:nth-child(9)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-4) .grid::slotted(:nth-child(10)){-ms-grid-row:3;-ms-grid-column:2}:host(.nano-grid-4) .grid::slotted(:nth-child(11)){-ms-grid-row:3;-ms-grid-column:3}:host(.nano-grid-4) .grid::slotted(:nth-child(12)){-ms-grid-row:3;-ms-grid-column:4}:host(.nano-grid-4) .grid::slotted(:nth-child(13)){-ms-grid-row:4;-ms-grid-column:1}:host(.nano-grid-4) .grid::slotted(:nth-child(14)){-ms-grid-row:4;-ms-grid-column:2}:host(.nano-grid-4) .grid::slotted(:nth-child(15)){-ms-grid-row:4;-ms-grid-column:3}:host(.nano-grid-4) .grid::slotted(:nth-child(16)){-ms-grid-row:4;-ms-grid-column:4}:host(.nano-grid-4) .grid::slotted(:nth-child(17)){-ms-grid-row:5;-ms-grid-column:1}:host(.nano-grid-4) .grid::slotted(:nth-child(18)){-ms-grid-row:5;-ms-grid-column:2}:host(.nano-grid-4) .grid::slotted(:nth-child(19)){-ms-grid-row:5;-ms-grid-column:3}:host(.nano-grid-4) .grid::slotted(:nth-child(20)){-ms-grid-row:5;-ms-grid-column:4}:host(.nano-grid-5){--current-grid-size:"grid size: 5";--col-width:calc(20% - var(--grid-col-gap));--repeat-width:calc(100% / 5)}:host(.nano-grid-5) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[5];grid-template-columns:repeat(5, minmax(var(--col-width), 1fr))}:host(.nano-grid-5) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-5) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-5) .grid::slotted(:nth-child(3)){-ms-grid-row:1;-ms-grid-column:3}:host(.nano-grid-5) .grid::slotted(:nth-child(4)){-ms-grid-row:1;-ms-grid-column:4}:host(.nano-grid-5) .grid::slotted(:nth-child(5)){-ms-grid-row:1;-ms-grid-column:5}:host(.nano-grid-5) .grid::slotted(:nth-child(6)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-5) .grid::slotted(:nth-child(7)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-5) .grid::slotted(:nth-child(8)){-ms-grid-row:2;-ms-grid-column:3}:host(.nano-grid-5) .grid::slotted(:nth-child(9)){-ms-grid-row:2;-ms-grid-column:4}:host(.nano-grid-5) .grid::slotted(:nth-child(10)){-ms-grid-row:2;-ms-grid-column:5}:host(.nano-grid-5) .grid::slotted(:nth-child(11)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-5) .grid::slotted(:nth-child(12)){-ms-grid-row:3;-ms-grid-column:2}:host(.nano-grid-5) .grid::slotted(:nth-child(13)){-ms-grid-row:3;-ms-grid-column:3}:host(.nano-grid-5) .grid::slotted(:nth-child(14)){-ms-grid-row:3;-ms-grid-column:4}:host(.nano-grid-5) .grid::slotted(:nth-child(15)){-ms-grid-row:3;-ms-grid-column:5}:host(.nano-grid-5) .grid::slotted(:nth-child(16)){-ms-grid-row:4;-ms-grid-column:1}:host(.nano-grid-5) .grid::slotted(:nth-child(17)){-ms-grid-row:4;-ms-grid-column:2}:host(.nano-grid-5) .grid::slotted(:nth-child(18)){-ms-grid-row:4;-ms-grid-column:3}:host(.nano-grid-5) .grid::slotted(:nth-child(19)){-ms-grid-row:4;-ms-grid-column:4}:host(.nano-grid-5) .grid::slotted(:nth-child(20)){-ms-grid-row:4;-ms-grid-column:5}:host(.nano-grid-6){--current-grid-size:"grid size: 6";--col-width:calc(16.6666666667% - var(--grid-col-gap));--repeat-width:calc(100% / 6)}:host(.nano-grid-6) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[6];grid-template-columns:repeat(6, minmax(var(--col-width), 1fr))}:host(.nano-grid-6) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-6) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-6) .grid::slotted(:nth-child(3)){-ms-grid-row:1;-ms-grid-column:3}:host(.nano-grid-6) .grid::slotted(:nth-child(4)){-ms-grid-row:1;-ms-grid-column:4}:host(.nano-grid-6) .grid::slotted(:nth-child(5)){-ms-grid-row:1;-ms-grid-column:5}:host(.nano-grid-6) .grid::slotted(:nth-child(6)){-ms-grid-row:1;-ms-grid-column:6}:host(.nano-grid-6) .grid::slotted(:nth-child(7)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-6) .grid::slotted(:nth-child(8)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-6) .grid::slotted(:nth-child(9)){-ms-grid-row:2;-ms-grid-column:3}:host(.nano-grid-6) .grid::slotted(:nth-child(10)){-ms-grid-row:2;-ms-grid-column:4}:host(.nano-grid-6) .grid::slotted(:nth-child(11)){-ms-grid-row:2;-ms-grid-column:5}:host(.nano-grid-6) .grid::slotted(:nth-child(12)){-ms-grid-row:2;-ms-grid-column:6}:host(.nano-grid-6) .grid::slotted(:nth-child(13)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-6) .grid::slotted(:nth-child(14)){-ms-grid-row:3;-ms-grid-column:2}:host(.nano-grid-6) .grid::slotted(:nth-child(15)){-ms-grid-row:3;-ms-grid-column:3}:host(.nano-grid-6) .grid::slotted(:nth-child(16)){-ms-grid-row:3;-ms-grid-column:4}:host(.nano-grid-6) .grid::slotted(:nth-child(17)){-ms-grid-row:3;-ms-grid-column:5}:host(.nano-grid-6) .grid::slotted(:nth-child(18)){-ms-grid-row:3;-ms-grid-column:6}:host(.nano-grid-6) .grid::slotted(:nth-child(19)){-ms-grid-row:4;-ms-grid-column:1}:host(.nano-grid-6) .grid::slotted(:nth-child(20)){-ms-grid-row:4;-ms-grid-column:2}:host(.nano-grid-7){--current-grid-size:"grid size: 7";--col-width:calc(14.2857142857% - var(--grid-col-gap));--repeat-width:calc(100% / 7)}:host(.nano-grid-7) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[7];grid-template-columns:repeat(7, minmax(var(--col-width), 1fr))}:host(.nano-grid-7) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-7) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-7) .grid::slotted(:nth-child(3)){-ms-grid-row:1;-ms-grid-column:3}:host(.nano-grid-7) .grid::slotted(:nth-child(4)){-ms-grid-row:1;-ms-grid-column:4}:host(.nano-grid-7) .grid::slotted(:nth-child(5)){-ms-grid-row:1;-ms-grid-column:5}:host(.nano-grid-7) .grid::slotted(:nth-child(6)){-ms-grid-row:1;-ms-grid-column:6}:host(.nano-grid-7) .grid::slotted(:nth-child(7)){-ms-grid-row:1;-ms-grid-column:7}:host(.nano-grid-7) .grid::slotted(:nth-child(8)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-7) .grid::slotted(:nth-child(9)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-7) .grid::slotted(:nth-child(10)){-ms-grid-row:2;-ms-grid-column:3}:host(.nano-grid-7) .grid::slotted(:nth-child(11)){-ms-grid-row:2;-ms-grid-column:4}:host(.nano-grid-7) .grid::slotted(:nth-child(12)){-ms-grid-row:2;-ms-grid-column:5}:host(.nano-grid-7) .grid::slotted(:nth-child(13)){-ms-grid-row:2;-ms-grid-column:6}:host(.nano-grid-7) .grid::slotted(:nth-child(14)){-ms-grid-row:2;-ms-grid-column:7}:host(.nano-grid-7) .grid::slotted(:nth-child(15)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-7) .grid::slotted(:nth-child(16)){-ms-grid-row:3;-ms-grid-column:2}:host(.nano-grid-7) .grid::slotted(:nth-child(17)){-ms-grid-row:3;-ms-grid-column:3}:host(.nano-grid-7) .grid::slotted(:nth-child(18)){-ms-grid-row:3;-ms-grid-column:4}:host(.nano-grid-7) .grid::slotted(:nth-child(19)){-ms-grid-row:3;-ms-grid-column:5}:host(.nano-grid-7) .grid::slotted(:nth-child(20)){-ms-grid-row:3;-ms-grid-column:6}:host(.nano-grid-8){--current-grid-size:"grid size: 8";--col-width:calc(12.5% - var(--grid-col-gap));--repeat-width:calc(100% / 8)}:host(.nano-grid-8) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[8];grid-template-columns:repeat(8, minmax(var(--col-width), 1fr))}:host(.nano-grid-8) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-8) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-8) .grid::slotted(:nth-child(3)){-ms-grid-row:1;-ms-grid-column:3}:host(.nano-grid-8) .grid::slotted(:nth-child(4)){-ms-grid-row:1;-ms-grid-column:4}:host(.nano-grid-8) .grid::slotted(:nth-child(5)){-ms-grid-row:1;-ms-grid-column:5}:host(.nano-grid-8) .grid::slotted(:nth-child(6)){-ms-grid-row:1;-ms-grid-column:6}:host(.nano-grid-8) .grid::slotted(:nth-child(7)){-ms-grid-row:1;-ms-grid-column:7}:host(.nano-grid-8) .grid::slotted(:nth-child(8)){-ms-grid-row:1;-ms-grid-column:8}:host(.nano-grid-8) .grid::slotted(:nth-child(9)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-8) .grid::slotted(:nth-child(10)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-8) .grid::slotted(:nth-child(11)){-ms-grid-row:2;-ms-grid-column:3}:host(.nano-grid-8) .grid::slotted(:nth-child(12)){-ms-grid-row:2;-ms-grid-column:4}:host(.nano-grid-8) .grid::slotted(:nth-child(13)){-ms-grid-row:2;-ms-grid-column:5}:host(.nano-grid-8) .grid::slotted(:nth-child(14)){-ms-grid-row:2;-ms-grid-column:6}:host(.nano-grid-8) .grid::slotted(:nth-child(15)){-ms-grid-row:2;-ms-grid-column:7}:host(.nano-grid-8) .grid::slotted(:nth-child(16)){-ms-grid-row:2;-ms-grid-column:8}:host(.nano-grid-8) .grid::slotted(:nth-child(17)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-8) .grid::slotted(:nth-child(18)){-ms-grid-row:3;-ms-grid-column:2}:host(.nano-grid-8) .grid::slotted(:nth-child(19)){-ms-grid-row:3;-ms-grid-column:3}:host(.nano-grid-8) .grid::slotted(:nth-child(20)){-ms-grid-row:3;-ms-grid-column:4}:host(.nano-grid-9){--current-grid-size:"grid size: 9";--col-width:calc(11.1111111111% - var(--grid-col-gap));--repeat-width:calc(100% / 9)}:host(.nano-grid-9) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[9];grid-template-columns:repeat(9, minmax(var(--col-width), 1fr))}:host(.nano-grid-9) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-9) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-9) .grid::slotted(:nth-child(3)){-ms-grid-row:1;-ms-grid-column:3}:host(.nano-grid-9) .grid::slotted(:nth-child(4)){-ms-grid-row:1;-ms-grid-column:4}:host(.nano-grid-9) .grid::slotted(:nth-child(5)){-ms-grid-row:1;-ms-grid-column:5}:host(.nano-grid-9) .grid::slotted(:nth-child(6)){-ms-grid-row:1;-ms-grid-column:6}:host(.nano-grid-9) .grid::slotted(:nth-child(7)){-ms-grid-row:1;-ms-grid-column:7}:host(.nano-grid-9) .grid::slotted(:nth-child(8)){-ms-grid-row:1;-ms-grid-column:8}:host(.nano-grid-9) .grid::slotted(:nth-child(9)){-ms-grid-row:1;-ms-grid-column:9}:host(.nano-grid-9) .grid::slotted(:nth-child(10)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-9) .grid::slotted(:nth-child(11)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-9) .grid::slotted(:nth-child(12)){-ms-grid-row:2;-ms-grid-column:3}:host(.nano-grid-9) .grid::slotted(:nth-child(13)){-ms-grid-row:2;-ms-grid-column:4}:host(.nano-grid-9) .grid::slotted(:nth-child(14)){-ms-grid-row:2;-ms-grid-column:5}:host(.nano-grid-9) .grid::slotted(:nth-child(15)){-ms-grid-row:2;-ms-grid-column:6}:host(.nano-grid-9) .grid::slotted(:nth-child(16)){-ms-grid-row:2;-ms-grid-column:7}:host(.nano-grid-9) .grid::slotted(:nth-child(17)){-ms-grid-row:2;-ms-grid-column:8}:host(.nano-grid-9) .grid::slotted(:nth-child(18)){-ms-grid-row:2;-ms-grid-column:9}:host(.nano-grid-9) .grid::slotted(:nth-child(19)){-ms-grid-row:3;-ms-grid-column:1}:host(.nano-grid-9) .grid::slotted(:nth-child(20)){-ms-grid-row:3;-ms-grid-column:2}:host(.nano-grid-10){--current-grid-size:"grid size: 10";--col-width:calc(10% - var(--grid-col-gap));--repeat-width:calc(100% / 10)}:host(.nano-grid-10) .grid{-ms-grid-columns:(minmax(var(--col-width), 1fr))[10];grid-template-columns:repeat(10, minmax(var(--col-width), 1fr))}:host(.nano-grid-10) .grid::slotted(:nth-child(1)){-ms-grid-row:1;-ms-grid-column:1}:host(.nano-grid-10) .grid::slotted(:nth-child(2)){-ms-grid-row:1;-ms-grid-column:2}:host(.nano-grid-10) .grid::slotted(:nth-child(3)){-ms-grid-row:1;-ms-grid-column:3}:host(.nano-grid-10) .grid::slotted(:nth-child(4)){-ms-grid-row:1;-ms-grid-column:4}:host(.nano-grid-10) .grid::slotted(:nth-child(5)){-ms-grid-row:1;-ms-grid-column:5}:host(.nano-grid-10) .grid::slotted(:nth-child(6)){-ms-grid-row:1;-ms-grid-column:6}:host(.nano-grid-10) .grid::slotted(:nth-child(7)){-ms-grid-row:1;-ms-grid-column:7}:host(.nano-grid-10) .grid::slotted(:nth-child(8)){-ms-grid-row:1;-ms-grid-column:8}:host(.nano-grid-10) .grid::slotted(:nth-child(9)){-ms-grid-row:1;-ms-grid-column:9}:host(.nano-grid-10) .grid::slotted(:nth-child(10)){-ms-grid-row:1;-ms-grid-column:10}:host(.nano-grid-10) .grid::slotted(:nth-child(11)){-ms-grid-row:2;-ms-grid-column:1}:host(.nano-grid-10) .grid::slotted(:nth-child(12)){-ms-grid-row:2;-ms-grid-column:2}:host(.nano-grid-10) .grid::slotted(:nth-child(13)){-ms-grid-row:2;-ms-grid-column:3}:host(.nano-grid-10) .grid::slotted(:nth-child(14)){-ms-grid-row:2;-ms-grid-column:4}:host(.nano-grid-10) .grid::slotted(:nth-child(15)){-ms-grid-row:2;-ms-grid-column:5}:host(.nano-grid-10) .grid::slotted(:nth-child(16)){-ms-grid-row:2;-ms-grid-column:6}:host(.nano-grid-10) .grid::slotted(:nth-child(17)){-ms-grid-row:2;-ms-grid-column:7}:host(.nano-grid-10) .grid::slotted(:nth-child(18)){-ms-grid-row:2;-ms-grid-column:8}:host(.nano-grid-10) .grid::slotted(:nth-child(19)){-ms-grid-row:2;-ms-grid-column:9}:host(.nano-grid-10) .grid::slotted(:nth-child(20)){-ms-grid-row:2;-ms-grid-column:10}';const h=["col-span","col-start","row-span","row-start"];const l=!!document.head.attachShadow;let a=class{constructor(t){i(this,t);this.nanoBpChange=r(this,"nanoBpChange",7);this.generalClasses=[""];this.gridClass=null;this.isSizes=[null];this.ready=false;this.isSmall=false;this.isMedium=false;this.isLarge=false;this.isXL=false;this.isXXL=false;this.sSize=300;this.mSize=550;this.lSize=800;this.xlSize=1e3;this.showHelper=false;this.contentPanel=false;this.fullHeight=false;this.stateChange=n(this.stateChange.bind(this),100)}propChanged(){this.applySizeClasses()}applySizeClasses(){let i=this.currentWidth;this.isSmall=false;this.isMedium=false;this.isLarge=false;this.isXL=false;this.isXXL=false;this.generalClasses=[];this.gridClass=null;this.isSizes=[null];this.isSmall=true;this.generalClasses.push("is-small");if(this.sCols)this.gridClass=`nano-grid-${this.sCols}`;this.isSizes.push({size:"s",active:true});if(i>this.sSize){this.isMedium=true;this.generalClasses.push("is-medium");if(this.mCols)this.gridClass=`nano-grid-${this.mCols}`;this.isSizes.push({size:"m",active:true})}if(i>this.mSize){this.isLarge=true;this.generalClasses.push("is-large");if(this.lCols)this.gridClass=`nano-grid-${this.lCols}`;this.isSizes.push({size:"l",active:true})}if(i>this.lSize){this.isXL=true;this.generalClasses.push("is-xl");if(this.xlCols)this.gridClass=`nano-grid-${this.xlCols}`;this.isSizes.push({size:"xl",active:true})}if(i>this.xlSize){this.isXXL=true;this.generalClasses.push("is-xxl");if(this.xxlCols)this.gridClass=`nano-grid-${this.xxlCols}`;this.isSizes.push({size:"xxl",active:true})}this.el.style.setProperty("--current-grid-size",`'grid size: ${this.isSizes.slice().pop().size}'`);this.applyChildrenClasses();setTimeout((()=>this.ready=true),0)}stateChange(){this.nanoBpChange.emit(this.generalClasses)}applyChildrenClasses(){let i=this.el.querySelectorAll("nano-grid-item");if(i.length){i.forEach((i=>{i.changeBP(this.isSizes)}));return}let r=[""],t="",d,o,s,n;if(!l)n=this.el.querySelector(".grid")||this.el;else n=this.el;[].map.call(n.children,(i=>{if(!i.hasAttribute("grid-states"))return;s=i.className.split(" ").filter((i=>!i.startsWith("nano-grid-")));i.className=s.join(" ").trim();o=i.getAttribute("grid-states").split(" ");h.forEach((n=>{d=false;this.isSizes.slice().reverse().forEach((function(g){if(d||!g)return;d=o.find((i=>i.indexOf(`${g.size}-${n}`)===0));if(d){s=i.className.split(" ").filter((i=>!i.includes("nano-grid-${stateOpt}")));i.className=s.join(" ").trim();r=d.split("-");r.shift();t=r.join("-");i.classList.add(`nano-grid-${t}`)}}))}))}))}componentWillLoad(){let i,r;if(!l)r=this.el.querySelector(".grid")||this.el;else r=this.el;[].map.call(r.children,(r=>{if(!l){if(r.classList.contains("nano-griditem")||r.nodeName==="NANO-GRID-ITEM")return;i=document.createElement("div");if(r.hasAttribute("grid-states")){i.setAttribute("grid-states",r.getAttribute("grid-states"));r.removeAttribute("grid-states")}this.el.insertBefore(i,r);i.appendChild(r);i.classList.add("nano-griditem")}else if(r.nodeName!=="NANO-GRID-ITEM")r.classList.add("nano-griditem")}))}componentDidLoad(){this.ro=new s((i=>{for(const r of i){if(!r.contentRect.width)return;this.currentWidth=r.contentRect.width;this.applySizeClasses()}}));this.ro.observe(this.el)}disconnectedCallback(){if(this.ro)this.ro.disconnect()}render(){return t(d,{class:{[this.generalClasses.join(" ")]:true,"has-grid":!!this.gridClass,ready:this.ready,[this.gridClass]:true},"is-legacy":!l?true:undefined},t("div",{class:{grid:true}},t("slot",null)))}get el(){return o(this)}static get watchers(){return{sSize:["propChanged"],mSize:["propChanged"],lSize:["propChanged"],xlSize:["propChanged"],sCols:["propChanged"],mCols:["propChanged"],lCols:["propChanged"],xlCols:["propChanged"],xxlCols:["propChanged"],isSmall:["stateChange"],isMedium:["stateChange"],isLarge:["stateChange"],isXL:["stateChange"],isXXL:["stateChange"]}}};a.style=g;const m=":host{-webkit-box-sizing:border-box;box-sizing:border-box}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hidden]{display:none !important}:host{display:block}";const e=["col-span","col-start","row-span","row-start"];let c=class{constructor(r){i(this,r);this.currGridSizes=[null];this.gridStates=""}updateGridClasses(){this.applyChildrenClasses()}async changeBP(i){if(this.currGridSizes===i)return;this.currGridSizes=i;if(!this.gridStates.length)return;this.applyChildrenClasses()}applyChildrenClasses(){let i=[""],r="",t,d,o;o=this.el.className.split(" ").filter((i=>!i.startsWith("nano-grid-")));this.el.className=o.join(" ").trim();d=this.gridStates.split(" ");e.forEach((s=>{t=false;this.currGridSizes.slice().reverse().forEach((n=>{if(t||!n)return;t=d.find((i=>i.indexOf(`${n.size}-${s}`)===0));if(t){o=this.el.className.split(" ").filter((i=>!i.includes("nano-grid-${stateOpt}")));this.el.className=o.join(" ").trim();i=t.split("-");i.shift();r=i.join("-");this.el.classList.add(`nano-grid-${r}`)}}))}))}render(){return t("slot",null)}get el(){return o(this)}static get watchers(){return{gridStates:["updateGridClasses"]}}};c.style=m;const u=":host{-webkit-box-sizing:border-box;box-sizing:border-box}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hidden]{display:none !important}:host{--padding:0;display:inline-block;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;background-size:cover;background-position:center}:host *{border-radius:inherit}:host([background]:not([background=false])){display:block}.img{position:relative;min-height:inherit;height:100%;display:block;-o-object-fit:inherit;object-fit:inherit;-o-object-position:inherit;object-position:inherit;background-color:inherit;background-position:inherit;background-size:inherit;background-origin:inherit;background-attachment:inherit;background-repeat:inherit}.img__loader,.img__observer{position:absolute;top:0;left:0;bottom:0;right:0;height:100%;width:100%;z-index:-1}.img__image,.img__bg{border-radius:inherit;display:block;opacity:0;-webkit-transition:0.5s ease opacity, 0.3s ease filter 0.4s;transition:0.5s ease opacity, 0.3s ease filter 0.4s;-webkit-filter:blur(5px);filter:blur(5px)}.img__image.loaded,.img__bg.loaded{opacity:1;-webkit-filter:blur(0.1px);filter:blur(0.1px)}@media not all and (-webkit-min-device-pixel-ratio: 0), not all and (min-resolution: 0.001dpcm){@supports (-webkit-appearance: none){.img__image.loaded,.img__bg.loaded{-webkit-filter:blur(0);filter:blur(0)}}}.img__image{-o-object-fit:inherit;object-fit:inherit;-o-object-position:inherit;object-position:inherit;max-width:100%;height:auto}.img__image.hide{visibility:hidden}.img__image.hide.no-height{height:1px;position:absolute;z-index:-1}.img__bg{background-color:inherit;background-position:inherit;background-size:inherit;background-origin:inherit;background-attachment:inherit;background-repeat:inherit;overflow:auto;padding:var(--padding)}.img__bg.no-height{position:absolute;top:0;left:0;right:0;bottom:0}";let w=class{constructor(t){i(this,t);this.nanoImgWillLoad=r(this,"nanoImgWillLoad",7);this.nanoImgDidLoad=r(this,"nanoImgDidLoad",7);this.nanoImgError=r(this,"nanoImgError",7);this._srcSet={};this.hasLoaded=false;this.imgStates=null;this.lazy=true;this.autoHeight="content";this.onLoad=()=>{this.nanoImgDidLoad.emit();setTimeout((()=>this.hasLoaded=true),50)};this.onError=()=>{this.nanoImgError.emit()};this.onResize=i=>{Object.entries(i.detail).forEach((([i,r])=>{this._srcSet[i].active=r}));const r=[];Object.keys(this._srcSet).sort().forEach((i=>{if(this._srcSet[i].active)r.push(this._srcSet[i].src)}));if(r.length)this._src=r.slice(-1)[0];else this._src=this.src}}_srcChanged(){this.hasLoaded=false;this.addIO()}srcChanged(){this._src=this.src}srcSetChanged(){if(!this.srcSet)return;delete this._srcSet;this._srcSet={};this.imgStates=this.srcSet.split(",").map((i=>{const[r,t]=i.split(" ").filter((i=>i.length));this._srcSet[r]={src:t,active:false};return r})).join(", ")}lazyChanged(){if(!this.lazy)this.load()}addIO(){if(!this._src||this.hasLoaded)return;if(!this.lazy){this.load();return}if(typeof window!=="undefined"&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype){this.removeIO();this.io=new IntersectionObserver((i=>{if(i[0].isIntersecting){this.load();this.removeIO()}}));this.io.observe(this.host)}else setTimeout((()=>this.load()),200)}load(){this.loadError=this.onError;this.loadSrc=this._src;this.nanoImgWillLoad.emit()}removeIO(){if(this.io){this.io.disconnect();this.io=undefined}}connectedCallback(){this.srcChanged();this.srcSetChanged();this.lazyChanged()}componentDidLoad(){this.addIO()}disconnectedCallback(){this.removeIO()}render(){const i=!!this.loadSrc?{"background-image":`url(${this.loadSrc})`}:{};return t("div",{class:"img"},t("nano-skeleton",{class:"img__loader"}),!!this.background&&t("div",{class:{loaded:this.hasLoaded,img__bg:true,"no-height":this.autoHeight==="image"},style:i},t("slot",null)),t("img",{class:{img__image:true,loaded:this.hasLoaded,hide:this.background,"no-height":this.autoHeight==="content"},decoding:"async",src:this.loadSrc,alt:this.alt,onLoad:this.onLoad,onError:this.loadError}),t("nano-resize-observe",{class:"img__observer",onNanoResizeStateChange:this.onResize,states:this.imgStates}))}get host(){return o(this)}static get watchers(){return{_src:["_srcChanged"],src:["srcChanged"],srcSet:["srcSetChanged"],lazy:["lazyChanged"]}}};w.style=u;export{a as nano_grid,c as nano_grid_item,w as nano_img};
5
- //# sourceMappingURL=p-2c8d7273.entry.js.map