@nanoporetech-digital/components 5.1.2 → 5.2.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 (218) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/cjs/{component-store-74d25f63.js → component-store-f1dc1276.js} +2 -2
  3. package/dist/cjs/{component-store-74d25f63.js.map → component-store-f1dc1276.js.map} +1 -1
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/nano-algolia-filter.cjs.entry.js +2 -2
  7. package/dist/cjs/nano-algolia-input.cjs.entry.js +2 -2
  8. package/dist/cjs/nano-algolia.cjs.entry.js +2 -2
  9. package/dist/cjs/nano-checkbox-group.cjs.entry.js +5 -1
  10. package/dist/cjs/nano-checkbox-group.cjs.entry.js.map +1 -1
  11. package/dist/cjs/nano-components.cjs.js +1 -1
  12. package/dist/cjs/nano-datalist_3.cjs.entry.js +14 -5
  13. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nano-dialog.cjs.entry.js +2 -2
  15. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +8 -5
  16. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nano-global-nav.cjs.entry.js +2 -2
  18. package/dist/cjs/nano-input.cjs.entry.js +3 -3
  19. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nano-overflow-nav.cjs.entry.js +1 -1
  21. package/dist/cjs/nano-range.cjs.entry.js +1 -1
  22. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +3 -1
  23. package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nano-sortable.cjs.entry.js +18 -8
  25. package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nano-split-pane.cjs.entry.js +1 -1
  27. package/dist/cjs/nano-sticker.cjs.entry.js +4 -2
  28. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nano-tab-group.cjs.entry.js +2 -2
  30. package/dist/cjs/{nano-table-0a720c5f.js → nano-table-04993bb4.js} +560 -186
  31. package/dist/cjs/nano-table-04993bb4.js.map +1 -0
  32. package/dist/cjs/nano-table.cjs.entry.js +2 -2
  33. package/dist/cjs/{table.worker-347d4d31.js → table.worker-85877b23.js} +4 -4
  34. package/dist/cjs/table.worker-85877b23.js.map +1 -0
  35. package/dist/cjs/{table.worker-bd51e29f.js → table.worker-f258383d.js} +1 -1
  36. package/dist/cjs/{throttle-f55496c8.js → throttle-dfa64b9e.js} +17 -20
  37. package/dist/cjs/throttle-dfa64b9e.js.map +1 -0
  38. package/dist/collection/components/checkbox/checkbox-group.js +4 -0
  39. package/dist/collection/components/checkbox/checkbox-group.js.map +1 -1
  40. package/dist/collection/components/datalist/datalist.js +13 -4
  41. package/dist/collection/components/datalist/datalist.js.map +1 -1
  42. package/dist/collection/components/input/input.css +1 -1
  43. package/dist/collection/components/input/input.js +1 -1
  44. package/dist/collection/components/input/input.js.map +1 -1
  45. package/dist/collection/components/nav-item/nav-item.js +6 -3
  46. package/dist/collection/components/nav-item/nav-item.js.map +1 -1
  47. package/dist/collection/components/resize-observe/resize-observe.js +21 -1
  48. package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
  49. package/dist/collection/components/select/select.css +1 -2
  50. package/dist/collection/components/sortable/sortable.js +5 -7
  51. package/dist/collection/components/sortable/sortable.js.map +1 -1
  52. package/dist/collection/components/sticker/sticker.js +11 -5
  53. package/dist/collection/components/sticker/sticker.js.map +1 -1
  54. package/dist/collection/components/table/table-interface.js.map +1 -1
  55. package/dist/collection/components/table/table.cell.js +43 -10
  56. package/dist/collection/components/table/table.cell.js.map +1 -1
  57. package/dist/collection/components/table/table.css +38 -55
  58. package/dist/collection/components/table/table.header.js +4 -9
  59. package/dist/collection/components/table/table.header.js.map +1 -1
  60. package/dist/collection/components/table/table.js +104 -48
  61. package/dist/collection/components/table/table.js.map +1 -1
  62. package/dist/collection/components/table/table.pin-service.js +382 -0
  63. package/dist/collection/components/table/table.pin-service.js.map +1 -0
  64. package/dist/collection/components/table/table.row.js +39 -46
  65. package/dist/collection/components/table/table.row.js.map +1 -1
  66. package/dist/collection/components/table/table.utils.js +0 -124
  67. package/dist/collection/components/table/table.utils.js.map +1 -1
  68. package/dist/collection/components/table/table.worker.js +1 -0
  69. package/dist/collection/components/table/table.worker.js.map +1 -1
  70. package/dist/collection/utils/events.js +27 -0
  71. package/dist/collection/utils/events.js.map +1 -0
  72. package/dist/collection/utils/throttle.js +16 -19
  73. package/dist/collection/utils/throttle.js.map +1 -1
  74. package/dist/components/datalist.js +13 -4
  75. package/dist/components/datalist.js.map +1 -1
  76. package/dist/components/input.js +2 -2
  77. package/dist/components/input.js.map +1 -1
  78. package/dist/components/nano-checkbox-group.js +4 -0
  79. package/dist/components/nano-checkbox-group.js.map +1 -1
  80. package/dist/components/nano-sortable.js +17 -7
  81. package/dist/components/nano-sortable.js.map +1 -1
  82. package/dist/components/nav-item.js +6 -3
  83. package/dist/components/nav-item.js.map +1 -1
  84. package/dist/components/resize-observe.js +3 -1
  85. package/dist/components/resize-observe.js.map +1 -1
  86. package/dist/components/select.js +1 -1
  87. package/dist/components/select.js.map +1 -1
  88. package/dist/components/sticker.js +3 -1
  89. package/dist/components/sticker.js.map +1 -1
  90. package/dist/components/table.js +533 -188
  91. package/dist/components/table.js.map +1 -1
  92. package/dist/components/table.worker.js +1 -1
  93. package/dist/components/throttle.js +16 -19
  94. package/dist/components/throttle.js.map +1 -1
  95. package/dist/esm/{component-store-244a8431.js → component-store-c23ebc9c.js} +2 -2
  96. package/dist/esm/{component-store-244a8431.js.map → component-store-c23ebc9c.js.map} +1 -1
  97. package/dist/esm/index.js +1 -1
  98. package/dist/esm/loader.js +1 -1
  99. package/dist/esm/nano-algolia-filter.entry.js +2 -2
  100. package/dist/esm/nano-algolia-input.entry.js +2 -2
  101. package/dist/esm/nano-algolia.entry.js +2 -2
  102. package/dist/esm/nano-checkbox-group.entry.js +5 -1
  103. package/dist/esm/nano-checkbox-group.entry.js.map +1 -1
  104. package/dist/esm/nano-components.js +1 -1
  105. package/dist/esm/nano-datalist_3.entry.js +14 -5
  106. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  107. package/dist/esm/nano-dialog.entry.js +2 -2
  108. package/dist/esm/nano-global-nav-user-profile_3.entry.js +8 -5
  109. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  110. package/dist/esm/nano-global-nav.entry.js +2 -2
  111. package/dist/esm/nano-input.entry.js +3 -3
  112. package/dist/esm/nano-input.entry.js.map +1 -1
  113. package/dist/esm/nano-overflow-nav.entry.js +1 -1
  114. package/dist/esm/nano-range.entry.js +1 -1
  115. package/dist/esm/nano-resize-observe_2.entry.js +3 -1
  116. package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
  117. package/dist/esm/nano-sortable.entry.js +18 -8
  118. package/dist/esm/nano-sortable.entry.js.map +1 -1
  119. package/dist/esm/nano-split-pane.entry.js +1 -1
  120. package/dist/esm/nano-sticker.entry.js +4 -2
  121. package/dist/esm/nano-sticker.entry.js.map +1 -1
  122. package/dist/esm/nano-tab-group.entry.js +2 -2
  123. package/dist/esm/{nano-table-9767860f.js → nano-table-91f09583.js} +561 -187
  124. package/dist/esm/nano-table-91f09583.js.map +1 -0
  125. package/dist/esm/nano-table.entry.js +2 -2
  126. package/dist/esm/{table.worker-d252307c.js → table.worker-625475ba.js} +4 -4
  127. package/dist/esm/table.worker-625475ba.js.map +1 -0
  128. package/dist/esm/{table.worker-bd51e29f.js → table.worker-f258383d.js} +1 -1
  129. package/dist/esm/{throttle-7836544e.js → throttle-ac4fcefa.js} +17 -20
  130. package/dist/esm/throttle-ac4fcefa.js.map +1 -0
  131. package/dist/nano-components/index.esm.js +1 -1
  132. package/dist/nano-components/nano-components.esm.js +1 -1
  133. package/dist/nano-components/nano-components.esm.js.map +1 -1
  134. package/dist/nano-components/{p-7d6065c6.entry.js → p-0697795a.entry.js} +2 -2
  135. package/dist/nano-components/p-0697795a.entry.js.map +1 -0
  136. package/dist/nano-components/p-17ee0c07.entry.js +5 -0
  137. package/dist/nano-components/{p-6975f110.entry.js → p-192902e0.entry.js} +2 -2
  138. package/dist/nano-components/{p-a6ff5ca6.js → p-1a0b5bc3.js} +2 -2
  139. package/dist/nano-components/{p-3a761d77.entry.js → p-1b791810.entry.js} +2 -2
  140. package/dist/nano-components/p-3de3449e.js +5 -0
  141. package/dist/nano-components/p-3de3449e.js.map +1 -0
  142. package/dist/nano-components/p-3eb6d833.entry.js +5 -0
  143. package/dist/nano-components/p-3eb6d833.entry.js.map +1 -0
  144. package/dist/nano-components/{p-a1c0afb6.entry.js → p-4884b65a.entry.js} +2 -2
  145. package/dist/nano-components/{p-75735a91.entry.js → p-565793a2.entry.js} +2 -2
  146. package/dist/nano-components/p-565793a2.entry.js.map +1 -0
  147. package/dist/nano-components/p-5aae2588.entry.js +5 -0
  148. package/dist/nano-components/p-5aae2588.entry.js.map +1 -0
  149. package/dist/nano-components/{p-935aef3d.entry.js → p-6920ad69.entry.js} +2 -2
  150. package/dist/nano-components/{p-1c6c94cb.entry.js → p-7baa9e14.entry.js} +2 -2
  151. package/dist/nano-components/p-7bff5224.js +5 -0
  152. package/dist/nano-components/p-7bff5224.js.map +1 -0
  153. package/dist/nano-components/{p-f60fe933.entry.js → p-898cbac7.entry.js} +2 -2
  154. package/dist/nano-components/{p-ace1ffc2.entry.js → p-a362bd23.entry.js} +2 -2
  155. package/dist/nano-components/{p-eb6c9191.entry.js → p-b72df1aa.entry.js} +2 -2
  156. package/dist/nano-components/p-bf18e298.entry.js +5 -0
  157. package/dist/nano-components/p-bf18e298.entry.js.map +1 -0
  158. package/dist/nano-components/p-ce5efc3f.entry.js +5 -0
  159. package/dist/nano-components/p-ce5efc3f.entry.js.map +1 -0
  160. package/dist/nano-components/{p-1b687f96.entry.js → p-d0eefd52.entry.js} +2 -2
  161. package/dist/nano-components/{p-2d43a82b.entry.js → p-d74e2642.entry.js} +2 -2
  162. package/dist/nano-components/p-d74e2642.entry.js.map +1 -0
  163. package/dist/nano-components/p-dfbf0d56.js +5 -0
  164. package/dist/nano-components/{p-bd51e29f.js → p-f258383d.js} +1 -1
  165. package/dist/types/components/datalist/datalist.d.ts +1 -0
  166. package/dist/types/components/nav-item/nav-item.d.ts +1 -1
  167. package/dist/types/components/resize-observe/resize-observe.d.ts +2 -0
  168. package/dist/types/components/sortable/sortable.d.ts +0 -1
  169. package/dist/types/components/sticker/sticker.d.ts +2 -2
  170. package/dist/types/components/table/table-interface.d.ts +23 -11
  171. package/dist/types/components/table/table.cell.d.ts +0 -7
  172. package/dist/types/components/table/table.d.ts +10 -7
  173. package/dist/types/components/table/table.header.d.ts +0 -1
  174. package/dist/types/components/table/table.pin-service.d.ts +90 -0
  175. package/dist/types/components/table/table.row.d.ts +3 -2
  176. package/dist/types/components/table/table.utils.d.ts +0 -27
  177. package/dist/types/components.d.ts +29 -11
  178. package/dist/types/utils/events.d.ts +15 -0
  179. package/dist/types/utils/throttle.d.ts +1 -1
  180. package/docs-json.json +59 -24
  181. package/docs-vscode.json +2 -2
  182. package/hydrate/index.js +610 -204
  183. package/package.json +2 -2
  184. package/dist/cjs/nano-table-0a720c5f.js.map +0 -1
  185. package/dist/cjs/table.worker-347d4d31.js.map +0 -1
  186. package/dist/cjs/throttle-f55496c8.js.map +0 -1
  187. package/dist/esm/nano-table-9767860f.js.map +0 -1
  188. package/dist/esm/table.worker-d252307c.js.map +0 -1
  189. package/dist/esm/throttle-7836544e.js.map +0 -1
  190. package/dist/nano-components/p-15217442.entry.js +0 -5
  191. package/dist/nano-components/p-15217442.entry.js.map +0 -1
  192. package/dist/nano-components/p-2d43a82b.entry.js.map +0 -1
  193. package/dist/nano-components/p-633c778c.js +0 -5
  194. package/dist/nano-components/p-633c778c.js.map +0 -1
  195. package/dist/nano-components/p-66631f50.js +0 -5
  196. package/dist/nano-components/p-75735a91.entry.js.map +0 -1
  197. package/dist/nano-components/p-7d6065c6.entry.js.map +0 -1
  198. package/dist/nano-components/p-8a79a7ca.entry.js +0 -5
  199. package/dist/nano-components/p-9746b0a5.js +0 -5
  200. package/dist/nano-components/p-9746b0a5.js.map +0 -1
  201. package/dist/nano-components/p-b0c60290.entry.js +0 -5
  202. package/dist/nano-components/p-b0c60290.entry.js.map +0 -1
  203. package/dist/nano-components/p-c8ccb57a.entry.js +0 -5
  204. package/dist/nano-components/p-c8ccb57a.entry.js.map +0 -1
  205. package/dist/nano-components/p-d1a5326f.entry.js +0 -5
  206. package/dist/nano-components/p-d1a5326f.entry.js.map +0 -1
  207. /package/dist/nano-components/{p-66631f50.js.map → p-17ee0c07.entry.js.map} +0 -0
  208. /package/dist/nano-components/{p-6975f110.entry.js.map → p-192902e0.entry.js.map} +0 -0
  209. /package/dist/nano-components/{p-a6ff5ca6.js.map → p-1a0b5bc3.js.map} +0 -0
  210. /package/dist/nano-components/{p-3a761d77.entry.js.map → p-1b791810.entry.js.map} +0 -0
  211. /package/dist/nano-components/{p-a1c0afb6.entry.js.map → p-4884b65a.entry.js.map} +0 -0
  212. /package/dist/nano-components/{p-935aef3d.entry.js.map → p-6920ad69.entry.js.map} +0 -0
  213. /package/dist/nano-components/{p-1c6c94cb.entry.js.map → p-7baa9e14.entry.js.map} +0 -0
  214. /package/dist/nano-components/{p-f60fe933.entry.js.map → p-898cbac7.entry.js.map} +0 -0
  215. /package/dist/nano-components/{p-ace1ffc2.entry.js.map → p-a362bd23.entry.js.map} +0 -0
  216. /package/dist/nano-components/{p-eb6c9191.entry.js.map → p-b72df1aa.entry.js.map} +0 -0
  217. /package/dist/nano-components/{p-1b687f96.entry.js.map → p-d0eefd52.entry.js.map} +0 -0
  218. /package/dist/nano-components/{p-8a79a7ca.entry.js.map → p-dfbf0d56.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"sticker.js","sour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ACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n ComponentInterface,\n h,\n Host,\n Prop,\n State,\n Watch,\n Element,\n Event,\n EventEmitter,\n Method,\n} from '@stencil/core';\nimport { getOffset } from '../../utils/dom';\nimport { debounce } from '../../utils/throttle';\n\nfunction _getScrollTop(ele: HTMLElement | Document) {\n return ele instanceof Document ? window.pageYOffset : ele.scrollTop;\n}\n\nfunction _getOffset(ele: HTMLElement, parent: HTMLElement | Document) {\n const parentEle =\n parent instanceof Document ? document.documentElement : parent;\n return getOffset(ele, parentEle);\n}\n\ntype Positions = 'top' | 'bottom' | 'start' | 'end';\n\n/**\n * The Sticker component is a toolbox for 'sticking' items to scrolling containers.\n *\n */\n@Component({\n tag: 'nano-sticker',\n styleUrl: 'sticker.scss',\n shadow: true,\n})\nexport class Sticker implements ComponentInterface {\n private isRtl: boolean = false;\n private io: IntersectionObserver;\n private contentSizeObserver: ResizeObserver;\n private parentSizeObserver: ResizeObserver;\n private sticker: HTMLDivElement;\n private content: HTMLDivElement;\n private scrollPosCache = 0;\n private scrollPosThresholdCache = 0;\n private cacheOffset: number | { v: number; h: number } = 0;\n private slottedContent: Element[];\n private pauseResizeWatcher = false;\n private listenForScrollParent = false;\n private stickToEleInitSize?: DOMRect;\n private positions: Positions[] = [];\n private pauseHide: boolean = false;\n private hasBootstrapped = false;\n\n @Element() host: HTMLNanoStickerElement;\n\n // Internal State\n\n @State() isStuck = false;\n @State() isRootSticker = true;\n @State() hide = false;\n @State() scrollHide = false;\n @State() multiStickerHide = false;\n @State() scrollingTo = false;\n @State() quietModeIsOn = false;\n @State() stuckCounter = 0;\n @State() stickerIndex = 0;\n @State() stickToEle?: HTMLNanoStickerElement;\n @State() triggerPos: { top: number; left: number };\n @State() trigger: HTMLDivElement;\n @State() _offset: number | { v: number; h: number } = 0;\n\n // Public API\n\n /** Only applicable to root stickers. When applied the sticker will grow or shrink to the scrollParent size */\n @Prop() autoResize = true;\n\n /** Manually enable / disabled sticky behaviour */\n @Prop({ mutable: true }) isSticky = true;\n\n /** Distance the item should be stuck from the sticky edge. */\n @Prop({ mutable: true }) offset: number | { v: number; h: number } = 0;\n\n /** The edge of the scroll-parent to stick to */\n @Prop() position: 'top' | 'bottom' = 'top';\n // other opts I'd like one day. 'start' | 'end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'\n\n /** When applied, the sticker will hide when the scroll-parent\n * is scrolling away from the sticker's stuck position and show when scrolling toward it.\n * By default this will apply when the parent is below either the h or w dimensions */\n @Prop() quietMode: 'on' | 'off' | { h: number; w: number } = {\n h: 600,\n w: 600,\n };\n\n /** When applied stickers will hide upon new stickers being stuck to the same position */\n @Prop() hideOnNewStickers = true;\n\n /** The max width of the item to implement sticky behaviour. */\n @Prop() breakPointMax: null | number = null;\n\n /** The min width of the item to implement sticky behaviour. */\n @Prop() breakPointMin: null | number = null;\n\n /** Define which scroll element to listen & stick to.\n * By default, it will find traverse the DOM to find the closest. */\n @Prop({ mutable: true }) scrollParent?: HTMLElement | Document;\n\n /** Upon being stuck, attach the sticker to another sticker element.\n * A JS query selector that returns a <nano-sticker> */\n @Prop() stickTo: string;\n\n // Broadcasted Events\n\n /** Emitted when a sticker is stuck */\n @Event() nanoStuck!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is unstuck */\n @Event() nanoUnstuck!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is hidden */\n @Event() nanoHide!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is showing */\n @Event() nanoShow!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n // Public methods\n\n /**\n * Method to return the visibility status of the sticker\n * @returns boolean\n */\n @Method()\n async isHiding() {\n return this.hide;\n }\n\n /**\n * Method to return the stuck status of the sticker\n * @returns boolean\n */\n @Method()\n async isSticking() {\n this.shouldStick();\n return this.isStuck;\n }\n\n /** @internal */\n @Method()\n async setTriggerPos(offset: number | { v: number; h: number }) {\n return (this._offset = offset);\n }\n\n /** @internal */\n @Method()\n async getTriggerPos() {\n return this.triggerPos;\n }\n\n /** @internal */\n @Method()\n async pauseHiding(pause: boolean) {\n return (this.pauseHide = pause);\n }\n\n // Watchers\n\n /** Keep a note of trigger position. Need this to track sticker order in the DOM */\n @Watch('trigger')\n @Watch('scrollParent')\n updateTriggerOffset() {\n if (!this.trigger || !this.scrollParent || !this.listenForScrollParent)\n return;\n this.triggerPos = _getOffset(this.trigger, this.scrollParent);\n }\n\n /** A root sticker is a fixed element Or this sticker is sticking to another.\n * We need a content resize watcher to make sure we maintain a correct placeholder size in the body */\n @Watch('position')\n stickerResizeListener() {\n if (!this.content || !window['ResizeObserver']) return;\n\n if (this.contentSizeObserver) {\n this.contentSizeObserver.disconnect();\n this.contentSizeObserver = undefined;\n }\n\n this.contentSizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (this.pauseResizeWatcher) return;\n\n if (entry.contentRect.height) {\n if (this.position === 'top')\n this.host.style.height = entry.contentRect.height + 'px';\n if (this.position === 'bottom')\n this.host.style.minHeight = entry.contentRect.height + 'px';\n }\n }\n });\n this.contentSizeObserver.observe(this.content);\n }\n\n @Watch('quietMode')\n quietModeChange() {\n if (this.quietMode === 'on')\n requestAnimationFrame(() => (this.quietModeIsOn = true));\n else if (this.quietMode === 'off')\n requestAnimationFrame(() => (this.quietModeIsOn = false));\n }\n\n /** offset is part of the public API but we also use it to manipulate trigger points */\n @Watch('offset')\n @Watch('_offset')\n setOffset() {\n this.trigger.setAttribute('style', '');\n let v: number, h: number, _v: number, _h: number;\n const sticker: HTMLElement =\n this.isRootSticker || this.stickToEle ? this.sticker : this.host;\n\n if (!sticker) return;\n\n if (typeof this.offset === 'object') ({ v, h } = this.offset);\n else v = h = this.offset;\n\n if (typeof this._offset === 'object') ({ v = _v, h = _h } = this._offset);\n else _v = _h = this._offset;\n\n const setPos = (pos: 'top' | 'bottom' | 'left' | 'right') => {\n const u = pos.match(/(top|bottom)/) ? v : h;\n setTriggetPos(pos);\n sticker.style[pos] = u + 'px';\n if (u)\n this.host.style.setProperty(\n '--hide-transform-amount',\n `(110% + ${u}px)`\n );\n else this.host.style.setProperty('--hide-transform-amount', null);\n };\n\n const setTriggetPos = (pos: 'top' | 'bottom' | 'left' | 'right') => {\n const u = pos.match(/(top|bottom)/) ? v + _v : h + _h;\n this.trigger.style[pos] = u * -1 + 'px';\n this.trigger.style.position = 'relative';\n this.trigger.style.height = '1px';\n };\n\n if (\n (this.positions.includes('start') && this.isRtl) ||\n (this.positions.includes('end') && !this.isRtl)\n )\n setPos('right');\n\n if (\n (this.positions.includes('end') && this.isRtl) ||\n (this.positions.includes('start') && !this.isRtl)\n )\n setPos('left');\n\n if (this.positions.includes('top')) setPos('top');\n if (this.positions.includes('bottom')) setPos('bottom');\n }\n\n @Watch('position')\n positionChange() {\n this.positions = this.position.split('-') as Positions[];\n this.setOffset();\n }\n\n /** If this sticker is attached to a 'master' sticker (stickToEle),\n * here we move the content of this sticker in and out accordingly */\n @Watch('isStuck')\n async stuckChange() {\n if (this.isStuck) {\n if (this.stickToEle) {\n const content = this.host.children;\n this.slottedContent = Array.from(content);\n\n this.slottedContent.forEach((child: HTMLElement) => {\n this.stickToEle.appendChild(child);\n child.style.order = this.stickerIndex + '';\n });\n\n this.nanoStuck.emit({ sticker: this.stickToEle });\n } else this.nanoStuck.emit({ sticker: this.host });\n } else {\n this.scrollHide = false;\n\n if (this.stickToEle) {\n this.slottedContent.forEach((child: HTMLElement) => {\n this.host.appendChild(child);\n child.style.order = '';\n });\n this.nanoUnstuck.emit({ sticker: this.stickToEle });\n } else this.nanoUnstuck.emit({ sticker: this.host });\n }\n }\n\n /** attach scroll listener. 'hides' stickers when scrolling away from trigger and 'shows' when scrolling toward */\n @Watch('quietModeIsOn')\n attachScrollListeners() {\n if (this.quietModeIsOn)\n this.scrollParent.addEventListener('scroll', this.onScroll, {\n passive: true,\n capture: false,\n });\n else if (this.scrollParent) {\n this.scrollParent.removeEventListener('scroll', this.onScroll);\n this.moveTrigger(true);\n }\n }\n\n /** Add / remove parent scrolling listeners. If there's stickToEle we need to remove them */\n @Watch('scrollParent')\n @Watch('stickToEle')\n handleParentEvents(_, oldParent: null | HTMLElement = null) {\n if (!this.listenForScrollParent) return;\n if (oldParent) this.manageListenersOnParent(false, oldParent);\n if (this.scrollParent) this.manageListenersOnParent(!this.stickToEle);\n }\n\n /** Add remove specific listeners if we're sticking to a sticker.\n * We need to adjust triggers according to the status of the 'master' */\n @Watch('stickToEle')\n stickToEleChange(_, oldEle: null | HTMLNanoStickerElement) {\n if (this.stickToEle) {\n this.stickToEle.addEventListener('nanoHide', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener('nanoShow', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener('nanoStuck', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener(\n 'nanoUnstuck',\n this.onStickToDisplayEvent\n );\n }\n if (oldEle) {\n oldEle.removeEventListener('nanoHide', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoShow', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoStuck', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoUnstuck', this.onStickToDisplayEvent);\n }\n }\n\n /** Find and set the stickToEle from the public, selector string */\n @Watch('stickTo')\n stickToChange() {\n if (this.stickTo)\n this.stickToEle = this.scrollParent.querySelector(this.stickTo);\n else this.stickToEle = undefined;\n }\n\n /** 2 potential criteria for hiding. Multi-stickers or quietmode. */\n @Watch('multiStickerHide')\n @Watch('scrollHide')\n visibilityDecisionHandler() {\n if (this.multiStickerHide || this.scrollHide) this.hide = true;\n else this.hide = false;\n }\n\n @Watch('hide')\n handleHideChange() {\n if (this.hide) this.nanoHide.emit({ sticker: this.host });\n else this.nanoShow.emit({ sticker: this.host });\n }\n\n @Watch('scrollParent')\n setupIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n if (!this.scrollParent || !this.hasBootstrapped || !this.trigger) return;\n\n this.isRootSticker = this.scrollParent instanceof Document;\n let root = this.scrollParent;\n if (this.scrollParent instanceof Document) root = null;\n\n this.io = new window.IntersectionObserver(\n (_) => {\n if (this.pauseResizeWatcher || !this.isSticky) return;\n this.shouldStick(_.slice(-1)[0]);\n },\n { root: root as HTMLElement }\n );\n\n this.io.observe(this.trigger);\n }\n\n // Private methods / handlers\n\n /** Assesses the public API quitemode and works out if it should be applied atm.\n * If 'smallscreen', or there is a breakpointmax / min it will add a resizeobserver to conditionally add behaviour */\n private setupParentResizeListener = () => {\n if (!window['ResizeObserver']) return;\n\n if (this.parentSizeObserver) {\n this.parentSizeObserver.disconnect();\n this.parentSizeObserver = undefined;\n }\n\n this.parentSizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n let height: number, width: number;\n if (entry.contentRect.height) height = entry.contentRect.height;\n if (entry.contentRect.width) width = entry.contentRect.width;\n\n if (typeof this.quietMode === 'object') {\n if (width < this.quietMode.w || height < this.quietMode.h)\n this.quietModeIsOn = true;\n else this.quietModeIsOn = false;\n }\n\n if (this.breakPointMin) {\n if (width > this.breakPointMin) this.isSticky = true;\n else this.isSticky = false;\n }\n\n if (this.breakPointMax) {\n if (width < this.breakPointMax) this.isSticky = true;\n else this.isSticky = false;\n }\n\n if (this.isRootSticker && this.sticker && this.autoResize)\n this.sticker.style.width = this.host.scrollWidth + 'px';\n }\n });\n\n const toWatch =\n this.scrollParent instanceof Document\n ? this.scrollParent.documentElement\n : this.scrollParent;\n if (toWatch) this.parentSizeObserver.observe(toWatch);\n };\n\n /** For stickTo stickers. We listen to the events from the 'master' sticker to ammend the hide/show trigger\n * Main diffs from rootstickers / non is height being on 'master' */\n private onStickToDisplayEvent = (\n e: CustomEvent<{ sticker: HTMLNanoStickerElement }>\n ) => {\n if (e.detail.sticker !== this.stickToEle) return;\n\n switch (e.type) {\n case 'nanoHide':\n this._offset = 0;\n this.cacheOffset = this.offset;\n this.offset = 0;\n /** trigger moves down, underneath sticker if the main sticker hides */\n if (!this.isStuck) this.moveTrigger(false);\n\n /** If it's an actual 'position: sticky' element, we need to give the sticker an appropriate height.\n * This minimises content jumping around as items are added */\n if (!this.isRootSticker && this.quietModeIsOn) {\n requestAnimationFrame(() => {\n this.stickToEle.style.minHeight =\n this.stickToEleInitSize.height +\n (this.host.scrollHeight +\n (typeof this.cacheOffset === 'object'\n ? this.cacheOffset.v\n : this.cacheOffset)) +\n 'px';\n this.stickToEle.setTriggerPos(this.stickToEleInitSize.height * -1);\n });\n }\n break;\n case 'nanoShow':\n this._offset = this.stickToEleInitSize.height;\n this.offset = this.cacheOffset;\n this.moveTrigger(true);\n\n /** reset master sticker size */\n if (!this.isRootSticker && this.quietModeIsOn) {\n requestAnimationFrame(() => {\n this.stickToEle.style.minHeight = '';\n this.stickToEle.setTriggerPos(0);\n });\n }\n break;\n case 'nanoStuck':\n this.stickToEleInitSize = this.stickToEle.getBoundingClientRect();\n this._offset = this.stickToEleInitSize.height;\n break;\n }\n };\n\n /** Add or removes event listeners / observers on scrolling parent\n * for when the scrolling parent changes, or, this sticker is sticking to another */\n private manageListenersOnParent(\n addEvents: boolean,\n ele?: HTMLElement | Document\n ) {\n const scrollParent = ele || this.scrollParent;\n\n if (!scrollParent) return;\n\n if (!addEvents) {\n try {\n if (this.quietModeIsOn)\n scrollParent.removeEventListener('scroll', this.onScroll);\n scrollParent.removeEventListener('nanoStuck', this.onStickEvent);\n scrollParent.removeEventListener('nanoUnstuck', this.onStickEvent);\n } catch (e) {\n console.error('Events haven`t been added');\n }\n } else {\n scrollParent.addEventListener('nanoStuck', this.onStickEvent);\n scrollParent.addEventListener('nanoUnstuck', this.onStickEvent);\n\n if (this.quietModeIsOn) this.attachScrollListeners();\n }\n this.setupParentResizeListener();\n }\n\n /** Handler applied to scrolling parent. When 'hideOnNewStickers' is true, hide this sticker on subsequent stuck stickers. */\n private onStickEvent = async (\n e: CustomEvent<{ sticker: HTMLNanoStickerElement }>\n ) => {\n const sticker = e.detail ? e.detail.sticker : null;\n if (!sticker || sticker.position !== this.position) return;\n\n const incomingTriggerPos = await sticker.getTriggerPos();\n\n if (\n e.type === 'nanoStuck' &&\n sticker !== this.host &&\n sticker.scrollParent === this.host.scrollParent\n ) {\n this.stickerIndex++;\n\n if (!this.hideOnNewStickers) return;\n\n if (\n (this.positions.includes('top') &&\n this.triggerPos.top < incomingTriggerPos.top) ||\n (this.positions.includes('bottom') &&\n this.triggerPos.top > incomingTriggerPos.top)\n ) {\n this.multiStickerHide = true;\n this.stuckCounter++;\n }\n }\n\n if (\n e.type === 'nanoUnstuck' &&\n sticker !== this.host &&\n sticker.scrollParent === this.host.scrollParent\n ) {\n this.stickerIndex--;\n\n if (!this.hideOnNewStickers) return;\n\n if (\n (this.positions.includes('top') &&\n this.triggerPos.top < incomingTriggerPos.top) ||\n (this.positions.includes('bottom') &&\n this.triggerPos.top > incomingTriggerPos.top)\n ) {\n this.stuckCounter--;\n if (this.stuckCounter < 1) this.multiStickerHide = false;\n }\n }\n };\n\n /** Scroll handler applied to scrolling parent. Only applied when quietmode is on.\n * 'hides' stickers when scrolling over 100px away from trigger and 'shows' when scrolling toward */\n private onScroll = () => {\n const y: number = _getScrollTop(this.scrollParent);\n\n // scrolling up\n if (y < this.scrollPosCache) {\n if (!this.positions.includes('bottom')) this.handleScrollTo();\n else this.handleScrollAway(y);\n }\n\n // scrolling down\n if (y > this.scrollPosCache) {\n if (!this.positions.includes('bottom')) this.handleScrollAway(y);\n else this.handleScrollTo();\n }\n this.scrollPosCache = y;\n };\n\n /** Watch for scroll direction. Only applies when quietmode is on.\n * We need to addjust the position of the trigger when the sticker is hidden */\n private handleScrollTo() {\n this.scrollPosThresholdCache = null;\n if (!this.scrollHide) return;\n\n if (this.scrollingTo !== true) {\n this._offset = this.cacheOffset || this._offset;\n }\n this.scrollingTo = true;\n this.scrollHide = false;\n }\n\n private handleScrollAway(currScroll: number) {\n if (this.scrollHide) return;\n\n if (!this.isStuck) return;\n\n if (this.scrollingTo !== false) {\n this.cacheOffset = this._offset;\n this._offset = 0;\n }\n this.scrollingTo = false;\n\n if (!this.scrollPosThresholdCache)\n this.scrollPosThresholdCache = currScroll;\n else if (\n !this.pauseHide &&\n Math.abs(currScroll - this.scrollPosThresholdCache) > 100\n )\n this.scrollHide = true;\n }\n\n private moveTrigger(toInitial?: boolean) {\n if (\n (this.positions.includes('bottom') && !toInitial) ||\n (!this.positions.includes('bottom') && toInitial)\n ) {\n this.host.parentNode.insertBefore(this.trigger, this.host);\n } else\n this.host.parentNode.insertBefore(this.trigger, this.host.nextSibling);\n }\n\n /**\n * Gets the 'closest' scrolling parent\n * @returns either an element with `overflow: scroll | auto` or the parent Document\n */\n private getScrollParent(): HTMLElement | Document {\n const regex = /(auto|scroll)/;\n const parents = (_node: Node, ps: Node[]) => {\n if (_node.parentNode === null) {\n return ps;\n }\n return parents(_node.parentNode, ps.concat([_node]));\n };\n const style = (_node, prop) =>\n getComputedStyle(_node, null).getPropertyValue(prop);\n const overflow = (_node) =>\n style(_node, 'overflow') +\n style(_node, 'overflow-y') +\n style(_node, 'overflow-x');\n const scroll = (_node) => regex.test(overflow(_node));\n const docHeight = document.documentElement.getBoundingClientRect().height;\n\n const scrollParent = (_node: HTMLElement) => {\n if (!(typeof _node === 'object')) return;\n\n const ps = parents(_node, []);\n return (\n ps.find(\n (ele) =>\n scroll(ele) && ele.getBoundingClientRect().height !== docHeight\n ) || document\n );\n };\n\n return scrollParent(this.host);\n }\n\n private shouldStick(data?: IntersectionObserverEntry) {\n let scrollAmt: number;\n\n if (this.positions.includes('top')) {\n if (!this.isRootSticker)\n scrollAmt = _getOffset(this.trigger, this.scrollParent).top;\n else scrollAmt = this.trigger.getBoundingClientRect().top;\n this.isStuck = scrollAmt < -1;\n } else if (this.positions.includes('bottom')) {\n scrollAmt = this.trigger.getBoundingClientRect().top;\n const parentBounding =\n data && data.rootBounds\n ? data.rootBounds\n : (this.scrollParent instanceof Document\n ? document.documentElement\n : this.scrollParent\n ).getBoundingClientRect();\n this.isStuck = scrollAmt > parentBounding.height + parentBounding.top;\n }\n }\n\n private bootstrapGurantor() {\n this.hasBootstrapped = true;\n\n this.scrollParent = this.scrollParent || this.getScrollParent();\n this.isRootSticker = this.scrollParent instanceof Document;\n\n this.trigger = this.trigger || document.createElement('div');\n this.trigger.classList.add('sticker-trigger');\n\n this.positionChange();\n this.moveTrigger(true);\n this.quietModeChange();\n\n this.listenForScrollParent = true;\n this.handleParentEvents(true);\n\n this.stickerIndex = Array.from(\n this.scrollParent.querySelectorAll('nano-sticker')\n )\n .filter(\n (sticker: HTMLNanoStickerElement) => sticker.position === this.position\n )\n .findIndex((sticker) => sticker === this.host);\n\n this.setOffset();\n this.stickerResizeListener();\n this.setupParentResizeListener();\n\n // bit of a hack ... add default 'order'. Required for 'stickTo' elements.\n this.slottedContent = Array.from(this.host.children);\n this.slottedContent.forEach((child: HTMLElement) => {\n child.style.order = this.stickerIndex + '';\n });\n\n this.updateTriggerOffset();\n this.stickToChange();\n this.setupIO();\n this.onStickToDisplayEvent = debounce(this.onStickToDisplayEvent, 50);\n }\n\n // Stencil metthods\n\n connectedCallback() {\n this.isRtl =\n this.host.dir === 'rtl' ||\n (this.host.ownerDocument as Document).dir === 'rtl';\n\n // this is all horrible.... shrug\n document.documentElement.addEventListener('nanoComponentsReady', () => {\n setTimeout((_) => this.bootstrapGurantor(), 200);\n });\n setTimeout((_) => {\n if (!this.hasBootstrapped) this.bootstrapGurantor();\n }, 1000);\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n\n if (this.parentSizeObserver) {\n this.parentSizeObserver.disconnect();\n this.parentSizeObserver = undefined;\n }\n\n this.scrollParent = null;\n this.hasBootstrapped = false;\n }\n\n render() {\n return (\n <Host\n sticky={!this.isRootSticker && !this.stickToEle && this.isSticky}\n hide={this.hide && this.isStuck}\n siblings={this.stuckCounter}\n index={this.stickerIndex}\n stuck={this.isStuck && this.isSticky}\n placed-bottom={this.positions.includes('bottom')}\n placed-top={this.positions.includes('top')}\n placed-end={this.positions.includes('end')}\n placed-start={this.positions.includes('start')}\n >\n <div\n class={{\n sticker: true,\n sticky: this.isRootSticker && this.isSticky,\n stuck: this.isStuck && this.isRootSticker && this.isSticky,\n hide: this.isRootSticker && this.hide && this.isStuck,\n }}\n ref={(div) => (this.sticker = div)}\n >\n <div class=\"sticker-content\" ref={(div) => (this.content = div)}>\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"sticker.js","sourceRoot":"","sources":["../../../src/components/sticker/sticker.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,CAAC,EACD,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,KAAK,EAEL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,SAAS,aAAa,CAAC,GAA2B;EAChD,OAAO,GA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n ComponentInterface,\n h,\n Host,\n Prop,\n State,\n Watch,\n Element,\n Event,\n EventEmitter,\n Method,\n} from '@stencil/core';\nimport { getOffset } from '../../utils/dom';\nimport { debounce } from '../../utils/throttle';\n\nfunction _getScrollTop(ele: HTMLElement | Document) {\n return ele instanceof Document ? window.pageYOffset : ele.scrollTop;\n}\n\nfunction _getOffset(ele: HTMLElement, parent: HTMLElement | Document) {\n const parentEle =\n parent instanceof Document ? document.documentElement : parent;\n return getOffset(ele, parentEle);\n}\n\ntype Positions = 'top' | 'bottom' | 'start' | 'end';\n\n/**\n * The Sticker component is a toolbox for 'sticking' items to scrolling containers.\n *\n */\n@Component({\n tag: 'nano-sticker',\n styleUrl: 'sticker.scss',\n shadow: true,\n})\nexport class Sticker implements ComponentInterface {\n private isRtl: boolean = false;\n private io: IntersectionObserver;\n private contentSizeObserver: ResizeObserver;\n private parentSizeObserver: ResizeObserver;\n private sticker: HTMLDivElement;\n private content: HTMLDivElement;\n private scrollPosCache = 0;\n private scrollPosThresholdCache = 0;\n private cacheOffset: number | { v: number; h: number } = 0;\n private slottedContent: Element[];\n private pauseResizeWatcher = false;\n private listenForScrollParent = false;\n private stickToEleInitSize?: DOMRect;\n private positions: Positions[] = [];\n private pauseHide: boolean = false;\n private hasBootstrapped = false;\n\n @Element() host: HTMLNanoStickerElement;\n\n // Internal State\n\n @State() isStuck = false;\n @State() isRootSticker = true;\n @State() hide = false;\n @State() scrollHide = false;\n @State() multiStickerHide = false;\n @State() scrollingTo = false;\n @State() quietModeIsOn = false;\n @State() stuckCounter = 0;\n @State() stickerIndex = 0;\n @State() stickToEle?: HTMLNanoStickerElement;\n @State() triggerPos: { top: number; left: number };\n @State() trigger: HTMLDivElement;\n @State() _offset: number | { v: number; h: number } = 0;\n\n // Public API\n\n /** Only applicable to root stickers. When applied the sticker will grow or shrink to the scrollParent size */\n @Prop() autoResize = true;\n\n /** Manually enable / disabled sticky behaviour */\n @Prop({ mutable: true }) isSticky = true;\n\n /** Distance the item should be stuck from the sticky edge. */\n @Prop({ mutable: true }) offset: number | { v: number; h: number } = 0;\n\n /** The edge of the scroll-parent to stick to */\n @Prop() position: 'top' | 'bottom' = 'top';\n // other opts I'd like one day. 'start' | 'end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'\n\n /** When applied, the sticker will hide when the scroll-parent\n * is scrolling away from the sticker's stuck position and show when scrolling toward it.\n * By default this will apply when the parent is below either the h or w dimensions */\n @Prop() quietMode: 'on' | 'off' | { h: number; w: number } = {\n h: 600,\n w: 600,\n };\n\n /** When applied stickers will hide upon new stickers being stuck to the same position */\n @Prop() hideOnNewStickers = true;\n\n /** The max width of the item to implement sticky behaviour. */\n @Prop() breakPointMax: null | number = null;\n\n /** The min width of the item to implement sticky behaviour. */\n @Prop() breakPointMin: null | number = null;\n\n /** Define which scroll element to listen & stick to.\n * By default, it will find traverse the DOM to find the closest. */\n @Prop({ mutable: true }) scrollParent?: HTMLElement | Document;\n\n /** Upon being stuck, attach the sticker to another sticker element.\n * JS query selector string or DOM element pointing to a `<nano-sticker>` */\n @Prop() stickTo: string | HTMLNanoStickerElement;\n\n // Broadcasted Events\n\n /** Emitted when a sticker is stuck */\n @Event() nanoStuck!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is unstuck */\n @Event() nanoUnstuck!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is hidden */\n @Event() nanoHide!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n /** Emitted when a sticker is showing */\n @Event() nanoShow!: EventEmitter<{ sticker: HTMLNanoStickerElement }>;\n\n // Public methods\n\n /**\n * Method to return the visibility status of the sticker\n * @returns boolean\n */\n @Method()\n async isHiding() {\n return this.hide;\n }\n\n /**\n * Method to return the stuck status of the sticker\n * @returns boolean\n */\n @Method()\n async isSticking() {\n this.shouldStick();\n return this.isStuck;\n }\n\n /** @internal */\n @Method()\n async setTriggerPos(offset: number | { v: number; h: number }) {\n return (this._offset = offset);\n }\n\n /** @internal */\n @Method()\n async getTriggerPos() {\n return this.triggerPos;\n }\n\n /** @internal */\n @Method()\n async pauseHiding(pause: boolean) {\n return (this.pauseHide = pause);\n }\n\n // Watchers\n\n /** Keep a note of trigger position. Need this to track sticker order in the DOM */\n @Watch('trigger')\n @Watch('scrollParent')\n updateTriggerOffset() {\n if (!this.trigger || !this.scrollParent || !this.listenForScrollParent)\n return;\n this.triggerPos = _getOffset(this.trigger, this.scrollParent);\n }\n\n /** A root sticker is a fixed element Or this sticker is sticking to another.\n * We need a content resize watcher to make sure we maintain a correct placeholder size in the body */\n @Watch('position')\n stickerResizeListener() {\n if (!this.content || !window['ResizeObserver']) return;\n\n if (this.contentSizeObserver) {\n this.contentSizeObserver.disconnect();\n this.contentSizeObserver = undefined;\n }\n\n this.contentSizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (this.pauseResizeWatcher) return;\n\n if (entry.contentRect.height) {\n if (this.position === 'top')\n this.host.style.height = entry.contentRect.height + 'px';\n if (this.position === 'bottom')\n this.host.style.minHeight = entry.contentRect.height + 'px';\n }\n }\n });\n this.contentSizeObserver.observe(this.content);\n }\n\n @Watch('quietMode')\n quietModeChange() {\n if (this.quietMode === 'on')\n requestAnimationFrame(() => (this.quietModeIsOn = true));\n else if (this.quietMode === 'off')\n requestAnimationFrame(() => (this.quietModeIsOn = false));\n }\n\n /** offset is part of the public API but we also use it to manipulate trigger points */\n @Watch('offset')\n @Watch('_offset')\n setOffset() {\n this.trigger.setAttribute('style', '');\n let v: number, h: number, _v: number, _h: number;\n const sticker: HTMLElement =\n this.isRootSticker || this.stickToEle ? this.sticker : this.host;\n\n if (!sticker) return;\n\n if (typeof this.offset === 'object') ({ v, h } = this.offset);\n else v = h = this.offset;\n\n if (typeof this._offset === 'object') ({ v = _v, h = _h } = this._offset);\n else _v = _h = this._offset;\n\n const setPos = (pos: 'top' | 'bottom' | 'left' | 'right') => {\n const u = pos.match(/(top|bottom)/) ? v : h;\n setTriggetPos(pos);\n sticker.style[pos] = u + 'px';\n if (u)\n this.host.style.setProperty(\n '--hide-transform-amount',\n `(110% + ${u}px)`\n );\n else this.host.style.setProperty('--hide-transform-amount', null);\n };\n\n const setTriggetPos = (pos: 'top' | 'bottom' | 'left' | 'right') => {\n const u = pos.match(/(top|bottom)/) ? v + _v : h + _h;\n this.trigger.style[pos] = u * -1 + 'px';\n this.trigger.style.position = 'relative';\n this.trigger.style.height = '1px';\n };\n\n if (\n (this.positions.includes('start') && this.isRtl) ||\n (this.positions.includes('end') && !this.isRtl)\n )\n setPos('right');\n\n if (\n (this.positions.includes('end') && this.isRtl) ||\n (this.positions.includes('start') && !this.isRtl)\n )\n setPos('left');\n\n if (this.positions.includes('top')) setPos('top');\n if (this.positions.includes('bottom')) setPos('bottom');\n }\n\n @Watch('position')\n positionChange() {\n this.positions = this.position.split('-') as Positions[];\n this.setOffset();\n }\n\n /** If this sticker is attached to a 'master' sticker (stickToEle),\n * here we move the content of this sticker in and out accordingly */\n @Watch('isStuck')\n async stuckChange() {\n if (this.isStuck) {\n if (this.stickToEle) {\n const content = this.host.children;\n this.slottedContent = Array.from(content);\n\n this.slottedContent.forEach((child: HTMLElement) => {\n this.stickToEle.appendChild(child);\n child.style.order = this.stickerIndex + '';\n });\n\n this.nanoStuck.emit({ sticker: this.stickToEle });\n } else this.nanoStuck.emit({ sticker: this.host });\n } else {\n this.scrollHide = false;\n\n if (this.stickToEle) {\n this.slottedContent.forEach((child: HTMLElement) => {\n this.host.appendChild(child);\n child.style.order = '';\n });\n this.nanoUnstuck.emit({ sticker: this.stickToEle });\n } else this.nanoUnstuck.emit({ sticker: this.host });\n }\n }\n\n /** attach scroll listener. 'hides' stickers when scrolling away from trigger and 'shows' when scrolling toward */\n @Watch('quietModeIsOn')\n attachScrollListeners() {\n if (this.quietModeIsOn)\n this.scrollParent.addEventListener('scroll', this.onScroll, {\n passive: true,\n capture: false,\n });\n else if (this.scrollParent) {\n this.scrollParent.removeEventListener('scroll', this.onScroll);\n this.moveTrigger(true);\n }\n }\n\n /** Add / remove parent scrolling listeners. If there's stickToEle we need to remove them */\n @Watch('scrollParent')\n @Watch('stickToEle')\n handleParentEvents(_, oldParent: null | HTMLElement = null) {\n if (!this.listenForScrollParent) return;\n if (oldParent) this.manageListenersOnParent(false, oldParent);\n if (this.scrollParent) this.manageListenersOnParent(!this.stickToEle);\n }\n\n /** Add remove specific listeners if we're sticking to a sticker.\n * We need to adjust triggers according to the status of the 'master' */\n @Watch('stickToEle')\n stickToEleChange(_, oldEle: null | HTMLNanoStickerElement) {\n if (this.stickToEle) {\n this.stickToEle.addEventListener('nanoHide', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener('nanoShow', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener('nanoStuck', this.onStickToDisplayEvent);\n this.stickToEle.addEventListener(\n 'nanoUnstuck',\n this.onStickToDisplayEvent\n );\n }\n if (oldEle) {\n oldEle.removeEventListener('nanoHide', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoShow', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoStuck', this.onStickToDisplayEvent);\n oldEle.removeEventListener('nanoUnstuck', this.onStickToDisplayEvent);\n }\n }\n\n /** Find and set the stickToEle from the public, selector string */\n @Watch('stickTo')\n stickToChange() {\n if (typeof this.stickTo === 'string')\n this.stickToEle = this.scrollParent.querySelector(this.stickTo);\n else if (!!this.stickTo) this.stickToEle = this.stickTo;\n else this.stickToEle = undefined;\n }\n\n /** 2 potential criteria for hiding. Multi-stickers or quietmode. */\n @Watch('multiStickerHide')\n @Watch('scrollHide')\n visibilityDecisionHandler() {\n if (this.multiStickerHide || this.scrollHide) this.hide = true;\n else this.hide = false;\n }\n\n @Watch('hide')\n handleHideChange() {\n if (this.hide) this.nanoHide.emit({ sticker: this.host });\n else this.nanoShow.emit({ sticker: this.host });\n }\n\n @Watch('scrollParent')\n setupIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n if (!this.scrollParent || !this.hasBootstrapped || !this.trigger) return;\n\n this.isRootSticker = this.scrollParent instanceof Document;\n let root = this.scrollParent;\n if (this.scrollParent instanceof Document) root = null;\n\n this.io = new window.IntersectionObserver(\n (_) => {\n if (this.pauseResizeWatcher || !this.isSticky) return;\n this.shouldStick(_.slice(-1)[0]);\n },\n { root: root as HTMLElement }\n );\n\n this.io.observe(this.trigger);\n }\n\n // Private methods / handlers\n\n /** Assesses the public API quitemode and works out if it should be applied atm.\n * If 'smallscreen', or there is a breakpointmax / min it will add a resizeobserver to conditionally add behaviour */\n private setupParentResizeListener = () => {\n if (!window['ResizeObserver']) return;\n\n if (this.parentSizeObserver) {\n this.parentSizeObserver.disconnect();\n this.parentSizeObserver = undefined;\n }\n\n this.parentSizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n let height: number, width: number;\n if (entry.contentRect.height) height = entry.contentRect.height;\n if (entry.contentRect.width) width = entry.contentRect.width;\n\n if (typeof this.quietMode === 'object') {\n if (width < this.quietMode.w || height < this.quietMode.h)\n this.quietModeIsOn = true;\n else this.quietModeIsOn = false;\n }\n\n if (this.breakPointMin) {\n if (width > this.breakPointMin) this.isSticky = true;\n else this.isSticky = false;\n }\n\n if (this.breakPointMax) {\n if (width < this.breakPointMax) this.isSticky = true;\n else this.isSticky = false;\n }\n\n if (this.isRootSticker && this.sticker && this.autoResize)\n this.sticker.style.width = this.host.scrollWidth + 'px';\n }\n });\n\n const toWatch =\n this.scrollParent instanceof Document\n ? this.scrollParent.documentElement\n : this.scrollParent;\n if (toWatch) this.parentSizeObserver.observe(toWatch);\n };\n\n /** For stickTo stickers. We listen to the events from the 'master' sticker to ammend the hide/show trigger\n * Main diffs from rootstickers / non is height being on 'master' */\n private onStickToDisplayEvent = (\n e: CustomEvent<{ sticker: HTMLNanoStickerElement }>\n ) => {\n if (e.detail.sticker !== this.stickToEle) return;\n\n switch (e.type) {\n case 'nanoHide':\n this._offset = 0;\n this.cacheOffset = this.offset;\n this.offset = 0;\n /** trigger moves down, underneath sticker if the main sticker hides */\n if (!this.isStuck) this.moveTrigger(false);\n\n /** If it's an actual 'position: sticky' element, we need to give the sticker an appropriate height.\n * This minimises content jumping around as items are added */\n if (!this.isRootSticker && this.quietModeIsOn) {\n requestAnimationFrame(() => {\n this.stickToEle.style.minHeight =\n this.stickToEleInitSize.height +\n (this.host.scrollHeight +\n (typeof this.cacheOffset === 'object'\n ? this.cacheOffset.v\n : this.cacheOffset)) +\n 'px';\n this.stickToEle.setTriggerPos(this.stickToEleInitSize.height * -1);\n });\n }\n break;\n case 'nanoShow':\n this._offset = this.stickToEleInitSize.height;\n this.offset = this.cacheOffset;\n this.moveTrigger(true);\n\n /** reset master sticker size */\n if (!this.isRootSticker && this.quietModeIsOn) {\n requestAnimationFrame(() => {\n this.stickToEle.style.minHeight = '';\n this.stickToEle.setTriggerPos(0);\n });\n }\n break;\n case 'nanoStuck':\n this.stickToEleInitSize = this.stickToEle.getBoundingClientRect();\n this._offset = this.stickToEleInitSize.height;\n break;\n }\n };\n\n /** Add or removes event listeners / observers on scrolling parent\n * for when the scrolling parent changes, or, this sticker is sticking to another */\n private manageListenersOnParent(\n addEvents: boolean,\n ele?: HTMLElement | Document\n ) {\n const scrollParent = ele || this.scrollParent;\n\n if (!scrollParent) return;\n\n if (!addEvents) {\n try {\n if (this.quietModeIsOn)\n scrollParent.removeEventListener('scroll', this.onScroll);\n scrollParent.removeEventListener('nanoStuck', this.onStickEvent);\n scrollParent.removeEventListener('nanoUnstuck', this.onStickEvent);\n } catch (e) {\n console.error('Events haven`t been added');\n }\n } else {\n scrollParent.addEventListener('nanoStuck', this.onStickEvent);\n scrollParent.addEventListener('nanoUnstuck', this.onStickEvent);\n\n if (this.quietModeIsOn) this.attachScrollListeners();\n }\n this.setupParentResizeListener();\n }\n\n /** Handler applied to scrolling parent. When 'hideOnNewStickers' is true, hide this sticker on subsequent stuck stickers. */\n private onStickEvent = async (\n e: CustomEvent<{ sticker: HTMLNanoStickerElement }>\n ) => {\n const sticker = e.detail ? e.detail.sticker : null;\n if (!sticker || sticker.position !== this.position) return;\n\n const incomingTriggerPos = await sticker.getTriggerPos();\n\n if (\n e.type === 'nanoStuck' &&\n sticker !== this.host &&\n sticker.scrollParent === this.host.scrollParent\n ) {\n this.stickerIndex++;\n\n if (!this.hideOnNewStickers) return;\n\n if (\n (this.positions.includes('top') &&\n this.triggerPos.top < incomingTriggerPos.top) ||\n (this.positions.includes('bottom') &&\n this.triggerPos.top > incomingTriggerPos.top)\n ) {\n this.multiStickerHide = true;\n this.stuckCounter++;\n }\n }\n\n if (\n e.type === 'nanoUnstuck' &&\n sticker !== this.host &&\n sticker.scrollParent === this.host.scrollParent\n ) {\n this.stickerIndex--;\n\n if (!this.hideOnNewStickers) return;\n\n if (\n (this.positions.includes('top') &&\n this.triggerPos.top < incomingTriggerPos.top) ||\n (this.positions.includes('bottom') &&\n this.triggerPos.top > incomingTriggerPos.top)\n ) {\n this.stuckCounter--;\n if (this.stuckCounter < 1) this.multiStickerHide = false;\n }\n }\n };\n\n /** Scroll handler applied to scrolling parent. Only applied when quietmode is on.\n * 'hides' stickers when scrolling over 100px away from trigger and 'shows' when scrolling toward */\n private onScroll = () => {\n const y: number = _getScrollTop(this.scrollParent);\n\n // scrolling up\n if (y < this.scrollPosCache) {\n if (!this.positions.includes('bottom')) this.handleScrollTo();\n else this.handleScrollAway(y);\n }\n\n // scrolling down\n if (y > this.scrollPosCache) {\n if (!this.positions.includes('bottom')) this.handleScrollAway(y);\n else this.handleScrollTo();\n }\n this.scrollPosCache = y;\n };\n\n /** Watch for scroll direction. Only applies when quietmode is on.\n * We need to addjust the position of the trigger when the sticker is hidden */\n private handleScrollTo() {\n this.scrollPosThresholdCache = null;\n if (!this.scrollHide) return;\n\n if (this.scrollingTo !== true) {\n this._offset = this.cacheOffset || this._offset;\n }\n this.scrollingTo = true;\n this.scrollHide = false;\n }\n\n private handleScrollAway(currScroll: number) {\n if (this.scrollHide) return;\n\n if (!this.isStuck) return;\n\n if (this.scrollingTo !== false) {\n this.cacheOffset = this._offset;\n this._offset = 0;\n }\n this.scrollingTo = false;\n\n if (!this.scrollPosThresholdCache)\n this.scrollPosThresholdCache = currScroll;\n else if (\n !this.pauseHide &&\n Math.abs(currScroll - this.scrollPosThresholdCache) > 100\n )\n this.scrollHide = true;\n }\n\n private moveTrigger(toInitial?: boolean) {\n if (\n (this.positions.includes('bottom') && !toInitial) ||\n (!this.positions.includes('bottom') && toInitial)\n ) {\n this.host.parentNode.insertBefore(this.trigger, this.host);\n } else\n this.host.parentNode.insertBefore(this.trigger, this.host.nextSibling);\n }\n\n /**\n * Gets the 'closest' scrolling parent\n * @returns either an element with `overflow: scroll | auto` or the parent Document\n */\n private getScrollParent(): HTMLElement | Document {\n const regex = /(auto|scroll)/;\n const parents = (_node: Node, ps: Node[]) => {\n if (_node.parentNode === null) {\n return ps;\n }\n return parents(_node.parentNode, ps.concat([_node]));\n };\n const style = (_node, prop) =>\n getComputedStyle(_node, null).getPropertyValue(prop);\n const overflow = (_node) =>\n style(_node, 'overflow') +\n style(_node, 'overflow-y') +\n style(_node, 'overflow-x');\n const scroll = (_node) => regex.test(overflow(_node));\n const docHeight = document.documentElement.getBoundingClientRect().height;\n\n const scrollParent = (_node: HTMLElement) => {\n if (!(typeof _node === 'object')) return;\n\n const ps = parents(_node, []);\n return (\n ps.find(\n (ele) =>\n scroll(ele) && ele.getBoundingClientRect().height !== docHeight\n ) || document\n );\n };\n\n return scrollParent(this.host);\n }\n\n private shouldStick(data?: IntersectionObserverEntry) {\n let scrollAmt: number;\n\n if (this.positions.includes('top')) {\n if (!this.isRootSticker)\n scrollAmt = _getOffset(this.trigger, this.scrollParent).top;\n else scrollAmt = this.trigger.getBoundingClientRect().top;\n this.isStuck = scrollAmt < -1;\n } else if (this.positions.includes('bottom')) {\n scrollAmt = this.trigger.getBoundingClientRect().top;\n const parentBounding =\n data && data.rootBounds\n ? data.rootBounds\n : (this.scrollParent instanceof Document\n ? document.documentElement\n : this.scrollParent\n ).getBoundingClientRect();\n this.isStuck = scrollAmt > parentBounding.height + parentBounding.top;\n }\n }\n\n private bootstrapGurantor() {\n this.hasBootstrapped = true;\n\n this.scrollParent = this.scrollParent || this.getScrollParent();\n this.isRootSticker = this.scrollParent instanceof Document;\n\n this.trigger = this.trigger || document.createElement('div');\n this.trigger.classList.add('sticker-trigger');\n\n this.positionChange();\n this.moveTrigger(true);\n this.quietModeChange();\n\n this.listenForScrollParent = true;\n this.handleParentEvents(true);\n\n this.stickerIndex = Array.from(\n this.scrollParent.querySelectorAll('nano-sticker')\n )\n .filter(\n (sticker: HTMLNanoStickerElement) => sticker.position === this.position\n )\n .findIndex((sticker) => sticker === this.host);\n\n this.setOffset();\n this.stickerResizeListener();\n this.setupParentResizeListener();\n\n // bit of a hack ... add default 'order'. Required for 'stickTo' elements.\n this.slottedContent = Array.from(this.host.children);\n this.slottedContent.forEach((child: HTMLElement) => {\n child.style.order = this.stickerIndex + '';\n });\n\n this.updateTriggerOffset();\n this.stickToChange();\n this.setupIO();\n this.onStickToDisplayEvent = debounce(this.onStickToDisplayEvent, 50);\n }\n\n // Stencil metthods\n\n connectedCallback() {\n this.isRtl =\n this.host.dir === 'rtl' ||\n (this.host.ownerDocument as Document).dir === 'rtl';\n\n // this is all horrible.... shrug\n document.documentElement.addEventListener('nanoComponentsReady', () => {\n setTimeout((_) => this.bootstrapGurantor(), 200);\n });\n setTimeout((_) => {\n if (!this.hasBootstrapped) this.bootstrapGurantor();\n }, 1000);\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n\n if (this.parentSizeObserver) {\n this.parentSizeObserver.disconnect();\n this.parentSizeObserver = undefined;\n }\n\n this.scrollParent = null;\n this.hasBootstrapped = false;\n }\n\n render() {\n return (\n <Host\n sticky={!this.isRootSticker && !this.stickToEle && this.isSticky}\n hide={this.hide && this.isStuck}\n siblings={this.stuckCounter}\n index={this.stickerIndex}\n stuck={this.isStuck && this.isSticky}\n placed-bottom={this.positions.includes('bottom')}\n placed-top={this.positions.includes('top')}\n placed-end={this.positions.includes('end')}\n placed-start={this.positions.includes('start')}\n >\n <div\n class={{\n sticker: true,\n sticky: this.isRootSticker && this.isSticky,\n stuck: this.isStuck && this.isRootSticker && this.isSticky,\n hide: this.isRootSticker && this.hide && this.isStuck,\n }}\n ref={(div) => (this.sticker = div)}\n >\n <div class=\"sticker-content\" ref={(div) => (this.content = div)}>\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"table-interface.js","sourceRoot":"","sources":["../../../src/components/table/table-interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\nimport type { VNode, FunctionalComponent } from '@stencil/core';\n\nexport declare namespace TableTypes {\n /** The column property */\n type ColumnProp = string | number;\n\n /** Possible positions. Horizontally means l/r. Vertically means top/bottom */\n type Position = 'start' | 'end' | 'top' | 'bottom';\n\n /** A function to assess whether a rendered row will be pinned to the top or bottom */\n type PinFunc = (props?: RowDataSchemaModel) => Position;\n\n /** Function called, via intersection observer, when an element's pinned status changes */\n type PinnedCb = (positions: { [key in Position]?: boolean }) => void;\n\n /** Potential column ordering options */\n type Order = 'asc' | 'desc' | undefined;\n\n /** Column filtering */\n interface Filter {\n prop: TableTypes.Prop;\n filter: string | boolean;\n }\n\n /** Column sorting */\n interface Sort {\n prop: TableTypes.Prop;\n order: TableTypes.Order;\n }\n\n /** Potential html properties which can be passed to a cell or column */\n type CellProps = JSXBase.ThHTMLAttributes<HTMLTableCellElement>;\n\n /** Potential html properties which can be passed to a row */\n type RowProps = JSXBase.HTMLAttributes<HTMLTableRowElement>;\n\n /** data model passed to cell rendering functions */\n interface RenderModel<T = RowGeneric> {\n /** The column property being iterated over */\n prop: keyof T;\n /** The data for this cell */\n cellModel: any;\n /** The column config object */\n column: ColumnConfig<T>;\n /** The row index currently being iterated over */\n rowIndex: number;\n /** The row model currently being iterated over */\n rowModel: RowData<T>;\n }\n\n /** data model passed to row rendering functions */\n interface RowDataSchemaModel<T = RowGeneric> {\n /** the current data row model being iterated over */\n rowModel?: RowData<T>;\n /** the current data row index */\n rowIndex?: number;\n /** The row being rendered. You *must* nest this in your render function otherwise it will not be shown */\n renderedRow?: VNode;\n }\n\n /** A JSX `createElement` function passed to rendering functions.\n * You can use this to create markup outside of JSX environments\n * e.g. https://reactjs.org/docs/react-without-jsx.html */\n interface HFunc<T> {\n (tag: any): T;\n }\n interface HFunc<T> {\n (tag: any, data: any): T;\n }\n interface HFunc<T> {\n (tag: any, text: string): T;\n }\n interface HFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, text: string): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, children: T): T;\n }\n\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row\n **/\n type RowTemplateFunc<T, P> = (\n /** use this to create markup outside of JSX environments\n * e.g. https://reactjs.org/docs/react-without-jsx.html */\n createElement: HFunc<T>,\n /** data passed to each template */\n props: RowDataSchemaModel<P>,\n /** a helper template to minimise boilerplate.\n * A shortcut for `<td><div class=\"nano-tbl__cell-content\"></div></td>` */\n TableCell: FunctionalComponent<{ header?: boolean }>\n ) => T | undefined;\n\n /**\n * A cell render function, called during any cell's render to the dom.\n * It can be used to add any markup within a table cell.\n */\n type CellTemplateFunc<T, P> = (\n createElement: HFunc<T>,\n props: RenderModel<P>\n ) => T | string | undefined;\n\n /**\n * A table header render function, called during any column's render to the dom.\n * It can be used to add any markup within a table header `th`.\n */\n type ColumnTemplateFunc<T, P> = (\n createElement: HFunc<T>,\n col: ColumnConfig<P>\n ) => T | string | undefined;\n\n /** A function used to assess the order of any given column.\n * e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n */\n type ColSortComparator = (\n prop: keyof RowData,\n order: Order\n ) => (a: RowData, b: RowData) => number;\n\n /** A function which can be used to apply any html attribute/s onto a table cell `td` */\n type PropertiesFunc = (props: RenderModel) => CellProps | void | undefined;\n\n /** A function which can be used to apply any html attribute/s onto a table head `th` */\n type ColPropertiesFunc<T> = (\n props: ColumnConfig<T>\n ) => CellProps | void | undefined;\n\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n type RowPropertiesFunc<T> = (\n props: RowDataSchemaModel<T>\n ) => RowProps | void | undefined;\n\n type RowGeneric = { [key: string | number]: any };\n\n /** An individual table cell's data */\n type RowData<T = RowGeneric> = T & {\n __uuid?: string | number;\n __index?: number;\n };\n\n /** A data property */\n type Prop = keyof RowData;\n\n /** Valid column data types */\n type ColumnType =\n | 'text'\n | 'string'\n | 'number'\n | 'date'\n | 'boolean'\n | 'unknown';\n\n /**\n * A table column's configuration\n */\n interface ColumnConfig<T = RowData> {\n /** The title of the column. Displayed in the table header `th` */\n title?: string;\n /** The row's data property to retrieve per cell render */\n prop?: keyof T;\n /** The type of data. Will affect how it is sorted and the available\n * filter operations ('text' uses browser locale to compare).\n * If none supplied, it will be derived by default using the first row of data retrieved. */\n type?: ColumnType;\n /** Whether this column is horizontally pinned to viewport */\n pinned?: Position;\n /** By default cell content too wide for the cell will not wrap,\n * but rather be trimmed with '...'.\n * *Note* 'wrap' is mutually-exclusive from `autoTooltip` */\n wrap?: boolean;\n /** Setting this to true, will automatically watch content that\n * doesn't fit and duplicate it to show in a tooltip.\n * *Note* 'autoTooltip' is mutually-exclusive from `wrap` */\n autoTooltip?: boolean;\n /** Whether this column is a row header; the cell will render a `th` not a `td` */\n rowHeader?: boolean;\n /** Whether this column can be sorted. Defaults to true */\n sortable?: boolean;\n /** Current order of this column */\n order?: Order;\n /** Whether to include this column when doing a general search. Defaults to true */\n searchable?: boolean;\n /** Current filters applied to this column */\n filter?: string | boolean;\n /**\n * A cell render function, called during any cell's render to the dom.\n * It can be used to add any markup within a table cell.\n */\n cellTemplate?: CellTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table cell `td` */\n cellProperties?: PropertiesFunc;\n /**\n * A table header render function, called during any column's render to the dom.\n * It can be used to add any markup within a table header `th`.\n */\n columnTemplate?: ColumnTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table head `th` */\n columnProperties?: ColPropertiesFunc<T>;\n /** A custom sorting comparator function - assess the order of any given column.\n * e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort */\n sortCompareFn?: ColSortComparator | string;\n }\n\n /**\n * Row renderer property. Called during the rendering of any table row\n * controlling it's visual state.\n */\n interface RowRenderer<T = RowData> {\n /** Function to decide whether the row is vertically pinned. */\n pinned?: PinFunc;\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row\n **/\n template?: RowTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n rowProperties?: RowPropertiesFunc<T>;\n }\n\n /**\n * Row renderer property. Called during the rendering of a tables head and foot\n * controlling their visual state.\n */\n interface HeadFootRenderer<T = RowData> {\n /** Function to decide whether the row is vertically pinned. Defaults to `start` for the header and `end` the footer */\n pinned: Position;\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row.\n * If used, and you want to see the rendered row, you *must* nest it within your\n * jsx function e.g. `(h, props) => { return [props.renderedRow, <tr><td>Custom thing</td></tr>]}`\n **/\n template?: RowTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n rowProperties?: () => RowProps | void | undefined;\n }\n\n type TBody = {\n rows: TableTypes.NanoTable['rows'];\n __uuid: string | number;\n };\n\n class NanoTable<T = RowGeneric> {\n rows: T[];\n columns: ColumnConfig<T>[];\n rowRender: RowRenderer<T>;\n headRender: HeadFootRenderer<T>;\n footRender: HeadFootRenderer<T>;\n }\n\n type Falsy = false | 0 | '' | null | undefined;\n}\n"]}
1
+ {"version":3,"file":"table-interface.js","sourceRoot":"","sources":["../../../src/components/table/table-interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\nimport type { VNode, FunctionalComponent } from '@stencil/core';\n\nexport declare namespace TableTypes {\n /** The column property */\n type ColumnProp = string | number;\n\n /** Possible positions. Horizontally means l/r. Vertically means top/bottom */\n type Position = 'start' | 'end' | 'top' | 'bottom';\n\n /** A function to assess whether a rendered row will be pinned to the top or bottom */\n type PinFunc = (props?: RowDataSchemaModel) => Position;\n\n /** Function called, via intersection observer, when an element's pinned status changes */\n type PinnedCb = (\n positions: { [key in Position]?: boolean },\n target: Element\n ) => void;\n\n /** Potential column ordering options */\n type Order = 'asc' | 'desc' | undefined;\n\n /** Column filtering */\n interface Filter {\n prop: TableTypes.Prop;\n filter: string | boolean | string[];\n }\n\n /** Column sorting */\n interface Sort {\n prop: TableTypes.Prop;\n order: TableTypes.Order;\n }\n\n /** Potential html properties which can be passed to a cell or column */\n type CellProps = JSXBase.ThHTMLAttributes<HTMLTableCellElement>;\n\n /** Potential html properties which can be passed to a row */\n type RowProps = JSXBase.HTMLAttributes<HTMLTableRowElement>;\n\n /** data model passed to cell rendering functions */\n interface RenderModel<T = RowGeneric> {\n /** The column property being iterated over */\n prop: keyof T;\n /** The data for this cell */\n cellModel: any;\n /** The column config object */\n column: ColumnConfig<T>;\n /** The row index currently being iterated over */\n rowIndex: number;\n /** The row model currently being iterated over */\n rowModel: RowData<T>;\n }\n\n /** data model passed to row rendering functions */\n interface RowDataSchemaModel<T = RowGeneric> {\n /** the current data row model being iterated over */\n rowModel?: RowData<T>;\n /** the current data row index */\n rowIndex?: number;\n /** The row being rendered. You *must* nest this in your render function otherwise it will not be shown */\n renderedRow?: VNode;\n }\n\n /** A JSX `createElement` function passed to rendering functions.\n * You can use this to create markup outside of JSX environments\n * e.g. https://reactjs.org/docs/react-without-jsx.html */\n interface HFunc<T> {\n (tag: any): T;\n }\n interface HFunc<T> {\n (tag: any, data: any): T;\n }\n interface HFunc<T> {\n (tag: any, text: string): T;\n }\n interface HFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, text: string): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n }\n interface HFunc<T> {\n (sel: any, data: any, children: T): T;\n }\n\n /**\n * Properties that can be used with the row template `TableCell` jsx partial\n */\n type TableRowCellHelperProps = {\n header?: boolean;\n wrap?: boolean;\n cellProps?: CellProps;\n wrapperProps?: JSXBase.HTMLAttributes<HTMLDivElement>;\n };\n\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row\n **/\n type RowTemplateFunc<T, P> = (\n /** use this to create markup outside of JSX environments\n * e.g. https://reactjs.org/docs/react-without-jsx.html */\n createElement: HFunc<T>,\n /** data passed to each template */\n props: RowDataSchemaModel<P>,\n /** a helper template to minimise boilerplate.\n * A shortcut for `<td><div class=\"nano-tbl__cell-content\"></div></td>` */\n TableCell: FunctionalComponent<TableRowCellHelperProps>\n ) => T | undefined;\n\n /**\n * A cell render function, called during any cell's render to the dom.\n * It can be used to add any markup within a table cell.\n */\n type CellTemplateFunc<T, P> = (\n createElement: HFunc<T>,\n props: RenderModel<P>\n ) => TplResult;\n\n /**\n * A table header render function, called during any column's render to the dom.\n * It can be used to add any markup within a table header `th`.\n */\n type ColumnTemplateFunc<T, P> = (\n createElement: HFunc<T>,\n col: ColumnConfig<P>\n ) => TplResult;\n\n /** A function used to assess the order of any given column.\n * e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n */\n type ColSortComparator = (\n prop: keyof RowData,\n order: Order\n ) => (a: RowData, b: RowData) => number;\n\n /** A function which can be used to apply any html attribute/s onto a table cell `td` */\n type PropertiesFunc = (props: RenderModel) => CellProps | void | undefined;\n\n /** A function which can be used to apply any html attribute/s onto a table head `th` */\n type ColPropertiesFunc<T> = (\n props: ColumnConfig<T>\n ) => CellProps | void | undefined;\n\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n type RowPropertiesFunc<T> = (\n props: RowDataSchemaModel<T>\n ) => RowProps | void | undefined;\n\n type RowGeneric = { [key: string | number]: any };\n\n /** An individual table cell's data */\n type RowData<T = RowGeneric> = T & {\n __uuid?: string | number;\n __index?: number;\n };\n\n /** A data property */\n type Prop = keyof RowData;\n\n /** Valid column data types */\n type ColumnType =\n | 'text'\n | 'string'\n | 'number'\n | 'date'\n | 'boolean'\n | 'unknown';\n\n type LibJSX = { [key: string]: any };\n type JSXRender = VNode | VNode[] | LibJSX | LibJSX[];\n type TplResult = JSXRender | string | Element | undefined;\n\n /**\n * A table column's configuration\n */\n interface ColumnConfig<T = RowData> {\n /** The title of the column. Displayed in the table header `th` */\n title?: string;\n /** The row's data property to retrieve per cell render */\n prop?: keyof T;\n /** The type of data. Will affect how it is sorted and the available\n * filter operations ('text' uses browser locale to compare).\n * If none supplied, it will be derived by default using the first row of data retrieved. */\n type?: ColumnType;\n /** Whether this column is horizontally pinned to viewport */\n pinned?: Position;\n /** By default cell content too wide for the cell will not wrap,\n * but rather be trimmed with '...'.\n * *Note* 'wrap' is mutually-exclusive from `autoTooltip` */\n wrap?: boolean;\n /** Setting this to true, will automatically watch content that\n * doesn't fit and duplicate it to show in a tooltip.\n * *Note* 'autoTooltip' is mutually-exclusive from `wrap` */\n autoTooltip?: boolean;\n /** Whether this column is a row header; the cell will render a `th` not a `td` */\n rowHeader?: boolean;\n /** Whether this column can be sorted. Defaults to true */\n sortable?: boolean;\n /** Current order of this column */\n order?: Order;\n /** Whether to include this column when doing a general search. Defaults to true */\n searchable?: boolean;\n /** Current filters applied to this column */\n filter?: string | boolean | string[];\n /**\n * A cell render function, called during any cell's render to the dom.\n * It can be used to add any markup within a table cell.\n */\n cellTemplate?: CellTemplateFunc<JSXRender, T>;\n /** A function which can be used to apply any html attribute/s onto a table cell `td` */\n cellProperties?: PropertiesFunc;\n /**\n * A table header render function, called during any column's render to the dom.\n * It can be used to add any markup within a table header `th`.\n */\n columnTemplate?: ColumnTemplateFunc<JSXRender, T>;\n /** A function which can be used to apply any html attribute/s onto a table head `th` */\n columnProperties?: ColPropertiesFunc<T>;\n /** A custom sorting comparator function - assess the order of any given column.\n * e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort */\n sortCompareFn?: ColSortComparator | string;\n }\n\n /**\n * Row renderer property. Called during the rendering of any table row\n * controlling it's visual state.\n */\n interface RowRenderer<T = RowData> {\n /** Function to decide whether the row is vertically pinned. */\n pinned?: PinFunc;\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row\n **/\n template?: RowTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n rowProperties?: RowPropertiesFunc<T>;\n }\n\n /**\n * Row renderer property. Called during the rendering of a tables head and foot\n * controlling their visual state.\n */\n interface HeadFootRenderer<T = RowData> {\n /** Position prop. Defaults to `top` for the header and `bottom` the footer */\n pinned: Position;\n /**\n * A row render function, called during a any row's render to the dom.\n * It can be used to add extra markup around any given table row.\n * If used, and you want to see the rendered row, you *must* nest it within your\n * jsx function e.g. `(h, props) => { return [props.renderedRow, <tr><td>Custom thing</td></tr>]}`\n **/\n template?: RowTemplateFunc<VNode | VNode[], T>;\n /** A function which can be used to apply any html attribute/s onto a table row `tr` */\n rowProperties?: () => RowProps | void | undefined;\n }\n\n type TBody = {\n rows: TableTypes.NanoTable['rows'];\n __uuid: string | number;\n };\n\n class NanoTable<T = RowGeneric> {\n rows: T[];\n columns: ColumnConfig<T>[];\n rowRender: RowRenderer<T>;\n headRender: HeadFootRenderer<T>;\n footRender: HeadFootRenderer<T>;\n }\n\n type Falsy = false | 0 | '' | null | undefined;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import { Fragment, h } from '@stencil/core';
4
+ import { Fragment, h, getRenderingRef, } from '@stencil/core';
5
5
  import { CSSNAMESPACE } from './table.constants';
6
6
  import { classListToStr, colDataModel, fetchStores, mergeCellProperties, } from './table.utils';
7
7
  // TABLE CELL
@@ -12,12 +12,13 @@ import { classListToStr, colDataModel, fetchStores, mergeCellProperties, } from
12
12
  * @param colIndex - the current column index being rendered
13
13
  * @returns - a JSX node
14
14
  */
15
- export function cellRender(rowIndex, colIndex) {
15
+ function cellRender(rowIndex, colIndex) {
16
16
  var _a, _b;
17
17
  const store = fetchStores();
18
18
  const columns = store.config.state.columns;
19
19
  const tpl = (_a = columns[colIndex]) === null || _a === void 0 ? void 0 : _a.cellTemplate;
20
20
  const model = colDataModel(rowIndex, colIndex);
21
+ const tableInstance = getRenderingRef();
21
22
  if (!!model.cellModel && columns[colIndex].type === 'date') {
22
23
  const d = new Date(model.cellModel);
23
24
  if (d instanceof Date && !isNaN(d)) {
@@ -26,7 +27,28 @@ export function cellRender(rowIndex, colIndex) {
26
27
  : d;
27
28
  }
28
29
  }
29
- return tpl ? (tpl(h, model)) : model.cellModel !== undefined && model.cellModel !== null ? (h(Fragment, null, (_b = model.cellModel) === null || _b === void 0 ? void 0 : _b.toString())) : ('');
30
+ // Wrap the h pragma, then we can know if we're using Stencil's
31
+ // jsx renderer or a different one
32
+ let hCalled = false;
33
+ const hWrap = (...args) => {
34
+ hCalled = true;
35
+ return h(...args);
36
+ };
37
+ let tplResult = tpl ? tpl(hWrap, model) : undefined;
38
+ if (tplResult &&
39
+ tableInstance.customRenderer &&
40
+ tplResult['$attrs$'] === undefined &&
41
+ !(tplResult instanceof Element) &&
42
+ typeof tplResult !== 'string' &&
43
+ !hCalled) {
44
+ // template result is jsx *not* from Stencil.
45
+ // Render it now and output it later.
46
+ const templateEle = document.createElement('template');
47
+ // @ts-expect-error
48
+ tableInstance.customRenderer(tplResult, templateEle.content);
49
+ tplResult = templateEle;
50
+ }
51
+ return tplResult ? (tplResult) : model.cellModel !== undefined && model.cellModel !== null ? (h(Fragment, null, (_b = model.cellModel) === null || _b === void 0 ? void 0 : _b.toString())) : ('');
30
52
  }
31
53
  export const baseCellClasses = (colIndex, toString = false) => {
32
54
  const store = fetchStores();
@@ -47,6 +69,7 @@ export const TableCell = ({ rowIndex, colIndex, nestedContent, }) => {
47
69
  ? nestedContent()
48
70
  : cellRender(rowIndex, colIndex) || (h("span", { class: "placeholder" }, "\u00A0"));
49
71
  let CellType = 'td';
72
+ const tableInstance = getRenderingRef();
50
73
  const store = fetchStores();
51
74
  const column = store.config.state.columns[colIndex];
52
75
  let props = mergeCellProperties(rowIndex, colIndex, {
@@ -58,13 +81,23 @@ export const TableCell = ({ rowIndex, colIndex, nestedContent, }) => {
58
81
  ? Object.assign(Object.assign({}, props), { scope: 'rowgroup' }) : Object.assign(Object.assign({}, props), { scope: 'row' });
59
82
  CellType = 'th';
60
83
  }
61
- const ContentWrap = (props) => (h("div", Object.assign({}, props, { class: {
62
- [`${CSSNAMESPACE}__cell-content`]: true,
63
- [`${CSSNAMESPACE}__cell-content--wrap`]: !!column.wrap,
64
- } }), h(Content, null)));
65
- return (h(CellType
66
- // role="gridcell"
67
- , Object.assign({}, props), column.autoTooltip && !column.wrap ? (h("nano-resize-observe", { notifyContentFit: "x", onNanoResizeContentFitChange: (e) => (e.target.firstElementChild.disabled =
84
+ const ContentWrap = (props) => {
85
+ const content = Content();
86
+ return (h("div", Object.assign({ ref: (d) => {
87
+ if (d && content instanceof Element) {
88
+ d.replaceChildren();
89
+ d.append(content['content'] || content);
90
+ }
91
+ } }, props, { class: {
92
+ [`${CSSNAMESPACE}__cell-content`]: true,
93
+ [`${CSSNAMESPACE}__cell-content--wrap`]: !!column.wrap,
94
+ }, innerHTML: typeof content === 'string' && content.includes('<')
95
+ ? content
96
+ : undefined }), (typeof content !== 'string' || !content.includes('<')) &&
97
+ !(content instanceof Element) &&
98
+ content));
99
+ };
100
+ return (h(CellType, Object.assign({ role: tableInstance.type === 'grid' ? 'gridcell' : undefined }, props), column.autoTooltip && !column.wrap ? (h("nano-resize-observe", { notifyContentFit: "x", onNanoResizeContentFitChange: (e) => (e.target.firstElementChild.disabled =
68
101
  e.detail.x) }, h("nano-tooltip", { disabled: true, placement: "top", onNanoShow: (e) => (e.target.closest(CellType).style.zIndex = '100'), onNanoHide: (e) => (e.target.closest(CellType).style.zIndex = '') }, h(ContentWrap, null), h("span", { slot: "content" }, h(Content, null))))) : (h(ContentWrap, null))));
69
102
  };
70
103
  //# sourceMappingURL=table.cell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.cell.js","sourceRoot":"","sources":["../../../src/components/table/table.cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,CAAC,EAAS,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAGvB,aAAa;AACb,qCAAqC;AAErC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAgB;;EAC3D,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;EAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;EAC3C,MAAM,GAAG,GAAG,MAAA,O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AAM,WAAW,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAC7B,2BACM,KAAK,IACT,KAAK,EAAE;MACL,CAAC,GAAG,YAAY,gBAAgB,CAAC,EAAE,IAAI;MACvC,CAAC,GAAG,YAAY,sBAAsB,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI;KACvD;IAED,EAAC,OAAO,OAAG,CACP,CACP,CAAC;EAEF,OAAO,CACL,EAAC,QAAQ;EACP,kBAAkB;sBACd,KAAK,GAER,MAAM,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CACpC,2BACE,gBAAgB,EAAC,GAAG,EACpB,4BAA4B,EAAE,CAC5B,CAA+C,EAC/C,EAAE,CACF,CAAE,CAAC,CAAC,MAAM,CAAC,iBAA4C,CAAC,QAAQ;MAC9D,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAGf,oBACE,QAAQ,QACR,SAAS,EAAC,KAAK,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAChB,CAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAiB,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,EAEpE,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAChB,CAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAiB,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;MAGjE,EAAC,WAAW,OAAG;MACf,YAAM,IAAI,EAAC,SAAS;QAClB,EAAC,OAAO,OAAG,CACN,CACM,CACK,CACvB,CAAC,CAAC,CAAC,CACF,EAAC,WAAW,OAAG,CAChB,CACQ,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Fragment, FunctionalComponent, h, VNode } from '@stencil/core';\nimport { CSSNAMESPACE } from './table.constants';\nimport {\n classListToStr,\n colDataModel,\n fetchStores,\n mergeCellProperties,\n} from './table.utils';\nimport type { NanoResizeObserveCustomEvent, TableTypes } from '../../interface';\n\n// TABLE CELL\n// (tbody > tr > td, tbody > tr > th)\n\n/**\n * Renders a cell using a custom renderer if set.\n * @param rowIndex - the current row index being rendered\n * @param colIndex - the current column index being rendered\n * @returns - a JSX node\n */\nexport function cellRender(rowIndex: number, colIndex: number): VNode {\n const store = fetchStores();\n const columns = store.config.state.columns;\n const tpl = columns[colIndex]?.cellTemplate;\n const model = colDataModel(rowIndex, colIndex);\n\n if (!!model.cellModel && columns[colIndex].type === 'date') {\n const d = new Date(model.cellModel);\n if (d instanceof Date && !isNaN(d as any)) {\n model.cellModel = !tpl\n ? `${new Date(model.cellModel).toLocaleDateString()} ${new Date(\n model.cellModel\n ).toLocaleTimeString()}`\n : d;\n }\n }\n\n return tpl ? (\n tpl(h as unknown as TableTypes.HFunc<VNode>, model)\n ) : model.cellModel !== undefined && model.cellModel !== null ? (\n <Fragment>{model.cellModel?.toString()}</Fragment>\n ) : (\n ''\n );\n}\n\nexport const baseCellClasses = (\n colIndex: number,\n toString: boolean = false\n) => {\n const store = fetchStores();\n const column = store.config.state.columns[colIndex];\n\n const classes = {\n [`${CSSNAMESPACE}__td`]: true,\n [`${CSSNAMESPACE}__ordered`]: !!column.order,\n [`${CSSNAMESPACE}__pin`]: !!column.pinned,\n [`${CSSNAMESPACE}__pin--start`]: column.pinned === 'start',\n [`${CSSNAMESPACE}__pin--end`]: column.pinned === 'end',\n };\n\n if (toString) return classListToStr(classes);\n return classes;\n};\n\ntype TableCellProps = {\n rowIndex: number;\n colIndex: number;\n nestedContent?: () => VNode;\n};\n\nexport const TableCell: FunctionalComponent<TableCellProps> = ({\n rowIndex,\n colIndex,\n nestedContent,\n}) => {\n const Content = () =>\n nestedContent\n ? nestedContent()\n : cellRender(rowIndex, colIndex) || (\n <span class=\"placeholder\">&nbsp;</span>\n );\n\n let CellType = 'td';\n const store = fetchStores();\n const column = store.config.state.columns[colIndex];\n let props = mergeCellProperties(rowIndex, colIndex, {\n class: baseCellClasses(colIndex),\n });\n\n if (column.rowHeader) {\n props =\n Number((props as TableTypes.CellProps).rowSpan) > 1\n ? { ...props, scope: 'rowgroup' }\n : { ...props, scope: 'row' };\n CellType = 'th';\n }\n\n const ContentWrap = (props) => (\n <div\n {...props}\n class={{\n [`${CSSNAMESPACE}__cell-content`]: true,\n [`${CSSNAMESPACE}__cell-content--wrap`]: !!column.wrap,\n }}\n >\n <Content />\n </div>\n );\n\n return (\n <CellType\n // role=\"gridcell\"\n {...props}\n >\n {column.autoTooltip && !column.wrap ? (\n <nano-resize-observe\n notifyContentFit=\"x\"\n onNanoResizeContentFitChange={(\n e: NanoResizeObserveCustomEvent<{ x: boolean }>\n ) =>\n ((e.target.firstElementChild as HTMLNanoTooltipElement).disabled =\n e.detail.x)\n }\n >\n <nano-tooltip\n disabled\n placement=\"top\"\n onNanoShow={(e) =>\n ((e.target.closest(CellType) as HTMLElement).style.zIndex = '100')\n }\n onNanoHide={(e) =>\n ((e.target.closest(CellType) as HTMLElement).style.zIndex = '')\n }\n >\n <ContentWrap />\n <span slot=\"content\">\n <Content />\n </span>\n </nano-tooltip>\n </nano-resize-observe>\n ) : (\n <ContentWrap />\n )}\n </CellType>\n );\n};\n"]}
1
+ {"version":3,"file":"table.cell.js","sourceRoot":"","sources":["../../../src/components/table/table.cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,CAAC,EAED,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAIvB,aAAa;AACb,qCAAqC;AAErC;;;;;GAKG;AACH,SAAS,UAAU,CACjB,QAAgB,EAChB,QAAgB;;EAEhB,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;EAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;EAC3C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OAAG,CAChB,CACQ,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n Fragment,\n FunctionalComponent,\n h,\n VNode,\n getRenderingRef,\n} from '@stencil/core';\nimport { CSSNAMESPACE } from './table.constants';\nimport {\n classListToStr,\n colDataModel,\n fetchStores,\n mergeCellProperties,\n} from './table.utils';\nimport type { NanoResizeObserveCustomEvent, TableTypes } from '../../interface';\nimport type { Table } from './table';\n\n// TABLE CELL\n// (tbody > tr > td, tbody > tr > th)\n\n/**\n * Renders a cell using a custom renderer if set.\n * @param rowIndex - the current row index being rendered\n * @param colIndex - the current column index being rendered\n * @returns - a JSX node\n */\nfunction cellRender(\n rowIndex: number,\n colIndex: number\n): VNode | string | Element {\n const store = fetchStores();\n const columns = store.config.state.columns;\n const tpl = columns[colIndex]?.cellTemplate;\n const model = colDataModel(rowIndex, colIndex);\n const tableInstance = getRenderingRef() as Table;\n\n if (!!model.cellModel && columns[colIndex].type === 'date') {\n const d = new Date(model.cellModel);\n if (d instanceof Date && !isNaN(d as any)) {\n model.cellModel = !tpl\n ? `${new Date(model.cellModel).toLocaleDateString()} ${new Date(\n model.cellModel\n ).toLocaleTimeString()}`\n : d;\n }\n }\n\n // Wrap the h pragma, then we can know if we're using Stencil's\n // jsx renderer or a different one\n let hCalled = false;\n const hWrap = (...args: [any[]]) => {\n hCalled = true;\n return h(...args);\n };\n let tplResult = tpl ? tpl(hWrap, model) : undefined;\n\n if (\n tplResult &&\n tableInstance.customRenderer &&\n tplResult['$attrs$'] === undefined &&\n !(tplResult instanceof Element) &&\n typeof tplResult !== 'string' &&\n !hCalled\n ) {\n // template result is jsx *not* from Stencil.\n // Render it now and output it later.\n const templateEle = document.createElement('template');\n // @ts-expect-error\n tableInstance.customRenderer(tplResult, templateEle.content);\n tplResult = templateEle;\n }\n\n return tplResult ? (\n tplResult\n ) : model.cellModel !== undefined && model.cellModel !== null ? (\n <Fragment>{model.cellModel?.toString()}</Fragment>\n ) : (\n ''\n );\n}\n\nexport const baseCellClasses = (\n colIndex: number,\n toString: boolean = false\n) => {\n const store = fetchStores();\n const column = store.config.state.columns[colIndex];\n\n const classes = {\n [`${CSSNAMESPACE}__td`]: true,\n [`${CSSNAMESPACE}__ordered`]: !!column.order,\n [`${CSSNAMESPACE}__pin`]: !!column.pinned,\n [`${CSSNAMESPACE}__pin--start`]: column.pinned === 'start',\n [`${CSSNAMESPACE}__pin--end`]: column.pinned === 'end',\n };\n\n if (toString) return classListToStr(classes);\n return classes;\n};\n\ntype TableCellProps = {\n rowIndex: number;\n colIndex: number;\n nestedContent?: () => VNode;\n};\n\nexport const TableCell: FunctionalComponent<TableCellProps> = ({\n rowIndex,\n colIndex,\n nestedContent,\n}) => {\n const Content = (): TableTypes.TplResult =>\n nestedContent\n ? nestedContent()\n : cellRender(rowIndex, colIndex) || (\n <span class=\"placeholder\">&nbsp;</span>\n );\n\n let CellType = 'td';\n const tableInstance = getRenderingRef() as Table;\n const store = fetchStores();\n const column = store.config.state.columns[colIndex];\n let props = mergeCellProperties(rowIndex, colIndex, {\n class: baseCellClasses(colIndex),\n });\n\n if (column.rowHeader) {\n props =\n Number((props as TableTypes.CellProps).rowSpan) > 1\n ? { ...props, scope: 'rowgroup' }\n : { ...props, scope: 'row' };\n CellType = 'th';\n }\n\n const ContentWrap = (props) => {\n const content = Content();\n\n return (\n <div\n ref={(d) => {\n if (d && content instanceof Element) {\n d.replaceChildren();\n d.append(content['content'] || content);\n }\n }}\n {...props}\n class={{\n [`${CSSNAMESPACE}__cell-content`]: true,\n [`${CSSNAMESPACE}__cell-content--wrap`]: !!column.wrap,\n }}\n innerHTML={\n typeof content === 'string' && content.includes('<')\n ? content\n : undefined\n }\n >\n {(typeof content !== 'string' || !content.includes('<')) &&\n !(content instanceof Element) &&\n content}\n </div>\n );\n };\n\n return (\n <CellType\n role={tableInstance.type === 'grid' ? 'gridcell' : undefined}\n {...props}\n >\n {column.autoTooltip && !column.wrap ? (\n <nano-resize-observe\n notifyContentFit=\"x\"\n onNanoResizeContentFitChange={(\n e: NanoResizeObserveCustomEvent<{ x: boolean }>\n ) =>\n ((e.target.firstElementChild as HTMLNanoTooltipElement).disabled =\n e.detail.x)\n }\n >\n <nano-tooltip\n disabled\n placement=\"top\"\n onNanoShow={(e) =>\n ((e.target.closest(CellType) as HTMLElement).style.zIndex = '100')\n }\n onNanoHide={(e) =>\n ((e.target.closest(CellType) as HTMLElement).style.zIndex = '')\n }\n >\n <ContentWrap />\n <span slot=\"content\">\n <Content />\n </span>\n </nano-tooltip>\n </nano-resize-observe>\n ) : (\n <ContentWrap />\n )}\n </CellType>\n );\n};\n"]}
@@ -73,9 +73,9 @@ nano-table {
73
73
  --ordered-bg-rgb: var(--nano-color-offwhite-rgb, 249 249 251);
74
74
  --td-padding-start: 0.625rem;
75
75
  --td-padding-end: 0.625rem;
76
- --td-padding-top: 0.5rem;
77
- --td-padding-bottom: 0.4125rem;
78
- --th-padding-start: 0.625rem;
76
+ --td-padding-top: 0.6rem;
77
+ --td-padding-bottom: 0.6125rem;
78
+ --th-padding-start: 0.725rem;
79
79
  --th-padding-end: 0.625rem;
80
80
  --th-padding-top: 0.875rem;
81
81
  --th-padding-bottom: 0.6875rem;
@@ -214,7 +214,7 @@ tbody:last-of-type tr:last-child .nano-tbl__td, tbody:last-of-type tr:last-child
214
214
  thead .nano-tbl__td, thead .nano-tbl__th {
215
215
  color: var(--thead-color);
216
216
  font-weight: 800;
217
- background: rgb(var(--head-bg-rgb)/90%);
217
+ background: rgb(var(--head-bg-rgb)/100%);
218
218
  font-size: var(--thead-font-size);
219
219
  -webkit-border-before: none !important;
220
220
  border-block-start: none !important;
@@ -236,7 +236,7 @@ tfoot .nano-tbl__td, tfoot .nano-tbl__th {
236
236
  font-weight: 800;
237
237
  -webkit-border-before: none;
238
238
  border-block-start: none;
239
- background: rgb(var(--foot-bg-rgb)/90%);
239
+ background: rgb(var(--foot-bg-rgb)/100%);
240
240
  font-size: var(--thead-font-size);
241
241
  }
242
242
  tfoot .nano-tbl__td .nano-tbl__cell-content, tfoot .nano-tbl__th .nano-tbl__cell-content {
@@ -264,7 +264,10 @@ tfoot .nano-tbl__td .nano-tbl__cell-content, tfoot .nano-tbl__th .nano-tbl__cell
264
264
  will-change: scroll-position;
265
265
  opacity: 1;
266
266
  transition: 0.1s ease opacity;
267
- transform: translateZ(0);
267
+ }
268
+ .nano-tbl tbody.nano-tbl__loading {
269
+ z-index: -1;
270
+ position: relative;
268
271
  }
269
272
  .nano-tbl tbody.nano-tbl__inactive {
270
273
  opacity: 0;
@@ -279,47 +282,32 @@ tfoot .nano-tbl__td .nano-tbl__cell-content, tfoot .nano-tbl__th .nano-tbl__cell
279
282
  font-weight: 800;
280
283
  margin: 0;
281
284
  }
282
- .nano-tbl__pin {
283
- position: sticky;
284
- transform: translateZ(0);
285
- }
286
285
  .nano-tbl__pin--start {
287
- inset-inline: -1px auto;
288
- transition: max-width 0.25s ease;
286
+ position: sticky;
287
+ inset-inline-start: var(--pin-start, -1px);
289
288
  }
290
289
  .nano-tbl__pin--start::after {
291
290
  content: "";
292
291
  position: absolute;
293
292
  inset: 0;
294
- box-shadow: 5px 1px 4px 0 rgba(0, 0, 0, 0.2);
295
- opacity: 0;
293
+ box-shadow: 5px 0 4px -1px rgba(0, 0, 0, 0.2);
294
+ opacity: var(--pin-start-active, 0);
296
295
  z-index: -1;
297
296
  }
298
297
  .nano-tbl__pinned--start .nano-tbl__pin--start {
299
298
  z-index: 2;
300
- max-width: 125px !important;
301
- }
302
- .sm .nano-tbl__pinned--start .nano-tbl__pin--start {
303
- max-width: var(--max-col-width) !important;
304
- }
305
- .nano-tbl__pinned--start .nano-tbl__pin--start::after {
306
- opacity: 1;
307
299
  }
308
300
  .nano-tbl__pin--end {
309
- /*
310
- I cannot think of a nice way to make stuck-end columns play nice on small screens :(
311
- Changing the width when stuck (as we do for stuck-start columns) causes the whole positioning to change.
312
- This fires the IO, thus un-sticks the column, thus causes the IO to fire which sticks the column ad-infinitum
313
- */
301
+ position: sticky;
314
302
  }
315
303
  .nano-tbl__pin--start + .nano-tbl__pin--end {
316
- inset-inline: auto auto;
304
+ inset-inline-end: auto !important;
317
305
  }
318
306
  .nano-tbl__pin--start + .nano-tbl__pin--end::after {
319
307
  display: none;
320
308
  }
321
309
  .sm .nano-tbl__pin--end {
322
- inset-inline: auto -1px !important;
310
+ inset-inline-end: var(--pin-end, -1px);
323
311
  max-width: min(50vw, 200px);
324
312
  }
325
313
  .sm .nano-tbl__pin--end::after {
@@ -327,49 +315,42 @@ tfoot .nano-tbl__td .nano-tbl__cell-content, tfoot .nano-tbl__th .nano-tbl__cell
327
315
  content: "";
328
316
  position: absolute;
329
317
  inset: 0;
330
- box-shadow: -5px 1px 4px 0 rgba(0, 0, 0, 0.2);
331
- opacity: 0;
318
+ box-shadow: -5px 1px 4px -1px rgba(0, 0, 0, 0.2);
319
+ opacity: var(--pin-end-active, 0);
332
320
  z-index: -1;
333
321
  }
334
- .sm .nano-tbl__pinned--end .nano-tbl__pin--end::after {
335
- opacity: 1;
322
+ .sm .nano-tbl__pinned--end .nano-tbl__pin--end {
323
+ z-index: 3;
336
324
  }
337
- .nano-tbl__pin--top {
338
- inset-block: -1px auto;
325
+ .nano-tbl__pin--top .nano-tbl__th, .nano-tbl__pin--top .nano-tbl__td {
326
+ position: sticky;
327
+ inset-block-start: var(--pin-top, -1px);
339
328
  }
340
- .nano-tbl__pinned--top .nano-tbl__pin--top {
329
+ .nano-tbl__pin--top.nano-tbl__pinned--top .nano-tbl__th, .nano-tbl__pin--top.nano-tbl__pinned--top .nano-tbl__td {
341
330
  z-index: 4 !important;
342
331
  }
343
- .nano-tbl__pin--bottom {
344
- inset-block: auto -1px;
345
- }
346
- .nano-tbl__pinned--bottom .nano-tbl__pin--bottom {
347
- z-index: 5 !important;
348
- }
349
- .nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pin--start {
350
- z-index: 5 !important;
351
- }
352
- .nano-tbl__pinned--top.nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pin--start {
332
+ .nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pinned--top .nano-tbl__pin--start {
353
333
  z-index: 6 !important;
354
334
  }
355
- .nano-tbl__pinned--end .nano-tbl__pin--top.nano-tbl__pin--end {
356
- z-index: 5 !important;
335
+ tbody .nano-tbl__pin--top.nano-tbl__pinned--top .nano-tbl__th, tbody .nano-tbl__pin--top.nano-tbl__pinned--top .nano-tbl__td {
336
+ box-shadow: 1px 3px 4px -1px rgba(0, 0, 0, 0.1);
357
337
  }
358
- .nano-tbl__pinned--top.nano-tbl__pinned--end .nano-tbl__pin--top.nano-tbl__pin--end {
359
- z-index: 6 !important;
338
+ .nano-tbl__pin--bottom .nano-tbl__th, .nano-tbl__pin--bottom .nano-tbl__td {
339
+ position: sticky;
340
+ inset-block-end: var(--pin-bottom, -1px);
360
341
  }
361
- .nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pin--start {
342
+ .nano-tbl__pin--bottom.nano-tbl__pinned--bottom .nano-tbl__th, .nano-tbl__pin--bottom.nano-tbl__pinned--bottom .nano-tbl__td {
362
343
  z-index: 5 !important;
363
344
  }
364
- .nano-tbl__pinned--bottom.nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pin--start {
345
+ .nano-tbl__pin--bottom.nano-tbl__pinned--bottom:has(~ .nano-tbl__pin--bottom.nano-tbl__pinned--bottom) .nano-tbl__th, .nano-tbl__pin--bottom.nano-tbl__pinned--bottom:has(~ .nano-tbl__pin--bottom.nano-tbl__pinned--bottom) .nano-tbl__td {
365
346
  z-index: 6 !important;
366
347
  }
367
- .nano-tbl__pinned--end .nano-tbl__pin--bottom.nano-tbl__pin--end {
368
- z-index: 5 !important;
369
- }
370
- .nano-tbl__pinned--bottom.nano-tbl__pinned--end .nano-tbl__pin--bottom.nano-tbl__pin--end {
348
+ .nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pinned--bottom .nano-tbl__pin--start {
371
349
  z-index: 6 !important;
372
350
  }
351
+ tbody .nano-tbl__pin--bottom.nano-tbl__pinned--bottom .nano-tbl__th, tbody .nano-tbl__pin--bottom.nano-tbl__pinned--bottom .nano-tbl__td {
352
+ box-shadow: 1px -3px 4px -1px rgba(0, 0, 0, 0.07);
353
+ }
373
354
  .nano-tbl thead tr:last-of-type td,
374
355
  .nano-tbl thead tr:last-of-type th {
375
356
  -webkit-border-after: var(--border-tint-style);
@@ -382,6 +363,8 @@ tfoot .nano-tbl__td .nano-tbl__cell-content, tfoot .nano-tbl__th .nano-tbl__cell
382
363
  }
383
364
  .nano-tbl tfoot tr:last-of-type td,
384
365
  .nano-tbl tfoot tr:last-of-type th {
366
+ -webkit-border-before: var(--border-style);
367
+ border-block-start: var(--border-style);
385
368
  -webkit-border-after: var(--border-tint-style);
386
369
  border-block-end: var(--border-tint-style);
387
370
  }