@yoobic/yobi 8.5.0-85 → 8.5.0-87

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.
@@ -44,9 +44,9 @@ const YooFormAutocompleteDialogComponent = class {
44
44
  this.modalPlacement = 'below';
45
45
  this.values = [];
46
46
  this.infiniteScrollDisabled = false;
47
+ this.initialValueLength = 0;
47
48
  this.fullscreen = false;
48
49
  this.gridIsExpanded = false;
49
- this.initialValueLength = 0;
50
50
  this.dialogTitleMap = {
51
51
  defaults: ['SELECTITEM', 'SELECTITEMS'],
52
52
  tags: ['SELECTTAG', 'SELECTTAGS'],
@@ -84,13 +84,9 @@ const YooFormAutocompleteDialogComponent = class {
84
84
  this.selection = lodash.compact([].concat(this.value || []));
85
85
  }
86
86
  onValuesChanged() {
87
- var _a;
88
87
  if (!this.initialLoadComplete) {
89
88
  this.initialLoadComplete = true;
90
89
  }
91
- if (!this.initialValueLength) {
92
- this.initialValueLength = (_a = this.values) === null || _a === void 0 ? void 0 : _a.length;
93
- }
94
90
  }
95
91
  onSwipingUp() {
96
92
  if (!this.isFromFormModal) {
@@ -111,7 +107,6 @@ const YooFormAutocompleteDialogComponent = class {
111
107
  }
112
108
  }
113
109
  componentWillLoad() {
114
- var _a, _b;
115
110
  this.halfDialogHeight = window.innerHeight / 2;
116
111
  if ((!this.isLocal && (!this.values || (this.values && this.values.length === 0))) || index$1.isWeb(this.host)) {
117
112
  this.initialLoadComplete = false;
@@ -119,9 +114,6 @@ const YooFormAutocompleteDialogComponent = class {
119
114
  else {
120
115
  this.initialLoadComplete = !(!index$1.isWeb(this.host) && this.isLocal && (this.values || this.values.length === 0));
121
116
  }
122
- if (((_a = this.values) === null || _a === void 0 ? void 0 : _a.length) > 0) {
123
- this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
124
- }
125
117
  if (this.openFullscreen) {
126
118
  this.fullscreen = true;
127
119
  }
@@ -104,6 +104,7 @@ const YooFormAutocompleteComponent = class {
104
104
  this.dialog.infiniteScrollDisabled = this.infiniteScrollDisabled;
105
105
  this.dialog.value = this.value;
106
106
  this.dialog.values = this.isLocal ? (this.storeLocalSearchValue !== undefined ? this.storeLocalValues : this.localValues) : this.values;
107
+ this.dialog.initialValueLength = this.initialValueLength;
107
108
  this.dialog.style.width = index$1.isWeb(this.host) ? this.dialogWidth || `${this.host.getBoundingClientRect().width}px` : undefined;
108
109
  this.dialog.addEventListener('currentPageChanged', (ev) => {
109
110
  ev.stopPropagation();
@@ -228,6 +229,7 @@ const YooFormAutocompleteComponent = class {
228
229
  }
229
230
  if (this.dialog) {
230
231
  this.dialog.values = this.dialog.isLoading && this.isLocal ? this.localValues : values;
232
+ this.dialog.initialValueLength = this.initialValueLength;
231
233
  this.dialog.isLoading = false;
232
234
  this.dialog.total = this.total;
233
235
  const localDialogSearchValue = await ((_f = this.dialog) === null || _f === void 0 ? void 0 : _f.getLocalSearchValue());
@@ -553,14 +555,15 @@ const YooFormAutocompleteComponent = class {
553
555
  else {
554
556
  this.infiniteScrollDisabled = hasReachedMaxItem;
555
557
  }
558
+ if (!this.initialValueLength) {
559
+ this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
560
+ }
556
561
  if (this.dialog) {
557
562
  this.dialog.values = this.values;
563
+ this.dialog.initialValueLength = this.initialValueLength;
558
564
  this.dialog.infiniteScrollDisabled = this.infiniteScrollDisabled;
559
565
  this.dialog.isLoading = false;
560
566
  }
561
- if (!this.initialValueLength) {
562
- this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
563
- }
564
567
  return this.values;
565
568
  }
566
569
  onFetchFieldFilterData(ev) {
@@ -58,7 +58,7 @@ const YooFormChoiceImageComponent = class {
58
58
  const readonly = this.readonly || this.isPdf;
59
59
  const noValidation = !((_a = this.answer) === null || _a === void 0 ? void 0 : _a.length);
60
60
  const isCorrect = this.answer.includes(item);
61
- const onOpenImage = () => commonHelpers.showSlidesMedia(this.host, { items: this.values.map(({ image }) => ({ value: image })), currentSlideIndex: index$2, showBottomContainer: false });
61
+ const onOpenImage = () => commonHelpers.showSlidesMedia(this.host, { items: this.choices.map(({ image }) => ({ value: image })), currentSlideIndex: index$2, showBottomContainer: false });
62
62
  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 && [
63
63
  index.h("yoo-form-checkbox", { value: formChoiceHelpers.isSelected(item, this.selection), onClick: () => formChoiceHelpers.onItemSelect(item, this), animated: this.animated }),
64
64
  index.h("yoo-tag", { color: "dark-60", icon: "maximize", iconOnlyColor: "light", size: "small", onClick: () => onOpenImage() })
@@ -293,7 +293,7 @@ const YooFormTodoMissionComponent = class {
293
293
  var _a, _b, _c, _d, _e, _f;
294
294
  const dueDate = (_a = task.duedate) === null || _a === void 0 ? void 0 : _a.value;
295
295
  const status = this.updateTaskStatus(task, index$1);
296
- return (index.h("main", { class: "container", ...{ status } }, index.h("section", { id: "task-container" }, this.renderLinkedField(task), task.field && index.h("p", { class: "linked-task" }, index$2.translate('YOOBICLINKEDTASK')), index.h("div", { class: "task" }, index.h("header", null, this.renderIcon(task, index$1), index.h("task-details", null, index.h("p", { class: "task-title" }, (_b = task.text) === null || _b === void 0 ? void 0 : _b.value), this.renderUser(task), this.renderDuedateTag(dueDate), status === 'unable-to-complete' && (index.h("yoo-tag", { color: "danger", size: "small" }, index$2.translate('YOOBICMARKEDASUNABLETOCOMPLETE')))), !this.completed && this.renderPlusButton(task, index$1)), this.readonly && (task.userComments || (((_c = task.hasphoto) === null || _c === void 0 ? void 0 : _c.value) && task.imageData)) && index.h("line", null), (((_d = task.isphotorequired) === null || _d === void 0 ? void 0 : _d.value) || ((_e = task.showPhotos) === null || _e === void 0 ? void 0 : _e.value) || ((_f = task.showComments) === null || _f === void 0 ? void 0 : _f.value)) && (index.h("additionnal-fields", null, this.renderCommentsField(task, index$1, task.userComments), this.renderPhotoField(task, index$1))))), status === 'unmarked' && !this.completed && this.renderAssignButton(task, index$1)));
296
+ return (index.h("main", { class: "container", ...{ status } }, index.h("section", { id: "task-container" }, this.renderLinkedField(task), task.field && index.h("p", { class: "linked-task" }, index$2.translate('YOOBICLINKEDTASK')), index.h("div", { class: "task" }, index.h("header", null, this.renderIcon(task, index$1), index.h("task-details", null, index.h("p", { class: "task-title" }, index$2.translateMulti((_b = task.text) === null || _b === void 0 ? void 0 : _b.value)), this.renderUser(task), this.renderDuedateTag(dueDate), status === 'unable-to-complete' && (index.h("yoo-tag", { color: "danger", size: "small" }, index$2.translate('YOOBICMARKEDASUNABLETOCOMPLETE')))), !this.completed && this.renderPlusButton(task, index$1)), this.readonly && (task.userComments || (((_c = task.hasphoto) === null || _c === void 0 ? void 0 : _c.value) && task.imageData)) && index.h("line", null), (((_d = task.isphotorequired) === null || _d === void 0 ? void 0 : _d.value) || ((_e = task.showPhotos) === null || _e === void 0 ? void 0 : _e.value) || ((_f = task.showComments) === null || _f === void 0 ? void 0 : _f.value)) && (index.h("additionnal-fields", null, this.renderCommentsField(task, index$1, task.userComments), this.renderPhotoField(task, index$1))))), status === 'unmarked' && !this.completed && this.renderAssignButton(task, index$1)));
297
297
  }))));
298
298
  }
299
299
  get host() { return index.getElement(this); }
@@ -84,6 +84,7 @@ export class YooFormAutocompleteComponent {
84
84
  this.dialog.infiniteScrollDisabled = this.infiniteScrollDisabled;
85
85
  this.dialog.value = this.value;
86
86
  this.dialog.values = this.isLocal ? (this.storeLocalSearchValue !== undefined ? this.storeLocalValues : this.localValues) : this.values;
87
+ this.dialog.initialValueLength = this.initialValueLength;
87
88
  this.dialog.style.width = isWeb(this.host) ? this.dialogWidth || `${this.host.getBoundingClientRect().width}px` : undefined;
88
89
  this.dialog.addEventListener('currentPageChanged', (ev) => {
89
90
  ev.stopPropagation();
@@ -208,6 +209,7 @@ export class YooFormAutocompleteComponent {
208
209
  }
209
210
  if (this.dialog) {
210
211
  this.dialog.values = this.dialog.isLoading && this.isLocal ? this.localValues : values;
212
+ this.dialog.initialValueLength = this.initialValueLength;
211
213
  this.dialog.isLoading = false;
212
214
  this.dialog.total = this.total;
213
215
  const localDialogSearchValue = await ((_f = this.dialog) === null || _f === void 0 ? void 0 : _f.getLocalSearchValue());
@@ -533,14 +535,15 @@ export class YooFormAutocompleteComponent {
533
535
  else {
534
536
  this.infiniteScrollDisabled = hasReachedMaxItem;
535
537
  }
538
+ if (!this.initialValueLength) {
539
+ this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
540
+ }
536
541
  if (this.dialog) {
537
542
  this.dialog.values = this.values;
543
+ this.dialog.initialValueLength = this.initialValueLength;
538
544
  this.dialog.infiniteScrollDisabled = this.infiniteScrollDisabled;
539
545
  this.dialog.isLoading = false;
540
546
  }
541
- if (!this.initialValueLength) {
542
- this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
543
- }
544
547
  return this.values;
545
548
  }
546
549
  onFetchFieldFilterData(ev) {
@@ -21,9 +21,9 @@ export class YooFormAutocompleteDialogComponent {
21
21
  this.modalPlacement = 'below';
22
22
  this.values = [];
23
23
  this.infiniteScrollDisabled = false;
24
+ this.initialValueLength = 0;
24
25
  this.fullscreen = false;
25
26
  this.gridIsExpanded = false;
26
- this.initialValueLength = 0;
27
27
  this.dialogTitleMap = {
28
28
  defaults: ['SELECTITEM', 'SELECTITEMS'],
29
29
  tags: ['SELECTTAG', 'SELECTTAGS'],
@@ -61,13 +61,9 @@ export class YooFormAutocompleteDialogComponent {
61
61
  this.selection = compact([].concat(this.value || []));
62
62
  }
63
63
  onValuesChanged() {
64
- var _a;
65
64
  if (!this.initialLoadComplete) {
66
65
  this.initialLoadComplete = true;
67
66
  }
68
- if (!this.initialValueLength) {
69
- this.initialValueLength = (_a = this.values) === null || _a === void 0 ? void 0 : _a.length;
70
- }
71
67
  }
72
68
  onSwipingUp() {
73
69
  if (!this.isFromFormModal) {
@@ -88,7 +84,6 @@ export class YooFormAutocompleteDialogComponent {
88
84
  }
89
85
  }
90
86
  componentWillLoad() {
91
- var _a, _b;
92
87
  this.halfDialogHeight = window.innerHeight / 2;
93
88
  if ((!this.isLocal && (!this.values || (this.values && this.values.length === 0))) || isWeb(this.host)) {
94
89
  this.initialLoadComplete = false;
@@ -96,9 +91,6 @@ export class YooFormAutocompleteDialogComponent {
96
91
  else {
97
92
  this.initialLoadComplete = !(!isWeb(this.host) && this.isLocal && (this.values || this.values.length === 0));
98
93
  }
99
- if (((_a = this.values) === null || _a === void 0 ? void 0 : _a.length) > 0) {
100
- this.initialValueLength = (_b = this.values) === null || _b === void 0 ? void 0 : _b.length;
101
- }
102
94
  if (this.openFullscreen) {
103
95
  this.fullscreen = true;
104
96
  }
@@ -1165,6 +1157,24 @@ export class YooFormAutocompleteDialogComponent {
1165
1157
  },
1166
1158
  "attribute": "value",
1167
1159
  "reflect": false
1160
+ },
1161
+ "initialValueLength": {
1162
+ "type": "number",
1163
+ "mutable": false,
1164
+ "complexType": {
1165
+ "original": "number",
1166
+ "resolved": "number",
1167
+ "references": {}
1168
+ },
1169
+ "required": false,
1170
+ "optional": true,
1171
+ "docs": {
1172
+ "tags": [],
1173
+ "text": ""
1174
+ },
1175
+ "attribute": "initial-value-length",
1176
+ "reflect": false,
1177
+ "defaultValue": "0"
1168
1178
  }
1169
1179
  };
1170
1180
  }
@@ -41,7 +41,7 @@ export class YooFormChoiceImageComponent {
41
41
  const readonly = this.readonly || this.isPdf;
42
42
  const noValidation = !((_a = this.answer) === null || _a === void 0 ? void 0 : _a.length);
43
43
  const isCorrect = this.answer.includes(item);
44
- const onOpenImage = () => showSlidesMedia(this.host, { items: this.values.map(({ image }) => ({ value: image })), currentSlideIndex: index, showBottomContainer: false });
44
+ const onOpenImage = () => showSlidesMedia(this.host, { items: this.choices.map(({ image }) => ({ value: image })), currentSlideIndex: index, showBottomContainer: false });
45
45
  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 && [
46
46
  h("yoo-form-checkbox", { value: isSelected(item, this.selection), onClick: () => onItemSelect(item, this), animated: this.animated }),
47
47
  h("yoo-tag", { color: "dark-60", icon: "maximize", iconOnlyColor: "light", size: "small", onClick: () => onOpenImage() })
@@ -1,5 +1,5 @@
1
1
  import { IUser } from '@shared/interfaces';
2
- import { dateFormat, fromToday, getCssColor, getUserDisplayName, isDateAfter, isDateSame, isToday, isWeb, showActionSheet, translate } from '@shared/utils';
2
+ import { dateFormat, fromToday, getCssColor, getUserDisplayName, isDateAfter, isDateSame, isToday, isWeb, showActionSheet, translate, translateMulti } from '@shared/utils';
3
3
  import { forceUpdate, h, Host } from '@stencil/core';
4
4
  import { cloneDeep, compact, lowerFirst, pick } from 'lodash-es';
5
5
  import { getAppContext } from '../../../utils/helpers/common-helpers';
@@ -280,7 +280,7 @@ export class YooFormTodoMissionComponent {
280
280
  var _a, _b, _c, _d, _e, _f;
281
281
  const dueDate = (_a = task.duedate) === null || _a === void 0 ? void 0 : _a.value;
282
282
  const status = this.updateTaskStatus(task, index);
283
- return (h("main", { class: "container", ...{ status } }, h("section", { id: "task-container" }, this.renderLinkedField(task), task.field && h("p", { class: "linked-task" }, translate('YOOBICLINKEDTASK')), h("div", { class: "task" }, h("header", null, this.renderIcon(task, index), h("task-details", null, h("p", { class: "task-title" }, (_b = task.text) === null || _b === void 0 ? void 0 : _b.value), this.renderUser(task), this.renderDuedateTag(dueDate), status === 'unable-to-complete' && (h("yoo-tag", { color: "danger", size: "small" }, translate('YOOBICMARKEDASUNABLETOCOMPLETE')))), !this.completed && this.renderPlusButton(task, index)), this.readonly && (task.userComments || (((_c = task.hasphoto) === null || _c === void 0 ? void 0 : _c.value) && task.imageData)) && h("line", null), (((_d = task.isphotorequired) === null || _d === void 0 ? void 0 : _d.value) || ((_e = task.showPhotos) === null || _e === void 0 ? void 0 : _e.value) || ((_f = task.showComments) === null || _f === void 0 ? void 0 : _f.value)) && (h("additionnal-fields", null, this.renderCommentsField(task, index, task.userComments), this.renderPhotoField(task, index))))), status === 'unmarked' && !this.completed && this.renderAssignButton(task, index)));
283
+ return (h("main", { class: "container", ...{ status } }, h("section", { id: "task-container" }, this.renderLinkedField(task), task.field && h("p", { class: "linked-task" }, translate('YOOBICLINKEDTASK')), h("div", { class: "task" }, h("header", null, this.renderIcon(task, index), h("task-details", null, h("p", { class: "task-title" }, translateMulti((_b = task.text) === null || _b === void 0 ? void 0 : _b.value)), this.renderUser(task), this.renderDuedateTag(dueDate), status === 'unable-to-complete' && (h("yoo-tag", { color: "danger", size: "small" }, translate('YOOBICMARKEDASUNABLETOCOMPLETE')))), !this.completed && this.renderPlusButton(task, index)), this.readonly && (task.userComments || (((_c = task.hasphoto) === null || _c === void 0 ? void 0 : _c.value) && task.imageData)) && h("line", null), (((_d = task.isphotorequired) === null || _d === void 0 ? void 0 : _d.value) || ((_e = task.showPhotos) === null || _e === void 0 ? void 0 : _e.value) || ((_f = task.showComments) === null || _f === void 0 ? void 0 : _f.value)) && (h("additionnal-fields", null, this.renderCommentsField(task, index, task.userComments), this.renderPhotoField(task, index))))), status === 'unmarked' && !this.completed && this.renderAssignButton(task, index)));
284
284
  }))));
285
285
  }
286
286
  static get is() { return "yoo-form-todo-mission"; }