ui-core-abv 0.11.3 → 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 +1155 -177
- package/fesm2022/ui-core-abv.mjs.map +1 -1
- package/lib/components/dynamic-form/form/dynamic-form.component.d.ts +14 -0
- package/lib/components/dynamic-form/form-engine.service.d.ts +6 -0
- package/lib/components/dynamic-form/form-validators.d.ts +12 -0
- package/lib/components/dynamic-form/form.models.d.ts +32 -2
- package/lib/components/dynamic-form/other-option.d.ts +34 -0
- 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 +62 -0
- package/lib/components/survey/survey.component.d.ts +59 -7
- 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 +13 -2
- 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 +32 -0
- package/lib/translate/dictionary.es.d.ts +32 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -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 = '';
|
|
@@ -465,6 +465,13 @@ const DICTIONARY_EN = {
|
|
|
465
465
|
visibility_summary: 'Visible if {{field}} {{operator}} {{value}}',
|
|
466
466
|
yes: 'Yes',
|
|
467
467
|
no: 'No',
|
|
468
|
+
other_option: {
|
|
469
|
+
enable: 'Include an "Other" (please specify) option',
|
|
470
|
+
enable_tip: 'Adds an Other option with a text to specify. The text is saved as <identifier>__other.',
|
|
471
|
+
label: 'Option text',
|
|
472
|
+
placeholder: 'Field placeholder',
|
|
473
|
+
required: 'Specifying is required when Other is chosen',
|
|
474
|
+
},
|
|
468
475
|
limits: {
|
|
469
476
|
fields_reached: 'The form already has the maximum of {{max}} fields',
|
|
470
477
|
blocks_reached: 'The maximum of {{max}} blocks has been reached',
|
|
@@ -502,6 +509,8 @@ const DICTIONARY_EN = {
|
|
|
502
509
|
new_line: 'New line',
|
|
503
510
|
col_span: 'Column span',
|
|
504
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',
|
|
505
514
|
},
|
|
506
515
|
extra: {
|
|
507
516
|
iconColor: 'Icon color',
|
|
@@ -663,6 +672,7 @@ const DICTIONARY_EN = {
|
|
|
663
672
|
operator: 'Operator',
|
|
664
673
|
value: 'Value',
|
|
665
674
|
expected_value: 'Expected value',
|
|
675
|
+
values: 'Values',
|
|
666
676
|
style: 'Style',
|
|
667
677
|
advanced: 'Advanced',
|
|
668
678
|
duplicate: 'Duplicate',
|
|
@@ -672,6 +682,7 @@ const DICTIONARY_EN = {
|
|
|
672
682
|
subfields: 'Sub-fields',
|
|
673
683
|
external_validation_title: 'External validation',
|
|
674
684
|
},
|
|
685
|
+
rules_pruned: '{{count}} dependency rules were updated because they used removed options.',
|
|
675
686
|
visibility_operators: {
|
|
676
687
|
equals: 'Equals',
|
|
677
688
|
notEquals: 'Does not equal',
|
|
@@ -681,6 +692,8 @@ const DICTIONARY_EN = {
|
|
|
681
692
|
notIncludes: 'Does not include',
|
|
682
693
|
isEmpty: 'Is empty',
|
|
683
694
|
isNotEmpty: 'Is not empty',
|
|
695
|
+
in: 'Is any of',
|
|
696
|
+
notIn: 'Is none of',
|
|
684
697
|
},
|
|
685
698
|
validation: {
|
|
686
699
|
duplicate_identifier: 'The identifier "{{identifier}}" is used more than once.',
|
|
@@ -706,6 +719,24 @@ const DICTIONARY_EN = {
|
|
|
706
719
|
subtitle_margin: 'Subtitle margin',
|
|
707
720
|
}
|
|
708
721
|
},
|
|
722
|
+
other_option: {
|
|
723
|
+
label: 'Other',
|
|
724
|
+
placeholder: 'Please specify...',
|
|
725
|
+
},
|
|
726
|
+
chips_input: {
|
|
727
|
+
placeholder: 'Type and press Enter',
|
|
728
|
+
remove: 'Remove {{item}}',
|
|
729
|
+
max_reached: 'Maximum {{max}}',
|
|
730
|
+
},
|
|
731
|
+
distribution: {
|
|
732
|
+
total: 'Total',
|
|
733
|
+
complete: 'Complete',
|
|
734
|
+
missing: '{{amount}}% left',
|
|
735
|
+
over: '{{amount}}% over',
|
|
736
|
+
clear: 'Clear',
|
|
737
|
+
fill_remaining: 'Assign the remaining {{remaining}}% to {{option}}',
|
|
738
|
+
no_options: 'This question has no options yet.',
|
|
739
|
+
},
|
|
709
740
|
validation: {
|
|
710
741
|
invalid: '{{field}} is invalid.',
|
|
711
742
|
required: '{{field}} is required.',
|
|
@@ -717,6 +748,7 @@ const DICTIONARY_EN = {
|
|
|
717
748
|
external_invalid: '{{field}} is not valid.',
|
|
718
749
|
min_selections: '{{field}}: choose at least {{min}} options.',
|
|
719
750
|
max_selections: '{{field}}: choose at most {{max}} options.',
|
|
751
|
+
distribution_total: '{{field}} must add up to {{expected}}% (currently {{total}}%).',
|
|
720
752
|
},
|
|
721
753
|
clipboard: {
|
|
722
754
|
copy_error: 'Could not copy:',
|
|
@@ -960,6 +992,13 @@ const DICTIONARY_ES = {
|
|
|
960
992
|
visibility_summary: 'Visible si {{field}} {{operator}} {{value}}',
|
|
961
993
|
yes: 'Sí',
|
|
962
994
|
no: 'No',
|
|
995
|
+
other_option: {
|
|
996
|
+
enable: 'Incluir opción «Otros» (especifica)',
|
|
997
|
+
enable_tip: 'Agrega la opción Otros con un texto para especificar. El texto se guarda en <identificador>__other.',
|
|
998
|
+
label: 'Texto de la opción',
|
|
999
|
+
placeholder: 'Texto de ayuda del campo',
|
|
1000
|
+
required: 'Especificar es obligatorio al elegir Otros',
|
|
1001
|
+
},
|
|
963
1002
|
limits: {
|
|
964
1003
|
fields_reached: 'Se alcanzó el máximo de {{max}} campos del formulario',
|
|
965
1004
|
blocks_reached: 'Se alcanzó el máximo de {{max}} bloques',
|
|
@@ -997,6 +1036,8 @@ const DICTIONARY_ES = {
|
|
|
997
1036
|
new_line: 'Saltar línea',
|
|
998
1037
|
col_span: 'Ancho',
|
|
999
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',
|
|
1000
1041
|
},
|
|
1001
1042
|
extra: {
|
|
1002
1043
|
iconColor: 'Color de ícono externo',
|
|
@@ -1158,6 +1199,7 @@ const DICTIONARY_ES = {
|
|
|
1158
1199
|
operator: 'Operador',
|
|
1159
1200
|
value: 'Valor',
|
|
1160
1201
|
expected_value: 'Valor esperado',
|
|
1202
|
+
values: 'Valores',
|
|
1161
1203
|
style: 'Estilo',
|
|
1162
1204
|
advanced: 'Avanzado',
|
|
1163
1205
|
duplicate: 'Duplicar',
|
|
@@ -1167,6 +1209,7 @@ const DICTIONARY_ES = {
|
|
|
1167
1209
|
subfields: 'Sub-campos',
|
|
1168
1210
|
external_validation_title: 'Validación externa',
|
|
1169
1211
|
},
|
|
1212
|
+
rules_pruned: 'Se actualizaron {{count}} reglas de dependencia porque usaban opciones eliminadas.',
|
|
1170
1213
|
visibility_operators: {
|
|
1171
1214
|
equals: 'Es igual a',
|
|
1172
1215
|
notEquals: 'No es igual a',
|
|
@@ -1176,6 +1219,8 @@ const DICTIONARY_ES = {
|
|
|
1176
1219
|
notIncludes: 'No incluye',
|
|
1177
1220
|
isEmpty: 'Está vacío',
|
|
1178
1221
|
isNotEmpty: 'No está vacío',
|
|
1222
|
+
in: 'Es alguno de',
|
|
1223
|
+
notIn: 'No es ninguno de',
|
|
1179
1224
|
},
|
|
1180
1225
|
validation: {
|
|
1181
1226
|
duplicate_identifier: 'El identificador "{{identifier}}" se está usando más de una vez.',
|
|
@@ -1201,6 +1246,24 @@ const DICTIONARY_ES = {
|
|
|
1201
1246
|
subtitle_margin: 'Margen subtítulo',
|
|
1202
1247
|
}
|
|
1203
1248
|
},
|
|
1249
|
+
other_option: {
|
|
1250
|
+
label: 'Otros',
|
|
1251
|
+
placeholder: 'Especifica...',
|
|
1252
|
+
},
|
|
1253
|
+
chips_input: {
|
|
1254
|
+
placeholder: 'Escribe y presiona Enter',
|
|
1255
|
+
remove: 'Quitar {{item}}',
|
|
1256
|
+
max_reached: 'Máximo {{max}}',
|
|
1257
|
+
},
|
|
1258
|
+
distribution: {
|
|
1259
|
+
total: 'Total',
|
|
1260
|
+
complete: 'Completo',
|
|
1261
|
+
missing: 'Faltan {{amount}}%',
|
|
1262
|
+
over: 'Sobran {{amount}}%',
|
|
1263
|
+
clear: 'Limpiar',
|
|
1264
|
+
fill_remaining: 'Asignar el {{remaining}}% restante a {{option}}',
|
|
1265
|
+
no_options: 'Esta pregunta aún no tiene opciones.',
|
|
1266
|
+
},
|
|
1204
1267
|
validation: {
|
|
1205
1268
|
invalid: '{{field}} es invalido.',
|
|
1206
1269
|
required: '{{field}} es obligatorio.',
|
|
@@ -1212,6 +1275,7 @@ const DICTIONARY_ES = {
|
|
|
1212
1275
|
external_invalid: '{{field}} no es válido.',
|
|
1213
1276
|
min_selections: '{{field}}: elige al menos {{min}} opciones.',
|
|
1214
1277
|
max_selections: '{{field}}: elige como máximo {{max}} opciones.',
|
|
1278
|
+
distribution_total: '{{field}} debe sumar {{expected}}% (ahora suma {{total}}%).',
|
|
1215
1279
|
},
|
|
1216
1280
|
clipboard: {
|
|
1217
1281
|
copy_error: 'No se pudo copiar:',
|
|
@@ -1525,8 +1589,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1525
1589
|
args: [{ providedIn: 'root' }]
|
|
1526
1590
|
}] });
|
|
1527
1591
|
|
|
1528
|
-
const base$
|
|
1529
|
-
class UicDatePickerComponent extends base$
|
|
1592
|
+
const base$f = createValueAccessor();
|
|
1593
|
+
class UicDatePickerComponent extends base$f {
|
|
1530
1594
|
icon = ''; // Icono externo
|
|
1531
1595
|
iconColor = 'black';
|
|
1532
1596
|
internalIcon = ''; //Icono interno
|
|
@@ -2000,10 +2064,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2000
2064
|
args: ['calendarTemplate']
|
|
2001
2065
|
}] } });
|
|
2002
2066
|
|
|
2003
|
-
let nextId$
|
|
2067
|
+
let nextId$2 = 1;
|
|
2004
2068
|
function createSuccessAlert(message, options) {
|
|
2005
2069
|
return {
|
|
2006
|
-
id: nextId$
|
|
2070
|
+
id: nextId$2++,
|
|
2007
2071
|
message,
|
|
2008
2072
|
icon: 'ri-check-line',
|
|
2009
2073
|
showProgressBar: true,
|
|
@@ -2014,7 +2078,7 @@ function createSuccessAlert(message, options) {
|
|
|
2014
2078
|
}
|
|
2015
2079
|
function createErrorAlert(message, options) {
|
|
2016
2080
|
return {
|
|
2017
|
-
id: nextId$
|
|
2081
|
+
id: nextId$2++,
|
|
2018
2082
|
message,
|
|
2019
2083
|
showProgressBar: true,
|
|
2020
2084
|
type: 'error',
|
|
@@ -2025,7 +2089,7 @@ function createErrorAlert(message, options) {
|
|
|
2025
2089
|
}
|
|
2026
2090
|
function createWarningAlert(message, options) {
|
|
2027
2091
|
return {
|
|
2028
|
-
id: nextId$
|
|
2092
|
+
id: nextId$2++,
|
|
2029
2093
|
message,
|
|
2030
2094
|
showProgressBar: true,
|
|
2031
2095
|
type: 'warning',
|
|
@@ -2036,7 +2100,7 @@ function createWarningAlert(message, options) {
|
|
|
2036
2100
|
}
|
|
2037
2101
|
function createInfoAlert(message, options) {
|
|
2038
2102
|
return {
|
|
2039
|
-
id: nextId$
|
|
2103
|
+
id: nextId$2++,
|
|
2040
2104
|
showProgressBar: true,
|
|
2041
2105
|
message,
|
|
2042
2106
|
icon: 'ri-information-2-line',
|
|
@@ -2076,8 +2140,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2076
2140
|
}]
|
|
2077
2141
|
}] });
|
|
2078
2142
|
|
|
2079
|
-
const base$
|
|
2080
|
-
class UicFileInputComponent extends base$
|
|
2143
|
+
const base$e = createValueAccessor();
|
|
2144
|
+
class UicFileInputComponent extends base$e {
|
|
2081
2145
|
icon = ''; // Icono externo
|
|
2082
2146
|
iconColor = 'black';
|
|
2083
2147
|
internalIcon = ''; //Icono interno
|
|
@@ -2405,8 +2469,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2405
2469
|
type: Input
|
|
2406
2470
|
}] } });
|
|
2407
2471
|
|
|
2408
|
-
const base$
|
|
2409
|
-
class UicMultySelectComponent extends base$
|
|
2472
|
+
const base$d = createValueAccessor();
|
|
2473
|
+
class UicMultySelectComponent extends base$d {
|
|
2410
2474
|
icon = ''; // Icono externo
|
|
2411
2475
|
iconColor = 'black'; //color de ícono externo
|
|
2412
2476
|
internalIcon = ''; //Icono interno
|
|
@@ -2632,8 +2696,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2632
2696
|
args: [{ providedIn: 'root' }]
|
|
2633
2697
|
}] });
|
|
2634
2698
|
|
|
2635
|
-
const base$
|
|
2636
|
-
class UicMultySearcherComponent extends base$
|
|
2699
|
+
const base$c = createValueAccessor();
|
|
2700
|
+
class UicMultySearcherComponent extends base$c {
|
|
2637
2701
|
icon = ''; // Icono externo
|
|
2638
2702
|
iconColor = 'black'; //color de ícono externo
|
|
2639
2703
|
internalIcon = 'ri-search-2-line'; //Icono interno
|
|
@@ -2732,7 +2796,7 @@ class UicMultySearcherComponent extends base$a {
|
|
|
2732
2796
|
useExisting: forwardRef(() => UicMultySearcherComponent),
|
|
2733
2797
|
multi: true
|
|
2734
2798
|
}
|
|
2735
|
-
], 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" }] });
|
|
2736
2800
|
}
|
|
2737
2801
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicMultySearcherComponent, decorators: [{
|
|
2738
2802
|
type: Component,
|
|
@@ -2742,7 +2806,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2742
2806
|
useExisting: forwardRef(() => UicMultySearcherComponent),
|
|
2743
2807
|
multi: true
|
|
2744
2808
|
}
|
|
2745
|
-
], 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"] }]
|
|
2746
2810
|
}], propDecorators: { icon: [{
|
|
2747
2811
|
type: Input
|
|
2748
2812
|
}], iconColor: [{
|
|
@@ -2809,8 +2873,8 @@ const PHONE_COUNTRIES = [
|
|
|
2809
2873
|
{ name: 'Venezuela', iso2: 've', dialCode: '58' }
|
|
2810
2874
|
];
|
|
2811
2875
|
|
|
2812
|
-
const base$
|
|
2813
|
-
class UicPhoneInputComponent extends base$
|
|
2876
|
+
const base$b = createValueAccessor();
|
|
2877
|
+
class UicPhoneInputComponent extends base$b {
|
|
2814
2878
|
icon = '';
|
|
2815
2879
|
iconColor = 'black';
|
|
2816
2880
|
internalIcon = '';
|
|
@@ -3226,8 +3290,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3226
3290
|
args: ['pointerdown']
|
|
3227
3291
|
}] } });
|
|
3228
3292
|
|
|
3229
|
-
const base$
|
|
3230
|
-
class UicSearcherComponent extends base$
|
|
3293
|
+
const base$a = createValueAccessor();
|
|
3294
|
+
class UicSearcherComponent extends base$a {
|
|
3231
3295
|
icon = ''; // Icono externo
|
|
3232
3296
|
iconColor = 'black'; //color de ícono externo
|
|
3233
3297
|
internalIcon = 'ri-search-2-line'; //Icono interno
|
|
@@ -3378,8 +3442,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3378
3442
|
args: ['dropdownTemplate']
|
|
3379
3443
|
}] } });
|
|
3380
3444
|
|
|
3381
|
-
const base$
|
|
3382
|
-
class UicSelectComponent extends base$
|
|
3445
|
+
const base$9 = createValueAccessor();
|
|
3446
|
+
class UicSelectComponent extends base$9 {
|
|
3383
3447
|
icon = ''; // Icono externo
|
|
3384
3448
|
iconColor = 'black';
|
|
3385
3449
|
internalIcon = ''; //Icono interno
|
|
@@ -3701,8 +3765,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3701
3765
|
args: ['dropdownTemplate']
|
|
3702
3766
|
}] } });
|
|
3703
3767
|
|
|
3704
|
-
const base$
|
|
3705
|
-
class UicSliderComponent extends base$
|
|
3768
|
+
const base$8 = createValueAccessor();
|
|
3769
|
+
class UicSliderComponent extends base$8 {
|
|
3706
3770
|
icon = ''; // Icono externo
|
|
3707
3771
|
iconColor = 'black';
|
|
3708
3772
|
label = '';
|
|
@@ -3802,8 +3866,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3802
3866
|
args: ['document:mouseup']
|
|
3803
3867
|
}] } });
|
|
3804
3868
|
|
|
3805
|
-
const base$
|
|
3806
|
-
class UicRadioComponent extends base$
|
|
3869
|
+
const base$7 = createValueAccessor();
|
|
3870
|
+
class UicRadioComponent extends base$7 {
|
|
3807
3871
|
icon = '';
|
|
3808
3872
|
iconColor = 'black';
|
|
3809
3873
|
label = '';
|
|
@@ -3871,7 +3935,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3871
3935
|
type: Input
|
|
3872
3936
|
}] } });
|
|
3873
3937
|
|
|
3874
|
-
const base$
|
|
3938
|
+
const base$6 = createValueAccessor();
|
|
3875
3939
|
/** Máximo de puntos de una escala, para que siga siendo usable. */
|
|
3876
3940
|
const MAX_POINTS = 21;
|
|
3877
3941
|
/**
|
|
@@ -3879,7 +3943,7 @@ const MAX_POINTS = 21;
|
|
|
3879
3943
|
* Valor: el número elegido, o null. Se maneja con teclado como un grupo de radios
|
|
3880
3944
|
* (flechas, Inicio, Fin) y anuncia cada punto con su leyenda.
|
|
3881
3945
|
*/
|
|
3882
|
-
class UicScaleComponent extends base$
|
|
3946
|
+
class UicScaleComponent extends base$6 {
|
|
3883
3947
|
host = inject(ElementRef);
|
|
3884
3948
|
icon = '';
|
|
3885
3949
|
iconColor = 'black';
|
|
@@ -3975,7 +4039,7 @@ class UicScaleComponent extends base$4 {
|
|
|
3975
4039
|
useExisting: forwardRef(() => UicScaleComponent),
|
|
3976
4040
|
multi: true
|
|
3977
4041
|
}
|
|
3978
|
-
], 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" }] });
|
|
3979
4043
|
}
|
|
3980
4044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicScaleComponent, decorators: [{
|
|
3981
4045
|
type: Component,
|
|
@@ -3985,7 +4049,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3985
4049
|
useExisting: forwardRef(() => UicScaleComponent),
|
|
3986
4050
|
multi: true
|
|
3987
4051
|
}
|
|
3988
|
-
], 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"] }]
|
|
3989
4053
|
}], propDecorators: { icon: [{
|
|
3990
4054
|
type: Input
|
|
3991
4055
|
}], iconColor: [{
|
|
@@ -4010,6 +4074,379 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4010
4074
|
type: Input
|
|
4011
4075
|
}] } });
|
|
4012
4076
|
|
|
4077
|
+
/** Tipos cuyo valor es una lista de opciones elegidas. */
|
|
4078
|
+
const MULTI_SELECTION_TYPES = new Set(['multyselect', 'pool', 'chips']);
|
|
4079
|
+
/**
|
|
4080
|
+
* Valida la cantidad de opciones elegidas (multyselect y pool múltiple).
|
|
4081
|
+
* Un valor vacío no falla por mínimo: para exigir al menos una respuesta se usa `required`.
|
|
4082
|
+
* Errores: { minSelections: { min, actual } } y { maxSelections: { max, actual } }.
|
|
4083
|
+
*/
|
|
4084
|
+
function uicSelectionCountValidator(min, max) {
|
|
4085
|
+
return (control) => {
|
|
4086
|
+
const value = control.value;
|
|
4087
|
+
const actual = Array.isArray(value) ? value.length : 0;
|
|
4088
|
+
if (actual === 0)
|
|
4089
|
+
return null;
|
|
4090
|
+
if (typeof min === 'number' && min > 0 && actual < min) {
|
|
4091
|
+
return { minSelections: { min, actual } };
|
|
4092
|
+
}
|
|
4093
|
+
if (typeof max === 'number' && max > 0 && actual > max) {
|
|
4094
|
+
return { maxSelections: { max, actual } };
|
|
4095
|
+
}
|
|
4096
|
+
return null;
|
|
4097
|
+
};
|
|
4098
|
+
}
|
|
4099
|
+
/** Validadores de selección que corresponden al campo (vacío si no aplica). */
|
|
4100
|
+
function uicSelectionValidatorsFor(field) {
|
|
4101
|
+
if (!MULTI_SELECTION_TYPES.has(field.type))
|
|
4102
|
+
return [];
|
|
4103
|
+
if (field.type === 'pool' && !field.multyEnabled)
|
|
4104
|
+
return [];
|
|
4105
|
+
const hasMin = typeof field.minSelections === 'number' && field.minSelections > 0;
|
|
4106
|
+
const hasMax = typeof field.maxSelections === 'number' && field.maxSelections > 0;
|
|
4107
|
+
return hasMin || hasMax ? [uicSelectionCountValidator(field.minSelections, field.maxSelections)] : [];
|
|
4108
|
+
}
|
|
4109
|
+
/** Total que debe sumar una pregunta de distribución porcentual. */
|
|
4110
|
+
const UIC_DISTRIBUTION_TOTAL = 100;
|
|
4111
|
+
/** Suma de los porcentajes de un valor de distribución (ignora ítems inválidos). */
|
|
4112
|
+
function uicDistributionSum(value) {
|
|
4113
|
+
if (!Array.isArray(value))
|
|
4114
|
+
return 0;
|
|
4115
|
+
return value.reduce((sum, item) => {
|
|
4116
|
+
const amount = Number(item?.value);
|
|
4117
|
+
return Number.isFinite(amount) ? sum + amount : sum;
|
|
4118
|
+
}, 0);
|
|
4119
|
+
}
|
|
4120
|
+
/**
|
|
4121
|
+
* Distribución porcentual: si hay respuesta, debe sumar exactamente 100.
|
|
4122
|
+
* Un valor vacío (null o todo en 0) no falla: para exigir respuesta se usa `required`.
|
|
4123
|
+
* Error: { distributionTotal: { total, expected } }.
|
|
4124
|
+
*/
|
|
4125
|
+
function uicDistributionTotalValidator(expected = UIC_DISTRIBUTION_TOTAL) {
|
|
4126
|
+
return (control) => {
|
|
4127
|
+
const total = uicDistributionSum(control.value);
|
|
4128
|
+
if (total === 0 || total === expected)
|
|
4129
|
+
return null;
|
|
4130
|
+
return { distributionTotal: { total, expected } };
|
|
4131
|
+
};
|
|
4132
|
+
}
|
|
4133
|
+
/** Validadores de distribución que corresponden al campo (vacío si no aplica). */
|
|
4134
|
+
function uicDistributionValidatorsFor(field) {
|
|
4135
|
+
return field.type === 'distribution' ? [uicDistributionTotalValidator()] : [];
|
|
4136
|
+
}
|
|
4137
|
+
|
|
4138
|
+
const base$5 = createValueAccessor();
|
|
4139
|
+
let nextId$1 = 0;
|
|
4140
|
+
/**
|
|
4141
|
+
* Distribución porcentual: el usuario reparte el 100% entre las opciones.
|
|
4142
|
+
* Valor: [{ id, value }] con un ítem por opción (en su orden), o null si no asignó nada.
|
|
4143
|
+
* Los porcentajes son enteros entre 0 y 100; la validación de que sumen 100 está en el formulario
|
|
4144
|
+
* (uicDistributionTotalValidator), este componente solo muestra el total y cuánto falta o sobra.
|
|
4145
|
+
*/
|
|
4146
|
+
class UicDistributionComponent extends base$5 {
|
|
4147
|
+
host = inject(ElementRef);
|
|
4148
|
+
uid = `uic-distribution-${nextId$1++}`;
|
|
4149
|
+
expected = UIC_DISTRIBUTION_TOTAL;
|
|
4150
|
+
icon = '';
|
|
4151
|
+
iconColor = 'black';
|
|
4152
|
+
label = '';
|
|
4153
|
+
error = '';
|
|
4154
|
+
tip = '';
|
|
4155
|
+
disabled = false;
|
|
4156
|
+
options = [];
|
|
4157
|
+
/** Opciones con id utilizable (una opción sin id no se puede guardar en el valor). */
|
|
4158
|
+
get validOptions() {
|
|
4159
|
+
return (this.options ?? []).filter((opt) => opt?.id !== null && opt?.id !== undefined && opt.id !== '');
|
|
4160
|
+
}
|
|
4161
|
+
get total() {
|
|
4162
|
+
return uicDistributionSum(this.value);
|
|
4163
|
+
}
|
|
4164
|
+
/** Lo que falta para llegar a 100 (negativo si se pasó). */
|
|
4165
|
+
get remaining() {
|
|
4166
|
+
return this.expected - this.total;
|
|
4167
|
+
}
|
|
4168
|
+
amountOf(option) {
|
|
4169
|
+
const item = this.value?.find(entry => String(entry.id) === String(option.id));
|
|
4170
|
+
const amount = Number(item?.value);
|
|
4171
|
+
return Number.isFinite(amount) ? amount : 0;
|
|
4172
|
+
}
|
|
4173
|
+
onInput(option, event) {
|
|
4174
|
+
const input = event.target;
|
|
4175
|
+
const parsed = Math.round(Number(input.value));
|
|
4176
|
+
const amount = Number.isFinite(parsed) ? Math.min(Math.max(parsed, 0), this.expected) : 0;
|
|
4177
|
+
// Si se corrigió (fuera de rango o decimal), se refleja en el input.
|
|
4178
|
+
if (input.value !== '' && String(amount) !== input.value)
|
|
4179
|
+
input.value = String(amount);
|
|
4180
|
+
this.setAmount(option, amount);
|
|
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
|
+
}
|
|
4202
|
+
/** Asigna a esta opción todo lo que falta para llegar a 100. */
|
|
4203
|
+
fillRemaining(option) {
|
|
4204
|
+
if (this.disabled || this.remaining <= 0)
|
|
4205
|
+
return;
|
|
4206
|
+
this.setAmount(option, this.amountOf(option) + this.remaining);
|
|
4207
|
+
}
|
|
4208
|
+
clear() {
|
|
4209
|
+
if (this.disabled || this.value === null)
|
|
4210
|
+
return;
|
|
4211
|
+
this.notifyChange(null);
|
|
4212
|
+
}
|
|
4213
|
+
/** Foco dentro del grupo: mientras se reparte, el total ya indica cuánto falta y no se muestra el error. */
|
|
4214
|
+
hasFocus = false;
|
|
4215
|
+
get displayedError() {
|
|
4216
|
+
return this.hasFocus ? '' : this.error;
|
|
4217
|
+
}
|
|
4218
|
+
onFocusIn() {
|
|
4219
|
+
this.hasFocus = true;
|
|
4220
|
+
}
|
|
4221
|
+
onFocusOut(event) {
|
|
4222
|
+
const next = event.relatedTarget;
|
|
4223
|
+
if (!next || !this.host.nativeElement.contains(next)) {
|
|
4224
|
+
this.hasFocus = false;
|
|
4225
|
+
this.onTouched();
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
inputId(index) {
|
|
4229
|
+
return `${this.uid}-${index}`;
|
|
4230
|
+
}
|
|
4231
|
+
setAmount(option, amount) {
|
|
4232
|
+
if (this.disabled)
|
|
4233
|
+
return;
|
|
4234
|
+
const next = this.validOptions.map(opt => ({
|
|
4235
|
+
id: opt.id,
|
|
4236
|
+
value: String(opt.id) === String(option.id) ? amount : this.amountOf(opt)
|
|
4237
|
+
}));
|
|
4238
|
+
// Sin nada asignado equivale a sin respuesta (así `required` funciona como en el resto de tipos).
|
|
4239
|
+
this.notifyChange(next.some(item => item.value > 0) ? next : null);
|
|
4240
|
+
}
|
|
4241
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDistributionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4242
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicDistributionComponent, isStandalone: true, selector: "ui-distribution", inputs: { icon: "icon", iconColor: "iconColor", label: "label", error: "error", tip: "tip", disabled: "disabled", options: "options" }, providers: [
|
|
4243
|
+
{
|
|
4244
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4245
|
+
useExisting: forwardRef(() => UicDistributionComponent),
|
|
4246
|
+
multi: true
|
|
4247
|
+
}
|
|
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" }] });
|
|
4249
|
+
}
|
|
4250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDistributionComponent, decorators: [{
|
|
4251
|
+
type: Component,
|
|
4252
|
+
args: [{ selector: 'ui-distribution', imports: [InputWrapperComponent, UicTranslatePipe], providers: [
|
|
4253
|
+
{
|
|
4254
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4255
|
+
useExisting: forwardRef(() => UicDistributionComponent),
|
|
4256
|
+
multi: true
|
|
4257
|
+
}
|
|
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"] }]
|
|
4259
|
+
}], propDecorators: { icon: [{
|
|
4260
|
+
type: Input
|
|
4261
|
+
}], iconColor: [{
|
|
4262
|
+
type: Input
|
|
4263
|
+
}], label: [{
|
|
4264
|
+
type: Input
|
|
4265
|
+
}], error: [{
|
|
4266
|
+
type: Input
|
|
4267
|
+
}], tip: [{
|
|
4268
|
+
type: Input
|
|
4269
|
+
}], disabled: [{
|
|
4270
|
+
type: Input
|
|
4271
|
+
}], options: [{
|
|
4272
|
+
type: Input
|
|
4273
|
+
}] } });
|
|
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
|
+
|
|
4013
4450
|
const base$3 = createValueAccessor();
|
|
4014
4451
|
class UicTimePickerComponent extends base$3 {
|
|
4015
4452
|
// Iconos y estado
|
|
@@ -4788,39 +5225,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4788
5225
|
type: Injectable
|
|
4789
5226
|
}], ctorParameters: () => [] });
|
|
4790
5227
|
|
|
4791
|
-
/** Tipos cuyo valor es una lista de opciones elegidas. */
|
|
4792
|
-
const MULTI_SELECTION_TYPES = new Set(['multyselect', 'pool']);
|
|
4793
|
-
/**
|
|
4794
|
-
* Valida la cantidad de opciones elegidas (multyselect y pool múltiple).
|
|
4795
|
-
* Un valor vacío no falla por mínimo: para exigir al menos una respuesta se usa `required`.
|
|
4796
|
-
* Errores: { minSelections: { min, actual } } y { maxSelections: { max, actual } }.
|
|
4797
|
-
*/
|
|
4798
|
-
function uicSelectionCountValidator(min, max) {
|
|
4799
|
-
return (control) => {
|
|
4800
|
-
const value = control.value;
|
|
4801
|
-
const actual = Array.isArray(value) ? value.length : 0;
|
|
4802
|
-
if (actual === 0)
|
|
4803
|
-
return null;
|
|
4804
|
-
if (typeof min === 'number' && min > 0 && actual < min) {
|
|
4805
|
-
return { minSelections: { min, actual } };
|
|
4806
|
-
}
|
|
4807
|
-
if (typeof max === 'number' && max > 0 && actual > max) {
|
|
4808
|
-
return { maxSelections: { max, actual } };
|
|
4809
|
-
}
|
|
4810
|
-
return null;
|
|
4811
|
-
};
|
|
4812
|
-
}
|
|
4813
|
-
/** Validadores de selección que corresponden al campo (vacío si no aplica). */
|
|
4814
|
-
function uicSelectionValidatorsFor(field) {
|
|
4815
|
-
if (!MULTI_SELECTION_TYPES.has(field.type))
|
|
4816
|
-
return [];
|
|
4817
|
-
if (field.type === 'pool' && !field.multyEnabled)
|
|
4818
|
-
return [];
|
|
4819
|
-
const hasMin = typeof field.minSelections === 'number' && field.minSelections > 0;
|
|
4820
|
-
const hasMax = typeof field.maxSelections === 'number' && field.maxSelections > 0;
|
|
4821
|
-
return hasMin || hasMax ? [uicSelectionCountValidator(field.minSelections, field.maxSelections)] : [];
|
|
4822
|
-
}
|
|
4823
|
-
|
|
4824
5228
|
class UicRepeaterComponent {
|
|
4825
5229
|
fb = inject(FormBuilder);
|
|
4826
5230
|
formState = inject(UicFormStateService, { optional: true });
|
|
@@ -4969,6 +5373,83 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4969
5373
|
type: Input
|
|
4970
5374
|
}] } });
|
|
4971
5375
|
|
|
5376
|
+
/**
|
|
5377
|
+
* Opción "Otros (especifica)".
|
|
5378
|
+
*
|
|
5379
|
+
* Una pregunta con `otherOption` suma la opción "Otros" (id UIC_OTHER_OPTION_ID) y un texto
|
|
5380
|
+
* acompañante que se guarda en `<name>__other`. El valor de la pregunta no cambia (sigue siendo
|
|
5381
|
+
* el id elegido, o la lista de ids), así que reglas, reportes y consumidores existentes no se afectan.
|
|
5382
|
+
*
|
|
5383
|
+
* El texto es un campo más del formulario, generado a partir del esquema: se muestra solo cuando
|
|
5384
|
+
* se elige "Otros" (regla de visibilidad automática), se limpia al dejar de elegirlo y se valida,
|
|
5385
|
+
* guarda y reanuda como cualquier otro campo.
|
|
5386
|
+
*/
|
|
5387
|
+
const UIC_OTHER_OPTION_ID = '__other__';
|
|
5388
|
+
const UIC_OTHER_FIELD_SUFFIX = '__other';
|
|
5389
|
+
/** Tipos que admiten "Otros": su valor es un id o una lista de ids. */
|
|
5390
|
+
const UIC_OTHER_OPTION_TYPES = ['radio', 'select', 'multyselect'];
|
|
5391
|
+
const UIC_OTHER_TEXT_MAX_LENGTH = 500;
|
|
5392
|
+
/** Nombre del campo que guarda el texto de "Otros" de una pregunta. */
|
|
5393
|
+
function uicOtherFieldName(name) {
|
|
5394
|
+
return `${name}${UIC_OTHER_FIELD_SUFFIX}`;
|
|
5395
|
+
}
|
|
5396
|
+
function uicSupportsOtherOption(field) {
|
|
5397
|
+
return UIC_OTHER_OPTION_TYPES.includes(field.type);
|
|
5398
|
+
}
|
|
5399
|
+
/** true si la pregunta muestra la opción "Otros". */
|
|
5400
|
+
function uicHasOtherOption(field) {
|
|
5401
|
+
return !!field.otherOption && uicSupportsOtherOption(field);
|
|
5402
|
+
}
|
|
5403
|
+
/** Opciones de la pregunta con "Otros" al final (si corresponde y no está ya). */
|
|
5404
|
+
function uicOptionsWithOther(options, field, label) {
|
|
5405
|
+
const base = options ?? [];
|
|
5406
|
+
if (!uicHasOtherOption(field) || base.some(option => option.id === UIC_OTHER_OPTION_ID))
|
|
5407
|
+
return base;
|
|
5408
|
+
return [...base, { id: UIC_OTHER_OPTION_ID, text: label }];
|
|
5409
|
+
}
|
|
5410
|
+
/** Campo de texto acompañante de una pregunta con "Otros". */
|
|
5411
|
+
function uicBuildOtherField(field, otherLabel, placeholder) {
|
|
5412
|
+
const config = field.otherOption ?? {};
|
|
5413
|
+
const showRule = {
|
|
5414
|
+
fieldName: field.name,
|
|
5415
|
+
operator: field.type === 'multyselect' ? 'includes' : 'equals',
|
|
5416
|
+
value: UIC_OTHER_OPTION_ID
|
|
5417
|
+
};
|
|
5418
|
+
return {
|
|
5419
|
+
name: uicOtherFieldName(field.name),
|
|
5420
|
+
type: 'text',
|
|
5421
|
+
// No se muestra como etiqueta (el input va pegado a la pregunta), pero nombra el campo en errores y reportes.
|
|
5422
|
+
label: `${field.label ?? field.name} (${config.label || otherLabel})`,
|
|
5423
|
+
placeholder: config.placeholder || placeholder,
|
|
5424
|
+
required: config.required ?? true,
|
|
5425
|
+
maxLength: UIC_OTHER_TEXT_MAX_LENGTH,
|
|
5426
|
+
colSpan: field.colSpan,
|
|
5427
|
+
// Hereda la visibilidad de la pregunta (si ella se oculta, el texto también) y suma "eligió Otros".
|
|
5428
|
+
visibilityRules: [...(field.visibilityRules ?? []), showRule],
|
|
5429
|
+
otherFor: field.name
|
|
5430
|
+
};
|
|
5431
|
+
}
|
|
5432
|
+
/** true si algún campo (o sub-campo de repetidor) usa "Otros". */
|
|
5433
|
+
function uicContainsOtherOption(fields) {
|
|
5434
|
+
return (fields ?? []).some(field => uicHasOtherOption(field) || uicContainsOtherOption(field.repeaterFields));
|
|
5435
|
+
}
|
|
5436
|
+
/**
|
|
5437
|
+
* Inserta, después de cada pregunta con "Otros", su campo de texto acompañante.
|
|
5438
|
+
* Si ningún campo usa "Otros" devuelve el mismo array (no copia el esquema).
|
|
5439
|
+
*/
|
|
5440
|
+
function uicExpandOtherFields(fields, otherLabel, placeholder) {
|
|
5441
|
+
if (!uicContainsOtherOption(fields))
|
|
5442
|
+
return fields;
|
|
5443
|
+
return fields.flatMap(field => {
|
|
5444
|
+
const withSubFields = field.repeaterFields?.length
|
|
5445
|
+
? { ...field, repeaterFields: uicExpandOtherFields(field.repeaterFields, otherLabel, placeholder) }
|
|
5446
|
+
: field;
|
|
5447
|
+
return uicHasOtherOption(field) && !field.hidden
|
|
5448
|
+
? [withSubFields, uicBuildOtherField(field, otherLabel, placeholder)]
|
|
5449
|
+
: [withSubFields];
|
|
5450
|
+
});
|
|
5451
|
+
}
|
|
5452
|
+
|
|
4972
5453
|
class UicDynamicFormComponent {
|
|
4973
5454
|
ngZone;
|
|
4974
5455
|
fieldsSignal = signal([]);
|
|
@@ -5049,6 +5530,29 @@ class UicDynamicFormComponent {
|
|
|
5049
5530
|
});
|
|
5050
5531
|
});
|
|
5051
5532
|
});
|
|
5533
|
+
// ---- Opción "Otros" (ver other-option.ts) ----
|
|
5534
|
+
otherTextMaxLength = UIC_OTHER_TEXT_MAX_LENGTH;
|
|
5535
|
+
otherOptionsCache = new WeakMap();
|
|
5536
|
+
/** Texto "especifica" visible de cada pregunta (por nombre de la pregunta). */
|
|
5537
|
+
visibleOtherStates = computed(() => new Map(this.visibleFieldStates()
|
|
5538
|
+
.filter(state => !!state.field.otherFor)
|
|
5539
|
+
.map(state => [state.field.otherFor, state])));
|
|
5540
|
+
/** Opciones de la pregunta, con "Otros" al final si la tiene. Cacheado para no recrear el array en cada ciclo. */
|
|
5541
|
+
optionsFor(field) {
|
|
5542
|
+
if (!uicHasOtherOption(field))
|
|
5543
|
+
return field.options || [];
|
|
5544
|
+
const label = this.i18n.translate(field.otherOption?.label || 'other_option.label');
|
|
5545
|
+
const cached = this.otherOptionsCache.get(field);
|
|
5546
|
+
if (cached && cached.source === field.options && cached.label === label)
|
|
5547
|
+
return cached.result;
|
|
5548
|
+
const result = uicOptionsWithOther(field.options, field, label);
|
|
5549
|
+
this.otherOptionsCache.set(field, { source: field.options, label, result });
|
|
5550
|
+
return result;
|
|
5551
|
+
}
|
|
5552
|
+
/** Estado del texto "especifica" de una pregunta, si está visible (eligió "Otros"). */
|
|
5553
|
+
otherStateFor(field) {
|
|
5554
|
+
return this.visibleOtherStates().get(field.name) ?? null;
|
|
5555
|
+
}
|
|
5052
5556
|
formSyncEffect = effect(() => {
|
|
5053
5557
|
const form = this.formSignal();
|
|
5054
5558
|
if (form && !this.isSubForm) {
|
|
@@ -5160,6 +5664,16 @@ class UicDynamicFormComponent {
|
|
|
5160
5664
|
}
|
|
5161
5665
|
}
|
|
5162
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
|
+
}
|
|
5163
5677
|
getClearValue(fieldType) {
|
|
5164
5678
|
if (fieldType === 'checkbox' || fieldType === 'switch') {
|
|
5165
5679
|
return false;
|
|
@@ -5196,6 +5710,10 @@ class UicDynamicFormComponent {
|
|
|
5196
5710
|
}
|
|
5197
5711
|
return currentValue != rule.value;
|
|
5198
5712
|
}
|
|
5713
|
+
case 'in':
|
|
5714
|
+
return this.isOneOfVisibilityValues(currentValue, rule.value);
|
|
5715
|
+
case 'notIn':
|
|
5716
|
+
return !this.isOneOfVisibilityValues(currentValue, rule.value);
|
|
5199
5717
|
case 'greaterThan':
|
|
5200
5718
|
return this.compareVisibilityValues(currentValue, rule.value, dependencyType) > 0;
|
|
5201
5719
|
case 'lessThan':
|
|
@@ -5347,6 +5865,7 @@ class UicDynamicFormComponent {
|
|
|
5347
5865
|
}),
|
|
5348
5866
|
pattern: (_err, field) => this.i18n.translate('validation.pattern', { field: field.label ?? field.name }),
|
|
5349
5867
|
minSelections: (err, field) => this.i18n.translate('validation.min_selections', { field: field.label ?? field.name, min: err.min }),
|
|
5868
|
+
distributionTotal: (err, field) => this.i18n.translate('validation.distribution_total', { field: field.label ?? field.name, total: err.total, expected: err.expected }),
|
|
5350
5869
|
maxSelections: (err, field) => this.i18n.translate('validation.max_selections', { field: field.label ?? field.name, max: err.max }),
|
|
5351
5870
|
minLengthArray: (_err, field) => this.i18n.translate('validation.required', { field: field.label ?? field.name }),
|
|
5352
5871
|
externalValidation: (err, field) => typeof err === 'string'
|
|
@@ -5638,7 +6157,7 @@ class UicDynamicFormComponent {
|
|
|
5638
6157
|
recognition.start();
|
|
5639
6158
|
}
|
|
5640
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 });
|
|
5641
|
-
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) {\r\n <div [style.grid-column]=\"getGridColumn(field)\" (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]=\"field.options || []\"\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]=\"field.options || []\"\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]=\"field.options || []\"\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 === '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 </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}\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: 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"] }] });
|
|
5642
6161
|
}
|
|
5643
6162
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDynamicFormComponent, decorators: [{
|
|
5644
6163
|
type: Component,
|
|
@@ -5652,6 +6171,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5652
6171
|
UicTimePickerComponent,
|
|
5653
6172
|
UicRadioComponent,
|
|
5654
6173
|
UicScaleComponent,
|
|
6174
|
+
UicDistributionComponent,
|
|
6175
|
+
UicChipsInputComponent,
|
|
5655
6176
|
UicSearcherComponent,
|
|
5656
6177
|
UicMultySelectComponent,
|
|
5657
6178
|
UicMultySearcherComponent,
|
|
@@ -5665,7 +6186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5665
6186
|
UicPhoneInputComponent,
|
|
5666
6187
|
FormsModule,
|
|
5667
6188
|
UicRepeaterComponent
|
|
5668
|
-
], 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) {\r\n <div [style.grid-column]=\"getGridColumn(field)\" (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]=\"field.options || []\"\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]=\"field.options || []\"\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]=\"field.options || []\"\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 === '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 </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}\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"] }]
|
|
5669
6190
|
}], ctorParameters: () => [{ type: i0.NgZone }], propDecorators: { fields: [{
|
|
5670
6191
|
type: Input
|
|
5671
6192
|
}], contextFields: [{
|
|
@@ -5707,6 +6228,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5707
6228
|
class UicFormEngine {
|
|
5708
6229
|
fb = inject(FormBuilder);
|
|
5709
6230
|
formState = inject(UicFormStateService);
|
|
6231
|
+
i18n = inject(UicTranslateService);
|
|
5710
6232
|
// CONFIGURACIÓN
|
|
5711
6233
|
schema;
|
|
5712
6234
|
fields = [];
|
|
@@ -5913,13 +6435,17 @@ class UicFormEngine {
|
|
|
5913
6435
|
validators.push(Validators.min(field.min));
|
|
5914
6436
|
if (typeof field.max === 'number')
|
|
5915
6437
|
validators.push(Validators.max(field.max));
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
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
|
+
}
|
|
5920
6445
|
if (field.pattern instanceof RegExp)
|
|
5921
6446
|
validators.push(Validators.pattern(field.pattern));
|
|
5922
6447
|
validators.push(...uicSelectionValidatorsFor(field));
|
|
6448
|
+
validators.push(...uicDistributionValidatorsFor(field));
|
|
5923
6449
|
return validators;
|
|
5924
6450
|
}
|
|
5925
6451
|
submit() {
|
|
@@ -6895,7 +7421,7 @@ class UicFormEngine {
|
|
|
6895
7421
|
current[parts[parts.length - 1]] = value;
|
|
6896
7422
|
}
|
|
6897
7423
|
syncEffectiveSchema() {
|
|
6898
|
-
|
|
7424
|
+
const schema = this.schema ?? {
|
|
6899
7425
|
cols: this.cols ?? 2,
|
|
6900
7426
|
blocks: [
|
|
6901
7427
|
{
|
|
@@ -6903,8 +7429,24 @@ class UicFormEngine {
|
|
|
6903
7429
|
}
|
|
6904
7430
|
]
|
|
6905
7431
|
};
|
|
7432
|
+
this.effectiveSchema = this.expandOtherOptionFields(schema);
|
|
6906
7433
|
this.touch();
|
|
6907
7434
|
}
|
|
7435
|
+
/**
|
|
7436
|
+
* Agrega el campo de texto de cada pregunta con "Otros" (ver other-option.ts).
|
|
7437
|
+
* Sin preguntas con "Otros" devuelve el mismo esquema, sin copiarlo.
|
|
7438
|
+
*/
|
|
7439
|
+
expandOtherOptionFields(schema) {
|
|
7440
|
+
const blocks = schema.blocks ?? [];
|
|
7441
|
+
if (!blocks.some(block => uicContainsOtherOption(block.fields)))
|
|
7442
|
+
return schema;
|
|
7443
|
+
const label = this.i18n.translate('other_option.label');
|
|
7444
|
+
const placeholder = this.i18n.translate('other_option.placeholder');
|
|
7445
|
+
return {
|
|
7446
|
+
...schema,
|
|
7447
|
+
blocks: blocks.map(block => ({ ...block, fields: uicExpandOtherFields(block.fields ?? [], label, placeholder) }))
|
|
7448
|
+
};
|
|
7449
|
+
}
|
|
6908
7450
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormEngine, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6909
7451
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormEngine });
|
|
6910
7452
|
}
|
|
@@ -7124,7 +7666,7 @@ class UicFormWrapperComponent {
|
|
|
7124
7666
|
return Array.from(focusableElements).find(element => element.id === fieldName) ?? null;
|
|
7125
7667
|
}
|
|
7126
7668
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7127
|
-
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"] }] });
|
|
7128
7670
|
}
|
|
7129
7671
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, decorators: [{
|
|
7130
7672
|
type: Component,
|
|
@@ -7135,7 +7677,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7135
7677
|
UicButtonComponent,
|
|
7136
7678
|
UicTranslatePipe,
|
|
7137
7679
|
ReactiveFormsModule
|
|
7138
|
-
], 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"] }]
|
|
7139
7681
|
}], ctorParameters: () => [], propDecorators: { schema: [{
|
|
7140
7682
|
type: Input
|
|
7141
7683
|
}], fields: [{
|
|
@@ -7451,7 +7993,7 @@ class UicDropdownContainerComponent {
|
|
|
7451
7993
|
provide: DROPDOWN_OVERLAY_CONTROLS,
|
|
7452
7994
|
useExisting: forwardRef(() => UicDropdownContainerComponent),
|
|
7453
7995
|
},
|
|
7454
|
-
], 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 }] });
|
|
7455
7997
|
}
|
|
7456
7998
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDropdownContainerComponent, decorators: [{
|
|
7457
7999
|
type: Component,
|
|
@@ -7460,7 +8002,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7460
8002
|
provide: DROPDOWN_OVERLAY_CONTROLS,
|
|
7461
8003
|
useExisting: forwardRef(() => UicDropdownContainerComponent),
|
|
7462
8004
|
},
|
|
7463
|
-
], 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"] }]
|
|
7464
8006
|
}], propDecorators: { buttonLabel: [{
|
|
7465
8007
|
type: Input
|
|
7466
8008
|
}], disabled: [{
|
|
@@ -7658,6 +8200,13 @@ class UicActionButtonComponent {
|
|
|
7658
8200
|
options = [];
|
|
7659
8201
|
multiselect = false;
|
|
7660
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;
|
|
7661
8210
|
optionSelected = new EventEmitter();
|
|
7662
8211
|
optionsApplied = new EventEmitter();
|
|
7663
8212
|
menuTemplate;
|
|
@@ -7733,11 +8282,11 @@ class UicActionButtonComponent {
|
|
|
7733
8282
|
}
|
|
7734
8283
|
}
|
|
7735
8284
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7736
|
-
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" }] });
|
|
7737
8286
|
}
|
|
7738
8287
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicActionButtonComponent, decorators: [{
|
|
7739
8288
|
type: Component,
|
|
7740
|
-
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"] }]
|
|
7741
8290
|
}], propDecorators: { icon: [{
|
|
7742
8291
|
type: Input
|
|
7743
8292
|
}], options: [{
|
|
@@ -7746,6 +8295,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7746
8295
|
type: Input
|
|
7747
8296
|
}], size: [{
|
|
7748
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
|
|
7749
8308
|
}], optionSelected: [{
|
|
7750
8309
|
type: Output
|
|
7751
8310
|
}], optionsApplied: [{
|
|
@@ -7927,11 +8486,11 @@ class UicModalComponent {
|
|
|
7927
8486
|
this.modalRef.closeFloating(null);
|
|
7928
8487
|
}
|
|
7929
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 });
|
|
7930
|
-
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] });
|
|
7931
8490
|
}
|
|
7932
8491
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicModalComponent, decorators: [{
|
|
7933
8492
|
type: Component,
|
|
7934
|
-
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"] }]
|
|
7935
8494
|
}], ctorParameters: () => [{ type: UiModalRef, decorators: [{
|
|
7936
8495
|
type: Inject,
|
|
7937
8496
|
args: [UiModalRef]
|
|
@@ -8301,7 +8860,7 @@ class ItemValueComponent {
|
|
|
8301
8860
|
});
|
|
8302
8861
|
}
|
|
8303
8862
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ItemValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8304
|
-
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" }] });
|
|
8305
8864
|
}
|
|
8306
8865
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ItemValueComponent, decorators: [{
|
|
8307
8866
|
type: Component,
|
|
@@ -8315,7 +8874,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8315
8874
|
UicButtonComponent,
|
|
8316
8875
|
CurrencyPipe,
|
|
8317
8876
|
DatePipe
|
|
8318
|
-
], 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"] }]
|
|
8319
8878
|
}], propDecorators: { key: [{
|
|
8320
8879
|
type: Input
|
|
8321
8880
|
}], type: [{
|
|
@@ -8763,7 +9322,7 @@ class UicTableComponent {
|
|
|
8763
9322
|
return `${a ?? ''}` === `${b ?? ''}`;
|
|
8764
9323
|
}
|
|
8765
9324
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8766
|
-
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] });
|
|
8767
9326
|
}
|
|
8768
9327
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, decorators: [{
|
|
8769
9328
|
type: Component,
|
|
@@ -8779,7 +9338,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8779
9338
|
UicCheckboxComponent,
|
|
8780
9339
|
UicInputComponent,
|
|
8781
9340
|
UicSelectComponent,
|
|
8782
|
-
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"] }]
|
|
8783
9342
|
}], propDecorators: { columns: [{
|
|
8784
9343
|
type: Input
|
|
8785
9344
|
}], data: [{
|
|
@@ -8882,11 +9441,11 @@ class UicSkeletonCardsComponent {
|
|
|
8882
9441
|
return this.cards > 0 ? this.cards : 0;
|
|
8883
9442
|
}
|
|
8884
9443
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSkeletonCardsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8885
|
-
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"] }] });
|
|
8886
9445
|
}
|
|
8887
9446
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSkeletonCardsComponent, decorators: [{
|
|
8888
9447
|
type: Component,
|
|
8889
|
-
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"] }]
|
|
8890
9449
|
}], propDecorators: { cards: [{
|
|
8891
9450
|
type: Input
|
|
8892
9451
|
}], gap: [{
|
|
@@ -9112,11 +9671,11 @@ class UicTabsButtonComponent {
|
|
|
9112
9671
|
this.activeTabChange.emit(this.activeTab);
|
|
9113
9672
|
}
|
|
9114
9673
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTabsButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9115
|
-
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"] }] });
|
|
9116
9675
|
}
|
|
9117
9676
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTabsButtonComponent, decorators: [{
|
|
9118
9677
|
type: Component,
|
|
9119
|
-
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"] }]
|
|
9120
9679
|
}], propDecorators: { tabs: [{
|
|
9121
9680
|
type: Input
|
|
9122
9681
|
}], activeTab: [{
|
|
@@ -9309,11 +9868,11 @@ class UicWorkPanelComponent {
|
|
|
9309
9868
|
return !(this.isMinimized || !this.activeTabId) && this.fullView;
|
|
9310
9869
|
}
|
|
9311
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 });
|
|
9312
|
-
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"] }] });
|
|
9313
9872
|
}
|
|
9314
9873
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicWorkPanelComponent, decorators: [{
|
|
9315
9874
|
type: Component,
|
|
9316
|
-
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"] }]
|
|
9317
9876
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { host: [{
|
|
9318
9877
|
type: ViewChild,
|
|
9319
9878
|
args: ['host', { read: ViewContainerRef, static: true }]
|
|
@@ -10294,7 +10853,7 @@ class UicEditableTableComponent {
|
|
|
10294
10853
|
this.visibleRowsCount = Math.min(this.visibleRowsCount, totalRows);
|
|
10295
10854
|
}
|
|
10296
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 });
|
|
10297
|
-
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"] }] });
|
|
10298
10857
|
}
|
|
10299
10858
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicEditableTableComponent, decorators: [{
|
|
10300
10859
|
type: Component,
|
|
@@ -10305,7 +10864,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
10305
10864
|
FormsModule,
|
|
10306
10865
|
UicTranslatePipe,
|
|
10307
10866
|
UicToolTipDirective
|
|
10308
|
-
], 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"] }]
|
|
10309
10868
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { visibleRowsStep: [{
|
|
10310
10869
|
type: Input
|
|
10311
10870
|
}], record: [{
|
|
@@ -10658,11 +11217,11 @@ class UicProgressBarComponent {
|
|
|
10658
11217
|
});
|
|
10659
11218
|
}
|
|
10660
11219
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10661
|
-
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"] });
|
|
10662
11221
|
}
|
|
10663
11222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicProgressBarComponent, decorators: [{
|
|
10664
11223
|
type: Component,
|
|
10665
|
-
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"] }]
|
|
10666
11225
|
}], propDecorators: { progress: [{
|
|
10667
11226
|
type: Input
|
|
10668
11227
|
}], color: [{
|
|
@@ -10762,18 +11321,22 @@ const VISIBILITY_OPERATOR_OPTIONS = [
|
|
|
10762
11321
|
{ id: 'includes', text: 'includes' },
|
|
10763
11322
|
{ id: 'notIncludes', text: 'notIncludes' },
|
|
10764
11323
|
{ id: 'isEmpty', text: 'isEmpty' },
|
|
10765
|
-
{ id: 'isNotEmpty', text: 'isNotEmpty' }
|
|
11324
|
+
{ id: 'isNotEmpty', text: 'isNotEmpty' },
|
|
11325
|
+
{ id: 'in', text: 'in' },
|
|
11326
|
+
{ id: 'notIn', text: 'notIn' }
|
|
10766
11327
|
];
|
|
11328
|
+
/** Operadores cuyo valor es una lista de valores (FieldVisibilityRule.value es un arreglo). */
|
|
11329
|
+
const LIST_VISIBILITY_OPERATORS = ['in', 'notIn'];
|
|
10767
11330
|
const FIELDS_CONFIG = [
|
|
10768
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'] } },
|
|
10769
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'] } },
|
|
10770
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'] } },
|
|
10771
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'] } },
|
|
10772
|
-
{ 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'] } },
|
|
10773
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'] } },
|
|
10774
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'] } },
|
|
10775
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'] } },
|
|
10776
|
-
{ 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'] } },
|
|
10777
11340
|
{ value: 'checkbox', icon: 'ri-checkbox-line', detail: 'Campo booleano tipo check', label: 'Checkbox', properties: ['placeholder'], visibility: { outputType: 'boolean', operators: ['equals', 'notEquals', 'isEmpty', 'isNotEmpty'] } },
|
|
10778
11341
|
{ value: 'switch', icon: 'ri-toggle-line', detail: 'Campo booleano tipo switch', label: 'Switch', properties: ['placeholder'], visibility: { outputType: 'boolean', operators: ['equals', 'notEquals', 'isEmpty', 'isNotEmpty'] } },
|
|
10779
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'] } },
|
|
@@ -10781,6 +11344,8 @@ const FIELDS_CONFIG = [
|
|
|
10781
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'] } },
|
|
10782
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'] } },
|
|
10783
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'] } },
|
|
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'] } },
|
|
10784
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'] } },
|
|
10785
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'] } },
|
|
10786
11351
|
{ value: 'computed', icon: 'ri-calculator-line', detail: 'Campo calculado automáticamente desde otros campos', label: 'Campo calculado', properties: ['computedSource.key', 'computedSource.dependsOn', 'minLength', 'maxLength'], visibility: { outputType: 'string', operators: ['equals', 'notEquals', 'includes', 'notIncludes', 'isEmpty', 'isNotEmpty'] } }
|
|
@@ -10896,6 +11461,15 @@ const LAYOUT_FORM_FIELDS = [
|
|
|
10896
11461
|
type: 'checkbox'
|
|
10897
11462
|
}
|
|
10898
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
|
+
];
|
|
10899
11473
|
const EXTRA_FORM_FIELDS = [
|
|
10900
11474
|
{
|
|
10901
11475
|
name: 'placeholder',
|
|
@@ -11454,10 +12028,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
11454
12028
|
args: [{ selector: 'ng-template[uicSurveyFooter]' }]
|
|
11455
12029
|
}] });
|
|
11456
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
|
+
|
|
11457
12054
|
/** Tipos que se guardan al cambiar de valor (no tienen un blur significativo). */
|
|
11458
12055
|
const IMMEDIATE_SAVE_TYPES = new Set([
|
|
11459
12056
|
'date', 'time', 'select', 'radio', 'checkbox', 'switch',
|
|
11460
|
-
'pool', 'file', 'multyselect', 'searcher', 'multisearcher', 'slider', 'scale'
|
|
12057
|
+
'pool', 'file', 'multyselect', 'searcher', 'multisearcher', 'slider', 'scale', 'chips'
|
|
11461
12058
|
]);
|
|
11462
12059
|
const THEME_KEY_PATTERN = /^--[\w-]+$/;
|
|
11463
12060
|
/**
|
|
@@ -11472,6 +12069,7 @@ class UicSurveyComponent {
|
|
|
11472
12069
|
engine = inject(UicFormEngine);
|
|
11473
12070
|
host = inject(ElementRef);
|
|
11474
12071
|
cdr = inject(ChangeDetectorRef);
|
|
12072
|
+
injector = inject(Injector);
|
|
11475
12073
|
// --- Configuración del motor (mismo contrato que ui-form-wrapper) ---
|
|
11476
12074
|
set schema(value) { this.engine.schema = value; }
|
|
11477
12075
|
get schema() { return this.engine.schema; }
|
|
@@ -11495,8 +12093,17 @@ class UicSurveyComponent {
|
|
|
11495
12093
|
* hasta revisarlas; 'slide' y 'fade' siguen disponibles de forma experimental (solo entrada).
|
|
11496
12094
|
*/
|
|
11497
12095
|
animation = input('none');
|
|
11498
|
-
|
|
11499
|
-
|
|
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);
|
|
11500
12107
|
/**
|
|
11501
12108
|
* Página en la que empieza (o se reanuda) la encuesta:
|
|
11502
12109
|
* - 'first-unanswered': la primera página visible con alguna pregunta sin responder.
|
|
@@ -11513,14 +12120,30 @@ class UicSurveyComponent {
|
|
|
11513
12120
|
autoAdvance = input(false);
|
|
11514
12121
|
/** Enfoca el primer campo de cada página al navegar. */
|
|
11515
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);
|
|
11516
12129
|
loading = input(false);
|
|
11517
12130
|
/** Variables CSS aplicadas al host. Solo claves que empiecen con "--". */
|
|
11518
12131
|
theme = input(null);
|
|
11519
12132
|
iconMode = input(undefined);
|
|
11520
12133
|
fileUidResolverFn = input(undefined);
|
|
11521
|
-
|
|
11522
|
-
|
|
11523
|
-
|
|
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
|
+
}));
|
|
11524
12147
|
// --- Auto-guardado ---
|
|
11525
12148
|
/**
|
|
11526
12149
|
* Emite fieldSave por cada respuesta que cambia: al salir del campo (texto, número, teléfono,
|
|
@@ -11533,6 +12156,8 @@ class UicSurveyComponent {
|
|
|
11533
12156
|
autoSaveDebounceMs = input(400);
|
|
11534
12157
|
surveySubmit = new EventEmitter();
|
|
11535
12158
|
pageChange = new EventEmitter();
|
|
12159
|
+
/** "Anterior" en la primera página (con showBackOnFirstPage): el consumidor decide a dónde volver. */
|
|
12160
|
+
backFromStart = new EventEmitter();
|
|
11536
12161
|
fieldSave = new EventEmitter();
|
|
11537
12162
|
formChange = new EventEmitter();
|
|
11538
12163
|
optionsSourceError = new EventEmitter();
|
|
@@ -11563,26 +12188,37 @@ class UicSurveyComponent {
|
|
|
11563
12188
|
return this.engine.form;
|
|
11564
12189
|
}
|
|
11565
12190
|
fieldPageFieldsCache = new WeakMap();
|
|
12191
|
+
/** Páginas con varias preguntas (samePage), por su primera pregunta. */
|
|
12192
|
+
fieldGroupCache = new WeakMap();
|
|
11566
12193
|
pages = computed(() => {
|
|
11567
12194
|
const schema = this.engineState().schema;
|
|
11568
12195
|
const blocks = schema.blocks ?? [];
|
|
11569
12196
|
const pages = [];
|
|
11570
12197
|
blocks.forEach((block, blockIndex) => {
|
|
11571
|
-
|
|
12198
|
+
// El texto de "Otros" no es una pregunta aparte: va en la página de su pregunta.
|
|
12199
|
+
const askable = (block.fields ?? []).filter(field => !field.hidden && !field.otherFor);
|
|
11572
12200
|
if (!askable.length)
|
|
11573
12201
|
return;
|
|
11574
12202
|
if (this.pageMode() === 'block') {
|
|
11575
12203
|
pages.push({ key: `b${blockIndex}`, index: pages.length, blockIndex, block, fields: block.fields, firstOfBlock: true });
|
|
11576
12204
|
return;
|
|
11577
12205
|
}
|
|
12206
|
+
// samePage une la pregunta con la anterior; la primera del bloque siempre abre página.
|
|
12207
|
+
const groups = [];
|
|
11578
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) => {
|
|
11579
12215
|
pages.push({
|
|
11580
|
-
key: `f:${
|
|
12216
|
+
key: `f:${group[0].name}`,
|
|
11581
12217
|
index: pages.length,
|
|
11582
12218
|
blockIndex,
|
|
11583
12219
|
block,
|
|
11584
|
-
fields: this.
|
|
11585
|
-
firstOfBlock:
|
|
12220
|
+
fields: this.fieldsForFieldPage(group, block.fields ?? []),
|
|
12221
|
+
firstOfBlock: groupIndex === 0
|
|
11586
12222
|
});
|
|
11587
12223
|
});
|
|
11588
12224
|
});
|
|
@@ -11615,8 +12251,27 @@ class UicSurveyComponent {
|
|
|
11615
12251
|
const total = this.total();
|
|
11616
12252
|
return total ? Math.round((this.position() / total) * 100) : 0;
|
|
11617
12253
|
});
|
|
11618
|
-
|
|
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);
|
|
11619
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());
|
|
11620
12275
|
// --- Auto-guardado: estado interno ---
|
|
11621
12276
|
lastSavedValue = new Map();
|
|
11622
12277
|
saveTimers = new Map();
|
|
@@ -11629,6 +12284,7 @@ class UicSurveyComponent {
|
|
|
11629
12284
|
this.subscriptions.add(this.engine.optionsSourceError$.subscribe(error => this.optionsSourceError.emit(error)));
|
|
11630
12285
|
this.subscriptions.add(this.engine.formBuilt$.subscribe(() => this.onFormBuilt()));
|
|
11631
12286
|
effect(() => this.applyTheme(this.theme()));
|
|
12287
|
+
effect(() => this.trackRevealedQuestions());
|
|
11632
12288
|
// Reanudar: se aplica cuando las páginas ya están montadas (las reglas de visibilidad listas).
|
|
11633
12289
|
effect(() => {
|
|
11634
12290
|
const startAt = this.startAt();
|
|
@@ -11693,10 +12349,16 @@ class UicSurveyComponent {
|
|
|
11693
12349
|
this.submit();
|
|
11694
12350
|
}
|
|
11695
12351
|
}
|
|
12352
|
+
/** Vuelve a la página anterior visible; en la primera, con showBackOnFirstPage, emite backFromStart. */
|
|
11696
12353
|
back() {
|
|
11697
12354
|
const previousPage = this.findAdjacentPage(-1);
|
|
11698
|
-
if (previousPage)
|
|
12355
|
+
if (previousPage) {
|
|
11699
12356
|
this.goTo(previousPage, 'back');
|
|
12357
|
+
}
|
|
12358
|
+
else if (this.currentPage() && this.settings().showBackOnFirstPage) {
|
|
12359
|
+
this.flushSaves();
|
|
12360
|
+
this.backFromStart.emit();
|
|
12361
|
+
}
|
|
11700
12362
|
}
|
|
11701
12363
|
/** Va a una página por su posición en `pages()` (sin validar la actual). */
|
|
11702
12364
|
goToPage(index) {
|
|
@@ -11772,7 +12434,7 @@ class UicSurveyComponent {
|
|
|
11772
12434
|
}
|
|
11773
12435
|
announcePage(page) {
|
|
11774
12436
|
const position = this.i18n.translate('survey.announce_page', { current: this.position() + 1, total: this.total() });
|
|
11775
|
-
const title = this.pageMode() === 'block' ? page.block.title : page
|
|
12437
|
+
const title = this.pageMode() === 'block' ? page.block.title : this.firstVisibleQuestion(page)?.label;
|
|
11776
12438
|
this.announce(title ? `${position}. ${this.i18n.translate(title)}` : position);
|
|
11777
12439
|
}
|
|
11778
12440
|
/** Vacía y vuelve a escribir la región aria-live para que se lea aunque el texto se repita. */
|
|
@@ -11825,6 +12487,83 @@ class UicSurveyComponent {
|
|
|
11825
12487
|
}
|
|
11826
12488
|
return null;
|
|
11827
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
|
+
}
|
|
11828
12567
|
validatePage(page) {
|
|
11829
12568
|
const form = this.pageForms()[page.index];
|
|
11830
12569
|
const states = form?.visibleFieldStates() ?? [];
|
|
@@ -11856,12 +12595,28 @@ class UicSurveyComponent {
|
|
|
11856
12595
|
target?.focus({ preventScroll: true });
|
|
11857
12596
|
});
|
|
11858
12597
|
}
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
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);
|
|
11865
12620
|
return fields;
|
|
11866
12621
|
}
|
|
11867
12622
|
onFormBuilt() {
|
|
@@ -11991,15 +12746,16 @@ class UicSurveyComponent {
|
|
|
11991
12746
|
}
|
|
11992
12747
|
}
|
|
11993
12748
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSurveyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11994
|
-
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 });
|
|
11995
12750
|
}
|
|
11996
12751
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSurveyComponent, decorators: [{
|
|
11997
12752
|
type: Component,
|
|
11998
12753
|
args: [{ selector: 'ui-survey', imports: [NgTemplateOutlet, UicDynamicFormComponent, UicButtonComponent, UicTranslatePipe, UicSkeletonLoaderComponent], providers: [UicFormStateService, UicFormEngine], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
11999
12754
|
'data-uic-theme-scope': '',
|
|
12000
12755
|
'[attr.data-animation]': 'animation()',
|
|
12756
|
+
'[attr.data-page-mode]': 'pageMode()',
|
|
12001
12757
|
'(keydown)': 'onKeydown($event)'
|
|
12002
|
-
}, 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"] }]
|
|
12003
12759
|
}], ctorParameters: () => [], propDecorators: { schema: [{
|
|
12004
12760
|
type: Input,
|
|
12005
12761
|
args: [{ required: true }]
|
|
@@ -12019,6 +12775,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
12019
12775
|
type: Output
|
|
12020
12776
|
}], pageChange: [{
|
|
12021
12777
|
type: Output
|
|
12778
|
+
}], backFromStart: [{
|
|
12779
|
+
type: Output
|
|
12022
12780
|
}], fieldSave: [{
|
|
12023
12781
|
type: Output
|
|
12024
12782
|
}], formChange: [{
|
|
@@ -12072,11 +12830,11 @@ class FormPreviewComponent {
|
|
|
12072
12830
|
this.surveyRun++;
|
|
12073
12831
|
}
|
|
12074
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 });
|
|
12075
|
-
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" }] });
|
|
12076
12834
|
}
|
|
12077
12835
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormPreviewComponent, decorators: [{
|
|
12078
12836
|
type: Component,
|
|
12079
|
-
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"] }]
|
|
12080
12838
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
12081
12839
|
type: Inject,
|
|
12082
12840
|
args: [MODAL_DATA]
|
|
@@ -12147,11 +12905,11 @@ class UicOptionStyleEditorComponent {
|
|
|
12147
12905
|
};
|
|
12148
12906
|
}
|
|
12149
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 });
|
|
12150
|
-
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"] }] });
|
|
12151
12909
|
}
|
|
12152
12910
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicOptionStyleEditorComponent, decorators: [{
|
|
12153
12911
|
type: Component,
|
|
12154
|
-
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"] }]
|
|
12155
12913
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
12156
12914
|
type: Inject,
|
|
12157
12915
|
args: [MODAL_DATA]
|
|
@@ -12266,11 +13024,11 @@ class UicFieldOptionsEditorComponent {
|
|
|
12266
13024
|
});
|
|
12267
13025
|
}
|
|
12268
13026
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFieldOptionsEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12269
|
-
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"] }] });
|
|
12270
13028
|
}
|
|
12271
13029
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFieldOptionsEditorComponent, decorators: [{
|
|
12272
13030
|
type: Component,
|
|
12273
|
-
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"] }]
|
|
12274
13032
|
}], propDecorators: { optionsChange: [{
|
|
12275
13033
|
type: Output
|
|
12276
13034
|
}], title: [{
|
|
@@ -12304,6 +13062,13 @@ const OPTIONS_SOURCE_FIELD_NAMES = [
|
|
|
12304
13062
|
'optionsSource.dependsOn',
|
|
12305
13063
|
'optionsSource.paramName'
|
|
12306
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
|
+
};
|
|
12307
13072
|
class FieldEditorComponent {
|
|
12308
13073
|
translateService = inject(UicTranslateService);
|
|
12309
13074
|
elementRef = inject(ElementRef);
|
|
@@ -12342,8 +13107,12 @@ class FieldEditorComponent {
|
|
|
12342
13107
|
visibilityRulesEnabled = input(true);
|
|
12343
13108
|
/** Sección "Estilo". */
|
|
12344
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);
|
|
12345
13112
|
showDependencySection = computed(() => this.visibilityRulesEnabled() || !!this.localField().visibilityRules?.length);
|
|
12346
|
-
|
|
13113
|
+
/** Tipos con opciones que no admiten origen externo (el motor solo lo resuelve para selectores, pool y radio). */
|
|
13114
|
+
manualOptionsOnly = computed(() => this.fieldType()?.value === 'distribution');
|
|
13115
|
+
showOptionsSourceConfig = computed(() => !this.manualOptionsOnly() && (this.externalSources().options || this.hasExternalOptionsSource()));
|
|
12347
13116
|
showExternalValidation = computed(() => this.hasExternalValidation() && (this.externalSources().validation || !!this.localField().externalValidation?.key));
|
|
12348
13117
|
options = input({});
|
|
12349
13118
|
hiddenSections = signal([]);
|
|
@@ -12429,11 +13198,15 @@ class FieldEditorComponent {
|
|
|
12429
13198
|
const operator = selectedOperator && allowedOperators.includes(selectedOperator)
|
|
12430
13199
|
? selectedOperator
|
|
12431
13200
|
: null;
|
|
12432
|
-
|
|
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;
|
|
12433
13205
|
const nextDraft = {
|
|
12434
13206
|
fieldName: fieldName ?? null,
|
|
12435
13207
|
operator,
|
|
12436
|
-
value
|
|
13208
|
+
value: listOperator ? null : value,
|
|
13209
|
+
values: listOperator ? value : null
|
|
12437
13210
|
};
|
|
12438
13211
|
this.branchDraftValues.set(nextDraft);
|
|
12439
13212
|
if (parentChanged) {
|
|
@@ -12442,6 +13215,9 @@ class FieldEditorComponent {
|
|
|
12442
13215
|
// Ignore partial emissions while the dependency form is still incomplete.
|
|
12443
13216
|
if (!fieldName || !operator)
|
|
12444
13217
|
return;
|
|
13218
|
+
// Una regla de lista sin valores no se guarda (nunca coincidiría).
|
|
13219
|
+
if (listOperator && !value)
|
|
13220
|
+
return;
|
|
12445
13221
|
const visibilityRule = {
|
|
12446
13222
|
fieldName,
|
|
12447
13223
|
fieldLabel: this.getDependencyFieldLabel(fieldName),
|
|
@@ -12454,7 +13230,7 @@ class FieldEditorComponent {
|
|
|
12454
13230
|
if (currentRule &&
|
|
12455
13231
|
currentRule.fieldName === visibilityRule.fieldName &&
|
|
12456
13232
|
currentRule.operator === visibilityRule.operator &&
|
|
12457
|
-
currentRule.value === visibilityRule.value) {
|
|
13233
|
+
JSON.stringify(currentRule.value ?? null) === JSON.stringify(visibilityRule.value ?? null)) {
|
|
12458
13234
|
return;
|
|
12459
13235
|
}
|
|
12460
13236
|
// If adding a new rule, only keep in draft — don't persist until confirmEditingRule()
|
|
@@ -12504,8 +13280,10 @@ class FieldEditorComponent {
|
|
|
12504
13280
|
fieldName,
|
|
12505
13281
|
fieldLabel: this.getDependencyFieldLabel(fieldName),
|
|
12506
13282
|
operator,
|
|
12507
|
-
value: draft['value'] ?? null
|
|
13283
|
+
value: this.isListVisibilityOperator(operator) ? draft['values'] ?? null : draft['value'] ?? null
|
|
12508
13284
|
};
|
|
13285
|
+
if (this.isListVisibilityOperator(operator) && !newRule.value)
|
|
13286
|
+
return;
|
|
12509
13287
|
const updatedRules = [...(this.localField().visibilityRules ?? []), newRule];
|
|
12510
13288
|
const updatedField = { ...this.localField(), visibilityRules: updatedRules };
|
|
12511
13289
|
this.localField.set(updatedField);
|
|
@@ -12630,6 +13408,26 @@ class FieldEditorComponent {
|
|
|
12630
13408
|
this.localField.set(updatedField);
|
|
12631
13409
|
this.fieldChange.emit(updatedField);
|
|
12632
13410
|
}
|
|
13411
|
+
// ---- Opción "Otros (especifica)" ----
|
|
13412
|
+
supportsOtherOption = computed(() => uicSupportsOtherOption({ type: this.localField().type }));
|
|
13413
|
+
toggleOtherOption(enabled) {
|
|
13414
|
+
this.patchField({ otherOption: enabled ? { required: true } : null });
|
|
13415
|
+
}
|
|
13416
|
+
updateOtherOption(patch) {
|
|
13417
|
+
const current = this.localField().otherOption;
|
|
13418
|
+
if (!current)
|
|
13419
|
+
return;
|
|
13420
|
+
const next = { ...current, ...patch };
|
|
13421
|
+
// Textos vacíos = valor por defecto (no se guardan).
|
|
13422
|
+
['label', 'placeholder'].forEach(key => { if (!next[key]?.trim())
|
|
13423
|
+
delete next[key]; });
|
|
13424
|
+
this.patchField({ otherOption: next });
|
|
13425
|
+
}
|
|
13426
|
+
patchField(patch) {
|
|
13427
|
+
const updatedField = { ...this.localField(), ...patch };
|
|
13428
|
+
this.localField.set(updatedField);
|
|
13429
|
+
this.fieldChange.emit(updatedField);
|
|
13430
|
+
}
|
|
12633
13431
|
updateOptions(options) {
|
|
12634
13432
|
const updatedField = {
|
|
12635
13433
|
...this.localField(),
|
|
@@ -12695,12 +13493,13 @@ class FieldEditorComponent {
|
|
|
12695
13493
|
const fieldType = this.fieldType();
|
|
12696
13494
|
if (!fieldType)
|
|
12697
13495
|
return [];
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
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
|
+
}));
|
|
12704
13503
|
}
|
|
12705
13504
|
buildAdvancedBlocks() {
|
|
12706
13505
|
const fieldType = this.fieldType();
|
|
@@ -12740,7 +13539,7 @@ class FieldEditorComponent {
|
|
|
12740
13539
|
const fieldName = values['fieldName'];
|
|
12741
13540
|
const dependencyType = this.getDependencyFieldType(fieldName);
|
|
12742
13541
|
const allowedOperators = this.getAllowedVisibilityOperators(dependencyType);
|
|
12743
|
-
return BRANCH_FORM_FIELDS.map(field => ({
|
|
13542
|
+
return [...BRANCH_FORM_FIELDS, BRANCH_LIST_VALUE_FIELD].map(field => ({
|
|
12744
13543
|
...this.prepareBranchField(field, fieldName, allowedOperators),
|
|
12745
13544
|
label: this.translateService.translate(field.label ?? ''),
|
|
12746
13545
|
placeholder: field.placeholder ? this.translateService.translate(field.placeholder) : this.translateService.translate(field.label ?? '')
|
|
@@ -12770,8 +13569,7 @@ class FieldEditorComponent {
|
|
|
12770
13569
|
{ fieldName: 'fieldName', operator: 'notEquals', value: '' },
|
|
12771
13570
|
{ fieldName: 'operator', operator: 'notEquals', value: null },
|
|
12772
13571
|
{ fieldName: 'operator', operator: 'notEquals', value: '' },
|
|
12773
|
-
{ fieldName: 'operator', operator: '
|
|
12774
|
-
{ fieldName: 'operator', operator: 'notEquals', value: 'isNotEmpty' }
|
|
13572
|
+
{ fieldName: 'operator', operator: 'notIn', value: ['isEmpty', 'isNotEmpty', ...LIST_VISIBILITY_OPERATORS] }
|
|
12775
13573
|
],
|
|
12776
13574
|
type: this.getBranchValueFieldType(fieldName)
|
|
12777
13575
|
};
|
|
@@ -12790,8 +13588,39 @@ class FieldEditorComponent {
|
|
|
12790
13588
|
}
|
|
12791
13589
|
return valueField;
|
|
12792
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
|
+
}
|
|
12793
13603
|
return field;
|
|
12794
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
|
+
}
|
|
12795
13624
|
getAllowedVisibilityOperators(fieldType) {
|
|
12796
13625
|
return FIELDS_CONFIG.find(field => field.value === fieldType)?.visibility.operators ?? [];
|
|
12797
13626
|
}
|
|
@@ -12815,10 +13644,12 @@ class FieldEditorComponent {
|
|
|
12815
13644
|
ruleToBranchValues(rule) {
|
|
12816
13645
|
if (!rule || !rule.fieldName)
|
|
12817
13646
|
return {};
|
|
13647
|
+
const listOperator = this.isListVisibilityOperator(rule.operator);
|
|
12818
13648
|
return {
|
|
12819
13649
|
fieldName: rule.fieldName ?? null,
|
|
12820
13650
|
operator: rule.operator ?? null,
|
|
12821
|
-
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
|
|
12822
13653
|
};
|
|
12823
13654
|
}
|
|
12824
13655
|
isValueLessVisibilityOperator(operator) {
|
|
@@ -12857,7 +13688,7 @@ class FieldEditorComponent {
|
|
|
12857
13688
|
});
|
|
12858
13689
|
}
|
|
12859
13690
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12860
|
-
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 }\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}\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: "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"] }] });
|
|
12861
13692
|
}
|
|
12862
13693
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldEditorComponent, decorators: [{
|
|
12863
13694
|
type: Component,
|
|
@@ -12865,9 +13696,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
12865
13696
|
UicFormWrapperComponent,
|
|
12866
13697
|
UicButtonComponent,
|
|
12867
13698
|
NgTemplateOutlet,
|
|
13699
|
+
FormsModule,
|
|
13700
|
+
UicCheckboxComponent,
|
|
13701
|
+
UicInputComponent,
|
|
12868
13702
|
UicTranslatePipe,
|
|
12869
13703
|
UicFieldOptionsEditorComponent
|
|
12870
|
-
], 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 }\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}\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"] }]
|
|
12871
13705
|
}], ctorParameters: () => [] });
|
|
12872
13706
|
|
|
12873
13707
|
/** Agrupación solo de presentación: no altera FIELDS_CONFIG. Tipos no listados caen en "other". */
|
|
@@ -12882,7 +13716,9 @@ const GROUP_BY_TYPE = {
|
|
|
12882
13716
|
checkbox: 'choice',
|
|
12883
13717
|
switch: 'choice',
|
|
12884
13718
|
pool: 'choice',
|
|
13719
|
+
chips: 'text',
|
|
12885
13720
|
scale: 'choice',
|
|
13721
|
+
distribution: 'choice',
|
|
12886
13722
|
slider: 'choice',
|
|
12887
13723
|
date: 'datetime',
|
|
12888
13724
|
time: 'datetime',
|
|
@@ -12950,11 +13786,11 @@ class FieldTypeSelectorComponent {
|
|
|
12950
13786
|
return value.normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase().trim();
|
|
12951
13787
|
}
|
|
12952
13788
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldTypeSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12953
|
-
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"] }] });
|
|
12954
13790
|
}
|
|
12955
13791
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldTypeSelectorComponent, decorators: [{
|
|
12956
13792
|
type: Component,
|
|
12957
|
-
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"] }]
|
|
12958
13794
|
}], propDecorators: { searchInput: [{
|
|
12959
13795
|
type: ViewChild,
|
|
12960
13796
|
args: ['searchInput']
|
|
@@ -13047,6 +13883,7 @@ function resolveFormBuilderConfig(...configs) {
|
|
|
13047
13883
|
maxRepeaterFields: positiveIntOrNull(merged.limits?.maxRepeaterFields, 'limits.maxRepeaterFields'),
|
|
13048
13884
|
},
|
|
13049
13885
|
preview: {
|
|
13886
|
+
showButton: merged.preview?.showButton ?? true,
|
|
13050
13887
|
mode: merged.preview?.mode ?? null,
|
|
13051
13888
|
survey: merged.preview?.survey ?? null,
|
|
13052
13889
|
},
|
|
@@ -13340,6 +14177,9 @@ class BlockEditorComponent {
|
|
|
13340
14177
|
if (typeof value === 'object')
|
|
13341
14178
|
return JSON.stringify(value);
|
|
13342
14179
|
const scalar = value;
|
|
14180
|
+
if (scalar === UIC_OTHER_OPTION_ID) {
|
|
14181
|
+
return this.translateService.translate(source?.fieldData.otherOption?.label || 'other_option.label');
|
|
14182
|
+
}
|
|
13343
14183
|
const option = source?.fieldData.options?.find(opt => String(opt.id) === String(scalar));
|
|
13344
14184
|
return option ? this.translateService.translate(option.text) : String(scalar);
|
|
13345
14185
|
};
|
|
@@ -13378,7 +14218,7 @@ class BlockEditorComponent {
|
|
|
13378
14218
|
this.blockChange.emit({ ...this.block(), fields: nextFields });
|
|
13379
14219
|
}
|
|
13380
14220
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlockEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13381
|
-
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"] }] });
|
|
13382
14222
|
}
|
|
13383
14223
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlockEditorComponent, decorators: [{
|
|
13384
14224
|
type: Component,
|
|
@@ -13389,27 +14229,114 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
13389
14229
|
DragDropModule,
|
|
13390
14230
|
FormsModule,
|
|
13391
14231
|
FieldTypeSelectorComponent
|
|
13392
|
-
], 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"] }]
|
|
13393
14235
|
}], ctorParameters: () => [], propDecorators: { visibilityParentFieldCodes: [{
|
|
13394
14236
|
type: Input
|
|
13395
14237
|
}], fieldLookup: [{
|
|
13396
14238
|
type: Input
|
|
13397
14239
|
}] } });
|
|
13398
14240
|
|
|
13399
|
-
const UNDO_TIMEOUT_MS = 6000;
|
|
13400
14241
|
/**
|
|
13401
14242
|
* Opciones manuales de un campo del que se puede depender: el editor de reglas las usa para
|
|
13402
14243
|
* mostrar un selector de valor (y su texto) en vez de pedir el id a mano. Con origen externo no hay lista fija.
|
|
13403
14244
|
*/
|
|
13404
|
-
const dependencyValueOptions = (fieldData) =>
|
|
13405
|
-
|
|
13406
|
-
|
|
14245
|
+
const dependencyValueOptions = (fieldData) => {
|
|
14246
|
+
const manual = !fieldData.optionsSource?.key && fieldData.options?.length
|
|
14247
|
+
? fieldData.options.filter(opt => opt.id !== '' && opt.id !== null && opt.id !== undefined).map(opt => ({ id: opt.id, text: opt.text || String(opt.id) }))
|
|
14248
|
+
: undefined;
|
|
14249
|
+
// "Otros" también se puede usar como condición (p. ej., mostrar otra pregunta si eligió Otros).
|
|
14250
|
+
if (manual && uicHasOtherOption(fieldData)) {
|
|
14251
|
+
return [...manual, { id: UIC_OTHER_OPTION_ID, text: fieldData.otherOption?.label || 'other_option.label' }];
|
|
14252
|
+
}
|
|
14253
|
+
return manual;
|
|
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;
|
|
13407
14333
|
const DEFAULT_PROPERTIES_WIDTH = 320;
|
|
13408
14334
|
const clampPropertiesWidth = (width) => Math.min(Math.max(width, 250), 600);
|
|
13409
14335
|
class UicUserFormbuilderComponent {
|
|
13410
14336
|
modalService = inject(UicModalService);
|
|
13411
14337
|
host = inject(ElementRef);
|
|
13412
14338
|
tinyAlertService = inject(UicTinyAlertService);
|
|
14339
|
+
pushAlertService = inject(UicPushAlertService);
|
|
13413
14340
|
translateService = inject(UicTranslateService);
|
|
13414
14341
|
disabled = false;
|
|
13415
14342
|
/**
|
|
@@ -13434,6 +14361,13 @@ class UicUserFormbuilderComponent {
|
|
|
13434
14361
|
previewMode = input('form');
|
|
13435
14362
|
/** Ajustes de la vista previa en modo encuesta. `config.preview.survey` tiene prioridad (ver previewMode). */
|
|
13436
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
|
+
});
|
|
13437
14371
|
editableFormInput = input({ cols: 2, blocks: [] }, { alias: 'editableForm' });
|
|
13438
14372
|
submitFormRequest = output();
|
|
13439
14373
|
nextBlockId = 1;
|
|
@@ -13858,15 +14792,47 @@ class UicUserFormbuilderComponent {
|
|
|
13858
14792
|
fieldData: updatedFieldData
|
|
13859
14793
|
};
|
|
13860
14794
|
this.editingSubField.set({ ...context, subField: updatedSubField });
|
|
13861
|
-
|
|
13862
|
-
|
|
13863
|
-
|
|
13864
|
-
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
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 }));
|
|
13870
14836
|
}
|
|
13871
14837
|
startPropertiesResize(event) {
|
|
13872
14838
|
event.preventDefault();
|
|
@@ -14240,23 +15206,35 @@ class UicUserFormbuilderComponent {
|
|
|
14240
15206
|
return;
|
|
14241
15207
|
const fieldCode = selected.code;
|
|
14242
15208
|
let updatedSelected = null;
|
|
14243
|
-
|
|
14244
|
-
|
|
14245
|
-
|
|
14246
|
-
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
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
|
+
});
|
|
14257
15231
|
if (updatedSelected) {
|
|
14258
15232
|
this.selectedField.set(updatedSelected);
|
|
14259
15233
|
}
|
|
15234
|
+
if (prunedRules) {
|
|
15235
|
+
this.syncSelectionAfterPruning();
|
|
15236
|
+
this.warnPrunedRules(prunedRules);
|
|
15237
|
+
}
|
|
14260
15238
|
}
|
|
14261
15239
|
prepareBlocksForLocalState(blocks) {
|
|
14262
15240
|
return this.hydrateBlocks(this.deepClone(blocks));
|
|
@@ -14446,7 +15424,7 @@ class UicUserFormbuilderComponent {
|
|
|
14446
15424
|
return value;
|
|
14447
15425
|
}
|
|
14448
15426
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicUserFormbuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14449
|
-
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"] }] });
|
|
14450
15428
|
}
|
|
14451
15429
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicUserFormbuilderComponent, decorators: [{
|
|
14452
15430
|
type: Component,
|
|
@@ -14460,7 +15438,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
14460
15438
|
UicDropdownContainerComponent,
|
|
14461
15439
|
UiDropdownCloseDirective,
|
|
14462
15440
|
UicToolTipDirective
|
|
14463
|
-
], 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"] }]
|
|
14464
15442
|
}], ctorParameters: () => [], propDecorators: { disabled: [{
|
|
14465
15443
|
type: Input
|
|
14466
15444
|
}], config: [{
|
|
@@ -14673,7 +15651,7 @@ class RuleDefinirionComponent {
|
|
|
14673
15651
|
return condition.id === 0 ? (condition.temporalId ?? '') : condition.id;
|
|
14674
15652
|
}
|
|
14675
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 });
|
|
14676
|
-
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" }] });
|
|
14677
15655
|
}
|
|
14678
15656
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RuleDefinirionComponent, decorators: [{
|
|
14679
15657
|
type: Component,
|
|
@@ -14683,7 +15661,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
14683
15661
|
UicInputComponent,
|
|
14684
15662
|
UicButtonComponent,
|
|
14685
15663
|
UicTranslatePipe
|
|
14686
|
-
], 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"] }]
|
|
14687
15665
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
14688
15666
|
type: Inject,
|
|
14689
15667
|
args: [MODAL_DATA]
|
|
@@ -15291,5 +16269,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
15291
16269
|
* Generated bundle index. Do not edit.
|
|
15292
16270
|
*/
|
|
15293
16271
|
|
|
15294
|
-
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_EXTRA_COLORS, UIC_FORM_BUILDER_CONFIG, 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, 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, uicColorOptions, uicColorSwatchOptions, uicSelectionCountValidator, uicSelectionValidatorsFor };
|
|
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 };
|
|
15295
16273
|
//# sourceMappingURL=ui-core-abv.mjs.map
|