@nanoporetech-digital/components 3.5.1 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/{date-utils-c581f187.js → date-utils-42fbcb42.js} +5 -3
  3. package/dist/cjs/date-utils-42fbcb42.js.map +1 -0
  4. package/dist/cjs/index-41582c2a.js +2 -6
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/nano-components.cjs.js +1 -1
  7. package/dist/cjs/nano-datalist_3.cjs.entry.js +10 -5
  8. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  9. package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
  10. package/dist/cjs/nano-date-picker.cjs.entry.js +1 -1
  11. package/dist/cjs/nano-demo.cjs.entry.js +3 -2
  12. package/dist/cjs/nano-demo.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nano-dropdown.cjs.entry.js +5 -2
  14. package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nano-file-upload.cjs.entry.js +4 -0
  16. package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +1 -2
  18. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nano-icon-button.cjs.entry.js +1 -1
  20. package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
  21. package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
  22. package/dist/cjs/{nano-tooltip.cjs.entry.js → nano-progress-bar_2.cjs.entry.js} +28 -4
  23. package/dist/cjs/nano-progress-bar_2.cjs.entry.js.map +1 -0
  24. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +74 -12
  25. package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nano-sticker.cjs.entry.js +2 -0
  27. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  28. package/dist/cjs/nano-tab-group.cjs.entry.js +1 -1
  29. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  30. package/dist/cjs/{nano-table-067e0c12.js → nano-table-56eb29c1.js} +172 -88
  31. package/dist/cjs/nano-table-56eb29c1.js.map +1 -0
  32. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  33. package/dist/cjs/{table.worker-a4d75c46.js → table.worker-b1c53001.js} +3 -3
  34. package/dist/cjs/table.worker-b1c53001.js.map +1 -0
  35. package/dist/{esm/table.worker-e9fb087e.js → cjs/table.worker-e2f9ccfa.js} +1 -1
  36. package/dist/collection/components/datalist/datalist.js +3 -3
  37. package/dist/collection/components/datalist/datalist.js.map +1 -1
  38. package/dist/collection/components/demo/demo.js +3 -2
  39. package/dist/collection/components/demo/demo.js.map +1 -1
  40. package/dist/collection/components/dropdown/dropdown.js +5 -2
  41. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  42. package/dist/collection/components/file-upload/file-upload.js +4 -0
  43. package/dist/collection/components/file-upload/file-upload.js.map +1 -1
  44. package/dist/collection/components/icon/icon.js +1 -1
  45. package/dist/collection/components/icon/icon.js.map +1 -1
  46. package/dist/collection/components/icon-button/icon-button.js +1 -1
  47. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  48. package/dist/collection/components/menu/menu.js +8 -3
  49. package/dist/collection/components/menu/menu.js.map +1 -1
  50. package/dist/collection/components/nav-item/nav-item.js +1 -2
  51. package/dist/collection/components/nav-item/nav-item.js.map +1 -1
  52. package/dist/collection/components/resize-observe/resize-observe.js +118 -14
  53. package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
  54. package/dist/collection/components/sticker/sticker.js +2 -0
  55. package/dist/collection/components/sticker/sticker.js.map +1 -1
  56. package/dist/collection/components/table/table-interface.js.map +1 -1
  57. package/dist/collection/components/table/table.cell.js +10 -5
  58. package/dist/collection/components/table/table.cell.js.map +1 -1
  59. package/dist/collection/components/table/table.css +9 -23
  60. package/dist/collection/components/table/table.js +236 -93
  61. package/dist/collection/components/table/table.js.map +1 -1
  62. package/dist/collection/components/table/table.row.js +19 -12
  63. package/dist/collection/components/table/table.row.js.map +1 -1
  64. package/dist/collection/components/table/table.store.js +1 -1
  65. package/dist/collection/components/table/table.store.js.map +1 -1
  66. package/dist/collection/components/table/table.utils.js +4 -4
  67. package/dist/collection/components/table/table.utils.js.map +1 -1
  68. package/dist/collection/components/table/table.worker.js +8 -0
  69. package/dist/collection/components/table/table.worker.js.map +1 -1
  70. package/dist/collection/components/tabs/tab-group.js +1 -1
  71. package/dist/collection/components/tabs/tab-group.js.map +1 -1
  72. package/dist/collection/components/tooltip/tooltip.js +25 -3
  73. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  74. package/dist/collection/utils/date-utils.js +4 -2
  75. package/dist/collection/utils/date-utils.js.map +1 -1
  76. package/dist/collection/utils/testing/index.js +15 -8
  77. package/dist/collection/utils/testing/index.js.map +1 -1
  78. package/dist/components/datalist.js +3 -3
  79. package/dist/components/datalist.js.map +1 -1
  80. package/dist/components/date-picker.js +4 -2
  81. package/dist/components/date-picker.js.map +1 -1
  82. package/dist/components/dropdown.js +5 -2
  83. package/dist/components/dropdown.js.map +1 -1
  84. package/dist/components/icon-button.js +1 -1
  85. package/dist/components/icon-button.js.map +1 -1
  86. package/dist/components/icon.js.map +1 -1
  87. package/dist/components/menu.js +8 -3
  88. package/dist/components/menu.js.map +1 -1
  89. package/dist/components/nano-demo.js +21 -14
  90. package/dist/components/nano-demo.js.map +1 -1
  91. package/dist/components/nano-file-upload.js +4 -0
  92. package/dist/components/nano-file-upload.js.map +1 -1
  93. package/dist/components/nano-tab-group.js +1 -1
  94. package/dist/components/nano-tab-group.js.map +1 -1
  95. package/dist/components/nav-item.js +1 -2
  96. package/dist/components/nav-item.js.map +1 -1
  97. package/dist/components/resize-observe.js +80 -14
  98. package/dist/components/resize-observe.js.map +1 -1
  99. package/dist/components/sticker.js +2 -0
  100. package/dist/components/sticker.js.map +1 -1
  101. package/dist/components/table.js +196 -103
  102. package/dist/components/table.js.map +1 -1
  103. package/dist/components/table.worker.js +1 -1
  104. package/dist/components/tooltip.js +6 -3
  105. package/dist/components/tooltip.js.map +1 -1
  106. package/dist/custom-elements/index.js +285 -120
  107. package/dist/custom-elements/index.js.map +1 -1
  108. package/dist/esm/{date-utils-bb82b123.js → date-utils-6b7a6e1f.js} +5 -3
  109. package/dist/esm/date-utils-6b7a6e1f.js.map +1 -0
  110. package/dist/esm/index-3c280603.js +2 -6
  111. package/dist/esm/loader.js +1 -1
  112. package/dist/esm/nano-components.js +1 -1
  113. package/dist/esm/nano-datalist_3.entry.js +10 -5
  114. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  115. package/dist/esm/nano-date-input.entry.js +1 -1
  116. package/dist/esm/nano-date-picker.entry.js +1 -1
  117. package/dist/esm/nano-demo.entry.js +3 -2
  118. package/dist/esm/nano-demo.entry.js.map +1 -1
  119. package/dist/esm/nano-dropdown.entry.js +5 -2
  120. package/dist/esm/nano-dropdown.entry.js.map +1 -1
  121. package/dist/esm/nano-file-upload.entry.js +4 -0
  122. package/dist/esm/nano-file-upload.entry.js.map +1 -1
  123. package/dist/esm/nano-global-nav-user-profile_3.entry.js +1 -2
  124. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  125. package/dist/esm/nano-icon-button.entry.js +1 -1
  126. package/dist/esm/nano-icon-button.entry.js.map +1 -1
  127. package/dist/esm/nano-icon.entry.js.map +1 -1
  128. package/dist/esm/{nano-tooltip.entry.js → nano-progress-bar_2.entry.js} +29 -6
  129. package/dist/esm/nano-progress-bar_2.entry.js.map +1 -0
  130. package/dist/esm/nano-resize-observe_2.entry.js +74 -12
  131. package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
  132. package/dist/esm/nano-sticker.entry.js +2 -0
  133. package/dist/esm/nano-sticker.entry.js.map +1 -1
  134. package/dist/esm/nano-tab-group.entry.js +1 -1
  135. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  136. package/dist/esm/{nano-table-95921f46.js → nano-table-38f3c797.js} +172 -88
  137. package/dist/esm/nano-table-38f3c797.js.map +1 -0
  138. package/dist/esm/nano-table.entry.js +1 -1
  139. package/dist/{nano-components/p-e9fb087e.js → esm/table.worker-e2f9ccfa.js} +1 -1
  140. package/dist/esm/{table.worker-769f1441.js → table.worker-e57fffd8.js} +3 -3
  141. package/dist/esm/table.worker-e57fffd8.js.map +1 -0
  142. package/dist/nano-components/nano-components.esm.js +1 -1
  143. package/dist/nano-components/nano-components.esm.js.map +1 -1
  144. package/dist/nano-components/p-0b29b22c.js +5 -0
  145. package/dist/nano-components/{p-26905bca.js.map → p-0b29b22c.js.map} +0 -0
  146. package/dist/nano-components/p-135fed16.entry.js +5 -0
  147. package/dist/nano-components/p-135fed16.entry.js.map +1 -0
  148. package/dist/nano-components/{p-2cb4615b.entry.js → p-2a97ef51.entry.js} +2 -2
  149. package/dist/nano-components/{p-2cb4615b.entry.js.map → p-2a97ef51.entry.js.map} +0 -0
  150. package/dist/nano-components/{p-751927d1.entry.js → p-3f25fc76.entry.js} +2 -2
  151. package/dist/nano-components/p-3f25fc76.entry.js.map +1 -0
  152. package/dist/nano-components/p-5d149792.entry.js +5 -0
  153. package/dist/nano-components/p-5d149792.entry.js.map +1 -0
  154. package/dist/nano-components/p-69e5a37d.entry.js.map +1 -1
  155. package/dist/nano-components/p-6ad194e4.entry.js +5 -0
  156. package/dist/nano-components/p-6ad194e4.entry.js.map +1 -0
  157. package/dist/nano-components/{p-46b348b7.entry.js → p-6cb77d5c.entry.js} +2 -2
  158. package/dist/nano-components/{p-46b348b7.entry.js.map → p-6cb77d5c.entry.js.map} +0 -0
  159. package/dist/nano-components/{p-85cfb0af.entry.js → p-9a4297e1.entry.js} +2 -2
  160. package/dist/nano-components/p-9a4297e1.entry.js.map +1 -0
  161. package/dist/nano-components/{p-d1c8eca4.entry.js → p-b55ffa92.entry.js} +2 -2
  162. package/dist/nano-components/p-b55ffa92.entry.js.map +1 -0
  163. package/dist/nano-components/{p-fb12a45d.entry.js → p-ba9cd047.entry.js} +2 -2
  164. package/dist/nano-components/{p-fb12a45d.entry.js.map → p-ba9cd047.entry.js.map} +0 -0
  165. package/dist/nano-components/p-cc5e7acb.entry.js +5 -0
  166. package/dist/nano-components/p-cc5e7acb.entry.js.map +1 -0
  167. package/dist/nano-components/p-cecb9af1.js +5 -0
  168. package/dist/nano-components/p-cecb9af1.js.map +1 -0
  169. package/dist/nano-components/p-d26b97d1.js +5 -0
  170. package/dist/nano-components/p-d26b97d1.js.map +1 -0
  171. package/dist/nano-components/{p-601e18d5.entry.js → p-d5303933.entry.js} +2 -2
  172. package/dist/nano-components/p-d5303933.entry.js.map +1 -0
  173. package/dist/nano-components/{p-4f0e14b5.entry.js → p-d565991d.entry.js} +2 -2
  174. package/dist/nano-components/p-d565991d.entry.js.map +1 -0
  175. package/dist/nano-components/{p-244223f0.entry.js → p-dc50b93c.entry.js} +2 -2
  176. package/dist/nano-components/p-dc50b93c.entry.js.map +1 -0
  177. package/dist/{cjs/table.worker-e9fb087e.js → nano-components/p-e2f9ccfa.js} +1 -1
  178. package/dist/types/components/icon/icon.d.ts +1 -1
  179. package/dist/types/components/menu/menu.d.ts +1 -0
  180. package/dist/types/components/resize-observe/resize-observe.d.ts +20 -1
  181. package/dist/types/components/table/table-interface.d.ts +35 -24
  182. package/dist/types/components/table/table.cell.d.ts +1 -1
  183. package/dist/types/components/table/table.d.ts +49 -15
  184. package/dist/types/components/table/table.row.d.ts +1 -1
  185. package/dist/types/components/table/table.store.d.ts +1 -1
  186. package/dist/types/components/table/table.utils.d.ts +1 -1
  187. package/dist/types/components/table/table.worker.d.ts +3 -3
  188. package/dist/types/components/tooltip/tooltip.d.ts +5 -0
  189. package/dist/types/components.d.ts +59 -14
  190. package/dist/types/utils/date-utils.d.ts +1 -1
  191. package/docs-json.json +179 -31
  192. package/docs-vscode.json +26 -3
  193. package/package.json +2 -2
  194. package/dist/cjs/date-utils-c581f187.js.map +0 -1
  195. package/dist/cjs/nano-progress-bar.cjs.entry.js +0 -33
  196. package/dist/cjs/nano-progress-bar.cjs.entry.js.map +0 -1
  197. package/dist/cjs/nano-table-067e0c12.js.map +0 -1
  198. package/dist/cjs/nano-tooltip.cjs.entry.js.map +0 -1
  199. package/dist/cjs/table.worker-a4d75c46.js.map +0 -1
  200. package/dist/esm/date-utils-bb82b123.js.map +0 -1
  201. package/dist/esm/nano-progress-bar.entry.js +0 -29
  202. package/dist/esm/nano-progress-bar.entry.js.map +0 -1
  203. package/dist/esm/nano-table-95921f46.js.map +0 -1
  204. package/dist/esm/nano-tooltip.entry.js.map +0 -1
  205. package/dist/esm/table.worker-769f1441.js.map +0 -1
  206. package/dist/nano-components/p-15a60f7e.js +0 -5
  207. package/dist/nano-components/p-15a60f7e.js.map +0 -1
  208. package/dist/nano-components/p-244223f0.entry.js.map +0 -1
  209. package/dist/nano-components/p-26905bca.js +0 -5
  210. package/dist/nano-components/p-4f0e14b5.entry.js.map +0 -1
  211. package/dist/nano-components/p-601e18d5.entry.js.map +0 -1
  212. package/dist/nano-components/p-751927d1.entry.js.map +0 -1
  213. package/dist/nano-components/p-85cfb0af.entry.js.map +0 -1
  214. package/dist/nano-components/p-8fc2a38d.js +0 -5
  215. package/dist/nano-components/p-8fc2a38d.js.map +0 -1
  216. package/dist/nano-components/p-9e8c9bac.entry.js +0 -5
  217. package/dist/nano-components/p-9e8c9bac.entry.js.map +0 -1
  218. package/dist/nano-components/p-a2e38472.entry.js +0 -5
  219. package/dist/nano-components/p-a2e38472.entry.js.map +0 -1
  220. package/dist/nano-components/p-b9c8b99f.entry.js +0 -5
  221. package/dist/nano-components/p-b9c8b99f.entry.js.map +0 -1
  222. package/dist/nano-components/p-d1c8eca4.entry.js.map +0 -1
  223. package/dist/nano-components/p-f43d1d8e.entry.js +0 -5
  224. package/dist/nano-components/p-f43d1d8e.entry.js.map +0 -1
  225. package/dist/nano-components/p-feb9f164.entry.js +0 -5
  226. package/dist/nano-components/p-feb9f164.entry.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
2
- import type { TableTypes } from '../../interface';
2
+ import { TableTypes } from '../../interface';
3
3
  /**
4
4
  * A performant, accessible and semantic (uses real html `<table />`, `<tr />` etc) table and data-grid solution.
5
5
  *
@@ -24,19 +24,22 @@ export declare class Table implements ComponentInterface {
24
24
  caption: string;
25
25
  /** Show the caption on-screen */
26
26
  showCaption: boolean;
27
- /** Will show a loading state when true.
28
- * Will be shown automatically if `rows` is a promise waiting to resolve
29
- * or when performing custom filtering or sorting */
30
- get loading(): boolean;
31
- set loading(l: boolean);
32
- _loading: boolean;
27
+ /** Will show a loading state when set to true.
28
+ * By default, will be shown automatically if `rows` is a promise waiting to resolve
29
+ * or when performing custom filtering or sorting.
30
+ * *Note* when set manually, will overwrite any internal loading state.
31
+ * Set to 'undefined' to revert to default behaviour. */
32
+ loading: boolean;
33
+ get _loading(): boolean;
34
+ set _loading(l: boolean);
33
35
  private debounceSetLoading;
36
+ internalLoading: boolean;
34
37
  /** When loading rows asynchronously, this will render this number of placeholder rows */
35
38
  placeholderSize: number;
36
39
  /** The data to place in the table */
37
40
  rows: TableTypes.NanoTable['rows'] | Promise<TableTypes.NanoTable['rows']>;
38
41
  handleRowsChange(): void;
39
- /** The column config used to generate present the rows of data */
42
+ /** The column config used to present the rows of data */
40
43
  columns: TableTypes.NanoTable['columns'];
41
44
  handleColsChange(): Promise<void>;
42
45
  /** Used for custom thead row rendering */
@@ -58,15 +61,17 @@ export declare class Table implements ComponentInterface {
58
61
  /** Term to search for in the data */
59
62
  searchTerm: string;
60
63
  /** A custom filtering function. Should return a promise.
61
- * On successful completion the column UI will be updated.
64
+ * If the promise resolves as `true` the column UI will be updated.
65
+ * If the promise resolves as falsey, the sort will be performed by the component.
62
66
  * A good use-case would be performing the filter on a server / via fetch.
63
67
  * Then on success, updating the table's data via the `rows` property */
64
- customFilterFn?: (filters: TableTypes.Filter[]) => Promise<void>;
68
+ customFilterFn?: (filters: TableTypes.Filter[]) => Promise<true | TableTypes.Falsy>;
65
69
  /** A custom sorting function. Should return a promise.
66
- * On successful completion the column UI will be updated.
70
+ * If the promise resolves as `true` the column UI will be updated.
71
+ * If the promise resolves as falsey, the sort will be performed by the component.
67
72
  * A good use-case would be performing the sort on a server / via fetch.
68
73
  * Then on success, updating the table's data via the `rows` property */
69
- customSortFn?: (property: TableTypes.Prop, order: TableTypes.Order) => Promise<void>;
74
+ customSortFn?: (property: TableTypes.Prop, order: TableTypes.Order) => Promise<true | TableTypes.Falsy>;
70
75
  /**
71
76
  * The default sortable option for all columns.
72
77
  * `true` will enable column sorting unless you set `sortable: false` on a column
@@ -80,6 +85,15 @@ export declare class Table implements ComponentInterface {
80
85
  */
81
86
  defaultColDraggable: boolean;
82
87
  handleSearchTermChange(): void;
88
+ /** Use this to render the table with roughly the correct dimensions.
89
+ * a use-case might be; fetch a small initial dataset to minimise load-time,
90
+ * render the table with the correct dimensions, the table becomes interactive,
91
+ * load the rest of the data
92
+ */
93
+ virtualTotalItems: number;
94
+ virtualTotalItemsChangeHandler(): void;
95
+ /** Fired when the table has done it's first complete render */
96
+ nanoTblReady: EventEmitter;
83
97
  /** Fired whenever a block is activated by scrolling into view / becoming visible
84
98
  * This could be leveraged for infinite scrolling / to fetch more data.
85
99
  */
@@ -87,8 +101,6 @@ export declare class Table implements ComponentInterface {
87
101
  block: number;
88
102
  totalBlocks: number;
89
103
  }>;
90
- /** Fired when the table has done it's first complete render */
91
- nanoTblReady: EventEmitter;
92
104
  /** Fired before a column is sorted.
93
105
  * `event.preventDefault()` to stop sorting. */
94
106
  nanoTblBeforeSort: EventEmitter<{
@@ -130,6 +142,11 @@ export declare class Table implements ComponentInterface {
130
142
  nanoTblAfterSearch: EventEmitter<{
131
143
  term: string;
132
144
  }>;
145
+ /** Fired before a general search.
146
+ * `event.preventDefault()` to stop searching. */
147
+ nanoTblBeforeEdit: EventEmitter<{
148
+ term: string;
149
+ }>;
133
150
  /** Remove any column sorts currently applied
134
151
  * @returns a promise which resolves when complete */
135
152
  resetSorting(): Promise<void>;
@@ -150,6 +167,13 @@ export declare class Table implements ComponentInterface {
150
167
  * @returns a promise which resolves when complete
151
168
  */
152
169
  removeFilters(columnNames: TableTypes.Prop[]): Promise<void>;
170
+ /** Updates a row model at a given index
171
+ * @param row - the row to update.
172
+ * *Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property
173
+ * - rows are augmented with certain properties to aid with efficient rendering
174
+ * @param rowIndex - the row index to insert this row
175
+ */
176
+ updateRow(row: TableTypes.RowData, rowIndex: number): Promise<void>;
153
177
  host: HTMLNanoTableElement;
154
178
  private renderId;
155
179
  private store;
@@ -163,7 +187,7 @@ export declare class Table implements ComponentInterface {
163
187
  These are show / hidden for perf */
164
188
  blocks: TableTypes.TBody[];
165
189
  activeBlocks: number[];
166
- measureHeight: number;
190
+ private measureHeight;
167
191
  private blockElements;
168
192
  private blockIos;
169
193
  private blockHeights;
@@ -177,7 +201,16 @@ export declare class Table implements ComponentInterface {
177
201
  private _isReady;
178
202
  scrollListener(): void;
179
203
  private handleReady;
204
+ /**
205
+ * Fired when a column is dragged
206
+ * @param column
207
+ */
180
208
  private colDrag;
209
+ /**
210
+ * Fired when a column is dropped after being dragged
211
+ * @param fromCol
212
+ * @param toCol
213
+ */
181
214
  private colDrop;
182
215
  /**
183
216
  * Start a sort - can be cancelled by `preventDefault`
@@ -221,6 +254,7 @@ export declare class Table implements ComponentInterface {
221
254
  private getBlockHeight;
222
255
  /** cache the height for all active blocks for later renders */
223
256
  private setBlockHeight;
257
+ private debouncedBlockChange;
224
258
  /**
225
259
  * Attaches an intersection observer to each rendered tbody element
226
260
  * shows / hides intersecting blocks' and sets heights for when they're hidden
@@ -3,7 +3,7 @@ import type { TableTypes } from '../../interface';
3
3
  declare type TableRowProps = {
4
4
  rowRenderer: TableTypes.RowRenderer;
5
5
  rowIndex: number;
6
- row: TableTypes.RowData;
6
+ rowModel: TableTypes.RowData;
7
7
  onColumnPinned?: TableTypes.PinnedCb;
8
8
  };
9
9
  export declare const TableRow: FunctionalComponent<TableRowProps>;
@@ -19,4 +19,4 @@ export declare function storeSetData(host: HTMLElement, rows: TableTypes.RowData
19
19
  export declare function storeSetConfig(host: HTMLElement, columns: TableTypes.ColumnConfig[]): Promise<boolean>;
20
20
  export declare function storeSearch(host: HTMLElement, term: string): Promise<void>;
21
21
  export declare function storeFilter(host: HTMLElement, filters: TableTypes.Filter[]): Promise<void>;
22
- export declare function storeSort(host: HTMLElement, prop: TableTypes.Prop, order: TableTypes.Order): Promise<void>;
22
+ export declare function storeSort(host: HTMLNanoTableElement, prop: TableTypes.Prop, order: TableTypes.Order): Promise<void>;
@@ -7,7 +7,7 @@ declare type ValidRenderTypes = 'tr' | 'th' | 'td';
7
7
  * @param colIndex - the current column index being rendered
8
8
  * @returns a model object which will be passed to custom renderers
9
9
  */
10
- export declare function colDataModel(rowIndex: number, colIndex: number): TableTypes.ColumnDataSchemaModel;
10
+ export declare function colDataModel(rowIndex: number, colIndex: number): TableTypes.RenderModel;
11
11
  /**
12
12
  * Get a model object for custom row renderers.
13
13
  * @param rowIndex
@@ -3,8 +3,8 @@ export declare function createWorkerStore(rows: TableTypes.NanoTable['rows'], co
3
3
  export declare function syncDataToWorker(workerId: string, rows: TableTypes.NanoTable['rows']): Promise<boolean>;
4
4
  export declare function syncConfigToWorker(workerId: string, columns: Partial<TableTypes.ColumnConfig>[]): Promise<boolean>;
5
5
  /** Sorting is the last thing we do - don't cache this, there's no point */
6
- export declare function workerSort(workerId: string, prop: TableTypes.Prop, order: TableTypes.Order): Promise<TableTypes.RowData[]>;
7
- export declare function workerFilter(workerId: string, filters: TableTypes.Filter[]): Promise<TableTypes.RowData[]>;
6
+ export declare function workerSort(workerId: string, prop: TableTypes.Prop, order: TableTypes.Order): Promise<TableTypes.RowGeneric[]>;
7
+ export declare function workerFilter(workerId: string, filters: TableTypes.Filter[]): Promise<TableTypes.RowGeneric[]>;
8
8
  /** SEARCH */
9
9
  /**
10
10
  * A general text search across all table columns.
@@ -13,7 +13,7 @@ export declare function workerFilter(workerId: string, filters: TableTypes.Filte
13
13
  * @param term
14
14
  * @returns the searched for data rows - with col filters / sorts also applied
15
15
  */
16
- export declare function workerSearch(workerId: string, term: string): Promise<TableTypes.RowData[]>;
16
+ export declare function workerSearch(workerId: string, term: string): Promise<TableTypes.RowGeneric[]>;
17
17
  /**
18
18
  * Clean up
19
19
  * @param workerId
@@ -29,6 +29,11 @@ export declare class Tooltip {
29
29
  open: boolean;
30
30
  /** The distance in pixels from which to offset the tooltip along its target. */
31
31
  skidding: number;
32
+ /**
33
+ * Enable this option to prevent the panel from being clipped when the component is placed inside a container with
34
+ * `overflow: auto|scroll`.
35
+ */
36
+ hoist: boolean;
32
37
  /**
33
38
  * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple
34
39
  * options can be passed by separating them with a space. When manual is used, the tooltip must be activated
@@ -1099,7 +1099,7 @@ export namespace Components {
1099
1099
  */
1100
1100
  "icon"?: any;
1101
1101
  /**
1102
- * If enabled, nano-icon will be loaded lazily when it's visible in the viewport. Default, `false`.
1102
+ * If enabled, nano-icon will be loaded lazily when it's visible in the viewport. Default, `true`.
1103
1103
  */
1104
1104
  "lazy": boolean;
1105
1105
  /**
@@ -1583,6 +1583,10 @@ export namespace Components {
1583
1583
  "value": number;
1584
1584
  }
1585
1585
  interface NanoResizeObserve {
1586
+ /**
1587
+ * Fire `nanoResizeContentFitChange` events notifying whether content currently fits or does not on the x, y or both axis'. Also makes the `content-fit-...` slots available
1588
+ */
1589
+ "notifyContentFit": 'x' | 'y' | 'xy';
1586
1590
  /**
1587
1591
  * string list of sizes and optional class-names. Adds class-names and fires nanoResizeStateChange events. Upon hitting breakpoints. Format: `states="800w, 300h class1 class2"`
1588
1592
  */
@@ -2019,20 +2023,22 @@ export namespace Components {
2019
2023
  */
2020
2024
  "caption": string;
2021
2025
  /**
2022
- * The column config used to generate present the rows of data
2026
+ * The column config used to present the rows of data
2023
2027
  */
2024
2028
  "columns": TableTypes.NanoTable['columns'];
2025
2029
  /**
2026
- * A custom filtering function. Should return a promise. On successful completion the column UI will be updated. A good use-case would be performing the filter on a server / via fetch. Then on success, updating the table's data via the `rows` property
2030
+ * A custom filtering function. Should return a promise. If the promise resolves as `true` the column UI will be updated. If the promise resolves as falsey, the sort will be performed by the component. A good use-case would be performing the filter on a server / via fetch. Then on success, updating the table's data via the `rows` property
2027
2031
  */
2028
- "customFilterFn"?: (filters: TableTypes.Filter[]) => Promise<void>;
2032
+ "customFilterFn"?: (
2033
+ filters: TableTypes.Filter[]
2034
+ ) => Promise<true | TableTypes.Falsy>;
2029
2035
  /**
2030
- * A custom sorting function. Should return a promise. On successful completion the column UI will be updated. A good use-case would be performing the sort on a server / via fetch. Then on success, updating the table's data via the `rows` property
2036
+ * A custom sorting function. Should return a promise. If the promise resolves as `true` the column UI will be updated. If the promise resolves as falsey, the sort will be performed by the component. A good use-case would be performing the sort on a server / via fetch. Then on success, updating the table's data via the `rows` property
2031
2037
  */
2032
2038
  "customSortFn"?: (
2033
2039
  property: TableTypes.Prop,
2034
2040
  order: TableTypes.Order
2035
- ) => Promise<void>;
2041
+ ) => Promise<true | TableTypes.Falsy>;
2036
2042
  /**
2037
2043
  * The default draggable option for all columns. `true` will enable column drag-to-reorder unless you set `draggable: false` on a column `false` will disable column drag-to-reorder unless you set `draggable: true` on a column
2038
2044
  */
@@ -2050,7 +2056,7 @@ export namespace Components {
2050
2056
  */
2051
2057
  "headRender": TableTypes.HeadFootRenderer;
2052
2058
  /**
2053
- * Will show a loading state when true. Will be shown automatically if `rows` is a promise waiting to resolve or when performing custom filtering or sorting
2059
+ * Will show a loading state when set to true. By default, will be shown automatically if `rows` is a promise waiting to resolve or when performing custom filtering or sorting. *Note* when set manually, will overwrite any internal loading state. Set to 'undefined' to revert to default behaviour.
2054
2060
  */
2055
2061
  "loading": boolean;
2056
2062
  /**
@@ -2102,6 +2108,16 @@ export namespace Components {
2102
2108
  * The type of table. Grid type will make cells navigable by keyboard
2103
2109
  */
2104
2110
  "type": 'grid' | 'table';
2111
+ /**
2112
+ * Updates a row model at a given index
2113
+ * @param row - the row to update. *Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property - rows are augmented with certain properties to aid with efficient rendering
2114
+ * @param rowIndex - the row index to insert this row
2115
+ */
2116
+ "updateRow": (row: TableTypes.RowData, rowIndex: number) => Promise<void>;
2117
+ /**
2118
+ * Use this to render the table with roughly the correct dimensions. a use-case might be; fetch a small initial dataset to minimise load-time, render the table with the correct dimensions, the table becomes interactive, load the rest of the data
2119
+ */
2120
+ "virtualTotalItems": number;
2105
2121
  }
2106
2122
  interface NanoTooltip {
2107
2123
  /**
@@ -2120,6 +2136,10 @@ export namespace Components {
2120
2136
  * Hides the tooltip.
2121
2137
  */
2122
2138
  "hide": () => Promise<void>;
2139
+ /**
2140
+ * Enable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`.
2141
+ */
2142
+ "hoist": boolean;
2123
2143
  /**
2124
2144
  * Indicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods.
2125
2145
  */
@@ -3808,7 +3828,7 @@ declare namespace LocalJSX {
3808
3828
  */
3809
3829
  "icon"?: any;
3810
3830
  /**
3811
- * If enabled, nano-icon will be loaded lazily when it's visible in the viewport. Default, `false`.
3831
+ * If enabled, nano-icon will be loaded lazily when it's visible in the viewport. Default, `true`.
3812
3832
  */
3813
3833
  "lazy"?: boolean;
3814
3834
  /**
@@ -4335,6 +4355,17 @@ declare namespace LocalJSX {
4335
4355
  "value"?: number;
4336
4356
  }
4337
4357
  interface NanoResizeObserve {
4358
+ /**
4359
+ * Fire `nanoResizeContentFitChange` events notifying whether content currently fits or does not on the x, y or both axis'. Also makes the `content-fit-...` slots available
4360
+ */
4361
+ "notifyContentFit"?: 'x' | 'y' | 'xy';
4362
+ /**
4363
+ * Fires when the content either begins or stops to fit. Will only work when `notifyContentFit` is set.
4364
+ */
4365
+ "onNanoResizeContentFitChange"?: (event: NanoResizeObserveCustomEvent<{
4366
+ x: boolean;
4367
+ y: boolean;
4368
+ }>) => void;
4338
4369
  /**
4339
4370
  * Fires after the initial loading and assessment
4340
4371
  */
@@ -4763,20 +4794,22 @@ declare namespace LocalJSX {
4763
4794
  */
4764
4795
  "caption"?: string;
4765
4796
  /**
4766
- * The column config used to generate present the rows of data
4797
+ * The column config used to present the rows of data
4767
4798
  */
4768
4799
  "columns"?: TableTypes.NanoTable['columns'];
4769
4800
  /**
4770
- * A custom filtering function. Should return a promise. On successful completion the column UI will be updated. A good use-case would be performing the filter on a server / via fetch. Then on success, updating the table's data via the `rows` property
4801
+ * A custom filtering function. Should return a promise. If the promise resolves as `true` the column UI will be updated. If the promise resolves as falsey, the sort will be performed by the component. A good use-case would be performing the filter on a server / via fetch. Then on success, updating the table's data via the `rows` property
4771
4802
  */
4772
- "customFilterFn"?: (filters: TableTypes.Filter[]) => Promise<void>;
4803
+ "customFilterFn"?: (
4804
+ filters: TableTypes.Filter[]
4805
+ ) => Promise<true | TableTypes.Falsy>;
4773
4806
  /**
4774
- * A custom sorting function. Should return a promise. On successful completion the column UI will be updated. A good use-case would be performing the sort on a server / via fetch. Then on success, updating the table's data via the `rows` property
4807
+ * A custom sorting function. Should return a promise. If the promise resolves as `true` the column UI will be updated. If the promise resolves as falsey, the sort will be performed by the component. A good use-case would be performing the sort on a server / via fetch. Then on success, updating the table's data via the `rows` property
4775
4808
  */
4776
4809
  "customSortFn"?: (
4777
4810
  property: TableTypes.Prop,
4778
4811
  order: TableTypes.Order
4779
- ) => Promise<void>;
4812
+ ) => Promise<true | TableTypes.Falsy>;
4780
4813
  /**
4781
4814
  * The default draggable option for all columns. `true` will enable column drag-to-reorder unless you set `draggable: false` on a column `false` will disable column drag-to-reorder unless you set `draggable: true` on a column
4782
4815
  */
@@ -4794,7 +4827,7 @@ declare namespace LocalJSX {
4794
4827
  */
4795
4828
  "headRender"?: TableTypes.HeadFootRenderer;
4796
4829
  /**
4797
- * Will show a loading state when true. Will be shown automatically if `rows` is a promise waiting to resolve or when performing custom filtering or sorting
4830
+ * Will show a loading state when set to true. By default, will be shown automatically if `rows` is a promise waiting to resolve or when performing custom filtering or sorting. *Note* when set manually, will overwrite any internal loading state. Set to 'undefined' to revert to default behaviour.
4798
4831
  */
4799
4832
  "loading"?: boolean;
4800
4833
  /**
@@ -4812,6 +4845,10 @@ declare namespace LocalJSX {
4812
4845
  column: TableTypes.Prop;
4813
4846
  order: TableTypes.Order;
4814
4847
  }>) => void;
4848
+ /**
4849
+ * Fired before a general search. `event.preventDefault()` to stop searching.
4850
+ */
4851
+ "onNanoTblBeforeEdit"?: (event: NanoTableCustomEvent<{ term: string }>) => void;
4815
4852
  /**
4816
4853
  * Fired before a column is filtered. `event.preventDefault()` to stop filtering.
4817
4854
  */
@@ -4886,6 +4923,10 @@ declare namespace LocalJSX {
4886
4923
  * The type of table. Grid type will make cells navigable by keyboard
4887
4924
  */
4888
4925
  "type"?: 'grid' | 'table';
4926
+ /**
4927
+ * Use this to render the table with roughly the correct dimensions. a use-case might be; fetch a small initial dataset to minimise load-time, render the table with the correct dimensions, the table becomes interactive, load the rest of the data
4928
+ */
4929
+ "virtualTotalItems"?: number;
4889
4930
  }
4890
4931
  interface NanoTooltip {
4891
4932
  /**
@@ -4900,6 +4941,10 @@ declare namespace LocalJSX {
4900
4941
  * The distance in pixels from which to offset the tooltip away from its target.
4901
4942
  */
4902
4943
  "distance"?: number;
4944
+ /**
4945
+ * Enable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`.
4946
+ */
4947
+ "hoist"?: boolean;
4903
4948
  /**
4904
4949
  * Emitted after the tooltip has hidden and all transitions are complete.
4905
4950
  */
@@ -11,7 +11,7 @@ export declare enum DaysOfWeek {
11
11
  * @param year
12
12
  * @param month
13
13
  * @param day
14
- * @returns a new Date objecy
14
+ * @returns a new Date object
15
15
  */
16
16
  export declare function createDate(year: string, month: string, day: string): Date;
17
17
  /**