valtech-components 4.0.998 → 4.0.1000
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/esm2022/lib/components/organisms/survey-builder/survey-builder.component.mjs +191 -15
- package/esm2022/lib/components/organisms/survey-builder/survey-builder.i18n.mjs +13 -1
- package/esm2022/lib/components/organisms/survey-builder/types.mjs +1 -1
- package/esm2022/lib/services/i18n/default-content.mjs +5 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +204 -15
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/survey-builder/survey-builder.component.d.ts +5 -0
- package/lib/components/organisms/survey-builder/types.d.ts +5 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -70,7 +70,7 @@ import fixWebmDuration from 'fix-webm-duration';
|
|
|
70
70
|
* Current version of valtech-components.
|
|
71
71
|
* This is automatically updated during the publish process.
|
|
72
72
|
*/
|
|
73
|
-
const VERSION = '4.0.
|
|
73
|
+
const VERSION = '4.0.1000';
|
|
74
74
|
|
|
75
75
|
function evaluateValtechAccess(rule, context, features = {}, visitedFeatures = new Set()) {
|
|
76
76
|
if (rule == null)
|
|
@@ -7759,6 +7759,8 @@ const VALTECH_DEFAULT_CONTENT = {
|
|
|
7759
7759
|
save: 'Guardar',
|
|
7760
7760
|
delete: 'Eliminar',
|
|
7761
7761
|
edit: 'Editar',
|
|
7762
|
+
yes: 'Sí',
|
|
7763
|
+
no: 'No',
|
|
7762
7764
|
close: 'Cerrar',
|
|
7763
7765
|
back: 'Volver',
|
|
7764
7766
|
next: 'Siguiente',
|
|
@@ -7923,6 +7925,8 @@ const VALTECH_DEFAULT_CONTENT = {
|
|
|
7923
7925
|
save: 'Save',
|
|
7924
7926
|
delete: 'Delete',
|
|
7925
7927
|
edit: 'Edit',
|
|
7928
|
+
yes: 'Yes',
|
|
7929
|
+
no: 'No',
|
|
7926
7930
|
close: 'Close',
|
|
7927
7931
|
back: 'Back',
|
|
7928
7932
|
next: 'Next',
|
|
@@ -40660,6 +40664,12 @@ const SURVEY_BUILDER_I18N = {
|
|
|
40660
40664
|
presentationLabel: 'Presentación',
|
|
40661
40665
|
headerImageLabel: 'Imagen inicial',
|
|
40662
40666
|
headerImagePlaceholder: 'URL de la imagen que abre la encuesta',
|
|
40667
|
+
imageUpload: 'Subir imagen',
|
|
40668
|
+
imageChange: 'Cambiar imagen',
|
|
40669
|
+
imageRemove: 'Quitar imagen',
|
|
40670
|
+
imageTypeError: 'Usa una imagen JPG, PNG, WEBP o GIF.',
|
|
40671
|
+
imageSizeError: 'La imagen no puede pesar más de 10 MB.',
|
|
40672
|
+
imageUploadError: 'No pudimos subir la imagen. Intenta nuevamente.',
|
|
40663
40673
|
successTitleLabel: 'Título de agradecimiento',
|
|
40664
40674
|
successTitlePlaceholder: 'Ej: Gracias por responder',
|
|
40665
40675
|
successMessageLabel: 'Mensaje de agradecimiento',
|
|
@@ -40693,6 +40703,12 @@ const SURVEY_BUILDER_I18N = {
|
|
|
40693
40703
|
presentationLabel: 'Presentation',
|
|
40694
40704
|
headerImageLabel: 'Opening image',
|
|
40695
40705
|
headerImagePlaceholder: 'Image URL shown at the start of the survey',
|
|
40706
|
+
imageUpload: 'Upload image',
|
|
40707
|
+
imageChange: 'Change image',
|
|
40708
|
+
imageRemove: 'Remove image',
|
|
40709
|
+
imageTypeError: 'Use a JPG, PNG, WEBP or GIF image.',
|
|
40710
|
+
imageSizeError: 'The image must be 10 MB or less.',
|
|
40711
|
+
imageUploadError: "We couldn't upload the image. Try again.",
|
|
40696
40712
|
successTitleLabel: 'Thank-you title',
|
|
40697
40713
|
successTitlePlaceholder: 'E.g: Thanks for answering',
|
|
40698
40714
|
successMessageLabel: 'Thank-you message',
|
|
@@ -40766,6 +40782,9 @@ class SurveyBuilderComponent {
|
|
|
40766
40782
|
this.editingId = signal('');
|
|
40767
40783
|
this.validationError = signal('');
|
|
40768
40784
|
this.saving = signal(false);
|
|
40785
|
+
this.uploadingImage = signal('');
|
|
40786
|
+
this.allowedImageTypes = ['image/jpeg', 'image/png', 'image/webp', 'image/gif'];
|
|
40787
|
+
this.maxImageBytes = 10 * 1024 * 1024;
|
|
40769
40788
|
if (!this.i18n.hasNamespace(NAMESPACE$1)) {
|
|
40770
40789
|
this.i18n.registerDefaults(NAMESPACE$1, SURVEY_BUILDER_I18N);
|
|
40771
40790
|
}
|
|
@@ -40775,6 +40794,7 @@ class SurveyBuilderComponent {
|
|
|
40775
40794
|
if (!this.i18n.hasNamespace(EDITOR_NAMESPACE)) {
|
|
40776
40795
|
this.i18n.registerDefaults(EDITOR_NAMESPACE, FIELD_SCHEMA_EDITOR_I18N);
|
|
40777
40796
|
}
|
|
40797
|
+
addIcons({ cloudUploadOutline, trashOutline });
|
|
40778
40798
|
}
|
|
40779
40799
|
async ngOnInit() {
|
|
40780
40800
|
// Sembrado directo: la app ya tenía la encuesta, no hace falta leerla.
|
|
@@ -40895,6 +40915,49 @@ class SurveyBuilderComponent {
|
|
|
40895
40915
|
this.editingId.set('');
|
|
40896
40916
|
this.validationError.set('');
|
|
40897
40917
|
}
|
|
40918
|
+
async onPresentationFileSelected(slot, event) {
|
|
40919
|
+
const input = event.target;
|
|
40920
|
+
const file = input.files?.[0];
|
|
40921
|
+
input.value = '';
|
|
40922
|
+
if (!file || !this.props.presentationImageUpload || this.uploadingImage())
|
|
40923
|
+
return;
|
|
40924
|
+
if (file.type && !this.allowedImageTypes.includes(file.type)) {
|
|
40925
|
+
this.validationError.set(this.t('imageTypeError'));
|
|
40926
|
+
return;
|
|
40927
|
+
}
|
|
40928
|
+
if (file.size > this.maxImageBytes) {
|
|
40929
|
+
this.validationError.set(this.t('imageSizeError'));
|
|
40930
|
+
return;
|
|
40931
|
+
}
|
|
40932
|
+
this.uploadingImage.set(slot);
|
|
40933
|
+
this.validationError.set('');
|
|
40934
|
+
try {
|
|
40935
|
+
const url = await this.props.presentationImageUpload(slot, file);
|
|
40936
|
+
if (slot === 'header') {
|
|
40937
|
+
this.headerImageControl.setValue(url);
|
|
40938
|
+
}
|
|
40939
|
+
else {
|
|
40940
|
+
this.successImageControl.setValue(url);
|
|
40941
|
+
}
|
|
40942
|
+
}
|
|
40943
|
+
catch (err) {
|
|
40944
|
+
this.errors.handle(err, {
|
|
40945
|
+
context: `surveyBuilder.presentationImageUpload slot=${slot}`,
|
|
40946
|
+
fallbackKey: 'imageUploadError',
|
|
40947
|
+
i18nNamespace: NAMESPACE$1,
|
|
40948
|
+
});
|
|
40949
|
+
}
|
|
40950
|
+
finally {
|
|
40951
|
+
this.uploadingImage.set('');
|
|
40952
|
+
}
|
|
40953
|
+
}
|
|
40954
|
+
clearPresentationImage(slot) {
|
|
40955
|
+
if (slot === 'header') {
|
|
40956
|
+
this.headerImageControl.setValue('');
|
|
40957
|
+
return;
|
|
40958
|
+
}
|
|
40959
|
+
this.successImageControl.setValue('');
|
|
40960
|
+
}
|
|
40898
40961
|
async save() {
|
|
40899
40962
|
if (this.saving())
|
|
40900
40963
|
return;
|
|
@@ -41017,18 +41080,80 @@ class SurveyBuilderComponent {
|
|
|
41017
41080
|
|
|
41018
41081
|
<div class="survey-builder__presentation">
|
|
41019
41082
|
<span class="survey-builder__questions-label">{{ t('presentationLabel') }}</span>
|
|
41020
|
-
<
|
|
41021
|
-
<val-
|
|
41022
|
-
|
|
41083
|
+
<div class="survey-builder__image-field">
|
|
41084
|
+
<val-form-field [label]="t('headerImageLabel')">
|
|
41085
|
+
<val-text-input [props]="{ control: headerImageControl, placeholder: t('headerImagePlaceholder') }" />
|
|
41086
|
+
</val-form-field>
|
|
41087
|
+
@if (headerImageControl.value) {
|
|
41088
|
+
<div class="survey-builder__image-preview">
|
|
41089
|
+
<img [src]="headerImageControl.value" alt="" />
|
|
41090
|
+
<button
|
|
41091
|
+
type="button"
|
|
41092
|
+
class="survey-builder__image-clear"
|
|
41093
|
+
[attr.aria-label]="t('imageRemove')"
|
|
41094
|
+
(click)="clearPresentationImage('header')"
|
|
41095
|
+
>
|
|
41096
|
+
<ion-icon name="trash-outline" aria-hidden="true" />
|
|
41097
|
+
</button>
|
|
41098
|
+
</div>
|
|
41099
|
+
}
|
|
41100
|
+
@if (props.presentationImageUpload) {
|
|
41101
|
+
<label class="survey-builder__image-upload" [class.survey-builder__image-upload--loading]="uploadingImage() === 'header'">
|
|
41102
|
+
@if (uploadingImage() === 'header') {
|
|
41103
|
+
<ion-spinner name="crescent" />
|
|
41104
|
+
} @else {
|
|
41105
|
+
<ion-icon name="cloud-upload-outline" aria-hidden="true" />
|
|
41106
|
+
}
|
|
41107
|
+
<span>{{ headerImageControl.value ? t('imageChange') : t('imageUpload') }}</span>
|
|
41108
|
+
<input
|
|
41109
|
+
type="file"
|
|
41110
|
+
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
|
41111
|
+
[disabled]="uploadingImage() === 'header'"
|
|
41112
|
+
(change)="onPresentationFileSelected('header', $event)"
|
|
41113
|
+
/>
|
|
41114
|
+
</label>
|
|
41115
|
+
}
|
|
41116
|
+
</div>
|
|
41023
41117
|
<val-form-field [label]="t('successTitleLabel')">
|
|
41024
41118
|
<val-text-input [props]="{ control: successTitleControl, placeholder: t('successTitlePlaceholder') }" />
|
|
41025
41119
|
</val-form-field>
|
|
41026
41120
|
<val-form-field [label]="t('successMessageLabel')">
|
|
41027
41121
|
<val-text-input [props]="{ control: successMessageControl, placeholder: t('successMessagePlaceholder') }" />
|
|
41028
41122
|
</val-form-field>
|
|
41029
|
-
<
|
|
41030
|
-
<val-
|
|
41031
|
-
|
|
41123
|
+
<div class="survey-builder__image-field">
|
|
41124
|
+
<val-form-field [label]="t('successImageLabel')">
|
|
41125
|
+
<val-text-input [props]="{ control: successImageControl, placeholder: t('successImagePlaceholder') }" />
|
|
41126
|
+
</val-form-field>
|
|
41127
|
+
@if (successImageControl.value) {
|
|
41128
|
+
<div class="survey-builder__image-preview">
|
|
41129
|
+
<img [src]="successImageControl.value" alt="" />
|
|
41130
|
+
<button
|
|
41131
|
+
type="button"
|
|
41132
|
+
class="survey-builder__image-clear"
|
|
41133
|
+
[attr.aria-label]="t('imageRemove')"
|
|
41134
|
+
(click)="clearPresentationImage('success')"
|
|
41135
|
+
>
|
|
41136
|
+
<ion-icon name="trash-outline" aria-hidden="true" />
|
|
41137
|
+
</button>
|
|
41138
|
+
</div>
|
|
41139
|
+
}
|
|
41140
|
+
@if (props.presentationImageUpload) {
|
|
41141
|
+
<label class="survey-builder__image-upload" [class.survey-builder__image-upload--loading]="uploadingImage() === 'success'">
|
|
41142
|
+
@if (uploadingImage() === 'success') {
|
|
41143
|
+
<ion-spinner name="crescent" />
|
|
41144
|
+
} @else {
|
|
41145
|
+
<ion-icon name="cloud-upload-outline" aria-hidden="true" />
|
|
41146
|
+
}
|
|
41147
|
+
<span>{{ successImageControl.value ? t('imageChange') : t('imageUpload') }}</span>
|
|
41148
|
+
<input
|
|
41149
|
+
type="file"
|
|
41150
|
+
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
|
41151
|
+
[disabled]="uploadingImage() === 'success'"
|
|
41152
|
+
(change)="onPresentationFileSelected('success', $event)"
|
|
41153
|
+
/>
|
|
41154
|
+
</label>
|
|
41155
|
+
}
|
|
41156
|
+
</div>
|
|
41032
41157
|
</div>
|
|
41033
41158
|
|
|
41034
41159
|
<div class="survey-builder__questions">
|
|
@@ -41130,13 +41255,15 @@ class SurveyBuilderComponent {
|
|
|
41130
41255
|
(onClick)="save()"
|
|
41131
41256
|
/>
|
|
41132
41257
|
</div>
|
|
41133
|
-
`, isInline: true, styles: [":host{display:block}.survey-builder{display:flex;flex-direction:column;gap:16px}.survey-builder__questions{display:flex;flex-direction:column;gap:12px}.survey-builder__presentation{display:flex;flex-direction:column;gap:12px;padding-top:4px}.survey-builder__questions-label{font-size:.8125rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ion-color-medium, #92949c)}.survey-builder__empty{margin:0;font-size:.875rem;color:var(--ion-color-medium, #92949c)}.survey-builder__row{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid var(--ion-border-color, rgba(0, 0, 0, .1));border-radius:var(--val-radius-md, 12px);background:var(--ion-card-background, var(--ion-background-color, #fff))}.survey-builder__row-head{display:flex;flex-direction:column;gap:8px}.survey-builder__row-text{display:flex;flex-direction:column;gap:2px;min-width:0}.survey-builder__row-text strong{color:var(--ion-text-color, #000);font-size:.9375rem}.survey-builder__row-text span{color:var(--ion-color-medium, #92949c);font-size:.8125rem}.survey-builder__row-actions{display:flex;gap:4px;flex-wrap:wrap}.survey-builder__row-editor{display:flex;flex-direction:column;gap:12px;padding-top:12px;border-top:1px solid var(--ion-border-color, rgba(0, 0, 0, .1))}.survey-builder__error{margin:0;color:var(--ion-color-danger);font-size:.875rem;font-weight:700}@media (min-width: 576px){.survey-builder__row-head{flex-direction:row;align-items:flex-start;justify-content:space-between}.survey-builder__row-text{flex:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: TextInputComponent, selector: "val-text-input", inputs: ["preset", "props"] }, { kind: "component", type: ButtonComponent, selector: "val-button", inputs: ["preset", "props"], outputs: ["onClick"] }, { kind: "component", type: FormFieldComponent, selector: "val-form-field", inputs: ["label"] }, { kind: "component", type: FieldSchemaEditorComponent, selector: "val-field-schema-editor", inputs: ["props"], outputs: ["save", "changed"] }] }); }
|
|
41258
|
+
`, isInline: true, styles: [":host{display:block}.survey-builder{display:flex;flex-direction:column;gap:16px}.survey-builder__questions{display:flex;flex-direction:column;gap:12px}.survey-builder__presentation{display:flex;flex-direction:column;gap:12px;padding-top:4px}.survey-builder__image-field{display:flex;flex-direction:column;gap:10px}.survey-builder__image-preview{position:relative;width:100%}.survey-builder__image-preview img{display:block;width:100%;aspect-ratio:16 / 9;object-fit:contain;border:1px solid var(--ion-border-color, rgba(0, 0, 0, .1));border-radius:8px;background:var(--ion-color-light, #f4f5f8)}.survey-builder__image-clear{position:absolute;top:8px;right:8px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:999px;background:#0009;color:#fff;cursor:pointer}.survey-builder__image-upload{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 18px;border:2px dashed var(--ion-border-color, rgba(0, 0, 0, .16));border-radius:20px;color:var(--ion-color-medium-shade, #6b6675);font-size:.875rem;font-weight:600;cursor:pointer}.survey-builder__image-upload:hover{border-color:var(--ion-color-primary);color:var(--ion-color-primary)}.survey-builder__image-upload--loading{opacity:.7;cursor:default}.survey-builder__image-upload ion-spinner{width:16px;height:16px}.survey-builder__image-upload input{display:none}.survey-builder__questions-label{font-size:.8125rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ion-color-medium, #92949c)}.survey-builder__empty{margin:0;font-size:.875rem;color:var(--ion-color-medium, #92949c)}.survey-builder__row{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid var(--ion-border-color, rgba(0, 0, 0, .1));border-radius:var(--val-radius-md, 12px);background:var(--ion-card-background, var(--ion-background-color, #fff))}.survey-builder__row-head{display:flex;flex-direction:column;gap:8px}.survey-builder__row-text{display:flex;flex-direction:column;gap:2px;min-width:0}.survey-builder__row-text strong{color:var(--ion-text-color, #000);font-size:.9375rem}.survey-builder__row-text span{color:var(--ion-color-medium, #92949c);font-size:.8125rem}.survey-builder__row-actions{display:flex;gap:4px;flex-wrap:wrap}.survey-builder__row-editor{display:flex;flex-direction:column;gap:12px;padding-top:12px;border-top:1px solid var(--ion-border-color, rgba(0, 0, 0, .1))}.survey-builder__error{margin:0;color:var(--ion-color-danger);font-size:.875rem;font-weight:700}@media (min-width: 576px){.survey-builder__row-head{flex-direction:row;align-items:flex-start;justify-content:space-between}.survey-builder__row-text{flex:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: TextInputComponent, selector: "val-text-input", inputs: ["preset", "props"] }, { kind: "component", type: ButtonComponent, selector: "val-button", inputs: ["preset", "props"], outputs: ["onClick"] }, { kind: "component", type: FormFieldComponent, selector: "val-form-field", inputs: ["label"] }, { kind: "component", type: FieldSchemaEditorComponent, selector: "val-field-schema-editor", inputs: ["props"], outputs: ["save", "changed"] }] }); }
|
|
41134
41259
|
}
|
|
41135
41260
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SurveyBuilderComponent, decorators: [{
|
|
41136
41261
|
type: Component,
|
|
41137
41262
|
args: [{ selector: 'val-survey-builder', standalone: true, imports: [
|
|
41138
41263
|
CommonModule,
|
|
41139
41264
|
ReactiveFormsModule,
|
|
41265
|
+
IonIcon,
|
|
41266
|
+
IonSpinner,
|
|
41140
41267
|
TextInputComponent,
|
|
41141
41268
|
ButtonComponent,
|
|
41142
41269
|
FormFieldComponent,
|
|
@@ -41152,18 +41279,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
41152
41279
|
|
|
41153
41280
|
<div class="survey-builder__presentation">
|
|
41154
41281
|
<span class="survey-builder__questions-label">{{ t('presentationLabel') }}</span>
|
|
41155
|
-
<
|
|
41156
|
-
<val-
|
|
41157
|
-
|
|
41282
|
+
<div class="survey-builder__image-field">
|
|
41283
|
+
<val-form-field [label]="t('headerImageLabel')">
|
|
41284
|
+
<val-text-input [props]="{ control: headerImageControl, placeholder: t('headerImagePlaceholder') }" />
|
|
41285
|
+
</val-form-field>
|
|
41286
|
+
@if (headerImageControl.value) {
|
|
41287
|
+
<div class="survey-builder__image-preview">
|
|
41288
|
+
<img [src]="headerImageControl.value" alt="" />
|
|
41289
|
+
<button
|
|
41290
|
+
type="button"
|
|
41291
|
+
class="survey-builder__image-clear"
|
|
41292
|
+
[attr.aria-label]="t('imageRemove')"
|
|
41293
|
+
(click)="clearPresentationImage('header')"
|
|
41294
|
+
>
|
|
41295
|
+
<ion-icon name="trash-outline" aria-hidden="true" />
|
|
41296
|
+
</button>
|
|
41297
|
+
</div>
|
|
41298
|
+
}
|
|
41299
|
+
@if (props.presentationImageUpload) {
|
|
41300
|
+
<label class="survey-builder__image-upload" [class.survey-builder__image-upload--loading]="uploadingImage() === 'header'">
|
|
41301
|
+
@if (uploadingImage() === 'header') {
|
|
41302
|
+
<ion-spinner name="crescent" />
|
|
41303
|
+
} @else {
|
|
41304
|
+
<ion-icon name="cloud-upload-outline" aria-hidden="true" />
|
|
41305
|
+
}
|
|
41306
|
+
<span>{{ headerImageControl.value ? t('imageChange') : t('imageUpload') }}</span>
|
|
41307
|
+
<input
|
|
41308
|
+
type="file"
|
|
41309
|
+
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
|
41310
|
+
[disabled]="uploadingImage() === 'header'"
|
|
41311
|
+
(change)="onPresentationFileSelected('header', $event)"
|
|
41312
|
+
/>
|
|
41313
|
+
</label>
|
|
41314
|
+
}
|
|
41315
|
+
</div>
|
|
41158
41316
|
<val-form-field [label]="t('successTitleLabel')">
|
|
41159
41317
|
<val-text-input [props]="{ control: successTitleControl, placeholder: t('successTitlePlaceholder') }" />
|
|
41160
41318
|
</val-form-field>
|
|
41161
41319
|
<val-form-field [label]="t('successMessageLabel')">
|
|
41162
41320
|
<val-text-input [props]="{ control: successMessageControl, placeholder: t('successMessagePlaceholder') }" />
|
|
41163
41321
|
</val-form-field>
|
|
41164
|
-
<
|
|
41165
|
-
<val-
|
|
41166
|
-
|
|
41322
|
+
<div class="survey-builder__image-field">
|
|
41323
|
+
<val-form-field [label]="t('successImageLabel')">
|
|
41324
|
+
<val-text-input [props]="{ control: successImageControl, placeholder: t('successImagePlaceholder') }" />
|
|
41325
|
+
</val-form-field>
|
|
41326
|
+
@if (successImageControl.value) {
|
|
41327
|
+
<div class="survey-builder__image-preview">
|
|
41328
|
+
<img [src]="successImageControl.value" alt="" />
|
|
41329
|
+
<button
|
|
41330
|
+
type="button"
|
|
41331
|
+
class="survey-builder__image-clear"
|
|
41332
|
+
[attr.aria-label]="t('imageRemove')"
|
|
41333
|
+
(click)="clearPresentationImage('success')"
|
|
41334
|
+
>
|
|
41335
|
+
<ion-icon name="trash-outline" aria-hidden="true" />
|
|
41336
|
+
</button>
|
|
41337
|
+
</div>
|
|
41338
|
+
}
|
|
41339
|
+
@if (props.presentationImageUpload) {
|
|
41340
|
+
<label class="survey-builder__image-upload" [class.survey-builder__image-upload--loading]="uploadingImage() === 'success'">
|
|
41341
|
+
@if (uploadingImage() === 'success') {
|
|
41342
|
+
<ion-spinner name="crescent" />
|
|
41343
|
+
} @else {
|
|
41344
|
+
<ion-icon name="cloud-upload-outline" aria-hidden="true" />
|
|
41345
|
+
}
|
|
41346
|
+
<span>{{ successImageControl.value ? t('imageChange') : t('imageUpload') }}</span>
|
|
41347
|
+
<input
|
|
41348
|
+
type="file"
|
|
41349
|
+
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
|
41350
|
+
[disabled]="uploadingImage() === 'success'"
|
|
41351
|
+
(change)="onPresentationFileSelected('success', $event)"
|
|
41352
|
+
/>
|
|
41353
|
+
</label>
|
|
41354
|
+
}
|
|
41355
|
+
</div>
|
|
41167
41356
|
</div>
|
|
41168
41357
|
|
|
41169
41358
|
<div class="survey-builder__questions">
|
|
@@ -41265,7 +41454,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
41265
41454
|
(onClick)="save()"
|
|
41266
41455
|
/>
|
|
41267
41456
|
</div>
|
|
41268
|
-
`, styles: [":host{display:block}.survey-builder{display:flex;flex-direction:column;gap:16px}.survey-builder__questions{display:flex;flex-direction:column;gap:12px}.survey-builder__presentation{display:flex;flex-direction:column;gap:12px;padding-top:4px}.survey-builder__questions-label{font-size:.8125rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ion-color-medium, #92949c)}.survey-builder__empty{margin:0;font-size:.875rem;color:var(--ion-color-medium, #92949c)}.survey-builder__row{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid var(--ion-border-color, rgba(0, 0, 0, .1));border-radius:var(--val-radius-md, 12px);background:var(--ion-card-background, var(--ion-background-color, #fff))}.survey-builder__row-head{display:flex;flex-direction:column;gap:8px}.survey-builder__row-text{display:flex;flex-direction:column;gap:2px;min-width:0}.survey-builder__row-text strong{color:var(--ion-text-color, #000);font-size:.9375rem}.survey-builder__row-text span{color:var(--ion-color-medium, #92949c);font-size:.8125rem}.survey-builder__row-actions{display:flex;gap:4px;flex-wrap:wrap}.survey-builder__row-editor{display:flex;flex-direction:column;gap:12px;padding-top:12px;border-top:1px solid var(--ion-border-color, rgba(0, 0, 0, .1))}.survey-builder__error{margin:0;color:var(--ion-color-danger);font-size:.875rem;font-weight:700}@media (min-width: 576px){.survey-builder__row-head{flex-direction:row;align-items:flex-start;justify-content:space-between}.survey-builder__row-text{flex:1}}\n"] }]
|
|
41457
|
+
`, styles: [":host{display:block}.survey-builder{display:flex;flex-direction:column;gap:16px}.survey-builder__questions{display:flex;flex-direction:column;gap:12px}.survey-builder__presentation{display:flex;flex-direction:column;gap:12px;padding-top:4px}.survey-builder__image-field{display:flex;flex-direction:column;gap:10px}.survey-builder__image-preview{position:relative;width:100%}.survey-builder__image-preview img{display:block;width:100%;aspect-ratio:16 / 9;object-fit:contain;border:1px solid var(--ion-border-color, rgba(0, 0, 0, .1));border-radius:8px;background:var(--ion-color-light, #f4f5f8)}.survey-builder__image-clear{position:absolute;top:8px;right:8px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:999px;background:#0009;color:#fff;cursor:pointer}.survey-builder__image-upload{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 18px;border:2px dashed var(--ion-border-color, rgba(0, 0, 0, .16));border-radius:20px;color:var(--ion-color-medium-shade, #6b6675);font-size:.875rem;font-weight:600;cursor:pointer}.survey-builder__image-upload:hover{border-color:var(--ion-color-primary);color:var(--ion-color-primary)}.survey-builder__image-upload--loading{opacity:.7;cursor:default}.survey-builder__image-upload ion-spinner{width:16px;height:16px}.survey-builder__image-upload input{display:none}.survey-builder__questions-label{font-size:.8125rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ion-color-medium, #92949c)}.survey-builder__empty{margin:0;font-size:.875rem;color:var(--ion-color-medium, #92949c)}.survey-builder__row{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid var(--ion-border-color, rgba(0, 0, 0, .1));border-radius:var(--val-radius-md, 12px);background:var(--ion-card-background, var(--ion-background-color, #fff))}.survey-builder__row-head{display:flex;flex-direction:column;gap:8px}.survey-builder__row-text{display:flex;flex-direction:column;gap:2px;min-width:0}.survey-builder__row-text strong{color:var(--ion-text-color, #000);font-size:.9375rem}.survey-builder__row-text span{color:var(--ion-color-medium, #92949c);font-size:.8125rem}.survey-builder__row-actions{display:flex;gap:4px;flex-wrap:wrap}.survey-builder__row-editor{display:flex;flex-direction:column;gap:12px;padding-top:12px;border-top:1px solid var(--ion-border-color, rgba(0, 0, 0, .1))}.survey-builder__error{margin:0;color:var(--ion-color-danger);font-size:.875rem;font-weight:700}@media (min-width: 576px){.survey-builder__row-head{flex-direction:row;align-items:flex-start;justify-content:space-between}.survey-builder__row-text{flex:1}}\n"] }]
|
|
41269
41458
|
}], ctorParameters: () => [], propDecorators: { props: [{
|
|
41270
41459
|
type: Input
|
|
41271
41460
|
}], saved: [{
|