@ebrains/react 1.0.0 → 1.1.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 (59) hide show
  1. package/components-section.entry.esm.js +1 -1
  2. package/eds-accordion.entry.esm.js +9 -9
  3. package/eds-alert.entry.esm.js +2 -2
  4. package/{eds-avatar_34.entry.esm.js → eds-avatar_28.entry.esm.js} +676 -747
  5. package/eds-breadcrumb.entry.esm.js +179 -0
  6. package/eds-card-desc_2.entry.esm.js +85 -0
  7. package/eds-card-generic.entry.esm.js +114 -0
  8. package/eds-card-project.entry.esm.js +10 -10
  9. package/eds-card-tags.entry.esm.js +1 -1
  10. package/eds-card-tool.entry.esm.js +4 -4
  11. package/eds-code-block.entry.esm.js +7 -7
  12. package/eds-gauge.entry.esm.js +78 -0
  13. package/eds-icon-arrow-diagonal.entry.esm.js +1 -1
  14. package/eds-icon-arrow-right.entry.esm.js +1 -1
  15. package/eds-icon-bluesky.entry.esm.js +1 -1
  16. package/eds-icon-bookmark.entry.esm.js +1 -1
  17. package/eds-icon-chevron-down.entry.esm.js +1 -1
  18. package/eds-icon-chevron-left.entry.esm.js +1 -1
  19. package/eds-icon-chevron-right.entry.esm.js +1 -1
  20. package/eds-icon-chevron-up.entry.esm.js +1 -1
  21. package/eds-icon-close.entry.esm.js +1 -1
  22. package/eds-icon-copy.entry.esm.js +1 -1
  23. package/eds-icon-eu.entry.esm.js +1 -1
  24. package/eds-icon-external.entry.esm.js +1 -1
  25. package/eds-icon-facebook.entry.esm.js +1 -1
  26. package/eds-icon-gitlab.entry.esm.js +1 -1
  27. package/eds-icon-linkedin.entry.esm.js +1 -1
  28. package/eds-icon-loader.entry.esm.js +1 -1
  29. package/eds-icon-mastodon.entry.esm.js +1 -1
  30. package/eds-icon-menu.entry.esm.js +1 -1
  31. package/eds-icon-minus.entry.esm.js +1 -1
  32. package/eds-icon-more.entry.esm.js +1 -1
  33. package/eds-icon-paper.entry.esm.js +1 -1
  34. package/eds-icon-plus.entry.esm.js +1 -1
  35. package/eds-icon-portal.entry.esm.js +1 -1
  36. package/eds-icon-private.entry.esm.js +1 -1
  37. package/eds-icon-public.entry.esm.js +1 -1
  38. package/eds-icon-search.entry.esm.js +1 -1
  39. package/eds-icon-star.entry.esm.js +1 -1
  40. package/eds-icon-success.entry.esm.js +1 -1
  41. package/eds-icon-thumbs-down.entry.esm.js +1 -1
  42. package/eds-icon-thumbs-up.entry.esm.js +1 -1
  43. package/eds-icon-tutorial.entry.esm.js +1 -1
  44. package/eds-icon-twitter.entry.esm.js +1 -1
  45. package/eds-icon-unknown.entry.esm.js +1 -1
  46. package/eds-icon-updown.entry.esm.js +1 -1
  47. package/eds-icon-user.entry.esm.js +1 -1
  48. package/eds-icon-youtube.entry.esm.js +1 -1
  49. package/eds-pie.entry.esm.js +131 -0
  50. package/eds-progress-bar.entry.esm.js +4 -4
  51. package/eds-rating.entry.esm.js +1 -1
  52. package/eds-section-core_2.entry.esm.js +5 -5
  53. package/eds-spinner.entry.esm.js +3 -3
  54. package/eds-switch.entry.esm.js +5 -5
  55. package/eds-tooltip.entry.esm.js +41 -0
  56. package/index.esm2.js +23 -5
  57. package/package.json +1 -1
  58. package/token-spacing.entry.esm.js +93 -0
  59. package/eds-pagination_2.entry.esm.js +0 -493
@@ -1,493 +0,0 @@
1
- import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
- import { s as sendAnalytics } from './analytics-d99780e3.esm.js';
3
- import { p as parseData } from './sharedUtils-a550989c.esm.js';
4
- import 'react';
5
- import 'react/jsx-runtime';
6
- import 'react-dom';
7
-
8
- const edsPaginationCss = "ul,menu{list-style:none;margin:0;padding:0}.f-ui-03{font-family:var(--f-ui-03-fontFamily);font-weight:var(--f-ui-03-fontWeight);font-size:var(--f-ui-03-fontSize);line-height:var(--f-ui-03-lineHeight);letter-spacing:var(--f-ui-03-letterSpacing)}.f-ui-03-light{font-family:var(--f-ui-03-light-fontFamily);font-weight:var(--f-ui-03-light-fontWeight);font-size:var(--f-ui-03-light-fontSize);line-height:var(--f-ui-03-light-lineHeight);letter-spacing:var(--f-ui-03-light-letterSpacing)}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.f-ui-02-light{font-family:var(--f-ui-02-light-fontFamily);font-weight:var(--f-ui-02-light-fontWeight);font-size:var(--f-ui-02-light-fontSize);line-height:var(--f-ui-02-light-lineHeight);letter-spacing:var(--f-ui-02-light-letterSpacing)}.text-lightest{color:var(--grey-500)}.mb-28{margin-bottom:1.75rem}.w-full{width:100%}.w-20{width:1.25rem}.h-20{height:1.25rem}.h-28{height:1.75rem}.h-32{height:2rem}.h-36{height:2.25rem}.text-center{text-align:center}.flex{display:flex}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-x-8{-moz-column-gap:0.5rem;column-gap:0.5rem}.mr-auto{margin-right:auto}.ml-auto{margin-left:auto}.\\!p-8{padding:0.5rem !important}.ml-4{margin-left:0.25rem}.mr-4{margin-right:0.25rem}.hidden{display:none}.gap-1{gap:0.0625rem}.py-4{padding-top:0.25rem;padding-bottom:0.25rem}.transition-colors{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}@media (min-width: 900px){.lg\\:\\!pr-12{padding-right:0.75rem !important}.lg\\:flex{display:flex}}";
9
- const EdsPaginationStyle0 = edsPaginationCss;
10
- const EdsPagination = class {
11
- constructor(hostRef) {
12
- registerInstance(this, hostRef);
13
- this.currentPage = undefined;
14
- this.lastPage = undefined;
15
- this.perPage = 10;
16
- this.total = 0;
17
- this.url = '';
18
- this.mode = 'default';
19
- this.prevLabel = 'Prev';
20
- this.nextLabel = 'Next';
21
- this.prevUrl = '';
22
- this.nextUrl = '';
23
- this.links = [];
24
- }
25
- /** Lifecycle hook to generate pagination links on component load */
26
- componentWillLoad() {
27
- if (this.mode === 'default') {
28
- this.generateLinks();
29
- }
30
- }
31
- componentDidLoad() {
32
- // Emit context for each eds-link element after the component is fully loaded
33
- const links = this.hostEl.shadowRoot.querySelectorAll('eds-link');
34
- links.forEach(lnk => {
35
- this.emitContext(lnk);
36
- });
37
- /*if (links.length > 0) {
38
- // Emit context for the first link
39
- this.emitContext(links[0]);
40
- // Emit context for the last link, if it's different from the first
41
- if (links.length > 1) {
42
- this.emitContext(links[links.length - 1]);
43
- }
44
- }*/
45
- }
46
- /**
47
- * Emits a custom event called `parentContext` for a given link element.
48
- * This event provides context information about the breadcrumb component.
49
- *
50
- * @param linkElement - The link element to which the event will be dispatched.
51
- */
52
- emitContext(linkElement) {
53
- const event = new CustomEvent('parentContext', {
54
- detail: {
55
- componentName: this.hostEl.tagName.toLowerCase(),
56
- identifier: null
57
- }
58
- });
59
- linkElement.dispatchEvent(event);
60
- }
61
- onPageOrLastPageChange() {
62
- if (this.mode === 'default') {
63
- this.generateLinks();
64
- }
65
- }
66
- /**
67
- * Checks if the current page is the first page
68
- * @returns {boolean} - true if current page is the first page
69
- */
70
- isFirstPage() {
71
- return this.currentPage === 1;
72
- }
73
- /**
74
- * Checks if the current page is the last page
75
- * @returns {boolean} - true if current page is the last page
76
- */
77
- isLastPage() {
78
- return this.currentPage === this.lastPage;
79
- }
80
- /**
81
- * Generates a pagination link object
82
- * @param {number} page - Page number for the link
83
- * @returns {Link} - Link object with page details
84
- */
85
- generateLink(page) {
86
- const urlHasQuery = this.url.includes('?');
87
- return {
88
- ariaLabel: `Page ${page}`,
89
- url: `${this.url}${urlHasQuery ? '&' : '?'}page=${page}`,
90
- label: page.toString(),
91
- current: this.currentPage === page,
92
- disabled: false
93
- };
94
- }
95
- /** Generates pagination links based on the last page and current page */
96
- generateLinks() {
97
- if (this.lastPage && this.lastPage > 5) {
98
- this.links = this.getPaginationGenerator(this.currentPage || 1, this.lastPage).map(page => typeof page === 'number' ? this.generateLink(page) : page);
99
- } else if (this.lastPage) {
100
- this.links = Array.from({
101
- length: this.lastPage
102
- }).map((_, i) => this.generateLink(i + 1));
103
- }
104
- }
105
- /**
106
- * Creates a pagination range based on delta, current, and total pages
107
- * @param {number} current - Current page number
108
- * @param {number} total - Total number of pages
109
- * @param {number} delta - Range of pages to display around the current page
110
- * @returns {(number | string)[]} - Range of page numbers or ellipses
111
- */
112
- getPaginationGenerator(current, total) {
113
- const delta = 1; // Show one page before and one after the current page
114
- const range = [];
115
- if (total <= 5) {
116
- // If total pages are 5 or less, show all pages
117
- for (let i = 1; i <= total; i++) {
118
- range.push(i);
119
- }
120
- } else {
121
- // Always show the first page
122
- range.push(1);
123
- // Add ellipsis if there’s a gap between the first page and the current range start
124
- if (current - delta > 2) {
125
- range.push('...');
126
- }
127
- // Determine range for pages around the current page
128
- for (let i = Math.max(2, current - delta); i <= Math.min(total - 1, current + delta); i++) {
129
- range.push(i);
130
- }
131
- // Add ellipsis if there’s a gap between the current range end and the last page
132
- if (current + delta < total - 1) {
133
- range.push('...');
134
- }
135
- // Always show the last page
136
- range.push(total);
137
- }
138
- return range;
139
- }
140
- /**
141
- * Formats the current page results information for display
142
- * @returns {string} - Formatted page result information
143
- */
144
- pageResults() {
145
- if (this.total > 0) {
146
- return this.total > this.perPage ? `${this.perPage * ((this.currentPage || 1) - 1) + 1} - ${this.perPage * (this.currentPage || 1) >= this.total ? this.total : this.perPage * (this.currentPage || 1)} of ${this.total}` : `${this.total}`;
147
- }
148
- return '';
149
- }
150
- /**
151
- * Handles a page click event, updating the current page and dispatching an event
152
- * @param {MouseEvent} event - Click event
153
- * @param {number} newPage - New page number
154
- */
155
- handlePageClick(event, newPage) {
156
- if (this.mode === 'navigator') {
157
- return; // No page clicking logic for navigator mode
158
- }
159
- event.preventDefault(); // Prevent default link navigation
160
- if (newPage !== this.currentPage) {
161
- this.links = this.links.map(link => typeof link === 'object' ? Object.assign(Object.assign({}, link), {
162
- current: parseInt(link.label) === newPage
163
- }) : link);
164
- const pageChangeEvent = new CustomEvent('page', {
165
- detail: newPage,
166
- bubbles: true,
167
- composed: true
168
- });
169
- this.hostEl.dispatchEvent(pageChangeEvent);
170
- this.currentPage = newPage;
171
- }
172
- }
173
- render() {
174
- return h("div", {
175
- key: '1d53f69179791434224f152503c0b81c4cfc7cd3'
176
- }, this.total > 0 && this.mode === 'default' && h("p", {
177
- key: '00ae324b49d62a74feee9d1cde21d67cd726ecf0',
178
- class: "f-ui-03 text-lightest mb-28 w-full text-center"
179
- }, h("span", {
180
- key: 'dedf2ce2700eae9d1386b305ec1d1904b133f992',
181
- class: "sr-only"
182
- }, "Results:"), this.pageResults()), this.mode === 'navigator' || this.lastPage && this.lastPage > 1 ? h("nav", {
183
- "aria-label": "Pagination"
184
- }, h("ul", {
185
- class: "flex items-center justify-center gap-x-8"
186
- }, h("li", {
187
- class: "mr-auto"
188
- }, h("eds-link", {
189
- label: this.prevLabel,
190
- url: this.mode === 'navigator' ? this.prevUrl || '#' // Use prevUrl if provided, otherwise disable with '#'
191
- : this.isFirstPage() ? '#' : this.generateLink(this.currentPage - 1).url,
192
- disabled: this.mode === 'navigator' ? !this.prevUrl // Disable if prevUrl is not provided
193
- : this.isFirstPage(),
194
- "aria-label": "Previous page",
195
- icon: "chevron-left",
196
- "icon-pos": "left",
197
- size: "small",
198
- "icon-small": "true",
199
- intent: "strong",
200
- "hide-label-on-small-screen": true,
201
- class: "!p-8 lg:!pr-12",
202
- onClick: event => {
203
- if (this.mode === 'default') {
204
- if (this.isFirstPage()) {
205
- event.preventDefault(); // Prevent click if disabled
206
- } else {
207
- this.handlePageClick(event, (this.currentPage || 1) - 1);
208
- }
209
- }
210
- }
211
- })), this.mode === 'default' && this.links.map((link, index) => h("li", {
212
- key: index,
213
- class: "f-ui-02 flex h-36 items-center justify-center"
214
- }, typeof link === 'string' ? h("span", {
215
- class: "flex items-center justify-center"
216
- }, link) : h("eds-link", {
217
- url: link.url,
218
- "aria-label": link.ariaLabel,
219
- label: link.label,
220
- current: link.current,
221
- size: "small",
222
- class: "!p-8",
223
- intent: link.current ? 'secondary' : 'ghost',
224
- onClick: event => this.handlePageClick(event, parseInt(link.label))
225
- }))), h("li", {
226
- class: "ml-auto"
227
- }, h("eds-link", {
228
- label: this.nextLabel,
229
- url: this.mode === 'navigator' ? this.nextUrl || '#' // Use nextUrl if provided, otherwise disable with '#'
230
- : this.isLastPage() ? '#' : this.generateLink(this.currentPage + 1).url,
231
- disabled: this.mode === 'navigator' ? !this.nextUrl // Disable if nextUrl is not provided
232
- : this.isLastPage(),
233
- "aria-label": "Next page",
234
- size: "small",
235
- "icon-small": "true",
236
- icon: "chevron-right",
237
- intent: "strong",
238
- "hide-label-on-small-screen": true,
239
- class: "!p-8 lg:!pl-12 flex items-center gap-1 py-4 transition-colors",
240
- onClick: event => {
241
- if (this.mode === 'default') {
242
- if (this.isLastPage()) {
243
- event.preventDefault(); // Prevent click if disabled
244
- } else {
245
- this.handlePageClick(event, (this.currentPage || 1) + 1);
246
- }
247
- }
248
- }
249
- })))) : null);
250
- }
251
- get hostEl() {
252
- return getElement(this);
253
- }
254
- static get watchers() {
255
- return {
256
- "currentPage": ["onPageOrLastPageChange"],
257
- "lastPage": ["onPageOrLastPageChange"]
258
- };
259
- }
260
- };
261
- EdsPagination.style = EdsPaginationStyle0;
262
- const edsTableCss = "table{text-indent:0;border-color:inherit;border-collapse:collapse;}.container{width:calc(var(--container-width, 100%) - (2 * var(--breakout-container-outer-gutter, var(--container-outer-gutter, var(--outer-gutter, 0)))));margin-right:auto;margin-left:auto}.container>*{--container-outer-gutter:0;--breakout-container-outer-gutter:0}.pt-32{padding-top:2rem}.pt-40{padding-top:2.5rem}.pt-48{padding-top:3rem}.pb-28{padding-bottom:1.75rem}.pb-60{padding-bottom:3.75rem}.mt-20{margin-top:1.25rem}.mt-28{margin-top:1.75rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.overflow-x-auto{overflow-x:auto}.mt-6{margin-top:0.375rem}.p-0{padding:0rem}.m-0{margin:0rem}.border{border-width:1px}.border-softer{border:1px solid rgba(0, 0, 0, .1)}.even\\:bg-inverse-softer:nth-child(even){background-color:rgba(255, 255, 255, .15)}.px-20{padding-left:1.25rem;padding-right:1.25rem}.py-8{padding-top:0.5rem;padding-bottom:0.5rem}.f-ui-01{font-family:var(--f-ui-01-fontFamily);font-weight:var(--f-ui-01-fontWeight);font-size:var(--f-ui-01-fontSize);line-height:var(--f-ui-01-lineHeight);letter-spacing:var(--f-ui-01-letterSpacing)}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.text-center{text-align:center}.break-words{overflow-wrap:anywhere}";
263
- const EdsTableStyle0 = edsTableCss;
264
- const EdsTable = class {
265
- constructor(hostRef) {
266
- registerInstance(this, hostRef);
267
- this.handleResize = () => {
268
- this.updateContainerWidth();
269
- };
270
- this.data = null;
271
- this.endpoint = null;
272
- this.config = {};
273
- this.rowsPerPage = 10;
274
- this.paginationEnabled = true;
275
- this.searchEnabled = false;
276
- this.hostWidth = undefined;
277
- this.columnSize = 'default';
278
- this.tbData = [];
279
- this.columns = [];
280
- this.currentPage = 1;
281
- this.parsedConfig = {};
282
- this.totalRows = 0;
283
- this.searchQuery = '';
284
- this.containerWidth = 0;
285
- }
286
- handleDataChange() {
287
- this.parseData();
288
- }
289
- handleConfigChange() {
290
- this.parseConfig();
291
- }
292
- componentWillLoad() {
293
- this.parseConfig();
294
- this.data ? this.parseData() : this.endpoint && this.fetchData();
295
- }
296
- componentDidLoad() {
297
- this.updateContainerWidth();
298
- window.addEventListener('resize', this.handleResize);
299
- this.setupPaginationListener();
300
- }
301
- componentDidUpdate() {
302
- this.setupPaginationListener();
303
- }
304
- disconnectedCallback() {
305
- window.removeEventListener('resize', this.handleResize);
306
- }
307
- updateContainerWidth() {
308
- // Use hostWidth prop if provided; otherwise, measure parent element
309
- if (this.hostWidth && this.hostWidth.trim() !== '') {
310
- this.containerWidth = Number(this.hostWidth);
311
- } else if (this.hostEl.parentElement instanceof HTMLElement) {
312
- this.containerWidth = this.hostEl.parentElement.getBoundingClientRect().width;
313
- } else {
314
- this.containerWidth = 400;
315
- }
316
- }
317
- parseData() {
318
- try {
319
- this.tbData = parseData(this.data);
320
- //this.tbData = typeof this.data === 'string' ? JSON.parse(this.data) : this.data || [];
321
- this.totalRows = this.tbData.length;
322
- this.updateColumns();
323
- this.currentPage = 1;
324
- } catch (error) {
325
- // eslint-disable-next-line
326
- console.error('Failed to parse data:', error);
327
- this.tbData = [];
328
- }
329
- }
330
- parseConfig() {
331
- try {
332
- //this.parsedConfig = parseData(this.config);
333
- this.parsedConfig = typeof this.config === 'string' ? JSON.parse(this.config) : this.config;
334
- } catch (error) {
335
- // eslint-disable-next-line
336
- console.error('Failed to parse config:', error);
337
- this.parsedConfig = {};
338
- }
339
- }
340
- async fetchData() {
341
- try {
342
- const response = await fetch(this.endpoint);
343
- const data = await response.json();
344
- this.data = data;
345
- } catch (error) {
346
- // eslint-disable-next-line
347
- console.error('Failed to fetch data:', error);
348
- }
349
- }
350
- setupPaginationListener() {
351
- if (!this.shouldEnablePagination()) {
352
- return;
353
- }
354
- const paginationEl = this.hostEl.shadowRoot.querySelector('eds-pagination');
355
- if (paginationEl && !paginationEl.hasAttribute('listener-attached')) {
356
- paginationEl.addEventListener('page', event => this.handlePageChange(event.detail));
357
- paginationEl.setAttribute('listener-attached', 'true');
358
- }
359
- }
360
- getFilteredRows() {
361
- return this.tbData.filter(row => Object.values(row).some(value => value.toString().toLowerCase().includes(this.searchQuery.toLowerCase())));
362
- }
363
- getPaginatedRows() {
364
- const filteredRows = this.getFilteredRows();
365
- this.totalRows = filteredRows.length;
366
- const start = (this.currentPage - 1) * this.rowsPerPage;
367
- return filteredRows.slice(start, start + this.rowsPerPage);
368
- }
369
- handlePageChange(newPage) {
370
- this.currentPage = newPage;
371
- sendAnalytics({
372
- category: 'ui-component',
373
- parentContext: null,
374
- tag: `${this.hostEl.tagName.toLowerCase()}/eds-pagination`,
375
- name: `${newPage}` || '',
376
- action: 'page'
377
- });
378
- }
379
- handleSearch(event) {
380
- this.searchQuery = event.target.value;
381
- this.currentPage = 1;
382
- /*sendAnalytics({
383
- category: 'ui-component',
384
- parentContext: null,
385
- tag: `${this.hostEl.tagName.toLowerCase()}/eds-input-field/search`,
386
- name: `${this.searchQuery}` || '',
387
- action: 'page'
388
- });*/
389
- }
390
- renderCell(value, column) {
391
- var _a;
392
- const format = (_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.format;
393
- return format === 'uppercase' ? value === null || value === void 0 ? void 0 : value.toString().toUpperCase() : format === 'svg' ? h("div", {
394
- innerHTML: value
395
- }) : format === 'bold' ? h("strong", null, value) : format === 'code' ? h("code", null, value) : value;
396
- }
397
- shouldEnablePagination() {
398
- return this.paginationEnabled && this.totalRows > this.rowsPerPage;
399
- }
400
- updateColumns() {
401
- this.columns = this.tbData.length > 0 ? Object.keys(this.tbData[0]) : [];
402
- }
403
- getVisibleColumnsCount() {
404
- return this.columns.filter(column => {
405
- var _a;
406
- return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden);
407
- }).length;
408
- }
409
- divisionFactor() {
410
- let divisionFactor = 1;
411
- if (this.columnSize === 'medium') {
412
- divisionFactor = 2;
413
- } else if (this.columnSize === 'large') {
414
- divisionFactor = 4;
415
- }
416
- return divisionFactor;
417
- }
418
- render() {
419
- // Use containerWidth state that is updated on resize.
420
- const currentContainerWidth = this.hostWidth && this.hostWidth.trim() !== '' ? Number(this.hostWidth) : this.containerWidth || 400;
421
- // Calculate the number of visible columns and the column width.
422
- const visibleColumnsCount = this.getVisibleColumnsCount();
423
- const columnWidth = visibleColumnsCount > 0 ? Math.floor(currentContainerWidth / visibleColumnsCount * this.divisionFactor()) : 100;
424
- const paginatedRows = this.getPaginatedRows();
425
- const lastPage = Math.ceil(this.totalRows / this.rowsPerPage);
426
- return h("div", {
427
- key: '81735ac374853c8c92b3f50e26263ff9d71b326c'
428
- }, this.searchEnabled && h("div", {
429
- key: '0b2ab8dbb343033f605e2028890bd963cd650998'
430
- }, h("eds-input-field", {
431
- key: 1,
432
- name: "search",
433
- "aria-label": "Search",
434
- type: "text",
435
- placeholder: "Search...",
436
- // @ts-ignore
437
- onInput: event => this.handleSearch(event)
438
- })), h("div", {
439
- key: 'eb3eebe6fb124d4e1983b2fb7e636707817d36bd',
440
- class: "mt-20"
441
- }, h("table", {
442
- key: '03b312ac20bdec28843a46907a3cc4fba69f62ae',
443
- class: "block overflow-x-auto mt-6 p-0"
444
- }, h("thead", {
445
- key: 'ccab58dc46ae765df28da97ded6b1dd14d45d7f1'
446
- }, h("tr", {
447
- key: '904a125aad610cebe42b0bce46615be38f0ee17a',
448
- class: "m-0 p-0 border border-softer even:bg-inverse-softer"
449
- }, this.columns.map(column => {
450
- var _a;
451
- return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && h("th", {
452
- class: "m-0 py-8 border border-softer f-ui-02 break-words",
453
- style: {
454
- minWidth: `${columnWidth - 4}px`
455
- }
456
- }, column);
457
- }))), h("tbody", {
458
- key: 'a4c54c9c89d15546020dbb684e5486decde33f30'
459
- }, paginatedRows.map(row => h("tr", {
460
- class: "m-0 p-0 border border-softer even:bg-inverse-softer"
461
- }, this.columns.map(column => {
462
- var _a;
463
- return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && h("td", {
464
- class: "text-center border border-softer m-0 py-8 f-ui-2 break-words",
465
- style: {
466
- minWidth: `${columnWidth - 4}px`
467
- }
468
- }, this.renderCell(row[column], column));
469
- })))))), this.shouldEnablePagination() && h("div", {
470
- key: '2a248cbbe81ac8c1ad4dfbb49a9615f15931bac6',
471
- class: "mt-20"
472
- }, h("eds-pagination", {
473
- key: '11701d81922ca4c8b36fe82be32316a175eddbcd',
474
- currentPage: this.currentPage,
475
- lastPage: lastPage,
476
- perPage: this.rowsPerPage,
477
- total: this.totalRows,
478
- mode: "default"
479
- })));
480
- }
481
- get hostEl() {
482
- return getElement(this);
483
- }
484
- static get watchers() {
485
- return {
486
- "data": ["handleDataChange", "parseData"],
487
- "config": ["handleConfigChange"]
488
- };
489
- }
490
- };
491
- EdsTable.style = EdsTableStyle0;
492
-
493
- export { EdsPagination as eds_pagination, EdsTable as eds_table };