@yoobic/yobi 8.6.62 → 8.6.64

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.
@@ -3846,7 +3846,11 @@ const YooFormDynamicComponent = class {
3846
3846
  displaySegmentsCount: field.displaySegmentsCount,
3847
3847
  mentionUsers: field.allowMention ? field.mentionUsers : [],
3848
3848
  translations: this.shouldUseTranslations() ? this.translations : null,
3849
- onInputResize: () => this.scrollToField(this.focusedField, true, this.keyboardHeight),
3849
+ onInputResize: (event) => {
3850
+ if (event.target === this.focusedField) {
3851
+ this.scrollToField(this.focusedField, true, this.keyboardHeight);
3852
+ }
3853
+ },
3850
3854
  onTranslationValueUpdated: (ev) => this.onTranslationValueUpdated(ev),
3851
3855
  onFetchData: field.allowMention ? (ev) => this.onFetchData(field, ev) : null
3852
3856
  };
@@ -2928,7 +2928,7 @@ const YooGridComponent = class {
2928
2928
  index.h("slot", { name: "header" }),
2929
2929
  index$1.isWeb(this.host) && this.entityType !== 'plans' && !this.withoutGradient && index.h("div", { class: `gradient-overlay left ${this.extraClass}` }),
2930
2930
  index.h("slot", { name: "before" }),
2931
- index.h("yoo-ion-slides", { ref: (el) => (this.slides = el), class: newClass, options: options, onIonSlideTransitionEnd: (ev) => this.onHorizontalSlidingEnd(ev), onIonSlideDidChange: () => this.onIonSlideDidChange() }, (_d = this.filteredItems) === null || _d === void 0 ? void 0 :
2931
+ index.h("yoo-ion-slides", { allowKeyNavigation: false, ref: (el) => (this.slides = el), class: newClass, options: options, onIonSlideTransitionEnd: (ev) => this.onHorizontalSlidingEnd(ev), onIonSlideDidChange: () => this.onIonSlideDidChange() }, (_d = this.filteredItems) === null || _d === void 0 ? void 0 :
2932
2932
  _d.map((item, index$1) => (index.h("yoo-ion-slide", { class: slideClass }, index.h("div", { ref: (el) => (this.itemSlideDiv = el), class: "slide" }, this.renderEntity(item, null, index$1))))), emptySlides),
2933
2933
  index$1.isWeb(this.host) && this.entityType !== 'plans' && !this.withoutGradient && index.h("div", { class: `gradient-overlay right ${this.extraClass}` }),
2934
2934
  index.h("slot", { name: "after" })
@@ -870,24 +870,22 @@ const YooPhotoEditorComponent = class {
870
870
  const startDraw = (ev) => {
871
871
  if (ev && this.isDrawMode) {
872
872
  this.hasImageBeenCleaned = false;
873
- const { x, y } = annotationsHelpers.getPointerCoordinates(ev, this.canvasDrawingsElement);
874
- drawCoordinates = { current: { x, y } };
873
+ drawCoordinates = annotationsHelpers.getPointerCoordinates(ev, this.canvasDrawingsElement);
875
874
  this.canvasContext.beginPath();
876
- this.canvasContext.moveTo(x, y);
875
+ this.canvasContext.lineWidth = this.size;
876
+ this.canvasContext.strokeStyle = index$1.getCssColor(this.color, this.color);
877
+ this.canvasContext.lineCap = 'round';
878
+ this.canvasContext.lineJoin = 'round';
879
+ this.canvasContext.moveTo(drawCoordinates.x, drawCoordinates.y);
877
880
  isDrawing = true;
878
881
  }
879
882
  };
880
883
  const draw = (ev) => {
881
- if (ev && this.isDrawMode && drawCoordinates && isDrawing) {
884
+ if (ev && this.isDrawMode && isDrawing && (drawCoordinates === null || drawCoordinates === void 0 ? void 0 : drawCoordinates.x) && (drawCoordinates === null || drawCoordinates === void 0 ? void 0 : drawCoordinates.y)) {
882
885
  ev.stopPropagation();
883
- const coords = annotationsHelpers.getPointerCoordinates(ev, this.canvasDrawingsElement);
884
- if (coords) {
885
- this.canvasContext.lineWidth = this.size;
886
- this.canvasContext.lineTo(coords.x, coords.y);
887
- this.canvasContext.strokeStyle = index$1.getCssColor(this.color, this.color);
888
- this.canvasContext.lineCap = 'round';
889
- this.canvasContext.stroke();
890
- }
886
+ drawCoordinates = annotationsHelpers.getPointerCoordinates(ev, this.canvasDrawingsElement);
887
+ this.canvasContext.lineTo(drawCoordinates.x, drawCoordinates.y);
888
+ this.canvasContext.stroke();
891
889
  }
892
890
  };
893
891
  const stopDraw = (ev) => {
@@ -901,19 +899,19 @@ const YooPhotoEditorComponent = class {
901
899
  this.canvasContext.closePath();
902
900
  }
903
901
  };
904
- // Web
905
- if (index$1.isWeb(this.host)) {
906
- this.canvasDrawingsElement.onmousedown = startDraw;
907
- this.canvasDrawingsElement.onmousemove = draw;
908
- this.canvasDrawingsElement.onmouseup = stopDraw;
909
- this.canvasDrawingsElement.onmouseleave = stopDraw;
902
+ if (window.navigator.maxTouchPoints) {
903
+ this.canvasDrawingsElement.addEventListener('touchstart', startDraw);
904
+ this.canvasDrawingsElement.addEventListener('touchmove', draw);
905
+ this.canvasDrawingsElement.addEventListener('touchend', stopDraw);
910
906
  }
911
907
  else {
912
- // Mobile & Emulate
913
- ['touchstart', 'pointerdown'].forEach((evName) => this.canvasDrawingsElement.addEventListener(evName, startDraw));
914
- ['touchmove', 'pointermove'].forEach((evName) => this.canvasDrawingsElement.addEventListener(evName, draw));
915
- ['touchend', 'pointerup'].forEach((evName) => this.canvasDrawingsElement.addEventListener(evName, stopDraw));
908
+ this.canvasDrawingsElement.addEventListener('mousedown', startDraw);
909
+ this.canvasDrawingsElement.addEventListener('mousemove', draw);
910
+ ['mouseup', 'mouseleave'].forEach((evName) => this.canvasDrawingsElement.addEventListener(evName, stopDraw));
916
911
  }
912
+ this.canvasDrawingsElement.addEventListener('pointerdown', startDraw);
913
+ this.canvasDrawingsElement.addEventListener('pointermove', draw);
914
+ this.canvasDrawingsElement.addEventListener('pointerup', stopDraw);
917
915
  }
918
916
  }
919
917
  updateAnnotationStyle(styleAttr, styleValue) {
@@ -684,24 +684,22 @@ export class YooPhotoEditorComponent {
684
684
  const startDraw = (ev) => {
685
685
  if (ev && this.isDrawMode) {
686
686
  this.hasImageBeenCleaned = false;
687
- const { x, y } = getPointerCoordinates(ev, this.canvasDrawingsElement);
688
- drawCoordinates = { current: { x, y } };
687
+ drawCoordinates = getPointerCoordinates(ev, this.canvasDrawingsElement);
689
688
  this.canvasContext.beginPath();
690
- this.canvasContext.moveTo(x, y);
689
+ this.canvasContext.lineWidth = this.size;
690
+ this.canvasContext.strokeStyle = getCssColor(this.color, this.color);
691
+ this.canvasContext.lineCap = 'round';
692
+ this.canvasContext.lineJoin = 'round';
693
+ this.canvasContext.moveTo(drawCoordinates.x, drawCoordinates.y);
691
694
  isDrawing = true;
692
695
  }
693
696
  };
694
697
  const draw = (ev) => {
695
- if (ev && this.isDrawMode && drawCoordinates && isDrawing) {
698
+ if (ev && this.isDrawMode && isDrawing && (drawCoordinates === null || drawCoordinates === void 0 ? void 0 : drawCoordinates.x) && (drawCoordinates === null || drawCoordinates === void 0 ? void 0 : drawCoordinates.y)) {
696
699
  ev.stopPropagation();
697
- const coords = getPointerCoordinates(ev, this.canvasDrawingsElement);
698
- if (coords) {
699
- this.canvasContext.lineWidth = this.size;
700
- this.canvasContext.lineTo(coords.x, coords.y);
701
- this.canvasContext.strokeStyle = getCssColor(this.color, this.color);
702
- this.canvasContext.lineCap = 'round';
703
- this.canvasContext.stroke();
704
- }
700
+ drawCoordinates = getPointerCoordinates(ev, this.canvasDrawingsElement);
701
+ this.canvasContext.lineTo(drawCoordinates.x, drawCoordinates.y);
702
+ this.canvasContext.stroke();
705
703
  }
706
704
  };
707
705
  const stopDraw = (ev) => {
@@ -715,19 +713,19 @@ export class YooPhotoEditorComponent {
715
713
  this.canvasContext.closePath();
716
714
  }
717
715
  };
718
- // Web
719
- if (isWeb(this.host)) {
720
- this.canvasDrawingsElement.onmousedown = startDraw;
721
- this.canvasDrawingsElement.onmousemove = draw;
722
- this.canvasDrawingsElement.onmouseup = stopDraw;
723
- this.canvasDrawingsElement.onmouseleave = stopDraw;
716
+ if (window.navigator.maxTouchPoints) {
717
+ this.canvasDrawingsElement.addEventListener('touchstart', startDraw);
718
+ this.canvasDrawingsElement.addEventListener('touchmove', draw);
719
+ this.canvasDrawingsElement.addEventListener('touchend', stopDraw);
724
720
  }
725
721
  else {
726
- // Mobile & Emulate
727
- ['touchstart', 'pointerdown'].forEach((evName) => this.canvasDrawingsElement.addEventListener(evName, startDraw));
728
- ['touchmove', 'pointermove'].forEach((evName) => this.canvasDrawingsElement.addEventListener(evName, draw));
729
- ['touchend', 'pointerup'].forEach((evName) => this.canvasDrawingsElement.addEventListener(evName, stopDraw));
722
+ this.canvasDrawingsElement.addEventListener('mousedown', startDraw);
723
+ this.canvasDrawingsElement.addEventListener('mousemove', draw);
724
+ ['mouseup', 'mouseleave'].forEach((evName) => this.canvasDrawingsElement.addEventListener(evName, stopDraw));
730
725
  }
726
+ this.canvasDrawingsElement.addEventListener('pointerdown', startDraw);
727
+ this.canvasDrawingsElement.addEventListener('pointermove', draw);
728
+ this.canvasDrawingsElement.addEventListener('pointerup', stopDraw);
731
729
  }
732
730
  }
733
731
  updateAnnotationStyle(styleAttr, styleValue) {
@@ -0,0 +1,30 @@
1
+ export const LANGUAGES = {
2
+ ar: 'ar',
3
+ bg: 'bg',
4
+ cz: 'cs',
5
+ zht: 'zh',
6
+ zhs: 'zh',
7
+ zhk: 'zh',
8
+ ca: 'en',
9
+ nl: 'nl',
10
+ en: 'en',
11
+ us: 'en',
12
+ de: 'de',
13
+ el: 'el',
14
+ es: 'es',
15
+ fr: 'fr',
16
+ he: 'he',
17
+ hu: 'hu',
18
+ it: 'it',
19
+ ja: 'ja',
20
+ kr: 'ko',
21
+ pl: 'pl',
22
+ br: 'pt-BR',
23
+ pt: 'pt-PT',
24
+ ro: 'ro',
25
+ ru: 'ru',
26
+ sk: 'sk',
27
+ th: 'th',
28
+ tr: 'tr',
29
+ ua: 'ua'
30
+ };
@@ -1,8 +1,9 @@
1
- import { datepicker } from '@mobiscroll/javascript';
2
- import { dateFormat, endOf, findDevice, getUUID, getWeekStart, isWeb, startOf, translate } from '@shared/utils';
1
+ import { datepicker, locale } from '@mobiscroll/javascript';
2
+ import { dateFormat, endOf, findDevice, getCurrentLanguage, getUUID, getWeekStart, isWeb, startOf, translate } from '@shared/utils';
3
3
  import { h } from '@stencil/core';
4
4
  import { convertValueForInputType, setValidator, setValueAndValidateInput, validate } from '@yobi/utils/helpers/form-input-helpers';
5
5
  import { destroyMountPoints, generateRandomMountElementId, initShadowMountPoints } from '@yobi/utils/helpers/shadow-dom-helper';
6
+ import { LANGUAGES } from './form-date-time.constant';
6
7
  const DISPLAY = {
7
8
  date: ['calendar'],
8
9
  'datetime-local': ['calendar', 'time'],
@@ -91,6 +92,7 @@ export class YooFormDateTimeComponent {
91
92
  displayTimezone: 'local',
92
93
  dataTimezone: 'utc',
93
94
  showOnFocus: false,
95
+ locale: locale[LANGUAGES[getCurrentLanguage()]] || locale['en'],
94
96
  ...(this.hoursOnly && { stepMinute: 60 }),
95
97
  ...(this.hoursOnly && { timeWheels: `|${this.timeFormat}|` }),
96
98
  ...(this.pages && { pages: this.pages }),
@@ -3635,7 +3635,11 @@ export class YooFormDynamicComponent {
3635
3635
  displaySegmentsCount: field.displaySegmentsCount,
3636
3636
  mentionUsers: field.allowMention ? field.mentionUsers : [],
3637
3637
  translations: this.shouldUseTranslations() ? this.translations : null,
3638
- onInputResize: () => this.scrollToField(this.focusedField, true, this.keyboardHeight),
3638
+ onInputResize: (event) => {
3639
+ if (event.target === this.focusedField) {
3640
+ this.scrollToField(this.focusedField, true, this.keyboardHeight);
3641
+ }
3642
+ },
3639
3643
  onTranslationValueUpdated: (ev) => this.onTranslationValueUpdated(ev),
3640
3644
  onFetchData: field.allowMention ? (ev) => this.onFetchData(field, ev) : null
3641
3645
  };
@@ -2845,7 +2845,7 @@ export class YooGridComponent {
2845
2845
  h("slot", { name: "header" }),
2846
2846
  isWeb(this.host) && this.entityType !== 'plans' && !this.withoutGradient && h("div", { class: `gradient-overlay left ${this.extraClass}` }),
2847
2847
  h("slot", { name: "before" }),
2848
- h("yoo-ion-slides", { ref: (el) => (this.slides = el), class: newClass, options: options, onIonSlideTransitionEnd: (ev) => this.onHorizontalSlidingEnd(ev), onIonSlideDidChange: () => this.onIonSlideDidChange() }, (_d = this.filteredItems) === null || _d === void 0 ? void 0 :
2848
+ h("yoo-ion-slides", { allowKeyNavigation: false, ref: (el) => (this.slides = el), class: newClass, options: options, onIonSlideTransitionEnd: (ev) => this.onHorizontalSlidingEnd(ev), onIonSlideDidChange: () => this.onIonSlideDidChange() }, (_d = this.filteredItems) === null || _d === void 0 ? void 0 :
2849
2849
  _d.map((item, index) => (h("yoo-ion-slide", { class: slideClass }, h("div", { ref: (el) => (this.itemSlideDiv = el), class: "slide" }, this.renderEntity(item, null, index))))), emptySlides),
2850
2850
  isWeb(this.host) && this.entityType !== 'plans' && !this.withoutGradient && h("div", { class: `gradient-overlay right ${this.extraClass}` }),
2851
2851
  h("slot", { name: "after" })