valtech-components 4.0.999 → 4.0.1001
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/field-schema-editor/field-schema-editor.i18n.mjs +3 -1
- package/esm2022/lib/components/organisms/form/form.component.mjs +34 -2
- 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 +2 -1
- package/esm2022/lib/components/types.mjs +3 -1
- package/esm2022/lib/services/forms/form-schema-builder.service.mjs +14 -1
- package/esm2022/lib/services/forms/types.mjs +1 -1
- package/esm2022/lib/shared/utils/form-defaults.mjs +3 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +252 -16
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/article/article.component.d.ts +1 -3
- package/lib/components/organisms/form/form.component.d.ts +3 -0
- 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/components/types.d.ts +15 -1
- package/lib/services/forms/types.d.ts +12 -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.1001';
|
|
74
74
|
|
|
75
75
|
function evaluateValtechAccess(rule, context, features = {}, visitedFeatures = new Set()) {
|
|
76
76
|
if (rule == null)
|
|
@@ -12688,6 +12688,8 @@ var InputType;
|
|
|
12688
12688
|
* apilan en vertical y su objetivo táctil es el círculo, no la etiqueta.
|
|
12689
12689
|
*/
|
|
12690
12690
|
InputType[InputType["CHIP_SELECT"] = 27] = "CHIP_SELECT";
|
|
12691
|
+
/** Selector numérico con controles -/+ (`val-number-picker`). */
|
|
12692
|
+
InputType[InputType["NUMBER_PICKER"] = 28] = "NUMBER_PICKER";
|
|
12691
12693
|
})(InputType || (InputType = {}));
|
|
12692
12694
|
/**
|
|
12693
12695
|
* Possible action types for a toolbar.
|
|
@@ -22480,6 +22482,7 @@ function parseValueByType(value, type) {
|
|
|
22480
22482
|
case InputType.DATE:
|
|
22481
22483
|
return new Date(value).toISOString();
|
|
22482
22484
|
case InputType.NUMBER:
|
|
22485
|
+
case InputType.NUMBER_PICKER:
|
|
22483
22486
|
return parseFloat(value) || 0;
|
|
22484
22487
|
case InputType.CHECK:
|
|
22485
22488
|
return value === 'true' || value === '1';
|
|
@@ -22508,6 +22511,7 @@ function getAutoDefaultValue(type) {
|
|
|
22508
22511
|
case InputType.DATE:
|
|
22509
22512
|
return new Date().toISOString();
|
|
22510
22513
|
case InputType.NUMBER:
|
|
22514
|
+
case InputType.NUMBER_PICKER:
|
|
22511
22515
|
return 0;
|
|
22512
22516
|
case InputType.CHECK:
|
|
22513
22517
|
return false;
|
|
@@ -37586,6 +37590,7 @@ class FormComponent {
|
|
|
37586
37590
|
this.textInputPropMemo = new WeakMap();
|
|
37587
37591
|
this.datePickerPropMemo = new WeakMap();
|
|
37588
37592
|
this.emojiRatingPropMemo = new WeakMap();
|
|
37593
|
+
this.numberPickerPropMemo = new WeakMap();
|
|
37589
37594
|
// Ids estables por field para el wiring de accesibilidad label↔input↔error.
|
|
37590
37595
|
// Estables entre CD cycles (memoizados por referencia de field) → aria-* no parpadea.
|
|
37591
37596
|
this.fieldIdMemo = new WeakMap();
|
|
@@ -37939,6 +37944,29 @@ class FormComponent {
|
|
|
37939
37944
|
this.emojiRatingPropMemo.set(field, result);
|
|
37940
37945
|
return result;
|
|
37941
37946
|
}
|
|
37947
|
+
getNumberPickerProp(field) {
|
|
37948
|
+
const cached = this.numberPickerPropMemo.get(field);
|
|
37949
|
+
if (cached)
|
|
37950
|
+
return cached;
|
|
37951
|
+
const control = this.getControl(field.name);
|
|
37952
|
+
const result = {
|
|
37953
|
+
control,
|
|
37954
|
+
token: field.token,
|
|
37955
|
+
label: '',
|
|
37956
|
+
hint: field.hint,
|
|
37957
|
+
min: field.range?.min,
|
|
37958
|
+
max: field.range?.max,
|
|
37959
|
+
step: field.step,
|
|
37960
|
+
unitLabel: field.unitLabel,
|
|
37961
|
+
variant: field.numberPickerVariant,
|
|
37962
|
+
editable: field.numberPickerEditable,
|
|
37963
|
+
inputMode: field.numberPickerInputMode,
|
|
37964
|
+
precision: field.precision,
|
|
37965
|
+
state: field.state,
|
|
37966
|
+
};
|
|
37967
|
+
this.numberPickerPropMemo.set(field, result);
|
|
37968
|
+
return result;
|
|
37969
|
+
}
|
|
37942
37970
|
setBooleanValue(fieldName, value) {
|
|
37943
37971
|
const control = this.getControl(fieldName);
|
|
37944
37972
|
if (control.disabled)
|
|
@@ -38165,6 +38193,9 @@ class FormComponent {
|
|
|
38165
38193
|
@case (types.NUMBER) {
|
|
38166
38194
|
<val-text-input [props]="getTextInputProp(f, 'number')"></val-text-input>
|
|
38167
38195
|
}
|
|
38196
|
+
@case (types.NUMBER_PICKER) {
|
|
38197
|
+
<val-number-picker [props]="getNumberPickerProp(f)"></val-number-picker>
|
|
38198
|
+
}
|
|
38168
38199
|
@case (types.NUMBER_FROM_TO) {
|
|
38169
38200
|
<val-number-from-to [props]="getFieldProp(f)"></val-number-from-to>
|
|
38170
38201
|
}
|
|
@@ -38271,7 +38302,7 @@ class FormComponent {
|
|
|
38271
38302
|
}
|
|
38272
38303
|
</form>
|
|
38273
38304
|
</div>
|
|
38274
|
-
`, isInline: true, styles: ["@charset \"UTF-8\";:root{--val-container-sm: 540px;--val-container-md: 720px;--val-container-lg: 880px;--val-container-xl: 1100px;--val-container-xl-wide: 1280px;--val-container-md-wide: 900px;--val-container-aside: 0px;--val-container-padding: 16px;--val-radius-xs: 10px;--val-radius-sm: 16px;--val-radius-md: 20px;--val-radius-lg: 28px;--val-radius-xl: 36px;--val-radius-full: 999px;--ion-color-primary: #7026df;--ion-color-primary-rgb: 112, 38, 223;--ion-color-primary-contrast: #ffffff;--ion-color-primary-contrast-rgb: 255, 255, 255;--ion-color-primary-shade: #6321c4;--ion-color-primary-tint: #7e3ce2;--ion-color-secondary: #e2ccff;--ion-color-secondary-rgb: 226, 204, 255;--ion-color-secondary-contrast: #000000;--ion-color-secondary-contrast-rgb: 0, 0, 0;--ion-color-secondary-shade: #c7b4e0;--ion-color-secondary-tint: #e5d1ff;--ion-color-texti: #354c69;--ion-color-texti-rgb: 53, 76, 105;--ion-color-texti-contrast: #ffffff;--ion-color-texti-contrast-rgb: 255, 255, 255;--ion-color-texti-shade: #2f435c;--ion-color-texti-tint: #495e78;--ion-color-darki: #090f1b;--ion-color-darki-rgb: 9, 15, 27;--ion-color-darki-contrast: #ffffff;--ion-color-darki-contrast-rgb: 255, 255, 255;--ion-color-darki-shade: #080d18;--ion-color-darki-tint: #222732;--ion-color-medium: #9e9e9e;--ion-color-medium-rgb: 158, 158, 158;--ion-color-medium-contrast: #000000;--ion-color-medium-contrast-rgb: 0, 0, 0;--ion-color-medium-shade: #8b8b8b;--ion-color-medium-tint: #a8a8a8;--ion-color-warning: #ffde38;--ion-color-warning-rgb: 255, 222, 56;--ion-color-warning-contrast: #000000;--ion-color-warning-contrast-rgb: 0, 0, 0;--ion-color-warning-shade: #e0c331;--ion-color-warning-tint: #ffe14c;--swiper-pagination-color: var(--ion-color-primary);--swiper-navigation-color: var(--ion-color-primary);--swiper-pagination-bullet-inactive-color: var(--ion-color-dark)}body.dark,html.ion-palette-dark,body[data-theme=dark]{--ion-color-texti: #8fc1ff;--ion-color-texti-rgb: 143, 193, 255;--ion-color-texti-contrast: #000000;--ion-color-texti-contrast-rgb: 0, 0, 0;--ion-color-texti-shade: #7eaae0;--ion-color-texti-tint: #9ac7ff;--ion-color-darki: #ffffff;--ion-color-darki-rgb: 255, 255, 255;--ion-color-darki-contrast: #000000;--ion-color-darki-contrast-rgb: 0, 0, 0;--ion-color-darki-shade: #e0e0e0;--ion-color-darki-tint: #ffffff;--ion-color-primary: #8f49f8;--ion-color-primary-rgb: 143, 73, 248;--ion-color-primary-contrast: #ffffff;--ion-color-primary-contrast-rgb: 255, 255, 255;--ion-color-primary-shade: #7e40da;--ion-color-primary-tint: #9a5bf9}.ion-color-texti{--ion-color-base: var(--ion-color-texti);--ion-color-base-rgb: var(--ion-color-texti-rgb);--ion-color-contrast: var(--ion-color-texti-contrast);--ion-color-contrast-rgb: var(--ion-color-texti-contrast-rgb);--ion-color-shade: var(--ion-color-texti-shade);--ion-color-tint: var(--ion-color-texti-tint)}.ion-color-darki{--ion-color-base: var(--ion-color-darki);--ion-color-base-rgb: var(--ion-color-darki-rgb);--ion-color-contrast: var(--ion-color-darki-contrast);--ion-color-contrast-rgb: var(--ion-color-darki-contrast-rgb);--ion-color-shade: var(--ion-color-darki-shade);--ion-color-tint: var(--ion-color-darki-tint)}.container--sticky-footer{--val-form-sticky-footer-space: 7rem;padding-bottom:calc(var(--val-form-sticky-footer-space) + env(safe-area-inset-bottom))}.section{margin-top:1rem}.input{margin:var(--val-form-field-gap, .5rem) 0}@media (min-width: 768px){.input{margin:var(--val-form-field-gap, .75rem) 0}}.submit-actions{display:block;width:100%;box-sizing:border-box}.submit-actions--sticky{position:sticky;bottom:0;z-index:20;width:calc(100% + var(--val-form-sticky-footer-bleed, 0px) * 2);margin-inline:calc(var(--val-form-sticky-footer-bleed, 0px) * -1);background:var(--ion-card-background, var(--ion-background-color, #ffffff));border-top:1px solid var(--ion-color-step-150, rgba(0, 0, 0, .08));box-shadow:0 -.25rem 1rem rgba(var(--ion-text-color-rgb, 0, 0, 0),.08);padding:.75rem var(--val-form-sticky-footer-inline-padding, var(--val-form-sticky-footer-bleed, 0px)) max(.75rem,env(safe-area-inset-bottom));isolation:isolate;transform:translateZ(0)}.field-description{display:block;font-size:.75rem;color:var(--ion-color-dark);margin-bottom:.25rem;line-height:1.4}.email-suggestion{margin:6px 0 0;font-size:.875rem;color:var(--ion-text-color, #000)}.email-suggestion__apply{padding:0;margin-left:4px;background:none;border:none;font:inherit;font-weight:700;color:var(--ion-color-primary);text-decoration:underline;cursor:pointer}.boolean-answer{display:inline-flex;width:fit-content;gap:.25rem;padding:.25rem;border:1px solid var(--ion-color-light-shade, #d7d8da);border-radius:999px;background:var(--ion-color-light, #f4f5f8)}.boolean-answer__option{min-width:3.5rem;min-height:2.25rem;border:0;border-radius:999px;background:transparent;color:var(--ion-color-medium);font:inherit;font-weight:700;cursor:pointer}.boolean-answer__option--active{background:var(--ion-color-primary);color:var(--ion-color-primary-contrast, #fff);box-shadow:0 .0625rem .25rem rgba(var(--ion-color-dark-rgb, 34, 36, 40),.16)}.boolean-answer__option:focus-visible:focus{outline:none}.boolean-answer__option:focus-visible:focus-visible{outline:.125rem solid var(--ion-color-primary, #7026df);outline-offset:2px;border-radius:inherit}.simple-multi{display:flex;flex-direction:column;gap:.5rem}.simple-multi__option{display:flex;align-items:center;gap:.625rem;width:fit-content;color:var(--ion-text-color);cursor:pointer}.simple-multi__option input{inline-size:1.125rem;block-size:1.125rem;accent-color:var(--ion-color-primary)}.simple-multi__option input:focus-visible:focus{outline:none}.simple-multi__option input:focus-visible:focus-visible{outline:.125rem solid var(--ion-color-primary, #7026df);outline-offset:2px;border-radius:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DisplayComponent, selector: "val-display", inputs: ["props"] }, { kind: "component", type: TitleComponent, selector: "val-title", inputs: ["props"] }, { kind: "component", type: EmojiRatingComponent, selector: "val-emoji-rating", inputs: ["props"] }, { kind: "component", type: TextInputComponent, selector: "val-text-input", inputs: ["preset", "props"] }, { kind: "component", type: TextareaInputComponent, selector: "val-textarea-input", inputs: ["preset", "props"] }, { kind: "component", type: CheckInputComponent, selector: "val-check-input", inputs: ["preset", "props"] }, { kind: "component", type: ButtonGroupComponent, selector: "val-button-group", inputs: ["props"], outputs: ["onClick"] }, { kind: "component", type: DividerComponent, selector: "val-divider", inputs: ["props"] }, { kind: "component", type: HintComponent, selector: "val-hint", inputs: ["props", "id", "isError"] }, { kind: "component", type: CommentInputComponent, selector: "val-comment-input", inputs: ["props"] }, { kind: "component", type: DateInputComponent, selector: "val-date-input", inputs: ["preset", "props"] }, { kind: "component", type: FileInputComponent, selector: "val-file-input", inputs: ["props"] }, { kind: "component", type: NumberFromToComponent, selector: "val-number-from-to", inputs: ["props"] }, { kind: "component", type: RadioInputComponent, selector: "val-radio-input", inputs: ["props"] }, { kind: "component", type: PasswordInputComponent, selector: "val-password-input", inputs: ["preset", "props"] }, { kind: "component", type: PinInputComponent, selector: "val-pin-input", inputs: ["props"] }, { kind: "component", type: SelectSearchComponent, selector: "val-select-search", inputs: ["label", "labelProperty", "valueProperty", "multiple", "placeholder", "props"] }, { kind: "component", type: MultiSelectSearchComponent, selector: "val-multi-select-search", inputs: ["label", "labelProperty", "valueProperty", "placeholder", "props"] }, { kind: "component", type: SearchSelectorComponent, selector: "val-select-input", inputs: ["preset", "props"] }, { kind: "component", type: PhoneInputComponent, selector: "val-phone-input", inputs: ["preset", "props"], outputs: ["phoneChange"] }, { kind: "component", type: CheckboxRadioInputComponent, selector: "val-checkbox-radio-input", inputs: ["props"] }, { kind: "component", type: ChipSelectComponent, selector: "val-chip-select", inputs: ["props"] }, { kind: "component", type: UsernameInputComponent, selector: "val-username-input", inputs: ["props"] }, { kind: "component", type: AttachmentUploaderComponent, selector: "val-attachment-uploader", inputs: ["props"], outputs: ["attachmentsChange"] }, { kind: "component", type: DatePickerComponent, selector: "val-date-picker", inputs: ["props"], outputs: ["valueChange"] }] }); }
|
|
38305
|
+
`, isInline: true, styles: ["@charset \"UTF-8\";:root{--val-container-sm: 540px;--val-container-md: 720px;--val-container-lg: 880px;--val-container-xl: 1100px;--val-container-xl-wide: 1280px;--val-container-md-wide: 900px;--val-container-aside: 0px;--val-container-padding: 16px;--val-radius-xs: 10px;--val-radius-sm: 16px;--val-radius-md: 20px;--val-radius-lg: 28px;--val-radius-xl: 36px;--val-radius-full: 999px;--ion-color-primary: #7026df;--ion-color-primary-rgb: 112, 38, 223;--ion-color-primary-contrast: #ffffff;--ion-color-primary-contrast-rgb: 255, 255, 255;--ion-color-primary-shade: #6321c4;--ion-color-primary-tint: #7e3ce2;--ion-color-secondary: #e2ccff;--ion-color-secondary-rgb: 226, 204, 255;--ion-color-secondary-contrast: #000000;--ion-color-secondary-contrast-rgb: 0, 0, 0;--ion-color-secondary-shade: #c7b4e0;--ion-color-secondary-tint: #e5d1ff;--ion-color-texti: #354c69;--ion-color-texti-rgb: 53, 76, 105;--ion-color-texti-contrast: #ffffff;--ion-color-texti-contrast-rgb: 255, 255, 255;--ion-color-texti-shade: #2f435c;--ion-color-texti-tint: #495e78;--ion-color-darki: #090f1b;--ion-color-darki-rgb: 9, 15, 27;--ion-color-darki-contrast: #ffffff;--ion-color-darki-contrast-rgb: 255, 255, 255;--ion-color-darki-shade: #080d18;--ion-color-darki-tint: #222732;--ion-color-medium: #9e9e9e;--ion-color-medium-rgb: 158, 158, 158;--ion-color-medium-contrast: #000000;--ion-color-medium-contrast-rgb: 0, 0, 0;--ion-color-medium-shade: #8b8b8b;--ion-color-medium-tint: #a8a8a8;--ion-color-warning: #ffde38;--ion-color-warning-rgb: 255, 222, 56;--ion-color-warning-contrast: #000000;--ion-color-warning-contrast-rgb: 0, 0, 0;--ion-color-warning-shade: #e0c331;--ion-color-warning-tint: #ffe14c;--swiper-pagination-color: var(--ion-color-primary);--swiper-navigation-color: var(--ion-color-primary);--swiper-pagination-bullet-inactive-color: var(--ion-color-dark)}body.dark,html.ion-palette-dark,body[data-theme=dark]{--ion-color-texti: #8fc1ff;--ion-color-texti-rgb: 143, 193, 255;--ion-color-texti-contrast: #000000;--ion-color-texti-contrast-rgb: 0, 0, 0;--ion-color-texti-shade: #7eaae0;--ion-color-texti-tint: #9ac7ff;--ion-color-darki: #ffffff;--ion-color-darki-rgb: 255, 255, 255;--ion-color-darki-contrast: #000000;--ion-color-darki-contrast-rgb: 0, 0, 0;--ion-color-darki-shade: #e0e0e0;--ion-color-darki-tint: #ffffff;--ion-color-primary: #8f49f8;--ion-color-primary-rgb: 143, 73, 248;--ion-color-primary-contrast: #ffffff;--ion-color-primary-contrast-rgb: 255, 255, 255;--ion-color-primary-shade: #7e40da;--ion-color-primary-tint: #9a5bf9}.ion-color-texti{--ion-color-base: var(--ion-color-texti);--ion-color-base-rgb: var(--ion-color-texti-rgb);--ion-color-contrast: var(--ion-color-texti-contrast);--ion-color-contrast-rgb: var(--ion-color-texti-contrast-rgb);--ion-color-shade: var(--ion-color-texti-shade);--ion-color-tint: var(--ion-color-texti-tint)}.ion-color-darki{--ion-color-base: var(--ion-color-darki);--ion-color-base-rgb: var(--ion-color-darki-rgb);--ion-color-contrast: var(--ion-color-darki-contrast);--ion-color-contrast-rgb: var(--ion-color-darki-contrast-rgb);--ion-color-shade: var(--ion-color-darki-shade);--ion-color-tint: var(--ion-color-darki-tint)}.container--sticky-footer{--val-form-sticky-footer-space: 7rem;padding-bottom:calc(var(--val-form-sticky-footer-space) + env(safe-area-inset-bottom))}.section{margin-top:1rem}.input{margin:var(--val-form-field-gap, .5rem) 0}@media (min-width: 768px){.input{margin:var(--val-form-field-gap, .75rem) 0}}.submit-actions{display:block;width:100%;box-sizing:border-box}.submit-actions--sticky{position:sticky;bottom:0;z-index:20;width:calc(100% + var(--val-form-sticky-footer-bleed, 0px) * 2);margin-inline:calc(var(--val-form-sticky-footer-bleed, 0px) * -1);background:var(--ion-card-background, var(--ion-background-color, #ffffff));border-top:1px solid var(--ion-color-step-150, rgba(0, 0, 0, .08));box-shadow:0 -.25rem 1rem rgba(var(--ion-text-color-rgb, 0, 0, 0),.08);padding:.75rem var(--val-form-sticky-footer-inline-padding, var(--val-form-sticky-footer-bleed, 0px)) max(.75rem,env(safe-area-inset-bottom));isolation:isolate;transform:translateZ(0)}.field-description{display:block;font-size:.75rem;color:var(--ion-color-dark);margin-bottom:.25rem;line-height:1.4}.email-suggestion{margin:6px 0 0;font-size:.875rem;color:var(--ion-text-color, #000)}.email-suggestion__apply{padding:0;margin-left:4px;background:none;border:none;font:inherit;font-weight:700;color:var(--ion-color-primary);text-decoration:underline;cursor:pointer}.boolean-answer{display:inline-flex;width:fit-content;gap:.25rem;padding:.25rem;border:1px solid var(--ion-color-light-shade, #d7d8da);border-radius:999px;background:var(--ion-color-light, #f4f5f8)}.boolean-answer__option{min-width:3.5rem;min-height:2.25rem;border:0;border-radius:999px;background:transparent;color:var(--ion-color-medium);font:inherit;font-weight:700;cursor:pointer}.boolean-answer__option--active{background:var(--ion-color-primary);color:var(--ion-color-primary-contrast, #fff);box-shadow:0 .0625rem .25rem rgba(var(--ion-color-dark-rgb, 34, 36, 40),.16)}.boolean-answer__option:focus-visible:focus{outline:none}.boolean-answer__option:focus-visible:focus-visible{outline:.125rem solid var(--ion-color-primary, #7026df);outline-offset:2px;border-radius:inherit}.simple-multi{display:flex;flex-direction:column;gap:.5rem}.simple-multi__option{display:flex;align-items:center;gap:.625rem;width:fit-content;color:var(--ion-text-color);cursor:pointer}.simple-multi__option input{inline-size:1.125rem;block-size:1.125rem;accent-color:var(--ion-color-primary)}.simple-multi__option input:focus-visible:focus{outline:none}.simple-multi__option input:focus-visible:focus-visible{outline:.125rem solid var(--ion-color-primary, #7026df);outline-offset:2px;border-radius:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DisplayComponent, selector: "val-display", inputs: ["props"] }, { kind: "component", type: TitleComponent, selector: "val-title", inputs: ["props"] }, { kind: "component", type: EmojiRatingComponent, selector: "val-emoji-rating", inputs: ["props"] }, { kind: "component", type: TextInputComponent, selector: "val-text-input", inputs: ["preset", "props"] }, { kind: "component", type: TextareaInputComponent, selector: "val-textarea-input", inputs: ["preset", "props"] }, { kind: "component", type: CheckInputComponent, selector: "val-check-input", inputs: ["preset", "props"] }, { kind: "component", type: ButtonGroupComponent, selector: "val-button-group", inputs: ["props"], outputs: ["onClick"] }, { kind: "component", type: DividerComponent, selector: "val-divider", inputs: ["props"] }, { kind: "component", type: HintComponent, selector: "val-hint", inputs: ["props", "id", "isError"] }, { kind: "component", type: CommentInputComponent, selector: "val-comment-input", inputs: ["props"] }, { kind: "component", type: DateInputComponent, selector: "val-date-input", inputs: ["preset", "props"] }, { kind: "component", type: FileInputComponent, selector: "val-file-input", inputs: ["props"] }, { kind: "component", type: NumberFromToComponent, selector: "val-number-from-to", inputs: ["props"] }, { kind: "component", type: NumberPickerComponent, selector: "val-number-picker", inputs: ["props"], outputs: ["valueChange"] }, { kind: "component", type: RadioInputComponent, selector: "val-radio-input", inputs: ["props"] }, { kind: "component", type: PasswordInputComponent, selector: "val-password-input", inputs: ["preset", "props"] }, { kind: "component", type: PinInputComponent, selector: "val-pin-input", inputs: ["props"] }, { kind: "component", type: SelectSearchComponent, selector: "val-select-search", inputs: ["label", "labelProperty", "valueProperty", "multiple", "placeholder", "props"] }, { kind: "component", type: MultiSelectSearchComponent, selector: "val-multi-select-search", inputs: ["label", "labelProperty", "valueProperty", "placeholder", "props"] }, { kind: "component", type: SearchSelectorComponent, selector: "val-select-input", inputs: ["preset", "props"] }, { kind: "component", type: PhoneInputComponent, selector: "val-phone-input", inputs: ["preset", "props"], outputs: ["phoneChange"] }, { kind: "component", type: CheckboxRadioInputComponent, selector: "val-checkbox-radio-input", inputs: ["props"] }, { kind: "component", type: ChipSelectComponent, selector: "val-chip-select", inputs: ["props"] }, { kind: "component", type: UsernameInputComponent, selector: "val-username-input", inputs: ["props"] }, { kind: "component", type: AttachmentUploaderComponent, selector: "val-attachment-uploader", inputs: ["props"], outputs: ["attachmentsChange"] }, { kind: "component", type: DatePickerComponent, selector: "val-date-picker", inputs: ["props"], outputs: ["valueChange"] }] }); }
|
|
38275
38306
|
}
|
|
38276
38307
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormComponent, decorators: [{
|
|
38277
38308
|
type: Component,
|
|
@@ -38291,6 +38322,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
38291
38322
|
DateInputComponent,
|
|
38292
38323
|
FileInputComponent,
|
|
38293
38324
|
NumberFromToComponent,
|
|
38325
|
+
NumberPickerComponent,
|
|
38294
38326
|
RadioInputComponent,
|
|
38295
38327
|
PasswordInputComponent,
|
|
38296
38328
|
PinInputComponent,
|
|
@@ -38377,6 +38409,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
38377
38409
|
@case (types.NUMBER) {
|
|
38378
38410
|
<val-text-input [props]="getTextInputProp(f, 'number')"></val-text-input>
|
|
38379
38411
|
}
|
|
38412
|
+
@case (types.NUMBER_PICKER) {
|
|
38413
|
+
<val-number-picker [props]="getNumberPickerProp(f)"></val-number-picker>
|
|
38414
|
+
}
|
|
38380
38415
|
@case (types.NUMBER_FROM_TO) {
|
|
38381
38416
|
<val-number-from-to [props]="getFieldProp(f)"></val-number-from-to>
|
|
38382
38417
|
}
|
|
@@ -39132,6 +39167,12 @@ class FormSchemaBuilderService {
|
|
|
39132
39167
|
order: def.order,
|
|
39133
39168
|
validators,
|
|
39134
39169
|
options,
|
|
39170
|
+
step: def.step,
|
|
39171
|
+
unitLabel: def.unitLabel,
|
|
39172
|
+
numberPickerVariant: def.numberPickerVariant,
|
|
39173
|
+
numberPickerEditable: def.numberPickerEditable,
|
|
39174
|
+
numberPickerInputMode: def.numberPickerInputMode,
|
|
39175
|
+
precision: def.precision,
|
|
39135
39176
|
errors,
|
|
39136
39177
|
value: def.value,
|
|
39137
39178
|
state,
|
|
@@ -39154,6 +39195,12 @@ class FormSchemaBuilderService {
|
|
|
39154
39195
|
required: !!field.required,
|
|
39155
39196
|
validators,
|
|
39156
39197
|
options: this.normalizeOptions(field.options),
|
|
39198
|
+
step: field.step,
|
|
39199
|
+
unitLabel: field.unitLabel,
|
|
39200
|
+
numberPickerVariant: field.numberPickerVariant,
|
|
39201
|
+
numberPickerEditable: field.numberPickerEditable,
|
|
39202
|
+
numberPickerInputMode: field.numberPickerInputMode,
|
|
39203
|
+
precision: field.precision,
|
|
39157
39204
|
order,
|
|
39158
39205
|
};
|
|
39159
39206
|
}
|
|
@@ -39256,6 +39303,7 @@ class FormSchemaBuilderService {
|
|
|
39256
39303
|
TEXTAREA: InputType.TEXTAREA,
|
|
39257
39304
|
EMAIL: InputType.EMAIL,
|
|
39258
39305
|
NUMBER: InputType.NUMBER,
|
|
39306
|
+
NUMBER_PICKER: InputType.NUMBER_PICKER,
|
|
39259
39307
|
DATE: InputType.DATE,
|
|
39260
39308
|
SELECT: InputType.SELECT,
|
|
39261
39309
|
MULTI_SELECT: InputType.MULTI_SELECT,
|
|
@@ -39840,6 +39888,7 @@ const FIELD_SCHEMA_EDITOR_I18N = {
|
|
|
39840
39888
|
typeEMAIL: 'Correo',
|
|
39841
39889
|
typePHONE: 'Teléfono',
|
|
39842
39890
|
typeNUMBER: 'Número',
|
|
39891
|
+
typeNUMBER_PICKER: 'Número con botones',
|
|
39843
39892
|
typeDATE: 'Fecha',
|
|
39844
39893
|
typeSELECT: 'Lista desplegable',
|
|
39845
39894
|
typeRADIO: 'Una sola opción',
|
|
@@ -39874,6 +39923,7 @@ const FIELD_SCHEMA_EDITOR_I18N = {
|
|
|
39874
39923
|
typeEMAIL: 'Email',
|
|
39875
39924
|
typePHONE: 'Phone',
|
|
39876
39925
|
typeNUMBER: 'Number',
|
|
39926
|
+
typeNUMBER_PICKER: 'Number with buttons',
|
|
39877
39927
|
typeDATE: 'Date',
|
|
39878
39928
|
typeSELECT: 'Dropdown',
|
|
39879
39929
|
typeRADIO: 'Single choice',
|
|
@@ -40650,6 +40700,7 @@ const SURVEY_QUESTION_TYPES = [
|
|
|
40650
40700
|
'TEXT',
|
|
40651
40701
|
'TEXTAREA',
|
|
40652
40702
|
'NUMBER',
|
|
40703
|
+
'NUMBER_PICKER',
|
|
40653
40704
|
'DATE',
|
|
40654
40705
|
'EMAIL',
|
|
40655
40706
|
'PHONE',
|
|
@@ -40664,6 +40715,12 @@ const SURVEY_BUILDER_I18N = {
|
|
|
40664
40715
|
presentationLabel: 'Presentación',
|
|
40665
40716
|
headerImageLabel: 'Imagen inicial',
|
|
40666
40717
|
headerImagePlaceholder: 'URL de la imagen que abre la encuesta',
|
|
40718
|
+
imageUpload: 'Subir imagen',
|
|
40719
|
+
imageChange: 'Cambiar imagen',
|
|
40720
|
+
imageRemove: 'Quitar imagen',
|
|
40721
|
+
imageTypeError: 'Usa una imagen JPG, PNG, WEBP o GIF.',
|
|
40722
|
+
imageSizeError: 'La imagen no puede pesar más de 10 MB.',
|
|
40723
|
+
imageUploadError: 'No pudimos subir la imagen. Intenta nuevamente.',
|
|
40667
40724
|
successTitleLabel: 'Título de agradecimiento',
|
|
40668
40725
|
successTitlePlaceholder: 'Ej: Gracias por responder',
|
|
40669
40726
|
successMessageLabel: 'Mensaje de agradecimiento',
|
|
@@ -40697,6 +40754,12 @@ const SURVEY_BUILDER_I18N = {
|
|
|
40697
40754
|
presentationLabel: 'Presentation',
|
|
40698
40755
|
headerImageLabel: 'Opening image',
|
|
40699
40756
|
headerImagePlaceholder: 'Image URL shown at the start of the survey',
|
|
40757
|
+
imageUpload: 'Upload image',
|
|
40758
|
+
imageChange: 'Change image',
|
|
40759
|
+
imageRemove: 'Remove image',
|
|
40760
|
+
imageTypeError: 'Use a JPG, PNG, WEBP or GIF image.',
|
|
40761
|
+
imageSizeError: 'The image must be 10 MB or less.',
|
|
40762
|
+
imageUploadError: "We couldn't upload the image. Try again.",
|
|
40700
40763
|
successTitleLabel: 'Thank-you title',
|
|
40701
40764
|
successTitlePlaceholder: 'E.g: Thanks for answering',
|
|
40702
40765
|
successMessageLabel: 'Thank-you message',
|
|
@@ -40770,6 +40833,9 @@ class SurveyBuilderComponent {
|
|
|
40770
40833
|
this.editingId = signal('');
|
|
40771
40834
|
this.validationError = signal('');
|
|
40772
40835
|
this.saving = signal(false);
|
|
40836
|
+
this.uploadingImage = signal('');
|
|
40837
|
+
this.allowedImageTypes = ['image/jpeg', 'image/png', 'image/webp', 'image/gif'];
|
|
40838
|
+
this.maxImageBytes = 10 * 1024 * 1024;
|
|
40773
40839
|
if (!this.i18n.hasNamespace(NAMESPACE$1)) {
|
|
40774
40840
|
this.i18n.registerDefaults(NAMESPACE$1, SURVEY_BUILDER_I18N);
|
|
40775
40841
|
}
|
|
@@ -40779,6 +40845,7 @@ class SurveyBuilderComponent {
|
|
|
40779
40845
|
if (!this.i18n.hasNamespace(EDITOR_NAMESPACE)) {
|
|
40780
40846
|
this.i18n.registerDefaults(EDITOR_NAMESPACE, FIELD_SCHEMA_EDITOR_I18N);
|
|
40781
40847
|
}
|
|
40848
|
+
addIcons({ cloudUploadOutline, trashOutline });
|
|
40782
40849
|
}
|
|
40783
40850
|
async ngOnInit() {
|
|
40784
40851
|
// Sembrado directo: la app ya tenía la encuesta, no hace falta leerla.
|
|
@@ -40899,6 +40966,49 @@ class SurveyBuilderComponent {
|
|
|
40899
40966
|
this.editingId.set('');
|
|
40900
40967
|
this.validationError.set('');
|
|
40901
40968
|
}
|
|
40969
|
+
async onPresentationFileSelected(slot, event) {
|
|
40970
|
+
const input = event.target;
|
|
40971
|
+
const file = input.files?.[0];
|
|
40972
|
+
input.value = '';
|
|
40973
|
+
if (!file || !this.props.presentationImageUpload || this.uploadingImage())
|
|
40974
|
+
return;
|
|
40975
|
+
if (file.type && !this.allowedImageTypes.includes(file.type)) {
|
|
40976
|
+
this.validationError.set(this.t('imageTypeError'));
|
|
40977
|
+
return;
|
|
40978
|
+
}
|
|
40979
|
+
if (file.size > this.maxImageBytes) {
|
|
40980
|
+
this.validationError.set(this.t('imageSizeError'));
|
|
40981
|
+
return;
|
|
40982
|
+
}
|
|
40983
|
+
this.uploadingImage.set(slot);
|
|
40984
|
+
this.validationError.set('');
|
|
40985
|
+
try {
|
|
40986
|
+
const url = await this.props.presentationImageUpload(slot, file);
|
|
40987
|
+
if (slot === 'header') {
|
|
40988
|
+
this.headerImageControl.setValue(url);
|
|
40989
|
+
}
|
|
40990
|
+
else {
|
|
40991
|
+
this.successImageControl.setValue(url);
|
|
40992
|
+
}
|
|
40993
|
+
}
|
|
40994
|
+
catch (err) {
|
|
40995
|
+
this.errors.handle(err, {
|
|
40996
|
+
context: `surveyBuilder.presentationImageUpload slot=${slot}`,
|
|
40997
|
+
fallbackKey: 'imageUploadError',
|
|
40998
|
+
i18nNamespace: NAMESPACE$1,
|
|
40999
|
+
});
|
|
41000
|
+
}
|
|
41001
|
+
finally {
|
|
41002
|
+
this.uploadingImage.set('');
|
|
41003
|
+
}
|
|
41004
|
+
}
|
|
41005
|
+
clearPresentationImage(slot) {
|
|
41006
|
+
if (slot === 'header') {
|
|
41007
|
+
this.headerImageControl.setValue('');
|
|
41008
|
+
return;
|
|
41009
|
+
}
|
|
41010
|
+
this.successImageControl.setValue('');
|
|
41011
|
+
}
|
|
40902
41012
|
async save() {
|
|
40903
41013
|
if (this.saving())
|
|
40904
41014
|
return;
|
|
@@ -41021,18 +41131,80 @@ class SurveyBuilderComponent {
|
|
|
41021
41131
|
|
|
41022
41132
|
<div class="survey-builder__presentation">
|
|
41023
41133
|
<span class="survey-builder__questions-label">{{ t('presentationLabel') }}</span>
|
|
41024
|
-
<
|
|
41025
|
-
<val-
|
|
41026
|
-
|
|
41134
|
+
<div class="survey-builder__image-field">
|
|
41135
|
+
<val-form-field [label]="t('headerImageLabel')">
|
|
41136
|
+
<val-text-input [props]="{ control: headerImageControl, placeholder: t('headerImagePlaceholder') }" />
|
|
41137
|
+
</val-form-field>
|
|
41138
|
+
@if (headerImageControl.value) {
|
|
41139
|
+
<div class="survey-builder__image-preview">
|
|
41140
|
+
<img [src]="headerImageControl.value" alt="" />
|
|
41141
|
+
<button
|
|
41142
|
+
type="button"
|
|
41143
|
+
class="survey-builder__image-clear"
|
|
41144
|
+
[attr.aria-label]="t('imageRemove')"
|
|
41145
|
+
(click)="clearPresentationImage('header')"
|
|
41146
|
+
>
|
|
41147
|
+
<ion-icon name="trash-outline" aria-hidden="true" />
|
|
41148
|
+
</button>
|
|
41149
|
+
</div>
|
|
41150
|
+
}
|
|
41151
|
+
@if (props.presentationImageUpload) {
|
|
41152
|
+
<label class="survey-builder__image-upload" [class.survey-builder__image-upload--loading]="uploadingImage() === 'header'">
|
|
41153
|
+
@if (uploadingImage() === 'header') {
|
|
41154
|
+
<ion-spinner name="crescent" />
|
|
41155
|
+
} @else {
|
|
41156
|
+
<ion-icon name="cloud-upload-outline" aria-hidden="true" />
|
|
41157
|
+
}
|
|
41158
|
+
<span>{{ headerImageControl.value ? t('imageChange') : t('imageUpload') }}</span>
|
|
41159
|
+
<input
|
|
41160
|
+
type="file"
|
|
41161
|
+
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
|
41162
|
+
[disabled]="uploadingImage() === 'header'"
|
|
41163
|
+
(change)="onPresentationFileSelected('header', $event)"
|
|
41164
|
+
/>
|
|
41165
|
+
</label>
|
|
41166
|
+
}
|
|
41167
|
+
</div>
|
|
41027
41168
|
<val-form-field [label]="t('successTitleLabel')">
|
|
41028
41169
|
<val-text-input [props]="{ control: successTitleControl, placeholder: t('successTitlePlaceholder') }" />
|
|
41029
41170
|
</val-form-field>
|
|
41030
41171
|
<val-form-field [label]="t('successMessageLabel')">
|
|
41031
41172
|
<val-text-input [props]="{ control: successMessageControl, placeholder: t('successMessagePlaceholder') }" />
|
|
41032
41173
|
</val-form-field>
|
|
41033
|
-
<
|
|
41034
|
-
<val-
|
|
41035
|
-
|
|
41174
|
+
<div class="survey-builder__image-field">
|
|
41175
|
+
<val-form-field [label]="t('successImageLabel')">
|
|
41176
|
+
<val-text-input [props]="{ control: successImageControl, placeholder: t('successImagePlaceholder') }" />
|
|
41177
|
+
</val-form-field>
|
|
41178
|
+
@if (successImageControl.value) {
|
|
41179
|
+
<div class="survey-builder__image-preview">
|
|
41180
|
+
<img [src]="successImageControl.value" alt="" />
|
|
41181
|
+
<button
|
|
41182
|
+
type="button"
|
|
41183
|
+
class="survey-builder__image-clear"
|
|
41184
|
+
[attr.aria-label]="t('imageRemove')"
|
|
41185
|
+
(click)="clearPresentationImage('success')"
|
|
41186
|
+
>
|
|
41187
|
+
<ion-icon name="trash-outline" aria-hidden="true" />
|
|
41188
|
+
</button>
|
|
41189
|
+
</div>
|
|
41190
|
+
}
|
|
41191
|
+
@if (props.presentationImageUpload) {
|
|
41192
|
+
<label class="survey-builder__image-upload" [class.survey-builder__image-upload--loading]="uploadingImage() === 'success'">
|
|
41193
|
+
@if (uploadingImage() === 'success') {
|
|
41194
|
+
<ion-spinner name="crescent" />
|
|
41195
|
+
} @else {
|
|
41196
|
+
<ion-icon name="cloud-upload-outline" aria-hidden="true" />
|
|
41197
|
+
}
|
|
41198
|
+
<span>{{ successImageControl.value ? t('imageChange') : t('imageUpload') }}</span>
|
|
41199
|
+
<input
|
|
41200
|
+
type="file"
|
|
41201
|
+
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
|
41202
|
+
[disabled]="uploadingImage() === 'success'"
|
|
41203
|
+
(change)="onPresentationFileSelected('success', $event)"
|
|
41204
|
+
/>
|
|
41205
|
+
</label>
|
|
41206
|
+
}
|
|
41207
|
+
</div>
|
|
41036
41208
|
</div>
|
|
41037
41209
|
|
|
41038
41210
|
<div class="survey-builder__questions">
|
|
@@ -41134,13 +41306,15 @@ class SurveyBuilderComponent {
|
|
|
41134
41306
|
(onClick)="save()"
|
|
41135
41307
|
/>
|
|
41136
41308
|
</div>
|
|
41137
|
-
`, 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"] }] }); }
|
|
41309
|
+
`, 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"] }] }); }
|
|
41138
41310
|
}
|
|
41139
41311
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SurveyBuilderComponent, decorators: [{
|
|
41140
41312
|
type: Component,
|
|
41141
41313
|
args: [{ selector: 'val-survey-builder', standalone: true, imports: [
|
|
41142
41314
|
CommonModule,
|
|
41143
41315
|
ReactiveFormsModule,
|
|
41316
|
+
IonIcon,
|
|
41317
|
+
IonSpinner,
|
|
41144
41318
|
TextInputComponent,
|
|
41145
41319
|
ButtonComponent,
|
|
41146
41320
|
FormFieldComponent,
|
|
@@ -41156,18 +41330,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
41156
41330
|
|
|
41157
41331
|
<div class="survey-builder__presentation">
|
|
41158
41332
|
<span class="survey-builder__questions-label">{{ t('presentationLabel') }}</span>
|
|
41159
|
-
<
|
|
41160
|
-
<val-
|
|
41161
|
-
|
|
41333
|
+
<div class="survey-builder__image-field">
|
|
41334
|
+
<val-form-field [label]="t('headerImageLabel')">
|
|
41335
|
+
<val-text-input [props]="{ control: headerImageControl, placeholder: t('headerImagePlaceholder') }" />
|
|
41336
|
+
</val-form-field>
|
|
41337
|
+
@if (headerImageControl.value) {
|
|
41338
|
+
<div class="survey-builder__image-preview">
|
|
41339
|
+
<img [src]="headerImageControl.value" alt="" />
|
|
41340
|
+
<button
|
|
41341
|
+
type="button"
|
|
41342
|
+
class="survey-builder__image-clear"
|
|
41343
|
+
[attr.aria-label]="t('imageRemove')"
|
|
41344
|
+
(click)="clearPresentationImage('header')"
|
|
41345
|
+
>
|
|
41346
|
+
<ion-icon name="trash-outline" aria-hidden="true" />
|
|
41347
|
+
</button>
|
|
41348
|
+
</div>
|
|
41349
|
+
}
|
|
41350
|
+
@if (props.presentationImageUpload) {
|
|
41351
|
+
<label class="survey-builder__image-upload" [class.survey-builder__image-upload--loading]="uploadingImage() === 'header'">
|
|
41352
|
+
@if (uploadingImage() === 'header') {
|
|
41353
|
+
<ion-spinner name="crescent" />
|
|
41354
|
+
} @else {
|
|
41355
|
+
<ion-icon name="cloud-upload-outline" aria-hidden="true" />
|
|
41356
|
+
}
|
|
41357
|
+
<span>{{ headerImageControl.value ? t('imageChange') : t('imageUpload') }}</span>
|
|
41358
|
+
<input
|
|
41359
|
+
type="file"
|
|
41360
|
+
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
|
41361
|
+
[disabled]="uploadingImage() === 'header'"
|
|
41362
|
+
(change)="onPresentationFileSelected('header', $event)"
|
|
41363
|
+
/>
|
|
41364
|
+
</label>
|
|
41365
|
+
}
|
|
41366
|
+
</div>
|
|
41162
41367
|
<val-form-field [label]="t('successTitleLabel')">
|
|
41163
41368
|
<val-text-input [props]="{ control: successTitleControl, placeholder: t('successTitlePlaceholder') }" />
|
|
41164
41369
|
</val-form-field>
|
|
41165
41370
|
<val-form-field [label]="t('successMessageLabel')">
|
|
41166
41371
|
<val-text-input [props]="{ control: successMessageControl, placeholder: t('successMessagePlaceholder') }" />
|
|
41167
41372
|
</val-form-field>
|
|
41168
|
-
<
|
|
41169
|
-
<val-
|
|
41170
|
-
|
|
41373
|
+
<div class="survey-builder__image-field">
|
|
41374
|
+
<val-form-field [label]="t('successImageLabel')">
|
|
41375
|
+
<val-text-input [props]="{ control: successImageControl, placeholder: t('successImagePlaceholder') }" />
|
|
41376
|
+
</val-form-field>
|
|
41377
|
+
@if (successImageControl.value) {
|
|
41378
|
+
<div class="survey-builder__image-preview">
|
|
41379
|
+
<img [src]="successImageControl.value" alt="" />
|
|
41380
|
+
<button
|
|
41381
|
+
type="button"
|
|
41382
|
+
class="survey-builder__image-clear"
|
|
41383
|
+
[attr.aria-label]="t('imageRemove')"
|
|
41384
|
+
(click)="clearPresentationImage('success')"
|
|
41385
|
+
>
|
|
41386
|
+
<ion-icon name="trash-outline" aria-hidden="true" />
|
|
41387
|
+
</button>
|
|
41388
|
+
</div>
|
|
41389
|
+
}
|
|
41390
|
+
@if (props.presentationImageUpload) {
|
|
41391
|
+
<label class="survey-builder__image-upload" [class.survey-builder__image-upload--loading]="uploadingImage() === 'success'">
|
|
41392
|
+
@if (uploadingImage() === 'success') {
|
|
41393
|
+
<ion-spinner name="crescent" />
|
|
41394
|
+
} @else {
|
|
41395
|
+
<ion-icon name="cloud-upload-outline" aria-hidden="true" />
|
|
41396
|
+
}
|
|
41397
|
+
<span>{{ successImageControl.value ? t('imageChange') : t('imageUpload') }}</span>
|
|
41398
|
+
<input
|
|
41399
|
+
type="file"
|
|
41400
|
+
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
|
41401
|
+
[disabled]="uploadingImage() === 'success'"
|
|
41402
|
+
(change)="onPresentationFileSelected('success', $event)"
|
|
41403
|
+
/>
|
|
41404
|
+
</label>
|
|
41405
|
+
}
|
|
41406
|
+
</div>
|
|
41171
41407
|
</div>
|
|
41172
41408
|
|
|
41173
41409
|
<div class="survey-builder__questions">
|
|
@@ -41269,7 +41505,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
41269
41505
|
(onClick)="save()"
|
|
41270
41506
|
/>
|
|
41271
41507
|
</div>
|
|
41272
|
-
`, 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"] }]
|
|
41508
|
+
`, 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"] }]
|
|
41273
41509
|
}], ctorParameters: () => [], propDecorators: { props: [{
|
|
41274
41510
|
type: Input
|
|
41275
41511
|
}], saved: [{
|