@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.
@@ -3285,6 +3285,7 @@ const YooFormDynamicComponent = class {
3285
3285
  extraAttrs = {
3286
3286
  min: field.min,
3287
3287
  max: field.max,
3288
+ allowDecimals: field.allowDecimals,
3288
3289
  maxCharacters: field.maxCharacters,
3289
3290
  type: field.type === FormFieldType.number && isSamsung() ? FormFieldType.text : getInputType(field),
3290
3291
  inputmode: field.type === FormFieldType.number && isSamsung() ? 'numeric' : '',
@@ -215,7 +215,7 @@ const YooLessonQuestionResultComponent = class {
215
215
  }
216
216
  else if (!isContentOnly(this.lessonType)) {
217
217
  items = (_b = this.fields) === null || _b === void 0 ? void 0 : _b.map((field, i) => {
218
- var _a, _b, _c, _d, _e, _f;
218
+ var _a, _b, _c, _d, _e, _f, _g;
219
219
  return ({
220
220
  name: `${translate('QUESTION')} ${i + 1}`,
221
221
  description: translateMulti(field.sentence || field.description || field.title),
@@ -227,11 +227,12 @@ const YooLessonQuestionResultComponent = class {
227
227
  ? ((_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)
228
228
  : ((_f = this.lessonData[field.name]) === null || _f === void 0 ? void 0 : _f.fieldValidity)
229
229
  ? Math.round(this.points)
230
- : 0
230
+ : 0,
231
+ isCorrect: (_g = this.lessonData[field.name]) === null || _g === void 0 ? void 0 : _g.fieldValidity
231
232
  });
232
233
  });
233
234
  }
234
- return h("yoo-points-recap", { heading: translate('TOTALPOINTSEARNED'), totalPoints: Math.round(this.earnedPoints), items: items, showItemIcon: showItemIcon });
235
+ return h("yoo-points-recap", { heading: translate('TOTALPOINTSEARNED'), totalPoints: Math.round(this.earnedPoints), items: items, showItemIcon: showItemIcon, forceTotalPoints: true });
235
236
  }
236
237
  renderProgressBarLessonRecap() {
237
238
  var _a;
@@ -6,6 +6,7 @@ const YooPointsRecap = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
8
  this.showItemIcon = true;
9
+ this.forceTotalPoints = false;
9
10
  }
10
11
  onItemsUpdated() {
11
12
  this.updatePoints();
@@ -31,8 +32,8 @@ const YooPointsRecap = class {
31
32
  return 'success';
32
33
  }
33
34
  }
34
- getItemIconAttr(points) {
35
- if (points <= 0) {
35
+ getItemIconAttr(isCorrect) {
36
+ if (!isCorrect) {
36
37
  return { name: 'close', color: 'danger' };
37
38
  }
38
39
  else {
@@ -42,7 +43,7 @@ const YooPointsRecap = class {
42
43
  renderTitle(title) {
43
44
  var _a, _b;
44
45
  const titleClass = `item ${((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.heading ? 'heading' : this.footer && 'footer' : 'content'}`;
45
- const points = (this.footer || !((_b = this.items) === null || _b === void 0 ? void 0 : _b.length)) ? this.totalPoints : this.totalItemsPoints;
46
+ const points = (this.footer || !((_b = this.items) === null || _b === void 0 ? void 0 : _b.length) || this.forceTotalPoints) ? this.totalPoints : this.totalItemsPoints;
46
47
  const tagColor = this.getTagColor(points);
47
48
  return (h("div", { class: "row" }, this.footer && this.renderSeparator(), h("div", { class: titleClass }, h("div", null, h("b", null, title)), h("div", null, h("yoo-tag", { size: "medium", color: `${tagColor}-10` }, h("yoo-icon", { slot: "start", name: "star", size: "small", color: tagColor }), h("div", null, points)))), this.heading && this.renderSeparator()));
48
49
  }
@@ -53,7 +54,7 @@ const YooPointsRecap = class {
53
54
  renderItem(item, index) {
54
55
  var _a;
55
56
  const tagColor = this.getTagColor(item.points);
56
- const itemIcon = this.getItemIconAttr(item.points);
57
+ const itemIcon = this.getItemIconAttr(item.isCorrect);
57
58
  return (h("div", { class: "row" }, h("div", { class: "item content" }, h("div", { class: "sub-item" }, this.showItemIcon && h("yoo-icon", { slot: "start", name: itemIcon.name, size: "medium", color: itemIcon.color }), item.subItem ? this.renderSubItem(item) :
58
59
  h("yoo-tooltip", { placement: "top", content: item.description }, h("div", { class: "name" }, item.name))), h("div", null, h("yoo-tag", { size: "medium", color: `${tagColor}-10` }, h("yoo-icon", { slot: "start", name: "star", size: "small", color: tagColor }), h("div", null, item.points)))), (((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) - 1) !== index && h("div", { class: "separator" })));
59
60
  }
@@ -5,13 +5,14 @@ export declare class YooPointsRecap {
5
5
  totalPoints?: number;
6
6
  items?: IItemsPoints[];
7
7
  showItemIcon?: boolean;
8
+ forceTotalPoints?: boolean;
8
9
  pointsUpdated: boolean;
9
10
  private totalItemsPoints;
10
11
  onItemsUpdated(): void;
11
12
  componentWillLoad(): void;
12
13
  updatePoints(): void;
13
14
  getTagColor(points: number, isSubItem?: boolean): TColor;
14
- getItemIconAttr(points: number): IITemIcon;
15
+ getItemIconAttr(isCorrect: boolean): IITemIcon;
15
16
  renderTitle(title: string): any;
16
17
  renderSeparator(): any;
17
18
  renderItem(item: IItemsPoints, index: number): any;
@@ -5984,6 +5984,7 @@ export namespace Components {
5984
5984
  }
5985
5985
  interface YooPointsRecap {
5986
5986
  "footer": string;
5987
+ "forceTotalPoints"?: boolean;
5987
5988
  "heading": string;
5988
5989
  "items"?: IItemsPoints[];
5989
5990
  "showItemIcon"?: boolean;
@@ -16919,6 +16920,7 @@ declare namespace LocalJSX {
16919
16920
  }
16920
16921
  interface YooPointsRecap {
16921
16922
  "footer"?: string;
16923
+ "forceTotalPoints"?: boolean;
16922
16924
  "heading"?: string;
16923
16925
  "items"?: IItemsPoints[];
16924
16926
  "showItemIcon"?: boolean;
@@ -60,6 +60,7 @@ export interface IFormField {
60
60
  description?: string;
61
61
  descriptionDynamic?: IDynamicProperty;
62
62
  caption?: string;
63
+ allowDecimals?: boolean;
63
64
  name?: string;
64
65
  customName?: string;
65
66
  disabled?: boolean | string | ICondition | ICondition[];
@@ -6,6 +6,7 @@ export interface IItemsPoints {
6
6
  subItem?: string;
7
7
  points: number;
8
8
  color?: TColor;
9
+ isCorrect?: boolean;
9
10
  }
10
11
  export interface IITemIcon {
11
12
  name: TIconName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoobic/yobi",
3
- "version": "8.2.13-0",
3
+ "version": "8.2.13-1",
4
4
  "description": "Yobi - Yoobic Design System",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",