ui-core-abv 0.11.4 → 0.11.5
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/fesm2022/ui-core-abv.mjs +771 -140
- package/fesm2022/ui-core-abv.mjs.map +1 -1
- package/lib/components/dynamic-form/form/dynamic-form.component.d.ts +5 -0
- package/lib/components/dynamic-form/form.models.d.ts +8 -2
- package/lib/components/inputs/ui-chips-input/ui-chips-input.component.d.ts +55 -0
- package/lib/components/inputs/ui-distribution/ui-distribution.component.d.ts +7 -0
- package/lib/components/survey/survey.component.d.ts +59 -8
- package/lib/components/survey/survey.config.d.ts +52 -0
- package/lib/components/survey/survey.models.d.ts +6 -1
- package/lib/components/uic-action-button/uic-action-button.component.d.ts +9 -2
- package/lib/components/user-formbuilder/block-editor/field-editor/field-editor.component.d.ts +6 -1
- package/lib/components/user-formbuilder/form-preview/form-preview.component.d.ts +3 -0
- package/lib/components/user-formbuilder/formbuilder.config.d.ts +4 -1
- package/lib/components/user-formbuilder/user-formbuilder.component.d.ts +6 -0
- package/lib/components/user-formbuilder/visibility-rule-pruning.d.ts +34 -0
- package/lib/translate/dictionary.en.d.ts +11 -0
- package/lib/translate/dictionary.es.d.ts +11 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/src/lib/styles/_dark.scss +113 -113
- package/src/lib/styles/_default_colors.scss +228 -228
- package/src/lib/styles/_variables.scss +140 -140
package/fesm2022/ui-core-abv.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, CurrencyPipe, DatePipe, NgTemplateOutlet, JsonPipe } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Input, Component, EventEmitter, Output, Directive, forwardRef, InjectionToken, Optional, Inject, Injectable, inject, ChangeDetectorRef, Pipe, ViewContainerRef, ElementRef, ViewChild, createComponent, HostListener, ViewChildren, Host, DestroyRef, signal, computed, output, effect, TemplateRef, ContentChild, Injector, EnvironmentInjector, HostBinding, input, contentChildren, contentChild, viewChildren, untracked, ChangeDetectionStrategy } from '@angular/core';
|
|
4
|
+
import { Input, Component, EventEmitter, Output, Directive, forwardRef, InjectionToken, Optional, Inject, Injectable, inject, ChangeDetectorRef, Pipe, ViewContainerRef, ElementRef, ViewChild, createComponent, HostListener, ViewChildren, Host, DestroyRef, signal, computed, output, effect, TemplateRef, ContentChild, Injector, EnvironmentInjector, HostBinding, input, contentChildren, contentChild, viewChildren, untracked, afterNextRender, ChangeDetectionStrategy } from '@angular/core';
|
|
5
5
|
import * as i1$1 from '@angular/forms';
|
|
6
6
|
import { NG_VALUE_ACCESSOR, FormsModule, FormBuilder, Validators, ReactiveFormsModule, FormArray } from '@angular/forms';
|
|
7
7
|
import { BehaviorSubject, Subject, debounceTime, distinctUntilChanged, switchMap, of, finalize, map, isObservable, from, Subscription, take, defaultIfEmpty } from 'rxjs';
|
|
@@ -124,8 +124,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
124
124
|
type: Input
|
|
125
125
|
}] } });
|
|
126
126
|
|
|
127
|
-
const base$
|
|
128
|
-
class UicCheckboxComponent extends base$
|
|
127
|
+
const base$g = createValueAccessor();
|
|
128
|
+
class UicCheckboxComponent extends base$g {
|
|
129
129
|
icon = ''; // Icono externo
|
|
130
130
|
iconColor = 'black';
|
|
131
131
|
label = '';
|
|
@@ -509,6 +509,8 @@ const DICTIONARY_EN = {
|
|
|
509
509
|
new_line: 'New line',
|
|
510
510
|
col_span: 'Column span',
|
|
511
511
|
col_span_tip: 'How many columns the field occupies',
|
|
512
|
+
same_page: 'Same page as the previous one',
|
|
513
|
+
same_page_tip: 'Only in one-question-per-page surveys',
|
|
512
514
|
},
|
|
513
515
|
extra: {
|
|
514
516
|
iconColor: 'Icon color',
|
|
@@ -670,6 +672,7 @@ const DICTIONARY_EN = {
|
|
|
670
672
|
operator: 'Operator',
|
|
671
673
|
value: 'Value',
|
|
672
674
|
expected_value: 'Expected value',
|
|
675
|
+
values: 'Values',
|
|
673
676
|
style: 'Style',
|
|
674
677
|
advanced: 'Advanced',
|
|
675
678
|
duplicate: 'Duplicate',
|
|
@@ -679,6 +682,7 @@ const DICTIONARY_EN = {
|
|
|
679
682
|
subfields: 'Sub-fields',
|
|
680
683
|
external_validation_title: 'External validation',
|
|
681
684
|
},
|
|
685
|
+
rules_pruned: '{{count}} dependency rules were updated because they used removed options.',
|
|
682
686
|
visibility_operators: {
|
|
683
687
|
equals: 'Equals',
|
|
684
688
|
notEquals: 'Does not equal',
|
|
@@ -688,6 +692,8 @@ const DICTIONARY_EN = {
|
|
|
688
692
|
notIncludes: 'Does not include',
|
|
689
693
|
isEmpty: 'Is empty',
|
|
690
694
|
isNotEmpty: 'Is not empty',
|
|
695
|
+
in: 'Is any of',
|
|
696
|
+
notIn: 'Is none of',
|
|
691
697
|
},
|
|
692
698
|
validation: {
|
|
693
699
|
duplicate_identifier: 'The identifier "{{identifier}}" is used more than once.',
|
|
@@ -717,6 +723,11 @@ const DICTIONARY_EN = {
|
|
|
717
723
|
label: 'Other',
|
|
718
724
|
placeholder: 'Please specify...',
|
|
719
725
|
},
|
|
726
|
+
chips_input: {
|
|
727
|
+
placeholder: 'Type and press Enter',
|
|
728
|
+
remove: 'Remove {{item}}',
|
|
729
|
+
max_reached: 'Maximum {{max}}',
|
|
730
|
+
},
|
|
720
731
|
distribution: {
|
|
721
732
|
total: 'Total',
|
|
722
733
|
complete: 'Complete',
|
|
@@ -1025,6 +1036,8 @@ const DICTIONARY_ES = {
|
|
|
1025
1036
|
new_line: 'Saltar línea',
|
|
1026
1037
|
col_span: 'Ancho',
|
|
1027
1038
|
col_span_tip: 'Cuantas columnas ocupa el campo',
|
|
1039
|
+
same_page: 'Misma página que la anterior',
|
|
1040
|
+
same_page_tip: 'Solo en encuestas de una pregunta por página',
|
|
1028
1041
|
},
|
|
1029
1042
|
extra: {
|
|
1030
1043
|
iconColor: 'Color de ícono externo',
|
|
@@ -1186,6 +1199,7 @@ const DICTIONARY_ES = {
|
|
|
1186
1199
|
operator: 'Operador',
|
|
1187
1200
|
value: 'Valor',
|
|
1188
1201
|
expected_value: 'Valor esperado',
|
|
1202
|
+
values: 'Valores',
|
|
1189
1203
|
style: 'Estilo',
|
|
1190
1204
|
advanced: 'Avanzado',
|
|
1191
1205
|
duplicate: 'Duplicar',
|
|
@@ -1195,6 +1209,7 @@ const DICTIONARY_ES = {
|
|
|
1195
1209
|
subfields: 'Sub-campos',
|
|
1196
1210
|
external_validation_title: 'Validación externa',
|
|
1197
1211
|
},
|
|
1212
|
+
rules_pruned: 'Se actualizaron {{count}} reglas de dependencia porque usaban opciones eliminadas.',
|
|
1198
1213
|
visibility_operators: {
|
|
1199
1214
|
equals: 'Es igual a',
|
|
1200
1215
|
notEquals: 'No es igual a',
|
|
@@ -1204,6 +1219,8 @@ const DICTIONARY_ES = {
|
|
|
1204
1219
|
notIncludes: 'No incluye',
|
|
1205
1220
|
isEmpty: 'Está vacío',
|
|
1206
1221
|
isNotEmpty: 'No está vacío',
|
|
1222
|
+
in: 'Es alguno de',
|
|
1223
|
+
notIn: 'No es ninguno de',
|
|
1207
1224
|
},
|
|
1208
1225
|
validation: {
|
|
1209
1226
|
duplicate_identifier: 'El identificador "{{identifier}}" se está usando más de una vez.',
|
|
@@ -1233,6 +1250,11 @@ const DICTIONARY_ES = {
|
|
|
1233
1250
|
label: 'Otros',
|
|
1234
1251
|
placeholder: 'Especifica...',
|
|
1235
1252
|
},
|
|
1253
|
+
chips_input: {
|
|
1254
|
+
placeholder: 'Escribe y presiona Enter',
|
|
1255
|
+
remove: 'Quitar {{item}}',
|
|
1256
|
+
max_reached: 'Máximo {{max}}',
|
|
1257
|
+
},
|
|
1236
1258
|
distribution: {
|
|
1237
1259
|
total: 'Total',
|
|
1238
1260
|
complete: 'Completo',
|
|
@@ -1567,8 +1589,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1567
1589
|
args: [{ providedIn: 'root' }]
|
|
1568
1590
|
}] });
|
|
1569
1591
|
|
|
1570
|
-
const base$
|
|
1571
|
-
class UicDatePickerComponent extends base$
|
|
1592
|
+
const base$f = createValueAccessor();
|
|
1593
|
+
class UicDatePickerComponent extends base$f {
|
|
1572
1594
|
icon = ''; // Icono externo
|
|
1573
1595
|
iconColor = 'black';
|
|
1574
1596
|
internalIcon = ''; //Icono interno
|
|
@@ -2118,8 +2140,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2118
2140
|
}]
|
|
2119
2141
|
}] });
|
|
2120
2142
|
|
|
2121
|
-
const base$
|
|
2122
|
-
class UicFileInputComponent extends base$
|
|
2143
|
+
const base$e = createValueAccessor();
|
|
2144
|
+
class UicFileInputComponent extends base$e {
|
|
2123
2145
|
icon = ''; // Icono externo
|
|
2124
2146
|
iconColor = 'black';
|
|
2125
2147
|
internalIcon = ''; //Icono interno
|
|
@@ -2447,8 +2469,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2447
2469
|
type: Input
|
|
2448
2470
|
}] } });
|
|
2449
2471
|
|
|
2450
|
-
const base$
|
|
2451
|
-
class UicMultySelectComponent extends base$
|
|
2472
|
+
const base$d = createValueAccessor();
|
|
2473
|
+
class UicMultySelectComponent extends base$d {
|
|
2452
2474
|
icon = ''; // Icono externo
|
|
2453
2475
|
iconColor = 'black'; //color de ícono externo
|
|
2454
2476
|
internalIcon = ''; //Icono interno
|
|
@@ -2674,8 +2696,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2674
2696
|
args: [{ providedIn: 'root' }]
|
|
2675
2697
|
}] });
|
|
2676
2698
|
|
|
2677
|
-
const base$
|
|
2678
|
-
class UicMultySearcherComponent extends base$
|
|
2699
|
+
const base$c = createValueAccessor();
|
|
2700
|
+
class UicMultySearcherComponent extends base$c {
|
|
2679
2701
|
icon = ''; // Icono externo
|
|
2680
2702
|
iconColor = 'black'; //color de ícono externo
|
|
2681
2703
|
internalIcon = 'ri-search-2-line'; //Icono interno
|
|
@@ -2774,7 +2796,7 @@ class UicMultySearcherComponent extends base$b {
|
|
|
2774
2796
|
useExisting: forwardRef(() => UicMultySearcherComponent),
|
|
2775
2797
|
multi: true
|
|
2776
2798
|
}
|
|
2777
|
-
], viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ui-input-wrapper\r\n [icon]=\"icon\"\r\n [iconColor]=\"iconColor\"\r\n [label]=\"label\"\r\n [error]=\"error\"\r\n [tip]=\"tip\"\r\n [disabled]=\"disabled\">\r\n <div class=\"fakeinput-wrapp\">\r\n <!-- INPUT -->\r\n <div class=\"fakeinput\" #fakeinput\r\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':watingApi||loading}\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon {{internalIcon}}\"></i>\r\n }\r\n <div class=\"input-container\">\r\n <input\r\n [disabled]=\"disabled\"\r\n (focus)=\"openList()\"\r\n type=\"text\"\r\n (keydown.enter)=\"triggerSearch()\"\r\n (keydown.escape)=\"clearSearch()\"\r\n [(ngModel)]=\"searchText\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n [placeholder]=\"placeholder | uicTranslate\"\r\n />\r\n </div>\r\n @if (!disabled) {\r\n @if (manualSearch) {\r\n <ui-button [iconOnly]=\"true\" size=\"s\" type=\"ghost\" icon=\"ri-search-line\" (click)=\"triggerSearch()\"></ui-button>\r\n }\r\n <ui-button [iconOnly]=\"true\" size=\"s\" type=\"ghost\" icon=\"ri-eraser-line\" (click)=\"clearSearch()\"></ui-button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- CHIPS -->\r\n <div class=\"search-results\">\r\n @for (item of selectedItems; track $index) {\r\n <div class=\"search-result\" [class.disabledresult]=\"disabled\">\r\n <div [innerHTML]=\"itemDisplayFn?itemDisplayFn(item):''\"></div>\r\n @if (!disabled) {\r\n <ui-button (click)=\"removeItem($index)\" [iconOnly]=\"true\" icon=\"ri-delete-bin-line\" type=\"ghost\" color=\"red\" size=\"s\"></ui-button>\r\n }\r\n </div>\r\n }\r\n @if (disabled && selectedItems.length == 0) {\r\n <div class=\"search-result-empty\">\r\n {{'searcher.without_selected' | uicTranslate}}\r\n </div>\r\n }\r\n </div>\r\n</ui-input-wrapper>\r\n\r\n<!-- DESPLEGABLE -->\r\n<ng-template #dropdownTemplate>\r\n @if (results$ | async; as items) {\r\n <div class=\"input-options\">\r\n <div class=\"input-option-scroll\">\r\n @for (item of items; track $index) {\r\n <div class=\"input-option\" [class.item-disabled]=\"itemIsEnabledFn?!itemIsEnabledFn(item):false\"\r\n (click)=\"selectItem(item)\"\r\n [innerHTML]=\"itemDisplayFn?itemDisplayFn(item):''\">\r\n </div>\r\n } @empty {\r\n <div class=\"t-disabled\">{{'searcher.empty' | uicTranslate}}</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [".search-results{display:flex;flex-direction:column;gap:5px;margin-top:5px}.search-results:empty{margin-top:0}.search-result{font-size:14px;line-height:16px;min-height:33px;padding:2px 2px 2px 10px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:4px;display:flex;background-color:var(--uic-neutral-50, var(--grey-50));align-items:center;justify-content:space-between}.disabledresult{color:var(--disabled-color)}.search-result-empty{font-size:14px;line-height:16px;min-height:33px;padding:2px 2px 2px 10px;border:dashed 1px var(--uic-neutral-300, var(--grey-300));border-radius:4px;display:flex;color:var(--uic-neutral-400, var(--grey-400));align-items:center;justify-content:center}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
2799
|
+
], viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ui-input-wrapper\n [icon]=\"icon\"\n [iconColor]=\"iconColor\"\n [label]=\"label\"\n [error]=\"error\"\n [tip]=\"tip\"\n [disabled]=\"disabled\">\n <div class=\"fakeinput-wrapp\">\n <!-- INPUT -->\n <div class=\"fakeinput\" #fakeinput\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':watingApi||loading}\">\n @if (internalIcon) {\n <i class=\"input-internalicon {{internalIcon}}\"></i>\n }\n <div class=\"input-container\">\n <input\n [disabled]=\"disabled\"\n (focus)=\"openList()\"\n type=\"text\"\n (keydown.enter)=\"triggerSearch()\"\n (keydown.escape)=\"clearSearch()\"\n [(ngModel)]=\"searchText\"\n (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"placeholder | uicTranslate\"\n />\n </div>\n @if (!disabled) {\n @if (manualSearch) {\n <ui-button [iconOnly]=\"true\" size=\"s\" type=\"ghost\" icon=\"ri-search-line\" (click)=\"triggerSearch()\"></ui-button>\n }\n <ui-button [iconOnly]=\"true\" size=\"s\" type=\"ghost\" icon=\"ri-eraser-line\" (click)=\"clearSearch()\"></ui-button>\n }\n </div>\n </div>\n\n <!-- CHIPS -->\n <div class=\"search-results\">\n @for (item of selectedItems; track $index) {\n <div class=\"search-result\" [class.disabledresult]=\"disabled\">\n <div [innerHTML]=\"itemDisplayFn?itemDisplayFn(item):''\"></div>\n @if (!disabled) {\n <ui-button (click)=\"removeItem($index)\" [iconOnly]=\"true\" icon=\"ri-delete-bin-line\" type=\"ghost\" color=\"red\" size=\"s\"></ui-button>\n }\n </div>\n }\n @if (disabled && selectedItems.length == 0) {\n <div class=\"search-result-empty\">\n {{'searcher.without_selected' | uicTranslate}}\n </div>\n }\n </div>\n</ui-input-wrapper>\n\n<!-- DESPLEGABLE -->\n<ng-template #dropdownTemplate>\n @if (results$ | async; as items) {\n <div class=\"input-options\">\n <div class=\"input-option-scroll\">\n @for (item of items; track $index) {\n <div class=\"input-option\" [class.item-disabled]=\"itemIsEnabledFn?!itemIsEnabledFn(item):false\"\n (click)=\"selectItem(item)\"\n [innerHTML]=\"itemDisplayFn?itemDisplayFn(item):''\">\n </div>\n } @empty {\n <div class=\"t-disabled\">{{'searcher.empty' | uicTranslate}}</div>\n }\n </div>\n </div>\n }\n</ng-template>\n", styles: [".search-results{display:flex;flex-direction:column;gap:5px;margin-top:5px}.search-results:empty{margin-top:0}.search-result{font-size:14px;line-height:16px;min-height:33px;padding:2px 2px 2px 10px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:4px;display:flex;background-color:var(--uic-neutral-50, var(--grey-50));align-items:center;justify-content:space-between}.disabledresult{color:var(--disabled-color)}.search-result-empty{font-size:14px;line-height:16px;min-height:33px;padding:2px 2px 2px 10px;border:dashed 1px var(--uic-neutral-300, var(--grey-300));border-radius:4px;display:flex;color:var(--uic-neutral-400, var(--grey-400));align-items:center;justify-content:center}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
2778
2800
|
}
|
|
2779
2801
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicMultySearcherComponent, decorators: [{
|
|
2780
2802
|
type: Component,
|
|
@@ -2784,7 +2806,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2784
2806
|
useExisting: forwardRef(() => UicMultySearcherComponent),
|
|
2785
2807
|
multi: true
|
|
2786
2808
|
}
|
|
2787
|
-
], template: "<ui-input-wrapper\r\n [icon]=\"icon\"\r\n [iconColor]=\"iconColor\"\r\n [label]=\"label\"\r\n [error]=\"error\"\r\n [tip]=\"tip\"\r\n [disabled]=\"disabled\">\r\n <div class=\"fakeinput-wrapp\">\r\n <!-- INPUT -->\r\n <div class=\"fakeinput\" #fakeinput\r\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':watingApi||loading}\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon {{internalIcon}}\"></i>\r\n }\r\n <div class=\"input-container\">\r\n <input\r\n [disabled]=\"disabled\"\r\n (focus)=\"openList()\"\r\n type=\"text\"\r\n (keydown.enter)=\"triggerSearch()\"\r\n (keydown.escape)=\"clearSearch()\"\r\n [(ngModel)]=\"searchText\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n [placeholder]=\"placeholder | uicTranslate\"\r\n />\r\n </div>\r\n @if (!disabled) {\r\n @if (manualSearch) {\r\n <ui-button [iconOnly]=\"true\" size=\"s\" type=\"ghost\" icon=\"ri-search-line\" (click)=\"triggerSearch()\"></ui-button>\r\n }\r\n <ui-button [iconOnly]=\"true\" size=\"s\" type=\"ghost\" icon=\"ri-eraser-line\" (click)=\"clearSearch()\"></ui-button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- CHIPS -->\r\n <div class=\"search-results\">\r\n @for (item of selectedItems; track $index) {\r\n <div class=\"search-result\" [class.disabledresult]=\"disabled\">\r\n <div [innerHTML]=\"itemDisplayFn?itemDisplayFn(item):''\"></div>\r\n @if (!disabled) {\r\n <ui-button (click)=\"removeItem($index)\" [iconOnly]=\"true\" icon=\"ri-delete-bin-line\" type=\"ghost\" color=\"red\" size=\"s\"></ui-button>\r\n }\r\n </div>\r\n }\r\n @if (disabled && selectedItems.length == 0) {\r\n <div class=\"search-result-empty\">\r\n {{'searcher.without_selected' | uicTranslate}}\r\n </div>\r\n }\r\n </div>\r\n</ui-input-wrapper>\r\n\r\n<!-- DESPLEGABLE -->\r\n<ng-template #dropdownTemplate>\r\n @if (results$ | async; as items) {\r\n <div class=\"input-options\">\r\n <div class=\"input-option-scroll\">\r\n @for (item of items; track $index) {\r\n <div class=\"input-option\" [class.item-disabled]=\"itemIsEnabledFn?!itemIsEnabledFn(item):false\"\r\n (click)=\"selectItem(item)\"\r\n [innerHTML]=\"itemDisplayFn?itemDisplayFn(item):''\">\r\n </div>\r\n } @empty {\r\n <div class=\"t-disabled\">{{'searcher.empty' | uicTranslate}}</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [".search-results{display:flex;flex-direction:column;gap:5px;margin-top:5px}.search-results:empty{margin-top:0}.search-result{font-size:14px;line-height:16px;min-height:33px;padding:2px 2px 2px 10px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:4px;display:flex;background-color:var(--uic-neutral-50, var(--grey-50));align-items:center;justify-content:space-between}.disabledresult{color:var(--disabled-color)}.search-result-empty{font-size:14px;line-height:16px;min-height:33px;padding:2px 2px 2px 10px;border:dashed 1px var(--uic-neutral-300, var(--grey-300));border-radius:4px;display:flex;color:var(--uic-neutral-400, var(--grey-400));align-items:center;justify-content:center}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
2809
|
+
], template: "<ui-input-wrapper\n [icon]=\"icon\"\n [iconColor]=\"iconColor\"\n [label]=\"label\"\n [error]=\"error\"\n [tip]=\"tip\"\n [disabled]=\"disabled\">\n <div class=\"fakeinput-wrapp\">\n <!-- INPUT -->\n <div class=\"fakeinput\" #fakeinput\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':watingApi||loading}\">\n @if (internalIcon) {\n <i class=\"input-internalicon {{internalIcon}}\"></i>\n }\n <div class=\"input-container\">\n <input\n [disabled]=\"disabled\"\n (focus)=\"openList()\"\n type=\"text\"\n (keydown.enter)=\"triggerSearch()\"\n (keydown.escape)=\"clearSearch()\"\n [(ngModel)]=\"searchText\"\n (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"placeholder | uicTranslate\"\n />\n </div>\n @if (!disabled) {\n @if (manualSearch) {\n <ui-button [iconOnly]=\"true\" size=\"s\" type=\"ghost\" icon=\"ri-search-line\" (click)=\"triggerSearch()\"></ui-button>\n }\n <ui-button [iconOnly]=\"true\" size=\"s\" type=\"ghost\" icon=\"ri-eraser-line\" (click)=\"clearSearch()\"></ui-button>\n }\n </div>\n </div>\n\n <!-- CHIPS -->\n <div class=\"search-results\">\n @for (item of selectedItems; track $index) {\n <div class=\"search-result\" [class.disabledresult]=\"disabled\">\n <div [innerHTML]=\"itemDisplayFn?itemDisplayFn(item):''\"></div>\n @if (!disabled) {\n <ui-button (click)=\"removeItem($index)\" [iconOnly]=\"true\" icon=\"ri-delete-bin-line\" type=\"ghost\" color=\"red\" size=\"s\"></ui-button>\n }\n </div>\n }\n @if (disabled && selectedItems.length == 0) {\n <div class=\"search-result-empty\">\n {{'searcher.without_selected' | uicTranslate}}\n </div>\n }\n </div>\n</ui-input-wrapper>\n\n<!-- DESPLEGABLE -->\n<ng-template #dropdownTemplate>\n @if (results$ | async; as items) {\n <div class=\"input-options\">\n <div class=\"input-option-scroll\">\n @for (item of items; track $index) {\n <div class=\"input-option\" [class.item-disabled]=\"itemIsEnabledFn?!itemIsEnabledFn(item):false\"\n (click)=\"selectItem(item)\"\n [innerHTML]=\"itemDisplayFn?itemDisplayFn(item):''\">\n </div>\n } @empty {\n <div class=\"t-disabled\">{{'searcher.empty' | uicTranslate}}</div>\n }\n </div>\n </div>\n }\n</ng-template>\n", styles: [".search-results{display:flex;flex-direction:column;gap:5px;margin-top:5px}.search-results:empty{margin-top:0}.search-result{font-size:14px;line-height:16px;min-height:33px;padding:2px 2px 2px 10px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:4px;display:flex;background-color:var(--uic-neutral-50, var(--grey-50));align-items:center;justify-content:space-between}.disabledresult{color:var(--disabled-color)}.search-result-empty{font-size:14px;line-height:16px;min-height:33px;padding:2px 2px 2px 10px;border:dashed 1px var(--uic-neutral-300, var(--grey-300));border-radius:4px;display:flex;color:var(--uic-neutral-400, var(--grey-400));align-items:center;justify-content:center}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
2788
2810
|
}], propDecorators: { icon: [{
|
|
2789
2811
|
type: Input
|
|
2790
2812
|
}], iconColor: [{
|
|
@@ -2851,8 +2873,8 @@ const PHONE_COUNTRIES = [
|
|
|
2851
2873
|
{ name: 'Venezuela', iso2: 've', dialCode: '58' }
|
|
2852
2874
|
];
|
|
2853
2875
|
|
|
2854
|
-
const base$
|
|
2855
|
-
class UicPhoneInputComponent extends base$
|
|
2876
|
+
const base$b = createValueAccessor();
|
|
2877
|
+
class UicPhoneInputComponent extends base$b {
|
|
2856
2878
|
icon = '';
|
|
2857
2879
|
iconColor = 'black';
|
|
2858
2880
|
internalIcon = '';
|
|
@@ -3268,8 +3290,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3268
3290
|
args: ['pointerdown']
|
|
3269
3291
|
}] } });
|
|
3270
3292
|
|
|
3271
|
-
const base$
|
|
3272
|
-
class UicSearcherComponent extends base$
|
|
3293
|
+
const base$a = createValueAccessor();
|
|
3294
|
+
class UicSearcherComponent extends base$a {
|
|
3273
3295
|
icon = ''; // Icono externo
|
|
3274
3296
|
iconColor = 'black'; //color de ícono externo
|
|
3275
3297
|
internalIcon = 'ri-search-2-line'; //Icono interno
|
|
@@ -3420,8 +3442,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3420
3442
|
args: ['dropdownTemplate']
|
|
3421
3443
|
}] } });
|
|
3422
3444
|
|
|
3423
|
-
const base$
|
|
3424
|
-
class UicSelectComponent extends base$
|
|
3445
|
+
const base$9 = createValueAccessor();
|
|
3446
|
+
class UicSelectComponent extends base$9 {
|
|
3425
3447
|
icon = ''; // Icono externo
|
|
3426
3448
|
iconColor = 'black';
|
|
3427
3449
|
internalIcon = ''; //Icono interno
|
|
@@ -3743,8 +3765,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3743
3765
|
args: ['dropdownTemplate']
|
|
3744
3766
|
}] } });
|
|
3745
3767
|
|
|
3746
|
-
const base$
|
|
3747
|
-
class UicSliderComponent extends base$
|
|
3768
|
+
const base$8 = createValueAccessor();
|
|
3769
|
+
class UicSliderComponent extends base$8 {
|
|
3748
3770
|
icon = ''; // Icono externo
|
|
3749
3771
|
iconColor = 'black';
|
|
3750
3772
|
label = '';
|
|
@@ -3844,8 +3866,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3844
3866
|
args: ['document:mouseup']
|
|
3845
3867
|
}] } });
|
|
3846
3868
|
|
|
3847
|
-
const base$
|
|
3848
|
-
class UicRadioComponent extends base$
|
|
3869
|
+
const base$7 = createValueAccessor();
|
|
3870
|
+
class UicRadioComponent extends base$7 {
|
|
3849
3871
|
icon = '';
|
|
3850
3872
|
iconColor = 'black';
|
|
3851
3873
|
label = '';
|
|
@@ -3913,7 +3935,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3913
3935
|
type: Input
|
|
3914
3936
|
}] } });
|
|
3915
3937
|
|
|
3916
|
-
const base$
|
|
3938
|
+
const base$6 = createValueAccessor();
|
|
3917
3939
|
/** Máximo de puntos de una escala, para que siga siendo usable. */
|
|
3918
3940
|
const MAX_POINTS = 21;
|
|
3919
3941
|
/**
|
|
@@ -3921,7 +3943,7 @@ const MAX_POINTS = 21;
|
|
|
3921
3943
|
* Valor: el número elegido, o null. Se maneja con teclado como un grupo de radios
|
|
3922
3944
|
* (flechas, Inicio, Fin) y anuncia cada punto con su leyenda.
|
|
3923
3945
|
*/
|
|
3924
|
-
class UicScaleComponent extends base$
|
|
3946
|
+
class UicScaleComponent extends base$6 {
|
|
3925
3947
|
host = inject(ElementRef);
|
|
3926
3948
|
icon = '';
|
|
3927
3949
|
iconColor = 'black';
|
|
@@ -4017,7 +4039,7 @@ class UicScaleComponent extends base$5 {
|
|
|
4017
4039
|
useExisting: forwardRef(() => UicScaleComponent),
|
|
4018
4040
|
multi: true
|
|
4019
4041
|
}
|
|
4020
|
-
], usesInheritance: true, ngImport: i0, template: "<ui-input-wrapper\n [icon]=\"icon\"\n [iconColor]=\"iconColor\"\n [label]=\"label\"\n [error]=\"error\"\n [tip]=\"tip\"\n [disabled]=\"disabled\">\n <div\n class=\"scale\"\n role=\"radiogroup\"\n [class.scale--icon]=\"mode === 'icon'\"\n [class.scale--number]=\"mode !== 'icon'\"\n [class.scale--disabled]=\"disabled\"\n [class.scale--error]=\"!!error\"\n [attr.aria-label]=\"label || null\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n (keydown)=\"onKeydown($event)\"\n (focusout)=\"onFocusOut($event)\"\n (mouseleave)=\"hovered = null\">\n @for (point of points; track point) {\n @let legend = legendFor(point);\n <div class=\"scale-point\">\n <button\n type=\"button\"\n role=\"radio\"\n class=\"scale-btn\"\n [class.is-selected]=\"isSelected(point)\"\n [class.is-filled]=\"isFilled(point)\"\n [attr.aria-checked]=\"isSelected(point)\"\n [attr.aria-label]=\"legend ? point + ' \u2013 ' + legend : point\"\n [tabindex]=\"tabIndexFor(point)\"\n [disabled]=\"disabled\"\n (click)=\"select(point)\"\n (mouseenter)=\"hovered = point\">\n @if (mode === 'icon') {\n <i class=\"scale-icon {{ scaleIcon || 'ri-star-fill' }}\" aria-hidden=\"true\"></i>\n } @else {\n {{ point }}\n }\n </button>\n @if (hasLegends) {\n <span class=\"scale-legend\" aria-hidden=\"true\">{{ legend | uicTranslate }}</span>\n }\n </div>\n }\n </div>\n</ui-input-wrapper>\n", styles: [".scale{display:flex;gap:var(--uic-scale-gap, 6px);width:100%;padding:2px 0}.scale-point{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}.scale-btn{display:inline-flex;align-items:center;justify-content:center;padding:0;font:inherit;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.scale-btn:focus-visible{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.scale-btn:disabled{cursor:not-allowed}.scale--number .scale-point{flex:1 1 0}.scale--number .scale-btn{width:100%;min-width:28px;height:var(--uic-scale-btn-height, calc(4 * var(--form-ref)));border:solid var(--uic-input-border-width, 1px) var(--uic-scale-btn-border-color, var(--uic-neutral-300, var(--grey-300)));border-radius:var(--uic-scale-btn-radius, var(--input-radius));background:var(--uic-scale-btn-bg, var(--uic-surface, var(--white)));color:var(--uic-scale-btn-color, var(--uic-neutral-800, var(--grey-800)));font-size:.875rem;font-weight:500;font-variant-numeric:tabular-nums}.scale--number .scale-btn:hover:not(:disabled){border-color:var(--uic-scale-btn-border-color-hover, var(--primary-400))}.scale--number .scale-btn.is-selected{background:var(--uic-scale-selected-bg, var(--primary-600));border-color:var(--uic-scale-selected-bg, var(--primary-600));color:var(--uic-scale-selected-color, var(--white))}.scale--number .scale-btn:disabled{background:var(--disabled-background);color:var(--disabled-color)}.scale--icon .scale-btn{border:none;background:transparent;border-radius:50%;color:var(--uic-scale-icon-empty-color, var(--uic-neutral-300, var(--grey-300)));font-size:var(--uic-scale-icon-size, 32px);line-height:1}.scale--icon .scale-btn.is-filled{color:var(--uic-scale-icon-color, var(--yellow-500))}.scale--icon .scale-btn:hover:not(:disabled){transform:scale(1.12)}.scale-legend{width:100%;min-height:1em;font-size:var(--uic-scale-legend-font-size, .75rem);line-height:1.25;text-align:center;color:var(--uic-scale-legend-color, var(--uic-neutral-600, var(--grey-600)));overflow-wrap:anywhere}.scale--error .scale-btn{border-color:var(--uic-error-color, var(--red-500))}.scale--icon.scale--error .scale-btn:not(.is-filled){color:var(--uic-error-color, var(--red-500))}@media (prefers-reduced-motion: reduce){.scale-btn{transition:none}.scale--icon .scale-btn:hover:not(:disabled){transform:none}}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
4042
|
+
], usesInheritance: true, ngImport: i0, template: "<ui-input-wrapper\r\n [icon]=\"icon\"\r\n [iconColor]=\"iconColor\"\r\n [label]=\"label\"\r\n [error]=\"error\"\r\n [tip]=\"tip\"\r\n [disabled]=\"disabled\">\r\n <div\r\n class=\"scale\"\r\n role=\"radiogroup\"\r\n [class.scale--icon]=\"mode === 'icon'\"\r\n [class.scale--number]=\"mode !== 'icon'\"\r\n [class.scale--disabled]=\"disabled\"\r\n [class.scale--error]=\"!!error\"\r\n [attr.aria-label]=\"label || null\"\r\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\r\n (keydown)=\"onKeydown($event)\"\r\n (focusout)=\"onFocusOut($event)\"\r\n (mouseleave)=\"hovered = null\">\r\n @for (point of points; track point) {\r\n @let legend = legendFor(point);\r\n <div class=\"scale-point\">\r\n <button\r\n type=\"button\"\r\n role=\"radio\"\r\n class=\"scale-btn\"\r\n [class.is-selected]=\"isSelected(point)\"\r\n [class.is-filled]=\"isFilled(point)\"\r\n [attr.aria-checked]=\"isSelected(point)\"\r\n [attr.aria-label]=\"legend ? point + ' \u2013 ' + legend : point\"\r\n [tabindex]=\"tabIndexFor(point)\"\r\n [disabled]=\"disabled\"\r\n (click)=\"select(point)\"\r\n (mouseenter)=\"hovered = point\">\r\n @if (mode === 'icon') {\r\n <i class=\"scale-icon {{ scaleIcon || 'ri-star-fill' }}\" aria-hidden=\"true\"></i>\r\n } @else {\r\n {{ point }}\r\n }\r\n </button>\r\n @if (hasLegends) {\r\n <span class=\"scale-legend\" aria-hidden=\"true\">{{ legend | uicTranslate }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [".scale{display:flex;gap:var(--uic-scale-gap, 6px);width:100%;padding:2px 0}.scale-point{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}.scale-btn{display:inline-flex;align-items:center;justify-content:center;padding:0;font:inherit;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.scale-btn:focus-visible{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.scale-btn:disabled{cursor:not-allowed}.scale--number .scale-point{flex:1 1 0}.scale--number .scale-btn{width:100%;min-width:28px;height:var(--uic-scale-btn-height, calc(4 * var(--form-ref)));border:solid var(--uic-input-border-width, 1px) var(--uic-scale-btn-border-color, var(--uic-neutral-300, var(--grey-300)));border-radius:var(--uic-scale-btn-radius, var(--input-radius));background:var(--uic-scale-btn-bg, var(--uic-surface, var(--white)));color:var(--uic-scale-btn-color, var(--uic-neutral-800, var(--grey-800)));font-size:.875rem;font-weight:500;font-variant-numeric:tabular-nums}.scale--number .scale-btn:hover:not(:disabled){border-color:var(--uic-scale-btn-border-color-hover, var(--primary-400))}.scale--number .scale-btn.is-selected{background:var(--uic-scale-selected-bg, var(--primary-600));border-color:var(--uic-scale-selected-bg, var(--primary-600));color:var(--uic-scale-selected-color, var(--white))}.scale--number .scale-btn:disabled{background:var(--disabled-background);color:var(--disabled-color)}.scale--icon .scale-btn{border:none;background:transparent;border-radius:50%;color:var(--uic-scale-icon-empty-color, var(--uic-neutral-300, var(--grey-300)));font-size:var(--uic-scale-icon-size, 32px);line-height:1}.scale--icon .scale-btn.is-filled{color:var(--uic-scale-icon-color, var(--yellow-500))}.scale--icon .scale-btn:hover:not(:disabled){transform:scale(1.12)}.scale-legend{width:100%;min-height:1em;font-size:var(--uic-scale-legend-font-size, .75rem);line-height:1.25;text-align:center;color:var(--uic-scale-legend-color, var(--uic-neutral-600, var(--grey-600)));overflow-wrap:anywhere}.scale--error .scale-btn{border-color:var(--uic-error-color, var(--red-500))}.scale--icon.scale--error .scale-btn:not(.is-filled){color:var(--uic-error-color, var(--red-500))}@media (prefers-reduced-motion: reduce){.scale-btn{transition:none}.scale--icon .scale-btn:hover:not(:disabled){transform:none}}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
4021
4043
|
}
|
|
4022
4044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicScaleComponent, decorators: [{
|
|
4023
4045
|
type: Component,
|
|
@@ -4027,7 +4049,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4027
4049
|
useExisting: forwardRef(() => UicScaleComponent),
|
|
4028
4050
|
multi: true
|
|
4029
4051
|
}
|
|
4030
|
-
], template: "<ui-input-wrapper\n [icon]=\"icon\"\n [iconColor]=\"iconColor\"\n [label]=\"label\"\n [error]=\"error\"\n [tip]=\"tip\"\n [disabled]=\"disabled\">\n <div\n class=\"scale\"\n role=\"radiogroup\"\n [class.scale--icon]=\"mode === 'icon'\"\n [class.scale--number]=\"mode !== 'icon'\"\n [class.scale--disabled]=\"disabled\"\n [class.scale--error]=\"!!error\"\n [attr.aria-label]=\"label || null\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n (keydown)=\"onKeydown($event)\"\n (focusout)=\"onFocusOut($event)\"\n (mouseleave)=\"hovered = null\">\n @for (point of points; track point) {\n @let legend = legendFor(point);\n <div class=\"scale-point\">\n <button\n type=\"button\"\n role=\"radio\"\n class=\"scale-btn\"\n [class.is-selected]=\"isSelected(point)\"\n [class.is-filled]=\"isFilled(point)\"\n [attr.aria-checked]=\"isSelected(point)\"\n [attr.aria-label]=\"legend ? point + ' \u2013 ' + legend : point\"\n [tabindex]=\"tabIndexFor(point)\"\n [disabled]=\"disabled\"\n (click)=\"select(point)\"\n (mouseenter)=\"hovered = point\">\n @if (mode === 'icon') {\n <i class=\"scale-icon {{ scaleIcon || 'ri-star-fill' }}\" aria-hidden=\"true\"></i>\n } @else {\n {{ point }}\n }\n </button>\n @if (hasLegends) {\n <span class=\"scale-legend\" aria-hidden=\"true\">{{ legend | uicTranslate }}</span>\n }\n </div>\n }\n </div>\n</ui-input-wrapper>\n", styles: [".scale{display:flex;gap:var(--uic-scale-gap, 6px);width:100%;padding:2px 0}.scale-point{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}.scale-btn{display:inline-flex;align-items:center;justify-content:center;padding:0;font:inherit;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.scale-btn:focus-visible{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.scale-btn:disabled{cursor:not-allowed}.scale--number .scale-point{flex:1 1 0}.scale--number .scale-btn{width:100%;min-width:28px;height:var(--uic-scale-btn-height, calc(4 * var(--form-ref)));border:solid var(--uic-input-border-width, 1px) var(--uic-scale-btn-border-color, var(--uic-neutral-300, var(--grey-300)));border-radius:var(--uic-scale-btn-radius, var(--input-radius));background:var(--uic-scale-btn-bg, var(--uic-surface, var(--white)));color:var(--uic-scale-btn-color, var(--uic-neutral-800, var(--grey-800)));font-size:.875rem;font-weight:500;font-variant-numeric:tabular-nums}.scale--number .scale-btn:hover:not(:disabled){border-color:var(--uic-scale-btn-border-color-hover, var(--primary-400))}.scale--number .scale-btn.is-selected{background:var(--uic-scale-selected-bg, var(--primary-600));border-color:var(--uic-scale-selected-bg, var(--primary-600));color:var(--uic-scale-selected-color, var(--white))}.scale--number .scale-btn:disabled{background:var(--disabled-background);color:var(--disabled-color)}.scale--icon .scale-btn{border:none;background:transparent;border-radius:50%;color:var(--uic-scale-icon-empty-color, var(--uic-neutral-300, var(--grey-300)));font-size:var(--uic-scale-icon-size, 32px);line-height:1}.scale--icon .scale-btn.is-filled{color:var(--uic-scale-icon-color, var(--yellow-500))}.scale--icon .scale-btn:hover:not(:disabled){transform:scale(1.12)}.scale-legend{width:100%;min-height:1em;font-size:var(--uic-scale-legend-font-size, .75rem);line-height:1.25;text-align:center;color:var(--uic-scale-legend-color, var(--uic-neutral-600, var(--grey-600)));overflow-wrap:anywhere}.scale--error .scale-btn{border-color:var(--uic-error-color, var(--red-500))}.scale--icon.scale--error .scale-btn:not(.is-filled){color:var(--uic-error-color, var(--red-500))}@media (prefers-reduced-motion: reduce){.scale-btn{transition:none}.scale--icon .scale-btn:hover:not(:disabled){transform:none}}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
4052
|
+
], template: "<ui-input-wrapper\r\n [icon]=\"icon\"\r\n [iconColor]=\"iconColor\"\r\n [label]=\"label\"\r\n [error]=\"error\"\r\n [tip]=\"tip\"\r\n [disabled]=\"disabled\">\r\n <div\r\n class=\"scale\"\r\n role=\"radiogroup\"\r\n [class.scale--icon]=\"mode === 'icon'\"\r\n [class.scale--number]=\"mode !== 'icon'\"\r\n [class.scale--disabled]=\"disabled\"\r\n [class.scale--error]=\"!!error\"\r\n [attr.aria-label]=\"label || null\"\r\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\r\n (keydown)=\"onKeydown($event)\"\r\n (focusout)=\"onFocusOut($event)\"\r\n (mouseleave)=\"hovered = null\">\r\n @for (point of points; track point) {\r\n @let legend = legendFor(point);\r\n <div class=\"scale-point\">\r\n <button\r\n type=\"button\"\r\n role=\"radio\"\r\n class=\"scale-btn\"\r\n [class.is-selected]=\"isSelected(point)\"\r\n [class.is-filled]=\"isFilled(point)\"\r\n [attr.aria-checked]=\"isSelected(point)\"\r\n [attr.aria-label]=\"legend ? point + ' \u2013 ' + legend : point\"\r\n [tabindex]=\"tabIndexFor(point)\"\r\n [disabled]=\"disabled\"\r\n (click)=\"select(point)\"\r\n (mouseenter)=\"hovered = point\">\r\n @if (mode === 'icon') {\r\n <i class=\"scale-icon {{ scaleIcon || 'ri-star-fill' }}\" aria-hidden=\"true\"></i>\r\n } @else {\r\n {{ point }}\r\n }\r\n </button>\r\n @if (hasLegends) {\r\n <span class=\"scale-legend\" aria-hidden=\"true\">{{ legend | uicTranslate }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [".scale{display:flex;gap:var(--uic-scale-gap, 6px);width:100%;padding:2px 0}.scale-point{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}.scale-btn{display:inline-flex;align-items:center;justify-content:center;padding:0;font:inherit;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.scale-btn:focus-visible{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.scale-btn:disabled{cursor:not-allowed}.scale--number .scale-point{flex:1 1 0}.scale--number .scale-btn{width:100%;min-width:28px;height:var(--uic-scale-btn-height, calc(4 * var(--form-ref)));border:solid var(--uic-input-border-width, 1px) var(--uic-scale-btn-border-color, var(--uic-neutral-300, var(--grey-300)));border-radius:var(--uic-scale-btn-radius, var(--input-radius));background:var(--uic-scale-btn-bg, var(--uic-surface, var(--white)));color:var(--uic-scale-btn-color, var(--uic-neutral-800, var(--grey-800)));font-size:.875rem;font-weight:500;font-variant-numeric:tabular-nums}.scale--number .scale-btn:hover:not(:disabled){border-color:var(--uic-scale-btn-border-color-hover, var(--primary-400))}.scale--number .scale-btn.is-selected{background:var(--uic-scale-selected-bg, var(--primary-600));border-color:var(--uic-scale-selected-bg, var(--primary-600));color:var(--uic-scale-selected-color, var(--white))}.scale--number .scale-btn:disabled{background:var(--disabled-background);color:var(--disabled-color)}.scale--icon .scale-btn{border:none;background:transparent;border-radius:50%;color:var(--uic-scale-icon-empty-color, var(--uic-neutral-300, var(--grey-300)));font-size:var(--uic-scale-icon-size, 32px);line-height:1}.scale--icon .scale-btn.is-filled{color:var(--uic-scale-icon-color, var(--yellow-500))}.scale--icon .scale-btn:hover:not(:disabled){transform:scale(1.12)}.scale-legend{width:100%;min-height:1em;font-size:var(--uic-scale-legend-font-size, .75rem);line-height:1.25;text-align:center;color:var(--uic-scale-legend-color, var(--uic-neutral-600, var(--grey-600)));overflow-wrap:anywhere}.scale--error .scale-btn{border-color:var(--uic-error-color, var(--red-500))}.scale--icon.scale--error .scale-btn:not(.is-filled){color:var(--uic-error-color, var(--red-500))}@media (prefers-reduced-motion: reduce){.scale-btn{transition:none}.scale--icon .scale-btn:hover:not(:disabled){transform:none}}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
4031
4053
|
}], propDecorators: { icon: [{
|
|
4032
4054
|
type: Input
|
|
4033
4055
|
}], iconColor: [{
|
|
@@ -4053,7 +4075,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4053
4075
|
}] } });
|
|
4054
4076
|
|
|
4055
4077
|
/** Tipos cuyo valor es una lista de opciones elegidas. */
|
|
4056
|
-
const MULTI_SELECTION_TYPES = new Set(['multyselect', 'pool']);
|
|
4078
|
+
const MULTI_SELECTION_TYPES = new Set(['multyselect', 'pool', 'chips']);
|
|
4057
4079
|
/**
|
|
4058
4080
|
* Valida la cantidad de opciones elegidas (multyselect y pool múltiple).
|
|
4059
4081
|
* Un valor vacío no falla por mínimo: para exigir al menos una respuesta se usa `required`.
|
|
@@ -4113,7 +4135,7 @@ function uicDistributionValidatorsFor(field) {
|
|
|
4113
4135
|
return field.type === 'distribution' ? [uicDistributionTotalValidator()] : [];
|
|
4114
4136
|
}
|
|
4115
4137
|
|
|
4116
|
-
const base$
|
|
4138
|
+
const base$5 = createValueAccessor();
|
|
4117
4139
|
let nextId$1 = 0;
|
|
4118
4140
|
/**
|
|
4119
4141
|
* Distribución porcentual: el usuario reparte el 100% entre las opciones.
|
|
@@ -4121,7 +4143,7 @@ let nextId$1 = 0;
|
|
|
4121
4143
|
* Los porcentajes son enteros entre 0 y 100; la validación de que sumen 100 está en el formulario
|
|
4122
4144
|
* (uicDistributionTotalValidator), este componente solo muestra el total y cuánto falta o sobra.
|
|
4123
4145
|
*/
|
|
4124
|
-
class UicDistributionComponent extends base$
|
|
4146
|
+
class UicDistributionComponent extends base$5 {
|
|
4125
4147
|
host = inject(ElementRef);
|
|
4126
4148
|
uid = `uic-distribution-${nextId$1++}`;
|
|
4127
4149
|
expected = UIC_DISTRIBUTION_TOTAL;
|
|
@@ -4157,6 +4179,26 @@ class UicDistributionComponent extends base$4 {
|
|
|
4157
4179
|
input.value = String(amount);
|
|
4158
4180
|
this.setAmount(option, amount);
|
|
4159
4181
|
}
|
|
4182
|
+
/** Máximo al que puede llegar la opción sin pasar de 100 (su valor + lo que falta). */
|
|
4183
|
+
capOf(option) {
|
|
4184
|
+
const amount = this.amountOf(option);
|
|
4185
|
+
return Math.min(this.expected, amount + Math.max(this.remaining, 0));
|
|
4186
|
+
}
|
|
4187
|
+
/**
|
|
4188
|
+
* Slider: el valor se detiene en lo disponible para no pasar de 100. Si ya se pasó (por el
|
|
4189
|
+
* input numérico o un valor inicial), solo se puede bajar.
|
|
4190
|
+
*/
|
|
4191
|
+
onSlide(option, event) {
|
|
4192
|
+
const input = event.target;
|
|
4193
|
+
const parsed = Math.round(Number(input.value));
|
|
4194
|
+
const current = this.amountOf(option);
|
|
4195
|
+
const cap = Math.max(this.capOf(option), Math.min(current, this.expected));
|
|
4196
|
+
const amount = Number.isFinite(parsed) ? Math.min(Math.max(parsed, 0), cap) : 0;
|
|
4197
|
+
if (String(amount) !== input.value)
|
|
4198
|
+
input.value = String(amount);
|
|
4199
|
+
if (amount !== current)
|
|
4200
|
+
this.setAmount(option, amount);
|
|
4201
|
+
}
|
|
4160
4202
|
/** Asigna a esta opción todo lo que falta para llegar a 100. */
|
|
4161
4203
|
fillRemaining(option) {
|
|
4162
4204
|
if (this.disabled || this.remaining <= 0)
|
|
@@ -4203,7 +4245,7 @@ class UicDistributionComponent extends base$4 {
|
|
|
4203
4245
|
useExisting: forwardRef(() => UicDistributionComponent),
|
|
4204
4246
|
multi: true
|
|
4205
4247
|
}
|
|
4206
|
-
], usesInheritance: true, ngImport: i0, template: "<ui-input-wrapper\n [icon]=\"icon\"\n [iconColor]=\"iconColor\"\n [label]=\"label\"\n [error]=\"displayedError\"\n [tip]=\"tip\"\n [disabled]=\"disabled\">\n <div\n class=\"dist\"\n role=\"group\"\n [class.dist--disabled]=\"disabled\"\n [class.dist--error]=\"!!displayedError\"\n [attr.aria-label]=\"label || null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\">\n @for (option of validOptions; track option.id; let i = $index) {\n @let amount = amountOf(option);\n <div class=\"dist-row\" [class.has-value]=\"amount > 0\">\n <label class=\"dist-label\" [for]=\"inputId(i)\">\n @if (option.icon) {\n <i class=\"dist-option-icon {{ option.icon }} f-{{ option.iconColor || 'black' }}\" aria-hidden=\"true\"></i>\n }\n <span>{{ option.text | uicTranslate }}</span>\n </label>\n <div class=\"dist-bar\" aria-hidden=\"true\">\n <span class=\"dist-bar-fill\" [style.width.%]=\"amount\"></span>\n </div>\n <div class=\"dist-input\">\n <input\n type=\"number\"\n inputmode=\"numeric\"\n min=\"0\"\n [max]=\"expected\"\n step=\"1\"\n placeholder=\"0\"\n [id]=\"inputId(i)\"\n [value]=\"amount || ''\"\n [disabled]=\"disabled\"\n (input)=\"onInput(option, $event)\">\n <span class=\"dist-unit\" aria-hidden=\"true\">%</span>\n </div>\n @if (!disabled && remaining > 0) {\n <button\n type=\"button\"\n class=\"dist-fill\"\n [attr.aria-label]=\"'distribution.fill_remaining' | uicTranslate: { remaining: remaining, option: (option.text | uicTranslate) }\"\n [title]=\"'distribution.fill_remaining' | uicTranslate: { remaining: remaining, option: (option.text | uicTranslate) }\"\n (click)=\"fillRemaining(option)\">+{{ remaining }}</button>\n } @else {\n <span class=\"dist-fill-spacer\" aria-hidden=\"true\"></span>\n }\n </div>\n } @empty {\n <p class=\"dist-empty\">{{ 'distribution.no_options' | uicTranslate }}</p>\n }\n\n @if (validOptions.length) {\n <div\n class=\"dist-total\"\n aria-live=\"polite\"\n [class.is-complete]=\"total === expected\"\n [class.is-over]=\"total > expected\">\n <span class=\"dist-total-label\">{{ 'distribution.total' | uicTranslate }}</span>\n <b class=\"dist-total-value\">{{ total }}%</b>\n <span class=\"dist-total-status\">\n @if (total === expected) {\n <i class=\"ri-checkbox-circle-fill\" aria-hidden=\"true\"></i>\n {{ 'distribution.complete' | uicTranslate }}\n } @else if (total > expected) {\n {{ 'distribution.over' | uicTranslate: { amount: total - expected } }}\n } @else {\n {{ 'distribution.missing' | uicTranslate: { amount: remaining } }}\n }\n </span>\n @if (!disabled && total > 0) {\n <button type=\"button\" class=\"dist-clear\" (click)=\"clear()\">{{ 'distribution.clear' | uicTranslate }}</button>\n }\n </div>\n }\n </div>\n</ui-input-wrapper>\n", styles: [".dist{display:flex;flex-direction:column;gap:var(--uic-distribution-gap, 8px);width:100%;padding:2px 0}.dist-row{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(40px,1fr) var(--uic-distribution-input-width, 72px) 44px;align-items:center;gap:10px}.dist-label{display:flex;align-items:center;gap:6px;min-width:0;font-size:.875rem;color:var(--uic-neutral-800, var(--grey-800));cursor:pointer}.dist-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dist-option-icon{flex:0 0 auto;font-size:16px}.dist-bar{height:8px;border-radius:4px;background-color:var(--uic-distribution-bar-bg, var(--uic-neutral-100, var(--grey-100)));overflow:hidden}.dist-bar-fill{display:block;height:100%;border-radius:inherit;background-color:var(--uic-distribution-bar-fill, var(--primary-500));transition:width .2s ease}.dist-input{position:relative;display:flex;align-items:center}.dist-input input{width:100%;height:calc(4 * var(--form-ref));padding:0 22px 0 8px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:var(--input-radius);background-color:var(--uic-surface, var(--white));color:var(--uic-neutral-800, var(--grey-800));font:inherit;text-align:right;-moz-appearance:textfield;appearance:textfield}.dist-input input::-webkit-outer-spin-button,.dist-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.dist-input input:focus{outline:none;border-color:var(--primary-500)}.dist-input input:disabled{background-color:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-500, var(--grey-500));cursor:not-allowed}.dist-unit{position:absolute;right:8px;font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500));pointer-events:none}.dist-fill{height:26px;padding:0 6px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:13px;background:var(--uic-surface, var(--white));color:var(--primary-600);font-size:11px;font-weight:600;cursor:pointer;opacity:0;transition:opacity .15s ease}.dist-fill:hover{border-color:var(--primary-400)}.dist-fill:focus-visible{opacity:1;outline:solid 2px var(--primary-400);outline-offset:1px}.dist-row:hover .dist-fill,.dist-row:focus-within .dist-fill{opacity:1}@media (hover: none){.dist-fill{opacity:1}}.dist-total{display:flex;align-items:center;gap:8px;padding-top:8px;border-top:solid 1px var(--uic-neutral-200, var(--grey-200));font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}.dist-total-value{font-size:15px;color:var(--uic-neutral-800, var(--grey-800))}.dist-total-status{display:inline-flex;align-items:center;gap:4px}.dist-total.is-complete .dist-total-value,.dist-total.is-complete .dist-total-status{color:var(--uic-distribution-complete-color, var(--green-600))}.dist-total.is-over .dist-total-value,.dist-total.is-over .dist-total-status{color:var(--uic-distribution-over-color, var(--red-600))}.dist-clear{margin-left:auto;border:none;background:none;color:var(--uic-neutral-500, var(--grey-500));font-size:12px;text-decoration:underline;cursor:pointer}.dist-clear:hover{color:var(--uic-neutral-800, var(--grey-800))}.dist--error .dist-total:not(.is-complete) .dist-total-value{color:var(--uic-distribution-over-color, var(--red-600))}.dist-empty{font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}@media (max-width: 480px){.dist-row{grid-template-columns:minmax(0,1fr) var(--uic-distribution-input-width, 72px) 44px;grid-template-areas:\"label input fill\" \"bar bar bar\";row-gap:4px}.dist-label{grid-area:label}.dist-input{grid-area:input}.dist-fill,.dist-fill-spacer{grid-area:fill}.dist-bar{grid-area:bar}}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
4248
|
+
], usesInheritance: true, ngImport: i0, template: "<ui-input-wrapper\r\n [icon]=\"icon\"\r\n [iconColor]=\"iconColor\"\r\n [label]=\"label\"\r\n [error]=\"displayedError\"\r\n [tip]=\"tip\"\r\n [disabled]=\"disabled\">\r\n <div\r\n class=\"dist\"\r\n role=\"group\"\r\n [class.dist--disabled]=\"disabled\"\r\n [class.dist--error]=\"!!displayedError\"\r\n [attr.aria-label]=\"label || null\"\r\n (focusin)=\"onFocusIn()\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @for (option of validOptions; track option.id; let i = $index) {\r\n @let amount = amountOf(option);\r\n <div class=\"dist-row\" [class.has-value]=\"amount > 0\">\r\n <label class=\"dist-label\" [for]=\"inputId(i)\">\r\n @if (option.icon) {\r\n <i class=\"dist-option-icon {{ option.icon }} f-{{ option.iconColor || 'black' }}\" aria-hidden=\"true\"></i>\r\n }\r\n <span>{{ option.text | uicTranslate }}</span>\r\n </label>\r\n <!-- Slider: se arrastra hasta lo que queda disponible (tramo claro); no pasa de 100% -->\r\n <div\r\n class=\"dist-slider\"\r\n [style.--dist-pct]=\"amount + '%'\"\r\n [style.--dist-cap]=\"capOf(option) + '%'\">\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n [max]=\"expected\"\r\n step=\"1\"\r\n [value]=\"amount\"\r\n [disabled]=\"disabled\"\r\n [attr.aria-label]=\"option.text | uicTranslate\"\r\n [attr.aria-valuetext]=\"amount + '%'\"\r\n (input)=\"onSlide(option, $event)\">\r\n </div>\r\n <div class=\"dist-input\">\r\n <input\r\n type=\"number\"\r\n inputmode=\"numeric\"\r\n min=\"0\"\r\n [max]=\"expected\"\r\n step=\"1\"\r\n placeholder=\"0\"\r\n [id]=\"inputId(i)\"\r\n [value]=\"amount || ''\"\r\n [disabled]=\"disabled\"\r\n (input)=\"onInput(option, $event)\">\r\n <span class=\"dist-unit\" aria-hidden=\"true\">%</span>\r\n </div>\r\n @if (!disabled && remaining > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"dist-fill\"\r\n [attr.aria-label]=\"'distribution.fill_remaining' | uicTranslate: { remaining: remaining, option: (option.text | uicTranslate) }\"\r\n [title]=\"'distribution.fill_remaining' | uicTranslate: { remaining: remaining, option: (option.text | uicTranslate) }\"\r\n (click)=\"fillRemaining(option)\">+{{ remaining }}</button>\r\n } @else {\r\n <span class=\"dist-fill-spacer\" aria-hidden=\"true\"></span>\r\n }\r\n </div>\r\n } @empty {\r\n <p class=\"dist-empty\">{{ 'distribution.no_options' | uicTranslate }}</p>\r\n }\r\n\r\n @if (validOptions.length) {\r\n <div\r\n class=\"dist-total\"\r\n aria-live=\"polite\"\r\n [class.is-complete]=\"total === expected\"\r\n [class.is-over]=\"total > expected\">\r\n <span class=\"dist-total-label\">{{ 'distribution.total' | uicTranslate }}</span>\r\n <b class=\"dist-total-value\">{{ total }}%</b>\r\n <span class=\"dist-total-status\">\r\n @if (total === expected) {\r\n <i class=\"ri-checkbox-circle-fill\" aria-hidden=\"true\"></i>\r\n {{ 'distribution.complete' | uicTranslate }}\r\n } @else if (total > expected) {\r\n {{ 'distribution.over' | uicTranslate: { amount: total - expected } }}\r\n } @else {\r\n {{ 'distribution.missing' | uicTranslate: { amount: remaining } }}\r\n }\r\n </span>\r\n @if (!disabled && total > 0) {\r\n <button type=\"button\" class=\"dist-clear\" (click)=\"clear()\">{{ 'distribution.clear' | uicTranslate }}</button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [".dist{display:flex;flex-direction:column;gap:var(--uic-distribution-gap, 8px);width:100%;padding:2px 0}.dist-row{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(96px,1.6fr) var(--uic-distribution-input-width, 72px) 44px;align-items:center;gap:10px}.dist-label{display:flex;align-items:center;gap:6px;min-width:0;font-size:.875rem;color:var(--uic-neutral-800, var(--grey-800));cursor:pointer}.dist-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dist-option-icon{flex:0 0 auto;font-size:16px}.dist-slider{--dist-track: linear-gradient( to right, var(--uic-distribution-bar-fill, var(--primary-500)) 0 var(--dist-pct, 0%), var(--uic-distribution-bar-available, var(--primary-100)) var(--dist-pct, 0%) var(--dist-cap, 0%), var(--uic-distribution-bar-bg, var(--uic-neutral-100, var(--grey-100))) var(--dist-cap, 0%) 100% );display:flex;align-items:center;min-width:0}.dist-slider input[type=range]{width:100%;height:24px;margin:0;background:transparent;cursor:pointer;-webkit-appearance:none;appearance:none}.dist-slider input[type=range]::-webkit-slider-runnable-track{height:8px;border-radius:4px;background:var(--dist-track)}.dist-slider input[type=range]::-moz-range-track{height:8px;border-radius:4px;background:var(--dist-track)}.dist-slider input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:18px;height:18px;margin-top:-5px;border:solid 2px var(--uic-distribution-bar-fill, var(--primary-500));border-radius:50%;background:var(--uic-surface, var(--white));box-shadow:0 1px 3px #0003;transition:transform .15s ease}.dist-slider input[type=range]::-moz-range-thumb{width:18px;height:18px;box-sizing:border-box;border:solid 2px var(--uic-distribution-bar-fill, var(--primary-500));border-radius:50%;background:var(--uic-surface, var(--white));box-shadow:0 1px 3px #0003}.dist-slider input[type=range]:hover::-webkit-slider-thumb,.dist-slider input[type=range]:active::-webkit-slider-thumb{transform:scale(1.15)}.dist-slider input[type=range]:focus{outline:none}.dist-slider input[type=range]:focus-visible::-webkit-slider-thumb{outline:solid 2px var(--primary-400);outline-offset:2px}.dist-slider input[type=range]:focus-visible::-moz-range-thumb{outline:solid 2px var(--primary-400);outline-offset:2px}.dist-slider input[type=range]:disabled{cursor:not-allowed}.dist-slider input[type=range]:disabled::-webkit-slider-thumb{border-color:var(--uic-neutral-500, var(--grey-500));box-shadow:none}.dist-slider input[type=range]:disabled::-moz-range-thumb{border-color:var(--uic-neutral-500, var(--grey-500));box-shadow:none}.dist--disabled .dist-slider{--dist-track: linear-gradient( to right, var(--uic-neutral-500, var(--grey-500)) 0 var(--dist-pct, 0%), var(--uic-distribution-bar-bg, var(--uic-neutral-100, var(--grey-100))) var(--dist-pct, 0%) 100% )}.dist-input{position:relative;display:flex;align-items:center}.dist-input input{width:100%;height:calc(4 * var(--form-ref));padding:0 22px 0 8px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:var(--input-radius);background-color:var(--uic-surface, var(--white));color:var(--uic-neutral-800, var(--grey-800));font:inherit;text-align:right;-moz-appearance:textfield;appearance:textfield}.dist-input input::-webkit-outer-spin-button,.dist-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.dist-input input:focus{outline:none;border-color:var(--primary-500)}.dist-input input:disabled{background-color:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-500, var(--grey-500));cursor:not-allowed}.dist-unit{position:absolute;right:8px;font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500));pointer-events:none}.dist-fill{height:26px;padding:0 6px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:13px;background:var(--uic-surface, var(--white));color:var(--primary-600);font-size:11px;font-weight:600;cursor:pointer;opacity:0;transition:opacity .15s ease}.dist-fill:hover{border-color:var(--primary-400)}.dist-fill:focus-visible{opacity:1;outline:solid 2px var(--primary-400);outline-offset:1px}.dist-row:hover .dist-fill,.dist-row:focus-within .dist-fill{opacity:1}@media (hover: none){.dist-fill{opacity:1}}.dist-total{display:flex;align-items:center;gap:8px;padding-top:8px;border-top:solid 1px var(--uic-neutral-200, var(--grey-200));font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}.dist-total-value{font-size:15px;color:var(--uic-neutral-800, var(--grey-800))}.dist-total-status{display:inline-flex;align-items:center;gap:4px}.dist-total.is-complete .dist-total-value,.dist-total.is-complete .dist-total-status{color:var(--uic-distribution-complete-color, var(--green-600))}.dist-total.is-over .dist-total-value,.dist-total.is-over .dist-total-status{color:var(--uic-distribution-over-color, var(--red-600))}.dist-clear{margin-left:auto;border:none;background:none;color:var(--uic-neutral-500, var(--grey-500));font-size:12px;text-decoration:underline;cursor:pointer}.dist-clear:hover{color:var(--uic-neutral-800, var(--grey-800))}.dist--error .dist-total:not(.is-complete) .dist-total-value{color:var(--uic-distribution-over-color, var(--red-600))}.dist-empty{font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}@media (max-width: 480px){.dist-row{grid-template-columns:minmax(0,1fr) var(--uic-distribution-input-width, 72px) 44px;grid-template-areas:\"label input fill\" \"slider slider slider\";row-gap:4px}.dist-label{grid-area:label}.dist-input{grid-area:input}.dist-fill,.dist-fill-spacer{grid-area:fill}.dist-slider{grid-area:slider}}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
4207
4249
|
}
|
|
4208
4250
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDistributionComponent, decorators: [{
|
|
4209
4251
|
type: Component,
|
|
@@ -4213,7 +4255,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4213
4255
|
useExisting: forwardRef(() => UicDistributionComponent),
|
|
4214
4256
|
multi: true
|
|
4215
4257
|
}
|
|
4216
|
-
], template: "<ui-input-wrapper\n [icon]=\"icon\"\n [iconColor]=\"iconColor\"\n [label]=\"label\"\n [error]=\"displayedError\"\n [tip]=\"tip\"\n [disabled]=\"disabled\">\n <div\n class=\"dist\"\n role=\"group\"\n [class.dist--disabled]=\"disabled\"\n [class.dist--error]=\"!!displayedError\"\n [attr.aria-label]=\"label || null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\">\n @for (option of validOptions; track option.id; let i = $index) {\n @let amount = amountOf(option);\n <div class=\"dist-row\" [class.has-value]=\"amount > 0\">\n <label class=\"dist-label\" [for]=\"inputId(i)\">\n @if (option.icon) {\n <i class=\"dist-option-icon {{ option.icon }} f-{{ option.iconColor || 'black' }}\" aria-hidden=\"true\"></i>\n }\n <span>{{ option.text | uicTranslate }}</span>\n </label>\n <div class=\"dist-bar\" aria-hidden=\"true\">\n <span class=\"dist-bar-fill\" [style.width.%]=\"amount\"></span>\n </div>\n <div class=\"dist-input\">\n <input\n type=\"number\"\n inputmode=\"numeric\"\n min=\"0\"\n [max]=\"expected\"\n step=\"1\"\n placeholder=\"0\"\n [id]=\"inputId(i)\"\n [value]=\"amount || ''\"\n [disabled]=\"disabled\"\n (input)=\"onInput(option, $event)\">\n <span class=\"dist-unit\" aria-hidden=\"true\">%</span>\n </div>\n @if (!disabled && remaining > 0) {\n <button\n type=\"button\"\n class=\"dist-fill\"\n [attr.aria-label]=\"'distribution.fill_remaining' | uicTranslate: { remaining: remaining, option: (option.text | uicTranslate) }\"\n [title]=\"'distribution.fill_remaining' | uicTranslate: { remaining: remaining, option: (option.text | uicTranslate) }\"\n (click)=\"fillRemaining(option)\">+{{ remaining }}</button>\n } @else {\n <span class=\"dist-fill-spacer\" aria-hidden=\"true\"></span>\n }\n </div>\n } @empty {\n <p class=\"dist-empty\">{{ 'distribution.no_options' | uicTranslate }}</p>\n }\n\n @if (validOptions.length) {\n <div\n class=\"dist-total\"\n aria-live=\"polite\"\n [class.is-complete]=\"total === expected\"\n [class.is-over]=\"total > expected\">\n <span class=\"dist-total-label\">{{ 'distribution.total' | uicTranslate }}</span>\n <b class=\"dist-total-value\">{{ total }}%</b>\n <span class=\"dist-total-status\">\n @if (total === expected) {\n <i class=\"ri-checkbox-circle-fill\" aria-hidden=\"true\"></i>\n {{ 'distribution.complete' | uicTranslate }}\n } @else if (total > expected) {\n {{ 'distribution.over' | uicTranslate: { amount: total - expected } }}\n } @else {\n {{ 'distribution.missing' | uicTranslate: { amount: remaining } }}\n }\n </span>\n @if (!disabled && total > 0) {\n <button type=\"button\" class=\"dist-clear\" (click)=\"clear()\">{{ 'distribution.clear' | uicTranslate }}</button>\n }\n </div>\n }\n </div>\n</ui-input-wrapper>\n", styles: [".dist{display:flex;flex-direction:column;gap:var(--uic-distribution-gap, 8px);width:100%;padding:2px 0}.dist-row{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(40px,1fr) var(--uic-distribution-input-width, 72px) 44px;align-items:center;gap:10px}.dist-label{display:flex;align-items:center;gap:6px;min-width:0;font-size:.875rem;color:var(--uic-neutral-800, var(--grey-800));cursor:pointer}.dist-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dist-option-icon{flex:0 0 auto;font-size:16px}.dist-bar{height:8px;border-radius:4px;background-color:var(--uic-distribution-bar-bg, var(--uic-neutral-100, var(--grey-100)));overflow:hidden}.dist-bar-fill{display:block;height:100%;border-radius:inherit;background-color:var(--uic-distribution-bar-fill, var(--primary-500));transition:width .2s ease}.dist-input{position:relative;display:flex;align-items:center}.dist-input input{width:100%;height:calc(4 * var(--form-ref));padding:0 22px 0 8px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:var(--input-radius);background-color:var(--uic-surface, var(--white));color:var(--uic-neutral-800, var(--grey-800));font:inherit;text-align:right;-moz-appearance:textfield;appearance:textfield}.dist-input input::-webkit-outer-spin-button,.dist-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.dist-input input:focus{outline:none;border-color:var(--primary-500)}.dist-input input:disabled{background-color:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-500, var(--grey-500));cursor:not-allowed}.dist-unit{position:absolute;right:8px;font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500));pointer-events:none}.dist-fill{height:26px;padding:0 6px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:13px;background:var(--uic-surface, var(--white));color:var(--primary-600);font-size:11px;font-weight:600;cursor:pointer;opacity:0;transition:opacity .15s ease}.dist-fill:hover{border-color:var(--primary-400)}.dist-fill:focus-visible{opacity:1;outline:solid 2px var(--primary-400);outline-offset:1px}.dist-row:hover .dist-fill,.dist-row:focus-within .dist-fill{opacity:1}@media (hover: none){.dist-fill{opacity:1}}.dist-total{display:flex;align-items:center;gap:8px;padding-top:8px;border-top:solid 1px var(--uic-neutral-200, var(--grey-200));font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}.dist-total-value{font-size:15px;color:var(--uic-neutral-800, var(--grey-800))}.dist-total-status{display:inline-flex;align-items:center;gap:4px}.dist-total.is-complete .dist-total-value,.dist-total.is-complete .dist-total-status{color:var(--uic-distribution-complete-color, var(--green-600))}.dist-total.is-over .dist-total-value,.dist-total.is-over .dist-total-status{color:var(--uic-distribution-over-color, var(--red-600))}.dist-clear{margin-left:auto;border:none;background:none;color:var(--uic-neutral-500, var(--grey-500));font-size:12px;text-decoration:underline;cursor:pointer}.dist-clear:hover{color:var(--uic-neutral-800, var(--grey-800))}.dist--error .dist-total:not(.is-complete) .dist-total-value{color:var(--uic-distribution-over-color, var(--red-600))}.dist-empty{font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}@media (max-width: 480px){.dist-row{grid-template-columns:minmax(0,1fr) var(--uic-distribution-input-width, 72px) 44px;grid-template-areas:\"label input fill\" \"bar bar bar\";row-gap:4px}.dist-label{grid-area:label}.dist-input{grid-area:input}.dist-fill,.dist-fill-spacer{grid-area:fill}.dist-bar{grid-area:bar}}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
4258
|
+
], template: "<ui-input-wrapper\r\n [icon]=\"icon\"\r\n [iconColor]=\"iconColor\"\r\n [label]=\"label\"\r\n [error]=\"displayedError\"\r\n [tip]=\"tip\"\r\n [disabled]=\"disabled\">\r\n <div\r\n class=\"dist\"\r\n role=\"group\"\r\n [class.dist--disabled]=\"disabled\"\r\n [class.dist--error]=\"!!displayedError\"\r\n [attr.aria-label]=\"label || null\"\r\n (focusin)=\"onFocusIn()\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @for (option of validOptions; track option.id; let i = $index) {\r\n @let amount = amountOf(option);\r\n <div class=\"dist-row\" [class.has-value]=\"amount > 0\">\r\n <label class=\"dist-label\" [for]=\"inputId(i)\">\r\n @if (option.icon) {\r\n <i class=\"dist-option-icon {{ option.icon }} f-{{ option.iconColor || 'black' }}\" aria-hidden=\"true\"></i>\r\n }\r\n <span>{{ option.text | uicTranslate }}</span>\r\n </label>\r\n <!-- Slider: se arrastra hasta lo que queda disponible (tramo claro); no pasa de 100% -->\r\n <div\r\n class=\"dist-slider\"\r\n [style.--dist-pct]=\"amount + '%'\"\r\n [style.--dist-cap]=\"capOf(option) + '%'\">\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n [max]=\"expected\"\r\n step=\"1\"\r\n [value]=\"amount\"\r\n [disabled]=\"disabled\"\r\n [attr.aria-label]=\"option.text | uicTranslate\"\r\n [attr.aria-valuetext]=\"amount + '%'\"\r\n (input)=\"onSlide(option, $event)\">\r\n </div>\r\n <div class=\"dist-input\">\r\n <input\r\n type=\"number\"\r\n inputmode=\"numeric\"\r\n min=\"0\"\r\n [max]=\"expected\"\r\n step=\"1\"\r\n placeholder=\"0\"\r\n [id]=\"inputId(i)\"\r\n [value]=\"amount || ''\"\r\n [disabled]=\"disabled\"\r\n (input)=\"onInput(option, $event)\">\r\n <span class=\"dist-unit\" aria-hidden=\"true\">%</span>\r\n </div>\r\n @if (!disabled && remaining > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"dist-fill\"\r\n [attr.aria-label]=\"'distribution.fill_remaining' | uicTranslate: { remaining: remaining, option: (option.text | uicTranslate) }\"\r\n [title]=\"'distribution.fill_remaining' | uicTranslate: { remaining: remaining, option: (option.text | uicTranslate) }\"\r\n (click)=\"fillRemaining(option)\">+{{ remaining }}</button>\r\n } @else {\r\n <span class=\"dist-fill-spacer\" aria-hidden=\"true\"></span>\r\n }\r\n </div>\r\n } @empty {\r\n <p class=\"dist-empty\">{{ 'distribution.no_options' | uicTranslate }}</p>\r\n }\r\n\r\n @if (validOptions.length) {\r\n <div\r\n class=\"dist-total\"\r\n aria-live=\"polite\"\r\n [class.is-complete]=\"total === expected\"\r\n [class.is-over]=\"total > expected\">\r\n <span class=\"dist-total-label\">{{ 'distribution.total' | uicTranslate }}</span>\r\n <b class=\"dist-total-value\">{{ total }}%</b>\r\n <span class=\"dist-total-status\">\r\n @if (total === expected) {\r\n <i class=\"ri-checkbox-circle-fill\" aria-hidden=\"true\"></i>\r\n {{ 'distribution.complete' | uicTranslate }}\r\n } @else if (total > expected) {\r\n {{ 'distribution.over' | uicTranslate: { amount: total - expected } }}\r\n } @else {\r\n {{ 'distribution.missing' | uicTranslate: { amount: remaining } }}\r\n }\r\n </span>\r\n @if (!disabled && total > 0) {\r\n <button type=\"button\" class=\"dist-clear\" (click)=\"clear()\">{{ 'distribution.clear' | uicTranslate }}</button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [".dist{display:flex;flex-direction:column;gap:var(--uic-distribution-gap, 8px);width:100%;padding:2px 0}.dist-row{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(96px,1.6fr) var(--uic-distribution-input-width, 72px) 44px;align-items:center;gap:10px}.dist-label{display:flex;align-items:center;gap:6px;min-width:0;font-size:.875rem;color:var(--uic-neutral-800, var(--grey-800));cursor:pointer}.dist-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dist-option-icon{flex:0 0 auto;font-size:16px}.dist-slider{--dist-track: linear-gradient( to right, var(--uic-distribution-bar-fill, var(--primary-500)) 0 var(--dist-pct, 0%), var(--uic-distribution-bar-available, var(--primary-100)) var(--dist-pct, 0%) var(--dist-cap, 0%), var(--uic-distribution-bar-bg, var(--uic-neutral-100, var(--grey-100))) var(--dist-cap, 0%) 100% );display:flex;align-items:center;min-width:0}.dist-slider input[type=range]{width:100%;height:24px;margin:0;background:transparent;cursor:pointer;-webkit-appearance:none;appearance:none}.dist-slider input[type=range]::-webkit-slider-runnable-track{height:8px;border-radius:4px;background:var(--dist-track)}.dist-slider input[type=range]::-moz-range-track{height:8px;border-radius:4px;background:var(--dist-track)}.dist-slider input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:18px;height:18px;margin-top:-5px;border:solid 2px var(--uic-distribution-bar-fill, var(--primary-500));border-radius:50%;background:var(--uic-surface, var(--white));box-shadow:0 1px 3px #0003;transition:transform .15s ease}.dist-slider input[type=range]::-moz-range-thumb{width:18px;height:18px;box-sizing:border-box;border:solid 2px var(--uic-distribution-bar-fill, var(--primary-500));border-radius:50%;background:var(--uic-surface, var(--white));box-shadow:0 1px 3px #0003}.dist-slider input[type=range]:hover::-webkit-slider-thumb,.dist-slider input[type=range]:active::-webkit-slider-thumb{transform:scale(1.15)}.dist-slider input[type=range]:focus{outline:none}.dist-slider input[type=range]:focus-visible::-webkit-slider-thumb{outline:solid 2px var(--primary-400);outline-offset:2px}.dist-slider input[type=range]:focus-visible::-moz-range-thumb{outline:solid 2px var(--primary-400);outline-offset:2px}.dist-slider input[type=range]:disabled{cursor:not-allowed}.dist-slider input[type=range]:disabled::-webkit-slider-thumb{border-color:var(--uic-neutral-500, var(--grey-500));box-shadow:none}.dist-slider input[type=range]:disabled::-moz-range-thumb{border-color:var(--uic-neutral-500, var(--grey-500));box-shadow:none}.dist--disabled .dist-slider{--dist-track: linear-gradient( to right, var(--uic-neutral-500, var(--grey-500)) 0 var(--dist-pct, 0%), var(--uic-distribution-bar-bg, var(--uic-neutral-100, var(--grey-100))) var(--dist-pct, 0%) 100% )}.dist-input{position:relative;display:flex;align-items:center}.dist-input input{width:100%;height:calc(4 * var(--form-ref));padding:0 22px 0 8px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:var(--input-radius);background-color:var(--uic-surface, var(--white));color:var(--uic-neutral-800, var(--grey-800));font:inherit;text-align:right;-moz-appearance:textfield;appearance:textfield}.dist-input input::-webkit-outer-spin-button,.dist-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.dist-input input:focus{outline:none;border-color:var(--primary-500)}.dist-input input:disabled{background-color:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-500, var(--grey-500));cursor:not-allowed}.dist-unit{position:absolute;right:8px;font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500));pointer-events:none}.dist-fill{height:26px;padding:0 6px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:13px;background:var(--uic-surface, var(--white));color:var(--primary-600);font-size:11px;font-weight:600;cursor:pointer;opacity:0;transition:opacity .15s ease}.dist-fill:hover{border-color:var(--primary-400)}.dist-fill:focus-visible{opacity:1;outline:solid 2px var(--primary-400);outline-offset:1px}.dist-row:hover .dist-fill,.dist-row:focus-within .dist-fill{opacity:1}@media (hover: none){.dist-fill{opacity:1}}.dist-total{display:flex;align-items:center;gap:8px;padding-top:8px;border-top:solid 1px var(--uic-neutral-200, var(--grey-200));font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}.dist-total-value{font-size:15px;color:var(--uic-neutral-800, var(--grey-800))}.dist-total-status{display:inline-flex;align-items:center;gap:4px}.dist-total.is-complete .dist-total-value,.dist-total.is-complete .dist-total-status{color:var(--uic-distribution-complete-color, var(--green-600))}.dist-total.is-over .dist-total-value,.dist-total.is-over .dist-total-status{color:var(--uic-distribution-over-color, var(--red-600))}.dist-clear{margin-left:auto;border:none;background:none;color:var(--uic-neutral-500, var(--grey-500));font-size:12px;text-decoration:underline;cursor:pointer}.dist-clear:hover{color:var(--uic-neutral-800, var(--grey-800))}.dist--error .dist-total:not(.is-complete) .dist-total-value{color:var(--uic-distribution-over-color, var(--red-600))}.dist-empty{font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}@media (max-width: 480px){.dist-row{grid-template-columns:minmax(0,1fr) var(--uic-distribution-input-width, 72px) 44px;grid-template-areas:\"label input fill\" \"slider slider slider\";row-gap:4px}.dist-label{grid-area:label}.dist-input{grid-area:input}.dist-fill,.dist-fill-spacer{grid-area:fill}.dist-slider{grid-area:slider}}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
4217
4259
|
}], propDecorators: { icon: [{
|
|
4218
4260
|
type: Input
|
|
4219
4261
|
}], iconColor: [{
|
|
@@ -4230,6 +4272,181 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4230
4272
|
type: Input
|
|
4231
4273
|
}] } });
|
|
4232
4274
|
|
|
4275
|
+
const base$4 = createValueAccessor();
|
|
4276
|
+
/** Separadores al pegar texto: coma, punto y coma y saltos de línea. */
|
|
4277
|
+
const PASTE_SEPARATORS = /[,;\n\r]+/;
|
|
4278
|
+
/**
|
|
4279
|
+
* Lista de textos libres como chips (hobbies, etiquetas, palabras clave...).
|
|
4280
|
+
* Enter o coma agregan el texto escrito; Retroceso con el campo vacío quita el último; al pegar
|
|
4281
|
+
* texto con comas, punto y coma o saltos de línea se agrega un chip por parte. Al salir del campo
|
|
4282
|
+
* se agrega lo que quedó escrito.
|
|
4283
|
+
* Valor: string[] (sin repetidos, sin distinguir mayúsculas), o null si no hay ninguno.
|
|
4284
|
+
*/
|
|
4285
|
+
class UicChipsInputComponent extends base$4 {
|
|
4286
|
+
icon = '';
|
|
4287
|
+
iconColor = 'black';
|
|
4288
|
+
label = '';
|
|
4289
|
+
error = '';
|
|
4290
|
+
tip = '';
|
|
4291
|
+
disabled = false;
|
|
4292
|
+
placeholder = 'chips_input.placeholder';
|
|
4293
|
+
/** Máximo de chips (null = sin límite). Al alcanzarlo se oculta el campo de texto. */
|
|
4294
|
+
maxItems = null;
|
|
4295
|
+
/** Largo máximo de cada chip. */
|
|
4296
|
+
maxLength = null;
|
|
4297
|
+
textInput;
|
|
4298
|
+
/** Texto que se está escribiendo (aún no es chip). */
|
|
4299
|
+
draft = '';
|
|
4300
|
+
/** Chip ya existente que se intentó repetir (se resalta un momento). */
|
|
4301
|
+
duplicated = null;
|
|
4302
|
+
duplicatedTimer = null;
|
|
4303
|
+
get items() {
|
|
4304
|
+
return Array.isArray(this.value) ? this.value : [];
|
|
4305
|
+
}
|
|
4306
|
+
get isFull() {
|
|
4307
|
+
return typeof this.maxItems === 'number' && this.maxItems > 0 && this.items.length >= this.maxItems;
|
|
4308
|
+
}
|
|
4309
|
+
focusInput() {
|
|
4310
|
+
if (!this.disabled)
|
|
4311
|
+
this.textInput?.nativeElement.focus();
|
|
4312
|
+
}
|
|
4313
|
+
onDraftInput(event) {
|
|
4314
|
+
const input = event.target;
|
|
4315
|
+
// La coma escrita (también en móviles, donde no siempre llega como keydown) cierra el chip.
|
|
4316
|
+
if (input.value.includes(',')) {
|
|
4317
|
+
const parts = input.value.split(',');
|
|
4318
|
+
this.addMany(parts.slice(0, -1));
|
|
4319
|
+
input.value = parts[parts.length - 1];
|
|
4320
|
+
}
|
|
4321
|
+
this.draft = input.value;
|
|
4322
|
+
}
|
|
4323
|
+
onKeydown(event) {
|
|
4324
|
+
if (event.isComposing)
|
|
4325
|
+
return;
|
|
4326
|
+
if (event.key === 'Enter') {
|
|
4327
|
+
// No envía el formulario ni avanza la encuesta: Enter es para agregar el chip.
|
|
4328
|
+
event.preventDefault();
|
|
4329
|
+
event.stopPropagation();
|
|
4330
|
+
this.commitDraft();
|
|
4331
|
+
return;
|
|
4332
|
+
}
|
|
4333
|
+
if (event.key === 'Backspace' && this.draft === '' && this.items.length) {
|
|
4334
|
+
event.preventDefault();
|
|
4335
|
+
this.remove(this.items.length - 1);
|
|
4336
|
+
}
|
|
4337
|
+
}
|
|
4338
|
+
onPaste(event) {
|
|
4339
|
+
const text = event.clipboardData?.getData('text') ?? '';
|
|
4340
|
+
if (!PASTE_SEPARATORS.test(text))
|
|
4341
|
+
return;
|
|
4342
|
+
event.preventDefault();
|
|
4343
|
+
this.addMany((this.draft + text).split(PASTE_SEPARATORS));
|
|
4344
|
+
this.setDraft('');
|
|
4345
|
+
}
|
|
4346
|
+
onBlur() {
|
|
4347
|
+
this.commitDraft();
|
|
4348
|
+
this.onTouched();
|
|
4349
|
+
}
|
|
4350
|
+
remove(index) {
|
|
4351
|
+
if (this.disabled)
|
|
4352
|
+
return;
|
|
4353
|
+
const next = this.items.filter((_item, i) => i !== index);
|
|
4354
|
+
this.notifyChange(next.length ? next : null);
|
|
4355
|
+
this.focusInput();
|
|
4356
|
+
}
|
|
4357
|
+
commitDraft() {
|
|
4358
|
+
if (!this.draft.trim()) {
|
|
4359
|
+
this.setDraft('');
|
|
4360
|
+
return;
|
|
4361
|
+
}
|
|
4362
|
+
const added = this.addMany([this.draft]);
|
|
4363
|
+
// Si no se agregó (repetido o lleno) el texto se descarta igual: el chip existente queda resaltado.
|
|
4364
|
+
if (added || this.duplicated !== null || this.isFull)
|
|
4365
|
+
this.setDraft('');
|
|
4366
|
+
}
|
|
4367
|
+
/** Agrega los textos válidos (recortados, sin repetidos y hasta el máximo). Devuelve cuántos agregó. */
|
|
4368
|
+
addMany(texts) {
|
|
4369
|
+
if (this.disabled)
|
|
4370
|
+
return 0;
|
|
4371
|
+
const next = [...this.items];
|
|
4372
|
+
const seen = new Set(next.map(item => item.toLocaleLowerCase()));
|
|
4373
|
+
let added = 0;
|
|
4374
|
+
for (const raw of texts) {
|
|
4375
|
+
let text = raw.trim();
|
|
4376
|
+
if (!text)
|
|
4377
|
+
continue;
|
|
4378
|
+
if (this.maxLength && this.maxLength > 0)
|
|
4379
|
+
text = text.slice(0, this.maxLength);
|
|
4380
|
+
const key = text.toLocaleLowerCase();
|
|
4381
|
+
if (seen.has(key)) {
|
|
4382
|
+
this.flagDuplicate(next.find(item => item.toLocaleLowerCase() === key) ?? text);
|
|
4383
|
+
continue;
|
|
4384
|
+
}
|
|
4385
|
+
if (typeof this.maxItems === 'number' && this.maxItems > 0 && next.length >= this.maxItems)
|
|
4386
|
+
break;
|
|
4387
|
+
next.push(text);
|
|
4388
|
+
seen.add(key);
|
|
4389
|
+
added++;
|
|
4390
|
+
}
|
|
4391
|
+
if (added)
|
|
4392
|
+
this.notifyChange(next);
|
|
4393
|
+
return added;
|
|
4394
|
+
}
|
|
4395
|
+
setDraft(value) {
|
|
4396
|
+
this.draft = value;
|
|
4397
|
+
if (this.textInput)
|
|
4398
|
+
this.textInput.nativeElement.value = value;
|
|
4399
|
+
}
|
|
4400
|
+
flagDuplicate(item) {
|
|
4401
|
+
this.duplicated = item;
|
|
4402
|
+
if (this.duplicatedTimer)
|
|
4403
|
+
clearTimeout(this.duplicatedTimer);
|
|
4404
|
+
this.duplicatedTimer = setTimeout(() => {
|
|
4405
|
+
this.duplicated = null;
|
|
4406
|
+
this.duplicatedTimer = null;
|
|
4407
|
+
}, 900);
|
|
4408
|
+
}
|
|
4409
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicChipsInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4410
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicChipsInputComponent, isStandalone: true, selector: "ui-chips-input", inputs: { icon: "icon", iconColor: "iconColor", label: "label", error: "error", tip: "tip", disabled: "disabled", placeholder: "placeholder", maxItems: "maxItems", maxLength: "maxLength" }, providers: [
|
|
4411
|
+
{
|
|
4412
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4413
|
+
useExisting: forwardRef(() => UicChipsInputComponent),
|
|
4414
|
+
multi: true
|
|
4415
|
+
}
|
|
4416
|
+
], viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ui-input-wrapper\n [icon]=\"icon\"\n [iconColor]=\"iconColor\"\n [label]=\"label\"\n [error]=\"error\"\n [tip]=\"tip\"\n [disabled]=\"disabled\">\n <div\n class=\"fakeinput chips\"\n [class.errorinput]=\"!!error\"\n [class.disabledinput]=\"disabled\"\n (click)=\"focusInput()\">\n <ul class=\"chips-list\" [attr.aria-label]=\"label || null\">\n @for (item of items; track item; let i = $index) {\n <li class=\"chip\" [class.is-duplicated]=\"item === duplicated\">\n <span class=\"chip-text\">{{ item }}</span>\n @if (!disabled) {\n <button\n type=\"button\"\n class=\"chip-remove\"\n [attr.aria-label]=\"'chips_input.remove' | uicTranslate: { item: item }\"\n (click)=\"$event.stopPropagation(); remove(i)\">\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\n </button>\n }\n </li>\n }\n @if (!disabled && !isFull) {\n <li class=\"chips-draft\">\n <input\n #textInput\n type=\"text\"\n enterkeyhint=\"enter\"\n [attr.maxlength]=\"maxLength || null\"\n [placeholder]=\"items.length ? '' : (placeholder | uicTranslate)\"\n [attr.aria-label]=\"(label || placeholder) | uicTranslate\"\n (input)=\"onDraftInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (paste)=\"onPaste($event)\"\n (blur)=\"onBlur()\">\n </li>\n } @else if (!items.length) {\n <li class=\"chips-empty disabled-placeholder\">{{ placeholder | uicTranslate }}</li>\n }\n </ul>\n </div>\n @if (!disabled && isFull) {\n <div class=\"fakeinput-alert tip\" aria-live=\"polite\">{{ 'chips_input.max_reached' | uicTranslate: { max: maxItems } }}</div>\n }\n</ui-input-wrapper>\n", styles: [".chips{height:auto;padding-top:4px;padding-bottom:4px;cursor:text}.chips-list{display:flex;flex-wrap:wrap;align-items:center;gap:6px;width:100%;margin:0;padding:0;list-style:none}.chip{display:inline-flex;align-items:center;gap:2px;max-width:100%;min-height:26px;padding:0 4px 0 10px;border-radius:var(--uic-chip-radius, 999px);background-color:var(--uic-chip-bg, var(--primary-100));color:var(--uic-chip-color, var(--primary-700));font-size:.875rem;line-height:1.2;transition:box-shadow .2s ease}.chip.is-duplicated{box-shadow:0 0 0 2px var(--yellow-500)}.chip-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chip-remove{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;border-radius:50%;background:transparent;color:inherit;cursor:pointer}.chip-remove:hover{background-color:#00000014}.chip-remove:focus-visible{outline:solid 2px var(--primary-400)}.disabledinput .chip{padding-right:10px;background-color:var(--uic-neutral-200, var(--grey-200));color:var(--disabled-color)}.chips-draft{flex:1 1 120px;min-width:120px}.chips-draft input{height:28px!important}.chips-empty{font-size:.875rem}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
4417
|
+
}
|
|
4418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicChipsInputComponent, decorators: [{
|
|
4419
|
+
type: Component,
|
|
4420
|
+
args: [{ selector: 'ui-chips-input', imports: [InputWrapperComponent, UicTranslatePipe], providers: [
|
|
4421
|
+
{
|
|
4422
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4423
|
+
useExisting: forwardRef(() => UicChipsInputComponent),
|
|
4424
|
+
multi: true
|
|
4425
|
+
}
|
|
4426
|
+
], template: "<ui-input-wrapper\n [icon]=\"icon\"\n [iconColor]=\"iconColor\"\n [label]=\"label\"\n [error]=\"error\"\n [tip]=\"tip\"\n [disabled]=\"disabled\">\n <div\n class=\"fakeinput chips\"\n [class.errorinput]=\"!!error\"\n [class.disabledinput]=\"disabled\"\n (click)=\"focusInput()\">\n <ul class=\"chips-list\" [attr.aria-label]=\"label || null\">\n @for (item of items; track item; let i = $index) {\n <li class=\"chip\" [class.is-duplicated]=\"item === duplicated\">\n <span class=\"chip-text\">{{ item }}</span>\n @if (!disabled) {\n <button\n type=\"button\"\n class=\"chip-remove\"\n [attr.aria-label]=\"'chips_input.remove' | uicTranslate: { item: item }\"\n (click)=\"$event.stopPropagation(); remove(i)\">\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\n </button>\n }\n </li>\n }\n @if (!disabled && !isFull) {\n <li class=\"chips-draft\">\n <input\n #textInput\n type=\"text\"\n enterkeyhint=\"enter\"\n [attr.maxlength]=\"maxLength || null\"\n [placeholder]=\"items.length ? '' : (placeholder | uicTranslate)\"\n [attr.aria-label]=\"(label || placeholder) | uicTranslate\"\n (input)=\"onDraftInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (paste)=\"onPaste($event)\"\n (blur)=\"onBlur()\">\n </li>\n } @else if (!items.length) {\n <li class=\"chips-empty disabled-placeholder\">{{ placeholder | uicTranslate }}</li>\n }\n </ul>\n </div>\n @if (!disabled && isFull) {\n <div class=\"fakeinput-alert tip\" aria-live=\"polite\">{{ 'chips_input.max_reached' | uicTranslate: { max: maxItems } }}</div>\n }\n</ui-input-wrapper>\n", styles: [".chips{height:auto;padding-top:4px;padding-bottom:4px;cursor:text}.chips-list{display:flex;flex-wrap:wrap;align-items:center;gap:6px;width:100%;margin:0;padding:0;list-style:none}.chip{display:inline-flex;align-items:center;gap:2px;max-width:100%;min-height:26px;padding:0 4px 0 10px;border-radius:var(--uic-chip-radius, 999px);background-color:var(--uic-chip-bg, var(--primary-100));color:var(--uic-chip-color, var(--primary-700));font-size:.875rem;line-height:1.2;transition:box-shadow .2s ease}.chip.is-duplicated{box-shadow:0 0 0 2px var(--yellow-500)}.chip-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chip-remove{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;border-radius:50%;background:transparent;color:inherit;cursor:pointer}.chip-remove:hover{background-color:#00000014}.chip-remove:focus-visible{outline:solid 2px var(--primary-400)}.disabledinput .chip{padding-right:10px;background-color:var(--uic-neutral-200, var(--grey-200));color:var(--disabled-color)}.chips-draft{flex:1 1 120px;min-width:120px}.chips-draft input{height:28px!important}.chips-empty{font-size:.875rem}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.f-extralight{font-weight:300;color:var(--uic-neutral-500, var(--grey-500))}.input-options{border-radius:var(--input-radius);background-color:var(--uic-overlay-bg, var(--uic-surface, var(--white)));box-shadow:var(--uic-overlay-shadow, var(--uic-shadow-sm, 0 1px 1px 0 rgba(0, 0, 0, .1254901961), 0 2px 5px 0 rgba(0, 0, 0, .3137254902)));width:100%;top:100%;font-size:var(--uic-option-font-size, .875rem);z-index:500;overflow:hidden;display:flex;flex-direction:column}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200))}.option-group-header{padding:.25rem .5rem 2px;font-size:.75rem;font-weight:600;color:var(--uic-neutral-500, var(--grey-500));text-transform:uppercase;letter-spacing:.05em;pointer-events:none;-webkit-user-select:none;user-select:none}.option-group-header:not(:first-child){border-top:1px solid var(--uic-neutral-200, var(--grey-200));margin-top:.25rem}.input-option{display:flex;align-items:center;padding:6px 12px;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-option-focused{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)))}.input-option:hover{background-color:var(--uic-option-hover-bg, var(--uic-surface-hover, var(--secondary-100)));cursor:pointer}.input-option-disabled{opacity:.55;cursor:not-allowed}.input-option-disabled:hover{background-color:transparent;cursor:not-allowed}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));width:100%;margin-top:2px}.input-option-scroll-focused{background-color:var(--primary-300)}.input-option-scroll-btns{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--uic-surface, var(--white));border:solid 1px var(--uic-neutral-200, var(--grey-200));padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:.5rem;font-size:1.625rem;height:1.625rem;width:1.625rem}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon{color:var(--uic-neutral-700, var(--grey-700));margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:var(--uic-label-font-size, max(var(--form-ref) + 4px, 14px));line-height:var(--uic-label-line-height, 1.125rem);min-height:var(--uic-label-line-height, 1.125rem);font-weight:var(--uic-label-font-weight, 400);color:var(--uic-label-color, var(--uic-neutral-950, var(--grey-950)));margin-bottom:var(--input-label-space)}.disabled-placeholder{color:var(--disabled-color-placeholder)}.fakeinput{min-height:calc(4 * var(--form-ref));border-radius:var(--input-radius);overflow:hidden;border:solid var(--uic-input-border-width, 1px) var(--uic-input-border-color, var(--uic-neutral-200, var(--grey-200)));display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color:var(--uic-input-bg, var(--uic-surface, var(--white)));transition:ease .3s;padding:0 var(--form-ref)}.fakeinput-wrapp{position:relative}.fakeinput-emptytext{margin:0 5px;flex:1 1;overflow:hidden;font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));white-space:nowrap}.fakeinput-emptytext i{font-size:20px}.fakeinput ::ng-deep textarea{padding:10px 0}.fakeinput ::ng-deep input{height:calc(4 * var(--form-ref));padding:0}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{font-size:var(--uic-input-font-size, max(var(--form-ref) + 4px, 14px));flex-grow:1;outline:none;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput ::ng-deep input:disabled::placeholder,.fakeinput ::ng-deep textarea:disabled::placeholder{color:var(--disabled-color-placeholder)}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:var(--uic-neutral-200, var(--grey-200))}.fakeinput-button:disabled{background-color:var(--disabled-background);color:var(--disabled-color)}.fakeinput-button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput-button:enabled:active{background-color:var(--primary-700)}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:var(--uic-neutral-200, var(--grey-200))}.fakeinput:focus-within{box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.fakeinput:hover{border-color:var(--uic-input-border-color-hover, var(--uic-neutral-400, var(--grey-400)));cursor:text}.activeselect{border-color:var(--uic-input-border-color-active, var(--primary-600))}.errorinput{border-color:var(--uic-error-color, var(--red-500))!important}.t-disabled{color:var(--disabled-color);padding:5px;text-align:center}.disabledinput{background-color:var(--disabled-background);color:var(--disabled-color)}.disabledinput ::ng-deep input{color:var(--disabled-color)}.inputlabel{display:flex;align-items:center}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-white{color:var(--white)}.tip{color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}.item-disabled{color:var(--uic-neutral-400, var(--grey-400))}.item-disabled:hover{background-color:var(--uic-surface, var(--white));cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 40%,var(--uic-loading-highlight, var(--uic-neutral-200, #dee1e2)) 50%,var(--uic-loading-base, var(--uic-neutral-100, #f2f2f2)) 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}.select-searcher{width:100%;display:flex;gap:5px;padding:.25rem;border-bottom:1px solid var(--uic-neutral-200, var(--grey-200));background-color:var(--uic-surface, var(--white))}.select-searcher>input{flex:1 1;padding:3px 5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));margin:0 auto;border-radius:4px}.select-searcher>input:focus{outline:none;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha));border-color:var(--primary-500)}.option-text-highlight ::ng-deep mark{background-color:var(--secondary-200);color:inherit;padding:0;border-radius:2px}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--uic-neutral-400, var(--grey-400))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
4427
|
+
}], propDecorators: { icon: [{
|
|
4428
|
+
type: Input
|
|
4429
|
+
}], iconColor: [{
|
|
4430
|
+
type: Input
|
|
4431
|
+
}], label: [{
|
|
4432
|
+
type: Input
|
|
4433
|
+
}], error: [{
|
|
4434
|
+
type: Input
|
|
4435
|
+
}], tip: [{
|
|
4436
|
+
type: Input
|
|
4437
|
+
}], disabled: [{
|
|
4438
|
+
type: Input
|
|
4439
|
+
}], placeholder: [{
|
|
4440
|
+
type: Input
|
|
4441
|
+
}], maxItems: [{
|
|
4442
|
+
type: Input
|
|
4443
|
+
}], maxLength: [{
|
|
4444
|
+
type: Input
|
|
4445
|
+
}], textInput: [{
|
|
4446
|
+
type: ViewChild,
|
|
4447
|
+
args: ['textInput']
|
|
4448
|
+
}] } });
|
|
4449
|
+
|
|
4233
4450
|
const base$3 = createValueAccessor();
|
|
4234
4451
|
class UicTimePickerComponent extends base$3 {
|
|
4235
4452
|
// Iconos y estado
|
|
@@ -5447,6 +5664,16 @@ class UicDynamicFormComponent {
|
|
|
5447
5664
|
}
|
|
5448
5665
|
}
|
|
5449
5666
|
}
|
|
5667
|
+
/**
|
|
5668
|
+
* 'in' / 'notIn': el valor actual (opción única) es alguno de la lista. Comparación flexible como
|
|
5669
|
+
* 'equals' (1 y '1' coinciden). Sin respuesta o con la lista vacía no coincide.
|
|
5670
|
+
*/
|
|
5671
|
+
isOneOfVisibilityValues(currentValue, ruleValue) {
|
|
5672
|
+
if (this.isEmptyValue(currentValue) || Array.isArray(currentValue))
|
|
5673
|
+
return false;
|
|
5674
|
+
const candidates = Array.isArray(ruleValue) ? ruleValue : (ruleValue == null || ruleValue === '' ? [] : [ruleValue]);
|
|
5675
|
+
return candidates.some(candidate => String(candidate) === String(currentValue));
|
|
5676
|
+
}
|
|
5450
5677
|
getClearValue(fieldType) {
|
|
5451
5678
|
if (fieldType === 'checkbox' || fieldType === 'switch') {
|
|
5452
5679
|
return false;
|
|
@@ -5483,6 +5710,10 @@ class UicDynamicFormComponent {
|
|
|
5483
5710
|
}
|
|
5484
5711
|
return currentValue != rule.value;
|
|
5485
5712
|
}
|
|
5713
|
+
case 'in':
|
|
5714
|
+
return this.isOneOfVisibilityValues(currentValue, rule.value);
|
|
5715
|
+
case 'notIn':
|
|
5716
|
+
return !this.isOneOfVisibilityValues(currentValue, rule.value);
|
|
5486
5717
|
case 'greaterThan':
|
|
5487
5718
|
return this.compareVisibilityValues(currentValue, rule.value, dependencyType) > 0;
|
|
5488
5719
|
case 'lessThan':
|
|
@@ -5926,7 +6157,7 @@ class UicDynamicFormComponent {
|
|
|
5926
6157
|
recognition.start();
|
|
5927
6158
|
}
|
|
5928
6159
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDynamicFormComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
5929
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicDynamicFormComponent, isStandalone: true, selector: "ui-dynamic-form", inputs: { fields: "fields", contextFields: "contextFields", isSubForm: "isSubForm", form: "form", disabled: "disabled", externalValidationStates: "externalValidationStates", voiceToTextSilenceMs: "voiceToTextSilenceMs", cols: "cols", iconMode: "iconMode", fileUidResolverFn: "fileUidResolverFn", selectOptionsResolver: "selectOptionsResolver", parentFormValues: "parentFormValues" }, outputs: { fieldBlur: "fieldBlur" }, ngImport: i0, template: "<div class=\"form\" [ngStyle]=\"{'--cols': cols, '--min': '180px'}\" [formGroup]=\"form\">\n @for (state of visibleFieldStates(); track state.field.name) {\n @let field = state.field;\n @let control = state.control;\n @let currentValue = state.value ?? '';\n @let error = getControlErrorMessages(control, field)[0];\n\n @if (!field.hidden && !field.otherFor) {\n <div [style.grid-column]=\"getGridColumn(field)\" (focusout)=\"onFieldContainerFocusout(field, $event)\">\n @if (['text', 'number'].includes(field.type)) {\n @let inputColor = getInputColor(field, currentValue);\n <ui-input\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [disabled]=\"!!control?.disabled\"\n [internalIconColor]=\"inputColor\"\n [internalIcon]=\"field.internalIcon || (currentValue !== '' ? getIconByColor(field, inputColor) : '')\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\">\n <input #inp\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [type]=\"field.type\"\n [step]=\"field.step\"\n [min]=\"field.min\"\n [max]=\"field.max\"\n [minLength]=\"field.minLength||null\"\n [maxlength]=\"field.maxLength||null\"\n [placeholder]=\"field.placeholder??field.label\"/>\n @if (field.maxLength && field.showCounter) {\n <span counter>{{inp.value.length}} /{{field.maxLength}}</span>\n }\n </ui-input>\n }\n @if (field.type === 'textarea') {\n <ui-input\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [disabled]=\"!!control?.disabled\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [internalIcon]=\"field.internalIcon??''\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\">\n <textarea #ta\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [minLength]=\"field.minLength||null\"\n [maxlength]=\"field.maxLength||null\"\n [textareaAutoresize]=\"field.textareaResize\"\n [textareaAutoresizeMinRows]=\"field.resizeMinRows??1\"\n [textareaAutoresizeMaxRows]=\"field.resizeMaxRows??5\"\n [rows]=\"field.resizeMinRows??3\"\n [placeholder]=\"field.placeholder??field.label\"\n ></textarea>\n @if (field.voiceToTextEnabled && !control?.disabled) {\n @let listening = isListening(field.name);\n <div class=\"speak-icon\" (click)=\"ta.focus()\">\n <ui-button\n [disabled]=\"listening\"\n style=\"margin-bottom: 2px;\"\n (click)=\"voiceToText(ta, field.name)\"\n [icon]=\"listening?'ri-mic-fill':'ri-mic-line'\"\n [type]=\"listening?'filled':'bordered'\"\n size=\"s\"\n [iconOnly]=\"true\"\n ></ui-button>\n @if (listening) {\n <i class=\"ri-voiceprint-line\"></i>\n }\n </div>\n }\n @if (field.showCounter) {\n <span counter>\n {{ta.value.length}}\n @if (field.maxLength) {\n /{{field.maxLength}}\n }\n </span>\n }\n </ui-input>\n }\n @if (field.type === 'phone') {\n <ui-phone-input\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\"\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [placeholder]=\"field.placeholder||field.label||''\"\n >\n </ui-phone-input>\n }\n @else if (field.type === 'date') {\n <ui-date-picker\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [tip]=\"field.tip??''\"\n [justMonth]=\"!!field.monthMode\"\n [min]=\"field.minDate??''\"\n [max]=\"field.maxDate??''\"\n [monthDay]=\"field.monthDay||'first'\"\n [formControlName]=\"field.name\"\n ></ui-date-picker>\n }\n @else if (field.type === 'time') {\n <ui-time-picker\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [tip]=\"field.tip??''\"\n [interval]=\"field.timeInterval??5\"\n [formControlName]=\"field.name\"\n ></ui-time-picker>\n }\n @else if (field.type === 'select') {\n <ui-select\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [loading]=\"field.loading??false\"\n [nullable]=\"field.selectNullable??false\"\n [showSubtitle]=\"field.showSubtitle??false\"\n [searcherEnabled]=\"field.selectSearchEnabled??false\"\n [tip]=\"field.tip??''\"\n [formControlName]=\"field.name\"\n [options]=\"optionsFor(field)\"\n ></ui-select>\n }\n @else if (field.type === 'multyselect') {\n <ui-multy-select\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [tip]=\"field.tip??''\"\n [formControlName]=\"field.name\"\n [maxSelections]=\"field.maxSelections ?? null\"\n [options]=\"optionsFor(field)\"\n ></ui-multy-select>\n }\n @else if (field.type === 'searcher') {\n <ui-searcher\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\"\n [searchFn]=\"getSearcherFn(field)\"\n [itemDisplayFn]=\"getSearcherDisplayFn(field)\"\n [itemIsEnabledFn]=\"getSearcherIsEnabledFn(field)\"\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\n [error]=\"error\"\n ></ui-searcher>\n }\n @else if (field.type === 'multisearcher') {\n <ui-multy-searcher\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\"\n [searchFn]=\"getSearcherFn(field)\"\n [itemDisplayFn]=\"getSearcherDisplayFn(field)\"\n [itemIsEnabledFn]=\"getSearcherIsEnabledFn(field)\"\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\n [error]=\"error\"\n ></ui-multy-searcher>\n }\n @else if (field.type === 'file') {\n <ui-file-input\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [multy]=\"field.multyEnabled??false\"\n [tip]=\"field.tip??''\"\n [fileTypes]=\"field.fileTypes??null\"\n [templateUrl]=\"field.templateUrl??''\"\n [templateText]=\"field.templateText??'Descarga el formato haciendo'\"\n [templateLinkLabel]=\"field.templateLinkLabel??'click aqu\u00ED'\"\n [fileUidResolverFn]=\"fileUidResolverFn\"\n [formControlName]=\"field.name\"\n ></ui-file-input>\n }\n @else if (['checkbox', 'switch'].includes(field.type)) {\n <ui-checkbox\n [label]=\"(field.label??'') + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [placeholder]=\"field.placeholder??''\"\n [tip]=\"field.tip??''\"\n [type]=\"field.type === 'checkbox' ? 'checkbox' : 'switch'\"\n ></ui-checkbox>\n }\n @else if (field.type === 'radio') {\n <ui-radio\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [tip]=\"field.tip??''\"\n [loading]=\"field.loading??false\"\n [error]=\"error\"\n [options]=\"optionsFor(field)\"\n ></ui-radio>\n }\n @else if (field.type === 'slider') {\n <ui-slider\n [min]=\"field.min??0\"\n [max]=\"field.max??100\"\n [step]=\"field.sliderInterval??1\"\n [markerCount]=\"field.sliderMarks??5\"\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [tip]=\"field.tip??''\"\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n ></ui-slider>\n }\n @else if (field.type === 'scale') {\n <ui-scale\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [tip]=\"field.tip??''\"\n [error]=\"error\"\n [min]=\"field.scaleMin ?? 1\"\n [max]=\"field.scaleMax ?? 5\"\n [mode]=\"field.scaleMode ?? 'number'\"\n [scaleIcon]=\"field.scaleIcon || 'ri-star-fill'\"\n [labels]=\"field.scaleLabels ?? []\"\n ></ui-scale>\n }\n @else if (field.type === 'distribution') {\n <ui-distribution\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [tip]=\"field.tip??''\"\n [error]=\"error\"\n [options]=\"field.options || []\"\n ></ui-distribution>\n }\n @else if (field.type === 'pool') {\n <ui-pool-options\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [multy]=\"field.multyEnabled??false\"\n [tip]=\"field.tip??''\"\n [listViewTitle]=\"field.poolTitle??'common.selected'\"\n [enabledListView]=\"field.poolEnabledListView||false\"\n [displayMode]=\"field.poolDisplayMode ?? 'flex'\"\n [gridColumns]=\"field.poolGridColumns ?? 2\"\n [maxSelections]=\"field.maxSelections ?? null\"\n [formControlName]=\"field.name\"\n [options]=\"field.options || []\"\n ></ui-pool-options>\n }\n @else if (field.type === 'repeater') {\n <ui-repeater\n [formArray]=\"asFormArray(control)\"\n [field]=\"field\"\n [cols]=\"cols\"\n [error]=\"error\"\n [fileUidResolverFn]=\"fileUidResolverFn\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [parentForm]=\"form\"\n ></ui-repeater>\n }\n\n <!-- \"Otros (especifica)\": el texto va pegado a su pregunta y solo existe mientras se eligi\u00F3 \"Otros\" -->\n @if (otherStateFor(field); as other) {\n <div class=\"other-specify\" (focusout)=\"onFieldContainerFocusout(other.field, $event)\">\n <ui-input\n [error]=\"getControlErrorMessages(other.control, other.field)[0]\"\n [disabled]=\"!!other.control?.disabled\">\n <input\n type=\"text\"\n [id]=\"other.field.name\"\n [formControlName]=\"other.field.name\"\n [maxlength]=\"otherTextMaxLength\"\n [attr.aria-label]=\"other.field.label\"\n [placeholder]=\"(other.field.placeholder ?? '') + (other.field.required ? ' *' : '')\"/>\n </ui-input>\n </div>\n }\n </div>\n }\n }\n</div>\n", styles: [".form{width:100%;display:grid;align-items:stretch;gap:var(--uic-form-gap, 1rem);padding-bottom:.75rem}@media (max-width: 479px){.form{grid-template-columns:1fr}}@media (min-width: 768px){.form{grid-template-columns:repeat(var(--cols),minmax(0,1fr))}}@media (min-width: 480px) and (max-width: 767px){.form{grid-template-columns:repeat(min(var(--cols),2),minmax(0,1fr))}}.form>*{min-width:0}h2{margin-top:1.5rem}.speak-icon{display:flex;width:100%;align-items:center;gap:10px}.speak-icon i{font-size:20px;color:var(--primary-500)}textarea{resize:none}.other-specify{margin-top:6px;padding-left:12px;border-left:solid 2px var(--uic-other-specify-guide, var(--primary-200));animation:other-specify-in .15s ease-out}@keyframes other-specify-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){.other-specify{animation:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: UicDatePickerComponent, selector: "ui-date-picker", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "disabled", "label", "error", "tip", "max", "min", "justMonth", "monthDay"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: UicSliderComponent, selector: "ui-slider", inputs: ["icon", "iconColor", "label", "error", "tip", "min", "max", "step", "markerCount", "disabled", "loading"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicPoolOptionsComponent, selector: "ui-pool-options", inputs: ["icon", "iconColor", "size", "label", "error", "tip", "disabled", "loading", "multy", "enabledListView", "listViewTitle", "options", "displayMode", "gridColumns", "maxSelections"] }, { kind: "component", type: UicTimePickerComponent, selector: "ui-time-picker", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "disabled", "label", "error", "tip", "interval"] }, { kind: "component", type: UicRadioComponent, selector: "ui-radio", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled", "loading", "options", "emptyText", "direction"] }, { kind: "component", type: UicScaleComponent, selector: "ui-scale", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled", "min", "max", "mode", "scaleIcon", "labels"] }, { kind: "component", type: UicDistributionComponent, selector: "ui-distribution", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled", "options"] }, { kind: "component", type: UicSearcherComponent, selector: "ui-searcher", inputs: ["icon", "iconColor", "internalIcon", "size", "label", "error", "tip", "showSubtitle", "disabled", "loading", "minimumSearchLength", "showSelected", "placeholder", "searchFn", "itemDisplayFn", "itemIsEnabledFn", "manualSearch", "stateless"], outputs: ["pickedItem"] }, { kind: "component", type: UicMultySelectComponent, selector: "ui-multy-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "allSelectedText", "loading", "options", "maxSelections"] }, { kind: "component", type: UicMultySearcherComponent, selector: "ui-multy-searcher", inputs: ["icon", "iconColor", "internalIcon", "label", "error", "tip", "disabled", "loading", "minimumSearchLength", "placeholder", "searchFn", "itemDisplayFn", "itemIsEnabledFn", "manualSearch"] }, { kind: "component", type: UicFileInputComponent, selector: "ui-file-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading", "multy", "fileTypes", "fileUidResolverFn", "templateUrl", "templateText", "templateLinkLabel"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "searcherEnabled", "loading", "nullable", "options"] }, { kind: "directive", type: UicTextareaAutoresizeDirective, selector: "[textareaAutoresize]", inputs: ["minRows", "maxRows", "textareaAutoresize"] }, { kind: "directive", type: UicTextareaAutoresizeMinRowsDirective, selector: "[textareaAutoresizeMinRows]", inputs: ["textareaAutoresizeMinRows"] }, { kind: "directive", type: UicTextareaAutoresizeMaxRowsDirective, selector: "[textareaAutoresizeMaxRows]", inputs: ["textareaAutoresizeMaxRows"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { kind: "component", type: UicPhoneInputComponent, selector: "ui-phone-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "placeholder", "disabled", "loading", "preferredCountries", "flagPath", "countries"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: UicRepeaterComponent, selector: "ui-repeater", inputs: ["formArray", "field", "cols", "error", "fileUidResolverFn", "selectOptionsResolver", "parentForm"] }] });
|
|
6160
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicDynamicFormComponent, isStandalone: true, selector: "ui-dynamic-form", inputs: { fields: "fields", contextFields: "contextFields", isSubForm: "isSubForm", form: "form", disabled: "disabled", externalValidationStates: "externalValidationStates", voiceToTextSilenceMs: "voiceToTextSilenceMs", cols: "cols", iconMode: "iconMode", fileUidResolverFn: "fileUidResolverFn", selectOptionsResolver: "selectOptionsResolver", parentFormValues: "parentFormValues" }, outputs: { fieldBlur: "fieldBlur" }, ngImport: i0, template: "<div class=\"form\" [ngStyle]=\"{'--cols': cols, '--min': '180px'}\" [formGroup]=\"form\">\r\n @for (state of visibleFieldStates(); track state.field.name) {\r\n @let field = state.field;\r\n @let control = state.control;\r\n @let currentValue = state.value ?? '';\r\n @let error = getControlErrorMessages(control, field)[0];\r\n\r\n @if (!field.hidden && !field.otherFor) {\r\n <div [style.grid-column]=\"getGridColumn(field)\" [attr.data-field-name]=\"field.name\" (focusout)=\"onFieldContainerFocusout(field, $event)\">\r\n @if (['text', 'number'].includes(field.type)) {\r\n @let inputColor = getInputColor(field, currentValue);\r\n <ui-input\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [disabled]=\"!!control?.disabled\"\r\n [internalIconColor]=\"inputColor\"\r\n [internalIcon]=\"field.internalIcon || (currentValue !== '' ? getIconByColor(field, inputColor) : '')\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\">\r\n <input #inp\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [type]=\"field.type\"\r\n [step]=\"field.step\"\r\n [min]=\"field.min\"\r\n [max]=\"field.max\"\r\n [minLength]=\"field.minLength||null\"\r\n [maxlength]=\"field.maxLength||null\"\r\n [placeholder]=\"field.placeholder??field.label\"/>\r\n @if (field.maxLength && field.showCounter) {\r\n <span counter>{{inp.value.length}} /{{field.maxLength}}</span>\r\n }\r\n </ui-input>\r\n }\r\n @if (field.type === 'textarea') {\r\n <ui-input\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [disabled]=\"!!control?.disabled\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\">\r\n <textarea #ta\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [minLength]=\"field.minLength||null\"\r\n [maxlength]=\"field.maxLength||null\"\r\n [textareaAutoresize]=\"field.textareaResize\"\r\n [textareaAutoresizeMinRows]=\"field.resizeMinRows??1\"\r\n [textareaAutoresizeMaxRows]=\"field.resizeMaxRows??5\"\r\n [rows]=\"field.resizeMinRows??3\"\r\n [placeholder]=\"field.placeholder??field.label\"\r\n ></textarea>\r\n @if (field.voiceToTextEnabled && !control?.disabled) {\r\n @let listening = isListening(field.name);\r\n <div class=\"speak-icon\" (click)=\"ta.focus()\">\r\n <ui-button\r\n [disabled]=\"listening\"\r\n style=\"margin-bottom: 2px;\"\r\n (click)=\"voiceToText(ta, field.name)\"\r\n [icon]=\"listening?'ri-mic-fill':'ri-mic-line'\"\r\n [type]=\"listening?'filled':'bordered'\"\r\n size=\"s\"\r\n [iconOnly]=\"true\"\r\n ></ui-button>\r\n @if (listening) {\r\n <i class=\"ri-voiceprint-line\"></i>\r\n }\r\n </div>\r\n }\r\n @if (field.showCounter) {\r\n <span counter>\r\n {{ta.value.length}}\r\n @if (field.maxLength) {\r\n /{{field.maxLength}}\r\n }\r\n </span>\r\n }\r\n </ui-input>\r\n }\r\n @if (field.type === 'phone') {\r\n <ui-phone-input\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [placeholder]=\"field.placeholder||field.label||''\"\r\n >\r\n </ui-phone-input>\r\n }\r\n @else if (field.type === 'date') {\r\n <ui-date-picker\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [tip]=\"field.tip??''\"\r\n [justMonth]=\"!!field.monthMode\"\r\n [min]=\"field.minDate??''\"\r\n [max]=\"field.maxDate??''\"\r\n [monthDay]=\"field.monthDay||'first'\"\r\n [formControlName]=\"field.name\"\r\n ></ui-date-picker>\r\n }\r\n @else if (field.type === 'time') {\r\n <ui-time-picker\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [tip]=\"field.tip??''\"\r\n [interval]=\"field.timeInterval??5\"\r\n [formControlName]=\"field.name\"\r\n ></ui-time-picker>\r\n }\r\n @else if (field.type === 'select') {\r\n <ui-select\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [loading]=\"field.loading??false\"\r\n [nullable]=\"field.selectNullable??false\"\r\n [showSubtitle]=\"field.showSubtitle??false\"\r\n [searcherEnabled]=\"field.selectSearchEnabled??false\"\r\n [tip]=\"field.tip??''\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"optionsFor(field)\"\r\n ></ui-select>\r\n }\r\n @else if (field.type === 'multyselect') {\r\n <ui-multy-select\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [tip]=\"field.tip??''\"\r\n [formControlName]=\"field.name\"\r\n [maxSelections]=\"field.maxSelections ?? null\"\r\n [options]=\"optionsFor(field)\"\r\n ></ui-multy-select>\r\n }\r\n @else if (field.type === 'searcher') {\r\n <ui-searcher\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\"\r\n [searchFn]=\"getSearcherFn(field)\"\r\n [itemDisplayFn]=\"getSearcherDisplayFn(field)\"\r\n [itemIsEnabledFn]=\"getSearcherIsEnabledFn(field)\"\r\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\r\n [error]=\"error\"\r\n ></ui-searcher>\r\n }\r\n @else if (field.type === 'multisearcher') {\r\n <ui-multy-searcher\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\"\r\n [searchFn]=\"getSearcherFn(field)\"\r\n [itemDisplayFn]=\"getSearcherDisplayFn(field)\"\r\n [itemIsEnabledFn]=\"getSearcherIsEnabledFn(field)\"\r\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\r\n [error]=\"error\"\r\n ></ui-multy-searcher>\r\n }\r\n @else if (field.type === 'file') {\r\n <ui-file-input\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [multy]=\"field.multyEnabled??false\"\r\n [tip]=\"field.tip??''\"\r\n [fileTypes]=\"field.fileTypes??null\"\r\n [templateUrl]=\"field.templateUrl??''\"\r\n [templateText]=\"field.templateText??'Descarga el formato haciendo'\"\r\n [templateLinkLabel]=\"field.templateLinkLabel??'click aqu\u00ED'\"\r\n [fileUidResolverFn]=\"fileUidResolverFn\"\r\n [formControlName]=\"field.name\"\r\n ></ui-file-input>\r\n }\r\n @else if (['checkbox', 'switch'].includes(field.type)) {\r\n <ui-checkbox\r\n [label]=\"(field.label??'') + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [placeholder]=\"field.placeholder??''\"\r\n [tip]=\"field.tip??''\"\r\n [type]=\"field.type === 'checkbox' ? 'checkbox' : 'switch'\"\r\n ></ui-checkbox>\r\n }\r\n @else if (field.type === 'radio') {\r\n <ui-radio\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [loading]=\"field.loading??false\"\r\n [error]=\"error\"\r\n [options]=\"optionsFor(field)\"\r\n ></ui-radio>\r\n }\r\n @else if (field.type === 'slider') {\r\n <ui-slider\r\n [min]=\"field.min??0\"\r\n [max]=\"field.max??100\"\r\n [step]=\"field.sliderInterval??1\"\r\n [markerCount]=\"field.sliderMarks??5\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n ></ui-slider>\r\n }\r\n @else if (field.type === 'scale') {\r\n <ui-scale\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"error\"\r\n [min]=\"field.scaleMin ?? 1\"\r\n [max]=\"field.scaleMax ?? 5\"\r\n [mode]=\"field.scaleMode ?? 'number'\"\r\n [scaleIcon]=\"field.scaleIcon || 'ri-star-fill'\"\r\n [labels]=\"field.scaleLabels ?? []\"\r\n ></ui-scale>\r\n }\r\n @else if (field.type === 'chips') {\r\n <ui-chips-input\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"error\"\r\n [placeholder]=\"field.placeholder || 'chips_input.placeholder'\"\r\n [maxItems]=\"field.maxSelections ?? null\"\r\n [maxLength]=\"field.maxLength ?? null\"\r\n ></ui-chips-input>\r\n }\r\n @else if (field.type === 'distribution') {\r\n <ui-distribution\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"error\"\r\n [options]=\"field.options || []\"\r\n ></ui-distribution>\r\n }\r\n @else if (field.type === 'pool') {\r\n <ui-pool-options\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [multy]=\"field.multyEnabled??false\"\r\n [tip]=\"field.tip??''\"\r\n [listViewTitle]=\"field.poolTitle??'common.selected'\"\r\n [enabledListView]=\"field.poolEnabledListView||false\"\r\n [displayMode]=\"field.poolDisplayMode ?? 'flex'\"\r\n [gridColumns]=\"field.poolGridColumns ?? 2\"\r\n [maxSelections]=\"field.maxSelections ?? null\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-pool-options>\r\n }\r\n @else if (field.type === 'repeater') {\r\n <ui-repeater\r\n [formArray]=\"asFormArray(control)\"\r\n [field]=\"field\"\r\n [cols]=\"cols\"\r\n [error]=\"error\"\r\n [fileUidResolverFn]=\"fileUidResolverFn\"\r\n [selectOptionsResolver]=\"selectOptionsResolver\"\r\n [parentForm]=\"form\"\r\n ></ui-repeater>\r\n }\r\n\r\n <!-- \"Otros (especifica)\": el texto va pegado a su pregunta y solo existe mientras se eligi\u00F3 \"Otros\" -->\r\n @if (otherStateFor(field); as other) {\r\n <div class=\"other-specify\" (focusout)=\"onFieldContainerFocusout(other.field, $event)\">\r\n <ui-input\r\n [error]=\"getControlErrorMessages(other.control, other.field)[0]\"\r\n [disabled]=\"!!other.control?.disabled\">\r\n <input\r\n type=\"text\"\r\n [id]=\"other.field.name\"\r\n [formControlName]=\"other.field.name\"\r\n [maxlength]=\"otherTextMaxLength\"\r\n [attr.aria-label]=\"other.field.label\"\r\n [placeholder]=\"(other.field.placeholder ?? '') + (other.field.required ? ' *' : '')\"/>\r\n </ui-input>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;align-items:stretch;gap:var(--uic-form-gap, 1rem);padding-bottom:.75rem}@media (max-width: 479px){.form{grid-template-columns:1fr}}@media (min-width: 768px){.form{grid-template-columns:repeat(var(--cols),minmax(0,1fr))}}@media (min-width: 480px) and (max-width: 767px){.form{grid-template-columns:repeat(min(var(--cols),2),minmax(0,1fr))}}.form>*{min-width:0}h2{margin-top:1.5rem}.speak-icon{display:flex;width:100%;align-items:center;gap:10px}.speak-icon i{font-size:20px;color:var(--primary-500)}textarea{resize:none}.other-specify{margin-top:6px;padding-left:12px;border-left:solid 2px var(--uic-other-specify-guide, var(--primary-200));animation:other-specify-in .15s ease-out}@keyframes other-specify-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){.other-specify{animation:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: UicDatePickerComponent, selector: "ui-date-picker", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "disabled", "label", "error", "tip", "max", "min", "justMonth", "monthDay"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: UicSliderComponent, selector: "ui-slider", inputs: ["icon", "iconColor", "label", "error", "tip", "min", "max", "step", "markerCount", "disabled", "loading"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicPoolOptionsComponent, selector: "ui-pool-options", inputs: ["icon", "iconColor", "size", "label", "error", "tip", "disabled", "loading", "multy", "enabledListView", "listViewTitle", "options", "displayMode", "gridColumns", "maxSelections"] }, { kind: "component", type: UicTimePickerComponent, selector: "ui-time-picker", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "disabled", "label", "error", "tip", "interval"] }, { kind: "component", type: UicRadioComponent, selector: "ui-radio", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled", "loading", "options", "emptyText", "direction"] }, { kind: "component", type: UicScaleComponent, selector: "ui-scale", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled", "min", "max", "mode", "scaleIcon", "labels"] }, { kind: "component", type: UicDistributionComponent, selector: "ui-distribution", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled", "options"] }, { kind: "component", type: UicChipsInputComponent, selector: "ui-chips-input", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled", "placeholder", "maxItems", "maxLength"] }, { kind: "component", type: UicSearcherComponent, selector: "ui-searcher", inputs: ["icon", "iconColor", "internalIcon", "size", "label", "error", "tip", "showSubtitle", "disabled", "loading", "minimumSearchLength", "showSelected", "placeholder", "searchFn", "itemDisplayFn", "itemIsEnabledFn", "manualSearch", "stateless"], outputs: ["pickedItem"] }, { kind: "component", type: UicMultySelectComponent, selector: "ui-multy-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "allSelectedText", "loading", "options", "maxSelections"] }, { kind: "component", type: UicMultySearcherComponent, selector: "ui-multy-searcher", inputs: ["icon", "iconColor", "internalIcon", "label", "error", "tip", "disabled", "loading", "minimumSearchLength", "placeholder", "searchFn", "itemDisplayFn", "itemIsEnabledFn", "manualSearch"] }, { kind: "component", type: UicFileInputComponent, selector: "ui-file-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading", "multy", "fileTypes", "fileUidResolverFn", "templateUrl", "templateText", "templateLinkLabel"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "searcherEnabled", "loading", "nullable", "options"] }, { kind: "directive", type: UicTextareaAutoresizeDirective, selector: "[textareaAutoresize]", inputs: ["minRows", "maxRows", "textareaAutoresize"] }, { kind: "directive", type: UicTextareaAutoresizeMinRowsDirective, selector: "[textareaAutoresizeMinRows]", inputs: ["textareaAutoresizeMinRows"] }, { kind: "directive", type: UicTextareaAutoresizeMaxRowsDirective, selector: "[textareaAutoresizeMaxRows]", inputs: ["textareaAutoresizeMaxRows"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { kind: "component", type: UicPhoneInputComponent, selector: "ui-phone-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "placeholder", "disabled", "loading", "preferredCountries", "flagPath", "countries"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: UicRepeaterComponent, selector: "ui-repeater", inputs: ["formArray", "field", "cols", "error", "fileUidResolverFn", "selectOptionsResolver", "parentForm"] }] });
|
|
5930
6161
|
}
|
|
5931
6162
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDynamicFormComponent, decorators: [{
|
|
5932
6163
|
type: Component,
|
|
@@ -5941,6 +6172,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5941
6172
|
UicRadioComponent,
|
|
5942
6173
|
UicScaleComponent,
|
|
5943
6174
|
UicDistributionComponent,
|
|
6175
|
+
UicChipsInputComponent,
|
|
5944
6176
|
UicSearcherComponent,
|
|
5945
6177
|
UicMultySelectComponent,
|
|
5946
6178
|
UicMultySearcherComponent,
|
|
@@ -5954,7 +6186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5954
6186
|
UicPhoneInputComponent,
|
|
5955
6187
|
FormsModule,
|
|
5956
6188
|
UicRepeaterComponent
|
|
5957
|
-
], template: "<div class=\"form\" [ngStyle]=\"{'--cols': cols, '--min': '180px'}\" [formGroup]=\"form\">\n @for (state of visibleFieldStates(); track state.field.name) {\n @let field = state.field;\n @let control = state.control;\n @let currentValue = state.value ?? '';\n @let error = getControlErrorMessages(control, field)[0];\n\n @if (!field.hidden && !field.otherFor) {\n <div [style.grid-column]=\"getGridColumn(field)\" (focusout)=\"onFieldContainerFocusout(field, $event)\">\n @if (['text', 'number'].includes(field.type)) {\n @let inputColor = getInputColor(field, currentValue);\n <ui-input\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [disabled]=\"!!control?.disabled\"\n [internalIconColor]=\"inputColor\"\n [internalIcon]=\"field.internalIcon || (currentValue !== '' ? getIconByColor(field, inputColor) : '')\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\">\n <input #inp\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [type]=\"field.type\"\n [step]=\"field.step\"\n [min]=\"field.min\"\n [max]=\"field.max\"\n [minLength]=\"field.minLength||null\"\n [maxlength]=\"field.maxLength||null\"\n [placeholder]=\"field.placeholder??field.label\"/>\n @if (field.maxLength && field.showCounter) {\n <span counter>{{inp.value.length}} /{{field.maxLength}}</span>\n }\n </ui-input>\n }\n @if (field.type === 'textarea') {\n <ui-input\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [disabled]=\"!!control?.disabled\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [internalIcon]=\"field.internalIcon??''\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\">\n <textarea #ta\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [minLength]=\"field.minLength||null\"\n [maxlength]=\"field.maxLength||null\"\n [textareaAutoresize]=\"field.textareaResize\"\n [textareaAutoresizeMinRows]=\"field.resizeMinRows??1\"\n [textareaAutoresizeMaxRows]=\"field.resizeMaxRows??5\"\n [rows]=\"field.resizeMinRows??3\"\n [placeholder]=\"field.placeholder??field.label\"\n ></textarea>\n @if (field.voiceToTextEnabled && !control?.disabled) {\n @let listening = isListening(field.name);\n <div class=\"speak-icon\" (click)=\"ta.focus()\">\n <ui-button\n [disabled]=\"listening\"\n style=\"margin-bottom: 2px;\"\n (click)=\"voiceToText(ta, field.name)\"\n [icon]=\"listening?'ri-mic-fill':'ri-mic-line'\"\n [type]=\"listening?'filled':'bordered'\"\n size=\"s\"\n [iconOnly]=\"true\"\n ></ui-button>\n @if (listening) {\n <i class=\"ri-voiceprint-line\"></i>\n }\n </div>\n }\n @if (field.showCounter) {\n <span counter>\n {{ta.value.length}}\n @if (field.maxLength) {\n /{{field.maxLength}}\n }\n </span>\n }\n </ui-input>\n }\n @if (field.type === 'phone') {\n <ui-phone-input\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\"\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [placeholder]=\"field.placeholder||field.label||''\"\n >\n </ui-phone-input>\n }\n @else if (field.type === 'date') {\n <ui-date-picker\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [tip]=\"field.tip??''\"\n [justMonth]=\"!!field.monthMode\"\n [min]=\"field.minDate??''\"\n [max]=\"field.maxDate??''\"\n [monthDay]=\"field.monthDay||'first'\"\n [formControlName]=\"field.name\"\n ></ui-date-picker>\n }\n @else if (field.type === 'time') {\n <ui-time-picker\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [tip]=\"field.tip??''\"\n [interval]=\"field.timeInterval??5\"\n [formControlName]=\"field.name\"\n ></ui-time-picker>\n }\n @else if (field.type === 'select') {\n <ui-select\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [loading]=\"field.loading??false\"\n [nullable]=\"field.selectNullable??false\"\n [showSubtitle]=\"field.showSubtitle??false\"\n [searcherEnabled]=\"field.selectSearchEnabled??false\"\n [tip]=\"field.tip??''\"\n [formControlName]=\"field.name\"\n [options]=\"optionsFor(field)\"\n ></ui-select>\n }\n @else if (field.type === 'multyselect') {\n <ui-multy-select\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [tip]=\"field.tip??''\"\n [formControlName]=\"field.name\"\n [maxSelections]=\"field.maxSelections ?? null\"\n [options]=\"optionsFor(field)\"\n ></ui-multy-select>\n }\n @else if (field.type === 'searcher') {\n <ui-searcher\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\"\n [searchFn]=\"getSearcherFn(field)\"\n [itemDisplayFn]=\"getSearcherDisplayFn(field)\"\n [itemIsEnabledFn]=\"getSearcherIsEnabledFn(field)\"\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\n [error]=\"error\"\n ></ui-searcher>\n }\n @else if (field.type === 'multisearcher') {\n <ui-multy-searcher\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [tip]=\"field.tip??''\"\n [searchFn]=\"getSearcherFn(field)\"\n [itemDisplayFn]=\"getSearcherDisplayFn(field)\"\n [itemIsEnabledFn]=\"getSearcherIsEnabledFn(field)\"\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\n [error]=\"error\"\n ></ui-multy-searcher>\n }\n @else if (field.type === 'file') {\n <ui-file-input\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [internalIcon]=\"field.internalIcon??''\"\n [internalIconColor]=\"field.internalIconColor??'grey'\"\n [multy]=\"field.multyEnabled??false\"\n [tip]=\"field.tip??''\"\n [fileTypes]=\"field.fileTypes??null\"\n [templateUrl]=\"field.templateUrl??''\"\n [templateText]=\"field.templateText??'Descarga el formato haciendo'\"\n [templateLinkLabel]=\"field.templateLinkLabel??'click aqu\u00ED'\"\n [fileUidResolverFn]=\"fileUidResolverFn\"\n [formControlName]=\"field.name\"\n ></ui-file-input>\n }\n @else if (['checkbox', 'switch'].includes(field.type)) {\n <ui-checkbox\n [label]=\"(field.label??'') + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [placeholder]=\"field.placeholder??''\"\n [tip]=\"field.tip??''\"\n [type]=\"field.type === 'checkbox' ? 'checkbox' : 'switch'\"\n ></ui-checkbox>\n }\n @else if (field.type === 'radio') {\n <ui-radio\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [tip]=\"field.tip??''\"\n [loading]=\"field.loading??false\"\n [error]=\"error\"\n [options]=\"optionsFor(field)\"\n ></ui-radio>\n }\n @else if (field.type === 'slider') {\n <ui-slider\n [min]=\"field.min??0\"\n [max]=\"field.max??100\"\n [step]=\"field.sliderInterval??1\"\n [markerCount]=\"field.sliderMarks??5\"\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [tip]=\"field.tip??''\"\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n ></ui-slider>\n }\n @else if (field.type === 'scale') {\n <ui-scale\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [tip]=\"field.tip??''\"\n [error]=\"error\"\n [min]=\"field.scaleMin ?? 1\"\n [max]=\"field.scaleMax ?? 5\"\n [mode]=\"field.scaleMode ?? 'number'\"\n [scaleIcon]=\"field.scaleIcon || 'ri-star-fill'\"\n [labels]=\"field.scaleLabels ?? []\"\n ></ui-scale>\n }\n @else if (field.type === 'distribution') {\n <ui-distribution\n [id]=\"field.name\"\n [formControlName]=\"field.name\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [tip]=\"field.tip??''\"\n [error]=\"error\"\n [options]=\"field.options || []\"\n ></ui-distribution>\n }\n @else if (field.type === 'pool') {\n <ui-pool-options\n [error]=\"error\"\n [label]=\"field.label + (field.required ? ' *' : '')\"\n [id]=\"field.name\"\n [icon]=\"getFieldIcon(field)\"\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\n [loading]=\"field.loading??false\"\n [multy]=\"field.multyEnabled??false\"\n [tip]=\"field.tip??''\"\n [listViewTitle]=\"field.poolTitle??'common.selected'\"\n [enabledListView]=\"field.poolEnabledListView||false\"\n [displayMode]=\"field.poolDisplayMode ?? 'flex'\"\n [gridColumns]=\"field.poolGridColumns ?? 2\"\n [maxSelections]=\"field.maxSelections ?? null\"\n [formControlName]=\"field.name\"\n [options]=\"field.options || []\"\n ></ui-pool-options>\n }\n @else if (field.type === 'repeater') {\n <ui-repeater\n [formArray]=\"asFormArray(control)\"\n [field]=\"field\"\n [cols]=\"cols\"\n [error]=\"error\"\n [fileUidResolverFn]=\"fileUidResolverFn\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [parentForm]=\"form\"\n ></ui-repeater>\n }\n\n <!-- \"Otros (especifica)\": el texto va pegado a su pregunta y solo existe mientras se eligi\u00F3 \"Otros\" -->\n @if (otherStateFor(field); as other) {\n <div class=\"other-specify\" (focusout)=\"onFieldContainerFocusout(other.field, $event)\">\n <ui-input\n [error]=\"getControlErrorMessages(other.control, other.field)[0]\"\n [disabled]=\"!!other.control?.disabled\">\n <input\n type=\"text\"\n [id]=\"other.field.name\"\n [formControlName]=\"other.field.name\"\n [maxlength]=\"otherTextMaxLength\"\n [attr.aria-label]=\"other.field.label\"\n [placeholder]=\"(other.field.placeholder ?? '') + (other.field.required ? ' *' : '')\"/>\n </ui-input>\n </div>\n }\n </div>\n }\n }\n</div>\n", styles: [".form{width:100%;display:grid;align-items:stretch;gap:var(--uic-form-gap, 1rem);padding-bottom:.75rem}@media (max-width: 479px){.form{grid-template-columns:1fr}}@media (min-width: 768px){.form{grid-template-columns:repeat(var(--cols),minmax(0,1fr))}}@media (min-width: 480px) and (max-width: 767px){.form{grid-template-columns:repeat(min(var(--cols),2),minmax(0,1fr))}}.form>*{min-width:0}h2{margin-top:1.5rem}.speak-icon{display:flex;width:100%;align-items:center;gap:10px}.speak-icon i{font-size:20px;color:var(--primary-500)}textarea{resize:none}.other-specify{margin-top:6px;padding-left:12px;border-left:solid 2px var(--uic-other-specify-guide, var(--primary-200));animation:other-specify-in .15s ease-out}@keyframes other-specify-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){.other-specify{animation:none}}\n"] }]
|
|
6189
|
+
], template: "<div class=\"form\" [ngStyle]=\"{'--cols': cols, '--min': '180px'}\" [formGroup]=\"form\">\r\n @for (state of visibleFieldStates(); track state.field.name) {\r\n @let field = state.field;\r\n @let control = state.control;\r\n @let currentValue = state.value ?? '';\r\n @let error = getControlErrorMessages(control, field)[0];\r\n\r\n @if (!field.hidden && !field.otherFor) {\r\n <div [style.grid-column]=\"getGridColumn(field)\" [attr.data-field-name]=\"field.name\" (focusout)=\"onFieldContainerFocusout(field, $event)\">\r\n @if (['text', 'number'].includes(field.type)) {\r\n @let inputColor = getInputColor(field, currentValue);\r\n <ui-input\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [disabled]=\"!!control?.disabled\"\r\n [internalIconColor]=\"inputColor\"\r\n [internalIcon]=\"field.internalIcon || (currentValue !== '' ? getIconByColor(field, inputColor) : '')\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\">\r\n <input #inp\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [type]=\"field.type\"\r\n [step]=\"field.step\"\r\n [min]=\"field.min\"\r\n [max]=\"field.max\"\r\n [minLength]=\"field.minLength||null\"\r\n [maxlength]=\"field.maxLength||null\"\r\n [placeholder]=\"field.placeholder??field.label\"/>\r\n @if (field.maxLength && field.showCounter) {\r\n <span counter>{{inp.value.length}} /{{field.maxLength}}</span>\r\n }\r\n </ui-input>\r\n }\r\n @if (field.type === 'textarea') {\r\n <ui-input\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [disabled]=\"!!control?.disabled\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\">\r\n <textarea #ta\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [minLength]=\"field.minLength||null\"\r\n [maxlength]=\"field.maxLength||null\"\r\n [textareaAutoresize]=\"field.textareaResize\"\r\n [textareaAutoresizeMinRows]=\"field.resizeMinRows??1\"\r\n [textareaAutoresizeMaxRows]=\"field.resizeMaxRows??5\"\r\n [rows]=\"field.resizeMinRows??3\"\r\n [placeholder]=\"field.placeholder??field.label\"\r\n ></textarea>\r\n @if (field.voiceToTextEnabled && !control?.disabled) {\r\n @let listening = isListening(field.name);\r\n <div class=\"speak-icon\" (click)=\"ta.focus()\">\r\n <ui-button\r\n [disabled]=\"listening\"\r\n style=\"margin-bottom: 2px;\"\r\n (click)=\"voiceToText(ta, field.name)\"\r\n [icon]=\"listening?'ri-mic-fill':'ri-mic-line'\"\r\n [type]=\"listening?'filled':'bordered'\"\r\n size=\"s\"\r\n [iconOnly]=\"true\"\r\n ></ui-button>\r\n @if (listening) {\r\n <i class=\"ri-voiceprint-line\"></i>\r\n }\r\n </div>\r\n }\r\n @if (field.showCounter) {\r\n <span counter>\r\n {{ta.value.length}}\r\n @if (field.maxLength) {\r\n /{{field.maxLength}}\r\n }\r\n </span>\r\n }\r\n </ui-input>\r\n }\r\n @if (field.type === 'phone') {\r\n <ui-phone-input\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [placeholder]=\"field.placeholder||field.label||''\"\r\n >\r\n </ui-phone-input>\r\n }\r\n @else if (field.type === 'date') {\r\n <ui-date-picker\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [tip]=\"field.tip??''\"\r\n [justMonth]=\"!!field.monthMode\"\r\n [min]=\"field.minDate??''\"\r\n [max]=\"field.maxDate??''\"\r\n [monthDay]=\"field.monthDay||'first'\"\r\n [formControlName]=\"field.name\"\r\n ></ui-date-picker>\r\n }\r\n @else if (field.type === 'time') {\r\n <ui-time-picker\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [tip]=\"field.tip??''\"\r\n [interval]=\"field.timeInterval??5\"\r\n [formControlName]=\"field.name\"\r\n ></ui-time-picker>\r\n }\r\n @else if (field.type === 'select') {\r\n <ui-select\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [loading]=\"field.loading??false\"\r\n [nullable]=\"field.selectNullable??false\"\r\n [showSubtitle]=\"field.showSubtitle??false\"\r\n [searcherEnabled]=\"field.selectSearchEnabled??false\"\r\n [tip]=\"field.tip??''\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"optionsFor(field)\"\r\n ></ui-select>\r\n }\r\n @else if (field.type === 'multyselect') {\r\n <ui-multy-select\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [tip]=\"field.tip??''\"\r\n [formControlName]=\"field.name\"\r\n [maxSelections]=\"field.maxSelections ?? null\"\r\n [options]=\"optionsFor(field)\"\r\n ></ui-multy-select>\r\n }\r\n @else if (field.type === 'searcher') {\r\n <ui-searcher\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\"\r\n [searchFn]=\"getSearcherFn(field)\"\r\n [itemDisplayFn]=\"getSearcherDisplayFn(field)\"\r\n [itemIsEnabledFn]=\"getSearcherIsEnabledFn(field)\"\r\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\r\n [error]=\"error\"\r\n ></ui-searcher>\r\n }\r\n @else if (field.type === 'multisearcher') {\r\n <ui-multy-searcher\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\"\r\n [searchFn]=\"getSearcherFn(field)\"\r\n [itemDisplayFn]=\"getSearcherDisplayFn(field)\"\r\n [itemIsEnabledFn]=\"getSearcherIsEnabledFn(field)\"\r\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\r\n [error]=\"error\"\r\n ></ui-multy-searcher>\r\n }\r\n @else if (field.type === 'file') {\r\n <ui-file-input\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [multy]=\"field.multyEnabled??false\"\r\n [tip]=\"field.tip??''\"\r\n [fileTypes]=\"field.fileTypes??null\"\r\n [templateUrl]=\"field.templateUrl??''\"\r\n [templateText]=\"field.templateText??'Descarga el formato haciendo'\"\r\n [templateLinkLabel]=\"field.templateLinkLabel??'click aqu\u00ED'\"\r\n [fileUidResolverFn]=\"fileUidResolverFn\"\r\n [formControlName]=\"field.name\"\r\n ></ui-file-input>\r\n }\r\n @else if (['checkbox', 'switch'].includes(field.type)) {\r\n <ui-checkbox\r\n [label]=\"(field.label??'') + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [placeholder]=\"field.placeholder??''\"\r\n [tip]=\"field.tip??''\"\r\n [type]=\"field.type === 'checkbox' ? 'checkbox' : 'switch'\"\r\n ></ui-checkbox>\r\n }\r\n @else if (field.type === 'radio') {\r\n <ui-radio\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [loading]=\"field.loading??false\"\r\n [error]=\"error\"\r\n [options]=\"optionsFor(field)\"\r\n ></ui-radio>\r\n }\r\n @else if (field.type === 'slider') {\r\n <ui-slider\r\n [min]=\"field.min??0\"\r\n [max]=\"field.max??100\"\r\n [step]=\"field.sliderInterval??1\"\r\n [markerCount]=\"field.sliderMarks??5\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n ></ui-slider>\r\n }\r\n @else if (field.type === 'scale') {\r\n <ui-scale\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"error\"\r\n [min]=\"field.scaleMin ?? 1\"\r\n [max]=\"field.scaleMax ?? 5\"\r\n [mode]=\"field.scaleMode ?? 'number'\"\r\n [scaleIcon]=\"field.scaleIcon || 'ri-star-fill'\"\r\n [labels]=\"field.scaleLabels ?? []\"\r\n ></ui-scale>\r\n }\r\n @else if (field.type === 'chips') {\r\n <ui-chips-input\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"error\"\r\n [placeholder]=\"field.placeholder || 'chips_input.placeholder'\"\r\n [maxItems]=\"field.maxSelections ?? null\"\r\n [maxLength]=\"field.maxLength ?? null\"\r\n ></ui-chips-input>\r\n }\r\n @else if (field.type === 'distribution') {\r\n <ui-distribution\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"error\"\r\n [options]=\"field.options || []\"\r\n ></ui-distribution>\r\n }\r\n @else if (field.type === 'pool') {\r\n <ui-pool-options\r\n [error]=\"error\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"getFieldIcon(field)\"\r\n [iconColor]=\"getFieldIconColor(field, control, currentValue)\"\r\n [loading]=\"field.loading??false\"\r\n [multy]=\"field.multyEnabled??false\"\r\n [tip]=\"field.tip??''\"\r\n [listViewTitle]=\"field.poolTitle??'common.selected'\"\r\n [enabledListView]=\"field.poolEnabledListView||false\"\r\n [displayMode]=\"field.poolDisplayMode ?? 'flex'\"\r\n [gridColumns]=\"field.poolGridColumns ?? 2\"\r\n [maxSelections]=\"field.maxSelections ?? null\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-pool-options>\r\n }\r\n @else if (field.type === 'repeater') {\r\n <ui-repeater\r\n [formArray]=\"asFormArray(control)\"\r\n [field]=\"field\"\r\n [cols]=\"cols\"\r\n [error]=\"error\"\r\n [fileUidResolverFn]=\"fileUidResolverFn\"\r\n [selectOptionsResolver]=\"selectOptionsResolver\"\r\n [parentForm]=\"form\"\r\n ></ui-repeater>\r\n }\r\n\r\n <!-- \"Otros (especifica)\": el texto va pegado a su pregunta y solo existe mientras se eligi\u00F3 \"Otros\" -->\r\n @if (otherStateFor(field); as other) {\r\n <div class=\"other-specify\" (focusout)=\"onFieldContainerFocusout(other.field, $event)\">\r\n <ui-input\r\n [error]=\"getControlErrorMessages(other.control, other.field)[0]\"\r\n [disabled]=\"!!other.control?.disabled\">\r\n <input\r\n type=\"text\"\r\n [id]=\"other.field.name\"\r\n [formControlName]=\"other.field.name\"\r\n [maxlength]=\"otherTextMaxLength\"\r\n [attr.aria-label]=\"other.field.label\"\r\n [placeholder]=\"(other.field.placeholder ?? '') + (other.field.required ? ' *' : '')\"/>\r\n </ui-input>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;align-items:stretch;gap:var(--uic-form-gap, 1rem);padding-bottom:.75rem}@media (max-width: 479px){.form{grid-template-columns:1fr}}@media (min-width: 768px){.form{grid-template-columns:repeat(var(--cols),minmax(0,1fr))}}@media (min-width: 480px) and (max-width: 767px){.form{grid-template-columns:repeat(min(var(--cols),2),minmax(0,1fr))}}.form>*{min-width:0}h2{margin-top:1.5rem}.speak-icon{display:flex;width:100%;align-items:center;gap:10px}.speak-icon i{font-size:20px;color:var(--primary-500)}textarea{resize:none}.other-specify{margin-top:6px;padding-left:12px;border-left:solid 2px var(--uic-other-specify-guide, var(--primary-200));animation:other-specify-in .15s ease-out}@keyframes other-specify-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){.other-specify{animation:none}}\n"] }]
|
|
5958
6190
|
}], ctorParameters: () => [{ type: i0.NgZone }], propDecorators: { fields: [{
|
|
5959
6191
|
type: Input
|
|
5960
6192
|
}], contextFields: [{
|
|
@@ -6203,10 +6435,13 @@ class UicFormEngine {
|
|
|
6203
6435
|
validators.push(Validators.min(field.min));
|
|
6204
6436
|
if (typeof field.max === 'number')
|
|
6205
6437
|
validators.push(Validators.max(field.max));
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6438
|
+
// En chips, maxLength es el largo de cada chip (lo aplica el componente), no del arreglo.
|
|
6439
|
+
if (field.type !== 'chips') {
|
|
6440
|
+
if (typeof field.maxLength === 'number')
|
|
6441
|
+
validators.push(Validators.maxLength(field.maxLength));
|
|
6442
|
+
if (typeof field.minLength === 'number')
|
|
6443
|
+
validators.push(Validators.minLength(field.minLength));
|
|
6444
|
+
}
|
|
6210
6445
|
if (field.pattern instanceof RegExp)
|
|
6211
6446
|
validators.push(Validators.pattern(field.pattern));
|
|
6212
6447
|
validators.push(...uicSelectionValidatorsFor(field));
|
|
@@ -7431,7 +7666,7 @@ class UicFormWrapperComponent {
|
|
|
7431
7666
|
return Array.from(focusableElements).find(element => element.id === fieldName) ?? null;
|
|
7432
7667
|
}
|
|
7433
7668
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7434
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFormWrapperComponent, isStandalone: true, selector: "ui-form-wrapper", inputs: { schema: "schema", fields: "fields", cols: "cols", externalData: "externalData", selectOptionsResolver: "selectOptionsResolver", computedFieldResolver: "computedFieldResolver", externalValidatorResolver: "externalValidatorResolver", disabled: "disabled", fillSelects: "fillSelects", initialValues: "initialValues", loading: "loading", showButtons: "showButtons", iconMode: "iconMode", focusFieldName: "focusFieldName", focusFieldTrigger: "focusFieldTrigger", fileUidResolverFn: "fileUidResolverFn" }, outputs: { formSubmit: "formSubmit", formChange: "formChange", optionsSourceError: "optionsSourceError" }, providers: [UicFormStateService, UicFormEngine], usesOnChanges: true, ngImport: i0, template: "@let state = view();\n<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\n @for (block of state.schema.blocks; track $index) {\n\n <section class=\"form-block\">\n @if (block.title){\n <div class=\"block-title\" [ngStyle]=\"getBlockTitleStyles($index)\">{{ block.title }}</div>\n }\n @if (block.subtitle){\n <div class=\"block-subtitle\" [ngStyle]=\"getBlockSubtitleStyles($index)\">{{ block.subtitle }}</div>\n }\n\n @if (block.message){\n <div class=\"block-message\" [innerHTML]=\"block.message\" ></div>\n }\n\n @if (loading) {\n <ui-skeleton-loader\n [cols]=\"state.schema.cols\"\n [inputs]=\"block.fields.length\"\n ></ui-skeleton-loader>\n } @else {\n <ui-dynamic-form\n [cols]=\"state.schema.cols\"\n [disabled]=\"disabled\"\n [iconMode]=\"iconMode\"\n [fileUidResolverFn]=\"fileUidResolverFn\"\n [fields]=\"block.fields\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [externalValidationStates]=\"state.externalValidationStates\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n (fieldBlur)=\"onFieldBlur($event)\">\n </ui-dynamic-form>\n }\n </section>\n }\n @if ( showButtons ) {\n\n <div class=\"form-buttons\">\n <ui-button color=\"black\" type=\"bordered\" (click)=\"clean()\">{{'common.clear' | uicTranslate}}</ui-button>\n <ui-button color=\"black\" (click)=\"submit()\">{{'common.save' | uicTranslate}}</ui-button>\n </div>\n }\n</form>\n", styles: [":host{display:block;padding:.25rem 0}.block-message{margin:0 0 16px;font-size:var(--uic-block-message-font-size, 13px);color:var(--uic-block-message-color, var(--uic-neutral-500, var(--grey-500, #666)));line-height:1.5}.block-title{font-size:var(--uic-block-title-font-size, 1.625rem);font-weight:600;line-height:calc(var(--uic-block-title-font-size, 1.625rem) + 4px);margin:1rem 0;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.block-subtitle{font-size:var(--uic-block-subtitle-font-size, 1.25rem);font-weight:600;line-height:calc(var(--uic-block-subtitle-font-size, 1.25rem) + 4px);margin:.75rem 0;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.form-buttons{display:flex;gap:10px;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "contextFields", "isSubForm", "form", "disabled", "externalValidationStates", "voiceToTextSilenceMs", "cols", "iconMode", "fileUidResolverFn", "selectOptionsResolver", "parentFormValues"], outputs: ["fieldBlur"] }, { kind: "component", type: UicSkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
7669
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFormWrapperComponent, isStandalone: true, selector: "ui-form-wrapper", inputs: { schema: "schema", fields: "fields", cols: "cols", externalData: "externalData", selectOptionsResolver: "selectOptionsResolver", computedFieldResolver: "computedFieldResolver", externalValidatorResolver: "externalValidatorResolver", disabled: "disabled", fillSelects: "fillSelects", initialValues: "initialValues", loading: "loading", showButtons: "showButtons", iconMode: "iconMode", focusFieldName: "focusFieldName", focusFieldTrigger: "focusFieldTrigger", fileUidResolverFn: "fileUidResolverFn" }, outputs: { formSubmit: "formSubmit", formChange: "formChange", optionsSourceError: "optionsSourceError" }, providers: [UicFormStateService, UicFormEngine], usesOnChanges: true, ngImport: i0, template: "@let state = view();\r\n<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n @for (block of state.schema.blocks; track $index) {\r\n\r\n <section class=\"form-block\">\r\n @if (block.title){\r\n <div class=\"block-title\" [ngStyle]=\"getBlockTitleStyles($index)\">{{ block.title }}</div>\r\n }\r\n @if (block.subtitle){\r\n <div class=\"block-subtitle\" [ngStyle]=\"getBlockSubtitleStyles($index)\">{{ block.subtitle }}</div>\r\n }\r\n\r\n @if (block.message){\r\n <div class=\"block-message\" [innerHTML]=\"block.message\" ></div>\r\n }\r\n\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"state.schema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <ui-dynamic-form\r\n [cols]=\"state.schema.cols\"\r\n [disabled]=\"disabled\"\r\n [iconMode]=\"iconMode\"\r\n [fileUidResolverFn]=\"fileUidResolverFn\"\r\n [fields]=\"block.fields\"\r\n [contextFields]=\"state.allFields\"\r\n [form]=\"form\"\r\n [externalValidationStates]=\"state.externalValidationStates\"\r\n [selectOptionsResolver]=\"selectOptionsResolver\"\r\n (fieldBlur)=\"onFieldBlur($event)\">\r\n </ui-dynamic-form>\r\n }\r\n </section>\r\n }\r\n @if ( showButtons ) {\r\n\r\n <div class=\"form-buttons\">\r\n <ui-button color=\"black\" type=\"bordered\" (click)=\"clean()\">{{'common.clear' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" (click)=\"submit()\">{{'common.save' | uicTranslate}}</ui-button>\r\n </div>\r\n }\r\n</form>\r\n", styles: [":host{display:block;padding:.25rem 0}.block-message{margin:0 0 16px;font-size:var(--uic-block-message-font-size, 13px);color:var(--uic-block-message-color, var(--uic-neutral-500, var(--grey-500, #666)));line-height:1.5}.block-title{font-size:var(--uic-block-title-font-size, 1.625rem);font-weight:600;line-height:calc(var(--uic-block-title-font-size, 1.625rem) + 4px);margin:1rem 0;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.block-subtitle{font-size:var(--uic-block-subtitle-font-size, 1.25rem);font-weight:600;line-height:calc(var(--uic-block-subtitle-font-size, 1.25rem) + 4px);margin:.75rem 0;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.form-buttons{display:flex;gap:10px;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "contextFields", "isSubForm", "form", "disabled", "externalValidationStates", "voiceToTextSilenceMs", "cols", "iconMode", "fileUidResolverFn", "selectOptionsResolver", "parentFormValues"], outputs: ["fieldBlur"] }, { kind: "component", type: UicSkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
7435
7670
|
}
|
|
7436
7671
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, decorators: [{
|
|
7437
7672
|
type: Component,
|
|
@@ -7442,7 +7677,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7442
7677
|
UicButtonComponent,
|
|
7443
7678
|
UicTranslatePipe,
|
|
7444
7679
|
ReactiveFormsModule
|
|
7445
|
-
], providers: [UicFormStateService, UicFormEngine], template: "@let state = view();\n<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\n @for (block of state.schema.blocks; track $index) {\n\n <section class=\"form-block\">\n @if (block.title){\n <div class=\"block-title\" [ngStyle]=\"getBlockTitleStyles($index)\">{{ block.title }}</div>\n }\n @if (block.subtitle){\n <div class=\"block-subtitle\" [ngStyle]=\"getBlockSubtitleStyles($index)\">{{ block.subtitle }}</div>\n }\n\n @if (block.message){\n <div class=\"block-message\" [innerHTML]=\"block.message\" ></div>\n }\n\n @if (loading) {\n <ui-skeleton-loader\n [cols]=\"state.schema.cols\"\n [inputs]=\"block.fields.length\"\n ></ui-skeleton-loader>\n } @else {\n <ui-dynamic-form\n [cols]=\"state.schema.cols\"\n [disabled]=\"disabled\"\n [iconMode]=\"iconMode\"\n [fileUidResolverFn]=\"fileUidResolverFn\"\n [fields]=\"block.fields\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [externalValidationStates]=\"state.externalValidationStates\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n (fieldBlur)=\"onFieldBlur($event)\">\n </ui-dynamic-form>\n }\n </section>\n }\n @if ( showButtons ) {\n\n <div class=\"form-buttons\">\n <ui-button color=\"black\" type=\"bordered\" (click)=\"clean()\">{{'common.clear' | uicTranslate}}</ui-button>\n <ui-button color=\"black\" (click)=\"submit()\">{{'common.save' | uicTranslate}}</ui-button>\n </div>\n }\n</form>\n", styles: [":host{display:block;padding:.25rem 0}.block-message{margin:0 0 16px;font-size:var(--uic-block-message-font-size, 13px);color:var(--uic-block-message-color, var(--uic-neutral-500, var(--grey-500, #666)));line-height:1.5}.block-title{font-size:var(--uic-block-title-font-size, 1.625rem);font-weight:600;line-height:calc(var(--uic-block-title-font-size, 1.625rem) + 4px);margin:1rem 0;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.block-subtitle{font-size:var(--uic-block-subtitle-font-size, 1.25rem);font-weight:600;line-height:calc(var(--uic-block-subtitle-font-size, 1.25rem) + 4px);margin:.75rem 0;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.form-buttons{display:flex;gap:10px;width:100%}\n"] }]
|
|
7680
|
+
], providers: [UicFormStateService, UicFormEngine], template: "@let state = view();\r\n<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n @for (block of state.schema.blocks; track $index) {\r\n\r\n <section class=\"form-block\">\r\n @if (block.title){\r\n <div class=\"block-title\" [ngStyle]=\"getBlockTitleStyles($index)\">{{ block.title }}</div>\r\n }\r\n @if (block.subtitle){\r\n <div class=\"block-subtitle\" [ngStyle]=\"getBlockSubtitleStyles($index)\">{{ block.subtitle }}</div>\r\n }\r\n\r\n @if (block.message){\r\n <div class=\"block-message\" [innerHTML]=\"block.message\" ></div>\r\n }\r\n\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"state.schema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <ui-dynamic-form\r\n [cols]=\"state.schema.cols\"\r\n [disabled]=\"disabled\"\r\n [iconMode]=\"iconMode\"\r\n [fileUidResolverFn]=\"fileUidResolverFn\"\r\n [fields]=\"block.fields\"\r\n [contextFields]=\"state.allFields\"\r\n [form]=\"form\"\r\n [externalValidationStates]=\"state.externalValidationStates\"\r\n [selectOptionsResolver]=\"selectOptionsResolver\"\r\n (fieldBlur)=\"onFieldBlur($event)\">\r\n </ui-dynamic-form>\r\n }\r\n </section>\r\n }\r\n @if ( showButtons ) {\r\n\r\n <div class=\"form-buttons\">\r\n <ui-button color=\"black\" type=\"bordered\" (click)=\"clean()\">{{'common.clear' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" (click)=\"submit()\">{{'common.save' | uicTranslate}}</ui-button>\r\n </div>\r\n }\r\n</form>\r\n", styles: [":host{display:block;padding:.25rem 0}.block-message{margin:0 0 16px;font-size:var(--uic-block-message-font-size, 13px);color:var(--uic-block-message-color, var(--uic-neutral-500, var(--grey-500, #666)));line-height:1.5}.block-title{font-size:var(--uic-block-title-font-size, 1.625rem);font-weight:600;line-height:calc(var(--uic-block-title-font-size, 1.625rem) + 4px);margin:1rem 0;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.block-subtitle{font-size:var(--uic-block-subtitle-font-size, 1.25rem);font-weight:600;line-height:calc(var(--uic-block-subtitle-font-size, 1.25rem) + 4px);margin:.75rem 0;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.form-buttons{display:flex;gap:10px;width:100%}\n"] }]
|
|
7446
7681
|
}], ctorParameters: () => [], propDecorators: { schema: [{
|
|
7447
7682
|
type: Input
|
|
7448
7683
|
}], fields: [{
|
|
@@ -7758,7 +7993,7 @@ class UicDropdownContainerComponent {
|
|
|
7758
7993
|
provide: DROPDOWN_OVERLAY_CONTROLS,
|
|
7759
7994
|
useExisting: forwardRef(() => UicDropdownContainerComponent),
|
|
7760
7995
|
},
|
|
7761
|
-
], queries: [{ propertyName: "projectedTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true, static: true }], ngImport: i0, template: "\
|
|
7996
|
+
], queries: [{ propertyName: "projectedTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true, static: true }], ngImport: i0, template: "\n<div #triggerButton class=\"triggerButton\" (click)=\"onTriggerClick($event)\">\n <ng-content select=\"[button]\"></ng-content>\n</div>\n\n<ng-template #contentTemplate >\n <div class=\"ui-dropdown-panel\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n</ng-template>", styles: [":host{display:inline-block}.triggerButton{width:fit-content;height:fit-content}.ui-dropdown-panel{border-radius:var(--input-radius);background-color:var(--uic-surface, var(--white));box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;max-height:50vh;font-size:.875rem;z-index:500;overflow:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
7762
7997
|
}
|
|
7763
7998
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDropdownContainerComponent, decorators: [{
|
|
7764
7999
|
type: Component,
|
|
@@ -7767,7 +8002,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7767
8002
|
provide: DROPDOWN_OVERLAY_CONTROLS,
|
|
7768
8003
|
useExisting: forwardRef(() => UicDropdownContainerComponent),
|
|
7769
8004
|
},
|
|
7770
|
-
], template: "\
|
|
8005
|
+
], template: "\n<div #triggerButton class=\"triggerButton\" (click)=\"onTriggerClick($event)\">\n <ng-content select=\"[button]\"></ng-content>\n</div>\n\n<ng-template #contentTemplate >\n <div class=\"ui-dropdown-panel\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n</ng-template>", styles: [":host{display:inline-block}.triggerButton{width:fit-content;height:fit-content}.ui-dropdown-panel{border-radius:var(--input-radius);background-color:var(--uic-surface, var(--white));box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;max-height:50vh;font-size:.875rem;z-index:500;overflow:auto}\n"] }]
|
|
7771
8006
|
}], propDecorators: { buttonLabel: [{
|
|
7772
8007
|
type: Input
|
|
7773
8008
|
}], disabled: [{
|
|
@@ -7965,6 +8200,13 @@ class UicActionButtonComponent {
|
|
|
7965
8200
|
options = [];
|
|
7966
8201
|
multiselect = false;
|
|
7967
8202
|
size = 's';
|
|
8203
|
+
/** Texto del disparador. Si se indica, el botón deja de ser solo icono. */
|
|
8204
|
+
text = '';
|
|
8205
|
+
/** Icono a la derecha del texto (solo se muestra con `text`). */
|
|
8206
|
+
rightIcon = 'ri-arrow-down-s-line';
|
|
8207
|
+
color = 'black';
|
|
8208
|
+
type = 'ghost';
|
|
8209
|
+
disabled = false;
|
|
7968
8210
|
optionSelected = new EventEmitter();
|
|
7969
8211
|
optionsApplied = new EventEmitter();
|
|
7970
8212
|
menuTemplate;
|
|
@@ -8040,11 +8282,11 @@ class UicActionButtonComponent {
|
|
|
8040
8282
|
}
|
|
8041
8283
|
}
|
|
8042
8284
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8043
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicActionButtonComponent, isStandalone: true, selector: "ui-action-button", inputs: { icon: "icon", options: "options", multiselect: "multiselect", size: "size" }, outputs: { optionSelected: "optionSelected", optionsApplied: "optionsApplied" }, viewQueries: [{ propertyName: "menuTemplate", first: true, predicate: ["menuTemplate"], descendants: true }], ngImport: i0, template: "<!-- Bot\u00F3n -->\r\n<ui-button class=\"action-btn\" [size]=\"size\" [icon]=\"icon\" color=\"
|
|
8285
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicActionButtonComponent, isStandalone: true, selector: "ui-action-button", inputs: { icon: "icon", options: "options", multiselect: "multiselect", size: "size", text: "text", rightIcon: "rightIcon", color: "color", type: "type", disabled: "disabled" }, outputs: { optionSelected: "optionSelected", optionsApplied: "optionsApplied" }, viewQueries: [{ propertyName: "menuTemplate", first: true, predicate: ["menuTemplate"], descendants: true }], ngImport: i0, template: "<!-- Bot\u00F3n -->\r\n<ui-button class=\"action-btn\" [size]=\"size\" [icon]=\"icon\" [color]=\"color\" [type]=\"type\"\r\n [text]=\"text\" [iconOnly]=\"!text\" [rightIcon]=\"text ? rightIcon : ''\" [disabled]=\"disabled\" (click)=\"openMenu()\">\r\n</ui-button>\r\n\r\n<!-- Men\u00FA -->\r\n<ng-template #menuTemplate>\r\n <div class=\"action-menu\" [class]=\"'action-menu action-menu-' + size\">\r\n @if (multiselect) {\r\n <div class=\"action-menu-header\">\r\n <ui-checkbox [noPadding]=\"true\" \r\n [ngModel]=\"allSelected\" \r\n (ngModelChange)=\"toggleAll($event)\" [placeholder]=\"'common.all' | uicTranslate\"></ui-checkbox>\r\n </div>\r\n }\r\n <div class=\"action-menu-body\">\r\n @for (opt of options; track $index) {\r\n <div class=\"action-menu-item\" (click)=\"multiselect ? toggleOption(opt) : selectOption(opt)\">\r\n @if (multiselect) {\r\n <div>\r\n <ui-checkbox [noPadding]=\"true\" [ngModel]=\"selectedSet.has(opt.id)\"></ui-checkbox>\r\n </div>\r\n }\r\n @if (opt.icon) {\r\n <i [class]=\"opt.icon\"></i>\r\n }\r\n <span>{{ opt.label | uicTranslate }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Footer con bot\u00F3n aplicar -->\r\n @if (multiselect) {\r\n <div class=\"action-menu-footer\">\r\n <ui-button type=\"bordered\" color=\"black\" size=\"t\" (click)=\"closeMenu()\">{{'common.close' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"t\" (click)=\"applySelection()\">{{'common.apply' | uicTranslate}}</ui-button>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";.action-menu{display:flex;flex-direction:column;max-height:300px;min-width:150px;background:var(--uic-surface, white);border:1px solid var(--border-color, var(--uic-border, #ddd));border-radius:10px;box-shadow:var(--uic-shadow-md, 0 2px 6px rgba(0, 0, 0, .15))}.action-menu-item{padding:2px 8px;cursor:pointer;display:flex;font-size:13px;line-height:24px;font-weight:400;color:var(--uic-neutral-700, var(--grey-700));align-items:center;gap:10px}.action-menu-header{padding:2px 4px;cursor:pointer;display:flex;align-items:center;font-size:14px;gap:10px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300))}.action-menu-item:hover{background:var(--uic-neutral-100, var(--grey-100))}.action-menu-body{overflow-y:auto}.action-menu-footer{border-top:solid 1px var(--uic-neutral-300, var(--grey-300));display:flex;justify-content:space-around;padding:4px;gap:8px}.action-menu-item i{font-size:1.15em}.action-menu-t .action-menu-item{font-size:12px;line-height:22px}.action-menu-m{min-width:180px}.action-menu-m .action-menu-item{font-size:14px;line-height:32px;padding:2px 12px}.action-menu-l{min-width:210px;padding:4px 0}.action-menu-l .action-menu-item{font-size:15px;line-height:40px;padding:0 14px;gap:12px}.action-menu-g{min-width:240px;padding:6px 0}.action-menu-g .action-menu-item{font-size:16px;line-height:44px;padding:0 16px;gap:12px}\n"], dependencies: [{ kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
8044
8286
|
}
|
|
8045
8287
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicActionButtonComponent, decorators: [{
|
|
8046
8288
|
type: Component,
|
|
8047
|
-
args: [{ selector: 'ui-action-button', imports: [UicCheckboxComponent, UicButtonComponent, FormsModule, UicTranslatePipe], template: "<!-- Bot\u00F3n -->\r\n<ui-button class=\"action-btn\" [size]=\"size\" [icon]=\"icon\" color=\"
|
|
8289
|
+
args: [{ selector: 'ui-action-button', imports: [UicCheckboxComponent, UicButtonComponent, FormsModule, UicTranslatePipe], template: "<!-- Bot\u00F3n -->\r\n<ui-button class=\"action-btn\" [size]=\"size\" [icon]=\"icon\" [color]=\"color\" [type]=\"type\"\r\n [text]=\"text\" [iconOnly]=\"!text\" [rightIcon]=\"text ? rightIcon : ''\" [disabled]=\"disabled\" (click)=\"openMenu()\">\r\n</ui-button>\r\n\r\n<!-- Men\u00FA -->\r\n<ng-template #menuTemplate>\r\n <div class=\"action-menu\" [class]=\"'action-menu action-menu-' + size\">\r\n @if (multiselect) {\r\n <div class=\"action-menu-header\">\r\n <ui-checkbox [noPadding]=\"true\" \r\n [ngModel]=\"allSelected\" \r\n (ngModelChange)=\"toggleAll($event)\" [placeholder]=\"'common.all' | uicTranslate\"></ui-checkbox>\r\n </div>\r\n }\r\n <div class=\"action-menu-body\">\r\n @for (opt of options; track $index) {\r\n <div class=\"action-menu-item\" (click)=\"multiselect ? toggleOption(opt) : selectOption(opt)\">\r\n @if (multiselect) {\r\n <div>\r\n <ui-checkbox [noPadding]=\"true\" [ngModel]=\"selectedSet.has(opt.id)\"></ui-checkbox>\r\n </div>\r\n }\r\n @if (opt.icon) {\r\n <i [class]=\"opt.icon\"></i>\r\n }\r\n <span>{{ opt.label | uicTranslate }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Footer con bot\u00F3n aplicar -->\r\n @if (multiselect) {\r\n <div class=\"action-menu-footer\">\r\n <ui-button type=\"bordered\" color=\"black\" size=\"t\" (click)=\"closeMenu()\">{{'common.close' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"t\" (click)=\"applySelection()\">{{'common.apply' | uicTranslate}}</ui-button>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";.action-menu{display:flex;flex-direction:column;max-height:300px;min-width:150px;background:var(--uic-surface, white);border:1px solid var(--border-color, var(--uic-border, #ddd));border-radius:10px;box-shadow:var(--uic-shadow-md, 0 2px 6px rgba(0, 0, 0, .15))}.action-menu-item{padding:2px 8px;cursor:pointer;display:flex;font-size:13px;line-height:24px;font-weight:400;color:var(--uic-neutral-700, var(--grey-700));align-items:center;gap:10px}.action-menu-header{padding:2px 4px;cursor:pointer;display:flex;align-items:center;font-size:14px;gap:10px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300))}.action-menu-item:hover{background:var(--uic-neutral-100, var(--grey-100))}.action-menu-body{overflow-y:auto}.action-menu-footer{border-top:solid 1px var(--uic-neutral-300, var(--grey-300));display:flex;justify-content:space-around;padding:4px;gap:8px}.action-menu-item i{font-size:1.15em}.action-menu-t .action-menu-item{font-size:12px;line-height:22px}.action-menu-m{min-width:180px}.action-menu-m .action-menu-item{font-size:14px;line-height:32px;padding:2px 12px}.action-menu-l{min-width:210px;padding:4px 0}.action-menu-l .action-menu-item{font-size:15px;line-height:40px;padding:0 14px;gap:12px}.action-menu-g{min-width:240px;padding:6px 0}.action-menu-g .action-menu-item{font-size:16px;line-height:44px;padding:0 16px;gap:12px}\n"] }]
|
|
8048
8290
|
}], propDecorators: { icon: [{
|
|
8049
8291
|
type: Input
|
|
8050
8292
|
}], options: [{
|
|
@@ -8053,6 +8295,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8053
8295
|
type: Input
|
|
8054
8296
|
}], size: [{
|
|
8055
8297
|
type: Input
|
|
8298
|
+
}], text: [{
|
|
8299
|
+
type: Input
|
|
8300
|
+
}], rightIcon: [{
|
|
8301
|
+
type: Input
|
|
8302
|
+
}], color: [{
|
|
8303
|
+
type: Input
|
|
8304
|
+
}], type: [{
|
|
8305
|
+
type: Input
|
|
8306
|
+
}], disabled: [{
|
|
8307
|
+
type: Input
|
|
8056
8308
|
}], optionSelected: [{
|
|
8057
8309
|
type: Output
|
|
8058
8310
|
}], optionsApplied: [{
|
|
@@ -8234,11 +8486,11 @@ class UicModalComponent {
|
|
|
8234
8486
|
this.modalRef.closeFloating(null);
|
|
8235
8487
|
}
|
|
8236
8488
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicModalComponent, deps: [{ token: UiModalRef }, { token: MODAL_COMPONENT }, { token: MODAL_CONFIG }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
8237
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicModalComponent, isStandalone: true, selector: "ui-modal", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], ngImport: i0, template: "<div class=\"uic_backdrop\" (click)=\"closeOuside()\"> \
|
|
8489
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicModalComponent, isStandalone: true, selector: "ui-modal", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], ngImport: i0, template: "<div class=\"uic_backdrop\" (click)=\"closeOuside()\"> \n <div @pushTop class=\"uic_modal\" \n [class]=\"myConfig.size ? 'uic_' + myConfig.size : ''\"\n (click)=\"$event.stopPropagation()\">\n \n @if ( myConfig.title) {\n <div class=\"uic_modal-header\">\n {{myConfig.title}}\n <ui-button color=\"red\" type=\"ghost\" icon=\"ri-close-large-line\" (click)=\"close()\" [iconOnly]=\"true\"></ui-button>\n </div>\n }\n <div class=\"uic_modal-body\" [class.uic_body-padding]=\"myConfig.title!='' && !myConfig.noPadding\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n </div>\n</div>\n", styles: [".uic_backdrop{position:fixed;width:100%;height:100vh;background-color:var(--uic-backdrop, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center}@media (max-width: 479px){.uic_backdrop{align-items:flex-start;padding-top:20px}}.uic_modal{background:var(--uic-surface, var(--white));border-radius:20px;min-width:300px;max-width:90%;height:fit-content;max-height:90vh;box-shadow:var(--uic-shadow-lg, 0 20px 70px 0 rgba(0, 0, 0, .32));overflow:hidden;display:flex;flex-direction:column}.uic_modal-header{padding:0 15px;width:100%;display:flex;align-items:center;font-size:22px;font-weight:600;justify-content:space-between;margin:0 auto;color:var(--primary-500);height:63px;border-bottom:solid 1px var(--primary-500)}@media (max-width: 479px){.uic_modal-header{padding:5px}}.uic_modal-body{flex:1 1;overflow-y:auto}.uic_body-padding{padding:25px}@media (max-width: 479px){.uic_body-padding{padding:10px}}.uic_medium{width:70%;max-width:800px;max-height:80%}@media (max-width: 479px){.uic_medium{width:90%}}.uic_large{width:80%;max-width:900px}@media (max-width: 479px){.uic_large{width:95%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1$2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }], animations: [pushTop] });
|
|
8238
8490
|
}
|
|
8239
8491
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicModalComponent, decorators: [{
|
|
8240
8492
|
type: Component,
|
|
8241
|
-
args: [{ selector: 'ui-modal', imports: [CommonModule, PortalModule, UicButtonComponent], animations: [pushTop], template: "<div class=\"uic_backdrop\" (click)=\"closeOuside()\"> \
|
|
8493
|
+
args: [{ selector: 'ui-modal', imports: [CommonModule, PortalModule, UicButtonComponent], animations: [pushTop], template: "<div class=\"uic_backdrop\" (click)=\"closeOuside()\"> \n <div @pushTop class=\"uic_modal\" \n [class]=\"myConfig.size ? 'uic_' + myConfig.size : ''\"\n (click)=\"$event.stopPropagation()\">\n \n @if ( myConfig.title) {\n <div class=\"uic_modal-header\">\n {{myConfig.title}}\n <ui-button color=\"red\" type=\"ghost\" icon=\"ri-close-large-line\" (click)=\"close()\" [iconOnly]=\"true\"></ui-button>\n </div>\n }\n <div class=\"uic_modal-body\" [class.uic_body-padding]=\"myConfig.title!='' && !myConfig.noPadding\">\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n </div>\n</div>\n", styles: [".uic_backdrop{position:fixed;width:100%;height:100vh;background-color:var(--uic-backdrop, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center}@media (max-width: 479px){.uic_backdrop{align-items:flex-start;padding-top:20px}}.uic_modal{background:var(--uic-surface, var(--white));border-radius:20px;min-width:300px;max-width:90%;height:fit-content;max-height:90vh;box-shadow:var(--uic-shadow-lg, 0 20px 70px 0 rgba(0, 0, 0, .32));overflow:hidden;display:flex;flex-direction:column}.uic_modal-header{padding:0 15px;width:100%;display:flex;align-items:center;font-size:22px;font-weight:600;justify-content:space-between;margin:0 auto;color:var(--primary-500);height:63px;border-bottom:solid 1px var(--primary-500)}@media (max-width: 479px){.uic_modal-header{padding:5px}}.uic_modal-body{flex:1 1;overflow-y:auto}.uic_body-padding{padding:25px}@media (max-width: 479px){.uic_body-padding{padding:10px}}.uic_medium{width:70%;max-width:800px;max-height:80%}@media (max-width: 479px){.uic_medium{width:90%}}.uic_large{width:80%;max-width:900px}@media (max-width: 479px){.uic_large{width:95%}}\n"] }]
|
|
8242
8494
|
}], ctorParameters: () => [{ type: UiModalRef, decorators: [{
|
|
8243
8495
|
type: Inject,
|
|
8244
8496
|
args: [UiModalRef]
|
|
@@ -8608,7 +8860,7 @@ class ItemValueComponent {
|
|
|
8608
8860
|
});
|
|
8609
8861
|
}
|
|
8610
8862
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ItemValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8611
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ItemValueComponent, isStandalone: true, selector: "ui-item-value", inputs: { key: "key", type: "type", alignment: "alignment", row: "row", disabled: "disabled", data: "data", switchValidation: "switchValidation" }, outputs: { switchConfirmed: "switchConfirmed" }, ngImport: i0, template: "@if (currentData) {\r\n @if (type == 'text' || !type) {\r\n <div [class]=\"'ui-trc-' + currentData.textColor \">\r\n @if( currentData.icon ){ <i [class]=\"currentData.icon + ' ui-trc-' + currentData.iconColor\"></i>}\r\n {{ currentData.value }} \r\n @if( currentData.rightIcon ){ <i [class]=\"currentData.rightIcon + ' ui-trc-' + currentData.iconColor\"></i>}\r\n </div>\r\n }\r\n @if (type == 'copy') {\r\n <div class=\"copy-div\">\r\n {{ currentData.value }} \r\n <ui-button (click)=\"copyText((currentData.value??'').toString(),$event)\" type=\"ghost\" size=\"s\" [iconOnly]=\"true\" icon=\"ri-file-copy-line\"></ui-button>\r\n </div>\r\n }\r\n @if (type == 'money'){\r\n {{ (currentData.value??0) | currency: currentData.currencyCode||''}} \r\n }\r\n @if (type == 'bold'){\r\n <b>{{ currentData.value}}</b>\r\n }\r\n @if (type == 'date'){\r\n {{ (currentData.value??'').toString() | date: 'dd/MM/yyyy'}} \r\n }\r\n @if (type == 'bigtext') {\r\n <div (click)=\"expand($event)\" class=\"expandible-row\" [class.expandedrow]=\"expanded\">\r\n {{ currentData.value }} \r\n @if( currentData.value && currentData.value.toString().length > 0){\r\n <i [class]=\"expanded?'ri-arrow-up-s-line':'ri-arrow-down-s-line'\"></i>\r\n }\r\n @if (!expanded && currentData.value && currentData.value.toString().length > 0) {\r\n <div class=\"fade-overlay\"></div>\r\n }\r\n </div>\r\n }\r\n @if (type == 'icon-list') {\r\n @for (alert of currentData.list; track $index) {\r\n <i [uiTooltip]=\"alert.text\" [class]=\"alert.icon + ' ui-alert'\" ></i>\
|
|
8863
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ItemValueComponent, isStandalone: true, selector: "ui-item-value", inputs: { key: "key", type: "type", alignment: "alignment", row: "row", disabled: "disabled", data: "data", switchValidation: "switchValidation" }, outputs: { switchConfirmed: "switchConfirmed" }, ngImport: i0, template: "@if (currentData) {\r\n @if (type == 'text' || !type) {\r\n <div [class]=\"'ui-trc-' + currentData.textColor \">\r\n @if( currentData.icon ){ <i [class]=\"currentData.icon + ' ui-trc-' + currentData.iconColor\"></i>}\r\n {{ currentData.value }} \r\n @if( currentData.rightIcon ){ <i [class]=\"currentData.rightIcon + ' ui-trc-' + currentData.iconColor\"></i>}\r\n </div>\r\n }\r\n @if (type == 'copy') {\r\n <div class=\"copy-div\">\r\n {{ currentData.value }} \r\n <ui-button (click)=\"copyText((currentData.value??'').toString(),$event)\" type=\"ghost\" size=\"s\" [iconOnly]=\"true\" icon=\"ri-file-copy-line\"></ui-button>\r\n </div>\r\n }\r\n @if (type == 'money'){\r\n {{ (currentData.value??0) | currency: currentData.currencyCode||''}} \r\n }\r\n @if (type == 'bold'){\r\n <b>{{ currentData.value}}</b>\r\n }\r\n @if (type == 'date'){\r\n {{ (currentData.value??'').toString() | date: 'dd/MM/yyyy'}} \r\n }\r\n @if (type == 'bigtext') {\r\n <div (click)=\"expand($event)\" class=\"expandible-row\" [class.expandedrow]=\"expanded\">\r\n {{ currentData.value }} \r\n @if( currentData.value && currentData.value.toString().length > 0){\r\n <i [class]=\"expanded?'ri-arrow-up-s-line':'ri-arrow-down-s-line'\"></i>\r\n }\r\n @if (!expanded && currentData.value && currentData.value.toString().length > 0) {\r\n <div class=\"fade-overlay\"></div>\r\n }\r\n </div>\r\n }\r\n @if (type == 'icon-list') {\r\n @for (alert of currentData.list; track $index) {\r\n <i [uiTooltip]=\"alert.text\" [class]=\"alert.icon + ' ui-alert'\" ></i>\n }\r\n }\r\n @else if (type == 'list'){\r\n <uic-table-list [list]=\"currentData.list??[]\"></uic-table-list> \r\n }\r\n @else if (type == 'user'){\r\n <uic-table-user [user]=\"currentData.user\"></uic-table-user> \r\n }\r\n @else if (type == 'status'){\r\n @if (currentData.value) {\r\n <ui-status-label [icon]=\"currentData.icon??'ri-circle-fill'\" [color]=\"currentData.color??''\"> {{currentData.value}} </ui-status-label> \r\n }@else {\r\n -\r\n }\r\n }\r\n @else if (type == 'tag'){\r\n <ui-status-label type=\"tag\" [icon]=\"currentData.icon??'ri-circle-fill'\" [color]=\"currentData.color??''\"> {{currentData.value}} </ui-status-label> \r\n }\r\n @else if (type == 'switch'){\r\n <div (click)=\"$event.stopPropagation()\">\r\n <ui-switch [disabled]=\"disabled\" [(checked)]=\"checked\" (checkedChange)=\"switchHandler(row.id,$event)\"></ui-switch> \r\n </div>\r\n }\r\n\r\n @if( currentData.subtext ){\r\n <div [class]=\"'subtext ui-alignment-'+alignment\">{{ currentData.subtext }}</div>\r\n }\r\n}\r\n\r\n", styles: [".copy-div{display:flex;align-items:center;gap:5px}.expandible-row{display:flex;align-items:flex-start;gap:10px;height:calc(var(--table-spacing-ref) * 4);overflow:hidden;cursor:n-resize;-webkit-user-select:none;user-select:none;position:relative}.expandible-row i{font-size:18px;font-weight:600}.expandible-row:hover>i{color:var(--primary-500)}.fade-overlay{position:absolute;bottom:0;left:0;width:100%;height:10px;pointer-events:none;background:linear-gradient(to top,white 0%,transparent 100%)}.expandedrow{height:fit-content}.subtext{font-size:12px;color:var(--uic-neutral-500, var(--grey-500));font-weight:400;text-align:left}.ui-alignment-center{justify-content:center;text-align:center}.ui-alignment-right{justify-content:flex-end;text-align:right}b{font-weight:600}.ui-trc-primary{color:var(--primary-500)}.ui-trc-red{color:var(--red-500)}.ui-trc-blue{color:var(--blue-600)}.ui-trc-green{color:var(--green-500)}.ui-trc-yellow{color:var(--yellow-500)}.ui-trc-black{color:var(--uic-neutral-900, var(--grey-900))}.ui-trc-grey{color:var(--uic-neutral-300, var(--grey-300))}.ui-trc-dark-green{color:var(--dark-green-500)}.ui-trc-light-blue{color:var(--light-blue-500)}.ui-trc-pink{color:var(--pink-500)}.ui-trc-dark-red{color:var(--dark-red-500)}.ui-trc-orange{color:var(--orange-500)}.ui-trc-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }, { kind: "component", type: UicTableUserComponent, selector: "uic-table-user", inputs: ["user"] }, { kind: "component", type: UicSwichComponent, selector: "ui-switch", inputs: ["checked", "disabled", "placeholder", "label"], outputs: ["checkedChange"] }, { kind: "component", type: UicStatusLabelComponent, selector: "ui-status-label", inputs: ["color", "type", "icon"] }, { kind: "component", type: UicTableListComponent, selector: "uic-table-list", inputs: ["list"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: CurrencyPipe, name: "currency" }, { kind: "pipe", type: DatePipe, name: "date" }] });
|
|
8612
8864
|
}
|
|
8613
8865
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ItemValueComponent, decorators: [{
|
|
8614
8866
|
type: Component,
|
|
@@ -8622,7 +8874,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8622
8874
|
UicButtonComponent,
|
|
8623
8875
|
CurrencyPipe,
|
|
8624
8876
|
DatePipe
|
|
8625
|
-
], template: "@if (currentData) {\r\n @if (type == 'text' || !type) {\r\n <div [class]=\"'ui-trc-' + currentData.textColor \">\r\n @if( currentData.icon ){ <i [class]=\"currentData.icon + ' ui-trc-' + currentData.iconColor\"></i>}\r\n {{ currentData.value }} \r\n @if( currentData.rightIcon ){ <i [class]=\"currentData.rightIcon + ' ui-trc-' + currentData.iconColor\"></i>}\r\n </div>\r\n }\r\n @if (type == 'copy') {\r\n <div class=\"copy-div\">\r\n {{ currentData.value }} \r\n <ui-button (click)=\"copyText((currentData.value??'').toString(),$event)\" type=\"ghost\" size=\"s\" [iconOnly]=\"true\" icon=\"ri-file-copy-line\"></ui-button>\r\n </div>\r\n }\r\n @if (type == 'money'){\r\n {{ (currentData.value??0) | currency: currentData.currencyCode||''}} \r\n }\r\n @if (type == 'bold'){\r\n <b>{{ currentData.value}}</b>\r\n }\r\n @if (type == 'date'){\r\n {{ (currentData.value??'').toString() | date: 'dd/MM/yyyy'}} \r\n }\r\n @if (type == 'bigtext') {\r\n <div (click)=\"expand($event)\" class=\"expandible-row\" [class.expandedrow]=\"expanded\">\r\n {{ currentData.value }} \r\n @if( currentData.value && currentData.value.toString().length > 0){\r\n <i [class]=\"expanded?'ri-arrow-up-s-line':'ri-arrow-down-s-line'\"></i>\r\n }\r\n @if (!expanded && currentData.value && currentData.value.toString().length > 0) {\r\n <div class=\"fade-overlay\"></div>\r\n }\r\n </div>\r\n }\r\n @if (type == 'icon-list') {\r\n @for (alert of currentData.list; track $index) {\r\n <i [uiTooltip]=\"alert.text\" [class]=\"alert.icon + ' ui-alert'\" ></i>\
|
|
8877
|
+
], template: "@if (currentData) {\r\n @if (type == 'text' || !type) {\r\n <div [class]=\"'ui-trc-' + currentData.textColor \">\r\n @if( currentData.icon ){ <i [class]=\"currentData.icon + ' ui-trc-' + currentData.iconColor\"></i>}\r\n {{ currentData.value }} \r\n @if( currentData.rightIcon ){ <i [class]=\"currentData.rightIcon + ' ui-trc-' + currentData.iconColor\"></i>}\r\n </div>\r\n }\r\n @if (type == 'copy') {\r\n <div class=\"copy-div\">\r\n {{ currentData.value }} \r\n <ui-button (click)=\"copyText((currentData.value??'').toString(),$event)\" type=\"ghost\" size=\"s\" [iconOnly]=\"true\" icon=\"ri-file-copy-line\"></ui-button>\r\n </div>\r\n }\r\n @if (type == 'money'){\r\n {{ (currentData.value??0) | currency: currentData.currencyCode||''}} \r\n }\r\n @if (type == 'bold'){\r\n <b>{{ currentData.value}}</b>\r\n }\r\n @if (type == 'date'){\r\n {{ (currentData.value??'').toString() | date: 'dd/MM/yyyy'}} \r\n }\r\n @if (type == 'bigtext') {\r\n <div (click)=\"expand($event)\" class=\"expandible-row\" [class.expandedrow]=\"expanded\">\r\n {{ currentData.value }} \r\n @if( currentData.value && currentData.value.toString().length > 0){\r\n <i [class]=\"expanded?'ri-arrow-up-s-line':'ri-arrow-down-s-line'\"></i>\r\n }\r\n @if (!expanded && currentData.value && currentData.value.toString().length > 0) {\r\n <div class=\"fade-overlay\"></div>\r\n }\r\n </div>\r\n }\r\n @if (type == 'icon-list') {\r\n @for (alert of currentData.list; track $index) {\r\n <i [uiTooltip]=\"alert.text\" [class]=\"alert.icon + ' ui-alert'\" ></i>\n }\r\n }\r\n @else if (type == 'list'){\r\n <uic-table-list [list]=\"currentData.list??[]\"></uic-table-list> \r\n }\r\n @else if (type == 'user'){\r\n <uic-table-user [user]=\"currentData.user\"></uic-table-user> \r\n }\r\n @else if (type == 'status'){\r\n @if (currentData.value) {\r\n <ui-status-label [icon]=\"currentData.icon??'ri-circle-fill'\" [color]=\"currentData.color??''\"> {{currentData.value}} </ui-status-label> \r\n }@else {\r\n -\r\n }\r\n }\r\n @else if (type == 'tag'){\r\n <ui-status-label type=\"tag\" [icon]=\"currentData.icon??'ri-circle-fill'\" [color]=\"currentData.color??''\"> {{currentData.value}} </ui-status-label> \r\n }\r\n @else if (type == 'switch'){\r\n <div (click)=\"$event.stopPropagation()\">\r\n <ui-switch [disabled]=\"disabled\" [(checked)]=\"checked\" (checkedChange)=\"switchHandler(row.id,$event)\"></ui-switch> \r\n </div>\r\n }\r\n\r\n @if( currentData.subtext ){\r\n <div [class]=\"'subtext ui-alignment-'+alignment\">{{ currentData.subtext }}</div>\r\n }\r\n}\r\n\r\n", styles: [".copy-div{display:flex;align-items:center;gap:5px}.expandible-row{display:flex;align-items:flex-start;gap:10px;height:calc(var(--table-spacing-ref) * 4);overflow:hidden;cursor:n-resize;-webkit-user-select:none;user-select:none;position:relative}.expandible-row i{font-size:18px;font-weight:600}.expandible-row:hover>i{color:var(--primary-500)}.fade-overlay{position:absolute;bottom:0;left:0;width:100%;height:10px;pointer-events:none;background:linear-gradient(to top,white 0%,transparent 100%)}.expandedrow{height:fit-content}.subtext{font-size:12px;color:var(--uic-neutral-500, var(--grey-500));font-weight:400;text-align:left}.ui-alignment-center{justify-content:center;text-align:center}.ui-alignment-right{justify-content:flex-end;text-align:right}b{font-weight:600}.ui-trc-primary{color:var(--primary-500)}.ui-trc-red{color:var(--red-500)}.ui-trc-blue{color:var(--blue-600)}.ui-trc-green{color:var(--green-500)}.ui-trc-yellow{color:var(--yellow-500)}.ui-trc-black{color:var(--uic-neutral-900, var(--grey-900))}.ui-trc-grey{color:var(--uic-neutral-300, var(--grey-300))}.ui-trc-dark-green{color:var(--dark-green-500)}.ui-trc-light-blue{color:var(--light-blue-500)}.ui-trc-pink{color:var(--pink-500)}.ui-trc-dark-red{color:var(--dark-red-500)}.ui-trc-orange{color:var(--orange-500)}.ui-trc-teal{color:var(--teal-500)}\n"] }]
|
|
8626
8878
|
}], propDecorators: { key: [{
|
|
8627
8879
|
type: Input
|
|
8628
8880
|
}], type: [{
|
|
@@ -9070,7 +9322,7 @@ class UicTableComponent {
|
|
|
9070
9322
|
return `${a ?? ''}` === `${b ?? ''}`;
|
|
9071
9323
|
}
|
|
9072
9324
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9073
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTableComponent, isStandalone: true, selector: "ui-table", inputs: { columns: "columns", data: "data", loading: "loading", disabled: "disabled", editable: "editable", rowClickable: "rowClickable", rowExpandible: "rowExpandible", pages: "pages", size: "size", squeletonRows: "squeletonRows", buttonSize: "buttonSize", highlightedId: "highlightedId", headerText: "headerText", headerSubtitle: "headerSubtitle", totalItems: "totalItems", alignment: "alignment", searchEnabled: "searchEnabled", searchLabel: "searchLabel", searchPlaceholder: "searchPlaceholder", headerClass: "headerClass", headerBackgroundColor: "headerBackgroundColor", striped: "striped", showPagination: "showPagination", searchOnKeydown: "searchOnKeydown", showEmptyMessage: "showEmptyMessage", showSearchButton: "showSearchButton", showTextPagination: "showTextPagination", emptyMessage: "emptyMessage", switchValidation: "switchValidation", nextButtonText: "nextButtonText", previousButtonText: "previousButtonText", mobilePortletCols: "mobilePortletCols", searcherShowButtonText: "searcherShowButtonText" }, outputs: { action: "action", update: "update", checkedChange: "checkedChange", switchChange: "switchChange", clickedRow: "clickedRow", cellChange: "cellChange" }, queries: [{ propertyName: "actionsRef", first: true, predicate: ["[actions]"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if ( hasActions || searchEnabled){\r\n <div class=\"ui-table-filters\">\r\n @if (searchEnabled) {\r\n <uic-table-searcher \r\n [showSearchButton]=\"showSearchButton\" \r\n [showButtonText]=\"searcherShowButtonText\" \r\n [searchOnKeydown]=\"searchOnKeydown\"\r\n (filter)=\"search($event)\" \r\n [placeholder]=\"searchPlaceholder\" >\r\n </uic-table-searcher>\r\n }\r\n <div class=\"ui-filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n </div>\r\n}\r\n<ng-content select=\"[filters]\"></ng-content>\r\n<div class=\"ui-table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"ui-table-topbar\"> \r\n <div>\r\n {{headerText}} <span class=\"hightlited-note\"> ({{totalItems}}) </span> \r\n </div>\r\n <p> {{headerSubtitle}} </p>\r\n </div>\r\n }\r\n <div class=\"ui-table-container\"> \r\n <table class=\"ui-table\" [class.ui-striped]=\"striped\">\r\n <thead>\r\n <tr [class]=\" headerClass || 'header-'+headerBackgroundColor\">\r\n @for (header of columns; track $index) {\r\n <th [class.noshow-small]=\"header.hideOn == 'small'\"\r\n [class.noshow-medium]=\"header.hideOn == 'medium'\">\r\n <div [class]=\"'ui-th-wrap ui-alignment-'+alignment\" >\r\n @if (header.type=='checkbox') {\r\n <div>\r\n <ui-checkbox style=\"margin-right: 5px;\" [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\r\n </div>\r\n }\r\n {{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div class=\"ui-sort-arrow\" (click)=\"sortClick(header.key)\" [ngClass]=\"{'ui-sort-active':header.key == sortKey}\">\r\n <i [class]=\"(sortAsc||header.key != sortKey)?'ri-arrow-down-line':'ri-arrow-up-line'\"></i> \r\n </div>\r\n }\r\n </div>\r\n </th> \r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n\r\n @if (loading) {\r\n @for (item of [].constructor(squeletonRows); track $index) {\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"ui-row-loader\"></div> </td>\r\n }\r\n </tr> \r\n }\r\n } @else {\r\n @for (row of data; track row.id) {\r\n <tr [@highlightRow]=\"highlightedId === row.id ? 'highlighted' : null\" \r\n [class.ui-tr-highlighted]=\"row.highlighted\"\r\n [class.clickable-row]=\"rowClickable\"\r\n (click)=\"clickRow(row.id)\"\r\n >\r\n @for (header of columns; track $index) {\r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\"\r\n [class.noshow-small]=\"header.hideOn == 'small'\"\r\n [class.noshow-medium]=\"header.hideOn == 'medium'\">\r\n\r\n <div [class]=\"'ui-cell-content ui-alignment-'+alignment\" \r\n [style.justify-content]=\"header.align||null\"\r\n [style.width.px]=\"header.width || null\">\r\n @if (header.type == 'actions') { \r\n <div class=\"ui-centered-cell-content\">\r\n @for (btn of header.actions; track $index) {\r\n @if (isValidRule(row.data,btn.rule)) {\r\n <ui-button \r\n [disabled]=\"loading\"\r\n [uiTooltip]=\"btn.tooltip??''\"\r\n size=\"s\"\r\n [disabled]=\"disabled\"\r\n [text]=\"btn.text??''\"\r\n [type]=\"btn.type??'filled'\"\r\n [iconOnly]=\"!btn.text\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color??'black'\"\r\n (click)=\"doAction(row.id,btn.key,$event)\">\r\n </ui-button> \r\n }\r\n } \r\n @if ( header.moreActions && header.moreActions.length>0 ) {\r\n @for (ma of header.moreActions; track $index) {\r\n <ui-action-button [icon]=\"ma.icon??'ri-more-2-line'\" (optionSelected)=\"doAction(row.id,$event.id)\" [options]=\"getMoreActions(ma.actions||[],row.data)\"></ui-action-button>\r\n }\r\n }\r\n </div> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [disabled]=\"disabled\" [ngModel]=\"checkedIds.has(row.id)\" [placeholder]=\"getValue(row.data,header.key)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (isCellEditable(header)) {\r\n @if ((header.editionType ?? 'input') === 'select') {\r\n <div class=\"ui-editable-cell\" (click)=\"$event.stopPropagation()\">\r\n <ui-select\r\n [disabled]=\"disabled\"\r\n [options]=\"header.editionTypeOptions || []\"\r\n [ngModel]=\"getEditableCellValue(row.id, header.key)\"\r\n (ngModelChange)=\"onEditableSelectChange(row.id, row.data, header.key, $event)\">\r\n </ui-select>\r\n </div>\r\n } @else {\r\n <div class=\"ui-editable-cell\" (click)=\"$event.stopPropagation()\">\r\n <ui-input [disabled]=\"disabled\">\r\n <input\r\n [disabled]=\"disabled\"\r\n [ngModel]=\"getEditableCellValue(row.id, header.key)\"\r\n (ngModelChange)=\"onEditableInputChange(row.id, header.key, $event)\"\r\n (blur)=\"onEditableInputBlur(row.id, row.data, header.key)\" />\r\n </ui-input>\r\n </div>\r\n }\r\n }\r\n @else {\r\n <ui-item-value\r\n [disabled]=\"disabled\"\r\n [key]=\"header.key\"\r\n [type]=\"header.type??'text'\"\r\n [row]=\"row\"\r\n [alignment]=\"alignment\"\r\n [switchValidation]=\"switchValidation\"\r\n (switchConfirmed)=\"switchHandler(row.id, $event, header.label)\"\r\n ></ui-item-value>\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n @if (fullViewRows.includes(row.id)) {\r\n <tr style=\"border-top: none ;\">\r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"full-space-row\">\r\n <ui-short-table [columns]=\"columns\" [cols]=\"mobilePortletCols\" [data]=\"row\"></ui-short-table>\r\n </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n @empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"ui-empty\">{{emptyMessage | uicTranslate}} </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n @if (showPagination) {\r\n <uic-table-pagination \r\n [loading]=\"loading\" \r\n [totalPages]=\"pages\" \r\n [showText]=\"showTextPagination\"\r\n [size]=\"size\"\r\n [nextButtonText]=\"nextButtonText\"\r\n [previousButtonText]=\"previousButtonText\"\r\n [buttonSize]=\"buttonSize\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </uic-table-pagination>\r\n }\r\n</div>\r\n", styles: [".ui-table-wrapper{overflow:hidden;border:solid 1px var(--table-border-color);border-radius:12px}.ui-table{width:100%;font-weight:400;border-collapse:collapse;background-color:var(--uic-surface, white)}.ui-table th{font-size:12px;height:calc(var(--table-spacing-ref) * 5.4);font-weight:500}.ui-table th .ui-th-wrap{white-space:nowrap;display:flex;align-items:center}.ui-table th .ui-th-wrap .ui-sort-arrow{font-size:12px;line-height:12px}.ui-table th .ui-th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;cursor:pointer;transition:ease .3s;color:var(--uic-neutral-400, var(--grey-400))}.ui-table th .ui-th-wrap div:hover{color:var(--primary-500)}.ui-table td{font-size:14px;color:var(--uic-neutral-600, var(--grey-600));height:calc(var(--table-spacing-ref) * 6)}.ui-table td,.ui-table th{padding:0 calc(var(--table-spacing-ref) * 2);vertical-align:middle;border:none}.ui-table tr{transition:ease .3s}.ui-table tr:hover{background-color:var(--table-hover)}.ui-table tbody tr{border-top:solid 1px var(--table-border-color)}.ui-table thead tr:hover{color:var(--uic-neutral-900, var(--grey-900))}tbody tr:last-child td{border-bottom:none}.ui-table-container{width:100%;overflow-x:auto}.ui-table-topbar{padding:calc(var(--table-spacing-ref) * 1.6) 20px;font-weight:600;font-size:18px;line-height:20px;gap:16px;background-color:var(--uic-surface, white);align-items:center;color:var(--uic-neutral-900, var(--grey-900));border-bottom:solid 1px var(--table-border-color)}.ui-table-topbar p{font-size:14px;font-weight:400;color:var(--uic-neutral-400, var(--grey-400))}.ui-cell-content{padding:5px 0;display:flex;gap:4px;align-items:center;width:100%;min-width:fit-content;text-align:left}.ui-editable-cell{width:100%;min-width:150px}.ui-loader-tr{border-bottom:none!important}.ui-loader-tr td{padding:0}.ui-sort-active{color:var(--secondary-500)!important;border:solid 1px}.ui-empty{text-align:center;color:var(--uic-neutral-300, var(--grey-300))}.ui-table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}@media (max-width: 479px){.ui-table-filters{padding:8px 0;flex-direction:column;align-items:normal;gap:8px}}.ui-filter-actions{display:flex;flex-wrap:wrap;gap:8px}.ui-alert{width:24px;height:24px;font-size:18px;background-color:var(--red-500);color:var(--white);border-radius:50%;padding:3px}.ui-loader{height:5px;width:100%;--c:no-repeat linear-gradient(var(--primary-500) 0 0);background:var(--c),var(--c),var(--primary-500);background-size:60% 100%;animation:l16 3s infinite}@keyframes l16{0%{background-position:-150% 0,-150% 0}66%{background-position:250% 0,-150% 0}to{background-position:250% 0,250% 0}}.ui-striped tbody tr:nth-child(odd){background-color:var(--uic-neutral-50, var(--grey-50));transition:ease .3s}.ui-striped tbody tr:nth-child(odd):hover{background-color:var(--primary-500)}.ui-tr-highlighted{border-left:solid 6px var(--green-500)}.ui-centered-cell-content{width:100%;display:flex;gap:5px;justify-content:center}.ui-alignment-center{justify-content:center;text-align:center}.ui-trc-primary{color:var(--primary-500)}.ui-trc-red{color:var(--red-500)}.ui-trc-blue{color:var(--blue-600)}.ui-trc-green{color:var(--green-500)}.ui-trc-yellow{color:var(--yellow-500)}.ui-trc-black{color:var(--uic-neutral-900, var(--grey-900))}.ui-trc-grey{color:var(--uic-neutral-300, var(--grey-300))}.clickable-row{cursor:pointer}.ui-row-loader{background:linear-gradient(90deg,var(--uic-neutral-100, var(--grey-100)) 25%,var(--uic-neutral-200, var(--grey-200)) 50%,var(--uic-neutral-100, var(--grey-100)) 75%);height:20px;width:100%;background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:4px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.header-grey{background-color:var(--table-header-background);color:var(--table-header-color)}.header-blue{color:var(--white);background-color:var(--blue-600)}.header-red{color:var(--white);background-color:var(--red-600)}.header-green{color:var(--white);background-color:var(--green-600)}.header-primary{color:var(--white);background-color:var(--primary-600)}.header-secondary{color:var(--white);background-color:var(--secondary-600)}.header-yellow{color:var(--white);background-color:var(--yellow-600)}.header-white{color:var(--table-header-color);background-color:var(--uic-surface, white)}.header-white:hover{background-color:var(--table-hover)!important}.full-space-row{width:100%;padding:20px;text-align:center}@media (max-width: 479px){.noshow-small{display:none}}@media (min-width: 480px) and (max-width: 767px){.noshow-medium{display:none}}@media (max-width: 479px){.noshow-medium{display:none}}.ui-trc-dark-green{color:var(--dark-green-500)}.header-dark-green{color:var(--white);background-color:var(--dark-green-600)}.ui-trc-light-blue{color:var(--light-blue-500)}.header-light-blue{color:var(--white);background-color:var(--light-blue-600)}.ui-trc-pink{color:var(--pink-500)}.header-pink{color:var(--white);background-color:var(--pink-600)}.ui-trc-dark-red{color:var(--dark-red-500)}.header-dark-red{color:var(--white);background-color:var(--dark-red-600)}.ui-trc-orange{color:var(--orange-500)}.header-orange{color:var(--white);background-color:var(--orange-600)}.ui-trc-teal{color:var(--teal-500)}.header-teal{color:var(--white);background-color:var(--teal-600)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: ItemValueComponent, selector: "ui-item-value", inputs: ["key", "type", "alignment", "row", "disabled", "data", "switchValidation"], outputs: ["switchConfirmed"] }, { kind: "component", type: UicShortTableComponent, selector: "ui-short-table", inputs: ["columns", "data", "loading", "disabled", "cols"] }, { kind: "component", type: UicActionButtonComponent, selector: "ui-action-button", inputs: ["icon", "options", "multiselect", "size"], outputs: ["optionSelected", "optionsApplied"] }, { kind: "component", type: UicTableUicSearcherComponent, selector: "uic-table-searcher", inputs: ["placeholder", "label", "searchOnKeydown", "showButtonText", "showSearchButton"], outputs: ["filter"] }, { kind: "component", type: UicTablePaginationComponent, selector: "uic-table-pagination", inputs: ["buttonSize", "currentPage", "totalPages", "size", "loading", "showText", "nextButtonText", "previousButtonText"], outputs: ["pageChange", "sizeChange"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "searcherEnabled", "loading", "nullable", "options"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], animations: [highlightRow, animatedRow] });
|
|
9325
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTableComponent, isStandalone: true, selector: "ui-table", inputs: { columns: "columns", data: "data", loading: "loading", disabled: "disabled", editable: "editable", rowClickable: "rowClickable", rowExpandible: "rowExpandible", pages: "pages", size: "size", squeletonRows: "squeletonRows", buttonSize: "buttonSize", highlightedId: "highlightedId", headerText: "headerText", headerSubtitle: "headerSubtitle", totalItems: "totalItems", alignment: "alignment", searchEnabled: "searchEnabled", searchLabel: "searchLabel", searchPlaceholder: "searchPlaceholder", headerClass: "headerClass", headerBackgroundColor: "headerBackgroundColor", striped: "striped", showPagination: "showPagination", searchOnKeydown: "searchOnKeydown", showEmptyMessage: "showEmptyMessage", showSearchButton: "showSearchButton", showTextPagination: "showTextPagination", emptyMessage: "emptyMessage", switchValidation: "switchValidation", nextButtonText: "nextButtonText", previousButtonText: "previousButtonText", mobilePortletCols: "mobilePortletCols", searcherShowButtonText: "searcherShowButtonText" }, outputs: { action: "action", update: "update", checkedChange: "checkedChange", switchChange: "switchChange", clickedRow: "clickedRow", cellChange: "cellChange" }, queries: [{ propertyName: "actionsRef", first: true, predicate: ["[actions]"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if ( hasActions || searchEnabled){\r\n <div class=\"ui-table-filters\">\r\n @if (searchEnabled) {\r\n <uic-table-searcher \r\n [showSearchButton]=\"showSearchButton\" \r\n [showButtonText]=\"searcherShowButtonText\" \r\n [searchOnKeydown]=\"searchOnKeydown\"\r\n (filter)=\"search($event)\" \r\n [placeholder]=\"searchPlaceholder\" >\r\n </uic-table-searcher>\r\n }\r\n <div class=\"ui-filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n </div>\r\n}\r\n<ng-content select=\"[filters]\"></ng-content>\r\n<div class=\"ui-table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"ui-table-topbar\"> \r\n <div>\r\n {{headerText}} <span class=\"hightlited-note\"> ({{totalItems}}) </span> \r\n </div>\r\n <p> {{headerSubtitle}} </p>\r\n </div>\r\n }\r\n <div class=\"ui-table-container\"> \r\n <table class=\"ui-table\" [class.ui-striped]=\"striped\">\r\n <thead>\r\n <tr [class]=\" headerClass || 'header-'+headerBackgroundColor\">\r\n @for (header of columns; track $index) {\r\n <th [class.noshow-small]=\"header.hideOn == 'small'\"\r\n [class.noshow-medium]=\"header.hideOn == 'medium'\">\r\n <div [class]=\"'ui-th-wrap ui-alignment-'+alignment\" >\r\n @if (header.type=='checkbox') {\r\n <div>\r\n <ui-checkbox style=\"margin-right: 5px;\" [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\r\n </div>\r\n }\r\n {{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div class=\"ui-sort-arrow\" (click)=\"sortClick(header.key)\" [ngClass]=\"{'ui-sort-active':header.key == sortKey}\">\r\n <i [class]=\"(sortAsc||header.key != sortKey)?'ri-arrow-down-line':'ri-arrow-up-line'\"></i> \r\n </div>\r\n }\r\n </div>\r\n </th> \r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n\r\n @if (loading) {\r\n @for (item of [].constructor(squeletonRows); track $index) {\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"ui-row-loader\"></div> </td>\r\n }\r\n </tr> \r\n }\r\n } @else {\r\n @for (row of data; track row.id) {\r\n <tr [@highlightRow]=\"highlightedId === row.id ? 'highlighted' : null\" \r\n [class.ui-tr-highlighted]=\"row.highlighted\"\r\n [class.clickable-row]=\"rowClickable\"\r\n (click)=\"clickRow(row.id)\"\r\n >\r\n @for (header of columns; track $index) {\r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\"\r\n [class.noshow-small]=\"header.hideOn == 'small'\"\r\n [class.noshow-medium]=\"header.hideOn == 'medium'\">\r\n\r\n <div [class]=\"'ui-cell-content ui-alignment-'+alignment\" \r\n [style.justify-content]=\"header.align||null\"\r\n [style.width.px]=\"header.width || null\">\r\n @if (header.type == 'actions') { \r\n <div class=\"ui-centered-cell-content\">\r\n @for (btn of header.actions; track $index) {\r\n @if (isValidRule(row.data,btn.rule)) {\r\n <ui-button \r\n [disabled]=\"loading\"\r\n [uiTooltip]=\"btn.tooltip??''\"\n size=\"s\"\r\n [disabled]=\"disabled\"\r\n [text]=\"btn.text??''\"\r\n [type]=\"btn.type??'filled'\"\r\n [iconOnly]=\"!btn.text\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color??'black'\"\r\n (click)=\"doAction(row.id,btn.key,$event)\">\r\n </ui-button> \r\n }\r\n } \r\n @if ( header.moreActions && header.moreActions.length>0 ) {\r\n @for (ma of header.moreActions; track $index) {\r\n <ui-action-button [icon]=\"ma.icon??'ri-more-2-line'\" (optionSelected)=\"doAction(row.id,$event.id)\" [options]=\"getMoreActions(ma.actions||[],row.data)\"></ui-action-button>\r\n }\r\n }\r\n </div> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [disabled]=\"disabled\" [ngModel]=\"checkedIds.has(row.id)\" [placeholder]=\"getValue(row.data,header.key)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (isCellEditable(header)) {\r\n @if ((header.editionType ?? 'input') === 'select') {\r\n <div class=\"ui-editable-cell\" (click)=\"$event.stopPropagation()\">\r\n <ui-select\r\n [disabled]=\"disabled\"\r\n [options]=\"header.editionTypeOptions || []\"\r\n [ngModel]=\"getEditableCellValue(row.id, header.key)\"\r\n (ngModelChange)=\"onEditableSelectChange(row.id, row.data, header.key, $event)\">\r\n </ui-select>\r\n </div>\r\n } @else {\r\n <div class=\"ui-editable-cell\" (click)=\"$event.stopPropagation()\">\r\n <ui-input [disabled]=\"disabled\">\r\n <input\r\n [disabled]=\"disabled\"\r\n [ngModel]=\"getEditableCellValue(row.id, header.key)\"\r\n (ngModelChange)=\"onEditableInputChange(row.id, header.key, $event)\"\r\n (blur)=\"onEditableInputBlur(row.id, row.data, header.key)\" />\r\n </ui-input>\r\n </div>\r\n }\r\n }\r\n @else {\r\n <ui-item-value\r\n [disabled]=\"disabled\"\r\n [key]=\"header.key\"\r\n [type]=\"header.type??'text'\"\r\n [row]=\"row\"\r\n [alignment]=\"alignment\"\r\n [switchValidation]=\"switchValidation\"\r\n (switchConfirmed)=\"switchHandler(row.id, $event, header.label)\"\r\n ></ui-item-value>\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n @if (fullViewRows.includes(row.id)) {\r\n <tr style=\"border-top: none ;\">\r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"full-space-row\">\r\n <ui-short-table [columns]=\"columns\" [cols]=\"mobilePortletCols\" [data]=\"row\"></ui-short-table>\r\n </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n @empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"ui-empty\">{{emptyMessage | uicTranslate}} </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n @if (showPagination) {\r\n <uic-table-pagination \r\n [loading]=\"loading\" \r\n [totalPages]=\"pages\" \r\n [showText]=\"showTextPagination\"\r\n [size]=\"size\"\r\n [nextButtonText]=\"nextButtonText\"\r\n [previousButtonText]=\"previousButtonText\"\r\n [buttonSize]=\"buttonSize\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </uic-table-pagination>\r\n }\r\n</div>\r\n", styles: [".ui-table-wrapper{overflow:hidden;border:solid 1px var(--table-border-color);border-radius:12px}.ui-table{width:100%;font-weight:400;border-collapse:collapse;background-color:var(--uic-surface, white)}.ui-table th{font-size:12px;height:calc(var(--table-spacing-ref) * 5.4);font-weight:500}.ui-table th .ui-th-wrap{white-space:nowrap;display:flex;align-items:center}.ui-table th .ui-th-wrap .ui-sort-arrow{font-size:12px;line-height:12px}.ui-table th .ui-th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;cursor:pointer;transition:ease .3s;color:var(--uic-neutral-400, var(--grey-400))}.ui-table th .ui-th-wrap div:hover{color:var(--primary-500)}.ui-table td{font-size:14px;color:var(--uic-neutral-600, var(--grey-600));height:calc(var(--table-spacing-ref) * 6)}.ui-table td,.ui-table th{padding:0 calc(var(--table-spacing-ref) * 2);vertical-align:middle;border:none}.ui-table tr{transition:ease .3s}.ui-table tr:hover{background-color:var(--table-hover)}.ui-table tbody tr{border-top:solid 1px var(--table-border-color)}.ui-table thead tr:hover{color:var(--uic-neutral-900, var(--grey-900))}tbody tr:last-child td{border-bottom:none}.ui-table-container{width:100%;overflow-x:auto}.ui-table-topbar{padding:calc(var(--table-spacing-ref) * 1.6) 20px;font-weight:600;font-size:18px;line-height:20px;gap:16px;background-color:var(--uic-surface, white);align-items:center;color:var(--uic-neutral-900, var(--grey-900));border-bottom:solid 1px var(--table-border-color)}.ui-table-topbar p{font-size:14px;font-weight:400;color:var(--uic-neutral-400, var(--grey-400))}.ui-cell-content{padding:5px 0;display:flex;gap:4px;align-items:center;width:100%;min-width:fit-content;text-align:left}.ui-editable-cell{width:100%;min-width:150px}.ui-loader-tr{border-bottom:none!important}.ui-loader-tr td{padding:0}.ui-sort-active{color:var(--secondary-500)!important;border:solid 1px}.ui-empty{text-align:center;color:var(--uic-neutral-300, var(--grey-300))}.ui-table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}@media (max-width: 479px){.ui-table-filters{padding:8px 0;flex-direction:column;align-items:normal;gap:8px}}.ui-filter-actions{display:flex;flex-wrap:wrap;gap:8px}.ui-alert{width:24px;height:24px;font-size:18px;background-color:var(--red-500);color:var(--white);border-radius:50%;padding:3px}.ui-loader{height:5px;width:100%;--c:no-repeat linear-gradient(var(--primary-500) 0 0);background:var(--c),var(--c),var(--primary-500);background-size:60% 100%;animation:l16 3s infinite}@keyframes l16{0%{background-position:-150% 0,-150% 0}66%{background-position:250% 0,-150% 0}to{background-position:250% 0,250% 0}}.ui-striped tbody tr:nth-child(odd){background-color:var(--uic-neutral-50, var(--grey-50));transition:ease .3s}.ui-striped tbody tr:nth-child(odd):hover{background-color:var(--primary-500)}.ui-tr-highlighted{border-left:solid 6px var(--green-500)}.ui-centered-cell-content{width:100%;display:flex;gap:5px;justify-content:center}.ui-alignment-center{justify-content:center;text-align:center}.ui-trc-primary{color:var(--primary-500)}.ui-trc-red{color:var(--red-500)}.ui-trc-blue{color:var(--blue-600)}.ui-trc-green{color:var(--green-500)}.ui-trc-yellow{color:var(--yellow-500)}.ui-trc-black{color:var(--uic-neutral-900, var(--grey-900))}.ui-trc-grey{color:var(--uic-neutral-300, var(--grey-300))}.clickable-row{cursor:pointer}.ui-row-loader{background:linear-gradient(90deg,var(--uic-neutral-100, var(--grey-100)) 25%,var(--uic-neutral-200, var(--grey-200)) 50%,var(--uic-neutral-100, var(--grey-100)) 75%);height:20px;width:100%;background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:4px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.header-grey{background-color:var(--table-header-background);color:var(--table-header-color)}.header-blue{color:var(--white);background-color:var(--blue-600)}.header-red{color:var(--white);background-color:var(--red-600)}.header-green{color:var(--white);background-color:var(--green-600)}.header-primary{color:var(--white);background-color:var(--primary-600)}.header-secondary{color:var(--white);background-color:var(--secondary-600)}.header-yellow{color:var(--white);background-color:var(--yellow-600)}.header-white{color:var(--table-header-color);background-color:var(--uic-surface, white)}.header-white:hover{background-color:var(--table-hover)!important}.full-space-row{width:100%;padding:20px;text-align:center}@media (max-width: 479px){.noshow-small{display:none}}@media (min-width: 480px) and (max-width: 767px){.noshow-medium{display:none}}@media (max-width: 479px){.noshow-medium{display:none}}.ui-trc-dark-green{color:var(--dark-green-500)}.header-dark-green{color:var(--white);background-color:var(--dark-green-600)}.ui-trc-light-blue{color:var(--light-blue-500)}.header-light-blue{color:var(--white);background-color:var(--light-blue-600)}.ui-trc-pink{color:var(--pink-500)}.header-pink{color:var(--white);background-color:var(--pink-600)}.ui-trc-dark-red{color:var(--dark-red-500)}.header-dark-red{color:var(--white);background-color:var(--dark-red-600)}.ui-trc-orange{color:var(--orange-500)}.header-orange{color:var(--white);background-color:var(--orange-600)}.ui-trc-teal{color:var(--teal-500)}.header-teal{color:var(--white);background-color:var(--teal-600)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: ItemValueComponent, selector: "ui-item-value", inputs: ["key", "type", "alignment", "row", "disabled", "data", "switchValidation"], outputs: ["switchConfirmed"] }, { kind: "component", type: UicShortTableComponent, selector: "ui-short-table", inputs: ["columns", "data", "loading", "disabled", "cols"] }, { kind: "component", type: UicActionButtonComponent, selector: "ui-action-button", inputs: ["icon", "options", "multiselect", "size", "text", "rightIcon", "color", "type", "disabled"], outputs: ["optionSelected", "optionsApplied"] }, { kind: "component", type: UicTableUicSearcherComponent, selector: "uic-table-searcher", inputs: ["placeholder", "label", "searchOnKeydown", "showButtonText", "showSearchButton"], outputs: ["filter"] }, { kind: "component", type: UicTablePaginationComponent, selector: "uic-table-pagination", inputs: ["buttonSize", "currentPage", "totalPages", "size", "loading", "showText", "nextButtonText", "previousButtonText"], outputs: ["pageChange", "sizeChange"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "searcherEnabled", "loading", "nullable", "options"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], animations: [highlightRow, animatedRow] });
|
|
9074
9326
|
}
|
|
9075
9327
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, decorators: [{
|
|
9076
9328
|
type: Component,
|
|
@@ -9086,7 +9338,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
9086
9338
|
UicCheckboxComponent,
|
|
9087
9339
|
UicInputComponent,
|
|
9088
9340
|
UicSelectComponent,
|
|
9089
|
-
FormsModule], animations: [highlightRow, animatedRow], template: "@if ( hasActions || searchEnabled){\r\n <div class=\"ui-table-filters\">\r\n @if (searchEnabled) {\r\n <uic-table-searcher \r\n [showSearchButton]=\"showSearchButton\" \r\n [showButtonText]=\"searcherShowButtonText\" \r\n [searchOnKeydown]=\"searchOnKeydown\"\r\n (filter)=\"search($event)\" \r\n [placeholder]=\"searchPlaceholder\" >\r\n </uic-table-searcher>\r\n }\r\n <div class=\"ui-filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n </div>\r\n}\r\n<ng-content select=\"[filters]\"></ng-content>\r\n<div class=\"ui-table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"ui-table-topbar\"> \r\n <div>\r\n {{headerText}} <span class=\"hightlited-note\"> ({{totalItems}}) </span> \r\n </div>\r\n <p> {{headerSubtitle}} </p>\r\n </div>\r\n }\r\n <div class=\"ui-table-container\"> \r\n <table class=\"ui-table\" [class.ui-striped]=\"striped\">\r\n <thead>\r\n <tr [class]=\" headerClass || 'header-'+headerBackgroundColor\">\r\n @for (header of columns; track $index) {\r\n <th [class.noshow-small]=\"header.hideOn == 'small'\"\r\n [class.noshow-medium]=\"header.hideOn == 'medium'\">\r\n <div [class]=\"'ui-th-wrap ui-alignment-'+alignment\" >\r\n @if (header.type=='checkbox') {\r\n <div>\r\n <ui-checkbox style=\"margin-right: 5px;\" [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\r\n </div>\r\n }\r\n {{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div class=\"ui-sort-arrow\" (click)=\"sortClick(header.key)\" [ngClass]=\"{'ui-sort-active':header.key == sortKey}\">\r\n <i [class]=\"(sortAsc||header.key != sortKey)?'ri-arrow-down-line':'ri-arrow-up-line'\"></i> \r\n </div>\r\n }\r\n </div>\r\n </th> \r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n\r\n @if (loading) {\r\n @for (item of [].constructor(squeletonRows); track $index) {\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"ui-row-loader\"></div> </td>\r\n }\r\n </tr> \r\n }\r\n } @else {\r\n @for (row of data; track row.id) {\r\n <tr [@highlightRow]=\"highlightedId === row.id ? 'highlighted' : null\" \r\n [class.ui-tr-highlighted]=\"row.highlighted\"\r\n [class.clickable-row]=\"rowClickable\"\r\n (click)=\"clickRow(row.id)\"\r\n >\r\n @for (header of columns; track $index) {\r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\"\r\n [class.noshow-small]=\"header.hideOn == 'small'\"\r\n [class.noshow-medium]=\"header.hideOn == 'medium'\">\r\n\r\n <div [class]=\"'ui-cell-content ui-alignment-'+alignment\" \r\n [style.justify-content]=\"header.align||null\"\r\n [style.width.px]=\"header.width || null\">\r\n @if (header.type == 'actions') { \r\n <div class=\"ui-centered-cell-content\">\r\n @for (btn of header.actions; track $index) {\r\n @if (isValidRule(row.data,btn.rule)) {\r\n <ui-button \r\n [disabled]=\"loading\"\r\n [uiTooltip]=\"btn.tooltip??''\"\r\n size=\"s\"\r\n [disabled]=\"disabled\"\r\n [text]=\"btn.text??''\"\r\n [type]=\"btn.type??'filled'\"\r\n [iconOnly]=\"!btn.text\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color??'black'\"\r\n (click)=\"doAction(row.id,btn.key,$event)\">\r\n </ui-button> \r\n }\r\n } \r\n @if ( header.moreActions && header.moreActions.length>0 ) {\r\n @for (ma of header.moreActions; track $index) {\r\n <ui-action-button [icon]=\"ma.icon??'ri-more-2-line'\" (optionSelected)=\"doAction(row.id,$event.id)\" [options]=\"getMoreActions(ma.actions||[],row.data)\"></ui-action-button>\r\n }\r\n }\r\n </div> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [disabled]=\"disabled\" [ngModel]=\"checkedIds.has(row.id)\" [placeholder]=\"getValue(row.data,header.key)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (isCellEditable(header)) {\r\n @if ((header.editionType ?? 'input') === 'select') {\r\n <div class=\"ui-editable-cell\" (click)=\"$event.stopPropagation()\">\r\n <ui-select\r\n [disabled]=\"disabled\"\r\n [options]=\"header.editionTypeOptions || []\"\r\n [ngModel]=\"getEditableCellValue(row.id, header.key)\"\r\n (ngModelChange)=\"onEditableSelectChange(row.id, row.data, header.key, $event)\">\r\n </ui-select>\r\n </div>\r\n } @else {\r\n <div class=\"ui-editable-cell\" (click)=\"$event.stopPropagation()\">\r\n <ui-input [disabled]=\"disabled\">\r\n <input\r\n [disabled]=\"disabled\"\r\n [ngModel]=\"getEditableCellValue(row.id, header.key)\"\r\n (ngModelChange)=\"onEditableInputChange(row.id, header.key, $event)\"\r\n (blur)=\"onEditableInputBlur(row.id, row.data, header.key)\" />\r\n </ui-input>\r\n </div>\r\n }\r\n }\r\n @else {\r\n <ui-item-value\r\n [disabled]=\"disabled\"\r\n [key]=\"header.key\"\r\n [type]=\"header.type??'text'\"\r\n [row]=\"row\"\r\n [alignment]=\"alignment\"\r\n [switchValidation]=\"switchValidation\"\r\n (switchConfirmed)=\"switchHandler(row.id, $event, header.label)\"\r\n ></ui-item-value>\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n @if (fullViewRows.includes(row.id)) {\r\n <tr style=\"border-top: none ;\">\r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"full-space-row\">\r\n <ui-short-table [columns]=\"columns\" [cols]=\"mobilePortletCols\" [data]=\"row\"></ui-short-table>\r\n </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n @empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"ui-empty\">{{emptyMessage | uicTranslate}} </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n @if (showPagination) {\r\n <uic-table-pagination \r\n [loading]=\"loading\" \r\n [totalPages]=\"pages\" \r\n [showText]=\"showTextPagination\"\r\n [size]=\"size\"\r\n [nextButtonText]=\"nextButtonText\"\r\n [previousButtonText]=\"previousButtonText\"\r\n [buttonSize]=\"buttonSize\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </uic-table-pagination>\r\n }\r\n</div>\r\n", styles: [".ui-table-wrapper{overflow:hidden;border:solid 1px var(--table-border-color);border-radius:12px}.ui-table{width:100%;font-weight:400;border-collapse:collapse;background-color:var(--uic-surface, white)}.ui-table th{font-size:12px;height:calc(var(--table-spacing-ref) * 5.4);font-weight:500}.ui-table th .ui-th-wrap{white-space:nowrap;display:flex;align-items:center}.ui-table th .ui-th-wrap .ui-sort-arrow{font-size:12px;line-height:12px}.ui-table th .ui-th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;cursor:pointer;transition:ease .3s;color:var(--uic-neutral-400, var(--grey-400))}.ui-table th .ui-th-wrap div:hover{color:var(--primary-500)}.ui-table td{font-size:14px;color:var(--uic-neutral-600, var(--grey-600));height:calc(var(--table-spacing-ref) * 6)}.ui-table td,.ui-table th{padding:0 calc(var(--table-spacing-ref) * 2);vertical-align:middle;border:none}.ui-table tr{transition:ease .3s}.ui-table tr:hover{background-color:var(--table-hover)}.ui-table tbody tr{border-top:solid 1px var(--table-border-color)}.ui-table thead tr:hover{color:var(--uic-neutral-900, var(--grey-900))}tbody tr:last-child td{border-bottom:none}.ui-table-container{width:100%;overflow-x:auto}.ui-table-topbar{padding:calc(var(--table-spacing-ref) * 1.6) 20px;font-weight:600;font-size:18px;line-height:20px;gap:16px;background-color:var(--uic-surface, white);align-items:center;color:var(--uic-neutral-900, var(--grey-900));border-bottom:solid 1px var(--table-border-color)}.ui-table-topbar p{font-size:14px;font-weight:400;color:var(--uic-neutral-400, var(--grey-400))}.ui-cell-content{padding:5px 0;display:flex;gap:4px;align-items:center;width:100%;min-width:fit-content;text-align:left}.ui-editable-cell{width:100%;min-width:150px}.ui-loader-tr{border-bottom:none!important}.ui-loader-tr td{padding:0}.ui-sort-active{color:var(--secondary-500)!important;border:solid 1px}.ui-empty{text-align:center;color:var(--uic-neutral-300, var(--grey-300))}.ui-table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}@media (max-width: 479px){.ui-table-filters{padding:8px 0;flex-direction:column;align-items:normal;gap:8px}}.ui-filter-actions{display:flex;flex-wrap:wrap;gap:8px}.ui-alert{width:24px;height:24px;font-size:18px;background-color:var(--red-500);color:var(--white);border-radius:50%;padding:3px}.ui-loader{height:5px;width:100%;--c:no-repeat linear-gradient(var(--primary-500) 0 0);background:var(--c),var(--c),var(--primary-500);background-size:60% 100%;animation:l16 3s infinite}@keyframes l16{0%{background-position:-150% 0,-150% 0}66%{background-position:250% 0,-150% 0}to{background-position:250% 0,250% 0}}.ui-striped tbody tr:nth-child(odd){background-color:var(--uic-neutral-50, var(--grey-50));transition:ease .3s}.ui-striped tbody tr:nth-child(odd):hover{background-color:var(--primary-500)}.ui-tr-highlighted{border-left:solid 6px var(--green-500)}.ui-centered-cell-content{width:100%;display:flex;gap:5px;justify-content:center}.ui-alignment-center{justify-content:center;text-align:center}.ui-trc-primary{color:var(--primary-500)}.ui-trc-red{color:var(--red-500)}.ui-trc-blue{color:var(--blue-600)}.ui-trc-green{color:var(--green-500)}.ui-trc-yellow{color:var(--yellow-500)}.ui-trc-black{color:var(--uic-neutral-900, var(--grey-900))}.ui-trc-grey{color:var(--uic-neutral-300, var(--grey-300))}.clickable-row{cursor:pointer}.ui-row-loader{background:linear-gradient(90deg,var(--uic-neutral-100, var(--grey-100)) 25%,var(--uic-neutral-200, var(--grey-200)) 50%,var(--uic-neutral-100, var(--grey-100)) 75%);height:20px;width:100%;background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:4px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.header-grey{background-color:var(--table-header-background);color:var(--table-header-color)}.header-blue{color:var(--white);background-color:var(--blue-600)}.header-red{color:var(--white);background-color:var(--red-600)}.header-green{color:var(--white);background-color:var(--green-600)}.header-primary{color:var(--white);background-color:var(--primary-600)}.header-secondary{color:var(--white);background-color:var(--secondary-600)}.header-yellow{color:var(--white);background-color:var(--yellow-600)}.header-white{color:var(--table-header-color);background-color:var(--uic-surface, white)}.header-white:hover{background-color:var(--table-hover)!important}.full-space-row{width:100%;padding:20px;text-align:center}@media (max-width: 479px){.noshow-small{display:none}}@media (min-width: 480px) and (max-width: 767px){.noshow-medium{display:none}}@media (max-width: 479px){.noshow-medium{display:none}}.ui-trc-dark-green{color:var(--dark-green-500)}.header-dark-green{color:var(--white);background-color:var(--dark-green-600)}.ui-trc-light-blue{color:var(--light-blue-500)}.header-light-blue{color:var(--white);background-color:var(--light-blue-600)}.ui-trc-pink{color:var(--pink-500)}.header-pink{color:var(--white);background-color:var(--pink-600)}.ui-trc-dark-red{color:var(--dark-red-500)}.header-dark-red{color:var(--white);background-color:var(--dark-red-600)}.ui-trc-orange{color:var(--orange-500)}.header-orange{color:var(--white);background-color:var(--orange-600)}.ui-trc-teal{color:var(--teal-500)}.header-teal{color:var(--white);background-color:var(--teal-600)}\n"] }]
|
|
9341
|
+
FormsModule], animations: [highlightRow, animatedRow], template: "@if ( hasActions || searchEnabled){\r\n <div class=\"ui-table-filters\">\r\n @if (searchEnabled) {\r\n <uic-table-searcher \r\n [showSearchButton]=\"showSearchButton\" \r\n [showButtonText]=\"searcherShowButtonText\" \r\n [searchOnKeydown]=\"searchOnKeydown\"\r\n (filter)=\"search($event)\" \r\n [placeholder]=\"searchPlaceholder\" >\r\n </uic-table-searcher>\r\n }\r\n <div class=\"ui-filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n </div>\r\n}\r\n<ng-content select=\"[filters]\"></ng-content>\r\n<div class=\"ui-table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"ui-table-topbar\"> \r\n <div>\r\n {{headerText}} <span class=\"hightlited-note\"> ({{totalItems}}) </span> \r\n </div>\r\n <p> {{headerSubtitle}} </p>\r\n </div>\r\n }\r\n <div class=\"ui-table-container\"> \r\n <table class=\"ui-table\" [class.ui-striped]=\"striped\">\r\n <thead>\r\n <tr [class]=\" headerClass || 'header-'+headerBackgroundColor\">\r\n @for (header of columns; track $index) {\r\n <th [class.noshow-small]=\"header.hideOn == 'small'\"\r\n [class.noshow-medium]=\"header.hideOn == 'medium'\">\r\n <div [class]=\"'ui-th-wrap ui-alignment-'+alignment\" >\r\n @if (header.type=='checkbox') {\r\n <div>\r\n <ui-checkbox style=\"margin-right: 5px;\" [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\r\n </div>\r\n }\r\n {{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div class=\"ui-sort-arrow\" (click)=\"sortClick(header.key)\" [ngClass]=\"{'ui-sort-active':header.key == sortKey}\">\r\n <i [class]=\"(sortAsc||header.key != sortKey)?'ri-arrow-down-line':'ri-arrow-up-line'\"></i> \r\n </div>\r\n }\r\n </div>\r\n </th> \r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n\r\n @if (loading) {\r\n @for (item of [].constructor(squeletonRows); track $index) {\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"ui-row-loader\"></div> </td>\r\n }\r\n </tr> \r\n }\r\n } @else {\r\n @for (row of data; track row.id) {\r\n <tr [@highlightRow]=\"highlightedId === row.id ? 'highlighted' : null\" \r\n [class.ui-tr-highlighted]=\"row.highlighted\"\r\n [class.clickable-row]=\"rowClickable\"\r\n (click)=\"clickRow(row.id)\"\r\n >\r\n @for (header of columns; track $index) {\r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\"\r\n [class.noshow-small]=\"header.hideOn == 'small'\"\r\n [class.noshow-medium]=\"header.hideOn == 'medium'\">\r\n\r\n <div [class]=\"'ui-cell-content ui-alignment-'+alignment\" \r\n [style.justify-content]=\"header.align||null\"\r\n [style.width.px]=\"header.width || null\">\r\n @if (header.type == 'actions') { \r\n <div class=\"ui-centered-cell-content\">\r\n @for (btn of header.actions; track $index) {\r\n @if (isValidRule(row.data,btn.rule)) {\r\n <ui-button \r\n [disabled]=\"loading\"\r\n [uiTooltip]=\"btn.tooltip??''\"\n size=\"s\"\r\n [disabled]=\"disabled\"\r\n [text]=\"btn.text??''\"\r\n [type]=\"btn.type??'filled'\"\r\n [iconOnly]=\"!btn.text\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color??'black'\"\r\n (click)=\"doAction(row.id,btn.key,$event)\">\r\n </ui-button> \r\n }\r\n } \r\n @if ( header.moreActions && header.moreActions.length>0 ) {\r\n @for (ma of header.moreActions; track $index) {\r\n <ui-action-button [icon]=\"ma.icon??'ri-more-2-line'\" (optionSelected)=\"doAction(row.id,$event.id)\" [options]=\"getMoreActions(ma.actions||[],row.data)\"></ui-action-button>\r\n }\r\n }\r\n </div> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [disabled]=\"disabled\" [ngModel]=\"checkedIds.has(row.id)\" [placeholder]=\"getValue(row.data,header.key)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (isCellEditable(header)) {\r\n @if ((header.editionType ?? 'input') === 'select') {\r\n <div class=\"ui-editable-cell\" (click)=\"$event.stopPropagation()\">\r\n <ui-select\r\n [disabled]=\"disabled\"\r\n [options]=\"header.editionTypeOptions || []\"\r\n [ngModel]=\"getEditableCellValue(row.id, header.key)\"\r\n (ngModelChange)=\"onEditableSelectChange(row.id, row.data, header.key, $event)\">\r\n </ui-select>\r\n </div>\r\n } @else {\r\n <div class=\"ui-editable-cell\" (click)=\"$event.stopPropagation()\">\r\n <ui-input [disabled]=\"disabled\">\r\n <input\r\n [disabled]=\"disabled\"\r\n [ngModel]=\"getEditableCellValue(row.id, header.key)\"\r\n (ngModelChange)=\"onEditableInputChange(row.id, header.key, $event)\"\r\n (blur)=\"onEditableInputBlur(row.id, row.data, header.key)\" />\r\n </ui-input>\r\n </div>\r\n }\r\n }\r\n @else {\r\n <ui-item-value\r\n [disabled]=\"disabled\"\r\n [key]=\"header.key\"\r\n [type]=\"header.type??'text'\"\r\n [row]=\"row\"\r\n [alignment]=\"alignment\"\r\n [switchValidation]=\"switchValidation\"\r\n (switchConfirmed)=\"switchHandler(row.id, $event, header.label)\"\r\n ></ui-item-value>\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n @if (fullViewRows.includes(row.id)) {\r\n <tr style=\"border-top: none ;\">\r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"full-space-row\">\r\n <ui-short-table [columns]=\"columns\" [cols]=\"mobilePortletCols\" [data]=\"row\"></ui-short-table>\r\n </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n @empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"ui-empty\">{{emptyMessage | uicTranslate}} </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n @if (showPagination) {\r\n <uic-table-pagination \r\n [loading]=\"loading\" \r\n [totalPages]=\"pages\" \r\n [showText]=\"showTextPagination\"\r\n [size]=\"size\"\r\n [nextButtonText]=\"nextButtonText\"\r\n [previousButtonText]=\"previousButtonText\"\r\n [buttonSize]=\"buttonSize\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </uic-table-pagination>\r\n }\r\n</div>\r\n", styles: [".ui-table-wrapper{overflow:hidden;border:solid 1px var(--table-border-color);border-radius:12px}.ui-table{width:100%;font-weight:400;border-collapse:collapse;background-color:var(--uic-surface, white)}.ui-table th{font-size:12px;height:calc(var(--table-spacing-ref) * 5.4);font-weight:500}.ui-table th .ui-th-wrap{white-space:nowrap;display:flex;align-items:center}.ui-table th .ui-th-wrap .ui-sort-arrow{font-size:12px;line-height:12px}.ui-table th .ui-th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;cursor:pointer;transition:ease .3s;color:var(--uic-neutral-400, var(--grey-400))}.ui-table th .ui-th-wrap div:hover{color:var(--primary-500)}.ui-table td{font-size:14px;color:var(--uic-neutral-600, var(--grey-600));height:calc(var(--table-spacing-ref) * 6)}.ui-table td,.ui-table th{padding:0 calc(var(--table-spacing-ref) * 2);vertical-align:middle;border:none}.ui-table tr{transition:ease .3s}.ui-table tr:hover{background-color:var(--table-hover)}.ui-table tbody tr{border-top:solid 1px var(--table-border-color)}.ui-table thead tr:hover{color:var(--uic-neutral-900, var(--grey-900))}tbody tr:last-child td{border-bottom:none}.ui-table-container{width:100%;overflow-x:auto}.ui-table-topbar{padding:calc(var(--table-spacing-ref) * 1.6) 20px;font-weight:600;font-size:18px;line-height:20px;gap:16px;background-color:var(--uic-surface, white);align-items:center;color:var(--uic-neutral-900, var(--grey-900));border-bottom:solid 1px var(--table-border-color)}.ui-table-topbar p{font-size:14px;font-weight:400;color:var(--uic-neutral-400, var(--grey-400))}.ui-cell-content{padding:5px 0;display:flex;gap:4px;align-items:center;width:100%;min-width:fit-content;text-align:left}.ui-editable-cell{width:100%;min-width:150px}.ui-loader-tr{border-bottom:none!important}.ui-loader-tr td{padding:0}.ui-sort-active{color:var(--secondary-500)!important;border:solid 1px}.ui-empty{text-align:center;color:var(--uic-neutral-300, var(--grey-300))}.ui-table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}@media (max-width: 479px){.ui-table-filters{padding:8px 0;flex-direction:column;align-items:normal;gap:8px}}.ui-filter-actions{display:flex;flex-wrap:wrap;gap:8px}.ui-alert{width:24px;height:24px;font-size:18px;background-color:var(--red-500);color:var(--white);border-radius:50%;padding:3px}.ui-loader{height:5px;width:100%;--c:no-repeat linear-gradient(var(--primary-500) 0 0);background:var(--c),var(--c),var(--primary-500);background-size:60% 100%;animation:l16 3s infinite}@keyframes l16{0%{background-position:-150% 0,-150% 0}66%{background-position:250% 0,-150% 0}to{background-position:250% 0,250% 0}}.ui-striped tbody tr:nth-child(odd){background-color:var(--uic-neutral-50, var(--grey-50));transition:ease .3s}.ui-striped tbody tr:nth-child(odd):hover{background-color:var(--primary-500)}.ui-tr-highlighted{border-left:solid 6px var(--green-500)}.ui-centered-cell-content{width:100%;display:flex;gap:5px;justify-content:center}.ui-alignment-center{justify-content:center;text-align:center}.ui-trc-primary{color:var(--primary-500)}.ui-trc-red{color:var(--red-500)}.ui-trc-blue{color:var(--blue-600)}.ui-trc-green{color:var(--green-500)}.ui-trc-yellow{color:var(--yellow-500)}.ui-trc-black{color:var(--uic-neutral-900, var(--grey-900))}.ui-trc-grey{color:var(--uic-neutral-300, var(--grey-300))}.clickable-row{cursor:pointer}.ui-row-loader{background:linear-gradient(90deg,var(--uic-neutral-100, var(--grey-100)) 25%,var(--uic-neutral-200, var(--grey-200)) 50%,var(--uic-neutral-100, var(--grey-100)) 75%);height:20px;width:100%;background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:4px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.header-grey{background-color:var(--table-header-background);color:var(--table-header-color)}.header-blue{color:var(--white);background-color:var(--blue-600)}.header-red{color:var(--white);background-color:var(--red-600)}.header-green{color:var(--white);background-color:var(--green-600)}.header-primary{color:var(--white);background-color:var(--primary-600)}.header-secondary{color:var(--white);background-color:var(--secondary-600)}.header-yellow{color:var(--white);background-color:var(--yellow-600)}.header-white{color:var(--table-header-color);background-color:var(--uic-surface, white)}.header-white:hover{background-color:var(--table-hover)!important}.full-space-row{width:100%;padding:20px;text-align:center}@media (max-width: 479px){.noshow-small{display:none}}@media (min-width: 480px) and (max-width: 767px){.noshow-medium{display:none}}@media (max-width: 479px){.noshow-medium{display:none}}.ui-trc-dark-green{color:var(--dark-green-500)}.header-dark-green{color:var(--white);background-color:var(--dark-green-600)}.ui-trc-light-blue{color:var(--light-blue-500)}.header-light-blue{color:var(--white);background-color:var(--light-blue-600)}.ui-trc-pink{color:var(--pink-500)}.header-pink{color:var(--white);background-color:var(--pink-600)}.ui-trc-dark-red{color:var(--dark-red-500)}.header-dark-red{color:var(--white);background-color:var(--dark-red-600)}.ui-trc-orange{color:var(--orange-500)}.header-orange{color:var(--white);background-color:var(--orange-600)}.ui-trc-teal{color:var(--teal-500)}.header-teal{color:var(--white);background-color:var(--teal-600)}\n"] }]
|
|
9090
9342
|
}], propDecorators: { columns: [{
|
|
9091
9343
|
type: Input
|
|
9092
9344
|
}], data: [{
|
|
@@ -9189,11 +9441,11 @@ class UicSkeletonCardsComponent {
|
|
|
9189
9441
|
return this.cards > 0 ? this.cards : 0;
|
|
9190
9442
|
}
|
|
9191
9443
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSkeletonCardsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9192
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSkeletonCardsComponent, isStandalone: true, selector: "ui-skeleton-cards", inputs: { cards: "cards", gap: "gap", minCardWidthPx: "minCardWidthPx" }, ngImport: i0, template: "<div class=\"skeleton-cards-grid\" [ngStyle]=\"gridStyle\">\
|
|
9444
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSkeletonCardsComponent, isStandalone: true, selector: "ui-skeleton-cards", inputs: { cards: "cards", gap: "gap", minCardWidthPx: "minCardWidthPx" }, ngImport: i0, template: "<div class=\"skeleton-cards-grid\" [ngStyle]=\"gridStyle\">\n @for (card of [].constructor(cardsCount); track $index) {\n <div class=\"skeleton-card skeleton-gradient\"></div>\n }\n</div>\n", styles: [".skeleton-cards-grid{width:100%;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;padding:24px 0}.skeleton-card{width:100%;aspect-ratio:1/1;border-radius:var(--input-radius)}.skeleton-gradient{background:linear-gradient(90deg,var(--uic-neutral-100, var(--grey-100)) 25%,var(--uic-neutral-200, var(--grey-200)) 50%,var(--uic-neutral-100, var(--grey-100)) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
9193
9445
|
}
|
|
9194
9446
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSkeletonCardsComponent, decorators: [{
|
|
9195
9447
|
type: Component,
|
|
9196
|
-
args: [{ selector: 'ui-skeleton-cards', imports: [CommonModule], template: "<div class=\"skeleton-cards-grid\" [ngStyle]=\"gridStyle\">\
|
|
9448
|
+
args: [{ selector: 'ui-skeleton-cards', imports: [CommonModule], template: "<div class=\"skeleton-cards-grid\" [ngStyle]=\"gridStyle\">\n @for (card of [].constructor(cardsCount); track $index) {\n <div class=\"skeleton-card skeleton-gradient\"></div>\n }\n</div>\n", styles: [".skeleton-cards-grid{width:100%;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;padding:24px 0}.skeleton-card{width:100%;aspect-ratio:1/1;border-radius:var(--input-radius)}.skeleton-gradient{background:linear-gradient(90deg,var(--uic-neutral-100, var(--grey-100)) 25%,var(--uic-neutral-200, var(--grey-200)) 50%,var(--uic-neutral-100, var(--grey-100)) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"] }]
|
|
9197
9449
|
}], propDecorators: { cards: [{
|
|
9198
9450
|
type: Input
|
|
9199
9451
|
}], gap: [{
|
|
@@ -9419,11 +9671,11 @@ class UicTabsButtonComponent {
|
|
|
9419
9671
|
this.activeTabChange.emit(this.activeTab);
|
|
9420
9672
|
}
|
|
9421
9673
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTabsButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9422
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTabsButtonComponent, isStandalone: true, selector: "ui-tabs-button", inputs: { tabs: "tabs", activeTab: "activeTab" }, outputs: { activeTabChange: "activeTabChange" }, ngImport: i0, template: "<div class=\"tabs\">\r\n @for (tab of tabs; track $index) {\r\n <div (click)=\"selectTab(tab.key)\" [class.active-tab]=\"tab.key == activeTab\" class=\"tab\"> \r\n @if (tab.icon) {\r\n <i [class]=\"tab.icon\"></i> \r\n }\r\n <div class=\"tab-text\">\r\n {{tab.text}}\r\n @if(tab.warning){\r\n <span [uiTooltip]=\"tab.warning\" class=\"warning-tab\">!</span>\
|
|
9674
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTabsButtonComponent, isStandalone: true, selector: "ui-tabs-button", inputs: { tabs: "tabs", activeTab: "activeTab" }, outputs: { activeTabChange: "activeTabChange" }, ngImport: i0, template: "<div class=\"tabs\">\r\n @for (tab of tabs; track $index) {\r\n <div (click)=\"selectTab(tab.key)\" [class.active-tab]=\"tab.key == activeTab\" class=\"tab\"> \r\n @if (tab.icon) {\r\n <i [class]=\"tab.icon\"></i> \r\n }\r\n <div class=\"tab-text\">\r\n {{tab.text}}\r\n @if(tab.warning){\r\n <span [uiTooltip]=\"tab.warning\" class=\"warning-tab\">!</span>\n }\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".tabs{background-color:var(--uic-neutral-100, var(--grey-100));display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;padding:5px;overflow:hidden;border-radius:10px}.warning-tab{right:-17px;top:-5px;width:12px;height:12px;border-radius:50%;background-color:var(--red-600);position:absolute;color:#fff;font-size:12px;display:flex;justify-content:center;align-items:center}.tab{font-size:.9rem;cursor:pointer;display:flex;gap:15px;justify-content:center;align-items:center;font-weight:400;padding:5px 25px;border-radius:10px;background-color:var(--uic-neutral-100, var(--grey-100));transition:ease .3s}.tab:hover{background-color:var(--uic-surface-raised, rgba(255, 255, 255, .842))}.tab-text{position:relative}.active-tab{background-color:var(--uic-surface, white);box-shadow:var(--uic-shadow-sm, 0 0 8px 1px rgba(0, 0, 0, .0509803922))}\n"], dependencies: [{ kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }] });
|
|
9423
9675
|
}
|
|
9424
9676
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTabsButtonComponent, decorators: [{
|
|
9425
9677
|
type: Component,
|
|
9426
|
-
args: [{ selector: 'ui-tabs-button', imports: [UicToolTipDirective], template: "<div class=\"tabs\">\r\n @for (tab of tabs; track $index) {\r\n <div (click)=\"selectTab(tab.key)\" [class.active-tab]=\"tab.key == activeTab\" class=\"tab\"> \r\n @if (tab.icon) {\r\n <i [class]=\"tab.icon\"></i> \r\n }\r\n <div class=\"tab-text\">\r\n {{tab.text}}\r\n @if(tab.warning){\r\n <span [uiTooltip]=\"tab.warning\" class=\"warning-tab\">!</span>\
|
|
9678
|
+
args: [{ selector: 'ui-tabs-button', imports: [UicToolTipDirective], template: "<div class=\"tabs\">\r\n @for (tab of tabs; track $index) {\r\n <div (click)=\"selectTab(tab.key)\" [class.active-tab]=\"tab.key == activeTab\" class=\"tab\"> \r\n @if (tab.icon) {\r\n <i [class]=\"tab.icon\"></i> \r\n }\r\n <div class=\"tab-text\">\r\n {{tab.text}}\r\n @if(tab.warning){\r\n <span [uiTooltip]=\"tab.warning\" class=\"warning-tab\">!</span>\n }\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".tabs{background-color:var(--uic-neutral-100, var(--grey-100));display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;padding:5px;overflow:hidden;border-radius:10px}.warning-tab{right:-17px;top:-5px;width:12px;height:12px;border-radius:50%;background-color:var(--red-600);position:absolute;color:#fff;font-size:12px;display:flex;justify-content:center;align-items:center}.tab{font-size:.9rem;cursor:pointer;display:flex;gap:15px;justify-content:center;align-items:center;font-weight:400;padding:5px 25px;border-radius:10px;background-color:var(--uic-neutral-100, var(--grey-100));transition:ease .3s}.tab:hover{background-color:var(--uic-surface-raised, rgba(255, 255, 255, .842))}.tab-text{position:relative}.active-tab{background-color:var(--uic-surface, white);box-shadow:var(--uic-shadow-sm, 0 0 8px 1px rgba(0, 0, 0, .0509803922))}\n"] }]
|
|
9427
9679
|
}], propDecorators: { tabs: [{
|
|
9428
9680
|
type: Input
|
|
9429
9681
|
}], activeTab: [{
|
|
@@ -9616,11 +9868,11 @@ class UicWorkPanelComponent {
|
|
|
9616
9868
|
return !(this.isMinimized || !this.activeTabId) && this.fullView;
|
|
9617
9869
|
}
|
|
9618
9870
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicWorkPanelComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
9619
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicWorkPanelComponent, isStandalone: true, selector: "ui-work-panel", inputs: { moreActions: "moreActions", componentType: "componentType", componentInputs: "componentInputs", tabs: "tabs", closeWarning: "closeWarning", width: "width", duplicateValidationMessage: "duplicateValidationMessage", minPosition: "minPosition", showAddButton: "showAddButton" }, outputs: { actionSelected: "actionSelected", tabsChange: "tabsChange", tabClosed: "tabClosed", tabSelected: "tabSelected", tabAdded: "tabAdded", fullViewChange: "fullViewChange" }, host: { properties: { "style.--panel-width": "this.panelWidth" } }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\r\n [class.dynamic-width]=\"!fullView\"\r\n [class]=\"fullView ? 'open-panel' : 'mid-panel'\"\r\n [class.panel-hidden]=\"isMinimized || !activeTabId\"\r\n>\r\n <div class=\"panel-header\">\r\n @if (activeTabTitle) {\r\n <div class=\"wp-title\">{{activeTabTitle}}</div>\r\n }\r\n @if (moreActions.length > 0) { \r\n <ui-action-button [options]=\"moreActions\" (optionSelected)=\"emitAction($event)\"></ui-action-button>\r\n }\r\n <ui-button class=\"nomob\" (click)=\"minimizePanel()\" size=\"s\" [uiTooltip]=\"'work_panel.minimize' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-subtract-fill\"></ui-button>\
|
|
9871
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicWorkPanelComponent, isStandalone: true, selector: "ui-work-panel", inputs: { moreActions: "moreActions", componentType: "componentType", componentInputs: "componentInputs", tabs: "tabs", closeWarning: "closeWarning", width: "width", duplicateValidationMessage: "duplicateValidationMessage", minPosition: "minPosition", showAddButton: "showAddButton" }, outputs: { actionSelected: "actionSelected", tabsChange: "tabsChange", tabClosed: "tabClosed", tabSelected: "tabSelected", tabAdded: "tabAdded", fullViewChange: "fullViewChange" }, host: { properties: { "style.--panel-width": "this.panelWidth" } }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\r\n [class.dynamic-width]=\"!fullView\"\r\n [class]=\"fullView ? 'open-panel' : 'mid-panel'\"\r\n [class.panel-hidden]=\"isMinimized || !activeTabId\"\r\n>\r\n <div class=\"panel-header\">\r\n @if (activeTabTitle) {\r\n <div class=\"wp-title\">{{activeTabTitle}}</div>\r\n }\r\n @if (moreActions.length > 0) { \r\n <ui-action-button [options]=\"moreActions\" (optionSelected)=\"emitAction($event)\"></ui-action-button>\r\n }\r\n <ui-button class=\"nomob\" (click)=\"minimizePanel()\" size=\"s\" [uiTooltip]=\"'work_panel.minimize' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-subtract-fill\"></ui-button>\n @if (fullView) {\r\n <ui-button class=\"nomob\" (click)=\"changeSizeBtn(false)\" size=\"s\" [uiTooltip]=\"'work_panel.reduce' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-collapse-diagonal-fill\"></ui-button>\n } @else {\r\n <ui-button class=\"nomob\" (click)=\"changeSizeBtn(true)\" size=\"s\" [uiTooltip]=\"'work_panel.expand' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-expand-diagonal-fill\"></ui-button>\n }\r\n <ui-button (click)=\"closeActiveTab()\" size=\"s\" [uiTooltip]=\"'work_panel.close' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-close-line\"></ui-button>\n </div>\r\n <div class=\"panel-overflow\">\r\n <!-- contenido dinamico -->\r\n <ng-container #host></ng-container>\r\n </div>\r\n</div>\r\n@if (tabInstances.length > 0) {\r\n <div class=\"panel-nav-bar\">\r\n <div class=\"panel-tabs\">\r\n @for (tab of tabInstances; track tab.id) {\r\n <div class=\"minimized-panel\" [class.active]=\"tab.id === activeTabId\">\r\n <button class=\"min-btn\" type=\"button\" (click)=\"selectTab(tab.id)\">\r\n <i [class]=\"tab.icon?tab.icon : 'ri-dossier-line'\"></i>\r\n <div class=\"min-text\">{{ tab.label }}</div>\r\n </button>\r\n <i (click)=\"closeTab(tab.id)\" class=\"close-btn ri-close-line\"></i>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [".open-panel{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;background-color:var(--uic-surface, white);border:solid 1px var(--uic-neutral-300, var(--grey-300));transition:transform .18s ease,opacity .18s ease,width .22s ease,height .22s ease}.wp-title{flex:1 1;font-weight:600}.mid-panel{position:fixed;height:80vh;min-width:30%;bottom:32px;right:0;display:flex;flex-direction:column;z-index:20;background-color:var(--uic-surface, white);border:solid 1px var(--uic-neutral-400, var(--grey-400));border-radius:10px 10px 0 0;box-shadow:var(--uic-shadow-lg, 0 1px 6px 2px rgba(0, 0, 0, .224));transition:transform .18s ease,opacity .18s ease,width .22s ease,height .22s ease,bottom .2s ease,right .2s ease}.panel-nav-bar{background-color:var(--primary-900);box-shadow:0 0 7px 5px #00000041;border-radius:20px 0 0;width:100%;position:fixed;bottom:0;right:0;z-index:100;padding:0 8px 2px 20px;display:flex;gap:8px;height:32px}@media (max-width: 479px){.panel-nav-bar{display:none}}.panel-tabs{width:100%;display:flex;align-items:center;justify-content:flex-end;gap:6px;overflow-x:auto;flex:1 1 auto}.close-btn{cursor:pointer}.close-btn:hover{color:var(--primary-900)}.minimized-panel{min-width:180px;max-width:260px;height:30px;background-color:var(--uic-surface, white);opacity:.5;border-radius:9px;border:solid 3px var(--primary-900);color:var(--uic-neutral-800, var(--grey-800));font-size:13px;padding:0 4px 0 8px;display:flex;align-items:center;gap:5px;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.minimized-panel.active{opacity:1;background-color:var(--uic-surface, white);border-color:var(--uic-surface, white);border-radius:0 0 9px 9px;color:var(--primary-900);font-weight:600}.minimized-panel .min-text{margin-right:10px;flex:1 1;overflow:hidden;white-space:nowrap}.minimized-panel i{font-size:18px}.min-btn{border:none;background:transparent;color:inherit;display:flex;align-items:center;gap:6px;cursor:pointer;padding:0;flex:1 1 auto}.panel-overflow{width:100%;height:100%;flex:1 1;height:fit-content;overflow:auto;animation:panelFadeIn .16s ease}.panel-header{display:flex;justify-content:flex-end;padding:5px 10px;gap:10px;align-items:center;border-radius:10px 10px 0 0}.add-tab{flex-shrink:0}.open-panel,.mid-panel{transform-origin:bottom right}@keyframes panelFadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.panel-hidden{opacity:0;transform:translateY(10px) scale(.98);pointer-events:none}.dynamic-width{width:var(--panel-width)}@media (min-width: 480px) and (max-width: 767px){.open-panel{position:fixed;inset:0;width:100vw;height:100vh;border-radius:0}.mid-panel{width:90vw;height:80vh;right:0;left:auto}}@media (max-width: 479px){.nomob{display:none}.open-panel,.mid-panel{position:fixed;inset:0;border-radius:0;width:100%;height:100vh;z-index:500}}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicActionButtonComponent, selector: "ui-action-button", inputs: ["icon", "options", "multiselect", "size", "text", "rightIcon", "color", "type", "disabled"], outputs: ["optionSelected", "optionsApplied"] }] });
|
|
9620
9872
|
}
|
|
9621
9873
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicWorkPanelComponent, decorators: [{
|
|
9622
9874
|
type: Component,
|
|
9623
|
-
args: [{ selector: 'ui-work-panel', imports: [UicButtonComponent, UicToolTipDirective, UicTranslatePipe, UicActionButtonComponent], template: "<div\r\n [class.dynamic-width]=\"!fullView\"\r\n [class]=\"fullView ? 'open-panel' : 'mid-panel'\"\r\n [class.panel-hidden]=\"isMinimized || !activeTabId\"\r\n>\r\n <div class=\"panel-header\">\r\n @if (activeTabTitle) {\r\n <div class=\"wp-title\">{{activeTabTitle}}</div>\r\n }\r\n @if (moreActions.length > 0) { \r\n <ui-action-button [options]=\"moreActions\" (optionSelected)=\"emitAction($event)\"></ui-action-button>\r\n }\r\n <ui-button class=\"nomob\" (click)=\"minimizePanel()\" size=\"s\" [uiTooltip]=\"'work_panel.minimize' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-subtract-fill\"></ui-button>\
|
|
9875
|
+
args: [{ selector: 'ui-work-panel', imports: [UicButtonComponent, UicToolTipDirective, UicTranslatePipe, UicActionButtonComponent], template: "<div\r\n [class.dynamic-width]=\"!fullView\"\r\n [class]=\"fullView ? 'open-panel' : 'mid-panel'\"\r\n [class.panel-hidden]=\"isMinimized || !activeTabId\"\r\n>\r\n <div class=\"panel-header\">\r\n @if (activeTabTitle) {\r\n <div class=\"wp-title\">{{activeTabTitle}}</div>\r\n }\r\n @if (moreActions.length > 0) { \r\n <ui-action-button [options]=\"moreActions\" (optionSelected)=\"emitAction($event)\"></ui-action-button>\r\n }\r\n <ui-button class=\"nomob\" (click)=\"minimizePanel()\" size=\"s\" [uiTooltip]=\"'work_panel.minimize' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-subtract-fill\"></ui-button>\n @if (fullView) {\r\n <ui-button class=\"nomob\" (click)=\"changeSizeBtn(false)\" size=\"s\" [uiTooltip]=\"'work_panel.reduce' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-collapse-diagonal-fill\"></ui-button>\n } @else {\r\n <ui-button class=\"nomob\" (click)=\"changeSizeBtn(true)\" size=\"s\" [uiTooltip]=\"'work_panel.expand' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-expand-diagonal-fill\"></ui-button>\n }\r\n <ui-button (click)=\"closeActiveTab()\" size=\"s\" [uiTooltip]=\"'work_panel.close' | uicTranslate\" [iconOnly]=\"true\" color=\"black\" type=\"bordered\" rightIcon=\"ri-close-line\"></ui-button>\n </div>\r\n <div class=\"panel-overflow\">\r\n <!-- contenido dinamico -->\r\n <ng-container #host></ng-container>\r\n </div>\r\n</div>\r\n@if (tabInstances.length > 0) {\r\n <div class=\"panel-nav-bar\">\r\n <div class=\"panel-tabs\">\r\n @for (tab of tabInstances; track tab.id) {\r\n <div class=\"minimized-panel\" [class.active]=\"tab.id === activeTabId\">\r\n <button class=\"min-btn\" type=\"button\" (click)=\"selectTab(tab.id)\">\r\n <i [class]=\"tab.icon?tab.icon : 'ri-dossier-line'\"></i>\r\n <div class=\"min-text\">{{ tab.label }}</div>\r\n </button>\r\n <i (click)=\"closeTab(tab.id)\" class=\"close-btn ri-close-line\"></i>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [".open-panel{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;background-color:var(--uic-surface, white);border:solid 1px var(--uic-neutral-300, var(--grey-300));transition:transform .18s ease,opacity .18s ease,width .22s ease,height .22s ease}.wp-title{flex:1 1;font-weight:600}.mid-panel{position:fixed;height:80vh;min-width:30%;bottom:32px;right:0;display:flex;flex-direction:column;z-index:20;background-color:var(--uic-surface, white);border:solid 1px var(--uic-neutral-400, var(--grey-400));border-radius:10px 10px 0 0;box-shadow:var(--uic-shadow-lg, 0 1px 6px 2px rgba(0, 0, 0, .224));transition:transform .18s ease,opacity .18s ease,width .22s ease,height .22s ease,bottom .2s ease,right .2s ease}.panel-nav-bar{background-color:var(--primary-900);box-shadow:0 0 7px 5px #00000041;border-radius:20px 0 0;width:100%;position:fixed;bottom:0;right:0;z-index:100;padding:0 8px 2px 20px;display:flex;gap:8px;height:32px}@media (max-width: 479px){.panel-nav-bar{display:none}}.panel-tabs{width:100%;display:flex;align-items:center;justify-content:flex-end;gap:6px;overflow-x:auto;flex:1 1 auto}.close-btn{cursor:pointer}.close-btn:hover{color:var(--primary-900)}.minimized-panel{min-width:180px;max-width:260px;height:30px;background-color:var(--uic-surface, white);opacity:.5;border-radius:9px;border:solid 3px var(--primary-900);color:var(--uic-neutral-800, var(--grey-800));font-size:13px;padding:0 4px 0 8px;display:flex;align-items:center;gap:5px;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.minimized-panel.active{opacity:1;background-color:var(--uic-surface, white);border-color:var(--uic-surface, white);border-radius:0 0 9px 9px;color:var(--primary-900);font-weight:600}.minimized-panel .min-text{margin-right:10px;flex:1 1;overflow:hidden;white-space:nowrap}.minimized-panel i{font-size:18px}.min-btn{border:none;background:transparent;color:inherit;display:flex;align-items:center;gap:6px;cursor:pointer;padding:0;flex:1 1 auto}.panel-overflow{width:100%;height:100%;flex:1 1;height:fit-content;overflow:auto;animation:panelFadeIn .16s ease}.panel-header{display:flex;justify-content:flex-end;padding:5px 10px;gap:10px;align-items:center;border-radius:10px 10px 0 0}.add-tab{flex-shrink:0}.open-panel,.mid-panel{transform-origin:bottom right}@keyframes panelFadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.panel-hidden{opacity:0;transform:translateY(10px) scale(.98);pointer-events:none}.dynamic-width{width:var(--panel-width)}@media (min-width: 480px) and (max-width: 767px){.open-panel{position:fixed;inset:0;width:100vw;height:100vh;border-radius:0}.mid-panel{width:90vw;height:80vh;right:0;left:auto}}@media (max-width: 479px){.nomob{display:none}.open-panel,.mid-panel{position:fixed;inset:0;border-radius:0;width:100%;height:100vh;z-index:500}}\n"] }]
|
|
9624
9876
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { host: [{
|
|
9625
9877
|
type: ViewChild,
|
|
9626
9878
|
args: ['host', { read: ViewContainerRef, static: true }]
|
|
@@ -10601,7 +10853,7 @@ class UicEditableTableComponent {
|
|
|
10601
10853
|
this.visibleRowsCount = Math.min(this.visibleRowsCount, totalRows);
|
|
10602
10854
|
}
|
|
10603
10855
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicEditableTableComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
10604
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicEditableTableComponent, isStandalone: true, selector: "ui-editable-table", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, columnsConfig: { classPropertyName: "columnsConfig", publicName: "columnsConfig", isSignal: true, isRequired: false, transformFunction: null }, visibleRowsStep: { classPropertyName: "visibleRowsStep", publicName: "visibleRowsStep", isSignal: false, isRequired: false, transformFunction: null }, record: { classPropertyName: "record", publicName: "record", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { recordChange: "recordChange" }, ngImport: i0, template: "<div class=\"xlstable-overflow\">\
|
|
10856
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicEditableTableComponent, isStandalone: true, selector: "ui-editable-table", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, columnsConfig: { classPropertyName: "columnsConfig", publicName: "columnsConfig", isSignal: true, isRequired: false, transformFunction: null }, visibleRowsStep: { classPropertyName: "visibleRowsStep", publicName: "visibleRowsStep", isSignal: false, isRequired: false, transformFunction: null }, record: { classPropertyName: "record", publicName: "record", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { recordChange: "recordChange" }, ngImport: i0, template: "<div class=\"xlstable-overflow\">\n @if (headers.length > 0) {\n <table class=\"xls-table\">\n <colgroup>\n @if (rowActions().length > 0) {\n <col class=\"action-col\" [style.width.px]=\"actionColumnWidth\">\n }\n @for (header of headers; track $index) {\n <col [style.width.px]=\"columnWidths[$index]\">\n }\n </colgroup>\n <thead>\n <tr>\n @if (rowActions().length > 0) {\n <th class=\"action-col\"></th>\n }\n @for (header of headers; track $index) {\n <th>\n @if (pendingColumnIndex === $index) {\n <div class=\"hea-th hea-th-edit\">\n <input\n class=\"new-col-name\"\n type=\"text\"\n [(ngModel)]=\"pendingColumnName\"\n (ngModelChange)=\"onPendingColumnNameChange($event)\"\n (blur)=\"onPendingColumnNameBlur()\"\n (keydown)=\"onPendingColumnNameKeydown($event)\"\n [attr.data-new-col]=\"$index\">\n @if (pendingColumnName.trim()) {\n <ui-button (mousedown)=\"onPendingColumnCheckMouseDown()\" (click)=\"confirmPendingColumnName()\" icon=\"ri-check-line\" color=\"green\" size=\"s\" [iconOnly]=\"true\"></ui-button>\n }\n </div>\n } @else {\n <div class=\"hea-th\">\n <div style=\"flex: 1 1; min-width: 0;\">\n {{ header }} \n </div>\n \n @if (resolvedConfig().canAddColumn) {\n <ui-button [uiTooltip]=\"'editable_table.add_column' | uicTranslate\" (click)=\"addColumAfert($index)\" icon=\"ri-insert-column-right\" size=\"s\" [iconOnly]=\"true\"></ui-button> \n }\n @if (resolvedConfig().canDeleteColumn){\n <ui-button [uiTooltip]=\"'editable_table.delete_column' | uicTranslate\" (click)=\"deleteColum(header)\" icon=\"ri-delete-bin-line\" color=\"red\" size=\"s\" [iconOnly]=\"true\"></ui-button>\n }\n @if (resolvedConfig().resizeableColumns) {\n <span\n class=\"column-resize-handle\"\n (pointerdown)=\"startColumnResize($event, $index)\"\n ></span>\n }\n\n </div>\n }\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of visibleRows(); track $index; let i = $index) {\n <tr>\n @if (rowActions().length > 0) {\n <td class=\"action-col\">\n <div class=\"action-cell\">\n <ui-action-button [options]=\"rowActions()\" (optionSelected)=\"handleRowAction($event.id, i)\"></ui-action-button>\n </div>\n </td>\n }\n @for (header of headers; track $index; let col = $index) {\n <td>\n <input\n [disabled]=\"columnDisabledByHeader()[header]\"\n [type]=\"columnInputTypeByHeader()[header]\"\n [attr.data-row]=\"i\"\n [attr.data-col]=\"col\"\n [(ngModel)]=\"row[header]\"\n (blur)=\"onCellBlur()\"\n (keydown)=\"onCellKeydown($event, i, col)\">\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n @if (hasMoreRows()) {\n <div class=\"show-more\">\n <ui-button color=\"black\" type=\"bordered\" size=\"m\" (click)=\"showMoreRows()\">\n {{'excel_table.see_more' | uicTranslate}}\n </ui-button>\n </div>\n }\n <div class=\"table-counter\">\n {{'excel_table.counter_text' | uicTranslate:{shown: visibleRows().length, total: rows.length} }}\n </div>\n } @else{\n <div class=\"empty-msg\"> {{'excel_table.empty_message' | uicTranslate}} </div>\n }\n</div>\n", styles: [".xls-table{width:max-content;min-width:0;table-layout:fixed;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:5px;overflow:hidden}.xls-table th,.xls-table td{height:28px;padding:2px;line-height:14px;font-size:12px;border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200))}.xls-table td{background-color:var(--uic-neutral-100, var(--grey-100))}.xls-table td input{padding:3px;border:solid 1px var(--uic-surface, white);border-radius:3px;background-color:var(--uic-surface, white);font-weight:300;width:calc(100% - 8px)}.xls-table td input:enabled:hover{border-color:var(--primary-400)}.xls-table td input:disabled{border-color:var(--uic-neutral-100, var(--grey-100));background-color:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-700, var(--grey-700))}.xls-table td input:focus{border-color:var(--primary-600)}.xls-table th{line-height:28px;white-space:nowrap;background-color:var(--uic-neutral-400, var(--grey-400));color:#fff;text-align:left;padding:0;border:solid 1px white}.action-col{width:30px!important;min-width:30px!important;max-width:30px!important;padding:0!important;box-sizing:border-box;overflow:hidden}.action-cell{display:flex;align-items:center;justify-content:center;width:30px;min-width:30px;max-width:30px;box-sizing:border-box;flex:0 0 auto}.xlstable-overflow{overflow-x:auto;overflow-y:hidden;width:100%}.show-more{display:flex;justify-content:center;margin-top:10px}.table-counter{margin-top:8px;text-align:right;font-size:11px;color:var(--uic-neutral-500, var(--grey-500));font-weight:400}.hea-th{display:flex;position:relative;justify-content:space-between;width:100%;gap:5px;align-items:center;padding:0 10px}.hea-th i{cursor:pointer}.column-resize-handle{position:absolute;top:0;right:0;background-color:var(--uic-neutral-500, var(--grey-500));width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;transition:opacity ease .3s}.column-resize-handle:hover{opacity:.5}.hea-th-edit{gap:4px}.new-col-name{width:140px;height:24px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:3px;padding:0 6px;font-size:12px}.empty-msg{text-align:center;color:var(--uic-neutral-500, var(--grey-500));padding:20px;font-weight:300;font-size:14px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicActionButtonComponent, selector: "ui-action-button", inputs: ["icon", "options", "multiselect", "size", "text", "rightIcon", "color", "type", "disabled"], outputs: ["optionSelected", "optionsApplied"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }] });
|
|
10605
10857
|
}
|
|
10606
10858
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicEditableTableComponent, decorators: [{
|
|
10607
10859
|
type: Component,
|
|
@@ -10612,7 +10864,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
10612
10864
|
FormsModule,
|
|
10613
10865
|
UicTranslatePipe,
|
|
10614
10866
|
UicToolTipDirective
|
|
10615
|
-
], template: "<div class=\"xlstable-overflow\">\
|
|
10867
|
+
], template: "<div class=\"xlstable-overflow\">\n @if (headers.length > 0) {\n <table class=\"xls-table\">\n <colgroup>\n @if (rowActions().length > 0) {\n <col class=\"action-col\" [style.width.px]=\"actionColumnWidth\">\n }\n @for (header of headers; track $index) {\n <col [style.width.px]=\"columnWidths[$index]\">\n }\n </colgroup>\n <thead>\n <tr>\n @if (rowActions().length > 0) {\n <th class=\"action-col\"></th>\n }\n @for (header of headers; track $index) {\n <th>\n @if (pendingColumnIndex === $index) {\n <div class=\"hea-th hea-th-edit\">\n <input\n class=\"new-col-name\"\n type=\"text\"\n [(ngModel)]=\"pendingColumnName\"\n (ngModelChange)=\"onPendingColumnNameChange($event)\"\n (blur)=\"onPendingColumnNameBlur()\"\n (keydown)=\"onPendingColumnNameKeydown($event)\"\n [attr.data-new-col]=\"$index\">\n @if (pendingColumnName.trim()) {\n <ui-button (mousedown)=\"onPendingColumnCheckMouseDown()\" (click)=\"confirmPendingColumnName()\" icon=\"ri-check-line\" color=\"green\" size=\"s\" [iconOnly]=\"true\"></ui-button>\n }\n </div>\n } @else {\n <div class=\"hea-th\">\n <div style=\"flex: 1 1; min-width: 0;\">\n {{ header }} \n </div>\n \n @if (resolvedConfig().canAddColumn) {\n <ui-button [uiTooltip]=\"'editable_table.add_column' | uicTranslate\" (click)=\"addColumAfert($index)\" icon=\"ri-insert-column-right\" size=\"s\" [iconOnly]=\"true\"></ui-button> \n }\n @if (resolvedConfig().canDeleteColumn){\n <ui-button [uiTooltip]=\"'editable_table.delete_column' | uicTranslate\" (click)=\"deleteColum(header)\" icon=\"ri-delete-bin-line\" color=\"red\" size=\"s\" [iconOnly]=\"true\"></ui-button>\n }\n @if (resolvedConfig().resizeableColumns) {\n <span\n class=\"column-resize-handle\"\n (pointerdown)=\"startColumnResize($event, $index)\"\n ></span>\n }\n\n </div>\n }\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of visibleRows(); track $index; let i = $index) {\n <tr>\n @if (rowActions().length > 0) {\n <td class=\"action-col\">\n <div class=\"action-cell\">\n <ui-action-button [options]=\"rowActions()\" (optionSelected)=\"handleRowAction($event.id, i)\"></ui-action-button>\n </div>\n </td>\n }\n @for (header of headers; track $index; let col = $index) {\n <td>\n <input\n [disabled]=\"columnDisabledByHeader()[header]\"\n [type]=\"columnInputTypeByHeader()[header]\"\n [attr.data-row]=\"i\"\n [attr.data-col]=\"col\"\n [(ngModel)]=\"row[header]\"\n (blur)=\"onCellBlur()\"\n (keydown)=\"onCellKeydown($event, i, col)\">\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n @if (hasMoreRows()) {\n <div class=\"show-more\">\n <ui-button color=\"black\" type=\"bordered\" size=\"m\" (click)=\"showMoreRows()\">\n {{'excel_table.see_more' | uicTranslate}}\n </ui-button>\n </div>\n }\n <div class=\"table-counter\">\n {{'excel_table.counter_text' | uicTranslate:{shown: visibleRows().length, total: rows.length} }}\n </div>\n } @else{\n <div class=\"empty-msg\"> {{'excel_table.empty_message' | uicTranslate}} </div>\n }\n</div>\n", styles: [".xls-table{width:max-content;min-width:0;table-layout:fixed;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:5px;overflow:hidden}.xls-table th,.xls-table td{height:28px;padding:2px;line-height:14px;font-size:12px;border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200))}.xls-table td{background-color:var(--uic-neutral-100, var(--grey-100))}.xls-table td input{padding:3px;border:solid 1px var(--uic-surface, white);border-radius:3px;background-color:var(--uic-surface, white);font-weight:300;width:calc(100% - 8px)}.xls-table td input:enabled:hover{border-color:var(--primary-400)}.xls-table td input:disabled{border-color:var(--uic-neutral-100, var(--grey-100));background-color:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-700, var(--grey-700))}.xls-table td input:focus{border-color:var(--primary-600)}.xls-table th{line-height:28px;white-space:nowrap;background-color:var(--uic-neutral-400, var(--grey-400));color:#fff;text-align:left;padding:0;border:solid 1px white}.action-col{width:30px!important;min-width:30px!important;max-width:30px!important;padding:0!important;box-sizing:border-box;overflow:hidden}.action-cell{display:flex;align-items:center;justify-content:center;width:30px;min-width:30px;max-width:30px;box-sizing:border-box;flex:0 0 auto}.xlstable-overflow{overflow-x:auto;overflow-y:hidden;width:100%}.show-more{display:flex;justify-content:center;margin-top:10px}.table-counter{margin-top:8px;text-align:right;font-size:11px;color:var(--uic-neutral-500, var(--grey-500));font-weight:400}.hea-th{display:flex;position:relative;justify-content:space-between;width:100%;gap:5px;align-items:center;padding:0 10px}.hea-th i{cursor:pointer}.column-resize-handle{position:absolute;top:0;right:0;background-color:var(--uic-neutral-500, var(--grey-500));width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;transition:opacity ease .3s}.column-resize-handle:hover{opacity:.5}.hea-th-edit{gap:4px}.new-col-name{width:140px;height:24px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:3px;padding:0 6px;font-size:12px}.empty-msg{text-align:center;color:var(--uic-neutral-500, var(--grey-500));padding:20px;font-weight:300;font-size:14px}\n"] }]
|
|
10616
10868
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { visibleRowsStep: [{
|
|
10617
10869
|
type: Input
|
|
10618
10870
|
}], record: [{
|
|
@@ -10965,11 +11217,11 @@ class UicProgressBarComponent {
|
|
|
10965
11217
|
});
|
|
10966
11218
|
}
|
|
10967
11219
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10968
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UicProgressBarComponent, isStandalone: true, selector: "ui-progress-bar", inputs: { progress: "progress", color: "color", height: "height" }, usesOnChanges: true, ngImport: i0, template: "<div [class]=\"'progress-bar pb-' + color\" [style.--pb-height]=\"heightPx\">\n <div class=\"progress-bar__fill\" [style.width.%]=\"displayProgress\"></div>\n</div>\n", styles: [":host{display:block;width:100%;margin:0;padding:0}.progress-bar{--pb-height: 4px;--progress-fill: var(--primary-600);--progress-track: var(--primary-200);width:100%;height:var(--pb-height);margin:0;padding:0;box-sizing:border-box;border-radius:calc(var(--pb-height) / 2);background-color:var(--progress-track);overflow:hidden}.progress-bar__fill{display:block;height:100%;background-color:var(--progress-fill);border-radius:inherit;width:0%;transition:width .4s ease-in-out;will-change:width}.pb-primary{--progress-fill: var(--primary-600);--progress-track: var(--primary-200)}.pb-secondary{--progress-fill: var(--secondary-600);--progress-track: var(--secondary-200)}.pb-red{--progress-fill: var(--red-600);--progress-track: var(--red-200)}.pb-green{--progress-fill: var(--green-600);--progress-track: var(--green-200)}.pb-blue{--progress-fill: var(--blue-600);--progress-track: var(--blue-200)}.pb-yellow{--progress-fill: var(--yellow-600);--progress-track: var(--yellow-200)}.pb-black{--progress-fill: var(--uic-neutral-900, var(--grey-900));--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-grey{--progress-fill: var(--uic-neutral-600, var(--grey-600));--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-white{--progress-fill: var(--white);--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-dark-green{--progress-fill: var(--dark-green-600);--progress-track: var(--dark-green-200)}.pb-light-blue{--progress-fill: var(--light-blue-600);--progress-track: var(--light-blue-200)}.pb-pink{--progress-fill: var(--pink-600);--progress-track: var(--pink-200)}.pb-dark-red{--progress-fill: var(--dark-red-600);--progress-track: var(--dark-red-200)}.pb-orange{--progress-fill: var(--orange-600);--progress-track: var(--orange-200)}.pb-teal{--progress-fill: var(--teal-600);--progress-track: var(--teal-200)}\n"] });
|
|
11220
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UicProgressBarComponent, isStandalone: true, selector: "ui-progress-bar", inputs: { progress: "progress", color: "color", height: "height" }, usesOnChanges: true, ngImport: i0, template: "<div [class]=\"'progress-bar pb-' + color\" [style.--pb-height]=\"heightPx\">\r\n <div class=\"progress-bar__fill\" [style.width.%]=\"displayProgress\"></div>\r\n</div>\r\n", styles: [":host{display:block;width:100%;margin:0;padding:0}.progress-bar{--pb-height: 4px;--progress-fill: var(--primary-600);--progress-track: var(--primary-200);width:100%;height:var(--pb-height);margin:0;padding:0;box-sizing:border-box;border-radius:calc(var(--pb-height) / 2);background-color:var(--progress-track);overflow:hidden}.progress-bar__fill{display:block;height:100%;background-color:var(--progress-fill);border-radius:inherit;width:0%;transition:width .4s ease-in-out;will-change:width}.pb-primary{--progress-fill: var(--primary-600);--progress-track: var(--primary-200)}.pb-secondary{--progress-fill: var(--secondary-600);--progress-track: var(--secondary-200)}.pb-red{--progress-fill: var(--red-600);--progress-track: var(--red-200)}.pb-green{--progress-fill: var(--green-600);--progress-track: var(--green-200)}.pb-blue{--progress-fill: var(--blue-600);--progress-track: var(--blue-200)}.pb-yellow{--progress-fill: var(--yellow-600);--progress-track: var(--yellow-200)}.pb-black{--progress-fill: var(--uic-neutral-900, var(--grey-900));--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-grey{--progress-fill: var(--uic-neutral-600, var(--grey-600));--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-white{--progress-fill: var(--white);--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-dark-green{--progress-fill: var(--dark-green-600);--progress-track: var(--dark-green-200)}.pb-light-blue{--progress-fill: var(--light-blue-600);--progress-track: var(--light-blue-200)}.pb-pink{--progress-fill: var(--pink-600);--progress-track: var(--pink-200)}.pb-dark-red{--progress-fill: var(--dark-red-600);--progress-track: var(--dark-red-200)}.pb-orange{--progress-fill: var(--orange-600);--progress-track: var(--orange-200)}.pb-teal{--progress-fill: var(--teal-600);--progress-track: var(--teal-200)}\n"] });
|
|
10969
11221
|
}
|
|
10970
11222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicProgressBarComponent, decorators: [{
|
|
10971
11223
|
type: Component,
|
|
10972
|
-
args: [{ selector: 'ui-progress-bar', imports: [], template: "<div [class]=\"'progress-bar pb-' + color\" [style.--pb-height]=\"heightPx\">\n <div class=\"progress-bar__fill\" [style.width.%]=\"displayProgress\"></div>\n</div>\n", styles: [":host{display:block;width:100%;margin:0;padding:0}.progress-bar{--pb-height: 4px;--progress-fill: var(--primary-600);--progress-track: var(--primary-200);width:100%;height:var(--pb-height);margin:0;padding:0;box-sizing:border-box;border-radius:calc(var(--pb-height) / 2);background-color:var(--progress-track);overflow:hidden}.progress-bar__fill{display:block;height:100%;background-color:var(--progress-fill);border-radius:inherit;width:0%;transition:width .4s ease-in-out;will-change:width}.pb-primary{--progress-fill: var(--primary-600);--progress-track: var(--primary-200)}.pb-secondary{--progress-fill: var(--secondary-600);--progress-track: var(--secondary-200)}.pb-red{--progress-fill: var(--red-600);--progress-track: var(--red-200)}.pb-green{--progress-fill: var(--green-600);--progress-track: var(--green-200)}.pb-blue{--progress-fill: var(--blue-600);--progress-track: var(--blue-200)}.pb-yellow{--progress-fill: var(--yellow-600);--progress-track: var(--yellow-200)}.pb-black{--progress-fill: var(--uic-neutral-900, var(--grey-900));--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-grey{--progress-fill: var(--uic-neutral-600, var(--grey-600));--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-white{--progress-fill: var(--white);--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-dark-green{--progress-fill: var(--dark-green-600);--progress-track: var(--dark-green-200)}.pb-light-blue{--progress-fill: var(--light-blue-600);--progress-track: var(--light-blue-200)}.pb-pink{--progress-fill: var(--pink-600);--progress-track: var(--pink-200)}.pb-dark-red{--progress-fill: var(--dark-red-600);--progress-track: var(--dark-red-200)}.pb-orange{--progress-fill: var(--orange-600);--progress-track: var(--orange-200)}.pb-teal{--progress-fill: var(--teal-600);--progress-track: var(--teal-200)}\n"] }]
|
|
11224
|
+
args: [{ selector: 'ui-progress-bar', imports: [], template: "<div [class]=\"'progress-bar pb-' + color\" [style.--pb-height]=\"heightPx\">\r\n <div class=\"progress-bar__fill\" [style.width.%]=\"displayProgress\"></div>\r\n</div>\r\n", styles: [":host{display:block;width:100%;margin:0;padding:0}.progress-bar{--pb-height: 4px;--progress-fill: var(--primary-600);--progress-track: var(--primary-200);width:100%;height:var(--pb-height);margin:0;padding:0;box-sizing:border-box;border-radius:calc(var(--pb-height) / 2);background-color:var(--progress-track);overflow:hidden}.progress-bar__fill{display:block;height:100%;background-color:var(--progress-fill);border-radius:inherit;width:0%;transition:width .4s ease-in-out;will-change:width}.pb-primary{--progress-fill: var(--primary-600);--progress-track: var(--primary-200)}.pb-secondary{--progress-fill: var(--secondary-600);--progress-track: var(--secondary-200)}.pb-red{--progress-fill: var(--red-600);--progress-track: var(--red-200)}.pb-green{--progress-fill: var(--green-600);--progress-track: var(--green-200)}.pb-blue{--progress-fill: var(--blue-600);--progress-track: var(--blue-200)}.pb-yellow{--progress-fill: var(--yellow-600);--progress-track: var(--yellow-200)}.pb-black{--progress-fill: var(--uic-neutral-900, var(--grey-900));--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-grey{--progress-fill: var(--uic-neutral-600, var(--grey-600));--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-white{--progress-fill: var(--white);--progress-track: var(--uic-neutral-200, var(--grey-200))}.pb-dark-green{--progress-fill: var(--dark-green-600);--progress-track: var(--dark-green-200)}.pb-light-blue{--progress-fill: var(--light-blue-600);--progress-track: var(--light-blue-200)}.pb-pink{--progress-fill: var(--pink-600);--progress-track: var(--pink-200)}.pb-dark-red{--progress-fill: var(--dark-red-600);--progress-track: var(--dark-red-200)}.pb-orange{--progress-fill: var(--orange-600);--progress-track: var(--orange-200)}.pb-teal{--progress-fill: var(--teal-600);--progress-track: var(--teal-200)}\n"] }]
|
|
10973
11225
|
}], propDecorators: { progress: [{
|
|
10974
11226
|
type: Input
|
|
10975
11227
|
}], color: [{
|
|
@@ -11069,18 +11321,22 @@ const VISIBILITY_OPERATOR_OPTIONS = [
|
|
|
11069
11321
|
{ id: 'includes', text: 'includes' },
|
|
11070
11322
|
{ id: 'notIncludes', text: 'notIncludes' },
|
|
11071
11323
|
{ id: 'isEmpty', text: 'isEmpty' },
|
|
11072
|
-
{ id: 'isNotEmpty', text: 'isNotEmpty' }
|
|
11324
|
+
{ id: 'isNotEmpty', text: 'isNotEmpty' },
|
|
11325
|
+
{ id: 'in', text: 'in' },
|
|
11326
|
+
{ id: 'notIn', text: 'notIn' }
|
|
11073
11327
|
];
|
|
11328
|
+
/** Operadores cuyo valor es una lista de valores (FieldVisibilityRule.value es un arreglo). */
|
|
11329
|
+
const LIST_VISIBILITY_OPERATORS = ['in', 'notIn'];
|
|
11074
11330
|
const FIELDS_CONFIG = [
|
|
11075
11331
|
{ value: 'text', icon: 'ri-text', detail: 'Campo de texto en una sola linea', label: 'Texto corto', properties: ['placeholder', 'minLength', 'maxLength', 'showCounter'], visibility: { outputType: 'string', operators: ['equals', 'notEquals', 'includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11076
11332
|
{ value: 'textarea', icon: 'ri-file-text-line', detail: 'Texto multilinea con ajuste de altura', label: 'Area de texto', properties: ['placeholder', 'minLength', 'maxLength', 'showCounter', 'voiceToTextEnabled', 'textareaResize', 'resizeMinRows', 'resizeMaxRows'], visibility: { outputType: 'string', operators: ['equals', 'notEquals', 'includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11077
11333
|
{ value: 'number', icon: 'ri-hashtag', detail: 'Campo numerico con control de paso', label: 'Numero', properties: ['placeholder', 'step', 'min', 'max'], visibility: { outputType: 'number', operators: ['equals', 'notEquals', 'greaterThan', 'lessThan', 'isEmpty', 'isNotEmpty'] } },
|
|
11078
11334
|
{ value: 'phone', icon: 'ri-phone-line', detail: 'Telefono con pais y codigo', label: 'Telefono', properties: ['placeholder'], visibility: { outputType: 'UicPhoneInputValue', operators: ['includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11079
|
-
{ value: 'select', icon: 'ri-arrow-drop-down-line', detail: 'Seleccion simple desde opciones', label: 'Selector', properties: ['options', 'selectSearchEnabled', 'selectNullable'], visibility: { outputType: 'string', operators: ['equals', 'notEquals', 'includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11335
|
+
{ value: 'select', icon: 'ri-arrow-drop-down-line', detail: 'Seleccion simple desde opciones', label: 'Selector', properties: ['options', 'selectSearchEnabled', 'selectNullable'], visibility: { outputType: 'string', operators: ['equals', 'notEquals', 'in', 'notIn', 'includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11080
11336
|
{ value: 'multyselect', icon: 'ri-arrow-down-double-line', detail: 'Seleccion multiple desde opciones', label: 'Selector multiple', properties: ['options', 'minSelections', 'maxSelections'], visibility: { outputType: 'string[]', operators: ['includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11081
11337
|
{ value: 'date', icon: 'ri-calendar-2-line', detail: 'Selector de fecha o mes', label: 'Fecha', properties: ['monthMode', 'monthDay', 'minDate', 'maxDate'], visibility: { outputType: 'string yyyy-MM-dd', operators: ['equals', 'notEquals', 'greaterThan', 'lessThan', 'isEmpty', 'isNotEmpty'] } },
|
|
11082
11338
|
{ value: 'time', icon: 'ri-timer-2-line', detail: 'Selector de hora', label: 'Hora', properties: ['timeInterval'], visibility: { outputType: 'string HH:mm', operators: ['equals', 'notEquals', 'greaterThan', 'lessThan', 'isEmpty', 'isNotEmpty'] } },
|
|
11083
|
-
{ value: 'radio', icon: 'ri-radio-button-line', detail: 'Seleccion unica entre opciones', label: 'Radio', properties: ['options'], visibility: { outputType: 'string', operators: ['equals', 'notEquals', 'includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11339
|
+
{ value: 'radio', icon: 'ri-radio-button-line', detail: 'Seleccion unica entre opciones', label: 'Radio', properties: ['options'], visibility: { outputType: 'string', operators: ['equals', 'notEquals', 'in', 'notIn', 'includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11084
11340
|
{ value: 'checkbox', icon: 'ri-checkbox-line', detail: 'Campo booleano tipo check', label: 'Checkbox', properties: ['placeholder'], visibility: { outputType: 'boolean', operators: ['equals', 'notEquals', 'isEmpty', 'isNotEmpty'] } },
|
|
11085
11341
|
{ value: 'switch', icon: 'ri-toggle-line', detail: 'Campo booleano tipo switch', label: 'Switch', properties: ['placeholder'], visibility: { outputType: 'boolean', operators: ['equals', 'notEquals', 'isEmpty', 'isNotEmpty'] } },
|
|
11086
11342
|
{ value: 'pool', icon: 'ri-bubble-chart-line', detail: 'Seleccion con lista y detalle por item', label: 'Pool de opciones', properties: ['options', 'multyEnabled', 'minSelections', 'maxSelections', 'poolDisplayMode', 'poolGridColumns', 'poolEnabledListView', 'poolTitle'], visibility: { outputType: 'selectedDetailed[]', operators: ['isEmpty', 'isNotEmpty'] } },
|
|
@@ -11088,6 +11344,7 @@ const FIELDS_CONFIG = [
|
|
|
11088
11344
|
{ value: 'searcher', icon: 'ri-seo-line', detail: 'Buscador con fuente de datos externa', label: 'Buscador', properties: ['placeholder', 'optionsSource.key', 'optionsSource.idField', 'optionsSource.textField', 'optionsSource.textTemplate', 'optionsSource.dependsOn', 'optionsSource.paramName'], visibility: { outputType: 'object', operators: ['isEmpty', 'isNotEmpty'] } },
|
|
11089
11345
|
{ value: 'multisearcher', icon: 'ri-user-add-line', detail: 'Buscador con selección múltiple y fuente de datos externa', label: 'Buscador múltiple', properties: ['placeholder', 'optionsSource.key', 'optionsSource.idField', 'optionsSource.textField', 'optionsSource.textTemplate', 'optionsSource.dependsOn', 'optionsSource.paramName'], visibility: { outputType: 'object[]', operators: ['isEmpty', 'isNotEmpty'] } },
|
|
11090
11346
|
{ value: 'scale', icon: 'ri-star-half-line', detail: 'Escala numérica o de íconos (NPS, Likert, estrellas)', label: 'Escala', properties: ['scaleMode', 'scaleIcon', 'scaleMin', 'scaleMax', 'scaleLabels'], visibility: { outputType: 'number', operators: ['equals', 'notEquals', 'greaterThan', 'lessThan', 'isEmpty', 'isNotEmpty'] } },
|
|
11347
|
+
{ value: 'chips', icon: 'ri-price-tag-3-line', detail: 'Lista de textos libres (Enter para agregar)', label: 'Chips', properties: ['placeholder', 'maxLength', 'minSelections', 'maxSelections'], visibility: { outputType: 'string[]', operators: ['includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } },
|
|
11091
11348
|
{ value: 'distribution', icon: 'ri-pie-chart-2-line', detail: 'Reparte el 100% entre las opciones', label: 'Distribución porcentual', properties: ['options'], visibility: { outputType: 'UicDistributionValue', operators: ['isEmpty', 'isNotEmpty'] } },
|
|
11092
11349
|
{ value: 'slider', icon: 'ri-equalizer-2-line', detail: 'Control deslizante continuo', label: 'Deslizador', properties: ['min', 'max', 'sliderInterval', 'sliderMarks'], visibility: { outputType: 'number', operators: ['equals', 'notEquals', 'greaterThan', 'lessThan', 'isEmpty', 'isNotEmpty'] } },
|
|
11093
11350
|
{ value: 'repeater', icon: 'ri-stack-line', detail: 'Grupo de campos repetibles', label: 'Repetidor', properties: ['repeaterMinItems', 'repeaterMaxItems', 'repeaterAddLabel', 'repeaterRemoveLabel', 'repeaterItemTitle'], visibility: { outputType: 'object[]', operators: ['isEmpty', 'isNotEmpty'] } },
|
|
@@ -11204,6 +11461,15 @@ const LAYOUT_FORM_FIELDS = [
|
|
|
11204
11461
|
type: 'checkbox'
|
|
11205
11462
|
}
|
|
11206
11463
|
];
|
|
11464
|
+
/** Propiedades que solo aplican cuando el formulario se muestra como encuesta (ui-survey). */
|
|
11465
|
+
const SURVEY_FORM_FIELDS = [
|
|
11466
|
+
{
|
|
11467
|
+
name: 'samePage',
|
|
11468
|
+
placeholder: 'form_builder.base.same_page',
|
|
11469
|
+
tip: 'form_builder.base.same_page_tip',
|
|
11470
|
+
type: 'checkbox'
|
|
11471
|
+
}
|
|
11472
|
+
];
|
|
11207
11473
|
const EXTRA_FORM_FIELDS = [
|
|
11208
11474
|
{
|
|
11209
11475
|
name: 'placeholder',
|
|
@@ -11762,10 +12028,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
11762
12028
|
args: [{ selector: 'ng-template[uicSurveyFooter]' }]
|
|
11763
12029
|
}] });
|
|
11764
12030
|
|
|
12031
|
+
/** Configuración global (p. ej. por cliente). La entrada `config` del componente la sobrescribe por clave. */
|
|
12032
|
+
const UIC_SURVEY_CONFIG = new InjectionToken('UIC_SURVEY_CONFIG');
|
|
12033
|
+
function provideUicSurveyConfig(config) {
|
|
12034
|
+
return { provide: UIC_SURVEY_CONFIG, useValue: config };
|
|
12035
|
+
}
|
|
12036
|
+
/** Combina configuraciones (las últimas ganan, por clave; `texts` se combina por texto). */
|
|
12037
|
+
function resolveSurveyConfig(...configs) {
|
|
12038
|
+
const present = configs.filter((config) => !!config);
|
|
12039
|
+
const pick = (key) => present.reduce((value, config) => config[key] ?? value, undefined);
|
|
12040
|
+
const text = (key) => present.reduce((value, config) => config.texts?.[key] || value, undefined);
|
|
12041
|
+
return {
|
|
12042
|
+
texts: {
|
|
12043
|
+
next: text('next') ?? 'survey.next',
|
|
12044
|
+
back: text('back') ?? 'survey.back',
|
|
12045
|
+
submit: text('submit') ?? 'survey.submit',
|
|
12046
|
+
},
|
|
12047
|
+
showProgress: pick('showProgress') ?? true,
|
|
12048
|
+
showBack: pick('showBack') ?? true,
|
|
12049
|
+
showBackOnFirstPage: pick('showBackOnFirstPage') ?? false,
|
|
12050
|
+
disableNextWhenInvalid: pick('disableNextWhenInvalid') ?? true,
|
|
12051
|
+
};
|
|
12052
|
+
}
|
|
12053
|
+
|
|
11765
12054
|
/** Tipos que se guardan al cambiar de valor (no tienen un blur significativo). */
|
|
11766
12055
|
const IMMEDIATE_SAVE_TYPES = new Set([
|
|
11767
12056
|
'date', 'time', 'select', 'radio', 'checkbox', 'switch',
|
|
11768
|
-
'pool', 'file', 'multyselect', 'searcher', 'multisearcher', 'slider', 'scale'
|
|
12057
|
+
'pool', 'file', 'multyselect', 'searcher', 'multisearcher', 'slider', 'scale', 'chips'
|
|
11769
12058
|
]);
|
|
11770
12059
|
const THEME_KEY_PATTERN = /^--[\w-]+$/;
|
|
11771
12060
|
/**
|
|
@@ -11780,6 +12069,7 @@ class UicSurveyComponent {
|
|
|
11780
12069
|
engine = inject(UicFormEngine);
|
|
11781
12070
|
host = inject(ElementRef);
|
|
11782
12071
|
cdr = inject(ChangeDetectorRef);
|
|
12072
|
+
injector = inject(Injector);
|
|
11783
12073
|
// --- Configuración del motor (mismo contrato que ui-form-wrapper) ---
|
|
11784
12074
|
set schema(value) { this.engine.schema = value; }
|
|
11785
12075
|
get schema() { return this.engine.schema; }
|
|
@@ -11803,8 +12093,17 @@ class UicSurveyComponent {
|
|
|
11803
12093
|
* hasta revisarlas; 'slide' y 'fade' siguen disponibles de forma experimental (solo entrada).
|
|
11804
12094
|
*/
|
|
11805
12095
|
animation = input('none');
|
|
11806
|
-
|
|
11807
|
-
|
|
12096
|
+
/**
|
|
12097
|
+
* Configuración inicial (textos y opciones de navegación). Se combina con la global
|
|
12098
|
+
* (provideUicSurveyConfig); los inputs sueltos de abajo tienen prioridad sobre ambas.
|
|
12099
|
+
*/
|
|
12100
|
+
config = input(null);
|
|
12101
|
+
/** Sobrescribe config.showProgress. */
|
|
12102
|
+
showProgress = input(undefined);
|
|
12103
|
+
/** Sobrescribe config.showBack. */
|
|
12104
|
+
showBack = input(undefined);
|
|
12105
|
+
/** Sobrescribe config.showBackOnFirstPage (ver UicSurveyConfig). */
|
|
12106
|
+
showBackOnFirstPage = input(undefined);
|
|
11808
12107
|
/**
|
|
11809
12108
|
* Página en la que empieza (o se reanuda) la encuesta:
|
|
11810
12109
|
* - 'first-unanswered': la primera página visible con alguna pregunta sin responder.
|
|
@@ -11821,14 +12120,30 @@ class UicSurveyComponent {
|
|
|
11821
12120
|
autoAdvance = input(false);
|
|
11822
12121
|
/** Enfoca el primer campo de cada página al navegar. */
|
|
11823
12122
|
autoFocus = input(true);
|
|
12123
|
+
/**
|
|
12124
|
+
* Sobrescribe config.disableNextWhenInvalid: deshabilita "Siguiente"/"Enviar" mientras la página
|
|
12125
|
+
* tenga respuestas inválidas (por ejemplo, obligatorias vacías). Enter sigue intentando avanzar y
|
|
12126
|
+
* marca los errores.
|
|
12127
|
+
*/
|
|
12128
|
+
disableNextWhenInvalid = input(undefined);
|
|
11824
12129
|
loading = input(false);
|
|
11825
12130
|
/** Variables CSS aplicadas al host. Solo claves que empiecen con "--". */
|
|
11826
12131
|
theme = input(null);
|
|
11827
12132
|
iconMode = input(undefined);
|
|
11828
12133
|
fileUidResolverFn = input(undefined);
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
|
|
12134
|
+
/** Sobrescriben config.texts. */
|
|
12135
|
+
nextText = input(undefined);
|
|
12136
|
+
backText = input(undefined);
|
|
12137
|
+
submitText = input(undefined);
|
|
12138
|
+
globalConfig = inject(UIC_SURVEY_CONFIG, { optional: true });
|
|
12139
|
+
/** Configuración efectiva: inputs sueltos > config > global > valores por defecto. */
|
|
12140
|
+
settings = computed(() => resolveSurveyConfig(this.globalConfig, this.config(), {
|
|
12141
|
+
texts: { next: this.nextText(), back: this.backText(), submit: this.submitText() },
|
|
12142
|
+
showProgress: this.showProgress(),
|
|
12143
|
+
showBack: this.showBack(),
|
|
12144
|
+
showBackOnFirstPage: this.showBackOnFirstPage(),
|
|
12145
|
+
disableNextWhenInvalid: this.disableNextWhenInvalid()
|
|
12146
|
+
}));
|
|
11832
12147
|
// --- Auto-guardado ---
|
|
11833
12148
|
/**
|
|
11834
12149
|
* Emite fieldSave por cada respuesta que cambia: al salir del campo (texto, número, teléfono,
|
|
@@ -11841,6 +12156,8 @@ class UicSurveyComponent {
|
|
|
11841
12156
|
autoSaveDebounceMs = input(400);
|
|
11842
12157
|
surveySubmit = new EventEmitter();
|
|
11843
12158
|
pageChange = new EventEmitter();
|
|
12159
|
+
/** "Anterior" en la primera página (con showBackOnFirstPage): el consumidor decide a dónde volver. */
|
|
12160
|
+
backFromStart = new EventEmitter();
|
|
11844
12161
|
fieldSave = new EventEmitter();
|
|
11845
12162
|
formChange = new EventEmitter();
|
|
11846
12163
|
optionsSourceError = new EventEmitter();
|
|
@@ -11871,6 +12188,8 @@ class UicSurveyComponent {
|
|
|
11871
12188
|
return this.engine.form;
|
|
11872
12189
|
}
|
|
11873
12190
|
fieldPageFieldsCache = new WeakMap();
|
|
12191
|
+
/** Páginas con varias preguntas (samePage), por su primera pregunta. */
|
|
12192
|
+
fieldGroupCache = new WeakMap();
|
|
11874
12193
|
pages = computed(() => {
|
|
11875
12194
|
const schema = this.engineState().schema;
|
|
11876
12195
|
const blocks = schema.blocks ?? [];
|
|
@@ -11884,14 +12203,22 @@ class UicSurveyComponent {
|
|
|
11884
12203
|
pages.push({ key: `b${blockIndex}`, index: pages.length, blockIndex, block, fields: block.fields, firstOfBlock: true });
|
|
11885
12204
|
return;
|
|
11886
12205
|
}
|
|
12206
|
+
// samePage une la pregunta con la anterior; la primera del bloque siempre abre página.
|
|
12207
|
+
const groups = [];
|
|
11887
12208
|
askable.forEach((field, fieldIndex) => {
|
|
12209
|
+
if (fieldIndex > 0 && field.samePage)
|
|
12210
|
+
groups[groups.length - 1].push(field);
|
|
12211
|
+
else
|
|
12212
|
+
groups.push([field]);
|
|
12213
|
+
});
|
|
12214
|
+
groups.forEach((group, groupIndex) => {
|
|
11888
12215
|
pages.push({
|
|
11889
|
-
key: `f:${
|
|
12216
|
+
key: `f:${group[0].name}`,
|
|
11890
12217
|
index: pages.length,
|
|
11891
12218
|
blockIndex,
|
|
11892
12219
|
block,
|
|
11893
|
-
fields: this.
|
|
11894
|
-
firstOfBlock:
|
|
12220
|
+
fields: this.fieldsForFieldPage(group, block.fields ?? []),
|
|
12221
|
+
firstOfBlock: groupIndex === 0
|
|
11895
12222
|
});
|
|
11896
12223
|
});
|
|
11897
12224
|
});
|
|
@@ -11924,8 +12251,27 @@ class UicSurveyComponent {
|
|
|
11924
12251
|
const total = this.total();
|
|
11925
12252
|
return total ? Math.round((this.position() / total) * 100) : 0;
|
|
11926
12253
|
});
|
|
11927
|
-
|
|
12254
|
+
/** true si "Anterior" hace algo: hay una página previa o, en la primera, showBackOnFirstPage. */
|
|
12255
|
+
canGoBack = computed(() => !!this.findAdjacentPage(-1) || this.settings().showBackOnFirstPage);
|
|
11928
12256
|
isLast = computed(() => !this.findAdjacentPage(1));
|
|
12257
|
+
/**
|
|
12258
|
+
* true si las preguntas visibles de la página actual son válidas. Se recalcula con cada cambio
|
|
12259
|
+
* de valor: si una respuesta muestra una pregunta obligatoria en la misma página (samePage +
|
|
12260
|
+
* visibilityRules), vuelve a false hasta que se conteste.
|
|
12261
|
+
*/
|
|
12262
|
+
canAdvance = computed(() => {
|
|
12263
|
+
this.engineState();
|
|
12264
|
+
const page = this.currentPage();
|
|
12265
|
+
if (!page)
|
|
12266
|
+
return false;
|
|
12267
|
+
const form = this.pageForms()[page.index];
|
|
12268
|
+
if (!form)
|
|
12269
|
+
return true;
|
|
12270
|
+
const externalStates = this.engine.externalValidationStates;
|
|
12271
|
+
return form.visibleFieldStates().every(({ field, control }) => field.hidden || !control || field.disabled ||
|
|
12272
|
+
(!this.isPendingInvalid(field, control) && externalStates[field.name] !== 'loading'));
|
|
12273
|
+
});
|
|
12274
|
+
nextDisabled = computed(() => this.settings().disableNextWhenInvalid && !this.canAdvance());
|
|
11929
12275
|
// --- Auto-guardado: estado interno ---
|
|
11930
12276
|
lastSavedValue = new Map();
|
|
11931
12277
|
saveTimers = new Map();
|
|
@@ -11938,6 +12284,7 @@ class UicSurveyComponent {
|
|
|
11938
12284
|
this.subscriptions.add(this.engine.optionsSourceError$.subscribe(error => this.optionsSourceError.emit(error)));
|
|
11939
12285
|
this.subscriptions.add(this.engine.formBuilt$.subscribe(() => this.onFormBuilt()));
|
|
11940
12286
|
effect(() => this.applyTheme(this.theme()));
|
|
12287
|
+
effect(() => this.trackRevealedQuestions());
|
|
11941
12288
|
// Reanudar: se aplica cuando las páginas ya están montadas (las reglas de visibilidad listas).
|
|
11942
12289
|
effect(() => {
|
|
11943
12290
|
const startAt = this.startAt();
|
|
@@ -12002,10 +12349,16 @@ class UicSurveyComponent {
|
|
|
12002
12349
|
this.submit();
|
|
12003
12350
|
}
|
|
12004
12351
|
}
|
|
12352
|
+
/** Vuelve a la página anterior visible; en la primera, con showBackOnFirstPage, emite backFromStart. */
|
|
12005
12353
|
back() {
|
|
12006
12354
|
const previousPage = this.findAdjacentPage(-1);
|
|
12007
|
-
if (previousPage)
|
|
12355
|
+
if (previousPage) {
|
|
12008
12356
|
this.goTo(previousPage, 'back');
|
|
12357
|
+
}
|
|
12358
|
+
else if (this.currentPage() && this.settings().showBackOnFirstPage) {
|
|
12359
|
+
this.flushSaves();
|
|
12360
|
+
this.backFromStart.emit();
|
|
12361
|
+
}
|
|
12009
12362
|
}
|
|
12010
12363
|
/** Va a una página por su posición en `pages()` (sin validar la actual). */
|
|
12011
12364
|
goToPage(index) {
|
|
@@ -12081,7 +12434,7 @@ class UicSurveyComponent {
|
|
|
12081
12434
|
}
|
|
12082
12435
|
announcePage(page) {
|
|
12083
12436
|
const position = this.i18n.translate('survey.announce_page', { current: this.position() + 1, total: this.total() });
|
|
12084
|
-
const title = this.pageMode() === 'block' ? page.block.title : page
|
|
12437
|
+
const title = this.pageMode() === 'block' ? page.block.title : this.firstVisibleQuestion(page)?.label;
|
|
12085
12438
|
this.announce(title ? `${position}. ${this.i18n.translate(title)}` : position);
|
|
12086
12439
|
}
|
|
12087
12440
|
/** Vacía y vuelve a escribir la región aria-live para que se lea aunque el texto se repita. */
|
|
@@ -12134,6 +12487,83 @@ class UicSurveyComponent {
|
|
|
12134
12487
|
}
|
|
12135
12488
|
return null;
|
|
12136
12489
|
}
|
|
12490
|
+
/** Primera pregunta visible de la página (en una página samePage la primera puede estar oculta por reglas). */
|
|
12491
|
+
firstVisibleQuestion(page) {
|
|
12492
|
+
const states = this.pageForms()[page.index]?.visibleFieldStates();
|
|
12493
|
+
return states?.find(({ field }) => !field.hidden && !field.otherFor)?.field ?? page.fields[0];
|
|
12494
|
+
}
|
|
12495
|
+
/**
|
|
12496
|
+
* Validez de un control para canAdvance. Una pregunta que se acaba de mostrar puede seguir
|
|
12497
|
+
* deshabilitada un instante (ui-dynamic-form la habilita en un effect sin emitir eventos), así
|
|
12498
|
+
* que en ese caso se evalúan sus validadores directamente.
|
|
12499
|
+
*/
|
|
12500
|
+
isPendingInvalid(field, control) {
|
|
12501
|
+
if (control.enabled)
|
|
12502
|
+
return control.invalid;
|
|
12503
|
+
if (this.disabled || field.disabled)
|
|
12504
|
+
return false;
|
|
12505
|
+
return !!control.validator?.(control);
|
|
12506
|
+
}
|
|
12507
|
+
/** Preguntas visibles de la página activa en el último cálculo (para detectar las que aparecen). */
|
|
12508
|
+
revealTracking = null;
|
|
12509
|
+
/** Anima las preguntas que aparecen en la página activa al contestar otra (samePage + visibilityRules). */
|
|
12510
|
+
trackRevealedQuestions() {
|
|
12511
|
+
const page = this.currentPage();
|
|
12512
|
+
const form = page ? this.pageForms()[page.index] : undefined;
|
|
12513
|
+
if (!page || !form) {
|
|
12514
|
+
this.revealTracking = null;
|
|
12515
|
+
return;
|
|
12516
|
+
}
|
|
12517
|
+
const names = form.visibleFieldStates()
|
|
12518
|
+
.filter(({ field }) => !field.hidden && !field.otherFor)
|
|
12519
|
+
.map(({ field }) => field.name);
|
|
12520
|
+
untracked(() => {
|
|
12521
|
+
const previous = this.revealTracking;
|
|
12522
|
+
this.revealTracking = { key: page.key, names: new Set(names) };
|
|
12523
|
+
if (!previous || previous.key !== page.key)
|
|
12524
|
+
return;
|
|
12525
|
+
const added = names.filter(name => !previous.names.has(name));
|
|
12526
|
+
if (added.length) {
|
|
12527
|
+
afterNextRender(() => this.revealQuestions(added), { injector: this.injector });
|
|
12528
|
+
}
|
|
12529
|
+
});
|
|
12530
|
+
}
|
|
12531
|
+
revealQuestions(names) {
|
|
12532
|
+
const page = this.host.nativeElement.querySelector('.uic-survey-page.is-active');
|
|
12533
|
+
if (!page)
|
|
12534
|
+
return;
|
|
12535
|
+
const elements = names
|
|
12536
|
+
.map(name => page.querySelector(`[data-field-name="${CSS.escape(name)}"]`))
|
|
12537
|
+
.filter((element) => !!element);
|
|
12538
|
+
if (!elements.length)
|
|
12539
|
+
return;
|
|
12540
|
+
const reduceMotion = typeof matchMedia !== 'undefined' && matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
12541
|
+
const last = elements[elements.length - 1];
|
|
12542
|
+
const scrollIntoView = () => last.scrollIntoView?.({ block: 'nearest', behavior: reduceMotion ? 'auto' : 'smooth' });
|
|
12543
|
+
if (reduceMotion || typeof last.animate !== 'function') {
|
|
12544
|
+
scrollIntoView();
|
|
12545
|
+
return;
|
|
12546
|
+
}
|
|
12547
|
+
// La altura crece desde 0: con la página centrada, las preguntas de arriba suben de a poco
|
|
12548
|
+
// para hacer lugar en vez de saltar.
|
|
12549
|
+
let pending = elements.length;
|
|
12550
|
+
for (const element of elements) {
|
|
12551
|
+
const height = element.offsetHeight;
|
|
12552
|
+
const previousOverflow = element.style.overflow;
|
|
12553
|
+
element.style.overflow = 'hidden';
|
|
12554
|
+
const animation = element.animate([
|
|
12555
|
+
{ height: '0px', opacity: 0, transform: 'translateY(8px)' },
|
|
12556
|
+
{ height: `${height}px`, opacity: 1, transform: 'none' }
|
|
12557
|
+
], { duration: 320, easing: 'cubic-bezier(0.22, 0.61, 0.36, 1)' });
|
|
12558
|
+
const done = () => {
|
|
12559
|
+
element.style.overflow = previousOverflow;
|
|
12560
|
+
if (--pending === 0)
|
|
12561
|
+
scrollIntoView();
|
|
12562
|
+
};
|
|
12563
|
+
animation.onfinish = done;
|
|
12564
|
+
animation.oncancel = done;
|
|
12565
|
+
}
|
|
12566
|
+
}
|
|
12137
12567
|
validatePage(page) {
|
|
12138
12568
|
const form = this.pageForms()[page.index];
|
|
12139
12569
|
const states = form?.visibleFieldStates() ?? [];
|
|
@@ -12165,14 +12595,28 @@ class UicSurveyComponent {
|
|
|
12165
12595
|
target?.focus({ preventScroll: true });
|
|
12166
12596
|
});
|
|
12167
12597
|
}
|
|
12168
|
-
/**
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
|
|
12175
|
-
|
|
12598
|
+
/**
|
|
12599
|
+
* Campos de una página en modo 'field': cada pregunta del grupo y, si tiene "Otros", su texto
|
|
12600
|
+
* acompañante. Se cachea por pregunta para que el array no cambie de referencia entre cálculos
|
|
12601
|
+
* (si cambiara, ui-dynamic-form recrearía los campos).
|
|
12602
|
+
*/
|
|
12603
|
+
fieldsForFieldPage(group, blockFields) {
|
|
12604
|
+
const withOther = (field) => {
|
|
12605
|
+
let fields = this.fieldPageFieldsCache.get(field);
|
|
12606
|
+
if (!fields) {
|
|
12607
|
+
const otherText = blockFields.find(candidate => candidate.otherFor === field.name);
|
|
12608
|
+
fields = otherText ? [field, otherText] : [field];
|
|
12609
|
+
this.fieldPageFieldsCache.set(field, fields);
|
|
12610
|
+
}
|
|
12611
|
+
return fields;
|
|
12612
|
+
};
|
|
12613
|
+
if (group.length === 1)
|
|
12614
|
+
return withOther(group[0]);
|
|
12615
|
+
const fields = group.flatMap(withOther);
|
|
12616
|
+
const cached = this.fieldGroupCache.get(group[0]);
|
|
12617
|
+
if (cached && cached.length === fields.length && cached.every((field, i) => field === fields[i]))
|
|
12618
|
+
return cached;
|
|
12619
|
+
this.fieldGroupCache.set(group[0], fields);
|
|
12176
12620
|
return fields;
|
|
12177
12621
|
}
|
|
12178
12622
|
onFormBuilt() {
|
|
@@ -12302,15 +12746,16 @@ class UicSurveyComponent {
|
|
|
12302
12746
|
}
|
|
12303
12747
|
}
|
|
12304
12748
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSurveyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12305
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSurveyComponent, isStandalone: true, selector: "ui-survey", inputs: { schema: { classPropertyName: "schema", publicName: "schema", isSignal: false, isRequired: true, transformFunction: null }, initialValues: { classPropertyName: "initialValues", publicName: "initialValues", isSignal: false, isRequired: false, transformFunction: null }, externalData: { classPropertyName: "externalData", publicName: "externalData", isSignal: false, isRequired: false, transformFunction: null }, selectOptionsResolver: { classPropertyName: "selectOptionsResolver", publicName: "selectOptionsResolver", isSignal: false, isRequired: false, transformFunction: null }, computedFieldResolver: { classPropertyName: "computedFieldResolver", publicName: "computedFieldResolver", isSignal: false, isRequired: false, transformFunction: null }, externalValidatorResolver: { classPropertyName: "externalValidatorResolver", publicName: "externalValidatorResolver", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, pageMode: { classPropertyName: "pageMode", publicName: "pageMode", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "animation", isSignal: true, isRequired: false, transformFunction: null }, showProgress: { classPropertyName: "showProgress", publicName: "showProgress", isSignal: true, isRequired: false, transformFunction: null }, showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, autoAdvance: { classPropertyName: "autoAdvance", publicName: "autoAdvance", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, iconMode: { classPropertyName: "iconMode", publicName: "iconMode", isSignal: true, isRequired: false, transformFunction: null }, fileUidResolverFn: { classPropertyName: "fileUidResolverFn", publicName: "fileUidResolverFn", isSignal: true, isRequired: false, transformFunction: null }, nextText: { classPropertyName: "nextText", publicName: "nextText", isSignal: true, isRequired: false, transformFunction: null }, backText: { classPropertyName: "backText", publicName: "backText", isSignal: true, isRequired: false, transformFunction: null }, submitText: { classPropertyName: "submitText", publicName: "submitText", isSignal: true, isRequired: false, transformFunction: null }, autoSave: { classPropertyName: "autoSave", publicName: "autoSave", isSignal: true, isRequired: false, transformFunction: null }, saveFn: { classPropertyName: "saveFn", publicName: "saveFn", isSignal: true, isRequired: false, transformFunction: null }, autoSaveDebounceMs: { classPropertyName: "autoSaveDebounceMs", publicName: "autoSaveDebounceMs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { surveySubmit: "surveySubmit", pageChange: "pageChange", fieldSave: "fieldSave", formChange: "formChange", optionsSourceError: "optionsSourceError" }, host: { attributes: { "data-uic-theme-scope": "" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.data-animation": "animation()" } }, providers: [UicFormStateService, UicFormEngine], queries: [{ propertyName: "headerTpl", first: true, predicate: UicSurveyHeaderDirective, descendants: true, isSignal: true }, { propertyName: "footerTpl", first: true, predicate: UicSurveyFooterDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "pageForms", predicate: ["pageForm"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@let state = engineState();\n@let page = currentPage();\n\n@if (loading()) {\n <div class=\"uic-survey-loading\">\n <ui-skeleton-loader [cols]=\"1\" [inputs]=\"2\"></ui-skeleton-loader>\n </div>\n} @else {\n <!-- ENCABEZADO -->\n @if (page) {\n @if (headerTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.template; context: { $implicit: page, position: position(), total: total(), progress: progress() }\"></ng-container>\n } @else if (showProgress()) {\n <header class=\"uic-survey-header\">\n <div class=\"uic-survey-progress\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" [attr.aria-valuenow]=\"progress()\">\n <div class=\"uic-survey-progress-fill\" [style.width.%]=\"progress()\"></div>\n </div>\n <span class=\"uic-survey-progress-text\">\n {{ 'survey.progress' | uicTranslate: { current: position() + 1, total: total() } }}\n </span>\n </header>\n }\n }\n\n <!-- Anuncios para lectores de pantalla (cambio de p\u00E1gina, errores) -->\n <div class=\"uic-survey-sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</div>\n\n <!-- P\u00C1GINAS: todas montadas (as\u00ED las reglas de visibilidad y los campos ocultos se mantienen al d\u00EDa) -->\n <div class=\"uic-survey-pages\">\n @for (p of pages(); track p.key) {\n @let active = p.key === activeKey();\n <section\n class=\"uic-survey-page\"\n [class.is-active]=\"active\"\n [class.is-back]=\"direction() === 'back'\"\n [attr.aria-hidden]=\"active ? null : 'true'\"\n [attr.inert]=\"active ? null : ''\">\n\n @if (pageMode() === 'block') {\n @if (p.block.title) { <h2 class=\"uic-survey-block-title\">{{ p.block.title }}</h2> }\n @if (p.block.subtitle) { <h3 class=\"uic-survey-block-subtitle\">{{ p.block.subtitle }}</h3> }\n @if (p.block.message) { <div class=\"uic-survey-block-message\" [innerHTML]=\"p.block.message\"></div> }\n } @else {\n @if (p.block.title) { <div class=\"uic-survey-eyebrow\">{{ p.block.title }}</div> }\n @if (p.firstOfBlock && p.block.message) { <div class=\"uic-survey-block-message\" [innerHTML]=\"p.block.message\"></div> }\n }\n\n <ui-dynamic-form\n #pageForm\n class=\"uic-survey-question\"\n [cols]=\"pageCols()\"\n [disabled]=\"disabled\"\n [iconMode]=\"iconMode()\"\n [fileUidResolverFn]=\"fileUidResolverFn()\"\n [fields]=\"p.fields\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [externalValidationStates]=\"state.externalValidationStates\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n (fieldBlur)=\"onFieldBlur($event)\">\n </ui-dynamic-form>\n </section>\n }\n\n @if (hiddenFields().length) {\n <ui-dynamic-form\n class=\"uic-survey-hidden-fields\"\n [fields]=\"hiddenFields()\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [disabled]=\"disabled\"\n [externalValidationStates]=\"state.externalValidationStates\">\n </ui-dynamic-form>\n }\n </div>\n\n <!-- NAVEGACI\u00D3N -->\n @if (page) {\n @if (footerTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.template; context: {\n $implicit: page,\n next: next.bind(this),\n back: back.bind(this),\n canGoBack: canGoBack(),\n isLast: isLast(),\n saveState: saveState()\n }\"></ng-container>\n } @else {\n <footer class=\"uic-survey-footer\">\n @if (showBack() && canGoBack()) {\n <ui-button class=\"uic-survey-back\" type=\"ghost\" color=\"black\" icon=\"ri-arrow-left-line\" (click)=\"back()\">\n {{ backText() | uicTranslate }}\n </ui-button>\n }\n\n <span class=\"uic-survey-save-state\" aria-live=\"polite\">\n @switch (saveState()) {\n @case ('saving') { <i class=\"ri-loader-4-line\" aria-hidden=\"true\"></i> {{ 'survey.saving' | uicTranslate }} }\n @case ('saved') { <i class=\"ri-check-line\" aria-hidden=\"true\"></i> {{ 'survey.saved' | uicTranslate }} }\n @case ('error') { <i class=\"ri-error-warning-line\" aria-hidden=\"true\"></i> {{ 'survey.save_error' | uicTranslate }} }\n }\n </span>\n\n <div class=\"uic-survey-next\">\n <!-- <span class=\"uic-survey-hint\">{{ 'survey.press_enter' | uicTranslate }}</span> -->\n <ui-button color=\"primary\" [rightIcon]=\"isLast() ? '' : 'ri-arrow-right-line'\" (click)=\"next()\">\n {{ (isLast() ? submitText() : nextText()) | uicTranslate }}\n </ui-button>\n </div>\n </footer>\n }\n }\n}\n", styles: [":host{--form-ref: 11px;--uic-label-font-size: var(--uic-survey-question-font-size, 1.25rem);--uic-label-font-weight: var(--uic-survey-question-font-weight, 500);--uic-label-color: var(--uic-survey-question-color, var(--uic-neutral-950, var(--grey-950)));--uic-label-line-height: calc(var(--uic-survey-question-font-size, 1.25rem) * 1.4);--uic-option-label-font-size: 1rem;--input-label-space: 12px;--uic-pool-gap: 10px;--uic-pool-option-padding: 12px 18px;--uic-pool-option-font-size: 1rem;--uic-pool-option-radius: var(--input-radius);--uic-pool-option-bg: var(--uic-surface, var(--white));--uic-pool-option-color: var(--uic-neutral-900, var(--grey-900));--uic-pool-option-border-color: var(--uic-neutral-300, var(--grey-300));--uic-pool-option-border-color-hover: var(--primary-400);--uic-pool-option-active-bg: var(--primary-100);--uic-pool-option-active-color: var(--primary-600);--uic-pool-option-active-border-color: var(--primary-600);display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:var(--uic-survey-max-width, 720px);min-height:var(--uic-survey-min-height, 320px);margin:0 auto;padding:var(--uic-survey-padding, 1.5rem);background:var(--uic-survey-bg, transparent);box-sizing:border-box;font-family:var(--uic-font-family, inherit)}@media (max-width: 479px){:host{padding:var(--uic-survey-padding, 1rem)}}:host ::ng-deep :is(input,textarea,button){font-family:inherit}:host ::ng-deep :is(input,textarea){color:var(--uic-input-text-color, inherit)}:host ::ng-deep :is(input,textarea)::placeholder{color:var(--uic-input-placeholder-color, var(--uic-neutral-400, var(--grey-400)))}.uic-survey-header{display:flex;align-items:center;gap:.75rem}.uic-survey-progress{flex:1 1 auto;height:var(--uic-survey-progress-height, 6px);border-radius:calc(var(--uic-survey-progress-height, 6px) / 2);background:var(--uic-survey-progress-track, var(--primary-100));overflow:hidden}.uic-survey-progress-fill{height:100%;border-radius:inherit;background:var(--uic-survey-progress-color, var(--primary-600));transition:width var(--uic-survey-transition-duration, .32s) var(--uic-survey-transition-easing, cubic-bezier(.22, .61, .36, 1))}.uic-survey-progress-text{flex:0 0 auto;font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)));font-variant-numeric:tabular-nums}.uic-survey-pages{flex:1 1 auto;position:relative}.uic-survey-page{display:none}.uic-survey-page.is-active{display:block;animation:uic-survey-enter-forward var(--uic-survey-transition-duration, .32s) var(--uic-survey-transition-easing, cubic-bezier(.22, .61, .36, 1)) both}.uic-survey-page.is-active.is-back{animation-name:uic-survey-enter-back}:host([data-animation=fade]) .uic-survey-page.is-active{animation-name:uic-survey-fade}:host([data-animation=none]) .uic-survey-page.is-active{animation:none}@media (prefers-reduced-motion: reduce){.uic-survey-page.is-active{animation-name:uic-survey-fade}.uic-survey-progress-fill{transition:none}}@keyframes uic-survey-enter-forward{0%{opacity:0;transform:translateY(var(--uic-survey-transition-distance, 32px))}to{opacity:1;transform:none}}@keyframes uic-survey-enter-back{0%{opacity:0;transform:translateY(calc(-1 * var(--uic-survey-transition-distance, 32px)))}to{opacity:1;transform:none}}@keyframes uic-survey-fade{0%{opacity:0}to{opacity:1}}.uic-survey-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.uic-survey-eyebrow{margin-bottom:.5rem;font-size:.75rem;font-weight:600;letter-spacing:var(--uic-survey-eyebrow-letter-spacing, .06em);text-transform:var(--uic-survey-eyebrow-transform, uppercase);color:var(--uic-survey-eyebrow-color, var(--primary-600))}.uic-survey-block-title{margin:0 0 .5rem;font-size:var(--uic-block-title-font-size, 1.625rem);font-weight:600;line-height:1.2;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.uic-survey-block-subtitle{margin:0 0 .5rem;font-size:var(--uic-block-subtitle-font-size, 1.25rem);font-weight:500;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.uic-survey-block-message{margin-bottom:1rem;font-size:.875rem;line-height:1.5;color:var(--uic-block-message-color, var(--uic-neutral-500, var(--grey-500, #666)))}.uic-survey-hidden-fields{display:none}.uic-survey-footer{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.uic-survey-save-state{display:inline-flex;align-items:center;gap:.25rem;font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)));min-height:1em}.uic-survey-save-state .ri-loader-4-line{animation:uic-survey-spin 1s linear infinite}.uic-survey-next{margin-left:auto;display:flex;align-items:center;gap:.75rem}.uic-survey-hint{font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}@media (max-width: 479px){.uic-survey-hint{display:none}}@keyframes uic-survey-spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "contextFields", "isSubForm", "form", "disabled", "externalValidationStates", "voiceToTextSilenceMs", "cols", "iconMode", "fileUidResolverFn", "selectOptionsResolver", "parentFormValues"], outputs: ["fieldBlur"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicSkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12749
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSurveyComponent, isStandalone: true, selector: "ui-survey", inputs: { schema: { classPropertyName: "schema", publicName: "schema", isSignal: false, isRequired: true, transformFunction: null }, initialValues: { classPropertyName: "initialValues", publicName: "initialValues", isSignal: false, isRequired: false, transformFunction: null }, externalData: { classPropertyName: "externalData", publicName: "externalData", isSignal: false, isRequired: false, transformFunction: null }, selectOptionsResolver: { classPropertyName: "selectOptionsResolver", publicName: "selectOptionsResolver", isSignal: false, isRequired: false, transformFunction: null }, computedFieldResolver: { classPropertyName: "computedFieldResolver", publicName: "computedFieldResolver", isSignal: false, isRequired: false, transformFunction: null }, externalValidatorResolver: { classPropertyName: "externalValidatorResolver", publicName: "externalValidatorResolver", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, pageMode: { classPropertyName: "pageMode", publicName: "pageMode", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "animation", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, showProgress: { classPropertyName: "showProgress", publicName: "showProgress", isSignal: true, isRequired: false, transformFunction: null }, showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null }, showBackOnFirstPage: { classPropertyName: "showBackOnFirstPage", publicName: "showBackOnFirstPage", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, autoAdvance: { classPropertyName: "autoAdvance", publicName: "autoAdvance", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, disableNextWhenInvalid: { classPropertyName: "disableNextWhenInvalid", publicName: "disableNextWhenInvalid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, iconMode: { classPropertyName: "iconMode", publicName: "iconMode", isSignal: true, isRequired: false, transformFunction: null }, fileUidResolverFn: { classPropertyName: "fileUidResolverFn", publicName: "fileUidResolverFn", isSignal: true, isRequired: false, transformFunction: null }, nextText: { classPropertyName: "nextText", publicName: "nextText", isSignal: true, isRequired: false, transformFunction: null }, backText: { classPropertyName: "backText", publicName: "backText", isSignal: true, isRequired: false, transformFunction: null }, submitText: { classPropertyName: "submitText", publicName: "submitText", isSignal: true, isRequired: false, transformFunction: null }, autoSave: { classPropertyName: "autoSave", publicName: "autoSave", isSignal: true, isRequired: false, transformFunction: null }, saveFn: { classPropertyName: "saveFn", publicName: "saveFn", isSignal: true, isRequired: false, transformFunction: null }, autoSaveDebounceMs: { classPropertyName: "autoSaveDebounceMs", publicName: "autoSaveDebounceMs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { surveySubmit: "surveySubmit", pageChange: "pageChange", backFromStart: "backFromStart", fieldSave: "fieldSave", formChange: "formChange", optionsSourceError: "optionsSourceError" }, host: { attributes: { "data-uic-theme-scope": "" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.data-animation": "animation()", "attr.data-page-mode": "pageMode()" } }, providers: [UicFormStateService, UicFormEngine], queries: [{ propertyName: "headerTpl", first: true, predicate: UicSurveyHeaderDirective, descendants: true, isSignal: true }, { propertyName: "footerTpl", first: true, predicate: UicSurveyFooterDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "pageForms", predicate: ["pageForm"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@let state = engineState();\n@let page = currentPage();\n\n@if (loading()) {\n <div class=\"uic-survey-loading\">\n <ui-skeleton-loader [cols]=\"1\" [inputs]=\"2\"></ui-skeleton-loader>\n </div>\n} @else {\n <!-- ENCABEZADO -->\n @if (page) {\n @if (headerTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.template; context: { $implicit: page, position: position(), total: total(), progress: progress() }\"></ng-container>\n } @else if (settings().showProgress) {\n <header class=\"uic-survey-header\">\n <div class=\"uic-survey-progress\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" [attr.aria-valuenow]=\"progress()\">\n <div class=\"uic-survey-progress-fill\" [style.width.%]=\"progress()\"></div>\n </div>\n <span class=\"uic-survey-progress-text\">\n {{ 'survey.progress' | uicTranslate: { current: position() + 1, total: total() } }}\n </span>\n </header>\n }\n }\n\n <!-- Anuncios para lectores de pantalla (cambio de p\u00E1gina, errores) -->\n <div class=\"uic-survey-sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</div>\n\n <!-- P\u00C1GINAS: todas montadas (as\u00ED las reglas de visibilidad y los campos ocultos se mantienen al d\u00EDa) -->\n <div class=\"uic-survey-pages\">\n @for (p of pages(); track p.key) {\n @let active = p.key === activeKey();\n <section\n class=\"uic-survey-page\"\n [class.is-active]=\"active\"\n [class.is-back]=\"direction() === 'back'\"\n [attr.aria-hidden]=\"active ? null : 'true'\"\n [attr.inert]=\"active ? null : ''\">\n\n @if (pageMode() === 'block') {\n @if (p.block.title) { <h2 class=\"uic-survey-block-title\">{{ p.block.title }}</h2> }\n @if (p.block.subtitle) { <h3 class=\"uic-survey-block-subtitle\">{{ p.block.subtitle }}</h3> }\n @if (p.block.message) { <div class=\"uic-survey-block-message\" [innerHTML]=\"p.block.message\"></div> }\n } @else {\n @if (p.block.title) { <div class=\"uic-survey-eyebrow\">{{ p.block.title }}</div> }\n @if (p.firstOfBlock && p.block.subtitle) { <h3 class=\"uic-survey-block-subtitle\">{{ p.block.subtitle }}</h3> }\n @if (p.firstOfBlock && p.block.message) { <div class=\"uic-survey-block-message\" [innerHTML]=\"p.block.message\"></div> }\n }\n\n <ui-dynamic-form\n #pageForm\n class=\"uic-survey-question\"\n [cols]=\"pageCols()\"\n [disabled]=\"disabled\"\n [iconMode]=\"iconMode()\"\n [fileUidResolverFn]=\"fileUidResolverFn()\"\n [fields]=\"p.fields\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [externalValidationStates]=\"state.externalValidationStates\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n (fieldBlur)=\"onFieldBlur($event)\">\n </ui-dynamic-form>\n </section>\n }\n\n @if (hiddenFields().length) {\n <ui-dynamic-form\n class=\"uic-survey-hidden-fields\"\n [fields]=\"hiddenFields()\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [disabled]=\"disabled\"\n [externalValidationStates]=\"state.externalValidationStates\">\n </ui-dynamic-form>\n }\n </div>\n\n <!-- NAVEGACI\u00D3N -->\n @if (page) {\n @if (footerTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.template; context: {\n $implicit: page,\n next: next.bind(this),\n back: back.bind(this),\n canGoBack: canGoBack(),\n isLast: isLast(),\n canAdvance: canAdvance(),\n saveState: saveState()\n }\"></ng-container>\n } @else {\n <footer class=\"uic-survey-footer\">\n @if (settings().showBack && canGoBack()) {\n <ui-button class=\"uic-survey-back\" type=\"ghost\" color=\"black\" icon=\"ri-arrow-left-line\" (click)=\"back()\">\n {{ settings().texts.back | uicTranslate }}\n </ui-button>\n }\n\n <span class=\"uic-survey-save-state\" aria-live=\"polite\">\n @switch (saveState()) {\n @case ('saving') { <i class=\"ri-loader-4-line\" aria-hidden=\"true\"></i> {{ 'survey.saving' | uicTranslate }} }\n @case ('saved') { <i class=\"ri-check-line\" aria-hidden=\"true\"></i> {{ 'survey.saved' | uicTranslate }} }\n @case ('error') { <i class=\"ri-error-warning-line\" aria-hidden=\"true\"></i> {{ 'survey.save_error' | uicTranslate }} }\n }\n </span>\n\n <div class=\"uic-survey-next\">\n <!-- <span class=\"uic-survey-hint\">{{ 'survey.press_enter' | uicTranslate }}</span> -->\n <ui-button\n color=\"primary\"\n [rightIcon]=\"isLast() ? '' : 'ri-arrow-right-line'\"\n [disabled]=\"nextDisabled()\"\n (click)=\"nextDisabled() || next()\">\n {{ (isLast() ? settings().texts.submit : settings().texts.next) | uicTranslate }}\n </ui-button>\n </div>\n </footer>\n }\n }\n}\n", styles: [":host{--form-ref: 11px;--uic-label-font-size: var(--uic-survey-question-font-size, 1.25rem);--uic-label-font-weight: var(--uic-survey-question-font-weight, 500);--uic-label-color: var(--uic-survey-question-color, var(--uic-neutral-950, var(--grey-950)));--uic-label-line-height: calc(var(--uic-survey-question-font-size, 1.25rem) * 1.4);--uic-option-label-font-size: 1rem;--input-label-space: 12px;--uic-pool-gap: 10px;--uic-pool-option-padding: 12px 18px;--uic-pool-option-font-size: 1rem;--uic-pool-option-radius: var(--input-radius);--uic-pool-option-bg: var(--uic-surface, var(--white));--uic-pool-option-color: var(--uic-neutral-900, var(--grey-900));--uic-pool-option-border-color: var(--uic-neutral-300, var(--grey-300));--uic-pool-option-border-color-hover: var(--primary-400);--uic-pool-option-active-bg: var(--primary-100);--uic-pool-option-active-color: var(--primary-600);--uic-pool-option-active-border-color: var(--primary-600);display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:var(--uic-survey-max-width, 720px);min-height:var(--uic-survey-min-height, 320px);margin:0 auto;padding:var(--uic-survey-padding, 1.5rem);background:var(--uic-survey-bg, transparent);box-sizing:border-box;font-family:var(--uic-font-family, inherit)}@media (max-width: 479px){:host{padding:var(--uic-survey-padding, 1rem)}}:host ::ng-deep :is(input,textarea,button){font-family:inherit}:host ::ng-deep :is(input,textarea){color:var(--uic-input-text-color, inherit)}:host ::ng-deep :is(input,textarea)::placeholder{color:var(--uic-input-placeholder-color, var(--uic-neutral-400, var(--grey-400)))}.uic-survey-header{display:flex;align-items:center;gap:.75rem}.uic-survey-progress{flex:1 1 auto;height:var(--uic-survey-progress-height, 6px);border-radius:calc(var(--uic-survey-progress-height, 6px) / 2);background:var(--uic-survey-progress-track, var(--primary-100));overflow:hidden}.uic-survey-progress-fill{height:100%;border-radius:inherit;background:var(--uic-survey-progress-color, var(--primary-600));transition:width var(--uic-survey-transition-duration, .32s) var(--uic-survey-transition-easing, cubic-bezier(.22, .61, .36, 1))}.uic-survey-progress-text{flex:0 0 auto;font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)));font-variant-numeric:tabular-nums}.uic-survey-pages{flex:1 1 auto;position:relative;display:flex;flex-direction:column}.uic-survey-page.is-active{flex:1 1 auto}:host([data-page-mode=field]) .uic-survey-page.is-active{display:flex;flex-direction:column;justify-content:var(--uic-survey-page-justify, center)}.uic-survey-page{display:none}.uic-survey-page.is-active{display:block;animation:uic-survey-enter-forward var(--uic-survey-transition-duration, .32s) var(--uic-survey-transition-easing, cubic-bezier(.22, .61, .36, 1)) both}.uic-survey-page.is-active.is-back{animation-name:uic-survey-enter-back}:host([data-animation=fade]) .uic-survey-page.is-active{animation-name:uic-survey-fade}:host([data-animation=none]) .uic-survey-page.is-active{animation:none}@media (prefers-reduced-motion: reduce){.uic-survey-page.is-active{animation-name:uic-survey-fade}.uic-survey-progress-fill{transition:none}}@keyframes uic-survey-enter-forward{0%{opacity:0;transform:translateY(var(--uic-survey-transition-distance, 32px))}to{opacity:1;transform:none}}@keyframes uic-survey-enter-back{0%{opacity:0;transform:translateY(calc(-1 * var(--uic-survey-transition-distance, 32px)))}to{opacity:1;transform:none}}@keyframes uic-survey-fade{0%{opacity:0}to{opacity:1}}.uic-survey-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.uic-survey-eyebrow{margin-bottom:.5rem;font-size:.75rem;font-weight:600;letter-spacing:var(--uic-survey-eyebrow-letter-spacing, .06em);text-transform:var(--uic-survey-eyebrow-transform, uppercase);color:var(--uic-survey-eyebrow-color, var(--primary-600))}.uic-survey-block-title{margin:0 0 .5rem;font-size:var(--uic-block-title-font-size, 1.625rem);font-weight:600;line-height:1.2;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.uic-survey-block-subtitle{margin:0 0 .5rem;font-size:var(--uic-block-subtitle-font-size, 1.25rem);font-weight:500;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.uic-survey-block-message{margin-bottom:1rem;font-size:.875rem;line-height:1.5;color:var(--uic-block-message-color, var(--uic-neutral-500, var(--grey-500, #666)))}.uic-survey-hidden-fields{display:none}.uic-survey-footer{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.uic-survey-save-state{display:inline-flex;align-items:center;gap:.25rem;font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)));min-height:1em}.uic-survey-save-state .ri-loader-4-line{animation:uic-survey-spin 1s linear infinite}.uic-survey-next{margin-left:auto;display:flex;align-items:center;gap:.75rem}.uic-survey-hint{font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}@media (max-width: 479px){.uic-survey-hint{display:none}}@keyframes uic-survey-spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "contextFields", "isSubForm", "form", "disabled", "externalValidationStates", "voiceToTextSilenceMs", "cols", "iconMode", "fileUidResolverFn", "selectOptionsResolver", "parentFormValues"], outputs: ["fieldBlur"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicSkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12306
12750
|
}
|
|
12307
12751
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSurveyComponent, decorators: [{
|
|
12308
12752
|
type: Component,
|
|
12309
12753
|
args: [{ selector: 'ui-survey', imports: [NgTemplateOutlet, UicDynamicFormComponent, UicButtonComponent, UicTranslatePipe, UicSkeletonLoaderComponent], providers: [UicFormStateService, UicFormEngine], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
12310
12754
|
'data-uic-theme-scope': '',
|
|
12311
12755
|
'[attr.data-animation]': 'animation()',
|
|
12756
|
+
'[attr.data-page-mode]': 'pageMode()',
|
|
12312
12757
|
'(keydown)': 'onKeydown($event)'
|
|
12313
|
-
}, template: "@let state = engineState();\n@let page = currentPage();\n\n@if (loading()) {\n <div class=\"uic-survey-loading\">\n <ui-skeleton-loader [cols]=\"1\" [inputs]=\"2\"></ui-skeleton-loader>\n </div>\n} @else {\n <!-- ENCABEZADO -->\n @if (page) {\n @if (headerTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.template; context: { $implicit: page, position: position(), total: total(), progress: progress() }\"></ng-container>\n } @else if (showProgress()) {\n <header class=\"uic-survey-header\">\n <div class=\"uic-survey-progress\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" [attr.aria-valuenow]=\"progress()\">\n <div class=\"uic-survey-progress-fill\" [style.width.%]=\"progress()\"></div>\n </div>\n <span class=\"uic-survey-progress-text\">\n {{ 'survey.progress' | uicTranslate: { current: position() + 1, total: total() } }}\n </span>\n </header>\n }\n }\n\n <!-- Anuncios para lectores de pantalla (cambio de p\u00E1gina, errores) -->\n <div class=\"uic-survey-sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</div>\n\n <!-- P\u00C1GINAS: todas montadas (as\u00ED las reglas de visibilidad y los campos ocultos se mantienen al d\u00EDa) -->\n <div class=\"uic-survey-pages\">\n @for (p of pages(); track p.key) {\n @let active = p.key === activeKey();\n <section\n class=\"uic-survey-page\"\n [class.is-active]=\"active\"\n [class.is-back]=\"direction() === 'back'\"\n [attr.aria-hidden]=\"active ? null : 'true'\"\n [attr.inert]=\"active ? null : ''\">\n\n @if (pageMode() === 'block') {\n @if (p.block.title) { <h2 class=\"uic-survey-block-title\">{{ p.block.title }}</h2> }\n @if (p.block.subtitle) { <h3 class=\"uic-survey-block-subtitle\">{{ p.block.subtitle }}</h3> }\n @if (p.block.message) { <div class=\"uic-survey-block-message\" [innerHTML]=\"p.block.message\"></div> }\n } @else {\n @if (p.block.title) { <div class=\"uic-survey-eyebrow\">{{ p.block.title }}</div> }\n @if (p.firstOfBlock && p.block.message) { <div class=\"uic-survey-block-message\" [innerHTML]=\"p.block.message\"></div> }\n }\n\n <ui-dynamic-form\n #pageForm\n class=\"uic-survey-question\"\n [cols]=\"pageCols()\"\n [disabled]=\"disabled\"\n [iconMode]=\"iconMode()\"\n [fileUidResolverFn]=\"fileUidResolverFn()\"\n [fields]=\"p.fields\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [externalValidationStates]=\"state.externalValidationStates\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n (fieldBlur)=\"onFieldBlur($event)\">\n </ui-dynamic-form>\n </section>\n }\n\n @if (hiddenFields().length) {\n <ui-dynamic-form\n class=\"uic-survey-hidden-fields\"\n [fields]=\"hiddenFields()\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [disabled]=\"disabled\"\n [externalValidationStates]=\"state.externalValidationStates\">\n </ui-dynamic-form>\n }\n </div>\n\n <!-- NAVEGACI\u00D3N -->\n @if (page) {\n @if (footerTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.template; context: {\n $implicit: page,\n next: next.bind(this),\n back: back.bind(this),\n canGoBack: canGoBack(),\n isLast: isLast(),\n saveState: saveState()\n }\"></ng-container>\n } @else {\n <footer class=\"uic-survey-footer\">\n @if (showBack() && canGoBack()) {\n <ui-button class=\"uic-survey-back\" type=\"ghost\" color=\"black\" icon=\"ri-arrow-left-line\" (click)=\"back()\">\n {{ backText() | uicTranslate }}\n </ui-button>\n }\n\n <span class=\"uic-survey-save-state\" aria-live=\"polite\">\n @switch (saveState()) {\n @case ('saving') { <i class=\"ri-loader-4-line\" aria-hidden=\"true\"></i> {{ 'survey.saving' | uicTranslate }} }\n @case ('saved') { <i class=\"ri-check-line\" aria-hidden=\"true\"></i> {{ 'survey.saved' | uicTranslate }} }\n @case ('error') { <i class=\"ri-error-warning-line\" aria-hidden=\"true\"></i> {{ 'survey.save_error' | uicTranslate }} }\n }\n </span>\n\n <div class=\"uic-survey-next\">\n <!-- <span class=\"uic-survey-hint\">{{ 'survey.press_enter' | uicTranslate }}</span> -->\n <ui-button color=\"primary\" [rightIcon]=\"isLast() ? '' : 'ri-arrow-right-line'\" (click)=\"next()\">\n {{ (isLast() ? submitText() : nextText()) | uicTranslate }}\n </ui-button>\n </div>\n </footer>\n }\n }\n}\n", styles: [":host{--form-ref: 11px;--uic-label-font-size: var(--uic-survey-question-font-size, 1.25rem);--uic-label-font-weight: var(--uic-survey-question-font-weight, 500);--uic-label-color: var(--uic-survey-question-color, var(--uic-neutral-950, var(--grey-950)));--uic-label-line-height: calc(var(--uic-survey-question-font-size, 1.25rem) * 1.4);--uic-option-label-font-size: 1rem;--input-label-space: 12px;--uic-pool-gap: 10px;--uic-pool-option-padding: 12px 18px;--uic-pool-option-font-size: 1rem;--uic-pool-option-radius: var(--input-radius);--uic-pool-option-bg: var(--uic-surface, var(--white));--uic-pool-option-color: var(--uic-neutral-900, var(--grey-900));--uic-pool-option-border-color: var(--uic-neutral-300, var(--grey-300));--uic-pool-option-border-color-hover: var(--primary-400);--uic-pool-option-active-bg: var(--primary-100);--uic-pool-option-active-color: var(--primary-600);--uic-pool-option-active-border-color: var(--primary-600);display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:var(--uic-survey-max-width, 720px);min-height:var(--uic-survey-min-height, 320px);margin:0 auto;padding:var(--uic-survey-padding, 1.5rem);background:var(--uic-survey-bg, transparent);box-sizing:border-box;font-family:var(--uic-font-family, inherit)}@media (max-width: 479px){:host{padding:var(--uic-survey-padding, 1rem)}}:host ::ng-deep :is(input,textarea,button){font-family:inherit}:host ::ng-deep :is(input,textarea){color:var(--uic-input-text-color, inherit)}:host ::ng-deep :is(input,textarea)::placeholder{color:var(--uic-input-placeholder-color, var(--uic-neutral-400, var(--grey-400)))}.uic-survey-header{display:flex;align-items:center;gap:.75rem}.uic-survey-progress{flex:1 1 auto;height:var(--uic-survey-progress-height, 6px);border-radius:calc(var(--uic-survey-progress-height, 6px) / 2);background:var(--uic-survey-progress-track, var(--primary-100));overflow:hidden}.uic-survey-progress-fill{height:100%;border-radius:inherit;background:var(--uic-survey-progress-color, var(--primary-600));transition:width var(--uic-survey-transition-duration, .32s) var(--uic-survey-transition-easing, cubic-bezier(.22, .61, .36, 1))}.uic-survey-progress-text{flex:0 0 auto;font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)));font-variant-numeric:tabular-nums}.uic-survey-pages{flex:1 1 auto;position:relative}.uic-survey-page{display:none}.uic-survey-page.is-active{display:block;animation:uic-survey-enter-forward var(--uic-survey-transition-duration, .32s) var(--uic-survey-transition-easing, cubic-bezier(.22, .61, .36, 1)) both}.uic-survey-page.is-active.is-back{animation-name:uic-survey-enter-back}:host([data-animation=fade]) .uic-survey-page.is-active{animation-name:uic-survey-fade}:host([data-animation=none]) .uic-survey-page.is-active{animation:none}@media (prefers-reduced-motion: reduce){.uic-survey-page.is-active{animation-name:uic-survey-fade}.uic-survey-progress-fill{transition:none}}@keyframes uic-survey-enter-forward{0%{opacity:0;transform:translateY(var(--uic-survey-transition-distance, 32px))}to{opacity:1;transform:none}}@keyframes uic-survey-enter-back{0%{opacity:0;transform:translateY(calc(-1 * var(--uic-survey-transition-distance, 32px)))}to{opacity:1;transform:none}}@keyframes uic-survey-fade{0%{opacity:0}to{opacity:1}}.uic-survey-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.uic-survey-eyebrow{margin-bottom:.5rem;font-size:.75rem;font-weight:600;letter-spacing:var(--uic-survey-eyebrow-letter-spacing, .06em);text-transform:var(--uic-survey-eyebrow-transform, uppercase);color:var(--uic-survey-eyebrow-color, var(--primary-600))}.uic-survey-block-title{margin:0 0 .5rem;font-size:var(--uic-block-title-font-size, 1.625rem);font-weight:600;line-height:1.2;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.uic-survey-block-subtitle{margin:0 0 .5rem;font-size:var(--uic-block-subtitle-font-size, 1.25rem);font-weight:500;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.uic-survey-block-message{margin-bottom:1rem;font-size:.875rem;line-height:1.5;color:var(--uic-block-message-color, var(--uic-neutral-500, var(--grey-500, #666)))}.uic-survey-hidden-fields{display:none}.uic-survey-footer{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.uic-survey-save-state{display:inline-flex;align-items:center;gap:.25rem;font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)));min-height:1em}.uic-survey-save-state .ri-loader-4-line{animation:uic-survey-spin 1s linear infinite}.uic-survey-next{margin-left:auto;display:flex;align-items:center;gap:.75rem}.uic-survey-hint{font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}@media (max-width: 479px){.uic-survey-hint{display:none}}@keyframes uic-survey-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
12758
|
+
}, template: "@let state = engineState();\n@let page = currentPage();\n\n@if (loading()) {\n <div class=\"uic-survey-loading\">\n <ui-skeleton-loader [cols]=\"1\" [inputs]=\"2\"></ui-skeleton-loader>\n </div>\n} @else {\n <!-- ENCABEZADO -->\n @if (page) {\n @if (headerTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.template; context: { $implicit: page, position: position(), total: total(), progress: progress() }\"></ng-container>\n } @else if (settings().showProgress) {\n <header class=\"uic-survey-header\">\n <div class=\"uic-survey-progress\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" [attr.aria-valuenow]=\"progress()\">\n <div class=\"uic-survey-progress-fill\" [style.width.%]=\"progress()\"></div>\n </div>\n <span class=\"uic-survey-progress-text\">\n {{ 'survey.progress' | uicTranslate: { current: position() + 1, total: total() } }}\n </span>\n </header>\n }\n }\n\n <!-- Anuncios para lectores de pantalla (cambio de p\u00E1gina, errores) -->\n <div class=\"uic-survey-sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</div>\n\n <!-- P\u00C1GINAS: todas montadas (as\u00ED las reglas de visibilidad y los campos ocultos se mantienen al d\u00EDa) -->\n <div class=\"uic-survey-pages\">\n @for (p of pages(); track p.key) {\n @let active = p.key === activeKey();\n <section\n class=\"uic-survey-page\"\n [class.is-active]=\"active\"\n [class.is-back]=\"direction() === 'back'\"\n [attr.aria-hidden]=\"active ? null : 'true'\"\n [attr.inert]=\"active ? null : ''\">\n\n @if (pageMode() === 'block') {\n @if (p.block.title) { <h2 class=\"uic-survey-block-title\">{{ p.block.title }}</h2> }\n @if (p.block.subtitle) { <h3 class=\"uic-survey-block-subtitle\">{{ p.block.subtitle }}</h3> }\n @if (p.block.message) { <div class=\"uic-survey-block-message\" [innerHTML]=\"p.block.message\"></div> }\n } @else {\n @if (p.block.title) { <div class=\"uic-survey-eyebrow\">{{ p.block.title }}</div> }\n @if (p.firstOfBlock && p.block.subtitle) { <h3 class=\"uic-survey-block-subtitle\">{{ p.block.subtitle }}</h3> }\n @if (p.firstOfBlock && p.block.message) { <div class=\"uic-survey-block-message\" [innerHTML]=\"p.block.message\"></div> }\n }\n\n <ui-dynamic-form\n #pageForm\n class=\"uic-survey-question\"\n [cols]=\"pageCols()\"\n [disabled]=\"disabled\"\n [iconMode]=\"iconMode()\"\n [fileUidResolverFn]=\"fileUidResolverFn()\"\n [fields]=\"p.fields\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [externalValidationStates]=\"state.externalValidationStates\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n (fieldBlur)=\"onFieldBlur($event)\">\n </ui-dynamic-form>\n </section>\n }\n\n @if (hiddenFields().length) {\n <ui-dynamic-form\n class=\"uic-survey-hidden-fields\"\n [fields]=\"hiddenFields()\"\n [contextFields]=\"state.allFields\"\n [form]=\"form\"\n [disabled]=\"disabled\"\n [externalValidationStates]=\"state.externalValidationStates\">\n </ui-dynamic-form>\n }\n </div>\n\n <!-- NAVEGACI\u00D3N -->\n @if (page) {\n @if (footerTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.template; context: {\n $implicit: page,\n next: next.bind(this),\n back: back.bind(this),\n canGoBack: canGoBack(),\n isLast: isLast(),\n canAdvance: canAdvance(),\n saveState: saveState()\n }\"></ng-container>\n } @else {\n <footer class=\"uic-survey-footer\">\n @if (settings().showBack && canGoBack()) {\n <ui-button class=\"uic-survey-back\" type=\"ghost\" color=\"black\" icon=\"ri-arrow-left-line\" (click)=\"back()\">\n {{ settings().texts.back | uicTranslate }}\n </ui-button>\n }\n\n <span class=\"uic-survey-save-state\" aria-live=\"polite\">\n @switch (saveState()) {\n @case ('saving') { <i class=\"ri-loader-4-line\" aria-hidden=\"true\"></i> {{ 'survey.saving' | uicTranslate }} }\n @case ('saved') { <i class=\"ri-check-line\" aria-hidden=\"true\"></i> {{ 'survey.saved' | uicTranslate }} }\n @case ('error') { <i class=\"ri-error-warning-line\" aria-hidden=\"true\"></i> {{ 'survey.save_error' | uicTranslate }} }\n }\n </span>\n\n <div class=\"uic-survey-next\">\n <!-- <span class=\"uic-survey-hint\">{{ 'survey.press_enter' | uicTranslate }}</span> -->\n <ui-button\n color=\"primary\"\n [rightIcon]=\"isLast() ? '' : 'ri-arrow-right-line'\"\n [disabled]=\"nextDisabled()\"\n (click)=\"nextDisabled() || next()\">\n {{ (isLast() ? settings().texts.submit : settings().texts.next) | uicTranslate }}\n </ui-button>\n </div>\n </footer>\n }\n }\n}\n", styles: [":host{--form-ref: 11px;--uic-label-font-size: var(--uic-survey-question-font-size, 1.25rem);--uic-label-font-weight: var(--uic-survey-question-font-weight, 500);--uic-label-color: var(--uic-survey-question-color, var(--uic-neutral-950, var(--grey-950)));--uic-label-line-height: calc(var(--uic-survey-question-font-size, 1.25rem) * 1.4);--uic-option-label-font-size: 1rem;--input-label-space: 12px;--uic-pool-gap: 10px;--uic-pool-option-padding: 12px 18px;--uic-pool-option-font-size: 1rem;--uic-pool-option-radius: var(--input-radius);--uic-pool-option-bg: var(--uic-surface, var(--white));--uic-pool-option-color: var(--uic-neutral-900, var(--grey-900));--uic-pool-option-border-color: var(--uic-neutral-300, var(--grey-300));--uic-pool-option-border-color-hover: var(--primary-400);--uic-pool-option-active-bg: var(--primary-100);--uic-pool-option-active-color: var(--primary-600);--uic-pool-option-active-border-color: var(--primary-600);display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:var(--uic-survey-max-width, 720px);min-height:var(--uic-survey-min-height, 320px);margin:0 auto;padding:var(--uic-survey-padding, 1.5rem);background:var(--uic-survey-bg, transparent);box-sizing:border-box;font-family:var(--uic-font-family, inherit)}@media (max-width: 479px){:host{padding:var(--uic-survey-padding, 1rem)}}:host ::ng-deep :is(input,textarea,button){font-family:inherit}:host ::ng-deep :is(input,textarea){color:var(--uic-input-text-color, inherit)}:host ::ng-deep :is(input,textarea)::placeholder{color:var(--uic-input-placeholder-color, var(--uic-neutral-400, var(--grey-400)))}.uic-survey-header{display:flex;align-items:center;gap:.75rem}.uic-survey-progress{flex:1 1 auto;height:var(--uic-survey-progress-height, 6px);border-radius:calc(var(--uic-survey-progress-height, 6px) / 2);background:var(--uic-survey-progress-track, var(--primary-100));overflow:hidden}.uic-survey-progress-fill{height:100%;border-radius:inherit;background:var(--uic-survey-progress-color, var(--primary-600));transition:width var(--uic-survey-transition-duration, .32s) var(--uic-survey-transition-easing, cubic-bezier(.22, .61, .36, 1))}.uic-survey-progress-text{flex:0 0 auto;font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)));font-variant-numeric:tabular-nums}.uic-survey-pages{flex:1 1 auto;position:relative;display:flex;flex-direction:column}.uic-survey-page.is-active{flex:1 1 auto}:host([data-page-mode=field]) .uic-survey-page.is-active{display:flex;flex-direction:column;justify-content:var(--uic-survey-page-justify, center)}.uic-survey-page{display:none}.uic-survey-page.is-active{display:block;animation:uic-survey-enter-forward var(--uic-survey-transition-duration, .32s) var(--uic-survey-transition-easing, cubic-bezier(.22, .61, .36, 1)) both}.uic-survey-page.is-active.is-back{animation-name:uic-survey-enter-back}:host([data-animation=fade]) .uic-survey-page.is-active{animation-name:uic-survey-fade}:host([data-animation=none]) .uic-survey-page.is-active{animation:none}@media (prefers-reduced-motion: reduce){.uic-survey-page.is-active{animation-name:uic-survey-fade}.uic-survey-progress-fill{transition:none}}@keyframes uic-survey-enter-forward{0%{opacity:0;transform:translateY(var(--uic-survey-transition-distance, 32px))}to{opacity:1;transform:none}}@keyframes uic-survey-enter-back{0%{opacity:0;transform:translateY(calc(-1 * var(--uic-survey-transition-distance, 32px)))}to{opacity:1;transform:none}}@keyframes uic-survey-fade{0%{opacity:0}to{opacity:1}}.uic-survey-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.uic-survey-eyebrow{margin-bottom:.5rem;font-size:.75rem;font-weight:600;letter-spacing:var(--uic-survey-eyebrow-letter-spacing, .06em);text-transform:var(--uic-survey-eyebrow-transform, uppercase);color:var(--uic-survey-eyebrow-color, var(--primary-600))}.uic-survey-block-title{margin:0 0 .5rem;font-size:var(--uic-block-title-font-size, 1.625rem);font-weight:600;line-height:1.2;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.uic-survey-block-subtitle{margin:0 0 .5rem;font-size:var(--uic-block-subtitle-font-size, 1.25rem);font-weight:500;color:var(--uic-block-title-color, var(--uic-neutral-950, var(--grey-950)))}.uic-survey-block-message{margin-bottom:1rem;font-size:.875rem;line-height:1.5;color:var(--uic-block-message-color, var(--uic-neutral-500, var(--grey-500, #666)))}.uic-survey-hidden-fields{display:none}.uic-survey-footer{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.uic-survey-save-state{display:inline-flex;align-items:center;gap:.25rem;font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)));min-height:1em}.uic-survey-save-state .ri-loader-4-line{animation:uic-survey-spin 1s linear infinite}.uic-survey-next{margin-left:auto;display:flex;align-items:center;gap:.75rem}.uic-survey-hint{font-size:.75rem;color:var(--uic-tip-color, var(--uic-neutral-500, var(--grey-500)))}@media (max-width: 479px){.uic-survey-hint{display:none}}@keyframes uic-survey-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
12314
12759
|
}], ctorParameters: () => [], propDecorators: { schema: [{
|
|
12315
12760
|
type: Input,
|
|
12316
12761
|
args: [{ required: true }]
|
|
@@ -12330,6 +12775,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
12330
12775
|
type: Output
|
|
12331
12776
|
}], pageChange: [{
|
|
12332
12777
|
type: Output
|
|
12778
|
+
}], backFromStart: [{
|
|
12779
|
+
type: Output
|
|
12333
12780
|
}], fieldSave: [{
|
|
12334
12781
|
type: Output
|
|
12335
12782
|
}], formChange: [{
|
|
@@ -12383,11 +12830,11 @@ class FormPreviewComponent {
|
|
|
12383
12830
|
this.surveyRun++;
|
|
12384
12831
|
}
|
|
12385
12832
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormPreviewComponent, deps: [{ token: MODAL_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
12386
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FormPreviewComponent, isStandalone: true, selector: "lib-form-preview", viewQueries: [{ propertyName: "formWrapper", first: true, predicate: ["formWrapper"], descendants: true }, { propertyName: "survey", first: true, predicate: ["survey"], descendants: true }], ngImport: i0, template: "@if (previewMode === 'survey') {\n @if (surveyResult) {\n <div class=\"form-preview-done\">\n <i class=\"ri-checkbox-circle-line\" aria-hidden=\"true\"></i>\n <p>{{ 'form_builder.preview_survey_done' | uicTranslate }}</p>\n <pre>{{ surveyResult.form | json }}</pre>\n </div>\n } @else {\n @for (run of [surveyRun]; track run) {\n <ui-survey\n #survey\n [schema]=\"schema\"\n [pageMode]=\"surveyOptions.pageMode ?? 'field'\"\n [theme]=\"surveyOptions.theme ?? null\"\n [animation]=\"surveyOptions.animation ?? 'none'\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [computedFieldResolver]=\"computedFieldResolver\"\n [externalValidatorResolver]=\"externalValidatorResolver\"\n (surveySubmit)=\"onSurveySubmit($event)\">\n </ui-survey>\n }\n }\n <div class=\"form-preview-footer\">\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-restart-line\" [text]=\"'form_builder.preview_survey_restart' | uicTranslate\" (click)=\"restartSurvey()\"></ui-button>\n <ui-button color=\"black\" icon=\"ri-file-copy-line\" [text]=\"'form_builder.preview_copy_response' | uicTranslate\" (click)=\"copyResponseToClipboard()\"></ui-button>\n </div>\n} @else {\n <ui-form-wrapper\n #formWrapper\n [schema]=\"schema\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [computedFieldResolver]=\"computedFieldResolver\"\n [externalValidatorResolver]=\"externalValidatorResolver\">\n </ui-form-wrapper>\n <div class=\"form-preview-footer\">\n <ui-button color=\"black\" icon=\"ri-file-copy-line\" [text]=\"'form_builder.preview_copy_response' | uicTranslate\" (click)=\"copyResponseToClipboard()\"></ui-button>\n </div>\n}\n", styles: [".form-preview-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.form-preview-done{display:flex;flex-direction:column;align-items:center;gap:6px;padding:24px 0;text-align:center}.form-preview-done i{font-size:40px;color:var(--green-600)}.form-preview-done p{margin:0}.form-preview-done pre{max-width:100%;max-height:40vh;overflow:auto;text-align:left;font-size:12px;background:var(--uic-neutral-100, var(--grey-100));border-radius:8px;padding:8px 12px}\n"], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "computedFieldResolver", "externalValidatorResolver", "disabled", "fillSelects", "initialValues", "loading", "showButtons", "iconMode", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicSurveyComponent, selector: "ui-survey", inputs: ["schema", "initialValues", "externalData", "selectOptionsResolver", "computedFieldResolver", "externalValidatorResolver", "disabled", "pageMode", "animation", "showProgress", "showBack", "startAt", "autoAdvance", "autoFocus", "loading", "theme", "iconMode", "fileUidResolverFn", "nextText", "backText", "submitText", "autoSave", "saveFn", "autoSaveDebounceMs"], outputs: ["surveySubmit", "pageChange", "fieldSave", "formChange", "optionsSourceError"] }, { kind: "pipe", type: JsonPipe, name: "json" }] });
|
|
12833
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FormPreviewComponent, isStandalone: true, selector: "lib-form-preview", viewQueries: [{ propertyName: "formWrapper", first: true, predicate: ["formWrapper"], descendants: true }, { propertyName: "survey", first: true, predicate: ["survey"], descendants: true }], ngImport: i0, template: "@if (previewMode === 'survey') {\n @if (surveyResult) {\n <div class=\"form-preview-done\">\n <i class=\"ri-checkbox-circle-line\" aria-hidden=\"true\"></i>\n <p>{{ 'form_builder.preview_survey_done' | uicTranslate }}</p>\n <pre>{{ surveyResult.form | json }}</pre>\n </div>\n } @else {\n @for (run of [surveyRun]; track run) {\n <ui-survey\n #survey\n [schema]=\"schema\"\n [pageMode]=\"surveyOptions.pageMode ?? 'field'\"\n [theme]=\"surveyOptions.theme ?? null\"\n [animation]=\"surveyOptions.animation ?? 'none'\"\n [config]=\"surveyOptions.config ?? null\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [computedFieldResolver]=\"computedFieldResolver\"\n [externalValidatorResolver]=\"externalValidatorResolver\"\n (surveySubmit)=\"onSurveySubmit($event)\">\n </ui-survey>\n }\n }\n <div class=\"form-preview-footer\">\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-restart-line\" [text]=\"'form_builder.preview_survey_restart' | uicTranslate\" (click)=\"restartSurvey()\"></ui-button>\n <ui-button color=\"black\" icon=\"ri-file-copy-line\" [text]=\"'form_builder.preview_copy_response' | uicTranslate\" (click)=\"copyResponseToClipboard()\"></ui-button>\n </div>\n} @else {\n <ui-form-wrapper\n #formWrapper\n [schema]=\"schema\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [computedFieldResolver]=\"computedFieldResolver\"\n [externalValidatorResolver]=\"externalValidatorResolver\">\n </ui-form-wrapper>\n <div class=\"form-preview-footer\">\n <ui-button color=\"black\" icon=\"ri-file-copy-line\" [text]=\"'form_builder.preview_copy_response' | uicTranslate\" (click)=\"copyResponseToClipboard()\"></ui-button>\n </div>\n}\n", styles: [".form-preview-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.form-preview-done{display:flex;flex-direction:column;align-items:center;gap:6px;padding:24px 0;text-align:center}.form-preview-done i{font-size:40px;color:var(--green-600)}.form-preview-done p{margin:0}.form-preview-done pre{max-width:100%;max-height:40vh;overflow:auto;text-align:left;font-size:12px;background:var(--uic-neutral-100, var(--grey-100));border-radius:8px;padding:8px 12px}\n"], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "computedFieldResolver", "externalValidatorResolver", "disabled", "fillSelects", "initialValues", "loading", "showButtons", "iconMode", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicSurveyComponent, selector: "ui-survey", inputs: ["schema", "initialValues", "externalData", "selectOptionsResolver", "computedFieldResolver", "externalValidatorResolver", "disabled", "pageMode", "animation", "config", "showProgress", "showBack", "showBackOnFirstPage", "startAt", "autoAdvance", "autoFocus", "disableNextWhenInvalid", "loading", "theme", "iconMode", "fileUidResolverFn", "nextText", "backText", "submitText", "autoSave", "saveFn", "autoSaveDebounceMs"], outputs: ["surveySubmit", "pageChange", "backFromStart", "fieldSave", "formChange", "optionsSourceError"] }, { kind: "pipe", type: JsonPipe, name: "json" }] });
|
|
12387
12834
|
}
|
|
12388
12835
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormPreviewComponent, decorators: [{
|
|
12389
12836
|
type: Component,
|
|
12390
|
-
args: [{ selector: 'lib-form-preview', imports: [UicFormWrapperComponent, UicButtonComponent, UicTranslatePipe, UicSurveyComponent, JsonPipe], template: "@if (previewMode === 'survey') {\n @if (surveyResult) {\n <div class=\"form-preview-done\">\n <i class=\"ri-checkbox-circle-line\" aria-hidden=\"true\"></i>\n <p>{{ 'form_builder.preview_survey_done' | uicTranslate }}</p>\n <pre>{{ surveyResult.form | json }}</pre>\n </div>\n } @else {\n @for (run of [surveyRun]; track run) {\n <ui-survey\n #survey\n [schema]=\"schema\"\n [pageMode]=\"surveyOptions.pageMode ?? 'field'\"\n [theme]=\"surveyOptions.theme ?? null\"\n [animation]=\"surveyOptions.animation ?? 'none'\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [computedFieldResolver]=\"computedFieldResolver\"\n [externalValidatorResolver]=\"externalValidatorResolver\"\n (surveySubmit)=\"onSurveySubmit($event)\">\n </ui-survey>\n }\n }\n <div class=\"form-preview-footer\">\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-restart-line\" [text]=\"'form_builder.preview_survey_restart' | uicTranslate\" (click)=\"restartSurvey()\"></ui-button>\n <ui-button color=\"black\" icon=\"ri-file-copy-line\" [text]=\"'form_builder.preview_copy_response' | uicTranslate\" (click)=\"copyResponseToClipboard()\"></ui-button>\n </div>\n} @else {\n <ui-form-wrapper\n #formWrapper\n [schema]=\"schema\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [computedFieldResolver]=\"computedFieldResolver\"\n [externalValidatorResolver]=\"externalValidatorResolver\">\n </ui-form-wrapper>\n <div class=\"form-preview-footer\">\n <ui-button color=\"black\" icon=\"ri-file-copy-line\" [text]=\"'form_builder.preview_copy_response' | uicTranslate\" (click)=\"copyResponseToClipboard()\"></ui-button>\n </div>\n}\n", styles: [".form-preview-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.form-preview-done{display:flex;flex-direction:column;align-items:center;gap:6px;padding:24px 0;text-align:center}.form-preview-done i{font-size:40px;color:var(--green-600)}.form-preview-done p{margin:0}.form-preview-done pre{max-width:100%;max-height:40vh;overflow:auto;text-align:left;font-size:12px;background:var(--uic-neutral-100, var(--grey-100));border-radius:8px;padding:8px 12px}\n"] }]
|
|
12837
|
+
args: [{ selector: 'lib-form-preview', imports: [UicFormWrapperComponent, UicButtonComponent, UicTranslatePipe, UicSurveyComponent, JsonPipe], template: "@if (previewMode === 'survey') {\n @if (surveyResult) {\n <div class=\"form-preview-done\">\n <i class=\"ri-checkbox-circle-line\" aria-hidden=\"true\"></i>\n <p>{{ 'form_builder.preview_survey_done' | uicTranslate }}</p>\n <pre>{{ surveyResult.form | json }}</pre>\n </div>\n } @else {\n @for (run of [surveyRun]; track run) {\n <ui-survey\n #survey\n [schema]=\"schema\"\n [pageMode]=\"surveyOptions.pageMode ?? 'field'\"\n [theme]=\"surveyOptions.theme ?? null\"\n [animation]=\"surveyOptions.animation ?? 'none'\"\n [config]=\"surveyOptions.config ?? null\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [computedFieldResolver]=\"computedFieldResolver\"\n [externalValidatorResolver]=\"externalValidatorResolver\"\n (surveySubmit)=\"onSurveySubmit($event)\">\n </ui-survey>\n }\n }\n <div class=\"form-preview-footer\">\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-restart-line\" [text]=\"'form_builder.preview_survey_restart' | uicTranslate\" (click)=\"restartSurvey()\"></ui-button>\n <ui-button color=\"black\" icon=\"ri-file-copy-line\" [text]=\"'form_builder.preview_copy_response' | uicTranslate\" (click)=\"copyResponseToClipboard()\"></ui-button>\n </div>\n} @else {\n <ui-form-wrapper\n #formWrapper\n [schema]=\"schema\"\n [selectOptionsResolver]=\"selectOptionsResolver\"\n [computedFieldResolver]=\"computedFieldResolver\"\n [externalValidatorResolver]=\"externalValidatorResolver\">\n </ui-form-wrapper>\n <div class=\"form-preview-footer\">\n <ui-button color=\"black\" icon=\"ri-file-copy-line\" [text]=\"'form_builder.preview_copy_response' | uicTranslate\" (click)=\"copyResponseToClipboard()\"></ui-button>\n </div>\n}\n", styles: [".form-preview-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.form-preview-done{display:flex;flex-direction:column;align-items:center;gap:6px;padding:24px 0;text-align:center}.form-preview-done i{font-size:40px;color:var(--green-600)}.form-preview-done p{margin:0}.form-preview-done pre{max-width:100%;max-height:40vh;overflow:auto;text-align:left;font-size:12px;background:var(--uic-neutral-100, var(--grey-100));border-radius:8px;padding:8px 12px}\n"] }]
|
|
12391
12838
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
12392
12839
|
type: Inject,
|
|
12393
12840
|
args: [MODAL_DATA]
|
|
@@ -12458,11 +12905,11 @@ class UicOptionStyleEditorComponent {
|
|
|
12458
12905
|
};
|
|
12459
12906
|
}
|
|
12460
12907
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicOptionStyleEditorComponent, deps: [{ token: MODAL_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
12461
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicOptionStyleEditorComponent, isStandalone: true, selector: "ui-option-style-editor", ngImport: i0, template: "<p class=\"ose-hint\">\n {{ 'form_builder.options_editor.advanced_hint' | uicTranslate }}\n <a href=\"https://remixicon.com/\" target=\"_blank\" rel=\"noopener\">remixicon.com</a>\n</p>\n\n@if (options.length) {\n <div class=\"ose-list\">\n @for (option of options; track $index; let i = $index) {\n <div class=\"ose-row\">\n <div class=\"ose-preview\" [title]=\"option.text\">\n @if (option.icon) {\n <i class=\"{{ option.icon }} f-{{ option.iconColor || 'black' }}\" aria-hidden=\"true\"></i>\n }\n <span class=\"ose-preview-text\">{{ option.text || option.id || '\u2014' }}</span>\n </div>\n\n <div class=\"ose-icon\">\n <input\n type=\"text\"\n [attr.aria-label]=\"'form_builder.options_editor.icon_label' | uicTranslate\"\n [placeholder]=\"'ri-star-line'\"\n [ngModel]=\"option.icon ?? ''\"\n (ngModelChange)=\"setIcon(i, $event)\">\n <ui-button size=\"s\" type=\"ghost\" color=\"black\" icon=\"ri-apps-line\" [iconOnly]=\"true\"\n [attr.title]=\"'form_builder.options_editor.icon_suggestions' | uicTranslate\"\n (click)=\"toggleSuggestions(i)\"></ui-button>\n </div>\n\n <ui-select\n class=\"ose-color\"\n size=\"s\"\n [attr.aria-label]=\"'form_builder.options_editor.color_label' | uicTranslate\"\n [options]=\"colorOptions\"\n [nullable]=\"true\"\n noneText=\"form_builder.options_editor.no_color\"\n nonSelectedText=\"form_builder.options_editor.no_color\"\n [disabled]=\"!option.icon\"\n [ngModel]=\"option.iconColor ?? null\"\n (ngModelChange)=\"setColor(i, $event ?? undefined)\">\n </ui-select>\n\n <ui-button size=\"s\" type=\"ghost\" color=\"red\" icon=\"ri-eraser-line\" [iconOnly]=\"true\"\n [disabled]=\"!option.icon && !option.iconColor\"\n [attr.title]=\"'form_builder.options_editor.clear_style' | uicTranslate\"\n (click)=\"clear(i)\"></ui-button>\n\n @if (suggestionsFor === i) {\n <div class=\"ose-suggestions\">\n @for (icon of suggestions; track icon) {\n <button type=\"button\" class=\"ose-suggestion\" [class.is-selected]=\"option.icon === icon\" [title]=\"icon\" (click)=\"pickSuggestion(i, icon)\">\n <i class=\"{{ icon }}\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <p class=\"ose-empty\">{{ 'form_builder.options_editor.no_options' | uicTranslate }}</p>\n}\n\n<div class=\"ose-footer\">\n <ui-button color=\"black\" type=\"bordered\" (click)=\"cancel()\">{{ 'common.cancel' | uicTranslate }}</ui-button>\n <ui-button color=\"black\" icon=\"ri-check-line\" (click)=\"apply()\">{{ 'common.apply' | uicTranslate }}</ui-button>\n</div>\n", styles: [":host{display:block;min-width:min(560px,80vw)}.ose-hint{margin:0 0 .75rem;font-size:.75rem;color:var(--uic-neutral-600, var(--grey-600))}.ose-hint a{color:var(--primary-600)}.ose-list{display:flex;flex-direction:column;gap:.5rem;max-height:60vh;overflow:auto}.ose-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(150px,1.1fr) minmax(140px,.9fr) auto;align-items:center;gap:.75rem;padding:.5rem;border:1px solid var(--uic-neutral-200, var(--grey-200));border-radius:8px;background:var(--uic-surface, var(--white))}.ose-preview{display:flex;align-items:center;gap:.5rem;min-width:0;font-size:.875rem}.ose-preview i{font-size:1.25rem}.ose-preview-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ose-color{min-width:0}.ose-icon{display:flex;align-items:center;gap:2px}.ose-icon input{width:100%;min-width:0;padding:5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:5px;font-size:.75rem}.ose-icon input:focus{outline:none;border-color:var(--primary-500);box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.ose-suggestions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px;padding-top:.25rem}.ose-suggestion{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--uic-neutral-200, var(--grey-200));border-radius:6px;background:var(--uic-surface, var(--white));font-size:1.25rem;cursor:pointer}.ose-suggestion:hover,.ose-suggestion.is-selected{border-color:var(--primary-500);color:var(--primary-600)}.ose-empty{font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}.ose-footer{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "searcherEnabled", "loading", "nullable", "options"] }] });
|
|
12908
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicOptionStyleEditorComponent, isStandalone: true, selector: "ui-option-style-editor", ngImport: i0, template: "<p class=\"ose-hint\">\r\n {{ 'form_builder.options_editor.advanced_hint' | uicTranslate }}\r\n <a href=\"https://remixicon.com/\" target=\"_blank\" rel=\"noopener\">remixicon.com</a>\r\n</p>\r\n\r\n@if (options.length) {\r\n <div class=\"ose-list\">\r\n @for (option of options; track $index; let i = $index) {\r\n <div class=\"ose-row\">\r\n <div class=\"ose-preview\" [title]=\"option.text\">\r\n @if (option.icon) {\r\n <i class=\"{{ option.icon }} f-{{ option.iconColor || 'black' }}\" aria-hidden=\"true\"></i>\r\n }\r\n <span class=\"ose-preview-text\">{{ option.text || option.id || '\u2014' }}</span>\r\n </div>\r\n\r\n <div class=\"ose-icon\">\r\n <input\r\n type=\"text\"\r\n [attr.aria-label]=\"'form_builder.options_editor.icon_label' | uicTranslate\"\r\n [placeholder]=\"'ri-star-line'\"\r\n [ngModel]=\"option.icon ?? ''\"\r\n (ngModelChange)=\"setIcon(i, $event)\">\r\n <ui-button size=\"s\" type=\"ghost\" color=\"black\" icon=\"ri-apps-line\" [iconOnly]=\"true\"\r\n [attr.title]=\"'form_builder.options_editor.icon_suggestions' | uicTranslate\"\r\n (click)=\"toggleSuggestions(i)\"></ui-button>\r\n </div>\r\n\r\n <ui-select\r\n class=\"ose-color\"\r\n size=\"s\"\r\n [attr.aria-label]=\"'form_builder.options_editor.color_label' | uicTranslate\"\r\n [options]=\"colorOptions\"\r\n [nullable]=\"true\"\r\n noneText=\"form_builder.options_editor.no_color\"\r\n nonSelectedText=\"form_builder.options_editor.no_color\"\r\n [disabled]=\"!option.icon\"\r\n [ngModel]=\"option.iconColor ?? null\"\r\n (ngModelChange)=\"setColor(i, $event ?? undefined)\">\r\n </ui-select>\r\n\r\n <ui-button size=\"s\" type=\"ghost\" color=\"red\" icon=\"ri-eraser-line\" [iconOnly]=\"true\"\r\n [disabled]=\"!option.icon && !option.iconColor\"\r\n [attr.title]=\"'form_builder.options_editor.clear_style' | uicTranslate\"\r\n (click)=\"clear(i)\"></ui-button>\r\n\r\n @if (suggestionsFor === i) {\r\n <div class=\"ose-suggestions\">\r\n @for (icon of suggestions; track icon) {\r\n <button type=\"button\" class=\"ose-suggestion\" [class.is-selected]=\"option.icon === icon\" [title]=\"icon\" (click)=\"pickSuggestion(i, icon)\">\r\n <i class=\"{{ icon }}\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p class=\"ose-empty\">{{ 'form_builder.options_editor.no_options' | uicTranslate }}</p>\r\n}\r\n\r\n<div class=\"ose-footer\">\r\n <ui-button color=\"black\" type=\"bordered\" (click)=\"cancel()\">{{ 'common.cancel' | uicTranslate }}</ui-button>\r\n <ui-button color=\"black\" icon=\"ri-check-line\" (click)=\"apply()\">{{ 'common.apply' | uicTranslate }}</ui-button>\r\n</div>\r\n", styles: [":host{display:block;min-width:min(560px,80vw)}.ose-hint{margin:0 0 .75rem;font-size:.75rem;color:var(--uic-neutral-600, var(--grey-600))}.ose-hint a{color:var(--primary-600)}.ose-list{display:flex;flex-direction:column;gap:.5rem;max-height:60vh;overflow:auto}.ose-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(150px,1.1fr) minmax(140px,.9fr) auto;align-items:center;gap:.75rem;padding:.5rem;border:1px solid var(--uic-neutral-200, var(--grey-200));border-radius:8px;background:var(--uic-surface, var(--white))}.ose-preview{display:flex;align-items:center;gap:.5rem;min-width:0;font-size:.875rem}.ose-preview i{font-size:1.25rem}.ose-preview-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ose-color{min-width:0}.ose-icon{display:flex;align-items:center;gap:2px}.ose-icon input{width:100%;min-width:0;padding:5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:5px;font-size:.75rem}.ose-icon input:focus{outline:none;border-color:var(--primary-500);box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.ose-suggestions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px;padding-top:.25rem}.ose-suggestion{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--uic-neutral-200, var(--grey-200));border-radius:6px;background:var(--uic-surface, var(--white));font-size:1.25rem;cursor:pointer}.ose-suggestion:hover,.ose-suggestion.is-selected{border-color:var(--primary-500);color:var(--primary-600)}.ose-empty{font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}.ose-footer{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "searcherEnabled", "loading", "nullable", "options"] }] });
|
|
12462
12909
|
}
|
|
12463
12910
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicOptionStyleEditorComponent, decorators: [{
|
|
12464
12911
|
type: Component,
|
|
12465
|
-
args: [{ selector: 'ui-option-style-editor', imports: [FormsModule, UicButtonComponent, UicTranslatePipe, UicSelectComponent], template: "<p class=\"ose-hint\">\n {{ 'form_builder.options_editor.advanced_hint' | uicTranslate }}\n <a href=\"https://remixicon.com/\" target=\"_blank\" rel=\"noopener\">remixicon.com</a>\n</p>\n\n@if (options.length) {\n <div class=\"ose-list\">\n @for (option of options; track $index; let i = $index) {\n <div class=\"ose-row\">\n <div class=\"ose-preview\" [title]=\"option.text\">\n @if (option.icon) {\n <i class=\"{{ option.icon }} f-{{ option.iconColor || 'black' }}\" aria-hidden=\"true\"></i>\n }\n <span class=\"ose-preview-text\">{{ option.text || option.id || '\u2014' }}</span>\n </div>\n\n <div class=\"ose-icon\">\n <input\n type=\"text\"\n [attr.aria-label]=\"'form_builder.options_editor.icon_label' | uicTranslate\"\n [placeholder]=\"'ri-star-line'\"\n [ngModel]=\"option.icon ?? ''\"\n (ngModelChange)=\"setIcon(i, $event)\">\n <ui-button size=\"s\" type=\"ghost\" color=\"black\" icon=\"ri-apps-line\" [iconOnly]=\"true\"\n [attr.title]=\"'form_builder.options_editor.icon_suggestions' | uicTranslate\"\n (click)=\"toggleSuggestions(i)\"></ui-button>\n </div>\n\n <ui-select\n class=\"ose-color\"\n size=\"s\"\n [attr.aria-label]=\"'form_builder.options_editor.color_label' | uicTranslate\"\n [options]=\"colorOptions\"\n [nullable]=\"true\"\n noneText=\"form_builder.options_editor.no_color\"\n nonSelectedText=\"form_builder.options_editor.no_color\"\n [disabled]=\"!option.icon\"\n [ngModel]=\"option.iconColor ?? null\"\n (ngModelChange)=\"setColor(i, $event ?? undefined)\">\n </ui-select>\n\n <ui-button size=\"s\" type=\"ghost\" color=\"red\" icon=\"ri-eraser-line\" [iconOnly]=\"true\"\n [disabled]=\"!option.icon && !option.iconColor\"\n [attr.title]=\"'form_builder.options_editor.clear_style' | uicTranslate\"\n (click)=\"clear(i)\"></ui-button>\n\n @if (suggestionsFor === i) {\n <div class=\"ose-suggestions\">\n @for (icon of suggestions; track icon) {\n <button type=\"button\" class=\"ose-suggestion\" [class.is-selected]=\"option.icon === icon\" [title]=\"icon\" (click)=\"pickSuggestion(i, icon)\">\n <i class=\"{{ icon }}\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <p class=\"ose-empty\">{{ 'form_builder.options_editor.no_options' | uicTranslate }}</p>\n}\n\n<div class=\"ose-footer\">\n <ui-button color=\"black\" type=\"bordered\" (click)=\"cancel()\">{{ 'common.cancel' | uicTranslate }}</ui-button>\n <ui-button color=\"black\" icon=\"ri-check-line\" (click)=\"apply()\">{{ 'common.apply' | uicTranslate }}</ui-button>\n</div>\n", styles: [":host{display:block;min-width:min(560px,80vw)}.ose-hint{margin:0 0 .75rem;font-size:.75rem;color:var(--uic-neutral-600, var(--grey-600))}.ose-hint a{color:var(--primary-600)}.ose-list{display:flex;flex-direction:column;gap:.5rem;max-height:60vh;overflow:auto}.ose-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(150px,1.1fr) minmax(140px,.9fr) auto;align-items:center;gap:.75rem;padding:.5rem;border:1px solid var(--uic-neutral-200, var(--grey-200));border-radius:8px;background:var(--uic-surface, var(--white))}.ose-preview{display:flex;align-items:center;gap:.5rem;min-width:0;font-size:.875rem}.ose-preview i{font-size:1.25rem}.ose-preview-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ose-color{min-width:0}.ose-icon{display:flex;align-items:center;gap:2px}.ose-icon input{width:100%;min-width:0;padding:5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:5px;font-size:.75rem}.ose-icon input:focus{outline:none;border-color:var(--primary-500);box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.ose-suggestions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px;padding-top:.25rem}.ose-suggestion{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--uic-neutral-200, var(--grey-200));border-radius:6px;background:var(--uic-surface, var(--white));font-size:1.25rem;cursor:pointer}.ose-suggestion:hover,.ose-suggestion.is-selected{border-color:var(--primary-500);color:var(--primary-600)}.ose-empty{font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}.ose-footer{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
12912
|
+
args: [{ selector: 'ui-option-style-editor', imports: [FormsModule, UicButtonComponent, UicTranslatePipe, UicSelectComponent], template: "<p class=\"ose-hint\">\r\n {{ 'form_builder.options_editor.advanced_hint' | uicTranslate }}\r\n <a href=\"https://remixicon.com/\" target=\"_blank\" rel=\"noopener\">remixicon.com</a>\r\n</p>\r\n\r\n@if (options.length) {\r\n <div class=\"ose-list\">\r\n @for (option of options; track $index; let i = $index) {\r\n <div class=\"ose-row\">\r\n <div class=\"ose-preview\" [title]=\"option.text\">\r\n @if (option.icon) {\r\n <i class=\"{{ option.icon }} f-{{ option.iconColor || 'black' }}\" aria-hidden=\"true\"></i>\r\n }\r\n <span class=\"ose-preview-text\">{{ option.text || option.id || '\u2014' }}</span>\r\n </div>\r\n\r\n <div class=\"ose-icon\">\r\n <input\r\n type=\"text\"\r\n [attr.aria-label]=\"'form_builder.options_editor.icon_label' | uicTranslate\"\r\n [placeholder]=\"'ri-star-line'\"\r\n [ngModel]=\"option.icon ?? ''\"\r\n (ngModelChange)=\"setIcon(i, $event)\">\r\n <ui-button size=\"s\" type=\"ghost\" color=\"black\" icon=\"ri-apps-line\" [iconOnly]=\"true\"\r\n [attr.title]=\"'form_builder.options_editor.icon_suggestions' | uicTranslate\"\r\n (click)=\"toggleSuggestions(i)\"></ui-button>\r\n </div>\r\n\r\n <ui-select\r\n class=\"ose-color\"\r\n size=\"s\"\r\n [attr.aria-label]=\"'form_builder.options_editor.color_label' | uicTranslate\"\r\n [options]=\"colorOptions\"\r\n [nullable]=\"true\"\r\n noneText=\"form_builder.options_editor.no_color\"\r\n nonSelectedText=\"form_builder.options_editor.no_color\"\r\n [disabled]=\"!option.icon\"\r\n [ngModel]=\"option.iconColor ?? null\"\r\n (ngModelChange)=\"setColor(i, $event ?? undefined)\">\r\n </ui-select>\r\n\r\n <ui-button size=\"s\" type=\"ghost\" color=\"red\" icon=\"ri-eraser-line\" [iconOnly]=\"true\"\r\n [disabled]=\"!option.icon && !option.iconColor\"\r\n [attr.title]=\"'form_builder.options_editor.clear_style' | uicTranslate\"\r\n (click)=\"clear(i)\"></ui-button>\r\n\r\n @if (suggestionsFor === i) {\r\n <div class=\"ose-suggestions\">\r\n @for (icon of suggestions; track icon) {\r\n <button type=\"button\" class=\"ose-suggestion\" [class.is-selected]=\"option.icon === icon\" [title]=\"icon\" (click)=\"pickSuggestion(i, icon)\">\r\n <i class=\"{{ icon }}\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p class=\"ose-empty\">{{ 'form_builder.options_editor.no_options' | uicTranslate }}</p>\r\n}\r\n\r\n<div class=\"ose-footer\">\r\n <ui-button color=\"black\" type=\"bordered\" (click)=\"cancel()\">{{ 'common.cancel' | uicTranslate }}</ui-button>\r\n <ui-button color=\"black\" icon=\"ri-check-line\" (click)=\"apply()\">{{ 'common.apply' | uicTranslate }}</ui-button>\r\n</div>\r\n", styles: [":host{display:block;min-width:min(560px,80vw)}.ose-hint{margin:0 0 .75rem;font-size:.75rem;color:var(--uic-neutral-600, var(--grey-600))}.ose-hint a{color:var(--primary-600)}.ose-list{display:flex;flex-direction:column;gap:.5rem;max-height:60vh;overflow:auto}.ose-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(150px,1.1fr) minmax(140px,.9fr) auto;align-items:center;gap:.75rem;padding:.5rem;border:1px solid var(--uic-neutral-200, var(--grey-200));border-radius:8px;background:var(--uic-surface, var(--white))}.ose-preview{display:flex;align-items:center;gap:.5rem;min-width:0;font-size:.875rem}.ose-preview i{font-size:1.25rem}.ose-preview-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ose-color{min-width:0}.ose-icon{display:flex;align-items:center;gap:2px}.ose-icon input{width:100%;min-width:0;padding:5px;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:5px;font-size:.75rem}.ose-icon input:focus{outline:none;border-color:var(--primary-500);box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.ose-suggestions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px;padding-top:.25rem}.ose-suggestion{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--uic-neutral-200, var(--grey-200));border-radius:6px;background:var(--uic-surface, var(--white));font-size:1.25rem;cursor:pointer}.ose-suggestion:hover,.ose-suggestion.is-selected{border-color:var(--primary-500);color:var(--primary-600)}.ose-empty{font-size:.875rem;color:var(--uic-neutral-500, var(--grey-500))}.ose-footer{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
12466
12913
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
12467
12914
|
type: Inject,
|
|
12468
12915
|
args: [MODAL_DATA]
|
|
@@ -12577,11 +13024,11 @@ class UicFieldOptionsEditorComponent {
|
|
|
12577
13024
|
});
|
|
12578
13025
|
}
|
|
12579
13026
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFieldOptionsEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12580
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFieldOptionsEditorComponent, isStandalone: true, selector: "ui-field-options-editor", inputs: { title: "title", codeLabel: "codeLabel", nameLabel: "nameLabel", codePlaceholder: "codePlaceholder", namePlaceholder: "namePlaceholder", showAdvanced: "showAdvanced", autoCode: "autoCode", disabled: "disabled", options: "options" }, outputs: { optionsChange: "optionsChange" }, viewQueries: [{ propertyName: "nameInputs", predicate: ["nameInput"], descendants: true }], ngImport: i0, template: "<ui-input-wrapper [label]=\"title | uicTranslate\">\n <div class=\"optbody\">\n @if (options.length) {\n <div class=\"option-row option-head\">\n <span class=\"option-handle-spacer\" aria-hidden=\"true\"></span>\n <div class=\"option-code-col\">{{codeLabel | uicTranslate}}</div>\n <div class=\"option-name-col\">{{nameLabel | uicTranslate}}</div>\n <span class=\"option-delete-spacer\" aria-hidden=\"true\"></span>\n </div>\n }\n <div class=\"option-list\" cdkDropList cdkDropListLockAxis=\"y\" [cdkDropListDisabled]=\"disabled\" (cdkDropListDropped)=\"reorder($event)\">\n @for (item of options; track $index) {\n <div class=\"option-row\" cdkDrag [cdkDragDisabled]=\"disabled\">\n @if (!disabled) {\n <i class=\"ri-draggable option-handle\" cdkDragHandle aria-hidden=\"true\"></i>\n }\n <input\n class=\"option-code\"\n type=\"text\"\n [attr.aria-label]=\"codeLabel | uicTranslate\"\n [placeholder]=\"codePlaceholder | uicTranslate\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"item.id\"\n (ngModelChange)=\"emitChange()\">\n <div class=\"option-name\">\n @if (item.icon) {\n <i class=\"option-icon {{item.icon}} f-{{item.iconColor || 'black'}}\" aria-hidden=\"true\"></i>\n }\n <input\n #nameInput\n type=\"text\"\n [attr.aria-label]=\"nameLabel | uicTranslate\"\n [placeholder]=\"namePlaceholder | uicTranslate\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"item.text\"\n (ngModelChange)=\"emitChange()\"\n (blur)=\"updateCode(item.text, $index)\"\n (keydown.enter)=\"onEnter($event, $index)\"\n (paste)=\"onPaste($event, $index)\">\n </div>\n @if (!disabled) {\n <ui-button (click)=\"dropOption($index)\" size=\"s\" type=\"ghost\" icon=\"ri-delete-bin-line\" [iconOnly]=\"true\" color=\"red\"\n [attr.aria-label]=\"'form_builder.options_editor.remove_option' | uicTranslate\"></ui-button>\n }\n </div>\n }\n </div>\n @if (disabled) {\n @if (!options.length) {\n <p class=\"option-hint\">{{'form_builder.options_editor.no_options_read_only' | uicTranslate}}</p>\n }\n } @else {\n @if (options.length) {\n <p class=\"option-hint\">{{'form_builder.options_editor.keyboard_hint' | uicTranslate}}</p>\n }\n <div class=\"option-actions\">\n <ui-button (click)=\"addOption()\" color=\"black\" type=\"bordered\" icon=\"ri-add-line\" size=\"s\">{{'form_builder.options_editor.add_option' | uicTranslate}}</ui-button>\n @if (showAdvanced) {\n <ui-button (click)=\"openAdvanced()\" [disabled]=\"!options.length\" color=\"black\" [type]=\"hasStyledOptions ? 'filled' : 'ghost'\" icon=\"ri-palette-line\" size=\"s\">{{'form_builder.options_editor.advanced' | uicTranslate}}</ui-button>\n }\n </div>\n }\n </div>\n</ui-input-wrapper>\n", styles: [".optbody{padding:10px;background-color:var(--uic-neutral-100, var(--grey-100));display:block;border-radius:10px;border:solid 1px var(--uic-neutral-200, var(--grey-200))}.option-row{display:flex;align-items:center;gap:4px;margin-bottom:6px}.option-row input{padding:5px;border:solid 1px var(--uic-neutral-50, var(--grey-50));border-radius:5px;min-width:0}.option-row input:focus{border-color:var(--primary-500);outline:none}.option-row .option-code{flex:0 0 32%;font-size:12px;color:var(--uic-neutral-600, var(--grey-600))}.option-row>.option-name{flex:1 1;min-width:0;position:relative}.option-row>.option-name input{width:100%}.option-row>.option-name:has(.option-icon) input{padding-left:24px}.option-head{font-size:12px;font-weight:500;color:var(--uic-neutral-500, var(--grey-500));margin-bottom:4px}.option-head .option-code-col{flex:0 0 32%}.option-head .option-name-col{flex:1 1}.option-handle,.option-handle-spacer{flex:0 0 14px;width:14px}.option-handle{cursor:grab;color:var(--uic-neutral-400, var(--grey-400))}.option-handle:active{cursor:grabbing}.option-delete-spacer{flex:0 0 28px}.option-list.cdk-drop-list-dragging .option-row:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.option-row.cdk-drag-placeholder{opacity:.3}.option-row.cdk-drag-preview{background-color:var(--uic-neutral-100, var(--grey-100));border-radius:5px;box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.option-hint{font-size:11px;color:var(--uic-neutral-400, var(--grey-400));margin:2px 0 8px}.option-icon{position:absolute;left:6px;top:6px;font-size:14px;line-height:1;pointer-events:none}.option-actions{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }] });
|
|
13027
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFieldOptionsEditorComponent, isStandalone: true, selector: "ui-field-options-editor", inputs: { title: "title", codeLabel: "codeLabel", nameLabel: "nameLabel", codePlaceholder: "codePlaceholder", namePlaceholder: "namePlaceholder", showAdvanced: "showAdvanced", autoCode: "autoCode", disabled: "disabled", options: "options" }, outputs: { optionsChange: "optionsChange" }, viewQueries: [{ propertyName: "nameInputs", predicate: ["nameInput"], descendants: true }], ngImport: i0, template: "<ui-input-wrapper [label]=\"title | uicTranslate\">\r\n <div class=\"optbody\">\r\n @if (options.length) {\r\n <div class=\"option-row option-head\">\r\n <span class=\"option-handle-spacer\" aria-hidden=\"true\"></span>\r\n <div class=\"option-code-col\">{{codeLabel | uicTranslate}}</div>\r\n <div class=\"option-name-col\">{{nameLabel | uicTranslate}}</div>\r\n <span class=\"option-delete-spacer\" aria-hidden=\"true\"></span>\r\n </div>\r\n }\r\n <div class=\"option-list\" cdkDropList cdkDropListLockAxis=\"y\" [cdkDropListDisabled]=\"disabled\" (cdkDropListDropped)=\"reorder($event)\">\r\n @for (item of options; track $index) {\r\n <div class=\"option-row\" cdkDrag [cdkDragDisabled]=\"disabled\">\r\n @if (!disabled) {\r\n <i class=\"ri-draggable option-handle\" cdkDragHandle aria-hidden=\"true\"></i>\r\n }\r\n <input\r\n class=\"option-code\"\r\n type=\"text\"\r\n [attr.aria-label]=\"codeLabel | uicTranslate\"\r\n [placeholder]=\"codePlaceholder | uicTranslate\"\r\n [disabled]=\"disabled\"\r\n [(ngModel)]=\"item.id\"\r\n (ngModelChange)=\"emitChange()\">\r\n <div class=\"option-name\">\r\n @if (item.icon) {\r\n <i class=\"option-icon {{item.icon}} f-{{item.iconColor || 'black'}}\" aria-hidden=\"true\"></i>\r\n }\r\n <input\r\n #nameInput\r\n type=\"text\"\r\n [attr.aria-label]=\"nameLabel | uicTranslate\"\r\n [placeholder]=\"namePlaceholder | uicTranslate\"\r\n [disabled]=\"disabled\"\r\n [(ngModel)]=\"item.text\"\r\n (ngModelChange)=\"emitChange()\"\r\n (blur)=\"updateCode(item.text, $index)\"\r\n (keydown.enter)=\"onEnter($event, $index)\"\r\n (paste)=\"onPaste($event, $index)\">\r\n </div>\r\n @if (!disabled) {\r\n <ui-button (click)=\"dropOption($index)\" size=\"s\" type=\"ghost\" icon=\"ri-delete-bin-line\" [iconOnly]=\"true\" color=\"red\"\r\n [attr.aria-label]=\"'form_builder.options_editor.remove_option' | uicTranslate\"></ui-button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n @if (disabled) {\r\n @if (!options.length) {\r\n <p class=\"option-hint\">{{'form_builder.options_editor.no_options_read_only' | uicTranslate}}</p>\r\n }\r\n } @else {\r\n @if (options.length) {\r\n <p class=\"option-hint\">{{'form_builder.options_editor.keyboard_hint' | uicTranslate}}</p>\r\n }\r\n <div class=\"option-actions\">\r\n <ui-button (click)=\"addOption()\" color=\"black\" type=\"bordered\" icon=\"ri-add-line\" size=\"s\">{{'form_builder.options_editor.add_option' | uicTranslate}}</ui-button>\r\n @if (showAdvanced) {\r\n <ui-button (click)=\"openAdvanced()\" [disabled]=\"!options.length\" color=\"black\" [type]=\"hasStyledOptions ? 'filled' : 'ghost'\" icon=\"ri-palette-line\" size=\"s\">{{'form_builder.options_editor.advanced' | uicTranslate}}</ui-button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [".optbody{padding:10px;background-color:var(--uic-neutral-100, var(--grey-100));display:block;border-radius:10px;border:solid 1px var(--uic-neutral-200, var(--grey-200))}.option-row{display:flex;align-items:center;gap:4px;margin-bottom:6px}.option-row input{padding:5px;border:solid 1px var(--uic-neutral-50, var(--grey-50));border-radius:5px;min-width:0}.option-row input:focus{border-color:var(--primary-500);outline:none}.option-row .option-code{flex:0 0 32%;font-size:12px;color:var(--uic-neutral-600, var(--grey-600))}.option-row>.option-name{flex:1 1;min-width:0;position:relative}.option-row>.option-name input{width:100%}.option-row>.option-name:has(.option-icon) input{padding-left:24px}.option-head{font-size:12px;font-weight:500;color:var(--uic-neutral-500, var(--grey-500));margin-bottom:4px}.option-head .option-code-col{flex:0 0 32%}.option-head .option-name-col{flex:1 1}.option-handle,.option-handle-spacer{flex:0 0 14px;width:14px}.option-handle{cursor:grab;color:var(--uic-neutral-400, var(--grey-400))}.option-handle:active{cursor:grabbing}.option-delete-spacer{flex:0 0 28px}.option-list.cdk-drop-list-dragging .option-row:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.option-row.cdk-drag-placeholder{opacity:.3}.option-row.cdk-drag-preview{background-color:var(--uic-neutral-100, var(--grey-100));border-radius:5px;box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.option-hint{font-size:11px;color:var(--uic-neutral-400, var(--grey-400));margin:2px 0 8px}.option-icon{position:absolute;left:6px;top:6px;font-size:14px;line-height:1;pointer-events:none}.option-actions{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }] });
|
|
12581
13028
|
}
|
|
12582
13029
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFieldOptionsEditorComponent, decorators: [{
|
|
12583
13030
|
type: Component,
|
|
12584
|
-
args: [{ selector: 'ui-field-options-editor', imports: [FormsModule, UicButtonComponent, InputWrapperComponent, UicTranslatePipe, DragDropModule], template: "<ui-input-wrapper [label]=\"title | uicTranslate\">\n <div class=\"optbody\">\n @if (options.length) {\n <div class=\"option-row option-head\">\n <span class=\"option-handle-spacer\" aria-hidden=\"true\"></span>\n <div class=\"option-code-col\">{{codeLabel | uicTranslate}}</div>\n <div class=\"option-name-col\">{{nameLabel | uicTranslate}}</div>\n <span class=\"option-delete-spacer\" aria-hidden=\"true\"></span>\n </div>\n }\n <div class=\"option-list\" cdkDropList cdkDropListLockAxis=\"y\" [cdkDropListDisabled]=\"disabled\" (cdkDropListDropped)=\"reorder($event)\">\n @for (item of options; track $index) {\n <div class=\"option-row\" cdkDrag [cdkDragDisabled]=\"disabled\">\n @if (!disabled) {\n <i class=\"ri-draggable option-handle\" cdkDragHandle aria-hidden=\"true\"></i>\n }\n <input\n class=\"option-code\"\n type=\"text\"\n [attr.aria-label]=\"codeLabel | uicTranslate\"\n [placeholder]=\"codePlaceholder | uicTranslate\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"item.id\"\n (ngModelChange)=\"emitChange()\">\n <div class=\"option-name\">\n @if (item.icon) {\n <i class=\"option-icon {{item.icon}} f-{{item.iconColor || 'black'}}\" aria-hidden=\"true\"></i>\n }\n <input\n #nameInput\n type=\"text\"\n [attr.aria-label]=\"nameLabel | uicTranslate\"\n [placeholder]=\"namePlaceholder | uicTranslate\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"item.text\"\n (ngModelChange)=\"emitChange()\"\n (blur)=\"updateCode(item.text, $index)\"\n (keydown.enter)=\"onEnter($event, $index)\"\n (paste)=\"onPaste($event, $index)\">\n </div>\n @if (!disabled) {\n <ui-button (click)=\"dropOption($index)\" size=\"s\" type=\"ghost\" icon=\"ri-delete-bin-line\" [iconOnly]=\"true\" color=\"red\"\n [attr.aria-label]=\"'form_builder.options_editor.remove_option' | uicTranslate\"></ui-button>\n }\n </div>\n }\n </div>\n @if (disabled) {\n @if (!options.length) {\n <p class=\"option-hint\">{{'form_builder.options_editor.no_options_read_only' | uicTranslate}}</p>\n }\n } @else {\n @if (options.length) {\n <p class=\"option-hint\">{{'form_builder.options_editor.keyboard_hint' | uicTranslate}}</p>\n }\n <div class=\"option-actions\">\n <ui-button (click)=\"addOption()\" color=\"black\" type=\"bordered\" icon=\"ri-add-line\" size=\"s\">{{'form_builder.options_editor.add_option' | uicTranslate}}</ui-button>\n @if (showAdvanced) {\n <ui-button (click)=\"openAdvanced()\" [disabled]=\"!options.length\" color=\"black\" [type]=\"hasStyledOptions ? 'filled' : 'ghost'\" icon=\"ri-palette-line\" size=\"s\">{{'form_builder.options_editor.advanced' | uicTranslate}}</ui-button>\n }\n </div>\n }\n </div>\n</ui-input-wrapper>\n", styles: [".optbody{padding:10px;background-color:var(--uic-neutral-100, var(--grey-100));display:block;border-radius:10px;border:solid 1px var(--uic-neutral-200, var(--grey-200))}.option-row{display:flex;align-items:center;gap:4px;margin-bottom:6px}.option-row input{padding:5px;border:solid 1px var(--uic-neutral-50, var(--grey-50));border-radius:5px;min-width:0}.option-row input:focus{border-color:var(--primary-500);outline:none}.option-row .option-code{flex:0 0 32%;font-size:12px;color:var(--uic-neutral-600, var(--grey-600))}.option-row>.option-name{flex:1 1;min-width:0;position:relative}.option-row>.option-name input{width:100%}.option-row>.option-name:has(.option-icon) input{padding-left:24px}.option-head{font-size:12px;font-weight:500;color:var(--uic-neutral-500, var(--grey-500));margin-bottom:4px}.option-head .option-code-col{flex:0 0 32%}.option-head .option-name-col{flex:1 1}.option-handle,.option-handle-spacer{flex:0 0 14px;width:14px}.option-handle{cursor:grab;color:var(--uic-neutral-400, var(--grey-400))}.option-handle:active{cursor:grabbing}.option-delete-spacer{flex:0 0 28px}.option-list.cdk-drop-list-dragging .option-row:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.option-row.cdk-drag-placeholder{opacity:.3}.option-row.cdk-drag-preview{background-color:var(--uic-neutral-100, var(--grey-100));border-radius:5px;box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.option-hint{font-size:11px;color:var(--uic-neutral-400, var(--grey-400));margin:2px 0 8px}.option-icon{position:absolute;left:6px;top:6px;font-size:14px;line-height:1;pointer-events:none}.option-actions{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
13031
|
+
args: [{ selector: 'ui-field-options-editor', imports: [FormsModule, UicButtonComponent, InputWrapperComponent, UicTranslatePipe, DragDropModule], template: "<ui-input-wrapper [label]=\"title | uicTranslate\">\r\n <div class=\"optbody\">\r\n @if (options.length) {\r\n <div class=\"option-row option-head\">\r\n <span class=\"option-handle-spacer\" aria-hidden=\"true\"></span>\r\n <div class=\"option-code-col\">{{codeLabel | uicTranslate}}</div>\r\n <div class=\"option-name-col\">{{nameLabel | uicTranslate}}</div>\r\n <span class=\"option-delete-spacer\" aria-hidden=\"true\"></span>\r\n </div>\r\n }\r\n <div class=\"option-list\" cdkDropList cdkDropListLockAxis=\"y\" [cdkDropListDisabled]=\"disabled\" (cdkDropListDropped)=\"reorder($event)\">\r\n @for (item of options; track $index) {\r\n <div class=\"option-row\" cdkDrag [cdkDragDisabled]=\"disabled\">\r\n @if (!disabled) {\r\n <i class=\"ri-draggable option-handle\" cdkDragHandle aria-hidden=\"true\"></i>\r\n }\r\n <input\r\n class=\"option-code\"\r\n type=\"text\"\r\n [attr.aria-label]=\"codeLabel | uicTranslate\"\r\n [placeholder]=\"codePlaceholder | uicTranslate\"\r\n [disabled]=\"disabled\"\r\n [(ngModel)]=\"item.id\"\r\n (ngModelChange)=\"emitChange()\">\r\n <div class=\"option-name\">\r\n @if (item.icon) {\r\n <i class=\"option-icon {{item.icon}} f-{{item.iconColor || 'black'}}\" aria-hidden=\"true\"></i>\r\n }\r\n <input\r\n #nameInput\r\n type=\"text\"\r\n [attr.aria-label]=\"nameLabel | uicTranslate\"\r\n [placeholder]=\"namePlaceholder | uicTranslate\"\r\n [disabled]=\"disabled\"\r\n [(ngModel)]=\"item.text\"\r\n (ngModelChange)=\"emitChange()\"\r\n (blur)=\"updateCode(item.text, $index)\"\r\n (keydown.enter)=\"onEnter($event, $index)\"\r\n (paste)=\"onPaste($event, $index)\">\r\n </div>\r\n @if (!disabled) {\r\n <ui-button (click)=\"dropOption($index)\" size=\"s\" type=\"ghost\" icon=\"ri-delete-bin-line\" [iconOnly]=\"true\" color=\"red\"\r\n [attr.aria-label]=\"'form_builder.options_editor.remove_option' | uicTranslate\"></ui-button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n @if (disabled) {\r\n @if (!options.length) {\r\n <p class=\"option-hint\">{{'form_builder.options_editor.no_options_read_only' | uicTranslate}}</p>\r\n }\r\n } @else {\r\n @if (options.length) {\r\n <p class=\"option-hint\">{{'form_builder.options_editor.keyboard_hint' | uicTranslate}}</p>\r\n }\r\n <div class=\"option-actions\">\r\n <ui-button (click)=\"addOption()\" color=\"black\" type=\"bordered\" icon=\"ri-add-line\" size=\"s\">{{'form_builder.options_editor.add_option' | uicTranslate}}</ui-button>\r\n @if (showAdvanced) {\r\n <ui-button (click)=\"openAdvanced()\" [disabled]=\"!options.length\" color=\"black\" [type]=\"hasStyledOptions ? 'filled' : 'ghost'\" icon=\"ri-palette-line\" size=\"s\">{{'form_builder.options_editor.advanced' | uicTranslate}}</ui-button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [".optbody{padding:10px;background-color:var(--uic-neutral-100, var(--grey-100));display:block;border-radius:10px;border:solid 1px var(--uic-neutral-200, var(--grey-200))}.option-row{display:flex;align-items:center;gap:4px;margin-bottom:6px}.option-row input{padding:5px;border:solid 1px var(--uic-neutral-50, var(--grey-50));border-radius:5px;min-width:0}.option-row input:focus{border-color:var(--primary-500);outline:none}.option-row .option-code{flex:0 0 32%;font-size:12px;color:var(--uic-neutral-600, var(--grey-600))}.option-row>.option-name{flex:1 1;min-width:0;position:relative}.option-row>.option-name input{width:100%}.option-row>.option-name:has(.option-icon) input{padding-left:24px}.option-head{font-size:12px;font-weight:500;color:var(--uic-neutral-500, var(--grey-500));margin-bottom:4px}.option-head .option-code-col{flex:0 0 32%}.option-head .option-name-col{flex:1 1}.option-handle,.option-handle-spacer{flex:0 0 14px;width:14px}.option-handle{cursor:grab;color:var(--uic-neutral-400, var(--grey-400))}.option-handle:active{cursor:grabbing}.option-delete-spacer{flex:0 0 28px}.option-list.cdk-drop-list-dragging .option-row:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.option-row.cdk-drag-placeholder{opacity:.3}.option-row.cdk-drag-preview{background-color:var(--uic-neutral-100, var(--grey-100));border-radius:5px;box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.option-hint{font-size:11px;color:var(--uic-neutral-400, var(--grey-400));margin:2px 0 8px}.option-icon{position:absolute;left:6px;top:6px;font-size:14px;line-height:1;pointer-events:none}.option-actions{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap}.f-primary{color:var(--primary-500)}.f-secondary{color:var(--secondary-500)}.f-red{color:var(--red-500)}.f-yellow{color:var(--yellow-500)}.f-blue{color:var(--blue-500)}.f-green{color:var(--green-500)}.f-grey{color:var(--uic-neutral-400, var(--grey-400))}.f-black{color:var(--uic-neutral-900, var(--grey-900))}.f-dark-green{color:var(--dark-green-500)}.f-light-blue{color:var(--light-blue-500)}.f-pink{color:var(--pink-500)}.f-dark-red{color:var(--dark-red-500)}.f-orange{color:var(--orange-500)}.f-teal{color:var(--teal-500)}\n"] }]
|
|
12585
13032
|
}], propDecorators: { optionsChange: [{
|
|
12586
13033
|
type: Output
|
|
12587
13034
|
}], title: [{
|
|
@@ -12615,6 +13062,13 @@ const OPTIONS_SOURCE_FIELD_NAMES = [
|
|
|
12615
13062
|
'optionsSource.dependsOn',
|
|
12616
13063
|
'optionsSource.paramName'
|
|
12617
13064
|
];
|
|
13065
|
+
/** Valores de las reglas 'in' / 'notIn' (arreglo). Control aparte de 'value' para no mezclar tipos. */
|
|
13066
|
+
const BRANCH_LIST_VALUE_FIELD = {
|
|
13067
|
+
name: 'values',
|
|
13068
|
+
label: 'form_builder.field_editor.values',
|
|
13069
|
+
type: 'multyselect',
|
|
13070
|
+
visibilityRules: [{ fieldName: 'operator', operator: 'in', value: LIST_VISIBILITY_OPERATORS }]
|
|
13071
|
+
};
|
|
12618
13072
|
class FieldEditorComponent {
|
|
12619
13073
|
translateService = inject(UicTranslateService);
|
|
12620
13074
|
elementRef = inject(ElementRef);
|
|
@@ -12653,6 +13107,8 @@ class FieldEditorComponent {
|
|
|
12653
13107
|
visibilityRulesEnabled = input(true);
|
|
12654
13108
|
/** Sección "Estilo". */
|
|
12655
13109
|
styleEnabled = input(true);
|
|
13110
|
+
/** El formulario se muestra como encuesta con una pregunta por página: agrega "samePage" a la sección de estilo. */
|
|
13111
|
+
surveyFieldMode = input(false);
|
|
12656
13112
|
showDependencySection = computed(() => this.visibilityRulesEnabled() || !!this.localField().visibilityRules?.length);
|
|
12657
13113
|
/** Tipos con opciones que no admiten origen externo (el motor solo lo resuelve para selectores, pool y radio). */
|
|
12658
13114
|
manualOptionsOnly = computed(() => this.fieldType()?.value === 'distribution');
|
|
@@ -12742,11 +13198,15 @@ class FieldEditorComponent {
|
|
|
12742
13198
|
const operator = selectedOperator && allowedOperators.includes(selectedOperator)
|
|
12743
13199
|
? selectedOperator
|
|
12744
13200
|
: null;
|
|
12745
|
-
|
|
13201
|
+
// 'in' / 'notIn' usan el control 'values' (arreglo); el resto, 'value'.
|
|
13202
|
+
const listOperator = this.isListVisibilityOperator(operator);
|
|
13203
|
+
const rawValue = listOperator ? this.normalizeListValue(fr['values']) : fr['value'];
|
|
13204
|
+
const value = parentChanged || this.isValueLessVisibilityOperator(operator) ? null : rawValue;
|
|
12746
13205
|
const nextDraft = {
|
|
12747
13206
|
fieldName: fieldName ?? null,
|
|
12748
13207
|
operator,
|
|
12749
|
-
value
|
|
13208
|
+
value: listOperator ? null : value,
|
|
13209
|
+
values: listOperator ? value : null
|
|
12750
13210
|
};
|
|
12751
13211
|
this.branchDraftValues.set(nextDraft);
|
|
12752
13212
|
if (parentChanged) {
|
|
@@ -12755,6 +13215,9 @@ class FieldEditorComponent {
|
|
|
12755
13215
|
// Ignore partial emissions while the dependency form is still incomplete.
|
|
12756
13216
|
if (!fieldName || !operator)
|
|
12757
13217
|
return;
|
|
13218
|
+
// Una regla de lista sin valores no se guarda (nunca coincidiría).
|
|
13219
|
+
if (listOperator && !value)
|
|
13220
|
+
return;
|
|
12758
13221
|
const visibilityRule = {
|
|
12759
13222
|
fieldName,
|
|
12760
13223
|
fieldLabel: this.getDependencyFieldLabel(fieldName),
|
|
@@ -12767,7 +13230,7 @@ class FieldEditorComponent {
|
|
|
12767
13230
|
if (currentRule &&
|
|
12768
13231
|
currentRule.fieldName === visibilityRule.fieldName &&
|
|
12769
13232
|
currentRule.operator === visibilityRule.operator &&
|
|
12770
|
-
currentRule.value === visibilityRule.value) {
|
|
13233
|
+
JSON.stringify(currentRule.value ?? null) === JSON.stringify(visibilityRule.value ?? null)) {
|
|
12771
13234
|
return;
|
|
12772
13235
|
}
|
|
12773
13236
|
// If adding a new rule, only keep in draft — don't persist until confirmEditingRule()
|
|
@@ -12817,8 +13280,10 @@ class FieldEditorComponent {
|
|
|
12817
13280
|
fieldName,
|
|
12818
13281
|
fieldLabel: this.getDependencyFieldLabel(fieldName),
|
|
12819
13282
|
operator,
|
|
12820
|
-
value: draft['value'] ?? null
|
|
13283
|
+
value: this.isListVisibilityOperator(operator) ? draft['values'] ?? null : draft['value'] ?? null
|
|
12821
13284
|
};
|
|
13285
|
+
if (this.isListVisibilityOperator(operator) && !newRule.value)
|
|
13286
|
+
return;
|
|
12822
13287
|
const updatedRules = [...(this.localField().visibilityRules ?? []), newRule];
|
|
12823
13288
|
const updatedField = { ...this.localField(), visibilityRules: updatedRules };
|
|
12824
13289
|
this.localField.set(updatedField);
|
|
@@ -13028,12 +13493,13 @@ class FieldEditorComponent {
|
|
|
13028
13493
|
const fieldType = this.fieldType();
|
|
13029
13494
|
if (!fieldType)
|
|
13030
13495
|
return [];
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13496
|
+
const showSurvey = !this.isSubField() && this.surveyFieldMode();
|
|
13497
|
+
return [...LAYOUT_FORM_FIELDS, ...(showSurvey ? SURVEY_FORM_FIELDS : [])].map(field => ({
|
|
13498
|
+
...field,
|
|
13499
|
+
label: this.translateService.translate(field.label ?? ''),
|
|
13500
|
+
placeholder: field.placeholder ? this.translateService.translate(field.placeholder) : this.translateService.translate(field.label ?? ''),
|
|
13501
|
+
tip: field.tip ? this.translateService.translate(field.tip) : field.tip
|
|
13502
|
+
}));
|
|
13037
13503
|
}
|
|
13038
13504
|
buildAdvancedBlocks() {
|
|
13039
13505
|
const fieldType = this.fieldType();
|
|
@@ -13073,7 +13539,7 @@ class FieldEditorComponent {
|
|
|
13073
13539
|
const fieldName = values['fieldName'];
|
|
13074
13540
|
const dependencyType = this.getDependencyFieldType(fieldName);
|
|
13075
13541
|
const allowedOperators = this.getAllowedVisibilityOperators(dependencyType);
|
|
13076
|
-
return BRANCH_FORM_FIELDS.map(field => ({
|
|
13542
|
+
return [...BRANCH_FORM_FIELDS, BRANCH_LIST_VALUE_FIELD].map(field => ({
|
|
13077
13543
|
...this.prepareBranchField(field, fieldName, allowedOperators),
|
|
13078
13544
|
label: this.translateService.translate(field.label ?? ''),
|
|
13079
13545
|
placeholder: field.placeholder ? this.translateService.translate(field.placeholder) : this.translateService.translate(field.label ?? '')
|
|
@@ -13103,8 +13569,7 @@ class FieldEditorComponent {
|
|
|
13103
13569
|
{ fieldName: 'fieldName', operator: 'notEquals', value: '' },
|
|
13104
13570
|
{ fieldName: 'operator', operator: 'notEquals', value: null },
|
|
13105
13571
|
{ fieldName: 'operator', operator: 'notEquals', value: '' },
|
|
13106
|
-
{ fieldName: 'operator', operator: '
|
|
13107
|
-
{ fieldName: 'operator', operator: 'notEquals', value: 'isNotEmpty' }
|
|
13572
|
+
{ fieldName: 'operator', operator: 'notIn', value: ['isEmpty', 'isNotEmpty', ...LIST_VISIBILITY_OPERATORS] }
|
|
13108
13573
|
],
|
|
13109
13574
|
type: this.getBranchValueFieldType(fieldName)
|
|
13110
13575
|
};
|
|
@@ -13123,8 +13588,39 @@ class FieldEditorComponent {
|
|
|
13123
13588
|
}
|
|
13124
13589
|
return valueField;
|
|
13125
13590
|
}
|
|
13591
|
+
// 'in' / 'notIn': varias opciones del padre (multyselect) o, sin opciones fijas, chips.
|
|
13592
|
+
if (field.name === 'values') {
|
|
13593
|
+
const valueOptions = this.getDependencyValueOptions(fieldName);
|
|
13594
|
+
if (valueOptions?.length) {
|
|
13595
|
+
return {
|
|
13596
|
+
...field,
|
|
13597
|
+
type: 'multyselect',
|
|
13598
|
+
options: valueOptions.map(opt => ({ ...opt, text: this.translateService.translate(opt.text) }))
|
|
13599
|
+
};
|
|
13600
|
+
}
|
|
13601
|
+
return { ...field, type: 'chips', placeholder: 'chips_input.placeholder' };
|
|
13602
|
+
}
|
|
13126
13603
|
return field;
|
|
13127
13604
|
}
|
|
13605
|
+
isListVisibilityOperator(operator) {
|
|
13606
|
+
return LIST_VISIBILITY_OPERATORS.includes(operator);
|
|
13607
|
+
}
|
|
13608
|
+
/** Arreglo de valores sin vacíos ni repetidos; null si queda vacío. */
|
|
13609
|
+
normalizeListValue(value) {
|
|
13610
|
+
if (!Array.isArray(value))
|
|
13611
|
+
return null;
|
|
13612
|
+
const seen = new Set();
|
|
13613
|
+
const result = value.filter(item => {
|
|
13614
|
+
if (item === null || item === undefined || item === '')
|
|
13615
|
+
return false;
|
|
13616
|
+
const key = String(item);
|
|
13617
|
+
if (seen.has(key))
|
|
13618
|
+
return false;
|
|
13619
|
+
seen.add(key);
|
|
13620
|
+
return true;
|
|
13621
|
+
});
|
|
13622
|
+
return result.length ? result : null;
|
|
13623
|
+
}
|
|
13128
13624
|
getAllowedVisibilityOperators(fieldType) {
|
|
13129
13625
|
return FIELDS_CONFIG.find(field => field.value === fieldType)?.visibility.operators ?? [];
|
|
13130
13626
|
}
|
|
@@ -13148,10 +13644,12 @@ class FieldEditorComponent {
|
|
|
13148
13644
|
ruleToBranchValues(rule) {
|
|
13149
13645
|
if (!rule || !rule.fieldName)
|
|
13150
13646
|
return {};
|
|
13647
|
+
const listOperator = this.isListVisibilityOperator(rule.operator);
|
|
13151
13648
|
return {
|
|
13152
13649
|
fieldName: rule.fieldName ?? null,
|
|
13153
13650
|
operator: rule.operator ?? null,
|
|
13154
|
-
value: rule.value ?? null
|
|
13651
|
+
value: listOperator ? null : rule.value ?? null,
|
|
13652
|
+
values: listOperator ? (Array.isArray(rule.value) ? rule.value : rule.value != null ? [rule.value] : null) : null
|
|
13155
13653
|
};
|
|
13156
13654
|
}
|
|
13157
13655
|
isValueLessVisibilityOperator(operator) {
|
|
@@ -13190,7 +13688,7 @@ class FieldEditorComponent {
|
|
|
13190
13688
|
});
|
|
13191
13689
|
}
|
|
13192
13690
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13193
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FieldEditorComponent, isStandalone: true, selector: "lib-field-editor", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, focusRequiredField: { classPropertyName: "focusRequiredField", publicName: "focusRequiredField", isSignal: true, isRequired: false, transformFunction: null }, isSubField: { classPropertyName: "isSubField", publicName: "isSubField", isSignal: true, isRequired: false, transformFunction: null }, enableNameModify: { classPropertyName: "enableNameModify", publicName: "enableNameModify", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, externalSources: { classPropertyName: "externalSources", publicName: "externalSources", isSignal: true, isRequired: false, transformFunction: null }, visibilityRulesEnabled: { classPropertyName: "visibilityRulesEnabled", publicName: "visibilityRulesEnabled", isSignal: true, isRequired: false, transformFunction: null }, styleEnabled: { classPropertyName: "styleEnabled", publicName: "styleEnabled", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fieldChange: "fieldChange" }, ngImport: i0, template: "<ng-template #sectionHeader let-key=\"key\" let-label=\"label\" let-count=\"count\">\n <button\n type=\"button\"\n class=\"props-title\"\n [attr.aria-expanded]=\"!isSectionHidden(key)\"\n (click)=\"toggleSection(key)\">\n <span class=\"props-title-text\">{{ label | uicTranslate }}</span>\n @if (count) {\n <span class=\"props-count\" [attr.aria-label]=\"'form_builder.field_editor.configured_count' | uicTranslate: { count: count }\">{{ count }}</span>\n }\n <i [class]=\"isSectionHidden(key) ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'\" aria-hidden=\"true\"></i>\n </button>\n</ng-template>\n\n<ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'basic', label: 'form_builder.field_editor.basic' }\"></ng-container>\n<div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('basic')\">\n <ui-form-wrapper\n #basicFormWrapper\n [fields]=\"requiredFields()\"\n [initialValues]=\"initialValues()\"\n [focusFieldName]=\"focusRequiredField() ? 'label' : null\"\n [focusFieldTrigger]=\"focusRequiredField() ? config().code : null\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n @if (hasOptionsSourceConfig()) {\n @if (showOptionsSourceConfig()) {\n <ui-form-wrapper\n [fields]=\"optionsSourceFields()\"\n [initialValues]=\"initialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n }\n @if (hasOptions() && !hasExternalOptionsSource()) {\n <ui-field-options-editor [disabled]=\"readOnly()\" [options]=\"localField().options ?? []\" (optionsChange)=\"updateOptions($event)\"></ui-field-options-editor>\n }\n @if (supportsOtherOption()) {\n @let other = localField().otherOption;\n <div class=\"other-config\" [class.is-on]=\"!!other\">\n <ui-checkbox\n type=\"switch\"\n [noPadding]=\"true\"\n [disabled]=\"readOnly()\"\n [placeholder]=\"'form_builder.other_option.enable' | uicTranslate\"\n [tip]=\"'form_builder.other_option.enable_tip' | uicTranslate\"\n [ngModel]=\"!!other\"\n (ngModelChange)=\"toggleOtherOption($event)\">\n </ui-checkbox>\n @if (other) {\n <div class=\"other-config-fields\">\n <ui-input [label]=\"'form_builder.other_option.label' | uicTranslate\" [disabled]=\"readOnly()\">\n <input type=\"text\"\n [disabled]=\"readOnly()\"\n [placeholder]=\"'other_option.label' | uicTranslate\"\n [value]=\"other.label ?? ''\"\n (change)=\"updateOtherOption({ label: $any($event.target).value })\">\n </ui-input>\n <ui-input [label]=\"'form_builder.other_option.placeholder' | uicTranslate\" [disabled]=\"readOnly()\">\n <input type=\"text\"\n [disabled]=\"readOnly()\"\n [placeholder]=\"'other_option.placeholder' | uicTranslate\"\n [value]=\"other.placeholder ?? ''\"\n (change)=\"updateOtherOption({ placeholder: $any($event.target).value })\">\n </ui-input>\n <ui-checkbox\n [noPadding]=\"true\"\n [disabled]=\"readOnly()\"\n [placeholder]=\"'form_builder.other_option.required' | uicTranslate\"\n [ngModel]=\"other.required ?? true\"\n (ngModelChange)=\"updateOtherOption({ required: $event })\">\n </ui-checkbox>\n </div>\n }\n </div>\n }\n }\n @if (isScale()) {\n <ui-field-options-editor\n title=\"form_builder.options_editor.scale_labels_title\"\n codeLabel=\"form_builder.options_editor.scale_value_label\"\n nameLabel=\"form_builder.options_editor.scale_text_label\"\n codePlaceholder=\"1\"\n namePlaceholder=\"form_builder.options_editor.scale_text_placeholder\"\n [showAdvanced]=\"false\"\n [disabled]=\"readOnly()\"\n [autoCode]=\"false\"\n [options]=\"localField().scaleLabels ?? []\"\n (optionsChange)=\"updateScaleLabels($event)\">\n </ui-field-options-editor>\n }\n @if (isComputed()) {\n <ui-form-wrapper\n [fields]=\"computedSourceFields()\"\n [initialValues]=\"initialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n }\n</div>\n\n@if (advancedFields().length) {\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'advanced', label: 'form_builder.field_editor.advanced', count: sectionCounts()['advanced'] }\"></ng-container>\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('advanced')\">\n <ui-form-wrapper\n [fields]=\"advancedFields()\"\n [initialValues]=\"initialValues()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n </div>\n}\n\n@if (styleEnabled()) {\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'style', label: 'form_builder.field_editor.style', count: sectionCounts()['style'] }\"></ng-container>\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('style')\">\n <ui-form-wrapper\n [fields]=\"styleFields()\"\n [initialValues]=\"initialValues()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n </div>\n}\n\n@if (!isSubField() && showExternalValidation()) {\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'external_validation', label: 'form_builder.field_editor.external_validation_title', count: sectionCounts()['external_validation'] }\"></ng-container>\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('external_validation')\">\n <ui-form-wrapper\n [fields]=\"externalValidationFields()\"\n [initialValues]=\"initialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n </div>\n}\n\n@if (showDependencySection()) {\n<ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'dependency', label: 'form_builder.field_editor.dependency_title', count: sectionCounts()['dependency'] }\"></ng-container>\n<div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('dependency')\">\n @if (localField().visibilityRules?.length || isAddingNewRule()) {\n <p class=\"dependency-hint\">{{'form_builder.field_editor.dependency_description' | uicTranslate}}</p>\n } @else {\n <p class=\"dependency-hint muted\">{{(readOnly() ? 'form_builder.field_editor.dependency_empty_read_only' : 'form_builder.field_editor.dependency_empty') | uicTranslate}}</p>\n }\n\n @if (localField().visibilityRules?.length) {\n <div class=\"rules-container\">\n @for (rule of localField().visibilityRules; track $index) {\n @if ($index > 0) {\n <div class=\"rule-joiner\">{{'form_builder.field_editor.and' | uicTranslate}}</div>\n }\n <div class=\"rule-card\" [class.editing]=\"editingRuleIndex() === $index && !isAddingNewRule()\">\n <div class=\"rule-content\">\n <div class=\"rule-text\">\n <strong>{{ rule.fieldLabel || rule.fieldName }}</strong>\n @if (rule.operator) {\n <span class=\"rule-operator\">{{ 'form_builder.visibility_operators.' + rule.operator | uicTranslate }}</span>\n }\n @if (rule.operator !== 'isEmpty' && rule.operator !== 'isNotEmpty' && rule.value !== null && rule.value !== undefined && rule.value !== '') {\n <span class=\"rule-value\">{{ ruleValueText(rule) }}</span>\n }\n </div>\n </div>\n @if (editingRuleIndex() === -1 && !readOnly()) {\n <div class=\"rule-actions\">\n <button type=\"button\" class=\"rule-btn edit\" (click)=\"startEditingRule($index)\" [attr.title]=\"'form_builder.field_editor.edit_rule' | uicTranslate\" [attr.aria-label]=\"'form_builder.field_editor.edit_rule' | uicTranslate\">\n <i class=\"ri-edit-line\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"rule-btn delete\" (click)=\"removeRule($index)\" [attr.title]=\"'form_builder.field_editor.remove_relation' | uicTranslate\" [attr.aria-label]=\"'form_builder.field_editor.remove_relation' | uicTranslate\">\n <i class=\"ri-delete-bin-line\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n </div>\n <!-- Inline edit form for existing rule -->\n @if (editingRuleIndex() === $index && !isAddingNewRule()) {\n <div class=\"rule-editor\">\n <ui-form-wrapper\n [fields]=\"branchFields()\"\n [initialValues]=\"branchInitialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateRuleValue($event)\">\n </ui-form-wrapper>\n <div class=\"editor-actions\">\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" (click)=\"cancelEditingRule()\">{{'form_builder.field_editor.cancel' | uicTranslate}}</ui-button>\n <ui-button color=\"black\" size=\"s\" icon=\"ri-check-line\" (click)=\"confirmEditingRule()\">{{'form_builder.field_editor.save' | uicTranslate}}</ui-button>\n </div>\n </div>\n }\n }\n </div>\n }\n\n <!-- New rule form (only while adding) -->\n @if (isAddingNewRule()) {\n @if (localField().visibilityRules?.length) {\n <div class=\"rule-joiner\">{{'form_builder.field_editor.and' | uicTranslate}}</div>\n }\n <div class=\"rule-editor new-rule\">\n <ui-form-wrapper\n [fields]=\"branchFields()\"\n [initialValues]=\"branchInitialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateRuleValue($event)\">\n </ui-form-wrapper>\n <div class=\"editor-actions\">\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" (click)=\"cancelEditingRule()\">{{'form_builder.field_editor.cancel' | uicTranslate}}</ui-button>\n <ui-button color=\"black\" size=\"s\" icon=\"ri-check-line\" (click)=\"confirmEditingRule()\">{{'form_builder.field_editor.save' | uicTranslate}}</ui-button>\n </div>\n </div>\n }\n\n <!-- Add button (hidden while editing) -->\n @if (editingRuleIndex() === -1 && !readOnly() && visibilityRulesEnabled()) {\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" icon=\"ri-add-line\" (click)=\"addRule()\">{{'form_builder.field_editor.add_relation' | uicTranslate}}</ui-button>\n }\n</div>\n}\n", styles: [".hidden{display:none}.props-title{width:100%;font-size:14px;font-weight:600;margin-bottom:8px;background:var(--uic-neutral-200, var(--grey-200));color:inherit;padding:5px 8px;border:none;border-radius:5px;display:flex;align-items:center;gap:6px;cursor:pointer;text-align:left}.props-title:hover{background:var(--uic-neutral-300, var(--grey-300))}.props-title:focus-visible{outline:solid 2px var(--primary-400);outline-offset:1px}.props-title-text{flex:1 1}.props-count{min-width:18px;padding:0 5px;border-radius:9px;font-size:11px;font-weight:600;text-align:center;background-color:var(--primary-100);color:var(--primary-700)}.props-inputs{padding-left:8px;margin-bottom:10px}.dependency-hint{font-size:13px;margin:6px 0 10px;color:var(--yellow-800)}.dependency-hint.muted{color:var(--uic-neutral-500, var(--grey-500))}.rule-joiner{align-self:flex-start;margin-left:10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-500, var(--grey-500))}.rules-container{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}.rule-card{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;border:1px solid var(--uic-neutral-300, var(--grey-300));border-radius:3px;background:var(--uic-surface-raised, var(--white));font-size:12px}.rule-card.editing{border-color:var(--primary-400, #6366f1);border-bottom:none;border-radius:3px 3px 0 0}.rule-card .rule-content{flex:1;min-width:0}.rule-card .rule-text{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.rule-card .rule-text strong{font-weight:600;color:var(--uic-neutral-800, var(--grey-800))}.rule-card .rule-text .rule-operator{font-style:italic;color:var(--uic-neutral-600, var(--grey-600))}.rule-card .rule-text .rule-value{background:var(--uic-neutral-100, var(--grey-100));padding:0 3px;border-radius:2px;color:var(--uic-neutral-800, var(--grey-800))}.rule-actions{display:flex;gap:4px;flex-shrink:0;margin-left:4px}.rule-btn{background:none;border:none;cursor:pointer;padding:2px 4px;display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--uic-neutral-600, var(--grey-600));transition:color .2s}.rule-btn:hover{color:var(--uic-neutral-800, var(--grey-800))}.rule-btn.delete{color:var(--red-600)}.rule-btn.delete:hover{color:var(--red-800)}.rule-editor{padding:8px;border:1px solid var(--primary-400, #6366f1);border-radius:0 0 3px 3px;background:var(--uic-neutral-50, var(--grey-50));margin-bottom:6px}.rule-editor.new-rule{border-radius:3px;margin-top:4px}.editor-actions{display:flex;gap:4px;margin-top:6px}.other-config{margin:4px 0 12px;padding:8px 10px;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:8px}.other-config.is-on{border-color:var(--primary-200);background-color:var(--uic-neutral-50, var(--grey-50))}.other-config-fields{display:flex;flex-direction:column;gap:8px;margin-top:8px}\n"], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "computedFieldResolver", "externalValidatorResolver", "disabled", "fillSelects", "initialValues", "loading", "showButtons", "iconMode", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicFieldOptionsEditorComponent, selector: "ui-field-options-editor", inputs: ["title", "codeLabel", "nameLabel", "codePlaceholder", "namePlaceholder", "showAdvanced", "autoCode", "disabled", "options"], outputs: ["optionsChange"] }] });
|
|
13691
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FieldEditorComponent, isStandalone: true, selector: "lib-field-editor", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, focusRequiredField: { classPropertyName: "focusRequiredField", publicName: "focusRequiredField", isSignal: true, isRequired: false, transformFunction: null }, isSubField: { classPropertyName: "isSubField", publicName: "isSubField", isSignal: true, isRequired: false, transformFunction: null }, enableNameModify: { classPropertyName: "enableNameModify", publicName: "enableNameModify", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, externalSources: { classPropertyName: "externalSources", publicName: "externalSources", isSignal: true, isRequired: false, transformFunction: null }, visibilityRulesEnabled: { classPropertyName: "visibilityRulesEnabled", publicName: "visibilityRulesEnabled", isSignal: true, isRequired: false, transformFunction: null }, styleEnabled: { classPropertyName: "styleEnabled", publicName: "styleEnabled", isSignal: true, isRequired: false, transformFunction: null }, surveyFieldMode: { classPropertyName: "surveyFieldMode", publicName: "surveyFieldMode", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fieldChange: "fieldChange" }, ngImport: i0, template: "<ng-template #sectionHeader let-key=\"key\" let-label=\"label\" let-count=\"count\">\r\n <button\r\n type=\"button\"\r\n class=\"props-title\"\r\n [attr.aria-expanded]=\"!isSectionHidden(key)\"\r\n (click)=\"toggleSection(key)\">\r\n <span class=\"props-title-text\">{{ label | uicTranslate }}</span>\r\n @if (count) {\r\n <span class=\"props-count\" [attr.aria-label]=\"'form_builder.field_editor.configured_count' | uicTranslate: { count: count }\">{{ count }}</span>\r\n }\r\n <i [class]=\"isSectionHidden(key) ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'\" aria-hidden=\"true\"></i>\r\n </button>\r\n</ng-template>\r\n\r\n<ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'basic', label: 'form_builder.field_editor.basic' }\"></ng-container>\r\n<div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('basic')\">\r\n <ui-form-wrapper\r\n #basicFormWrapper\r\n [fields]=\"requiredFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [focusFieldName]=\"focusRequiredField() ? 'label' : null\"\r\n [focusFieldTrigger]=\"focusRequiredField() ? config().code : null\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n @if (hasOptionsSourceConfig()) {\r\n @if (showOptionsSourceConfig()) {\r\n <ui-form-wrapper\r\n [fields]=\"optionsSourceFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n }\r\n @if (hasOptions() && !hasExternalOptionsSource()) {\r\n <ui-field-options-editor [disabled]=\"readOnly()\" [options]=\"localField().options ?? []\" (optionsChange)=\"updateOptions($event)\"></ui-field-options-editor>\r\n }\r\n @if (supportsOtherOption()) {\r\n @let other = localField().otherOption;\r\n <div class=\"other-config\" [class.is-on]=\"!!other\">\r\n <ui-checkbox\r\n type=\"switch\"\r\n [noPadding]=\"true\"\r\n [disabled]=\"readOnly()\"\r\n [placeholder]=\"'form_builder.other_option.enable' | uicTranslate\"\r\n [tip]=\"'form_builder.other_option.enable_tip' | uicTranslate\"\r\n [ngModel]=\"!!other\"\r\n (ngModelChange)=\"toggleOtherOption($event)\">\r\n </ui-checkbox>\r\n @if (other) {\r\n <div class=\"other-config-fields\">\r\n <ui-input [label]=\"'form_builder.other_option.label' | uicTranslate\" [disabled]=\"readOnly()\">\r\n <input type=\"text\"\r\n [disabled]=\"readOnly()\"\r\n [placeholder]=\"'other_option.label' | uicTranslate\"\r\n [value]=\"other.label ?? ''\"\r\n (change)=\"updateOtherOption({ label: $any($event.target).value })\">\r\n </ui-input>\r\n <ui-input [label]=\"'form_builder.other_option.placeholder' | uicTranslate\" [disabled]=\"readOnly()\">\r\n <input type=\"text\"\r\n [disabled]=\"readOnly()\"\r\n [placeholder]=\"'other_option.placeholder' | uicTranslate\"\r\n [value]=\"other.placeholder ?? ''\"\r\n (change)=\"updateOtherOption({ placeholder: $any($event.target).value })\">\r\n </ui-input>\r\n <ui-checkbox\r\n [noPadding]=\"true\"\r\n [disabled]=\"readOnly()\"\r\n [placeholder]=\"'form_builder.other_option.required' | uicTranslate\"\r\n [ngModel]=\"other.required ?? true\"\r\n (ngModelChange)=\"updateOtherOption({ required: $event })\">\r\n </ui-checkbox>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n @if (isScale()) {\r\n <ui-field-options-editor\r\n title=\"form_builder.options_editor.scale_labels_title\"\r\n codeLabel=\"form_builder.options_editor.scale_value_label\"\r\n nameLabel=\"form_builder.options_editor.scale_text_label\"\r\n codePlaceholder=\"1\"\r\n namePlaceholder=\"form_builder.options_editor.scale_text_placeholder\"\r\n [showAdvanced]=\"false\"\r\n [disabled]=\"readOnly()\"\r\n [autoCode]=\"false\"\r\n [options]=\"localField().scaleLabels ?? []\"\r\n (optionsChange)=\"updateScaleLabels($event)\">\r\n </ui-field-options-editor>\r\n }\r\n @if (isComputed()) {\r\n <ui-form-wrapper\r\n [fields]=\"computedSourceFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n }\r\n</div>\r\n\r\n@if (advancedFields().length) {\r\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'advanced', label: 'form_builder.field_editor.advanced', count: sectionCounts()['advanced'] }\"></ng-container>\r\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('advanced')\">\r\n <ui-form-wrapper\r\n [fields]=\"advancedFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n </div>\r\n}\r\n\r\n@if (styleEnabled()) {\r\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'style', label: 'form_builder.field_editor.style', count: sectionCounts()['style'] }\"></ng-container>\r\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('style')\">\r\n <ui-form-wrapper\r\n [fields]=\"styleFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n </div>\r\n}\r\n\r\n@if (!isSubField() && showExternalValidation()) {\r\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'external_validation', label: 'form_builder.field_editor.external_validation_title', count: sectionCounts()['external_validation'] }\"></ng-container>\r\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('external_validation')\">\r\n <ui-form-wrapper\r\n [fields]=\"externalValidationFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n </div>\r\n}\r\n\r\n@if (showDependencySection()) {\r\n<ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'dependency', label: 'form_builder.field_editor.dependency_title', count: sectionCounts()['dependency'] }\"></ng-container>\r\n<div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('dependency')\">\r\n @if (localField().visibilityRules?.length || isAddingNewRule()) {\r\n <p class=\"dependency-hint\">{{'form_builder.field_editor.dependency_description' | uicTranslate}}</p>\r\n } @else {\r\n <p class=\"dependency-hint muted\">{{(readOnly() ? 'form_builder.field_editor.dependency_empty_read_only' : 'form_builder.field_editor.dependency_empty') | uicTranslate}}</p>\r\n }\r\n\r\n @if (localField().visibilityRules?.length) {\r\n <div class=\"rules-container\">\r\n @for (rule of localField().visibilityRules; track $index) {\r\n @if ($index > 0) {\r\n <div class=\"rule-joiner\">{{'form_builder.field_editor.and' | uicTranslate}}</div>\r\n }\r\n <div class=\"rule-card\" [class.editing]=\"editingRuleIndex() === $index && !isAddingNewRule()\">\r\n <div class=\"rule-content\">\r\n <div class=\"rule-text\">\r\n <strong>{{ rule.fieldLabel || rule.fieldName }}</strong>\r\n @if (rule.operator) {\r\n <span class=\"rule-operator\">{{ 'form_builder.visibility_operators.' + rule.operator | uicTranslate }}</span>\r\n }\r\n @if (rule.operator !== 'isEmpty' && rule.operator !== 'isNotEmpty' && rule.value !== null && rule.value !== undefined && rule.value !== '') {\r\n <span class=\"rule-value\">{{ ruleValueText(rule) }}</span>\r\n }\r\n </div>\r\n </div>\r\n @if (editingRuleIndex() === -1 && !readOnly()) {\r\n <div class=\"rule-actions\">\r\n <button type=\"button\" class=\"rule-btn edit\" (click)=\"startEditingRule($index)\" [attr.title]=\"'form_builder.field_editor.edit_rule' | uicTranslate\" [attr.aria-label]=\"'form_builder.field_editor.edit_rule' | uicTranslate\">\r\n <i class=\"ri-edit-line\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button type=\"button\" class=\"rule-btn delete\" (click)=\"removeRule($index)\" [attr.title]=\"'form_builder.field_editor.remove_relation' | uicTranslate\" [attr.aria-label]=\"'form_builder.field_editor.remove_relation' | uicTranslate\">\r\n <i class=\"ri-delete-bin-line\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n <!-- Inline edit form for existing rule -->\r\n @if (editingRuleIndex() === $index && !isAddingNewRule()) {\r\n <div class=\"rule-editor\">\r\n <ui-form-wrapper\r\n [fields]=\"branchFields()\"\r\n [initialValues]=\"branchInitialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateRuleValue($event)\">\r\n </ui-form-wrapper>\r\n <div class=\"editor-actions\">\r\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" (click)=\"cancelEditingRule()\">{{'form_builder.field_editor.cancel' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"s\" icon=\"ri-check-line\" (click)=\"confirmEditingRule()\">{{'form_builder.field_editor.save' | uicTranslate}}</ui-button>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <!-- New rule form (only while adding) -->\r\n @if (isAddingNewRule()) {\r\n @if (localField().visibilityRules?.length) {\r\n <div class=\"rule-joiner\">{{'form_builder.field_editor.and' | uicTranslate}}</div>\r\n }\r\n <div class=\"rule-editor new-rule\">\r\n <ui-form-wrapper\r\n [fields]=\"branchFields()\"\r\n [initialValues]=\"branchInitialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateRuleValue($event)\">\r\n </ui-form-wrapper>\r\n <div class=\"editor-actions\">\r\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" (click)=\"cancelEditingRule()\">{{'form_builder.field_editor.cancel' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"s\" icon=\"ri-check-line\" (click)=\"confirmEditingRule()\">{{'form_builder.field_editor.save' | uicTranslate}}</ui-button>\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Add button (hidden while editing) -->\r\n @if (editingRuleIndex() === -1 && !readOnly() && visibilityRulesEnabled()) {\r\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" icon=\"ri-add-line\" (click)=\"addRule()\">{{'form_builder.field_editor.add_relation' | uicTranslate}}</ui-button>\r\n }\r\n</div>\r\n}\r\n", styles: [".hidden{display:none}.props-title{width:100%;font-size:14px;font-weight:600;margin-bottom:8px;background:var(--uic-neutral-200, var(--grey-200));color:inherit;padding:5px 8px;border:none;border-radius:5px;display:flex;align-items:center;gap:6px;cursor:pointer;text-align:left}.props-title:hover{background:var(--uic-neutral-300, var(--grey-300))}.props-title:focus-visible{outline:solid 2px var(--primary-400);outline-offset:1px}.props-title-text{flex:1 1}.props-count{min-width:18px;padding:0 5px;border-radius:9px;font-size:11px;font-weight:600;text-align:center;background-color:var(--primary-100);color:var(--primary-700)}.props-inputs{padding-left:8px;margin-bottom:10px}.dependency-hint{font-size:13px;margin:6px 0 10px;color:var(--yellow-800)}.dependency-hint.muted{color:var(--uic-neutral-500, var(--grey-500))}.rule-joiner{align-self:flex-start;margin-left:10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-500, var(--grey-500))}.rules-container{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}.rule-card{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;border:1px solid var(--uic-neutral-300, var(--grey-300));border-radius:3px;background:var(--uic-surface-raised, var(--white));font-size:12px}.rule-card.editing{border-color:var(--primary-400, #6366f1);border-bottom:none;border-radius:3px 3px 0 0}.rule-card .rule-content{flex:1;min-width:0}.rule-card .rule-text{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.rule-card .rule-text strong{font-weight:600;color:var(--uic-neutral-800, var(--grey-800))}.rule-card .rule-text .rule-operator{font-style:italic;color:var(--uic-neutral-600, var(--grey-600))}.rule-card .rule-text .rule-value{background:var(--uic-neutral-100, var(--grey-100));padding:0 3px;border-radius:2px;color:var(--uic-neutral-800, var(--grey-800))}.rule-actions{display:flex;gap:4px;flex-shrink:0;margin-left:4px}.rule-btn{background:none;border:none;cursor:pointer;padding:2px 4px;display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--uic-neutral-600, var(--grey-600));transition:color .2s}.rule-btn:hover{color:var(--uic-neutral-800, var(--grey-800))}.rule-btn.delete{color:var(--red-600)}.rule-btn.delete:hover{color:var(--red-800)}.rule-editor{padding:8px;border:1px solid var(--primary-400, #6366f1);border-radius:0 0 3px 3px;background:var(--uic-neutral-50, var(--grey-50));margin-bottom:6px}.rule-editor.new-rule{border-radius:3px;margin-top:4px}.editor-actions{display:flex;gap:4px;margin-top:6px}.other-config{margin:4px 0 12px;padding:8px 10px;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:8px}.other-config.is-on{border-color:var(--primary-200);background-color:var(--uic-neutral-50, var(--grey-50))}.other-config-fields{display:flex;flex-direction:column;gap:8px;margin-top:8px}\n"], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "computedFieldResolver", "externalValidatorResolver", "disabled", "fillSelects", "initialValues", "loading", "showButtons", "iconMode", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicFieldOptionsEditorComponent, selector: "ui-field-options-editor", inputs: ["title", "codeLabel", "nameLabel", "codePlaceholder", "namePlaceholder", "showAdvanced", "autoCode", "disabled", "options"], outputs: ["optionsChange"] }] });
|
|
13194
13692
|
}
|
|
13195
13693
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldEditorComponent, decorators: [{
|
|
13196
13694
|
type: Component,
|
|
@@ -13203,7 +13701,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
13203
13701
|
UicInputComponent,
|
|
13204
13702
|
UicTranslatePipe,
|
|
13205
13703
|
UicFieldOptionsEditorComponent
|
|
13206
|
-
], template: "<ng-template #sectionHeader let-key=\"key\" let-label=\"label\" let-count=\"count\">\n <button\n type=\"button\"\n class=\"props-title\"\n [attr.aria-expanded]=\"!isSectionHidden(key)\"\n (click)=\"toggleSection(key)\">\n <span class=\"props-title-text\">{{ label | uicTranslate }}</span>\n @if (count) {\n <span class=\"props-count\" [attr.aria-label]=\"'form_builder.field_editor.configured_count' | uicTranslate: { count: count }\">{{ count }}</span>\n }\n <i [class]=\"isSectionHidden(key) ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'\" aria-hidden=\"true\"></i>\n </button>\n</ng-template>\n\n<ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'basic', label: 'form_builder.field_editor.basic' }\"></ng-container>\n<div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('basic')\">\n <ui-form-wrapper\n #basicFormWrapper\n [fields]=\"requiredFields()\"\n [initialValues]=\"initialValues()\"\n [focusFieldName]=\"focusRequiredField() ? 'label' : null\"\n [focusFieldTrigger]=\"focusRequiredField() ? config().code : null\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n @if (hasOptionsSourceConfig()) {\n @if (showOptionsSourceConfig()) {\n <ui-form-wrapper\n [fields]=\"optionsSourceFields()\"\n [initialValues]=\"initialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n }\n @if (hasOptions() && !hasExternalOptionsSource()) {\n <ui-field-options-editor [disabled]=\"readOnly()\" [options]=\"localField().options ?? []\" (optionsChange)=\"updateOptions($event)\"></ui-field-options-editor>\n }\n @if (supportsOtherOption()) {\n @let other = localField().otherOption;\n <div class=\"other-config\" [class.is-on]=\"!!other\">\n <ui-checkbox\n type=\"switch\"\n [noPadding]=\"true\"\n [disabled]=\"readOnly()\"\n [placeholder]=\"'form_builder.other_option.enable' | uicTranslate\"\n [tip]=\"'form_builder.other_option.enable_tip' | uicTranslate\"\n [ngModel]=\"!!other\"\n (ngModelChange)=\"toggleOtherOption($event)\">\n </ui-checkbox>\n @if (other) {\n <div class=\"other-config-fields\">\n <ui-input [label]=\"'form_builder.other_option.label' | uicTranslate\" [disabled]=\"readOnly()\">\n <input type=\"text\"\n [disabled]=\"readOnly()\"\n [placeholder]=\"'other_option.label' | uicTranslate\"\n [value]=\"other.label ?? ''\"\n (change)=\"updateOtherOption({ label: $any($event.target).value })\">\n </ui-input>\n <ui-input [label]=\"'form_builder.other_option.placeholder' | uicTranslate\" [disabled]=\"readOnly()\">\n <input type=\"text\"\n [disabled]=\"readOnly()\"\n [placeholder]=\"'other_option.placeholder' | uicTranslate\"\n [value]=\"other.placeholder ?? ''\"\n (change)=\"updateOtherOption({ placeholder: $any($event.target).value })\">\n </ui-input>\n <ui-checkbox\n [noPadding]=\"true\"\n [disabled]=\"readOnly()\"\n [placeholder]=\"'form_builder.other_option.required' | uicTranslate\"\n [ngModel]=\"other.required ?? true\"\n (ngModelChange)=\"updateOtherOption({ required: $event })\">\n </ui-checkbox>\n </div>\n }\n </div>\n }\n }\n @if (isScale()) {\n <ui-field-options-editor\n title=\"form_builder.options_editor.scale_labels_title\"\n codeLabel=\"form_builder.options_editor.scale_value_label\"\n nameLabel=\"form_builder.options_editor.scale_text_label\"\n codePlaceholder=\"1\"\n namePlaceholder=\"form_builder.options_editor.scale_text_placeholder\"\n [showAdvanced]=\"false\"\n [disabled]=\"readOnly()\"\n [autoCode]=\"false\"\n [options]=\"localField().scaleLabels ?? []\"\n (optionsChange)=\"updateScaleLabels($event)\">\n </ui-field-options-editor>\n }\n @if (isComputed()) {\n <ui-form-wrapper\n [fields]=\"computedSourceFields()\"\n [initialValues]=\"initialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n }\n</div>\n\n@if (advancedFields().length) {\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'advanced', label: 'form_builder.field_editor.advanced', count: sectionCounts()['advanced'] }\"></ng-container>\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('advanced')\">\n <ui-form-wrapper\n [fields]=\"advancedFields()\"\n [initialValues]=\"initialValues()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n </div>\n}\n\n@if (styleEnabled()) {\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'style', label: 'form_builder.field_editor.style', count: sectionCounts()['style'] }\"></ng-container>\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('style')\">\n <ui-form-wrapper\n [fields]=\"styleFields()\"\n [initialValues]=\"initialValues()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n </div>\n}\n\n@if (!isSubField() && showExternalValidation()) {\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'external_validation', label: 'form_builder.field_editor.external_validation_title', count: sectionCounts()['external_validation'] }\"></ng-container>\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('external_validation')\">\n <ui-form-wrapper\n [fields]=\"externalValidationFields()\"\n [initialValues]=\"initialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n </div>\n}\n\n@if (showDependencySection()) {\n<ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'dependency', label: 'form_builder.field_editor.dependency_title', count: sectionCounts()['dependency'] }\"></ng-container>\n<div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('dependency')\">\n @if (localField().visibilityRules?.length || isAddingNewRule()) {\n <p class=\"dependency-hint\">{{'form_builder.field_editor.dependency_description' | uicTranslate}}</p>\n } @else {\n <p class=\"dependency-hint muted\">{{(readOnly() ? 'form_builder.field_editor.dependency_empty_read_only' : 'form_builder.field_editor.dependency_empty') | uicTranslate}}</p>\n }\n\n @if (localField().visibilityRules?.length) {\n <div class=\"rules-container\">\n @for (rule of localField().visibilityRules; track $index) {\n @if ($index > 0) {\n <div class=\"rule-joiner\">{{'form_builder.field_editor.and' | uicTranslate}}</div>\n }\n <div class=\"rule-card\" [class.editing]=\"editingRuleIndex() === $index && !isAddingNewRule()\">\n <div class=\"rule-content\">\n <div class=\"rule-text\">\n <strong>{{ rule.fieldLabel || rule.fieldName }}</strong>\n @if (rule.operator) {\n <span class=\"rule-operator\">{{ 'form_builder.visibility_operators.' + rule.operator | uicTranslate }}</span>\n }\n @if (rule.operator !== 'isEmpty' && rule.operator !== 'isNotEmpty' && rule.value !== null && rule.value !== undefined && rule.value !== '') {\n <span class=\"rule-value\">{{ ruleValueText(rule) }}</span>\n }\n </div>\n </div>\n @if (editingRuleIndex() === -1 && !readOnly()) {\n <div class=\"rule-actions\">\n <button type=\"button\" class=\"rule-btn edit\" (click)=\"startEditingRule($index)\" [attr.title]=\"'form_builder.field_editor.edit_rule' | uicTranslate\" [attr.aria-label]=\"'form_builder.field_editor.edit_rule' | uicTranslate\">\n <i class=\"ri-edit-line\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"rule-btn delete\" (click)=\"removeRule($index)\" [attr.title]=\"'form_builder.field_editor.remove_relation' | uicTranslate\" [attr.aria-label]=\"'form_builder.field_editor.remove_relation' | uicTranslate\">\n <i class=\"ri-delete-bin-line\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n </div>\n <!-- Inline edit form for existing rule -->\n @if (editingRuleIndex() === $index && !isAddingNewRule()) {\n <div class=\"rule-editor\">\n <ui-form-wrapper\n [fields]=\"branchFields()\"\n [initialValues]=\"branchInitialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateRuleValue($event)\">\n </ui-form-wrapper>\n <div class=\"editor-actions\">\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" (click)=\"cancelEditingRule()\">{{'form_builder.field_editor.cancel' | uicTranslate}}</ui-button>\n <ui-button color=\"black\" size=\"s\" icon=\"ri-check-line\" (click)=\"confirmEditingRule()\">{{'form_builder.field_editor.save' | uicTranslate}}</ui-button>\n </div>\n </div>\n }\n }\n </div>\n }\n\n <!-- New rule form (only while adding) -->\n @if (isAddingNewRule()) {\n @if (localField().visibilityRules?.length) {\n <div class=\"rule-joiner\">{{'form_builder.field_editor.and' | uicTranslate}}</div>\n }\n <div class=\"rule-editor new-rule\">\n <ui-form-wrapper\n [fields]=\"branchFields()\"\n [initialValues]=\"branchInitialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\"\n [disabled]=\"readOnly()\"\n (formChange)=\"updateRuleValue($event)\">\n </ui-form-wrapper>\n <div class=\"editor-actions\">\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" (click)=\"cancelEditingRule()\">{{'form_builder.field_editor.cancel' | uicTranslate}}</ui-button>\n <ui-button color=\"black\" size=\"s\" icon=\"ri-check-line\" (click)=\"confirmEditingRule()\">{{'form_builder.field_editor.save' | uicTranslate}}</ui-button>\n </div>\n </div>\n }\n\n <!-- Add button (hidden while editing) -->\n @if (editingRuleIndex() === -1 && !readOnly() && visibilityRulesEnabled()) {\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" icon=\"ri-add-line\" (click)=\"addRule()\">{{'form_builder.field_editor.add_relation' | uicTranslate}}</ui-button>\n }\n</div>\n}\n", styles: [".hidden{display:none}.props-title{width:100%;font-size:14px;font-weight:600;margin-bottom:8px;background:var(--uic-neutral-200, var(--grey-200));color:inherit;padding:5px 8px;border:none;border-radius:5px;display:flex;align-items:center;gap:6px;cursor:pointer;text-align:left}.props-title:hover{background:var(--uic-neutral-300, var(--grey-300))}.props-title:focus-visible{outline:solid 2px var(--primary-400);outline-offset:1px}.props-title-text{flex:1 1}.props-count{min-width:18px;padding:0 5px;border-radius:9px;font-size:11px;font-weight:600;text-align:center;background-color:var(--primary-100);color:var(--primary-700)}.props-inputs{padding-left:8px;margin-bottom:10px}.dependency-hint{font-size:13px;margin:6px 0 10px;color:var(--yellow-800)}.dependency-hint.muted{color:var(--uic-neutral-500, var(--grey-500))}.rule-joiner{align-self:flex-start;margin-left:10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-500, var(--grey-500))}.rules-container{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}.rule-card{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;border:1px solid var(--uic-neutral-300, var(--grey-300));border-radius:3px;background:var(--uic-surface-raised, var(--white));font-size:12px}.rule-card.editing{border-color:var(--primary-400, #6366f1);border-bottom:none;border-radius:3px 3px 0 0}.rule-card .rule-content{flex:1;min-width:0}.rule-card .rule-text{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.rule-card .rule-text strong{font-weight:600;color:var(--uic-neutral-800, var(--grey-800))}.rule-card .rule-text .rule-operator{font-style:italic;color:var(--uic-neutral-600, var(--grey-600))}.rule-card .rule-text .rule-value{background:var(--uic-neutral-100, var(--grey-100));padding:0 3px;border-radius:2px;color:var(--uic-neutral-800, var(--grey-800))}.rule-actions{display:flex;gap:4px;flex-shrink:0;margin-left:4px}.rule-btn{background:none;border:none;cursor:pointer;padding:2px 4px;display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--uic-neutral-600, var(--grey-600));transition:color .2s}.rule-btn:hover{color:var(--uic-neutral-800, var(--grey-800))}.rule-btn.delete{color:var(--red-600)}.rule-btn.delete:hover{color:var(--red-800)}.rule-editor{padding:8px;border:1px solid var(--primary-400, #6366f1);border-radius:0 0 3px 3px;background:var(--uic-neutral-50, var(--grey-50));margin-bottom:6px}.rule-editor.new-rule{border-radius:3px;margin-top:4px}.editor-actions{display:flex;gap:4px;margin-top:6px}.other-config{margin:4px 0 12px;padding:8px 10px;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:8px}.other-config.is-on{border-color:var(--primary-200);background-color:var(--uic-neutral-50, var(--grey-50))}.other-config-fields{display:flex;flex-direction:column;gap:8px;margin-top:8px}\n"] }]
|
|
13704
|
+
], template: "<ng-template #sectionHeader let-key=\"key\" let-label=\"label\" let-count=\"count\">\r\n <button\r\n type=\"button\"\r\n class=\"props-title\"\r\n [attr.aria-expanded]=\"!isSectionHidden(key)\"\r\n (click)=\"toggleSection(key)\">\r\n <span class=\"props-title-text\">{{ label | uicTranslate }}</span>\r\n @if (count) {\r\n <span class=\"props-count\" [attr.aria-label]=\"'form_builder.field_editor.configured_count' | uicTranslate: { count: count }\">{{ count }}</span>\r\n }\r\n <i [class]=\"isSectionHidden(key) ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'\" aria-hidden=\"true\"></i>\r\n </button>\r\n</ng-template>\r\n\r\n<ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'basic', label: 'form_builder.field_editor.basic' }\"></ng-container>\r\n<div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('basic')\">\r\n <ui-form-wrapper\r\n #basicFormWrapper\r\n [fields]=\"requiredFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [focusFieldName]=\"focusRequiredField() ? 'label' : null\"\r\n [focusFieldTrigger]=\"focusRequiredField() ? config().code : null\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n @if (hasOptionsSourceConfig()) {\r\n @if (showOptionsSourceConfig()) {\r\n <ui-form-wrapper\r\n [fields]=\"optionsSourceFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n }\r\n @if (hasOptions() && !hasExternalOptionsSource()) {\r\n <ui-field-options-editor [disabled]=\"readOnly()\" [options]=\"localField().options ?? []\" (optionsChange)=\"updateOptions($event)\"></ui-field-options-editor>\r\n }\r\n @if (supportsOtherOption()) {\r\n @let other = localField().otherOption;\r\n <div class=\"other-config\" [class.is-on]=\"!!other\">\r\n <ui-checkbox\r\n type=\"switch\"\r\n [noPadding]=\"true\"\r\n [disabled]=\"readOnly()\"\r\n [placeholder]=\"'form_builder.other_option.enable' | uicTranslate\"\r\n [tip]=\"'form_builder.other_option.enable_tip' | uicTranslate\"\r\n [ngModel]=\"!!other\"\r\n (ngModelChange)=\"toggleOtherOption($event)\">\r\n </ui-checkbox>\r\n @if (other) {\r\n <div class=\"other-config-fields\">\r\n <ui-input [label]=\"'form_builder.other_option.label' | uicTranslate\" [disabled]=\"readOnly()\">\r\n <input type=\"text\"\r\n [disabled]=\"readOnly()\"\r\n [placeholder]=\"'other_option.label' | uicTranslate\"\r\n [value]=\"other.label ?? ''\"\r\n (change)=\"updateOtherOption({ label: $any($event.target).value })\">\r\n </ui-input>\r\n <ui-input [label]=\"'form_builder.other_option.placeholder' | uicTranslate\" [disabled]=\"readOnly()\">\r\n <input type=\"text\"\r\n [disabled]=\"readOnly()\"\r\n [placeholder]=\"'other_option.placeholder' | uicTranslate\"\r\n [value]=\"other.placeholder ?? ''\"\r\n (change)=\"updateOtherOption({ placeholder: $any($event.target).value })\">\r\n </ui-input>\r\n <ui-checkbox\r\n [noPadding]=\"true\"\r\n [disabled]=\"readOnly()\"\r\n [placeholder]=\"'form_builder.other_option.required' | uicTranslate\"\r\n [ngModel]=\"other.required ?? true\"\r\n (ngModelChange)=\"updateOtherOption({ required: $event })\">\r\n </ui-checkbox>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n @if (isScale()) {\r\n <ui-field-options-editor\r\n title=\"form_builder.options_editor.scale_labels_title\"\r\n codeLabel=\"form_builder.options_editor.scale_value_label\"\r\n nameLabel=\"form_builder.options_editor.scale_text_label\"\r\n codePlaceholder=\"1\"\r\n namePlaceholder=\"form_builder.options_editor.scale_text_placeholder\"\r\n [showAdvanced]=\"false\"\r\n [disabled]=\"readOnly()\"\r\n [autoCode]=\"false\"\r\n [options]=\"localField().scaleLabels ?? []\"\r\n (optionsChange)=\"updateScaleLabels($event)\">\r\n </ui-field-options-editor>\r\n }\r\n @if (isComputed()) {\r\n <ui-form-wrapper\r\n [fields]=\"computedSourceFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n }\r\n</div>\r\n\r\n@if (advancedFields().length) {\r\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'advanced', label: 'form_builder.field_editor.advanced', count: sectionCounts()['advanced'] }\"></ng-container>\r\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('advanced')\">\r\n <ui-form-wrapper\r\n [fields]=\"advancedFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n </div>\r\n}\r\n\r\n@if (styleEnabled()) {\r\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'style', label: 'form_builder.field_editor.style', count: sectionCounts()['style'] }\"></ng-container>\r\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('style')\">\r\n <ui-form-wrapper\r\n [fields]=\"styleFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n </div>\r\n}\r\n\r\n@if (!isSubField() && showExternalValidation()) {\r\n <ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'external_validation', label: 'form_builder.field_editor.external_validation_title', count: sectionCounts()['external_validation'] }\"></ng-container>\r\n <div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('external_validation')\">\r\n <ui-form-wrapper\r\n [fields]=\"externalValidationFields()\"\r\n [initialValues]=\"initialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateFieldValues($event)\">\r\n </ui-form-wrapper>\r\n </div>\r\n}\r\n\r\n@if (showDependencySection()) {\r\n<ng-container *ngTemplateOutlet=\"sectionHeader; context: { key: 'dependency', label: 'form_builder.field_editor.dependency_title', count: sectionCounts()['dependency'] }\"></ng-container>\r\n<div class=\"props-inputs\" [class.hidden]=\"isSectionHidden('dependency')\">\r\n @if (localField().visibilityRules?.length || isAddingNewRule()) {\r\n <p class=\"dependency-hint\">{{'form_builder.field_editor.dependency_description' | uicTranslate}}</p>\r\n } @else {\r\n <p class=\"dependency-hint muted\">{{(readOnly() ? 'form_builder.field_editor.dependency_empty_read_only' : 'form_builder.field_editor.dependency_empty') | uicTranslate}}</p>\r\n }\r\n\r\n @if (localField().visibilityRules?.length) {\r\n <div class=\"rules-container\">\r\n @for (rule of localField().visibilityRules; track $index) {\r\n @if ($index > 0) {\r\n <div class=\"rule-joiner\">{{'form_builder.field_editor.and' | uicTranslate}}</div>\r\n }\r\n <div class=\"rule-card\" [class.editing]=\"editingRuleIndex() === $index && !isAddingNewRule()\">\r\n <div class=\"rule-content\">\r\n <div class=\"rule-text\">\r\n <strong>{{ rule.fieldLabel || rule.fieldName }}</strong>\r\n @if (rule.operator) {\r\n <span class=\"rule-operator\">{{ 'form_builder.visibility_operators.' + rule.operator | uicTranslate }}</span>\r\n }\r\n @if (rule.operator !== 'isEmpty' && rule.operator !== 'isNotEmpty' && rule.value !== null && rule.value !== undefined && rule.value !== '') {\r\n <span class=\"rule-value\">{{ ruleValueText(rule) }}</span>\r\n }\r\n </div>\r\n </div>\r\n @if (editingRuleIndex() === -1 && !readOnly()) {\r\n <div class=\"rule-actions\">\r\n <button type=\"button\" class=\"rule-btn edit\" (click)=\"startEditingRule($index)\" [attr.title]=\"'form_builder.field_editor.edit_rule' | uicTranslate\" [attr.aria-label]=\"'form_builder.field_editor.edit_rule' | uicTranslate\">\r\n <i class=\"ri-edit-line\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button type=\"button\" class=\"rule-btn delete\" (click)=\"removeRule($index)\" [attr.title]=\"'form_builder.field_editor.remove_relation' | uicTranslate\" [attr.aria-label]=\"'form_builder.field_editor.remove_relation' | uicTranslate\">\r\n <i class=\"ri-delete-bin-line\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n <!-- Inline edit form for existing rule -->\r\n @if (editingRuleIndex() === $index && !isAddingNewRule()) {\r\n <div class=\"rule-editor\">\r\n <ui-form-wrapper\r\n [fields]=\"branchFields()\"\r\n [initialValues]=\"branchInitialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateRuleValue($event)\">\r\n </ui-form-wrapper>\r\n <div class=\"editor-actions\">\r\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" (click)=\"cancelEditingRule()\">{{'form_builder.field_editor.cancel' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"s\" icon=\"ri-check-line\" (click)=\"confirmEditingRule()\">{{'form_builder.field_editor.save' | uicTranslate}}</ui-button>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <!-- New rule form (only while adding) -->\r\n @if (isAddingNewRule()) {\r\n @if (localField().visibilityRules?.length) {\r\n <div class=\"rule-joiner\">{{'form_builder.field_editor.and' | uicTranslate}}</div>\r\n }\r\n <div class=\"rule-editor new-rule\">\r\n <ui-form-wrapper\r\n [fields]=\"branchFields()\"\r\n [initialValues]=\"branchInitialValues()\"\r\n [externalData]=\"options()\"\r\n [cols]=\"1\"\r\n [disabled]=\"readOnly()\"\r\n (formChange)=\"updateRuleValue($event)\">\r\n </ui-form-wrapper>\r\n <div class=\"editor-actions\">\r\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" (click)=\"cancelEditingRule()\">{{'form_builder.field_editor.cancel' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"s\" icon=\"ri-check-line\" (click)=\"confirmEditingRule()\">{{'form_builder.field_editor.save' | uicTranslate}}</ui-button>\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Add button (hidden while editing) -->\r\n @if (editingRuleIndex() === -1 && !readOnly() && visibilityRulesEnabled()) {\r\n <ui-button color=\"black\" type=\"bordered\" size=\"s\" icon=\"ri-add-line\" (click)=\"addRule()\">{{'form_builder.field_editor.add_relation' | uicTranslate}}</ui-button>\r\n }\r\n</div>\r\n}\r\n", styles: [".hidden{display:none}.props-title{width:100%;font-size:14px;font-weight:600;margin-bottom:8px;background:var(--uic-neutral-200, var(--grey-200));color:inherit;padding:5px 8px;border:none;border-radius:5px;display:flex;align-items:center;gap:6px;cursor:pointer;text-align:left}.props-title:hover{background:var(--uic-neutral-300, var(--grey-300))}.props-title:focus-visible{outline:solid 2px var(--primary-400);outline-offset:1px}.props-title-text{flex:1 1}.props-count{min-width:18px;padding:0 5px;border-radius:9px;font-size:11px;font-weight:600;text-align:center;background-color:var(--primary-100);color:var(--primary-700)}.props-inputs{padding-left:8px;margin-bottom:10px}.dependency-hint{font-size:13px;margin:6px 0 10px;color:var(--yellow-800)}.dependency-hint.muted{color:var(--uic-neutral-500, var(--grey-500))}.rule-joiner{align-self:flex-start;margin-left:10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-500, var(--grey-500))}.rules-container{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}.rule-card{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;border:1px solid var(--uic-neutral-300, var(--grey-300));border-radius:3px;background:var(--uic-surface-raised, var(--white));font-size:12px}.rule-card.editing{border-color:var(--primary-400, #6366f1);border-bottom:none;border-radius:3px 3px 0 0}.rule-card .rule-content{flex:1;min-width:0}.rule-card .rule-text{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.rule-card .rule-text strong{font-weight:600;color:var(--uic-neutral-800, var(--grey-800))}.rule-card .rule-text .rule-operator{font-style:italic;color:var(--uic-neutral-600, var(--grey-600))}.rule-card .rule-text .rule-value{background:var(--uic-neutral-100, var(--grey-100));padding:0 3px;border-radius:2px;color:var(--uic-neutral-800, var(--grey-800))}.rule-actions{display:flex;gap:4px;flex-shrink:0;margin-left:4px}.rule-btn{background:none;border:none;cursor:pointer;padding:2px 4px;display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--uic-neutral-600, var(--grey-600));transition:color .2s}.rule-btn:hover{color:var(--uic-neutral-800, var(--grey-800))}.rule-btn.delete{color:var(--red-600)}.rule-btn.delete:hover{color:var(--red-800)}.rule-editor{padding:8px;border:1px solid var(--primary-400, #6366f1);border-radius:0 0 3px 3px;background:var(--uic-neutral-50, var(--grey-50));margin-bottom:6px}.rule-editor.new-rule{border-radius:3px;margin-top:4px}.editor-actions{display:flex;gap:4px;margin-top:6px}.other-config{margin:4px 0 12px;padding:8px 10px;border:solid 1px var(--uic-neutral-200, var(--grey-200));border-radius:8px}.other-config.is-on{border-color:var(--primary-200);background-color:var(--uic-neutral-50, var(--grey-50))}.other-config-fields{display:flex;flex-direction:column;gap:8px;margin-top:8px}\n"] }]
|
|
13207
13705
|
}], ctorParameters: () => [] });
|
|
13208
13706
|
|
|
13209
13707
|
/** Agrupación solo de presentación: no altera FIELDS_CONFIG. Tipos no listados caen en "other". */
|
|
@@ -13218,6 +13716,7 @@ const GROUP_BY_TYPE = {
|
|
|
13218
13716
|
checkbox: 'choice',
|
|
13219
13717
|
switch: 'choice',
|
|
13220
13718
|
pool: 'choice',
|
|
13719
|
+
chips: 'text',
|
|
13221
13720
|
scale: 'choice',
|
|
13222
13721
|
distribution: 'choice',
|
|
13223
13722
|
slider: 'choice',
|
|
@@ -13287,11 +13786,11 @@ class FieldTypeSelectorComponent {
|
|
|
13287
13786
|
return value.normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase().trim();
|
|
13288
13787
|
}
|
|
13289
13788
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldTypeSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13290
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FieldTypeSelectorComponent, isStandalone: true, selector: "lib-field-type-selector", inputs: { allowedTypes: { classPropertyName: "allowedTypes", publicName: "allowedTypes", isSignal: true, isRequired: false, transformFunction: null }, excludeTypes: { classPropertyName: "excludeTypes", publicName: "excludeTypes", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disabledReason: { classPropertyName: "disabledReason", publicName: "disabledReason", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectType: "selectType" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }], ngImport: i0, template: "<ui-dropdown-container #dropdown width=\"320px\" maxWidth=\"calc(100vw - 32px)\" [disabled]=\"disabled()\" (closed)=\"onClosed()\">\n <!-- El tooltip va en el contenedor: un bot\u00F3n deshabilitado no recibe eventos del mouse -->\n <span button class=\"ftp-trigger\" [uiTooltip]=\"disabled() ? disabledReason() : ''\">\n <ui-button\n type=\"bordered\"\n color=\"black\"\n icon=\"ri-add-line\"\n [size]=\"size()\"\n [disabled]=\"disabled()\"\n [text]=\"label() | uicTranslate\"\n (click)=\"onOpen()\">\n </ui-button>\n </span>\n\n <div content class=\"ftp\">\n <div class=\"ftp-search\">\n <i class=\"ri-search-line\" aria-hidden=\"true\"></i>\n <input\n #searchInput\n type=\"text\"\n [attr.aria-label]=\"'form_builder.field_picker.search' | uicTranslate\"\n [placeholder]=\"'form_builder.field_picker.search' | uicTranslate\"\n [value]=\"search()\"\n (input)=\"search.set($any($event.target).value)\"\n (keydown.enter)=\"pickFirst(dropdown)\">\n </div>\n\n <div class=\"ftp-list\">\n @for (group of groups(); track group.key) {\n <div class=\"ftp-group-title\">{{ 'form_builder.field_picker.groups.' + group.key | uicTranslate }}</div>\n @for (type of group.types; track type.value) {\n <button type=\"button\" class=\"ftp-item\" uiDropdownClose (click)=\"pick(type)\">\n <span class=\"ftp-item-icon\"><i [class]=\"type.icon\" aria-hidden=\"true\"></i></span>\n <span class=\"ftp-item-text\">\n <b>{{ type.label | uicTranslate }}</b>\n @if (type.detail) {\n <small>{{ type.detail | uicTranslate }}</small>\n }\n </span>\n </button>\n }\n } @empty {\n <p class=\"ftp-empty\">{{ 'form_builder.field_picker.empty' | uicTranslate }}</p>\n }\n </div>\n </div>\n</ui-dropdown-container>\n", styles: [":host{display:inline-block}.ftp{display:flex;flex-direction:column;max-height:inherit}.ftp-search{display:flex;align-items:center;gap:6px;padding:8px 10px;border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));position:sticky;top:0;background-color:var(--uic-surface, white);z-index:1}.ftp-search i{color:var(--uic-neutral-400, var(--grey-400))}.ftp-search input{flex:1 1;min-width:0;border:none;outline:none;background:transparent;font-size:13px;color:var(--uic-neutral-800, var(--grey-800))}.ftp-list{padding:4px}.ftp-group-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400));padding:8px 8px 4px}.ftp-item{width:100%;display:flex;align-items:center;gap:10px;padding:6px 8px;border:none;border-radius:5px;background:none;cursor:pointer;text-align:left;color:inherit}.ftp-item:hover,.ftp-item:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));outline:none}.ftp-item-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:5px;font-size:16px;background-color:var(--uic-neutral-200, var(--grey-200));color:var(--uic-neutral-600, var(--grey-600))}.ftp-item-text{display:flex;flex-direction:column;min-width:0}.ftp-item-text b{font-weight:500;font-size:13px}.ftp-item-text small{font-size:11px;color:var(--uic-neutral-500, var(--grey-500));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftp-empty{padding:12px;text-align:center;font-size:12px;color:var(--uic-neutral-400, var(--grey-400))}.ftp-trigger{display:inline-block}.ftp-trigger:has(button:disabled) ui-button{pointer-events:none}\n"], dependencies: [{ kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicDropdownContainerComponent, selector: "ui-dropdown-container", inputs: ["buttonLabel", "disabled", "positions", "matchTriggerWidth", "width", "minWidth", "maxWidth", "backdropClass", "hasBackdrop", "closeOnBackdropClick", "closeOnEscape", "closeOnContentClick", "offsetX", "offsetY", "push", "flexibleDimensions"], outputs: ["closed"] }, { kind: "directive", type: UiDropdownCloseDirective, selector: "[uiDropdownClose]" }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }] });
|
|
13789
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FieldTypeSelectorComponent, isStandalone: true, selector: "lib-field-type-selector", inputs: { allowedTypes: { classPropertyName: "allowedTypes", publicName: "allowedTypes", isSignal: true, isRequired: false, transformFunction: null }, excludeTypes: { classPropertyName: "excludeTypes", publicName: "excludeTypes", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disabledReason: { classPropertyName: "disabledReason", publicName: "disabledReason", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectType: "selectType" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }], ngImport: i0, template: "<ui-dropdown-container #dropdown width=\"320px\" maxWidth=\"calc(100vw - 32px)\" [disabled]=\"disabled()\" (closed)=\"onClosed()\">\r\n <!-- El tooltip va en el contenedor: un bot\u00F3n deshabilitado no recibe eventos del mouse -->\r\n <span button class=\"ftp-trigger\" [uiTooltip]=\"disabled() ? disabledReason() : ''\">\r\n <ui-button\r\n type=\"bordered\"\r\n color=\"black\"\r\n icon=\"ri-add-line\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled()\"\r\n [text]=\"label() | uicTranslate\"\r\n (click)=\"onOpen()\">\r\n </ui-button>\r\n </span>\r\n\r\n <div content class=\"ftp\">\r\n <div class=\"ftp-search\">\r\n <i class=\"ri-search-line\" aria-hidden=\"true\"></i>\r\n <input\r\n #searchInput\r\n type=\"text\"\r\n [attr.aria-label]=\"'form_builder.field_picker.search' | uicTranslate\"\r\n [placeholder]=\"'form_builder.field_picker.search' | uicTranslate\"\r\n [value]=\"search()\"\r\n (input)=\"search.set($any($event.target).value)\"\r\n (keydown.enter)=\"pickFirst(dropdown)\">\r\n </div>\r\n\r\n <div class=\"ftp-list\">\r\n @for (group of groups(); track group.key) {\r\n <div class=\"ftp-group-title\">{{ 'form_builder.field_picker.groups.' + group.key | uicTranslate }}</div>\r\n @for (type of group.types; track type.value) {\r\n <button type=\"button\" class=\"ftp-item\" uiDropdownClose (click)=\"pick(type)\">\r\n <span class=\"ftp-item-icon\"><i [class]=\"type.icon\" aria-hidden=\"true\"></i></span>\r\n <span class=\"ftp-item-text\">\r\n <b>{{ type.label | uicTranslate }}</b>\r\n @if (type.detail) {\r\n <small>{{ type.detail | uicTranslate }}</small>\r\n }\r\n </span>\r\n </button>\r\n }\r\n } @empty {\r\n <p class=\"ftp-empty\">{{ 'form_builder.field_picker.empty' | uicTranslate }}</p>\r\n }\r\n </div>\r\n </div>\r\n</ui-dropdown-container>\r\n", styles: [":host{display:inline-block}.ftp{display:flex;flex-direction:column;max-height:inherit}.ftp-search{display:flex;align-items:center;gap:6px;padding:8px 10px;border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));position:sticky;top:0;background-color:var(--uic-surface, white);z-index:1}.ftp-search i{color:var(--uic-neutral-400, var(--grey-400))}.ftp-search input{flex:1 1;min-width:0;border:none;outline:none;background:transparent;font-size:13px;color:var(--uic-neutral-800, var(--grey-800))}.ftp-list{padding:4px}.ftp-group-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400));padding:8px 8px 4px}.ftp-item{width:100%;display:flex;align-items:center;gap:10px;padding:6px 8px;border:none;border-radius:5px;background:none;cursor:pointer;text-align:left;color:inherit}.ftp-item:hover,.ftp-item:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));outline:none}.ftp-item-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:5px;font-size:16px;background-color:var(--uic-neutral-200, var(--grey-200));color:var(--uic-neutral-600, var(--grey-600))}.ftp-item-text{display:flex;flex-direction:column;min-width:0}.ftp-item-text b{font-weight:500;font-size:13px}.ftp-item-text small{font-size:11px;color:var(--uic-neutral-500, var(--grey-500));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftp-empty{padding:12px;text-align:center;font-size:12px;color:var(--uic-neutral-400, var(--grey-400))}.ftp-trigger{display:inline-block}.ftp-trigger:has(button:disabled) ui-button{pointer-events:none}\n"], dependencies: [{ kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicDropdownContainerComponent, selector: "ui-dropdown-container", inputs: ["buttonLabel", "disabled", "positions", "matchTriggerWidth", "width", "minWidth", "maxWidth", "backdropClass", "hasBackdrop", "closeOnBackdropClick", "closeOnEscape", "closeOnContentClick", "offsetX", "offsetY", "push", "flexibleDimensions"], outputs: ["closed"] }, { kind: "directive", type: UiDropdownCloseDirective, selector: "[uiDropdownClose]" }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }] });
|
|
13291
13790
|
}
|
|
13292
13791
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldTypeSelectorComponent, decorators: [{
|
|
13293
13792
|
type: Component,
|
|
13294
|
-
args: [{ selector: 'lib-field-type-selector', imports: [UicTranslatePipe, UicDropdownContainerComponent, UiDropdownCloseDirective, UicButtonComponent, UicToolTipDirective], template: "<ui-dropdown-container #dropdown width=\"320px\" maxWidth=\"calc(100vw - 32px)\" [disabled]=\"disabled()\" (closed)=\"onClosed()\">\n <!-- El tooltip va en el contenedor: un bot\u00F3n deshabilitado no recibe eventos del mouse -->\n <span button class=\"ftp-trigger\" [uiTooltip]=\"disabled() ? disabledReason() : ''\">\n <ui-button\n type=\"bordered\"\n color=\"black\"\n icon=\"ri-add-line\"\n [size]=\"size()\"\n [disabled]=\"disabled()\"\n [text]=\"label() | uicTranslate\"\n (click)=\"onOpen()\">\n </ui-button>\n </span>\n\n <div content class=\"ftp\">\n <div class=\"ftp-search\">\n <i class=\"ri-search-line\" aria-hidden=\"true\"></i>\n <input\n #searchInput\n type=\"text\"\n [attr.aria-label]=\"'form_builder.field_picker.search' | uicTranslate\"\n [placeholder]=\"'form_builder.field_picker.search' | uicTranslate\"\n [value]=\"search()\"\n (input)=\"search.set($any($event.target).value)\"\n (keydown.enter)=\"pickFirst(dropdown)\">\n </div>\n\n <div class=\"ftp-list\">\n @for (group of groups(); track group.key) {\n <div class=\"ftp-group-title\">{{ 'form_builder.field_picker.groups.' + group.key | uicTranslate }}</div>\n @for (type of group.types; track type.value) {\n <button type=\"button\" class=\"ftp-item\" uiDropdownClose (click)=\"pick(type)\">\n <span class=\"ftp-item-icon\"><i [class]=\"type.icon\" aria-hidden=\"true\"></i></span>\n <span class=\"ftp-item-text\">\n <b>{{ type.label | uicTranslate }}</b>\n @if (type.detail) {\n <small>{{ type.detail | uicTranslate }}</small>\n }\n </span>\n </button>\n }\n } @empty {\n <p class=\"ftp-empty\">{{ 'form_builder.field_picker.empty' | uicTranslate }}</p>\n }\n </div>\n </div>\n</ui-dropdown-container>\n", styles: [":host{display:inline-block}.ftp{display:flex;flex-direction:column;max-height:inherit}.ftp-search{display:flex;align-items:center;gap:6px;padding:8px 10px;border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));position:sticky;top:0;background-color:var(--uic-surface, white);z-index:1}.ftp-search i{color:var(--uic-neutral-400, var(--grey-400))}.ftp-search input{flex:1 1;min-width:0;border:none;outline:none;background:transparent;font-size:13px;color:var(--uic-neutral-800, var(--grey-800))}.ftp-list{padding:4px}.ftp-group-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400));padding:8px 8px 4px}.ftp-item{width:100%;display:flex;align-items:center;gap:10px;padding:6px 8px;border:none;border-radius:5px;background:none;cursor:pointer;text-align:left;color:inherit}.ftp-item:hover,.ftp-item:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));outline:none}.ftp-item-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:5px;font-size:16px;background-color:var(--uic-neutral-200, var(--grey-200));color:var(--uic-neutral-600, var(--grey-600))}.ftp-item-text{display:flex;flex-direction:column;min-width:0}.ftp-item-text b{font-weight:500;font-size:13px}.ftp-item-text small{font-size:11px;color:var(--uic-neutral-500, var(--grey-500));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftp-empty{padding:12px;text-align:center;font-size:12px;color:var(--uic-neutral-400, var(--grey-400))}.ftp-trigger{display:inline-block}.ftp-trigger:has(button:disabled) ui-button{pointer-events:none}\n"] }]
|
|
13793
|
+
args: [{ selector: 'lib-field-type-selector', imports: [UicTranslatePipe, UicDropdownContainerComponent, UiDropdownCloseDirective, UicButtonComponent, UicToolTipDirective], template: "<ui-dropdown-container #dropdown width=\"320px\" maxWidth=\"calc(100vw - 32px)\" [disabled]=\"disabled()\" (closed)=\"onClosed()\">\r\n <!-- El tooltip va en el contenedor: un bot\u00F3n deshabilitado no recibe eventos del mouse -->\r\n <span button class=\"ftp-trigger\" [uiTooltip]=\"disabled() ? disabledReason() : ''\">\r\n <ui-button\r\n type=\"bordered\"\r\n color=\"black\"\r\n icon=\"ri-add-line\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled()\"\r\n [text]=\"label() | uicTranslate\"\r\n (click)=\"onOpen()\">\r\n </ui-button>\r\n </span>\r\n\r\n <div content class=\"ftp\">\r\n <div class=\"ftp-search\">\r\n <i class=\"ri-search-line\" aria-hidden=\"true\"></i>\r\n <input\r\n #searchInput\r\n type=\"text\"\r\n [attr.aria-label]=\"'form_builder.field_picker.search' | uicTranslate\"\r\n [placeholder]=\"'form_builder.field_picker.search' | uicTranslate\"\r\n [value]=\"search()\"\r\n (input)=\"search.set($any($event.target).value)\"\r\n (keydown.enter)=\"pickFirst(dropdown)\">\r\n </div>\r\n\r\n <div class=\"ftp-list\">\r\n @for (group of groups(); track group.key) {\r\n <div class=\"ftp-group-title\">{{ 'form_builder.field_picker.groups.' + group.key | uicTranslate }}</div>\r\n @for (type of group.types; track type.value) {\r\n <button type=\"button\" class=\"ftp-item\" uiDropdownClose (click)=\"pick(type)\">\r\n <span class=\"ftp-item-icon\"><i [class]=\"type.icon\" aria-hidden=\"true\"></i></span>\r\n <span class=\"ftp-item-text\">\r\n <b>{{ type.label | uicTranslate }}</b>\r\n @if (type.detail) {\r\n <small>{{ type.detail | uicTranslate }}</small>\r\n }\r\n </span>\r\n </button>\r\n }\r\n } @empty {\r\n <p class=\"ftp-empty\">{{ 'form_builder.field_picker.empty' | uicTranslate }}</p>\r\n }\r\n </div>\r\n </div>\r\n</ui-dropdown-container>\r\n", styles: [":host{display:inline-block}.ftp{display:flex;flex-direction:column;max-height:inherit}.ftp-search{display:flex;align-items:center;gap:6px;padding:8px 10px;border-bottom:solid 1px var(--uic-neutral-200, var(--grey-200));position:sticky;top:0;background-color:var(--uic-surface, white);z-index:1}.ftp-search i{color:var(--uic-neutral-400, var(--grey-400))}.ftp-search input{flex:1 1;min-width:0;border:none;outline:none;background:transparent;font-size:13px;color:var(--uic-neutral-800, var(--grey-800))}.ftp-list{padding:4px}.ftp-group-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400));padding:8px 8px 4px}.ftp-item{width:100%;display:flex;align-items:center;gap:10px;padding:6px 8px;border:none;border-radius:5px;background:none;cursor:pointer;text-align:left;color:inherit}.ftp-item:hover,.ftp-item:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));outline:none}.ftp-item-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:5px;font-size:16px;background-color:var(--uic-neutral-200, var(--grey-200));color:var(--uic-neutral-600, var(--grey-600))}.ftp-item-text{display:flex;flex-direction:column;min-width:0}.ftp-item-text b{font-weight:500;font-size:13px}.ftp-item-text small{font-size:11px;color:var(--uic-neutral-500, var(--grey-500));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftp-empty{padding:12px;text-align:center;font-size:12px;color:var(--uic-neutral-400, var(--grey-400))}.ftp-trigger{display:inline-block}.ftp-trigger:has(button:disabled) ui-button{pointer-events:none}\n"] }]
|
|
13295
13794
|
}], propDecorators: { searchInput: [{
|
|
13296
13795
|
type: ViewChild,
|
|
13297
13796
|
args: ['searchInput']
|
|
@@ -13384,6 +13883,7 @@ function resolveFormBuilderConfig(...configs) {
|
|
|
13384
13883
|
maxRepeaterFields: positiveIntOrNull(merged.limits?.maxRepeaterFields, 'limits.maxRepeaterFields'),
|
|
13385
13884
|
},
|
|
13386
13885
|
preview: {
|
|
13886
|
+
showButton: merged.preview?.showButton ?? true,
|
|
13387
13887
|
mode: merged.preview?.mode ?? null,
|
|
13388
13888
|
survey: merged.preview?.survey ?? null,
|
|
13389
13889
|
},
|
|
@@ -13718,7 +14218,7 @@ class BlockEditorComponent {
|
|
|
13718
14218
|
this.blockChange.emit({ ...this.block(), fields: nextFields });
|
|
13719
14219
|
}
|
|
13720
14220
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlockEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13721
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: BlockEditorComponent, isStandalone: true, selector: "lib-block-editor", inputs: { block: { classPropertyName: "block", publicName: "block", isSignal: true, isRequired: false, transformFunction: null }, selectedFieldId: { classPropertyName: "selectedFieldId", publicName: "selectedFieldId", isSignal: true, isRequired: false, transformFunction: null }, selectedSubFieldCode: { classPropertyName: "selectedSubFieldCode", publicName: "selectedSubFieldCode", isSignal: true, isRequired: false, transformFunction: null }, selectedSubFieldParentCode: { classPropertyName: "selectedSubFieldParentCode", publicName: "selectedSubFieldParentCode", isSignal: true, isRequired: false, transformFunction: null }, visibilityParentFieldCodes: { classPropertyName: "visibilityParentFieldCodes", publicName: "visibilityParentFieldCodes", isSignal: false, isRequired: false, transformFunction: null }, fieldLookup: { classPropertyName: "fieldLookup", publicName: "fieldLookup", isSignal: false, isRequired: false, transformFunction: null }, showIdentifier: { classPropertyName: "showIdentifier", publicName: "showIdentifier", isSignal: true, isRequired: false, transformFunction: null }, connectedFieldListIds: { classPropertyName: "connectedFieldListIds", publicName: "connectedFieldListIds", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, availableFieldTypes: { classPropertyName: "availableFieldTypes", publicName: "availableFieldTypes", isSignal: true, isRequired: false, transformFunction: null }, canDelete: { classPropertyName: "canDelete", publicName: "canDelete", isSignal: true, isRequired: false, transformFunction: null }, fieldLimitReached: { classPropertyName: "fieldLimitReached", publicName: "fieldLimitReached", isSignal: true, isRequired: false, transformFunction: null }, maxFields: { classPropertyName: "maxFields", publicName: "maxFields", isSignal: true, isRequired: false, transformFunction: null }, maxRepeaterFields: { classPropertyName: "maxRepeaterFields", publicName: "maxRepeaterFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { blockChange: "blockChange", addFieldRequest: "addFieldRequest", deleteBlock: "deleteBlock", notifySelectedField: "notifySelectedField", notifySelectedSubField: "notifySelectedSubField", notifyNewSubField: "notifyNewSubField", itemRemoved: "itemRemoved", duplicateFieldRequest: "duplicateFieldRequest", moveFieldRequest: "moveFieldRequest" }, ngImport: i0, template: "<div class=\"form-block-card\" [class.collapsed]=\"collapsed()\">\n <div class=\"form-block-card-header\">\n @if (!readOnly()) {\n <i\n class=\"ri-draggable block-drag-handle\"\n cdkDragHandle\n [uiTooltip]=\"'form_builder.block.drag' | uicTranslate\"\n aria-hidden=\"true\"></i>\n }\n <div class=\"block-texts\">\n <input\n class=\"block-title-input\"\n [attr.aria-label]=\"'form_builder.block_title' | uicTranslate\"\n [placeholder]=\"'form_builder.block_title' | uicTranslate\"\n [readOnly]=\"readOnly()\"\n [ngModel]=\"block().title\"\n (ngModelChange)=\"changeTitle($event)\">\n @if (!collapsed() && (!readOnly() || block().subtitle || block().message)) {\n <input\n class=\"block-subtitle-input\"\n [attr.aria-label]=\"'form_builder.block_subtitle' | uicTranslate\"\n [placeholder]=\"'form_builder.block_subtitle' | uicTranslate\"\n [readOnly]=\"readOnly()\"\n [ngModel]=\"block().subtitle\"\n (ngModelChange)=\"changeSubtitle($event)\">\n <input\n class=\"block-message-input\"\n [attr.aria-label]=\"'form_builder.block_message' | uicTranslate\"\n [placeholder]=\"'form_builder.block_message' | uicTranslate\"\n [readOnly]=\"readOnly()\"\n [ngModel]=\"block().message\"\n (ngModelChange)=\"changeMessage($event)\">\n }\n </div>\n @if (collapsed()) {\n <span class=\"block-count\">{{'form_builder.block.field_count' | uicTranslate: { count: block().fields.length } }}</span>\n }\n <ui-button\n [uiTooltip]=\"(collapsed() ? 'form_builder.block.expand' : 'form_builder.block.collapse') | uicTranslate\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"toggleCollapsed()\"\n size=\"s\"\n [icon]=\"collapsed() ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'\"\n color=\"black\"\n type=\"ghost\"\n [iconOnly]=\"true\">\n </ui-button>\n @if (!readOnly() && canDelete()) {\n <ui-button\n [uiTooltip]=\"(isBlockVisibilityParent() ? 'form_builder.delete_block_dependency_blocked' : 'form_builder.delete_block') | uicTranslate\"\n [disabled]=\"isBlockVisibilityParent()\"\n (click)=\"requestDeleteBlock($event)\"\n size=\"s\"\n icon=\"ri-delete-bin-line\"\n color=\"red\"\n type=\"ghost\"\n [iconOnly]=\"true\">\n </ui-button>\n }\n </div>\n\n @if (!collapsed()) {\n <div\n class=\"form-block-card-body\"\n cdkDropList\n [id]=\"fieldListId()\"\n [cdkDropListData]=\"block().code\"\n [cdkDropListConnectedTo]=\"connectedFieldListIds()\"\n [cdkDropListDisabled]=\"readOnly()\"\n (cdkDropListDropped)=\"reorderFields($event)\">\n\n <!-- FIELDS -->\n @for(edtField of block().fields; track edtField.code; let i = $index) {\n <div class=\"field-with-subfields\">\n <div\n class=\"xfield-card\"\n cdkDrag\n [attr.data-field-code]=\"edtField.code\"\n [cdkDragDisabled]=\"readOnly()\"\n [class.selected-field]=\"isRepeaterParentSelected(edtField)\"\n (click)=\"selectField(edtField)\">\n @if (!readOnly()) {\n <i class=\"ri-draggable field-drag-handle\" cdkDragHandle></i>\n }\n\n <div class=\"xfield-card-icon\">\n <i [class]=\"edtField.field?.icon ?? ''\"></i>\n </div>\n <div class=\"xfield-card-body\">\n <b>\n <span class=\"field-label\">{{edtField.fieldData.label || edtField.fieldData.name}}</span>\n @if (edtField.fieldData.required) {\n <span class=\"required-mark\" [uiTooltip]=\"'form_builder.base.required' | uicTranslate\">*</span>\n }\n @if (edtField.fieldData.hidden) {\n <i class=\"hidden-field ri-eye-off-line\" [uiTooltip]=\"'form_builder.base.hidden' | uicTranslate\"></i>\n }\n </b>\n <p class=\"field-meta\">\n <span>{{(edtField.field?.label ?? edtField.type ?? edtField.fieldData.type) | uicTranslate}}</span>\n @if (showIdentifier()) {\n <code class=\"field-identifier\" [uiTooltip]=\"'form_builder.base.name' | uicTranslate\">{{edtField.fieldData.name}}</code>\n }\n </p>\n @let rootRule = visibilitySummary(edtField);\n @if (rootRule) {\n <p class=\"vs-rule\">\n <i class=\"branched-field ri-git-merge-line\" aria-hidden=\"true\"></i>\n <span>{{rootRule.text}}</span>\n @if (rootRule.extraRules > 0) {\n <span class=\"vs-rule-extra\">+{{rootRule.extraRules}}</span>\n }\n </p>\n }\n </div>\n <div class=\"xfield-card-actions\">\n @if (edtField.fieldData.type === 'repeater') {\n <ui-button\n [uiTooltip]=\"(isRepeaterExpanded(edtField.code) ? 'form_builder.repeater.hide_subfields' : 'form_builder.repeater.show_subfields') | uicTranslate\"\n [icon]=\"isRepeaterExpanded(edtField.code) ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line'\"\n size=\"s\" color=\"black\" type=\"ghost\" [iconOnly]=\"true\"\n (click)=\"toggleRepeater(edtField.code, $event)\">\n </ui-button>\n }\n @if (!readOnly()) {\n @if (isTypeAvailable(edtField.fieldData.type) && !fieldLimitReached()) {\n <ui-button\n [uiTooltip]=\"'form_builder.field_editor.duplicate' | uicTranslate\"\n (click)=\"requestDuplicateField(edtField.code, $event)\"\n size=\"s\"\n icon=\"ri-file-copy-2-line\"\n color=\"black\"\n type=\"ghost\"\n [iconOnly]=\"true\">\n </ui-button>\n }\n <ui-button\n [uiTooltip]=\"(isVisibilityParent(edtField.code) ? 'form_builder.delete_field_dependency_blocked' : 'form_builder.field_editor.delete') | uicTranslate\"\n [disabled]=\"isVisibilityParent(edtField.code)\"\n (click)=\"deleteField(edtField.code, $event)\"\n size=\"s\"\n icon=\"ri-delete-bin-line\"\n color=\"red\"\n type=\"ghost\"\n [iconOnly]=\"true\">\n </ui-button>\n }\n </div>\n </div>\n\n @if (edtField.fieldData.type === 'repeater' && isRepeaterExpanded(edtField.code)) {\n <div class=\"repeater-inline-panel\">\n <div\n class=\"repeater-subfields-list\"\n cdkDropList\n [cdkDropListData]=\"edtField.repeaterSubFields ?? []\"\n [cdkDropListDisabled]=\"readOnly()\"\n (cdkDropListDropped)=\"reorderSubFields(edtField.code, $event)\">\n @for (sf of edtField.repeaterSubFields ?? []; track sf.code) {\n <div\n class=\"xfield-card subfield-card\"\n cdkDrag\n [attr.data-subfield-code]=\"edtField.code + ':' + sf.code\"\n [class.selected-field]=\"selectedSubFieldCode() === sf.code && edtField.code === selectedSubFieldParentCode()\"\n [cdkDragDisabled]=\"readOnly()\"\n (click)=\"onSelectSubField(edtField.code, sf, $event)\">\n @if (!readOnly()) {\n <i class=\"ri-draggable field-drag-handle\" cdkDragHandle></i>\n }\n <div class=\"xfield-card-icon\">\n <i [class]=\"sf.field?.icon ?? 'ri-question-line'\"></i>\n </div>\n <div class=\"xfield-card-body\">\n <b>\n <span class=\"field-label\">{{ sf.fieldData.label || sf.fieldData.name }}</span>\n @if (sf.fieldData.required) {\n <span class=\"required-mark\" [uiTooltip]=\"'form_builder.base.required' | uicTranslate\">*</span>\n }\n @if (sf.fieldData.hidden) {\n <i class=\"hidden-field ri-eye-off-line\" [uiTooltip]=\"'form_builder.base.hidden' | uicTranslate\"></i>\n }\n </b>\n <p class=\"field-meta\">\n <span>{{ (sf.field?.label ?? sf.type ?? sf.fieldData.type) | uicTranslate }}</span>\n @if (showIdentifier()) {\n <code class=\"field-identifier\" [uiTooltip]=\"'form_builder.base.name' | uicTranslate\">{{sf.fieldData.name}}</code>\n }\n </p>\n @let subRule = visibilitySummary(sf, edtField.repeaterSubFields ?? []);\n @if (subRule) {\n <p class=\"vs-rule\">\n <i class=\"branched-field ri-git-merge-line\" aria-hidden=\"true\"></i>\n <span>{{subRule.text}}</span>\n @if (subRule.extraRules > 0) {\n <span class=\"vs-rule-extra\">+{{subRule.extraRules}}</span>\n }\n </p>\n }\n </div>\n @if (!readOnly()) {\n <div class=\"xfield-card-actions\">\n @if (isTypeAvailable(sf.fieldData.type) && !isRepeaterFull(edtField)) {\n <ui-button\n [uiTooltip]=\"'form_builder.field_editor.duplicate' | uicTranslate\"\n size=\"s\" icon=\"ri-file-copy-2-line\" color=\"black\" type=\"ghost\" [iconOnly]=\"true\"\n (click)=\"duplicateSubField(edtField.code, sf.code, $event)\">\n </ui-button>\n }\n <ui-button\n [uiTooltip]=\"(isSubFieldVisibilityParent(edtField, sf.code) ? 'form_builder.delete_field_dependency_blocked' : 'form_builder.field_editor.delete') | uicTranslate\"\n [disabled]=\"isSubFieldVisibilityParent(edtField, sf.code)\"\n size=\"s\" icon=\"ri-delete-bin-line\" color=\"red\" type=\"ghost\" [iconOnly]=\"true\"\n (click)=\"deleteSubField(edtField.code, sf.code, $event)\">\n </ui-button>\n </div>\n }\n </div>\n } @empty {\n <p class=\"empty-hint\">{{'form_builder.repeater.no_subfields' | uicTranslate}}</p>\n }\n </div>\n @if (!readOnly()) {\n <div class=\"new-subfield\">\n <lib-field-type-selector label=\"form_builder.repeater.add_subfield\" size=\"t\" [allowedTypes]=\"availableFieldTypes()\" [disabled]=\"isRepeaterFull(edtField)\" [disabledReason]=\"repeaterLimitMessage()\" [excludeTypes]=\"excludeSubFieldTypes\" (selectType)=\"addSubField(edtField.code, $event)\"></lib-field-type-selector>\n </div>\n }\n </div>\n }\n </div>\n\n } @empty {\n <div class=\"empty-block\">\n <i class=\"ri-layout-row-line\" aria-hidden=\"true\"></i>\n <p>{{(readOnly() ? 'form_builder.block.empty_read_only' : 'form_builder.no_fields_drop') | uicTranslate}}</p>\n </div>\n }\n\n </div>\n @if (!readOnly()) {\n <div class=\"new-field\">\n <lib-field-type-selector label=\"form_builder.add_new_field\" [allowedTypes]=\"availableFieldTypes()\" [disabled]=\"fieldLimitReached()\" [disabledReason]=\"fieldLimitMessage()\" (selectType)=\"addField($event)\"></lib-field-type-selector>\n </div>\n }\n }\n</div>\n", styles: [":host{display:block}.form-block-card{border:solid 1px var(--blue-500);border-radius:5px;overflow:hidden}.form-block-card-header{display:flex;gap:5px;align-items:flex-start;background-color:var(--uic-surface-raised, white);padding:10px 10px 10px 6px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300))}.form-block-card.collapsed .form-block-card-header{border-bottom:none;align-items:center}.form-block-card-body{padding:15px;display:flex;flex-direction:column;background-color:var(--uic-neutral-50, var(--grey-50));gap:10px;min-height:40px}:host(.cdk-drag-preview) .form-block-card{box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.block-drag-handle{cursor:grab;padding:4px 2px;color:var(--uic-neutral-400, var(--grey-400))}.block-drag-handle:hover{color:var(--uic-neutral-600, var(--grey-600))}.block-drag-handle:active{cursor:grabbing}.block-texts{flex:1 1;min-width:0;display:flex;flex-direction:column;gap:2px}.block-texts input{width:100%;border:solid 1px transparent;background:transparent;padding:2px 6px;border-radius:5px;color:var(--uic-neutral-800, var(--grey-800))}.block-texts input:hover{border-color:var(--uic-neutral-200, var(--grey-200))}.block-texts input:focus{border-color:var(--primary-500);background-color:var(--uic-surface, white);outline:none}.block-texts input::placeholder{color:var(--uic-neutral-400, var(--grey-400))}.block-texts input[readonly]{cursor:default}.block-texts input[readonly]:hover,.block-texts input[readonly]:focus{border-color:transparent;background:transparent}.block-texts .block-title-input{font-size:16px;font-weight:600}.block-texts .block-subtitle-input{font-size:13px;color:var(--uic-neutral-600, var(--grey-600))}.block-texts .block-message-input{font-size:12px;font-style:italic;color:var(--uic-neutral-500, var(--grey-500))}.block-count{flex:0 0 auto;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));padding:0 6px}.xfield-card{background-color:var(--uic-surface-raised, white);border-radius:5px;padding:10px;gap:10px;display:flex;align-items:center;border:solid 2px var(--uic-neutral-200, var(--grey-200));cursor:pointer;transition:border-color .3s ease}.xfield-card:hover{border-color:var(--uic-neutral-300, var(--grey-300))}.xfield-card-icon{display:flex;justify-content:center;align-items:center;border-radius:5px;width:30px;height:30px;font-size:20px;background-color:var(--uic-neutral-300, var(--grey-300));color:var(--uic-neutral-600, var(--grey-600))}.xfield-card-body{flex:1 1;min-width:0;display:flex;flex-direction:column;gap:2px}.xfield-card-body b{display:flex;align-items:center;gap:5px;min-width:0}.xfield-card-body p{color:var(--uic-neutral-400, var(--grey-400));font-size:12px}.field-drag-handle{cursor:grab;color:var(--uic-neutral-400, var(--grey-400));transition:color .2s ease}.field-drag-handle:active{cursor:grabbing}.xfield-card:hover .field-drag-handle{color:var(--uic-neutral-600, var(--grey-600))}.cdk-drag-preview{box-sizing:border-box;border-radius:5px;box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.field-with-subfields{display:flex;flex-direction:column;gap:0}.repeater-inline-panel{background-color:var(--uic-neutral-100, var(--grey-100));border:solid 1px var(--blue-300);border-top:none;border-radius:0 0 5px 5px;padding:10px 10px 8px 28px;display:flex;flex-direction:column;gap:8px}.repeater-subfields-list{display:flex;flex-direction:column;gap:6px;min-height:6px}.subfield-card{font-size:13px;border-radius:4px;padding:7px 8px!important}.subfield-card .xfield-card-icon{width:26px!important;height:26px!important;font-size:16px!important}.subfield-card b{font-size:13px}.subfield-card p{font-size:11px}.new-subfield{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));flex-wrap:wrap;padding-top:2px}.empty-hint{font-size:12px;color:var(--uic-neutral-400, var(--grey-400));text-align:center;padding:4px 0;margin:0}.form-block-card-body.cdk-drop-list-dragging .xfield-card:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.branched-field{color:var(--yellow-700)}.hidden-field{color:var(--uic-neutral-500, var(--grey-500))}.selected-field,.selected-field:hover{border-color:var(--primary-500)}.new-field{border-top:solid 1px var(--uic-neutral-300, var(--grey-300));padding:10px;background-color:var(--uic-surface-raised, white);display:flex;align-items:center;gap:5px;font-size:14px}.field-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.required-mark{color:var(--red-500);font-weight:700;cursor:default}.field-meta{display:flex;align-items:center;gap:6px;min-width:0}.field-identifier{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;padding:0 5px;border-radius:3px;background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-600, var(--grey-600));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xfield-card-body .vs-rule{display:flex;align-items:center;gap:4px;min-width:0;font-size:12px;color:var(--uic-neutral-600, var(--grey-600))}.xfield-card-body .vs-rule>span:not(.vs-rule-extra){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vs-rule-extra{flex:0 0 auto;font-size:11px;padding:0 5px;border-radius:8px;background-color:var(--yellow-100);color:var(--yellow-700)}.empty-block{display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 10px;border:dashed 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;font-size:13px;color:var(--uic-neutral-400, var(--grey-400))}.empty-block i{font-size:22px}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FieldTypeSelectorComponent, selector: "lib-field-type-selector", inputs: ["allowedTypes", "excludeTypes", "label", "size", "disabled", "disabledReason"], outputs: ["selectType"] }] });
|
|
14221
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: BlockEditorComponent, isStandalone: true, selector: "lib-block-editor", inputs: { block: { classPropertyName: "block", publicName: "block", isSignal: true, isRequired: false, transformFunction: null }, selectedFieldId: { classPropertyName: "selectedFieldId", publicName: "selectedFieldId", isSignal: true, isRequired: false, transformFunction: null }, selectedSubFieldCode: { classPropertyName: "selectedSubFieldCode", publicName: "selectedSubFieldCode", isSignal: true, isRequired: false, transformFunction: null }, selectedSubFieldParentCode: { classPropertyName: "selectedSubFieldParentCode", publicName: "selectedSubFieldParentCode", isSignal: true, isRequired: false, transformFunction: null }, visibilityParentFieldCodes: { classPropertyName: "visibilityParentFieldCodes", publicName: "visibilityParentFieldCodes", isSignal: false, isRequired: false, transformFunction: null }, fieldLookup: { classPropertyName: "fieldLookup", publicName: "fieldLookup", isSignal: false, isRequired: false, transformFunction: null }, showIdentifier: { classPropertyName: "showIdentifier", publicName: "showIdentifier", isSignal: true, isRequired: false, transformFunction: null }, connectedFieldListIds: { classPropertyName: "connectedFieldListIds", publicName: "connectedFieldListIds", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, availableFieldTypes: { classPropertyName: "availableFieldTypes", publicName: "availableFieldTypes", isSignal: true, isRequired: false, transformFunction: null }, canDelete: { classPropertyName: "canDelete", publicName: "canDelete", isSignal: true, isRequired: false, transformFunction: null }, fieldLimitReached: { classPropertyName: "fieldLimitReached", publicName: "fieldLimitReached", isSignal: true, isRequired: false, transformFunction: null }, maxFields: { classPropertyName: "maxFields", publicName: "maxFields", isSignal: true, isRequired: false, transformFunction: null }, maxRepeaterFields: { classPropertyName: "maxRepeaterFields", publicName: "maxRepeaterFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { blockChange: "blockChange", addFieldRequest: "addFieldRequest", deleteBlock: "deleteBlock", notifySelectedField: "notifySelectedField", notifySelectedSubField: "notifySelectedSubField", notifyNewSubField: "notifyNewSubField", itemRemoved: "itemRemoved", duplicateFieldRequest: "duplicateFieldRequest", moveFieldRequest: "moveFieldRequest" }, host: { properties: { "class.is-read-only": "readOnly()" } }, ngImport: i0, template: "<div class=\"form-block-card\" [class.collapsed]=\"collapsed()\">\r\n <div class=\"form-block-card-header\">\r\n @if (!readOnly()) {\r\n <i\r\n class=\"ri-draggable block-drag-handle\"\r\n cdkDragHandle\r\n [uiTooltip]=\"'form_builder.block.drag' | uicTranslate\"\r\n aria-hidden=\"true\"></i>\r\n }\r\n <div class=\"block-texts\">\r\n <input\r\n class=\"block-title-input\"\r\n [attr.aria-label]=\"'form_builder.block_title' | uicTranslate\"\r\n [placeholder]=\"'form_builder.block_title' | uicTranslate\"\r\n [readOnly]=\"readOnly()\"\r\n [ngModel]=\"block().title\"\r\n (ngModelChange)=\"changeTitle($event)\">\r\n @if (!collapsed() && (!readOnly() || block().subtitle || block().message)) {\r\n <input\r\n class=\"block-subtitle-input\"\r\n [attr.aria-label]=\"'form_builder.block_subtitle' | uicTranslate\"\r\n [placeholder]=\"'form_builder.block_subtitle' | uicTranslate\"\r\n [readOnly]=\"readOnly()\"\r\n [ngModel]=\"block().subtitle\"\r\n (ngModelChange)=\"changeSubtitle($event)\">\r\n <input\r\n class=\"block-message-input\"\r\n [attr.aria-label]=\"'form_builder.block_message' | uicTranslate\"\r\n [placeholder]=\"'form_builder.block_message' | uicTranslate\"\r\n [readOnly]=\"readOnly()\"\r\n [ngModel]=\"block().message\"\r\n (ngModelChange)=\"changeMessage($event)\">\r\n }\r\n </div>\r\n @if (collapsed()) {\r\n <span class=\"block-count\">{{'form_builder.block.field_count' | uicTranslate: { count: block().fields.length } }}</span>\r\n }\r\n <ui-button\r\n [uiTooltip]=\"(collapsed() ? 'form_builder.block.expand' : 'form_builder.block.collapse') | uicTranslate\"\r\n [attr.aria-expanded]=\"!collapsed()\"\r\n (click)=\"toggleCollapsed()\"\r\n size=\"s\"\r\n [icon]=\"collapsed() ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'\"\r\n color=\"black\"\r\n type=\"ghost\"\r\n [iconOnly]=\"true\">\r\n </ui-button>\r\n @if (!readOnly() && canDelete()) {\r\n <ui-button\r\n [uiTooltip]=\"(isBlockVisibilityParent() ? 'form_builder.delete_block_dependency_blocked' : 'form_builder.delete_block') | uicTranslate\"\r\n [disabled]=\"isBlockVisibilityParent()\"\r\n (click)=\"requestDeleteBlock($event)\"\r\n size=\"s\"\r\n icon=\"ri-delete-bin-line\"\r\n color=\"red\"\r\n type=\"ghost\"\r\n [iconOnly]=\"true\">\r\n </ui-button>\r\n }\r\n </div>\r\n\r\n @if (!collapsed()) {\r\n <div\r\n class=\"form-block-card-body\"\r\n cdkDropList\r\n [id]=\"fieldListId()\"\r\n [cdkDropListData]=\"block().code\"\r\n [cdkDropListConnectedTo]=\"connectedFieldListIds()\"\r\n [cdkDropListDisabled]=\"readOnly()\"\r\n (cdkDropListDropped)=\"reorderFields($event)\">\r\n\r\n <!-- FIELDS -->\r\n @for(edtField of block().fields; track edtField.code; let i = $index) {\r\n <div class=\"field-with-subfields\">\r\n <div\r\n class=\"xfield-card\"\r\n cdkDrag\r\n [attr.data-field-code]=\"edtField.code\"\r\n [cdkDragDisabled]=\"readOnly()\"\r\n [class.selected-field]=\"isRepeaterParentSelected(edtField)\"\r\n (click)=\"selectField(edtField)\">\r\n @if (!readOnly()) {\r\n <i class=\"ri-draggable field-drag-handle\" cdkDragHandle></i>\r\n }\r\n\r\n <div class=\"xfield-card-icon\">\r\n <i [class]=\"edtField.field?.icon ?? ''\"></i>\r\n </div>\r\n <div class=\"xfield-card-body\">\r\n <b>\r\n <span class=\"field-label\">{{edtField.fieldData.label || edtField.fieldData.name}}</span>\r\n @if (edtField.fieldData.required) {\r\n <span class=\"required-mark\" [uiTooltip]=\"'form_builder.base.required' | uicTranslate\">*</span>\r\n }\r\n @if (edtField.fieldData.hidden) {\r\n <i class=\"hidden-field ri-eye-off-line\" [uiTooltip]=\"'form_builder.base.hidden' | uicTranslate\"></i>\r\n }\r\n </b>\r\n <p class=\"field-meta\">\r\n <span>{{(edtField.field?.label ?? edtField.type ?? edtField.fieldData.type) | uicTranslate}}</span>\r\n @if (showIdentifier()) {\r\n <code class=\"field-identifier\" [uiTooltip]=\"'form_builder.base.name' | uicTranslate\">{{edtField.fieldData.name}}</code>\r\n }\r\n </p>\r\n @let rootRule = visibilitySummary(edtField);\r\n @if (rootRule) {\r\n <p class=\"vs-rule\">\r\n <i class=\"branched-field ri-git-merge-line\" aria-hidden=\"true\"></i>\r\n <span>{{rootRule.text}}</span>\r\n @if (rootRule.extraRules > 0) {\r\n <span class=\"vs-rule-extra\">+{{rootRule.extraRules}}</span>\r\n }\r\n </p>\r\n }\r\n </div>\r\n <div class=\"xfield-card-actions\">\r\n @if (edtField.fieldData.type === 'repeater') {\r\n <ui-button\r\n [uiTooltip]=\"(isRepeaterExpanded(edtField.code) ? 'form_builder.repeater.hide_subfields' : 'form_builder.repeater.show_subfields') | uicTranslate\"\r\n [icon]=\"isRepeaterExpanded(edtField.code) ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line'\"\r\n size=\"s\" color=\"black\" type=\"ghost\" [iconOnly]=\"true\"\r\n (click)=\"toggleRepeater(edtField.code, $event)\">\r\n </ui-button>\r\n }\r\n @if (!readOnly()) {\r\n @if (isTypeAvailable(edtField.fieldData.type) && !fieldLimitReached()) {\r\n <ui-button\r\n [uiTooltip]=\"'form_builder.field_editor.duplicate' | uicTranslate\"\r\n (click)=\"requestDuplicateField(edtField.code, $event)\"\r\n size=\"s\"\r\n icon=\"ri-file-copy-2-line\"\r\n color=\"black\"\r\n type=\"ghost\"\r\n [iconOnly]=\"true\">\r\n </ui-button>\r\n }\r\n <ui-button\r\n [uiTooltip]=\"(isVisibilityParent(edtField.code) ? 'form_builder.delete_field_dependency_blocked' : 'form_builder.field_editor.delete') | uicTranslate\"\r\n [disabled]=\"isVisibilityParent(edtField.code)\"\r\n (click)=\"deleteField(edtField.code, $event)\"\r\n size=\"s\"\r\n icon=\"ri-delete-bin-line\"\r\n color=\"red\"\r\n type=\"ghost\"\r\n [iconOnly]=\"true\">\r\n </ui-button>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (edtField.fieldData.type === 'repeater' && isRepeaterExpanded(edtField.code)) {\r\n <div class=\"repeater-inline-panel\">\r\n <div\r\n class=\"repeater-subfields-list\"\r\n cdkDropList\r\n [cdkDropListData]=\"edtField.repeaterSubFields ?? []\"\r\n [cdkDropListDisabled]=\"readOnly()\"\r\n (cdkDropListDropped)=\"reorderSubFields(edtField.code, $event)\">\r\n @for (sf of edtField.repeaterSubFields ?? []; track sf.code) {\r\n <div\r\n class=\"xfield-card subfield-card\"\r\n cdkDrag\r\n [attr.data-subfield-code]=\"edtField.code + ':' + sf.code\"\r\n [class.selected-field]=\"selectedSubFieldCode() === sf.code && edtField.code === selectedSubFieldParentCode()\"\r\n [cdkDragDisabled]=\"readOnly()\"\r\n (click)=\"onSelectSubField(edtField.code, sf, $event)\">\r\n @if (!readOnly()) {\r\n <i class=\"ri-draggable field-drag-handle\" cdkDragHandle></i>\r\n }\r\n <div class=\"xfield-card-icon\">\r\n <i [class]=\"sf.field?.icon ?? 'ri-question-line'\"></i>\r\n </div>\r\n <div class=\"xfield-card-body\">\r\n <b>\r\n <span class=\"field-label\">{{ sf.fieldData.label || sf.fieldData.name }}</span>\r\n @if (sf.fieldData.required) {\r\n <span class=\"required-mark\" [uiTooltip]=\"'form_builder.base.required' | uicTranslate\">*</span>\r\n }\r\n @if (sf.fieldData.hidden) {\r\n <i class=\"hidden-field ri-eye-off-line\" [uiTooltip]=\"'form_builder.base.hidden' | uicTranslate\"></i>\r\n }\r\n </b>\r\n <p class=\"field-meta\">\r\n <span>{{ (sf.field?.label ?? sf.type ?? sf.fieldData.type) | uicTranslate }}</span>\r\n @if (showIdentifier()) {\r\n <code class=\"field-identifier\" [uiTooltip]=\"'form_builder.base.name' | uicTranslate\">{{sf.fieldData.name}}</code>\r\n }\r\n </p>\r\n @let subRule = visibilitySummary(sf, edtField.repeaterSubFields ?? []);\r\n @if (subRule) {\r\n <p class=\"vs-rule\">\r\n <i class=\"branched-field ri-git-merge-line\" aria-hidden=\"true\"></i>\r\n <span>{{subRule.text}}</span>\r\n @if (subRule.extraRules > 0) {\r\n <span class=\"vs-rule-extra\">+{{subRule.extraRules}}</span>\r\n }\r\n </p>\r\n }\r\n </div>\r\n @if (!readOnly()) {\r\n <div class=\"xfield-card-actions\">\r\n @if (isTypeAvailable(sf.fieldData.type) && !isRepeaterFull(edtField)) {\r\n <ui-button\r\n [uiTooltip]=\"'form_builder.field_editor.duplicate' | uicTranslate\"\r\n size=\"s\" icon=\"ri-file-copy-2-line\" color=\"black\" type=\"ghost\" [iconOnly]=\"true\"\r\n (click)=\"duplicateSubField(edtField.code, sf.code, $event)\">\r\n </ui-button>\r\n }\r\n <ui-button\r\n [uiTooltip]=\"(isSubFieldVisibilityParent(edtField, sf.code) ? 'form_builder.delete_field_dependency_blocked' : 'form_builder.field_editor.delete') | uicTranslate\"\r\n [disabled]=\"isSubFieldVisibilityParent(edtField, sf.code)\"\r\n size=\"s\" icon=\"ri-delete-bin-line\" color=\"red\" type=\"ghost\" [iconOnly]=\"true\"\r\n (click)=\"deleteSubField(edtField.code, sf.code, $event)\">\r\n </ui-button>\r\n </div>\r\n }\r\n </div>\r\n } @empty {\r\n <p class=\"empty-hint\">{{'form_builder.repeater.no_subfields' | uicTranslate}}</p>\r\n }\r\n </div>\r\n @if (!readOnly()) {\r\n <div class=\"new-subfield\">\r\n <lib-field-type-selector label=\"form_builder.repeater.add_subfield\" size=\"t\" [allowedTypes]=\"availableFieldTypes()\" [disabled]=\"isRepeaterFull(edtField)\" [disabledReason]=\"repeaterLimitMessage()\" [excludeTypes]=\"excludeSubFieldTypes\" (selectType)=\"addSubField(edtField.code, $event)\"></lib-field-type-selector>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n } @empty {\r\n <div class=\"empty-block\">\r\n <i class=\"ri-layout-row-line\" aria-hidden=\"true\"></i>\r\n <p>{{(readOnly() ? 'form_builder.block.empty_read_only' : 'form_builder.no_fields_drop') | uicTranslate}}</p>\r\n </div>\r\n }\r\n\r\n </div>\r\n @if (!readOnly()) {\r\n <div class=\"new-field\">\r\n <lib-field-type-selector label=\"form_builder.add_new_field\" [allowedTypes]=\"availableFieldTypes()\" [disabled]=\"fieldLimitReached()\" [disabledReason]=\"fieldLimitMessage()\" (selectType)=\"addField($event)\"></lib-field-type-selector>\r\n </div>\r\n }\r\n }\r\n</div>\r\n", styles: [":host{display:block}.form-block-card{border:solid 1px var(--blue-500);border-radius:5px;overflow:hidden}.form-block-card-header{display:flex;gap:5px;align-items:flex-start;background-color:var(--uic-surface-raised, white);padding:10px 10px 10px 6px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300))}.form-block-card.collapsed .form-block-card-header{border-bottom:none;align-items:center}.form-block-card-body{padding:15px;display:flex;flex-direction:column;background-color:var(--uic-neutral-50, var(--grey-50));gap:10px;min-height:40px}:host(.cdk-drag-preview) .form-block-card{box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.block-drag-handle{cursor:grab;padding:4px 2px;color:var(--uic-neutral-400, var(--grey-400))}.block-drag-handle:hover{color:var(--uic-neutral-600, var(--grey-600))}.block-drag-handle:active{cursor:grabbing}.block-texts{flex:1 1;min-width:0;display:flex;flex-direction:column;gap:2px}.block-texts input{width:100%;border:solid 1px transparent;background:transparent;padding:2px 6px;border-radius:5px;color:var(--uic-neutral-800, var(--grey-800))}.block-texts input:hover{border-color:var(--uic-neutral-200, var(--grey-200))}.block-texts input:focus{border-color:var(--primary-500);background-color:var(--uic-surface, white);outline:none}.block-texts input::placeholder{color:var(--uic-neutral-400, var(--grey-400))}.block-texts input[readonly]{cursor:default}.block-texts input[readonly]:hover,.block-texts input[readonly]:focus{border-color:transparent;background:transparent}.block-texts .block-title-input{font-size:16px;font-weight:600}.block-texts .block-subtitle-input{font-size:13px;color:var(--uic-neutral-600, var(--grey-600))}.block-texts .block-message-input{font-size:12px;font-style:italic;color:var(--uic-neutral-500, var(--grey-500))}.block-count{flex:0 0 auto;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));padding:0 6px}.xfield-card{background-color:var(--uic-surface-raised, white);border-radius:5px;padding:10px;gap:10px;display:flex;align-items:center;border:solid 2px var(--uic-neutral-200, var(--grey-200));cursor:pointer;transition:border-color .3s ease}.xfield-card:hover{border-color:var(--uic-neutral-300, var(--grey-300))}.xfield-card-icon{display:flex;justify-content:center;align-items:center;border-radius:5px;width:30px;height:30px;font-size:20px;background-color:var(--uic-neutral-300, var(--grey-300));color:var(--uic-neutral-600, var(--grey-600))}.xfield-card-body{flex:1 1;min-width:0;display:flex;flex-direction:column;gap:2px}.xfield-card-body b{display:flex;align-items:center;gap:5px;min-width:0}.xfield-card-body p{color:var(--uic-neutral-400, var(--grey-400));font-size:12px}:host(.is-read-only) .xfield-card{background-color:var(--uic-readonly-card-bg, var(--uic-neutral-100, var(--grey-100)));border-color:var(--uic-neutral-200, var(--grey-200))}:host(.is-read-only) .xfield-card .xfield-card-icon{background-color:var(--uic-neutral-200, var(--grey-200));color:var(--uic-neutral-500, var(--grey-500))}:host(.is-read-only) .xfield-card.selected-field{border-color:var(--primary-500)}.field-drag-handle{cursor:grab;color:var(--uic-neutral-400, var(--grey-400));transition:color .2s ease}.field-drag-handle:active{cursor:grabbing}.xfield-card:hover .field-drag-handle{color:var(--uic-neutral-600, var(--grey-600))}.cdk-drag-preview{box-sizing:border-box;border-radius:5px;box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.field-with-subfields{display:flex;flex-direction:column;gap:0}.repeater-inline-panel{background-color:var(--uic-neutral-100, var(--grey-100));border:solid 1px var(--blue-300);border-top:none;border-radius:0 0 5px 5px;padding:10px 10px 8px 28px;display:flex;flex-direction:column;gap:8px}.repeater-subfields-list{display:flex;flex-direction:column;gap:6px;min-height:6px}.subfield-card{font-size:13px;border-radius:4px;padding:7px 8px!important}.subfield-card .xfield-card-icon{width:26px!important;height:26px!important;font-size:16px!important}.subfield-card b{font-size:13px}.subfield-card p{font-size:11px}.new-subfield{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));flex-wrap:wrap;padding-top:2px}.empty-hint{font-size:12px;color:var(--uic-neutral-400, var(--grey-400));text-align:center;padding:4px 0;margin:0}.form-block-card-body.cdk-drop-list-dragging .xfield-card:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.branched-field{color:var(--yellow-700)}.hidden-field{color:var(--uic-neutral-500, var(--grey-500))}.selected-field,.selected-field:hover{border-color:var(--primary-500)}.new-field{border-top:solid 1px var(--uic-neutral-300, var(--grey-300));padding:10px;background-color:var(--uic-surface-raised, white);display:flex;align-items:center;gap:5px;font-size:14px}.field-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.required-mark{color:var(--red-500);font-weight:700;cursor:default}.field-meta{display:flex;align-items:center;gap:6px;min-width:0}.field-identifier{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;padding:0 5px;border-radius:3px;background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-600, var(--grey-600));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xfield-card-body .vs-rule{display:flex;align-items:center;gap:4px;min-width:0;font-size:12px;color:var(--uic-neutral-600, var(--grey-600))}.xfield-card-body .vs-rule>span:not(.vs-rule-extra){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vs-rule-extra{flex:0 0 auto;font-size:11px;padding:0 5px;border-radius:8px;background-color:var(--yellow-100);color:var(--yellow-700)}.empty-block{display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 10px;border:dashed 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;font-size:13px;color:var(--uic-neutral-400, var(--grey-400))}.empty-block i{font-size:22px}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FieldTypeSelectorComponent, selector: "lib-field-type-selector", inputs: ["allowedTypes", "excludeTypes", "label", "size", "disabled", "disabledReason"], outputs: ["selectType"] }] });
|
|
13722
14222
|
}
|
|
13723
14223
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlockEditorComponent, decorators: [{
|
|
13724
14224
|
type: Component,
|
|
@@ -13729,14 +14229,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
13729
14229
|
DragDropModule,
|
|
13730
14230
|
FormsModule,
|
|
13731
14231
|
FieldTypeSelectorComponent
|
|
13732
|
-
], template: "<div class=\"form-block-card\" [class.collapsed]=\"collapsed()\">\n <div class=\"form-block-card-header\">\n @if (!readOnly()) {\n <i\n class=\"ri-draggable block-drag-handle\"\n cdkDragHandle\n [uiTooltip]=\"'form_builder.block.drag' | uicTranslate\"\n aria-hidden=\"true\"></i>\n }\n <div class=\"block-texts\">\n <input\n class=\"block-title-input\"\n [attr.aria-label]=\"'form_builder.block_title' | uicTranslate\"\n [placeholder]=\"'form_builder.block_title' | uicTranslate\"\n [readOnly]=\"readOnly()\"\n [ngModel]=\"block().title\"\n (ngModelChange)=\"changeTitle($event)\">\n @if (!collapsed() && (!readOnly() || block().subtitle || block().message)) {\n <input\n class=\"block-subtitle-input\"\n [attr.aria-label]=\"'form_builder.block_subtitle' | uicTranslate\"\n [placeholder]=\"'form_builder.block_subtitle' | uicTranslate\"\n [readOnly]=\"readOnly()\"\n [ngModel]=\"block().subtitle\"\n (ngModelChange)=\"changeSubtitle($event)\">\n <input\n class=\"block-message-input\"\n [attr.aria-label]=\"'form_builder.block_message' | uicTranslate\"\n [placeholder]=\"'form_builder.block_message' | uicTranslate\"\n [readOnly]=\"readOnly()\"\n [ngModel]=\"block().message\"\n (ngModelChange)=\"changeMessage($event)\">\n }\n </div>\n @if (collapsed()) {\n <span class=\"block-count\">{{'form_builder.block.field_count' | uicTranslate: { count: block().fields.length } }}</span>\n }\n <ui-button\n [uiTooltip]=\"(collapsed() ? 'form_builder.block.expand' : 'form_builder.block.collapse') | uicTranslate\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"toggleCollapsed()\"\n size=\"s\"\n [icon]=\"collapsed() ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'\"\n color=\"black\"\n type=\"ghost\"\n [iconOnly]=\"true\">\n </ui-button>\n @if (!readOnly() && canDelete()) {\n <ui-button\n [uiTooltip]=\"(isBlockVisibilityParent() ? 'form_builder.delete_block_dependency_blocked' : 'form_builder.delete_block') | uicTranslate\"\n [disabled]=\"isBlockVisibilityParent()\"\n (click)=\"requestDeleteBlock($event)\"\n size=\"s\"\n icon=\"ri-delete-bin-line\"\n color=\"red\"\n type=\"ghost\"\n [iconOnly]=\"true\">\n </ui-button>\n }\n </div>\n\n @if (!collapsed()) {\n <div\n class=\"form-block-card-body\"\n cdkDropList\n [id]=\"fieldListId()\"\n [cdkDropListData]=\"block().code\"\n [cdkDropListConnectedTo]=\"connectedFieldListIds()\"\n [cdkDropListDisabled]=\"readOnly()\"\n (cdkDropListDropped)=\"reorderFields($event)\">\n\n <!-- FIELDS -->\n @for(edtField of block().fields; track edtField.code; let i = $index) {\n <div class=\"field-with-subfields\">\n <div\n class=\"xfield-card\"\n cdkDrag\n [attr.data-field-code]=\"edtField.code\"\n [cdkDragDisabled]=\"readOnly()\"\n [class.selected-field]=\"isRepeaterParentSelected(edtField)\"\n (click)=\"selectField(edtField)\">\n @if (!readOnly()) {\n <i class=\"ri-draggable field-drag-handle\" cdkDragHandle></i>\n }\n\n <div class=\"xfield-card-icon\">\n <i [class]=\"edtField.field?.icon ?? ''\"></i>\n </div>\n <div class=\"xfield-card-body\">\n <b>\n <span class=\"field-label\">{{edtField.fieldData.label || edtField.fieldData.name}}</span>\n @if (edtField.fieldData.required) {\n <span class=\"required-mark\" [uiTooltip]=\"'form_builder.base.required' | uicTranslate\">*</span>\n }\n @if (edtField.fieldData.hidden) {\n <i class=\"hidden-field ri-eye-off-line\" [uiTooltip]=\"'form_builder.base.hidden' | uicTranslate\"></i>\n }\n </b>\n <p class=\"field-meta\">\n <span>{{(edtField.field?.label ?? edtField.type ?? edtField.fieldData.type) | uicTranslate}}</span>\n @if (showIdentifier()) {\n <code class=\"field-identifier\" [uiTooltip]=\"'form_builder.base.name' | uicTranslate\">{{edtField.fieldData.name}}</code>\n }\n </p>\n @let rootRule = visibilitySummary(edtField);\n @if (rootRule) {\n <p class=\"vs-rule\">\n <i class=\"branched-field ri-git-merge-line\" aria-hidden=\"true\"></i>\n <span>{{rootRule.text}}</span>\n @if (rootRule.extraRules > 0) {\n <span class=\"vs-rule-extra\">+{{rootRule.extraRules}}</span>\n }\n </p>\n }\n </div>\n <div class=\"xfield-card-actions\">\n @if (edtField.fieldData.type === 'repeater') {\n <ui-button\n [uiTooltip]=\"(isRepeaterExpanded(edtField.code) ? 'form_builder.repeater.hide_subfields' : 'form_builder.repeater.show_subfields') | uicTranslate\"\n [icon]=\"isRepeaterExpanded(edtField.code) ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line'\"\n size=\"s\" color=\"black\" type=\"ghost\" [iconOnly]=\"true\"\n (click)=\"toggleRepeater(edtField.code, $event)\">\n </ui-button>\n }\n @if (!readOnly()) {\n @if (isTypeAvailable(edtField.fieldData.type) && !fieldLimitReached()) {\n <ui-button\n [uiTooltip]=\"'form_builder.field_editor.duplicate' | uicTranslate\"\n (click)=\"requestDuplicateField(edtField.code, $event)\"\n size=\"s\"\n icon=\"ri-file-copy-2-line\"\n color=\"black\"\n type=\"ghost\"\n [iconOnly]=\"true\">\n </ui-button>\n }\n <ui-button\n [uiTooltip]=\"(isVisibilityParent(edtField.code) ? 'form_builder.delete_field_dependency_blocked' : 'form_builder.field_editor.delete') | uicTranslate\"\n [disabled]=\"isVisibilityParent(edtField.code)\"\n (click)=\"deleteField(edtField.code, $event)\"\n size=\"s\"\n icon=\"ri-delete-bin-line\"\n color=\"red\"\n type=\"ghost\"\n [iconOnly]=\"true\">\n </ui-button>\n }\n </div>\n </div>\n\n @if (edtField.fieldData.type === 'repeater' && isRepeaterExpanded(edtField.code)) {\n <div class=\"repeater-inline-panel\">\n <div\n class=\"repeater-subfields-list\"\n cdkDropList\n [cdkDropListData]=\"edtField.repeaterSubFields ?? []\"\n [cdkDropListDisabled]=\"readOnly()\"\n (cdkDropListDropped)=\"reorderSubFields(edtField.code, $event)\">\n @for (sf of edtField.repeaterSubFields ?? []; track sf.code) {\n <div\n class=\"xfield-card subfield-card\"\n cdkDrag\n [attr.data-subfield-code]=\"edtField.code + ':' + sf.code\"\n [class.selected-field]=\"selectedSubFieldCode() === sf.code && edtField.code === selectedSubFieldParentCode()\"\n [cdkDragDisabled]=\"readOnly()\"\n (click)=\"onSelectSubField(edtField.code, sf, $event)\">\n @if (!readOnly()) {\n <i class=\"ri-draggable field-drag-handle\" cdkDragHandle></i>\n }\n <div class=\"xfield-card-icon\">\n <i [class]=\"sf.field?.icon ?? 'ri-question-line'\"></i>\n </div>\n <div class=\"xfield-card-body\">\n <b>\n <span class=\"field-label\">{{ sf.fieldData.label || sf.fieldData.name }}</span>\n @if (sf.fieldData.required) {\n <span class=\"required-mark\" [uiTooltip]=\"'form_builder.base.required' | uicTranslate\">*</span>\n }\n @if (sf.fieldData.hidden) {\n <i class=\"hidden-field ri-eye-off-line\" [uiTooltip]=\"'form_builder.base.hidden' | uicTranslate\"></i>\n }\n </b>\n <p class=\"field-meta\">\n <span>{{ (sf.field?.label ?? sf.type ?? sf.fieldData.type) | uicTranslate }}</span>\n @if (showIdentifier()) {\n <code class=\"field-identifier\" [uiTooltip]=\"'form_builder.base.name' | uicTranslate\">{{sf.fieldData.name}}</code>\n }\n </p>\n @let subRule = visibilitySummary(sf, edtField.repeaterSubFields ?? []);\n @if (subRule) {\n <p class=\"vs-rule\">\n <i class=\"branched-field ri-git-merge-line\" aria-hidden=\"true\"></i>\n <span>{{subRule.text}}</span>\n @if (subRule.extraRules > 0) {\n <span class=\"vs-rule-extra\">+{{subRule.extraRules}}</span>\n }\n </p>\n }\n </div>\n @if (!readOnly()) {\n <div class=\"xfield-card-actions\">\n @if (isTypeAvailable(sf.fieldData.type) && !isRepeaterFull(edtField)) {\n <ui-button\n [uiTooltip]=\"'form_builder.field_editor.duplicate' | uicTranslate\"\n size=\"s\" icon=\"ri-file-copy-2-line\" color=\"black\" type=\"ghost\" [iconOnly]=\"true\"\n (click)=\"duplicateSubField(edtField.code, sf.code, $event)\">\n </ui-button>\n }\n <ui-button\n [uiTooltip]=\"(isSubFieldVisibilityParent(edtField, sf.code) ? 'form_builder.delete_field_dependency_blocked' : 'form_builder.field_editor.delete') | uicTranslate\"\n [disabled]=\"isSubFieldVisibilityParent(edtField, sf.code)\"\n size=\"s\" icon=\"ri-delete-bin-line\" color=\"red\" type=\"ghost\" [iconOnly]=\"true\"\n (click)=\"deleteSubField(edtField.code, sf.code, $event)\">\n </ui-button>\n </div>\n }\n </div>\n } @empty {\n <p class=\"empty-hint\">{{'form_builder.repeater.no_subfields' | uicTranslate}}</p>\n }\n </div>\n @if (!readOnly()) {\n <div class=\"new-subfield\">\n <lib-field-type-selector label=\"form_builder.repeater.add_subfield\" size=\"t\" [allowedTypes]=\"availableFieldTypes()\" [disabled]=\"isRepeaterFull(edtField)\" [disabledReason]=\"repeaterLimitMessage()\" [excludeTypes]=\"excludeSubFieldTypes\" (selectType)=\"addSubField(edtField.code, $event)\"></lib-field-type-selector>\n </div>\n }\n </div>\n }\n </div>\n\n } @empty {\n <div class=\"empty-block\">\n <i class=\"ri-layout-row-line\" aria-hidden=\"true\"></i>\n <p>{{(readOnly() ? 'form_builder.block.empty_read_only' : 'form_builder.no_fields_drop') | uicTranslate}}</p>\n </div>\n }\n\n </div>\n @if (!readOnly()) {\n <div class=\"new-field\">\n <lib-field-type-selector label=\"form_builder.add_new_field\" [allowedTypes]=\"availableFieldTypes()\" [disabled]=\"fieldLimitReached()\" [disabledReason]=\"fieldLimitMessage()\" (selectType)=\"addField($event)\"></lib-field-type-selector>\n </div>\n }\n }\n</div>\n", styles: [":host{display:block}.form-block-card{border:solid 1px var(--blue-500);border-radius:5px;overflow:hidden}.form-block-card-header{display:flex;gap:5px;align-items:flex-start;background-color:var(--uic-surface-raised, white);padding:10px 10px 10px 6px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300))}.form-block-card.collapsed .form-block-card-header{border-bottom:none;align-items:center}.form-block-card-body{padding:15px;display:flex;flex-direction:column;background-color:var(--uic-neutral-50, var(--grey-50));gap:10px;min-height:40px}:host(.cdk-drag-preview) .form-block-card{box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.block-drag-handle{cursor:grab;padding:4px 2px;color:var(--uic-neutral-400, var(--grey-400))}.block-drag-handle:hover{color:var(--uic-neutral-600, var(--grey-600))}.block-drag-handle:active{cursor:grabbing}.block-texts{flex:1 1;min-width:0;display:flex;flex-direction:column;gap:2px}.block-texts input{width:100%;border:solid 1px transparent;background:transparent;padding:2px 6px;border-radius:5px;color:var(--uic-neutral-800, var(--grey-800))}.block-texts input:hover{border-color:var(--uic-neutral-200, var(--grey-200))}.block-texts input:focus{border-color:var(--primary-500);background-color:var(--uic-surface, white);outline:none}.block-texts input::placeholder{color:var(--uic-neutral-400, var(--grey-400))}.block-texts input[readonly]{cursor:default}.block-texts input[readonly]:hover,.block-texts input[readonly]:focus{border-color:transparent;background:transparent}.block-texts .block-title-input{font-size:16px;font-weight:600}.block-texts .block-subtitle-input{font-size:13px;color:var(--uic-neutral-600, var(--grey-600))}.block-texts .block-message-input{font-size:12px;font-style:italic;color:var(--uic-neutral-500, var(--grey-500))}.block-count{flex:0 0 auto;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));padding:0 6px}.xfield-card{background-color:var(--uic-surface-raised, white);border-radius:5px;padding:10px;gap:10px;display:flex;align-items:center;border:solid 2px var(--uic-neutral-200, var(--grey-200));cursor:pointer;transition:border-color .3s ease}.xfield-card:hover{border-color:var(--uic-neutral-300, var(--grey-300))}.xfield-card-icon{display:flex;justify-content:center;align-items:center;border-radius:5px;width:30px;height:30px;font-size:20px;background-color:var(--uic-neutral-300, var(--grey-300));color:var(--uic-neutral-600, var(--grey-600))}.xfield-card-body{flex:1 1;min-width:0;display:flex;flex-direction:column;gap:2px}.xfield-card-body b{display:flex;align-items:center;gap:5px;min-width:0}.xfield-card-body p{color:var(--uic-neutral-400, var(--grey-400));font-size:12px}.field-drag-handle{cursor:grab;color:var(--uic-neutral-400, var(--grey-400));transition:color .2s ease}.field-drag-handle:active{cursor:grabbing}.xfield-card:hover .field-drag-handle{color:var(--uic-neutral-600, var(--grey-600))}.cdk-drag-preview{box-sizing:border-box;border-radius:5px;box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.field-with-subfields{display:flex;flex-direction:column;gap:0}.repeater-inline-panel{background-color:var(--uic-neutral-100, var(--grey-100));border:solid 1px var(--blue-300);border-top:none;border-radius:0 0 5px 5px;padding:10px 10px 8px 28px;display:flex;flex-direction:column;gap:8px}.repeater-subfields-list{display:flex;flex-direction:column;gap:6px;min-height:6px}.subfield-card{font-size:13px;border-radius:4px;padding:7px 8px!important}.subfield-card .xfield-card-icon{width:26px!important;height:26px!important;font-size:16px!important}.subfield-card b{font-size:13px}.subfield-card p{font-size:11px}.new-subfield{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));flex-wrap:wrap;padding-top:2px}.empty-hint{font-size:12px;color:var(--uic-neutral-400, var(--grey-400));text-align:center;padding:4px 0;margin:0}.form-block-card-body.cdk-drop-list-dragging .xfield-card:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.branched-field{color:var(--yellow-700)}.hidden-field{color:var(--uic-neutral-500, var(--grey-500))}.selected-field,.selected-field:hover{border-color:var(--primary-500)}.new-field{border-top:solid 1px var(--uic-neutral-300, var(--grey-300));padding:10px;background-color:var(--uic-surface-raised, white);display:flex;align-items:center;gap:5px;font-size:14px}.field-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.required-mark{color:var(--red-500);font-weight:700;cursor:default}.field-meta{display:flex;align-items:center;gap:6px;min-width:0}.field-identifier{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;padding:0 5px;border-radius:3px;background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-600, var(--grey-600));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xfield-card-body .vs-rule{display:flex;align-items:center;gap:4px;min-width:0;font-size:12px;color:var(--uic-neutral-600, var(--grey-600))}.xfield-card-body .vs-rule>span:not(.vs-rule-extra){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vs-rule-extra{flex:0 0 auto;font-size:11px;padding:0 5px;border-radius:8px;background-color:var(--yellow-100);color:var(--yellow-700)}.empty-block{display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 10px;border:dashed 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;font-size:13px;color:var(--uic-neutral-400, var(--grey-400))}.empty-block i{font-size:22px}\n"] }]
|
|
14232
|
+
], host: {
|
|
14233
|
+
'[class.is-read-only]': 'readOnly()'
|
|
14234
|
+
}, template: "<div class=\"form-block-card\" [class.collapsed]=\"collapsed()\">\r\n <div class=\"form-block-card-header\">\r\n @if (!readOnly()) {\r\n <i\r\n class=\"ri-draggable block-drag-handle\"\r\n cdkDragHandle\r\n [uiTooltip]=\"'form_builder.block.drag' | uicTranslate\"\r\n aria-hidden=\"true\"></i>\r\n }\r\n <div class=\"block-texts\">\r\n <input\r\n class=\"block-title-input\"\r\n [attr.aria-label]=\"'form_builder.block_title' | uicTranslate\"\r\n [placeholder]=\"'form_builder.block_title' | uicTranslate\"\r\n [readOnly]=\"readOnly()\"\r\n [ngModel]=\"block().title\"\r\n (ngModelChange)=\"changeTitle($event)\">\r\n @if (!collapsed() && (!readOnly() || block().subtitle || block().message)) {\r\n <input\r\n class=\"block-subtitle-input\"\r\n [attr.aria-label]=\"'form_builder.block_subtitle' | uicTranslate\"\r\n [placeholder]=\"'form_builder.block_subtitle' | uicTranslate\"\r\n [readOnly]=\"readOnly()\"\r\n [ngModel]=\"block().subtitle\"\r\n (ngModelChange)=\"changeSubtitle($event)\">\r\n <input\r\n class=\"block-message-input\"\r\n [attr.aria-label]=\"'form_builder.block_message' | uicTranslate\"\r\n [placeholder]=\"'form_builder.block_message' | uicTranslate\"\r\n [readOnly]=\"readOnly()\"\r\n [ngModel]=\"block().message\"\r\n (ngModelChange)=\"changeMessage($event)\">\r\n }\r\n </div>\r\n @if (collapsed()) {\r\n <span class=\"block-count\">{{'form_builder.block.field_count' | uicTranslate: { count: block().fields.length } }}</span>\r\n }\r\n <ui-button\r\n [uiTooltip]=\"(collapsed() ? 'form_builder.block.expand' : 'form_builder.block.collapse') | uicTranslate\"\r\n [attr.aria-expanded]=\"!collapsed()\"\r\n (click)=\"toggleCollapsed()\"\r\n size=\"s\"\r\n [icon]=\"collapsed() ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'\"\r\n color=\"black\"\r\n type=\"ghost\"\r\n [iconOnly]=\"true\">\r\n </ui-button>\r\n @if (!readOnly() && canDelete()) {\r\n <ui-button\r\n [uiTooltip]=\"(isBlockVisibilityParent() ? 'form_builder.delete_block_dependency_blocked' : 'form_builder.delete_block') | uicTranslate\"\r\n [disabled]=\"isBlockVisibilityParent()\"\r\n (click)=\"requestDeleteBlock($event)\"\r\n size=\"s\"\r\n icon=\"ri-delete-bin-line\"\r\n color=\"red\"\r\n type=\"ghost\"\r\n [iconOnly]=\"true\">\r\n </ui-button>\r\n }\r\n </div>\r\n\r\n @if (!collapsed()) {\r\n <div\r\n class=\"form-block-card-body\"\r\n cdkDropList\r\n [id]=\"fieldListId()\"\r\n [cdkDropListData]=\"block().code\"\r\n [cdkDropListConnectedTo]=\"connectedFieldListIds()\"\r\n [cdkDropListDisabled]=\"readOnly()\"\r\n (cdkDropListDropped)=\"reorderFields($event)\">\r\n\r\n <!-- FIELDS -->\r\n @for(edtField of block().fields; track edtField.code; let i = $index) {\r\n <div class=\"field-with-subfields\">\r\n <div\r\n class=\"xfield-card\"\r\n cdkDrag\r\n [attr.data-field-code]=\"edtField.code\"\r\n [cdkDragDisabled]=\"readOnly()\"\r\n [class.selected-field]=\"isRepeaterParentSelected(edtField)\"\r\n (click)=\"selectField(edtField)\">\r\n @if (!readOnly()) {\r\n <i class=\"ri-draggable field-drag-handle\" cdkDragHandle></i>\r\n }\r\n\r\n <div class=\"xfield-card-icon\">\r\n <i [class]=\"edtField.field?.icon ?? ''\"></i>\r\n </div>\r\n <div class=\"xfield-card-body\">\r\n <b>\r\n <span class=\"field-label\">{{edtField.fieldData.label || edtField.fieldData.name}}</span>\r\n @if (edtField.fieldData.required) {\r\n <span class=\"required-mark\" [uiTooltip]=\"'form_builder.base.required' | uicTranslate\">*</span>\r\n }\r\n @if (edtField.fieldData.hidden) {\r\n <i class=\"hidden-field ri-eye-off-line\" [uiTooltip]=\"'form_builder.base.hidden' | uicTranslate\"></i>\r\n }\r\n </b>\r\n <p class=\"field-meta\">\r\n <span>{{(edtField.field?.label ?? edtField.type ?? edtField.fieldData.type) | uicTranslate}}</span>\r\n @if (showIdentifier()) {\r\n <code class=\"field-identifier\" [uiTooltip]=\"'form_builder.base.name' | uicTranslate\">{{edtField.fieldData.name}}</code>\r\n }\r\n </p>\r\n @let rootRule = visibilitySummary(edtField);\r\n @if (rootRule) {\r\n <p class=\"vs-rule\">\r\n <i class=\"branched-field ri-git-merge-line\" aria-hidden=\"true\"></i>\r\n <span>{{rootRule.text}}</span>\r\n @if (rootRule.extraRules > 0) {\r\n <span class=\"vs-rule-extra\">+{{rootRule.extraRules}}</span>\r\n }\r\n </p>\r\n }\r\n </div>\r\n <div class=\"xfield-card-actions\">\r\n @if (edtField.fieldData.type === 'repeater') {\r\n <ui-button\r\n [uiTooltip]=\"(isRepeaterExpanded(edtField.code) ? 'form_builder.repeater.hide_subfields' : 'form_builder.repeater.show_subfields') | uicTranslate\"\r\n [icon]=\"isRepeaterExpanded(edtField.code) ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line'\"\r\n size=\"s\" color=\"black\" type=\"ghost\" [iconOnly]=\"true\"\r\n (click)=\"toggleRepeater(edtField.code, $event)\">\r\n </ui-button>\r\n }\r\n @if (!readOnly()) {\r\n @if (isTypeAvailable(edtField.fieldData.type) && !fieldLimitReached()) {\r\n <ui-button\r\n [uiTooltip]=\"'form_builder.field_editor.duplicate' | uicTranslate\"\r\n (click)=\"requestDuplicateField(edtField.code, $event)\"\r\n size=\"s\"\r\n icon=\"ri-file-copy-2-line\"\r\n color=\"black\"\r\n type=\"ghost\"\r\n [iconOnly]=\"true\">\r\n </ui-button>\r\n }\r\n <ui-button\r\n [uiTooltip]=\"(isVisibilityParent(edtField.code) ? 'form_builder.delete_field_dependency_blocked' : 'form_builder.field_editor.delete') | uicTranslate\"\r\n [disabled]=\"isVisibilityParent(edtField.code)\"\r\n (click)=\"deleteField(edtField.code, $event)\"\r\n size=\"s\"\r\n icon=\"ri-delete-bin-line\"\r\n color=\"red\"\r\n type=\"ghost\"\r\n [iconOnly]=\"true\">\r\n </ui-button>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (edtField.fieldData.type === 'repeater' && isRepeaterExpanded(edtField.code)) {\r\n <div class=\"repeater-inline-panel\">\r\n <div\r\n class=\"repeater-subfields-list\"\r\n cdkDropList\r\n [cdkDropListData]=\"edtField.repeaterSubFields ?? []\"\r\n [cdkDropListDisabled]=\"readOnly()\"\r\n (cdkDropListDropped)=\"reorderSubFields(edtField.code, $event)\">\r\n @for (sf of edtField.repeaterSubFields ?? []; track sf.code) {\r\n <div\r\n class=\"xfield-card subfield-card\"\r\n cdkDrag\r\n [attr.data-subfield-code]=\"edtField.code + ':' + sf.code\"\r\n [class.selected-field]=\"selectedSubFieldCode() === sf.code && edtField.code === selectedSubFieldParentCode()\"\r\n [cdkDragDisabled]=\"readOnly()\"\r\n (click)=\"onSelectSubField(edtField.code, sf, $event)\">\r\n @if (!readOnly()) {\r\n <i class=\"ri-draggable field-drag-handle\" cdkDragHandle></i>\r\n }\r\n <div class=\"xfield-card-icon\">\r\n <i [class]=\"sf.field?.icon ?? 'ri-question-line'\"></i>\r\n </div>\r\n <div class=\"xfield-card-body\">\r\n <b>\r\n <span class=\"field-label\">{{ sf.fieldData.label || sf.fieldData.name }}</span>\r\n @if (sf.fieldData.required) {\r\n <span class=\"required-mark\" [uiTooltip]=\"'form_builder.base.required' | uicTranslate\">*</span>\r\n }\r\n @if (sf.fieldData.hidden) {\r\n <i class=\"hidden-field ri-eye-off-line\" [uiTooltip]=\"'form_builder.base.hidden' | uicTranslate\"></i>\r\n }\r\n </b>\r\n <p class=\"field-meta\">\r\n <span>{{ (sf.field?.label ?? sf.type ?? sf.fieldData.type) | uicTranslate }}</span>\r\n @if (showIdentifier()) {\r\n <code class=\"field-identifier\" [uiTooltip]=\"'form_builder.base.name' | uicTranslate\">{{sf.fieldData.name}}</code>\r\n }\r\n </p>\r\n @let subRule = visibilitySummary(sf, edtField.repeaterSubFields ?? []);\r\n @if (subRule) {\r\n <p class=\"vs-rule\">\r\n <i class=\"branched-field ri-git-merge-line\" aria-hidden=\"true\"></i>\r\n <span>{{subRule.text}}</span>\r\n @if (subRule.extraRules > 0) {\r\n <span class=\"vs-rule-extra\">+{{subRule.extraRules}}</span>\r\n }\r\n </p>\r\n }\r\n </div>\r\n @if (!readOnly()) {\r\n <div class=\"xfield-card-actions\">\r\n @if (isTypeAvailable(sf.fieldData.type) && !isRepeaterFull(edtField)) {\r\n <ui-button\r\n [uiTooltip]=\"'form_builder.field_editor.duplicate' | uicTranslate\"\r\n size=\"s\" icon=\"ri-file-copy-2-line\" color=\"black\" type=\"ghost\" [iconOnly]=\"true\"\r\n (click)=\"duplicateSubField(edtField.code, sf.code, $event)\">\r\n </ui-button>\r\n }\r\n <ui-button\r\n [uiTooltip]=\"(isSubFieldVisibilityParent(edtField, sf.code) ? 'form_builder.delete_field_dependency_blocked' : 'form_builder.field_editor.delete') | uicTranslate\"\r\n [disabled]=\"isSubFieldVisibilityParent(edtField, sf.code)\"\r\n size=\"s\" icon=\"ri-delete-bin-line\" color=\"red\" type=\"ghost\" [iconOnly]=\"true\"\r\n (click)=\"deleteSubField(edtField.code, sf.code, $event)\">\r\n </ui-button>\r\n </div>\r\n }\r\n </div>\r\n } @empty {\r\n <p class=\"empty-hint\">{{'form_builder.repeater.no_subfields' | uicTranslate}}</p>\r\n }\r\n </div>\r\n @if (!readOnly()) {\r\n <div class=\"new-subfield\">\r\n <lib-field-type-selector label=\"form_builder.repeater.add_subfield\" size=\"t\" [allowedTypes]=\"availableFieldTypes()\" [disabled]=\"isRepeaterFull(edtField)\" [disabledReason]=\"repeaterLimitMessage()\" [excludeTypes]=\"excludeSubFieldTypes\" (selectType)=\"addSubField(edtField.code, $event)\"></lib-field-type-selector>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n } @empty {\r\n <div class=\"empty-block\">\r\n <i class=\"ri-layout-row-line\" aria-hidden=\"true\"></i>\r\n <p>{{(readOnly() ? 'form_builder.block.empty_read_only' : 'form_builder.no_fields_drop') | uicTranslate}}</p>\r\n </div>\r\n }\r\n\r\n </div>\r\n @if (!readOnly()) {\r\n <div class=\"new-field\">\r\n <lib-field-type-selector label=\"form_builder.add_new_field\" [allowedTypes]=\"availableFieldTypes()\" [disabled]=\"fieldLimitReached()\" [disabledReason]=\"fieldLimitMessage()\" (selectType)=\"addField($event)\"></lib-field-type-selector>\r\n </div>\r\n }\r\n }\r\n</div>\r\n", styles: [":host{display:block}.form-block-card{border:solid 1px var(--blue-500);border-radius:5px;overflow:hidden}.form-block-card-header{display:flex;gap:5px;align-items:flex-start;background-color:var(--uic-surface-raised, white);padding:10px 10px 10px 6px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300))}.form-block-card.collapsed .form-block-card-header{border-bottom:none;align-items:center}.form-block-card-body{padding:15px;display:flex;flex-direction:column;background-color:var(--uic-neutral-50, var(--grey-50));gap:10px;min-height:40px}:host(.cdk-drag-preview) .form-block-card{box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.block-drag-handle{cursor:grab;padding:4px 2px;color:var(--uic-neutral-400, var(--grey-400))}.block-drag-handle:hover{color:var(--uic-neutral-600, var(--grey-600))}.block-drag-handle:active{cursor:grabbing}.block-texts{flex:1 1;min-width:0;display:flex;flex-direction:column;gap:2px}.block-texts input{width:100%;border:solid 1px transparent;background:transparent;padding:2px 6px;border-radius:5px;color:var(--uic-neutral-800, var(--grey-800))}.block-texts input:hover{border-color:var(--uic-neutral-200, var(--grey-200))}.block-texts input:focus{border-color:var(--primary-500);background-color:var(--uic-surface, white);outline:none}.block-texts input::placeholder{color:var(--uic-neutral-400, var(--grey-400))}.block-texts input[readonly]{cursor:default}.block-texts input[readonly]:hover,.block-texts input[readonly]:focus{border-color:transparent;background:transparent}.block-texts .block-title-input{font-size:16px;font-weight:600}.block-texts .block-subtitle-input{font-size:13px;color:var(--uic-neutral-600, var(--grey-600))}.block-texts .block-message-input{font-size:12px;font-style:italic;color:var(--uic-neutral-500, var(--grey-500))}.block-count{flex:0 0 auto;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));padding:0 6px}.xfield-card{background-color:var(--uic-surface-raised, white);border-radius:5px;padding:10px;gap:10px;display:flex;align-items:center;border:solid 2px var(--uic-neutral-200, var(--grey-200));cursor:pointer;transition:border-color .3s ease}.xfield-card:hover{border-color:var(--uic-neutral-300, var(--grey-300))}.xfield-card-icon{display:flex;justify-content:center;align-items:center;border-radius:5px;width:30px;height:30px;font-size:20px;background-color:var(--uic-neutral-300, var(--grey-300));color:var(--uic-neutral-600, var(--grey-600))}.xfield-card-body{flex:1 1;min-width:0;display:flex;flex-direction:column;gap:2px}.xfield-card-body b{display:flex;align-items:center;gap:5px;min-width:0}.xfield-card-body p{color:var(--uic-neutral-400, var(--grey-400));font-size:12px}:host(.is-read-only) .xfield-card{background-color:var(--uic-readonly-card-bg, var(--uic-neutral-100, var(--grey-100)));border-color:var(--uic-neutral-200, var(--grey-200))}:host(.is-read-only) .xfield-card .xfield-card-icon{background-color:var(--uic-neutral-200, var(--grey-200));color:var(--uic-neutral-500, var(--grey-500))}:host(.is-read-only) .xfield-card.selected-field{border-color:var(--primary-500)}.field-drag-handle{cursor:grab;color:var(--uic-neutral-400, var(--grey-400));transition:color .2s ease}.field-drag-handle:active{cursor:grabbing}.xfield-card:hover .field-drag-handle{color:var(--uic-neutral-600, var(--grey-600))}.cdk-drag-preview{box-sizing:border-box;border-radius:5px;box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18))}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.field-with-subfields{display:flex;flex-direction:column;gap:0}.repeater-inline-panel{background-color:var(--uic-neutral-100, var(--grey-100));border:solid 1px var(--blue-300);border-top:none;border-radius:0 0 5px 5px;padding:10px 10px 8px 28px;display:flex;flex-direction:column;gap:8px}.repeater-subfields-list{display:flex;flex-direction:column;gap:6px;min-height:6px}.subfield-card{font-size:13px;border-radius:4px;padding:7px 8px!important}.subfield-card .xfield-card-icon{width:26px!important;height:26px!important;font-size:16px!important}.subfield-card b{font-size:13px}.subfield-card p{font-size:11px}.new-subfield{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));flex-wrap:wrap;padding-top:2px}.empty-hint{font-size:12px;color:var(--uic-neutral-400, var(--grey-400));text-align:center;padding:4px 0;margin:0}.form-block-card-body.cdk-drop-list-dragging .xfield-card:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.branched-field{color:var(--yellow-700)}.hidden-field{color:var(--uic-neutral-500, var(--grey-500))}.selected-field,.selected-field:hover{border-color:var(--primary-500)}.new-field{border-top:solid 1px var(--uic-neutral-300, var(--grey-300));padding:10px;background-color:var(--uic-surface-raised, white);display:flex;align-items:center;gap:5px;font-size:14px}.field-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.required-mark{color:var(--red-500);font-weight:700;cursor:default}.field-meta{display:flex;align-items:center;gap:6px;min-width:0}.field-identifier{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;padding:0 5px;border-radius:3px;background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-600, var(--grey-600));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xfield-card-body .vs-rule{display:flex;align-items:center;gap:4px;min-width:0;font-size:12px;color:var(--uic-neutral-600, var(--grey-600))}.xfield-card-body .vs-rule>span:not(.vs-rule-extra){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vs-rule-extra{flex:0 0 auto;font-size:11px;padding:0 5px;border-radius:8px;background-color:var(--yellow-100);color:var(--yellow-700)}.empty-block{display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 10px;border:dashed 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;font-size:13px;color:var(--uic-neutral-400, var(--grey-400))}.empty-block i{font-size:22px}\n"] }]
|
|
13733
14235
|
}], ctorParameters: () => [], propDecorators: { visibilityParentFieldCodes: [{
|
|
13734
14236
|
type: Input
|
|
13735
14237
|
}], fieldLookup: [{
|
|
13736
14238
|
type: Input
|
|
13737
14239
|
}] } });
|
|
13738
14240
|
|
|
13739
|
-
const UNDO_TIMEOUT_MS = 6000;
|
|
13740
14241
|
/**
|
|
13741
14242
|
* Opciones manuales de un campo del que se puede depender: el editor de reglas las usa para
|
|
13742
14243
|
* mostrar un selector de valor (y su texto) en vez de pedir el id a mano. Con origen externo no hay lista fija.
|
|
@@ -13751,12 +14252,91 @@ const dependencyValueOptions = (fieldData) => {
|
|
|
13751
14252
|
}
|
|
13752
14253
|
return manual;
|
|
13753
14254
|
};
|
|
14255
|
+
/** Ids de opciones que tenía `before` y ya no tiene `after`. Vacío si `after` no tiene opciones manuales. */
|
|
14256
|
+
function removedOptionIds(before, after) {
|
|
14257
|
+
const next = dependencyValueOptions(after);
|
|
14258
|
+
if (!next)
|
|
14259
|
+
return new Set();
|
|
14260
|
+
const nextIds = new Set(next.map(opt => String(opt.id)));
|
|
14261
|
+
return new Set((dependencyValueOptions(before) ?? [])
|
|
14262
|
+
.map(opt => String(opt.id))
|
|
14263
|
+
.filter(id => !nextIds.has(id)));
|
|
14264
|
+
}
|
|
14265
|
+
/**
|
|
14266
|
+
* Quita de las reglas de visibilidad las referencias a opciones eliminadas de un campo.
|
|
14267
|
+
* - in / notIn: se quitan los ids eliminados del arreglo; si queda vacío, se elimina la regla.
|
|
14268
|
+
* - equals / notEquals (e includes / notIncludes si el campo es multyselect): se elimina la regla
|
|
14269
|
+
* si su valor era una opción eliminada.
|
|
14270
|
+
* Alcance: un campo raíz puede ser referenciado por campos raíz y subcampos; un subcampo, solo por
|
|
14271
|
+
* sus hermanos del mismo repetidor (los codes de subcampo se repiten entre repetidores).
|
|
14272
|
+
* Devuelve los mismos objetos para lo que no cambió.
|
|
14273
|
+
*/
|
|
14274
|
+
function pruneRulesForRemovedOptions(blocks, ref, removedIds, changedFieldType) {
|
|
14275
|
+
if (!removedIds.size)
|
|
14276
|
+
return { blocks, changed: 0 };
|
|
14277
|
+
let changed = 0;
|
|
14278
|
+
const pruneRule = (rule) => {
|
|
14279
|
+
if (rule.fieldName !== ref.code)
|
|
14280
|
+
return rule;
|
|
14281
|
+
const operator = rule.operator;
|
|
14282
|
+
if (operator === 'in' || operator === 'notIn') {
|
|
14283
|
+
if (!Array.isArray(rule.value))
|
|
14284
|
+
return rule;
|
|
14285
|
+
const value = rule.value.filter(item => !removedIds.has(String(item)));
|
|
14286
|
+
if (value.length === rule.value.length)
|
|
14287
|
+
return rule;
|
|
14288
|
+
changed++;
|
|
14289
|
+
return value.length ? { ...rule, value } : null;
|
|
14290
|
+
}
|
|
14291
|
+
const valueOperators = changedFieldType === 'multyselect'
|
|
14292
|
+
? ['equals', 'notEquals', 'includes', 'notIncludes']
|
|
14293
|
+
: ['equals', 'notEquals'];
|
|
14294
|
+
if (valueOperators.includes(operator) && rule.value !== null && rule.value !== undefined && removedIds.has(String(rule.value))) {
|
|
14295
|
+
changed++;
|
|
14296
|
+
return null;
|
|
14297
|
+
}
|
|
14298
|
+
return rule;
|
|
14299
|
+
};
|
|
14300
|
+
const pruneField = (field) => {
|
|
14301
|
+
const rules = field.fieldData.visibilityRules;
|
|
14302
|
+
if (!rules?.length)
|
|
14303
|
+
return field;
|
|
14304
|
+
const before = changed;
|
|
14305
|
+
const next = rules.map(pruneRule).filter((rule) => rule !== null);
|
|
14306
|
+
if (changed === before)
|
|
14307
|
+
return field;
|
|
14308
|
+
return {
|
|
14309
|
+
...field,
|
|
14310
|
+
fieldData: { ...field.fieldData, visibilityRules: next.length ? next : null }
|
|
14311
|
+
};
|
|
14312
|
+
};
|
|
14313
|
+
const pruneSubFields = (field) => {
|
|
14314
|
+
const subFields = field.repeaterSubFields;
|
|
14315
|
+
if (!subFields?.length)
|
|
14316
|
+
return field;
|
|
14317
|
+
const next = subFields.map(pruneField);
|
|
14318
|
+
return next.some((sf, i) => sf !== subFields[i]) ? { ...field, repeaterSubFields: next } : field;
|
|
14319
|
+
};
|
|
14320
|
+
const nextBlocks = blocks.map(block => {
|
|
14321
|
+
const fields = block.fields.map(field => {
|
|
14322
|
+
if (ref.kind === 'field') {
|
|
14323
|
+
return pruneSubFields(pruneField(field));
|
|
14324
|
+
}
|
|
14325
|
+
return field.code === ref.parentCode ? pruneSubFields(field) : field;
|
|
14326
|
+
});
|
|
14327
|
+
return fields.some((field, i) => field !== block.fields[i]) ? { ...block, fields } : block;
|
|
14328
|
+
});
|
|
14329
|
+
return { blocks: changed ? nextBlocks : blocks, changed };
|
|
14330
|
+
}
|
|
14331
|
+
|
|
14332
|
+
const UNDO_TIMEOUT_MS = 6000;
|
|
13754
14333
|
const DEFAULT_PROPERTIES_WIDTH = 320;
|
|
13755
14334
|
const clampPropertiesWidth = (width) => Math.min(Math.max(width, 250), 600);
|
|
13756
14335
|
class UicUserFormbuilderComponent {
|
|
13757
14336
|
modalService = inject(UicModalService);
|
|
13758
14337
|
host = inject(ElementRef);
|
|
13759
14338
|
tinyAlertService = inject(UicTinyAlertService);
|
|
14339
|
+
pushAlertService = inject(UicPushAlertService);
|
|
13760
14340
|
translateService = inject(UicTranslateService);
|
|
13761
14341
|
disabled = false;
|
|
13762
14342
|
/**
|
|
@@ -13781,6 +14361,13 @@ class UicUserFormbuilderComponent {
|
|
|
13781
14361
|
previewMode = input('form');
|
|
13782
14362
|
/** Ajustes de la vista previa en modo encuesta. `config.preview.survey` tiene prioridad (ver previewMode). */
|
|
13783
14363
|
surveyPreviewOptions = input(null);
|
|
14364
|
+
/** Vista previa como encuesta de una pregunta por página: habilita "samePage" en los campos. */
|
|
14365
|
+
surveyFieldMode = computed(() => {
|
|
14366
|
+
const settings = this.settings();
|
|
14367
|
+
if ((settings.preview.mode ?? this.previewMode()) !== 'survey')
|
|
14368
|
+
return false;
|
|
14369
|
+
return ((settings.preview.survey ?? this.surveyPreviewOptions())?.pageMode ?? 'field') === 'field';
|
|
14370
|
+
});
|
|
13784
14371
|
editableFormInput = input({ cols: 2, blocks: [] }, { alias: 'editableForm' });
|
|
13785
14372
|
submitFormRequest = output();
|
|
13786
14373
|
nextBlockId = 1;
|
|
@@ -14205,15 +14792,47 @@ class UicUserFormbuilderComponent {
|
|
|
14205
14792
|
fieldData: updatedFieldData
|
|
14206
14793
|
};
|
|
14207
14794
|
this.editingSubField.set({ ...context, subField: updatedSubField });
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
|
|
14215
|
-
|
|
14216
|
-
|
|
14795
|
+
// Reglas de los hermanos que apuntaban a opciones que se acaban de quitar.
|
|
14796
|
+
const removedIds = removedOptionIds(context.subField.fieldData, updatedFieldData);
|
|
14797
|
+
let prunedRules = 0;
|
|
14798
|
+
this.editableBlocks.update(blocks => {
|
|
14799
|
+
const updated = blocks.map(block => ({
|
|
14800
|
+
...block,
|
|
14801
|
+
fields: block.fields.map(field => {
|
|
14802
|
+
if (field.code !== context.parentCode)
|
|
14803
|
+
return field;
|
|
14804
|
+
const updatedSubFields = (field.repeaterSubFields ?? []).map(sf => sf.code !== context.subField.code ? sf : updatedSubField);
|
|
14805
|
+
return { ...field, repeaterSubFields: updatedSubFields };
|
|
14806
|
+
})
|
|
14807
|
+
}));
|
|
14808
|
+
const pruned = pruneRulesForRemovedOptions(updated, { kind: 'subfield', parentCode: context.parentCode, code: context.subField.code }, removedIds, updatedFieldData.type);
|
|
14809
|
+
prunedRules = pruned.changed;
|
|
14810
|
+
return pruned.blocks;
|
|
14811
|
+
});
|
|
14812
|
+
if (prunedRules) {
|
|
14813
|
+
this.syncSelectionAfterPruning();
|
|
14814
|
+
this.warnPrunedRules(prunedRules);
|
|
14815
|
+
}
|
|
14816
|
+
}
|
|
14817
|
+
/** Tras limpiar reglas, la selección apunta a los objetos actualizados (mismo code). */
|
|
14818
|
+
syncSelectionAfterPruning() {
|
|
14819
|
+
const fields = this.editableBlocks().flatMap(block => block.fields);
|
|
14820
|
+
const selected = this.selectedField();
|
|
14821
|
+
if (selected) {
|
|
14822
|
+
const current = fields.find(field => field.code === selected.code);
|
|
14823
|
+
if (current && current !== selected)
|
|
14824
|
+
this.selectedField.set(current);
|
|
14825
|
+
}
|
|
14826
|
+
const sub = this.editingSubField();
|
|
14827
|
+
if (sub) {
|
|
14828
|
+
const current = fields.find(field => field.code === sub.parentCode)
|
|
14829
|
+
?.repeaterSubFields?.find(sf => sf.code === sub.subField.code);
|
|
14830
|
+
if (current && current !== sub.subField)
|
|
14831
|
+
this.editingSubField.set({ ...sub, subField: current });
|
|
14832
|
+
}
|
|
14833
|
+
}
|
|
14834
|
+
warnPrunedRules(count) {
|
|
14835
|
+
this.pushAlertService.warning(this.translateService.translate('form_builder.rules_pruned', { count }));
|
|
14217
14836
|
}
|
|
14218
14837
|
startPropertiesResize(event) {
|
|
14219
14838
|
event.preventDefault();
|
|
@@ -14587,23 +15206,35 @@ class UicUserFormbuilderComponent {
|
|
|
14587
15206
|
return;
|
|
14588
15207
|
const fieldCode = selected.code;
|
|
14589
15208
|
let updatedSelected = null;
|
|
14590
|
-
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14602
|
-
|
|
14603
|
-
|
|
15209
|
+
// Reglas (de campos y subcampos) que apuntaban a opciones que se acaban de quitar.
|
|
15210
|
+
const removedIds = removedOptionIds(selected.fieldData, updatedField);
|
|
15211
|
+
let prunedRules = 0;
|
|
15212
|
+
this.editableBlocks.update(blocks => {
|
|
15213
|
+
const updated = blocks.map(block => ({
|
|
15214
|
+
...block,
|
|
15215
|
+
fields: block.fields.map(field => {
|
|
15216
|
+
if (field.code !== fieldCode)
|
|
15217
|
+
return field;
|
|
15218
|
+
const next = {
|
|
15219
|
+
...field,
|
|
15220
|
+
type: updatedField.type,
|
|
15221
|
+
fieldData: updatedField
|
|
15222
|
+
};
|
|
15223
|
+
updatedSelected = next;
|
|
15224
|
+
return next;
|
|
15225
|
+
})
|
|
15226
|
+
}));
|
|
15227
|
+
const pruned = pruneRulesForRemovedOptions(updated, { kind: 'field', code: fieldCode }, removedIds, updatedField.type);
|
|
15228
|
+
prunedRules = pruned.changed;
|
|
15229
|
+
return pruned.blocks;
|
|
15230
|
+
});
|
|
14604
15231
|
if (updatedSelected) {
|
|
14605
15232
|
this.selectedField.set(updatedSelected);
|
|
14606
15233
|
}
|
|
15234
|
+
if (prunedRules) {
|
|
15235
|
+
this.syncSelectionAfterPruning();
|
|
15236
|
+
this.warnPrunedRules(prunedRules);
|
|
15237
|
+
}
|
|
14607
15238
|
}
|
|
14608
15239
|
prepareBlocksForLocalState(blocks) {
|
|
14609
15240
|
return this.hydrateBlocks(this.deepClone(blocks));
|
|
@@ -14793,7 +15424,7 @@ class UicUserFormbuilderComponent {
|
|
|
14793
15424
|
return value;
|
|
14794
15425
|
}
|
|
14795
15426
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicUserFormbuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14796
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicUserFormbuilderComponent, isStandalone: true, selector: "ui-user-formbuilder", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, formTitle: { classPropertyName: "formTitle", publicName: "formTitle", isSignal: false, isRequired: false, transformFunction: null }, optionSources: { classPropertyName: "optionSources", publicName: "optionSources", isSignal: false, isRequired: false, transformFunction: null }, computedSources: { classPropertyName: "computedSources", publicName: "computedSources", isSignal: false, isRequired: false, transformFunction: null }, validationSources: { classPropertyName: "validationSources", publicName: "validationSources", isSignal: false, isRequired: false, transformFunction: null }, selectOptionsResolver: { classPropertyName: "selectOptionsResolver", publicName: "selectOptionsResolver", isSignal: false, isRequired: false, transformFunction: null }, computedFieldResolver: { classPropertyName: "computedFieldResolver", publicName: "computedFieldResolver", isSignal: false, isRequired: false, transformFunction: null }, externalValidatorResolver: { classPropertyName: "externalValidatorResolver", publicName: "externalValidatorResolver", isSignal: false, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, enableNameModify: { classPropertyName: "enableNameModify", publicName: "enableNameModify", isSignal: true, isRequired: false, transformFunction: null }, previewMode: { classPropertyName: "previewMode", publicName: "previewMode", isSignal: true, isRequired: false, transformFunction: null }, surveyPreviewOptions: { classPropertyName: "surveyPreviewOptions", publicName: "surveyPreviewOptions", isSignal: true, isRequired: false, transformFunction: null }, editableFormInput: { classPropertyName: "editableFormInput", publicName: "editableForm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitFormRequest: "submitFormRequest" }, host: { listeners: { "window:beforeunload": "onBeforeUnload($event)", "document:mousemove": "onPropertiesResize($event)", "document:mouseup": "stopPropertiesResize()" } }, ngImport: i0, template: "<div class=\"formeditor\" [class.focused]=\"!isReadOnly()\" [class.read-only]=\"isReadOnly()\">\n <input #importFileInput id=\"formbuilder-import-file\" type=\"file\" accept=\".json,application/json\" hidden\n [attr.aria-label]=\"'form_builder.menu.load_json' | uicTranslate\"\n (change)=\"importSchemaFromFile($event)\">\n\n <!-- HEADER: t\u00EDtulo + estado | acciones principales + men\u00FA contextual -->\n <div class=\"formeditor-header\">\n <div class=\"formeditor-heading\">\n <span class=\"formeditor-title\">{{formTitle}}</span>\n @if (isReadOnly()) {\n <span class=\"status-chip read-only-chip\">\n <i class=\"ri-lock-line\" aria-hidden=\"true\"></i>\n {{'form_builder.read_only' | uicTranslate}}\n </span>\n } @else if (hasUnsavedChanges()) {\n <span class=\"status-chip unsaved-chip\" role=\"status\">\n <span class=\"unsaved-dot\" aria-hidden=\"true\"></span>\n {{'form_builder.unsaved_changes' | uicTranslate}}\n </span>\n }\n </div>\n\n <div class=\"formeditor-actions\">\n <ui-button color=\"primary\" type=\"bordered\" icon=\"ri-eye-line\" [text]=\"'form_builder.preview_form' | uicTranslate\" (click)=\"printForm()\"></ui-button>\n @if (isReadOnly()) {\n @if (!disabled) {\n <ui-button color=\"black\" icon=\"ri-edit-line\" [text]=\"'form_builder.edit' | uicTranslate\" (click)=\"enableEditMode()\"></ui-button>\n }\n } @else {\n <ui-button color=\"black\" type=\"bordered\" [text]=\"'form_builder.discard_changes' | uicTranslate\" (click)=\"discardChanges()\"></ui-button>\n <!-- Sin cambios no hay nada que guardar; \"Descartar\" sigue disponible para salir de la edici\u00F3n.\n Si el builder arranca en edici\u00F3n (sin snapshot), Guardar queda siempre habilitado. -->\n @let nothingToSave = !!editingSnapshot() && !hasUnsavedChanges();\n <ui-button\n color=\"black\"\n icon=\"ri-check-line\"\n [disabled]=\"nothingToSave\"\n [uiTooltip]=\"nothingToSave ? ('form_builder.no_changes' | uicTranslate) : ''\"\n [text]=\"'form_builder.submit_form' | uicTranslate\"\n (click)=\"submitForm()\">\n </ui-button>\n }\n\n <ui-dropdown-container width=\"280px\" maxWidth=\"calc(100vw - 32px)\" [positions]=\"menuPositions\">\n <ui-button\n button\n color=\"black\"\n type=\"ghost\"\n icon=\"ri-more-2-fill\"\n [iconOnly]=\"true\"\n [uiTooltip]=\"'form_builder.menu.more' | uicTranslate\"\n [attr.aria-label]=\"'form_builder.menu.more' | uicTranslate\">\n </ui-button>\n\n <div content class=\"fb-menu\">\n <div class=\"fb-menu-actions\">\n <button type=\"button\" class=\"fb-menu-item\" (click)=\"copySchemaToClipboard()\">\n <i [class]=\"schemaCopied() ? 'ri-check-line copied' : 'ri-file-copy-line'\" aria-hidden=\"true\"></i>\n <span>{{(schemaCopied() ? 'form_builder.menu.copied' : 'form_builder.menu.copy_json') | uicTranslate}}</span>\n </button>\n @if (!isReadOnly()) {\n <button type=\"button\" class=\"fb-menu-item\" uiDropdownClose (click)=\"importFileInput.click()\">\n <i class=\"ri-upload-2-line\" aria-hidden=\"true\"></i>\n <span>{{'form_builder.menu.load_json' | uicTranslate}}</span>\n </button>\n }\n </div>\n\n <div class=\"fb-menu-section\">\n <div class=\"fb-menu-section-title\">{{'form_builder.menu.layout_title' | uicTranslate}}</div>\n\n <div class=\"fb-menu-row\">\n <span id=\"fb-cols-label\">{{'form_builder.menu.columns' | uicTranslate}}</span>\n <div class=\"fb-segmented\" role=\"radiogroup\" aria-labelledby=\"fb-cols-label\">\n @for (cols of columnOptions; track cols) {\n <button\n type=\"button\"\n role=\"radio\"\n [attr.aria-checked]=\"editableCols() === cols\"\n [class.active]=\"editableCols() === cols\"\n [disabled]=\"isReadOnly()\"\n (click)=\"editableCols.set(cols)\">{{cols}}</button>\n }\n </div>\n </div>\n\n <div class=\"fb-menu-grid\">\n <span></span>\n <span class=\"fb-menu-grid-head\">{{'form_builder.menu.size' | uicTranslate}}</span>\n <span class=\"fb-menu-grid-head\">{{'form_builder.menu.margin' | uicTranslate}}</span>\n\n <span>{{'form_builder.menu.title' | uicTranslate}}</span>\n <input type=\"number\" min=\"8\" max=\"72\" placeholder=\"Auto\"\n [attr.aria-label]=\"'form_builder.schema.title_font_size' | uicTranslate\"\n [disabled]=\"isReadOnly()\"\n [ngModel]=\"editableTitleFontSize()\" (ngModelChange)=\"editableTitleFontSize.set($event || null)\">\n <input type=\"number\" min=\"0\" placeholder=\"Auto\"\n [attr.aria-label]=\"'form_builder.schema.title_margin' | uicTranslate\"\n [disabled]=\"isReadOnly()\"\n [ngModel]=\"editableTitleMargin()\" (ngModelChange)=\"editableTitleMargin.set($event || null)\">\n\n <span>{{'form_builder.menu.subtitle' | uicTranslate}}</span>\n <input type=\"number\" min=\"8\" max=\"72\" placeholder=\"Auto\"\n [attr.aria-label]=\"'form_builder.schema.subtitle_font_size' | uicTranslate\"\n [disabled]=\"isReadOnly()\"\n [ngModel]=\"editableSubtitleFontSize()\" (ngModelChange)=\"editableSubtitleFontSize.set($event || null)\">\n <input type=\"number\" min=\"0\" placeholder=\"Auto\"\n [attr.aria-label]=\"'form_builder.schema.subtitle_margin' | uicTranslate\"\n [disabled]=\"isReadOnly()\"\n [ngModel]=\"editableSubtitleMargin()\" (ngModelChange)=\"editableSubtitleMargin.set($event || null)\">\n </div>\n <p class=\"fb-menu-hint\">{{'form_builder.menu.layout_hint' | uicTranslate}}</p>\n </div>\n </div>\n </ui-dropdown-container>\n </div>\n </div>\n\n <!-- BODY: el mismo editor en ambos modos; en solo lectura todo queda deshabilitado -->\n <div class=\"formeditor-body\">\n <!-- Clic en una zona vac\u00EDa del canvas (no en un bloque ni un campo) cierra las propiedades -->\n <div class=\"formeditor-overflow\" (click)=\"onCanvasBackgroundClick($event)\">\n <div class=\"formeditor-workarea\">\n <div\n class=\"formeditor-blocks\"\n cdkDropList\n cdkDropListLockAxis=\"y\"\n [cdkDropListDisabled]=\"isReadOnly()\"\n (cdkDropListDropped)=\"reorderBlocks($event)\">\n @for (block of editableBlocks(); track block.code; let i = $index) {\n <lib-block-editor\n cdkDrag\n cdkDragLockAxis=\"y\"\n [cdkDragDisabled]=\"isReadOnly()\"\n [readOnly]=\"isReadOnly()\"\n [availableFieldTypes]=\"settings().fieldTypes\"\n [canDelete]=\"canDeleteBlocks()\"\n [fieldLimitReached]=\"fieldLimitReached()\"\n [maxFields]=\"settings().limits.maxFields\"\n [maxRepeaterFields]=\"settings().limits.maxRepeaterFields\"\n [block]=\"block\"\n [fieldLookup]=\"fieldLookup()\"\n [showIdentifier]=\"nameEditable()\"\n [connectedFieldListIds]=\"fieldListIds()\"\n (itemRemoved)=\"registerRemoval($event)\"\n (duplicateFieldRequest)=\"duplicateField($event)\"\n (moveFieldRequest)=\"moveField($event)\"\n [selectedFieldId]=\"selectedField()?.code ?? null\"\n [selectedSubFieldCode]=\"editingSubField()?.subField?.code ?? null\"\n [selectedSubFieldParentCode]=\"editingSubField()?.parentCode ?? null\"\n [visibilityParentFieldCodes]=\"visibilityParentFieldCodes()\"\n (blockChange)=\"onBlockChange(i, $event)\"\n (addFieldRequest)=\"addField(block.code, $event)\"\n (notifySelectedField)=\"selectField($event)\"\n (notifySelectedSubField)=\"onSelectSubField($event)\"\n (notifyNewSubField)=\"onNewSubField($event)\"\n (deleteBlock)=\"deleteBlock($event)\">\n </lib-block-editor>\n } @empty {\n @if (isReadOnly()) {\n <div class=\"no-selected-field\">\n <i class=\"ri-file-list-3-line\" aria-hidden=\"true\"></i>\n <p>{{'form_builder.no_blocks' | uicTranslate}}</p>\n </div>\n }\n }\n </div>\n @if (!isReadOnly() && settings().allowBlockCreation) {\n @let blockLimit = blockLimitReached();\n <!-- El tooltip va en un contenedor: un bot\u00F3n deshabilitado no recibe eventos del mouse -->\n <span class=\"limit-wrapper\" [uiTooltip]=\"blockLimit ? ('form_builder.limits.blocks_reached' | uicTranslate: { max: settings().limits.maxBlocks }) : ''\">\n <ui-button type=\"bordered\" icon=\"ri-add-line\" color=\"black\" [disabled]=\"blockLimit\" [text]=\"'form_builder.add_block' | uicTranslate\" (click)=\"addBlock()\"></ui-button>\n </span>\n }\n </div>\n </div>\n <!-- PROPERTIES: solo existe mientras hay un campo seleccionado; cerrarlo deselecciona -->\n @let editing = editingSubField()?.subField ?? selectedField();\n @if (editing) {\n <section\n class=\"formeditor-properties\"\n [attr.aria-label]=\"'form_builder.properties.title' | uicTranslate\"\n [style.width.px]=\"propertiesWidth()\"\n (keydown.escape)=\"onPropertiesEscape($event)\">\n <div\n class=\"formeditor-properties-resize\"\n [class.resizing]=\"isResizing()\"\n [attr.title]=\"'form_builder.properties.resize' | uicTranslate\"\n (mousedown)=\"startPropertiesResize($event)\"\n (dblclick)=\"resetPropertiesWidth()\">\n </div>\n <div class=\"properties-header\">\n <div class=\"properties-header-top\">\n @if (editingSubField(); as sub) {\n @let parent = fieldLookup().get(sub.parentCode);\n <button type=\"button\" class=\"properties-breadcrumb\" (click)=\"backToRepeater(sub.parentCode)\" [uiTooltip]=\"'form_builder.properties.back_to_repeater' | uicTranslate\">\n <i class=\"ri-arrow-left-s-line\" aria-hidden=\"true\"></i>\n <i class=\"ri-stack-line\" aria-hidden=\"true\"></i>\n <span>{{parent?.fieldData?.label || parent?.fieldData?.name}}</span>\n </button>\n } @else {\n <span class=\"properties-eyebrow\">{{'form_builder.properties.title' | uicTranslate}}</span>\n }\n <button\n type=\"button\"\n class=\"properties-close\"\n [uiTooltip]=\"'form_builder.properties.close' | uicTranslate\"\n [attr.aria-label]=\"'form_builder.properties.close' | uicTranslate\"\n (click)=\"closeProperties()\">\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <div class=\"properties-title\">\n <span class=\"properties-title-icon\"><i [class]=\"editing.field?.icon ?? 'ri-question-line'\" aria-hidden=\"true\"></i></span>\n <div class=\"properties-title-text\">\n <b>{{editing.fieldData.label || editing.fieldData.name}}</b>\n <small>{{(editing.field?.label ?? editing.fieldData.type) | uicTranslate}}</small>\n </div>\n </div>\n </div>\n <div class=\"formeditor-properties-form\">\n @if (editingSubField()) {\n <lib-field-editor\n [config]=\"editingSubField()!.subField\"\n [isSubField]=\"true\"\n [readOnly]=\"isReadOnly()\"\n [externalSources]=\"settings().externalSources\"\n [visibilityRulesEnabled]=\"settings().visibilityRules\"\n [styleEnabled]=\"settings().styleSection\"\n [focusRequiredField]=\"focusNewSubFieldCode() === editingSubField()?.subField?.code\"\n [enableNameModify]=\"nameEditable()\"\n [options]=\"subFieldDependencyOptions()\"\n (fieldChange)=\"onSubFieldChange($event)\">\n </lib-field-editor>\n } @else if (selectedField()) {\n <lib-field-editor\n [config]=\"selectedField()!\"\n [readOnly]=\"isReadOnly()\"\n [externalSources]=\"settings().externalSources\"\n [visibilityRulesEnabled]=\"settings().visibilityRules\"\n [styleEnabled]=\"settings().styleSection\"\n [focusRequiredField]=\"focusNewFieldCode() === selectedField()?.code\"\n [enableNameModify]=\"nameEditable()\"\n [options]=\"dependencyOptions()\"\n (fieldChange)=\"onFieldChange($event)\">\n </lib-field-editor>\n }\n </div>\n </section>\n }\n </div>\n\n @if (pendingUndo(); as undo) {\n <div class=\"undo-bar\" role=\"status\" aria-live=\"polite\">\n <i class=\"ri-delete-bin-line\" aria-hidden=\"true\"></i>\n <span class=\"undo-bar-text\">{{undo.message}}</span>\n <button type=\"button\" class=\"undo-bar-action\" (click)=\"undoRemoval()\">{{'form_builder.undo.action' | uicTranslate}}</button>\n <button type=\"button\" class=\"undo-bar-close\" [attr.aria-label]=\"'common.close' | uicTranslate\" (click)=\"dismissUndo()\">\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n</div>\n", styles: [".formeditor{position:relative;display:flex;flex-direction:column;overflow:hidden;background-color:var(--uic-neutral-100, var(--grey-100));border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;max-height:500px}.formeditor-header{background-color:var(--uic-surface, white);border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300));display:flex;align-items:center;gap:10px;padding:6px 8px 6px 14px;min-height:48px}.formeditor-heading{flex:1 1;min-width:0;display:flex;align-items:center;gap:10px}.formeditor-title{font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formeditor-actions{flex:0 0 auto;display:flex;align-items:center;gap:6px}.formeditor-body{display:flex;gap:10px;overflow:hidden;padding:10px;min-height:0}.formeditor-overflow{padding:5px;flex:1 1;overflow:auto;min-width:0}.formeditor-workarea{display:flex;flex-direction:column;gap:15px;height:fit-content}.formeditor-properties{width:320px;flex:0 0 auto;display:flex;flex-direction:column;position:relative;background-color:var(--uic-surface, white);border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;min-height:0;min-width:250px;max-width:600px}.formeditor-properties-resize{position:absolute;top:0;bottom:0;left:-6px;width:10px;cursor:col-resize;z-index:1}.formeditor-properties-resize:after{content:\"\";position:absolute;top:8px;bottom:8px;left:4px;width:2px;border-radius:1px;background-color:transparent;transition:background-color .15s ease}.formeditor-properties-resize:hover:after,.formeditor-properties-resize.resizing:after{background-color:var(--primary-400)}.formeditor-properties-form{padding:10px;overflow:auto;flex:1 1 auto;min-height:0}.focused{border:solid 1px var(--primary-400);border-radius:10px;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.no-selected-field{width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px 0;font-size:13px;gap:15px;text-align:center;color:var(--uic-neutral-400, var(--grey-400))}.no-selected-field i{font-size:24px}.status-chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:5px;padding:1px 8px;border-radius:10px;font-size:11px;white-space:nowrap}.unsaved-chip{background-color:var(--yellow-100);color:var(--yellow-700)}.read-only-chip{background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-500, var(--grey-500))}.fb-menu{display:flex;flex-direction:column;font-size:13px}.fb-menu-actions{display:flex;flex-direction:column;padding:4px}.fb-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:7px 10px;border:none;border-radius:5px;background:none;color:inherit;text-align:left;cursor:pointer}.fb-menu-item i{font-size:16px;color:var(--uic-neutral-500, var(--grey-500))}.fb-menu-item i.copied{color:var(--green-600, #16a34a)}.fb-menu-item:hover,.fb-menu-item:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));outline:none}.fb-menu-section{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding:10px 14px 12px;display:flex;flex-direction:column;gap:10px}.fb-menu-section-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400))}.fb-menu-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.fb-segmented{display:inline-flex;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:6px;overflow:hidden}.fb-segmented button{width:32px;height:26px;border:none;border-left:solid 1px var(--uic-neutral-300, var(--grey-300));background:var(--uic-surface, white);color:inherit;font-size:12px;cursor:pointer}.fb-segmented button:first-child{border-left:none}.fb-segmented button:hover:not(:disabled){background-color:var(--uic-neutral-100, var(--grey-100))}.fb-segmented button.active{background-color:var(--uic-neutral-800, var(--grey-800));color:var(--uic-neutral-50, var(--grey-50));font-weight:600}.fb-segmented button:disabled{cursor:default}.fb-segmented button:focus-visible{outline:solid 2px var(--primary-400);outline-offset:-2px}.fb-menu-grid{display:grid;grid-template-columns:1fr 64px 64px;align-items:center;gap:6px 8px}.fb-menu-grid-head{font-size:11px;color:var(--uic-neutral-500, var(--grey-500));text-align:center}.fb-menu-grid input{width:100%;height:26px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;padding:0 6px;font-size:12px;text-align:center;background:var(--uic-surface, white);color:var(--uic-neutral-800, var(--grey-800))}.fb-menu-grid input:focus{outline:none;border-color:var(--primary-400)}.fb-menu-grid input:disabled{background:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-500, var(--grey-500))}.fb-menu-hint{font-size:11px;color:var(--uic-neutral-400, var(--grey-400))}.unsaved-dot{width:6px;height:6px;border-radius:50%;background-color:currentColor}.undo-bar{position:absolute;left:50%;bottom:14px;transform:translate(-50%);z-index:5;display:flex;align-items:center;gap:10px;max-width:calc(100% - 32px);padding:8px 8px 8px 14px;border-radius:6px;font-size:13px;background-color:var(--uic-neutral-800, var(--grey-800));color:var(--uic-neutral-50, var(--grey-50));box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18));animation:undo-bar-in .16s ease-out}.undo-bar-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.undo-bar-action,.undo-bar-close{flex:0 0 auto;border:none;background:none;color:inherit;cursor:pointer;border-radius:4px;padding:4px 8px}.undo-bar-action:hover,.undo-bar-action:focus-visible,.undo-bar-close:hover,.undo-bar-close:focus-visible{background-color:#ffffff1f;outline:none}.undo-bar-action{font-weight:600;color:var(--primary-200, #a9c7ff)}.undo-bar-close{padding:4px;display:flex}@keyframes undo-bar-in{0%{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%)}}@media (prefers-reduced-motion: reduce){.undo-bar{animation:none}}.formeditor-blocks{display:flex;flex-direction:column;gap:15px}.formeditor-blocks.cdk-drop-list-dragging>lib-block-editor:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}lib-block-editor.cdk-drag-placeholder{opacity:.35}.properties-header{display:flex;flex-direction:column;gap:6px;padding:10px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300));min-width:0}.formeditor-properties{animation:properties-in .16s ease-out}@keyframes properties-in{0%{opacity:0;transform:translate(12px)}to{opacity:1;transform:translate(0)}}@media (prefers-reduced-motion: reduce){.formeditor-properties{animation:none}}.properties-header-top{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}.properties-eyebrow{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400))}.properties-close{flex:0 0 auto;margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border:none;border-radius:5px;background:none;color:var(--uic-neutral-500, var(--grey-500));font-size:16px;cursor:pointer}.properties-close:hover,.properties-close:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-800, var(--grey-800));outline:none}.properties-breadcrumb{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;border:none;background:none;padding:2px 4px 2px 0;border-radius:4px;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));cursor:pointer}.properties-breadcrumb span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.properties-breadcrumb:hover,.properties-breadcrumb:focus-visible{color:var(--primary-600);outline:none}.properties-title{display:flex;align-items:center;gap:8px;min-width:0}.properties-title-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:5px;font-size:18px;background-color:var(--primary-100);color:var(--primary-600)}.properties-title-text{display:flex;flex-direction:column;min-width:0}.properties-title-text b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.properties-title-text small{font-size:11px;color:var(--uic-neutral-500, var(--grey-500))}.limit-wrapper{display:inline-block;align-self:flex-start}.limit-wrapper:has(button:disabled) ui-button{pointer-events:none}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: FieldEditorComponent, selector: "lib-field-editor", inputs: ["config", "focusRequiredField", "isSubField", "enableNameModify", "readOnly", "externalSources", "visibilityRulesEnabled", "styleEnabled", "options"], outputs: ["fieldChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: BlockEditorComponent, selector: "lib-block-editor", inputs: ["block", "selectedFieldId", "selectedSubFieldCode", "selectedSubFieldParentCode", "visibilityParentFieldCodes", "fieldLookup", "showIdentifier", "connectedFieldListIds", "readOnly", "availableFieldTypes", "canDelete", "fieldLimitReached", "maxFields", "maxRepeaterFields"], outputs: ["blockChange", "addFieldRequest", "deleteBlock", "notifySelectedField", "notifySelectedSubField", "notifyNewSubField", "itemRemoved", "duplicateFieldRequest", "moveFieldRequest"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: UicDropdownContainerComponent, selector: "ui-dropdown-container", inputs: ["buttonLabel", "disabled", "positions", "matchTriggerWidth", "width", "minWidth", "maxWidth", "backdropClass", "hasBackdrop", "closeOnBackdropClick", "closeOnEscape", "closeOnContentClick", "offsetX", "offsetY", "push", "flexibleDimensions"], outputs: ["closed"] }, { kind: "directive", type: UiDropdownCloseDirective, selector: "[uiDropdownClose]" }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }] });
|
|
15427
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicUserFormbuilderComponent, isStandalone: true, selector: "ui-user-formbuilder", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, formTitle: { classPropertyName: "formTitle", publicName: "formTitle", isSignal: false, isRequired: false, transformFunction: null }, optionSources: { classPropertyName: "optionSources", publicName: "optionSources", isSignal: false, isRequired: false, transformFunction: null }, computedSources: { classPropertyName: "computedSources", publicName: "computedSources", isSignal: false, isRequired: false, transformFunction: null }, validationSources: { classPropertyName: "validationSources", publicName: "validationSources", isSignal: false, isRequired: false, transformFunction: null }, selectOptionsResolver: { classPropertyName: "selectOptionsResolver", publicName: "selectOptionsResolver", isSignal: false, isRequired: false, transformFunction: null }, computedFieldResolver: { classPropertyName: "computedFieldResolver", publicName: "computedFieldResolver", isSignal: false, isRequired: false, transformFunction: null }, externalValidatorResolver: { classPropertyName: "externalValidatorResolver", publicName: "externalValidatorResolver", isSignal: false, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, enableNameModify: { classPropertyName: "enableNameModify", publicName: "enableNameModify", isSignal: true, isRequired: false, transformFunction: null }, previewMode: { classPropertyName: "previewMode", publicName: "previewMode", isSignal: true, isRequired: false, transformFunction: null }, surveyPreviewOptions: { classPropertyName: "surveyPreviewOptions", publicName: "surveyPreviewOptions", isSignal: true, isRequired: false, transformFunction: null }, editableFormInput: { classPropertyName: "editableFormInput", publicName: "editableForm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitFormRequest: "submitFormRequest" }, host: { listeners: { "window:beforeunload": "onBeforeUnload($event)", "document:mousemove": "onPropertiesResize($event)", "document:mouseup": "stopPropertiesResize()" } }, ngImport: i0, template: "<div class=\"formeditor\" [class.focused]=\"!isReadOnly()\" [class.read-only]=\"isReadOnly()\">\r\n <input #importFileInput id=\"formbuilder-import-file\" type=\"file\" accept=\".json,application/json\" hidden\r\n [attr.aria-label]=\"'form_builder.menu.load_json' | uicTranslate\"\r\n (change)=\"importSchemaFromFile($event)\">\r\n\r\n <!-- HEADER: t\u00EDtulo + estado | acciones principales + men\u00FA contextual -->\r\n <div class=\"formeditor-header\">\r\n <div class=\"formeditor-heading\">\r\n <span class=\"formeditor-title\">{{formTitle}}</span>\r\n @if (isReadOnly()) {\r\n <span class=\"status-chip read-only-chip\">\r\n <i class=\"ri-lock-line\" aria-hidden=\"true\"></i>\r\n {{'form_builder.read_only' | uicTranslate}}\r\n </span>\r\n } @else if (hasUnsavedChanges()) {\r\n <span class=\"status-chip unsaved-chip\" role=\"status\">\r\n <span class=\"unsaved-dot\" aria-hidden=\"true\"></span>\r\n {{'form_builder.unsaved_changes' | uicTranslate}}\r\n </span>\r\n }\r\n </div>\r\n\r\n <div class=\"formeditor-actions\">\r\n @if (settings().preview.showButton) {\r\n <ui-button color=\"primary\" type=\"bordered\" icon=\"ri-eye-line\" [text]=\"'form_builder.preview_form' | uicTranslate\" (click)=\"printForm()\"></ui-button>\r\n }\r\n @if (isReadOnly()) {\r\n @if (!disabled) {\r\n <ui-button color=\"black\" icon=\"ri-edit-line\" [text]=\"'form_builder.edit' | uicTranslate\" (click)=\"enableEditMode()\"></ui-button>\r\n }\r\n } @else {\r\n <ui-button color=\"black\" type=\"bordered\" [text]=\"'form_builder.discard_changes' | uicTranslate\" (click)=\"discardChanges()\"></ui-button>\r\n <!-- Sin cambios no hay nada que guardar; \"Descartar\" sigue disponible para salir de la edici\u00F3n.\r\n Si el builder arranca en edici\u00F3n (sin snapshot), Guardar queda siempre habilitado. -->\r\n @let nothingToSave = !!editingSnapshot() && !hasUnsavedChanges();\r\n <ui-button\r\n color=\"black\"\r\n icon=\"ri-check-line\"\r\n [disabled]=\"nothingToSave\"\r\n [uiTooltip]=\"nothingToSave ? ('form_builder.no_changes' | uicTranslate) : ''\"\r\n [text]=\"'form_builder.submit_form' | uicTranslate\"\r\n (click)=\"submitForm()\">\r\n </ui-button>\r\n }\r\n\r\n <ui-dropdown-container width=\"280px\" maxWidth=\"calc(100vw - 32px)\" [positions]=\"menuPositions\">\r\n <ui-button\r\n button\r\n color=\"black\"\r\n type=\"ghost\"\r\n icon=\"ri-more-2-fill\"\r\n [iconOnly]=\"true\"\r\n [uiTooltip]=\"'form_builder.menu.more' | uicTranslate\"\r\n [attr.aria-label]=\"'form_builder.menu.more' | uicTranslate\">\r\n </ui-button>\r\n\r\n <div content class=\"fb-menu\">\r\n <div class=\"fb-menu-actions\">\r\n <button type=\"button\" class=\"fb-menu-item\" (click)=\"copySchemaToClipboard()\">\r\n <i [class]=\"schemaCopied() ? 'ri-check-line copied' : 'ri-file-copy-line'\" aria-hidden=\"true\"></i>\r\n <span>{{(schemaCopied() ? 'form_builder.menu.copied' : 'form_builder.menu.copy_json') | uicTranslate}}</span>\r\n </button>\r\n @if (!isReadOnly()) {\r\n <button type=\"button\" class=\"fb-menu-item\" uiDropdownClose (click)=\"importFileInput.click()\">\r\n <i class=\"ri-upload-2-line\" aria-hidden=\"true\"></i>\r\n <span>{{'form_builder.menu.load_json' | uicTranslate}}</span>\r\n </button>\r\n }\r\n </div>\r\n\r\n <div class=\"fb-menu-section\">\r\n <div class=\"fb-menu-section-title\">{{'form_builder.menu.layout_title' | uicTranslate}}</div>\r\n\r\n <div class=\"fb-menu-row\">\r\n <span id=\"fb-cols-label\">{{'form_builder.menu.columns' | uicTranslate}}</span>\r\n <div class=\"fb-segmented\" role=\"radiogroup\" aria-labelledby=\"fb-cols-label\">\r\n @for (cols of columnOptions; track cols) {\r\n <button\r\n type=\"button\"\r\n role=\"radio\"\r\n [attr.aria-checked]=\"editableCols() === cols\"\r\n [class.active]=\"editableCols() === cols\"\r\n [disabled]=\"isReadOnly()\"\r\n (click)=\"editableCols.set(cols)\">{{cols}}</button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"fb-menu-grid\">\r\n <span></span>\r\n <span class=\"fb-menu-grid-head\">{{'form_builder.menu.size' | uicTranslate}}</span>\r\n <span class=\"fb-menu-grid-head\">{{'form_builder.menu.margin' | uicTranslate}}</span>\r\n\r\n <span>{{'form_builder.menu.title' | uicTranslate}}</span>\r\n <input type=\"number\" min=\"8\" max=\"72\" placeholder=\"Auto\"\r\n [attr.aria-label]=\"'form_builder.schema.title_font_size' | uicTranslate\"\r\n [disabled]=\"isReadOnly()\"\r\n [ngModel]=\"editableTitleFontSize()\" (ngModelChange)=\"editableTitleFontSize.set($event || null)\">\r\n <input type=\"number\" min=\"0\" placeholder=\"Auto\"\r\n [attr.aria-label]=\"'form_builder.schema.title_margin' | uicTranslate\"\r\n [disabled]=\"isReadOnly()\"\r\n [ngModel]=\"editableTitleMargin()\" (ngModelChange)=\"editableTitleMargin.set($event || null)\">\r\n\r\n <span>{{'form_builder.menu.subtitle' | uicTranslate}}</span>\r\n <input type=\"number\" min=\"8\" max=\"72\" placeholder=\"Auto\"\r\n [attr.aria-label]=\"'form_builder.schema.subtitle_font_size' | uicTranslate\"\r\n [disabled]=\"isReadOnly()\"\r\n [ngModel]=\"editableSubtitleFontSize()\" (ngModelChange)=\"editableSubtitleFontSize.set($event || null)\">\r\n <input type=\"number\" min=\"0\" placeholder=\"Auto\"\r\n [attr.aria-label]=\"'form_builder.schema.subtitle_margin' | uicTranslate\"\r\n [disabled]=\"isReadOnly()\"\r\n [ngModel]=\"editableSubtitleMargin()\" (ngModelChange)=\"editableSubtitleMargin.set($event || null)\">\r\n </div>\r\n <p class=\"fb-menu-hint\">{{'form_builder.menu.layout_hint' | uicTranslate}}</p>\r\n </div>\r\n </div>\r\n </ui-dropdown-container>\r\n </div>\r\n </div>\r\n\r\n <!-- BODY: el mismo editor en ambos modos; en solo lectura todo queda deshabilitado -->\r\n <div class=\"formeditor-body\">\r\n <!-- Clic en una zona vac\u00EDa del canvas (no en un bloque ni un campo) cierra las propiedades -->\r\n <div class=\"formeditor-overflow\" (click)=\"onCanvasBackgroundClick($event)\">\r\n <div class=\"formeditor-workarea\">\r\n <div\r\n class=\"formeditor-blocks\"\r\n cdkDropList\r\n cdkDropListLockAxis=\"y\"\r\n [cdkDropListDisabled]=\"isReadOnly()\"\r\n (cdkDropListDropped)=\"reorderBlocks($event)\">\r\n @for (block of editableBlocks(); track block.code; let i = $index) {\r\n <lib-block-editor\r\n cdkDrag\r\n cdkDragLockAxis=\"y\"\r\n [cdkDragDisabled]=\"isReadOnly()\"\r\n [readOnly]=\"isReadOnly()\"\r\n [availableFieldTypes]=\"settings().fieldTypes\"\r\n [canDelete]=\"canDeleteBlocks()\"\r\n [fieldLimitReached]=\"fieldLimitReached()\"\r\n [maxFields]=\"settings().limits.maxFields\"\r\n [maxRepeaterFields]=\"settings().limits.maxRepeaterFields\"\r\n [block]=\"block\"\r\n [fieldLookup]=\"fieldLookup()\"\r\n [showIdentifier]=\"nameEditable()\"\r\n [connectedFieldListIds]=\"fieldListIds()\"\r\n (itemRemoved)=\"registerRemoval($event)\"\r\n (duplicateFieldRequest)=\"duplicateField($event)\"\r\n (moveFieldRequest)=\"moveField($event)\"\r\n [selectedFieldId]=\"selectedField()?.code ?? null\"\r\n [selectedSubFieldCode]=\"editingSubField()?.subField?.code ?? null\"\r\n [selectedSubFieldParentCode]=\"editingSubField()?.parentCode ?? null\"\r\n [visibilityParentFieldCodes]=\"visibilityParentFieldCodes()\"\r\n (blockChange)=\"onBlockChange(i, $event)\"\r\n (addFieldRequest)=\"addField(block.code, $event)\"\r\n (notifySelectedField)=\"selectField($event)\"\r\n (notifySelectedSubField)=\"onSelectSubField($event)\"\r\n (notifyNewSubField)=\"onNewSubField($event)\"\r\n (deleteBlock)=\"deleteBlock($event)\">\r\n </lib-block-editor>\r\n } @empty {\r\n @if (isReadOnly()) {\r\n <div class=\"no-selected-field\">\r\n <i class=\"ri-file-list-3-line\" aria-hidden=\"true\"></i>\r\n <p>{{'form_builder.no_blocks' | uicTranslate}}</p>\r\n </div>\r\n }\r\n }\r\n </div>\r\n @if (!isReadOnly() && settings().allowBlockCreation) {\r\n @let blockLimit = blockLimitReached();\r\n <!-- El tooltip va en un contenedor: un bot\u00F3n deshabilitado no recibe eventos del mouse -->\r\n <span class=\"limit-wrapper\" [uiTooltip]=\"blockLimit ? ('form_builder.limits.blocks_reached' | uicTranslate: { max: settings().limits.maxBlocks }) : ''\">\r\n <ui-button type=\"bordered\" icon=\"ri-add-line\" color=\"black\" [disabled]=\"blockLimit\" [text]=\"'form_builder.add_block' | uicTranslate\" (click)=\"addBlock()\"></ui-button>\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n <!-- PROPERTIES: solo existe mientras hay un campo seleccionado; cerrarlo deselecciona -->\r\n @let editing = editingSubField()?.subField ?? selectedField();\r\n @if (editing) {\r\n <section\r\n class=\"formeditor-properties\"\r\n [attr.aria-label]=\"'form_builder.properties.title' | uicTranslate\"\r\n [style.width.px]=\"propertiesWidth()\"\r\n (keydown.escape)=\"onPropertiesEscape($event)\">\r\n <div\r\n class=\"formeditor-properties-resize\"\r\n [class.resizing]=\"isResizing()\"\r\n [attr.title]=\"'form_builder.properties.resize' | uicTranslate\"\r\n (mousedown)=\"startPropertiesResize($event)\"\r\n (dblclick)=\"resetPropertiesWidth()\">\r\n </div>\r\n <div class=\"properties-header\">\r\n <div class=\"properties-header-top\">\r\n @if (editingSubField(); as sub) {\r\n @let parent = fieldLookup().get(sub.parentCode);\r\n <button type=\"button\" class=\"properties-breadcrumb\" (click)=\"backToRepeater(sub.parentCode)\" [uiTooltip]=\"'form_builder.properties.back_to_repeater' | uicTranslate\">\r\n <i class=\"ri-arrow-left-s-line\" aria-hidden=\"true\"></i>\r\n <i class=\"ri-stack-line\" aria-hidden=\"true\"></i>\r\n <span>{{parent?.fieldData?.label || parent?.fieldData?.name}}</span>\r\n </button>\r\n } @else {\r\n <span class=\"properties-eyebrow\">{{'form_builder.properties.title' | uicTranslate}}</span>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"properties-close\"\r\n [uiTooltip]=\"'form_builder.properties.close' | uicTranslate\"\r\n [attr.aria-label]=\"'form_builder.properties.close' | uicTranslate\"\r\n (click)=\"closeProperties()\">\r\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n <div class=\"properties-title\">\r\n <span class=\"properties-title-icon\"><i [class]=\"editing.field?.icon ?? 'ri-question-line'\" aria-hidden=\"true\"></i></span>\r\n <div class=\"properties-title-text\">\r\n <b>{{editing.fieldData.label || editing.fieldData.name}}</b>\r\n <small>{{(editing.field?.label ?? editing.fieldData.type) | uicTranslate}}</small>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"formeditor-properties-form\">\r\n @if (editingSubField()) {\r\n <lib-field-editor\r\n [config]=\"editingSubField()!.subField\"\r\n [isSubField]=\"true\"\r\n [readOnly]=\"isReadOnly()\"\r\n [externalSources]=\"settings().externalSources\"\r\n [visibilityRulesEnabled]=\"settings().visibilityRules\"\r\n [styleEnabled]=\"settings().styleSection\"\r\n [focusRequiredField]=\"focusNewSubFieldCode() === editingSubField()?.subField?.code\"\r\n [enableNameModify]=\"nameEditable()\"\r\n [options]=\"subFieldDependencyOptions()\"\r\n (fieldChange)=\"onSubFieldChange($event)\">\r\n </lib-field-editor>\r\n } @else if (selectedField()) {\r\n <lib-field-editor\r\n [config]=\"selectedField()!\"\r\n [readOnly]=\"isReadOnly()\"\r\n [externalSources]=\"settings().externalSources\"\r\n [visibilityRulesEnabled]=\"settings().visibilityRules\"\r\n [styleEnabled]=\"settings().styleSection\"\r\n [surveyFieldMode]=\"surveyFieldMode()\"\r\n [focusRequiredField]=\"focusNewFieldCode() === selectedField()?.code\"\r\n [enableNameModify]=\"nameEditable()\"\r\n [options]=\"dependencyOptions()\"\r\n (fieldChange)=\"onFieldChange($event)\">\r\n </lib-field-editor>\r\n }\r\n </div>\r\n </section>\r\n }\r\n </div>\r\n\r\n @if (pendingUndo(); as undo) {\r\n <div class=\"undo-bar\" role=\"status\" aria-live=\"polite\">\r\n <i class=\"ri-delete-bin-line\" aria-hidden=\"true\"></i>\r\n <span class=\"undo-bar-text\">{{undo.message}}</span>\r\n <button type=\"button\" class=\"undo-bar-action\" (click)=\"undoRemoval()\">{{'form_builder.undo.action' | uicTranslate}}</button>\r\n <button type=\"button\" class=\"undo-bar-close\" [attr.aria-label]=\"'common.close' | uicTranslate\" (click)=\"dismissUndo()\">\r\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".formeditor{position:relative;display:flex;flex-direction:column;overflow:hidden;background-color:var(--uic-neutral-100, var(--grey-100));border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;max-height:500px}.formeditor-header{background-color:var(--uic-surface, white);border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300));display:flex;align-items:center;gap:10px;padding:6px 8px 6px 14px;min-height:48px}.formeditor-heading{flex:1 1;min-width:0;display:flex;align-items:center;gap:10px}.formeditor-title{font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formeditor-actions{flex:0 0 auto;display:flex;align-items:center;gap:6px}.formeditor-body{display:flex;gap:10px;overflow:hidden;padding:10px;min-height:0}.formeditor-overflow{padding:5px;flex:1 1;overflow:auto;min-width:0}.formeditor-workarea{display:flex;flex-direction:column;gap:15px;height:fit-content}.formeditor-properties{width:320px;flex:0 0 auto;display:flex;flex-direction:column;position:relative;background-color:var(--uic-surface, white);border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;min-height:0;min-width:250px;max-width:600px}.formeditor-properties-resize{position:absolute;top:0;bottom:0;left:-6px;width:10px;cursor:col-resize;z-index:1}.formeditor-properties-resize:after{content:\"\";position:absolute;top:8px;bottom:8px;left:4px;width:2px;border-radius:1px;background-color:transparent;transition:background-color .15s ease}.formeditor-properties-resize:hover:after,.formeditor-properties-resize.resizing:after{background-color:var(--primary-400)}.formeditor-properties-form{padding:10px;overflow:auto;flex:1 1 auto;min-height:0}.focused{border:solid 1px var(--primary-400);border-radius:10px;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.no-selected-field{width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px 0;font-size:13px;gap:15px;text-align:center;color:var(--uic-neutral-400, var(--grey-400))}.no-selected-field i{font-size:24px}.status-chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:5px;padding:1px 8px;border-radius:10px;font-size:11px;white-space:nowrap}.unsaved-chip{background-color:var(--yellow-100);color:var(--yellow-700)}.read-only-chip{background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-500, var(--grey-500))}.fb-menu{display:flex;flex-direction:column;font-size:13px}.fb-menu-actions{display:flex;flex-direction:column;padding:4px}.fb-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:7px 10px;border:none;border-radius:5px;background:none;color:inherit;text-align:left;cursor:pointer}.fb-menu-item i{font-size:16px;color:var(--uic-neutral-500, var(--grey-500))}.fb-menu-item i.copied{color:var(--green-600, #16a34a)}.fb-menu-item:hover,.fb-menu-item:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));outline:none}.fb-menu-section{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding:10px 14px 12px;display:flex;flex-direction:column;gap:10px}.fb-menu-section-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400))}.fb-menu-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.fb-segmented{display:inline-flex;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:6px;overflow:hidden}.fb-segmented button{width:32px;height:26px;border:none;border-left:solid 1px var(--uic-neutral-300, var(--grey-300));background:var(--uic-surface, white);color:inherit;font-size:12px;cursor:pointer}.fb-segmented button:first-child{border-left:none}.fb-segmented button:hover:not(:disabled){background-color:var(--uic-neutral-100, var(--grey-100))}.fb-segmented button.active{background-color:var(--uic-neutral-800, var(--grey-800));color:var(--uic-neutral-50, var(--grey-50));font-weight:600}.fb-segmented button:disabled{cursor:default}.fb-segmented button:focus-visible{outline:solid 2px var(--primary-400);outline-offset:-2px}.fb-menu-grid{display:grid;grid-template-columns:1fr 64px 64px;align-items:center;gap:6px 8px}.fb-menu-grid-head{font-size:11px;color:var(--uic-neutral-500, var(--grey-500));text-align:center}.fb-menu-grid input{width:100%;height:26px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;padding:0 6px;font-size:12px;text-align:center;background:var(--uic-surface, white);color:var(--uic-neutral-800, var(--grey-800))}.fb-menu-grid input:focus{outline:none;border-color:var(--primary-400)}.fb-menu-grid input:disabled{background:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-500, var(--grey-500))}.fb-menu-hint{font-size:11px;color:var(--uic-neutral-400, var(--grey-400))}.unsaved-dot{width:6px;height:6px;border-radius:50%;background-color:currentColor}.undo-bar{position:absolute;left:50%;bottom:14px;transform:translate(-50%);z-index:5;display:flex;align-items:center;gap:10px;max-width:calc(100% - 32px);padding:8px 8px 8px 14px;border-radius:6px;font-size:13px;background-color:var(--uic-neutral-800, var(--grey-800));color:var(--uic-neutral-50, var(--grey-50));box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18));animation:undo-bar-in .16s ease-out}.undo-bar-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.undo-bar-action,.undo-bar-close{flex:0 0 auto;border:none;background:none;color:inherit;cursor:pointer;border-radius:4px;padding:4px 8px}.undo-bar-action:hover,.undo-bar-action:focus-visible,.undo-bar-close:hover,.undo-bar-close:focus-visible{background-color:#ffffff1f;outline:none}.undo-bar-action{font-weight:600;color:var(--primary-200, #a9c7ff)}.undo-bar-close{padding:4px;display:flex}@keyframes undo-bar-in{0%{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%)}}@media (prefers-reduced-motion: reduce){.undo-bar{animation:none}}.formeditor-blocks{display:flex;flex-direction:column;gap:15px}.formeditor-blocks.cdk-drop-list-dragging>lib-block-editor:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}lib-block-editor.cdk-drag-placeholder{opacity:.35}.properties-header{display:flex;flex-direction:column;gap:6px;padding:10px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300));min-width:0}.formeditor-properties{animation:properties-in .16s ease-out}@keyframes properties-in{0%{opacity:0;transform:translate(12px)}to{opacity:1;transform:translate(0)}}@media (prefers-reduced-motion: reduce){.formeditor-properties{animation:none}}.properties-header-top{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}.properties-eyebrow{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400))}.properties-close{flex:0 0 auto;margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border:none;border-radius:5px;background:none;color:var(--uic-neutral-500, var(--grey-500));font-size:16px;cursor:pointer}.properties-close:hover,.properties-close:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-800, var(--grey-800));outline:none}.properties-breadcrumb{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;border:none;background:none;padding:2px 4px 2px 0;border-radius:4px;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));cursor:pointer}.properties-breadcrumb span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.properties-breadcrumb:hover,.properties-breadcrumb:focus-visible{color:var(--primary-600);outline:none}.properties-title{display:flex;align-items:center;gap:8px;min-width:0}.properties-title-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:5px;font-size:18px;background-color:var(--primary-100);color:var(--primary-600)}.properties-title-text{display:flex;flex-direction:column;min-width:0}.properties-title-text b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.properties-title-text small{font-size:11px;color:var(--uic-neutral-500, var(--grey-500))}.limit-wrapper{display:inline-block;align-self:flex-start}.limit-wrapper:has(button:disabled) ui-button{pointer-events:none}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: FieldEditorComponent, selector: "lib-field-editor", inputs: ["config", "focusRequiredField", "isSubField", "enableNameModify", "readOnly", "externalSources", "visibilityRulesEnabled", "styleEnabled", "surveyFieldMode", "options"], outputs: ["fieldChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: BlockEditorComponent, selector: "lib-block-editor", inputs: ["block", "selectedFieldId", "selectedSubFieldCode", "selectedSubFieldParentCode", "visibilityParentFieldCodes", "fieldLookup", "showIdentifier", "connectedFieldListIds", "readOnly", "availableFieldTypes", "canDelete", "fieldLimitReached", "maxFields", "maxRepeaterFields"], outputs: ["blockChange", "addFieldRequest", "deleteBlock", "notifySelectedField", "notifySelectedSubField", "notifyNewSubField", "itemRemoved", "duplicateFieldRequest", "moveFieldRequest"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: UicDropdownContainerComponent, selector: "ui-dropdown-container", inputs: ["buttonLabel", "disabled", "positions", "matchTriggerWidth", "width", "minWidth", "maxWidth", "backdropClass", "hasBackdrop", "closeOnBackdropClick", "closeOnEscape", "closeOnContentClick", "offsetX", "offsetY", "push", "flexibleDimensions"], outputs: ["closed"] }, { kind: "directive", type: UiDropdownCloseDirective, selector: "[uiDropdownClose]" }, { kind: "directive", type: UicToolTipDirective, selector: "[uiTooltip]", inputs: ["uiTooltip"] }] });
|
|
14797
15428
|
}
|
|
14798
15429
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicUserFormbuilderComponent, decorators: [{
|
|
14799
15430
|
type: Component,
|
|
@@ -14807,7 +15438,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
14807
15438
|
UicDropdownContainerComponent,
|
|
14808
15439
|
UiDropdownCloseDirective,
|
|
14809
15440
|
UicToolTipDirective
|
|
14810
|
-
], template: "<div class=\"formeditor\" [class.focused]=\"!isReadOnly()\" [class.read-only]=\"isReadOnly()\">\n <input #importFileInput id=\"formbuilder-import-file\" type=\"file\" accept=\".json,application/json\" hidden\n [attr.aria-label]=\"'form_builder.menu.load_json' | uicTranslate\"\n (change)=\"importSchemaFromFile($event)\">\n\n <!-- HEADER: t\u00EDtulo + estado | acciones principales + men\u00FA contextual -->\n <div class=\"formeditor-header\">\n <div class=\"formeditor-heading\">\n <span class=\"formeditor-title\">{{formTitle}}</span>\n @if (isReadOnly()) {\n <span class=\"status-chip read-only-chip\">\n <i class=\"ri-lock-line\" aria-hidden=\"true\"></i>\n {{'form_builder.read_only' | uicTranslate}}\n </span>\n } @else if (hasUnsavedChanges()) {\n <span class=\"status-chip unsaved-chip\" role=\"status\">\n <span class=\"unsaved-dot\" aria-hidden=\"true\"></span>\n {{'form_builder.unsaved_changes' | uicTranslate}}\n </span>\n }\n </div>\n\n <div class=\"formeditor-actions\">\n <ui-button color=\"primary\" type=\"bordered\" icon=\"ri-eye-line\" [text]=\"'form_builder.preview_form' | uicTranslate\" (click)=\"printForm()\"></ui-button>\n @if (isReadOnly()) {\n @if (!disabled) {\n <ui-button color=\"black\" icon=\"ri-edit-line\" [text]=\"'form_builder.edit' | uicTranslate\" (click)=\"enableEditMode()\"></ui-button>\n }\n } @else {\n <ui-button color=\"black\" type=\"bordered\" [text]=\"'form_builder.discard_changes' | uicTranslate\" (click)=\"discardChanges()\"></ui-button>\n <!-- Sin cambios no hay nada que guardar; \"Descartar\" sigue disponible para salir de la edici\u00F3n.\n Si el builder arranca en edici\u00F3n (sin snapshot), Guardar queda siempre habilitado. -->\n @let nothingToSave = !!editingSnapshot() && !hasUnsavedChanges();\n <ui-button\n color=\"black\"\n icon=\"ri-check-line\"\n [disabled]=\"nothingToSave\"\n [uiTooltip]=\"nothingToSave ? ('form_builder.no_changes' | uicTranslate) : ''\"\n [text]=\"'form_builder.submit_form' | uicTranslate\"\n (click)=\"submitForm()\">\n </ui-button>\n }\n\n <ui-dropdown-container width=\"280px\" maxWidth=\"calc(100vw - 32px)\" [positions]=\"menuPositions\">\n <ui-button\n button\n color=\"black\"\n type=\"ghost\"\n icon=\"ri-more-2-fill\"\n [iconOnly]=\"true\"\n [uiTooltip]=\"'form_builder.menu.more' | uicTranslate\"\n [attr.aria-label]=\"'form_builder.menu.more' | uicTranslate\">\n </ui-button>\n\n <div content class=\"fb-menu\">\n <div class=\"fb-menu-actions\">\n <button type=\"button\" class=\"fb-menu-item\" (click)=\"copySchemaToClipboard()\">\n <i [class]=\"schemaCopied() ? 'ri-check-line copied' : 'ri-file-copy-line'\" aria-hidden=\"true\"></i>\n <span>{{(schemaCopied() ? 'form_builder.menu.copied' : 'form_builder.menu.copy_json') | uicTranslate}}</span>\n </button>\n @if (!isReadOnly()) {\n <button type=\"button\" class=\"fb-menu-item\" uiDropdownClose (click)=\"importFileInput.click()\">\n <i class=\"ri-upload-2-line\" aria-hidden=\"true\"></i>\n <span>{{'form_builder.menu.load_json' | uicTranslate}}</span>\n </button>\n }\n </div>\n\n <div class=\"fb-menu-section\">\n <div class=\"fb-menu-section-title\">{{'form_builder.menu.layout_title' | uicTranslate}}</div>\n\n <div class=\"fb-menu-row\">\n <span id=\"fb-cols-label\">{{'form_builder.menu.columns' | uicTranslate}}</span>\n <div class=\"fb-segmented\" role=\"radiogroup\" aria-labelledby=\"fb-cols-label\">\n @for (cols of columnOptions; track cols) {\n <button\n type=\"button\"\n role=\"radio\"\n [attr.aria-checked]=\"editableCols() === cols\"\n [class.active]=\"editableCols() === cols\"\n [disabled]=\"isReadOnly()\"\n (click)=\"editableCols.set(cols)\">{{cols}}</button>\n }\n </div>\n </div>\n\n <div class=\"fb-menu-grid\">\n <span></span>\n <span class=\"fb-menu-grid-head\">{{'form_builder.menu.size' | uicTranslate}}</span>\n <span class=\"fb-menu-grid-head\">{{'form_builder.menu.margin' | uicTranslate}}</span>\n\n <span>{{'form_builder.menu.title' | uicTranslate}}</span>\n <input type=\"number\" min=\"8\" max=\"72\" placeholder=\"Auto\"\n [attr.aria-label]=\"'form_builder.schema.title_font_size' | uicTranslate\"\n [disabled]=\"isReadOnly()\"\n [ngModel]=\"editableTitleFontSize()\" (ngModelChange)=\"editableTitleFontSize.set($event || null)\">\n <input type=\"number\" min=\"0\" placeholder=\"Auto\"\n [attr.aria-label]=\"'form_builder.schema.title_margin' | uicTranslate\"\n [disabled]=\"isReadOnly()\"\n [ngModel]=\"editableTitleMargin()\" (ngModelChange)=\"editableTitleMargin.set($event || null)\">\n\n <span>{{'form_builder.menu.subtitle' | uicTranslate}}</span>\n <input type=\"number\" min=\"8\" max=\"72\" placeholder=\"Auto\"\n [attr.aria-label]=\"'form_builder.schema.subtitle_font_size' | uicTranslate\"\n [disabled]=\"isReadOnly()\"\n [ngModel]=\"editableSubtitleFontSize()\" (ngModelChange)=\"editableSubtitleFontSize.set($event || null)\">\n <input type=\"number\" min=\"0\" placeholder=\"Auto\"\n [attr.aria-label]=\"'form_builder.schema.subtitle_margin' | uicTranslate\"\n [disabled]=\"isReadOnly()\"\n [ngModel]=\"editableSubtitleMargin()\" (ngModelChange)=\"editableSubtitleMargin.set($event || null)\">\n </div>\n <p class=\"fb-menu-hint\">{{'form_builder.menu.layout_hint' | uicTranslate}}</p>\n </div>\n </div>\n </ui-dropdown-container>\n </div>\n </div>\n\n <!-- BODY: el mismo editor en ambos modos; en solo lectura todo queda deshabilitado -->\n <div class=\"formeditor-body\">\n <!-- Clic en una zona vac\u00EDa del canvas (no en un bloque ni un campo) cierra las propiedades -->\n <div class=\"formeditor-overflow\" (click)=\"onCanvasBackgroundClick($event)\">\n <div class=\"formeditor-workarea\">\n <div\n class=\"formeditor-blocks\"\n cdkDropList\n cdkDropListLockAxis=\"y\"\n [cdkDropListDisabled]=\"isReadOnly()\"\n (cdkDropListDropped)=\"reorderBlocks($event)\">\n @for (block of editableBlocks(); track block.code; let i = $index) {\n <lib-block-editor\n cdkDrag\n cdkDragLockAxis=\"y\"\n [cdkDragDisabled]=\"isReadOnly()\"\n [readOnly]=\"isReadOnly()\"\n [availableFieldTypes]=\"settings().fieldTypes\"\n [canDelete]=\"canDeleteBlocks()\"\n [fieldLimitReached]=\"fieldLimitReached()\"\n [maxFields]=\"settings().limits.maxFields\"\n [maxRepeaterFields]=\"settings().limits.maxRepeaterFields\"\n [block]=\"block\"\n [fieldLookup]=\"fieldLookup()\"\n [showIdentifier]=\"nameEditable()\"\n [connectedFieldListIds]=\"fieldListIds()\"\n (itemRemoved)=\"registerRemoval($event)\"\n (duplicateFieldRequest)=\"duplicateField($event)\"\n (moveFieldRequest)=\"moveField($event)\"\n [selectedFieldId]=\"selectedField()?.code ?? null\"\n [selectedSubFieldCode]=\"editingSubField()?.subField?.code ?? null\"\n [selectedSubFieldParentCode]=\"editingSubField()?.parentCode ?? null\"\n [visibilityParentFieldCodes]=\"visibilityParentFieldCodes()\"\n (blockChange)=\"onBlockChange(i, $event)\"\n (addFieldRequest)=\"addField(block.code, $event)\"\n (notifySelectedField)=\"selectField($event)\"\n (notifySelectedSubField)=\"onSelectSubField($event)\"\n (notifyNewSubField)=\"onNewSubField($event)\"\n (deleteBlock)=\"deleteBlock($event)\">\n </lib-block-editor>\n } @empty {\n @if (isReadOnly()) {\n <div class=\"no-selected-field\">\n <i class=\"ri-file-list-3-line\" aria-hidden=\"true\"></i>\n <p>{{'form_builder.no_blocks' | uicTranslate}}</p>\n </div>\n }\n }\n </div>\n @if (!isReadOnly() && settings().allowBlockCreation) {\n @let blockLimit = blockLimitReached();\n <!-- El tooltip va en un contenedor: un bot\u00F3n deshabilitado no recibe eventos del mouse -->\n <span class=\"limit-wrapper\" [uiTooltip]=\"blockLimit ? ('form_builder.limits.blocks_reached' | uicTranslate: { max: settings().limits.maxBlocks }) : ''\">\n <ui-button type=\"bordered\" icon=\"ri-add-line\" color=\"black\" [disabled]=\"blockLimit\" [text]=\"'form_builder.add_block' | uicTranslate\" (click)=\"addBlock()\"></ui-button>\n </span>\n }\n </div>\n </div>\n <!-- PROPERTIES: solo existe mientras hay un campo seleccionado; cerrarlo deselecciona -->\n @let editing = editingSubField()?.subField ?? selectedField();\n @if (editing) {\n <section\n class=\"formeditor-properties\"\n [attr.aria-label]=\"'form_builder.properties.title' | uicTranslate\"\n [style.width.px]=\"propertiesWidth()\"\n (keydown.escape)=\"onPropertiesEscape($event)\">\n <div\n class=\"formeditor-properties-resize\"\n [class.resizing]=\"isResizing()\"\n [attr.title]=\"'form_builder.properties.resize' | uicTranslate\"\n (mousedown)=\"startPropertiesResize($event)\"\n (dblclick)=\"resetPropertiesWidth()\">\n </div>\n <div class=\"properties-header\">\n <div class=\"properties-header-top\">\n @if (editingSubField(); as sub) {\n @let parent = fieldLookup().get(sub.parentCode);\n <button type=\"button\" class=\"properties-breadcrumb\" (click)=\"backToRepeater(sub.parentCode)\" [uiTooltip]=\"'form_builder.properties.back_to_repeater' | uicTranslate\">\n <i class=\"ri-arrow-left-s-line\" aria-hidden=\"true\"></i>\n <i class=\"ri-stack-line\" aria-hidden=\"true\"></i>\n <span>{{parent?.fieldData?.label || parent?.fieldData?.name}}</span>\n </button>\n } @else {\n <span class=\"properties-eyebrow\">{{'form_builder.properties.title' | uicTranslate}}</span>\n }\n <button\n type=\"button\"\n class=\"properties-close\"\n [uiTooltip]=\"'form_builder.properties.close' | uicTranslate\"\n [attr.aria-label]=\"'form_builder.properties.close' | uicTranslate\"\n (click)=\"closeProperties()\">\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <div class=\"properties-title\">\n <span class=\"properties-title-icon\"><i [class]=\"editing.field?.icon ?? 'ri-question-line'\" aria-hidden=\"true\"></i></span>\n <div class=\"properties-title-text\">\n <b>{{editing.fieldData.label || editing.fieldData.name}}</b>\n <small>{{(editing.field?.label ?? editing.fieldData.type) | uicTranslate}}</small>\n </div>\n </div>\n </div>\n <div class=\"formeditor-properties-form\">\n @if (editingSubField()) {\n <lib-field-editor\n [config]=\"editingSubField()!.subField\"\n [isSubField]=\"true\"\n [readOnly]=\"isReadOnly()\"\n [externalSources]=\"settings().externalSources\"\n [visibilityRulesEnabled]=\"settings().visibilityRules\"\n [styleEnabled]=\"settings().styleSection\"\n [focusRequiredField]=\"focusNewSubFieldCode() === editingSubField()?.subField?.code\"\n [enableNameModify]=\"nameEditable()\"\n [options]=\"subFieldDependencyOptions()\"\n (fieldChange)=\"onSubFieldChange($event)\">\n </lib-field-editor>\n } @else if (selectedField()) {\n <lib-field-editor\n [config]=\"selectedField()!\"\n [readOnly]=\"isReadOnly()\"\n [externalSources]=\"settings().externalSources\"\n [visibilityRulesEnabled]=\"settings().visibilityRules\"\n [styleEnabled]=\"settings().styleSection\"\n [focusRequiredField]=\"focusNewFieldCode() === selectedField()?.code\"\n [enableNameModify]=\"nameEditable()\"\n [options]=\"dependencyOptions()\"\n (fieldChange)=\"onFieldChange($event)\">\n </lib-field-editor>\n }\n </div>\n </section>\n }\n </div>\n\n @if (pendingUndo(); as undo) {\n <div class=\"undo-bar\" role=\"status\" aria-live=\"polite\">\n <i class=\"ri-delete-bin-line\" aria-hidden=\"true\"></i>\n <span class=\"undo-bar-text\">{{undo.message}}</span>\n <button type=\"button\" class=\"undo-bar-action\" (click)=\"undoRemoval()\">{{'form_builder.undo.action' | uicTranslate}}</button>\n <button type=\"button\" class=\"undo-bar-close\" [attr.aria-label]=\"'common.close' | uicTranslate\" (click)=\"dismissUndo()\">\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n</div>\n", styles: [".formeditor{position:relative;display:flex;flex-direction:column;overflow:hidden;background-color:var(--uic-neutral-100, var(--grey-100));border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;max-height:500px}.formeditor-header{background-color:var(--uic-surface, white);border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300));display:flex;align-items:center;gap:10px;padding:6px 8px 6px 14px;min-height:48px}.formeditor-heading{flex:1 1;min-width:0;display:flex;align-items:center;gap:10px}.formeditor-title{font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formeditor-actions{flex:0 0 auto;display:flex;align-items:center;gap:6px}.formeditor-body{display:flex;gap:10px;overflow:hidden;padding:10px;min-height:0}.formeditor-overflow{padding:5px;flex:1 1;overflow:auto;min-width:0}.formeditor-workarea{display:flex;flex-direction:column;gap:15px;height:fit-content}.formeditor-properties{width:320px;flex:0 0 auto;display:flex;flex-direction:column;position:relative;background-color:var(--uic-surface, white);border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;min-height:0;min-width:250px;max-width:600px}.formeditor-properties-resize{position:absolute;top:0;bottom:0;left:-6px;width:10px;cursor:col-resize;z-index:1}.formeditor-properties-resize:after{content:\"\";position:absolute;top:8px;bottom:8px;left:4px;width:2px;border-radius:1px;background-color:transparent;transition:background-color .15s ease}.formeditor-properties-resize:hover:after,.formeditor-properties-resize.resizing:after{background-color:var(--primary-400)}.formeditor-properties-form{padding:10px;overflow:auto;flex:1 1 auto;min-height:0}.focused{border:solid 1px var(--primary-400);border-radius:10px;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.no-selected-field{width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px 0;font-size:13px;gap:15px;text-align:center;color:var(--uic-neutral-400, var(--grey-400))}.no-selected-field i{font-size:24px}.status-chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:5px;padding:1px 8px;border-radius:10px;font-size:11px;white-space:nowrap}.unsaved-chip{background-color:var(--yellow-100);color:var(--yellow-700)}.read-only-chip{background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-500, var(--grey-500))}.fb-menu{display:flex;flex-direction:column;font-size:13px}.fb-menu-actions{display:flex;flex-direction:column;padding:4px}.fb-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:7px 10px;border:none;border-radius:5px;background:none;color:inherit;text-align:left;cursor:pointer}.fb-menu-item i{font-size:16px;color:var(--uic-neutral-500, var(--grey-500))}.fb-menu-item i.copied{color:var(--green-600, #16a34a)}.fb-menu-item:hover,.fb-menu-item:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));outline:none}.fb-menu-section{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding:10px 14px 12px;display:flex;flex-direction:column;gap:10px}.fb-menu-section-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400))}.fb-menu-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.fb-segmented{display:inline-flex;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:6px;overflow:hidden}.fb-segmented button{width:32px;height:26px;border:none;border-left:solid 1px var(--uic-neutral-300, var(--grey-300));background:var(--uic-surface, white);color:inherit;font-size:12px;cursor:pointer}.fb-segmented button:first-child{border-left:none}.fb-segmented button:hover:not(:disabled){background-color:var(--uic-neutral-100, var(--grey-100))}.fb-segmented button.active{background-color:var(--uic-neutral-800, var(--grey-800));color:var(--uic-neutral-50, var(--grey-50));font-weight:600}.fb-segmented button:disabled{cursor:default}.fb-segmented button:focus-visible{outline:solid 2px var(--primary-400);outline-offset:-2px}.fb-menu-grid{display:grid;grid-template-columns:1fr 64px 64px;align-items:center;gap:6px 8px}.fb-menu-grid-head{font-size:11px;color:var(--uic-neutral-500, var(--grey-500));text-align:center}.fb-menu-grid input{width:100%;height:26px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;padding:0 6px;font-size:12px;text-align:center;background:var(--uic-surface, white);color:var(--uic-neutral-800, var(--grey-800))}.fb-menu-grid input:focus{outline:none;border-color:var(--primary-400)}.fb-menu-grid input:disabled{background:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-500, var(--grey-500))}.fb-menu-hint{font-size:11px;color:var(--uic-neutral-400, var(--grey-400))}.unsaved-dot{width:6px;height:6px;border-radius:50%;background-color:currentColor}.undo-bar{position:absolute;left:50%;bottom:14px;transform:translate(-50%);z-index:5;display:flex;align-items:center;gap:10px;max-width:calc(100% - 32px);padding:8px 8px 8px 14px;border-radius:6px;font-size:13px;background-color:var(--uic-neutral-800, var(--grey-800));color:var(--uic-neutral-50, var(--grey-50));box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18));animation:undo-bar-in .16s ease-out}.undo-bar-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.undo-bar-action,.undo-bar-close{flex:0 0 auto;border:none;background:none;color:inherit;cursor:pointer;border-radius:4px;padding:4px 8px}.undo-bar-action:hover,.undo-bar-action:focus-visible,.undo-bar-close:hover,.undo-bar-close:focus-visible{background-color:#ffffff1f;outline:none}.undo-bar-action{font-weight:600;color:var(--primary-200, #a9c7ff)}.undo-bar-close{padding:4px;display:flex}@keyframes undo-bar-in{0%{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%)}}@media (prefers-reduced-motion: reduce){.undo-bar{animation:none}}.formeditor-blocks{display:flex;flex-direction:column;gap:15px}.formeditor-blocks.cdk-drop-list-dragging>lib-block-editor:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}lib-block-editor.cdk-drag-placeholder{opacity:.35}.properties-header{display:flex;flex-direction:column;gap:6px;padding:10px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300));min-width:0}.formeditor-properties{animation:properties-in .16s ease-out}@keyframes properties-in{0%{opacity:0;transform:translate(12px)}to{opacity:1;transform:translate(0)}}@media (prefers-reduced-motion: reduce){.formeditor-properties{animation:none}}.properties-header-top{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}.properties-eyebrow{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400))}.properties-close{flex:0 0 auto;margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border:none;border-radius:5px;background:none;color:var(--uic-neutral-500, var(--grey-500));font-size:16px;cursor:pointer}.properties-close:hover,.properties-close:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-800, var(--grey-800));outline:none}.properties-breadcrumb{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;border:none;background:none;padding:2px 4px 2px 0;border-radius:4px;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));cursor:pointer}.properties-breadcrumb span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.properties-breadcrumb:hover,.properties-breadcrumb:focus-visible{color:var(--primary-600);outline:none}.properties-title{display:flex;align-items:center;gap:8px;min-width:0}.properties-title-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:5px;font-size:18px;background-color:var(--primary-100);color:var(--primary-600)}.properties-title-text{display:flex;flex-direction:column;min-width:0}.properties-title-text b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.properties-title-text small{font-size:11px;color:var(--uic-neutral-500, var(--grey-500))}.limit-wrapper{display:inline-block;align-self:flex-start}.limit-wrapper:has(button:disabled) ui-button{pointer-events:none}\n"] }]
|
|
15441
|
+
], template: "<div class=\"formeditor\" [class.focused]=\"!isReadOnly()\" [class.read-only]=\"isReadOnly()\">\r\n <input #importFileInput id=\"formbuilder-import-file\" type=\"file\" accept=\".json,application/json\" hidden\r\n [attr.aria-label]=\"'form_builder.menu.load_json' | uicTranslate\"\r\n (change)=\"importSchemaFromFile($event)\">\r\n\r\n <!-- HEADER: t\u00EDtulo + estado | acciones principales + men\u00FA contextual -->\r\n <div class=\"formeditor-header\">\r\n <div class=\"formeditor-heading\">\r\n <span class=\"formeditor-title\">{{formTitle}}</span>\r\n @if (isReadOnly()) {\r\n <span class=\"status-chip read-only-chip\">\r\n <i class=\"ri-lock-line\" aria-hidden=\"true\"></i>\r\n {{'form_builder.read_only' | uicTranslate}}\r\n </span>\r\n } @else if (hasUnsavedChanges()) {\r\n <span class=\"status-chip unsaved-chip\" role=\"status\">\r\n <span class=\"unsaved-dot\" aria-hidden=\"true\"></span>\r\n {{'form_builder.unsaved_changes' | uicTranslate}}\r\n </span>\r\n }\r\n </div>\r\n\r\n <div class=\"formeditor-actions\">\r\n @if (settings().preview.showButton) {\r\n <ui-button color=\"primary\" type=\"bordered\" icon=\"ri-eye-line\" [text]=\"'form_builder.preview_form' | uicTranslate\" (click)=\"printForm()\"></ui-button>\r\n }\r\n @if (isReadOnly()) {\r\n @if (!disabled) {\r\n <ui-button color=\"black\" icon=\"ri-edit-line\" [text]=\"'form_builder.edit' | uicTranslate\" (click)=\"enableEditMode()\"></ui-button>\r\n }\r\n } @else {\r\n <ui-button color=\"black\" type=\"bordered\" [text]=\"'form_builder.discard_changes' | uicTranslate\" (click)=\"discardChanges()\"></ui-button>\r\n <!-- Sin cambios no hay nada que guardar; \"Descartar\" sigue disponible para salir de la edici\u00F3n.\r\n Si el builder arranca en edici\u00F3n (sin snapshot), Guardar queda siempre habilitado. -->\r\n @let nothingToSave = !!editingSnapshot() && !hasUnsavedChanges();\r\n <ui-button\r\n color=\"black\"\r\n icon=\"ri-check-line\"\r\n [disabled]=\"nothingToSave\"\r\n [uiTooltip]=\"nothingToSave ? ('form_builder.no_changes' | uicTranslate) : ''\"\r\n [text]=\"'form_builder.submit_form' | uicTranslate\"\r\n (click)=\"submitForm()\">\r\n </ui-button>\r\n }\r\n\r\n <ui-dropdown-container width=\"280px\" maxWidth=\"calc(100vw - 32px)\" [positions]=\"menuPositions\">\r\n <ui-button\r\n button\r\n color=\"black\"\r\n type=\"ghost\"\r\n icon=\"ri-more-2-fill\"\r\n [iconOnly]=\"true\"\r\n [uiTooltip]=\"'form_builder.menu.more' | uicTranslate\"\r\n [attr.aria-label]=\"'form_builder.menu.more' | uicTranslate\">\r\n </ui-button>\r\n\r\n <div content class=\"fb-menu\">\r\n <div class=\"fb-menu-actions\">\r\n <button type=\"button\" class=\"fb-menu-item\" (click)=\"copySchemaToClipboard()\">\r\n <i [class]=\"schemaCopied() ? 'ri-check-line copied' : 'ri-file-copy-line'\" aria-hidden=\"true\"></i>\r\n <span>{{(schemaCopied() ? 'form_builder.menu.copied' : 'form_builder.menu.copy_json') | uicTranslate}}</span>\r\n </button>\r\n @if (!isReadOnly()) {\r\n <button type=\"button\" class=\"fb-menu-item\" uiDropdownClose (click)=\"importFileInput.click()\">\r\n <i class=\"ri-upload-2-line\" aria-hidden=\"true\"></i>\r\n <span>{{'form_builder.menu.load_json' | uicTranslate}}</span>\r\n </button>\r\n }\r\n </div>\r\n\r\n <div class=\"fb-menu-section\">\r\n <div class=\"fb-menu-section-title\">{{'form_builder.menu.layout_title' | uicTranslate}}</div>\r\n\r\n <div class=\"fb-menu-row\">\r\n <span id=\"fb-cols-label\">{{'form_builder.menu.columns' | uicTranslate}}</span>\r\n <div class=\"fb-segmented\" role=\"radiogroup\" aria-labelledby=\"fb-cols-label\">\r\n @for (cols of columnOptions; track cols) {\r\n <button\r\n type=\"button\"\r\n role=\"radio\"\r\n [attr.aria-checked]=\"editableCols() === cols\"\r\n [class.active]=\"editableCols() === cols\"\r\n [disabled]=\"isReadOnly()\"\r\n (click)=\"editableCols.set(cols)\">{{cols}}</button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"fb-menu-grid\">\r\n <span></span>\r\n <span class=\"fb-menu-grid-head\">{{'form_builder.menu.size' | uicTranslate}}</span>\r\n <span class=\"fb-menu-grid-head\">{{'form_builder.menu.margin' | uicTranslate}}</span>\r\n\r\n <span>{{'form_builder.menu.title' | uicTranslate}}</span>\r\n <input type=\"number\" min=\"8\" max=\"72\" placeholder=\"Auto\"\r\n [attr.aria-label]=\"'form_builder.schema.title_font_size' | uicTranslate\"\r\n [disabled]=\"isReadOnly()\"\r\n [ngModel]=\"editableTitleFontSize()\" (ngModelChange)=\"editableTitleFontSize.set($event || null)\">\r\n <input type=\"number\" min=\"0\" placeholder=\"Auto\"\r\n [attr.aria-label]=\"'form_builder.schema.title_margin' | uicTranslate\"\r\n [disabled]=\"isReadOnly()\"\r\n [ngModel]=\"editableTitleMargin()\" (ngModelChange)=\"editableTitleMargin.set($event || null)\">\r\n\r\n <span>{{'form_builder.menu.subtitle' | uicTranslate}}</span>\r\n <input type=\"number\" min=\"8\" max=\"72\" placeholder=\"Auto\"\r\n [attr.aria-label]=\"'form_builder.schema.subtitle_font_size' | uicTranslate\"\r\n [disabled]=\"isReadOnly()\"\r\n [ngModel]=\"editableSubtitleFontSize()\" (ngModelChange)=\"editableSubtitleFontSize.set($event || null)\">\r\n <input type=\"number\" min=\"0\" placeholder=\"Auto\"\r\n [attr.aria-label]=\"'form_builder.schema.subtitle_margin' | uicTranslate\"\r\n [disabled]=\"isReadOnly()\"\r\n [ngModel]=\"editableSubtitleMargin()\" (ngModelChange)=\"editableSubtitleMargin.set($event || null)\">\r\n </div>\r\n <p class=\"fb-menu-hint\">{{'form_builder.menu.layout_hint' | uicTranslate}}</p>\r\n </div>\r\n </div>\r\n </ui-dropdown-container>\r\n </div>\r\n </div>\r\n\r\n <!-- BODY: el mismo editor en ambos modos; en solo lectura todo queda deshabilitado -->\r\n <div class=\"formeditor-body\">\r\n <!-- Clic en una zona vac\u00EDa del canvas (no en un bloque ni un campo) cierra las propiedades -->\r\n <div class=\"formeditor-overflow\" (click)=\"onCanvasBackgroundClick($event)\">\r\n <div class=\"formeditor-workarea\">\r\n <div\r\n class=\"formeditor-blocks\"\r\n cdkDropList\r\n cdkDropListLockAxis=\"y\"\r\n [cdkDropListDisabled]=\"isReadOnly()\"\r\n (cdkDropListDropped)=\"reorderBlocks($event)\">\r\n @for (block of editableBlocks(); track block.code; let i = $index) {\r\n <lib-block-editor\r\n cdkDrag\r\n cdkDragLockAxis=\"y\"\r\n [cdkDragDisabled]=\"isReadOnly()\"\r\n [readOnly]=\"isReadOnly()\"\r\n [availableFieldTypes]=\"settings().fieldTypes\"\r\n [canDelete]=\"canDeleteBlocks()\"\r\n [fieldLimitReached]=\"fieldLimitReached()\"\r\n [maxFields]=\"settings().limits.maxFields\"\r\n [maxRepeaterFields]=\"settings().limits.maxRepeaterFields\"\r\n [block]=\"block\"\r\n [fieldLookup]=\"fieldLookup()\"\r\n [showIdentifier]=\"nameEditable()\"\r\n [connectedFieldListIds]=\"fieldListIds()\"\r\n (itemRemoved)=\"registerRemoval($event)\"\r\n (duplicateFieldRequest)=\"duplicateField($event)\"\r\n (moveFieldRequest)=\"moveField($event)\"\r\n [selectedFieldId]=\"selectedField()?.code ?? null\"\r\n [selectedSubFieldCode]=\"editingSubField()?.subField?.code ?? null\"\r\n [selectedSubFieldParentCode]=\"editingSubField()?.parentCode ?? null\"\r\n [visibilityParentFieldCodes]=\"visibilityParentFieldCodes()\"\r\n (blockChange)=\"onBlockChange(i, $event)\"\r\n (addFieldRequest)=\"addField(block.code, $event)\"\r\n (notifySelectedField)=\"selectField($event)\"\r\n (notifySelectedSubField)=\"onSelectSubField($event)\"\r\n (notifyNewSubField)=\"onNewSubField($event)\"\r\n (deleteBlock)=\"deleteBlock($event)\">\r\n </lib-block-editor>\r\n } @empty {\r\n @if (isReadOnly()) {\r\n <div class=\"no-selected-field\">\r\n <i class=\"ri-file-list-3-line\" aria-hidden=\"true\"></i>\r\n <p>{{'form_builder.no_blocks' | uicTranslate}}</p>\r\n </div>\r\n }\r\n }\r\n </div>\r\n @if (!isReadOnly() && settings().allowBlockCreation) {\r\n @let blockLimit = blockLimitReached();\r\n <!-- El tooltip va en un contenedor: un bot\u00F3n deshabilitado no recibe eventos del mouse -->\r\n <span class=\"limit-wrapper\" [uiTooltip]=\"blockLimit ? ('form_builder.limits.blocks_reached' | uicTranslate: { max: settings().limits.maxBlocks }) : ''\">\r\n <ui-button type=\"bordered\" icon=\"ri-add-line\" color=\"black\" [disabled]=\"blockLimit\" [text]=\"'form_builder.add_block' | uicTranslate\" (click)=\"addBlock()\"></ui-button>\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n <!-- PROPERTIES: solo existe mientras hay un campo seleccionado; cerrarlo deselecciona -->\r\n @let editing = editingSubField()?.subField ?? selectedField();\r\n @if (editing) {\r\n <section\r\n class=\"formeditor-properties\"\r\n [attr.aria-label]=\"'form_builder.properties.title' | uicTranslate\"\r\n [style.width.px]=\"propertiesWidth()\"\r\n (keydown.escape)=\"onPropertiesEscape($event)\">\r\n <div\r\n class=\"formeditor-properties-resize\"\r\n [class.resizing]=\"isResizing()\"\r\n [attr.title]=\"'form_builder.properties.resize' | uicTranslate\"\r\n (mousedown)=\"startPropertiesResize($event)\"\r\n (dblclick)=\"resetPropertiesWidth()\">\r\n </div>\r\n <div class=\"properties-header\">\r\n <div class=\"properties-header-top\">\r\n @if (editingSubField(); as sub) {\r\n @let parent = fieldLookup().get(sub.parentCode);\r\n <button type=\"button\" class=\"properties-breadcrumb\" (click)=\"backToRepeater(sub.parentCode)\" [uiTooltip]=\"'form_builder.properties.back_to_repeater' | uicTranslate\">\r\n <i class=\"ri-arrow-left-s-line\" aria-hidden=\"true\"></i>\r\n <i class=\"ri-stack-line\" aria-hidden=\"true\"></i>\r\n <span>{{parent?.fieldData?.label || parent?.fieldData?.name}}</span>\r\n </button>\r\n } @else {\r\n <span class=\"properties-eyebrow\">{{'form_builder.properties.title' | uicTranslate}}</span>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"properties-close\"\r\n [uiTooltip]=\"'form_builder.properties.close' | uicTranslate\"\r\n [attr.aria-label]=\"'form_builder.properties.close' | uicTranslate\"\r\n (click)=\"closeProperties()\">\r\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n <div class=\"properties-title\">\r\n <span class=\"properties-title-icon\"><i [class]=\"editing.field?.icon ?? 'ri-question-line'\" aria-hidden=\"true\"></i></span>\r\n <div class=\"properties-title-text\">\r\n <b>{{editing.fieldData.label || editing.fieldData.name}}</b>\r\n <small>{{(editing.field?.label ?? editing.fieldData.type) | uicTranslate}}</small>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"formeditor-properties-form\">\r\n @if (editingSubField()) {\r\n <lib-field-editor\r\n [config]=\"editingSubField()!.subField\"\r\n [isSubField]=\"true\"\r\n [readOnly]=\"isReadOnly()\"\r\n [externalSources]=\"settings().externalSources\"\r\n [visibilityRulesEnabled]=\"settings().visibilityRules\"\r\n [styleEnabled]=\"settings().styleSection\"\r\n [focusRequiredField]=\"focusNewSubFieldCode() === editingSubField()?.subField?.code\"\r\n [enableNameModify]=\"nameEditable()\"\r\n [options]=\"subFieldDependencyOptions()\"\r\n (fieldChange)=\"onSubFieldChange($event)\">\r\n </lib-field-editor>\r\n } @else if (selectedField()) {\r\n <lib-field-editor\r\n [config]=\"selectedField()!\"\r\n [readOnly]=\"isReadOnly()\"\r\n [externalSources]=\"settings().externalSources\"\r\n [visibilityRulesEnabled]=\"settings().visibilityRules\"\r\n [styleEnabled]=\"settings().styleSection\"\r\n [surveyFieldMode]=\"surveyFieldMode()\"\r\n [focusRequiredField]=\"focusNewFieldCode() === selectedField()?.code\"\r\n [enableNameModify]=\"nameEditable()\"\r\n [options]=\"dependencyOptions()\"\r\n (fieldChange)=\"onFieldChange($event)\">\r\n </lib-field-editor>\r\n }\r\n </div>\r\n </section>\r\n }\r\n </div>\r\n\r\n @if (pendingUndo(); as undo) {\r\n <div class=\"undo-bar\" role=\"status\" aria-live=\"polite\">\r\n <i class=\"ri-delete-bin-line\" aria-hidden=\"true\"></i>\r\n <span class=\"undo-bar-text\">{{undo.message}}</span>\r\n <button type=\"button\" class=\"undo-bar-action\" (click)=\"undoRemoval()\">{{'form_builder.undo.action' | uicTranslate}}</button>\r\n <button type=\"button\" class=\"undo-bar-close\" [attr.aria-label]=\"'common.close' | uicTranslate\" (click)=\"dismissUndo()\">\r\n <i class=\"ri-close-line\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".formeditor{position:relative;display:flex;flex-direction:column;overflow:hidden;background-color:var(--uic-neutral-100, var(--grey-100));border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;max-height:500px}.formeditor-header{background-color:var(--uic-surface, white);border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300));display:flex;align-items:center;gap:10px;padding:6px 8px 6px 14px;min-height:48px}.formeditor-heading{flex:1 1;min-width:0;display:flex;align-items:center;gap:10px}.formeditor-title{font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formeditor-actions{flex:0 0 auto;display:flex;align-items:center;gap:6px}.formeditor-body{display:flex;gap:10px;overflow:hidden;padding:10px;min-height:0}.formeditor-overflow{padding:5px;flex:1 1;overflow:auto;min-width:0}.formeditor-workarea{display:flex;flex-direction:column;gap:15px;height:fit-content}.formeditor-properties{width:320px;flex:0 0 auto;display:flex;flex-direction:column;position:relative;background-color:var(--uic-surface, white);border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;min-height:0;min-width:250px;max-width:600px}.formeditor-properties-resize{position:absolute;top:0;bottom:0;left:-6px;width:10px;cursor:col-resize;z-index:1}.formeditor-properties-resize:after{content:\"\";position:absolute;top:8px;bottom:8px;left:4px;width:2px;border-radius:1px;background-color:transparent;transition:background-color .15s ease}.formeditor-properties-resize:hover:after,.formeditor-properties-resize.resizing:after{background-color:var(--primary-400)}.formeditor-properties-form{padding:10px;overflow:auto;flex:1 1 auto;min-height:0}.focused{border:solid 1px var(--primary-400);border-radius:10px;box-shadow:var(--uic-focus-shadow, 0 0 0 3px var(--secondary-alpha))}.no-selected-field{width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px 0;font-size:13px;gap:15px;text-align:center;color:var(--uic-neutral-400, var(--grey-400))}.no-selected-field i{font-size:24px}.status-chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:5px;padding:1px 8px;border-radius:10px;font-size:11px;white-space:nowrap}.unsaved-chip{background-color:var(--yellow-100);color:var(--yellow-700)}.read-only-chip{background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-500, var(--grey-500))}.fb-menu{display:flex;flex-direction:column;font-size:13px}.fb-menu-actions{display:flex;flex-direction:column;padding:4px}.fb-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:7px 10px;border:none;border-radius:5px;background:none;color:inherit;text-align:left;cursor:pointer}.fb-menu-item i{font-size:16px;color:var(--uic-neutral-500, var(--grey-500))}.fb-menu-item i.copied{color:var(--green-600, #16a34a)}.fb-menu-item:hover,.fb-menu-item:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));outline:none}.fb-menu-section{border-top:solid 1px var(--uic-neutral-200, var(--grey-200));padding:10px 14px 12px;display:flex;flex-direction:column;gap:10px}.fb-menu-section-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400))}.fb-menu-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.fb-segmented{display:inline-flex;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:6px;overflow:hidden}.fb-segmented button{width:32px;height:26px;border:none;border-left:solid 1px var(--uic-neutral-300, var(--grey-300));background:var(--uic-surface, white);color:inherit;font-size:12px;cursor:pointer}.fb-segmented button:first-child{border-left:none}.fb-segmented button:hover:not(:disabled){background-color:var(--uic-neutral-100, var(--grey-100))}.fb-segmented button.active{background-color:var(--uic-neutral-800, var(--grey-800));color:var(--uic-neutral-50, var(--grey-50));font-weight:600}.fb-segmented button:disabled{cursor:default}.fb-segmented button:focus-visible{outline:solid 2px var(--primary-400);outline-offset:-2px}.fb-menu-grid{display:grid;grid-template-columns:1fr 64px 64px;align-items:center;gap:6px 8px}.fb-menu-grid-head{font-size:11px;color:var(--uic-neutral-500, var(--grey-500));text-align:center}.fb-menu-grid input{width:100%;height:26px;border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:5px;padding:0 6px;font-size:12px;text-align:center;background:var(--uic-surface, white);color:var(--uic-neutral-800, var(--grey-800))}.fb-menu-grid input:focus{outline:none;border-color:var(--primary-400)}.fb-menu-grid input:disabled{background:var(--uic-neutral-50, var(--grey-50));color:var(--uic-neutral-500, var(--grey-500))}.fb-menu-hint{font-size:11px;color:var(--uic-neutral-400, var(--grey-400))}.unsaved-dot{width:6px;height:6px;border-radius:50%;background-color:currentColor}.undo-bar{position:absolute;left:50%;bottom:14px;transform:translate(-50%);z-index:5;display:flex;align-items:center;gap:10px;max-width:calc(100% - 32px);padding:8px 8px 8px 14px;border-radius:6px;font-size:13px;background-color:var(--uic-neutral-800, var(--grey-800));color:var(--uic-neutral-50, var(--grey-50));box-shadow:var(--uic-shadow-md, 0 6px 12px rgba(0, 0, 0, .18));animation:undo-bar-in .16s ease-out}.undo-bar-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.undo-bar-action,.undo-bar-close{flex:0 0 auto;border:none;background:none;color:inherit;cursor:pointer;border-radius:4px;padding:4px 8px}.undo-bar-action:hover,.undo-bar-action:focus-visible,.undo-bar-close:hover,.undo-bar-close:focus-visible{background-color:#ffffff1f;outline:none}.undo-bar-action{font-weight:600;color:var(--primary-200, #a9c7ff)}.undo-bar-close{padding:4px;display:flex}@keyframes undo-bar-in{0%{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%)}}@media (prefers-reduced-motion: reduce){.undo-bar{animation:none}}.formeditor-blocks{display:flex;flex-direction:column;gap:15px}.formeditor-blocks.cdk-drop-list-dragging>lib-block-editor:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}lib-block-editor.cdk-drag-placeholder{opacity:.35}.properties-header{display:flex;flex-direction:column;gap:6px;padding:10px;border-bottom:solid 1px var(--uic-neutral-300, var(--grey-300));min-width:0}.formeditor-properties{animation:properties-in .16s ease-out}@keyframes properties-in{0%{opacity:0;transform:translate(12px)}to{opacity:1;transform:translate(0)}}@media (prefers-reduced-motion: reduce){.formeditor-properties{animation:none}}.properties-header-top{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}.properties-eyebrow{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--uic-neutral-400, var(--grey-400))}.properties-close{flex:0 0 auto;margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border:none;border-radius:5px;background:none;color:var(--uic-neutral-500, var(--grey-500));font-size:16px;cursor:pointer}.properties-close:hover,.properties-close:focus-visible{background-color:var(--uic-neutral-100, var(--grey-100));color:var(--uic-neutral-800, var(--grey-800));outline:none}.properties-breadcrumb{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;border:none;background:none;padding:2px 4px 2px 0;border-radius:4px;font-size:12px;color:var(--uic-neutral-500, var(--grey-500));cursor:pointer}.properties-breadcrumb span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.properties-breadcrumb:hover,.properties-breadcrumb:focus-visible{color:var(--primary-600);outline:none}.properties-title{display:flex;align-items:center;gap:8px;min-width:0}.properties-title-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:5px;font-size:18px;background-color:var(--primary-100);color:var(--primary-600)}.properties-title-text{display:flex;flex-direction:column;min-width:0}.properties-title-text b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.properties-title-text small{font-size:11px;color:var(--uic-neutral-500, var(--grey-500))}.limit-wrapper{display:inline-block;align-self:flex-start}.limit-wrapper:has(button:disabled) ui-button{pointer-events:none}\n"] }]
|
|
14811
15442
|
}], ctorParameters: () => [], propDecorators: { disabled: [{
|
|
14812
15443
|
type: Input
|
|
14813
15444
|
}], config: [{
|
|
@@ -15020,7 +15651,7 @@ class RuleDefinirionComponent {
|
|
|
15020
15651
|
return condition.id === 0 ? (condition.temporalId ?? '') : condition.id;
|
|
15021
15652
|
}
|
|
15022
15653
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RuleDefinirionComponent, deps: [{ token: MODAL_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
15023
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: RuleDefinirionComponent, isStandalone: true, selector: "lib-rule-definirion", ngImport: i0, template: "\
|
|
15654
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: RuleDefinirionComponent, isStandalone: true, selector: "lib-rule-definirion", ngImport: i0, template: "\n@if (newRule) {\n <ui-form-wrapper #formWrapper \n (formChange)=\"updateFormNewRule($event)\"\n (formSubmit)=\"createAndSelectRule($event)\" \n [initialValues]=\"initialValues\"\n [fields]=\"fields\" \n [cols]=\"2\"></ui-form-wrapper>\n <div class=\"condition-btns\">\n <ui-button icon=\"ri-arrow-left-line\" (click)=\"newRule = false\" color=\"black\" type=\"bordered\">{{ 'rule_builder.definition.cancel_and_back' | uicTranslate }}</ui-button>\n <ui-button (click)=\"formWrapper.submit()\" icon=\"ri-check-line\" color=\"black\">{{ 'rule_builder.definition.create_and_select' | uicTranslate }}</ui-button>\n </div>\n} @else {\n <div class=\"condition-searcher\">\n <ui-input>\n <input [(ngModel)]=\"searchTerm\" (ngModelChange)=\"onSearchTermChange()\" [placeholder]=\"'rule_builder.definition.search_placeholder' | uicTranslate\" type=\"text\">\n </ui-input>\n <ui-button (click)=\"newRule = true\" color=\"black\">{{ 'rule_builder.definition.new_rule' | uicTranslate }}</ui-button>\n </div>\n\n @if (paginatedConditions.length > 0) {\n @for (condition of paginatedConditions; track $index) {\n <div class=\"condition\" [class.condition-selected]=\"isSelected(condition)\">\n <i class=\"ri-align-item-horizontal-center-line\"></i>\n <div style=\"flex: 1 1;\">\n <div class=\"condition-title\"><span [innerHTML]=\"highlightSearch(condition.description)\"></span></div>\n @if (customNamesEnabled) {\n <div class=\"condition-body\">\n <span class=\"condition-field\" [innerHTML]=\"highlightSearch(condition.fieldName)\"></span>\n <span class=\"condition-operator\" [innerHTML]=\"highlightSearch(condition.operatorName)\"></span>\n <span class=\"condition-value\" [innerHTML]=\"highlightSearch(condition.value)\"></span>\n </div>\n }\n </div>\n @if (!isSelected(condition)) {\n <ui-button (click)=\"select(condition)\" color=\"primary\" size=\"s\" type=\"bordered\">{{ 'common.select' | uicTranslate }}</ui-button>\n }\n </div>\n }\n } @else {\n <div class=\"condition\">\n <div class=\"condition-emptytext\">\n {{ 'rule_builder.definition.no_results' | uicTranslate }}\n </div>\n </div>\n }\n\n <div class=\"condition-pagination\">\n <ui-button [disabled]=\"!canGoToPreviousPage\" (click)=\"goToPreviousPage()\" color=\"black\" size=\"s\" type=\"bordered\">{{ 'rule_builder.definition.previous' | uicTranslate }}</ui-button>\n <div><b>{{ currentPage }}</b> / {{ totalPages }}</div>\n <ui-button [disabled]=\"!canGoToNextPage\" (click)=\"goToNextPage()\" color=\"black\" size=\"s\" type=\"bordered\">{{ 'rule_builder.definition.next' | uicTranslate }}</ui-button>\n </div>\n}\n", styles: [".condition{border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:10px;background-color:var(--uic-neutral-50, var(--grey-50));padding:6px;margin-bottom:4px;display:flex;align-items:center;gap:10px}.condition-emptytext{font-size:12px;text-align:center;color:var(--uic-neutral-400, var(--grey-400));padding:10px;width:100%}.condition i{color:var(--blue-600)}.condition-selected{border-color:var(--blue-500);background:linear-gradient(135deg,var(--blue-50) 0%,#eef6ff 100%);box-shadow:inset 0 0 0 1px #2563eb1f}.condition-selected .condition-title{color:var(--blue-800)}.condition-selected .condition-body,.condition-selected i{color:var(--blue-700)}.condition-title{font-size:14px;font-weight:500;line-height:16px}.condition-body{color:var(--uic-neutral-500, var(--grey-500));display:flex;gap:5px;font-size:12px}.condition-searcher{display:flex;gap:25px;margin-bottom:10px}.condition-pagination{margin-top:15px;display:flex;font-size:14px;align-items:center;justify-content:space-between}.condition-btns{padding-top:10px;border-top:solid 1px var(--uic-neutral-200, var(--grey-200));display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "computedFieldResolver", "externalValidatorResolver", "disabled", "fillSelects", "initialValues", "loading", "showButtons", "iconMode", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
15024
15655
|
}
|
|
15025
15656
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RuleDefinirionComponent, decorators: [{
|
|
15026
15657
|
type: Component,
|
|
@@ -15030,7 +15661,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
15030
15661
|
UicInputComponent,
|
|
15031
15662
|
UicButtonComponent,
|
|
15032
15663
|
UicTranslatePipe
|
|
15033
|
-
], template: "\
|
|
15664
|
+
], template: "\n@if (newRule) {\n <ui-form-wrapper #formWrapper \n (formChange)=\"updateFormNewRule($event)\"\n (formSubmit)=\"createAndSelectRule($event)\" \n [initialValues]=\"initialValues\"\n [fields]=\"fields\" \n [cols]=\"2\"></ui-form-wrapper>\n <div class=\"condition-btns\">\n <ui-button icon=\"ri-arrow-left-line\" (click)=\"newRule = false\" color=\"black\" type=\"bordered\">{{ 'rule_builder.definition.cancel_and_back' | uicTranslate }}</ui-button>\n <ui-button (click)=\"formWrapper.submit()\" icon=\"ri-check-line\" color=\"black\">{{ 'rule_builder.definition.create_and_select' | uicTranslate }}</ui-button>\n </div>\n} @else {\n <div class=\"condition-searcher\">\n <ui-input>\n <input [(ngModel)]=\"searchTerm\" (ngModelChange)=\"onSearchTermChange()\" [placeholder]=\"'rule_builder.definition.search_placeholder' | uicTranslate\" type=\"text\">\n </ui-input>\n <ui-button (click)=\"newRule = true\" color=\"black\">{{ 'rule_builder.definition.new_rule' | uicTranslate }}</ui-button>\n </div>\n\n @if (paginatedConditions.length > 0) {\n @for (condition of paginatedConditions; track $index) {\n <div class=\"condition\" [class.condition-selected]=\"isSelected(condition)\">\n <i class=\"ri-align-item-horizontal-center-line\"></i>\n <div style=\"flex: 1 1;\">\n <div class=\"condition-title\"><span [innerHTML]=\"highlightSearch(condition.description)\"></span></div>\n @if (customNamesEnabled) {\n <div class=\"condition-body\">\n <span class=\"condition-field\" [innerHTML]=\"highlightSearch(condition.fieldName)\"></span>\n <span class=\"condition-operator\" [innerHTML]=\"highlightSearch(condition.operatorName)\"></span>\n <span class=\"condition-value\" [innerHTML]=\"highlightSearch(condition.value)\"></span>\n </div>\n }\n </div>\n @if (!isSelected(condition)) {\n <ui-button (click)=\"select(condition)\" color=\"primary\" size=\"s\" type=\"bordered\">{{ 'common.select' | uicTranslate }}</ui-button>\n }\n </div>\n }\n } @else {\n <div class=\"condition\">\n <div class=\"condition-emptytext\">\n {{ 'rule_builder.definition.no_results' | uicTranslate }}\n </div>\n </div>\n }\n\n <div class=\"condition-pagination\">\n <ui-button [disabled]=\"!canGoToPreviousPage\" (click)=\"goToPreviousPage()\" color=\"black\" size=\"s\" type=\"bordered\">{{ 'rule_builder.definition.previous' | uicTranslate }}</ui-button>\n <div><b>{{ currentPage }}</b> / {{ totalPages }}</div>\n <ui-button [disabled]=\"!canGoToNextPage\" (click)=\"goToNextPage()\" color=\"black\" size=\"s\" type=\"bordered\">{{ 'rule_builder.definition.next' | uicTranslate }}</ui-button>\n </div>\n}\n", styles: [".condition{border:solid 1px var(--uic-neutral-300, var(--grey-300));border-radius:10px;background-color:var(--uic-neutral-50, var(--grey-50));padding:6px;margin-bottom:4px;display:flex;align-items:center;gap:10px}.condition-emptytext{font-size:12px;text-align:center;color:var(--uic-neutral-400, var(--grey-400));padding:10px;width:100%}.condition i{color:var(--blue-600)}.condition-selected{border-color:var(--blue-500);background:linear-gradient(135deg,var(--blue-50) 0%,#eef6ff 100%);box-shadow:inset 0 0 0 1px #2563eb1f}.condition-selected .condition-title{color:var(--blue-800)}.condition-selected .condition-body,.condition-selected i{color:var(--blue-700)}.condition-title{font-size:14px;font-weight:500;line-height:16px}.condition-body{color:var(--uic-neutral-500, var(--grey-500));display:flex;gap:5px;font-size:12px}.condition-searcher{display:flex;gap:25px;margin-bottom:10px}.condition-pagination{margin-top:15px;display:flex;font-size:14px;align-items:center;justify-content:space-between}.condition-btns{padding-top:10px;border-top:solid 1px var(--uic-neutral-200, var(--grey-200));display:flex;justify-content:space-between}\n"] }]
|
|
15034
15665
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
15035
15666
|
type: Inject,
|
|
15036
15667
|
args: [MODAL_DATA]
|
|
@@ -15638,5 +16269,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
15638
16269
|
* Generated bundle index. Do not edit.
|
|
15639
16270
|
*/
|
|
15640
16271
|
|
|
15641
|
-
export { BASE_FORM_FIELDS, BRANCH_FORM_FIELDS, COMPUTED_FORM_FIELDS, DROPDOWN_OVERLAY_CONTROLS, EXTERNAL_VALIDATION_FORM_FIELDS, EXTRA_FORM_FIELDS, FIELDS_CONFIG, FirstCapitalPipe, LAYOUT_FORM_FIELDS, MODAL_CLOSE_EVENT, MODAL_CLOSE_REQUEST, MODAL_COMPONENT, MODAL_CONFIG, MODAL_DATA, UIC_BASE_COLORS, UIC_COLORS, UIC_COLOR_SCHEME_ATTR, UIC_DISTRIBUTION_TOTAL, UIC_EXTRA_COLORS, UIC_FORM_BUILDER_CONFIG, UIC_OTHER_FIELD_SUFFIX, UIC_OTHER_OPTION_ID, UIC_OTHER_OPTION_TYPES, UIC_OTHER_TEXT_MAX_LENGTH, UIC_PALETTE_COLORS, UIC_THEME_SCOPE_ATTR, UIC_THEME_SCOPE_CLASS, UIC_THEME_TOKENS, UIC_TRANSLATE_CONFIG, UiDropdownCloseDirective, UiModalRef, UicAccordionComponent, UicActionButtonComponent, UicAlertContainerComponent, UicButtonComponent, UicCheckboxComponent, UicDatePickerComponent, UicDistributionComponent, UicDropdownContainerComponent, UicEditableTableComponent, UicExcelTableComponent, UicFileInputComponent, UicFormEngine, UicFormStateService, UicFormWrapperComponent, UicInputComponent, UicKpiCardComponent, UicModalService, UicMultySearcherComponent, UicMultySelectComponent, UicNameInitsPipe, UicOverlayCardComponent, UicPhoneInputComponent, UicPoolOptionsComponent, UicPortletCardComponent, UicProgressBarComponent, UicPushAlertService, UicRadioComponent, UicRepeaterComponent, UicRuleBuilderComponent, UicScaleComponent, UicSearcherComponent, UicSelectComponent, UicShortTableComponent, UicSignaturePadComponent, UicSkeletonCardsComponent, UicSkeletonLoaderComponent, UicSliderComponent, UicStepTabsComponent, UicStepsFormComponent, UicSurveyComponent, UicSurveyFooterDirective, UicSurveyHeaderDirective, UicSwichComponent, UicTableComponent, UicTabsButtonComponent, UicTagSelectorComponent, UicTextareaAutoresizeDirective, UicTextareaAutoresizeMaxRowsDirective, UicTextareaAutoresizeMinRowsDirective, UicTimePickerComponent, UicTinyAlertService, UicToolTipDirective, UicTranslatePipe, UicTranslateService, UicTreeAdminComponent, UicUserFormbuilderComponent, UicWizardComponent, UicWizardStepComponent, UicWorkPanelComponent, VISIBILITY_OPERATOR_OPTIONS, animatedRow, applyColorScheme, applyThemeScope, fadeAndRise, fadeBackdrop, findThemeScope, helperFormMapFormdataToObject, helperShowFormFromBuilder, helperTableMapDatoToColums, highlightRow, isLimitReached, isMobile, provideUicFormBuilderConfig, provideUicTranslateConfig, pushTop, resolveFormBuilderConfig, sideModal, simpleFade, uicBuildOtherField, uicColorOptions, uicColorSwatchOptions, uicContainsOtherOption, uicDistributionSum, uicDistributionTotalValidator, uicDistributionValidatorsFor, uicExpandOtherFields, uicHasOtherOption, uicOptionsWithOther, uicOtherFieldName, uicSelectionCountValidator, uicSelectionValidatorsFor, uicSupportsOtherOption };
|
|
16272
|
+
export { BASE_FORM_FIELDS, BRANCH_FORM_FIELDS, COMPUTED_FORM_FIELDS, DROPDOWN_OVERLAY_CONTROLS, EXTERNAL_VALIDATION_FORM_FIELDS, EXTRA_FORM_FIELDS, FIELDS_CONFIG, FirstCapitalPipe, LAYOUT_FORM_FIELDS, LIST_VISIBILITY_OPERATORS, MODAL_CLOSE_EVENT, MODAL_CLOSE_REQUEST, MODAL_COMPONENT, MODAL_CONFIG, MODAL_DATA, SURVEY_FORM_FIELDS, UIC_BASE_COLORS, UIC_COLORS, UIC_COLOR_SCHEME_ATTR, UIC_DISTRIBUTION_TOTAL, UIC_EXTRA_COLORS, UIC_FORM_BUILDER_CONFIG, UIC_OTHER_FIELD_SUFFIX, UIC_OTHER_OPTION_ID, UIC_OTHER_OPTION_TYPES, UIC_OTHER_TEXT_MAX_LENGTH, UIC_PALETTE_COLORS, UIC_SURVEY_CONFIG, UIC_THEME_SCOPE_ATTR, UIC_THEME_SCOPE_CLASS, UIC_THEME_TOKENS, UIC_TRANSLATE_CONFIG, UiDropdownCloseDirective, UiModalRef, UicAccordionComponent, UicActionButtonComponent, UicAlertContainerComponent, UicButtonComponent, UicCheckboxComponent, UicChipsInputComponent, UicDatePickerComponent, UicDistributionComponent, UicDropdownContainerComponent, UicEditableTableComponent, UicExcelTableComponent, UicFileInputComponent, UicFormEngine, UicFormStateService, UicFormWrapperComponent, UicInputComponent, UicKpiCardComponent, UicModalService, UicMultySearcherComponent, UicMultySelectComponent, UicNameInitsPipe, UicOverlayCardComponent, UicPhoneInputComponent, UicPoolOptionsComponent, UicPortletCardComponent, UicProgressBarComponent, UicPushAlertService, UicRadioComponent, UicRepeaterComponent, UicRuleBuilderComponent, UicScaleComponent, UicSearcherComponent, UicSelectComponent, UicShortTableComponent, UicSignaturePadComponent, UicSkeletonCardsComponent, UicSkeletonLoaderComponent, UicSliderComponent, UicStepTabsComponent, UicStepsFormComponent, UicSurveyComponent, UicSurveyFooterDirective, UicSurveyHeaderDirective, UicSwichComponent, UicTableComponent, UicTabsButtonComponent, UicTagSelectorComponent, UicTextareaAutoresizeDirective, UicTextareaAutoresizeMaxRowsDirective, UicTextareaAutoresizeMinRowsDirective, UicTimePickerComponent, UicTinyAlertService, UicToolTipDirective, UicTranslatePipe, UicTranslateService, UicTreeAdminComponent, UicUserFormbuilderComponent, UicWizardComponent, UicWizardStepComponent, UicWorkPanelComponent, VISIBILITY_OPERATOR_OPTIONS, animatedRow, applyColorScheme, applyThemeScope, fadeAndRise, fadeBackdrop, findThemeScope, helperFormMapFormdataToObject, helperShowFormFromBuilder, helperTableMapDatoToColums, highlightRow, isLimitReached, isMobile, provideUicFormBuilderConfig, provideUicSurveyConfig, provideUicTranslateConfig, pushTop, resolveFormBuilderConfig, resolveSurveyConfig, sideModal, simpleFade, uicBuildOtherField, uicColorOptions, uicColorSwatchOptions, uicContainsOtherOption, uicDistributionSum, uicDistributionTotalValidator, uicDistributionValidatorsFor, uicExpandOtherFields, uicHasOtherOption, uicOptionsWithOther, uicOtherFieldName, uicSelectionCountValidator, uicSelectionValidatorsFor, uicSupportsOtherOption };
|
|
15642
16273
|
//# sourceMappingURL=ui-core-abv.mjs.map
|