@ebrains/react 0.2.0-alpha.0 → 0.3.0-alpha.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.
- package/color-primary-palette_6.entry.esm.js +106 -106
- package/correct-use-of-colors.entry.esm.js +57 -57
- package/eds-alert.entry.esm.js +102 -0
- package/eds-avatar_17.entry.esm.js +209 -0
- package/eds-card-desc_3.entry.esm.js +129 -0
- package/eds-card-generic.entry.esm.js +125 -0
- package/eds-card-section.entry.esm.js +17 -7
- package/eds-components-section.entry.esm.js +57 -24
- package/eds-docs-palettes.entry.esm.js +1 -1
- package/eds-docs-tokens.entry.esm.js +1 -1
- package/eds-form.entry.esm.js +374 -0
- package/eds-input_7.entry.esm.js +518 -0
- package/eds-login.entry.esm.js +4 -12
- package/eds-logo-variations.entry.esm.js +29 -0
- package/{eds-pagination.entry.esm.js → eds-pagination_2.entry.esm.js} +199 -1
- package/eds-progress-bar.entry.esm.js +36 -0
- package/eds-svg-repository.entry.esm.js +12 -3
- package/eds-tabs-content.entry.esm.js +4 -4
- package/eds-tabs.entry.esm.js +26 -7
- package/eds-timeline.entry.esm.js +130 -0
- package/eds-trl.entry.esm.js +69 -0
- package/incorrect-use-of-colors.entry.esm.js +11 -10
- package/index.esm.js +1 -1
- package/index.esm2.js +35 -27
- package/logo-space.entry.esm.js +4 -4
- package/logo-variations-horizontal_2.entry.esm.js +116 -0
- package/logo-wrong-usage.entry.esm.js +39 -39
- package/package.json +1 -1
- package/src/components.d.ts +2 -0
- package/token-list_3.entry.esm.js +5 -5
- package/token-ratios.entry.esm.js +3 -3
- package/token-spacing.entry.esm.js +26 -26
- package/token-typography.entry.esm.js +2 -2
- package/eds-alert_28.entry.esm.js +0 -227
- package/eds-block-break.entry.esm.js +0 -22
- package/eds-breadcrumb.entry.esm.js +0 -169
- package/eds-footer.entry.esm.js +0 -110
- package/eds-fullscreen-menu.entry.esm.js +0 -143
- package/eds-social-networks.entry.esm.js +0 -74
- package/eds-table.entry.esm.js +0 -196
- package/logo-variations-horizontal.entry.esm.js +0 -50
- package/logo-variations-vertical.entry.esm.js +0 -53
package/eds-login.entry.esm.js
CHANGED
|
@@ -62,22 +62,14 @@ const EdsLogin = class {
|
|
|
62
62
|
return this.authenticated ? 'Logout' : 'Login';
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return h("
|
|
66
|
-
key: '
|
|
67
|
-
}, h("eds-button", {
|
|
68
|
-
key: '452b1c6ba9dda0ae5570accedf5e61b8391aeadb',
|
|
65
|
+
return h("eds-button", {
|
|
66
|
+
key: '35f298ecf951d5b1087f988262ae7d312c5e2d38',
|
|
69
67
|
label: this.getBtnLabel(),
|
|
70
68
|
intent: "primary",
|
|
71
|
-
|
|
72
|
-
disabled: false,
|
|
73
|
-
pill: false,
|
|
74
|
-
icon: "arrow-diagonal",
|
|
75
|
-
size: "small",
|
|
76
|
-
"icon-pos": "right",
|
|
69
|
+
"extra-class": "text-default",
|
|
77
70
|
"aria-label": this.getBtnLabel(),
|
|
78
|
-
"element-type": "button",
|
|
79
71
|
triggerClick: this.authenticated ? this.handleLogout : this.handleLogin.bind(this)
|
|
80
|
-
})
|
|
72
|
+
});
|
|
81
73
|
}
|
|
82
74
|
};
|
|
83
75
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
const EdsLogoVariations = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.tabIndex = undefined;
|
|
10
|
+
}
|
|
11
|
+
renderContent() {
|
|
12
|
+
switch (this.tabIndex) {
|
|
13
|
+
case 0:
|
|
14
|
+
return h("logo-variations-horizontal", null);
|
|
15
|
+
case 1:
|
|
16
|
+
return h("logo-variations-vertical", null);
|
|
17
|
+
default:
|
|
18
|
+
return h("p", null, "Content not available.");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return h("div", {
|
|
23
|
+
key: '9d6ce0e75030d6e636aab423181b0ce999f6f1b0',
|
|
24
|
+
class: "container"
|
|
25
|
+
}, this.renderContent());
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { EdsLogoVariations as eds_logo_variations };
|
|
@@ -254,5 +254,203 @@ const EdsPagination = class {
|
|
|
254
254
|
}
|
|
255
255
|
};
|
|
256
256
|
EdsPagination.style = EdsPaginationStyle0;
|
|
257
|
+
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}";
|
|
258
|
+
const EdsTableStyle0 = edsTableCss;
|
|
259
|
+
const EdsTable = class {
|
|
260
|
+
constructor(hostRef) {
|
|
261
|
+
registerInstance(this, hostRef);
|
|
262
|
+
this.data = null;
|
|
263
|
+
this.endpoint = null;
|
|
264
|
+
this.config = {};
|
|
265
|
+
this.rowsPerPage = 10;
|
|
266
|
+
this.paginationEnabled = true;
|
|
267
|
+
this.searchEnabled = false;
|
|
268
|
+
this.hostWidth = undefined;
|
|
269
|
+
this.columnSize = 'default';
|
|
270
|
+
this.tableData = [];
|
|
271
|
+
this.columns = [];
|
|
272
|
+
this.currentPage = 1;
|
|
273
|
+
this.parsedConfig = {};
|
|
274
|
+
this.totalRows = 0;
|
|
275
|
+
this.searchQuery = '';
|
|
276
|
+
}
|
|
277
|
+
handleDataChange() {
|
|
278
|
+
this.parseData();
|
|
279
|
+
}
|
|
280
|
+
handleConfigChange() {
|
|
281
|
+
this.parseConfig();
|
|
282
|
+
}
|
|
283
|
+
componentWillLoad() {
|
|
284
|
+
this.parseConfig();
|
|
285
|
+
this.data ? this.parseData() : this.endpoint && this.fetchData();
|
|
286
|
+
}
|
|
287
|
+
componentDidLoad() {
|
|
288
|
+
this.setupPaginationListener();
|
|
289
|
+
}
|
|
290
|
+
componentDidUpdate() {
|
|
291
|
+
this.setupPaginationListener();
|
|
292
|
+
}
|
|
293
|
+
parseData() {
|
|
294
|
+
try {
|
|
295
|
+
this.tableData = typeof this.data === 'string' ? JSON.parse(this.data) : this.data || [];
|
|
296
|
+
this.totalRows = this.tableData.length;
|
|
297
|
+
this.updateColumns();
|
|
298
|
+
this.currentPage = 1;
|
|
299
|
+
} catch (error) {
|
|
300
|
+
// eslint-disable-next-line
|
|
301
|
+
console.error('Failed to parse data:', error);
|
|
302
|
+
this.tableData = [];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
parseConfig() {
|
|
306
|
+
try {
|
|
307
|
+
this.parsedConfig = typeof this.config === 'string' ? JSON.parse(this.config) : this.config;
|
|
308
|
+
} catch (error) {
|
|
309
|
+
// eslint-disable-next-line
|
|
310
|
+
console.error('Failed to parse config:', error);
|
|
311
|
+
this.parsedConfig = {};
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
async fetchData() {
|
|
315
|
+
try {
|
|
316
|
+
const response = await fetch(this.endpoint);
|
|
317
|
+
const data = await response.json();
|
|
318
|
+
this.data = data;
|
|
319
|
+
} catch (error) {
|
|
320
|
+
// eslint-disable-next-line
|
|
321
|
+
console.error('Failed to fetch data:', error);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
setupPaginationListener() {
|
|
325
|
+
if (!this.shouldEnablePagination()) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const paginationEl = this.hostEl.shadowRoot.querySelector('eds-pagination');
|
|
329
|
+
if (paginationEl && !paginationEl.hasAttribute('listener-attached')) {
|
|
330
|
+
paginationEl.addEventListener('pageChange', event => this.handlePageChange(event.detail));
|
|
331
|
+
paginationEl.setAttribute('listener-attached', 'true');
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
getFilteredRows() {
|
|
335
|
+
return this.tableData.filter(row => Object.values(row).some(value => value.toString().toLowerCase().includes(this.searchQuery.toLowerCase())));
|
|
336
|
+
}
|
|
337
|
+
getPaginatedRows() {
|
|
338
|
+
const filteredRows = this.getFilteredRows();
|
|
339
|
+
this.totalRows = filteredRows.length;
|
|
340
|
+
const start = (this.currentPage - 1) * this.rowsPerPage;
|
|
341
|
+
return filteredRows.slice(start, start + this.rowsPerPage);
|
|
342
|
+
}
|
|
343
|
+
handlePageChange(newPage) {
|
|
344
|
+
this.currentPage = newPage;
|
|
345
|
+
}
|
|
346
|
+
handleSearch(event) {
|
|
347
|
+
this.searchQuery = event.target.value;
|
|
348
|
+
this.currentPage = 1;
|
|
349
|
+
}
|
|
350
|
+
renderCell(value, column) {
|
|
351
|
+
var _a;
|
|
352
|
+
const format = (_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.format;
|
|
353
|
+
return format === 'uppercase' ? value === null || value === void 0 ? void 0 : value.toString().toUpperCase() : format === 'svg' ? h("div", {
|
|
354
|
+
innerHTML: value
|
|
355
|
+
}) : format === 'bold' ? h("strong", null, value) : format === 'code' ? h("code", null, value) : value;
|
|
356
|
+
}
|
|
357
|
+
shouldEnablePagination() {
|
|
358
|
+
return this.paginationEnabled && this.totalRows > this.rowsPerPage;
|
|
359
|
+
}
|
|
360
|
+
updateColumns() {
|
|
361
|
+
this.columns = this.tableData.length > 0 ? Object.keys(this.tableData[0]) : [];
|
|
362
|
+
}
|
|
363
|
+
getVisibleColumnsCount() {
|
|
364
|
+
return this.columns.filter(column => {
|
|
365
|
+
var _a;
|
|
366
|
+
return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden);
|
|
367
|
+
}).length;
|
|
368
|
+
}
|
|
369
|
+
divisionFactor() {
|
|
370
|
+
let divisionFactor = 1;
|
|
371
|
+
if (this.columnSize === 'medium') {
|
|
372
|
+
divisionFactor = 2;
|
|
373
|
+
} else if (this.columnSize === 'large') {
|
|
374
|
+
divisionFactor = 4;
|
|
375
|
+
}
|
|
376
|
+
return divisionFactor;
|
|
377
|
+
}
|
|
378
|
+
render() {
|
|
379
|
+
// Get the paginated rows and calculate the last page.
|
|
380
|
+
const paginatedRows = this.getPaginatedRows();
|
|
381
|
+
const lastPage = Math.ceil(this.totalRows / this.rowsPerPage);
|
|
382
|
+
// Determine the number of visible columns (i.e., those not hidden via config)
|
|
383
|
+
const visibleColumnsCount = this.getVisibleColumnsCount();
|
|
384
|
+
/// Calculate container width based on the optional prop or parent's measured width.
|
|
385
|
+
const containerWidth = this.hostWidth && this.hostWidth.trim() !== '' ? Number(this.hostWidth) : this.hostEl.parentElement instanceof HTMLElement ? this.hostEl.parentElement.getBoundingClientRect().width : this.hostEl.getRootNode().host instanceof HTMLElement ? this.hostEl.getRootNode().host.getBoundingClientRect().width : 400;
|
|
386
|
+
//console.log('containerWidth:', containerWidth);
|
|
387
|
+
const columnWidth = visibleColumnsCount > 0 ? Math.floor(containerWidth / visibleColumnsCount * this.divisionFactor()) : 100;
|
|
388
|
+
console.log('columnWidth:', columnWidth);
|
|
389
|
+
return h("div", {
|
|
390
|
+
key: '178a33c07e6eae9d5edc170f842b6ef29ae21d9c'
|
|
391
|
+
}, this.searchEnabled && h("div", {
|
|
392
|
+
key: 'f1212a4e515a1db218df28b71367c6ffa42e3063'
|
|
393
|
+
}, h("eds-input-field", {
|
|
394
|
+
key: 1,
|
|
395
|
+
name: "search",
|
|
396
|
+
"aria-label": "Search",
|
|
397
|
+
type: "text",
|
|
398
|
+
placeholder: "Search...",
|
|
399
|
+
// @ts-ignore
|
|
400
|
+
onInput: event => this.handleSearch(event)
|
|
401
|
+
})), h("div", {
|
|
402
|
+
key: 'da6ac91e4b4d56780b044a3d35088e7722efe143',
|
|
403
|
+
class: "mt-20"
|
|
404
|
+
}, h("table", {
|
|
405
|
+
key: '3c5734d2370b31d2445ed4f043a80bf87c6d4bde',
|
|
406
|
+
class: "block overflow-x-auto mt-6 p-0"
|
|
407
|
+
}, h("thead", {
|
|
408
|
+
key: '3803a39b4c987ff39bf22e2567bd1bc3d513e1f4'
|
|
409
|
+
}, h("tr", {
|
|
410
|
+
key: 'a67fa7bdd48549c69cfa9721083a908ab036a559',
|
|
411
|
+
class: "m-0 p-0 border border-softer even:bg-inverse-softer"
|
|
412
|
+
}, this.columns.map(column => {
|
|
413
|
+
var _a;
|
|
414
|
+
return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && h("th", {
|
|
415
|
+
class: "m-0 py-8 border border-softer f-ui-02 break-words",
|
|
416
|
+
style: {
|
|
417
|
+
minWidth: `${columnWidth}px`
|
|
418
|
+
}
|
|
419
|
+
}, column);
|
|
420
|
+
}))), h("tbody", {
|
|
421
|
+
key: '8e3f21bf2ee5b1bd84cfa93411ca2671f43ced45'
|
|
422
|
+
}, paginatedRows.map(row => h("tr", {
|
|
423
|
+
class: "m-0 p-0 border border-softer even:bg-inverse-softer"
|
|
424
|
+
}, this.columns.map(column => {
|
|
425
|
+
var _a;
|
|
426
|
+
return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && h("td", {
|
|
427
|
+
class: "text-center border border-softer m-0 py-8 f-ui-2 break-words",
|
|
428
|
+
style: {
|
|
429
|
+
minWidth: `${columnWidth}px`
|
|
430
|
+
}
|
|
431
|
+
}, this.renderCell(row[column], column));
|
|
432
|
+
})))))), this.shouldEnablePagination() && h("div", {
|
|
433
|
+
key: '24931f257ef9ced394c1b5b1e589cacedd8035e6',
|
|
434
|
+
class: "mt-20"
|
|
435
|
+
}, h("eds-pagination", {
|
|
436
|
+
key: '996b26ae090ee4fe08cc821fb11362d94879ff72',
|
|
437
|
+
currentPage: this.currentPage,
|
|
438
|
+
lastPage: lastPage,
|
|
439
|
+
perPage: this.rowsPerPage,
|
|
440
|
+
total: this.totalRows,
|
|
441
|
+
mode: "default"
|
|
442
|
+
})));
|
|
443
|
+
}
|
|
444
|
+
get hostEl() {
|
|
445
|
+
return getElement(this);
|
|
446
|
+
}
|
|
447
|
+
static get watchers() {
|
|
448
|
+
return {
|
|
449
|
+
"data": ["handleDataChange", "parseData"],
|
|
450
|
+
"config": ["handleConfigChange"]
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
EdsTable.style = EdsTableStyle0;
|
|
257
455
|
|
|
258
|
-
export { EdsPagination as eds_pagination };
|
|
456
|
+
export { EdsPagination as eds_pagination, EdsTable as eds_table };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
const edsProgressBarCss = ".w-full{width:100%}.h-full{height:100%}.bg-default{background-color:var(--grey-200)}.rounded-lg{border-radius:16px}.h-24{height:1.5rem}.border{border-width:1px}.border-softer{border:2px solid rgba(0, 0, 0, .1 )}.overflow-hidden{overflow:hidden}.bg-accent{background-color:var(--green-500)}.bg-\\[\\#0034CB\\]{--tw-text-opacity:1;background-color:rgb(0 52 203 / var(--tw-text-opacity))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.duration-300{transition-duration:300ms}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.text-default{color:var(--black)}.text-inverse{color:var(--white)}.f-body-02{font-family:var(--f-body-02-fontFamily);font-weight:var(--f-body-02-fontWeight);font-size:var(--f-body-02-fontSize);line-height:var(--f-body-02-lineHeight);letter-spacing:var(--f-body-02-letterSpacing)}";
|
|
7
|
+
const EdsProgressBarStyle0 = edsProgressBarCss;
|
|
8
|
+
const EdsProgressBar = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.value = 0;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Method to update the progress value externally.
|
|
15
|
+
* @param newValue The new progress value (0-100).
|
|
16
|
+
*/
|
|
17
|
+
async updateValue(newValue) {
|
|
18
|
+
this.value = Math.min(100, Math.max(0, newValue)); // Clamp value between 0 and 100
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const progressValue = this.value;
|
|
22
|
+
return h("div", {
|
|
23
|
+
key: '3131f56034a9fd72ca51e448bc2bcc6281669b25',
|
|
24
|
+
class: "outer w-full bg-default rounded-lg h-24 border border-softer overflow-hidden"
|
|
25
|
+
}, h("div", {
|
|
26
|
+
key: 'f1665a254f8dbe1ccb9e512e5f2e7c1e5ab88c07',
|
|
27
|
+
class: `inner h-full rounded-lg bg-accent transition-all duration-300 flex items-center justify-center text-default f-body-02`,
|
|
28
|
+
style: {
|
|
29
|
+
width: `${progressValue}%`
|
|
30
|
+
}
|
|
31
|
+
}, progressValue, "%"));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
EdsProgressBar.style = EdsProgressBarStyle0;
|
|
35
|
+
|
|
36
|
+
export { EdsProgressBar as eds_progress_bar };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index.esm2.js';
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
2
|
import { e as euSvg } from './eu-9ddde93a.esm.js';
|
|
3
3
|
import { h as hLogoColor } from './logo-color-7f1fd803.esm.js';
|
|
4
4
|
import { h as hLogoBlack, a as hLogoColorWhite, b as hLogoWhite, c as hLogoWhiteNoBg, v as vLogoColor, d as vLogoBlack, e as vLogoColorWhite, f as vLogoWhite, g as vLogoWhiteNoBg } from './logo-white-no-bg-f382f86f.esm.js';
|
|
@@ -291,6 +291,11 @@ const EdsSvgRepository = class {
|
|
|
291
291
|
icon: svgContent // Pass SVG content as innerHTML
|
|
292
292
|
}));
|
|
293
293
|
}
|
|
294
|
+
get hostWidth() {
|
|
295
|
+
// Instead of using window.innerWidth, use the parent element's width.
|
|
296
|
+
const containerWidth = this.hostEl.parentElement ? this.hostEl.parentElement.offsetWidth : 400;
|
|
297
|
+
return containerWidth;
|
|
298
|
+
}
|
|
294
299
|
render() {
|
|
295
300
|
const svgData = this.getSvgData();
|
|
296
301
|
// Define table configuration
|
|
@@ -303,14 +308,18 @@ const EdsSvgRepository = class {
|
|
|
303
308
|
}
|
|
304
309
|
};
|
|
305
310
|
return h("eds-table", {
|
|
306
|
-
key: '
|
|
311
|
+
key: 'a1d4a1db6f0886a43513fc34707cdd6140ab685d',
|
|
307
312
|
data: JSON.stringify(svgData),
|
|
308
313
|
config: JSON.stringify(tableConfig),
|
|
309
314
|
"rows-per-page": 10,
|
|
310
315
|
"search-enabled": true,
|
|
311
|
-
"pagination-enabled": true
|
|
316
|
+
"pagination-enabled": true,
|
|
317
|
+
"host-width": this.hostWidth
|
|
312
318
|
});
|
|
313
319
|
}
|
|
320
|
+
get hostEl() {
|
|
321
|
+
return getElement(this);
|
|
322
|
+
}
|
|
314
323
|
};
|
|
315
324
|
|
|
316
325
|
export { EdsSvgRepository as eds_svg_repository };
|
|
@@ -108,13 +108,13 @@ const EdsTabsContent = class {
|
|
|
108
108
|
}
|
|
109
109
|
render() {
|
|
110
110
|
return h("div", {
|
|
111
|
-
key: '
|
|
111
|
+
key: '7bc954d9251bd15b5e3a49d5c74b83805f802b07',
|
|
112
112
|
class: "after:border-softest before:bg-gradient-y relative overflow-x-hidden before:absolute before:inset-x-0 before:bottom-0 before:h-12 before:opacity-5 before:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:border-b-2 after:content-['']"
|
|
113
113
|
}, h("div", {
|
|
114
|
-
key: '
|
|
114
|
+
key: '1bfda380604f1eae1cc5be147a5e3e6b537e0396',
|
|
115
115
|
class: "scroller-x max-w-xxxl xxxl:px-0 relative z-[1] mx-auto px-16 pt-8 lg:px-28"
|
|
116
116
|
}, h("nav", {
|
|
117
|
-
key: '
|
|
117
|
+
key: 'b2ed26b52fd629ec99b01c7dc8e612eae4f3886d',
|
|
118
118
|
ref: el => this.tabContainer = el,
|
|
119
119
|
class: "inline-flex",
|
|
120
120
|
"aria-label": this.navAriaLabel
|
|
@@ -129,7 +129,7 @@ const EdsTabsContent = class {
|
|
|
129
129
|
onClick: () => this.handleTabClick(index, tab.label)
|
|
130
130
|
}));
|
|
131
131
|
})), h("slot", {
|
|
132
|
-
key: '
|
|
132
|
+
key: '5072b877786a23358d540d6d242d5fbdb3c63d7f'
|
|
133
133
|
})));
|
|
134
134
|
}
|
|
135
135
|
get el() {
|
package/eds-tabs.entry.esm.js
CHANGED
|
@@ -40,11 +40,30 @@ const EdsTabs = class {
|
|
|
40
40
|
index: 0
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Parses the `links` prop into an array of link objects.
|
|
45
|
+
* Returns an empty array if parsing fails or if `links` is not a valid JSON string or object.
|
|
46
|
+
*
|
|
47
|
+
* @returns {any[]} Array of parsed link objects
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Parses the `links` prop into an array of link objects.
|
|
51
|
+
* Returns an empty array if parsing fails or if `links` is not a valid JSON string or object.
|
|
52
|
+
*
|
|
53
|
+
* @returns {any[]} Array of parsed link objects
|
|
54
|
+
*/
|
|
43
55
|
parseTabs() {
|
|
44
|
-
|
|
45
|
-
this.parsedTabs =
|
|
46
|
-
}
|
|
47
|
-
|
|
56
|
+
if (Array.isArray(this.tabs)) {
|
|
57
|
+
this.parsedTabs = this.tabs;
|
|
58
|
+
} else if (typeof this.tabs === 'string') {
|
|
59
|
+
try {
|
|
60
|
+
this.parsedTabs = JSON.parse(this.tabs);
|
|
61
|
+
} catch (e) {
|
|
62
|
+
//console.error('Error parsing tabs prop:', e);
|
|
63
|
+
this.parsedTabs = [];
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
// If the type is not an array or string, assume an empty array.
|
|
48
67
|
this.parsedTabs = [];
|
|
49
68
|
}
|
|
50
69
|
}
|
|
@@ -100,14 +119,14 @@ const EdsTabs = class {
|
|
|
100
119
|
}
|
|
101
120
|
render() {
|
|
102
121
|
return h("div", {
|
|
103
|
-
key: '
|
|
122
|
+
key: '540bb667084b36ae2151ec39ef6b54a9ac6a4c4a',
|
|
104
123
|
id: `${this.id}`,
|
|
105
124
|
class: "after:border-softest before:bg-gradient-y relative overflow-x-hidden before:absolute before:inset-x-0 before:bottom-0 before:h-12 before:opacity-5 before:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:border-b-2 after:content-['']"
|
|
106
125
|
}, h("div", {
|
|
107
|
-
key: '
|
|
126
|
+
key: 'f0266d39c943b82725ded757cce0b35fb85fa874',
|
|
108
127
|
class: "scroller-x overflow-x-auto max-w-xxxl xxxl:px-0 relative z-[1] mx-auto px-16 pt-8 lg:px-28"
|
|
109
128
|
}, h("nav", {
|
|
110
|
-
key: '
|
|
129
|
+
key: 'fcedf94e6f6c14635291d9c8e6d672efc8055433',
|
|
111
130
|
ref: el => this.tabContainer = el,
|
|
112
131
|
class: "inline-flex",
|
|
113
132
|
"aria-label": this.navAriaLabel
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
const EdsTimeline = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.events = undefined;
|
|
10
|
+
this.selectedEvent = null;
|
|
11
|
+
this.parsedEvents = [];
|
|
12
|
+
}
|
|
13
|
+
parseEvents(newValue) {
|
|
14
|
+
let parsed;
|
|
15
|
+
// If events is a string, try to parse it
|
|
16
|
+
if (typeof newValue === 'string') {
|
|
17
|
+
try {
|
|
18
|
+
parsed = JSON.parse(newValue);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.error('Error parsing events JSON', e);
|
|
21
|
+
parsed = [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// If events is already an array, use it directly
|
|
25
|
+
else if (Array.isArray(newValue)) {
|
|
26
|
+
parsed = newValue;
|
|
27
|
+
}
|
|
28
|
+
// Otherwise, default to an empty array
|
|
29
|
+
else {
|
|
30
|
+
parsed = [];
|
|
31
|
+
}
|
|
32
|
+
// Map over the parsed events to ensure boolean conversion for "completed"
|
|
33
|
+
this.parsedEvents = Array.isArray(parsed) ? parsed.map(event => Object.assign(Object.assign({}, event), {
|
|
34
|
+
completed: event.completed === 'true' || event.completed === true
|
|
35
|
+
})) : [];
|
|
36
|
+
}
|
|
37
|
+
componentWillLoad() {
|
|
38
|
+
this.parseEvents(this.events);
|
|
39
|
+
}
|
|
40
|
+
componentDidLoad() {
|
|
41
|
+
const cards = this.el.querySelectorAll('eds-card-generic');
|
|
42
|
+
cards.forEach(card => {
|
|
43
|
+
this.emitContext(card);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
emitContext(cardElement) {
|
|
47
|
+
const event = new CustomEvent('parentContext', {
|
|
48
|
+
detail: {
|
|
49
|
+
componentName: this.el.tagName.toLowerCase(),
|
|
50
|
+
identifier: null
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
cardElement.dispatchEvent(event);
|
|
54
|
+
}
|
|
55
|
+
handleEventClick(event) {
|
|
56
|
+
this.selectedEvent = event;
|
|
57
|
+
if (this.modalRef && typeof this.modalRef.open === 'function') {
|
|
58
|
+
this.modalRef.open();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
return h("div", {
|
|
63
|
+
key: '29e360adb412c67e7516f04671c276a12197d830',
|
|
64
|
+
class: "max-w-sidebar mx-auto px-4 py-8"
|
|
65
|
+
}, h("div", {
|
|
66
|
+
key: 'c556578a505bfb2da435616cb1f39cb91859ec7e',
|
|
67
|
+
class: "relative"
|
|
68
|
+
}, h("div", {
|
|
69
|
+
key: '8e1d307b2b3b470c643ba992d8307457581e9d4f',
|
|
70
|
+
class: "absolute w-4 left-1/2 transform -translate-x-1/2 bg-strong h-full z-0"
|
|
71
|
+
}), h("div", {
|
|
72
|
+
key: '7b40b6a8944aad01d01524e13056fbafeaa8a8a8',
|
|
73
|
+
class: "space-y-16"
|
|
74
|
+
}, this.parsedEvents.map((event, index) => h("div", {
|
|
75
|
+
class: "relative flex"
|
|
76
|
+
}, h("div", {
|
|
77
|
+
class: `w-1/2 ${index % 2 === 0 ? 'pr-4' : ''}`
|
|
78
|
+
}, index % 2 === 0 && h("eds-card-generic", {
|
|
79
|
+
cardTitle: event.title,
|
|
80
|
+
url: "#",
|
|
81
|
+
description: event.description,
|
|
82
|
+
"heading-level": "h2",
|
|
83
|
+
tiny: true,
|
|
84
|
+
bg: !event.completed,
|
|
85
|
+
"with-hover": "false",
|
|
86
|
+
tags: JSON.stringify(event.completed ? [{
|
|
87
|
+
label: 'completed',
|
|
88
|
+
style: 'accent'
|
|
89
|
+
}] : [{
|
|
90
|
+
label: 'pending',
|
|
91
|
+
style: 'default'
|
|
92
|
+
}]),
|
|
93
|
+
onClick: () => this.handleEventClick(event)
|
|
94
|
+
})), h("div", {
|
|
95
|
+
class: "flex items-center justify-center relative"
|
|
96
|
+
}, event.completed ? h("div", {
|
|
97
|
+
class: "w-32 h-32 bg-accent rounded-full shadow flex items-center justify-center"
|
|
98
|
+
}) : h("div", {
|
|
99
|
+
class: "w-32 h-32 bg-strong rounded-full shadow flex items-center justify-center"
|
|
100
|
+
})), h("div", {
|
|
101
|
+
class: `w-1/2 ${index % 2 !== 0 ? 'pl-4' : ''}`
|
|
102
|
+
}, index % 2 !== 0 && h("eds-card-generic", {
|
|
103
|
+
cardTitle: event.title,
|
|
104
|
+
url: "#",
|
|
105
|
+
description: event.description,
|
|
106
|
+
"heading-level": "h2",
|
|
107
|
+
tiny: true,
|
|
108
|
+
bg: !event.completed,
|
|
109
|
+
"with-hover": "false",
|
|
110
|
+
tags: JSON.stringify(event.completed ? [{
|
|
111
|
+
label: 'completed',
|
|
112
|
+
style: 'accent'
|
|
113
|
+
}] : [{
|
|
114
|
+
label: 'pending',
|
|
115
|
+
style: 'default'
|
|
116
|
+
}]),
|
|
117
|
+
onClick: () => this.handleEventClick(event)
|
|
118
|
+
})))))));
|
|
119
|
+
}
|
|
120
|
+
get el() {
|
|
121
|
+
return getElement(this);
|
|
122
|
+
}
|
|
123
|
+
static get watchers() {
|
|
124
|
+
return {
|
|
125
|
+
"events": ["parseEvents"]
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export { EdsTimeline as eds_timeline };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
const EdsTrl = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.applications = undefined;
|
|
10
|
+
}
|
|
11
|
+
getParsedApplications() {
|
|
12
|
+
let apps = [];
|
|
13
|
+
// If applications is a string, attempt to parse it as JSON.
|
|
14
|
+
if (typeof this.applications === 'string') {
|
|
15
|
+
try {
|
|
16
|
+
apps = JSON.parse(this.applications || '[]');
|
|
17
|
+
} catch (error) {
|
|
18
|
+
// Uncomment the next line for debugging
|
|
19
|
+
// console.error('Invalid applications JSON', error);
|
|
20
|
+
apps = [];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// If applications is already an array, use it directly.
|
|
24
|
+
else if (Array.isArray(this.applications)) {
|
|
25
|
+
apps = this.applications;
|
|
26
|
+
}
|
|
27
|
+
return apps;
|
|
28
|
+
}
|
|
29
|
+
calculateProgress(currentTrl) {
|
|
30
|
+
const maxTrl = 9;
|
|
31
|
+
return Math.ceil(currentTrl / maxTrl * 100); // Calculate percentage and round up
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
const apps = this.getParsedApplications();
|
|
35
|
+
console.log('apps:', apps);
|
|
36
|
+
// Map applications into table-friendly data.
|
|
37
|
+
const tableData = apps.map(app => ({
|
|
38
|
+
Application: app.name,
|
|
39
|
+
"Current TRL Stage": `TRL ${app.currentTrl}`,
|
|
40
|
+
Progress: h("div", {
|
|
41
|
+
class: "w-[200px]"
|
|
42
|
+
}, h("eds-progress-bar", {
|
|
43
|
+
value: this.calculateProgress(app.currentTrl)
|
|
44
|
+
}))
|
|
45
|
+
}));
|
|
46
|
+
const tableConfig = {
|
|
47
|
+
"Application": {
|
|
48
|
+
"format": "code"
|
|
49
|
+
},
|
|
50
|
+
"Current TRL Stage": {
|
|
51
|
+
"format": "text"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return h("div", {
|
|
55
|
+
key: '71e903734b5cd1ef74bf93e8fcdc57afacb51f07',
|
|
56
|
+
class: "container mx-auto px-4 py-8"
|
|
57
|
+
}, h("eds-table", {
|
|
58
|
+
key: 'cb8e4324c9c8481dcc2daf74f06c6928257e6f8b',
|
|
59
|
+
data: JSON.stringify(tableData),
|
|
60
|
+
config: JSON.stringify(tableConfig),
|
|
61
|
+
"rows-per-page": "2",
|
|
62
|
+
"pagination-enabled": "true",
|
|
63
|
+
"search-enabled": "true",
|
|
64
|
+
"column-size": "default"
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { EdsTrl as eds_trl };
|
|
@@ -29,19 +29,20 @@ const IncorrectUseOfColors = class {
|
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
31
|
return h("div", {
|
|
32
|
-
key: '
|
|
32
|
+
key: '2e660e9a788e46e68d6695ae8aa475bbb1ca395e',
|
|
33
33
|
class: "container"
|
|
34
|
-
}, h("
|
|
35
|
-
key: '
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
}, h("eds-alert", {
|
|
35
|
+
key: '1dc4552a33d88055a3a0c33eeb18c53a8379039a',
|
|
36
|
+
message: "Note that, each of the four colour tones cannot be mixed in the same composition.",
|
|
37
|
+
intent: "error"
|
|
38
|
+
}), h("div", {
|
|
39
|
+
key: 'fd6bf7f0205422b1bd3ceb3f8374d5a9a73aaca0',
|
|
39
40
|
class: "flex"
|
|
40
41
|
}, h("div", {
|
|
41
|
-
key: '
|
|
42
|
+
key: 'dae745447f5e9792136f059b1dcfc868e473dfd5',
|
|
42
43
|
class: "w-full"
|
|
43
44
|
}, h("ul", {
|
|
44
|
-
key: '
|
|
45
|
+
key: 'daeec7514f4027ec3f688f05fb4f1e027b846a81',
|
|
45
46
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
46
47
|
}, primary.map(color => h("li", {
|
|
47
48
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -51,10 +52,10 @@ const IncorrectUseOfColors = class {
|
|
|
51
52
|
backgroundColor: color.background
|
|
52
53
|
}
|
|
53
54
|
}))))), h("div", {
|
|
54
|
-
key: '
|
|
55
|
+
key: '1ca202afa9384e78e3ed9c0674e06c51184d3a5a',
|
|
55
56
|
class: "w-full"
|
|
56
57
|
}, h("ul", {
|
|
57
|
-
key: '
|
|
58
|
+
key: '7bdef2e7d64f3c5553193d127bac69ee89a93686',
|
|
58
59
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
59
60
|
}, incorrect.map(color => h("li", {
|
|
60
61
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as EdsAccordion, a as EdsAlert, b as EdsAvatar, d as EdsBlockBreak, e as EdsBreadcrumb, f as EdsButton, i as EdsCardDesc, j as EdsCardGeneric, k as EdsCardSection, l as EdsCodeBlock, m as EdsDropdown, n as EdsFooter, o as EdsForm, p as EdsFrame, q as EdsFullscreenMenu, s as EdsHeader, t as EdsIconWrapper, u as EdsImg, v as EdsInputField, w as
|
|
1
|
+
export { E as EdsAccordion, a as EdsAlert, b as EdsAvatar, d as EdsBlockBreak, e as EdsBreadcrumb, f as EdsButton, i as EdsCardDesc, j as EdsCardGeneric, k as EdsCardSection, l as EdsCodeBlock, m as EdsDropdown, n as EdsFooter, o as EdsForm, p as EdsFrame, q as EdsFullscreenMenu, s as EdsHeader, t as EdsIconWrapper, u as EdsImg, v as EdsInputField, w as EdsInputSelect, x as EdsLink, y as EdsLogin, z as EdsLogo, A as EdsMatomoNotice, B as EdsModal, C as EdsPagination, D as EdsProgressBar, F as EdsRating, G as EdsSectionCore, H as EdsSectionHeading, I as EdsSocialNetworks, J as EdsTable, K as EdsTabs, L as EdsTag, M as EdsTimeline, N as EdsToast, O as EdsToastManager, P as EdsTooltip, Q as EdsUser } from './index.esm2.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react-dom';
|