@nanoporetech-digital/components 2.10.1 → 2.13.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 (441) hide show
  1. package/CHANGELOG.md +58 -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/index.cjs.js +2 -0
  7. package/dist/cjs/index.cjs.js.map +1 -1
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/nano-algolia.cjs.entry.js +5 -1
  10. package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
  11. package/dist/cjs/nano-components.cjs.js +2 -2
  12. package/dist/cjs/nano-datalist_3.cjs.entry.js +3 -1
  13. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nano-date-input.cjs.entry.js +16 -5
  15. package/dist/cjs/nano-date-input.cjs.entry.js.map +1 -1
  16. package/dist/cjs/nano-date-picker.cjs.entry.js +2 -2
  17. package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -1
  18. package/dist/cjs/nano-details.cjs.entry.js +1 -2
  19. package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nano-field-validator.cjs.entry.js +292 -96
  21. package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nano-file-upload.cjs.entry.js +5 -2
  23. package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nano-global-search-results.cjs.entry.js +21 -6
  25. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nano-grid_3.cjs.entry.js +1 -2
  27. package/dist/cjs/nano-grid_3.cjs.entry.js.map +1 -1
  28. package/dist/cjs/nano-icon-button.cjs.entry.js +4 -0
  29. package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
  30. package/dist/cjs/nano-input.cjs.entry.js +16 -3
  31. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  32. package/dist/cjs/nano-nav-item_2.cjs.entry.js +2 -0
  33. package/dist/cjs/nano-nav-item_2.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +1 -2
  35. package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
  36. package/dist/cjs/nano-slides.cjs.entry.js +1 -2
  37. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  38. package/dist/cjs/nano-sticker.cjs.entry.js +2 -3
  39. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  40. package/dist/cjs/nano-tab-group.cjs.entry.js +4 -2
  41. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  42. package/dist/cjs/nano-tab.cjs.entry.js +5 -1
  43. package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
  44. package/dist/cjs/nano-tooltip.cjs.entry.js +1 -1
  45. package/dist/cjs/nano-tooltip.cjs.entry.js.map +1 -1
  46. package/dist/collection/components/accordion/accordion.js +1 -1
  47. package/dist/collection/components/alert/alert.js +1 -1
  48. package/dist/collection/components/algolia/algolia-filter.js +2 -2
  49. package/dist/collection/components/algolia/algolia-input.js +5 -5
  50. package/dist/collection/components/algolia/algolia-results.js +1 -1
  51. package/dist/collection/components/algolia/algolia.js +12 -6
  52. package/dist/collection/components/algolia/algolia.js.map +1 -1
  53. package/dist/collection/components/checkbox/checkbox-group.js +2 -2
  54. package/dist/collection/components/checkbox/checkbox.js +3 -3
  55. package/dist/collection/components/datalist/datalist.js +4 -2
  56. package/dist/collection/components/datalist/datalist.js.map +1 -1
  57. package/dist/collection/components/date-input/date-input.js +65 -11
  58. package/dist/collection/components/date-input/date-input.js.map +1 -1
  59. package/dist/collection/components/date-picker/date-picker.css +1 -1
  60. package/dist/collection/components/date-picker/date-picker.js +5 -5
  61. package/dist/collection/components/details/details.js +1 -2
  62. package/dist/collection/components/details/details.js.map +1 -1
  63. package/dist/collection/components/dialog/dialog.js +1 -1
  64. package/dist/collection/components/dropdown/dropdown.js +1 -1
  65. package/dist/collection/components/field-validator/field-validator-interface.js +5 -0
  66. package/dist/collection/components/field-validator/field-validator-interface.js.map +1 -0
  67. package/dist/collection/components/field-validator/field-validator.js +434 -113
  68. package/dist/collection/components/field-validator/field-validator.js.map +1 -1
  69. package/dist/collection/components/file-upload/file-upload.css +0 -1
  70. package/dist/collection/components/file-upload/file-upload.js +10 -7
  71. package/dist/collection/components/file-upload/file-upload.js.map +1 -1
  72. package/dist/collection/components/global-nav/global-nav.js +4 -4
  73. package/dist/collection/components/global-search-results/global-search-results.css +7 -0
  74. package/dist/collection/components/global-search-results/global-search-results.js +19 -4
  75. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  76. package/dist/collection/components/grid/grid-item.js +1 -1
  77. package/dist/collection/components/grid/grid.js +0 -1
  78. package/dist/collection/components/grid/grid.js.map +1 -1
  79. package/dist/collection/components/icon/icon.js +1 -1
  80. package/dist/collection/components/icon-button/icon-button.js +23 -1
  81. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  82. package/dist/collection/components/input/input.js +37 -8
  83. package/dist/collection/components/input/input.js.map +1 -1
  84. package/dist/collection/components/nav-item/nav-item.js +4 -4
  85. package/dist/collection/components/range/range.js +4 -4
  86. package/dist/collection/components/resize-observe/resize-observe.js +1 -2
  87. package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
  88. package/dist/collection/components/select/select.js +9 -7
  89. package/dist/collection/components/select/select.js.map +1 -1
  90. package/dist/collection/components/slides/slides.js +7 -8
  91. package/dist/collection/components/slides/slides.js.map +1 -1
  92. package/dist/collection/components/sticker/sticker.js +0 -1
  93. package/dist/collection/components/sticker/sticker.js.map +1 -1
  94. package/dist/collection/components/tabs/tab-group.js +5 -3
  95. package/dist/collection/components/tabs/tab-group.js.map +1 -1
  96. package/dist/collection/components/tabs/tab.js +5 -1
  97. package/dist/collection/components/tabs/tab.js.map +1 -1
  98. package/dist/collection/components/tooltip/tooltip.css +0 -1
  99. package/dist/collection/global/script/global.js +0 -7
  100. package/dist/collection/global/script/global.js.map +1 -1
  101. package/dist/collection/index.js +1 -0
  102. package/dist/collection/index.js.map +1 -1
  103. package/dist/collection/utils/date-utils.js +1 -1
  104. package/dist/collection/utils/date-utils.js.map +1 -1
  105. package/dist/components/algolia.js +5 -1
  106. package/dist/components/algolia.js.map +1 -1
  107. package/dist/components/datalist.js +3 -1
  108. package/dist/components/datalist.js.map +1 -1
  109. package/dist/components/date-picker.js +2 -2
  110. package/dist/components/date-picker.js.map +1 -1
  111. package/dist/components/grid.js +1 -2
  112. package/dist/components/grid.js.map +1 -1
  113. package/dist/components/icon-button.js +6 -1
  114. package/dist/components/icon-button.js.map +1 -1
  115. package/dist/components/index.js +1 -7
  116. package/dist/components/index.js.map +1 -1
  117. package/dist/components/input.js +17 -3
  118. package/dist/components/input.js.map +1 -1
  119. package/dist/components/nano-date-input.js +17 -4
  120. package/dist/components/nano-date-input.js.map +1 -1
  121. package/dist/components/nano-details.js +1 -2
  122. package/dist/components/nano-details.js.map +1 -1
  123. package/dist/components/nano-field-validator.js +300 -99
  124. package/dist/components/nano-field-validator.js.map +1 -1
  125. package/dist/components/nano-file-upload.js +6 -3
  126. package/dist/components/nano-file-upload.js.map +1 -1
  127. package/dist/components/nano-global-search-results.js +21 -6
  128. package/dist/components/nano-global-search-results.js.map +1 -1
  129. package/dist/components/nano-slides.js +1 -2
  130. package/dist/components/nano-slides.js.map +1 -1
  131. package/dist/components/nano-tab-group.js +4 -2
  132. package/dist/components/nano-tab-group.js.map +1 -1
  133. package/dist/components/nano-tab.js +5 -1
  134. package/dist/components/nano-tab.js.map +1 -1
  135. package/dist/components/resize-observe.js +1 -2
  136. package/dist/components/resize-observe.js.map +1 -1
  137. package/dist/components/select.js +2 -0
  138. package/dist/components/select.js.map +1 -1
  139. package/dist/components/sticker.js +2 -3
  140. package/dist/components/sticker.js.map +1 -1
  141. package/dist/components/tooltip.js +1 -1
  142. package/dist/components/tooltip.js.map +1 -1
  143. package/dist/custom-elements/index.js +386 -2046
  144. package/dist/custom-elements/index.js.map +1 -1
  145. package/dist/esm/{date-utils-e4b757ff.js → date-utils-839cb010.js} +2 -2
  146. package/dist/esm/date-utils-839cb010.js.map +1 -0
  147. package/dist/esm/{global-d5ec4d53.js → global-8047b4ff.js} +1 -8
  148. package/dist/esm/global-8047b4ff.js.map +1 -0
  149. package/dist/esm/index.js +1 -0
  150. package/dist/esm/index.js.map +1 -1
  151. package/dist/esm/loader.js +2 -2
  152. package/dist/esm/nano-algolia.entry.js +5 -1
  153. package/dist/esm/nano-algolia.entry.js.map +1 -1
  154. package/dist/esm/nano-components.js +2 -2
  155. package/dist/esm/nano-datalist_3.entry.js +3 -1
  156. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  157. package/dist/esm/nano-date-input.entry.js +16 -5
  158. package/dist/esm/nano-date-input.entry.js.map +1 -1
  159. package/dist/esm/nano-date-picker.entry.js +2 -2
  160. package/dist/esm/nano-date-picker.entry.js.map +1 -1
  161. package/dist/esm/nano-details.entry.js +1 -2
  162. package/dist/esm/nano-details.entry.js.map +1 -1
  163. package/dist/esm/nano-field-validator.entry.js +292 -96
  164. package/dist/esm/nano-field-validator.entry.js.map +1 -1
  165. package/dist/esm/nano-file-upload.entry.js +5 -2
  166. package/dist/esm/nano-file-upload.entry.js.map +1 -1
  167. package/dist/esm/nano-global-search-results.entry.js +21 -6
  168. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  169. package/dist/esm/nano-grid_3.entry.js +1 -2
  170. package/dist/esm/nano-grid_3.entry.js.map +1 -1
  171. package/dist/esm/nano-icon-button.entry.js +4 -0
  172. package/dist/esm/nano-icon-button.entry.js.map +1 -1
  173. package/dist/esm/nano-input.entry.js +16 -3
  174. package/dist/esm/nano-input.entry.js.map +1 -1
  175. package/dist/esm/nano-nav-item_2.entry.js +2 -0
  176. package/dist/esm/nano-nav-item_2.entry.js.map +1 -1
  177. package/dist/esm/nano-resize-observe_2.entry.js +1 -2
  178. package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
  179. package/dist/esm/nano-slides.entry.js +1 -2
  180. package/dist/esm/nano-slides.entry.js.map +1 -1
  181. package/dist/esm/nano-sticker.entry.js +2 -3
  182. package/dist/esm/nano-sticker.entry.js.map +1 -1
  183. package/dist/esm/nano-tab-group.entry.js +4 -2
  184. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  185. package/dist/esm/nano-tab.entry.js +5 -1
  186. package/dist/esm/nano-tab.entry.js.map +1 -1
  187. package/dist/esm/nano-tooltip.entry.js +1 -1
  188. package/dist/esm/nano-tooltip.entry.js.map +1 -1
  189. package/dist/esm-es5/date-utils-839cb010.js +5 -0
  190. package/dist/esm-es5/date-utils-839cb010.js.map +1 -0
  191. package/dist/esm-es5/{global-d5ec4d53.js → global-8047b4ff.js} +2 -2
  192. package/dist/esm-es5/global-8047b4ff.js.map +1 -0
  193. package/dist/esm-es5/index.js +2 -2
  194. package/dist/esm-es5/index.js.map +1 -1
  195. package/dist/esm-es5/loader.js +1 -1
  196. package/dist/esm-es5/loader.js.map +1 -1
  197. package/dist/esm-es5/nano-algolia.entry.js +1 -1
  198. package/dist/esm-es5/nano-algolia.entry.js.map +1 -1
  199. package/dist/esm-es5/nano-components.js +1 -1
  200. package/dist/esm-es5/nano-components.js.map +1 -1
  201. package/dist/esm-es5/nano-datalist_3.entry.js +1 -1
  202. package/dist/esm-es5/nano-datalist_3.entry.js.map +1 -1
  203. package/dist/esm-es5/nano-date-input.entry.js +1 -1
  204. package/dist/esm-es5/nano-date-input.entry.js.map +1 -1
  205. package/dist/esm-es5/nano-date-picker.entry.js +1 -1
  206. package/dist/esm-es5/nano-date-picker.entry.js.map +1 -1
  207. package/dist/esm-es5/nano-details.entry.js +1 -1
  208. package/dist/esm-es5/nano-details.entry.js.map +1 -1
  209. package/dist/esm-es5/nano-field-validator.entry.js +2 -2
  210. package/dist/esm-es5/nano-field-validator.entry.js.map +1 -1
  211. package/dist/esm-es5/nano-file-upload.entry.js +1 -1
  212. package/dist/esm-es5/nano-file-upload.entry.js.map +1 -1
  213. package/dist/esm-es5/nano-global-search-results.entry.js +1 -1
  214. package/dist/esm-es5/nano-global-search-results.entry.js.map +1 -1
  215. package/dist/esm-es5/nano-grid_3.entry.js +1 -1
  216. package/dist/esm-es5/nano-grid_3.entry.js.map +1 -1
  217. package/dist/esm-es5/nano-icon-button.entry.js +2 -2
  218. package/dist/esm-es5/nano-icon-button.entry.js.map +1 -1
  219. package/dist/esm-es5/nano-input.entry.js +1 -1
  220. package/dist/esm-es5/nano-input.entry.js.map +1 -1
  221. package/dist/esm-es5/nano-nav-item_2.entry.js +1 -1
  222. package/dist/esm-es5/nano-nav-item_2.entry.js.map +1 -1
  223. package/dist/esm-es5/nano-resize-observe_2.entry.js +1 -1
  224. package/dist/esm-es5/nano-resize-observe_2.entry.js.map +1 -1
  225. package/dist/esm-es5/nano-slides.entry.js +2 -2
  226. package/dist/esm-es5/nano-slides.entry.js.map +1 -1
  227. package/dist/esm-es5/nano-sticker.entry.js +1 -1
  228. package/dist/esm-es5/nano-sticker.entry.js.map +1 -1
  229. package/dist/esm-es5/nano-tab-group.entry.js +2 -2
  230. package/dist/esm-es5/nano-tab-group.entry.js.map +1 -1
  231. package/dist/esm-es5/nano-tab.entry.js +2 -2
  232. package/dist/esm-es5/nano-tab.entry.js.map +1 -1
  233. package/dist/esm-es5/nano-tooltip.entry.js +1 -1
  234. package/dist/esm-es5/nano-tooltip.entry.js.map +1 -1
  235. package/dist/nano-components/index.esm.js +1 -1
  236. package/dist/nano-components/index.esm.js.map +1 -1
  237. package/dist/nano-components/nano-components.esm.js +1 -1
  238. package/dist/nano-components/nano-components.esm.js.map +1 -1
  239. package/dist/nano-components/nano-components.js +1 -1
  240. package/dist/nano-components/p-018b7047.entry.js +5 -0
  241. package/dist/nano-components/p-018b7047.entry.js.map +1 -0
  242. package/dist/nano-components/p-0193a282.entry.js +5 -0
  243. package/dist/nano-components/p-0193a282.entry.js.map +1 -0
  244. package/dist/nano-components/p-0320410c.entry.js +5 -0
  245. package/dist/nano-components/p-0320410c.entry.js.map +1 -0
  246. package/dist/nano-components/p-0d699368.system.js +5 -0
  247. package/dist/nano-components/{p-3258c568.system.js.map → p-0d699368.system.js.map} +1 -1
  248. package/dist/nano-components/p-18863670.system.entry.js +5 -0
  249. package/dist/nano-components/p-18863670.system.entry.js.map +1 -0
  250. package/dist/nano-components/p-32900c91.entry.js +5 -0
  251. package/dist/nano-components/p-32900c91.entry.js.map +1 -0
  252. package/dist/nano-components/p-33fce1a6.js +5 -0
  253. package/dist/nano-components/p-33fce1a6.js.map +1 -0
  254. package/dist/nano-components/p-371aebe7.system.entry.js +23 -0
  255. package/dist/nano-components/p-371aebe7.system.entry.js.map +1 -0
  256. package/dist/nano-components/p-41899a31.system.entry.js +5 -0
  257. package/dist/nano-components/p-41899a31.system.entry.js.map +1 -0
  258. package/dist/nano-components/p-53957ec6.system.js +5 -0
  259. package/dist/nano-components/{p-e7140887.system.js.map → p-53957ec6.system.js.map} +1 -1
  260. package/dist/nano-components/p-561500f0.system.entry.js +5 -0
  261. package/dist/nano-components/p-561500f0.system.entry.js.map +1 -0
  262. package/dist/nano-components/p-596c1711.system.entry.js +5 -0
  263. package/dist/nano-components/p-596c1711.system.entry.js.map +1 -0
  264. package/dist/nano-components/{p-01667573.entry.js → p-634a58f7.entry.js} +2 -2
  265. package/dist/nano-components/p-634a58f7.entry.js.map +1 -0
  266. package/dist/nano-components/p-6a949280.system.entry.js +5 -0
  267. package/dist/nano-components/p-6a949280.system.entry.js.map +1 -0
  268. package/dist/nano-components/{p-bf9aa89d.system.entry.js → p-6af10533.system.entry.js} +3 -3
  269. package/dist/nano-components/p-6af10533.system.entry.js.map +1 -0
  270. package/dist/nano-components/p-70272eae.js +5 -0
  271. package/dist/nano-components/p-70272eae.js.map +1 -0
  272. package/dist/nano-components/p-755d9227.entry.js +5 -0
  273. package/dist/nano-components/p-755d9227.entry.js.map +1 -0
  274. package/dist/nano-components/p-7bd25494.entry.js +5 -0
  275. package/dist/nano-components/p-7bd25494.entry.js.map +1 -0
  276. package/dist/nano-components/p-7c837460.entry.js +5 -0
  277. package/dist/nano-components/p-7c837460.entry.js.map +1 -0
  278. package/dist/nano-components/p-7f051c20.entry.js +5 -0
  279. package/dist/nano-components/p-7f051c20.entry.js.map +1 -0
  280. package/dist/nano-components/{p-93880c28.system.js → p-82e28afd.system.js} +2 -2
  281. package/dist/nano-components/p-82e28afd.system.js.map +1 -0
  282. package/dist/nano-components/p-8378428e.system.js +5 -0
  283. package/dist/nano-components/p-8378428e.system.js.map +1 -0
  284. package/dist/nano-components/p-8df4f125.system.entry.js +5 -0
  285. package/dist/nano-components/p-8df4f125.system.entry.js.map +1 -0
  286. package/dist/nano-components/{p-d0385948.system.entry.js → p-93596c3d.system.entry.js} +2 -2
  287. package/dist/nano-components/p-93596c3d.system.entry.js.map +1 -0
  288. package/dist/nano-components/{p-3e930ac7.entry.js → p-9d9b0b66.entry.js} +2 -2
  289. package/dist/nano-components/p-9d9b0b66.entry.js.map +1 -0
  290. package/dist/nano-components/p-9ffdf6cc.entry.js +5 -0
  291. package/dist/nano-components/{p-222d8095.entry.js.map → p-9ffdf6cc.entry.js.map} +1 -1
  292. package/dist/nano-components/p-a07cf44c.system.entry.js +5 -0
  293. package/dist/nano-components/p-a07cf44c.system.entry.js.map +1 -0
  294. package/dist/nano-components/p-a1444980.entry.js +5 -0
  295. package/dist/nano-components/p-a1444980.entry.js.map +1 -0
  296. package/dist/nano-components/p-aa84c727.system.entry.js +5 -0
  297. package/dist/nano-components/p-aa84c727.system.entry.js.map +1 -0
  298. package/dist/nano-components/p-ac5e3775.system.entry.js +5 -0
  299. package/dist/nano-components/p-ac5e3775.system.entry.js.map +1 -0
  300. package/dist/nano-components/p-b85cf493.system.entry.js +5 -0
  301. package/dist/nano-components/{p-e817ab4a.system.entry.js.map → p-b85cf493.system.entry.js.map} +1 -1
  302. package/dist/nano-components/{p-96d9b8b9.system.entry.js → p-c2bbf0fb.system.entry.js} +2 -2
  303. package/dist/nano-components/p-c2bbf0fb.system.entry.js.map +1 -0
  304. package/dist/nano-components/{p-f780d2f6.system.entry.js → p-cb512cff.system.entry.js} +2 -2
  305. package/dist/nano-components/p-cb512cff.system.entry.js.map +1 -0
  306. package/dist/nano-components/{p-4e2c0abb.entry.js → p-ccd6c206.entry.js} +2 -2
  307. package/dist/nano-components/p-ccd6c206.entry.js.map +1 -0
  308. package/dist/nano-components/{p-1030797a.entry.js → p-d37e1489.entry.js} +2 -2
  309. package/dist/nano-components/p-d37e1489.entry.js.map +1 -0
  310. package/dist/nano-components/p-da88981f.entry.js +23 -0
  311. package/dist/nano-components/p-da88981f.entry.js.map +1 -0
  312. package/dist/nano-components/p-e8a913ac.system.entry.js +5 -0
  313. package/dist/nano-components/p-e8a913ac.system.entry.js.map +1 -0
  314. package/dist/nano-components/p-e9fddc1a.entry.js +5 -0
  315. package/dist/nano-components/p-e9fddc1a.entry.js.map +1 -0
  316. package/dist/nano-components/p-ea54ee12.entry.js +5 -0
  317. package/dist/nano-components/p-ea54ee12.entry.js.map +1 -0
  318. package/dist/nano-components/{p-86bd5194.entry.js → p-ed0bdea9.entry.js} +2 -2
  319. package/dist/nano-components/p-ed0bdea9.entry.js.map +1 -0
  320. package/dist/nano-components/p-faba2fc1.system.entry.js +5 -0
  321. package/dist/nano-components/p-faba2fc1.system.entry.js.map +1 -0
  322. package/dist/nano-components/p-ff026352.system.entry.js +5 -0
  323. package/dist/nano-components/p-ff026352.system.entry.js.map +1 -0
  324. package/dist/themes/nanopore.css +1 -1
  325. package/dist/themes/nanopore.css.map +1 -1
  326. package/dist/types/components/algolia/algolia.d.ts +1 -0
  327. package/dist/types/components/date-input/date-input.d.ts +6 -1
  328. package/dist/types/components/field-validator/field-validator-interface.d.ts +19 -0
  329. package/dist/types/components/field-validator/field-validator.d.ts +77 -31
  330. package/dist/types/components/file-upload/file-upload.d.ts +2 -1
  331. package/dist/types/components/global-search-results/global-search-results.d.ts +1 -0
  332. package/dist/types/components/icon-button/icon-button.d.ts +2 -0
  333. package/dist/types/components/input/input.d.ts +6 -1
  334. package/dist/types/components/tabs/tab.d.ts +1 -0
  335. package/dist/types/components.d.ts +67 -12
  336. package/dist/types/index.d.ts +1 -0
  337. package/dist/types/interface.d.ts +1 -0
  338. package/docs-json.json +161 -13
  339. package/docs-vscode.json +6 -2
  340. package/package.json +2 -4
  341. package/dist/cjs/ResizeObserver.es-09b81a1b.js +0 -935
  342. package/dist/cjs/ResizeObserver.es-09b81a1b.js.map +0 -1
  343. package/dist/cjs/date-utils-0ae9a12d.js.map +0 -1
  344. package/dist/cjs/global-0d4f3b77.js.map +0 -1
  345. package/dist/cjs/intersection-observer-1822c787.js +0 -987
  346. package/dist/cjs/intersection-observer-1822c787.js.map +0 -1
  347. package/dist/components/ResizeObserver.es.js +0 -933
  348. package/dist/components/ResizeObserver.es.js.map +0 -1
  349. package/dist/components/intersection-observer.js +0 -985
  350. package/dist/components/intersection-observer.js.map +0 -1
  351. package/dist/esm/ResizeObserver.es-724af9fd.js +0 -933
  352. package/dist/esm/ResizeObserver.es-724af9fd.js.map +0 -1
  353. package/dist/esm/date-utils-e4b757ff.js.map +0 -1
  354. package/dist/esm/global-d5ec4d53.js.map +0 -1
  355. package/dist/esm/intersection-observer-dff9fb5b.js +0 -985
  356. package/dist/esm/intersection-observer-dff9fb5b.js.map +0 -1
  357. package/dist/esm-es5/ResizeObserver.es-724af9fd.js +0 -5
  358. package/dist/esm-es5/ResizeObserver.es-724af9fd.js.map +0 -1
  359. package/dist/esm-es5/date-utils-e4b757ff.js +0 -5
  360. package/dist/esm-es5/date-utils-e4b757ff.js.map +0 -1
  361. package/dist/esm-es5/global-d5ec4d53.js.map +0 -1
  362. package/dist/esm-es5/intersection-observer-dff9fb5b.js +0 -5
  363. package/dist/esm-es5/intersection-observer-dff9fb5b.js.map +0 -1
  364. package/dist/nano-components/p-00eaa36a.entry.js +0 -5
  365. package/dist/nano-components/p-00eaa36a.entry.js.map +0 -1
  366. package/dist/nano-components/p-01667573.entry.js.map +0 -1
  367. package/dist/nano-components/p-1030797a.entry.js.map +0 -1
  368. package/dist/nano-components/p-11a2dcce.js +0 -5
  369. package/dist/nano-components/p-11a2dcce.js.map +0 -1
  370. package/dist/nano-components/p-1a30dfdd.system.entry.js +0 -5
  371. package/dist/nano-components/p-1a30dfdd.system.entry.js.map +0 -1
  372. package/dist/nano-components/p-1b120f53.entry.js +0 -5
  373. package/dist/nano-components/p-1b120f53.entry.js.map +0 -1
  374. package/dist/nano-components/p-21d6d31e.system.entry.js +0 -5
  375. package/dist/nano-components/p-21d6d31e.system.entry.js.map +0 -1
  376. package/dist/nano-components/p-222d8095.entry.js +0 -5
  377. package/dist/nano-components/p-241d90eb.system.entry.js +0 -5
  378. package/dist/nano-components/p-241d90eb.system.entry.js.map +0 -1
  379. package/dist/nano-components/p-2c8d7273.entry.js +0 -5
  380. package/dist/nano-components/p-2c8d7273.entry.js.map +0 -1
  381. package/dist/nano-components/p-3093915f.entry.js +0 -5
  382. package/dist/nano-components/p-3093915f.entry.js.map +0 -1
  383. package/dist/nano-components/p-3258c568.system.js +0 -5
  384. package/dist/nano-components/p-325c1cad.entry.js +0 -5
  385. package/dist/nano-components/p-325c1cad.entry.js.map +0 -1
  386. package/dist/nano-components/p-32f396c0.system.entry.js +0 -5
  387. package/dist/nano-components/p-32f396c0.system.entry.js.map +0 -1
  388. package/dist/nano-components/p-35108e08.entry.js +0 -5
  389. package/dist/nano-components/p-35108e08.entry.js.map +0 -1
  390. package/dist/nano-components/p-3ccb176c.system.entry.js +0 -5
  391. package/dist/nano-components/p-3ccb176c.system.entry.js.map +0 -1
  392. package/dist/nano-components/p-3e930ac7.entry.js.map +0 -1
  393. package/dist/nano-components/p-42cebbfe.system.entry.js +0 -5
  394. package/dist/nano-components/p-42cebbfe.system.entry.js.map +0 -1
  395. package/dist/nano-components/p-4e2c0abb.entry.js.map +0 -1
  396. package/dist/nano-components/p-5d17cfbb.system.entry.js +0 -23
  397. package/dist/nano-components/p-5d17cfbb.system.entry.js.map +0 -1
  398. package/dist/nano-components/p-5d5ea4ab.system.entry.js +0 -5
  399. package/dist/nano-components/p-5d5ea4ab.system.entry.js.map +0 -1
  400. package/dist/nano-components/p-6722447c.entry.js +0 -5
  401. package/dist/nano-components/p-6722447c.entry.js.map +0 -1
  402. package/dist/nano-components/p-6d138abf.entry.js +0 -5
  403. package/dist/nano-components/p-6d138abf.entry.js.map +0 -1
  404. package/dist/nano-components/p-76d9d1d4.entry.js +0 -5
  405. package/dist/nano-components/p-76d9d1d4.entry.js.map +0 -1
  406. package/dist/nano-components/p-866f083f.system.entry.js +0 -5
  407. package/dist/nano-components/p-866f083f.system.entry.js.map +0 -1
  408. package/dist/nano-components/p-86bd5194.entry.js.map +0 -1
  409. package/dist/nano-components/p-88779174.system.entry.js +0 -5
  410. package/dist/nano-components/p-88779174.system.entry.js.map +0 -1
  411. package/dist/nano-components/p-93880c28.system.js.map +0 -1
  412. package/dist/nano-components/p-96d9b8b9.system.entry.js.map +0 -1
  413. package/dist/nano-components/p-97b13ad2.entry.js +0 -5
  414. package/dist/nano-components/p-97b13ad2.entry.js.map +0 -1
  415. package/dist/nano-components/p-b430a9b6.system.js +0 -5
  416. package/dist/nano-components/p-b430a9b6.system.js.map +0 -1
  417. package/dist/nano-components/p-bc394857.system.entry.js +0 -5
  418. package/dist/nano-components/p-bc394857.system.entry.js.map +0 -1
  419. package/dist/nano-components/p-bf9aa89d.system.entry.js.map +0 -1
  420. package/dist/nano-components/p-c3830c43.entry.js +0 -5
  421. package/dist/nano-components/p-c3830c43.entry.js.map +0 -1
  422. package/dist/nano-components/p-d0385948.system.entry.js.map +0 -1
  423. package/dist/nano-components/p-debd9efc.js +0 -5
  424. package/dist/nano-components/p-debd9efc.js.map +0 -1
  425. package/dist/nano-components/p-e195ab77.system.js +0 -5
  426. package/dist/nano-components/p-e195ab77.system.js.map +0 -1
  427. package/dist/nano-components/p-e7140887.system.js +0 -5
  428. package/dist/nano-components/p-e817ab4a.system.entry.js +0 -5
  429. package/dist/nano-components/p-f5d4d13b.system.js +0 -5
  430. package/dist/nano-components/p-f5d4d13b.system.js.map +0 -1
  431. package/dist/nano-components/p-f66958c1.js +0 -5
  432. package/dist/nano-components/p-f66958c1.js.map +0 -1
  433. package/dist/nano-components/p-f710c763.system.entry.js +0 -5
  434. package/dist/nano-components/p-f710c763.system.entry.js.map +0 -1
  435. package/dist/nano-components/p-f780d2f6.system.entry.js.map +0 -1
  436. package/dist/nano-components/p-f9c7d961.js +0 -5
  437. package/dist/nano-components/p-f9c7d961.js.map +0 -1
  438. package/dist/nano-components/p-ffc2063a.entry.js +0 -23
  439. package/dist/nano-components/p-ffc2063a.entry.js.map +0 -1
  440. package/dist/nano-components/p-fff27907.system.entry.js +0 -5
  441. package/dist/nano-components/p-fff27907.system.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"file":"nano-grid.nano-grid-item.nano-img.entry.cjs.js","mappings":";;;;;;;;;;;AAAA,MAAM,OAAO,GAAG,u14BAAu14B;;ACev24B,MAAMA,WAAS,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AACrE,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;IAWlC,IAAI;EAQf;;;IALQ,mBAAc,GAAkB,CAAC,EAAE,CAAC,CAAC;IACrC,cAAS,GAAW,IAAI,CAAC;IACzB,YAAO,GAAgB,CAAC,IAAI,CAAC,CAAC;IAO7B,UAAK,GAAY,KAAK,CAAC;IACvB,YAAO,GAAG,KAAK,CAAC;IAChB,aAAQ,GAAG,KAAK,CAAC;IACjB,YAAO,GAAG,KAAK,CAAC;IAChB,SAAI,GA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AM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO;QAC1B,EAAE,kBAAkB,EAAE,OAAO,IAAI,CAAC,OAAO,GAAG,EAAE;QAC9C,EAAE,CAAC;IACP,QACEA,iBAAK,KAAK,EAAC,KAAK,IACdA,2BAAe,KAAK,EAAC,aAAa,GAAiB,EAClD,CAAC,CAAC,IAAI,CAAC,UAAU,KAChBA,iBACE,KAAK,EAAE;QACL,MAAM,EAAE,IAAI,CAAC,SAAS;QACtB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO;OACzC,EACD,KAAK,EAAE,OAAO,IAEdA,qBAAQ,CACJ,CACP,EACDA,iBACE,KAAK,EAAE;QACL,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI,CAAC,SAAS;QACtB,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,WAAW,EAAE,IAAI,CAAC,UAAU,KAAK,SAAS;OAC3C,EACD,QAAQ,EAAC,OAAO,EAChB,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,SAAS,GACvB,EACFA,iCACE,KAAK,EAAC,eAAe,EACrB,uBAAuB,EAAE,IAAI,CAAC,QAAQ,EACtC,MAAM,EAAE,IAAI,CAAC,SAAS,GACtB,CACE,EACN;GACH;;;;;;;;;;;;;;;","names":["STATEOPTS","debounce","ResizeObserver","h","Host"],"sources":["./src/components/grid/grid.scss?tag=nano-grid&encapsulation=shadow","./src/components/grid/grid.tsx","./src/components/grid/grid-item.scss?tag=nano-grid-item&encapsulation=shadow","./src/components/grid/grid-item.tsx","./src/components/img/img.scss?tag=nano-img&encapsulation=shadow","./src/components/img/img.tsx"],"sourcesContent":["// we use &::slotted selectors to target ie ... this is a due to a bug with how stencil makes css scoping for browsers without shadow-dom. Need to be mindful incase they ever fix this!\n\n@import '../../global/style/nano-theme/base';\n\n// ie 11 fixes ... maximum numbers we can place on the grid ... upping this number decreases performance a lot.\n$max-grid-cols: 10;\n\n@mixin grid($size: 1) {\n @at-root :host(.nano-grid-#{$size}) {\n --current-grid-size: 'grid size: #{$size}';\n --col-width: calc(#{100 / $size}% - var(--grid-col-gap));\n --repeat-width: calc(100% / #{$size});\n\n .grid {\n grid-template-columns: repeat(#{$size}, minmax(var(--col-width), 1fr));\n\n $current-column: 1;\n $current-row: 1;\n\n @for $i from 1 through ($max-grid-cols * 2) {\n @if $current-column > $size {\n $current-column: 1;\n $current-row: $current-row + 1;\n }\n\n &::slotted(:nth-child(#{$i})) {\n -ms-grid-row: $current-row;\n -ms-grid-column: $current-column;\n // use margin because there's no grid gap.\n }\n $current-column: $current-column + 1;\n }\n }\n }\n}\n\n@mixin grid-spans {\n @for $i from 1 through $max-grid-cols {\n ::slotted(.nano-grid-col-start-#{$i}),\n &::slotted(.nano-grid-col-start-#{$i}) {\n grid-column-start: #{$i} !important;\n }\n\n ::slotted(.nano-grid-row-start-#{$i}),\n &::slotted(.nano-grid-row-start-#{$i}) {\n grid-row-start: #{$i} !important;\n }\n\n ::slotted(.nano-grid-col-span-#{$i}),\n &::slotted(.nano-grid-col-span-#{$i}) {\n grid-column-end: span #{$i} !important;\n }\n\n ::slotted(.nano-grid-row-span-#{$i}),\n &::slotted(.nano-grid-row-span-#{$i}) {\n grid-row-end: span #{$i} !important;\n }\n }\n}\n\n:host {\n /**\n * @prop --grid-col-gap: gap between all columns. Defaults to theme's global padding\n * @prop --grid-row-gap: gap between all rows. Defaults to theme's global padding\n */\n\n --grid-col-gap: #{$spacing-medium};\n --grid-row-gap: #{$spacing-medium};\n --current-grid-size: \"'grid size: sm'\";\n\n display: block;\n opacity: 0;\n transition: 0.2s ease opacity;\n\n .grid {\n /* autoprefixer: ignore next */\n display: grid;\n\n /* autoprefixer: ignore next */\n grid-gap: var(--grid-row-gap) var(--grid-col-gap);\n height: inherit;\n min-height: inherit;\n\n &::slotted(*) {\n border: 0 solid transparent;\n background-clip: padding-box;\n border-width: var(--grid-row-gap) calc(var(--grid-col-gap) / 2);\n }\n }\n}\n\n:host(.ready) {\n opacity: 1;\n}\n\n:host(.has-grid) {\n .grid {\n display: grid;\n\n @include grid-spans;\n\n // ie 'grid gap'. use border because there's no grid gap.\n &::slotted(*) {\n border-width: calc(var(--grid-row-gap) / 2) calc(var(--grid-col-gap) / 2);\n }\n }\n}\n\n// All sorts of IE fuckery to recreate grid-gap when nested etc\n:host([is-legacy]) {\n overflow: hidden;\n\n .grid {\n margin-bottom: calc(var(--grid-row-gap) * -0.5);\n margin-top: calc(var(--grid-row-gap) * -0.5);\n margin-left: calc(var(--grid-col-gap) * -0.5);\n margin-right: calc(var(--grid-col-gap) * -0.5);\n }\n}\n\n// nested\nnano-grid :host-context[is-legacy] {\n overflow: visible;\n\n .grid {\n &::slotted(:first-child) {\n border-top-width: calc(var(--grid-row-gap) / 2);\n }\n\n &::slotted(:last-child) {\n border-bottom-width: calc(var(--grid-row-gap) / 2);\n }\n }\n}\n\n:host([content-panel]:not([content-panel='false'])) {\n display: -ms-flexbox;\n -ms-flex-direction: column;\n\n .grid {\n grid-template-rows: auto 1fr;\n }\n}\n\n:host([full-height]:not([full-height='false'])) {\n height: 100%;\n\n .grid {\n grid-template-rows: 1fr;\n\n &::slotted(*) {\n min-height: 100%;\n }\n }\n}\n\n:host([show-helper]:not([show-helper='false'])) {\n .grid {\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n pointer-events: none;\n background-image:\n repeating-linear-gradient(\n to right,\n hsla(204, 80%, 72%, 0.25),\n hsla(204, 80%, 72%, 0.25) var(--col-width),\n transparent var(--col-width),\n transparent var(--repeat-width)\n );\n background-size: calc(100% + var(--grid-col-gap)) 100%;\n z-index: 100;\n }\n\n &::before {\n content: var(--current-grid-size);\n font-size: 30px;\n position: absolute;\n width: 100%;\n left: 0;\n text-align: center;\n top: 50%;\n transform: translateY(-50%);\n color: rgba(0, 0, 0, 0.2);\n text-transform: uppercase;\n z-index: 99;\n pointer-events: none;\n }\n }\n}\n\n@for $i from 1 through $max-grid-cols {\n @include grid($i);\n}\n","import {\n Component,\n h,\n Prop,\n Element,\n Host,\n State,\n Watch,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport ResizeObserver from 'resize-observer-polyfill';\nimport { GridSizes } from '../../interface';\nimport { debounce } from '../../utils';\n\nconst STATEOPTS = ['col-span', 'col-start', 'row-span', 'row-start'];\nconst CANSHADOW = !!document.head.attachShadow;\n\n/**\n * A context-aware CSS grid implementation.\n * Uses it's own width to choose column number - not screen width.\n */\n@Component({\n tag: 'nano-grid',\n styleUrl: 'grid.scss',\n shadow: true,\n})\nexport class Grid {\n @Element() private el: HTMLNanoGridElement;\n private ro: ResizeObserver;\n private generalClasses: Array<string> = [''];\n private gridClass: string = null;\n private isSizes: GridSizes[] = [null];\n private currentWidth: number;\n\n constructor() {\n this.stateChange = debounce(this.stateChange.bind(this), 100);\n }\n\n @State() ready: boolean = false;\n @State() isSmall = false;\n @State() isMedium = false;\n @State() isLarge = false;\n @State() isXL = false;\n @State() isXXL = false;\n\n /**\n * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() sSize: number = 300;\n\n /**\n * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() mSize: number = 550;\n\n /**\n * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() lSize: number = 800;\n\n /**\n * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() xlSize: number = 1000;\n\n /**\n * the number of columns the grid has at the small breakpoint.\n */\n @Prop() sCols: number;\n\n /**\n * the number of columns the grid has at the medium breakpoint.\n */\n @Prop() mCols: number;\n\n /**\n * the number of columns the grid has at the large breakpoint.\n */\n @Prop() lCols: number;\n\n /**\n * the number of columns the grid has at the xl breakpoint.\n */\n @Prop() xlCols: number;\n\n /**\n * the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint)\n */\n @Prop() xxlCols: number;\n\n /**\n * shows a grid helper to visualise where columns are\n */\n @Prop({ reflect: true }) showHelper: boolean = false;\n\n /**\n * shortcut for a traditional website like grid (requires more than one row). The second row will auto expand to fill the grid height. The first row and > 2nd row will be the size of their content. e.g. header, body and footer.\n */\n @Prop({ reflect: true }) contentPanel: boolean = false;\n\n /**\n * Helper to make grid items expand to full height in IE11\n */\n @Prop({ reflect: true }) fullHeight: boolean = false;\n\n /**\n * Emitted when the `nano-grid` changes breakpoint\n */\n @Event() nanoBpChange: EventEmitter<string[]>;\n\n @Watch('sSize')\n @Watch('mSize')\n @Watch('lSize')\n @Watch('xlSize')\n @Watch('sCols')\n @Watch('mCols')\n @Watch('lCols')\n @Watch('xlCols')\n @Watch('xxlCols')\n propChanged() {\n this.applySizeClasses();\n }\n\n private applySizeClasses() {\n let size = this.currentWidth;\n\n this.isSmall = false;\n this.isMedium = false;\n this.isLarge = false;\n this.isXL = false;\n this.isXXL = false;\n\n this.generalClasses = [];\n this.gridClass = null;\n this.isSizes = [null];\n\n this.isSmall = true;\n this.generalClasses.push('is-small');\n if (this.sCols) this.gridClass = `nano-grid-${this.sCols}`;\n this.isSizes.push({ size: 's', active: true });\n\n if (size > this.sSize) {\n this.isMedium = true;\n this.generalClasses.push('is-medium');\n if (this.mCols) this.gridClass = `nano-grid-${this.mCols}`;\n this.isSizes.push({ size: 'm', active: true });\n }\n\n if (size > this.mSize) {\n this.isLarge = true;\n this.generalClasses.push('is-large');\n if (this.lCols) this.gridClass = `nano-grid-${this.lCols}`;\n this.isSizes.push({ size: 'l', active: true });\n }\n\n if (size > this.lSize) {\n this.isXL = true;\n this.generalClasses.push('is-xl');\n if (this.xlCols) this.gridClass = `nano-grid-${this.xlCols}`;\n this.isSizes.push({ size: 'xl', active: true });\n }\n\n if (size > this.xlSize) {\n this.isXXL = true;\n this.generalClasses.push('is-xxl');\n if (this.xxlCols) this.gridClass = `nano-grid-${this.xxlCols}`;\n this.isSizes.push({ size: 'xxl', active: true });\n }\n\n this.el.style.setProperty(\n '--current-grid-size',\n `'grid size: ${this.isSizes.slice().pop().size}'`\n );\n this.applyChildrenClasses();\n setTimeout(() => (this.ready = true), 0);\n }\n\n @Watch('isSmall')\n @Watch('isMedium')\n @Watch('isLarge')\n @Watch('isXL')\n @Watch('isXXL')\n stateChange() {\n this.nanoBpChange.emit(this.generalClasses);\n }\n\n private applyChildrenClasses() {\n let gridItems = this.el.querySelectorAll('nano-grid-item');\n if (gridItems.length) {\n gridItems.forEach((gridItem: HTMLNanoGridItemElement) => {\n gridItem.changeBP(this.isSizes);\n });\n return;\n }\n\n // this logic has been put into grid-item. Keep here for legacy for now\n let stateArr: Array<string> = [''],\n itemState: string = '',\n found: any,\n itemStates: Array<string>,\n classes: Array<string>,\n ctx: HTMLElement;\n\n if (!CANSHADOW) ctx = this.el.querySelector('.grid') || this.el;\n else ctx = this.el;\n\n // item states come in 4 possible flavours at every breakpoint. E.g.\n // xl-col-span-2\n // xl-col-start-2\n // xl-row-span-2\n // xl-row-start-2\n\n // loop through all grid items with states.\n [].map.call(ctx.children, (gItem: HTMLElement) => {\n if (!gItem.hasAttribute('grid-states')) return;\n\n // gridItems.forEach(gItem => {\n\n // clear all previous grid state classnames\n classes = gItem.className\n .split(' ')\n .filter((c) => !c.startsWith('nano-grid-'));\n gItem.className = classes.join(' ').trim();\n\n // get all potential states this element can have\n itemStates = gItem.getAttribute('grid-states').split(' ');\n\n // loop through all potential state options: col & row span & start\n STATEOPTS.forEach((stateOpt) => {\n // reset found flag\n found = false;\n\n // loop through all the current valid breakpoints / sizes backwards because\n // we only care about the item's state at the largest current breakpoint.\n this.isSizes\n .slice()\n .reverse()\n .forEach(function (size) {\n if (found || !size) return;\n found = itemStates.find(\n (state) => state.indexOf(`${size.size}-${stateOpt}`) === 0\n );\n\n // found a state at this current size. apply class.\n if (found) {\n // clear previous grid state classname\n classes = gItem.className\n .split(' ')\n .filter((c) => !c.includes('nano-grid-${stateOpt}'));\n gItem.className = classes.join(' ').trim();\n\n stateArr = found.split('-');\n\n // remove the size of the state\n stateArr.shift();\n itemState = stateArr.join('-');\n\n // add new class\n gItem.classList.add(`nano-grid-${itemState}`);\n }\n });\n });\n });\n }\n\n componentWillLoad() {\n let wrapper: HTMLElement, ctx;\n\n if (!CANSHADOW) ctx = this.el.querySelector('.grid') || this.el;\n else ctx = this.el;\n\n [].map.call(ctx.children, (ele: HTMLElement) => {\n if (!CANSHADOW) {\n if (\n ele.classList.contains('nano-griditem') ||\n ele.nodeName === 'NANO-GRID-ITEM'\n )\n return;\n\n wrapper = document.createElement('div');\n if (ele.hasAttribute('grid-states')) {\n wrapper.setAttribute('grid-states', ele.getAttribute('grid-states'));\n ele.removeAttribute('grid-states');\n }\n\n this.el.insertBefore(wrapper, ele);\n wrapper.appendChild(ele);\n wrapper.classList.add('nano-griditem');\n } else if (ele.nodeName !== 'NANO-GRID-ITEM')\n ele.classList.add('nano-griditem');\n });\n }\n\n componentDidLoad() {\n this.ro = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (!entry.contentRect.width) return;\n this.currentWidth = entry.contentRect.width;\n this.applySizeClasses();\n }\n });\n this.ro.observe(this.el);\n }\n\n disconnectedCallback() {\n if (this.ro) this.ro.disconnect();\n }\n\n render() {\n return (\n <Host\n class={{\n [this.generalClasses.join(' ')]: true,\n 'has-grid': !!this.gridClass,\n ready: this.ready,\n [this.gridClass]: true,\n }}\n is-legacy={!CANSHADOW ? true : undefined}\n >\n <div\n class={{\n grid: true,\n }}\n >\n <slot />\n </div>\n </Host>\n );\n }\n}\n\n// <Host class={{\n// [this.generalClasses.join(' ')]: true,\n// [this.gridClass]: true,\n// 'helper': this.showHelper,\n// 'has-grid': !!this.gridClass,\n// 'legacy': !CANSHADOW,\n// 'content-panel': this.contentPanel,\n// 'full-height': this.fullHeight,\n// 'ready': this.ready\n// }}></Host>\n",":host {\n display: block;\n}\n","import { Component, h, Prop, Element, Method, Watch } from '@stencil/core';\nimport { GridSizes } from '../../interface';\n\nconst STATEOPTS = ['col-span', 'col-start', 'row-span', 'row-start'];\n\n/**\n * Grid items to be used with [grid](/story/nano-components-grid) elements\n */\n@Component({\n tag: 'nano-grid-item',\n styleUrl: 'grid-item.scss',\n shadow: true,\n})\nexport class GridItem {\n private currGridSizes: GridSizes[] = [null];\n\n @Element() private el: HTMLNanoGridItemElement;\n /**\n * How to position this item within it's parent grid at different break points. Examples:\n * xl-col-span-2\n * l-col-start-2\n * xxl-row-span-2\n * m-row-start-2\n */\n @Prop() gridStates: string = '';\n\n @Watch('gridStates')\n updateGridClasses() {\n this.applyChildrenClasses();\n }\n\n /**\n * Called by parent grid to trigger new classes\n * @internal\n */\n @Method()\n async changeBP(newGridSizes: GridSizes[]) {\n if (this.currGridSizes === newGridSizes) return;\n this.currGridSizes = newGridSizes;\n\n if (!this.gridStates.length) return;\n this.applyChildrenClasses();\n }\n\n private applyChildrenClasses() {\n let stateArr: Array<string> = [''],\n itemState: string = '',\n found: any,\n itemStates: Array<string>,\n classes: Array<string>;\n\n // item states come in 4 possible flavours at every breakpoint. E.g.\n // xl-col-span-2\n // xl-col-start-2\n // xl-row-span-2\n // xl-row-start-2\n\n // clear all previous grid state classnames\n classes = this.el.className\n .split(' ')\n .filter((c) => !c.startsWith('nano-grid-'));\n this.el.className = classes.join(' ').trim();\n\n // get all potential states this element can have\n itemStates = this.gridStates.split(' ');\n\n // loop through all potential state options: col & row span & start\n STATEOPTS.forEach((stateOpt) => {\n // reset found flag\n found = false;\n\n // loop through all the current valid breakpoints / sizes backwards because\n // we only care about the item's state at the largest current breakpoint.\n this.currGridSizes\n .slice()\n .reverse()\n .forEach((size) => {\n if (found || !size) return;\n found = itemStates.find(\n (state) => state.indexOf(`${size.size}-${stateOpt}`) === 0\n );\n\n // found a state at this current size. apply class.\n if (found) {\n // clear previous grid state classname\n classes = this.el.className\n .split(' ')\n .filter((c) => !c.includes('nano-grid-${stateOpt}'));\n this.el.className = classes.join(' ').trim();\n\n stateArr = found.split('-');\n\n // remove the size of the state\n stateArr.shift();\n itemState = stateArr.join('-');\n\n // add new class\n this.el.classList.add(`nano-grid-${itemState}`);\n }\n });\n });\n }\n\n render() {\n return <slot />;\n }\n}\n",":host {\n /**\n * @prop --padding: padding around any content. Only relevent on `<nano-img background>`\n */\n --padding: 0;\n\n display: inline-block;\n object-fit: cover;\n object-position: center;\n background-size: cover;\n background-position: center;\n\n * {\n border-radius: inherit;\n }\n}\n\n:host([background]:not([background='false'])) {\n display: block;\n}\n\n.img {\n position: relative;\n min-height: inherit;\n height: 100%;\n display: block;\n object-fit: inherit;\n object-position: inherit;\n background-color: inherit;\n background-position: inherit;\n background-size: inherit;\n background-origin: inherit;\n background-attachment: inherit;\n background-repeat: inherit;\n}\n\n.img__loader,\n.img__observer {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n z-index: -1;\n}\n\n.img__image,\n.img__bg {\n border-radius: inherit;\n display: block;\n opacity: 0;\n transition: 0.5s ease opacity, 0.3s ease filter 0.4s;\n filter: blur(5px);\n\n &.loaded {\n opacity: 1;\n filter: blur(0.1px);\n\n @media not all and (min-resolution: 0.001dpcm) {\n @supports (-webkit-appearance: none) {\n filter: blur(0);\n }\n }\n }\n}\n\n.img__image {\n object-fit: inherit;\n object-position: inherit;\n max-width: 100%;\n height: auto;\n\n &.hide {\n visibility: hidden;\n\n &.no-height {\n height: 1px;\n position: absolute;\n z-index: -1;\n }\n }\n}\n\n.img__bg {\n background-color: inherit;\n background-position: inherit;\n background-size: inherit;\n background-origin: inherit;\n background-attachment: inherit;\n background-repeat: inherit;\n overflow: auto;\n padding: var(--padding);\n\n &.no-height {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n State,\n Prop,\n Watch,\n h,\n ComponentInterface,\n} from '@stencil/core';\nimport { ResizeStateChangeEventDetail } from '../../interface';\n\n/**\n * Img with benefits. Lazy loading. Simple `srcSet` solution for both `<img>` and `background-image` varieties.\n * @slot - Main slot. Only relevant with `<nano-img background>`\n */\n@Component({\n tag: 'nano-img',\n styleUrl: 'img.scss',\n shadow: true,\n})\nexport class Img implements ComponentInterface {\n private io?: IntersectionObserver;\n private _srcSet: { [key: string]: { src: string; active: boolean } } = {};\n\n @Element() host!: HTMLNanoImgElement;\n\n @State() loadSrc?: string;\n @State() loadError?: () => void;\n @State() hasLoaded: boolean = false;\n @State() imgStates: string = null;\n @State() _src: string;\n @Watch('_src')\n _srcChanged() {\n this.hasLoaded = false;\n this.addIO();\n }\n\n /** This attribute defines the alternative text describing the image.\n * Users will see this text displayed if the image URL is wrong, or if the image is not yet downloaded. */\n @Prop() alt?: string;\n\n /** The image URL. This attribute is mandatory for the `<img>` element. */\n @Prop() src!: string;\n @Watch('src')\n srcChanged() {\n this._src = this.src;\n }\n\n /** Optional list string providing media sizes with corresponding image srcs.\n * i.e. show img-x at 300px wide. Format `srcSet=\"200w src/imgSmall.jpg, 500h src/imgMed.png\"` */\n @Prop() srcSet?: string;\n @Watch('srcSet')\n srcSetChanged() {\n if (!this.srcSet) return;\n\n delete this._srcSet;\n this._srcSet = {};\n\n this.imgStates = this.srcSet\n .split(',')\n .map((bpSrc) => {\n const [bp, src] = bpSrc.split(' ').filter((bp) => bp.length);\n this._srcSet[bp] = { src: src, active: false };\n return bp;\n })\n .join(', ');\n }\n\n /** Render image lazily, when it comes into the browser viewport **/\n @Prop() lazy: boolean = true;\n @Watch('lazy')\n lazyChanged() {\n if (!this.lazy) this.load();\n }\n\n /** Render the image as a background image **/\n @Prop() background?: boolean;\n\n /** When the image is rendered as a background, and there is no preset dimensions of the component,\n * you can set how the component height will be set. Via image size or via the content **/\n @Prop() autoHeight: 'content' | 'image' = 'content';\n\n /** Emitted when the img src has been set */\n @Event() nanoImgWillLoad!: EventEmitter<void>;\n\n /** Emitted when the image has finished loading */\n @Event() nanoImgDidLoad!: EventEmitter<void>;\n\n /** Emitted when the img fails to load */\n @Event() nanoImgError!: EventEmitter<void>;\n\n private addIO() {\n if (!this._src || this.hasLoaded) return;\n if (!this.lazy) {\n this.load();\n return;\n }\n if (\n typeof (window as any) !== 'undefined' &&\n 'IntersectionObserver' in window &&\n 'isIntersecting' in window.IntersectionObserverEntry.prototype\n ) {\n this.removeIO();\n this.io = new IntersectionObserver((data) => {\n if (data[0].isIntersecting) {\n this.load();\n this.removeIO();\n }\n });\n\n this.io.observe(this.host);\n } else setTimeout(() => this.load(), 200);\n }\n\n private load() {\n this.loadError = this.onError;\n this.loadSrc = this._src;\n this.nanoImgWillLoad.emit();\n }\n\n private onLoad = () => {\n this.nanoImgDidLoad.emit();\n setTimeout(() => (this.hasLoaded = true), 50);\n };\n\n private onError = () => {\n this.nanoImgError.emit();\n };\n\n private onResize = (e: { detail: ResizeStateChangeEventDetail }) => {\n Object.entries(e.detail).forEach(([bp, active]) => {\n this._srcSet[bp].active = active;\n });\n\n // sort and find the highest sized matching image.\n const srcOpts = [];\n Object.keys(this._srcSet)\n .sort()\n .forEach((bp) => {\n if (this._srcSet[bp].active) srcOpts.push(this._srcSet[bp].src);\n });\n\n if (srcOpts.length) this._src = srcOpts.slice(-1)[0];\n // no matching image? Set back to default\n else this._src = this.src;\n };\n\n private removeIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n connectedCallback() {\n this.srcChanged();\n this.srcSetChanged();\n this.lazyChanged();\n }\n\n componentDidLoad() {\n this.addIO();\n }\n\n disconnectedCallback() {\n this.removeIO();\n }\n\n render() {\n const bgStyle = !!this.loadSrc\n ? { 'background-image': `url(${this.loadSrc})` }\n : {};\n return (\n <div class=\"img\">\n <nano-skeleton class=\"img__loader\"></nano-skeleton>\n {!!this.background && (\n <div\n class={{\n loaded: this.hasLoaded,\n img__bg: true,\n 'no-height': this.autoHeight === 'image',\n }}\n style={bgStyle}\n >\n <slot />\n </div>\n )}\n <img\n class={{\n img__image: true,\n loaded: this.hasLoaded,\n hide: this.background,\n 'no-height': this.autoHeight === 'content',\n }}\n decoding=\"async\"\n src={this.loadSrc}\n alt={this.alt}\n onLoad={this.onLoad}\n onError={this.loadError}\n />\n <nano-resize-observe\n class=\"img__observer\"\n onNanoResizeStateChange={this.onResize}\n states={this.imgStates}\n />\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"nano-grid.nano-grid-item.nano-img.entry.cjs.js","mappings":";;;;;;;;;;AAAA,MAAM,OAAO,GAAG,u14BAAu14B;;ACcv24B,MAAMA,WAAS,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AACrE,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;IAWlC,IAAI;EAQf;;;IALQ,mBAAc,GAAkB,CAAC,EAAE,CAAC,CAAC;IACrC,cAAS,GAAW,IAAI,CAAC;IACzB,YAAO,GAAgB,CAAC,IAAI,CAAC,CAAC;IAO7B,UAAK,GAAY,KAAK,CAAC;IACvB,YAAO,GAAG,KAAK,CAAC;IAChB,aAAQ,GAAG,KAAK,CAAC;IACjB,YAAO,GAAG,KAAK,CAAC;IAChB,SAAI,GAAG,KAAK,CAAC;IACb,UAAK,GAAG,KAAK,CAAC;;;;IAKf,UAAK,GAAW,GAAG,CAAC;;;;IAKpB,UAAK,GAAW,GAAG,CAAC;;;;IAKpB,UAAK,GAAW,GAAG,CAAC;;;;IAKpB,WAAM,GAAW,IAAI,CAAC;;;;IA8BL,eAAU,GAAY,KAAK,CAAC;;;;IAK5B,iBAAY,GAAY,KAAK,CAAC;;;;IAK9B,eAAU,GAAY,KAAK,CAAC;IApEnD,IAAI,CAAC,WAAW,GAAGC,iBAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;GAC/D;EAmFD,WAAW;IACT,IAAI,CA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EAAE;QACL,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI,CAAC,SAAS;QACtB,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,WAAW,EAAE,IAAI,CAAC,UAAU,KAAK,SAAS;OAC3C,EACD,QAAQ,EAAC,OAAO,EAChB,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,SAAS,GACvB,EACFA,iCACE,KAAK,EAAC,eAAe,EACrB,uBAAuB,EAAE,IAAI,CAAC,QAAQ,EACtC,MAAM,EAAE,IAAI,CAAC,SAAS,GACtB,CACE,EACN;GACH;;;;;;;;;;;;;;;","names":["STATEOPTS","debounce","h","Host"],"sources":["./src/components/grid/grid.scss?tag=nano-grid&encapsulation=shadow","./src/components/grid/grid.tsx","./src/components/grid/grid-item.scss?tag=nano-grid-item&encapsulation=shadow","./src/components/grid/grid-item.tsx","./src/components/img/img.scss?tag=nano-img&encapsulation=shadow","./src/components/img/img.tsx"],"sourcesContent":["// we use &::slotted selectors to target ie ... this is a due to a bug with how stencil makes css scoping for browsers without shadow-dom. Need to be mindful incase they ever fix this!\n\n@import '../../global/style/nano-theme/base';\n\n// ie 11 fixes ... maximum numbers we can place on the grid ... upping this number decreases performance a lot.\n$max-grid-cols: 10;\n\n@mixin grid($size: 1) {\n @at-root :host(.nano-grid-#{$size}) {\n --current-grid-size: 'grid size: #{$size}';\n --col-width: calc(#{100 / $size}% - var(--grid-col-gap));\n --repeat-width: calc(100% / #{$size});\n\n .grid {\n grid-template-columns: repeat(#{$size}, minmax(var(--col-width), 1fr));\n\n $current-column: 1;\n $current-row: 1;\n\n @for $i from 1 through ($max-grid-cols * 2) {\n @if $current-column > $size {\n $current-column: 1;\n $current-row: $current-row + 1;\n }\n\n &::slotted(:nth-child(#{$i})) {\n -ms-grid-row: $current-row;\n -ms-grid-column: $current-column;\n // use margin because there's no grid gap.\n }\n $current-column: $current-column + 1;\n }\n }\n }\n}\n\n@mixin grid-spans {\n @for $i from 1 through $max-grid-cols {\n ::slotted(.nano-grid-col-start-#{$i}),\n &::slotted(.nano-grid-col-start-#{$i}) {\n grid-column-start: #{$i} !important;\n }\n\n ::slotted(.nano-grid-row-start-#{$i}),\n &::slotted(.nano-grid-row-start-#{$i}) {\n grid-row-start: #{$i} !important;\n }\n\n ::slotted(.nano-grid-col-span-#{$i}),\n &::slotted(.nano-grid-col-span-#{$i}) {\n grid-column-end: span #{$i} !important;\n }\n\n ::slotted(.nano-grid-row-span-#{$i}),\n &::slotted(.nano-grid-row-span-#{$i}) {\n grid-row-end: span #{$i} !important;\n }\n }\n}\n\n:host {\n /**\n * @prop --grid-col-gap: gap between all columns. Defaults to theme's global padding\n * @prop --grid-row-gap: gap between all rows. Defaults to theme's global padding\n */\n\n --grid-col-gap: #{$spacing-medium};\n --grid-row-gap: #{$spacing-medium};\n --current-grid-size: \"'grid size: sm'\";\n\n display: block;\n opacity: 0;\n transition: 0.2s ease opacity;\n\n .grid {\n /* autoprefixer: ignore next */\n display: grid;\n\n /* autoprefixer: ignore next */\n grid-gap: var(--grid-row-gap) var(--grid-col-gap);\n height: inherit;\n min-height: inherit;\n\n &::slotted(*) {\n border: 0 solid transparent;\n background-clip: padding-box;\n border-width: var(--grid-row-gap) calc(var(--grid-col-gap) / 2);\n }\n }\n}\n\n:host(.ready) {\n opacity: 1;\n}\n\n:host(.has-grid) {\n .grid {\n display: grid;\n\n @include grid-spans;\n\n // ie 'grid gap'. use border because there's no grid gap.\n &::slotted(*) {\n border-width: calc(var(--grid-row-gap) / 2) calc(var(--grid-col-gap) / 2);\n }\n }\n}\n\n// All sorts of IE fuckery to recreate grid-gap when nested etc\n:host([is-legacy]) {\n overflow: hidden;\n\n .grid {\n margin-bottom: calc(var(--grid-row-gap) * -0.5);\n margin-top: calc(var(--grid-row-gap) * -0.5);\n margin-left: calc(var(--grid-col-gap) * -0.5);\n margin-right: calc(var(--grid-col-gap) * -0.5);\n }\n}\n\n// nested\nnano-grid :host-context[is-legacy] {\n overflow: visible;\n\n .grid {\n &::slotted(:first-child) {\n border-top-width: calc(var(--grid-row-gap) / 2);\n }\n\n &::slotted(:last-child) {\n border-bottom-width: calc(var(--grid-row-gap) / 2);\n }\n }\n}\n\n:host([content-panel]:not([content-panel='false'])) {\n display: -ms-flexbox;\n -ms-flex-direction: column;\n\n .grid {\n grid-template-rows: auto 1fr;\n }\n}\n\n:host([full-height]:not([full-height='false'])) {\n height: 100%;\n\n .grid {\n grid-template-rows: 1fr;\n\n &::slotted(*) {\n min-height: 100%;\n }\n }\n}\n\n:host([show-helper]:not([show-helper='false'])) {\n .grid {\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n pointer-events: none;\n background-image:\n repeating-linear-gradient(\n to right,\n hsla(204, 80%, 72%, 0.25),\n hsla(204, 80%, 72%, 0.25) var(--col-width),\n transparent var(--col-width),\n transparent var(--repeat-width)\n );\n background-size: calc(100% + var(--grid-col-gap)) 100%;\n z-index: 100;\n }\n\n &::before {\n content: var(--current-grid-size);\n font-size: 30px;\n position: absolute;\n width: 100%;\n left: 0;\n text-align: center;\n top: 50%;\n transform: translateY(-50%);\n color: rgba(0, 0, 0, 0.2);\n text-transform: uppercase;\n z-index: 99;\n pointer-events: none;\n }\n }\n}\n\n@for $i from 1 through $max-grid-cols {\n @include grid($i);\n}\n","import {\n Component,\n h,\n Prop,\n Element,\n Host,\n State,\n Watch,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { GridSizes } from '../../interface';\nimport { debounce } from '../../utils';\n\nconst STATEOPTS = ['col-span', 'col-start', 'row-span', 'row-start'];\nconst CANSHADOW = !!document.head.attachShadow;\n\n/**\n * A context-aware CSS grid implementation.\n * Uses it's own width to choose column number - not screen width.\n */\n@Component({\n tag: 'nano-grid',\n styleUrl: 'grid.scss',\n shadow: true,\n})\nexport class Grid {\n @Element() private el: HTMLNanoGridElement;\n private ro: ResizeObserver;\n private generalClasses: Array<string> = [''];\n private gridClass: string = null;\n private isSizes: GridSizes[] = [null];\n private currentWidth: number;\n\n constructor() {\n this.stateChange = debounce(this.stateChange.bind(this), 100);\n }\n\n @State() ready: boolean = false;\n @State() isSmall = false;\n @State() isMedium = false;\n @State() isLarge = false;\n @State() isXL = false;\n @State() isXXL = false;\n\n /**\n * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() sSize: number = 300;\n\n /**\n * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() mSize: number = 550;\n\n /**\n * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() lSize: number = 800;\n\n /**\n * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() xlSize: number = 1000;\n\n /**\n * the number of columns the grid has at the small breakpoint.\n */\n @Prop() sCols: number;\n\n /**\n * the number of columns the grid has at the medium breakpoint.\n */\n @Prop() mCols: number;\n\n /**\n * the number of columns the grid has at the large breakpoint.\n */\n @Prop() lCols: number;\n\n /**\n * the number of columns the grid has at the xl breakpoint.\n */\n @Prop() xlCols: number;\n\n /**\n * the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint)\n */\n @Prop() xxlCols: number;\n\n /**\n * shows a grid helper to visualise where columns are\n */\n @Prop({ reflect: true }) showHelper: boolean = false;\n\n /**\n * shortcut for a traditional website like grid (requires more than one row). The second row will auto expand to fill the grid height. The first row and > 2nd row will be the size of their content. e.g. header, body and footer.\n */\n @Prop({ reflect: true }) contentPanel: boolean = false;\n\n /**\n * Helper to make grid items expand to full height in IE11\n */\n @Prop({ reflect: true }) fullHeight: boolean = false;\n\n /**\n * Emitted when the `nano-grid` changes breakpoint\n */\n @Event() nanoBpChange: EventEmitter<string[]>;\n\n @Watch('sSize')\n @Watch('mSize')\n @Watch('lSize')\n @Watch('xlSize')\n @Watch('sCols')\n @Watch('mCols')\n @Watch('lCols')\n @Watch('xlCols')\n @Watch('xxlCols')\n propChanged() {\n this.applySizeClasses();\n }\n\n private applySizeClasses() {\n let size = this.currentWidth;\n\n this.isSmall = false;\n this.isMedium = false;\n this.isLarge = false;\n this.isXL = false;\n this.isXXL = false;\n\n this.generalClasses = [];\n this.gridClass = null;\n this.isSizes = [null];\n\n this.isSmall = true;\n this.generalClasses.push('is-small');\n if (this.sCols) this.gridClass = `nano-grid-${this.sCols}`;\n this.isSizes.push({ size: 's', active: true });\n\n if (size > this.sSize) {\n this.isMedium = true;\n this.generalClasses.push('is-medium');\n if (this.mCols) this.gridClass = `nano-grid-${this.mCols}`;\n this.isSizes.push({ size: 'm', active: true });\n }\n\n if (size > this.mSize) {\n this.isLarge = true;\n this.generalClasses.push('is-large');\n if (this.lCols) this.gridClass = `nano-grid-${this.lCols}`;\n this.isSizes.push({ size: 'l', active: true });\n }\n\n if (size > this.lSize) {\n this.isXL = true;\n this.generalClasses.push('is-xl');\n if (this.xlCols) this.gridClass = `nano-grid-${this.xlCols}`;\n this.isSizes.push({ size: 'xl', active: true });\n }\n\n if (size > this.xlSize) {\n this.isXXL = true;\n this.generalClasses.push('is-xxl');\n if (this.xxlCols) this.gridClass = `nano-grid-${this.xxlCols}`;\n this.isSizes.push({ size: 'xxl', active: true });\n }\n\n this.el.style.setProperty(\n '--current-grid-size',\n `'grid size: ${this.isSizes.slice().pop().size}'`\n );\n this.applyChildrenClasses();\n setTimeout(() => (this.ready = true), 0);\n }\n\n @Watch('isSmall')\n @Watch('isMedium')\n @Watch('isLarge')\n @Watch('isXL')\n @Watch('isXXL')\n stateChange() {\n this.nanoBpChange.emit(this.generalClasses);\n }\n\n private applyChildrenClasses() {\n let gridItems = this.el.querySelectorAll('nano-grid-item');\n if (gridItems.length) {\n gridItems.forEach((gridItem: HTMLNanoGridItemElement) => {\n gridItem.changeBP(this.isSizes);\n });\n return;\n }\n\n // this logic has been put into grid-item. Keep here for legacy for now\n let stateArr: Array<string> = [''],\n itemState: string = '',\n found: any,\n itemStates: Array<string>,\n classes: Array<string>,\n ctx: HTMLElement;\n\n if (!CANSHADOW) ctx = this.el.querySelector('.grid') || this.el;\n else ctx = this.el;\n\n // item states come in 4 possible flavours at every breakpoint. E.g.\n // xl-col-span-2\n // xl-col-start-2\n // xl-row-span-2\n // xl-row-start-2\n\n // loop through all grid items with states.\n [].map.call(ctx.children, (gItem: HTMLElement) => {\n if (!gItem.hasAttribute('grid-states')) return;\n\n // gridItems.forEach(gItem => {\n\n // clear all previous grid state classnames\n classes = gItem.className\n .split(' ')\n .filter((c) => !c.startsWith('nano-grid-'));\n gItem.className = classes.join(' ').trim();\n\n // get all potential states this element can have\n itemStates = gItem.getAttribute('grid-states').split(' ');\n\n // loop through all potential state options: col & row span & start\n STATEOPTS.forEach((stateOpt) => {\n // reset found flag\n found = false;\n\n // loop through all the current valid breakpoints / sizes backwards because\n // we only care about the item's state at the largest current breakpoint.\n this.isSizes\n .slice()\n .reverse()\n .forEach(function (size) {\n if (found || !size) return;\n found = itemStates.find(\n (state) => state.indexOf(`${size.size}-${stateOpt}`) === 0\n );\n\n // found a state at this current size. apply class.\n if (found) {\n // clear previous grid state classname\n classes = gItem.className\n .split(' ')\n .filter((c) => !c.includes('nano-grid-${stateOpt}'));\n gItem.className = classes.join(' ').trim();\n\n stateArr = found.split('-');\n\n // remove the size of the state\n stateArr.shift();\n itemState = stateArr.join('-');\n\n // add new class\n gItem.classList.add(`nano-grid-${itemState}`);\n }\n });\n });\n });\n }\n\n componentWillLoad() {\n let wrapper: HTMLElement, ctx;\n\n if (!CANSHADOW) ctx = this.el.querySelector('.grid') || this.el;\n else ctx = this.el;\n\n [].map.call(ctx.children, (ele: HTMLElement) => {\n if (!CANSHADOW) {\n if (\n ele.classList.contains('nano-griditem') ||\n ele.nodeName === 'NANO-GRID-ITEM'\n )\n return;\n\n wrapper = document.createElement('div');\n if (ele.hasAttribute('grid-states')) {\n wrapper.setAttribute('grid-states', ele.getAttribute('grid-states'));\n ele.removeAttribute('grid-states');\n }\n\n this.el.insertBefore(wrapper, ele);\n wrapper.appendChild(ele);\n wrapper.classList.add('nano-griditem');\n } else if (ele.nodeName !== 'NANO-GRID-ITEM')\n ele.classList.add('nano-griditem');\n });\n }\n\n componentDidLoad() {\n this.ro = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (!entry.contentRect.width) return;\n this.currentWidth = entry.contentRect.width;\n this.applySizeClasses();\n }\n });\n this.ro.observe(this.el);\n }\n\n disconnectedCallback() {\n if (this.ro) this.ro.disconnect();\n }\n\n render() {\n return (\n <Host\n class={{\n [this.generalClasses.join(' ')]: true,\n 'has-grid': !!this.gridClass,\n ready: this.ready,\n [this.gridClass]: true,\n }}\n is-legacy={!CANSHADOW ? true : undefined}\n >\n <div\n class={{\n grid: true,\n }}\n >\n <slot />\n </div>\n </Host>\n );\n }\n}\n\n// <Host class={{\n// [this.generalClasses.join(' ')]: true,\n// [this.gridClass]: true,\n// 'helper': this.showHelper,\n// 'has-grid': !!this.gridClass,\n// 'legacy': !CANSHADOW,\n// 'content-panel': this.contentPanel,\n// 'full-height': this.fullHeight,\n// 'ready': this.ready\n// }}></Host>\n",":host {\n display: block;\n}\n","import { Component, h, Prop, Element, Method, Watch } from '@stencil/core';\nimport { GridSizes } from '../../interface';\n\nconst STATEOPTS = ['col-span', 'col-start', 'row-span', 'row-start'];\n\n/**\n * Grid items to be used with [grid](/story/nano-components-grid) elements\n */\n@Component({\n tag: 'nano-grid-item',\n styleUrl: 'grid-item.scss',\n shadow: true,\n})\nexport class GridItem {\n private currGridSizes: GridSizes[] = [null];\n\n @Element() private el: HTMLNanoGridItemElement;\n /**\n * How to position this item within it's parent grid at different break points. Examples:\n * xl-col-span-2\n * l-col-start-2\n * xxl-row-span-2\n * m-row-start-2\n */\n @Prop() gridStates: string = '';\n\n @Watch('gridStates')\n updateGridClasses() {\n this.applyChildrenClasses();\n }\n\n /**\n * Called by parent grid to trigger new classes\n * @internal\n */\n @Method()\n async changeBP(newGridSizes: GridSizes[]) {\n if (this.currGridSizes === newGridSizes) return;\n this.currGridSizes = newGridSizes;\n\n if (!this.gridStates.length) return;\n this.applyChildrenClasses();\n }\n\n private applyChildrenClasses() {\n let stateArr: Array<string> = [''],\n itemState: string = '',\n found: any,\n itemStates: Array<string>,\n classes: Array<string>;\n\n // item states come in 4 possible flavours at every breakpoint. E.g.\n // xl-col-span-2\n // xl-col-start-2\n // xl-row-span-2\n // xl-row-start-2\n\n // clear all previous grid state classnames\n classes = this.el.className\n .split(' ')\n .filter((c) => !c.startsWith('nano-grid-'));\n this.el.className = classes.join(' ').trim();\n\n // get all potential states this element can have\n itemStates = this.gridStates.split(' ');\n\n // loop through all potential state options: col & row span & start\n STATEOPTS.forEach((stateOpt) => {\n // reset found flag\n found = false;\n\n // loop through all the current valid breakpoints / sizes backwards because\n // we only care about the item's state at the largest current breakpoint.\n this.currGridSizes\n .slice()\n .reverse()\n .forEach((size) => {\n if (found || !size) return;\n found = itemStates.find(\n (state) => state.indexOf(`${size.size}-${stateOpt}`) === 0\n );\n\n // found a state at this current size. apply class.\n if (found) {\n // clear previous grid state classname\n classes = this.el.className\n .split(' ')\n .filter((c) => !c.includes('nano-grid-${stateOpt}'));\n this.el.className = classes.join(' ').trim();\n\n stateArr = found.split('-');\n\n // remove the size of the state\n stateArr.shift();\n itemState = stateArr.join('-');\n\n // add new class\n this.el.classList.add(`nano-grid-${itemState}`);\n }\n });\n });\n }\n\n render() {\n return <slot />;\n }\n}\n",":host {\n /**\n * @prop --padding: padding around any content. Only relevent on `<nano-img background>`\n */\n --padding: 0;\n\n display: inline-block;\n object-fit: cover;\n object-position: center;\n background-size: cover;\n background-position: center;\n\n * {\n border-radius: inherit;\n }\n}\n\n:host([background]:not([background='false'])) {\n display: block;\n}\n\n.img {\n position: relative;\n min-height: inherit;\n height: 100%;\n display: block;\n object-fit: inherit;\n object-position: inherit;\n background-color: inherit;\n background-position: inherit;\n background-size: inherit;\n background-origin: inherit;\n background-attachment: inherit;\n background-repeat: inherit;\n}\n\n.img__loader,\n.img__observer {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n z-index: -1;\n}\n\n.img__image,\n.img__bg {\n border-radius: inherit;\n display: block;\n opacity: 0;\n transition: 0.5s ease opacity, 0.3s ease filter 0.4s;\n filter: blur(5px);\n\n &.loaded {\n opacity: 1;\n filter: blur(0.1px);\n\n @media not all and (min-resolution: 0.001dpcm) {\n @supports (-webkit-appearance: none) {\n filter: blur(0);\n }\n }\n }\n}\n\n.img__image {\n object-fit: inherit;\n object-position: inherit;\n max-width: 100%;\n height: auto;\n\n &.hide {\n visibility: hidden;\n\n &.no-height {\n height: 1px;\n position: absolute;\n z-index: -1;\n }\n }\n}\n\n.img__bg {\n background-color: inherit;\n background-position: inherit;\n background-size: inherit;\n background-origin: inherit;\n background-attachment: inherit;\n background-repeat: inherit;\n overflow: auto;\n padding: var(--padding);\n\n &.no-height {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n State,\n Prop,\n Watch,\n h,\n ComponentInterface,\n} from '@stencil/core';\nimport { ResizeStateChangeEventDetail } from '../../interface';\n\n/**\n * Img with benefits. Lazy loading. Simple `srcSet` solution for both `<img>` and `background-image` varieties.\n * @slot - Main slot. Only relevant with `<nano-img background>`\n */\n@Component({\n tag: 'nano-img',\n styleUrl: 'img.scss',\n shadow: true,\n})\nexport class Img implements ComponentInterface {\n private io?: IntersectionObserver;\n private _srcSet: { [key: string]: { src: string; active: boolean } } = {};\n\n @Element() host!: HTMLNanoImgElement;\n\n @State() loadSrc?: string;\n @State() loadError?: () => void;\n @State() hasLoaded: boolean = false;\n @State() imgStates: string = null;\n @State() _src: string;\n @Watch('_src')\n _srcChanged() {\n this.hasLoaded = false;\n this.addIO();\n }\n\n /** This attribute defines the alternative text describing the image.\n * Users will see this text displayed if the image URL is wrong, or if the image is not yet downloaded. */\n @Prop() alt?: string;\n\n /** The image URL. This attribute is mandatory for the `<img>` element. */\n @Prop() src!: string;\n @Watch('src')\n srcChanged() {\n this._src = this.src;\n }\n\n /** Optional list string providing media sizes with corresponding image srcs.\n * i.e. show img-x at 300px wide. Format `srcSet=\"200w src/imgSmall.jpg, 500h src/imgMed.png\"` */\n @Prop() srcSet?: string;\n @Watch('srcSet')\n srcSetChanged() {\n if (!this.srcSet) return;\n\n delete this._srcSet;\n this._srcSet = {};\n\n this.imgStates = this.srcSet\n .split(',')\n .map((bpSrc) => {\n const [bp, src] = bpSrc.split(' ').filter((bp) => bp.length);\n this._srcSet[bp] = { src: src, active: false };\n return bp;\n })\n .join(', ');\n }\n\n /** Render image lazily, when it comes into the browser viewport **/\n @Prop() lazy: boolean = true;\n @Watch('lazy')\n lazyChanged() {\n if (!this.lazy) this.load();\n }\n\n /** Render the image as a background image **/\n @Prop() background?: boolean;\n\n /** When the image is rendered as a background, and there is no preset dimensions of the component,\n * you can set how the component height will be set. Via image size or via the content **/\n @Prop() autoHeight: 'content' | 'image' = 'content';\n\n /** Emitted when the img src has been set */\n @Event() nanoImgWillLoad!: EventEmitter<void>;\n\n /** Emitted when the image has finished loading */\n @Event() nanoImgDidLoad!: EventEmitter<void>;\n\n /** Emitted when the img fails to load */\n @Event() nanoImgError!: EventEmitter<void>;\n\n private addIO() {\n if (!this._src || this.hasLoaded) return;\n if (!this.lazy) {\n this.load();\n return;\n }\n if (\n typeof (window as any) !== 'undefined' &&\n 'IntersectionObserver' in window &&\n 'isIntersecting' in window.IntersectionObserverEntry.prototype\n ) {\n this.removeIO();\n this.io = new IntersectionObserver((data) => {\n if (data[0].isIntersecting) {\n this.load();\n this.removeIO();\n }\n });\n\n this.io.observe(this.host);\n } else setTimeout(() => this.load(), 200);\n }\n\n private load() {\n this.loadError = this.onError;\n this.loadSrc = this._src;\n this.nanoImgWillLoad.emit();\n }\n\n private onLoad = () => {\n this.nanoImgDidLoad.emit();\n setTimeout(() => (this.hasLoaded = true), 50);\n };\n\n private onError = () => {\n this.nanoImgError.emit();\n };\n\n private onResize = (e: { detail: ResizeStateChangeEventDetail }) => {\n Object.entries(e.detail).forEach(([bp, active]) => {\n this._srcSet[bp].active = active;\n });\n\n // sort and find the highest sized matching image.\n const srcOpts = [];\n Object.keys(this._srcSet)\n .sort()\n .forEach((bp) => {\n if (this._srcSet[bp].active) srcOpts.push(this._srcSet[bp].src);\n });\n\n if (srcOpts.length) this._src = srcOpts.slice(-1)[0];\n // no matching image? Set back to default\n else this._src = this.src;\n };\n\n private removeIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n connectedCallback() {\n this.srcChanged();\n this.srcSetChanged();\n this.lazyChanged();\n }\n\n componentDidLoad() {\n this.addIO();\n }\n\n disconnectedCallback() {\n this.removeIO();\n }\n\n render() {\n const bgStyle = !!this.loadSrc\n ? { 'background-image': `url(${this.loadSrc})` }\n : {};\n return (\n <div class=\"img\">\n <nano-skeleton class=\"img__loader\"></nano-skeleton>\n {!!this.background && (\n <div\n class={{\n loaded: this.hasLoaded,\n img__bg: true,\n 'no-height': this.autoHeight === 'image',\n }}\n style={bgStyle}\n >\n <slot />\n </div>\n )}\n <img\n class={{\n img__image: true,\n loaded: this.hasLoaded,\n hide: this.background,\n 'no-height': this.autoHeight === 'content',\n }}\n decoding=\"async\"\n src={this.loadSrc}\n alt={this.alt}\n onLoad={this.onLoad}\n onError={this.loadError}\n />\n <nano-resize-observe\n class=\"img__observer\"\n onNanoResizeStateChange={this.onResize}\n states={this.imgStates}\n />\n </div>\n );\n }\n}\n"],"version":3}
@@ -18,6 +18,10 @@ let IconButton = class {
18
18
  /** Set to true to disable the button. */
19
19
  this.disabled = false;
20
20
  }
21
+ /** Sets focus on the internal button */
22
+ async setFocus() {
23
+ this.button.focus();
24
+ }
21
25
  componentDidLoad() {
22
26
  focusVisible.focusVisible.observe(this.button);
23
27
  }
@@ -1 +1 @@
1
- {"file":"nano-icon-button.entry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on-button/icon-button.scss?tag=nano-icon-button&encapsulation=scoped","./src/components/icon-button/icon-button.tsx"],"sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/nano-theme/base';\n@import '../../global/style/nano-theme/colours';\n@import '../../global/style/nano-theme/form';\n\n:host {\n /**\n * @prop --border-radius: defaults to #{$border-radius-medium};\n * @prop --border-radius: defaults to #{$border-radius-medium};\n * @prop --color: defaults to #{map.get($colors, palegrey)};\n * @prop --active-color: defaults to #{map.get($colors, darkblue--faded)};\n * @prop --hover-color: defaults to #{map.get($colors, blue)};\n * @prop --background: defaults to transparent;\n * @prop --padding: defaults to #{$spacing-small};\n */\n display: inline-block;\n\n --border-radius: #{$border-radius-medium};\n --active-color: #{map.get($colors, darkblue--faded)};\n --hover-color: #{map.get($colors, blue)};\n --nano-color-base: var(--color, #{map.get($colors, mediumgrey)});\n --background: transparent;\n --padding: #{$spacing-small};\n}\n\n.icon-button {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n border: none;\n border-radius: var(--border-radius);\n background: var(--background);\n font-size: inherit;\n color: var(--color);\n padding: var(--padding);\n cursor: pointer;\n appearance: none;\n -webkit-appearance: none;\n transition: box-shadow #{$transition-xfast} ease-in-out;\n\n &:hover:not(.icon-button--disabled),\n &:focus:not(.icon-button--disabled) {\n color: var(--hover-color);\n\n --nano-color-base: var(--hover-color);\n }\n\n &:active:not(.icon-button--disabled) {\n color: var(--active-color);\n\n --nano-color-base: var(--active-color);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.icon-button--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.focus-visible.icon-button:focus {\n box-shadow: #{$control-focus-style};\n}\n","import { Component, Prop, h, ComponentInterface } from '@stencil/core';\nimport { focusVisible } from '../../utils/focus-visible';\n\n/** Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars. */\n\n@Component({\n tag: 'nano-icon-button',\n styleUrl: 'icon-button.scss',\n scoped: true,\n})\nexport class IconButton implements ComponentInterface {\n private button: HTMLButtonElement;\n\n /** The name of the icon to draw. */\n @Prop() iconName?: string;\n\n /** An external URL of an SVG file. */\n @Prop() iconSrc?: string;\n\n /** The default behavior of the button. */\n @Prop({ reflect: true }) type: 'submit' | 'reset' | 'button' = 'button';\n\n /** The name of the button, submitted as a pair with the button’s value as part of the form data. */\n @Prop({ reflect: true }) name?: string;\n\n /** Defines the value associated with the button’s name when it’s submitted with the form data. */\n @Prop({ reflect: true }) value?: string;\n\n /** A description that gets read by screen readers and other assistive devices. For optimal accessibility, you should\n * always include a label that describes what the icon button does. */\n @Prop() label!: string;\n\n /** Set to true to disable the button. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Contains a URL or a URL fragment that the hyperlink points to.\n * If this property is set, an anchor tag will be rendered. */\n @Prop() href: string | undefined;\n\n /** Specifies where to display the linked URL. Only applies when an `href` is provided.\n * Special keywords: `\"_blank\"`, `\"_self\"`, `\"_parent\"`, `\"_top\"`. */\n @Prop() target: string | undefined;\n\n componentDidLoad() {\n focusVisible.observe(this.button);\n }\n\n connectedCallback() {\n if (this.button) focusVisible.observe(this.button);\n }\n\n disconnectedCallback() {\n focusVisible.unobserve(this.button);\n }\n\n render() {\n const TagType = this.href === undefined ? 'button' : ('a' as any);\n\n return (\n <TagType\n part=\"base\"\n ref={(el) => (this.button = el)}\n class={{\n 'icon-button': true,\n 'icon-button--disabled': this.disabled,\n }}\n aria-label={this.label}\n name={this.name}\n value={this.value}\n href={this.href || undefined}\n target={this.href && this.target ? this.target : undefined}\n type={!this.href && this.type ? this.type : undefined}\n >\n <nano-icon name={this.iconName} src={this.iconSrc} aria-hidden=\"true\" />\n </TagType>\n );\n }\n}\n"],"version":3}
1
+ {"file":"nano-icon-button.entry.cjs.js","mappings":";;;;;;;;;;AAAA,MAAM,aAAa,GAAG,ghEAAghE;;ICUzhE,UAAU;EALvB;;;IAe2B,SAAI,GAAkC,QAAQ,CAAC;;IAa/C,aAAQ,GAAG,KAAK,CAAC;GAkD3C;;EAtCC,MAAM,QAAQ;IACZ,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;GACrB;EAED,gBAAgB;IACdA,yBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;GACnC;EAED,iBAAiB;IACf,IAAI,IAAI,CAAC,MAAM;MAAEA,yBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;GACpD;EAED,oBAAoB;IAClBA,yBAAY,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;GACrC;EAED,MAAM;IACJ,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,GAAG,QAAQ,GAAI,GAAW,CAAC;IAElE,QACEC,QAAC,OAAO,IACN,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,EAC/B,KAAK,EAAE;QACL,aAAa,EAAE,IAAI;QACnB,uBAAuB,EAAE,IAAI,CAAC,QAAQ;OACvC,gBACW,IAAI,CAAC,KAAK,EACtB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,SAAS,EAC5B,MAAM,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,EAC1D,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,SAAS,IAErDA,uBAAW,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,iBAAc,MAAM,GAAG,CAChE,EACV;GACH;;;;;;","names":["focusVisible","h"],"sources":["./src/components/icon-button/icon-button.scss?tag=nano-icon-button&encapsulation=scoped","./src/components/icon-button/icon-button.tsx"],"sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/nano-theme/base';\n@import '../../global/style/nano-theme/colours';\n@import '../../global/style/nano-theme/form';\n\n:host {\n /**\n * @prop --border-radius: defaults to #{$border-radius-medium};\n * @prop --border-radius: defaults to #{$border-radius-medium};\n * @prop --color: defaults to #{map.get($colors, palegrey)};\n * @prop --active-color: defaults to #{map.get($colors, darkblue--faded)};\n * @prop --hover-color: defaults to #{map.get($colors, blue)};\n * @prop --background: defaults to transparent;\n * @prop --padding: defaults to #{$spacing-small};\n */\n display: inline-block;\n\n --border-radius: #{$border-radius-medium};\n --active-color: #{map.get($colors, darkblue--faded)};\n --hover-color: #{map.get($colors, blue)};\n --nano-color-base: var(--color, #{map.get($colors, mediumgrey)});\n --background: transparent;\n --padding: #{$spacing-small};\n}\n\n.icon-button {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n border: none;\n border-radius: var(--border-radius);\n background: var(--background);\n font-size: inherit;\n color: var(--color);\n padding: var(--padding);\n cursor: pointer;\n appearance: none;\n -webkit-appearance: none;\n transition: box-shadow #{$transition-xfast} ease-in-out;\n\n &:hover:not(.icon-button--disabled),\n &:focus:not(.icon-button--disabled) {\n color: var(--hover-color);\n\n --nano-color-base: var(--hover-color);\n }\n\n &:active:not(.icon-button--disabled) {\n color: var(--active-color);\n\n --nano-color-base: var(--active-color);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.icon-button--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.focus-visible.icon-button:focus {\n box-shadow: #{$control-focus-style};\n}\n","import { Component, Prop, h, ComponentInterface, Method } from '@stencil/core';\nimport { focusVisible } from '../../utils/focus-visible';\n\n/** Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars. */\n\n@Component({\n tag: 'nano-icon-button',\n styleUrl: 'icon-button.scss',\n scoped: true,\n})\nexport class IconButton implements ComponentInterface {\n private button: HTMLButtonElement;\n\n /** The name of the icon to draw. */\n @Prop() iconName?: string;\n\n /** An external URL of an SVG file. */\n @Prop() iconSrc?: string;\n\n /** The default behavior of the button. */\n @Prop({ reflect: true }) type: 'submit' | 'reset' | 'button' = 'button';\n\n /** The name of the button, submitted as a pair with the button’s value as part of the form data. */\n @Prop({ reflect: true }) name?: string;\n\n /** Defines the value associated with the button’s name when it’s submitted with the form data. */\n @Prop({ reflect: true }) value?: string;\n\n /** A description that gets read by screen readers and other assistive devices. For optimal accessibility, you should\n * always include a label that describes what the icon button does. */\n @Prop() label!: string;\n\n /** Set to true to disable the button. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Contains a URL or a URL fragment that the hyperlink points to.\n * If this property is set, an anchor tag will be rendered. */\n @Prop() href: string | undefined;\n\n /** Specifies where to display the linked URL. Only applies when an `href` is provided.\n * Special keywords: `\"_blank\"`, `\"_self\"`, `\"_parent\"`, `\"_top\"`. */\n @Prop() target: string | undefined;\n\n /** Sets focus on the internal button */\n @Method()\n async setFocus() {\n this.button.focus();\n }\n\n componentDidLoad() {\n focusVisible.observe(this.button);\n }\n\n connectedCallback() {\n if (this.button) focusVisible.observe(this.button);\n }\n\n disconnectedCallback() {\n focusVisible.unobserve(this.button);\n }\n\n render() {\n const TagType = this.href === undefined ? 'button' : ('a' as any);\n\n return (\n <TagType\n part=\"base\"\n ref={(el) => (this.button = el)}\n class={{\n 'icon-button': true,\n 'icon-button--disabled': this.disabled,\n }}\n aria-label={this.label}\n name={this.name}\n value={this.value}\n href={this.href || undefined}\n target={this.href && this.target ? this.target : undefined}\n type={!this.href && this.type ? this.type : undefined}\n >\n <nano-icon name={this.iconName} src={this.iconSrc} aria-hidden=\"true\" />\n </TagType>\n );\n }\n}\n"],"version":3}
@@ -175,6 +175,7 @@ let Input = class {
175
175
  this.nativeInput.dispatchEvent(event);
176
176
  };
177
177
  this.validate = throttle.debounce(this.validate, 50);
178
+ this.handleBlur = this.handleBlur.bind(this);
178
179
  }
179
180
  get nativeInputWrap() {
180
181
  return this._nativeInputWrap;
@@ -260,6 +261,15 @@ let Input = class {
260
261
  this.nativeInput.click();
261
262
  }
262
263
  }
264
+ /**
265
+ * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global
266
+ * `input.select()`.
267
+ */
268
+ async select() {
269
+ if (this.nativeInput) {
270
+ this.nativeInput.select();
271
+ }
272
+ }
263
273
  /**
264
274
  * Returns the native `<input>` element used under the hood.
265
275
  */
@@ -289,11 +299,14 @@ let Input = class {
289
299
  const kev = e;
290
300
  let target;
291
301
  index$1.raf(() => {
292
- if (kev.key) {
302
+ if (e instanceof KeyboardEvent && kev.key) {
293
303
  if (kev.key !== 'Tab')
294
304
  return;
295
305
  target = document.activeElement;
296
306
  }
307
+ else if (e instanceof FocusEvent) {
308
+ target = document.activeElement;
309
+ }
297
310
  else
298
311
  target = e.target;
299
312
  if (dom.closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {
@@ -396,10 +409,10 @@ let Input = class {
396
409
  disabled,
397
410
  clearControl: this.clearInput,
398
411
  }))(this);
399
- return (index.h(index.Host, { "aria-disabled": this.disabled ? 'true' : null, dir: this.rtl ? 'rtl' : null, class: Object.assign(Object.assign({}, theme.createColorClasses(this.color)), { 'has-value': this.hasValue(), 'has-focus': this.hasFocus, 'is-invalid': this._invalid }) }, index.h(formControl.FormControlWrap, Object.assign({}, wrapOptions), index.h(formControl.FormControl, Object.assign({}, controlOptions, { onClearText: this.clearTextInput, control: this.el, ref: (el) => (this.nativeInputWrap = el) }), this.type !== 'textarea' && (index.h("input", { id: this.inputId, class: "input__native-ctrl", ref: (input) => (this.nativeInput = input), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalise, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, inputMode: this.inputmode, form: this.form, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onChange: this.onInput, onFocus: this.onFocus, onKeyDown: this.onKeydown, onInvalid: this.validate })), this.type === 'textarea' && (index.h("textarea", { rows: this.floatLabel ? 1 : this.rows, id: this.inputId, class: {
412
+ return (index.h(index.Host, { "aria-disabled": this.disabled ? 'true' : null, dir: this.rtl ? 'rtl' : null, class: Object.assign(Object.assign({}, theme.createColorClasses(this.color)), { 'has-value': this.hasValue(), 'has-focus': this.hasFocus, 'is-invalid': this._invalid }) }, index.h(formControl.FormControlWrap, Object.assign({}, wrapOptions), index.h(formControl.FormControl, Object.assign({}, controlOptions, { onClearText: this.clearTextInput, control: this.el, ref: (el) => (this.nativeInputWrap = el) }), this.type !== 'textarea' && (index.h("input", { id: this.inputId, class: "input__native-ctrl", ref: (input) => (this.nativeInput = input), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalise, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, inputMode: this.inputmode, form: this.form, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onChange: this.onInput, onFocus: this.onFocus, onBlur: this.handleBlur, onKeyDown: this.onKeydown, onInvalid: this.validate })), this.type === 'textarea' && (index.h("textarea", { rows: this.floatLabel ? 1 : this.rows, id: this.inputId, class: {
400
413
  'input__native-ctrl': true,
401
414
  input__resizable: this.resize === 'true',
402
- }, ref: (input) => (this.nativeInput = input), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, autoCapitalize: this.autocapitalise, autoCorrect: this.autocorrect, autoFocus: this.autofocus, inputMode: this.inputmode, form: this.form, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, value: value, onInput: this.onInput, onChange: this.onInput, onFocus: this.onFocus, onKeyDown: this.onKeydown, onInvalid: this.validate }))), index.h("slot", null))));
415
+ }, ref: (input) => (this.nativeInput = input), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, autoCapitalize: this.autocapitalise, autoCorrect: this.autocorrect, autoFocus: this.autofocus, inputMode: this.inputmode, form: this.form, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, value: value, onInput: this.onInput, onChange: this.onInput, onFocus: this.onFocus, onKeyDown: this.onKeydown, onInvalid: this.validate, onBlur: this.handleBlur }))), index.h("slot", null))));
403
416
  }
404
417
  get el() { return index.getElement(this); }
405
418
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"nano-input.entry.cjs.js","mappings":";;;;;;;;;;;;;;AAAA,MAAM,QAAQ,GAAG,m0jBAAm0jB;;ACgCp1jB,IAAI,QAAQ,GAAG,CAAC,CAAC;IAqBJ,KAAK;EAqBhB;;;;;;;;;IAnBQ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;IACrC,qBAAgB,GAAG,KAAK,CAAC;IACzB,QAAG,GAAY,KAAK,CAAC;IAErB,cAAS,GAAG,CAAC,CAAC;IACd,gBAAW,GAAG,KAAK,CAAC;IAkBnB,aAAQ,GAAG,KAAK,CAAC;IACjB,iBAAY,GAAG,KAAK,CAAC;IACrB,kBAAa,GAAG,KAAK,CAAC;IACtB,qBAAgB,GAAG,KAAK,CAAC;IACzB,iBAAY,GAAW,EAAE,CAAC;IAC1B,aAAQ,GAA4B,IAAI,CAAC;IAuBzC,aAAQ,GAAG,KAAK,CAAC;;;;IAwBlB,mBAAc,GACpB,MAAM,CAAC;;;;IAKD,iBAAY,GAAiB,KAAK,CAAC;;;;IAKnC,gBAAW,GAAiB,KAAK,CAAC;;;;IAKlC,cAAS,G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CACQ,CACb,EACP;GACH;;;;;;;;;;;;;;;;;;;;;","names":["debounce","debounceEvent","raf","closestElement","h","Host","createColorClasses","FormControlWrap","FormControl"],"sources":["./src/components/input/input.scss?tag=nano-input&encapsulation=scoped","./src/components/input/input.tsx"],"sourcesContent":["@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../form-control/form-control';\n@import '../form-control/form-control-vars';\n\n:host {\n @include formControlVars;\n\n position: relative;\n width: 100%;\n padding: 0 !important;\n color: currentColor;\n display: block;\n}\n\n:host(.nano-color) {\n color: current-color(base);\n\n --input-border-style--focus: #{$input-border-style} var(--nano-color-tint, #{nano-color(primary, tint)});\n}\n\n.input__native-ctrl {\n @include text-inherit();\n\n padding-left: unset;\n padding-right: unset;\n padding-top: 0;\n padding-bottom: 0;\n padding-inline-start: var(--padding-start);\n padding-inline-end: var(--padding-end);\n border-radius: var(--input-border-radius);\n text-overflow: ellipsis;\n color: var(--input-text-color);\n display: inline-block;\n flex: 1;\n width: 100%;\n max-width: 100%;\n max-height: 100%;\n border: 0;\n outline: none;\n background: transparent;\n appearance: none;\n margin: 0;\n box-sizing: border-box;\n resize: none;\n overflow: hidden;\n line-height: 2.5em;\n min-height: 2.5em;\n\n .has-float-label & {\n line-height: 2.1em;\n min-height: 2.1em;\n padding-top: 1.4em;\n }\n\n &::placeholder {\n color: var(--placeholder-color);\n font-family: inherit;\n font-style: var(--placeholder-font-style);\n font-weight: var(--placeholder-font-weight);\n opacity: var(--placeholder-opacity);\n line-height: inherit;\n min-height: inherit;\n }\n\n &::-moz-placeholder {\n line-height: 2.8em;\n text-overflow: ellipsis;\n }\n\n &:-webkit-autofill {\n background-color: transparent;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:invalid {\n box-shadow: none;\n }\n\n &::-ms-clear,\n &::-ms-reveal {\n display: none;\n }\n\n &.input__resizable {\n resize: vertical;\n overflow: auto;\n }\n\n .form-ctrl__textarea & {\n line-height: 1.5em;\n padding-top: var(--padding-top);\n padding-bottom: 0.25em;\n white-space: pre-wrap;\n\n &::placeholder {\n line-height: 1.5em;\n }\n\n .has-float-label & {\n padding-top: 1.75em;\n }\n }\n\n :host([readonly]:not([readonly='false'])) & {\n user-select: none;\n }\n}\n","import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n Listen,\n} from '@stencil/core';\n\nimport {\n Color,\n ControlValidity,\n ControlValidityEventDetail,\n InputChangeEventDetail,\n TextFieldTypes,\n} from '../../interface';\nimport {\n debounceEvent,\n closestElement,\n createColorClasses,\n raf,\n debounce,\n} from '../../utils';\nimport { FormControl, FormControlWrap } from '../form-control/form-control';\n\nlet inputIds = 0;\n\n/**\n * The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), but works great on desktop devices and integrates with the keyboard on mobile devices.\n\nIt is meant for text type inputs only, such as \"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", and \"url\". It supports all standard text input events including keyup, keydown, keypress, and more.\nThe default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)\n * @slot start - suitable for inline action buttons or icons that may add extra contextual information\n * @slot end - suitable for inline action buttons or icons that may add extra contextual information\n * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot label - if you do not set a label attribute, you can use this slot for more complex markup\n * @slot helper - helper text to accompany the form field underneath.\n * @slot helper-end - helper text to accompany the form field on the side.\n * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information\n */\n@Component({\n tag: 'nano-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement | HTMLTextAreaElement;\n private inputId = `nano-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private rtl: boolean = false;\n private mo?: MutationObserver;\n private charCount = 0;\n private hasRendered = false;\n\n // we don't want these rendered eles decorated with @State\n // because that will cause re-renders. User get/set to set datalist options\n private _nativeInputWrap: HTMLElement;\n private get nativeInputWrap() {\n return this._nativeInputWrap;\n }\n private set nativeInputWrap(ele: HTMLElement) {\n if (this._nativeInputWrap === ele) return;\n this._nativeInputWrap = ele;\n this.setDataListOpts();\n }\n\n constructor() {\n this.validate = debounce(this.validate, 50);\n }\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasHelperSlot = false;\n @State() hasHelperEndSlot = false;\n @State() errorMessage: string = '';\n @State() datalist: HTMLNanoDatalistElement = null;\n\n @Watch('datalist')\n setDataListOpts() {\n if (!this.datalist) return;\n const currDWConfig = this.datalist.dropDownConfig || {};\n this.datalist.dropDownConfig = {\n ...currDWConfig,\n skidding: -1,\n tetherTo: this.nativeInputWrap,\n };\n }\n\n @Element() el!: HTMLNanoInputElement;\n\n /**\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 */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n @State() _invalid = false;\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.nativeInput) return '';\n return this.nativeInput.validationMessage;\n }\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalise: 'none' | 'sentences' | 'words' | 'characters' =\n 'none';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: 'on' | 'off' = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n\n /**\n * When should the field perform validation\n */\n @Prop({ mutable: true }) validateOn: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /**\n * Whether to show validation errors underneath input\n */\n @Prop({ reflect: true }) showInlineError = true;\n\n /**\n * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label!: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop({ reflect: true }) type: TextFieldTypes = 'text';\n\n /**\n * The form element to associate the input with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * relevant to type=\"textarea\". Vertical resizing - enable / disable or make automatic.\n */\n @Prop() resize: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * relevant to type=\"textarea\". Default number of rows to show\n */\n @Prop() rows = 2;\n\n /**\n * relevant to type=\"textarea\".\n */\n @Prop() showCharCount = false;\n\n @Watch('minlength')\n @Watch('maxlength')\n @Watch('min')\n @Watch('max')\n @Watch('required')\n @Watch('disabled')\n @Watch('readonly')\n @Watch('pattern')\n @Watch('inputmode')\n protected shouldValidate() {\n if (!this.hasRendered) return;\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.nanoChange.emit({ value: this.value });\n this.charCount = this.value.length;\n\n if (this.type === 'textarea' && this.resize === 'auto') {\n this.nativeInput.style.height = 'auto';\n if (this.value.length)\n this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';\n }\n\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.nanoChange = debounceEvent(this.nanoChange, this.debounce);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() nanoInput!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() nanoChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() nanoBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() nanoFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been created.\n * @internal\n */\n @Event() nanoDidLoad!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been removed.\n * @internal\n */\n @Event() nanoDidUnload!: EventEmitter<void>;\n\n /**\n * Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.\n */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n /**\n * Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }`\n */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n return new Promise((resolve) => {\n if (validateFirst) this.validate();\n setTimeout(() => {\n resolve({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n });\n }, 50);\n });\n }\n\n /**\n * Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n this.nativeInput.click();\n }\n }\n\n /**\n * Returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.nativeInput);\n }\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 */\n @Method()\n async showError(message: string) {\n if (this.nativeInput) {\n this.nativeInput.setCustomValidity(message);\n this.validate();\n }\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.el.closest('form');\n if (!form || e.target !== this.el.closest('form')) return;\n\n this.value = '';\n }\n\n @Listen('mousedown', { target: 'body' })\n @Listen('keydown')\n handleBlur(e: KeyboardEvent | MouseEvent) {\n if (!this.hasFocus) return;\n\n const kev = e as KeyboardEvent;\n let target: Element;\n\n raf(() => {\n if (kev.key) {\n if (kev.key !== 'Tab') return;\n target = document.activeElement;\n } else target = e.target as Element;\n\n if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {\n this.onBlur();\n }\n });\n }\n\n private shouldClearOnEdit() {\n const { type, clearOnEdit } = this;\n return clearOnEdit === undefined ? type === 'password' : clearOnEdit;\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private validate = (ev?: Event) => {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n if (!this.nativeInput.validity.valid) {\n if (this.showInlineError) {\n if (ev) ev.preventDefault();\n this.errorMessage = this.nativeInput.validationMessage;\n }\n this._invalid = true;\n } else this._invalid = false;\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n originalEvent: ev,\n });\n };\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n this.value = input?.value || '';\n this.nanoInput.emit(ev);\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.focusChanged();\n if (this.validateOn === 'dirty') this.validate();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.focusChanged();\n this.nanoFocus.emit();\n };\n\n private onKeydown = () => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n };\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n this.value = '';\n this.nativeInput.value = '';\n const event = new window.Event('change');\n this.nativeInput.dispatchEvent(event);\n };\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private slotChangeObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.el, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have label / button content\n this.hasLabelSlot = !!this.el.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.el.querySelector('[slot=\"helper\"]');\n this.hasHelperEndSlot = !!this.el.querySelector('[slot=\"helper-end\"]');\n this.datalist = this.el.querySelector('nano-datalist:not([slot])');\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"inline-button\"]')) {\n console.warn(\n 'The `inline-button` slot was renamed to `end` in v2 - please update your code',\n this.el\n );\n }\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"legacy\"]')) {\n console.warn(\n 'The `legacy` slot has been removed. Please update your code',\n this.el\n );\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n this.el.dispatchEvent(\n new CustomEvent('nanoDidLoad', {\n detail: this.el,\n })\n );\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(\n new CustomEvent('nanoDidUnload', {\n detail: this.el,\n })\n );\n }\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n this.hasRendered = true;\n if (this.autofocus) setTimeout((_) => this.setFocus(), 300);\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';\n const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';\n this.rtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const compWrapOptions = (({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }) => ({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }))(this);\n const wrapOptions = {\n ...compWrapOptions,\n labelId,\n moreId,\n helperEndId,\n hasValue: this.hasValue(),\n controlId: this.inputId,\n };\n\n const controlOptions = (({ clearInput, readonly, disabled }) => ({\n clearInput,\n readonly,\n disabled,\n clearControl: this.clearInput,\n }))(this);\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n dir={this.rtl ? 'rtl' : null}\n class={{\n ...createColorClasses(this.color),\n 'has-value': this.hasValue(),\n 'has-focus': this.hasFocus,\n 'is-invalid': this._invalid,\n }}\n >\n <FormControlWrap {...wrapOptions}>\n <FormControl\n {...controlOptions}\n onClearText={this.clearTextInput}\n control={this.el}\n ref={(el) => (this.nativeInputWrap = el)}\n >\n {this.type !== 'textarea' && (\n <input\n id={this.inputId}\n class=\"input__native-ctrl\"\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalise}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n />\n )}\n {this.type === 'textarea' && (\n <textarea\n rows={this.floatLabel ? 1 : this.rows}\n id={this.inputId}\n class={{\n 'input__native-ctrl': true,\n input__resizable: this.resize === 'true',\n }}\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalise}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n ></textarea>\n )}\n </FormControl>\n <slot />\n </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C,IAAI,KAAK,UAAU,KACvBA,sBACE,IAAI,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,EACrC,EAAE,EAAE,IAAI,CAAC,OAAO,EAChB,KAAK,EAAE;QACL,oBAAoB,EAAE,IAAI;QAC1B,gBAAgB,EAAE,IAAI,CAAC,MAAM,KAAK,MAAM;OACzC,EACD,GAAG,EAAE,CAAC,KAAK,MAAM,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,qBACzB,OAAO,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,WAAW,EAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,OAAO,EACtB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,QAAQ,EACxB,MAAM,EAAE,IAAI,CAAC,UAAU,GACb,CACb,CACW,EACdA,qBAAQ,CACQ,CACb,EACP;GACH;;;;;;;;;;;;;;;;;;;;;","names":["debounce","debounceEvent","raf","closestElement","h","Host","createColorClasses","FormControlWrap","FormControl"],"sources":["./src/components/input/input.scss?tag=nano-input&encapsulation=scoped","./src/components/input/input.tsx"],"sourcesContent":["@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../form-control/form-control';\n@import '../form-control/form-control-vars';\n\n:host {\n @include formControlVars;\n\n position: relative;\n width: 100%;\n padding: 0 !important;\n color: currentColor;\n display: block;\n}\n\n:host(.nano-color) {\n color: current-color(base);\n\n --input-border-style--focus: #{$input-border-style} var(--nano-color-tint, #{nano-color(primary, tint)});\n}\n\n.input__native-ctrl {\n @include text-inherit();\n\n padding-left: unset;\n padding-right: unset;\n padding-top: 0;\n padding-bottom: 0;\n padding-inline-start: var(--padding-start);\n padding-inline-end: var(--padding-end);\n border-radius: var(--input-border-radius);\n text-overflow: ellipsis;\n color: var(--input-text-color);\n display: inline-block;\n flex: 1;\n width: 100%;\n max-width: 100%;\n max-height: 100%;\n border: 0;\n outline: none;\n background: transparent;\n appearance: none;\n margin: 0;\n box-sizing: border-box;\n resize: none;\n overflow: hidden;\n line-height: 2.5em;\n min-height: 2.5em;\n\n .has-float-label & {\n line-height: 2.1em;\n min-height: 2.1em;\n padding-top: 1.4em;\n }\n\n &::placeholder {\n color: var(--placeholder-color);\n font-family: inherit;\n font-style: var(--placeholder-font-style);\n font-weight: var(--placeholder-font-weight);\n opacity: var(--placeholder-opacity);\n line-height: inherit;\n min-height: inherit;\n }\n\n &::-moz-placeholder {\n line-height: 2.8em;\n text-overflow: ellipsis;\n }\n\n &:-webkit-autofill {\n background-color: transparent;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:invalid {\n box-shadow: none;\n }\n\n &::-ms-clear,\n &::-ms-reveal {\n display: none;\n }\n\n &.input__resizable {\n resize: vertical;\n overflow: auto;\n }\n\n .form-ctrl__textarea & {\n line-height: 1.5em;\n padding-top: var(--padding-top);\n padding-bottom: 0.25em;\n white-space: pre-wrap;\n\n &::placeholder {\n line-height: 1.5em;\n }\n\n .has-float-label & {\n padding-top: 1.75em;\n }\n }\n\n :host([readonly]:not([readonly='false'])) & {\n user-select: none;\n }\n}\n","import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n Listen,\n} from '@stencil/core';\n\nimport {\n Color,\n ControlValidity,\n ControlValidityEventDetail,\n InputChangeEventDetail,\n TextFieldTypes,\n} from '../../interface';\nimport {\n debounceEvent,\n closestElement,\n createColorClasses,\n raf,\n debounce,\n} from '../../utils';\nimport { FormControl, FormControlWrap } from '../form-control/form-control';\n\nlet inputIds = 0;\n\n/**\n * The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), but works great on desktop devices and integrates with the keyboard on mobile devices.\n\nIt is meant for text type inputs only, such as \"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", and \"url\". It supports all standard text input events including keyup, keydown, keypress, and more.\nThe default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)\n * @slot start - suitable for inline action buttons or icons that may add extra contextual information\n * @slot end - suitable for inline action buttons or icons that may add extra contextual information\n * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot label - if you do not set a label attribute, you can use this slot for more complex markup\n * @slot helper - helper text to accompany the form field underneath.\n * @slot helper-end - helper text to accompany the form field on the side.\n * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information\n */\n@Component({\n tag: 'nano-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement | HTMLTextAreaElement;\n private inputId = `nano-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private rtl: boolean = false;\n private mo?: MutationObserver;\n private charCount = 0;\n private hasRendered = false;\n\n // we don't want these rendered eles decorated with @State\n // because that will cause re-renders. User get/set to set datalist options\n private _nativeInputWrap: HTMLElement;\n private get nativeInputWrap() {\n return this._nativeInputWrap;\n }\n private set nativeInputWrap(ele: HTMLElement) {\n if (this._nativeInputWrap === ele) return;\n this._nativeInputWrap = ele;\n this.setDataListOpts();\n }\n\n constructor() {\n this.validate = debounce(this.validate, 50);\n this.handleBlur = this.handleBlur.bind(this);\n }\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasHelperSlot = false;\n @State() hasHelperEndSlot = false;\n @State() errorMessage: string = '';\n @State() datalist: HTMLNanoDatalistElement = null;\n\n @Watch('datalist')\n setDataListOpts() {\n if (!this.datalist) return;\n const currDWConfig = this.datalist.dropDownConfig || {};\n this.datalist.dropDownConfig = {\n ...currDWConfig,\n skidding: -1,\n tetherTo: this.nativeInputWrap,\n };\n }\n\n @Element() el!: HTMLNanoInputElement;\n\n /**\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 */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n @State() _invalid = false;\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.nativeInput) return '';\n return this.nativeInput.validationMessage;\n }\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalise: 'none' | 'sentences' | 'words' | 'characters' =\n 'none';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: 'on' | 'off' = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n\n /**\n * When should the field perform validation\n */\n @Prop({ mutable: true }) validateOn: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /**\n * Whether to show validation errors underneath input\n */\n @Prop({ reflect: true }) showInlineError = true;\n\n /**\n * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label!: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop({ reflect: true }) type: TextFieldTypes = 'text';\n\n /**\n * The form element to associate the input with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * relevant to type=\"textarea\". Vertical resizing - enable / disable or make automatic.\n */\n @Prop() resize: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * relevant to type=\"textarea\". Default number of rows to show\n */\n @Prop() rows = 2;\n\n /**\n * relevant to type=\"textarea\".\n */\n @Prop() showCharCount = false;\n\n @Watch('minlength')\n @Watch('maxlength')\n @Watch('min')\n @Watch('max')\n @Watch('required')\n @Watch('disabled')\n @Watch('readonly')\n @Watch('pattern')\n @Watch('inputmode')\n protected shouldValidate() {\n if (!this.hasRendered) return;\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.nanoChange.emit({ value: this.value });\n this.charCount = this.value.length;\n\n if (this.type === 'textarea' && this.resize === 'auto') {\n this.nativeInput.style.height = 'auto';\n if (this.value.length)\n this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';\n }\n\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.nanoChange = debounceEvent(this.nanoChange, this.debounce);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() nanoInput!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() nanoChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() nanoBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() nanoFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been created.\n * @internal\n */\n @Event() nanoDidLoad!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been removed.\n * @internal\n */\n @Event() nanoDidUnload!: EventEmitter<void>;\n\n /**\n * Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.\n */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n /**\n * Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }`\n */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n return new Promise((resolve) => {\n if (validateFirst) this.validate();\n setTimeout(() => {\n resolve({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n });\n }, 50);\n });\n }\n\n /**\n * Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n this.nativeInput.click();\n }\n }\n\n /**\n * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global\n * `input.select()`.\n */\n @Method()\n async select() {\n if (this.nativeInput) {\n this.nativeInput.select();\n }\n }\n\n /**\n * Returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.nativeInput);\n }\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 */\n @Method()\n async showError(message: string) {\n if (this.nativeInput) {\n this.nativeInput.setCustomValidity(message);\n this.validate();\n }\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.el.closest('form');\n if (!form || e.target !== this.el.closest('form')) return;\n\n this.value = '';\n }\n\n @Listen('mousedown', { target: 'body' })\n @Listen('keydown')\n handleBlur(e: KeyboardEvent | MouseEvent | FocusEvent) {\n if (!this.hasFocus) return;\n\n const kev = e as KeyboardEvent;\n let target: Element;\n\n raf(() => {\n if (e instanceof KeyboardEvent && kev.key) {\n if (kev.key !== 'Tab') return;\n target = document.activeElement;\n } else if (e instanceof FocusEvent) {\n target = document.activeElement;\n } else target = e.target as Element;\n\n if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {\n this.onBlur();\n }\n });\n }\n\n private shouldClearOnEdit() {\n const { type, clearOnEdit } = this;\n return clearOnEdit === undefined ? type === 'password' : clearOnEdit;\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private validate = (ev?: Event) => {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n if (!this.nativeInput.validity.valid) {\n if (this.showInlineError) {\n if (ev) ev.preventDefault();\n this.errorMessage = this.nativeInput.validationMessage;\n }\n this._invalid = true;\n } else this._invalid = false;\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n originalEvent: ev,\n });\n };\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n this.value = input?.value || '';\n this.nanoInput.emit(ev);\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.focusChanged();\n if (this.validateOn === 'dirty') this.validate();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.focusChanged();\n this.nanoFocus.emit();\n };\n\n private onKeydown = () => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n };\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n this.value = '';\n this.nativeInput.value = '';\n const event = new window.Event('change');\n this.nativeInput.dispatchEvent(event);\n };\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private slotChangeObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.el, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have label / button content\n this.hasLabelSlot = !!this.el.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.el.querySelector('[slot=\"helper\"]');\n this.hasHelperEndSlot = !!this.el.querySelector('[slot=\"helper-end\"]');\n this.datalist = this.el.querySelector('nano-datalist:not([slot])');\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"inline-button\"]')) {\n console.warn(\n 'The `inline-button` slot was renamed to `end` in v2 - please update your code',\n this.el\n );\n }\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"legacy\"]')) {\n console.warn(\n 'The `legacy` slot has been removed. Please update your code',\n this.el\n );\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n this.el.dispatchEvent(\n new CustomEvent('nanoDidLoad', {\n detail: this.el,\n })\n );\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(\n new CustomEvent('nanoDidUnload', {\n detail: this.el,\n })\n );\n }\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n this.hasRendered = true;\n if (this.autofocus) setTimeout((_) => this.setFocus(), 300);\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';\n const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';\n this.rtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const compWrapOptions = (({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }) => ({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }))(this);\n const wrapOptions = {\n ...compWrapOptions,\n labelId,\n moreId,\n helperEndId,\n hasValue: this.hasValue(),\n controlId: this.inputId,\n };\n\n const controlOptions = (({ clearInput, readonly, disabled }) => ({\n clearInput,\n readonly,\n disabled,\n clearControl: this.clearInput,\n }))(this);\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n dir={this.rtl ? 'rtl' : null}\n class={{\n ...createColorClasses(this.color),\n 'has-value': this.hasValue(),\n 'has-focus': this.hasFocus,\n 'is-invalid': this._invalid,\n }}\n >\n <FormControlWrap {...wrapOptions}>\n <FormControl\n {...controlOptions}\n onClearText={this.clearTextInput}\n control={this.el}\n ref={(el) => (this.nativeInputWrap = el)}\n >\n {this.type !== 'textarea' && (\n <input\n id={this.inputId}\n class=\"input__native-ctrl\"\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalise}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n />\n )}\n {this.type === 'textarea' && (\n <textarea\n rows={this.floatLabel ? 1 : this.rows}\n id={this.inputId}\n class={{\n 'input__native-ctrl': true,\n input__resizable: this.resize === 'true',\n }}\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalise}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n onBlur={this.handleBlur}\n ></textarea>\n )}\n </FormControl>\n <slot />\n </FormControlWrap>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -482,6 +482,7 @@ let Select = class {
482
482
  const { value, selected, label, filterMeta } = ao;
483
483
  return { value, selected, label, filterMeta };
484
484
  });
485
+ this.customValidate();
485
486
  };
486
487
  this.handleDocumentKeyDown = (ev) => {
487
488
  if (!this.multiple || !this.hasFocus)
@@ -690,6 +691,7 @@ let Select = class {
690
691
  */
691
692
  // eslint-disable-next-line @stencil/no-unused-watch
692
693
  valueChanged() {
694
+ this.customValidate();
693
695
  if (this.onInit) {
694
696
  if (this.multiple)
695
697
  this.currInsertIndex = this.value.length - 1;