@ebrains/react 0.2.0-alpha.0 → 0.4.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-0ba8ed56.esm.js → color-bb472c37.esm.js} +2 -2
- package/color-primary-palette_6.entry.esm.js +106 -106
- package/correct-use-of-colors.entry.esm.js +57 -57
- package/{eds-alert_28.entry.esm.js → eds-accordion_33.entry.esm.js} +187 -45
- package/eds-card-project.entry.esm.js +1 -1
- package/eds-card-section.entry.esm.js +18 -8
- package/eds-card-tags.entry.esm.js +1 -1
- package/eds-card-tool.entry.esm.js +1 -1
- package/eds-card-wrapper.entry.esm.js +4 -4
- package/eds-code-block.entry.esm.js +55 -8
- 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-login.entry.esm.js +4 -12
- package/eds-logo-variations.entry.esm.js +29 -0
- package/eds-matomo-notice.entry.esm.js +1 -1
- package/{eds-pagination.entry.esm.js → eds-pagination_2.entry.esm.js} +222 -7
- package/eds-progress-bar.entry.esm.js +36 -0
- package/eds-rating.entry.esm.js +7 -9
- package/eds-svg-repository.entry.esm.js +12 -3
- package/eds-tabs-content.entry.esm.js +5 -5
- package/eds-tabs.entry.esm.js +27 -8
- package/eds-timeline.entry.esm.js +131 -0
- package/eds-tooltip.entry.esm.js +13 -3
- package/eds-trl.entry.esm.js +68 -0
- package/incorrect-use-of-colors.entry.esm.js +11 -10
- package/index.esm.js +1 -1
- package/index.esm2.js +20 -37
- 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 +1 -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-accordion.entry.esm.js +0 -132
- 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-frame.entry.esm.js +0 -117
- package/eds-fullscreen-menu.entry.esm.js +0 -143
- package/eds-modal.entry.esm.js +0 -114
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
-
import { s as sendAnalytics, g as gradientBGColorVariants } from './color-
|
|
2
|
+
import { s as sendAnalytics, g as gradientBGColorVariants } from './color-bb472c37.esm.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react-dom';
|
|
@@ -8,7 +8,7 @@ const EdsCardSectionStyle0 = edsCardSectionCss;
|
|
|
8
8
|
const EdsCardSection = class {
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
registerInstance(this, hostRef);
|
|
11
|
-
this.cards =
|
|
11
|
+
this.cards = [];
|
|
12
12
|
this.cols = 4;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
@@ -18,12 +18,22 @@ const EdsCardSection = class {
|
|
|
18
18
|
* @returns {any[]} An array of parsed card objects.
|
|
19
19
|
*/
|
|
20
20
|
get parsedCards() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//console.error('Error parsing links JSON', e);
|
|
25
|
-
return [];
|
|
21
|
+
// If it's already an array, return it immediately.
|
|
22
|
+
if (Array.isArray(this.cards)) {
|
|
23
|
+
return this.cards;
|
|
26
24
|
}
|
|
25
|
+
if (typeof this.cards === 'object') {
|
|
26
|
+
return this.cards;
|
|
27
|
+
} else if (typeof this.cards === 'string') {
|
|
28
|
+
try {
|
|
29
|
+
return JSON.parse(this.cards);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
// eslint-disable-next-line
|
|
32
|
+
console.error('Error parsing cards prop:', e);
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return [];
|
|
27
37
|
}
|
|
28
38
|
/**
|
|
29
39
|
* Renders the card section as a grid layout.
|
|
@@ -34,10 +44,10 @@ const EdsCardSection = class {
|
|
|
34
44
|
*/
|
|
35
45
|
render() {
|
|
36
46
|
return h("section", {
|
|
37
|
-
key: '
|
|
47
|
+
key: 'da139da167230819e494a6426c2431f209a2e557',
|
|
38
48
|
class: "w-full"
|
|
39
49
|
}, h("ul", {
|
|
40
|
-
key: '
|
|
50
|
+
key: '3e8affe5c9aee91c4487480c72c437339265101a',
|
|
41
51
|
class: "grid-layout gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
42
52
|
}, this.parsedCards.map(card => h("li", {
|
|
43
53
|
class: `grid-col-span-12 md:grid-col-span-${this.cols} flex flex-col`
|
|
@@ -13,7 +13,7 @@ const EdsCardTags = class {
|
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
15
|
return h("div", {
|
|
16
|
-
key: '
|
|
16
|
+
key: '60a129de62d45736eba0884cc24c9738f3a0f55c',
|
|
17
17
|
class: "flex flex-wrap gap-y-4"
|
|
18
18
|
}, this.tags.map((tag, index) => h("eds-tag", {
|
|
19
19
|
key: index,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
-
import { s as sendAnalytics } from './color-
|
|
2
|
+
import { s as sendAnalytics } from './color-bb472c37.esm.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react-dom';
|
|
@@ -19,15 +19,15 @@ const EdsCardWrapper = class {
|
|
|
19
19
|
render() {
|
|
20
20
|
const articleClasses = [this.tiny ? 'min-h-120' : 'min-h-156', this.withBg ? 'bg-inverse' : 'bg-default', this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '', 'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'].join(' ');
|
|
21
21
|
return h("article", {
|
|
22
|
-
key: '
|
|
22
|
+
key: '7c12b1d147f061e189b5dda5d517ec4eae0c3691',
|
|
23
23
|
class: articleClasses
|
|
24
24
|
}, h("slot", {
|
|
25
|
-
key: '
|
|
25
|
+
key: 'f506bad73ed38ae36931f88f7d7c5f5d94705e4f'
|
|
26
26
|
}), this.hasSlot('footer') && h("div", {
|
|
27
|
-
key: '
|
|
27
|
+
key: '783f480be269e4a2f61aa8d4396e757fe41bfcc6',
|
|
28
28
|
class: "mt-auto"
|
|
29
29
|
}, h("slot", {
|
|
30
|
-
key: '
|
|
30
|
+
key: 'f07ddaa2d930518a5c8ac82efab3cb0dd6647bdd',
|
|
31
31
|
name: "footer"
|
|
32
32
|
})));
|
|
33
33
|
}
|
|
@@ -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 'react';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react-dom';
|
|
@@ -2187,12 +2187,56 @@ const EdsCodeBlock = class {
|
|
|
2187
2187
|
this.language = undefined;
|
|
2188
2188
|
this.copied = false;
|
|
2189
2189
|
}
|
|
2190
|
+
/**
|
|
2191
|
+
* Copies the current code content to the clipboard and sets a temporary copied state.
|
|
2192
|
+
*
|
|
2193
|
+
* @private
|
|
2194
|
+
* @returns {void}
|
|
2195
|
+
*/
|
|
2190
2196
|
copyToClipboard() {
|
|
2191
2197
|
navigator.clipboard.writeText(this.code).then(() => {
|
|
2192
2198
|
this.copied = true;
|
|
2199
|
+
/*const analyticsName = this.createHumanFriendlyAnalyticsName(this.code, this.language);
|
|
2200
|
+
sendAnalytics({
|
|
2201
|
+
category: 'ui-component',
|
|
2202
|
+
parentContext: null,
|
|
2203
|
+
tag: this.el.tagName.toLowerCase(),
|
|
2204
|
+
name: analyticsName || '',
|
|
2205
|
+
action: 'copy'
|
|
2206
|
+
});*/
|
|
2193
2207
|
setTimeout(() => this.copied = false, 2000);
|
|
2194
2208
|
});
|
|
2195
2209
|
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Utility function that creates a human-friendly analytics name based on the code and language.
|
|
2212
|
+
* It uses:
|
|
2213
|
+
* - The language (in uppercase)
|
|
2214
|
+
* - The number of non-empty lines in the code
|
|
2215
|
+
* - The first non-empty line of code (truncated to 30 characters, if needed)
|
|
2216
|
+
*
|
|
2217
|
+
* returns A descriptive analytics name.
|
|
2218
|
+
*/
|
|
2219
|
+
/*private createHumanFriendlyAnalyticsName(code: string, language: string): string {
|
|
2220
|
+
// Count non-empty lines
|
|
2221
|
+
const lines = code.split('\n').filter(line => line.trim() !== '').length;
|
|
2222
|
+
|
|
2223
|
+
// Find the first non-empty line and trim it
|
|
2224
|
+
let firstNonEmptyLine = code.split('\n').find(line => line.trim() !== '');
|
|
2225
|
+
firstNonEmptyLine = firstNonEmptyLine ? firstNonEmptyLine.trim() : '';
|
|
2226
|
+
// Truncate the snippet if it’s too long
|
|
2227
|
+
if (firstNonEmptyLine.length > 30) {
|
|
2228
|
+
firstNonEmptyLine = firstNonEmptyLine.substring(0, 30) + '...';
|
|
2229
|
+
}
|
|
2230
|
+
return `CodeBlock:${language.toLowerCase()}|${lines}-line(s)|${firstNonEmptyLine.toLowerCase()}`;
|
|
2231
|
+
}*/
|
|
2232
|
+
/**
|
|
2233
|
+
* Returns the syntax-highlighted HTML for the code.
|
|
2234
|
+
* If the provided language is supported by Prism, this method returns the highlighted code.
|
|
2235
|
+
* Otherwise, it logs a warning and returns the raw code.
|
|
2236
|
+
*
|
|
2237
|
+
* @private
|
|
2238
|
+
* @returns {string} The highlighted HTML string for the code block.
|
|
2239
|
+
*/
|
|
2196
2240
|
getHighlightedCode() {
|
|
2197
2241
|
if (this.language && Prism$1.languages[this.language]) {
|
|
2198
2242
|
return Prism$1.highlight(this.code, Prism$1.languages[this.language], this.language);
|
|
@@ -2203,10 +2247,10 @@ const EdsCodeBlock = class {
|
|
|
2203
2247
|
}
|
|
2204
2248
|
render() {
|
|
2205
2249
|
return h("div", {
|
|
2206
|
-
key: '
|
|
2250
|
+
key: '00eba9265ee17605f699d1e5606013b68e900b29',
|
|
2207
2251
|
class: "relative bg-stronger rounded-sm"
|
|
2208
2252
|
}, h("div", {
|
|
2209
|
-
key: '
|
|
2253
|
+
key: '1192584f04de5ff74e91c88597a3360b92053456',
|
|
2210
2254
|
class: "text-inverse flex justify-between items-center p-8"
|
|
2211
2255
|
}, this.language ? h("span", {
|
|
2212
2256
|
class: "f-ui-03"
|
|
@@ -2217,26 +2261,29 @@ const EdsCodeBlock = class {
|
|
|
2217
2261
|
}, h("code", {
|
|
2218
2262
|
innerHTML: this.getHighlightedCode()
|
|
2219
2263
|
})), h("span", {
|
|
2220
|
-
key: '
|
|
2264
|
+
key: '3666b6529a16a8cc64f448527db4ddee08f977a3',
|
|
2221
2265
|
"aria-hidden": "true",
|
|
2222
2266
|
class: "w-20 h-20 mt-8"
|
|
2223
2267
|
}, h("eds-icon-wrapper", {
|
|
2224
|
-
key: '
|
|
2268
|
+
key: 'f222d95a2e548429f6c4de96a7646e3cef1f360f',
|
|
2225
2269
|
icon: this.copied ? 'success' : 'copy',
|
|
2226
2270
|
onClick: () => this.copyToClipboard()
|
|
2227
2271
|
})), h("span", {
|
|
2228
|
-
key: '
|
|
2272
|
+
key: '8c539deda773909c01a41eb04ee51380c0a9c4bb',
|
|
2229
2273
|
class: "sr-only"
|
|
2230
2274
|
}, "Copy Code")), this.language && h("pre", {
|
|
2231
|
-
key: '
|
|
2275
|
+
key: '99541dedb32c543da5e780ffee4460333fbb3724',
|
|
2232
2276
|
class: `language-${this.language} bg-stronger pl-8 pb-8`,
|
|
2233
2277
|
role: "region",
|
|
2234
2278
|
"aria-label": `Code block in ${this.language}`
|
|
2235
2279
|
}, h("code", {
|
|
2236
|
-
key: '
|
|
2280
|
+
key: '4e6ae6fcfae3de8c1fe5ad9d22309e0c8bee0c2c',
|
|
2237
2281
|
innerHTML: this.getHighlightedCode()
|
|
2238
2282
|
})));
|
|
2239
2283
|
}
|
|
2284
|
+
get el() {
|
|
2285
|
+
return getElement(this);
|
|
2286
|
+
}
|
|
2240
2287
|
};
|
|
2241
2288
|
EdsCodeBlock.style = EdsCodeBlockStyle0;
|
|
2242
2289
|
|
|
@@ -5,57 +5,92 @@ import 'react-dom';
|
|
|
5
5
|
|
|
6
6
|
const EdsComponentsOverview = () => h("div", {
|
|
7
7
|
class: "static-content container"
|
|
8
|
-
}, h("eds-
|
|
9
|
-
|
|
10
|
-
intent: "default"
|
|
11
|
-
}), h("h2", null, "Load the module"), h("p", null, "Integrating EDSs components to a project without a JavaScript framework is straight forward. If you\u2019re working on a simple HTML page, you can start using the components immediately by adding the tags below to the", ' ', h("code", null, "head"), "."), h("eds-code-block", {
|
|
12
|
-
code: '<script type="module" href="https://unpkg.com/@ebrains/components@0.0.1/loader"/></script>',
|
|
8
|
+
}, h("h2", null, "Load the module"), h("p", null, "Integrating EDSs components to a project without a JavaScript framework is straight forward. If you\u2019re working on a simple HTML page, you can start using the components immediately by adding the tags below to the", ' ', h("code", null, "head"), "."), h("eds-code-block", {
|
|
9
|
+
code: "<script type='module'>\n import { defineCustomElements } from 'https://unpkg.com/@ebrains/components@latest/loader/index.js'; \n // Define custom elements\n defineCustomElements(window);\n</script>",
|
|
13
10
|
language: "javascript",
|
|
14
11
|
"copy-label": "Copy Code"
|
|
15
12
|
}), h("h2", null, "Load the styles"), h("p", null, "To directly use the produced css framework with a few predefined custom utility classes, add the tag below to the", ' ', h("code", null, "head")), h("eds-code-block", {
|
|
16
|
-
code: '<link rel="stylesheet" href="https://unpkg.com/@ebrains/assets@
|
|
13
|
+
code: '<link rel="stylesheet" href="https://unpkg.com/@ebrains/assets@latest/styles/output.css"/>',
|
|
17
14
|
language: "css",
|
|
18
15
|
"copy-label": "Copy Code"
|
|
19
|
-
}), h("
|
|
16
|
+
}), h("div", {
|
|
17
|
+
class: "my-4"
|
|
18
|
+
}, h("eds-alert", {
|
|
19
|
+
message: "Note that, loading the predefined CSS framework above, automatically loads the fonts so you can skip loading them separately.",
|
|
20
|
+
intent: "warning"
|
|
21
|
+
})), h("h2", null, "Load the fonts"), h("p", null, "To load the webfonts, add the tag below to the ", h("code", null, "head")), h("eds-code-block", {
|
|
20
22
|
code: '<link rel="stylesheet" href="https://unpkg.com/@ebrains/assets@0.0.1/styles/base/fonts.css"/>',
|
|
21
23
|
language: "css",
|
|
22
24
|
"copy-label": "Copy Code"
|
|
23
25
|
}), h("h2", null, "Component Usage"), h("p", null, "Once included, components can be used in your markup like any other regular HTML elements:"), h("eds-code-block", {
|
|
24
|
-
code: '<eds-button label="my bytton" intent="primary"
|
|
26
|
+
code: '<eds-button \n label="my bytton" \n intent="primary">\n</eds-button>',
|
|
25
27
|
language: "html",
|
|
26
28
|
"copy-label": "Copy Code"
|
|
27
29
|
}));
|
|
28
|
-
const EdsDocsInstallation = () => h("div", null, h("p", null, "
|
|
30
|
+
const EdsDocsInstallation = () => h("div", null, h("p", null, "Before proceeding, ensure that Node.js is installed on your machine\u2014you can download the latest version from the official website. If your project doesn\u2019t already use npm and you plan to integrate EBRAINS Components, you'll need to create a package.json file by running npm init and following the on-screen instructions."), h("div", {
|
|
31
|
+
class: "my-8"
|
|
32
|
+
}, h("eds-code-block", {
|
|
29
33
|
code: "npm install @ebrains/components",
|
|
30
34
|
language: "html",
|
|
31
35
|
"copy-label": "Copy Code"
|
|
32
|
-
}), h("
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
})), h("div", {
|
|
37
|
+
class: "my-8"
|
|
38
|
+
}, h("eds-code-block", {
|
|
39
|
+
code: "npm install @ebrains/assets",
|
|
40
|
+
language: "html",
|
|
41
|
+
"copy-label": "Copy Code"
|
|
42
|
+
})), h("div", {
|
|
43
|
+
class: "my-8"
|
|
44
|
+
}, h("eds-code-block", {
|
|
45
|
+
code: "npm install @ebrains/react",
|
|
46
|
+
language: "html",
|
|
47
|
+
"copy-label": "Copy Code"
|
|
48
|
+
})));
|
|
49
|
+
const EdsDocsReact = () => h("div", null, h("h2", null, "React Wrappers"), h("p", null, "Learn how to use our components in a React Application.Simple install the package below and check out the examples"), h("div", {
|
|
50
|
+
class: "my-8"
|
|
51
|
+
}, h("eds-code-block", {
|
|
35
52
|
code: "npm install @ebrains/react",
|
|
36
53
|
language: "javascript",
|
|
37
54
|
"copy-label": "Copy Code"
|
|
38
|
-
}), h("eds-section-core", {
|
|
55
|
+
})), h("eds-section-core", {
|
|
39
56
|
"section-title": "Example React App",
|
|
40
57
|
"heading-level": "h3"
|
|
41
58
|
}, h("eds-code-block", {
|
|
42
|
-
code: '\nimport { EdsHeader } from "@ebrains/react";\n\ninterface User {\n firstname: string;\n lastname: string;\n
|
|
59
|
+
code: '\nimport { EdsHeader } from "@ebrains/react";\n\ninterface User {\n firstname: string;\n lastname: string;\n}\n\ninterface AuthStatus {\n authenticated: boolean;\n user: User | null;\n}\n\nimport { useEffect, useState } from "react";\n\nexport function App() {\n\n const [authStatus, setAuthStatus] = useState<AuthStatus>({\n authenticated: false,\n user: null,\n });\n \n const [activeTabIndex, setActiveTabIndex] = useState<number>(0);\n\n // Use useEffect to render Stencil components dynamically after the component mounts\n useEffect(() => {\n \n const handleAuthStatusChange = (event: CustomEvent) => {\n console.log(event.detail);\n setAuthStatus(event.detail); // Set the entire object\n };\n\n const handleTabChange = (\n event: CustomEvent<{ index: number; name: string }>,\n ) => {\n console.log(event.detail);\n setActiveTabIndex(event.detail.index);\n };\n\n document.addEventListener(\n "authStatusChanged",\n handleAuthStatusChange as EventListener,\n );\n document.addEventListener("tabChange", handleTabChange as EventListener);\n\n return () => {\n document.removeEventListener(\n "authStatusChanged",\n handleAuthStatusChange as EventListener,\n );\n document.removeEventListener(\n "tabChange",\n handleTabChange as EventListener,\n );\n };\n }, []); // Empty dependency array ensures this runs only once after mounting\n\n return (\n <div id="main">\n <EdsHeader\n home-url="/"\n user-feature={false}\n keycloak-url="http://localhost:8080"\n keycloak-realm="nigeor-realm"\n keycloak-client-id="stencil-app"\n links="[\n { "label": "About", "url": "/about" },\n { "label": "Focus Areas", "url": "/focus-areas" },\n { "label": "News & Events", "url": "/news-and-events" },\n { "label": "Contact", "url": "/contact" }\n ]"\n ></EdsHeader>\n\n <div> \n User is{" "} {authStatus.authenticated ? "authenticated" : "not authenticated"}\n </div>\n {authStatus.user && <div>Welcome, {authStatus.user.firstname}</div>}\n </div>\n </div>\n );\n}\n\nexport default App;\n',
|
|
43
60
|
language: "javascript",
|
|
44
61
|
"copy-label": "Copy Code"
|
|
45
62
|
})));
|
|
46
|
-
const EdsDocsVue = () => h("div", null, h("h2", null, "Vue Wrappers"), h("p", null, "Learn how to use our components in a Vue Application."), h("eds-code-block", {
|
|
63
|
+
const EdsDocsVue = () => h("div", null, h("h2", null, "Vue Wrappers"), h("p", null, "Learn how to use our components in a Vue Application."), h("p", null, "Simply install the latest version of our NPM package."), h("eds-code-block", {
|
|
47
64
|
code: "npm install @ebrains/vue",
|
|
48
65
|
language: "javascript",
|
|
49
66
|
"copy-label": "Copy Code"
|
|
50
|
-
}), h("p", null, "
|
|
67
|
+
}), h("p", null, "Our NPM package already includes the custom elements definitions. However, you can use the components as they are by simply importing and executing the initialization command in your \"main.ts\" file."), h("eds-code-block", {
|
|
51
68
|
code: "import { defineCustomElements } from '@ebrains/components/loader';\ndefineCustomElements();",
|
|
52
69
|
language: "javascript",
|
|
53
70
|
"copy-label": "Copy Code"
|
|
54
|
-
}), h("
|
|
71
|
+
}), h("h2", null, "Passing Properties to Custom Elements Using the ", h("b", null, ".prop"), " Modifier in Vue Wrappers"), h("p", null, "When using Vue wrappers for Stencil components (or any custom elements), you might encounter issues with property names being altered due to HTML\u2019s attribute handling. By default, Vue binds values as HTML attributes, and HTML attributes are case-insensitive. This means that camelCase property names can be transformed into lowercase strings, which can prevent your component from receiving the correct data."), h("h3", null, "How to Use the ", h("b", null, ".prop"), " Modifier"), h("p", null, "When using Vue wrappers, you can pass properties with the .prop modifier by adding it to your binding expression. Here\u2019s an example of how to do it:"), h("div", {
|
|
72
|
+
class: "mt-8"
|
|
73
|
+
}, h("eds-alert", {
|
|
74
|
+
message: "This may lead to issues because Vue binds these as attributes .",
|
|
75
|
+
intent: "error"
|
|
76
|
+
})), h("eds-code-block", {
|
|
77
|
+
code: '<EdsAlert\n message="This is a default informational alert."\n intent="default"\n :pressableLabel="Press Me"\n :pressableUrl="https://ebrains.eu"\n></EdsAlert>',
|
|
78
|
+
language: "javascript",
|
|
79
|
+
"copy-label": "Copy Code"
|
|
80
|
+
}), h("div", {
|
|
81
|
+
class: "mt-8"
|
|
82
|
+
}, h("eds-alert", {
|
|
83
|
+
message: "Use the .prop modifier to ensure properties are passed correctly.",
|
|
84
|
+
intent: "success"
|
|
85
|
+
})), h("eds-code-block", {
|
|
86
|
+
code: '<EdsAlert\n message="This is a default informational alert."\n intent="default"\n :pressableLabel.prop="Press Me"\n :pressableUrl.prop="https://ebrains.eu"\n></EdsAlert>',
|
|
87
|
+
language: "javascript",
|
|
88
|
+
"copy-label": "Copy Code"
|
|
89
|
+
}), h("p", null, "Using the ", h("b", null, ".prop"), " modifier in Vue ensures that the data you pass to your custom elements is received as intended. It prevents Vue (and the browser) from transforming camelCase property names into lowercase attributes, thereby maintaining the correct data mapping in your Stencil components."), h("eds-section-core", {
|
|
55
90
|
"section-title": "Example Vue App",
|
|
56
91
|
"heading-level": "h3"
|
|
57
92
|
}, h("eds-code-block", {
|
|
58
|
-
code: '\n<template>\n <
|
|
93
|
+
code: '\n<template>\n <EdsHeader \n :inverseHeader.prop="true"\n :menuEnabled.prop="true">\n </EdsHeader>\n</template>\n\n<script>\n\nimport { EdsHeader } from "@ebrains/vue";\n\nexport default {\n name: "App",\n components: {\n EdsHeader,\n }\n};\n</script>\n',
|
|
59
94
|
language: "javascript",
|
|
60
95
|
"copy-label": "Copy Code"
|
|
61
96
|
})));
|
|
@@ -75,7 +110,7 @@ const EdsDocsAngular = () => h("div", null, h("h2", null, "Angular Wrappers"), h
|
|
|
75
110
|
"section-title": "Example Angular App",
|
|
76
111
|
"heading-level": "h3"
|
|
77
112
|
}, h("eds-code-block", {
|
|
78
|
-
code: '\n<div class="container">\n <
|
|
113
|
+
code: '\n<div class="container">\n <eds-breadcrumb\n intent="tertiary"\n items="[\n { "label": "Home", "url": "#" },\n { "label": "Products", "url": "#" },\n ]">\n </eds-breadcrumb>\n <eds-footer></eds-footer>\n</div>',
|
|
79
114
|
language: "javascript",
|
|
80
115
|
"copy-label": "Copy Code"
|
|
81
116
|
})));
|
|
@@ -91,12 +126,10 @@ const EdsComponentsSection = class {
|
|
|
91
126
|
case 1:
|
|
92
127
|
return h(EdsDocsInstallation, null);
|
|
93
128
|
case 2:
|
|
94
|
-
return h(EdsDocsUsage, null);
|
|
95
|
-
case 3:
|
|
96
129
|
return h(EdsDocsReact, null);
|
|
97
|
-
case
|
|
130
|
+
case 3:
|
|
98
131
|
return h(EdsDocsVue, null);
|
|
99
|
-
case
|
|
132
|
+
case 4:
|
|
100
133
|
return h(EdsDocsAngular, null);
|
|
101
134
|
default:
|
|
102
135
|
return h("p", null, "Content not available.");
|
|
@@ -104,7 +137,7 @@ const EdsComponentsSection = class {
|
|
|
104
137
|
}
|
|
105
138
|
render() {
|
|
106
139
|
return h("div", {
|
|
107
|
-
key: '
|
|
140
|
+
key: 'ce34514ab73daa5baa011bda56a13d6197f8bfd0',
|
|
108
141
|
class: "container"
|
|
109
142
|
}, this.renderContent());
|
|
110
143
|
}
|
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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
2
|
import { t as toast } from './toastManager-d9eee791.esm.js';
|
|
3
|
-
import { m as matomoOptIn } from './color-
|
|
3
|
+
import { m as matomoOptIn } from './color-bb472c37.esm.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
6
6
|
import 'react-dom';
|