@nanoporetech-digital/components 3.5.1 → 3.7.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 (226) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/{date-utils-c581f187.js → date-utils-42fbcb42.js} +5 -3
  3. package/dist/cjs/date-utils-42fbcb42.js.map +1 -0
  4. package/dist/cjs/index-41582c2a.js +2 -6
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/nano-components.cjs.js +1 -1
  7. package/dist/cjs/nano-datalist_3.cjs.entry.js +10 -5
  8. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  9. package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
  10. package/dist/cjs/nano-date-picker.cjs.entry.js +1 -1
  11. package/dist/cjs/nano-demo.cjs.entry.js +3 -2
  12. package/dist/cjs/nano-demo.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nano-dropdown.cjs.entry.js +5 -2
  14. package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nano-file-upload.cjs.entry.js +4 -0
  16. package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +1 -2
  18. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nano-icon-button.cjs.entry.js +1 -1
  20. package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
  21. package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
  22. package/dist/cjs/{nano-tooltip.cjs.entry.js → nano-progress-bar_2.cjs.entry.js} +28 -4
  23. package/dist/cjs/nano-progress-bar_2.cjs.entry.js.map +1 -0
  24. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +74 -12
  25. package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nano-sticker.cjs.entry.js +2 -0
  27. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  28. package/dist/cjs/nano-tab-group.cjs.entry.js +1 -1
  29. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  30. package/dist/cjs/{nano-table-067e0c12.js → nano-table-56eb29c1.js} +172 -88
  31. package/dist/cjs/nano-table-56eb29c1.js.map +1 -0
  32. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  33. package/dist/cjs/{table.worker-a4d75c46.js → table.worker-b1c53001.js} +3 -3
  34. package/dist/cjs/table.worker-b1c53001.js.map +1 -0
  35. package/dist/{esm/table.worker-e9fb087e.js → cjs/table.worker-e2f9ccfa.js} +1 -1
  36. package/dist/collection/components/datalist/datalist.js +3 -3
  37. package/dist/collection/components/datalist/datalist.js.map +1 -1
  38. package/dist/collection/components/demo/demo.js +3 -2
  39. package/dist/collection/components/demo/demo.js.map +1 -1
  40. package/dist/collection/components/dropdown/dropdown.js +5 -2
  41. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  42. package/dist/collection/components/file-upload/file-upload.js +4 -0
  43. package/dist/collection/components/file-upload/file-upload.js.map +1 -1
  44. package/dist/collection/components/icon/icon.js +1 -1
  45. package/dist/collection/components/icon/icon.js.map +1 -1
  46. package/dist/collection/components/icon-button/icon-button.js +1 -1
  47. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  48. package/dist/collection/components/menu/menu.js +8 -3
  49. package/dist/collection/components/menu/menu.js.map +1 -1
  50. package/dist/collection/components/nav-item/nav-item.js +1 -2
  51. package/dist/collection/components/nav-item/nav-item.js.map +1 -1
  52. package/dist/collection/components/resize-observe/resize-observe.js +118 -14
  53. package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
  54. package/dist/collection/components/sticker/sticker.js +2 -0
  55. package/dist/collection/components/sticker/sticker.js.map +1 -1
  56. package/dist/collection/components/table/table-interface.js.map +1 -1
  57. package/dist/collection/components/table/table.cell.js +10 -5
  58. package/dist/collection/components/table/table.cell.js.map +1 -1
  59. package/dist/collection/components/table/table.css +9 -23
  60. package/dist/collection/components/table/table.js +236 -93
  61. package/dist/collection/components/table/table.js.map +1 -1
  62. package/dist/collection/components/table/table.row.js +19 -12
  63. package/dist/collection/components/table/table.row.js.map +1 -1
  64. package/dist/collection/components/table/table.store.js +1 -1
  65. package/dist/collection/components/table/table.store.js.map +1 -1
  66. package/dist/collection/components/table/table.utils.js +4 -4
  67. package/dist/collection/components/table/table.utils.js.map +1 -1
  68. package/dist/collection/components/table/table.worker.js +8 -0
  69. package/dist/collection/components/table/table.worker.js.map +1 -1
  70. package/dist/collection/components/tabs/tab-group.js +1 -1
  71. package/dist/collection/components/tabs/tab-group.js.map +1 -1
  72. package/dist/collection/components/tooltip/tooltip.js +25 -3
  73. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  74. package/dist/collection/utils/date-utils.js +4 -2
  75. package/dist/collection/utils/date-utils.js.map +1 -1
  76. package/dist/collection/utils/testing/index.js +15 -8
  77. package/dist/collection/utils/testing/index.js.map +1 -1
  78. package/dist/components/datalist.js +3 -3
  79. package/dist/components/datalist.js.map +1 -1
  80. package/dist/components/date-picker.js +4 -2
  81. package/dist/components/date-picker.js.map +1 -1
  82. package/dist/components/dropdown.js +5 -2
  83. package/dist/components/dropdown.js.map +1 -1
  84. package/dist/components/icon-button.js +1 -1
  85. package/dist/components/icon-button.js.map +1 -1
  86. package/dist/components/icon.js.map +1 -1
  87. package/dist/components/menu.js +8 -3
  88. package/dist/components/menu.js.map +1 -1
  89. package/dist/components/nano-demo.js +21 -14
  90. package/dist/components/nano-demo.js.map +1 -1
  91. package/dist/components/nano-file-upload.js +4 -0
  92. package/dist/components/nano-file-upload.js.map +1 -1
  93. package/dist/components/nano-tab-group.js +1 -1
  94. package/dist/components/nano-tab-group.js.map +1 -1
  95. package/dist/components/nav-item.js +1 -2
  96. package/dist/components/nav-item.js.map +1 -1
  97. package/dist/components/resize-observe.js +80 -14
  98. package/dist/components/resize-observe.js.map +1 -1
  99. package/dist/components/sticker.js +2 -0
  100. package/dist/components/sticker.js.map +1 -1
  101. package/dist/components/table.js +196 -103
  102. package/dist/components/table.js.map +1 -1
  103. package/dist/components/table.worker.js +1 -1
  104. package/dist/components/tooltip.js +6 -3
  105. package/dist/components/tooltip.js.map +1 -1
  106. package/dist/custom-elements/index.js +285 -120
  107. package/dist/custom-elements/index.js.map +1 -1
  108. package/dist/esm/{date-utils-bb82b123.js → date-utils-6b7a6e1f.js} +5 -3
  109. package/dist/esm/date-utils-6b7a6e1f.js.map +1 -0
  110. package/dist/esm/index-3c280603.js +2 -6
  111. package/dist/esm/loader.js +1 -1
  112. package/dist/esm/nano-components.js +1 -1
  113. package/dist/esm/nano-datalist_3.entry.js +10 -5
  114. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  115. package/dist/esm/nano-date-input.entry.js +1 -1
  116. package/dist/esm/nano-date-picker.entry.js +1 -1
  117. package/dist/esm/nano-demo.entry.js +3 -2
  118. package/dist/esm/nano-demo.entry.js.map +1 -1
  119. package/dist/esm/nano-dropdown.entry.js +5 -2
  120. package/dist/esm/nano-dropdown.entry.js.map +1 -1
  121. package/dist/esm/nano-file-upload.entry.js +4 -0
  122. package/dist/esm/nano-file-upload.entry.js.map +1 -1
  123. package/dist/esm/nano-global-nav-user-profile_3.entry.js +1 -2
  124. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  125. package/dist/esm/nano-icon-button.entry.js +1 -1
  126. package/dist/esm/nano-icon-button.entry.js.map +1 -1
  127. package/dist/esm/nano-icon.entry.js.map +1 -1
  128. package/dist/esm/{nano-tooltip.entry.js → nano-progress-bar_2.entry.js} +29 -6
  129. package/dist/esm/nano-progress-bar_2.entry.js.map +1 -0
  130. package/dist/esm/nano-resize-observe_2.entry.js +74 -12
  131. package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
  132. package/dist/esm/nano-sticker.entry.js +2 -0
  133. package/dist/esm/nano-sticker.entry.js.map +1 -1
  134. package/dist/esm/nano-tab-group.entry.js +1 -1
  135. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  136. package/dist/esm/{nano-table-95921f46.js → nano-table-38f3c797.js} +172 -88
  137. package/dist/esm/nano-table-38f3c797.js.map +1 -0
  138. package/dist/esm/nano-table.entry.js +1 -1
  139. package/dist/{nano-components/p-e9fb087e.js → esm/table.worker-e2f9ccfa.js} +1 -1
  140. package/dist/esm/{table.worker-769f1441.js → table.worker-e57fffd8.js} +3 -3
  141. package/dist/esm/table.worker-e57fffd8.js.map +1 -0
  142. package/dist/nano-components/nano-components.esm.js +1 -1
  143. package/dist/nano-components/nano-components.esm.js.map +1 -1
  144. package/dist/nano-components/p-0b29b22c.js +5 -0
  145. package/dist/nano-components/{p-26905bca.js.map → p-0b29b22c.js.map} +0 -0
  146. package/dist/nano-components/p-135fed16.entry.js +5 -0
  147. package/dist/nano-components/p-135fed16.entry.js.map +1 -0
  148. package/dist/nano-components/{p-2cb4615b.entry.js → p-2a97ef51.entry.js} +2 -2
  149. package/dist/nano-components/{p-2cb4615b.entry.js.map → p-2a97ef51.entry.js.map} +0 -0
  150. package/dist/nano-components/{p-751927d1.entry.js → p-3f25fc76.entry.js} +2 -2
  151. package/dist/nano-components/p-3f25fc76.entry.js.map +1 -0
  152. package/dist/nano-components/p-5d149792.entry.js +5 -0
  153. package/dist/nano-components/p-5d149792.entry.js.map +1 -0
  154. package/dist/nano-components/p-69e5a37d.entry.js.map +1 -1
  155. package/dist/nano-components/p-6ad194e4.entry.js +5 -0
  156. package/dist/nano-components/p-6ad194e4.entry.js.map +1 -0
  157. package/dist/nano-components/{p-46b348b7.entry.js → p-6cb77d5c.entry.js} +2 -2
  158. package/dist/nano-components/{p-46b348b7.entry.js.map → p-6cb77d5c.entry.js.map} +0 -0
  159. package/dist/nano-components/{p-85cfb0af.entry.js → p-9a4297e1.entry.js} +2 -2
  160. package/dist/nano-components/p-9a4297e1.entry.js.map +1 -0
  161. package/dist/nano-components/{p-d1c8eca4.entry.js → p-b55ffa92.entry.js} +2 -2
  162. package/dist/nano-components/p-b55ffa92.entry.js.map +1 -0
  163. package/dist/nano-components/{p-fb12a45d.entry.js → p-ba9cd047.entry.js} +2 -2
  164. package/dist/nano-components/{p-fb12a45d.entry.js.map → p-ba9cd047.entry.js.map} +0 -0
  165. package/dist/nano-components/p-cc5e7acb.entry.js +5 -0
  166. package/dist/nano-components/p-cc5e7acb.entry.js.map +1 -0
  167. package/dist/nano-components/p-cecb9af1.js +5 -0
  168. package/dist/nano-components/p-cecb9af1.js.map +1 -0
  169. package/dist/nano-components/p-d26b97d1.js +5 -0
  170. package/dist/nano-components/p-d26b97d1.js.map +1 -0
  171. package/dist/nano-components/{p-601e18d5.entry.js → p-d5303933.entry.js} +2 -2
  172. package/dist/nano-components/p-d5303933.entry.js.map +1 -0
  173. package/dist/nano-components/{p-4f0e14b5.entry.js → p-d565991d.entry.js} +2 -2
  174. package/dist/nano-components/p-d565991d.entry.js.map +1 -0
  175. package/dist/nano-components/{p-244223f0.entry.js → p-dc50b93c.entry.js} +2 -2
  176. package/dist/nano-components/p-dc50b93c.entry.js.map +1 -0
  177. package/dist/{cjs/table.worker-e9fb087e.js → nano-components/p-e2f9ccfa.js} +1 -1
  178. package/dist/types/components/icon/icon.d.ts +1 -1
  179. package/dist/types/components/menu/menu.d.ts +1 -0
  180. package/dist/types/components/resize-observe/resize-observe.d.ts +20 -1
  181. package/dist/types/components/table/table-interface.d.ts +35 -24
  182. package/dist/types/components/table/table.cell.d.ts +1 -1
  183. package/dist/types/components/table/table.d.ts +49 -15
  184. package/dist/types/components/table/table.row.d.ts +1 -1
  185. package/dist/types/components/table/table.store.d.ts +1 -1
  186. package/dist/types/components/table/table.utils.d.ts +1 -1
  187. package/dist/types/components/table/table.worker.d.ts +3 -3
  188. package/dist/types/components/tooltip/tooltip.d.ts +5 -0
  189. package/dist/types/components.d.ts +59 -14
  190. package/dist/types/utils/date-utils.d.ts +1 -1
  191. package/docs-json.json +179 -31
  192. package/docs-vscode.json +26 -3
  193. package/package.json +2 -2
  194. package/dist/cjs/date-utils-c581f187.js.map +0 -1
  195. package/dist/cjs/nano-progress-bar.cjs.entry.js +0 -33
  196. package/dist/cjs/nano-progress-bar.cjs.entry.js.map +0 -1
  197. package/dist/cjs/nano-table-067e0c12.js.map +0 -1
  198. package/dist/cjs/nano-tooltip.cjs.entry.js.map +0 -1
  199. package/dist/cjs/table.worker-a4d75c46.js.map +0 -1
  200. package/dist/esm/date-utils-bb82b123.js.map +0 -1
  201. package/dist/esm/nano-progress-bar.entry.js +0 -29
  202. package/dist/esm/nano-progress-bar.entry.js.map +0 -1
  203. package/dist/esm/nano-table-95921f46.js.map +0 -1
  204. package/dist/esm/nano-tooltip.entry.js.map +0 -1
  205. package/dist/esm/table.worker-769f1441.js.map +0 -1
  206. package/dist/nano-components/p-15a60f7e.js +0 -5
  207. package/dist/nano-components/p-15a60f7e.js.map +0 -1
  208. package/dist/nano-components/p-244223f0.entry.js.map +0 -1
  209. package/dist/nano-components/p-26905bca.js +0 -5
  210. package/dist/nano-components/p-4f0e14b5.entry.js.map +0 -1
  211. package/dist/nano-components/p-601e18d5.entry.js.map +0 -1
  212. package/dist/nano-components/p-751927d1.entry.js.map +0 -1
  213. package/dist/nano-components/p-85cfb0af.entry.js.map +0 -1
  214. package/dist/nano-components/p-8fc2a38d.js +0 -5
  215. package/dist/nano-components/p-8fc2a38d.js.map +0 -1
  216. package/dist/nano-components/p-9e8c9bac.entry.js +0 -5
  217. package/dist/nano-components/p-9e8c9bac.entry.js.map +0 -1
  218. package/dist/nano-components/p-a2e38472.entry.js +0 -5
  219. package/dist/nano-components/p-a2e38472.entry.js.map +0 -1
  220. package/dist/nano-components/p-b9c8b99f.entry.js +0 -5
  221. package/dist/nano-components/p-b9c8b99f.entry.js.map +0 -1
  222. package/dist/nano-components/p-d1c8eca4.entry.js.map +0 -1
  223. package/dist/nano-components/p-f43d1d8e.entry.js +0 -5
  224. package/dist/nano-components/p-f43d1d8e.entry.js.map +0 -1
  225. package/dist/nano-components/p-feb9f164.entry.js +0 -5
  226. package/dist/nano-components/p-feb9f164.entry.js.map +0 -1
package/docs-json.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2022-12-14T12:36:55",
2
+ "timestamp": "2023-01-10T23:15:45",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.19.4",
@@ -3941,7 +3941,8 @@
3941
3941
  "nano-progress-bar",
3942
3942
  "nano-skeleton",
3943
3943
  "nano-spinner",
3944
- "nano-icon"
3944
+ "nano-icon",
3945
+ "nano-tooltip"
3945
3946
  ]
3946
3947
  }
3947
3948
  },
@@ -7839,7 +7840,7 @@
7839
7840
  "mutable": false,
7840
7841
  "attr": "lazy",
7841
7842
  "reflectToAttr": false,
7842
- "docs": "If enabled, nano-icon will be loaded lazily when it's visible in the viewport.\nDefault, `false`.",
7843
+ "docs": "If enabled, nano-icon will be loaded lazily when it's visible in the viewport.\nDefault, `true`.",
7843
7844
  "docsTags": [],
7844
7845
  "default": "true",
7845
7846
  "values": [
@@ -11542,18 +11543,61 @@
11542
11543
  },
11543
11544
  {
11544
11545
  "filePath": "./src/components/resize-observe/resize-observe.tsx",
11545
- "encapsulation": "none",
11546
+ "encapsulation": "shadow",
11546
11547
  "tag": "nano-resize-observe",
11547
11548
  "readme": "# nano-resize-observe\n\n\n",
11548
- "docs": "A Resize-Observer utility component.\nTakes a string list of sizes and optional class-names. Adds class-names and fires `nanoResizeStateChange` events when the component reaches those sizes.",
11549
+ "docs": "A Resize-Observer utility component.\nTakes a string list of sizes and optional class-names.\nAdds class-names and fires `nanoResizeStateChange` events when the component reaches those sizes.\nAdditionally, can fire events when content no-longer fits within the element.",
11549
11550
  "docsTags": [
11550
11551
  {
11551
11552
  "name": "slot",
11552
11553
  "text": "- Main slot for any content."
11554
+ },
11555
+ {
11556
+ "name": "slot",
11557
+ "text": "content-fit-x - optional slot (when `notifyContentFit` is set). Shows when content fits / doesn't get cut off"
11558
+ },
11559
+ {
11560
+ "name": "slot",
11561
+ "text": "content-nofit-x - optional slot (when `notifyContentFit` is set). Shows when content doesn't get cut off"
11562
+ },
11563
+ {
11564
+ "name": "slot",
11565
+ "text": "content-fit-y - optional slot (when `notifyContentFit` is set). Shows when content fits / doesn't get cut off"
11566
+ },
11567
+ {
11568
+ "name": "slot",
11569
+ "text": "content-nofit-y - optional slot (when `notifyContentFit` is set). Shows when content doesn't get cut off"
11553
11570
  }
11554
11571
  ],
11555
11572
  "usage": {},
11556
11573
  "props": [
11574
+ {
11575
+ "name": "notifyContentFit",
11576
+ "type": "\"x\" | \"xy\" | \"y\"",
11577
+ "mutable": false,
11578
+ "attr": "notify-content-fit",
11579
+ "reflectToAttr": false,
11580
+ "docs": "Fire `nanoResizeContentFitChange` events notifying\nwhether content currently fits or does not on the x, y or both axis'.\nAlso makes the `content-fit-...` slots available",
11581
+ "docsTags": [],
11582
+ "values": [
11583
+ {
11584
+ "value": "x",
11585
+ "type": "string"
11586
+ },
11587
+ {
11588
+ "value": "xy",
11589
+ "type": "string"
11590
+ },
11591
+ {
11592
+ "value": "y",
11593
+ "type": "string"
11594
+ }
11595
+ ],
11596
+ "optional": false,
11597
+ "required": false,
11598
+ "getter": false,
11599
+ "setter": false
11600
+ },
11557
11601
  {
11558
11602
  "name": "states",
11559
11603
  "type": "string",
@@ -11575,6 +11619,15 @@
11575
11619
  ],
11576
11620
  "methods": [],
11577
11621
  "events": [
11622
+ {
11623
+ "event": "nanoResizeContentFitChange",
11624
+ "detail": "{ x: boolean; y: boolean; }",
11625
+ "bubbles": true,
11626
+ "cancelable": true,
11627
+ "composed": true,
11628
+ "docs": "Fires when the content either begins or stops to fit. Will only work when `notifyContentFit` is set.",
11629
+ "docsTags": []
11630
+ },
11578
11631
  {
11579
11632
  "event": "nanoResizeObserverReady",
11580
11633
  "detail": "void",
@@ -11600,6 +11653,22 @@
11600
11653
  {
11601
11654
  "name": "",
11602
11655
  "docs": "Main slot for any content."
11656
+ },
11657
+ {
11658
+ "name": "content-fit-x",
11659
+ "docs": "optional slot (when `notifyContentFit` is set). Shows when content fits / doesn't get cut off"
11660
+ },
11661
+ {
11662
+ "name": "content-fit-y",
11663
+ "docs": "optional slot (when `notifyContentFit` is set). Shows when content fits / doesn't get cut off"
11664
+ },
11665
+ {
11666
+ "name": "content-nofit-x",
11667
+ "docs": "optional slot (when `notifyContentFit` is set). Shows when content doesn't get cut off"
11668
+ },
11669
+ {
11670
+ "name": "content-nofit-y",
11671
+ "docs": "optional slot (when `notifyContentFit` is set). Shows when content doesn't get cut off"
11603
11672
  }
11604
11673
  ],
11605
11674
  "parts": [],
@@ -14734,15 +14803,15 @@
14734
14803
  },
14735
14804
  {
14736
14805
  "name": "columns",
14737
- "type": "ColumnConfig<RowData>[]",
14806
+ "type": "ColumnConfig<RowGeneric>[]",
14738
14807
  "mutable": true,
14739
14808
  "reflectToAttr": false,
14740
- "docs": "The column config used to generate present the rows of data",
14809
+ "docs": "The column config used to present the rows of data",
14741
14810
  "docsTags": [],
14742
14811
  "default": "[]",
14743
14812
  "values": [
14744
14813
  {
14745
- "type": "ColumnConfig<RowData>[]"
14814
+ "type": "ColumnConfig<RowGeneric>[]"
14746
14815
  }
14747
14816
  ],
14748
14817
  "optional": false,
@@ -14752,14 +14821,17 @@
14752
14821
  },
14753
14822
  {
14754
14823
  "name": "customFilterFn",
14755
- "type": "(filters: Filter[]) => Promise<void>",
14824
+ "type": "(filters: Filter[]) => Promise<true | Falsy>",
14756
14825
  "mutable": false,
14757
14826
  "reflectToAttr": false,
14758
- "docs": "A custom filtering function. Should return a promise.\nOn successful completion the column UI will be updated.\nA good use-case would be performing the filter on a server / via fetch.\nThen on success, updating the table's data via the `rows` property",
14827
+ "docs": "A custom filtering function. Should return a promise.\nIf the promise resolves as `true` the column UI will be updated.\nIf the promise resolves as falsey, the sort will be performed by the component.\nA good use-case would be performing the filter on a server / via fetch.\nThen on success, updating the table's data via the `rows` property",
14759
14828
  "docsTags": [],
14760
14829
  "values": [
14761
14830
  {
14762
- "type": "(filters: Filter[]) => Promise<void>"
14831
+ "type": "(filters: Filter[]) => Promise<true"
14832
+ },
14833
+ {
14834
+ "type": "Falsy>"
14763
14835
  }
14764
14836
  ],
14765
14837
  "optional": true,
@@ -14769,14 +14841,17 @@
14769
14841
  },
14770
14842
  {
14771
14843
  "name": "customSortFn",
14772
- "type": "(property: keyof RowData, order: Order) => Promise<void>",
14844
+ "type": "(property: keyof RowGeneric, order: Order) => Promise<true | Falsy>",
14773
14845
  "mutable": false,
14774
14846
  "reflectToAttr": false,
14775
- "docs": "A custom sorting function. Should return a promise.\nOn successful completion the column UI will be updated.\nA good use-case would be performing the sort on a server / via fetch.\nThen on success, updating the table's data via the `rows` property",
14847
+ "docs": "A custom sorting function. Should return a promise.\nIf the promise resolves as `true` the column UI will be updated.\nIf the promise resolves as falsey, the sort will be performed by the component.\nA good use-case would be performing the sort on a server / via fetch.\nThen on success, updating the table's data via the `rows` property",
14776
14848
  "docsTags": [],
14777
14849
  "values": [
14778
14850
  {
14779
- "type": "(property: keyof RowData, order: Order) => Promise<void>"
14851
+ "type": "(property: keyof RowGeneric, order: Order) => Promise<true"
14852
+ },
14853
+ {
14854
+ "type": "Falsy>"
14780
14855
  }
14781
14856
  ],
14782
14857
  "optional": true,
@@ -14864,9 +14939,9 @@
14864
14939
  "mutable": false,
14865
14940
  "attr": "loading",
14866
14941
  "reflectToAttr": false,
14867
- "docs": "Will show a loading state when true.\nWill be shown automatically if `rows` is a promise waiting to resolve\nor when performing custom filtering or sorting",
14942
+ "docs": "Will show a loading state when set to true.\nBy default, will be shown automatically if `rows` is a promise waiting to resolve\nor when performing custom filtering or sorting.\n*Note* when set manually, will overwrite any internal loading state.\nSet to 'undefined' to revert to default behaviour.",
14868
14943
  "docsTags": [],
14869
- "default": "false",
14944
+ "default": "undefined",
14870
14945
  "values": [
14871
14946
  {
14872
14947
  "type": "boolean"
@@ -14874,8 +14949,8 @@
14874
14949
  ],
14875
14950
  "optional": false,
14876
14951
  "required": false,
14877
- "getter": true,
14878
- "setter": true
14952
+ "getter": false,
14953
+ "setter": false
14879
14954
  },
14880
14955
  {
14881
14956
  "name": "perBlock",
@@ -14917,14 +14992,14 @@
14917
14992
  },
14918
14993
  {
14919
14994
  "name": "rowRender",
14920
- "type": "RowRenderer",
14995
+ "type": "RowRenderer<RowData<RowGeneric>>",
14921
14996
  "mutable": false,
14922
14997
  "reflectToAttr": false,
14923
14998
  "docs": "Used for custom row rendering",
14924
14999
  "docsTags": [],
14925
15000
  "values": [
14926
15001
  {
14927
- "type": "RowRenderer"
15002
+ "type": "RowRenderer<RowData<RowGeneric>>"
14928
15003
  }
14929
15004
  ],
14930
15005
  "optional": false,
@@ -14934,17 +15009,17 @@
14934
15009
  },
14935
15010
  {
14936
15011
  "name": "rows",
14937
- "type": "Promise<RowData[]> | RowData[]",
14938
- "mutable": false,
15012
+ "type": "Promise<RowGeneric[]> | RowGeneric[]",
15013
+ "mutable": true,
14939
15014
  "reflectToAttr": false,
14940
15015
  "docs": "The data to place in the table",
14941
15016
  "docsTags": [],
14942
15017
  "values": [
14943
15018
  {
14944
- "type": "Promise<RowData[]>"
15019
+ "type": "Promise<RowGeneric[]>"
14945
15020
  },
14946
15021
  {
14947
- "type": "RowData[]"
15022
+ "type": "RowGeneric[]"
14948
15023
  }
14949
15024
  ],
14950
15025
  "optional": false,
@@ -15031,6 +15106,25 @@
15031
15106
  "required": false,
15032
15107
  "getter": false,
15033
15108
  "setter": false
15109
+ },
15110
+ {
15111
+ "name": "virtualTotalItems",
15112
+ "type": "number",
15113
+ "mutable": false,
15114
+ "attr": "virtual-total-items",
15115
+ "reflectToAttr": false,
15116
+ "docs": "Use this to render the table with roughly the correct dimensions.\na use-case might be; fetch a small initial dataset to minimise load-time,\nrender the table with the correct dimensions, the table becomes interactive,\nload the rest of the data",
15117
+ "docsTags": [],
15118
+ "default": "0",
15119
+ "values": [
15120
+ {
15121
+ "type": "number"
15122
+ }
15123
+ ],
15124
+ "optional": false,
15125
+ "required": false,
15126
+ "getter": false,
15127
+ "setter": false
15034
15128
  }
15035
15129
  ],
15036
15130
  "methods": [
@@ -15125,6 +15219,26 @@
15125
15219
  "text": "a promise which resolves when complete"
15126
15220
  }
15127
15221
  ]
15222
+ },
15223
+ {
15224
+ "name": "updateRow",
15225
+ "returns": {
15226
+ "type": "Promise<void>",
15227
+ "docs": ""
15228
+ },
15229
+ "signature": "updateRow(row: TableTypes.RowData, rowIndex: number) => Promise<void>",
15230
+ "parameters": [],
15231
+ "docs": "Updates a row model at a given index",
15232
+ "docsTags": [
15233
+ {
15234
+ "name": "param",
15235
+ "text": "row - the row to update.\n*Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property\n- rows are augmented with certain properties to aid with efficient rendering"
15236
+ },
15237
+ {
15238
+ "name": "param",
15239
+ "text": "rowIndex - the row index to insert this row"
15240
+ }
15241
+ ]
15128
15242
  }
15129
15243
  ],
15130
15244
  "events": [
@@ -15148,13 +15262,22 @@
15148
15262
  },
15149
15263
  {
15150
15264
  "event": "nanoTblAfterSort",
15151
- "detail": "{ column: keyof RowData; order: Order; }",
15265
+ "detail": "{ column: keyof RowGeneric; order: Order; }",
15152
15266
  "bubbles": true,
15153
15267
  "cancelable": true,
15154
15268
  "composed": true,
15155
15269
  "docs": "Fired after a column is sorted",
15156
15270
  "docsTags": []
15157
15271
  },
15272
+ {
15273
+ "event": "nanoTblBeforeEdit",
15274
+ "detail": "{ term: string; }",
15275
+ "bubbles": true,
15276
+ "cancelable": true,
15277
+ "composed": true,
15278
+ "docs": "Fired before a general search.\n`event.preventDefault()` to stop searching.",
15279
+ "docsTags": []
15280
+ },
15158
15281
  {
15159
15282
  "event": "nanoTblBeforeFilter",
15160
15283
  "detail": "{ filters: Filter[]; }",
@@ -15175,7 +15298,7 @@
15175
15298
  },
15176
15299
  {
15177
15300
  "event": "nanoTblBeforeSort",
15178
- "detail": "{ column: keyof RowData; order: Order; }",
15301
+ "detail": "{ column: keyof RowGeneric; order: Order; }",
15179
15302
  "bubbles": true,
15180
15303
  "cancelable": true,
15181
15304
  "composed": true,
@@ -15193,7 +15316,7 @@
15193
15316
  },
15194
15317
  {
15195
15318
  "event": "nanoTblColDrag",
15196
- "detail": "{ column: keyof RowData; }",
15319
+ "detail": "{ column: keyof RowGeneric; }",
15197
15320
  "bubbles": true,
15198
15321
  "cancelable": true,
15199
15322
  "composed": true,
@@ -15202,7 +15325,7 @@
15202
15325
  },
15203
15326
  {
15204
15327
  "event": "nanoTblColDrop",
15205
- "detail": "{ fromCol: keyof RowData; toCol: keyof RowData; fromIndex: number; toIndex: number; }",
15328
+ "detail": "{ fromCol: keyof RowGeneric; toCol: keyof RowGeneric; fromIndex: number; toIndex: number; }",
15206
15329
  "bubbles": true,
15207
15330
  "cancelable": true,
15208
15331
  "composed": true,
@@ -15398,7 +15521,8 @@
15398
15521
  "nano-progress-bar",
15399
15522
  "nano-skeleton",
15400
15523
  "nano-spinner",
15401
- "nano-icon"
15524
+ "nano-icon",
15525
+ "nano-tooltip"
15402
15526
  ],
15403
15527
  "dependencyGraph": {
15404
15528
  "nano-table": [
@@ -15406,7 +15530,8 @@
15406
15530
  "nano-progress-bar",
15407
15531
  "nano-skeleton",
15408
15532
  "nano-spinner",
15409
- "nano-icon"
15533
+ "nano-icon",
15534
+ "nano-tooltip"
15410
15535
  ],
15411
15536
  "nano-demo": [
15412
15537
  "nano-table"
@@ -15488,6 +15613,25 @@
15488
15613
  "getter": false,
15489
15614
  "setter": false
15490
15615
  },
15616
+ {
15617
+ "name": "hoist",
15618
+ "type": "boolean",
15619
+ "mutable": false,
15620
+ "attr": "hoist",
15621
+ "reflectToAttr": false,
15622
+ "docs": "Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`.",
15623
+ "docsTags": [],
15624
+ "default": "false",
15625
+ "values": [
15626
+ {
15627
+ "type": "boolean"
15628
+ }
15629
+ ],
15630
+ "optional": false,
15631
+ "required": false,
15632
+ "getter": false,
15633
+ "setter": false
15634
+ },
15491
15635
  {
15492
15636
  "name": "open",
15493
15637
  "type": "boolean",
@@ -15727,12 +15871,16 @@
15727
15871
  }
15728
15872
  ],
15729
15873
  "dependents": [
15730
- "nano-file-upload"
15874
+ "nano-file-upload",
15875
+ "nano-table"
15731
15876
  ],
15732
15877
  "dependencies": [],
15733
15878
  "dependencyGraph": {
15734
15879
  "nano-file-upload": [
15735
15880
  "nano-tooltip"
15881
+ ],
15882
+ "nano-table": [
15883
+ "nano-tooltip"
15736
15884
  ]
15737
15885
  }
15738
15886
  }
package/docs-vscode.json CHANGED
@@ -1484,7 +1484,7 @@
1484
1484
  },
1485
1485
  {
1486
1486
  "name": "lazy",
1487
- "description": "If enabled, nano-icon will be loaded lazily when it's visible in the viewport.\nDefault, `false`."
1487
+ "description": "If enabled, nano-icon will be loaded lazily when it's visible in the viewport.\nDefault, `true`."
1488
1488
  },
1489
1489
  {
1490
1490
  "name": "name",
@@ -2187,9 +2187,24 @@
2187
2187
  "name": "nano-resize-observe",
2188
2188
  "description": {
2189
2189
  "kind": "markdown",
2190
- "value": "A Resize-Observer utility component.\nTakes a string list of sizes and optional class-names. Adds class-names and fires `nanoResizeStateChange` events when the component reaches those sizes."
2190
+ "value": "A Resize-Observer utility component.\nTakes a string list of sizes and optional class-names.\nAdds class-names and fires `nanoResizeStateChange` events when the component reaches those sizes.\nAdditionally, can fire events when content no-longer fits within the element."
2191
2191
  },
2192
2192
  "attributes": [
2193
+ {
2194
+ "name": "notify-content-fit",
2195
+ "description": "Fire `nanoResizeContentFitChange` events notifying\nwhether content currently fits or does not on the x, y or both axis'.\nAlso makes the `content-fit-...` slots available",
2196
+ "values": [
2197
+ {
2198
+ "name": "x"
2199
+ },
2200
+ {
2201
+ "name": "xy"
2202
+ },
2203
+ {
2204
+ "name": "y"
2205
+ }
2206
+ ]
2207
+ },
2193
2208
  {
2194
2209
  "name": "states",
2195
2210
  "description": "string list of sizes and optional class-names. Adds class-names and fires nanoResizeStateChange events. Upon hitting breakpoints.\nFormat: `states=\"800w, 300h class1 class2\"`"
@@ -2707,7 +2722,7 @@
2707
2722
  },
2708
2723
  {
2709
2724
  "name": "loading",
2710
- "description": "Will show a loading state when true.\nWill be shown automatically if `rows` is a promise waiting to resolve\nor when performing custom filtering or sorting"
2725
+ "description": "Will show a loading state when set to true.\nBy default, will be shown automatically if `rows` is a promise waiting to resolve\nor when performing custom filtering or sorting.\n*Note* when set manually, will overwrite any internal loading state.\nSet to 'undefined' to revert to default behaviour."
2711
2726
  },
2712
2727
  {
2713
2728
  "name": "per-block",
@@ -2740,6 +2755,10 @@
2740
2755
  "name": "table"
2741
2756
  }
2742
2757
  ]
2758
+ },
2759
+ {
2760
+ "name": "virtual-total-items",
2761
+ "description": "Use this to render the table with roughly the correct dimensions.\na use-case might be; fetch a small initial dataset to minimise load-time,\nrender the table with the correct dimensions, the table becomes interactive,\nload the rest of the data"
2743
2762
  }
2744
2763
  ]
2745
2764
  },
@@ -2762,6 +2781,10 @@
2762
2781
  "name": "distance",
2763
2782
  "description": "The distance in pixels from which to offset the tooltip away from its target."
2764
2783
  },
2784
+ {
2785
+ "name": "hoist",
2786
+ "description": "Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`."
2787
+ },
2765
2788
  {
2766
2789
  "name": "open",
2767
2790
  "description": "Indicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanoporetech-digital/components",
3
- "version": "3.5.1",
3
+ "version": "3.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://git.oxfordnanolabs.local/Digital/nano-components"
@@ -124,5 +124,5 @@
124
124
  "nanopore",
125
125
  "digital"
126
126
  ],
127
- "gitHead": "3c734e80f6553e5b8283ed766395a0587256cc4d"
127
+ "gitHead": "7e820bab43e6f12191ba96ff4f24105c24db1402"
128
128
  }
@@ -1 +0,0 @@
1
- {"file":"date-utils-c581f187.js","mapp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A6BA,kBAAU,CAAC,MAAM;EAE9C,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC;EAC9D,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC;EAExD,OAAO,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACpC;;;;;;;;;;;;;;;;;","names":["DaysOfWeek"],"sources":["./src/utils/date-utils.ts"],"sourcesContent":["const ISO_DATE_FORMAT = /^(\\d{4})-(\\d{2})-(\\d{2})/;\n\nexport enum DaysOfWeek {\n Sunday = 0,\n Monday = 1,\n Tuesday = 2,\n Wednesday = 3,\n Thursday = 4,\n Friday = 5,\n Saturday = 6,\n}\n\n/**\n * @param year\n * @param month\n * @param day\n * @returns a new Date objecy\n */\nexport function createDate(year: string, month: string, day: string): Date {\n const dayInt = parseInt(day, 10);\n const monthInt = parseInt(month, 10);\n const yearInt = parseInt(year, 10);\n\n const isValid =\n Number.isInteger(yearInt) && // all parts should be integers\n Number.isInteger(monthInt) &&\n Number.isInteger(dayInt) &&\n monthInt > 0 && // month must be 1-12\n monthInt <= 12 &&\n dayInt > 0 && // day must be 1-31\n dayInt <= 31 &&\n yearInt > 0;\n\n if (isValid) {\n return new Date(yearInt, monthInt - 1, dayInt);\n }\n}\n\n/**\n * @param value date string in ISO format YYYY-MM-DD\n * @returns an ISO Date object\n */\nexport function parseISODate(value: string): Date {\n if (!value) return;\n const matches = value.match(ISO_DATE_FORMAT);\n if (matches) {\n return createDate(matches[1], matches[2], matches[3]);\n }\n}\n\n/**\n * print date in format YYYY-MM-DD\n * @param date\n * @returns an iso date string\n */\nexport function printISODate(date: Date): string {\n if (!date) return '';\n\n let d = date.getDate().toString(10);\n let m = (date.getMonth() + 1).toString(10);\n const y = date.getFullYear().toString(10);\n\n // days are not zero-indexed, so pad if less than 10\n if (date.getDate() < 10) {\n d = `0${d}`;\n }\n\n // months *are* zero-indexed, pad if less than 9!\n if (date.getMonth() < 9) {\n m = `0${m}`;\n }\n\n return `${y}-${m}-${d}`;\n}\n\n/**\n * Compare if two dates are equal in terms of day, month, and year\n * @param a date to compare\n * @param b date to compare\n * @returns boolean\n */\nexport function isEqual(a: Date, b: Date): boolean {\n if (a == null || b == null) return false;\n return (\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n );\n}\n\n/**\n * Add days to a date\n * @param date\n * @param days\n * @returns a new Date\n */\nexport function addDays(date: Date, days: number): Date {\n const d = new Date(date);\n d.setDate(d.getDate() + days);\n return d;\n}\n\n/**\n * Add months to a date\n * @param date\n * @param months\n * @returns a new Date\n */\nexport function addMonths(date: Date, months: number): Date {\n const d = new Date(date);\n d.setMonth(date.getMonth() + months);\n return d;\n}\n\n/**\n * Add years to a date\n * @param date\n * @param years\n * @returns a new Date\n */\nexport function addYears(date: Date, years: number): Date {\n const d = new Date(date);\n d.setFullYear(date.getFullYear() + years);\n return d;\n}\n\n/**\n * Takes a date and a day enum and finds the first day of that date's week\n * @param date\n * @param firstDayOfWeek\n * @returns the first day of a date's week\n */\nexport function startOfWeek(\n date: Date,\n firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday\n): Date {\n const d = new Date(date);\n const day = d.getDay();\n const diff = (day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek;\n\n d.setDate(d.getDate() - diff);\n return d;\n}\n\n/**\n * Takes a date and a day enum and finds the last day of that date's week\n * @param date\n * @param firstDayOfWeek\n * @returns the last day of that date's week\n */\nexport function endOfWeek(\n date: Date,\n firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday\n): Date {\n const d = new Date(date);\n const day = d.getDay();\n const diff = (day < firstDayOfWeek ? -7 : 0) + 6 - (day - firstDayOfWeek);\n\n d.setDate(d.getDate() + diff);\n return d;\n}\n\n/**\n * Get the date of the start of the month\n * @param date\n * @returns start of the month Date\n */\nexport function startOfMonth(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), 1);\n}\n\n/**\n * Get the date of the end of the month\n * @param date\n * @returns end of the month Date\n */\nexport function endOfMonth(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0);\n}\n\n/**\n * Changes a dates' month\n * @param date\n * @param month\n * @returns a new Date with the new month set\n */\nexport function setMonth(date: Date, month: number): Date {\n const d = new Date(date);\n d.setMonth(month);\n return d;\n}\n\n/**\n * Changes a dates' year\n * @param date\n * @param year\n * @returns a new Date with the new year set\n */\nexport function setYear(date: Date, year: number): Date {\n const d = new Date(date);\n d.setFullYear(year);\n return d;\n}\n\n/**\n * Check if date is within a min and max\n * @param date\n * @param min\n * @param max\n * @returns boolean\n */\nexport function inRange(date: Date, min?: Date, max?: Date): boolean {\n return dateClamp(date, min, max) === date;\n}\n\n/**\n * Ensures date is within range, returns min or max if out of bounds\n * @param date\n * @param min\n * @param max\n * @returns the clamped date\n */\nexport function dateClamp(date: Date, min?: Date, max?: Date): Date {\n const time = date.getTime();\n\n if (min && min instanceof Date && time < min.getTime()) {\n return min;\n }\n if (max && max instanceof Date && time > max.getTime()) {\n return max;\n }\n return date;\n}\n\n/**\n * Given start and end date, return an (inclusive) array of all dates in between\n * @param start\n * @param end\n * @returns an array of Date objects in the range\n */\nfunction getDaysInRange(start: Date, end: Date): Date[] {\n const days: Date[] = [];\n let current = start;\n\n while (!isEqual(current, end)) {\n days.push(current);\n current = addDays(current, 1);\n }\n\n days.push(current);\n\n return days;\n}\n\n/**\n * Given a date, return an array of dates from a calendar perspective\n * @param date\n * @param firstDayOfWeek\n * @returns an array of Date objects in the month range\n */\nexport function getViewOfMonth(\n date: Date,\n firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday\n): Date[] {\n const start = startOfWeek(startOfMonth(date), firstDayOfWeek);\n const end = endOfWeek(endOfMonth(date), firstDayOfWeek);\n\n return getDaysInRange(start, end);\n}\n"],"version":3}
@@ -1,33 +0,0 @@
1
- /*!
2
- * Web Components for Nanopore digital Web Apps
3
- */
4
- 'use strict';
5
-
6
- Object.defineProperty(exports, '__esModule', { value: true });
7
-
8
- const index = require('./index-41582c2a.js');
9
-
10
- const progressBarCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--height:1em;--track-color:rgba(var(--nano-track-rgb, 228, 230, 232), 1);--indicator-color:rgba(var(--nano-indicator-rgb, 84, 140, 175), 1);--label-color:var(--nano-color-white, white);display:block}.progress-bar{position:relative;background-color:var(--track-color);height:var(--height);border-radius:var(--nano-layer-border-radius, var(--nano-border-radius-medium, 4px));overflow:hidden}.progress-bar__indicator{height:100%;font-size:0.75em;background-color:var(--indicator-color);color:var(--label-color);text-align:center;white-space:nowrap;overflow:hidden;transition:0.4s width, 0.4s background-color;transform:translateZ(0);-webkit-user-select:none;user-select:none;transform-origin:left}.progress-bar--indeterminate .progress-bar__indicator{animation:indeterminate 2.5s infinite cubic-bezier(0.37, 0, 0.63, 1)}@keyframes indeterminate{0%{scale:1 1;transform:translateX(-100%) translateZ(0)}75%,100%{scale:1 1;transform:translateX(100%) translateZ(0)}}";
11
-
12
- const ProgressBar = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.value = 0;
16
- this.indeterminate = false;
17
- this.showPercent = false;
18
- }
19
- render() {
20
- return (index.h("div", { part: "base", class: {
21
- 'progress-bar': true,
22
- 'progress-bar--indeterminate': this.indeterminate,
23
- }, role: "progressbar", title: this.host.title || undefined, "aria-label": "Progress", "aria-valuemin": "0", "aria-valuemax": "100", "aria-valuenow": this.indeterminate ? null : this.value }, index.h("div", { part: "indicator", class: "progress-bar__indicator", style: {
24
- width: !this.indeterminate ? `${this.value}%` : undefined,
25
- } }, index.h("span", { part: "label", class: "progress-bar__label" }, index.h("slot", null, !this.indeterminate && this.showPercent ? `${this.value}%` : '')))));
26
- }
27
- get host() { return index.getElement(this); }
28
- };
29
- ProgressBar.style = progressBarCss;
30
-
31
- exports.nano_progress_bar = ProgressBar;
32
-
33
- //# sourceMappingURL=nano-progress-bar.cjs.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"nano-progress-bar.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,cAAc,GAAG,8iCAA8iC;;MCiBxjC,WAAW;;;iBAIN,CAAC;yBAGO,KAAK;uBAGP,KAAK;;EAE3B,MAAM;IACJ,QACEA,iBACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;QACL,cAAc,EAAE,IAAI;QACpB,6BAA6B,EAAE,IAAI,CAAC,aAAa;OAClD,EACD,IAAI,EAAC,aAAa,EAClB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,gBACxB,UAAU,mBACP,GAAG,mBACH,KAAK,mBACJ,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,IAErDA,iBACE,IAAI,EAAC,WAAW,EAChB,KAAK,EAAC,yBAAyB,EAC/B,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,IAAI,CAAC,aAAa,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,SAAS;OAC1D,IAEDA,kBAAM,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,qBAAqB,IAC5CA,sBACG,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,WAAW,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,CAC3D,CACF,CACH,CACF,EACN;GACH;;;;;;;","names":["h"],"sources":["./src/components/progress-bar/progress-bar.scss?tag=nano-progress-bar&encapsulation=shadow","./src/components/progress-bar/progress-bar.tsx"],"sourcesContent":["@import '../../global/style/nano-theme/components';\n@import '../../global/style/nano-theme/layers';\n\n/**\n * @prop --height: The progress bar's height. Default 1em\n * @prop --track-color: The track color. Default rgba(#{$progress-track-color-rgb}, 1);\n * @prop --indicator-color: The indicator color. Default rgba(#{$progress-indicator-color-rgb}, 1);\n * @prop --label-color: The label color. Default var(--nano-color-white, white);\n */\n:host {\n --height: 1em;\n --track-color: rgba(#{$progress-track-color-rgb}, 1);\n --indicator-color: rgba(#{$progress-indicator-color-rgb}, 1);\n --label-color: var(--nano-color-white, white);\n\n display: block;\n}\n\n.progress-bar {\n position: relative;\n background-color: var(--track-color);\n height: var(--height);\n border-radius: $layer-border-radius;\n overflow: hidden;\n}\n\n.progress-bar__indicator {\n height: 100%;\n font-size: 0.75em;\n background-color: var(--indicator-color);\n color: var(--label-color);\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n transition: 0.4s width, 0.4s background-color;\n transform: translateZ(0);\n user-select: none;\n transform-origin: left;\n}\n\n// Indeterminate\n.progress-bar--indeterminate .progress-bar__indicator {\n animation: indeterminate 2.5s infinite cubic-bezier(0.37, 0, 0.63, 1);\n}\n\n@keyframes indeterminate {\n 0% {\n scale: 1 1;\n transform: translateX(-100%) translateZ(0);\n }\n\n 75%,\n 100% {\n scale: 1 1;\n transform: translateX(100%) translateZ(0);\n }\n}\n","import { Component, Prop, h, Element } from '@stencil/core';\n\n/**\n * Used to show the status of an ongoing operation.\n *\n * @slot - A label to show inside the indicator.\n *\n * @part base - The component's base wrapper.\n * @part indicator - The progress bar indicator.\n * @part label - The progress bar label.\n */\n\n@Component({\n tag: 'nano-progress-bar',\n styleUrl: 'progress-bar.scss',\n shadow: true,\n})\nexport class ProgressBar {\n @Element() host: HTMLNanoProgressBarElement;\n\n /** The progress bar's percentage, 0 to 100. */\n @Prop() value = 0;\n\n /** When true, percentage is ignored, the label is hidden, and the progress bar is drawn in an indeterminate state. */\n @Prop() indeterminate = false;\n\n /** Whether to show the progress bar's current percent as text. Will be overwritten if you use the default slot. */\n @Prop() showPercent = false;\n\n render() {\n return (\n <div\n part=\"base\"\n class={{\n 'progress-bar': true,\n 'progress-bar--indeterminate': this.indeterminate,\n }}\n role=\"progressbar\"\n title={this.host.title || undefined}\n aria-label=\"Progress\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n aria-valuenow={this.indeterminate ? null : this.value}\n >\n <div\n part=\"indicator\"\n class=\"progress-bar__indicator\"\n style={{\n width: !this.indeterminate ? `${this.value}%` : undefined,\n }}\n >\n <span part=\"label\" class=\"progress-bar__label\">\n <slot>\n {!this.indeterminate && this.showPercent ? `${this.value}%` : ''}\n </slot>\n </span>\n </div>\n </div>\n );\n }\n}\n"],"version":3}