@ebrains/components 0.3.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/dist/cjs/{color-3ffe3072.js → color-88793e49.js} +2 -2
- package/dist/cjs/components.cjs.js +1 -1
- package/dist/cjs/eds-accordion_33.cjs.entry.js +2670 -0
- package/dist/cjs/eds-card-project.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-section.cjs.entry.js +3 -3
- package/dist/cjs/eds-card-tags.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-tool.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-wrapper.cjs.entry.js +1 -1
- package/dist/cjs/eds-code-block.cjs.entry.js +48 -1
- package/dist/cjs/eds-matomo-notice.cjs.entry.js +1 -1
- package/dist/cjs/eds-pagination_2.cjs.entry.js +33 -15
- package/dist/cjs/eds-rating.cjs.entry.js +5 -7
- package/dist/cjs/eds-tabs-content.cjs.entry.js +1 -1
- package/dist/cjs/eds-tabs.cjs.entry.js +1 -1
- package/dist/cjs/eds-timeline.cjs.entry.js +3 -2
- package/dist/cjs/eds-tooltip.cjs.entry.js +11 -1
- package/dist/cjs/eds-trl.cjs.entry.js +7 -8
- package/dist/cjs/index-f08e4f5c.js +2 -34
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/eds-accordion/eds-accordion.js +11 -20
- package/dist/collection/components/eds-alert/eds-alert.js +5 -7
- package/dist/collection/components/eds-alert/eds-alert.stories.js +4 -4
- package/dist/collection/components/eds-avatar/eds-avatar.js +1 -1
- package/dist/collection/components/eds-avatar/eds-avatar.stories.js +24 -22
- package/dist/collection/components/eds-block-break/eds-block-break.js +1 -1
- package/dist/collection/components/eds-breadcrump/eds-breadcrump.js +2 -1
- package/dist/collection/components/eds-button/eds-button.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.js +9 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-tags/eds-card-tags.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-title/eds-card-title.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-wrapper/eds-card-wrapper.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.js +14 -8
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.stories.js +1 -1
- package/dist/collection/components/eds-code-block/eds-code-block.js +57 -2
- package/dist/collection/components/eds-code-block/eds-code-block.stories.js +78 -0
- package/dist/collection/components/eds-dropdown/eds-dropdown.js +11 -21
- package/dist/collection/components/eds-form/eds-form.js +41 -31
- package/dist/collection/components/eds-form/eds-form.stories.js +0 -3
- package/dist/collection/components/eds-frame/eds-frame.stories.js +19 -18
- package/dist/collection/components/eds-input-elements/eds-input-select/eds-input-select.js +4 -1
- package/dist/collection/components/eds-link/eds-link.js +3 -4
- package/dist/collection/components/eds-modal/eds-modal.css +16 -0
- package/dist/collection/components/eds-modal/eds-modal.js +71 -29
- package/dist/collection/components/eds-modal/eds-modal.stories.js +34 -18
- package/dist/collection/components/eds-pagination/eds-pagination.js +13 -9
- package/dist/collection/components/eds-rating/eds-rating.js +8 -10
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.stories.js +12 -11
- package/dist/collection/components/eds-table/eds-table.js +20 -7
- package/dist/collection/components/eds-timeline/eds-timeline.js +3 -2
- package/dist/collection/components/eds-toast/eds-toast.js +21 -0
- package/dist/collection/components/eds-tooltip/eds-tooltip.js +10 -1
- package/dist/collection/components/eds-trl/eds-trl.js +7 -8
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.js +7 -6
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.stories.js +8 -39
- package/dist/components/analytics.js +2 -2
- package/dist/components/components.css +12 -0
- package/dist/components/components.esm.js +1 -1
- package/dist/components/eds-accordion2.js +12 -20
- package/dist/components/eds-alert2.js +5 -7
- package/dist/components/eds-avatar2.js +1 -1
- package/dist/components/eds-block-break2.js +1 -1
- package/dist/components/eds-breadcrumb.js +2 -1
- package/dist/components/eds-button2.js +1 -1
- package/dist/components/eds-card-desc2.js +1 -1
- package/dist/components/eds-card-generic2.js +3 -3
- package/dist/components/eds-card-section.js +3 -3
- package/dist/components/eds-card-tags.js +1 -1
- package/dist/components/eds-card-title2.js +1 -1
- package/dist/components/eds-card-wrapper.js +1 -1
- package/dist/components/eds-code-block2.js +48 -1
- package/dist/components/eds-dropdown2.js +12 -21
- package/dist/components/eds-form.js +37 -12
- package/dist/components/eds-input-select2.js +1 -1
- package/dist/components/eds-link2.js +3 -4
- package/dist/components/eds-modal.js +56 -30
- package/dist/components/eds-pagination2.js +13 -9
- package/dist/components/eds-rating.js +6 -8
- package/dist/components/eds-table2.js +20 -6
- package/dist/components/eds-timeline.js +3 -2
- package/dist/components/eds-toast2.js +21 -0
- package/dist/components/eds-tooltip.js +11 -1
- package/dist/components/eds-trl.js +7 -8
- package/dist/components/p-2dda1ec4.entry.js +1 -0
- package/dist/components/{p-d9788b54.entry.js → p-35ec730b.entry.js} +1 -1
- package/dist/components/{p-e6bfbf51.entry.js → p-5398d652.entry.js} +2 -2
- package/dist/components/{p-e20ed2c7.entry.js → p-610db2b2.entry.js} +1 -1
- package/dist/components/p-832dc95a.entry.js +1 -0
- package/dist/components/p-855aa1a3.entry.js +1 -0
- package/dist/components/{p-52ac3456.entry.js → p-8ddc67a1.entry.js} +1 -1
- package/dist/components/p-ab32b3fc.entry.js +1 -0
- package/dist/components/p-b04eff31.entry.js +1 -0
- package/dist/components/p-b86a4985.js +1 -0
- package/dist/components/{p-2e8459ef.entry.js → p-ba6bafef.entry.js} +1 -1
- package/dist/components/{p-6fc62452.entry.js → p-c3b294a0.entry.js} +1 -1
- package/dist/components/p-c6038449.entry.js +1 -0
- package/dist/components/p-c72c8fb0.entry.js +1 -0
- package/dist/components/p-dd6daa96.entry.js +1 -0
- package/dist/components/{p-73bd0c97.entry.js → p-df94285c.entry.js} +1 -1
- package/dist/esm/{color-0ba8ed56.js → color-bb472c37.js} +2 -2
- package/dist/esm/components.js +1 -1
- package/dist/esm/eds-accordion_33.entry.js +2634 -0
- package/dist/esm/eds-card-project.entry.js +1 -1
- package/dist/esm/eds-card-section.entry.js +3 -3
- package/dist/esm/eds-card-tags.entry.js +1 -1
- package/dist/esm/eds-card-tool.entry.js +1 -1
- package/dist/esm/eds-card-wrapper.entry.js +1 -1
- package/dist/esm/eds-code-block.entry.js +49 -2
- package/dist/esm/eds-matomo-notice.entry.js +1 -1
- package/dist/esm/eds-pagination_2.entry.js +33 -15
- package/dist/esm/eds-rating.entry.js +5 -7
- package/dist/esm/eds-tabs-content.entry.js +1 -1
- package/dist/esm/eds-tabs.entry.js +1 -1
- package/dist/esm/eds-timeline.entry.js +3 -2
- package/dist/esm/eds-tooltip.entry.js +11 -1
- package/dist/esm/eds-trl.entry.js +7 -8
- package/dist/esm/index-e96badea.js +2 -34
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +560 -427
- package/dist/hydrate/index.mjs +560 -427
- package/dist/types/components/eds-accordion/eds-accordion.d.ts +5 -12
- package/dist/types/components/eds-avatar/eds-avatar.stories.d.ts +0 -18
- package/dist/types/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.d.ts +8 -0
- package/dist/types/components/eds-cards/eds-card-generic/eds-card-generic.d.ts +6 -2
- package/dist/types/components/eds-code-block/eds-code-block.d.ts +43 -3
- package/dist/types/components/eds-code-block/eds-code-block.stories.d.ts +54 -0
- package/dist/types/components/eds-dropdown/eds-dropdown.d.ts +0 -7
- package/dist/types/components/eds-form/eds-form.d.ts +3 -6
- package/dist/types/components/eds-form/eds-form.stories.d.ts +0 -5
- package/dist/types/components/eds-frame/eds-frame.stories.d.ts +0 -2
- package/dist/types/components/eds-input-elements/eds-input-select/eds-input-select.d.ts +3 -0
- package/dist/types/components/eds-link/eds-link.d.ts +1 -1
- package/dist/types/components/eds-modal/eds-modal.d.ts +18 -3
- package/dist/types/components/eds-modal/eds-modal.stories.d.ts +9 -0
- package/dist/types/components/eds-rating/eds-rating.d.ts +4 -6
- package/dist/types/components/eds-section/eds-section-core/eds-section-core.stories.d.ts +0 -1
- package/dist/types/components/eds-table/eds-table.d.ts +5 -5
- package/dist/types/components/eds-toast/eds-toast.d.ts +9 -0
- package/dist/types/components.d.ts +66 -84
- package/dist/types/shared-ui/eds-card-section/eds-card-section.d.ts +1 -6
- package/dist/types/shared-ui/eds-card-section/eds-card-section.stories.d.ts +42 -21
- package/package.json +1 -1
- package/dist/cjs/eds-accordion.cjs.entry.js +0 -93
- package/dist/cjs/eds-alert.cjs.entry.js +0 -96
- package/dist/cjs/eds-avatar_17.cjs.entry.js +0 -1454
- package/dist/cjs/eds-card-desc_3.cjs.entry.js +0 -117
- package/dist/cjs/eds-card-generic.cjs.entry.js +0 -105
- package/dist/cjs/eds-form.cjs.entry.js +0 -322
- package/dist/cjs/eds-frame.cjs.entry.js +0 -91
- package/dist/cjs/eds-input_7.cjs.entry.js +0 -316
- package/dist/cjs/eds-modal.cjs.entry.js +0 -86
- package/dist/components/p-02e2a62f.entry.js +0 -1
- package/dist/components/p-32f282a9.entry.js +0 -1
- package/dist/components/p-3617841d.entry.js +0 -1
- package/dist/components/p-373673ca.js +0 -1
- package/dist/components/p-3ff76976.entry.js +0 -1
- package/dist/components/p-42b4ecff.entry.js +0 -1
- package/dist/components/p-54c75346.entry.js +0 -1
- package/dist/components/p-5afb626c.entry.js +0 -1
- package/dist/components/p-5d7af761.entry.js +0 -1
- package/dist/components/p-7215789a.entry.js +0 -1
- package/dist/components/p-79887c2c.entry.js +0 -1
- package/dist/components/p-84957b6d.entry.js +0 -1
- package/dist/components/p-96c4deda.entry.js +0 -1
- package/dist/components/p-be6c80da.entry.js +0 -1
- package/dist/components/p-d1f6a722.entry.js +0 -1
- package/dist/components/p-d7a92efb.entry.js +0 -1
- package/dist/components/p-fd27e56c.entry.js +0 -1
- package/dist/esm/eds-accordion.entry.js +0 -89
- package/dist/esm/eds-alert.entry.js +0 -92
- package/dist/esm/eds-avatar_17.entry.js +0 -1434
- package/dist/esm/eds-card-desc_3.entry.js +0 -111
- package/dist/esm/eds-card-generic.entry.js +0 -101
- package/dist/esm/eds-form.entry.js +0 -318
- package/dist/esm/eds-frame.entry.js +0 -87
- package/dist/esm/eds-input_7.entry.js +0 -306
- package/dist/esm/eds-modal.entry.js +0 -82
|
@@ -125,7 +125,6 @@ export class EdsForm {
|
|
|
125
125
|
this.formSubmitting.emit(this.isSubmitting);
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
this.smallAlert = false;
|
|
129
128
|
this.setFormUrl = true;
|
|
130
129
|
this.submitBtn = true;
|
|
131
130
|
this.submitBtnLabel = 'Submit';
|
|
@@ -134,7 +133,7 @@ export class EdsForm {
|
|
|
134
133
|
this.submitBtnHintMessage = 'To participate, please sign in using your EBRAINS account. If you do not have an account yet, you can easily create one on the EBRAINS portal.';
|
|
135
134
|
this.endpoint = undefined;
|
|
136
135
|
this.name = 'form';
|
|
137
|
-
this.fields =
|
|
136
|
+
this.fields = [];
|
|
138
137
|
this.values = {};
|
|
139
138
|
this.coupleAuth = false;
|
|
140
139
|
this.formSubmitted = false;
|
|
@@ -144,6 +143,7 @@ export class EdsForm {
|
|
|
144
143
|
this.alertMessage = null;
|
|
145
144
|
this.isAuthenticated = false;
|
|
146
145
|
this.authUser = undefined;
|
|
146
|
+
this.parsedFields = [];
|
|
147
147
|
}
|
|
148
148
|
onAuthStatusChanged(event) {
|
|
149
149
|
var _a;
|
|
@@ -151,6 +151,7 @@ export class EdsForm {
|
|
|
151
151
|
this.authUser = event.detail.user;
|
|
152
152
|
}
|
|
153
153
|
componentDidLoad() {
|
|
154
|
+
this.parseFields(this.fields);
|
|
154
155
|
// Emit context for each eds-link element after the component is fully loaded
|
|
155
156
|
const links = this.el.querySelectorAll('eds-button');
|
|
156
157
|
links.forEach((link) => {
|
|
@@ -223,7 +224,7 @@ export class EdsForm {
|
|
|
223
224
|
validateForm() {
|
|
224
225
|
this.errors = {};
|
|
225
226
|
this.hasError = false;
|
|
226
|
-
this.
|
|
227
|
+
this.parsedFields.forEach((field) => {
|
|
227
228
|
if (field.type !== 'hidden') {
|
|
228
229
|
if ((field.type === 'checkbox' || field.type === 'radio') && !field.options) {
|
|
229
230
|
// Single checkbox validation
|
|
@@ -305,19 +306,38 @@ export class EdsForm {
|
|
|
305
306
|
});
|
|
306
307
|
return formData;
|
|
307
308
|
}
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
parseFields(newValue) {
|
|
310
|
+
try {
|
|
311
|
+
if (typeof newValue === 'string') {
|
|
312
|
+
this.parsedFields = JSON.parse(newValue);
|
|
313
|
+
}
|
|
314
|
+
else if (Array.isArray(newValue)) {
|
|
315
|
+
this.parsedFields = newValue;
|
|
316
|
+
}
|
|
317
|
+
else if (newValue && typeof newValue === 'object') {
|
|
318
|
+
// In case a single object is passed, wrap it in an array.
|
|
319
|
+
this.parsedFields = newValue;
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
this.parsedFields = [];
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
// eslint-disable-next-line
|
|
327
|
+
console.error('Error parsing fields prop:', error);
|
|
328
|
+
this.parsedFields = [];
|
|
329
|
+
}
|
|
310
330
|
}
|
|
311
331
|
render() {
|
|
312
|
-
const hiddenFields = this.
|
|
313
|
-
const otherFields = this.
|
|
314
|
-
return (h("form", { key: '
|
|
332
|
+
const hiddenFields = this.parsedFields.filter((field) => field.type === 'hidden');
|
|
333
|
+
const otherFields = this.parsedFields.filter((field) => field.type !== 'hidden');
|
|
334
|
+
return (h("form", { key: '0a106caa8aa9f056b55acf6fecfbc7090c4411d2', ref: (el) => (this.formEl = el), enctype: "multipart/form-data", autocomplete: "on", method: "post", onSubmit: this.handleSubmit }, h("div", { key: '3478d82640378d9a1c0c09394453e2118b1b3ca9' }, h("slot", { key: '9bc37f54c03b2b0f831da917b6ce6bab2ec11084' }), hiddenFields.map((field, index) => (h("eds-input", { key: index, type: "hidden", name: field.name, value: field.value }))), otherFields.map((field, index) => {
|
|
315
335
|
var _a, _b;
|
|
316
336
|
if (!this.isFieldVisible(field)) {
|
|
317
337
|
return null;
|
|
318
338
|
}
|
|
319
339
|
return (h("eds-input-field", { key: index, name: field.name, id: `${this.name}_${field.name}`, label: field.label, type: field.type, icon: field.icon || null, required: field.required, maxLength: field.maxlength, hint: field.hint, error: ((_a = this.errors[field.name]) === null || _a === void 0 ? void 0 : _a.length) > 0, errorMessage: (_b = this.errors[field.name]) === null || _b === void 0 ? void 0 : _b.join('<br />'), onInput: (e) => this.handleChange(e, field), class: index > 0 ? 'mt-20' : '', options: field.options }));
|
|
320
|
-
})), this.submitBtn && (h("div", { key: '
|
|
340
|
+
})), this.submitBtn && (h("div", { key: 'ca221e8c5c18cf4a107581736728f84cea7831d0', class: "mt-20" }, h("eds-button", { key: 'eef3cf052beb62703c1df74d142650194d60c501', intent: "primary", label: this.submitBtnLabel, disabled: this.isSubmitting || (this.coupleAuth && !this.isAuthenticated), loading: this.isSubmitting, onClick: (e) => this.handleSubmit(e) }), this.coupleAuth && !this.isAuthenticated ? (h("p", { class: "f-ui-05 text-lighter mt-8 ml-8" }, this.submitBtnHintMessage)) : null)), this.alertMessage && (this.formSubmitted || this.hasError) && (h("div", { key: '69861c8776b99e26a08585a5a8c893c85a2d9999', class: "mt-20" }, h("eds-alert", { key: 'b4d225d8efcbe6cde95789c367f0ecf94f217c9c', message: this.alertMessage, intent: this.hasError ? 'error' : 'success', direction: "horizontal" })))));
|
|
321
341
|
}
|
|
322
342
|
static get is() { return "eds-form"; }
|
|
323
343
|
static get originalStyleUrls() {
|
|
@@ -332,24 +352,6 @@ export class EdsForm {
|
|
|
332
352
|
}
|
|
333
353
|
static get properties() {
|
|
334
354
|
return {
|
|
335
|
-
"smallAlert": {
|
|
336
|
-
"type": "boolean",
|
|
337
|
-
"mutable": false,
|
|
338
|
-
"complexType": {
|
|
339
|
-
"original": "boolean",
|
|
340
|
-
"resolved": "boolean",
|
|
341
|
-
"references": {}
|
|
342
|
-
},
|
|
343
|
-
"required": false,
|
|
344
|
-
"optional": true,
|
|
345
|
-
"docs": {
|
|
346
|
-
"tags": [],
|
|
347
|
-
"text": "If `true`, displays a small alert for messages."
|
|
348
|
-
},
|
|
349
|
-
"attribute": "small-alert",
|
|
350
|
-
"reflect": false,
|
|
351
|
-
"defaultValue": "false"
|
|
352
|
-
},
|
|
353
355
|
"setFormUrl": {
|
|
354
356
|
"type": "boolean",
|
|
355
357
|
"mutable": false,
|
|
@@ -497,8 +499,8 @@ export class EdsForm {
|
|
|
497
499
|
"type": "string",
|
|
498
500
|
"mutable": false,
|
|
499
501
|
"complexType": {
|
|
500
|
-
"original": "string",
|
|
501
|
-
"resolved": "string",
|
|
502
|
+
"original": "string | any[]",
|
|
503
|
+
"resolved": "any[] | string",
|
|
502
504
|
"references": {}
|
|
503
505
|
},
|
|
504
506
|
"required": false,
|
|
@@ -508,7 +510,8 @@ export class EdsForm {
|
|
|
508
510
|
"text": "A JSON string representing the fields in the form.\nExample:\n```json\n[\n { \"name\": \"email\", \"label\": \"Email\", \"type\": \"text\", \"required\": true },\n { \"name\": \"password\", \"label\": \"Password\", \"type\": \"password\", \"required\": true }\n]\n```"
|
|
509
511
|
},
|
|
510
512
|
"attribute": "fields",
|
|
511
|
-
"reflect": false
|
|
513
|
+
"reflect": false,
|
|
514
|
+
"defaultValue": "[]"
|
|
512
515
|
},
|
|
513
516
|
"coupleAuth": {
|
|
514
517
|
"type": "boolean",
|
|
@@ -539,7 +542,8 @@ export class EdsForm {
|
|
|
539
542
|
"isSubmitting": {},
|
|
540
543
|
"alertMessage": {},
|
|
541
544
|
"isAuthenticated": {},
|
|
542
|
-
"authUser": {}
|
|
545
|
+
"authUser": {},
|
|
546
|
+
"parsedFields": {}
|
|
543
547
|
};
|
|
544
548
|
}
|
|
545
549
|
static get events() {
|
|
@@ -561,6 +565,12 @@ export class EdsForm {
|
|
|
561
565
|
}];
|
|
562
566
|
}
|
|
563
567
|
static get elementRef() { return "el"; }
|
|
568
|
+
static get watchers() {
|
|
569
|
+
return [{
|
|
570
|
+
"propName": "fields",
|
|
571
|
+
"methodName": "parseFields"
|
|
572
|
+
}];
|
|
573
|
+
}
|
|
564
574
|
static get listeners() {
|
|
565
575
|
return [{
|
|
566
576
|
"name": "authStatusChanged",
|
|
@@ -17,7 +17,6 @@ export default {
|
|
|
17
17
|
defaultValue: 'Please fix the errors in the form.'
|
|
18
18
|
},
|
|
19
19
|
submitBtn: { control: 'boolean', description: 'Show submit button', defaultValue: true },
|
|
20
|
-
smallAlert: { control: 'boolean', description: 'Show small alert message', defaultValue: false },
|
|
21
20
|
setFormUrl: { control: 'boolean', description: 'Include the current URL in the form data', defaultValue: true }
|
|
22
21
|
}
|
|
23
22
|
};
|
|
@@ -29,7 +28,6 @@ const Template = (args) => html `
|
|
|
29
28
|
success-message="${args.successMessage}"
|
|
30
29
|
error-message="${args.errorMessage}"
|
|
31
30
|
?submit-btn="${args.submitBtn}"
|
|
32
|
-
?small-alert="${args.smallAlert}"
|
|
33
31
|
?set-form-url="${args.setFormUrl}"
|
|
34
32
|
></eds-form>
|
|
35
33
|
`;
|
|
@@ -84,6 +82,5 @@ Default.args = {
|
|
|
84
82
|
successMessage: 'Form submitted successfully!',
|
|
85
83
|
errorMessage: 'Please fix the errors in the form.',
|
|
86
84
|
submitBtn: true,
|
|
87
|
-
smallAlert: false,
|
|
88
85
|
setFormUrl: true
|
|
89
86
|
};
|
|
@@ -43,25 +43,26 @@ Default.args = {
|
|
|
43
43
|
bg: true,
|
|
44
44
|
withHover: true
|
|
45
45
|
};
|
|
46
|
-
export const SmallFrame = Template.bind({});
|
|
46
|
+
/*export const SmallFrame = Template.bind({});
|
|
47
47
|
SmallFrame.args = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
frameLabel: 'Small Frame',
|
|
49
|
+
urlLabel: 'Small Frame Link',
|
|
50
|
+
urlLink: 'https://gitlab-org.gitlab.io/gitlab-ui?path=%2Fstory%2Fbase-card--default',
|
|
51
|
+
src: 'https://gitlab-org.gitlab.io/gitlab-ui/iframe.html?id=base-card--default&viewMode=story',
|
|
52
|
+
intent: 'secondary',
|
|
53
|
+
tiny: true,
|
|
54
|
+
bg: true,
|
|
55
|
+
withHover: false
|
|
56
56
|
};
|
|
57
|
+
|
|
57
58
|
export const ErrorState = Template.bind({});
|
|
58
59
|
ErrorState.args = {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
60
|
+
frameLabel: 'Error Frame',
|
|
61
|
+
urlLabel: 'Error Link',
|
|
62
|
+
urlLink: 'https://errorframe.com',
|
|
63
|
+
src: 'https://invalid-url.com', // Simulating a broken URL to trigger the error state
|
|
64
|
+
intent: 'inverse',
|
|
65
|
+
tiny: false,
|
|
66
|
+
bg: false,
|
|
67
|
+
withHover: true
|
|
68
|
+
};*/
|
|
@@ -18,6 +18,9 @@ import { toast } from "../../../utils/toastManager";
|
|
|
18
18
|
*
|
|
19
19
|
* The component will automatically fetch data if a dynamic configuration is provided.
|
|
20
20
|
*/
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
21
24
|
export class EdsInputSelect {
|
|
22
25
|
constructor() {
|
|
23
26
|
/**
|
|
@@ -91,7 +94,7 @@ export class EdsInputSelect {
|
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
render() {
|
|
94
|
-
return (h("div", { key: '
|
|
97
|
+
return (h("div", { key: 'd37107564a86281b3a3920a5eb128f47f6fd4ceb', class: "relative" }, h("select", { key: 'a69cd907ef6732ec42a99fd46bbf9a52ef03735a', id: this.inputId || this.name, name: this.name, class: `input invalid:text-lightest pr-32 ${this.error ? 'input-error' : ''}`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": this.hasMessage || this.error ? `${this.name}-error` : '', disabled: this.disabled || this.loading, required: this.required, onChange: this.handleChange }, h("option", { key: '8b84a2b7edd7e989411908b16f35c46853889d8e', value: "", disabled: true, hidden: true }, this.loading ? 'Loading options...' : `Please select ${this.name}`), this.dynamicOptions.map((option, index) => (h("option", { key: index, value: option[this.dynamicValueKey] }, option[this.dynamicLabelKey])))), h("span", { key: 'dbccb6161aafc2dc31cc6dd5b3d8c812545eab9a', class: `bg-dark rounded-xs absolute top-1/2 right-[6px] flex h-28 w-28 -translate-y-1/2 items-center justify-center ${this.disabled || this.loading ? 'text-lightest bg-transparent' : ''}` }, h("eds-icon-wrapper", { key: 'b0fd24cb54185d8558dfabcb94d05b6257caacd1', class: "w-20 h-20", icon: "chevron-right" }))));
|
|
95
98
|
}
|
|
96
99
|
static get is() { return "eds-input-select"; }
|
|
97
100
|
static get properties() {
|
|
@@ -149,12 +149,11 @@ export class EdsLink {
|
|
|
149
149
|
this.hideLabelOnSmallScreen = false;
|
|
150
150
|
this.extraClass = undefined;
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
handleParentContext(event) {
|
|
153
153
|
if (event.target !== this.el) {
|
|
154
154
|
// Ignore the event if it's not targeted at this specific instance
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
//console.log(event.detail);
|
|
158
157
|
this.parentContext = event.detail;
|
|
159
158
|
event.stopPropagation();
|
|
160
159
|
}
|
|
@@ -205,7 +204,7 @@ export class EdsLink {
|
|
|
205
204
|
const labelClasses = this.hideLabelOnSmallScreen
|
|
206
205
|
? 'hidden lg:flex' // Tailwind example: hidden on small screens, visible on larger
|
|
207
206
|
: '';
|
|
208
|
-
return (h(ComponentType, { key: '
|
|
207
|
+
return (h(ComponentType, { key: '58eb3c1c5c192c2855424864c9e3e9c7a5fe3378', class: `${classes || ''} ${this.extraClass || ''}`, href: !this.disabled ? this.url : undefined, target: this.external && !this.disabled ? '_blank' : undefined, rel: this.external && !this.disabled ? 'noopener noreferrer' : undefined, "aria-label": this.label || this.ariaLabel || undefined, "aria-disabled": this.disabled ? 'true' : null, download: this.download ? '' : undefined, onClick: (event) => this.handleClick(event) }, h("span", { key: 'd4033ba589552f60f8dc7559434a3c035d226de4', class: "z-1 relative inline-flex items-center justify-center" }, this.renderLeftIcon(), h("span", { key: 'ca520cc66febaf8c8ddfd2fd8ee8a13b71a3078d', class: labelClasses }, this.label), this.renderRightIcon())));
|
|
209
208
|
}
|
|
210
209
|
static get is() { return "eds-link"; }
|
|
211
210
|
static get encapsulation() { return "shadow"; }
|
|
@@ -473,7 +472,7 @@ export class EdsLink {
|
|
|
473
472
|
static get listeners() {
|
|
474
473
|
return [{
|
|
475
474
|
"name": "parentContext",
|
|
476
|
-
"method": "
|
|
475
|
+
"method": "handleParentContext",
|
|
477
476
|
"target": undefined,
|
|
478
477
|
"capture": false,
|
|
479
478
|
"passive": false
|
|
@@ -92,10 +92,26 @@
|
|
|
92
92
|
left: 50%;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
.left-20 {
|
|
96
|
+
left: 1.25rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.right-20 {
|
|
100
|
+
right: 1.25rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
95
103
|
.top-1\/2 {
|
|
96
104
|
top: 50%;
|
|
97
105
|
}
|
|
98
106
|
|
|
107
|
+
.top-20 {
|
|
108
|
+
top: 1.25rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.bottom-20 {
|
|
112
|
+
bottom: 1.25rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
99
115
|
.grow {
|
|
100
116
|
flex-grow: 1;
|
|
101
117
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sendAnalytics } from "../../../../../../../packages/utils/src/index";
|
|
1
2
|
import { h } from "@stencil/core";
|
|
2
3
|
//import { sendAnalytics } from '@ebrains/utils';
|
|
3
4
|
/**
|
|
@@ -16,33 +17,59 @@ export class EdsModal {
|
|
|
16
17
|
this.title = '';
|
|
17
18
|
this.truncate = true;
|
|
18
19
|
this.truncateLines = '1';
|
|
20
|
+
this.position = 'middle';
|
|
19
21
|
}
|
|
20
22
|
getTruncateClass() {
|
|
21
23
|
return this.truncate && this.truncateLines ? `line-clamp-${this.truncateLines}` : '';
|
|
22
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the Tailwind CSS classes to position the modal based on the `position` prop.
|
|
27
|
+
*
|
|
28
|
+
* @private
|
|
29
|
+
* @returns {string} The concatenated CSS classes for modal positioning.
|
|
30
|
+
*/
|
|
31
|
+
getModalPositionClasses() {
|
|
32
|
+
switch (this.position) {
|
|
33
|
+
case 'top':
|
|
34
|
+
return 'left-1/2 top-20 -translate-x-1/2';
|
|
35
|
+
case 'bottom':
|
|
36
|
+
return 'left-1/2 bottom-20 -translate-x-1/2';
|
|
37
|
+
case 'left':
|
|
38
|
+
return 'left-20 top-1/2 -translate-y-1/2';
|
|
39
|
+
case 'right':
|
|
40
|
+
return 'right-20 top-1/2 -translate-y-1/2';
|
|
41
|
+
case 'middle':
|
|
42
|
+
default:
|
|
43
|
+
return 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
23
46
|
/**
|
|
24
47
|
* Opens the modal.
|
|
25
48
|
*/
|
|
26
49
|
async open() {
|
|
50
|
+
var _a;
|
|
27
51
|
this.isOpen = true;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
52
|
+
sendAnalytics({
|
|
53
|
+
category: 'ui-component',
|
|
54
|
+
parentContext: null,
|
|
55
|
+
tag: this.el.tagName.toLowerCase(),
|
|
56
|
+
name: ((_a = this.title) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
|
|
57
|
+
action: 'opened'
|
|
58
|
+
});
|
|
34
59
|
}
|
|
35
60
|
/**
|
|
36
61
|
* Closes the modal.
|
|
37
62
|
*/
|
|
38
63
|
async close() {
|
|
64
|
+
var _a;
|
|
39
65
|
this.isOpen = false;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
66
|
+
sendAnalytics({
|
|
67
|
+
category: 'ui-component',
|
|
68
|
+
parentContext: null,
|
|
69
|
+
tag: this.el.tagName.toLowerCase(),
|
|
70
|
+
name: ((_a = this.title) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
|
|
71
|
+
action: 'closed'
|
|
72
|
+
});
|
|
46
73
|
}
|
|
47
74
|
/**
|
|
48
75
|
* Toggles the modal open or closed.
|
|
@@ -56,30 +83,27 @@ export class EdsModal {
|
|
|
56
83
|
*/
|
|
57
84
|
componentDidLoad() {
|
|
58
85
|
// Emit context for each eds-link element after the component is fully loaded
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
this.emitContext(btn);
|
|
62
|
-
});
|
|
86
|
+
//const btn = this.el.shadowRoot.querySelector('eds-button');
|
|
87
|
+
//this.emitContext(btn);
|
|
63
88
|
}
|
|
64
89
|
/**
|
|
65
90
|
* Emits a custom event called `parentContext` for a given button element.
|
|
66
91
|
* This event provides context information about the eds-modal component.
|
|
67
|
-
*
|
|
68
|
-
* @param btnElement - The link element to which the event will be dispatched.
|
|
69
92
|
*/
|
|
70
|
-
emitContext(btnElement) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
93
|
+
/*emitContext(btnElement: HTMLElement) {
|
|
94
|
+
const event = new CustomEvent<ParentContextDetail>('parentContext', {
|
|
95
|
+
detail: {
|
|
96
|
+
componentName: this.el.tagName.toLowerCase(),
|
|
97
|
+
identifier: null
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
btnElement.dispatchEvent(event);
|
|
102
|
+
}*/
|
|
79
103
|
render() {
|
|
80
|
-
return (h("div", { key: '
|
|
104
|
+
return (h("div", { key: 'eedcdc49c9f4a16ef4537ec02335757aa1143bd9', class: `${this.isOpen ? 'block' : 'hidden'} fixed inset-0 z-50 flex` }, this.isOpen && (h("div", { key: '2b24903b85895fd5eca389d6897aa85c892e762f', class: "fixed inset-0 bg-dark bg-opacity-90" // Add backdrop-blur utility class here
|
|
81
105
|
,
|
|
82
|
-
onClick: () => this.close() })), h("div", { key: '
|
|
106
|
+
onClick: () => this.close() })), h("div", { key: 'd135a2d9eff1764b6335b9b16be54d8fec7d4112', class: `max-w-full absolute px-20 py-20 bg-inverse rounded-lg shadow-lg z-10 ${this.getModalPositionClasses()} grow justify-center` }, h("div", { key: 'bc8ea6f95443f01d3e5b88953581e1f2eae4009c', class: "flex justify-between items-center border-b-2 border-softer pb-8" }, h("span", { key: '872b9a4bf44db478d38f18d3459a816c119f352d', class: `f-heading-04 text-lighter ${this.getTruncateClass()}` }, this.title), h("eds-button", { key: 'bdf27a3f564d295383985cb1f0ce7df7f13a97fb', intent: "tertiary", icon: "close", "aria-label": "Close modal", onClick: () => this.close(), "extra-class": "ml-8" })), h("div", { key: '600cc4d544d0a41d9d2be74aedbb0d2fe2028141', class: "pt-8" }, h("slot", { key: '8ce560804a6d960b4075e4b6d1607dda6530c08d' })))));
|
|
83
107
|
}
|
|
84
108
|
static get is() { return "eds-modal"; }
|
|
85
109
|
static get encapsulation() { return "shadow"; }
|
|
@@ -148,6 +172,24 @@ export class EdsModal {
|
|
|
148
172
|
"attribute": "truncate-lines",
|
|
149
173
|
"reflect": false,
|
|
150
174
|
"defaultValue": "'1'"
|
|
175
|
+
},
|
|
176
|
+
"position": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"mutable": false,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "'middle' | 'top' | 'bottom' | 'left' | 'right'",
|
|
181
|
+
"resolved": "\"bottom\" | \"left\" | \"middle\" | \"right\" | \"top\"",
|
|
182
|
+
"references": {}
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"optional": false,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [],
|
|
188
|
+
"text": "Specifies the position of the modal.\n\nAcceptable values are:\n- `\"middle\"` (default): The modal is centered both vertically and horizontally.\n- `\"top\"`: The modal is positioned near the top of the viewport.\n- `\"bottom\"`: The modal is positioned near the bottom of the viewport.\n- `\"left\"`: The modal is positioned on the left side of the viewport, centered vertically.\n- `\"right\"`: The modal is positioned on the right side of the viewport, centered vertically."
|
|
189
|
+
},
|
|
190
|
+
"attribute": "position",
|
|
191
|
+
"reflect": false,
|
|
192
|
+
"defaultValue": "'middle'"
|
|
151
193
|
}
|
|
152
194
|
};
|
|
153
195
|
}
|
|
@@ -7,41 +7,55 @@ export default {
|
|
|
7
7
|
control: 'text',
|
|
8
8
|
description: 'Title of the modal',
|
|
9
9
|
defaultValue: 'Default Modal Title'
|
|
10
|
+
},
|
|
11
|
+
position: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: ['middle', 'top', 'bottom', 'left', 'right'],
|
|
14
|
+
description: 'Position of the modal in the viewport'
|
|
10
15
|
}
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
title: 'Default Modal Title',
|
|
19
|
+
position: 'middle'
|
|
11
20
|
}
|
|
12
21
|
};
|
|
13
|
-
const Template = ({ title }) => {
|
|
22
|
+
const Template = ({ title, position }) => {
|
|
14
23
|
const openModal = () => {
|
|
15
|
-
|
|
24
|
+
var _a;
|
|
25
|
+
// Open the first instance of eds-modal on the page
|
|
26
|
+
(_a = document.querySelector('eds-modal')) === null || _a === void 0 ? void 0 : _a.open();
|
|
16
27
|
};
|
|
17
28
|
return html `
|
|
18
|
-
<!-- Modal component with dynamic title -->
|
|
19
|
-
<eds-modal title="${title}">
|
|
29
|
+
<!-- Modal component with dynamic title and position -->
|
|
30
|
+
<eds-modal title="${title}" position="${position}">
|
|
20
31
|
<p>This is the content inside the modal.</p>
|
|
21
32
|
</eds-modal>
|
|
22
33
|
|
|
23
|
-
<!--
|
|
24
|
-
<eds-button intent="primary" label="Open Modal
|
|
34
|
+
<!-- Button to control modal -->
|
|
35
|
+
<eds-button intent="primary" label="Open Modal" @click="${openModal}"></eds-button>
|
|
25
36
|
`;
|
|
26
37
|
};
|
|
27
38
|
export const Default = Template.bind({});
|
|
28
39
|
Default.args = {
|
|
29
|
-
title: 'Default Modal Title'
|
|
40
|
+
title: 'Default Modal Title',
|
|
41
|
+
position: 'middle'
|
|
30
42
|
};
|
|
31
|
-
const TemplateWithForm = ({ title }) => {
|
|
43
|
+
const TemplateWithForm = ({ title, position }) => {
|
|
32
44
|
const openModal = () => {
|
|
33
|
-
|
|
45
|
+
var _a;
|
|
46
|
+
(_a = document.querySelector('eds-modal')) === null || _a === void 0 ? void 0 : _a.open();
|
|
34
47
|
};
|
|
35
|
-
return html `
|
|
36
|
-
|
|
48
|
+
return html `
|
|
49
|
+
<!-- Modal with eds-form inside the slot -->
|
|
50
|
+
<eds-modal title="${title}" position="${position}">
|
|
37
51
|
<eds-form
|
|
38
52
|
name="extended-form"
|
|
39
53
|
endpoint="http://127.0.0.1:5000/api/data"
|
|
40
54
|
fields='[
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
{"name": "username", "label": "Username", "type": "text", "required": true, "maxlength": 10},
|
|
56
|
+
{"name": "email", "label": "Email", "type": "email", "required": true},
|
|
57
|
+
{"name": "number", "label": "Number", "type": "number", "required": true}
|
|
58
|
+
]'
|
|
45
59
|
success-message="Form submitted successfully!"
|
|
46
60
|
error-message="Please fix the errors in the form."
|
|
47
61
|
submit-btn="true"
|
|
@@ -50,15 +64,17 @@ const TemplateWithForm = ({ title }) => {
|
|
|
50
64
|
></eds-form>
|
|
51
65
|
</eds-modal>
|
|
52
66
|
|
|
53
|
-
<!--
|
|
67
|
+
<!-- Button to control modal -->
|
|
54
68
|
<eds-button
|
|
55
69
|
intent="primary"
|
|
56
70
|
label="Open Modal with Form"
|
|
57
71
|
@click="${openModal}"
|
|
58
72
|
style="margin-right: 10px;"
|
|
59
|
-
></eds-button
|
|
73
|
+
></eds-button>
|
|
74
|
+
`;
|
|
60
75
|
};
|
|
61
76
|
export const ModalWithForm = TemplateWithForm.bind({});
|
|
62
77
|
ModalWithForm.args = {
|
|
63
|
-
title: 'Extended Form Modal'
|
|
78
|
+
title: 'Extended Form Modal',
|
|
79
|
+
position: 'middle'
|
|
64
80
|
};
|
|
@@ -32,14 +32,18 @@ export class EdsPagination {
|
|
|
32
32
|
componentDidLoad() {
|
|
33
33
|
// Emit context for each eds-link element after the component is fully loaded
|
|
34
34
|
const links = this.hostEl.shadowRoot.querySelectorAll('eds-link');
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
links.forEach((lnk) => {
|
|
36
|
+
this.emitContext(lnk);
|
|
37
|
+
});
|
|
38
|
+
/*if (links.length > 0) {
|
|
39
|
+
// Emit context for the first link
|
|
40
|
+
this.emitContext(links[0]);
|
|
41
|
+
|
|
42
|
+
// Emit context for the last link, if it's different from the first
|
|
43
|
+
if (links.length > 1) {
|
|
44
|
+
this.emitContext(links[links.length - 1]);
|
|
45
|
+
}
|
|
46
|
+
}*/
|
|
43
47
|
}
|
|
44
48
|
/**
|
|
45
49
|
* Emits a custom event called `parentContext` for a given link element.
|
|
@@ -169,7 +173,7 @@ export class EdsPagination {
|
|
|
169
173
|
}
|
|
170
174
|
}
|
|
171
175
|
render() {
|
|
172
|
-
return (h("div", { key: '
|
|
176
|
+
return (h("div", { key: '584e0918b070eac25a7c4bfceff59b000b60076c' }, this.total > 0 && this.mode === 'default' && (h("p", { key: 'c688bd8e1f1d15904fc274454093f03213f59e38', class: "f-ui-03 text-lightest mb-28 w-full text-center" }, h("span", { key: 'c2472919bad41f76e26d518da27509e545ed9db6', class: "sr-only" }, "Results:"), this.pageResults())), this.mode === 'navigator' || (this.lastPage && this.lastPage > 1) ? (h("nav", { "aria-label": "Pagination" }, h("ul", { class: "flex items-center justify-center gap-x-8" }, h("li", { class: "mr-auto" }, h("eds-link", { label: this.prevLabel, url: this.mode === 'navigator'
|
|
173
177
|
? this.prevUrl || '#' // Use prevUrl if provided, otherwise disable with '#'
|
|
174
178
|
: this.isFirstPage()
|
|
175
179
|
? '#'
|
|
@@ -7,10 +7,8 @@ export class EdsRating {
|
|
|
7
7
|
this.selectedRating = 0;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Parses the `
|
|
11
|
-
* Returns an empty array if parsing fails
|
|
12
|
-
*
|
|
13
|
-
* @returns {any[]} Array of parsed link objects
|
|
10
|
+
* Parses the `textMapping` prop into an array of strings.
|
|
11
|
+
* Returns an empty array if parsing fails.
|
|
14
12
|
*/
|
|
15
13
|
get parsedMappings() {
|
|
16
14
|
if (typeof this.textMapping === 'object') {
|
|
@@ -22,7 +20,7 @@ export class EdsRating {
|
|
|
22
20
|
}
|
|
23
21
|
catch (e) {
|
|
24
22
|
// eslint-disable-next-line
|
|
25
|
-
console.error('Error parsing
|
|
23
|
+
console.error('Error parsing textMapping prop:', e);
|
|
26
24
|
return [];
|
|
27
25
|
}
|
|
28
26
|
}
|
|
@@ -37,10 +35,10 @@ export class EdsRating {
|
|
|
37
35
|
this.ratingChange.emit(rating);
|
|
38
36
|
}
|
|
39
37
|
render() {
|
|
40
|
-
return (h("div", { key: '
|
|
38
|
+
return (h("div", { key: 'c9147c2635f091d93f329d2b56a5fee8dce9126c', class: "relative w-full flex flex-col" }, h("span", { key: '39a84bc3d9bcd4b729a35737c883eca7144d13ac', class: "f-body-01" }, this.label), h("div", { key: '3cb84acf399cac0b23393c71df2f2b36aab4f43e', class: "stars" }, Array.from({ length: this.stars }, (_, index) => (h("span", { class: {
|
|
41
39
|
star: true,
|
|
42
40
|
filled: index < this.selectedRating
|
|
43
|
-
}, onClick: () => this.handleClick(index + 1) }, "\u2605")))), this.selectedRating > 0 && this.parsedMappings[this.selectedRating - 1] && (h("span", { key: '
|
|
41
|
+
}, onClick: () => this.handleClick(index + 1) }, "\u2605")))), this.selectedRating > 0 && this.parsedMappings[this.selectedRating - 1] && (h("span", { key: '60605ec21b542825da0dad629fc1618d9cf63b25', class: "f-ui-04 text-lighter" }, this.parsedMappings[this.selectedRating - 1]))));
|
|
44
42
|
}
|
|
45
43
|
static get is() { return "eds-rating"; }
|
|
46
44
|
static get encapsulation() { return "shadow"; }
|
|
@@ -93,11 +91,11 @@ export class EdsRating {
|
|
|
93
91
|
"defaultValue": "'Rate your experience'"
|
|
94
92
|
},
|
|
95
93
|
"textMapping": {
|
|
96
|
-
"type": "
|
|
94
|
+
"type": "string",
|
|
97
95
|
"mutable": false,
|
|
98
96
|
"complexType": {
|
|
99
|
-
"original": "string |
|
|
100
|
-
"resolved": "
|
|
97
|
+
"original": "string | string[]",
|
|
98
|
+
"resolved": "string | string[]",
|
|
101
99
|
"references": {}
|
|
102
100
|
},
|
|
103
101
|
"required": false,
|