@yoobic/yobi 8.2.13-0 → 8.2.13-1

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.
@@ -3289,6 +3289,7 @@ const YooFormDynamicComponent = class {
3289
3289
  extraAttrs = {
3290
3290
  min: field.min,
3291
3291
  max: field.max,
3292
+ allowDecimals: field.allowDecimals,
3292
3293
  maxCharacters: field.maxCharacters,
3293
3294
  type: field.type === index.FormFieldType.number && index$1.isSamsung() ? index.FormFieldType.text : getInputType(field),
3294
3295
  inputmode: field.type === index.FormFieldType.number && index$1.isSamsung() ? 'numeric' : '',
@@ -219,7 +219,7 @@ const YooLessonQuestionResultComponent = class {
219
219
  }
220
220
  else if (!index$1.isContentOnly(this.lessonType)) {
221
221
  items = (_b = this.fields) === null || _b === void 0 ? void 0 : _b.map((field, i) => {
222
- var _a, _b, _c, _d, _e, _f;
222
+ var _a, _b, _c, _d, _e, _f, _g;
223
223
  return ({
224
224
  name: `${index$1.translate('QUESTION')} ${i + 1}`,
225
225
  description: index$1.translateMulti(field.sentence || field.description || field.title),
@@ -231,11 +231,12 @@ const YooLessonQuestionResultComponent = class {
231
231
  ? ((_d = this.lessonData[field.name]) === null || _d === void 0 ? void 0 : _d.earnedConfidencePoints) + ((_e = this.lessonData[field.name]) === null || _e === void 0 ? void 0 : _e.earnedQuestionPoints)
232
232
  : ((_f = this.lessonData[field.name]) === null || _f === void 0 ? void 0 : _f.fieldValidity)
233
233
  ? Math.round(this.points)
234
- : 0
234
+ : 0,
235
+ isCorrect: (_g = this.lessonData[field.name]) === null || _g === void 0 ? void 0 : _g.fieldValidity
235
236
  });
236
237
  });
237
238
  }
238
- return index.h("yoo-points-recap", { heading: index$1.translate('TOTALPOINTSEARNED'), totalPoints: Math.round(this.earnedPoints), items: items, showItemIcon: showItemIcon });
239
+ return index.h("yoo-points-recap", { heading: index$1.translate('TOTALPOINTSEARNED'), totalPoints: Math.round(this.earnedPoints), items: items, showItemIcon: showItemIcon, forceTotalPoints: true });
239
240
  }
240
241
  renderProgressBarLessonRecap() {
241
242
  var _a;
@@ -10,6 +10,7 @@ const YooPointsRecap = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
12
  this.showItemIcon = true;
13
+ this.forceTotalPoints = false;
13
14
  }
14
15
  onItemsUpdated() {
15
16
  this.updatePoints();
@@ -35,8 +36,8 @@ const YooPointsRecap = class {
35
36
  return 'success';
36
37
  }
37
38
  }
38
- getItemIconAttr(points) {
39
- if (points <= 0) {
39
+ getItemIconAttr(isCorrect) {
40
+ if (!isCorrect) {
40
41
  return { name: 'close', color: 'danger' };
41
42
  }
42
43
  else {
@@ -46,7 +47,7 @@ const YooPointsRecap = class {
46
47
  renderTitle(title) {
47
48
  var _a, _b;
48
49
  const titleClass = `item ${((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.heading ? 'heading' : this.footer && 'footer' : 'content'}`;
49
- const points = (this.footer || !((_b = this.items) === null || _b === void 0 ? void 0 : _b.length)) ? this.totalPoints : this.totalItemsPoints;
50
+ const points = (this.footer || !((_b = this.items) === null || _b === void 0 ? void 0 : _b.length) || this.forceTotalPoints) ? this.totalPoints : this.totalItemsPoints;
50
51
  const tagColor = this.getTagColor(points);
51
52
  return (index.h("div", { class: "row" }, this.footer && this.renderSeparator(), index.h("div", { class: titleClass }, index.h("div", null, index.h("b", null, title)), index.h("div", null, index.h("yoo-tag", { size: "medium", color: `${tagColor}-10` }, index.h("yoo-icon", { slot: "start", name: "star", size: "small", color: tagColor }), index.h("div", null, points)))), this.heading && this.renderSeparator()));
52
53
  }
@@ -57,7 +58,7 @@ const YooPointsRecap = class {
57
58
  renderItem(item, index$1) {
58
59
  var _a;
59
60
  const tagColor = this.getTagColor(item.points);
60
- const itemIcon = this.getItemIconAttr(item.points);
61
+ const itemIcon = this.getItemIconAttr(item.isCorrect);
61
62
  return (index.h("div", { class: "row" }, index.h("div", { class: "item content" }, index.h("div", { class: "sub-item" }, this.showItemIcon && index.h("yoo-icon", { slot: "start", name: itemIcon.name, size: "medium", color: itemIcon.color }), item.subItem ? this.renderSubItem(item) :
62
63
  index.h("yoo-tooltip", { placement: "top", content: item.description }, index.h("div", { class: "name" }, item.name))), index.h("div", null, index.h("yoo-tag", { size: "medium", color: `${tagColor}-10` }, index.h("yoo-icon", { slot: "start", name: "star", size: "small", color: tagColor }), index.h("div", null, item.points)))), (((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) - 1) !== index$1 && index.h("div", { class: "separator" })));
63
64
  }
@@ -2,6 +2,7 @@ import { Component, h, Host, Prop, State, Watch } from '@stencil/core';
2
2
  export class YooPointsRecap {
3
3
  constructor() {
4
4
  this.showItemIcon = true;
5
+ this.forceTotalPoints = false;
5
6
  }
6
7
  onItemsUpdated() {
7
8
  this.updatePoints();
@@ -27,8 +28,8 @@ export class YooPointsRecap {
27
28
  return 'success';
28
29
  }
29
30
  }
30
- getItemIconAttr(points) {
31
- if (points <= 0) {
31
+ getItemIconAttr(isCorrect) {
32
+ if (!isCorrect) {
32
33
  return { name: 'close', color: 'danger' };
33
34
  }
34
35
  else {
@@ -38,7 +39,7 @@ export class YooPointsRecap {
38
39
  renderTitle(title) {
39
40
  var _a, _b;
40
41
  const titleClass = `item ${((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.heading ? 'heading' : this.footer && 'footer' : 'content'}`;
41
- const points = (this.footer || !((_b = this.items) === null || _b === void 0 ? void 0 : _b.length)) ? this.totalPoints : this.totalItemsPoints;
42
+ const points = (this.footer || !((_b = this.items) === null || _b === void 0 ? void 0 : _b.length) || this.forceTotalPoints) ? this.totalPoints : this.totalItemsPoints;
42
43
  const tagColor = this.getTagColor(points);
43
44
  return (h("div", { class: "row" },
44
45
  this.footer && this.renderSeparator(),
@@ -58,7 +59,7 @@ export class YooPointsRecap {
58
59
  renderItem(item, index) {
59
60
  var _a;
60
61
  const tagColor = this.getTagColor(item.points);
61
- const itemIcon = this.getItemIconAttr(item.points);
62
+ const itemIcon = this.getItemIconAttr(item.isCorrect);
62
63
  return (h("div", { class: "row" },
63
64
  h("div", { class: "item content" },
64
65
  h("div", { class: "sub-item" },
@@ -182,6 +183,24 @@ export class YooPointsRecap {
182
183
  "attribute": "show-item-icon",
183
184
  "reflect": false,
184
185
  "defaultValue": "true"
186
+ },
187
+ "forceTotalPoints": {
188
+ "type": "boolean",
189
+ "mutable": false,
190
+ "complexType": {
191
+ "original": "boolean",
192
+ "resolved": "boolean",
193
+ "references": {}
194
+ },
195
+ "required": false,
196
+ "optional": true,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": ""
200
+ },
201
+ "attribute": "force-total-points",
202
+ "reflect": false,
203
+ "defaultValue": "false"
185
204
  }
186
205
  }; }
187
206
  static get states() { return {
@@ -3152,6 +3152,7 @@ export class YooFormDynamicComponent {
3152
3152
  extraAttrs = {
3153
3153
  min: field.min,
3154
3154
  max: field.max,
3155
+ allowDecimals: field.allowDecimals,
3155
3156
  maxCharacters: field.maxCharacters,
3156
3157
  type: field.type === FormFieldType.number && isSamsung() ? FormFieldType.text : getInputType(field),
3157
3158
  inputmode: field.type === FormFieldType.number && isSamsung() ? 'numeric' : '',
@@ -219,7 +219,7 @@ export class YooLessonQuestionResultComponent {
219
219
  }
220
220
  else if (!isContentOnly(this.lessonType)) {
221
221
  items = (_b = this.fields) === null || _b === void 0 ? void 0 : _b.map((field, i) => {
222
- var _a, _b, _c, _d, _e, _f;
222
+ var _a, _b, _c, _d, _e, _f, _g;
223
223
  return ({
224
224
  name: `${translate('QUESTION')} ${i + 1}`,
225
225
  description: translateMulti(field.sentence || field.description || field.title),
@@ -231,11 +231,12 @@ export class YooLessonQuestionResultComponent {
231
231
  ? ((_d = this.lessonData[field.name]) === null || _d === void 0 ? void 0 : _d.earnedConfidencePoints) + ((_e = this.lessonData[field.name]) === null || _e === void 0 ? void 0 : _e.earnedQuestionPoints)
232
232
  : ((_f = this.lessonData[field.name]) === null || _f === void 0 ? void 0 : _f.fieldValidity)
233
233
  ? Math.round(this.points)
234
- : 0
234
+ : 0,
235
+ isCorrect: (_g = this.lessonData[field.name]) === null || _g === void 0 ? void 0 : _g.fieldValidity
235
236
  });
236
237
  });
237
238
  }
238
- return h("yoo-points-recap", { heading: translate('TOTALPOINTSEARNED'), totalPoints: Math.round(this.earnedPoints), items: items, showItemIcon: showItemIcon });
239
+ return h("yoo-points-recap", { heading: translate('TOTALPOINTSEARNED'), totalPoints: Math.round(this.earnedPoints), items: items, showItemIcon: showItemIcon, forceTotalPoints: true });
239
240
  }
240
241
  renderProgressBarLessonRecap() {
241
242
  var _a;