@nanoporetech-digital/components 8.3.2 → 8.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/cjs/constructible-style-BsHBb9au.js +133 -0
  2. package/dist/cjs/{fade-BzBFJiQK.js → fade-DBuNbJEw.js} +1 -1
  3. package/dist/cjs/{fullscreen-Cz3eYnOp.js → fullscreen-Bk4jXSN0.js} +1 -1
  4. package/dist/cjs/index-DGttnXif.js +28 -16
  5. package/dist/cjs/{lazyload-DIFYejbf.js → lazyload-gQqOMvpr.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/nano-accordion.cjs.entry.js +28 -9
  8. package/dist/cjs/nano-avatar_5.cjs.entry.js +11 -11
  9. package/dist/cjs/nano-components.cjs.js +1 -1
  10. package/dist/cjs/{nano-data-table-DFEflpc4.js → nano-data-table-BHQIpW0N.js} +31 -1
  11. package/dist/cjs/nano-data-table.cjs.entry.js +1 -1
  12. package/dist/cjs/nano-details.cjs.entry.js +6 -4
  13. package/dist/cjs/nano-field-validator.cjs.entry.js +4 -2
  14. package/dist/cjs/nano-footer.cjs.entry.js +2 -2
  15. package/dist/cjs/nano-global-nav.cjs.entry.js +22 -21
  16. package/dist/cjs/nano-grid-item.cjs.entry.js +1 -1
  17. package/dist/cjs/nano-grid_2.cjs.entry.js +6 -130
  18. package/dist/cjs/nano-hero.cjs.entry.js +4 -4
  19. package/dist/cjs/{nano-icon_3.cjs.entry.js → nano-icon-button_2.cjs.entry.js} +2 -320
  20. package/dist/cjs/nano-icon.cjs.entry.js +326 -0
  21. package/dist/cjs/nano-in-page-nav.cjs.entry.js +1 -1
  22. package/dist/cjs/nano-increment.cjs.entry.js +1 -1
  23. package/dist/cjs/nano-intersection-observe.cjs.entry.js +1 -1
  24. package/dist/cjs/nano-masked-overflow.cjs.entry.js +3 -3
  25. package/dist/cjs/nano-menu-drawer.cjs.entry.js +2 -2
  26. package/dist/cjs/nano-more-less.cjs.entry.js +2 -2
  27. package/dist/cjs/nano-rating.cjs.entry.js +4 -4
  28. package/dist/cjs/nano-resize-observe.cjs.entry.js +2 -2
  29. package/dist/cjs/nano-slide.cjs.entry.js +1 -1
  30. package/dist/cjs/{nano-slides-C576PTmo.js → nano-slides-C73bSG0h.js} +7 -7
  31. package/dist/cjs/nano-slides.cjs.entry.js +1 -1
  32. package/dist/cjs/nano-sortable.cjs.entry.js +1 -1
  33. package/dist/cjs/nano-step-accordion.cjs.entry.js +101 -0
  34. package/dist/cjs/nano-step-breadcrumb.cjs.entry.js +133 -0
  35. package/dist/cjs/nano-sticker.cjs.entry.js +2 -2
  36. package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
  37. package/dist/cjs/nano-tab.cjs.entry.js +2 -2
  38. package/dist/cjs/nano-table.cjs.entry.js +2 -2
  39. package/dist/cjs/{page-dots-Clb2QknR.js → page-dots-BLPta5z5.js} +1 -1
  40. package/dist/cjs/{table.worker-DxRLPmU9.js → table.worker-BeE8kdSf.js} +1 -1
  41. package/dist/collection/collection-manifest.json +2 -0
  42. package/dist/collection/components/accordion/accordion.js +51 -13
  43. package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
  44. package/dist/collection/components/data-table/table.js +1 -13
  45. package/dist/collection/components/details/details.js +9 -6
  46. package/dist/collection/components/field-validator/field-validator.js +4 -2
  47. package/dist/collection/components/footer/footer.css +7 -7
  48. package/dist/collection/components/footer/footer.js +2 -1
  49. package/dist/collection/components/global-nav/global-nav.js +23 -22
  50. package/dist/collection/components/global-search-results/global-search-results.js +4 -4
  51. package/dist/collection/components/grid/grid-item.js +1 -1
  52. package/dist/collection/components/grid/grid.js +1 -1
  53. package/dist/collection/components/hero/hero.js +4 -4
  54. package/dist/collection/components/icon/icon.js +1 -1
  55. package/dist/collection/components/icon/validate.js +1 -1
  56. package/dist/collection/components/img/img.js +3 -3
  57. package/dist/collection/components/in-page-nav/in-page-nav.js +1 -1
  58. package/dist/collection/components/increment/increment.js +1 -1
  59. package/dist/collection/components/intersection-observe/intersection-observe.js +1 -1
  60. package/dist/collection/components/masked-overflow/masked-overflow.js +3 -3
  61. package/dist/collection/components/menu-drawer/menu-drawer.js +2 -2
  62. package/dist/collection/components/more-less/more-less.js +2 -2
  63. package/dist/collection/components/rating/rating.js +4 -4
  64. package/dist/collection/components/resize-observe/resize-observe.js +2 -2
  65. package/dist/collection/components/select/select.js +7 -7
  66. package/dist/collection/components/slides/slide.js +1 -1
  67. package/dist/collection/components/slides/slides.js +3 -3
  68. package/dist/collection/components/sortable/sortable.js +1 -1
  69. package/dist/collection/components/step-accordion/step-accordion.css +138 -0
  70. package/dist/collection/components/step-accordion/step-accordion.js +190 -0
  71. package/dist/collection/components/step-breadcrumb/step-breadcrumb.css +231 -0
  72. package/dist/collection/components/step-breadcrumb/step-breadcrumb.js +222 -0
  73. package/dist/collection/components/sticker/sticker.js +2 -2
  74. package/dist/collection/components/table/table.js +2 -2
  75. package/dist/collection/components/tabs/tab-content.js +2 -2
  76. package/dist/collection/components/tabs/tab.js +2 -2
  77. package/dist/collection/components/tooltip/tooltip.js +2 -2
  78. package/dist/collection/utils/constructible-style.js +2 -2
  79. package/dist/collection/utils/performance.js +17 -0
  80. package/dist/components/accordion.js +80 -0
  81. package/dist/components/constructible-style.js +131 -0
  82. package/dist/components/details.js +6 -4
  83. package/dist/components/global-search-results.js +4 -4
  84. package/dist/components/grid.js +5 -129
  85. package/dist/components/icon.js +2 -2
  86. package/dist/components/img.js +3 -3
  87. package/dist/components/masked-overflow.js +3 -3
  88. package/dist/components/nano-accordion.js +1 -56
  89. package/dist/components/nano-data-table.js +30 -0
  90. package/dist/components/nano-field-validator.js +4 -2
  91. package/dist/components/nano-footer.js +2 -2
  92. package/dist/components/nano-global-nav.js +22 -21
  93. package/dist/components/nano-grid-item.js +1 -1
  94. package/dist/components/nano-hero.js +4 -4
  95. package/dist/components/nano-in-page-nav.js +1 -1
  96. package/dist/components/nano-increment.js +1 -1
  97. package/dist/components/nano-intersection-observe.js +1 -1
  98. package/dist/components/nano-menu-drawer.js +2 -2
  99. package/dist/components/nano-more-less.js +2 -2
  100. package/dist/components/nano-rating.js +4 -4
  101. package/dist/components/nano-slide.js +1 -1
  102. package/dist/components/nano-sortable.js +1 -1
  103. package/dist/components/nano-step-accordion.d.ts +11 -0
  104. package/dist/components/nano-step-accordion.js +141 -0
  105. package/dist/components/nano-step-breadcrumb.d.ts +11 -0
  106. package/dist/components/nano-step-breadcrumb.js +181 -0
  107. package/dist/components/nano-tab-content.js +2 -2
  108. package/dist/components/nano-tab.js +2 -2
  109. package/dist/components/nano-table.js +2 -2
  110. package/dist/components/resize-observe.js +2 -2
  111. package/dist/components/select.js +7 -7
  112. package/dist/components/slides.js +3 -3
  113. package/dist/components/sticker.js +2 -2
  114. package/dist/components/tooltip.js +2 -2
  115. package/dist/esm/constructible-style-B2_GfhhS.js +131 -0
  116. package/dist/esm/{fade-D4P3XGVa.js → fade-C0NluV0K.js} +1 -1
  117. package/dist/esm/{fullscreen-Cfl6LvH2.js → fullscreen-Ck_w6MCZ.js} +1 -1
  118. package/dist/esm/index-BM3Om9WE.js +28 -16
  119. package/dist/esm/{lazyload-CQYknGN2.js → lazyload-DddTyM-A.js} +1 -1
  120. package/dist/esm/loader.js +1 -1
  121. package/dist/esm/nano-accordion.entry.js +28 -9
  122. package/dist/esm/nano-avatar_5.entry.js +11 -11
  123. package/dist/esm/nano-components.js +1 -1
  124. package/dist/esm/{nano-data-table-Bqk8ZUaL.js → nano-data-table-CWliPF7Y.js} +31 -1
  125. package/dist/esm/nano-data-table.entry.js +1 -1
  126. package/dist/esm/nano-details.entry.js +6 -4
  127. package/dist/esm/nano-field-validator.entry.js +4 -2
  128. package/dist/esm/nano-footer.entry.js +2 -2
  129. package/dist/esm/nano-global-nav.entry.js +22 -21
  130. package/dist/esm/nano-grid-item.entry.js +1 -1
  131. package/dist/esm/nano-grid_2.entry.js +7 -131
  132. package/dist/esm/nano-hero.entry.js +4 -4
  133. package/dist/esm/{nano-icon_3.entry.js → nano-icon-button_2.entry.js} +4 -321
  134. package/dist/esm/nano-icon.entry.js +324 -0
  135. package/dist/esm/nano-in-page-nav.entry.js +1 -1
  136. package/dist/esm/nano-increment.entry.js +1 -1
  137. package/dist/esm/nano-intersection-observe.entry.js +1 -1
  138. package/dist/esm/nano-masked-overflow.entry.js +3 -3
  139. package/dist/esm/nano-menu-drawer.entry.js +2 -2
  140. package/dist/esm/nano-more-less.entry.js +2 -2
  141. package/dist/esm/nano-rating.entry.js +4 -4
  142. package/dist/esm/nano-resize-observe.entry.js +2 -2
  143. package/dist/esm/nano-slide.entry.js +1 -1
  144. package/dist/esm/{nano-slides-DcJWApi6.js → nano-slides-BiPGpe5F.js} +7 -7
  145. package/dist/esm/nano-slides.entry.js +1 -1
  146. package/dist/esm/nano-sortable.entry.js +1 -1
  147. package/dist/esm/nano-step-accordion.entry.js +99 -0
  148. package/dist/esm/nano-step-breadcrumb.entry.js +131 -0
  149. package/dist/esm/nano-sticker.entry.js +2 -2
  150. package/dist/esm/nano-tab-content.entry.js +2 -2
  151. package/dist/esm/nano-tab.entry.js +2 -2
  152. package/dist/esm/nano-table.entry.js +2 -2
  153. package/dist/esm/{page-dots-kX7jiD3G.js → page-dots-WKehEjjM.js} +1 -1
  154. package/dist/esm/{table.worker-a52UkSRM.js → table.worker-DJks4i_l.js} +1 -1
  155. package/dist/nano-components/constructible-style-B2_GfhhS.js +4 -0
  156. package/dist/nano-components/{fade-D4P3XGVa.js → fade-C0NluV0K.js} +1 -1
  157. package/dist/nano-components/{fullscreen-Cfl6LvH2.js → fullscreen-Ck_w6MCZ.js} +1 -1
  158. package/dist/nano-components/{lazyload-CQYknGN2.js → lazyload-DddTyM-A.js} +1 -1
  159. package/dist/nano-components/nano-accordion.entry.js +1 -1
  160. package/dist/nano-components/nano-avatar_5.entry.js +1 -1
  161. package/dist/nano-components/nano-components.css +32 -1
  162. package/dist/nano-components/nano-components.esm.js +1 -1
  163. package/dist/nano-components/nano-data-table-CWliPF7Y.js +4 -0
  164. package/dist/nano-components/nano-data-table.entry.js +1 -1
  165. package/dist/nano-components/nano-details.entry.js +1 -1
  166. package/dist/nano-components/nano-field-validator.entry.js +1 -1
  167. package/dist/nano-components/nano-footer.entry.js +1 -1
  168. package/dist/nano-components/nano-global-nav.entry.js +1 -1
  169. package/dist/nano-components/nano-grid-item.entry.js +1 -1
  170. package/dist/nano-components/nano-grid_2.entry.js +1 -1
  171. package/dist/nano-components/nano-hero.entry.js +1 -1
  172. package/dist/nano-components/nano-icon-button_2.entry.js +4 -0
  173. package/dist/nano-components/nano-icon.entry.js +4 -0
  174. package/dist/nano-components/nano-in-page-nav.entry.js +1 -1
  175. package/dist/nano-components/nano-increment.entry.js +1 -1
  176. package/dist/nano-components/nano-intersection-observe.entry.js +1 -1
  177. package/dist/nano-components/nano-masked-overflow.entry.js +1 -1
  178. package/dist/nano-components/nano-menu-drawer.entry.js +1 -1
  179. package/dist/nano-components/nano-more-less.entry.js +1 -1
  180. package/dist/nano-components/nano-rating.entry.js +1 -1
  181. package/dist/nano-components/nano-resize-observe.entry.js +1 -1
  182. package/dist/nano-components/nano-slide.entry.js +1 -1
  183. package/dist/nano-components/{nano-slides-DcJWApi6.js → nano-slides-BiPGpe5F.js} +3 -3
  184. package/dist/nano-components/nano-slides.entry.js +1 -1
  185. package/dist/nano-components/nano-sortable.entry.js +1 -1
  186. package/dist/nano-components/nano-step-accordion.entry.js +4 -0
  187. package/dist/nano-components/nano-step-breadcrumb.entry.js +4 -0
  188. package/dist/nano-components/nano-sticker.entry.js +1 -1
  189. package/dist/nano-components/nano-tab-content.entry.js +1 -1
  190. package/dist/nano-components/nano-tab.entry.js +1 -1
  191. package/dist/nano-components/nano-table.entry.js +1 -1
  192. package/dist/nano-components/{page-dots-kX7jiD3G.js → page-dots-WKehEjjM.js} +1 -1
  193. package/dist/nano-components/{table.worker-a52UkSRM.js → table.worker-DJks4i_l.js} +1 -1
  194. package/dist/stencil.config.js +1 -0
  195. package/dist/style/components.css +1 -1
  196. package/dist/style/components.css.map +1 -1
  197. package/dist/style/core.css +1 -1
  198. package/dist/style/core.css.map +1 -1
  199. package/dist/style/nano.css +1 -1
  200. package/dist/style/nano.css.map +1 -1
  201. package/dist/types/components/accordion/accordion.d.ts +10 -4
  202. package/dist/types/components/details/details.d.ts +3 -2
  203. package/dist/types/components/footer/footer.d.ts +1 -0
  204. package/dist/types/components/global-nav/global-nav.d.ts +1 -1
  205. package/dist/types/components/step-accordion/step-accordion.d.ts +38 -0
  206. package/dist/types/components/step-breadcrumb/step-breadcrumb.d.ts +37 -0
  207. package/dist/types/components.d.ts +174 -4
  208. package/dist/types/utils/performance.d.ts +1 -0
  209. package/docs-json.json +352 -18
  210. package/docs-vscode.json +41 -2
  211. package/hydrate/index.js +404 -99
  212. package/hydrate/index.mjs +404 -99
  213. package/package.json +2 -2
  214. package/dist/nano-components/nano-data-table-Bqk8ZUaL.js +0 -4
  215. package/dist/nano-components/nano-icon_3.entry.js +0 -4
  216. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/generate-vue-component.d.ts +0 -0
  217. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/index.d.ts +0 -0
  218. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/output-vue.d.ts +0 -0
  219. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/plugin.d.ts +0 -0
  220. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/types.d.ts +0 -0
  221. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/utils.d.ts +0 -0
  222. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/stencil.config.d.ts +0 -0
  223. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
  224. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/testing/mocks/intersection-observer.d.ts +0 -0
  225. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/wdio.conf.d.ts +0 -0
@@ -7,323 +7,6 @@ var index = require('./index-DGttnXif.js');
7
7
  var renderer = require('./renderer-B9M1kXq8.js');
8
8
  var popover = require('./popover-BxNxwqMv.js');
9
9
 
10
- let CACHED_MAP;
11
- const getIconMap = () => {
12
- if (!CACHED_MAP) {
13
- const win = window;
14
- win.Nanoicons = win.Nanoicons || {};
15
- CACHED_MAP = win.Nanoicons.map = win.Nanoicons.map || new Map();
16
- }
17
- return CACHED_MAP;
18
- };
19
- const getUrl = (i) => {
20
- let url = getSrc(i.src);
21
- if (url)
22
- return url;
23
- url = getName(i.name, i.icon);
24
- if (url)
25
- return getNamedUrl(url);
26
- if (i.icon) {
27
- url = getSrc(i.icon);
28
- if (url)
29
- return url;
30
- }
31
- return null;
32
- };
33
- const getNamedUrl = (iconName) => {
34
- const url = getIconMap().get(iconName);
35
- if (url)
36
- return url;
37
- if (iconName.startsWith('device/') || iconName.startsWith('pictogram/')) {
38
- return index.getAssetPath(`../nano-assets/icon/${iconName}.svg`);
39
- }
40
- return index.getAssetPath(`../nano-assets/fontawesome-pro/svgs/${iconName}.svg`);
41
- };
42
- const getName = (iconName, icon) => {
43
- if (!iconName && icon && !isSrc(icon)) {
44
- iconName = icon;
45
- }
46
- if (isStr(iconName)) {
47
- iconName = toLower(iconName);
48
- }
49
- if (!isStr(iconName) || iconName.trim() === '') {
50
- return null;
51
- }
52
- // only allow alpha characters and dash
53
- const invalidChars = iconName.replace(/[a-z]|-|\/|\d/gi, '');
54
- if (invalidChars !== '') {
55
- console.warn('invalid characters in icon name ' + iconName);
56
- return null;
57
- }
58
- return iconName;
59
- };
60
- const getSrc = (src) => {
61
- if (isStr(src)) {
62
- src = src.trim();
63
- if (isSrc(src))
64
- return src;
65
- }
66
- return null;
67
- };
68
- const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
69
- const isStr = (val) => typeof val === 'string';
70
- const toLower = (val) => val.toLowerCase();
71
-
72
- const validateContent = (svgContent) => {
73
- if (svgContent) {
74
- const div = document.createElement('div');
75
- div.innerHTML = svgContent;
76
- // setup this way to ensure it works on our buddy IE
77
- for (let i = div.childNodes.length - 1; i >= 0; i--) {
78
- if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
79
- div.removeChild(div.childNodes[i]);
80
- }
81
- }
82
- // must only have 1 root element
83
- const svgElm = div.firstElementChild;
84
- if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
85
- const svgClass = svgElm.getAttribute('class') || '';
86
- svgElm.setAttribute('class', (svgClass + ' sc-nano-icon s-nano-icon svg').trim());
87
- // root element must be an svg
88
- // lets double check we've got valid elements
89
- // do not allow scripts
90
- if (isValid(svgElm)) {
91
- return div.innerHTML;
92
- }
93
- }
94
- }
95
- return '';
96
- };
97
- const isValid = (elm) => {
98
- if (elm.nodeType === 1) {
99
- if (elm.nodeName.toLowerCase() === 'script') {
100
- return false;
101
- }
102
- for (let i = 0; i < elm.attributes.length; i++) {
103
- const val = elm.attributes[i].value;
104
- if (isStr(val) && val.toLowerCase().indexOf('on') === 0) {
105
- return false;
106
- }
107
- }
108
- for (let i = 0; i < elm.childNodes.length; i++) {
109
- if (!isValid(elm.childNodes[i])) {
110
- return false;
111
- }
112
- }
113
- }
114
- return true;
115
- };
116
-
117
- const iconContent = new Map();
118
- const requests = new Map();
119
- const getSvgContent = (url) => {
120
- // see if we already have a request for this url
121
- let req = requests.get(url);
122
- if (!req) {
123
- // we don't already have a request
124
- req = fetch(url).then((rsp) => {
125
- if (rsp.ok) {
126
- return rsp.text().then((svgContent) => {
127
- iconContent.set(url, validateContent(svgContent));
128
- });
129
- }
130
- iconContent.set(url, '');
131
- });
132
- // cache for the same requests
133
- requests.set(url, req);
134
- }
135
- return req;
136
- };
137
-
138
- const iconCss = ":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--icon-size:1em;--primary-color:currentcolor\n --secondary-color: color-mix(in srgb, currentColor 50%, transparent);--primary-opacity:0.8;--secondary-opacity:1;display:inline-block;inline-size:var(--icon-size);block-size:var(--icon-size);min-inline-size:var(--icon-size);min-block-size:var(--icon-size);contain:strict;fill:currentcolor;box-sizing:content-box !important;transition:opacity 0.3s ease;color:currentcolor}:host .nanoicon{stroke:currentcolor}.nanoicon-fill-none{fill:none}.icon-inner,.nanoicon,svg,.svg{display:block;block-size:100%;inline-size:100%;overflow:visible}:host(.loading){opacity:0}.fa-primary{color:var(--primary-color);opacity:var(--primary-opacity, 1)}.fa-secondary{color:var(--secondary-color);opacity:var(--secondary-opacity) !important}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host([name^=pictogram]),:host([name^=device]){font-size:max(var(--nano-pictogram-size-medium), var(--icon-size))}:host([size=small][name^=pictogram]),:host([size=small][name^=device]){font-size:var(--nano-pictogram-size-small)}:host([size=regular]){font-size:var(--nano-icon-size-small)}:host([size=regular][name^=pictogram]),:host([size=regular][name^=device]){font-size:var(--nano-pictogram-size-medium)}:host([size=large]){font-size:var(--nano-icon-size-large)}:host([size=large][name^=pictogram]),:host([size=large][name^=device]){font-size:var(--nano-pictogram-size-large)}:host([size=xl][name^=pictogram]),:host([size=xl][name^=device]){font-size:var(--nano-pictogram-size-x-large)}:host([name^=pictogram]),:host([name^=device]),:host([color=primary]){color:var(--nano-color-primary-1100)}:host([color=neutral]){color:var(--nano-color-base-1000)}";
139
-
140
- const Icon = class {
141
- constructor(hostRef) {
142
- index.registerInstance(this, hostRef);
143
- this.nanoLoad = index.createEvent(this, "nanoLoad", 7);
144
- this.nanoError = index.createEvent(this, "nanoError", 7);
145
- }
146
- io;
147
- get el() { return index.getElement(this); }
148
- svgContent;
149
- isVisible = false;
150
- isLoading = true;
151
- /**
152
- * Specifies the color of the icon. If not specified, the icon will inherit the color of the parent element.
153
- */
154
- color;
155
- /**
156
- * Specifies the role to use for accessibility. Defaults to 'presentation' (invisible to screen-readers)
157
- */
158
- role;
159
- setAriaLabel() {
160
- if (!this.ariaLabel && !this.el.ariaLabel) {
161
- if (!this.role || this.role !== 'presentation') {
162
- // if the role is not 'presentation' and the user did not explicitly set a role,
163
- // let's try and derive one from the icon name
164
- const label = getName(this.name, this.icon);
165
- // user did not provide a label
166
- // come up with the label based on the icon name
167
- if (label) {
168
- this.ariaLabel = label.split('/').slice(-1)[0].replace(/-/g, ' ');
169
- }
170
- }
171
- }
172
- else if (this.role === 'presentation') {
173
- this.ariaLabel = undefined;
174
- }
175
- }
176
- /**
177
- * Specifies the label to use for accessibility. Defaults to the icon name.
178
- */
179
- ariaLabel;
180
- updateRole() {
181
- // force the role to be 'img' if the aria-label is explicitly set
182
- if (this.ariaLabel)
183
- this.role = 'img';
184
- else if (!this.ariaLabel)
185
- this.role = 'presentation';
186
- }
187
- /**
188
- * Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
189
- * By default, when an 'arrow' or 'chevron' icon is used, it will flip automatically when detecting `dir="rtl"` on the document or closest ancestor.
190
- */
191
- flipRtl;
192
- /**
193
- * Specifies which icon to use from the built-in set of icons.
194
- */
195
- name;
196
- /**
197
- * Specifies the exact `src` of an SVG file to use.
198
- */
199
- src;
200
- /**
201
- * A combination of both `name` and `src`. If a `src` url is detected
202
- * it will set the `src` property. Otherwise it assumes it's a built-in named
203
- * SVG and set the `name` property.
204
- */
205
- icon;
206
- /**
207
- * The size of the icon. `auto` automatically sizes according to the font-size of the parent element.
208
- * *Note*: size will be different on 'pictogram' and 'device' vs 'font awesome' icons.
209
- */
210
- size = 'auto';
211
- /**
212
- * If enabled, nano-icon will be loaded lazily when it's visible in the viewport.
213
- * Default, `true`.
214
- */
215
- lazy = true;
216
- loadIcon() {
217
- if (this.isVisible) {
218
- const url = getUrl(this);
219
- if (url) {
220
- if (iconContent.has(url)) {
221
- // sync if it's already loaded
222
- this.svgContent = iconContent.get(url);
223
- requestAnimationFrame(() => {
224
- this.isLoading = false;
225
- this.nanoLoad.emit();
226
- });
227
- }
228
- else {
229
- // async if it hasn't been loaded
230
- getSvgContent(url).then(() => {
231
- this.svgContent = iconContent.get(url);
232
- requestAnimationFrame(() => {
233
- this.isLoading = false;
234
- this.nanoLoad.emit();
235
- });
236
- this.setAriaLabel();
237
- }, () => {
238
- // error loading icon
239
- this.nanoError.emit();
240
- });
241
- }
242
- }
243
- }
244
- }
245
- /** Emitted when the icon has finished loading. */
246
- nanoLoad;
247
- /** Emitted when the icon fails to load. */
248
- nanoError;
249
- waitUntilVisible(el, rootMargin, cb) {
250
- if (this.lazy &&
251
- typeof window !== 'undefined' &&
252
- window.IntersectionObserver) {
253
- const io = (this.io = new window.IntersectionObserver((data) => {
254
- if (data[0].isIntersecting || (data[1] && data[1].isIntersecting)) {
255
- io.disconnect();
256
- this.io = undefined;
257
- cb();
258
- }
259
- }, { rootMargin }));
260
- io.observe(el);
261
- }
262
- else {
263
- // not a browser env (e.g. node)
264
- // or we're not loading lazily
265
- // or env doesn't support IntersectionObserver (testing?)
266
- // - immediately fetch icon
267
- cb();
268
- }
269
- }
270
- isRtl() {
271
- // doc is in rtl
272
- if (this.el.ownerDocument?.dir === 'rtl')
273
- return true;
274
- // html element is in rtl element
275
- if (this.el.closest('[dir="rtl"]'))
276
- return true;
277
- // nested in a shadow dom - see if that host element is contained in an rtl element
278
- const rootNode = this.el.getRootNode();
279
- const ownerHost = rootNode.host;
280
- if (ownerHost && ownerHost.closest('[dir="rtl"]'))
281
- return true;
282
- return false;
283
- }
284
- connectedCallback() {
285
- // purposely do not return the promise here because loading
286
- // the svg file should not hold up loading the app
287
- // only load the svg if it's visible
288
- this.waitUntilVisible(this.el, '50px', () => {
289
- this.isVisible = true;
290
- this.loadIcon();
291
- });
292
- }
293
- disconnectedCallback() {
294
- if (this.io) {
295
- this.io.disconnect();
296
- this.io = undefined;
297
- }
298
- }
299
- componentWillLoad() {
300
- this.updateRole();
301
- this.setAriaLabel();
302
- }
303
- render() {
304
- const flipRtl = this.flipRtl ||
305
- (this.name &&
306
- this.name.match(/right|left/) &&
307
- (this.name.indexOf('arrow') > -1 ||
308
- this.name.indexOf('chevron') > -1) &&
309
- this.isRtl());
310
- return (renderer.h(index.Host, { key: '754a53ed280fd9bcb1dcbec89eba4180f491d1b8', class: {
311
- loading: this.isLoading,
312
- 'flip-rtl': !!flipRtl,
313
- 'nano-icon': true,
314
- } }, this.svgContent ? (renderer.h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (renderer.h("div", { class: "icon-inner" }))));
315
- }
316
- static get assetsDirs() { return ["device", "pictogram"]; }
317
- static get watchers() { return {
318
- "role": ["setAriaLabel"],
319
- "ariaLabel": ["updateRole"],
320
- "name": ["loadIcon"],
321
- "src": ["loadIcon"],
322
- "icon": ["loadIcon"]
323
- }; }
324
- };
325
- Icon.style = iconCss;
326
-
327
10
  const iconButtonCss = ":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--border-radius:none;--active-color:var(--nano-color-neutral-800);--hover-color:var(--nano-color-primary-1100);--padding:var(--nano-spacing-xs);--box-shadow:none;--button-bg:transparent;color:currentcolor;border-radius:var(--border-radius);display:inline-block}.icon-button{flex:0 0 auto;display:flex;align-items:center;border:none;border-radius:inherit;background:inherit;font-size:inherit;color:inherit;padding:var(--padding);cursor:pointer;appearance:none;box-shadow:var(--box-shadow)}.icon-button:hover:not(.icon-button--disabled),.icon-button:focus:not(.icon-button--disabled){color:var(--hover-color)}.icon-button:active:not(.icon-button--disabled){color:var(--active-color)}.icon-button:focus-visible:not(.icon-button--disabled){outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}.icon-button__label{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}:host([disabled]:not([disabled=false])){opacity:0.5;cursor:not-allowed}.icon-button--disabled{pointer-events:none}";
328
11
 
329
12
  const IconButton = class {
@@ -638,10 +321,10 @@ const Tooltip = class {
638
321
  this.popover.destroy();
639
322
  }
640
323
  render() {
641
- return (renderer.h(index.Host, { key: '88500e56b7cc79e344604bfb9ffc54f2c7884c16', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick, class: "nano-tooltip" }, renderer.h("slot", { key: '6ff00a2034648eb7cde6bb7e7ba1bc0dcf611238', onSlotchange: this.handleSlotChange }), renderer.h("div", { key: 'e278b67db89953ef0a174b50f5aa28e101e8e83d', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner", popover: "manual" }, renderer.h("div", { key: '226bc518e38502e1a864c26a265abb01cfdb918e', part: "base", ref: (el) => (this.tooltip = el), class: {
324
+ return (renderer.h(index.Host, { key: '94758bb18228b14884cf2be79228e554de84013f', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick, class: "nano-tooltip" }, renderer.h("slot", { key: '45589386e68d89c21abbb50513678152e8bce9d1', onSlotchange: this.handleSlotChange }), renderer.h("div", { key: '6a76c101c35d45458f0a680753a381cc95631b87', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner", popover: "manual" }, renderer.h("div", { key: 'd3b2cc9c9018c9a0a5dc4cef256c8b9c568cd0b4', part: "base", ref: (el) => (this.tooltip = el), class: {
642
325
  tooltip: true,
643
326
  'tooltip--open': this.open,
644
- }, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, renderer.h("slot", { key: '6245d2904946b690c9c3ea4e902fa5d789473110', name: "content", onSlotchange: () => this.setLabel() }, this.content), renderer.h("div", { key: '8ddc4c34d70107ade21b7b53827d3c37e6744d2e', class: "tooltip-arrow", "data-popper-arrow": true })))));
327
+ }, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, renderer.h("slot", { key: '1c51cdc6a7ec88107e3290b0b9750198e7176c20', name: "content", onSlotchange: () => this.setLabel() }, this.content), renderer.h("div", { key: '00f090eee000e6bba713dc21a1d53c348eb94a76', class: "tooltip-arrow", "data-popper-arrow": true })))));
645
328
  }
646
329
  static get watchers() { return {
647
330
  "content": ["setLabel"],
@@ -650,6 +333,5 @@ const Tooltip = class {
650
333
  };
651
334
  Tooltip.style = tooltipCss;
652
335
 
653
- exports.nano_icon = Icon;
654
336
  exports.nano_icon_button = IconButton;
655
337
  exports.nano_tooltip = Tooltip;
@@ -0,0 +1,326 @@
1
+ /*!
2
+ * Custom elements for Nanopore-Digital Web applications
3
+ */
4
+ 'use strict';
5
+
6
+ var index = require('./index-DGttnXif.js');
7
+ var renderer = require('./renderer-B9M1kXq8.js');
8
+
9
+ let CACHED_MAP;
10
+ const getIconMap = () => {
11
+ if (!CACHED_MAP) {
12
+ const win = window;
13
+ win.Nanoicons = win.Nanoicons || {};
14
+ CACHED_MAP = win.Nanoicons.map = win.Nanoicons.map || new Map();
15
+ }
16
+ return CACHED_MAP;
17
+ };
18
+ const getUrl = (i) => {
19
+ let url = getSrc(i.src);
20
+ if (url)
21
+ return url;
22
+ url = getName(i.name, i.icon);
23
+ if (url)
24
+ return getNamedUrl(url);
25
+ if (i.icon) {
26
+ url = getSrc(i.icon);
27
+ if (url)
28
+ return url;
29
+ }
30
+ return null;
31
+ };
32
+ const getNamedUrl = (iconName) => {
33
+ const url = getIconMap().get(iconName);
34
+ if (url)
35
+ return url;
36
+ if (iconName.startsWith('device/') || iconName.startsWith('pictogram/')) {
37
+ return index.getAssetPath(`../nano-assets/icon/${iconName}.svg`);
38
+ }
39
+ return index.getAssetPath(`../nano-assets/fontawesome-pro/svgs/${iconName}.svg`);
40
+ };
41
+ const getName = (iconName, icon) => {
42
+ if (!iconName && icon && !isSrc(icon)) {
43
+ iconName = icon;
44
+ }
45
+ if (isStr(iconName)) {
46
+ iconName = toLower(iconName);
47
+ }
48
+ if (!isStr(iconName) || iconName.trim() === '') {
49
+ return null;
50
+ }
51
+ // only allow alpha characters and dash
52
+ const invalidChars = iconName.replace(/[a-z]|-|\/|\d/gi, '');
53
+ if (invalidChars !== '') {
54
+ console.warn('invalid characters in icon name ' + iconName);
55
+ return null;
56
+ }
57
+ return iconName;
58
+ };
59
+ const getSrc = (src) => {
60
+ if (isStr(src)) {
61
+ src = src.trim();
62
+ if (isSrc(src))
63
+ return src;
64
+ }
65
+ return null;
66
+ };
67
+ const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
68
+ const isStr = (val) => typeof val === 'string';
69
+ const toLower = (val) => val.toLowerCase();
70
+
71
+ const validateContent = (svgContent) => {
72
+ if (svgContent && document) {
73
+ const div = document.createElement('div');
74
+ div.innerHTML = svgContent;
75
+ // setup this way to ensure it works on our buddy IE
76
+ for (let i = div.childNodes.length - 1; i >= 0; i--) {
77
+ if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
78
+ div.removeChild(div.childNodes[i]);
79
+ }
80
+ }
81
+ // must only have 1 root element
82
+ const svgElm = div.firstElementChild;
83
+ if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
84
+ const svgClass = svgElm.getAttribute('class') || '';
85
+ svgElm.setAttribute('class', (svgClass + ' sc-nano-icon s-nano-icon svg').trim());
86
+ // root element must be an svg
87
+ // lets double check we've got valid elements
88
+ // do not allow scripts
89
+ if (isValid(svgElm)) {
90
+ return div.innerHTML;
91
+ }
92
+ }
93
+ }
94
+ return '';
95
+ };
96
+ const isValid = (elm) => {
97
+ if (elm.nodeType === 1) {
98
+ if (elm.nodeName.toLowerCase() === 'script') {
99
+ return false;
100
+ }
101
+ for (let i = 0; i < elm.attributes.length; i++) {
102
+ const val = elm.attributes[i].value;
103
+ if (isStr(val) && val.toLowerCase().indexOf('on') === 0) {
104
+ return false;
105
+ }
106
+ }
107
+ for (let i = 0; i < elm.childNodes.length; i++) {
108
+ if (!isValid(elm.childNodes[i])) {
109
+ return false;
110
+ }
111
+ }
112
+ }
113
+ return true;
114
+ };
115
+
116
+ const iconContent = new Map();
117
+ const requests = new Map();
118
+ const getSvgContent = (url) => {
119
+ // see if we already have a request for this url
120
+ let req = requests.get(url);
121
+ if (!req) {
122
+ // we don't already have a request
123
+ req = fetch(url).then((rsp) => {
124
+ if (rsp.ok) {
125
+ return rsp.text().then((svgContent) => {
126
+ iconContent.set(url, validateContent(svgContent));
127
+ });
128
+ }
129
+ iconContent.set(url, '');
130
+ });
131
+ // cache for the same requests
132
+ requests.set(url, req);
133
+ }
134
+ return req;
135
+ };
136
+
137
+ const iconCss = ":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--icon-size:1em;--primary-color:currentcolor\n --secondary-color: color-mix(in srgb, currentColor 50%, transparent);--primary-opacity:0.8;--secondary-opacity:1;display:inline-block;inline-size:var(--icon-size);block-size:var(--icon-size);min-inline-size:var(--icon-size);min-block-size:var(--icon-size);contain:strict;fill:currentcolor;box-sizing:content-box !important;transition:opacity 0.3s ease;color:currentcolor}:host .nanoicon{stroke:currentcolor}.nanoicon-fill-none{fill:none}.icon-inner,.nanoicon,svg,.svg{display:block;block-size:100%;inline-size:100%;overflow:visible}:host(.loading){opacity:0}.fa-primary{color:var(--primary-color);opacity:var(--primary-opacity, 1)}.fa-secondary{color:var(--secondary-color);opacity:var(--secondary-opacity) !important}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host([name^=pictogram]),:host([name^=device]){font-size:max(var(--nano-pictogram-size-medium), var(--icon-size))}:host([size=small][name^=pictogram]),:host([size=small][name^=device]){font-size:var(--nano-pictogram-size-small)}:host([size=regular]){font-size:var(--nano-icon-size-small)}:host([size=regular][name^=pictogram]),:host([size=regular][name^=device]){font-size:var(--nano-pictogram-size-medium)}:host([size=large]){font-size:var(--nano-icon-size-large)}:host([size=large][name^=pictogram]),:host([size=large][name^=device]){font-size:var(--nano-pictogram-size-large)}:host([size=xl][name^=pictogram]),:host([size=xl][name^=device]){font-size:var(--nano-pictogram-size-x-large)}:host([name^=pictogram]),:host([name^=device]),:host([color=primary]){color:var(--nano-color-primary-1100)}:host([color=neutral]){color:var(--nano-color-base-1000)}";
138
+
139
+ const Icon = class {
140
+ constructor(hostRef) {
141
+ index.registerInstance(this, hostRef);
142
+ this.nanoLoad = index.createEvent(this, "nanoLoad", 7);
143
+ this.nanoError = index.createEvent(this, "nanoError", 7);
144
+ }
145
+ io;
146
+ get el() { return index.getElement(this); }
147
+ svgContent;
148
+ isVisible = false;
149
+ isLoading = true;
150
+ /**
151
+ * Specifies the color of the icon. If not specified, the icon will inherit the color of the parent element.
152
+ */
153
+ color;
154
+ /**
155
+ * Specifies the role to use for accessibility. Defaults to 'presentation' (invisible to screen-readers)
156
+ */
157
+ role;
158
+ setAriaLabel() {
159
+ if (!this.ariaLabel && !this.el.ariaLabel) {
160
+ if (!this.role || this.role !== 'presentation') {
161
+ // if the role is not 'presentation' and the user did not explicitly set a role,
162
+ // let's try and derive one from the icon name
163
+ const label = getName(this.name, this.icon);
164
+ // user did not provide a label
165
+ // come up with the label based on the icon name
166
+ if (label) {
167
+ this.ariaLabel = label.split('/').slice(-1)[0].replace(/-/g, ' ');
168
+ }
169
+ }
170
+ }
171
+ else if (this.role === 'presentation') {
172
+ this.ariaLabel = undefined;
173
+ }
174
+ }
175
+ /**
176
+ * Specifies the label to use for accessibility. Defaults to the icon name.
177
+ */
178
+ ariaLabel;
179
+ updateRole() {
180
+ // force the role to be 'img' if the aria-label is explicitly set
181
+ if (this.ariaLabel)
182
+ this.role = 'img';
183
+ else if (!this.ariaLabel)
184
+ this.role = 'presentation';
185
+ }
186
+ /**
187
+ * Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
188
+ * By default, when an 'arrow' or 'chevron' icon is used, it will flip automatically when detecting `dir="rtl"` on the document or closest ancestor.
189
+ */
190
+ flipRtl;
191
+ /**
192
+ * Specifies which icon to use from the built-in set of icons.
193
+ */
194
+ name;
195
+ /**
196
+ * Specifies the exact `src` of an SVG file to use.
197
+ */
198
+ src;
199
+ /**
200
+ * A combination of both `name` and `src`. If a `src` url is detected
201
+ * it will set the `src` property. Otherwise it assumes it's a built-in named
202
+ * SVG and set the `name` property.
203
+ */
204
+ icon;
205
+ /**
206
+ * The size of the icon. `auto` automatically sizes according to the font-size of the parent element.
207
+ * *Note*: size will be different on 'pictogram' and 'device' vs 'font awesome' icons.
208
+ */
209
+ size = 'auto';
210
+ /**
211
+ * If enabled, nano-icon will be loaded lazily when it's visible in the viewport.
212
+ * Default, `true`.
213
+ */
214
+ lazy = true;
215
+ loadIcon() {
216
+ if (this.isVisible) {
217
+ const url = getUrl(this);
218
+ if (url) {
219
+ if (iconContent.has(url)) {
220
+ // sync if it's already loaded
221
+ this.svgContent = iconContent.get(url);
222
+ requestAnimationFrame(() => {
223
+ this.isLoading = false;
224
+ this.nanoLoad.emit();
225
+ });
226
+ }
227
+ else {
228
+ // async if it hasn't been loaded
229
+ getSvgContent(url).then(() => {
230
+ this.svgContent = iconContent.get(url);
231
+ requestAnimationFrame(() => {
232
+ this.isLoading = false;
233
+ this.nanoLoad.emit();
234
+ });
235
+ this.setAriaLabel();
236
+ }, () => {
237
+ // error loading icon
238
+ this.nanoError.emit();
239
+ });
240
+ }
241
+ }
242
+ }
243
+ }
244
+ /** Emitted when the icon has finished loading. */
245
+ nanoLoad;
246
+ /** Emitted when the icon fails to load. */
247
+ nanoError;
248
+ waitUntilVisible(el, rootMargin, cb) {
249
+ if (this.lazy &&
250
+ typeof window !== 'undefined' &&
251
+ window.IntersectionObserver) {
252
+ const io = (this.io = new window.IntersectionObserver((data) => {
253
+ if (data[0].isIntersecting || (data[1] && data[1].isIntersecting)) {
254
+ io.disconnect();
255
+ this.io = undefined;
256
+ cb();
257
+ }
258
+ }, { rootMargin }));
259
+ io.observe(el);
260
+ }
261
+ else {
262
+ // not a browser env (e.g. node)
263
+ // or we're not loading lazily
264
+ // or env doesn't support IntersectionObserver (testing?)
265
+ // - immediately fetch icon
266
+ cb();
267
+ }
268
+ }
269
+ isRtl() {
270
+ // doc is in rtl
271
+ if (this.el.ownerDocument?.dir === 'rtl')
272
+ return true;
273
+ // html element is in rtl element
274
+ if (this.el.closest('[dir="rtl"]'))
275
+ return true;
276
+ // nested in a shadow dom - see if that host element is contained in an rtl element
277
+ const rootNode = this.el.getRootNode();
278
+ const ownerHost = rootNode.host;
279
+ if (ownerHost && ownerHost.closest('[dir="rtl"]'))
280
+ return true;
281
+ return false;
282
+ }
283
+ connectedCallback() {
284
+ // purposely do not return the promise here because loading
285
+ // the svg file should not hold up loading the app
286
+ // only load the svg if it's visible
287
+ this.waitUntilVisible(this.el, '50px', () => {
288
+ this.isVisible = true;
289
+ this.loadIcon();
290
+ });
291
+ }
292
+ disconnectedCallback() {
293
+ if (this.io) {
294
+ this.io.disconnect();
295
+ this.io = undefined;
296
+ }
297
+ }
298
+ componentWillLoad() {
299
+ this.updateRole();
300
+ this.setAriaLabel();
301
+ }
302
+ render() {
303
+ const flipRtl = this.flipRtl ||
304
+ (this.name &&
305
+ this.name.match(/right|left/) &&
306
+ (this.name.indexOf('arrow') > -1 ||
307
+ this.name.indexOf('chevron') > -1) &&
308
+ this.isRtl());
309
+ return (renderer.h(index.Host, { key: '0bc1c17119f0e49b9798a1b61a4a768f6406129f', class: {
310
+ loading: this.isLoading,
311
+ 'flip-rtl': !!flipRtl,
312
+ 'nano-icon': true,
313
+ } }, this.svgContent ? (renderer.h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (renderer.h("div", { class: "icon-inner" }))));
314
+ }
315
+ static get assetsDirs() { return ["device", "pictogram"]; }
316
+ static get watchers() { return {
317
+ "role": ["setAriaLabel"],
318
+ "ariaLabel": ["updateRole"],
319
+ "name": ["loadIcon"],
320
+ "src": ["loadIcon"],
321
+ "icon": ["loadIcon"]
322
+ }; }
323
+ };
324
+ Icon.style = iconCss;
325
+
326
+ exports.nano_icon = Icon;
@@ -53,7 +53,7 @@ const NanoInPageNav = class {
53
53
  return node;
54
54
  }
55
55
  render() {
56
- return (renderer.h(index.Host, { key: '5fc7993edd48363da225ffce7e8d3dad8689e761', class: "nano-in-page-nav" }, renderer.h("nav", { key: '4cc75849661bb1e2fd144ac075a693ce9e5af58f', part: "root" }, (this.slotCtrl.has('back') || this.slotCtrl.has('accessory')) && (renderer.h("div", { key: '286df7a444423180967750017575414cce154b0d', class: "header" }, renderer.h("slot", { key: '255d81a0c2d26b0069a83a08e552e6afeb035295', name: "back" }), renderer.h("slot", { key: 'c939561b8be1b4a479e1f0c01684f5dd0a3014ce', name: "accessory" }))), renderer.h("div", { key: '411231a64e23575d76722f59446567f5cd68575e', class: "desktop-nav" }, renderer.h("slot", { key: '892a93de5de705e392b687ee62ab89c17bcc349a' })), renderer.h("nano-details", { key: '34d89f9f7927db1cb817124cf0d053f88963484c', label: "Menu", class: "details-wrapper mobile-nav", ref: (el) => (this.mobileNavWrapper = el) }))));
56
+ return (renderer.h(index.Host, { key: '8b88cd04f960c4c8ea7ae2dd79a6ec82694570e6', class: "nano-in-page-nav" }, renderer.h("nav", { key: '4df4a5ef8aecad356c6ad1acd9a6a886edce8139', part: "root" }, (this.slotCtrl.has('back') || this.slotCtrl.has('accessory')) && (renderer.h("div", { key: 'ed1315ac689d77ffd4005df5a6eeb01f3fc9f599', class: "header" }, renderer.h("slot", { key: '0db0fb3919268a14fb924b292302c563181e87c0', name: "back" }), renderer.h("slot", { key: '95a5fafda43239ef7cc9208efc254fb335bc9f66', name: "accessory" }))), renderer.h("div", { key: '5a273c033b193efe7d4c72c3ccfdbf30b4442eae', class: "desktop-nav" }, renderer.h("slot", { key: '7d0cff62b54d21daa5b8e7d9551a9d0ed08cfe6f' })), renderer.h("nano-details", { key: 'c337ce8ac65560e5914f8566304f9382540316f2', label: "Menu", class: "details-wrapper mobile-nav", ref: (el) => (this.mobileNavWrapper = el) }))));
57
57
  }
58
58
  };
59
59
  NanoInPageNav.style = inPageNavCss;