@yoobic/yobi 8.5.0-3 → 8.5.0-4

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.
@@ -1029,6 +1029,7 @@ export class YooFormCaptureComponent {
1029
1029
  showAlert('', [translate('YOOBICOK')], description);
1030
1030
  }
1031
1031
  async onShowActionSheet(value, index, event) {
1032
+ var _a, _b, _c;
1032
1033
  if (index && index < 0 && this.max && this.value && this.value.length === this.max) {
1033
1034
  this.onShowMaximumCaptureReached();
1034
1035
  return;
@@ -1136,7 +1137,7 @@ export class YooFormCaptureComponent {
1136
1137
  }
1137
1138
  else if (buttons.length > 0) {
1138
1139
  if (isWeb(this.host)) {
1139
- showContextMenu(event, { multipleSelection: false, contentButtons: buttons, className: 'width-unset', hostElement: this.cameraContainerElement });
1140
+ showContextMenu(event, { multipleSelection: false, contentButtons: buttons, className: 'width-unset', hostElement: this.cameraContainerElement || ((_c = (_b = (_a = this.host) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector) === null || _c === void 0 ? void 0 : _c.call(_b, '.camera-container')) });
1140
1141
  }
1141
1142
  else {
1142
1143
  showActionSheet(buttons, null, { heading: actionSheetTitle });
@@ -767,6 +767,23 @@ export class YooFormDynamicComponent {
767
767
  }
768
768
  }, 1000);
769
769
  }
770
+ getActiveSlideWithField(field) {
771
+ let activeSlide;
772
+ this.slides.forEach((s) => {
773
+ let found = false;
774
+ if (s.items) {
775
+ s.items.forEach((f) => {
776
+ if (f.name === field.name) {
777
+ found = true;
778
+ }
779
+ });
780
+ }
781
+ if (found) {
782
+ activeSlide = s;
783
+ }
784
+ });
785
+ return activeSlide;
786
+ }
770
787
  checkIfFirstSlideAndLockSwipePrev() {
771
788
  // timeout -> wait swipe is done
772
789
  setTimeout(() => {
@@ -1327,42 +1344,27 @@ export class YooFormDynamicComponent {
1327
1344
  dataArray.forEach((d) => {
1328
1345
  const key = d.key;
1329
1346
  const value = d.value;
1330
- let activeSlide;
1331
- if (this.slides) {
1332
- this.slides.forEach((s) => {
1333
- let found = false;
1334
- if (s.items) {
1335
- s.items.forEach((f) => {
1336
- if (f.name === field.name) {
1337
- found = true;
1338
- }
1339
- });
1340
- }
1341
- if (found) {
1342
- activeSlide = s;
1343
- }
1344
- });
1345
- if (activeSlide) {
1346
- const fieldIndex = activeSlide.items.indexOf(field);
1347
- for (let i = fieldIndex + 1; i < activeSlide.items.length; i++) {
1348
- if (key && key.toLowerCase && activeSlide.items[i].title.toLowerCase() === key.toLowerCase()) {
1349
- const foundField = cloneDeep(activeSlide.items[i]);
1350
- let isVisibleProp = true;
1351
- if (foundField.condition) {
1352
- // we have to pass the whole data because maybe some conditions are on other fields
1353
- // we also have to disable the hide from mobile here
1354
- foundField.hideMobile = false;
1355
- foundField.readonly = false;
1356
- isVisibleProp = isVisible(foundField, false, Object.assign({ [foundField.name]: { value } }, this.currentData), this.currentDataFlatten, this.suffix, this.session);
1357
- }
1358
- if (isVisibleProp || !foundField.dontSaveIfHidden) {
1359
- this.currentData[foundField.name] = { value };
1360
- }
1361
- break;
1347
+ const activeSlide = this.getActiveSlideWithField(field);
1348
+ if (this.slides && activeSlide) {
1349
+ const fieldIndex = activeSlide.items.indexOf(field);
1350
+ for (let i = fieldIndex + 1; i < activeSlide.items.length; i++) {
1351
+ if (key && key.toLowerCase && activeSlide.items[i].title.toLowerCase() === key.toLowerCase()) {
1352
+ const foundField = cloneDeep(activeSlide.items[i]);
1353
+ let isVisibleProp = true;
1354
+ if (foundField.condition) {
1355
+ // we have to pass the whole data because maybe some conditions are on other fields
1356
+ // we also have to disable the hide from mobile here
1357
+ foundField.hideMobile = false;
1358
+ foundField.readonly = false;
1359
+ isVisibleProp = isVisible(foundField, false, Object.assign({ [foundField.name]: { value } }, this.currentData), this.currentDataFlatten, this.suffix, this.session);
1362
1360
  }
1363
- else if (activeSlide.items[i].isImageRecognition) {
1364
- break;
1361
+ if (isVisibleProp || !foundField.dontSaveIfHidden) {
1362
+ this.currentData[foundField.name] = { value };
1365
1363
  }
1364
+ break;
1365
+ }
1366
+ else if (activeSlide.items[i].isImageRecognition) {
1367
+ break;
1366
1368
  }
1367
1369
  }
1368
1370
  }
@@ -3888,9 +3890,7 @@ export class YooFormDynamicComponent {
3888
3890
  TagType = 'yoo-form-capture';
3889
3891
  const imageRecognitionKpiKeys = [];
3890
3892
  if (field.isImageRecognition) {
3891
- // slideIndex needs to be based on the active tab index
3892
- const finalIndex = this.isRenderFormSlidesWithTab() ? this.selectedTabIndex || 0 : slideIndex;
3893
- const activeSlide = this.slides[finalIndex];
3893
+ const activeSlide = this.getActiveSlideWithField(field);
3894
3894
  for (let i = inputIndex + 1; i < activeSlide.items.length; i++) {
3895
3895
  const f = activeSlide.items[i];
3896
3896
  if (f.readonly && f.title) {
@@ -490,19 +490,19 @@ svg:not(:root) {
490
490
  .outer-login-container:not(.emulated) .header .login-main-title {
491
491
  display: none;
492
492
  }
493
- .outer-login-container:not(.emulated) #error-alert {
493
+ .outer-login-container:not(.emulated) #error-alert:not(.mobile) {
494
494
  top: 7.5rem;
495
495
  width: 41.5rem;
496
496
  margin: 0 calc((100% - 41.5rem) / 2);
497
497
  }
498
- .outer-login-container:not(.emulated)[is-whitelabel] #error-alert {
498
+ .outer-login-container:not(.emulated)[is-whitelabel] #error-alert:not(.mobile) {
499
499
  top: 9rem;
500
500
  }
501
501
  .outer-login-container:not(.emulated)[logo-shape=square] .header img {
502
502
  height: var(--logo-08, 6rem);
503
503
  max-height: var(--logo-08, 6rem);
504
504
  }
505
- .outer-login-container:not(.emulated)[logo-shape=square] #error-alert {
505
+ .outer-login-container:not(.emulated)[logo-shape=square] #error-alert:not(.mobile) {
506
506
  top: 11rem;
507
507
  }
508
508
  .outer-login-container:not(.emulated).tablet #error-alert {
@@ -590,32 +590,45 @@ svg:not(:root) {
590
590
  }
591
591
  }
592
592
  @media screen and (max-height: 799px) {
593
- .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) .header img {
593
+ .outer-login-container.keyboard-closed:not(.emulated) .header img {
594
594
  margin-top: var(--spacing-32, 2rem);
595
595
  }
596
+ .outer-login-container.keyboard-closed:not(.emulated)[logo-shape=square] .header img {
597
+ margin-top: var(--spacing-48, 3rem);
598
+ }
596
599
  }
597
600
  @media screen and (max-height: 749px) {
598
- .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) .header img {
601
+ .outer-login-container.keyboard-closed:not(.emulated) .header img {
599
602
  margin-top: var(--spacing-16, 1rem);
600
603
  }
601
- .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) #error-alert {
604
+ .outer-login-container.keyboard-closed:not(.emulated)[logo-shape=square] .header img {
605
+ margin-top: var(--spacing-32, 2rem);
606
+ }
607
+ .outer-login-container.keyboard-closed:not(.emulated) #error-alert:not(.mobile):not(.tablet) {
602
608
  top: 6rem;
603
609
  }
604
610
  }
605
611
  @media screen and (max-height: 699px) {
606
- .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) .header img {
612
+ .outer-login-container.keyboard-closed:not(.emulated) .header img {
607
613
  margin-top: var(--spacing-08, 0.5rem);
608
614
  margin-bottom: var(--spacing-08, 0.5rem);
609
615
  }
610
- .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) #error-alert {
616
+ .outer-login-container.keyboard-closed:not(.emulated)[logo-shape=square] .header img {
617
+ margin-top: 0;
618
+ margin-bottom: 0;
619
+ }
620
+ .outer-login-container.keyboard-closed:not(.emulated) #error-alert:not(.mobile):not(.tablet) {
611
621
  top: 4.5rem;
612
622
  }
613
623
  }
614
624
  @media screen and (max-height: 649px) {
615
- .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) .header .login-main-title {
625
+ .outer-login-container.keyboard-closed:not(.emulated) .header .login-main-title {
626
+ display: none;
627
+ }
628
+ .outer-login-container.keyboard-closed:not(.emulated)[logo-shape=square] .header img {
616
629
  display: none;
617
630
  }
618
- .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) #error-alert {
631
+ .outer-login-container.keyboard-closed:not(.emulated) #error-alert:not(.mobile):not(.tablet) {
619
632
  top: 3rem;
620
633
  }
621
634
  }
@@ -625,7 +638,7 @@ svg:not(:root) {
625
638
  display: none;
626
639
  }
627
640
 
628
- .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) #error-alert {
641
+ .outer-login-container:not([is-whitelabel]).keyboard-closed:not(.emulated) #error-alert:not(.mobile):not(.tablet) {
629
642
  top: 0.5rem;
630
643
  }
631
644
  }