@yoobic/yobi 8.6.19 → 8.6.21

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.
@@ -58,11 +58,11 @@ const YooFormChoiceImageComponent = class {
58
58
  formChoiceHelpers.hasWarnings(this, this.hasEmptyValues && ['NOEMPTYVALUES']);
59
59
  }
60
60
  renderImage(image, text, index$2) {
61
- var _a;
61
+ var _a, _b, _c;
62
62
  const item = this.hasDuplicateTexts ? image : text;
63
63
  const readonly = this.readonly || this.isPdf;
64
64
  const noValidation = !((_a = this.answer) === null || _a === void 0 ? void 0 : _a.length);
65
- const isCorrect = this.answer.includes(item);
65
+ const isCorrect = (_c = (_b = this.answer) === null || _b === void 0 ? void 0 : _b.map(a => typeof a === 'object' ? a === null || a === void 0 ? void 0 : a[this.hasDuplicateTexts ? 'image' : 'text'] : a)) === null || _c === void 0 ? void 0 : _c.includes(item);
66
66
  const onOpenImage = () => commonHelpers.showSlidesMedia(this.host, { items: this.choices.map(({ image }) => ({ value: image })), currentSlideIndex: index$2, showBottomContainer: false });
67
67
  return (index.h("div", { class: "image-container", onClick: () => this.isHistory && onOpenImage(), style: this.animated ? { '--image-index': index$2.toString() } : {} }, index.h("div", { class: { content: true, 'correct-answer': this.readonly && isCorrect && !noValidation, 'wrong-answer': this.readonly && !isCorrect && !noValidation } }, index.h("yoo-img", { cloudinaryOptions: { pad: true }, scaledUp: this.isPdf, src: image, onClick: () => !readonly && formChoiceHelpers.onItemSelect(item, this) }), !readonly && [
68
68
  index.h("yoo-form-checkbox", { value: formChoiceHelpers.isSelected(item, this.selection), onClick: () => formChoiceHelpers.onItemSelect(item, this), animated: this.animated }),
@@ -42,11 +42,11 @@ export class YooFormChoiceImageComponent {
42
42
  hasWarnings(this, this.hasEmptyValues && ['NOEMPTYVALUES']);
43
43
  }
44
44
  renderImage(image, text, index) {
45
- var _a;
45
+ var _a, _b, _c;
46
46
  const item = this.hasDuplicateTexts ? image : text;
47
47
  const readonly = this.readonly || this.isPdf;
48
48
  const noValidation = !((_a = this.answer) === null || _a === void 0 ? void 0 : _a.length);
49
- const isCorrect = this.answer.includes(item);
49
+ const isCorrect = (_c = (_b = this.answer) === null || _b === void 0 ? void 0 : _b.map(a => typeof a === 'object' ? a === null || a === void 0 ? void 0 : a[this.hasDuplicateTexts ? 'image' : 'text'] : a)) === null || _c === void 0 ? void 0 : _c.includes(item);
50
50
  const onOpenImage = () => showSlidesMedia(this.host, { items: this.choices.map(({ image }) => ({ value: image })), currentSlideIndex: index, showBottomContainer: false });
51
51
  return (h("div", { class: "image-container", onClick: () => this.isHistory && onOpenImage(), style: this.animated ? { '--image-index': index.toString() } : {} }, h("div", { class: { content: true, 'correct-answer': this.readonly && isCorrect && !noValidation, 'wrong-answer': this.readonly && !isCorrect && !noValidation } }, h("yoo-img", { cloudinaryOptions: { pad: true }, scaledUp: this.isPdf, src: image, onClick: () => !readonly && onItemSelect(item, this) }), !readonly && [
52
52
  h("yoo-form-checkbox", { value: isSelected(item, this.selection), onClick: () => onItemSelect(item, this), animated: this.animated }),
@@ -54,11 +54,11 @@ const YooFormChoiceImageComponent = class {
54
54
  hasWarnings(this, this.hasEmptyValues && ['NOEMPTYVALUES']);
55
55
  }
56
56
  renderImage(image, text, index) {
57
- var _a;
57
+ var _a, _b, _c;
58
58
  const item = this.hasDuplicateTexts ? image : text;
59
59
  const readonly = this.readonly || this.isPdf;
60
60
  const noValidation = !((_a = this.answer) === null || _a === void 0 ? void 0 : _a.length);
61
- const isCorrect = this.answer.includes(item);
61
+ const isCorrect = (_c = (_b = this.answer) === null || _b === void 0 ? void 0 : _b.map(a => typeof a === 'object' ? a === null || a === void 0 ? void 0 : a[this.hasDuplicateTexts ? 'image' : 'text'] : a)) === null || _c === void 0 ? void 0 : _c.includes(item);
62
62
  const onOpenImage = () => showSlidesMedia(this.host, { items: this.choices.map(({ image }) => ({ value: image })), currentSlideIndex: index, showBottomContainer: false });
63
63
  return (h("div", { class: "image-container", onClick: () => this.isHistory && onOpenImage(), style: this.animated ? { '--image-index': index.toString() } : {} }, h("div", { class: { content: true, 'correct-answer': this.readonly && isCorrect && !noValidation, 'wrong-answer': this.readonly && !isCorrect && !noValidation } }, h("yoo-img", { cloudinaryOptions: { pad: true }, scaledUp: this.isPdf, src: image, onClick: () => !readonly && onItemSelect(item, this) }), !readonly && [
64
64
  h("yoo-form-checkbox", { value: isSelected(item, this.selection), onClick: () => onItemSelect(item, this), animated: this.animated }),
@@ -54,11 +54,11 @@ const YooFormChoiceImageComponent = class {
54
54
  hasWarnings(this, this.hasEmptyValues && ['NOEMPTYVALUES']);
55
55
  }
56
56
  renderImage(image, text, index) {
57
- var _a;
57
+ var _a, _b, _c;
58
58
  const item = this.hasDuplicateTexts ? image : text;
59
59
  const readonly = this.readonly || this.isPdf;
60
60
  const noValidation = !((_a = this.answer) === null || _a === void 0 ? void 0 : _a.length);
61
- const isCorrect = this.answer.includes(item);
61
+ const isCorrect = (_c = (_b = this.answer) === null || _b === void 0 ? void 0 : _b.map(a => typeof a === 'object' ? a === null || a === void 0 ? void 0 : a[this.hasDuplicateTexts ? 'image' : 'text'] : a)) === null || _c === void 0 ? void 0 : _c.includes(item);
62
62
  const onOpenImage = () => showSlidesMedia(this.host, { items: this.choices.map(({ image }) => ({ value: image })), currentSlideIndex: index, showBottomContainer: false });
63
63
  return (h("div", { class: "image-container", onClick: () => this.isHistory && onOpenImage(), style: this.animated ? { '--image-index': index.toString() } : {} }, h("div", { class: { content: true, 'correct-answer': this.readonly && isCorrect && !noValidation, 'wrong-answer': this.readonly && !isCorrect && !noValidation } }, h("yoo-img", { cloudinaryOptions: { pad: true }, scaledUp: this.isPdf, src: image, onClick: () => !readonly && onItemSelect(item, this) }), !readonly && [
64
64
  h("yoo-form-checkbox", { value: isSelected(item, this.selection), onClick: () => onItemSelect(item, this), animated: this.animated }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoobic/yobi",
3
- "version": "8.6.19",
3
+ "version": "8.6.21",
4
4
  "description": "Yobi - Yoobic Design System",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",