@ukic/canary-web-components 2.0.0-canary.37 → 2.0.0-canary.39

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 (95) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/ic-data-table.cjs.entry.js +6 -2
  3. package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
  4. package/dist/cjs/ic-date-picker.cjs.entry.js +110 -57
  5. package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ic-navigation-group.cjs.entry.js +9 -0
  7. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  9. package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-tree-item.cjs.entry.js +1 -1
  11. package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.stories.js +605 -0
  14. package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.stories.js.map +1 -0
  15. package/dist/collection/components/ic-data-table/ic-data-table.js +6 -2
  16. package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
  17. package/dist/collection/components/ic-data-table/ic-data-table.stories.js +414 -0
  18. package/dist/collection/components/ic-data-table/ic-data-table.stories.js.map +1 -0
  19. package/dist/collection/components/ic-data-table/story-data.js +155 -0
  20. package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
  21. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.stories.js +98 -0
  22. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.stories.js.map +1 -0
  23. package/dist/collection/components/ic-date-input/ic-date-input.stories.js +341 -0
  24. package/dist/collection/components/ic-date-input/ic-date-input.stories.js.map +1 -0
  25. package/dist/collection/components/ic-date-picker/ic-date-picker.css +10 -3
  26. package/dist/collection/components/ic-date-picker/ic-date-picker.js +152 -57
  27. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -1
  28. package/dist/collection/components/ic-date-picker/ic-date-picker.stories.js +167 -0
  29. package/dist/collection/components/ic-date-picker/ic-date-picker.stories.js.map +1 -0
  30. package/dist/collection/components/ic-date-picker/story-data.js +34 -3
  31. package/dist/collection/components/ic-date-picker/story-data.js.map +1 -1
  32. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.stories.js +260 -0
  33. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.stories.js.map +1 -0
  34. package/dist/collection/components/ic-select-with-multi/ic-select-multi.stories.js +144 -0
  35. package/dist/collection/components/ic-select-with-multi/ic-select-multi.stories.js.map +1 -0
  36. package/dist/collection/components/ic-tree-item/ic-tree-item.css +22 -3
  37. package/dist/collection/components/ic-tree-view/ic-tree-view.stories.js +456 -0
  38. package/dist/collection/components/ic-tree-view/ic-tree-view.stories.js.map +1 -0
  39. package/dist/components/ic-data-table.js +6 -2
  40. package/dist/components/ic-data-table.js.map +1 -1
  41. package/dist/components/ic-date-picker.js +112 -57
  42. package/dist/components/ic-date-picker.js.map +1 -1
  43. package/dist/components/ic-navigation-group.js +11 -2
  44. package/dist/components/ic-navigation-group.js.map +1 -1
  45. package/dist/components/ic-radio-option.js +1 -1
  46. package/dist/components/ic-radio-option.js.map +1 -1
  47. package/dist/components/ic-tree-item.js +1 -1
  48. package/dist/components/ic-tree-item.js.map +1 -1
  49. package/dist/core/core.esm.js +1 -1
  50. package/dist/core/core.esm.js.map +1 -1
  51. package/dist/core/p-04fe848d.entry.js +2 -0
  52. package/dist/core/p-04fe848d.entry.js.map +1 -0
  53. package/dist/core/{p-b4f824a6.entry.js → p-3ebd4703.entry.js} +2 -2
  54. package/dist/core/p-3ebd4703.entry.js.map +1 -0
  55. package/dist/core/p-bd0328f3.entry.js +2 -0
  56. package/dist/core/p-bd0328f3.entry.js.map +1 -0
  57. package/dist/core/p-cc0e0b46.entry.js +2 -0
  58. package/dist/core/p-cc0e0b46.entry.js.map +1 -0
  59. package/dist/core/p-fac387e8.entry.js +2 -0
  60. package/dist/core/p-fac387e8.entry.js.map +1 -0
  61. package/dist/esm/core.js +1 -1
  62. package/dist/esm/ic-data-table.entry.js +6 -2
  63. package/dist/esm/ic-data-table.entry.js.map +1 -1
  64. package/dist/esm/ic-date-picker.entry.js +110 -57
  65. package/dist/esm/ic-date-picker.entry.js.map +1 -1
  66. package/dist/esm/ic-navigation-group.entry.js +10 -1
  67. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  68. package/dist/esm/ic-radio-option.entry.js +1 -1
  69. package/dist/esm/ic-radio-option.entry.js.map +1 -1
  70. package/dist/esm/ic-tree-item.entry.js +1 -1
  71. package/dist/esm/ic-tree-item.entry.js.map +1 -1
  72. package/dist/esm/loader.js +1 -1
  73. package/dist/types/components/ic-card-horizontal/ic-card-horizontal.stories.d.ts +82 -0
  74. package/dist/types/components/ic-data-table/ic-data-table.stories.d.ts +239 -0
  75. package/dist/types/components/ic-data-table/story-data.d.ts +57 -0
  76. package/dist/types/components/ic-data-table-title-bar/ic-data-table-title-bar.stories.d.ts +47 -0
  77. package/dist/types/components/ic-date-input/ic-date-input.stories.d.ts +124 -0
  78. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +18 -1
  79. package/dist/types/components/ic-date-picker/ic-date-picker.stories.d.ts +153 -0
  80. package/dist/types/components/ic-date-picker/story-data.d.ts +2 -0
  81. package/dist/types/components/ic-pagination-bar/ic-pagination-bar.stories.d.ts +106 -0
  82. package/dist/types/components/ic-select-with-multi/ic-select-multi.stories.d.ts +106 -0
  83. package/dist/types/components/ic-tree-view/ic-tree-view.stories.d.ts +99 -0
  84. package/dist/types/components.d.ts +13 -0
  85. package/hydrate/index.js +129 -62
  86. package/package.json +12 -12
  87. package/dist/core/p-4084bce2.entry.js +0 -2
  88. package/dist/core/p-4084bce2.entry.js.map +0 -1
  89. package/dist/core/p-71bbb583.entry.js +0 -2
  90. package/dist/core/p-71bbb583.entry.js.map +0 -1
  91. package/dist/core/p-89112e37.entry.js +0 -2
  92. package/dist/core/p-89112e37.entry.js.map +0 -1
  93. package/dist/core/p-b4f824a6.entry.js.map +0 -1
  94. package/dist/core/p-fe105ed0.entry.js +0 -2
  95. package/dist/core/p-fe105ed0.entry.js.map +0 -1
@@ -0,0 +1,456 @@
1
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2
+ import readme from "./readme.md";
3
+ import treeItemReadme from "../ic-tree-item/readme.md";
4
+ import { html } from "lit-html";
5
+ export default {
6
+ title: "Web Components/Tree view",
7
+ component: "ic-tree-view",
8
+ parameters: {
9
+ componentAPI: {
10
+ data: readme + treeItemReadme,
11
+ },
12
+ },
13
+ };
14
+ /**
15
+ * Use the tree view component to display hierarchical data in a tree structure. The tree view component is useful for displaying nested data, such as a file system or a category hierarchy.
16
+ *
17
+ * Click the 'Component API' tab to view all the available attributes, events and slots for tree view.
18
+ *
19
+ * To use the tree view component, import `@ukic/canary-web-components` into your application.
20
+ */
21
+ export const Basic = {
22
+ render: () => html `
23
+ <div style="width:250px">
24
+ <ic-tree-view heading="Menu">
25
+ <ic-tree-item label="Coffee"></ic-tree-item>
26
+ <ic-tree-item label="Tea"></ic-tree-item>
27
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
28
+ </ic-tree-view>
29
+ </div>
30
+ `,
31
+ name: "Basic",
32
+ };
33
+ export const Nested = {
34
+ render: () => html `
35
+ <div style="width:250px">
36
+ <ic-tree-view heading="Menu">
37
+ <ic-tree-item label="Coffee">
38
+ <ic-tree-item label="Americano">
39
+ <ic-tree-item label="With milk"></ic-tree-item>
40
+ </ic-tree-item>
41
+ <ic-tree-item label="Latte"></ic-tree-item>
42
+ <ic-tree-item label="Espresso"></ic-tree-item>
43
+ </ic-tree-item>
44
+ <ic-tree-item label="Tea">
45
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
46
+ <ic-tree-item label="Chai"></ic-tree-item>
47
+ </ic-tree-item>
48
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
49
+ </ic-tree-view>
50
+ </div>
51
+ `,
52
+ name: "Nested",
53
+ };
54
+ export const WithIcons = {
55
+ render: () => html `
56
+ <div style="width:250px">
57
+ <ic-tree-view heading="Menu">
58
+ <svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
59
+ <path
60
+ d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"
61
+ />
62
+ </svg>
63
+ <ic-tree-item label="Coffee">
64
+ <svg
65
+ slot="icon"
66
+ xmlns="http://www.w3.org/2000/svg"
67
+ viewBox="0 0 24 24"
68
+ >
69
+ <path
70
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
71
+ />
72
+ </svg>
73
+ <ic-tree-item label="Americano"></ic-tree-item>
74
+ <ic-tree-item label="Latte">
75
+ <svg
76
+ slot="icon"
77
+ xmlns="http://www.w3.org/2000/svg"
78
+ viewBox="0 0 24 24"
79
+ >
80
+ <path
81
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
82
+ />
83
+ </svg>
84
+ </ic-tree-item>
85
+ <ic-tree-item label="Espresso"></ic-tree-item>
86
+ </ic-tree-item>
87
+ <ic-tree-item label="Tea">
88
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
89
+ <ic-tree-item label="Chai"></ic-tree-item>
90
+ </ic-tree-item>
91
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
92
+ </ic-tree-view>
93
+ </div>
94
+ `,
95
+ name: "With icons",
96
+ };
97
+ /**
98
+ * Small and large styling will be passed down from tree view to tree items and nested tree items.
99
+ */
100
+ export const Small = {
101
+ render: () => html `
102
+ <div style="width:250px">
103
+ <ic-tree-view heading="Menu" size="small">
104
+ <svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
105
+ <path
106
+ d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"
107
+ />
108
+ </svg>
109
+ <ic-tree-item label="Coffee">
110
+ <svg
111
+ slot="icon"
112
+ xmlns="http://www.w3.org/2000/svg"
113
+ viewBox="0 0 24 24"
114
+ >
115
+ <path
116
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
117
+ />
118
+ </svg>
119
+ <ic-tree-item label="Americano"></ic-tree-item>
120
+ <ic-tree-item label="Latte">
121
+ <svg
122
+ slot="icon"
123
+ xmlns="http://www.w3.org/2000/svg"
124
+ viewBox="0 0 24 24"
125
+ >
126
+ <path
127
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
128
+ />
129
+ </svg>
130
+ </ic-tree-item>
131
+ <ic-tree-item label="Espresso"></ic-tree-item>
132
+ </ic-tree-item>
133
+ <ic-tree-item label="Tea">
134
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
135
+ <ic-tree-item label="Chai"></ic-tree-item>
136
+ </ic-tree-item>
137
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
138
+ </ic-tree-view>
139
+ </div>
140
+ `,
141
+ name: "Small",
142
+ };
143
+ export const Large = {
144
+ render: () => html `
145
+ <div style="width:250px">
146
+ <ic-tree-view heading="Menu" size="large">
147
+ <svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
148
+ <path
149
+ d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"
150
+ />
151
+ </svg>
152
+ <ic-tree-item label="Coffee">
153
+ <svg
154
+ slot="icon"
155
+ xmlns="http://www.w3.org/2000/svg"
156
+ viewBox="0 0 24 24"
157
+ >
158
+ <path
159
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
160
+ />
161
+ </svg>
162
+ <ic-tree-item label="Americano"></ic-tree-item>
163
+ <ic-tree-item label="Latte">
164
+ <svg
165
+ slot="icon"
166
+ xmlns="http://www.w3.org/2000/svg"
167
+ viewBox="0 0 24 24"
168
+ >
169
+ <path
170
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
171
+ />
172
+ </svg>
173
+ </ic-tree-item>
174
+ <ic-tree-item label="Espresso"></ic-tree-item>
175
+ </ic-tree-item>
176
+ <ic-tree-item label="Tea">
177
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
178
+ <ic-tree-item label="Chai"></ic-tree-item>
179
+ </ic-tree-item>
180
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
181
+ </ic-tree-view>
182
+ </div>
183
+ `,
184
+ name: "Large",
185
+ };
186
+ /**
187
+ * Set `appearance` to `light` when the tree-view is displayed on dark background, to provide sufficient colour contrast.
188
+ */
189
+ export const Light = {
190
+ render: () => html `
191
+ <div style="width:250px;">
192
+ <ic-tree-view heading="Menu" appearance="light">
193
+ <svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
194
+ <path
195
+ d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"
196
+ />
197
+ </svg>
198
+ <ic-tree-item label="Coffee">
199
+ <svg
200
+ slot="icon"
201
+ xmlns="http://www.w3.org/2000/svg"
202
+ viewBox="0 0 24 24"
203
+ >
204
+ <path
205
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
206
+ />
207
+ </svg>
208
+ <ic-tree-item label="Americano"></ic-tree-item>
209
+ <ic-tree-item label="Latte">
210
+ <svg
211
+ slot="icon"
212
+ xmlns="http://www.w3.org/2000/svg"
213
+ viewBox="0 0 24 24"
214
+ >
215
+ <path
216
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
217
+ />
218
+ </svg>
219
+ </ic-tree-item>
220
+ <ic-tree-item label="Espresso"></ic-tree-item>
221
+ </ic-tree-item>
222
+ <ic-tree-item label="Tea">
223
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
224
+ <ic-tree-item label="Chai"></ic-tree-item>
225
+ </ic-tree-item>
226
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
227
+ </ic-tree-view>
228
+ </div>
229
+ `,
230
+ name: "Light",
231
+ parameters: {
232
+ backgrounds: {
233
+ default: "dark",
234
+ },
235
+ },
236
+ };
237
+ /**
238
+ * Individual tree-items can be disabled using the `disabled` prop.
239
+ */
240
+ export const DisabledTreeItems = {
241
+ render: () => html `
242
+ <div style="width:250px">
243
+ <ic-tree-view heading="Menu">
244
+ <svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
245
+ <path
246
+ d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"
247
+ />
248
+ </svg>
249
+ <ic-tree-item label="Coffee">
250
+ <svg
251
+ slot="icon"
252
+ xmlns="http://www.w3.org/2000/svg"
253
+ viewBox="0 0 24 24"
254
+ >
255
+ <path
256
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
257
+ />
258
+ </svg>
259
+ <ic-tree-item label="Americano"></ic-tree-item>
260
+ <ic-tree-item label="Latte" disabled="true">
261
+ <svg
262
+ slot="icon"
263
+ xmlns="http://www.w3.org/2000/svg"
264
+ viewBox="0 0 24 24"
265
+ >
266
+ <path
267
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
268
+ />
269
+ </svg>
270
+ </ic-tree-item>
271
+ <ic-tree-item label="Espresso"></ic-tree-item>
272
+ </ic-tree-item>
273
+ <ic-tree-item label="Tea">
274
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
275
+ <ic-tree-item label="Chai" disabled="true"></ic-tree-item>
276
+ </ic-tree-item>
277
+ <ic-tree-item label="Hot chocolate" disabled="true"></ic-tree-item>
278
+ </ic-tree-view>
279
+ </div>
280
+ `,
281
+ name: "Disabled tree items",
282
+ };
283
+ /**
284
+ * Custom links and router-items can be passed in using the `router-item` slot.
285
+ */
286
+ export const RouterItem = {
287
+ render: () => html `
288
+ <div style="width:250px">
289
+ <ic-tree-view heading="Menu">
290
+ <ic-tree-item>
291
+ <a slot="router-item" href="/">Slotted coffee</a>
292
+ </ic-tree-item>
293
+ <ic-tree-item label="Tea"></ic-tree-item>
294
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
295
+ </ic-tree-view>
296
+ </div>
297
+ `,
298
+ name: "Router item",
299
+ };
300
+ /**
301
+ * Custom content can be passed to both the tree view (using the `heading` slot) and the tree-item (using the `label` slot).
302
+ */
303
+ export const SlottedContent = {
304
+ render: () => html `
305
+ <div style="width:250px">
306
+ <ic-tree-view>
307
+ <ic-typography variant="subtitle-large" slot="heading">Menu</ic-typography>
308
+ <ic-tree-item>
309
+ <ic-typography slot="label">Coffee<ic-typography>
310
+ </ic-tree-item>
311
+ <ic-tree-item label="Tea"></ic-tree-item>
312
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
313
+ </ic-tree-view>
314
+ </div>
315
+ `,
316
+ name: "Slotted content",
317
+ };
318
+ /**
319
+ * When the heading/label exceeds the width of the container, the text will wrap unless `truncate-tree-item` is set to `true`.
320
+ */
321
+ export const MaxContent = {
322
+ render: () => html `
323
+ <div style="width:250px">
324
+ <ic-tree-view heading="Menu with nested options">
325
+ <svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
326
+ <path
327
+ d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"
328
+ />
329
+ </svg>
330
+ <ic-tree-item label="Coffee">
331
+ <svg
332
+ slot="icon"
333
+ xmlns="http://www.w3.org/2000/svg"
334
+ viewBox="0 0 24 24"
335
+ >
336
+ <path
337
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
338
+ />
339
+ </svg>
340
+ <ic-tree-item label="Americano"></ic-tree-item>
341
+ <ic-tree-item label="Latte with extra milk and sugar"></ic-tree-item>
342
+ <ic-tree-item label="Espresso"></ic-tree-item>
343
+ </ic-tree-item>
344
+ <ic-tree-item label="Tea">
345
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
346
+ <ic-tree-item label="Chai"></ic-tree-item>
347
+ </ic-tree-item>
348
+ <ic-tree-item label="Hot chocolate with marshmallows"></ic-tree-item>
349
+ </ic-tree-view>
350
+ </div>
351
+ `,
352
+ name: "Max content",
353
+ };
354
+ /**
355
+ * When `truncate-tree-items` or `truncate-heading` are set to `true`, and the heading/label exceeds the width of the container, they will be truncated with an ellipsis.
356
+ */
357
+ export const TruncationBehaviour = {
358
+ render: () => html `
359
+ <div style="width:250px">
360
+ <ic-tree-view
361
+ heading="Menu with nested options"
362
+ truncate-tree-items="true"
363
+ truncate-heading="true"
364
+ >
365
+ <svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
366
+ <path
367
+ d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"
368
+ />
369
+ </svg>
370
+ <ic-tree-item label="Coffee">
371
+ <svg
372
+ slot="icon"
373
+ xmlns="http://www.w3.org/2000/svg"
374
+ viewBox="0 0 24 24"
375
+ >
376
+ <path
377
+ d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"
378
+ />
379
+ </svg>
380
+ <ic-tree-item label="Americano"></ic-tree-item>
381
+ <ic-tree-item label="Latte with extra milk and sugar"></ic-tree-item>
382
+ <ic-tree-item label="Espresso"></ic-tree-item>
383
+ </ic-tree-item>
384
+ <ic-tree-item label="Tea">
385
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
386
+ <ic-tree-item
387
+ label="Earl Grey with truncation false"
388
+ truncate-tree-item="false"
389
+ ></ic-tree-item>
390
+ <ic-tree-item label="Chai"></ic-tree-item>
391
+ </ic-tree-item>
392
+ <ic-tree-item label="Hot chocolate with marshmallows"></ic-tree-item>
393
+ </ic-tree-view>
394
+ </div>
395
+ `,
396
+ name: "Truncation behaviour",
397
+ };
398
+ /**
399
+ * Utilising the `selected` attribute on `ic-tree-item` will turn it into a controlled component, displaying the selected state when set to `true`.
400
+ */
401
+ export const SelectedTreeItem = {
402
+ render: () => html `
403
+ <div style="width:250px">
404
+ <ic-tree-view heading="Menu">
405
+ <ic-tree-item label="Coffee"></ic-tree-item>
406
+ <ic-tree-item label="Tea"></ic-tree-item>
407
+ <ic-tree-item label="Hot chocolate" selected="true"></ic-tree-item>
408
+ </ic-tree-view>
409
+ </div>
410
+ `,
411
+ name: "Selected tree item",
412
+ };
413
+ /**
414
+ * When setting the `href` attribute, the tree-item will function as a link.
415
+ */
416
+ export const Link = {
417
+ render: () => html `
418
+ <div style="width:250px">
419
+ <ic-tree-view heading="Menu">
420
+ <ic-tree-item label="Coffee" href="#"></ic-tree-item>
421
+ <ic-tree-item label="Tea" selected="true" href="#"></ic-tree-item>
422
+ <ic-tree-item
423
+ label="Hot chocolate"
424
+ disabled="true"
425
+ href="#"
426
+ ></ic-tree-item>
427
+ </ic-tree-view>
428
+ </div>
429
+ `,
430
+ name: "Link",
431
+ };
432
+ /**
433
+ * An example with the `expanded` prop set to `true` on a parent tree item.
434
+ */
435
+ export const Expanded = {
436
+ render: () => html `
437
+ <div style="width:250px">
438
+ <ic-tree-view heading="Menu">
439
+ <ic-tree-item label="Coffee" expanded="true">
440
+ <ic-tree-item label="Americano" expanded="true">
441
+ <ic-tree-item label="With milk"></ic-tree-item>
442
+ </ic-tree-item>
443
+ <ic-tree-item label="Latte"></ic-tree-item>
444
+ <ic-tree-item label="Espresso"></ic-tree-item>
445
+ </ic-tree-item>
446
+ <ic-tree-item label="Tea">
447
+ <ic-tree-item label="Earl Grey"></ic-tree-item>
448
+ <ic-tree-item label="Chai"></ic-tree-item>
449
+ </ic-tree-item>
450
+ <ic-tree-item label="Hot chocolate"></ic-tree-item>
451
+ </ic-tree-view>
452
+ </div>
453
+ `,
454
+ name: "Expanded",
455
+ };
456
+ //# sourceMappingURL=ic-tree-view.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ic-tree-view.stories.js","sourceRoot":"","sources":["../../../src/components/ic-tree-view/ic-tree-view.stories.js"],"names":[],"mappings":"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","sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport readme from \"./readme.md\";\nimport treeItemReadme from \"../ic-tree-item/readme.md\";\nimport { html } from \"lit-html\";\n\nexport default {\n title: \"Web Components/Tree view\",\n component: \"ic-tree-view\",\n\n parameters: {\n componentAPI: {\n data: readme + treeItemReadme,\n },\n },\n};\n\n/**\n * Use the tree view component to display hierarchical data in a tree structure. The tree view component is useful for displaying nested data, such as a file system or a category hierarchy.\n *\n * Click the 'Component API' tab to view all the available attributes, events and slots for tree view.\n *\n * To use the tree view component, import `@ukic/canary-web-components` into your application.\n */\nexport const Basic = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\">\n <ic-tree-item label=\"Coffee\"></ic-tree-item>\n <ic-tree-item label=\"Tea\"></ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Basic\",\n};\n\nexport const Nested = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\">\n <ic-tree-item label=\"Coffee\">\n <ic-tree-item label=\"Americano\">\n <ic-tree-item label=\"With milk\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Latte\"></ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item label=\"Chai\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Nested\",\n};\n\nexport const WithIcons = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\">\n <svg slot=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path\n d=\"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z\"\n />\n </svg>\n <ic-tree-item label=\"Coffee\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n <ic-tree-item label=\"Americano\"></ic-tree-item>\n <ic-tree-item label=\"Latte\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n </ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item label=\"Chai\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"With icons\",\n};\n\n/**\n * Small and large styling will be passed down from tree view to tree items and nested tree items.\n */\nexport const Small = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\" size=\"small\">\n <svg slot=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path\n d=\"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z\"\n />\n </svg>\n <ic-tree-item label=\"Coffee\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n <ic-tree-item label=\"Americano\"></ic-tree-item>\n <ic-tree-item label=\"Latte\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n </ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item label=\"Chai\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Small\",\n};\n\nexport const Large = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\" size=\"large\">\n <svg slot=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path\n d=\"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z\"\n />\n </svg>\n <ic-tree-item label=\"Coffee\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n <ic-tree-item label=\"Americano\"></ic-tree-item>\n <ic-tree-item label=\"Latte\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n </ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item label=\"Chai\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Large\",\n};\n\n/**\n * Set `appearance` to `light` when the tree-view is displayed on dark background, to provide sufficient colour contrast.\n */\nexport const Light = {\n render: () => html`\n <div style=\"width:250px;\">\n <ic-tree-view heading=\"Menu\" appearance=\"light\">\n <svg slot=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path\n d=\"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z\"\n />\n </svg>\n <ic-tree-item label=\"Coffee\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n <ic-tree-item label=\"Americano\"></ic-tree-item>\n <ic-tree-item label=\"Latte\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n </ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item label=\"Chai\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Light\",\n\n parameters: {\n backgrounds: {\n default: \"dark\",\n },\n },\n};\n\n/**\n * Individual tree-items can be disabled using the `disabled` prop.\n */\nexport const DisabledTreeItems = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\">\n <svg slot=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path\n d=\"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z\"\n />\n </svg>\n <ic-tree-item label=\"Coffee\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n <ic-tree-item label=\"Americano\"></ic-tree-item>\n <ic-tree-item label=\"Latte\" disabled=\"true\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n </ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item label=\"Chai\" disabled=\"true\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\" disabled=\"true\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Disabled tree items\",\n};\n\n/**\n * Custom links and router-items can be passed in using the `router-item` slot.\n */\nexport const RouterItem = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\">\n <ic-tree-item>\n <a slot=\"router-item\" href=\"/\">Slotted coffee</a>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\"></ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Router item\",\n};\n\n/**\n * Custom content can be passed to both the tree view (using the `heading` slot) and the tree-item (using the `label` slot).\n */\nexport const SlottedContent = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view>\n <ic-typography variant=\"subtitle-large\" slot=\"heading\">Menu</ic-typography>\n <ic-tree-item>\n <ic-typography slot=\"label\">Coffee<ic-typography>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\"></ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Slotted content\",\n};\n\n/**\n * When the heading/label exceeds the width of the container, the text will wrap unless `truncate-tree-item` is set to `true`.\n */\nexport const MaxContent = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu with nested options\">\n <svg slot=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path\n d=\"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z\"\n />\n </svg>\n <ic-tree-item label=\"Coffee\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n <ic-tree-item label=\"Americano\"></ic-tree-item>\n <ic-tree-item label=\"Latte with extra milk and sugar\"></ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item label=\"Chai\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate with marshmallows\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Max content\",\n};\n\n/**\n * When `truncate-tree-items` or `truncate-heading` are set to `true`, and the heading/label exceeds the width of the container, they will be truncated with an ellipsis.\n */\nexport const TruncationBehaviour = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view\n heading=\"Menu with nested options\"\n truncate-tree-items=\"true\"\n truncate-heading=\"true\"\n >\n <svg slot=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path\n d=\"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z\"\n />\n </svg>\n <ic-tree-item label=\"Coffee\">\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path\n d=\"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z\"\n />\n </svg>\n <ic-tree-item label=\"Americano\"></ic-tree-item>\n <ic-tree-item label=\"Latte with extra milk and sugar\"></ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item\n label=\"Earl Grey with truncation false\"\n truncate-tree-item=\"false\"\n ></ic-tree-item>\n <ic-tree-item label=\"Chai\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate with marshmallows\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Truncation behaviour\",\n};\n\n/**\n * Utilising the `selected` attribute on `ic-tree-item` will turn it into a controlled component, displaying the selected state when set to `true`.\n */\nexport const SelectedTreeItem = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\">\n <ic-tree-item label=\"Coffee\"></ic-tree-item>\n <ic-tree-item label=\"Tea\"></ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\" selected=\"true\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Selected tree item\",\n};\n\n/**\n * When setting the `href` attribute, the tree-item will function as a link.\n */\nexport const Link = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\">\n <ic-tree-item label=\"Coffee\" href=\"#\"></ic-tree-item>\n <ic-tree-item label=\"Tea\" selected=\"true\" href=\"#\"></ic-tree-item>\n <ic-tree-item\n label=\"Hot chocolate\"\n disabled=\"true\"\n href=\"#\"\n ></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Link\",\n};\n\n/**\n * An example with the `expanded` prop set to `true` on a parent tree item.\n */\nexport const Expanded = {\n render: () => html`\n <div style=\"width:250px\">\n <ic-tree-view heading=\"Menu\">\n <ic-tree-item label=\"Coffee\" expanded=\"true\">\n <ic-tree-item label=\"Americano\" expanded=\"true\">\n <ic-tree-item label=\"With milk\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Latte\"></ic-tree-item>\n <ic-tree-item label=\"Espresso\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Tea\">\n <ic-tree-item label=\"Earl Grey\"></ic-tree-item>\n <ic-tree-item label=\"Chai\"></ic-tree-item>\n </ic-tree-item>\n <ic-tree-item label=\"Hot chocolate\"></ic-tree-item>\n </ic-tree-view>\n </div>\n `,\n\n name: \"Expanded\",\n};\n"]}
@@ -431,6 +431,7 @@ const DataTable = /*@__PURE__*/ proxyCustomElement(class DataTable extends HTMLE
431
431
  const data = this.showPagination
432
432
  ? this.data.slice(this.fromRow, this.toRow)
433
433
  : this.data.slice();
434
+ const paginationOffset = this.showPagination ? this.fromRow : 0;
434
435
  /**
435
436
  * Ensures that createCells has a value in data to map over to actually render the slot.
436
437
  * Removes the need for the user to add it multiple times.
@@ -439,7 +440,10 @@ const DataTable = /*@__PURE__*/ proxyCustomElement(class DataTable extends HTMLE
439
440
  */
440
441
  const organisedData = data.map((row, rowIndex) => {
441
442
  const slottedColumns = this.columns
442
- .map(({ key }, index) => isSlotUsed(this.el, `${key}-${rowIndex}`) && { key, index })
443
+ .map(({ key }, index) => isSlotUsed(this.el, `${key}-${rowIndex + paginationOffset}`) && {
444
+ key,
445
+ index,
446
+ })
443
447
  .filter((col) => !!col &&
444
448
  // skip the column if its already in the row
445
449
  !Object.prototype.hasOwnProperty.call(row, col.key));
@@ -458,7 +462,7 @@ const DataTable = /*@__PURE__*/ proxyCustomElement(class DataTable extends HTMLE
458
462
  ["table-row"]: true,
459
463
  ["table-row-selected"]: this.highlightSelectedRow && this.selectedRow === row,
460
464
  }
461
- }, this.createCells(row, index)));
465
+ }, this.createCells(row, index + paginationOffset)));
462
466
  });
463
467
  };
464
468
  this.getObjectValue = (cell, key) => Object.values(cell)[Object.keys(cell).indexOf(key)];