@yoobic/yobi 8.5.0-46 → 8.5.0-48
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.
- package/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/yoo-form-capture.cjs.entry.js +71 -92
- package/dist/cjs/yoo-form-date-time.cjs.entry.js +1 -1
- package/dist/cjs/yoo-form-dynamic.cjs.entry.js +1 -1
- package/dist/cjs/yoo-grid-calendar.cjs.entry.js +2 -2
- package/dist/cjs/yoo-image-cropper-dialog.cjs.entry.js +25 -19
- package/dist/cjs/yoo-mission-details.cjs.entry.js +1 -1
- package/dist/cjs/yoo-mission-heading.cjs.entry.js +1 -1
- package/dist/cjs/yoo-text-sequence.cjs.entry.js +5 -2
- package/dist/collection/components/2.molecules/text-sequence/text-sequence.js +5 -2
- package/dist/collection/components/form/form-capture/form-capture-helper.js +20 -0
- package/dist/collection/components/form/form-capture/form-capture.js +59 -96
- package/dist/collection/components/form/form-date-time/form-date-time.js +1 -1
- package/dist/collection/components/form/form-dynamic/form-dynamic.js +1 -1
- package/dist/collection/components/form/image-cropper-dialog/image-cropper-dialog.css +4 -0
- package/dist/collection/components/form/image-cropper-dialog/image-cropper-dialog.js +27 -21
- package/dist/collection/components/grid/grid-calendar/grid-calendar.js +19 -2
- package/dist/collection/feature-operate/mission/mission-details/mission-details.js +1 -1
- package/dist/collection/feature-operate/mission/mission-heading/mission-heading.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/yoo-form-capture.entry.js +72 -93
- package/dist/design-system/yoo-form-date-time.entry.js +1 -1
- package/dist/design-system/yoo-form-dynamic.entry.js +1 -1
- package/dist/design-system/yoo-grid-calendar.entry.js +2 -2
- package/dist/design-system/yoo-image-cropper-dialog.entry.js +27 -21
- package/dist/design-system/yoo-mission-details.entry.js +1 -1
- package/dist/design-system/yoo-mission-heading.entry.js +1 -1
- package/dist/design-system/yoo-text-sequence.entry.js +5 -2
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/yoo-form-capture.entry.js +72 -93
- package/dist/esm/yoo-form-date-time.entry.js +1 -1
- package/dist/esm/yoo-form-dynamic.entry.js +1 -1
- package/dist/esm/yoo-grid-calendar.entry.js +2 -2
- package/dist/esm/yoo-image-cropper-dialog.entry.js +27 -21
- package/dist/esm/yoo-mission-details.entry.js +1 -1
- package/dist/esm/yoo-mission-heading.entry.js +1 -1
- package/dist/esm/yoo-text-sequence.entry.js +5 -2
- package/dist/types/components/2.molecules/text-sequence/text-sequence.d.ts +1 -0
- package/dist/types/components/form/form-capture/form-capture-helper.d.ts +1 -0
- package/dist/types/components/form/form-capture/form-capture.d.ts +6 -6
- package/dist/types/components/form/image-cropper-dialog/image-cropper-dialog.d.ts +2 -2
- package/dist/types/components/grid/grid-calendar/grid-calendar.d.ts +1 -0
- package/dist/types/components.d.ts +5 -3
- package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/environment/index.d.ts +1 -0
- package/package.json +1 -1
@@ -46,12 +46,15 @@ export class YooTextSequence {
|
|
46
46
|
componentDidUpdate() {
|
47
47
|
this.initSequencesHeight();
|
48
48
|
}
|
49
|
+
updateValidity() {
|
50
|
+
this.validity = this.validity || (this.currentIndex === this.sequenceElements.length - 1);
|
51
|
+
}
|
49
52
|
initSequencesHeight() {
|
50
53
|
var _a;
|
51
54
|
if (this.revealSequences && ((_a = this.sequenceElements) === null || _a === void 0 ? void 0 : _a.length) && this.maxSequenceHeight) {
|
52
55
|
this.host.style.setProperty('--max-sequence-height', `${this.maxSequenceHeight}px`);
|
53
56
|
this.sequenceElements.forEach(e => e.classList.toggle('overflowing', e.scrollHeight > this.maxSequenceHeight));
|
54
|
-
this.
|
57
|
+
this.updateValidity();
|
55
58
|
}
|
56
59
|
}
|
57
60
|
renderSequences() {
|
@@ -71,7 +74,7 @@ export class YooTextSequence {
|
|
71
74
|
const textsHeight = this.sequenceElements.map((e, i) => Math.round(e.offsetHeight * (i <= this.currentIndex ? 1 : .9)));
|
72
75
|
this.host.style.setProperty('--max-sequence-height', `${this.maxSequenceHeight}px`);
|
73
76
|
this.translateY = 0 - ((textsHeight.slice(0, this.currentIndex).reduce((acc, a) => acc + a, 0) + GAP_INTER_SEQUENCES * this.currentIndex));
|
74
|
-
this.
|
77
|
+
this.updateValidity();
|
75
78
|
}
|
76
79
|
};
|
77
80
|
return h("yoo-button", { size: "large", ...{ placement }, hidden: (isUp && !this.currentIndex) || (!isUp && this.currentIndex === ((_a = this.sequenceValues) === null || _a === void 0 ? void 0 : _a.length) - 1), ...(!isUp && this.animated && { onanimationend: () => this.revealSequences = true }), onClick: () => clickArrow() }, h("yoo-icon", { name: `big-arrow-${isUp ? 'up' : 'down'}` }));
|
@@ -1,6 +1,26 @@
|
|
1
|
+
import { addFilePrefix, isAndroid, isBase64, isImageUrl, moveToImageDirectory } from '@shared/utils';
|
1
2
|
export function shouldUseLowPerformanceCamera(user, isNativeMobile, useLibrary) {
|
2
3
|
const enableLowPerformanceCamera = user === null || user === void 0 ? void 0 : user.enableLowPerformanceCamera;
|
3
4
|
const isLowEndDevice = user === null || user === void 0 ? void 0 : user.isLowEndDevice;
|
4
5
|
return !!(enableLowPerformanceCamera ||
|
5
6
|
(enableLowPerformanceCamera === undefined && isLowEndDevice)) && isNativeMobile && !useLibrary;
|
6
7
|
}
|
8
|
+
export async function processMediaPath(mediaPath) {
|
9
|
+
if (isBase64(mediaPath)) {
|
10
|
+
return mediaPath;
|
11
|
+
}
|
12
|
+
else if (mediaPath === null || mediaPath === void 0 ? void 0 : mediaPath.includes('?')) {
|
13
|
+
return mediaPath.substring(0, mediaPath.indexOf('?'));
|
14
|
+
}
|
15
|
+
else if (!isImageUrl(mediaPath)) {
|
16
|
+
return addFilePrefix(mediaPath);
|
17
|
+
}
|
18
|
+
else if (!isAndroid() && ['cache', 'tmp'].includes(mediaPath)) {
|
19
|
+
try {
|
20
|
+
return await moveToImageDirectory(addFilePrefix(mediaPath));
|
21
|
+
}
|
22
|
+
catch (err) {
|
23
|
+
throw new Error(err);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { MediaType, PictureSourceType } from '@awesome-cordova-plugins/camera';
|
2
2
|
import { MediaCapture } from '@awesome-cordova-plugins/media-capture';
|
3
3
|
import { StatusBar } from '@capacitor/status-bar';
|
4
|
-
import { addFilePrefix, asyncWaterfall, audios, changeExtension, downloadFile, getAsyncExtraData, getFormCapturedFileSize, getMimeType, getSession, hasLargeFile, images, isAndroid, isAudio, isCloudinaryLink, isFile, isGif, isImage, isImageUrl, isIOS, isIphoneX, isLenovo, isNativeFilePath, isNativeMobile, isNullOrUndefined, isOffline, isPhotoEdited, isSafari, isUnsplashUrl, isVideo, isWeb,
|
4
|
+
import { addFilePrefix, asyncWaterfall, audios, changeExtension, downloadFile, getAsyncExtraData, getFormCapturedFileSize, getMimeType, getSession, hasLargeFile, images, isAndroid, isAudio, isBase64, isCloudinaryLink, isFile, isGif, isImage, isImageUrl, isIOS, isIphoneX, isLenovo, isNativeFilePath, isNativeMobile, isNullOrUndefined, isOffline, isPhotoEdited, isSafari, isUnsplashUrl, isVideo, isWeb, pipes, read, showActionSheet, showAlert, showContextMenu, showModal, showToast, translate, translateMulti, updatePathSessionId, videos } from '@shared/utils';
|
5
5
|
import { Build, h, Host } from '@stencil/core';
|
6
6
|
import { assign, assignInWith, clone, compact, intersection, isArray, isNumber, isUndefined, keys } from 'lodash-es';
|
7
7
|
import { getPicture, getVideo, getVideoDevices, importMultipleFromLibrary, showAudioRecorder } from '../../../utils/helpers/camera-helpers';
|
8
8
|
import { getAppContext, querySelectorAllDeep, querySelectorDeep, showImageCropper, showPhotoEditor, showSlidesMedia } from '../../../utils/helpers/common-helpers';
|
9
9
|
import { initArrayValue } from '../../../utils/helpers/form-helpers';
|
10
10
|
import { setValidator, setValueAndValidateInput } from '../../../utils/helpers/form-input-helpers';
|
11
|
-
import { shouldUseLowPerformanceCamera } from './form-capture-helper';
|
11
|
+
import { processMediaPath, shouldUseLowPerformanceCamera } from './form-capture-helper';
|
12
12
|
export class YooFormCaptureComponent {
|
13
13
|
constructor() {
|
14
14
|
this.extraData = {};
|
@@ -37,9 +37,15 @@ export class YooFormCaptureComponent {
|
|
37
37
|
this.updateExtraData(extraData);
|
38
38
|
}
|
39
39
|
/** If there is index, the field is a multiphoto */
|
40
|
-
async setFieldValue(data) {
|
41
|
-
|
42
|
-
|
40
|
+
async setFieldValue(index, data) {
|
41
|
+
if (index === undefined) {
|
42
|
+
setValueAndValidateInput(data, this);
|
43
|
+
}
|
44
|
+
else {
|
45
|
+
const newValue = this.value ? [...this.value] : [];
|
46
|
+
newValue[index] = data;
|
47
|
+
setValueAndValidateInput(newValue, this);
|
48
|
+
}
|
43
49
|
}
|
44
50
|
async stopImageRecognitionProcess(isCancelled = false) {
|
45
51
|
this.imageRecoCancelled = isCancelled;
|
@@ -229,9 +235,9 @@ export class YooFormCaptureComponent {
|
|
229
235
|
this.fileInputs = querySelectorDeep(this.host, '.camera-input');
|
230
236
|
}
|
231
237
|
}
|
232
|
-
allowCrop(
|
238
|
+
allowCrop(data) {
|
233
239
|
var _a;
|
234
|
-
return (((_a = this.cropperOptions) === null || _a === void 0 ? void 0 : _a.cropRatio) > 0 || this.showCropper) && isImage(
|
240
|
+
return isWeb(this.host) && (((_a = this.cropperOptions) === null || _a === void 0 ? void 0 : _a.cropRatio) > 0 || this.showCropper) && (isImage(data) || isBase64(data)) && !isGif(data) && (!(typeof data === 'string' && isUnsplashUrl(data)) || isWeb(this.host));
|
235
241
|
}
|
236
242
|
removeAllCapture() {
|
237
243
|
this.value = [];
|
@@ -291,33 +297,19 @@ export class YooFormCaptureComponent {
|
|
291
297
|
}
|
292
298
|
}
|
293
299
|
async processMediaData(mediaData, index) {
|
294
|
-
if (mediaData === null || mediaData === void 0 ? void 0 : mediaData.includes('?')) {
|
295
|
-
mediaData = mediaData.substring(0, mediaData.indexOf('?'));
|
296
|
-
}
|
297
|
-
else if (mediaData && !isImageUrl(mediaData)) {
|
298
|
-
mediaData = addFilePrefix(mediaData);
|
299
|
-
if (!isAndroid() && ['cache', 'tmp'].includes(mediaData)) {
|
300
|
-
try {
|
301
|
-
mediaData = await moveToImageDirectory(mediaData, getSession().user ? getSession().user.disablePhotoOrientationAutoFix : false);
|
302
|
-
}
|
303
|
-
catch (err) {
|
304
|
-
throw new Error(err);
|
305
|
-
}
|
306
|
-
}
|
307
|
-
}
|
308
300
|
try {
|
301
|
+
!isImageUrl(mediaData) && (mediaData = await processMediaPath(mediaData));
|
309
302
|
if (this.shouldTagImage()) {
|
310
303
|
const tag = await this.showPhotoTagDialog(mediaData);
|
311
304
|
(tag === null || tag === void 0 ? void 0 : tag.data) && this.updateTagData(tag, index);
|
312
305
|
}
|
313
|
-
await this.setFieldValue(mediaData);
|
306
|
+
await this.setFieldValue(index, mediaData);
|
314
307
|
this.clearPhotoEdit(index);
|
315
308
|
this.saveGeoloc && this.captureGeoloc(index);
|
316
309
|
}
|
317
310
|
catch (err) {
|
318
311
|
throw new Error(err);
|
319
312
|
}
|
320
|
-
return mediaData;
|
321
313
|
}
|
322
314
|
showPhotoTagDialog(imageSrc, value) {
|
323
315
|
const imageTag = document.createElement('yoo-form-capture-tag-dialog');
|
@@ -379,7 +371,7 @@ export class YooFormCaptureComponent {
|
|
379
371
|
});
|
380
372
|
}
|
381
373
|
async capturePhoto(useLibrary, index) {
|
382
|
-
var _a, _b, _c;
|
374
|
+
var _a, _b, _c, _d, _e;
|
383
375
|
const quality = this.isImageRecognition ? 100 : 70;
|
384
376
|
const sourceType = useLibrary ? PictureSourceType.PHOTOLIBRARY : PictureSourceType.CAMERA;
|
385
377
|
const mediaType = this.type === 'video' ? MediaType.VIDEO : MediaType.PICTURE;
|
@@ -449,26 +441,22 @@ export class YooFormCaptureComponent {
|
|
449
441
|
if (!res && this.showImageLoader) {
|
450
442
|
this.showImageLoader = false;
|
451
443
|
}
|
444
|
+
const newIndex = index < 0 ? ((_e = (_d = this.value) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0) : index;
|
452
445
|
const imagesData = Array.isArray(res) ? res : [res];
|
453
446
|
const hasUnsplash = imagesData.some(d => isUnsplashUrl(d));
|
454
|
-
const processImage = async (imageData,
|
455
|
-
var _a;
|
447
|
+
const processImage = async (imageData, i) => {
|
456
448
|
try {
|
457
|
-
let extractedData = (imageData === null || imageData === void 0 ? void 0 : imageData['data']) || (imageData === null || imageData === void 0 ? void 0 : imageData['path']) || (imageData === null || imageData === void 0 ? void 0 : imageData['fullPath']) || imageData;
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
extractedData = await this.onOpenCropper(imageData);
|
463
|
-
}
|
464
|
-
await this.processMediaData(extractedData, newIndex);
|
465
|
-
}
|
449
|
+
let extractedData = await processMediaPath((imageData === null || imageData === void 0 ? void 0 : imageData['data']) || (imageData === null || imageData === void 0 ? void 0 : imageData['path']) || (imageData === null || imageData === void 0 ? void 0 : imageData['fullPath']) || imageData);
|
450
|
+
const shouldOpenCropper = !hasUnsplash && imagesData.length === 1 && this.allowCrop(extractedData);
|
451
|
+
shouldOpenCropper && (extractedData = await this.onOpenCropper(imageData));
|
452
|
+
const updatingIndex = this.multiple ? newIndex + i : undefined;
|
453
|
+
await this.processMediaData(extractedData, updatingIndex);
|
466
454
|
}
|
467
455
|
catch (err) {
|
468
456
|
this.showImageLoader = false;
|
469
457
|
}
|
470
458
|
};
|
471
|
-
await
|
459
|
+
await asyncWaterfall(imagesData.map((data, i) => processImage(data, i)));
|
472
460
|
this.showImageLoader = false;
|
473
461
|
}
|
474
462
|
catch (err) {
|
@@ -476,30 +464,26 @@ export class YooFormCaptureComponent {
|
|
476
464
|
throw new Error(err);
|
477
465
|
}
|
478
466
|
}
|
479
|
-
captureVideo(index) {
|
480
|
-
const
|
481
|
-
|
482
|
-
this.processMediaData(this.fixPathAndGetValue(files), index);
|
483
|
-
});
|
467
|
+
async captureVideo(index) {
|
468
|
+
const files = await getVideo({ limit: 1, duration: this.duration || 60, saveToPhotoAlbum: true });
|
469
|
+
await Promise.all(files === null || files === void 0 ? void 0 : files.map(file => this.processMediaData(this.fixPathAndGetValue(file), index)));
|
484
470
|
}
|
485
471
|
async captureAudio(index) {
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
472
|
+
try {
|
473
|
+
if (isAndroid()) {
|
474
|
+
const { data } = await showAudioRecorder(this.host);
|
475
|
+
this.processMediaData(data, index);
|
476
|
+
}
|
477
|
+
else {
|
478
|
+
const files = await MediaCapture.captureAudio({ limit: 1, duration: this.duration || 60 });
|
479
|
+
await Promise.all(files === null || files === void 0 ? void 0 : files.map(file => this.processMediaData(this.fixPathAndGetValue(file), index)));
|
490
480
|
}
|
491
481
|
}
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
})
|
498
|
-
.catch((err) => {
|
499
|
-
if (err.code !== 3) {
|
500
|
-
this.noAudio();
|
501
|
-
}
|
502
|
-
});
|
482
|
+
catch (err) {
|
483
|
+
if (err.code !== 3) {
|
484
|
+
showAlert(translate('AUDIO'), [translate('YOOBICOK')], translate('NOAUDIO'));
|
485
|
+
}
|
486
|
+
throw new Error(err);
|
503
487
|
}
|
504
488
|
}
|
505
489
|
noAudio() {
|
@@ -527,39 +511,14 @@ export class YooFormCaptureComponent {
|
|
527
511
|
}
|
528
512
|
}
|
529
513
|
}
|
530
|
-
fixPathAndGetValue(
|
531
|
-
|
532
|
-
return addFilePrefix(files[0].fullPath);
|
533
|
-
}
|
534
|
-
return '';
|
514
|
+
fixPathAndGetValue(file) {
|
515
|
+
return addFilePrefix(file === null || file === void 0 ? void 0 : file.fullPath) || '';
|
535
516
|
}
|
536
|
-
captureFromWebcam(device, index) {
|
537
|
-
|
538
|
-
webcam
|
539
|
-
|
540
|
-
|
541
|
-
if (this.shouldTagImage()) {
|
542
|
-
this.showPhotoTagDialog(ret.data).then((tag) => {
|
543
|
-
if (!isNullOrUndefined(tag === null || tag === void 0 ? void 0 : tag.data)) {
|
544
|
-
this.updateTagData(tag, index);
|
545
|
-
this.setFieldValue(ret.data);
|
546
|
-
this.clearPhotoEdit(index);
|
547
|
-
if (this.saveGeoloc) {
|
548
|
-
this.captureGeoloc();
|
549
|
-
}
|
550
|
-
}
|
551
|
-
});
|
552
|
-
}
|
553
|
-
else {
|
554
|
-
this.setFieldValue(ret.data);
|
555
|
-
this.clearPhotoEdit(index);
|
556
|
-
if (this.saveGeoloc) {
|
557
|
-
this.captureGeoloc();
|
558
|
-
}
|
559
|
-
}
|
560
|
-
}
|
561
|
-
webcam = null;
|
562
|
-
});
|
517
|
+
async captureFromWebcam(device, index) {
|
518
|
+
var _a;
|
519
|
+
const mediaData = (_a = (await showModal(Object.assign(document.createElement('yoo-form-capture-webcam-dialog'), { device }), null, !isWeb(this.host) ? '' : 'fullscreen', 'fadeEnterAnimation', 'fadeLeaveAnimation'))) === null || _a === void 0 ? void 0 : _a.data;
|
520
|
+
// this.allowCrop(mediaData) && (mediaData = await this.onOpenCropper(mediaData));
|
521
|
+
mediaData && await this.processMediaData(mediaData, index);
|
563
522
|
}
|
564
523
|
captureFromDisk(index) {
|
565
524
|
const targetElement = index && index < 0 ? this.getAddFileInput() : this.getTargetElement(index);
|
@@ -651,7 +610,7 @@ export class YooFormCaptureComponent {
|
|
651
610
|
}
|
652
611
|
else {
|
653
612
|
if (this.multiple && (newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
|
654
|
-
this.setFieldValue(newImages);
|
613
|
+
this.setFieldValue(index, newImages);
|
655
614
|
}
|
656
615
|
else if (newImages === null || newImages === void 0 ? void 0 : newImages.length) {
|
657
616
|
this.value = newImages[0];
|
@@ -714,24 +673,24 @@ export class YooFormCaptureComponent {
|
|
714
673
|
const tag = await this.showPhotoTagDialog(data);
|
715
674
|
if (!isNullOrUndefined(tag === null || tag === void 0 ? void 0 : tag.data)) {
|
716
675
|
this.updateTagData(tag, index);
|
717
|
-
this.setFieldValue(data);
|
676
|
+
this.setFieldValue(index, data);
|
718
677
|
this.clearPhotoEdit(index);
|
719
678
|
}
|
720
679
|
}
|
721
680
|
else {
|
722
|
-
this.setFieldValue(data);
|
681
|
+
this.setFieldValue(index, data);
|
723
682
|
this.clearPhotoEdit(index);
|
724
683
|
}
|
725
684
|
}
|
726
685
|
else {
|
727
|
-
this.setFieldValue(f);
|
686
|
+
this.setFieldValue(index, f);
|
728
687
|
this.clearPhotoEdit(index);
|
729
688
|
}
|
730
689
|
targetElement.value = null;
|
731
690
|
}
|
732
691
|
async onOpenCropper(file) {
|
733
692
|
var _a;
|
734
|
-
return (_a = (await showImageCropper(this.host, { file,
|
693
|
+
return (_a = (await showImageCropper(this.host, { file, maintainQuality: true, ...this.cropperOptions || {} }))) === null || _a === void 0 ? void 0 : _a.data;
|
735
694
|
}
|
736
695
|
clearPhotoEdit(index) {
|
737
696
|
var _a, _b;
|
@@ -1551,7 +1510,8 @@ export class YooFormCaptureComponent {
|
|
1551
1510
|
}
|
1552
1511
|
}
|
1553
1512
|
shouldTagImage() {
|
1554
|
-
|
1513
|
+
var _a;
|
1514
|
+
return ((_a = this.tags) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
1555
1515
|
}
|
1556
1516
|
onCancelImageReco() {
|
1557
1517
|
showAlert('', [translate('YOOBICNO'), translate('YOOBICYES')], translate('STOPIMAGERECO')).then((res) => {
|
@@ -1916,7 +1876,7 @@ export class YooFormCaptureComponent {
|
|
1916
1876
|
"mutable": false,
|
1917
1877
|
"complexType": {
|
1918
1878
|
"original": "Partial<YooImageCropperDialogComponent>",
|
1919
|
-
"resolved": "{ heading?: string; file?: any; cropRatio?: number; maintainQuality?: boolean; preventBlob?: boolean;
|
1879
|
+
"resolved": "{ heading?: string; file?: any; cropRatio?: number; maintainQuality?: boolean; preventBlob?: boolean; uploadToCloudinary?: boolean; loading?: boolean; host?: HTMLYooImageCropperDialogElement; componentWillLoad?: () => Promise<void>; componentDidLoad?: () => void; onClose?: () => void; renderLoader?: () => any; renderHeader?: () => any; renderContent?: () => any; render?: () => any; }",
|
1920
1880
|
"references": {
|
1921
1881
|
"Partial": {
|
1922
1882
|
"location": "global"
|
@@ -2714,10 +2674,13 @@ export class YooFormCaptureComponent {
|
|
2714
2674
|
},
|
2715
2675
|
"setFieldValue": {
|
2716
2676
|
"complexType": {
|
2717
|
-
"signature": "(data: any) => Promise<void>",
|
2677
|
+
"signature": "(index: number, data: any) => Promise<void>",
|
2718
2678
|
"parameters": [{
|
2719
2679
|
"tags": [],
|
2720
2680
|
"text": ""
|
2681
|
+
}, {
|
2682
|
+
"tags": [],
|
2683
|
+
"text": ""
|
2721
2684
|
}],
|
2722
2685
|
"references": {
|
2723
2686
|
"Promise": {
|
@@ -156,7 +156,7 @@ export class YooFormDateTimeComponent {
|
|
156
156
|
if (!this.value) {
|
157
157
|
const value = new Date();
|
158
158
|
const oldMinutes = value.getMinutes();
|
159
|
-
const newMinutes = getRoundedMinutes(value, this.timeStep);
|
159
|
+
const newMinutes = +getRoundedMinutes(value, this.timeStep);
|
160
160
|
value.setMinutes(+newMinutes, 0, 0);
|
161
161
|
if (newMinutes === 0 && oldMinutes !== newMinutes) {
|
162
162
|
value.setHours(value.getHours() + 1);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { closeModal, getAsyncExtraData, getMedia, isNativeMobile, showAlert, translate, urlToBlob } from '@shared/utils';
|
1
|
+
import { closeModal, getAsyncExtraData, getMedia, isIOS, isNativeMobile, showAlert, translate, urlToBlob } from '@shared/utils';
|
2
2
|
import { h, Host } from '@stencil/core';
|
3
3
|
import { keys } from 'lodash-es';
|
4
4
|
import {
|
@@ -44,7 +44,13 @@ export class YooImageCropperDialogComponent {
|
|
44
44
|
imageCropLimitToImage: false,
|
45
45
|
imageCropAspectRatio: isFinite(this.cropRatio) && this.cropRatio,
|
46
46
|
imageReader: createDefaultImageReader(),
|
47
|
-
imageWriter: createDefaultImageWriter({
|
47
|
+
imageWriter: createDefaultImageWriter({
|
48
|
+
canvasMemoryLimit: isNativeMobile() && isIOS() ? 4096 * 4096 : Infinity,
|
49
|
+
format: 'canvas',
|
50
|
+
mimeType: 'image/jpeg'
|
51
|
+
}),
|
52
|
+
enableZoom: !isNativeMobile(),
|
53
|
+
enableZoomControls: !isNativeMobile(),
|
48
54
|
imageBackgroundColor: [255, 255, 255, 255],
|
49
55
|
stickers: [
|
50
56
|
['Emoji', ['⭐️', '😊', '👍', '👎', '☀️', '🌤', '🌥']],
|
@@ -65,27 +71,26 @@ export class YooImageCropperDialogComponent {
|
|
65
71
|
cropEnableSelectPreset: false
|
66
72
|
});
|
67
73
|
this.editor.on('close', () => this.onClose());
|
68
|
-
this.editor.on('process', (
|
69
|
-
|
74
|
+
this.editor.on('process', async ({ dest }) => {
|
75
|
+
const b64Value = dest === null || dest === void 0 ? void 0 : dest.toDataURL();
|
76
|
+
this.loading = true;
|
77
|
+
if (this.uploadToCloudinary) {
|
78
|
+
try {
|
79
|
+
this.closeModal(await getAsyncExtraData({ type: 'upload-cloudinary', params: { file: b64Value } }));
|
80
|
+
}
|
81
|
+
catch (err) {
|
82
|
+
await showAlert(translate('FILEPONDLABELFILELOADERROR'), [translate('YOOBICOK')]);
|
83
|
+
throw new Error(err);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
this.closeModal(b64Value);
|
88
|
+
}
|
70
89
|
});
|
71
90
|
}
|
72
91
|
onClose() {
|
73
92
|
this.closeModal(null);
|
74
93
|
}
|
75
|
-
onSave(b64Val) {
|
76
|
-
this.loading = true;
|
77
|
-
if (this.upload) {
|
78
|
-
getAsyncExtraData({ type: 'upload-cloudinary', params: { file: b64Val } }).then((ret) => {
|
79
|
-
this.closeModal(ret);
|
80
|
-
}, () => {
|
81
|
-
showAlert(translate('FILEPONDLABELFILELOADERROR'), [translate('YOOBICOK')]);
|
82
|
-
this.loading = false;
|
83
|
-
});
|
84
|
-
}
|
85
|
-
else {
|
86
|
-
this.closeModal(b64Val);
|
87
|
-
}
|
88
|
-
}
|
89
94
|
async closeModal(value) {
|
90
95
|
var _a;
|
91
96
|
this.loading = false;
|
@@ -102,7 +107,7 @@ export class YooImageCropperDialogComponent {
|
|
102
107
|
return (h("yoo-ion-content", { scrollEnabled: false, class: "bg-light" }, h("div", { class: "outer-container", ref: (el) => (this.outerContainer = el) }), this.loading && this.renderLoader()));
|
103
108
|
}
|
104
109
|
render() {
|
105
|
-
return h(Host,
|
110
|
+
return h(Host, { class: { native: isNativeMobile() } }, this.renderContent());
|
106
111
|
}
|
107
112
|
static get is() { return "yoo-image-cropper-dialog"; }
|
108
113
|
static get encapsulation() { return "shadow"; }
|
@@ -204,7 +209,7 @@ export class YooImageCropperDialogComponent {
|
|
204
209
|
"attribute": "prevent-blob",
|
205
210
|
"reflect": false
|
206
211
|
},
|
207
|
-
"
|
212
|
+
"uploadToCloudinary": {
|
208
213
|
"type": "boolean",
|
209
214
|
"mutable": false,
|
210
215
|
"complexType": {
|
@@ -218,7 +223,7 @@ export class YooImageCropperDialogComponent {
|
|
218
223
|
"tags": [],
|
219
224
|
"text": "Option to upload return file to cloudinary"
|
220
225
|
},
|
221
|
-
"attribute": "upload",
|
226
|
+
"attribute": "upload-to-cloudinary",
|
222
227
|
"reflect": false
|
223
228
|
}
|
224
229
|
};
|
@@ -228,4 +233,5 @@ export class YooImageCropperDialogComponent {
|
|
228
233
|
"loading": {}
|
229
234
|
};
|
230
235
|
}
|
236
|
+
static get elementRef() { return "host"; }
|
231
237
|
}
|
@@ -576,11 +576,11 @@ export class YooGridCalendarComponent {
|
|
576
576
|
var _a, _b;
|
577
577
|
return (h("div", { class: { 'left-container': isWeb(this.host), hidden: !isWeb(this.host) && !this.showMobileCalendar } }, (isWeb(this.host)) && (h("yoo-calendar", { class: { 'no-border': true, 'no-margin-top': !isWeb(this.host) }, isDatePicker: true, size: "small", markers: this.markers, displayMode: "month", onDateChanged: (ev) => this.onLeftCalendarDateChanged(ev) })), isWeb(this.host) && ((_a = this.types) === null || _a === void 0 ? void 0 : _a.length) > 0 && !this.hideFilters && h("div", { class: "types" }, h("yoo-collapsible", { class: "bold", collapsed: false, header: translate('YOOBICTYPE') }, this.types.map((t) => {
|
578
578
|
var _a;
|
579
|
-
return h("yoo-form-checkbox", { class: getEventTypeColor(t), iconColor: getEventTypeColor(t), onClick: () => this.onToggleType(t), value: !(((_a = this.hiddenTypes) === null || _a === void 0 ? void 0 : _a.indexOf(t)) > 0), header: translate(CALENDAR_TRANSLATIONS[t]) });
|
579
|
+
return h("yoo-form-checkbox", { animated: this.animated, class: getEventTypeColor(t), iconColor: getEventTypeColor(t), onClick: () => this.onToggleType(t), value: !(((_a = this.hiddenTypes) === null || _a === void 0 ? void 0 : _a.indexOf(t)) > 0), header: translate(CALENDAR_TRANSLATIONS[t]) });
|
580
580
|
})), h("slot", { name: "filters" }), ((_b = this.eventStatuses) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
581
581
|
h("yoo-collapsible", { class: "bold margin-top", collapsed: false, header: translate('EVENTATTENDANCE') }, this.eventStatuses.map((t) => {
|
582
582
|
var _a;
|
583
|
-
return h("yoo-form-checkbox", { class: "app-color", onClick: () => this.onToggleAttendance(t), value: !(((_a = this.hiddenStatuses) === null || _a === void 0 ? void 0 : _a.indexOf(t)) > 0), header: translate(ATTENDANCE_TRANSLATIONS[t]) });
|
583
|
+
return h("yoo-form-checkbox", { animated: this.animated, class: "app-color", onClick: () => this.onToggleAttendance(t), value: !(((_a = this.hiddenStatuses) === null || _a === void 0 ? void 0 : _a.indexOf(t)) > 0), header: translate(ATTENDANCE_TRANSLATIONS[t]) });
|
584
584
|
})), h("slot", { name: "more-filters" }))));
|
585
585
|
}
|
586
586
|
renderHeader(calendar, type) {
|
@@ -1126,6 +1126,23 @@ export class YooGridCalendarComponent {
|
|
1126
1126
|
},
|
1127
1127
|
"attribute": "initial-date",
|
1128
1128
|
"reflect": false
|
1129
|
+
},
|
1130
|
+
"animated": {
|
1131
|
+
"type": "boolean",
|
1132
|
+
"mutable": false,
|
1133
|
+
"complexType": {
|
1134
|
+
"original": "boolean",
|
1135
|
+
"resolved": "boolean",
|
1136
|
+
"references": {}
|
1137
|
+
},
|
1138
|
+
"required": false,
|
1139
|
+
"optional": true,
|
1140
|
+
"docs": {
|
1141
|
+
"tags": [],
|
1142
|
+
"text": ""
|
1143
|
+
},
|
1144
|
+
"attribute": "animated",
|
1145
|
+
"reflect": false
|
1129
1146
|
}
|
1130
1147
|
};
|
1131
1148
|
}
|
@@ -467,7 +467,7 @@ export class YooMissionDetailsComponent {
|
|
467
467
|
return (h("div", { class: { 'mission-results': true, pdf: this.isPdf, ...getAppContext(this.host) } }, this.isPdf && (h("div", { class: "header-photo-container" }, ((_b = (_a = this.mission) === null || _a === void 0 ? void 0 : _a.description) === null || _b === void 0 ? void 0 : _b.pdfHeaderPhoto) && h("yoo-img", { class: "header-photo", instant: this.instant, src: this.mission.description.pdfHeaderPhoto }), h("div", { class: "header-content" }, h("div", { class: "title" }, translateMulti((_c = this.mission) === null || _c === void 0 ? void 0 : _c.title)), h("div", { class: "subtitle" }, (_d = this.mission) === null || _d === void 0 ? void 0 : _d.address), h("div", { class: "tag-container" }, this.showInformation && (tags === null || tags === void 0 ? void 0 : tags.map((tag) => h("yoo-tag", { color: tag.color, customColor: tag.customColor, innerHTML: tag.title }))))))), h("div", { class: "content" }, !this.isPdf && this.showInformation && h("yoo-mission-heading", { class: "mission-results", isPdf: this.isPdf, mission: this.mission }), !!menuContent.length && h("ul", { class: { menu: true, pdf: this.isPdf } }, menuContent), h("slot", null), this.showScore && h("yoo-mission-score", { class: "mission-detail", isPdf: this.isPdf, charts: this.charts, networkScore: this.networkScore })), h("slot", { name: "end" })));
|
468
468
|
}
|
469
469
|
renderDetails() {
|
470
|
-
return this.isTodoMission ? this.renderTodoMissionDetails() : this.renderMissionDetails();
|
470
|
+
return (this.isTodoMission || this.isTodoCampaign) ? this.renderTodoMissionDetails() : this.renderMissionDetails();
|
471
471
|
}
|
472
472
|
renderResults() {
|
473
473
|
return this.isTodoCampaign ? this.renderTodoMissionDetails() : this.renderMissionResults();
|
@@ -16,7 +16,7 @@ export class YooMissionHeadingComponent {
|
|
16
16
|
renderActionPlanProgress() {
|
17
17
|
const actionProgress = getMissionProgress(this.mission);
|
18
18
|
if ((actionProgress === null || actionProgress === void 0 ? void 0 : actionProgress.value) >= 0) {
|
19
|
-
return h("div", { class: { 'action-plan-progress': true, 'mission-progress-web': !this.isMobile } }, h("yoo-progress-bar", { class: "app-color", shape: "circle", hideProgressValue: true, value: actionProgress.value, metric: actionProgress.unit, maxValue: actionProgress.max }), h("yoo-truncate", { class: "app-color", style: { cssText: '--max-lines: 1' } }, h("span", null, translate('ACTIONSCOMPLETED', { smart_count: actionProgress.value, total: actionProgress.max }))));
|
19
|
+
return h("div", { class: { 'action-plan-progress': true, 'mission-progress-web': !this.isMobile } }, h("yoo-progress-bar", { class: "app-color", shape: "circle", animated: this.animated, hideProgressValue: true, value: actionProgress.value, metric: actionProgress.unit, maxValue: actionProgress.max }), h("yoo-truncate", { class: "app-color", style: { cssText: '--max-lines: 1' } }, h("span", null, translate('ACTIONSCOMPLETED', { smart_count: actionProgress.value, total: actionProgress.max }))));
|
20
20
|
}
|
21
21
|
return null;
|
22
22
|
}
|