@yoobic/yobi 8.5.0-85 → 8.5.0-86

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.
@@ -40,9 +40,9 @@ const YooFormAutocompleteDialogComponent = class {
40
40
  this.modalPlacement = 'below';
41
41
  this.values = [];
42
42
  this.infiniteScrollDisabled = false;
43
+ this.initialValueLength = 0;
43
44
  this.fullscreen = false;
44
45
  this.gridIsExpanded = false;
45
- this.initialValueLength = 0;
46
46
  this.dialogTitleMap = {
47
47
  defaults: ['SELECTITEM', 'SELECTITEMS'],
48
48
  tags: ['SELECTTAG', 'SELECTTAGS'],
@@ -80,13 +80,9 @@ const YooFormAutocompleteDialogComponent = class {
80
80
  this.selection = compact([].concat(this.value || []));
81
81
  }
82
82
  onValuesChanged() {
83
- var _a;
84
83
  if (!this.initialLoadComplete) {
85
84
  this.initialLoadComplete = true;
86
85
  }
87
- if (!this.initialValueLength) {
88
- this.initialValueLength = (_a = this.values) === null || _a === void 0 ? void 0 : _a.length;
89
- }
90
86
  }
91
87
  onSwipingUp() {
92
88
  if (!this.isFromFormModal) {
@@ -107,7 +103,6 @@ const YooFormAutocompleteDialogComponent = class {
107
103
  }
108
104
  }
109
105
  componentWillLoad() {
110
- var _a, _b;
111
106
  this.halfDialogHeight = window.innerHeight / 2;
112
107
  if ((!this.isLocal && (!this.values || (this.values && this.values.length === 0))) || isWeb(this.host)) {
113
108
  this.initialLoadComplete = false;
@@ -115,9 +110,6 @@ const YooFormAutocompleteDialogComponent = class {
115
110
  else {
116
111
  this.initialLoadComplete = !(!isWeb(this.host) && this.isLocal && (this.values || this.values.length === 0));
117
112
  }
118
- if (((_a = this.values) === null || _a === void 0 ? void 0 : _a.length) > 0) {
119
- this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
120
- }
121
113
  if (this.openFullscreen) {
122
114
  this.fullscreen = true;
123
115
  }
@@ -100,6 +100,7 @@ const YooFormAutocompleteComponent = class {
100
100
  this.dialog.infiniteScrollDisabled = this.infiniteScrollDisabled;
101
101
  this.dialog.value = this.value;
102
102
  this.dialog.values = this.isLocal ? (this.storeLocalSearchValue !== undefined ? this.storeLocalValues : this.localValues) : this.values;
103
+ this.dialog.initialValueLength = this.initialValueLength;
103
104
  this.dialog.style.width = isWeb(this.host) ? this.dialogWidth || `${this.host.getBoundingClientRect().width}px` : undefined;
104
105
  this.dialog.addEventListener('currentPageChanged', (ev) => {
105
106
  ev.stopPropagation();
@@ -224,6 +225,7 @@ const YooFormAutocompleteComponent = class {
224
225
  }
225
226
  if (this.dialog) {
226
227
  this.dialog.values = this.dialog.isLoading && this.isLocal ? this.localValues : values;
228
+ this.dialog.initialValueLength = this.initialValueLength;
227
229
  this.dialog.isLoading = false;
228
230
  this.dialog.total = this.total;
229
231
  const localDialogSearchValue = await ((_f = this.dialog) === null || _f === void 0 ? void 0 : _f.getLocalSearchValue());
@@ -549,14 +551,15 @@ const YooFormAutocompleteComponent = class {
549
551
  else {
550
552
  this.infiniteScrollDisabled = hasReachedMaxItem;
551
553
  }
554
+ if (!this.initialValueLength) {
555
+ this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
556
+ }
552
557
  if (this.dialog) {
553
558
  this.dialog.values = this.values;
559
+ this.dialog.initialValueLength = this.initialValueLength;
554
560
  this.dialog.infiniteScrollDisabled = this.infiniteScrollDisabled;
555
561
  this.dialog.isLoading = false;
556
562
  }
557
- if (!this.initialValueLength) {
558
- this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
559
- }
560
563
  return this.values;
561
564
  }
562
565
  onFetchFieldFilterData(ev) {
@@ -54,7 +54,7 @@ const YooFormChoiceImageComponent = class {
54
54
  const readonly = this.readonly || this.isPdf;
55
55
  const noValidation = !((_a = this.answer) === null || _a === void 0 ? void 0 : _a.length);
56
56
  const isCorrect = this.answer.includes(item);
57
- const onOpenImage = () => showSlidesMedia(this.host, { items: this.values.map(({ image }) => ({ value: image })), currentSlideIndex: index, showBottomContainer: false });
57
+ const onOpenImage = () => showSlidesMedia(this.host, { items: this.choices.map(({ image }) => ({ value: image })), currentSlideIndex: index, showBottomContainer: false });
58
58
  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 && [
59
59
  h("yoo-form-checkbox", { value: isSelected(item, this.selection), onClick: () => onItemSelect(item, this), animated: this.animated }),
60
60
  h("yoo-tag", { color: "dark-60", icon: "maximize", iconOnlyColor: "light", size: "small", onClick: () => onOpenImage() })