ui-core-abv 0.6.20 → 0.6.24
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 +1041 -151
- package/fesm2022/ui-core-abv.mjs.map +1 -1
- package/lib/components/editable-table/editable-table.component.d.ts +84 -0
- package/lib/components/excel-table/excel-table.component.d.ts +2 -19
- package/lib/components/inputs/select/select.component.d.ts +2 -0
- package/lib/components/user-formbuilder/field-editor/field-editor.component.d.ts +31 -0
- package/lib/components/user-formbuilder/field-editor/field-options-editor/field-options-editor.component.d.ts +10 -0
- package/lib/components/user-formbuilder/form-preview/form-preview.component.d.ts +13 -0
- package/lib/components/user-formbuilder/user-formbuilder.component.d.ts +59 -0
- package/lib/translate/dictionary.en.d.ts +31 -1
- package/lib/translate/dictionary.es.d.ts +31 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
package/fesm2022/ui-core-abv.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, CurrencyPipe, DatePipe } 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, HostListener, ViewChildren, Host, TemplateRef, ContentChild, createComponent, Injector, EnvironmentInjector, HostBinding } from '@angular/core';
|
|
5
|
-
import * as
|
|
4
|
+
import { Input, Component, EventEmitter, Output, Directive, forwardRef, InjectionToken, Optional, Inject, Injectable, inject, ChangeDetectorRef, Pipe, ViewContainerRef, ElementRef, ViewChild, HostListener, ViewChildren, Host, TemplateRef, ContentChild, createComponent, Injector, EnvironmentInjector, HostBinding, input, computed, signal } from '@angular/core';
|
|
5
|
+
import * as i1$1 from '@angular/forms';
|
|
6
6
|
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormBuilder, Validators } from '@angular/forms';
|
|
7
7
|
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
|
8
|
-
import * as i1$
|
|
8
|
+
import * as i1$2 from '@angular/cdk/portal';
|
|
9
9
|
import { TemplatePortal, ComponentPortal, PortalModule, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
10
10
|
import { BehaviorSubject, Subject, debounceTime, distinctUntilChanged, tap, switchMap, of, finalize, takeUntil, Subscription } from 'rxjs';
|
|
11
11
|
import { filter } from 'rxjs/operators';
|
|
@@ -263,11 +263,25 @@ const DICTIONARY_EN = {
|
|
|
263
263
|
},
|
|
264
264
|
excel_table: {
|
|
265
265
|
load_file: 'Upload excel',
|
|
266
|
-
empty_message: '
|
|
266
|
+
empty_message: 'No data to show',
|
|
267
267
|
clear_file: 'Clear',
|
|
268
268
|
see_more: 'See more',
|
|
269
269
|
counter_text: 'Viewing {{shown}} items of {{total}} total',
|
|
270
270
|
},
|
|
271
|
+
editable_table: {
|
|
272
|
+
add_row_above: 'Add row above',
|
|
273
|
+
add_row_below: 'Add row below',
|
|
274
|
+
delete_row: 'Delete row',
|
|
275
|
+
add_column: 'Add column',
|
|
276
|
+
delete_column: 'Delete column',
|
|
277
|
+
delete_row_with_data_warning: 'This row has data. If you delete it, all values will be lost.',
|
|
278
|
+
delete_column_with_data_warning: 'The column "{{column_name}}" has data. If you delete it, these values will be lost.',
|
|
279
|
+
save_or_discard_column: 'Do you want to save this new column or delete it?',
|
|
280
|
+
save_column: 'Save column',
|
|
281
|
+
save: 'Save',
|
|
282
|
+
delete: 'Delete',
|
|
283
|
+
column_name_must_be_unique: 'Column name must be unique',
|
|
284
|
+
},
|
|
271
285
|
step_form: {
|
|
272
286
|
back: 'Back',
|
|
273
287
|
next: 'Next',
|
|
@@ -384,6 +398,22 @@ const DICTIONARY_EN = {
|
|
|
384
398
|
pattern: 'Pattern',
|
|
385
399
|
pattern_tip: 'Regular expression in text',
|
|
386
400
|
},
|
|
401
|
+
options_editor: {
|
|
402
|
+
title: 'Options',
|
|
403
|
+
code_label: 'Code',
|
|
404
|
+
name_label: 'Label',
|
|
405
|
+
code_placeholder: 'ID',
|
|
406
|
+
display_name_placeholder: 'Display name',
|
|
407
|
+
add_option: 'Add option',
|
|
408
|
+
},
|
|
409
|
+
field_editor: {
|
|
410
|
+
style: 'Style',
|
|
411
|
+
advanced: 'Advanced',
|
|
412
|
+
duplicate: 'Duplicate',
|
|
413
|
+
delete: 'Delete',
|
|
414
|
+
show_advanced: 'Show advanced',
|
|
415
|
+
hide_advanced: 'Hide advanced',
|
|
416
|
+
},
|
|
387
417
|
validation: {
|
|
388
418
|
duplicate_identifier: 'The identifier "{{identifier}}" is used more than once.',
|
|
389
419
|
duplicate_identifier_title: 'Validation error',
|
|
@@ -462,10 +492,24 @@ const DICTIONARY_ES = {
|
|
|
462
492
|
excel_table: {
|
|
463
493
|
load_file: 'Cargar excel',
|
|
464
494
|
clear_file: 'Limpiar',
|
|
465
|
-
empty_message: '
|
|
495
|
+
empty_message: 'No hay datos para mostrar',
|
|
466
496
|
see_more: 'Ver mas',
|
|
467
497
|
counter_text: 'Viendo {{shown}} elementos de {{total}} totales',
|
|
468
498
|
},
|
|
499
|
+
editable_table: {
|
|
500
|
+
add_row_above: 'Agregar arriba',
|
|
501
|
+
add_row_below: 'Agregar abajo',
|
|
502
|
+
delete_row: 'Eliminar fila',
|
|
503
|
+
add_column: 'Agregar columna',
|
|
504
|
+
delete_column: 'Eliminar columna',
|
|
505
|
+
delete_row_with_data_warning: 'Esta fila tiene datos. Si la eliminas, se perderán todos sus valores.',
|
|
506
|
+
delete_column_with_data_warning: 'La columna "{{column_name}}" tiene datos. Si la eliminas, perderás esos valores.',
|
|
507
|
+
save_or_discard_column: '¿Deseas guardar esta nueva columna o eliminarla?',
|
|
508
|
+
save_column: 'Guardar columna',
|
|
509
|
+
save: 'Guardar',
|
|
510
|
+
delete: 'Eliminar',
|
|
511
|
+
column_name_must_be_unique: 'El nombre de la columna debe ser único',
|
|
512
|
+
},
|
|
469
513
|
step_form: {
|
|
470
514
|
back: 'Volver',
|
|
471
515
|
next: 'Siguiente',
|
|
@@ -582,6 +626,22 @@ const DICTIONARY_ES = {
|
|
|
582
626
|
pattern: 'Patrón',
|
|
583
627
|
pattern_tip: 'Expresión regular en texto',
|
|
584
628
|
},
|
|
629
|
+
options_editor: {
|
|
630
|
+
title: 'Opciones',
|
|
631
|
+
code_label: 'Código',
|
|
632
|
+
name_label: 'Etiqueta',
|
|
633
|
+
code_placeholder: 'ID',
|
|
634
|
+
display_name_placeholder: 'Nombre para mostrar',
|
|
635
|
+
add_option: 'Nueva opción',
|
|
636
|
+
},
|
|
637
|
+
field_editor: {
|
|
638
|
+
style: 'Estilo',
|
|
639
|
+
advanced: 'Avanzado',
|
|
640
|
+
duplicate: 'Duplicar',
|
|
641
|
+
delete: 'Eliminar',
|
|
642
|
+
show_advanced: 'Mostrar avanzado',
|
|
643
|
+
hide_advanced: 'Ocultar avanzado',
|
|
644
|
+
},
|
|
585
645
|
validation: {
|
|
586
646
|
duplicate_identifier: 'El identificador "{{identifier}}" se está usando más de una vez.',
|
|
587
647
|
duplicate_identifier_title: 'Error de validación',
|
|
@@ -775,7 +835,7 @@ class UicSelectComponent extends base$b {
|
|
|
775
835
|
useExisting: forwardRef(() => UicSelectComponent),
|
|
776
836
|
multi: true
|
|
777
837
|
}
|
|
778
|
-
], viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "\r\n<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 (click)=\"openList()\" class=\"fakeinput\" #fakeinput \r\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':loading}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon {{internalIcon}} f-{{internalIconColor}}\" ></i>\r\n }\r\n <div class=\"fakeinput-emptytext\" [class.disabled-placeholder]=\"disabled && !selectedOption?.text\"
|
|
838
|
+
], viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "\r\n<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 (click)=\"openList()\" class=\"fakeinput\" #fakeinput \r\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':loading}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon {{internalIcon}} f-{{internalIconColor}}\" ></i>\r\n }\r\n <div class=\"fakeinput-emptytext\" [class.disabled-placeholder]=\"disabled && !selectedOption?.text\" >\r\n @if (selectedOption?.icon) {\r\n <i class=\"{{selectedOption?.icon}} f-{{selectedOption?.iconColor}}\" style=\"margin-right: 5px;\"></i>\r\n }\r\n {{(selectedOption?.text || nonSelectedText) | uicTranslate}}\r\n </div>\r\n @if (!disabled && !loading) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n <ng-template #dropdownTemplate >\r\n <div class=\"input-options\">\r\n <!-- OPCIONES -->\r\n <div class=\"input-option-scroll\">\r\n @if (options.length > 0 && nullable) {\r\n <div (click)=\"selectOption(null)\" class=\"input-option \" style=\"padding: 3px;\" >{{noneText | uicTranslate}}</div>\r\n <div class=\"option-divider\"></div>\r\n }\r\n \r\n \r\n @for (option of options; track $index) {\r\n <div (click)=\"selectOption(option)\" class=\"input-option\">\r\n @if (option.icon) {\r\n <i class=\"{{option.icon}} f-{{option.iconColor}}\" style=\"margin-right: 5px;\"></i>\r\n }\r\n <div style=\"padding: 2px;\" >\r\n <div class=\"f-medium\" >{{option.text }}</div>\r\n <div *ngIf=\"showSubtitle\" class=\"f-extralight\" >\r\n {{option.detail}}\r\n </div>\r\n </div>\r\n </div>\r\n @if ( $index < (options.length - 1) ) {\r\n <span class=\"option-divider\"></span>\r\n }\r\n \r\n }\r\n \r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">{{emptyText | uicTranslate}}</div>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n \r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [":host{width:100%}.input-container{flex:1 1;overflow:hidden}.input-options{border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;font-size:.875rem;z-index:500;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.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(--primary-500)}.input-option:hover{background-color:var(--secondary-100);cursor:pointer}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px 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(--grey-200);padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--white);border:solid 1px 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(--grey-700);margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:max(var(--form-ref) + 4px,14px);line-height:1.125rem;min-height:1.125rem;font-weight:400;color: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 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color: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: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: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(--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(--grey-200)}.fakeinput:focus-within{box-shadow:0 0 0 3px var(--secondary-alpha)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-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(--grey-400)}.f-black{color:var(--grey-900)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-400)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,#f2f2f2 40%,#dee1e2,#f2f2f2 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--grey-400)}\n"], dependencies: [{ kind: "component", type: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
779
839
|
}
|
|
780
840
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSelectComponent, decorators: [{
|
|
781
841
|
type: Component,
|
|
@@ -785,7 +845,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
785
845
|
useExisting: forwardRef(() => UicSelectComponent),
|
|
786
846
|
multi: true
|
|
787
847
|
}
|
|
788
|
-
], template: "\r\n<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 (click)=\"openList()\" class=\"fakeinput\" #fakeinput \r\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':loading}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon {{internalIcon}} f-{{internalIconColor}}\" ></i>\r\n }\r\n <div class=\"fakeinput-emptytext\" [class.disabled-placeholder]=\"disabled && !selectedOption?.text\"
|
|
848
|
+
], template: "\r\n<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 (click)=\"openList()\" class=\"fakeinput\" #fakeinput \r\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':loading}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon {{internalIcon}} f-{{internalIconColor}}\" ></i>\r\n }\r\n <div class=\"fakeinput-emptytext\" [class.disabled-placeholder]=\"disabled && !selectedOption?.text\" >\r\n @if (selectedOption?.icon) {\r\n <i class=\"{{selectedOption?.icon}} f-{{selectedOption?.iconColor}}\" style=\"margin-right: 5px;\"></i>\r\n }\r\n {{(selectedOption?.text || nonSelectedText) | uicTranslate}}\r\n </div>\r\n @if (!disabled && !loading) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n <ng-template #dropdownTemplate >\r\n <div class=\"input-options\">\r\n <!-- OPCIONES -->\r\n <div class=\"input-option-scroll\">\r\n @if (options.length > 0 && nullable) {\r\n <div (click)=\"selectOption(null)\" class=\"input-option \" style=\"padding: 3px;\" >{{noneText | uicTranslate}}</div>\r\n <div class=\"option-divider\"></div>\r\n }\r\n \r\n \r\n @for (option of options; track $index) {\r\n <div (click)=\"selectOption(option)\" class=\"input-option\">\r\n @if (option.icon) {\r\n <i class=\"{{option.icon}} f-{{option.iconColor}}\" style=\"margin-right: 5px;\"></i>\r\n }\r\n <div style=\"padding: 2px;\" >\r\n <div class=\"f-medium\" >{{option.text }}</div>\r\n <div *ngIf=\"showSubtitle\" class=\"f-extralight\" >\r\n {{option.detail}}\r\n </div>\r\n </div>\r\n </div>\r\n @if ( $index < (options.length - 1) ) {\r\n <span class=\"option-divider\"></span>\r\n }\r\n \r\n }\r\n \r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">{{emptyText | uicTranslate}}</div>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n \r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [":host{width:100%}.input-container{flex:1 1;overflow:hidden}.input-options{border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;font-size:.875rem;z-index:500;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.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(--primary-500)}.input-option:hover{background-color:var(--secondary-100);cursor:pointer}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px 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(--grey-200);padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--white);border:solid 1px 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(--grey-700);margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:max(var(--form-ref) + 4px,14px);line-height:1.125rem;min-height:1.125rem;font-weight:400;color: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 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color: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: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: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(--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(--grey-200)}.fakeinput:focus-within{box-shadow:0 0 0 3px var(--secondary-alpha)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-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(--grey-400)}.f-black{color:var(--grey-900)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-400)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,#f2f2f2 40%,#dee1e2,#f2f2f2 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--grey-400)}\n"] }]
|
|
789
849
|
}], propDecorators: { icon: [{
|
|
790
850
|
type: Input
|
|
791
851
|
}], iconColor: [{
|
|
@@ -1800,7 +1860,7 @@ class UicSearcherComponent extends base$6 {
|
|
|
1800
1860
|
useExisting: forwardRef(() => UicSearcherComponent),
|
|
1801
1861
|
multi: true
|
|
1802
1862
|
}
|
|
1803
|
-
], 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@if ( !stateless || (!disabled && stateless)) {\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}\" style=\"cursor: pointer;\">\r\n @if (selectedOption == null) { \r\n @if (internalIcon) {\r\n <i [class]=\"'input-internalicon f-'+ 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 [attr.tip]=\"'searcher.clear_tip' | uicTranslate\" (click)=\"triggerSearch()\" size=\"t\" ></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 }@else {\r\n <div class=\"input-container\" >\r\n <div class=\"selected-item\" >\r\n <div class=\"selected-item-text\" [innerHTML]=\"itemDisplayFn?itemDisplayFn(selectedOption):''\"></div> \r\n <ui-button [iconOnly]=\"true\" (click)=\"unselect()\" type=\"ghost\" size=\"t\" icon=\"ri-close-large-line\" color=\"red\"></ui-button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </ui-input-wrapper>\r\n \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\r\n\r\n\r\n", styles: [".selected-item{border-radius:5px;background-color:var(--primary-100);padding-left:10px;height:25px;display:flex;gap:20px;align-items:center;justify-content:space-between}.selected-item-text{overflow:hidden;white-space:nowrap}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.input-options{border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;font-size:.875rem;z-index:500;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.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(--primary-500)}.input-option:hover{background-color:var(--secondary-100);cursor:pointer}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px 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(--grey-200);padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--white);border:solid 1px 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(--grey-700);margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:max(var(--form-ref) + 4px,14px);line-height:1.125rem;min-height:1.125rem;font-weight:400;color: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 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color: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: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: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(--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(--grey-200)}.fakeinput:focus-within{box-shadow:0 0 0 3px var(--secondary-alpha)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-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(--grey-400)}.f-black{color:var(--grey-900)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-400)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,#f2f2f2 40%,#dee1e2,#f2f2f2 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--grey-400)}\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:
|
|
1863
|
+
], 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@if ( !stateless || (!disabled && stateless)) {\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}\" style=\"cursor: pointer;\">\r\n @if (selectedOption == null) { \r\n @if (internalIcon) {\r\n <i [class]=\"'input-internalicon f-'+ 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 [attr.tip]=\"'searcher.clear_tip' | uicTranslate\" (click)=\"triggerSearch()\" size=\"t\" ></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 }@else {\r\n <div class=\"input-container\" >\r\n <div class=\"selected-item\" >\r\n <div class=\"selected-item-text\" [innerHTML]=\"itemDisplayFn?itemDisplayFn(selectedOption):''\"></div> \r\n <ui-button [iconOnly]=\"true\" (click)=\"unselect()\" type=\"ghost\" size=\"t\" icon=\"ri-close-large-line\" color=\"red\"></ui-button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </ui-input-wrapper>\r\n \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\r\n\r\n\r\n", styles: [".selected-item{border-radius:5px;background-color:var(--primary-100);padding-left:10px;height:25px;display:flex;gap:20px;align-items:center;justify-content:space-between}.selected-item-text{overflow:hidden;white-space:nowrap}\n", ":host{width:100%}.input-container{flex:1 1;overflow:hidden}.input-options{border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;font-size:.875rem;z-index:500;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.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(--primary-500)}.input-option:hover{background-color:var(--secondary-100);cursor:pointer}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px 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(--grey-200);padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--white);border:solid 1px 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(--grey-700);margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:max(var(--form-ref) + 4px,14px);line-height:1.125rem;min-height:1.125rem;font-weight:400;color: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 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color: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: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: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(--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(--grey-200)}.fakeinput:focus-within{box-shadow:0 0 0 3px var(--secondary-alpha)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-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(--grey-400)}.f-black{color:var(--grey-900)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-400)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,#f2f2f2 40%,#dee1e2,#f2f2f2 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--grey-400)}\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" }] });
|
|
1804
1864
|
}
|
|
1805
1865
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSearcherComponent, decorators: [{
|
|
1806
1866
|
type: Component,
|
|
@@ -1959,7 +2019,7 @@ class UicMultySelectComponent extends base$5 {
|
|
|
1959
2019
|
useExisting: forwardRef(() => UicMultySelectComponent),
|
|
1960
2020
|
multi: true
|
|
1961
2021
|
}
|
|
1962
|
-
], viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "\r\n<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 (click)=\"openList()\" class=\"fakeinput\" #fakeinput \r\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':loading}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"fakeinput-emptytext\" [class.disabled-placeholder]=\"disabled\" >{{'select.pending_text' | uicTranslate}}</div>\r\n @if (!disabled && !loading) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n <ng-template #dropdownTemplate >\r\n <div class=\"input-options\">\r\n <div class=\"multyoptions-header\">\r\n <ui-checkbox [noPadding]=\"true\"\r\n [ngModel]=\"allSelected\" \r\n (ngModelChange)=\"toggleAll($event)\"\r\n [placeholder]=\"'common.all' | uicTranslate\"></ui-checkbox>\r\n </div>\r\n <!-- OPCIONES -->\r\n <div class=\"input-option-scroll\"> \r\n @for (option of options; track $index) {\r\n <div (click)=\"toggleOption(option.id??option.text)\" class=\"input-multyoption\">\r\n <ui-checkbox \r\n [ngModel]=\"selectedSet.has(option.id??option.text)\"\r\n [noPadding]=\"true\" \r\n [placeholder]=\"option.text\"></ui-checkbox>\r\n </div> \r\n }\r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">{{'select.empty' | uicTranslate}}</div>\r\n }\r\n </div>\r\n <!-- <div class=\"multyoptions-footer\">\r\n <ui-button (click)=\"closeList()\" color=\"black\" type=\"bordered\" size=\"s\">Cancelar</ui-button>\r\n <ui-button (click)=\"applySelection()\" color=\"black\" size=\"s\">Aplicar</ui-button>\r\n </div> -->\r\n </div>\r\n </ng-template>\r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [":host{width:100%}.input-container{flex:1 1;overflow:hidden}.input-options{border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;font-size:.875rem;z-index:500;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.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(--primary-500)}.input-option:hover{background-color:var(--secondary-100);cursor:pointer}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px 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(--grey-200);padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--white);border:solid 1px 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(--grey-700);margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:max(var(--form-ref) + 4px,14px);line-height:1.125rem;min-height:1.125rem;font-weight:400;color: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 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color: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: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: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(--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(--grey-200)}.fakeinput:focus-within{box-shadow:0 0 0 3px var(--secondary-alpha)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-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(--grey-400)}.f-black{color:var(--grey-900)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-400)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,#f2f2f2 40%,#dee1e2,#f2f2f2 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--grey-400)}\n", ".input-multyoption{display:flex;align-items:center;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-multyoption-focused{background-color:var(--primary-500)}.input-multyoption:hover{background-color:var(--secondary-100);cursor:pointer}.multyoptions-header{display:flex;align-items:center;gap:10px;padding:5px 3px;border-bottom:solid 1px var(--grey-300)}.multyoptions-footer{display:flex;padding:4px;justify-content:space-around;border-top:solid 1px var(--grey-300)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type:
|
|
2022
|
+
], viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "\r\n<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 (click)=\"openList()\" class=\"fakeinput\" #fakeinput \r\n [ngClass]=\"{'errorinput':error, 'disabledinput':disabled, 'loading-input':loading}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"fakeinput-emptytext\" [class.disabled-placeholder]=\"disabled\" >{{'select.pending_text' | uicTranslate}}</div>\r\n @if (!disabled && !loading) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n <ng-template #dropdownTemplate >\r\n <div class=\"input-options\">\r\n <div class=\"multyoptions-header\">\r\n <ui-checkbox [noPadding]=\"true\"\r\n [ngModel]=\"allSelected\" \r\n (ngModelChange)=\"toggleAll($event)\"\r\n [placeholder]=\"'common.all' | uicTranslate\"></ui-checkbox>\r\n </div>\r\n <!-- OPCIONES -->\r\n <div class=\"input-option-scroll\"> \r\n @for (option of options; track $index) {\r\n <div (click)=\"toggleOption(option.id??option.text)\" class=\"input-multyoption\">\r\n <ui-checkbox \r\n [ngModel]=\"selectedSet.has(option.id??option.text)\"\r\n [noPadding]=\"true\" \r\n [placeholder]=\"option.text\"></ui-checkbox>\r\n </div> \r\n }\r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">{{'select.empty' | uicTranslate}}</div>\r\n }\r\n </div>\r\n <!-- <div class=\"multyoptions-footer\">\r\n <ui-button (click)=\"closeList()\" color=\"black\" type=\"bordered\" size=\"s\">Cancelar</ui-button>\r\n <ui-button (click)=\"applySelection()\" color=\"black\" size=\"s\">Aplicar</ui-button>\r\n </div> -->\r\n </div>\r\n </ng-template>\r\n </div>\r\n</ui-input-wrapper>\r\n", styles: [":host{width:100%}.input-container{flex:1 1;overflow:hidden}.input-options{border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;font-size:.875rem;z-index:500;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.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(--primary-500)}.input-option:hover{background-color:var(--secondary-100);cursor:pointer}.input-option-scroll{padding:.25rem;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px 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(--grey-200);padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:var(--white);border:solid 1px 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(--grey-700);margin-right:calc(var(--form-ref) * .6);font-size:calc(2.5 * var(--form-ref))}.label{font-size:max(var(--form-ref) + 4px,14px);line-height:1.125rem;min-height:1.125rem;font-weight:400;color: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 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;-webkit-user-select:none;user-select:none;background-color: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: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: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(--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(--grey-200)}.fakeinput:focus-within{box-shadow:0 0 0 3px var(--secondary-alpha)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-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(--grey-400)}.f-black{color:var(--grey-900)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-400)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}.loading-input{background:linear-gradient(-45deg,#f2f2f2 40%,#dee1e2,#f2f2f2 60%);background-size:300%;background-position-x:100%;animation:shimmer 1s infinite linear}@keyframes shimmer{to{background-position-x:0%}}.char-counter{width:100%;display:flex;justify-content:flex-end;font-size:10px;color:var(--grey-400)}\n", ".input-multyoption{display:flex;align-items:center;line-height:1rem;-webkit-user-select:none;user-select:none;transition:ease .3s;border-radius:.25rem}.input-multyoption-focused{background-color:var(--primary-500)}.input-multyoption:hover{background-color:var(--secondary-100);cursor:pointer}.multyoptions-header{display:flex;align-items:center;gap:10px;padding:5px 3px;border-bottom:solid 1px var(--grey-300)}.multyoptions-footer{display:flex;padding:4px;justify-content:space-around;border-top:solid 1px var(--grey-300)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["icon", "iconColor", "label", "tip", "type", "placeholder", "loading", "noPadding", "disabled"] }, { 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: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
1963
2023
|
}
|
|
1964
2024
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicMultySelectComponent, decorators: [{
|
|
1965
2025
|
type: Component,
|
|
@@ -3418,7 +3478,7 @@ class UicDynamicFormComponent {
|
|
|
3418
3478
|
recognition.start();
|
|
3419
3479
|
}
|
|
3420
3480
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDynamicFormComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
3421
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicDynamicFormComponent, isStandalone: true, selector: "ui-dynamic-form", inputs: { fields: "fields", form: "form", disabled: "disabled", voiceToTextSilenceMs: "voiceToTextSilenceMs", cols: "cols" }, ngImport: i0, template: "<div class=\"form\" [ngStyle]=\"{'--cols': cols, '--min': '180px'}\" [formGroup]=\"form\">\r\n @for (field of fields; track field.name) {\r\n <div class=\"col-span-{{field.colSpan || 1}}\" [class.new-line]=\"field.newLine\">\r\n \r\n @if ( ['text','number'].includes(field.type) ) {\r\n @let currentValue = form.get([field.name])?.value ?? '';\r\n @let inputColor = getInputColor(field, currentValue);\r\n <ui-input \r\n [error]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"field.icon??''\"\r\n [disabled]=\"!!form.get([field.name])?.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 [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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"field.icon??''\"\r\n [disabled]=\"!!form.get([field.name])?.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 && !form.get([field.name])?.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 (isListening(field.name)) {\r\n <i class=\"ri-voiceprint-line\"></i>\r\n }\r\n </div>\r\n }\r\n @if (field.showCounter) {\r\n <span counter> {{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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"field.icon??''\"\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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [loading]=\"field.loading??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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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 [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]=\"field.icon??''\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\"\r\n [searchFn]=\"field.searchFn\"\r\n [itemDisplayFn]=\"field.searchDisplayFn\"\r\n [itemIsEnabledFn]=\"field.searchIsEnabledFn\"\r\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\r\n [error]=\"getErrorMessages(field)[0]\"\r\n ></ui-searcher>\r\n }\r\n @else if (field.type === 'file') {\r\n <ui-file-input\r\n [error]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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 [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]=\"field.icon??''\"\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]=\"field.icon??''\"\r\n [tip]=\"field.tip??''\"\r\n [loading]=\"field.loading??false\"\r\n [error]=\"getErrorMessages(field)[0]\"\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]=\"field.icon??''\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n ></ui-slider>\r\n }\r\n @else if (field.type === 'pool') {\r\n <ui-pool-options\r\n [error]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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 [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-pool-options>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;align-items:stretch;gap:1rem;padding-bottom:.75rem}@media (max-width: 479px){.form{grid-template-columns:1fr}.form .col-span-1,.form .col-span-2,.form .col-span-3,.form .col-span-4,.form .col-span-5,.form .col-span-6,.form .col-span-7,.form .col-span-8,.form .col-span-9,.form .col-span-10,.form .col-span-11,.form .col-span-12{grid-column:1/-1}}@media (min-width: 768px){.form{grid-template-columns:repeat(var(--cols),1fr)}}@media (min-width: 480px) and (max-width: 767px){.form{grid-template-columns:repeat(min(var(--cols),2),1fr)}}h2{margin-top:1.5rem}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-6{grid-column:span 6/span 6}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-9{grid-column:span 9/span 9}.col-span-10{grid-column:span 10/span 10}.col-span-11{grid-column:span 11/span 11}.col-span-12{grid-column:span 12/span 12}.speak-icon{display:flex;width:100%;align-items:center;gap:10px}.speak-icon i{font-size:20px;color:var(--primary-500)}.new-line{grid-column-start:1}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: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.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"] }, { 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: 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", "loading", "options"] }, { kind: "component", type: UicFileInputComponent, selector: "ui-file-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading", "multy", "fileTypes"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "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"], outputs: ["clickButton"] }, { 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 }] });
|
|
3481
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicDynamicFormComponent, isStandalone: true, selector: "ui-dynamic-form", inputs: { fields: "fields", form: "form", disabled: "disabled", voiceToTextSilenceMs: "voiceToTextSilenceMs", cols: "cols" }, ngImport: i0, template: "<div class=\"form\" [ngStyle]=\"{'--cols': cols, '--min': '180px'}\" [formGroup]=\"form\">\r\n @for (field of fields; track field.name) {\r\n <div class=\"col-span-{{field.colSpan || 1}}\" [class.new-line]=\"field.newLine\">\r\n \r\n @if ( ['text','number'].includes(field.type) ) {\r\n @let currentValue = form.get([field.name])?.value ?? '';\r\n @let inputColor = getInputColor(field, currentValue);\r\n <ui-input \r\n [error]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"field.icon??''\"\r\n [disabled]=\"!!form.get([field.name])?.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 [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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"field.icon??''\"\r\n [disabled]=\"!!form.get([field.name])?.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 && !form.get([field.name])?.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 (isListening(field.name)) {\r\n <i class=\"ri-voiceprint-line\"></i>\r\n }\r\n </div>\r\n }\r\n @if (field.showCounter) {\r\n <span counter> {{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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [icon]=\"field.icon??''\"\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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\r\n [internalIcon]=\"field.internalIcon??''\"\r\n [internalIconColor]=\"field.internalIconColor??'grey'\"\r\n [loading]=\"field.loading??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]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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 [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]=\"field.icon??''\"\r\n [loading]=\"field.loading??false\"\r\n [tip]=\"field.tip??''\"\r\n [searchFn]=\"field.searchFn\"\r\n [itemDisplayFn]=\"field.searchDisplayFn\"\r\n [itemIsEnabledFn]=\"field.searchIsEnabledFn\"\r\n [placeholder]=\"field.placeholder??'common.search_ellipsis'\"\r\n [error]=\"getErrorMessages(field)[0]\"\r\n ></ui-searcher>\r\n }\r\n @else if (field.type === 'file') {\r\n <ui-file-input\r\n [error]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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 [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]=\"field.icon??''\"\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]=\"field.icon??''\"\r\n [tip]=\"field.tip??''\"\r\n [loading]=\"field.loading??false\"\r\n [error]=\"getErrorMessages(field)[0]\"\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]=\"field.icon??''\"\r\n [tip]=\"field.tip??''\"\r\n [error]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n ></ui-slider>\r\n }\r\n @else if (field.type === 'pool') {\r\n <ui-pool-options\r\n [error]=\"getErrorMessages(field)[0]\"\r\n [label]=\"field.label + (field.required ? ' *' : '')\"\r\n [id]=\"field.name\"\r\n [icon]=\"field.icon??''\"\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 [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-pool-options>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;align-items:stretch;gap:1rem;padding-bottom:.75rem}@media (max-width: 479px){.form{grid-template-columns:1fr}.form .col-span-1,.form .col-span-2,.form .col-span-3,.form .col-span-4,.form .col-span-5,.form .col-span-6,.form .col-span-7,.form .col-span-8,.form .col-span-9,.form .col-span-10,.form .col-span-11,.form .col-span-12{grid-column:1/-1}}@media (min-width: 768px){.form{grid-template-columns:repeat(var(--cols),1fr)}}@media (min-width: 480px) and (max-width: 767px){.form{grid-template-columns:repeat(min(var(--cols),2),1fr)}}h2{margin-top:1.5rem}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-6{grid-column:span 6/span 6}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-9{grid-column:span 9/span 9}.col-span-10{grid-column:span 10/span 10}.col-span-11{grid-column:span 11/span 11}.col-span-12{grid-column:span 12/span 12}.speak-icon{display:flex;width:100%;align-items:center;gap:10px}.speak-icon i{font-size:20px;color:var(--primary-500)}.new-line{grid-column-start:1}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"] }, { 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: 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", "loading", "options"] }, { kind: "component", type: UicFileInputComponent, selector: "ui-file-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading", "multy", "fileTypes"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "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"], outputs: ["clickButton"] }, { 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 }] });
|
|
3422
3482
|
}
|
|
3423
3483
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDynamicFormComponent, decorators: [{
|
|
3424
3484
|
type: Component,
|
|
@@ -3858,7 +3918,7 @@ class UicFormWrapperComponent {
|
|
|
3858
3918
|
};
|
|
3859
3919
|
}
|
|
3860
3920
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3861
|
-
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", loading: "loading", disabled: "disabled", showButtons: "showButtons", fillSelects: "fillSelects", initialValues: "initialValues" }, outputs: { formSubmit: "formSubmit", formChange: "formChange" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n @for (block of effectiveSchema.blocks; track $index) {\r\n \r\n <section class=\"form-block\">\r\n @if (block.title){\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n }\r\n @if (block.subtitle){\r\n <div class=\"block-subtitle\">{{ block.subtitle }}</div>\r\n }\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"effectiveSchema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <ui-dynamic-form\r\n [cols]=\"effectiveSchema.cols\"\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\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-title{font-size:1.625rem;font-weight:600;line-height:calc(1.625rem + 4px);margin:1rem 0;color:var(--grey-950)}.block-subtitle{font-size:1.25rem;font-weight:600;line-height:calc(1.25rem + 4px);margin:.75rem 0;color:var(--grey-950)}.form-buttons{display:flex;gap:10px;width:100%}\n"], dependencies: [{ kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "form", "disabled", "voiceToTextSilenceMs", "cols"] }, { 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:
|
|
3921
|
+
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", loading: "loading", disabled: "disabled", showButtons: "showButtons", fillSelects: "fillSelects", initialValues: "initialValues" }, outputs: { formSubmit: "formSubmit", formChange: "formChange" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n @for (block of effectiveSchema.blocks; track $index) {\r\n \r\n <section class=\"form-block\">\r\n @if (block.title){\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n }\r\n @if (block.subtitle){\r\n <div class=\"block-subtitle\">{{ block.subtitle }}</div>\r\n }\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"effectiveSchema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <ui-dynamic-form\r\n [cols]=\"effectiveSchema.cols\"\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\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-title{font-size:1.625rem;font-weight:600;line-height:calc(1.625rem + 4px);margin:1rem 0;color:var(--grey-950)}.block-subtitle{font-size:1.25rem;font-weight:600;line-height:calc(1.25rem + 4px);margin:.75rem 0;color:var(--grey-950)}.form-buttons{display:flex;gap:10px;width:100%}\n"], dependencies: [{ kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "form", "disabled", "voiceToTextSilenceMs", "cols"] }, { 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"] }] });
|
|
3862
3922
|
}
|
|
3863
3923
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, decorators: [{
|
|
3864
3924
|
type: Component,
|
|
@@ -4191,7 +4251,7 @@ class UicDropdownContainerComponent {
|
|
|
4191
4251
|
provide: DROPDOWN_OVERLAY_CONTROLS,
|
|
4192
4252
|
useExisting: forwardRef(() => UicDropdownContainerComponent),
|
|
4193
4253
|
},
|
|
4194
|
-
], queries: [{ propertyName: "projectedTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true, static: true }], ngImport: i0, template: "\
|
|
4254
|
+
], 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(--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 }] });
|
|
4195
4255
|
}
|
|
4196
4256
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDropdownContainerComponent, decorators: [{
|
|
4197
4257
|
type: Component,
|
|
@@ -4200,7 +4260,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4200
4260
|
provide: DROPDOWN_OVERLAY_CONTROLS,
|
|
4201
4261
|
useExisting: forwardRef(() => UicDropdownContainerComponent),
|
|
4202
4262
|
},
|
|
4203
|
-
], template: "\
|
|
4263
|
+
], 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(--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"] }]
|
|
4204
4264
|
}], propDecorators: { buttonLabel: [{
|
|
4205
4265
|
type: Input
|
|
4206
4266
|
}], disabled: [{
|
|
@@ -4405,7 +4465,7 @@ class UicTableUicSearcherComponent {
|
|
|
4405
4465
|
}
|
|
4406
4466
|
}
|
|
4407
4467
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableUicSearcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4408
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTableUicSearcherComponent, isStandalone: true, selector: "uic-table-searcher", inputs: { placeholder: "placeholder", label: "label", searchOnKeydown: "searchOnKeydown", showButtonText: "showButtonText", showSearchButton: "showSearchButton" }, outputs: { filter: "filter" }, ngImport: i0, template: "\r\n<div class=\"ui-table-searcher\">\r\n <ui-input [internalIcon]=\"!showSearchButton?'ri-search-line':''\">\r\n <input [(ngModel)]=\"text\" type=\"text\" (ngModelChange)=\"updateText()\" (keydown.enter)=\"filter.emit(text)\" [placeholder]=\"placeholder | uicTranslate\">\r\n </ui-input>\r\n @if (showSearchButton) {\r\n <ui-button [iconOnly]=\"!showButtonText\" (click)=\"filter.emit(text)\" color=\"black\" type=\"bordered\" rightIcon=\"showSearchButton ri-search-2-line\" size=\"m\">{{showButtonText?('common.search' | uicTranslate):''}}</ui-button>\r\n }\r\n <ui-button [iconOnly]=\"!showButtonText\" (click)=\"reset()\" color=\"black\" type=\"bordered\" rightIcon=\"ri-eraser-line\" size=\"m\">{{showButtonText?('common.clear' | uicTranslate):''}}</ui-button>\r\n</div>\r\n", styles: [".ui-table-searcher{display:flex;gap:5px;align-items:center}.ui-table-searcher ui-input{min-width:300px;flex:1 1}@media (max-width: 479px){.ui-table-searcher ui-input{min-width:5px}}.ui-table-searcher .fakeinput{display:flex;align-items:center;border:solid 1px var(--grey-200);height:40px;padding:2px 1px 2px 10px;border-radius:8px;transition:ease .3s;width:350px}@media (max-width: 479px){.ui-table-searcher .fakeinput{width:100%}}.ui-table-searcher .fakeinput i{font-size:24px;margin-right:8px}.ui-table-searcher .fakeinput input{width:100%;border:none}.ui-table-searcher .fakeinput:focus-within{box-shadow:0 0 0 3px var(--secondary-alpha)}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type:
|
|
4468
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTableUicSearcherComponent, isStandalone: true, selector: "uic-table-searcher", inputs: { placeholder: "placeholder", label: "label", searchOnKeydown: "searchOnKeydown", showButtonText: "showButtonText", showSearchButton: "showSearchButton" }, outputs: { filter: "filter" }, ngImport: i0, template: "\r\n<div class=\"ui-table-searcher\">\r\n <ui-input [internalIcon]=\"!showSearchButton?'ri-search-line':''\">\r\n <input [(ngModel)]=\"text\" type=\"text\" (ngModelChange)=\"updateText()\" (keydown.enter)=\"filter.emit(text)\" [placeholder]=\"placeholder | uicTranslate\">\r\n </ui-input>\r\n @if (showSearchButton) {\r\n <ui-button [iconOnly]=\"!showButtonText\" (click)=\"filter.emit(text)\" color=\"black\" type=\"bordered\" rightIcon=\"showSearchButton ri-search-2-line\" size=\"m\">{{showButtonText?('common.search' | uicTranslate):''}}</ui-button>\r\n }\r\n <ui-button [iconOnly]=\"!showButtonText\" (click)=\"reset()\" color=\"black\" type=\"bordered\" rightIcon=\"ri-eraser-line\" size=\"m\">{{showButtonText?('common.clear' | uicTranslate):''}}</ui-button>\r\n</div>\r\n", styles: [".ui-table-searcher{display:flex;gap:5px;align-items:center}.ui-table-searcher ui-input{min-width:300px;flex:1 1}@media (max-width: 479px){.ui-table-searcher ui-input{min-width:5px}}.ui-table-searcher .fakeinput{display:flex;align-items:center;border:solid 1px var(--grey-200);height:40px;padding:2px 1px 2px 10px;border-radius:8px;transition:ease .3s;width:350px}@media (max-width: 479px){.ui-table-searcher .fakeinput{width:100%}}.ui-table-searcher .fakeinput i{font-size:24px;margin-right:8px}.ui-table-searcher .fakeinput input{width:100%;border:none}.ui-table-searcher .fakeinput:focus-within{box-shadow:0 0 0 3px var(--secondary-alpha)}\n"], dependencies: [{ 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.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: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"], outputs: ["clickButton"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
4409
4469
|
}
|
|
4410
4470
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableUicSearcherComponent, decorators: [{
|
|
4411
4471
|
type: Component,
|
|
@@ -4598,11 +4658,11 @@ class UicActionButtonComponent {
|
|
|
4598
4658
|
}
|
|
4599
4659
|
}
|
|
4600
4660
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4601
|
-
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=\"black\" [iconOnly]=\"true\" type=\"ghost\" (click)=\"openMenu()\">\r\n</ui-button>\r\n\r\n<!-- Men\u00FA -->\r\n<ng-template #menuTemplate>\r\n <div class=\"action-menu\">\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 (icon) {\r\n <i [class]=\"opt.icon\"></i>\r\n }\r\n <span>{{ opt.label }}</span>\
|
|
4661
|
+
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=\"black\" [iconOnly]=\"true\" type=\"ghost\" (click)=\"openMenu()\">\r\n</ui-button>\r\n\r\n<!-- Men\u00FA -->\r\n<ng-template #menuTemplate>\r\n <div class=\"action-menu\">\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 (icon) {\r\n <i [class]=\"opt.icon\"></i>\r\n }\r\n <span>{{ opt.label | uicTranslate }}</span>\n </div>\n }\n </div>\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: [".action-menu{display:flex;flex-direction:column;max-height:300px;min-width:150px;background:#fff;border:1px solid var(--border-color, #ddd);border-radius:10px;box-shadow:0 2px 6px #00000026}.action-menu-item{padding:2px 8px;cursor:pointer;display:flex;font-size:13px;line-height:24px;font-weight:400;color: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(--grey-300)}.action-menu-item:hover{background:var(--grey-100)}.action-menu-body{overflow-y:auto}.action-menu-footer{border-top:solid 1px var(--grey-300);display:flex;justify-content:space-around;padding:4px;gap:8px}\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" }] });
|
|
4602
4662
|
}
|
|
4603
4663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicActionButtonComponent, decorators: [{
|
|
4604
4664
|
type: Component,
|
|
4605
|
-
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=\"black\" [iconOnly]=\"true\" type=\"ghost\" (click)=\"openMenu()\">\r\n</ui-button>\r\n\r\n<!-- Men\u00FA -->\r\n<ng-template #menuTemplate>\r\n <div class=\"action-menu\">\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 (icon) {\r\n <i [class]=\"opt.icon\"></i>\r\n }\r\n <span>{{ opt.label }}</span>\
|
|
4665
|
+
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=\"black\" [iconOnly]=\"true\" type=\"ghost\" (click)=\"openMenu()\">\r\n</ui-button>\r\n\r\n<!-- Men\u00FA -->\r\n<ng-template #menuTemplate>\r\n <div class=\"action-menu\">\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 (icon) {\r\n <i [class]=\"opt.icon\"></i>\r\n }\r\n <span>{{ opt.label | uicTranslate }}</span>\n </div>\n }\n </div>\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: [".action-menu{display:flex;flex-direction:column;max-height:300px;min-width:150px;background:#fff;border:1px solid var(--border-color, #ddd);border-radius:10px;box-shadow:0 2px 6px #00000026}.action-menu-item{padding:2px 8px;cursor:pointer;display:flex;font-size:13px;line-height:24px;font-weight:400;color: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(--grey-300)}.action-menu-item:hover{background:var(--grey-100)}.action-menu-body{overflow-y:auto}.action-menu-footer{border-top:solid 1px var(--grey-300);display:flex;justify-content:space-around;padding:4px;gap:8px}\n"] }]
|
|
4606
4666
|
}], propDecorators: { icon: [{
|
|
4607
4667
|
type: Input
|
|
4608
4668
|
}], options: [{
|
|
@@ -4729,7 +4789,7 @@ class TinyAlertComponent {
|
|
|
4729
4789
|
this.modalRef.closeFloating(value ? this.response : null);
|
|
4730
4790
|
}
|
|
4731
4791
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TinyAlertComponent, deps: [{ token: MODAL_DATA }, { token: UiModalRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4732
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TinyAlertComponent, isStandalone: true, selector: "ui-tiny-alert", ngImport: i0, template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath) {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }@else{\r\n <i [class]=\"'alert-main-icon icon-'+data.type + ' ' + data.iconChar\" ></i>\r\n }\r\n <div class=\"h3-alert\" [class]=\"'icon-'+data.type\"> {{data.title | uicTranslate}} </div>\r\n \r\n <div class=\"alert-body\" [innerHTML]=\"data.body\"> </div>\
|
|
4792
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TinyAlertComponent, isStandalone: true, selector: "ui-tiny-alert", ngImport: i0, template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath) {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }@else{\r\n <i [class]=\"'alert-main-icon icon-'+data.type + ' ' + data.iconChar\" ></i>\r\n }\r\n <div class=\"h3-alert\" [class]=\"'icon-'+data.type\"> {{data.title | uicTranslate}} </div>\r\n \r\n <div class=\"alert-body\" [innerHTML]=\"data.body | uicTranslate\"> </div>\n \r\n @if ( data.showInput ){\r\n <ui-input>\r\n <input type=\"text\">\r\n </ui-input>\r\n }\r\n\r\n <div class=\"tinyalert-buttons\">\r\n @if (data.showCancelButton) {\r\n <ui-button (click)=\"close(false)\" type=\"bordered\" [color]=\"data.cancelButtonColor??'black'\" size=\"l\"> {{(data.cancelButtonText??'common.cancel') | uicTranslate}} </ui-button>\r\n }\r\n <ui-button (click)=\"close(true)\" [color]=\"data.okButtonColor??'primary'\" size=\"l\"> {{(data.okButtonText??'common.continue') | uicTranslate}} </ui-button>\r\n </div>\r\n \r\n <button class=\"floating-close\" (click)=\"close(false)\" >\r\n <i class=\"ri-close-line\"></i>\r\n </button>\r\n</div>\r\n", styles: [".alert-wrapper{position:relative;display:flex;flex-direction:column;align-items:center;padding:20px 20px 5px;width:400px;max-width:100%;-webkit-user-select:none;user-select:none}.alert-wrapper img{height:88px;margin-bottom:20px}.tinyalert-buttons{padding-top:20px;display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem}.h3-alert{font-size:24px;font-weight:800;margin-bottom:10px}.alert-body{font-size:18px;font-weight:500;line-height:24px;text-align:center;color:var(--grey-700)}.floating-close{position:absolute;top:-10px;right:-20px;background-color:transparent;font-size:28px;border:none;cursor:pointer;transition:ease .3s}.floating-close:hover{color:var(--red-500)}@media (max-width: 479px){.floating-close{top:0;right:-5px}}.alert-main-icon{font-size:80px;line-height:80px;margin-bottom:10px}.icon-error{color:var(--red-500)}.icon-delete{color:var(--red-800)}.icon-warning{color:var(--yellow-500)}.icon-info{color:var(--blue-800)}.icon-success{color:var(--green-500)}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"], outputs: ["clickButton"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
4733
4793
|
}
|
|
4734
4794
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TinyAlertComponent, decorators: [{
|
|
4735
4795
|
type: Component,
|
|
@@ -4737,7 +4797,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4737
4797
|
UicButtonComponent,
|
|
4738
4798
|
UicInputComponent,
|
|
4739
4799
|
UicTranslatePipe
|
|
4740
|
-
], template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath) {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }@else{\r\n <i [class]=\"'alert-main-icon icon-'+data.type + ' ' + data.iconChar\" ></i>\r\n }\r\n <div class=\"h3-alert\" [class]=\"'icon-'+data.type\"> {{data.title | uicTranslate}} </div>\r\n \r\n <div class=\"alert-body\" [innerHTML]=\"data.body\"> </div>\
|
|
4800
|
+
], template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath) {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }@else{\r\n <i [class]=\"'alert-main-icon icon-'+data.type + ' ' + data.iconChar\" ></i>\r\n }\r\n <div class=\"h3-alert\" [class]=\"'icon-'+data.type\"> {{data.title | uicTranslate}} </div>\r\n \r\n <div class=\"alert-body\" [innerHTML]=\"data.body | uicTranslate\"> </div>\n \r\n @if ( data.showInput ){\r\n <ui-input>\r\n <input type=\"text\">\r\n </ui-input>\r\n }\r\n\r\n <div class=\"tinyalert-buttons\">\r\n @if (data.showCancelButton) {\r\n <ui-button (click)=\"close(false)\" type=\"bordered\" [color]=\"data.cancelButtonColor??'black'\" size=\"l\"> {{(data.cancelButtonText??'common.cancel') | uicTranslate}} </ui-button>\r\n }\r\n <ui-button (click)=\"close(true)\" [color]=\"data.okButtonColor??'primary'\" size=\"l\"> {{(data.okButtonText??'common.continue') | uicTranslate}} </ui-button>\r\n </div>\r\n \r\n <button class=\"floating-close\" (click)=\"close(false)\" >\r\n <i class=\"ri-close-line\"></i>\r\n </button>\r\n</div>\r\n", styles: [".alert-wrapper{position:relative;display:flex;flex-direction:column;align-items:center;padding:20px 20px 5px;width:400px;max-width:100%;-webkit-user-select:none;user-select:none}.alert-wrapper img{height:88px;margin-bottom:20px}.tinyalert-buttons{padding-top:20px;display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem}.h3-alert{font-size:24px;font-weight:800;margin-bottom:10px}.alert-body{font-size:18px;font-weight:500;line-height:24px;text-align:center;color:var(--grey-700)}.floating-close{position:absolute;top:-10px;right:-20px;background-color:transparent;font-size:28px;border:none;cursor:pointer;transition:ease .3s}.floating-close:hover{color:var(--red-500)}@media (max-width: 479px){.floating-close{top:0;right:-5px}}.alert-main-icon{font-size:80px;line-height:80px;margin-bottom:10px}.icon-error{color:var(--red-500)}.icon-delete{color:var(--red-800)}.icon-warning{color:var(--yellow-500)}.icon-info{color:var(--blue-800)}.icon-success{color:var(--green-500)}\n"] }]
|
|
4741
4801
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4742
4802
|
type: Inject,
|
|
4743
4803
|
args: [MODAL_DATA]
|
|
@@ -4787,11 +4847,11 @@ class UicModalComponent {
|
|
|
4787
4847
|
this.modalRef.closeFloating(null);
|
|
4788
4848
|
}
|
|
4789
4849
|
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 });
|
|
4790
|
-
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()\"> \
|
|
4850
|
+
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:#00000080;-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(--white);border-radius:20px;min-width:300px;max-width:90%;height:fit-content;max-height:90vh;box-shadow:0 20px 70px #00000052;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] });
|
|
4791
4851
|
}
|
|
4792
4852
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicModalComponent, decorators: [{
|
|
4793
4853
|
type: Component,
|
|
4794
|
-
args: [{ selector: 'ui-modal', imports: [CommonModule, PortalModule, UicButtonComponent], animations: [pushTop], template: "<div class=\"uic_backdrop\" (click)=\"closeOuside()\"> \
|
|
4854
|
+
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:#00000080;-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(--white);border-radius:20px;min-width:300px;max-width:90%;height:fit-content;max-height:90vh;box-shadow:0 20px 70px #00000052;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"] }]
|
|
4795
4855
|
}], ctorParameters: () => [{ type: UiModalRef, decorators: [{
|
|
4796
4856
|
type: Inject,
|
|
4797
4857
|
args: [UiModalRef]
|
|
@@ -4894,7 +4954,7 @@ class UicSideModalComponent {
|
|
|
4894
4954
|
this.modal.triggerSave();
|
|
4895
4955
|
}
|
|
4896
4956
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSideModalComponent, deps: [{ token: UiModalRef }, { token: MODAL_COMPONENT }, { token: MODAL_CONFIG }, { token: i0.Injector }, { token: UicModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4897
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSideModalComponent, isStandalone: true, selector: "ui-side-modal", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], ngImport: i0, template: "<div [@fadeBackdrop]=\"state\" class=\"backdrop\" (click)=\"closeOuside()\"> \r\n</div>\r\n<div [@sideModal]=\"state\" \r\n (@sideModal.done)=\"onAnimationDone($event)\" \r\n class=\"sidemodal\" \r\n [style.width]=\"myConfig.width??'60%'\" \r\n (click)=\"$event.stopPropagation()\">\r\n @if (myConfig.headerEnabled) {\r\n <div class=\"modal-header\">\r\n <div class=\"modal-header-title\">\r\n <div class=\"f-title\">{{myConfig.title}}</div>\r\n <div class=\"f-subtitle\">{{myConfig.subtitle}}</div>\r\n </div>\r\n <ui-button class=\"close-icon\" (click)=\"close()\" icon=\"ri-close-large-line\" type=\"ghost\" color=\"black\" [iconOnly]=\"true\" size=\"m\"></ui-button>\r\n </div>\r\n }\r\n <div class=\"sidemodal-body\" [class.nopadding]=\"myConfig.noPadding\" >\r\n <ng-template cdkPortalOutlet></ng-template>\r\n </div>\r\n @if (myConfig.footerEnabled) {\r\n <div class=\"sidemodal-footer\">\r\n @if (myConfig.showCancelButton) {\r\n <ui-button (click)=\"cancel()\" color=\"black\" size=\"l\" type=\"bordered\" [icon]=\"myConfig.footerCancelIcon??'ri-close-line'\">{{(myConfig.footerCancelButtonText??'modal.cancel') | uicTranslate}}</ui-button>\r\n }\r\n <ui-button (click)=\"save()\" color=\"black\" size=\"l\" [rightIcon]=\"myConfig.footerOkIcon??'ri-check-line'\">{{(myConfig.footerOkButtonText??'modal.next') | uicTranslate}}</ui-button>\r\n </div>\r\n }\r\n</div>\r\n", styles: ["::ng-deep .side-modal-panel{position:fixed!important;top:0;right:0;height:100%;width:400px;background:#fff;z-index:2000;box-shadow:-2px 0 8px #0003;display:flex;flex-direction:column}.modal-header{width:100%;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--grey-100);padding:5px}.modal-header-title{font-size:20px;font-weight:600;padding-left:20px}@media (max-width: 479px){.modal-header{right:10px;top:10px}}.f-subtitle{font-weight:400;font-size:16px;color:var(--grey-500)}.backdrop{position:fixed;inset:0;width:100%;height:100vh;background-color:#00000080;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);display:flex;justify-content:flex-end}.sidemodal{position:fixed;right:0;top:0;height:100%;background-color:var(--white);display:flex;flex-direction:column}@media (max-width: 479px){.sidemodal{width:100%!important}}@media (min-width: 480px) and (max-width: 767px){.sidemodal{width:90%!important}}.sidemodal-header{height:30px;width:100%;padding:0 30px;display:flex;align-items:center;justify-content:space-between}.sidemodal-body{flex:1;overflow-y:auto;padding:25px}@media (max-width: 479px){.sidemodal-body{padding:10px}}.sidemodal-footer{height:calc(7 * var(--design-size-ref));padding:0 calc(2 * var(--design-size-ref));width:100%;display:flex;align-items:center;gap:8px;justify-content:flex-end;border-top:1px solid var(--grey-300)}.nopadding{padding:0}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1$
|
|
4957
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSideModalComponent, isStandalone: true, selector: "ui-side-modal", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], ngImport: i0, template: "<div [@fadeBackdrop]=\"state\" class=\"backdrop\" (click)=\"closeOuside()\"> \r\n</div>\r\n<div [@sideModal]=\"state\" \r\n (@sideModal.done)=\"onAnimationDone($event)\" \r\n class=\"sidemodal\" \r\n [style.width]=\"myConfig.width??'60%'\" \r\n (click)=\"$event.stopPropagation()\">\r\n @if (myConfig.headerEnabled) {\r\n <div class=\"modal-header\">\r\n <div class=\"modal-header-title\">\r\n <div class=\"f-title\">{{myConfig.title}}</div>\r\n <div class=\"f-subtitle\">{{myConfig.subtitle}}</div>\r\n </div>\r\n <ui-button class=\"close-icon\" (click)=\"close()\" icon=\"ri-close-large-line\" type=\"ghost\" color=\"black\" [iconOnly]=\"true\" size=\"m\"></ui-button>\r\n </div>\r\n }\r\n <div class=\"sidemodal-body\" [class.nopadding]=\"myConfig.noPadding\" >\r\n <ng-template cdkPortalOutlet></ng-template>\r\n </div>\r\n @if (myConfig.footerEnabled) {\r\n <div class=\"sidemodal-footer\">\r\n @if (myConfig.showCancelButton) {\r\n <ui-button (click)=\"cancel()\" color=\"black\" size=\"l\" type=\"bordered\" [icon]=\"myConfig.footerCancelIcon??'ri-close-line'\">{{(myConfig.footerCancelButtonText??'modal.cancel') | uicTranslate}}</ui-button>\r\n }\r\n <ui-button (click)=\"save()\" color=\"black\" size=\"l\" [rightIcon]=\"myConfig.footerOkIcon??'ri-check-line'\">{{(myConfig.footerOkButtonText??'modal.next') | uicTranslate}}</ui-button>\r\n </div>\r\n }\r\n</div>\r\n", styles: ["::ng-deep .side-modal-panel{position:fixed!important;top:0;right:0;height:100%;width:400px;background:#fff;z-index:2000;box-shadow:-2px 0 8px #0003;display:flex;flex-direction:column}.modal-header{width:100%;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--grey-100);padding:5px}.modal-header-title{font-size:20px;font-weight:600;padding-left:20px}@media (max-width: 479px){.modal-header{right:10px;top:10px}}.f-subtitle{font-weight:400;font-size:16px;color:var(--grey-500)}.backdrop{position:fixed;inset:0;width:100%;height:100vh;background-color:#00000080;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);display:flex;justify-content:flex-end}.sidemodal{position:fixed;right:0;top:0;height:100%;background-color:var(--white);display:flex;flex-direction:column}@media (max-width: 479px){.sidemodal{width:100%!important}}@media (min-width: 480px) and (max-width: 767px){.sidemodal{width:90%!important}}.sidemodal-header{height:30px;width:100%;padding:0 30px;display:flex;align-items:center;justify-content:space-between}.sidemodal-body{flex:1;overflow-y:auto;padding:25px}@media (max-width: 479px){.sidemodal-body{padding:10px}}.sidemodal-footer{height:calc(7 * var(--design-size-ref));padding:0 calc(2 * var(--design-size-ref));width:100%;display:flex;align-items:center;gap:8px;justify-content:flex-end;border-top:1px solid var(--grey-300)}.nopadding{padding:0}\n"], dependencies: [{ 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"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }], animations: [sideModal, fadeBackdrop] });
|
|
4898
4958
|
}
|
|
4899
4959
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSideModalComponent, decorators: [{
|
|
4900
4960
|
type: Component,
|
|
@@ -5510,7 +5570,7 @@ class UicTableComponent {
|
|
|
5510
5570
|
return `${a ?? ''}` === `${b ?? ''}`;
|
|
5511
5571
|
}
|
|
5512
5572
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5513
|
-
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 [tip]=\"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:#fff}.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(--grey-400)}.ui-table th .ui-th-wrap div:hover{color:var(--primary-500)}.ui-table td{font-size:14px;color: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(--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:#fff;align-items:center;color:var(--grey-900);border-bottom:solid 1px var(--table-border-color)}.ui-table-topbar p{font-size:14px;font-weight:400;color: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(--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(--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(--grey-900)}.ui-trc-grey{color:var(--grey-300)}.clickable-row{cursor:pointer}.ui-row-loader{background:linear-gradient(90deg,var(--grey-100) 25%,var(--grey-200) 50%,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:#fff}.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}}\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: "[tip]", inputs: ["tip"] }, { 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"], outputs: ["clickButton"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "loading", "nullable", "options"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], animations: [highlightRow, animatedRow] });
|
|
5573
|
+
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 [tip]=\"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:#fff}.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(--grey-400)}.ui-table th .ui-th-wrap div:hover{color:var(--primary-500)}.ui-table td{font-size:14px;color: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(--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:#fff;align-items:center;color:var(--grey-900);border-bottom:solid 1px var(--table-border-color)}.ui-table-topbar p{font-size:14px;font-weight:400;color: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(--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(--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(--grey-900)}.ui-trc-grey{color:var(--grey-300)}.clickable-row{cursor:pointer}.ui-row-loader{background:linear-gradient(90deg,var(--grey-100) 25%,var(--grey-200) 50%,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:#fff}.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}}\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: "[tip]", inputs: ["tip"] }, { 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"], outputs: ["clickButton"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "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] });
|
|
5514
5574
|
}
|
|
5515
5575
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, decorators: [{
|
|
5516
5576
|
type: Component,
|
|
@@ -5629,11 +5689,11 @@ class UicSkeletonCardsComponent {
|
|
|
5629
5689
|
return this.cards > 0 ? this.cards : 0;
|
|
5630
5690
|
}
|
|
5631
5691
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSkeletonCardsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5632
|
-
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\">\
|
|
5692
|
+
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(--grey-100) 25%,var(--grey-200) 50%,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"] }] });
|
|
5633
5693
|
}
|
|
5634
5694
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSkeletonCardsComponent, decorators: [{
|
|
5635
5695
|
type: Component,
|
|
5636
|
-
args: [{ selector: 'ui-skeleton-cards', imports: [CommonModule], template: "<div class=\"skeleton-cards-grid\" [ngStyle]=\"gridStyle\">\
|
|
5696
|
+
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(--grey-100) 25%,var(--grey-200) 50%,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"] }]
|
|
5637
5697
|
}], propDecorators: { cards: [{
|
|
5638
5698
|
type: Input
|
|
5639
5699
|
}], gap: [{
|
|
@@ -6547,25 +6607,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
6547
6607
|
args: ['parentNameInput']
|
|
6548
6608
|
}] } });
|
|
6549
6609
|
|
|
6550
|
-
|
|
6610
|
+
const DEFAULT_CONFIG = {
|
|
6611
|
+
canAddRow: true,
|
|
6612
|
+
canDeleteRow: true,
|
|
6613
|
+
canAddColumn: true,
|
|
6614
|
+
canDeleteColumn: true,
|
|
6615
|
+
resizeableColumns: true
|
|
6616
|
+
};
|
|
6617
|
+
class UicEditableTableComponent {
|
|
6551
6618
|
hostElement;
|
|
6619
|
+
actionColumnWidth = 30;
|
|
6620
|
+
config = input({});
|
|
6621
|
+
columnsConfig = input({});
|
|
6622
|
+
resolvedConfig = computed(() => ({
|
|
6623
|
+
...DEFAULT_CONFIG,
|
|
6624
|
+
...this.config()
|
|
6625
|
+
}));
|
|
6626
|
+
rowActions = computed(() => {
|
|
6627
|
+
const actions = [];
|
|
6628
|
+
if (this.resolvedConfig().canAddRow) {
|
|
6629
|
+
actions.push({ id: 'TOP', label: 'editable_table.add_row_above' }, { id: 'BOTTOM', label: 'editable_table.add_row_below' });
|
|
6630
|
+
}
|
|
6631
|
+
if (this.resolvedConfig().canDeleteRow) {
|
|
6632
|
+
actions.push({ id: 'DELETE', label: 'editable_table.delete_row' });
|
|
6633
|
+
}
|
|
6634
|
+
return actions;
|
|
6635
|
+
});
|
|
6552
6636
|
constructor(hostElement) {
|
|
6553
6637
|
this.hostElement = hostElement;
|
|
6554
6638
|
}
|
|
6555
|
-
headerFormat = 'none';
|
|
6556
|
-
title = '';
|
|
6557
|
-
_visibleRowsStep = 50;
|
|
6558
6639
|
_record = [];
|
|
6559
|
-
|
|
6640
|
+
tinyAlert = inject(UicTinyAlertService);
|
|
6641
|
+
translateService = inject(UicTranslateService);
|
|
6642
|
+
_visibleRowsStep = signal(50);
|
|
6643
|
+
rowsSignal = signal([]);
|
|
6644
|
+
headersSignal = signal([]);
|
|
6645
|
+
visibleRowsCountSignal = signal(0);
|
|
6646
|
+
columnWidthsSignal = signal([]);
|
|
6647
|
+
columnConfigsSignal = signal({});
|
|
6560
6648
|
set visibleRowsStep(value) {
|
|
6561
6649
|
const numericValue = Number(value);
|
|
6562
|
-
this._visibleRowsStep
|
|
6650
|
+
this._visibleRowsStep.set(Number.isFinite(numericValue) && numericValue > 0
|
|
6563
6651
|
? Math.floor(numericValue)
|
|
6564
|
-
: 50;
|
|
6652
|
+
: 50);
|
|
6565
6653
|
this.syncVisibleRows(false);
|
|
6566
6654
|
}
|
|
6567
6655
|
get visibleRowsStep() {
|
|
6568
|
-
return this._visibleRowsStep;
|
|
6656
|
+
return this._visibleRowsStep();
|
|
6569
6657
|
}
|
|
6570
6658
|
set record(value) {
|
|
6571
6659
|
const normalizedRows = Array.isArray(value)
|
|
@@ -6574,130 +6662,317 @@ class UicExcelTableComponent {
|
|
|
6574
6662
|
this._record = normalizedRows;
|
|
6575
6663
|
this.rows = normalizedRows;
|
|
6576
6664
|
this.headers = this.buildHeadersFromRows(this.rows);
|
|
6577
|
-
this.
|
|
6665
|
+
this.syncColumnWidths(this.headers.length);
|
|
6578
6666
|
this.syncVisibleRows(false);
|
|
6579
6667
|
}
|
|
6580
6668
|
get record() {
|
|
6581
6669
|
return this._record;
|
|
6582
6670
|
}
|
|
6583
|
-
headers
|
|
6584
|
-
|
|
6585
|
-
jsonData = [];
|
|
6586
|
-
fileName = '';
|
|
6587
|
-
recordChange = new EventEmitter();
|
|
6588
|
-
get visibleRows() {
|
|
6589
|
-
return this.rows.slice(0, this.visibleRowsCount);
|
|
6671
|
+
get headers() {
|
|
6672
|
+
return this.headersSignal();
|
|
6590
6673
|
}
|
|
6591
|
-
|
|
6592
|
-
|
|
6674
|
+
set headers(value) {
|
|
6675
|
+
this.headersSignal.set(value);
|
|
6593
6676
|
}
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6677
|
+
get rows() {
|
|
6678
|
+
return this.rowsSignal();
|
|
6679
|
+
}
|
|
6680
|
+
set rows(value) {
|
|
6681
|
+
this.rowsSignal.set(value);
|
|
6682
|
+
}
|
|
6683
|
+
get visibleRowsCount() {
|
|
6684
|
+
return this.visibleRowsCountSignal();
|
|
6685
|
+
}
|
|
6686
|
+
set visibleRowsCount(value) {
|
|
6687
|
+
this.visibleRowsCountSignal.set(value);
|
|
6688
|
+
}
|
|
6689
|
+
get columnWidths() {
|
|
6690
|
+
return this.columnWidthsSignal();
|
|
6691
|
+
}
|
|
6692
|
+
set columnWidths(value) {
|
|
6693
|
+
this.columnWidthsSignal.set(value);
|
|
6694
|
+
}
|
|
6695
|
+
defaultColumnWidth = 160;
|
|
6696
|
+
minColumnWidth = 80;
|
|
6697
|
+
resizingColumn = null;
|
|
6698
|
+
recordChange = new EventEmitter();
|
|
6699
|
+
visibleRows = computed(() => this.rows.slice(0, this.visibleRowsCount));
|
|
6700
|
+
hasMoreRows = computed(() => this.visibleRowsCount < this.rows.length);
|
|
6701
|
+
async deleteColum(header) {
|
|
6702
|
+
const hasData = this.hasDataInColumn(header);
|
|
6703
|
+
if (hasData) {
|
|
6704
|
+
const response = await this.tinyAlert.showAlert({
|
|
6705
|
+
body: this.translateService.translate('editable_table.delete_column_with_data_warning', { column_name: header }),
|
|
6706
|
+
title: 'editable_table.delete_column',
|
|
6707
|
+
okButtonText: 'editable_table.delete',
|
|
6708
|
+
cancelButtonText: 'common.cancel',
|
|
6709
|
+
okButtonColor: 'red',
|
|
6710
|
+
showCancelButton: true,
|
|
6615
6711
|
});
|
|
6616
|
-
if (!
|
|
6617
|
-
this.resetData();
|
|
6712
|
+
if (!response.value) {
|
|
6618
6713
|
return;
|
|
6619
6714
|
}
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
});
|
|
6635
|
-
return record;
|
|
6636
|
-
});
|
|
6637
|
-
this.emitTableDataChanges(true);
|
|
6638
|
-
};
|
|
6639
|
-
reader.readAsArrayBuffer(file);
|
|
6640
|
-
input.value = '';
|
|
6641
|
-
}
|
|
6642
|
-
resetData() {
|
|
6643
|
-
this.headers = [];
|
|
6644
|
-
this.rows = [];
|
|
6645
|
-
this.emitTableDataChanges(true);
|
|
6646
|
-
}
|
|
6647
|
-
deleteColum(headerKey) {
|
|
6648
|
-
this.headers = this.headers.filter((header) => header !== headerKey);
|
|
6715
|
+
}
|
|
6716
|
+
const headerIndex = this.headers.indexOf(header);
|
|
6717
|
+
this.headers = this.headers.filter((item) => item !== header);
|
|
6718
|
+
this.columnConfigsSignal.update((configs) => {
|
|
6719
|
+
const next = { ...configs };
|
|
6720
|
+
delete next[header];
|
|
6721
|
+
return next;
|
|
6722
|
+
});
|
|
6723
|
+
if (headerIndex >= 0) {
|
|
6724
|
+
this.columnWidths = [
|
|
6725
|
+
...this.columnWidths.slice(0, headerIndex),
|
|
6726
|
+
...this.columnWidths.slice(headerIndex + 1)
|
|
6727
|
+
];
|
|
6728
|
+
}
|
|
6649
6729
|
this.rows = this.rows.map((row) => {
|
|
6650
|
-
const { [
|
|
6730
|
+
const { [header]: _removed, ...rest } = row;
|
|
6651
6731
|
return rest;
|
|
6652
6732
|
});
|
|
6653
6733
|
this.emitTableDataChanges();
|
|
6654
6734
|
}
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6735
|
+
hasDataInColumn(header) {
|
|
6736
|
+
return this.rows.some((row) => {
|
|
6737
|
+
const rawValue = row[header];
|
|
6738
|
+
if (rawValue === null || rawValue === undefined) {
|
|
6739
|
+
return false;
|
|
6740
|
+
}
|
|
6741
|
+
return String(rawValue).trim() !== '';
|
|
6659
6742
|
});
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6743
|
+
}
|
|
6744
|
+
pendingColumnIndex = null;
|
|
6745
|
+
pendingColumnName = '';
|
|
6746
|
+
confirmingPendingColumn = false;
|
|
6747
|
+
addColumAfert(idx) {
|
|
6748
|
+
if (!this.resolvedConfig().canAddColumn) {
|
|
6749
|
+
return;
|
|
6750
|
+
}
|
|
6751
|
+
const insertAt = Math.min(Math.max(idx + 1, 0), this.headers.length);
|
|
6752
|
+
if (this.pendingColumnIndex !== null) {
|
|
6753
|
+
this.cancelPendingColumn();
|
|
6754
|
+
}
|
|
6755
|
+
this.pendingColumnIndex = insertAt;
|
|
6756
|
+
this.pendingColumnName = '';
|
|
6757
|
+
this.headers = [
|
|
6758
|
+
...this.headers.slice(0, insertAt),
|
|
6759
|
+
'',
|
|
6760
|
+
...this.headers.slice(insertAt),
|
|
6667
6761
|
];
|
|
6668
|
-
this.
|
|
6762
|
+
this.columnWidths = [
|
|
6763
|
+
...this.columnWidths.slice(0, insertAt),
|
|
6764
|
+
this.defaultColumnWidth,
|
|
6765
|
+
...this.columnWidths.slice(insertAt)
|
|
6766
|
+
];
|
|
6767
|
+
setTimeout(() => {
|
|
6768
|
+
this.focusPendingColumnInput();
|
|
6769
|
+
});
|
|
6669
6770
|
}
|
|
6670
|
-
|
|
6671
|
-
if (
|
|
6771
|
+
async onPendingColumnNameBlur() {
|
|
6772
|
+
if (this.pendingColumnIndex === null || this.confirmingPendingColumn) {
|
|
6672
6773
|
return;
|
|
6673
6774
|
}
|
|
6674
|
-
|
|
6675
|
-
|
|
6775
|
+
const newName = this.pendingColumnName.trim();
|
|
6776
|
+
if (!newName) {
|
|
6777
|
+
this.cancelPendingColumn();
|
|
6778
|
+
return;
|
|
6779
|
+
}
|
|
6780
|
+
this.confirmingPendingColumn = true;
|
|
6781
|
+
try {
|
|
6782
|
+
const response = await this.tinyAlert.showAlert({
|
|
6783
|
+
body: 'editable_table.save_or_discard_column',
|
|
6784
|
+
title: 'editable_table.save_column',
|
|
6785
|
+
okButtonText: 'editable_table.save',
|
|
6786
|
+
cancelButtonText: 'editable_table.delete',
|
|
6787
|
+
showCancelButton: true,
|
|
6788
|
+
okButtonColor: 'green'
|
|
6789
|
+
});
|
|
6790
|
+
if (response.value) {
|
|
6791
|
+
this.confirmPendingColumnName();
|
|
6792
|
+
}
|
|
6793
|
+
else {
|
|
6794
|
+
this.cancelPendingColumn();
|
|
6795
|
+
}
|
|
6796
|
+
}
|
|
6797
|
+
finally {
|
|
6798
|
+
setTimeout(() => {
|
|
6799
|
+
this.confirmingPendingColumn = false;
|
|
6800
|
+
});
|
|
6801
|
+
}
|
|
6676
6802
|
}
|
|
6677
|
-
|
|
6803
|
+
onPendingColumnCheckMouseDown() {
|
|
6804
|
+
this.confirmingPendingColumn = true;
|
|
6805
|
+
}
|
|
6806
|
+
onPendingColumnNameKeydown(event) {
|
|
6807
|
+
if (event.key === 'Enter') {
|
|
6808
|
+
event.preventDefault();
|
|
6809
|
+
this.confirmPendingColumnName();
|
|
6810
|
+
return;
|
|
6811
|
+
}
|
|
6812
|
+
if (event.key === 'Escape') {
|
|
6813
|
+
event.preventDefault();
|
|
6814
|
+
this.cancelPendingColumn();
|
|
6815
|
+
return;
|
|
6816
|
+
}
|
|
6817
|
+
}
|
|
6818
|
+
async confirmPendingColumnName() {
|
|
6819
|
+
if (this.pendingColumnIndex === null) {
|
|
6820
|
+
return;
|
|
6821
|
+
}
|
|
6822
|
+
const newName = this.pendingColumnName.trim();
|
|
6823
|
+
if (!newName) {
|
|
6824
|
+
this.cancelPendingColumn();
|
|
6825
|
+
return;
|
|
6826
|
+
}
|
|
6827
|
+
const exists = this.headers.some((header, index) => index !== this.pendingColumnIndex && header.toLowerCase() === newName.toLowerCase());
|
|
6828
|
+
if (exists) {
|
|
6829
|
+
this.confirmingPendingColumn = true;
|
|
6830
|
+
await this.tinyAlert.error('editable_table.column_name_must_be_unique');
|
|
6831
|
+
setTimeout(() => {
|
|
6832
|
+
this.confirmingPendingColumn = false;
|
|
6833
|
+
});
|
|
6834
|
+
setTimeout(() => {
|
|
6835
|
+
this.focusPendingColumnInput();
|
|
6836
|
+
});
|
|
6837
|
+
return;
|
|
6838
|
+
}
|
|
6839
|
+
this.headers = this.headers.map((header, index) => {
|
|
6840
|
+
if (index === this.pendingColumnIndex) {
|
|
6841
|
+
return newName;
|
|
6842
|
+
}
|
|
6843
|
+
return header;
|
|
6844
|
+
});
|
|
6845
|
+
this.rows = this.rows.map((row) => ({
|
|
6846
|
+
...row,
|
|
6847
|
+
[newName]: ''
|
|
6848
|
+
}));
|
|
6849
|
+
this.columnConfigsSignal.update((configs) => ({
|
|
6850
|
+
...configs,
|
|
6851
|
+
[newName]: this.normalizeProvidedColumnConfig(this.columnsConfig()[newName])
|
|
6852
|
+
}));
|
|
6853
|
+
this.pendingColumnIndex = null;
|
|
6854
|
+
this.pendingColumnName = '';
|
|
6678
6855
|
this.emitTableDataChanges();
|
|
6679
6856
|
}
|
|
6680
|
-
|
|
6681
|
-
this.
|
|
6857
|
+
onPendingColumnNameChange(value) {
|
|
6858
|
+
this.pendingColumnName = value;
|
|
6682
6859
|
}
|
|
6683
|
-
|
|
6684
|
-
if (
|
|
6685
|
-
event.target.blur();
|
|
6860
|
+
cancelPendingColumn() {
|
|
6861
|
+
if (this.pendingColumnIndex === null) {
|
|
6686
6862
|
return;
|
|
6687
6863
|
}
|
|
6688
|
-
|
|
6689
|
-
|
|
6864
|
+
this.headers = [
|
|
6865
|
+
...this.headers.slice(0, this.pendingColumnIndex),
|
|
6866
|
+
...this.headers.slice(this.pendingColumnIndex + 1)
|
|
6867
|
+
];
|
|
6868
|
+
this.columnWidths = [
|
|
6869
|
+
...this.columnWidths.slice(0, this.pendingColumnIndex),
|
|
6870
|
+
...this.columnWidths.slice(this.pendingColumnIndex + 1)
|
|
6871
|
+
];
|
|
6872
|
+
this.pendingColumnIndex = null;
|
|
6873
|
+
this.pendingColumnName = '';
|
|
6874
|
+
}
|
|
6875
|
+
startColumnResize(event, headerIndex) {
|
|
6876
|
+
event.preventDefault();
|
|
6877
|
+
const startX = event.clientX;
|
|
6878
|
+
const startWidth = this.columnWidths[headerIndex] ?? this.defaultColumnWidth;
|
|
6879
|
+
const pointerId = event.pointerId;
|
|
6880
|
+
const moveTarget = event.currentTarget;
|
|
6881
|
+
if (!moveTarget) {
|
|
6882
|
+
return;
|
|
6883
|
+
}
|
|
6884
|
+
this.resizingColumn = headerIndex;
|
|
6885
|
+
moveTarget.setPointerCapture(pointerId);
|
|
6886
|
+
const onMove = (moveEvent) => {
|
|
6887
|
+
if (this.resizingColumn !== headerIndex) {
|
|
6888
|
+
return;
|
|
6889
|
+
}
|
|
6890
|
+
const nextWidth = Math.max(this.minColumnWidth, Math.floor(startWidth + (moveEvent.clientX - startX)));
|
|
6891
|
+
const nextColumnWidths = [...this.columnWidths];
|
|
6892
|
+
nextColumnWidths[headerIndex] = nextWidth;
|
|
6893
|
+
this.columnWidths = nextColumnWidths;
|
|
6894
|
+
};
|
|
6895
|
+
const onUp = () => {
|
|
6896
|
+
this.resizingColumn = null;
|
|
6897
|
+
moveTarget.releasePointerCapture(pointerId);
|
|
6898
|
+
window.removeEventListener('pointermove', onMove);
|
|
6899
|
+
window.removeEventListener('pointerup', onUp);
|
|
6900
|
+
};
|
|
6901
|
+
window.addEventListener('pointermove', onMove);
|
|
6902
|
+
window.addEventListener('pointerup', onUp);
|
|
6903
|
+
}
|
|
6904
|
+
columnInputTypeByHeader = computed(() => {
|
|
6905
|
+
const headers = this.headers;
|
|
6906
|
+
const externalConfig = this.columnsConfig();
|
|
6907
|
+
const localConfig = this.columnConfigsSignal();
|
|
6908
|
+
const values = {};
|
|
6909
|
+
headers.forEach((header) => {
|
|
6910
|
+
values[header] = this.normalizeColumnInputType(externalConfig[header]?.type)
|
|
6911
|
+
?? this.normalizeColumnInputType(localConfig[header]?.type)
|
|
6912
|
+
?? 'text';
|
|
6913
|
+
});
|
|
6914
|
+
return values;
|
|
6915
|
+
});
|
|
6916
|
+
columnDisabledByHeader = computed(() => {
|
|
6917
|
+
const headers = this.headers;
|
|
6918
|
+
const externalConfig = this.columnsConfig();
|
|
6919
|
+
const localConfig = this.columnConfigsSignal();
|
|
6920
|
+
const values = {};
|
|
6921
|
+
headers.forEach((header) => {
|
|
6922
|
+
const columnConfig = externalConfig[header] ?? localConfig[header];
|
|
6923
|
+
values[header] = columnConfig?.disabled ?? false;
|
|
6924
|
+
});
|
|
6925
|
+
return values;
|
|
6926
|
+
});
|
|
6927
|
+
syncColumnWidths(columnCount) {
|
|
6928
|
+
this.columnWidths = Array.from({ length: columnCount }, (_, index) => {
|
|
6929
|
+
return this.columnWidths[index] ?? this.defaultColumnWidth;
|
|
6930
|
+
});
|
|
6931
|
+
}
|
|
6932
|
+
normalizeProvidedColumnConfig(config) {
|
|
6933
|
+
const normalizedType = this.normalizeColumnInputType(config?.type);
|
|
6934
|
+
return {
|
|
6935
|
+
disabled: config?.disabled ?? false,
|
|
6936
|
+
type: normalizedType ?? 'text'
|
|
6937
|
+
};
|
|
6938
|
+
}
|
|
6939
|
+
normalizeColumnInputType(type) {
|
|
6940
|
+
if (type === 'text' ||
|
|
6941
|
+
type === 'number' ||
|
|
6942
|
+
type === 'date' ||
|
|
6943
|
+
type === 'email' ||
|
|
6944
|
+
type === 'password' ||
|
|
6945
|
+
type === 'search' ||
|
|
6946
|
+
type === 'tel' ||
|
|
6947
|
+
type === 'url' ||
|
|
6948
|
+
type === 'time' ||
|
|
6949
|
+
type === 'datetime-local' ||
|
|
6950
|
+
type === 'month') {
|
|
6951
|
+
return type;
|
|
6952
|
+
}
|
|
6953
|
+
return null;
|
|
6954
|
+
}
|
|
6955
|
+
onCellBlur() {
|
|
6956
|
+
this.emitTableDataChanges();
|
|
6957
|
+
}
|
|
6958
|
+
onCellKeydown(event, indexRows, indexCols) {
|
|
6959
|
+
let targetRow = indexRows;
|
|
6960
|
+
let targetCol = indexCols;
|
|
6690
6961
|
if (event.key === 'ArrowUp') {
|
|
6691
|
-
targetRow =
|
|
6962
|
+
targetRow = indexRows - 1;
|
|
6692
6963
|
}
|
|
6693
6964
|
else if (event.key === 'ArrowDown') {
|
|
6694
|
-
targetRow =
|
|
6965
|
+
targetRow = indexRows + 1;
|
|
6695
6966
|
}
|
|
6696
6967
|
else if (event.key === 'ArrowLeft') {
|
|
6697
|
-
targetCol =
|
|
6968
|
+
targetCol = indexCols - 1;
|
|
6698
6969
|
}
|
|
6699
6970
|
else if (event.key === 'ArrowRight') {
|
|
6700
|
-
targetCol =
|
|
6971
|
+
targetCol = indexCols + 1;
|
|
6972
|
+
}
|
|
6973
|
+
else if (event.key === 'Escape') {
|
|
6974
|
+
event.target.blur();
|
|
6975
|
+
return;
|
|
6701
6976
|
}
|
|
6702
6977
|
else {
|
|
6703
6978
|
return;
|
|
@@ -6708,17 +6983,78 @@ class UicExcelTableComponent {
|
|
|
6708
6983
|
}
|
|
6709
6984
|
this.focusCell(targetRow, targetCol);
|
|
6710
6985
|
}
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6986
|
+
handleRowAction(actionId, rowIndex) {
|
|
6987
|
+
if (actionId === 'DELETE') {
|
|
6988
|
+
this.deleteRow(rowIndex);
|
|
6989
|
+
return;
|
|
6990
|
+
}
|
|
6991
|
+
this.addEmptyRow(rowIndex, actionId);
|
|
6992
|
+
}
|
|
6993
|
+
showMoreRows() {
|
|
6994
|
+
this.visibleRowsCount = Math.min(this.visibleRowsCount + this.visibleRowsStep, this.rows.length);
|
|
6995
|
+
}
|
|
6996
|
+
async deleteRow(index) {
|
|
6997
|
+
if (index < 0 || index >= this.rows.length) {
|
|
6998
|
+
return;
|
|
6999
|
+
}
|
|
7000
|
+
const row = this.rows[index];
|
|
7001
|
+
const hasData = this.hasDataInRow(row);
|
|
7002
|
+
if (hasData) {
|
|
7003
|
+
const response = await this.tinyAlert.showAlert({
|
|
7004
|
+
body: this.translateService.translate('editable_table.delete_row_with_data_warning'),
|
|
7005
|
+
title: 'editable_table.delete_row',
|
|
7006
|
+
okButtonText: 'editable_table.delete',
|
|
7007
|
+
cancelButtonText: 'common.cancel',
|
|
7008
|
+
okButtonColor: 'red',
|
|
7009
|
+
showCancelButton: true,
|
|
7010
|
+
});
|
|
7011
|
+
if (!response.value) {
|
|
7012
|
+
return;
|
|
7013
|
+
}
|
|
7014
|
+
}
|
|
7015
|
+
this.rows = this.rows.filter((_, i) => i !== index);
|
|
7016
|
+
this.emitTableDataChanges();
|
|
7017
|
+
}
|
|
7018
|
+
hasDataInRow(row) {
|
|
7019
|
+
return Object.values(row).some((value) => {
|
|
7020
|
+
if (value === null || value === undefined) {
|
|
7021
|
+
return false;
|
|
7022
|
+
}
|
|
7023
|
+
return String(value).trim() !== '';
|
|
7024
|
+
});
|
|
7025
|
+
}
|
|
7026
|
+
addEmptyRow(index, position) {
|
|
7027
|
+
const emptyRow = {};
|
|
7028
|
+
this.headers.forEach((header) => {
|
|
7029
|
+
emptyRow[header] = '';
|
|
7030
|
+
});
|
|
7031
|
+
const normalizedPosition = position.toLowerCase();
|
|
7032
|
+
const targetIndex = normalizedPosition === 'top' ? index : index + 1;
|
|
7033
|
+
const insertIndex = Math.min(Math.max(targetIndex, 0), this.rows.length);
|
|
7034
|
+
this.rows = [
|
|
7035
|
+
...this.rows.slice(0, insertIndex),
|
|
7036
|
+
emptyRow,
|
|
7037
|
+
...this.rows.slice(insertIndex)
|
|
7038
|
+
];
|
|
7039
|
+
this.emitTableDataChanges();
|
|
6714
7040
|
}
|
|
6715
7041
|
emitTableDataChanges(resetVisibleRows = false) {
|
|
6716
7042
|
const nextValue = this.rows.map((row) => ({ ...row }));
|
|
6717
|
-
this.jsonData = nextValue;
|
|
6718
7043
|
this._record = nextValue;
|
|
6719
7044
|
this.syncVisibleRows(resetVisibleRows);
|
|
6720
7045
|
this.recordChange.emit(nextValue);
|
|
6721
7046
|
}
|
|
7047
|
+
focusCell(row, col) {
|
|
7048
|
+
const cellInput = this.hostElement.nativeElement.querySelector(`input[data-row="${row}"][data-col="${col}"]`);
|
|
7049
|
+
cellInput?.focus();
|
|
7050
|
+
}
|
|
7051
|
+
focusPendingColumnInput() {
|
|
7052
|
+
if (this.pendingColumnIndex === null) {
|
|
7053
|
+
return;
|
|
7054
|
+
}
|
|
7055
|
+
const input = this.hostElement.nativeElement.querySelector(`input[data-new-col="${this.pendingColumnIndex}"]`);
|
|
7056
|
+
input?.focus();
|
|
7057
|
+
}
|
|
6722
7058
|
buildHeadersFromRows(rows) {
|
|
6723
7059
|
const keys = new Set();
|
|
6724
7060
|
rows.forEach((row) => {
|
|
@@ -6726,6 +7062,127 @@ class UicExcelTableComponent {
|
|
|
6726
7062
|
});
|
|
6727
7063
|
return Array.from(keys);
|
|
6728
7064
|
}
|
|
7065
|
+
syncVisibleRows(reset) {
|
|
7066
|
+
const totalRows = this.rows.length;
|
|
7067
|
+
if (totalRows === 0) {
|
|
7068
|
+
this.visibleRowsCount = 0;
|
|
7069
|
+
return;
|
|
7070
|
+
}
|
|
7071
|
+
const initialVisibleRows = Math.min(this.visibleRowsStep, totalRows);
|
|
7072
|
+
if (reset || this.visibleRowsCount === 0) {
|
|
7073
|
+
this.visibleRowsCount = initialVisibleRows;
|
|
7074
|
+
return;
|
|
7075
|
+
}
|
|
7076
|
+
if (totalRows <= this.visibleRowsStep) {
|
|
7077
|
+
this.visibleRowsCount = totalRows;
|
|
7078
|
+
return;
|
|
7079
|
+
}
|
|
7080
|
+
this.visibleRowsCount = Math.min(this.visibleRowsCount, totalRows);
|
|
7081
|
+
}
|
|
7082
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicEditableTableComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7083
|
+
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 [tip]=\"'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 [tip]=\"'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(--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(--grey-200)}.xls-table td{background-color:var(--grey-100)}.xls-table td input{padding:3px;border:solid 1px white;border-radius:3px;background-color:#fff;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(--grey-100);background-color:var(--grey-50);color: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(--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(--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(--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(--grey-300);border-radius:3px;padding:0 6px;font-size:12px}.empty-msg{text-align:center;color: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"], 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: "[tip]", inputs: ["tip"] }] });
|
|
7084
|
+
}
|
|
7085
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicEditableTableComponent, decorators: [{
|
|
7086
|
+
type: Component,
|
|
7087
|
+
args: [{ selector: 'ui-editable-table', imports: [
|
|
7088
|
+
CommonModule,
|
|
7089
|
+
UicButtonComponent,
|
|
7090
|
+
UicActionButtonComponent,
|
|
7091
|
+
FormsModule,
|
|
7092
|
+
UicTranslatePipe,
|
|
7093
|
+
UicToolTipDirective
|
|
7094
|
+
], 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 [tip]=\"'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 [tip]=\"'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(--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(--grey-200)}.xls-table td{background-color:var(--grey-100)}.xls-table td input{padding:3px;border:solid 1px white;border-radius:3px;background-color:#fff;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(--grey-100);background-color:var(--grey-50);color: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(--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(--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(--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(--grey-300);border-radius:3px;padding:0 6px;font-size:12px}.empty-msg{text-align:center;color:var(--grey-500);padding:20px;font-weight:300;font-size:14px}\n"] }]
|
|
7095
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { visibleRowsStep: [{
|
|
7096
|
+
type: Input
|
|
7097
|
+
}], record: [{
|
|
7098
|
+
type: Input
|
|
7099
|
+
}], recordChange: [{
|
|
7100
|
+
type: Output
|
|
7101
|
+
}] } });
|
|
7102
|
+
|
|
7103
|
+
class UicExcelTableComponent {
|
|
7104
|
+
headerFormat = 'none';
|
|
7105
|
+
title = '';
|
|
7106
|
+
_visibleRowsStep = 50;
|
|
7107
|
+
_record = [];
|
|
7108
|
+
set visibleRowsStep(value) {
|
|
7109
|
+
const numericValue = Number(value);
|
|
7110
|
+
this._visibleRowsStep = Number.isFinite(numericValue) && numericValue > 0
|
|
7111
|
+
? Math.floor(numericValue)
|
|
7112
|
+
: 50;
|
|
7113
|
+
}
|
|
7114
|
+
get visibleRowsStep() {
|
|
7115
|
+
return this._visibleRowsStep;
|
|
7116
|
+
}
|
|
7117
|
+
set record(value) {
|
|
7118
|
+
const normalizedRows = Array.isArray(value)
|
|
7119
|
+
? value.map((row) => ({ ...row }))
|
|
7120
|
+
: [];
|
|
7121
|
+
this._record = normalizedRows;
|
|
7122
|
+
}
|
|
7123
|
+
get record() {
|
|
7124
|
+
return this._record;
|
|
7125
|
+
}
|
|
7126
|
+
fileName = '';
|
|
7127
|
+
recordChange = new EventEmitter();
|
|
7128
|
+
onFileSelected(event) {
|
|
7129
|
+
const input = event.target;
|
|
7130
|
+
if (!input.files || input.files.length === 0) {
|
|
7131
|
+
return;
|
|
7132
|
+
}
|
|
7133
|
+
const file = input.files[0];
|
|
7134
|
+
this.fileName = file.name;
|
|
7135
|
+
const reader = new FileReader();
|
|
7136
|
+
reader.onload = () => {
|
|
7137
|
+
const buffer = reader.result;
|
|
7138
|
+
const data = new Uint8Array(buffer);
|
|
7139
|
+
const workbook = XLSX.read(data, { type: 'array' });
|
|
7140
|
+
const sheetName = workbook.SheetNames[0];
|
|
7141
|
+
if (!sheetName) {
|
|
7142
|
+
this.resetData();
|
|
7143
|
+
return;
|
|
7144
|
+
}
|
|
7145
|
+
const sheet = workbook.Sheets[sheetName];
|
|
7146
|
+
const sheetData = XLSX.utils.sheet_to_json(sheet, {
|
|
7147
|
+
header: 1,
|
|
7148
|
+
defval: ''
|
|
7149
|
+
});
|
|
7150
|
+
if (!sheetData || sheetData.length === 0) {
|
|
7151
|
+
this.resetData();
|
|
7152
|
+
return;
|
|
7153
|
+
}
|
|
7154
|
+
const headerRow = sheetData[0];
|
|
7155
|
+
const columnCount = Math.max(headerRow.length, ...sheetData.map((row) => row.length));
|
|
7156
|
+
const headerFormat = this.normalizeHeaderFormat(this.headerFormat);
|
|
7157
|
+
const rawHeaders = Array.from({ length: columnCount }, (_, index) => {
|
|
7158
|
+
const value = headerRow[index];
|
|
7159
|
+
const header = value === undefined || value === null ? '' : String(value).trim();
|
|
7160
|
+
return header !== '' ? header : `Col ${index + 1}`;
|
|
7161
|
+
});
|
|
7162
|
+
const headers = rawHeaders.map((header) => this.formatHeader(header, headerFormat));
|
|
7163
|
+
const dataRows = sheetData.slice(1);
|
|
7164
|
+
const rows = dataRows.map((row) => {
|
|
7165
|
+
const record = {};
|
|
7166
|
+
headers.forEach((header, index) => {
|
|
7167
|
+
record[header] = row[index] ?? '';
|
|
7168
|
+
});
|
|
7169
|
+
return record;
|
|
7170
|
+
});
|
|
7171
|
+
this._record = rows;
|
|
7172
|
+
this.recordChange.emit(rows.map((row) => ({ ...row })));
|
|
7173
|
+
};
|
|
7174
|
+
reader.readAsArrayBuffer(file);
|
|
7175
|
+
input.value = '';
|
|
7176
|
+
}
|
|
7177
|
+
onEditableRecordChange(value) {
|
|
7178
|
+
const normalizedRows = value.map((row) => ({ ...row }));
|
|
7179
|
+
this._record = normalizedRows;
|
|
7180
|
+
this.recordChange.emit(normalizedRows);
|
|
7181
|
+
}
|
|
7182
|
+
resetData() {
|
|
7183
|
+
this._record = [];
|
|
7184
|
+
this.recordChange.emit([]);
|
|
7185
|
+
}
|
|
6729
7186
|
normalizeHeaderFormat(value) {
|
|
6730
7187
|
if (value === 'lowercase' || value === 'uppercase' || value === 'none') {
|
|
6731
7188
|
return value;
|
|
@@ -6741,32 +7198,18 @@ class UicExcelTableComponent {
|
|
|
6741
7198
|
}
|
|
6742
7199
|
return header;
|
|
6743
7200
|
}
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
if (totalRows === 0) {
|
|
6747
|
-
this.visibleRowsCount = 0;
|
|
6748
|
-
return;
|
|
6749
|
-
}
|
|
6750
|
-
const initialVisibleRows = Math.min(this.visibleRowsStep, totalRows);
|
|
6751
|
-
if (reset || this.visibleRowsCount === 0) {
|
|
6752
|
-
this.visibleRowsCount = initialVisibleRows;
|
|
6753
|
-
return;
|
|
6754
|
-
}
|
|
6755
|
-
this.visibleRowsCount = Math.min(this.visibleRowsCount, totalRows);
|
|
6756
|
-
}
|
|
6757
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicExcelTableComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6758
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicExcelTableComponent, isStandalone: true, selector: "ui-excel-table", inputs: { headerFormat: "headerFormat", title: "title", visibleRowsStep: "visibleRowsStep", record: "record" }, outputs: { recordChange: "recordChange" }, ngImport: i0, template: "<input\r\n#fileInput\r\ntype=\"file\"\r\naccept=\".xlsx,.xls,.csv\"\r\n(change)=\"onFileSelected($event)\"\r\nhidden\r\n/>\r\n\r\n<div class=\"xls-title\">\r\n @if (title) {\r\n <h1 style=\"flex: 1 1;\">{{title}}</h1>\r\n }\r\n <div class=\"xls-buttons\">\r\n <ui-button color=\"black\" type=\"bordered\" size=\"m\" (click)=\"resetData()\">{{'excel_table.clear_file' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"m\" (click)=\"fileInput.click()\">{{'excel_table.load_file' | uicTranslate}}</ui-button>\r\n </div>\r\n</div>\r\n<div class=\"xlstable-overflow\">\r\n @if (headers.length > 0) {\r\n <table class=\"xls-table\">\r\n <thead>\r\n <tr>\r\n <th style=\"width: 30px;\"></th>\r\n @for (header of headers; track $index) {\r\n <th>\r\n <div class=\"hea-th\">\r\n {{ header }} \r\n <ui-button (click)=\"deleteColum(header)\" icon=\"ri-delete-bin-line\" type=\"ghost\" size=\"s\" [iconOnly]=\"true\"></ui-button> \r\n </div>\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (row of visibleRows; track $index; let i = $index) {\r\n <tr>\r\n <td> <ui-action-button [options]=\"[{id:'TOP',label:'Agregar arriba'},{id:'BOTTOM',label:'Agregar abajo'},{id:'DELETE',label:'Eliminar fila'}]\" (optionSelected)=\"$event.id === 'DELETE' ? deleteRow(i) : addEmptyRow(i,$event.id)\"></ui-action-button> </td>\r\n @for (header of headers; track $index; let col = $index) {\r\n <td>\r\n <input\r\n [attr.data-row]=\"i\"\r\n [attr.data-col]=\"col\"\r\n [(ngModel)]=\"row[header]\"\r\n (blur)=\"onCellBlur()\"\r\n (keydown)=\"onCellKeydown($event, i, col)\"\r\n >\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n @if (canShowMoreRows) {\r\n <div class=\"show-more\">\r\n <ui-button color=\"black\" type=\"bordered\" size=\"m\" (click)=\"showMoreRows()\">\r\n {{'excel_table.see_more' | uicTranslate}}\r\n </ui-button>\r\n </div>\r\n }\r\n <div class=\"table-counter\">\r\n {{'excel_table.counter_text' | uicTranslate:{shown: visibleRows.length, total: rows.length} }}\r\n </div>\r\n } @else{\r\n <div class=\"empty-msg\"> {{'excel_table.empty_message' | uicTranslate}} </div>\r\n }\r\n</div>\r\n", styles: [".xls-title{display:flex;gap:10px;justify-content:space-between;margin-bottom:10px;border:solid 1px var(--grey-200);border-radius:10px;padding:5px}.xls-buttons{display:flex;gap:10px}.empty-msg{text-align:center;color:var(--grey-500);padding:20px;font-weight:300;font-size:14px}.xls-table{width:max-content;min-width:100%;border:solid 1px 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(--grey-200)}.xls-table td{background-color:var(--grey-100)}.xls-table td input{padding:3px;border:solid 1px white;border-radius:3px;background-color:#fff;font-weight:300;width:calc(100% - 8px)}.xls-table td input:hover{border-color:var(--primary-400)}.xls-table td input:focus{border-color:var(--primary-600)}.xls-table th{line-height:28px;white-space:nowrap;background-color:var(--grey-400);color:#fff;text-align:left;padding:0 5px;border:solid 1px white}.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(--grey-500);font-weight:400}.hea-th{display:flex;justify-content:space-between;width:100%;align-items:center}.hea-th i{cursor:pointer}\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"], outputs: ["optionSelected", "optionsApplied"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
7201
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicExcelTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7202
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicExcelTableComponent, isStandalone: true, selector: "ui-excel-table", inputs: { headerFormat: "headerFormat", title: "title", visibleRowsStep: "visibleRowsStep", record: "record" }, outputs: { recordChange: "recordChange" }, ngImport: i0, template: "<input\r\n#fileInput\r\ntype=\"file\"\r\naccept=\".xlsx,.xls,.csv\"\r\n(change)=\"onFileSelected($event)\"\r\nhidden\r\n/>\r\n\r\n<div class=\"xls-title\">\r\n @if (title) {\r\n <h1 style=\"flex: 1 1;\">{{title}}</h1>\r\n }\r\n <div class=\"xls-buttons\">\r\n <ui-button color=\"black\" type=\"bordered\" size=\"m\" (click)=\"resetData()\">{{'excel_table.clear_file' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"m\" (click)=\"fileInput.click()\">{{'excel_table.load_file' | uicTranslate}}</ui-button>\r\n </div>\r\n</div>\r\n<ui-editable-table\r\n [record]=\"record\"\r\n [visibleRowsStep]=\"visibleRowsStep\"\r\n (recordChange)=\"onEditableRecordChange($event)\"\r\n></ui-editable-table>\r\n", styles: [".xls-title{display:flex;gap:10px;justify-content:space-between;margin-bottom:10px;border:solid 1px var(--grey-200);border-radius:10px;padding:5px}.xls-buttons{display:flex;gap:10px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: UicEditableTableComponent, selector: "ui-editable-table", inputs: ["config", "columnsConfig", "visibleRowsStep", "record"], outputs: ["recordChange"] }] });
|
|
6759
7203
|
}
|
|
6760
7204
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicExcelTableComponent, decorators: [{
|
|
6761
7205
|
type: Component,
|
|
6762
7206
|
args: [{ selector: 'ui-excel-table', imports: [
|
|
6763
7207
|
CommonModule,
|
|
6764
7208
|
UicButtonComponent,
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { headerFormat: [{
|
|
7209
|
+
UicTranslatePipe,
|
|
7210
|
+
UicEditableTableComponent
|
|
7211
|
+
], template: "<input\r\n#fileInput\r\ntype=\"file\"\r\naccept=\".xlsx,.xls,.csv\"\r\n(change)=\"onFileSelected($event)\"\r\nhidden\r\n/>\r\n\r\n<div class=\"xls-title\">\r\n @if (title) {\r\n <h1 style=\"flex: 1 1;\">{{title}}</h1>\r\n }\r\n <div class=\"xls-buttons\">\r\n <ui-button color=\"black\" type=\"bordered\" size=\"m\" (click)=\"resetData()\">{{'excel_table.clear_file' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" size=\"m\" (click)=\"fileInput.click()\">{{'excel_table.load_file' | uicTranslate}}</ui-button>\r\n </div>\r\n</div>\r\n<ui-editable-table\r\n [record]=\"record\"\r\n [visibleRowsStep]=\"visibleRowsStep\"\r\n (recordChange)=\"onEditableRecordChange($event)\"\r\n></ui-editable-table>\r\n", styles: [".xls-title{display:flex;gap:10px;justify-content:space-between;margin-bottom:10px;border:solid 1px var(--grey-200);border-radius:10px;padding:5px}.xls-buttons{display:flex;gap:10px}\n"] }]
|
|
7212
|
+
}], propDecorators: { headerFormat: [{
|
|
6770
7213
|
type: Input
|
|
6771
7214
|
}], title: [{
|
|
6772
7215
|
type: Input
|
|
@@ -6849,7 +7292,7 @@ class UicTagSelectorComponent extends base {
|
|
|
6849
7292
|
useExisting: forwardRef(() => UicTagSelectorComponent),
|
|
6850
7293
|
multi: true
|
|
6851
7294
|
}
|
|
6852
|
-
], usesInheritance: true, ngImport: i0, template: "\r\n<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=\"tags-reel\">\r\n @for (item of selectedTags; track $index) {\r\n <div [class]=\"'selected-tag lc-'+item.color\" ><i [class]=\"item.icon??'ri-hashtag'\"></i>{{item.name}} <i (click)=\"removeTag(item)\" class=\"ri-close-large-line close-icon\"></i> </div>\r\n }\r\n <ui-overlay-card>\r\n <ui-button button type=\"bordered\" color=\"black\" icon=\"ri-add-line\" size=\"s\">{{buttonText | uicTranslate}}</ui-button>\r\n <ng-container content >\r\n\r\n <ui-input internalIcon=\"ri-search-line\" internalIconColor=\"blue\">\r\n <input [placeholder]=\"placeholder | uicTranslate\" [(ngModel)]=\"filterText\" (ngModelChange)=\"filter()\" >\r\n </ui-input>\r\n <div class=\"tags-overflow\">\r\n <div class=\"tags-title\">{{predefinedTitle | uicTranslate}}</div>\r\n @for(item of filterArray; track $index){\r\n <div (click)=\"select(item)\" class=\"tag-option\"> \r\n <i class=\"ri-circle-fill f-grey\"></i> \r\n <div style=\"flex: 1 1;\">{{item.name}}</div> \r\n @if ( isSelected(item.name) ) {\r\n <i class=\"ri-check-line\"></i> \r\n }\r\n </div>\r\n }\r\n <div class=\"new-tag\"> \r\n <div class=\"new-tag-label\">{{newTagTitle | uicTranslate}}:</div>\r\n <div class=\"input-tag\">\r\n <input [(ngModel)]=\"newTagLabel\" (keydown.enter)=\"createTag()\" type=\"text\">\r\n <ui-button (click)=\"createTag()\" size=\"s\" [iconOnly]=\"true\" icon=\"ri-add-line\"></ui-button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ui-overlay-card>\r\n</div> \r\n</ui-input-wrapper>\r\n", styles: [".tags-reel{display:flex;gap:10px;flex-wrap:wrap}.selected-tag{display:flex;gap:5px;align-items:center;font-size:12px;line-height:28px;padding:0 12px;border:solid 1px var(--grey-200);border-radius:20px}.selected-tag i{font-size:14px}.close-icon{color:var(--red-600);cursor:pointer}.tags-title{font-size:13px;padding:4px;font-weight:600;margin-bottom:5px;color:var(--grey-500)}.tag-option{font-size:14px;padding:5px 10px;border-radius:5px;transition:ease;display:flex;gap:10px;color:var(--grey-600);cursor:pointer}.tag-option:hover{background-color:var(--grey-200)}.tags-overflow{display:flex;flex-direction:column;gap:2px;padding:3px;max-height:250px;overflow:auto}.new-tag{padding:5px;border-top:solid 1px var(--grey-200)}.new-tag-label{font-size:13px;line-height:25px;color:var(--grey-500)}.input-tag{display:flex;gap:5px}.input-tag input{border:solid 1px var(--grey-300);border-radius:8px;padding:0 10px}.f-grey{color:var(--grey-200)}.lc-blue{background-color:var(--blue-100);border-color:var(--blue-600);color:var(--blue-700)}\n"], dependencies: [{ kind: "component", type: UicOverlayCardComponent, selector: "ui-overlay-card" }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"], outputs: ["clickButton"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type:
|
|
7295
|
+
], usesInheritance: true, ngImport: i0, template: "\r\n<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=\"tags-reel\">\r\n @for (item of selectedTags; track $index) {\r\n <div [class]=\"'selected-tag lc-'+item.color\" ><i [class]=\"item.icon??'ri-hashtag'\"></i>{{item.name}} <i (click)=\"removeTag(item)\" class=\"ri-close-large-line close-icon\"></i> </div>\r\n }\r\n <ui-overlay-card>\r\n <ui-button button type=\"bordered\" color=\"black\" icon=\"ri-add-line\" size=\"s\">{{buttonText | uicTranslate}}</ui-button>\r\n <ng-container content >\r\n\r\n <ui-input internalIcon=\"ri-search-line\" internalIconColor=\"blue\">\r\n <input [placeholder]=\"placeholder | uicTranslate\" [(ngModel)]=\"filterText\" (ngModelChange)=\"filter()\" >\r\n </ui-input>\r\n <div class=\"tags-overflow\">\r\n <div class=\"tags-title\">{{predefinedTitle | uicTranslate}}</div>\r\n @for(item of filterArray; track $index){\r\n <div (click)=\"select(item)\" class=\"tag-option\"> \r\n <i class=\"ri-circle-fill f-grey\"></i> \r\n <div style=\"flex: 1 1;\">{{item.name}}</div> \r\n @if ( isSelected(item.name) ) {\r\n <i class=\"ri-check-line\"></i> \r\n }\r\n </div>\r\n }\r\n <div class=\"new-tag\"> \r\n <div class=\"new-tag-label\">{{newTagTitle | uicTranslate}}:</div>\r\n <div class=\"input-tag\">\r\n <input [(ngModel)]=\"newTagLabel\" (keydown.enter)=\"createTag()\" type=\"text\">\r\n <ui-button (click)=\"createTag()\" size=\"s\" [iconOnly]=\"true\" icon=\"ri-add-line\"></ui-button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ui-overlay-card>\r\n</div> \r\n</ui-input-wrapper>\r\n", styles: [".tags-reel{display:flex;gap:10px;flex-wrap:wrap}.selected-tag{display:flex;gap:5px;align-items:center;font-size:12px;line-height:28px;padding:0 12px;border:solid 1px var(--grey-200);border-radius:20px}.selected-tag i{font-size:14px}.close-icon{color:var(--red-600);cursor:pointer}.tags-title{font-size:13px;padding:4px;font-weight:600;margin-bottom:5px;color:var(--grey-500)}.tag-option{font-size:14px;padding:5px 10px;border-radius:5px;transition:ease;display:flex;gap:10px;color:var(--grey-600);cursor:pointer}.tag-option:hover{background-color:var(--grey-200)}.tags-overflow{display:flex;flex-direction:column;gap:2px;padding:3px;max-height:250px;overflow:auto}.new-tag{padding:5px;border-top:solid 1px var(--grey-200)}.new-tag-label{font-size:13px;line-height:25px;color:var(--grey-500)}.input-tag{display:flex;gap:5px}.input-tag input{border:solid 1px var(--grey-300);border-radius:8px;padding:0 10px}.f-grey{color:var(--grey-200)}.lc-blue{background-color:var(--blue-100);border-color:var(--blue-600);color:var(--blue-700)}\n"], dependencies: [{ kind: "component", type: UicOverlayCardComponent, selector: "ui-overlay-card" }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"], outputs: ["clickButton"] }, { 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: InputWrapperComponent, selector: "ui-input-wrapper", inputs: ["icon", "iconColor", "label", "error", "tip", "disabled"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
6853
7296
|
}
|
|
6854
7297
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTagSelectorComponent, decorators: [{
|
|
6855
7298
|
type: Component,
|
|
@@ -6931,11 +7374,11 @@ class UicProgressBarComponent {
|
|
|
6931
7374
|
});
|
|
6932
7375
|
}
|
|
6933
7376
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6934
|
-
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(--grey-900);--progress-track: var(--grey-200)}.pb-grey{--progress-fill: var(--grey-600);--progress-track: var(--grey-200)}.pb-white{--progress-fill: var(--white);--progress-track: var(--grey-200)}\n"] });
|
|
7377
|
+
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(--grey-900);--progress-track: var(--grey-200)}.pb-grey{--progress-fill: var(--grey-600);--progress-track: var(--grey-200)}.pb-white{--progress-fill: var(--white);--progress-track: var(--grey-200)}\n"] });
|
|
6935
7378
|
}
|
|
6936
7379
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicProgressBarComponent, decorators: [{
|
|
6937
7380
|
type: Component,
|
|
6938
|
-
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(--grey-900);--progress-track: var(--grey-200)}.pb-grey{--progress-fill: var(--grey-600);--progress-track: var(--grey-200)}.pb-white{--progress-fill: var(--white);--progress-track: var(--grey-200)}\n"] }]
|
|
7381
|
+
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(--grey-900);--progress-track: var(--grey-200)}.pb-grey{--progress-fill: var(--grey-600);--progress-track: var(--grey-200)}.pb-white{--progress-fill: var(--white);--progress-track: var(--grey-200)}\n"] }]
|
|
6939
7382
|
}], propDecorators: { progress: [{
|
|
6940
7383
|
type: Input
|
|
6941
7384
|
}], color: [{
|
|
@@ -7294,6 +7737,453 @@ const EXTRA_FORM_FIELDS = [
|
|
|
7294
7737
|
}
|
|
7295
7738
|
];
|
|
7296
7739
|
|
|
7740
|
+
class UicFieldOptionsEditorComponent {
|
|
7741
|
+
options = [
|
|
7742
|
+
{ id: '', text: '' }
|
|
7743
|
+
];
|
|
7744
|
+
addOption() {
|
|
7745
|
+
this.options.push({ id: '', text: '' });
|
|
7746
|
+
}
|
|
7747
|
+
dropOption(index) {
|
|
7748
|
+
this.options.splice(index, 1);
|
|
7749
|
+
}
|
|
7750
|
+
updateCode(name, idx) {
|
|
7751
|
+
if (this.options[idx].id === '') {
|
|
7752
|
+
this.options[idx].id = name;
|
|
7753
|
+
}
|
|
7754
|
+
}
|
|
7755
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFieldOptionsEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7756
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFieldOptionsEditorComponent, isStandalone: true, selector: "ui-field-options-editor", ngImport: i0, template: "<ui-input-wrapper [label]=\"'form_builder.options_editor.title' | uicTranslate\">\n <div class=\"optbody\">\r\n <div class=\"option-row\">\r\n <div>{{'form_builder.options_editor.code_label' | uicTranslate}}</div>\n <div>{{'form_builder.options_editor.name_label' | uicTranslate}}</div>\n </div>\r\n @for (item of options; track $index) {\r\n <div class=\"option-row\">\r\n @if (true) {\r\n <input [(ngModel)]=\"item.id\" [placeholder]=\"'form_builder.options_editor.code_placeholder' | uicTranslate\" type=\"text\">\n }\n <input [(ngModel)]=\"item.text\" (blur)=\"updateCode(item.text,$index)\" [placeholder]=\"'form_builder.options_editor.display_name_placeholder' | uicTranslate\" type=\"text\">\n <ui-button (click)=\"dropOption($index)\" size=\"s\" type=\"ghost\" icon=\"ri-delete-bin-line\" [iconOnly]=\"true\" color=\"red\"></ui-button>\n </div>\r\n }\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>\n </div>\r\n</ui-input-wrapper>\n", styles: [".optbody{padding:10px;background-color:var(--grey-100);display:block;border-radius:10px;border:solid 1px var(--grey-200)}.option-row{display:flex;gap:3px}.option-row input{margin-bottom:8px;padding:5px;width:50%;border:solid 1px var(--grey-50);border-radius:5px}.option-row input:focus{border-color:var(--primary-500)}.option-row>div{width:50%;font-size:13px;font-weight:500;text-align:center;margin-bottom:8px}\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" }] });
|
|
7757
|
+
}
|
|
7758
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFieldOptionsEditorComponent, decorators: [{
|
|
7759
|
+
type: Component,
|
|
7760
|
+
args: [{ selector: 'ui-field-options-editor', imports: [FormsModule, UicButtonComponent, InputWrapperComponent, UicTranslatePipe], template: "<ui-input-wrapper [label]=\"'form_builder.options_editor.title' | uicTranslate\">\n <div class=\"optbody\">\r\n <div class=\"option-row\">\r\n <div>{{'form_builder.options_editor.code_label' | uicTranslate}}</div>\n <div>{{'form_builder.options_editor.name_label' | uicTranslate}}</div>\n </div>\r\n @for (item of options; track $index) {\r\n <div class=\"option-row\">\r\n @if (true) {\r\n <input [(ngModel)]=\"item.id\" [placeholder]=\"'form_builder.options_editor.code_placeholder' | uicTranslate\" type=\"text\">\n }\n <input [(ngModel)]=\"item.text\" (blur)=\"updateCode(item.text,$index)\" [placeholder]=\"'form_builder.options_editor.display_name_placeholder' | uicTranslate\" type=\"text\">\n <ui-button (click)=\"dropOption($index)\" size=\"s\" type=\"ghost\" icon=\"ri-delete-bin-line\" [iconOnly]=\"true\" color=\"red\"></ui-button>\n </div>\r\n }\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>\n </div>\r\n</ui-input-wrapper>\n", styles: [".optbody{padding:10px;background-color:var(--grey-100);display:block;border-radius:10px;border:solid 1px var(--grey-200)}.option-row{display:flex;gap:3px}.option-row input{margin-bottom:8px;padding:5px;width:50%;border:solid 1px var(--grey-50);border-radius:5px}.option-row input:focus{border-color:var(--primary-500)}.option-row>div{width:50%;font-size:13px;font-weight:500;text-align:center;margin-bottom:8px}\n"] }]
|
|
7761
|
+
}] });
|
|
7762
|
+
|
|
7763
|
+
class FieldEditorComponent {
|
|
7764
|
+
fieldType;
|
|
7765
|
+
delete = new EventEmitter();
|
|
7766
|
+
duplicate = new EventEmitter();
|
|
7767
|
+
fieldChange = new EventEmitter();
|
|
7768
|
+
dragStart = new EventEmitter();
|
|
7769
|
+
translateService = inject(UicTranslateService);
|
|
7770
|
+
destroy$ = new Subject();
|
|
7771
|
+
showAdvanced = false;
|
|
7772
|
+
requiredFieldsForm;
|
|
7773
|
+
advancedFieldsForm;
|
|
7774
|
+
basicFields = [...BASE_FORM_FIELDS];
|
|
7775
|
+
layoutFields = [...LAYOUT_FORM_FIELDS];
|
|
7776
|
+
requiredFields = [];
|
|
7777
|
+
fieldModel = { name: '', type: 'text' };
|
|
7778
|
+
formSchema = {
|
|
7779
|
+
cols: 4,
|
|
7780
|
+
blocks: [
|
|
7781
|
+
{
|
|
7782
|
+
subtitle: 'form_builder.field_editor.style',
|
|
7783
|
+
fields: this.layoutFields
|
|
7784
|
+
},
|
|
7785
|
+
{
|
|
7786
|
+
subtitle: 'form_builder.field_editor.advanced',
|
|
7787
|
+
fields: []
|
|
7788
|
+
}
|
|
7789
|
+
]
|
|
7790
|
+
};
|
|
7791
|
+
ngOnInit() {
|
|
7792
|
+
this.fieldModel = {
|
|
7793
|
+
...this.fieldModel,
|
|
7794
|
+
type: this.fieldType.value
|
|
7795
|
+
};
|
|
7796
|
+
this.updateFields();
|
|
7797
|
+
this.translateService.language$
|
|
7798
|
+
.pipe(takeUntil(this.destroy$))
|
|
7799
|
+
.subscribe(() => this.updateFields());
|
|
7800
|
+
}
|
|
7801
|
+
updateFields() {
|
|
7802
|
+
const field = FIELDS_CONFIG.find(f => f.value === this.fieldType.value);
|
|
7803
|
+
if (field) {
|
|
7804
|
+
const extraFields = EXTRA_FORM_FIELDS.filter(f => field.properties.includes(f.name));
|
|
7805
|
+
this.formSchema.blocks[1].fields = [...extraFields];
|
|
7806
|
+
}
|
|
7807
|
+
this.requiredFields = this.basicFields.map(field => ({
|
|
7808
|
+
...field,
|
|
7809
|
+
label: this.translateService.translate(field.label ?? ''),
|
|
7810
|
+
placeholder: field.placeholder ? this.translateService.translate(field.placeholder) : this.translateService.translate(field.label ?? ''),
|
|
7811
|
+
tip: field.tip ? this.translateService.translate(field.tip) : field.tip
|
|
7812
|
+
}));
|
|
7813
|
+
this.formSchema.blocks = this.formSchema.blocks?.map(block => ({
|
|
7814
|
+
...block,
|
|
7815
|
+
subtitle: block.subtitle ? this.translateService.translate(block.subtitle) : block.subtitle,
|
|
7816
|
+
fields: block.fields.map(field => ({
|
|
7817
|
+
...field,
|
|
7818
|
+
label: this.translateService.translate(field.label ?? ''),
|
|
7819
|
+
placeholder: field.placeholder ? this.translateService.translate(field.placeholder) : this.translateService.translate(field.label ?? ''),
|
|
7820
|
+
tip: field.tip ? this.translateService.translate(field.tip) : field.tip
|
|
7821
|
+
}))
|
|
7822
|
+
}));
|
|
7823
|
+
this.fieldModel = {
|
|
7824
|
+
...this.fieldModel,
|
|
7825
|
+
type: this.fieldType.value,
|
|
7826
|
+
name: this.fieldModel.name,
|
|
7827
|
+
};
|
|
7828
|
+
this.emitField();
|
|
7829
|
+
}
|
|
7830
|
+
ngOnDestroy() {
|
|
7831
|
+
this.destroy$.next();
|
|
7832
|
+
this.destroy$.complete();
|
|
7833
|
+
}
|
|
7834
|
+
deleteField() {
|
|
7835
|
+
this.delete.emit();
|
|
7836
|
+
}
|
|
7837
|
+
duplicateField() {
|
|
7838
|
+
this.duplicate.emit();
|
|
7839
|
+
}
|
|
7840
|
+
onDragStart(event) {
|
|
7841
|
+
event.stopPropagation();
|
|
7842
|
+
this.dragStart.emit(event);
|
|
7843
|
+
}
|
|
7844
|
+
updateFieldValues(values) {
|
|
7845
|
+
this.fieldModel = {
|
|
7846
|
+
...this.fieldModel,
|
|
7847
|
+
...values,
|
|
7848
|
+
type: this.fieldType.value
|
|
7849
|
+
};
|
|
7850
|
+
this.emitField();
|
|
7851
|
+
}
|
|
7852
|
+
submitForms() {
|
|
7853
|
+
const requiredResult = this.requiredFieldsForm?.submit();
|
|
7854
|
+
const advancedResult = this.advancedFieldsForm?.submit();
|
|
7855
|
+
return (requiredResult?.result ?? true) && (advancedResult?.result ?? true);
|
|
7856
|
+
}
|
|
7857
|
+
emitField() {
|
|
7858
|
+
const nextField = { ...this.fieldModel };
|
|
7859
|
+
this.fieldChange.emit(nextField);
|
|
7860
|
+
}
|
|
7861
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7862
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FieldEditorComponent, isStandalone: true, selector: "lib-field-editor", inputs: { fieldType: "fieldType" }, outputs: { delete: "delete", duplicate: "duplicate", fieldChange: "fieldChange", dragStart: "dragStart" }, viewQueries: [{ propertyName: "requiredFieldsForm", first: true, predicate: ["requiredFieldsForm"], descendants: true }, { propertyName: "advancedFieldsForm", first: true, predicate: ["advancedFieldsForm"], descendants: true }], ngImport: i0, template: "<div class=\"field-editor\">\r\n\r\n <div class=\"field-header\">\n <div>\n <i class=\"ri-draggable field-drag-handle\" draggable=\"true\" (dragstart)=\"onDragStart($event)\"></i>\n {{fieldType.label}}\n </div>\n <div class=\"field-header-buttons\">\n <ui-button (click)=\"duplicateField()\" size=\"s\" color=\"blue\" icon=\"ri-file-copy-line\">{{'field_editor.duplicate' | uicTranslate}}</ui-button>\n <ui-button (click)=\"deleteField()\" size=\"s\" color=\"red\" icon=\"ri-delete-bin-line\">{{'field_editor.delete' | uicTranslate}}</ui-button>\n </div>\n </div>\n\r\n <div class=\"field-body\">\r\n <ui-form-wrapper #requiredFieldsForm [fields]=\"requiredFields\" [cols]=\"3\" (formChange)=\"updateFieldValues($event)\"></ui-form-wrapper>\r\n \r\n <div style=\"width: 33%;\">\r\n <ui-field-options-editor></ui-field-options-editor>\r\n </div>\r\n \r\n <div class=\"show-btn\" (click)=\"showAdvanced = !showAdvanced\"> {{showAdvanced ? ('field_editor.hide_advanced' | uicTranslate) : ('field_editor.show_advanced' | uicTranslate)}} </div>\n \r\n <ui-form-wrapper [class.hidden]=\"!showAdvanced\"\r\n #advancedFieldsForm\r\n [schema]=\"formSchema\"\r\n (formChange)=\"updateFieldValues($event)\"> \r\n </ui-form-wrapper>\r\n\r\n </div>\r\n \r\n</div>\r\n", styles: [".field-editor{border:solid 1px var(--grey-300);border-radius:5px;overflow:hidden}.show-btn{text-decoration:underline;color:var(--blue-700);cursor:pointer;font-size:14px}.hidden{display:none}.field-header{font-weight:600;display:flex;align-items:center;padding:5px;justify-content:space-between;background-color:var(--grey-50);border-bottom:solid 1px var(--grey-300)}.field-header-buttons{display:flex;gap:5px}.field-drag-handle{cursor:grab;-webkit-user-select:none;user-select:none}.field-body{padding:10px}\n"], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "loading", "disabled", "showButtons", "fillSelects", "initialValues"], outputs: ["formSubmit", "formChange"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicFieldOptionsEditorComponent, selector: "ui-field-options-editor" }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
7863
|
+
}
|
|
7864
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldEditorComponent, decorators: [{
|
|
7865
|
+
type: Component,
|
|
7866
|
+
args: [{ selector: 'lib-field-editor', imports: [UicFormWrapperComponent, UicButtonComponent, UicFieldOptionsEditorComponent, UicTranslatePipe], template: "<div class=\"field-editor\">\r\n\r\n <div class=\"field-header\">\n <div>\n <i class=\"ri-draggable field-drag-handle\" draggable=\"true\" (dragstart)=\"onDragStart($event)\"></i>\n {{fieldType.label}}\n </div>\n <div class=\"field-header-buttons\">\n <ui-button (click)=\"duplicateField()\" size=\"s\" color=\"blue\" icon=\"ri-file-copy-line\">{{'field_editor.duplicate' | uicTranslate}}</ui-button>\n <ui-button (click)=\"deleteField()\" size=\"s\" color=\"red\" icon=\"ri-delete-bin-line\">{{'field_editor.delete' | uicTranslate}}</ui-button>\n </div>\n </div>\n\r\n <div class=\"field-body\">\r\n <ui-form-wrapper #requiredFieldsForm [fields]=\"requiredFields\" [cols]=\"3\" (formChange)=\"updateFieldValues($event)\"></ui-form-wrapper>\r\n \r\n <div style=\"width: 33%;\">\r\n <ui-field-options-editor></ui-field-options-editor>\r\n </div>\r\n \r\n <div class=\"show-btn\" (click)=\"showAdvanced = !showAdvanced\"> {{showAdvanced ? ('field_editor.hide_advanced' | uicTranslate) : ('field_editor.show_advanced' | uicTranslate)}} </div>\n \r\n <ui-form-wrapper [class.hidden]=\"!showAdvanced\"\r\n #advancedFieldsForm\r\n [schema]=\"formSchema\"\r\n (formChange)=\"updateFieldValues($event)\"> \r\n </ui-form-wrapper>\r\n\r\n </div>\r\n \r\n</div>\r\n", styles: [".field-editor{border:solid 1px var(--grey-300);border-radius:5px;overflow:hidden}.show-btn{text-decoration:underline;color:var(--blue-700);cursor:pointer;font-size:14px}.hidden{display:none}.field-header{font-weight:600;display:flex;align-items:center;padding:5px;justify-content:space-between;background-color:var(--grey-50);border-bottom:solid 1px var(--grey-300)}.field-header-buttons{display:flex;gap:5px}.field-drag-handle{cursor:grab;-webkit-user-select:none;user-select:none}.field-body{padding:10px}\n"] }]
|
|
7867
|
+
}], propDecorators: { fieldType: [{
|
|
7868
|
+
type: Input
|
|
7869
|
+
}], delete: [{
|
|
7870
|
+
type: Output
|
|
7871
|
+
}], duplicate: [{
|
|
7872
|
+
type: Output
|
|
7873
|
+
}], fieldChange: [{
|
|
7874
|
+
type: Output
|
|
7875
|
+
}], dragStart: [{
|
|
7876
|
+
type: Output
|
|
7877
|
+
}], requiredFieldsForm: [{
|
|
7878
|
+
type: ViewChild,
|
|
7879
|
+
args: ['requiredFieldsForm']
|
|
7880
|
+
}], advancedFieldsForm: [{
|
|
7881
|
+
type: ViewChild,
|
|
7882
|
+
args: ['advancedFieldsForm']
|
|
7883
|
+
}] } });
|
|
7884
|
+
|
|
7885
|
+
class FormPreviewComponent {
|
|
7886
|
+
data;
|
|
7887
|
+
schema = { cols: 2, blocks: [] };
|
|
7888
|
+
constructor(data) {
|
|
7889
|
+
this.data = data;
|
|
7890
|
+
this.schema = data.schema;
|
|
7891
|
+
}
|
|
7892
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormPreviewComponent, deps: [{ token: MODAL_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
7893
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FormPreviewComponent, isStandalone: true, selector: "lib-form-preview", ngImport: i0, template: "<ui-form-wrapper [schema]=\"schema\"></ui-form-wrapper>\r\n", styles: [""], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "loading", "disabled", "showButtons", "fillSelects", "initialValues"], outputs: ["formSubmit", "formChange"] }] });
|
|
7894
|
+
}
|
|
7895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormPreviewComponent, decorators: [{
|
|
7896
|
+
type: Component,
|
|
7897
|
+
args: [{ selector: 'lib-form-preview', imports: [UicFormWrapperComponent], template: "<ui-form-wrapper [schema]=\"schema\"></ui-form-wrapper>\r\n" }]
|
|
7898
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
7899
|
+
type: Inject,
|
|
7900
|
+
args: [MODAL_DATA]
|
|
7901
|
+
}] }] });
|
|
7902
|
+
|
|
7903
|
+
class UicUserFormbuilderComponent {
|
|
7904
|
+
tinyAlert = inject(UicTinyAlertService);
|
|
7905
|
+
translateService = inject(UicTranslateService);
|
|
7906
|
+
modalService = inject(UicModalService);
|
|
7907
|
+
fieldEditors;
|
|
7908
|
+
types = FIELDS_CONFIG;
|
|
7909
|
+
cols = 2;
|
|
7910
|
+
blocks = [{ title: '', subtitle: '', fields: [] }];
|
|
7911
|
+
editableBlocks = [{ id: 0, title: '', subtitle: '', showOptions: false, fields: [] }];
|
|
7912
|
+
nextFieldId = 0;
|
|
7913
|
+
nextBlockId = 1;
|
|
7914
|
+
activeBlockId = this.editableBlocks[0]?.id ?? 0;
|
|
7915
|
+
draggingField;
|
|
7916
|
+
insertionPoint;
|
|
7917
|
+
ngOnInit() {
|
|
7918
|
+
this.addField({ value: 'text', label: 'Texto', icon: '', detail: '', properties: [] }, this.editableBlocks[0].id, { close() { } });
|
|
7919
|
+
}
|
|
7920
|
+
get blockTabs() {
|
|
7921
|
+
return this.editableBlocks.map((block, index) => ({
|
|
7922
|
+
key: String(block.id),
|
|
7923
|
+
text: block.title?.trim() ? block.title : `Bloque ${index + 1}`
|
|
7924
|
+
}));
|
|
7925
|
+
}
|
|
7926
|
+
addField(newFieldType, blockId, ref) {
|
|
7927
|
+
ref.close();
|
|
7928
|
+
const blockIdx = this.editableBlocks.findIndex(block => block.id === blockId);
|
|
7929
|
+
if (blockIdx === -1)
|
|
7930
|
+
return;
|
|
7931
|
+
const fieldId = this.nextFieldId++;
|
|
7932
|
+
const editableBlocks = [...this.editableBlocks];
|
|
7933
|
+
const editableBlock = editableBlocks[blockIdx];
|
|
7934
|
+
editableBlocks[blockIdx] = {
|
|
7935
|
+
...editableBlock,
|
|
7936
|
+
fields: [...editableBlock.fields, { id: fieldId, fieldType: newFieldType }]
|
|
7937
|
+
};
|
|
7938
|
+
this.editableBlocks = editableBlocks;
|
|
7939
|
+
const blocks = [...this.blocks];
|
|
7940
|
+
const schemaBlock = blocks[blockIdx] ?? { title: '', subtitle: '', fields: [] };
|
|
7941
|
+
blocks[blockIdx] = {
|
|
7942
|
+
...schemaBlock,
|
|
7943
|
+
fields: [...schemaBlock.fields, { name: '', type: newFieldType.value }]
|
|
7944
|
+
};
|
|
7945
|
+
this.blocks = blocks;
|
|
7946
|
+
}
|
|
7947
|
+
addBlock() {
|
|
7948
|
+
const newBlockId = this.nextBlockId++;
|
|
7949
|
+
this.editableBlocks = [...this.editableBlocks, {
|
|
7950
|
+
id: newBlockId,
|
|
7951
|
+
title: '',
|
|
7952
|
+
subtitle: '',
|
|
7953
|
+
showOptions: false,
|
|
7954
|
+
fields: []
|
|
7955
|
+
}];
|
|
7956
|
+
this.blocks = [...this.blocks, { title: '', subtitle: '', fields: [] }];
|
|
7957
|
+
this.activeBlockId = newBlockId;
|
|
7958
|
+
}
|
|
7959
|
+
selectBlock(tabKey) {
|
|
7960
|
+
const parsed = Number(tabKey);
|
|
7961
|
+
if (!Number.isNaN(parsed)) {
|
|
7962
|
+
this.activeBlockId = parsed;
|
|
7963
|
+
}
|
|
7964
|
+
}
|
|
7965
|
+
onFieldDragStart(blockId, index, event) {
|
|
7966
|
+
const current = event.dataTransfer;
|
|
7967
|
+
if (current) {
|
|
7968
|
+
current.effectAllowed = 'move';
|
|
7969
|
+
current.setData('text/plain', JSON.stringify({ blockId, index }));
|
|
7970
|
+
}
|
|
7971
|
+
this.draggingField = { blockId, index };
|
|
7972
|
+
this.insertionPoint = undefined;
|
|
7973
|
+
event.stopPropagation();
|
|
7974
|
+
}
|
|
7975
|
+
onFieldDropSlotOver(event, blockId, index) {
|
|
7976
|
+
event.preventDefault();
|
|
7977
|
+
if (this.draggingField?.blockId !== blockId)
|
|
7978
|
+
return;
|
|
7979
|
+
this.insertionPoint = { blockId, index };
|
|
7980
|
+
}
|
|
7981
|
+
onFieldDropSlotLeave(event, blockId, index) {
|
|
7982
|
+
if (this.insertionPoint?.blockId === blockId && this.insertionPoint.index === index) {
|
|
7983
|
+
event.preventDefault();
|
|
7984
|
+
this.insertionPoint = undefined;
|
|
7985
|
+
}
|
|
7986
|
+
}
|
|
7987
|
+
onFieldDrop(event, blockId, targetIndex) {
|
|
7988
|
+
event.preventDefault();
|
|
7989
|
+
event.stopPropagation();
|
|
7990
|
+
const dragPayload = this.getDragPayload(event);
|
|
7991
|
+
const dragBlockId = dragPayload?.blockId ?? this.draggingField?.blockId;
|
|
7992
|
+
const dragIndex = dragPayload?.index ?? this.draggingField?.index;
|
|
7993
|
+
if (dragBlockId === undefined || dragIndex === undefined)
|
|
7994
|
+
return;
|
|
7995
|
+
if (dragBlockId !== blockId || dragIndex === targetIndex)
|
|
7996
|
+
return;
|
|
7997
|
+
const blockIdx = this.editableBlocks.findIndex(block => block.id === blockId);
|
|
7998
|
+
if (blockIdx === -1)
|
|
7999
|
+
return;
|
|
8000
|
+
const editableFields = [...this.editableBlocks[blockIdx].fields];
|
|
8001
|
+
const schemaFields = [...(this.blocks[blockIdx]?.fields ?? [])];
|
|
8002
|
+
if (dragIndex < 0 || dragIndex >= editableFields.length)
|
|
8003
|
+
return;
|
|
8004
|
+
const movedEditableField = editableFields.splice(dragIndex, 1)[0];
|
|
8005
|
+
const movedSchemaField = schemaFields.splice(dragIndex, 1)[0];
|
|
8006
|
+
const normalizedIndex = targetIndex > dragIndex ? targetIndex - 1 : targetIndex;
|
|
8007
|
+
if (normalizedIndex === dragIndex) {
|
|
8008
|
+
this.clearDragState();
|
|
8009
|
+
return;
|
|
8010
|
+
}
|
|
8011
|
+
editableFields.splice(normalizedIndex, 0, movedEditableField);
|
|
8012
|
+
if (movedSchemaField) {
|
|
8013
|
+
schemaFields.splice(normalizedIndex, 0, movedSchemaField);
|
|
8014
|
+
}
|
|
8015
|
+
const nextEditableBlocks = [...this.editableBlocks];
|
|
8016
|
+
nextEditableBlocks[blockIdx] = { ...nextEditableBlocks[blockIdx], fields: editableFields };
|
|
8017
|
+
const nextBlocks = [...this.blocks];
|
|
8018
|
+
nextBlocks[blockIdx] = { ...nextBlocks[blockIdx], fields: schemaFields };
|
|
8019
|
+
this.editableBlocks = nextEditableBlocks;
|
|
8020
|
+
this.blocks = nextBlocks;
|
|
8021
|
+
this.clearDragState();
|
|
8022
|
+
}
|
|
8023
|
+
onFieldDragEnd(blockId) {
|
|
8024
|
+
if (this.draggingField?.blockId === blockId) {
|
|
8025
|
+
this.clearDragState();
|
|
8026
|
+
}
|
|
8027
|
+
}
|
|
8028
|
+
getDragPayload(event) {
|
|
8029
|
+
const data = event.dataTransfer?.getData('text/plain');
|
|
8030
|
+
if (!data)
|
|
8031
|
+
return undefined;
|
|
8032
|
+
try {
|
|
8033
|
+
return JSON.parse(data);
|
|
8034
|
+
}
|
|
8035
|
+
catch {
|
|
8036
|
+
return undefined;
|
|
8037
|
+
}
|
|
8038
|
+
}
|
|
8039
|
+
isDropSlotActive(blockId, index) {
|
|
8040
|
+
return this.insertionPoint?.blockId === blockId && this.insertionPoint.index === index;
|
|
8041
|
+
}
|
|
8042
|
+
clearDragState() {
|
|
8043
|
+
this.draggingField = undefined;
|
|
8044
|
+
this.insertionPoint = undefined;
|
|
8045
|
+
}
|
|
8046
|
+
printForm() {
|
|
8047
|
+
const editors = this.fieldEditors?.toArray() ?? [];
|
|
8048
|
+
const fields = this.blocks.flatMap(block => block.fields);
|
|
8049
|
+
const formValid = editors.every(editor => editor.submitForms());
|
|
8050
|
+
const hasRequiredFields = fields.every(field => !!field.name?.trim() && !!field.label?.trim());
|
|
8051
|
+
const nameToOriginal = new Map();
|
|
8052
|
+
const duplicated = [];
|
|
8053
|
+
for (const field of fields) {
|
|
8054
|
+
const rawName = field.name?.trim();
|
|
8055
|
+
const name = rawName?.toLowerCase();
|
|
8056
|
+
if (!name)
|
|
8057
|
+
continue;
|
|
8058
|
+
if (nameToOriginal.has(name)) {
|
|
8059
|
+
const duplicateName = nameToOriginal.get(name) ?? rawName;
|
|
8060
|
+
if (!duplicated.includes(duplicateName ?? ''))
|
|
8061
|
+
duplicated.push(duplicateName ?? '');
|
|
8062
|
+
}
|
|
8063
|
+
else {
|
|
8064
|
+
nameToOriginal.set(name, rawName);
|
|
8065
|
+
}
|
|
8066
|
+
}
|
|
8067
|
+
if (duplicated.length > 0) {
|
|
8068
|
+
const message = duplicated
|
|
8069
|
+
.map((name) => this.translateService.translate('form_builder.validation.duplicate_identifier', { identifier: name }))
|
|
8070
|
+
.join('<br>');
|
|
8071
|
+
this.tinyAlert.error(message, {
|
|
8072
|
+
title: 'form_builder.validation.duplicate_identifier_title'
|
|
8073
|
+
});
|
|
8074
|
+
}
|
|
8075
|
+
if (formValid && hasRequiredFields && duplicated.length === 0) {
|
|
8076
|
+
const formSchema = this.getFormSchema();
|
|
8077
|
+
this.modalService.openFloatingModal(FormPreviewComponent, {
|
|
8078
|
+
data: { schema: formSchema }
|
|
8079
|
+
});
|
|
8080
|
+
}
|
|
8081
|
+
}
|
|
8082
|
+
submitForm() {
|
|
8083
|
+
}
|
|
8084
|
+
updateField(blockId, fieldIdx, field) {
|
|
8085
|
+
const blockIdx = this.editableBlocks.findIndex(block => block.id === blockId);
|
|
8086
|
+
if (blockIdx === -1)
|
|
8087
|
+
return;
|
|
8088
|
+
const schemaField = {
|
|
8089
|
+
...field,
|
|
8090
|
+
type: this.blocks[blockIdx]?.fields?.[fieldIdx]?.type ?? field.type
|
|
8091
|
+
};
|
|
8092
|
+
const schemaBlocks = [...this.blocks];
|
|
8093
|
+
const schemaBlock = schemaBlocks[blockIdx] ?? { title: '', subtitle: '', fields: [] };
|
|
8094
|
+
const schemaFields = [...schemaBlock.fields];
|
|
8095
|
+
if (fieldIdx < 0 || fieldIdx >= schemaFields.length)
|
|
8096
|
+
return;
|
|
8097
|
+
schemaFields[fieldIdx] = schemaField;
|
|
8098
|
+
schemaBlocks[blockIdx] = { ...schemaBlock, fields: schemaFields };
|
|
8099
|
+
this.blocks = schemaBlocks;
|
|
8100
|
+
}
|
|
8101
|
+
deleteField(blockId, fieldIdx) {
|
|
8102
|
+
const blockIdx = this.editableBlocks.findIndex(block => block.id === blockId);
|
|
8103
|
+
if (blockIdx === -1)
|
|
8104
|
+
return;
|
|
8105
|
+
const editableBlocks = [...this.editableBlocks];
|
|
8106
|
+
const editableBlock = editableBlocks[blockIdx];
|
|
8107
|
+
editableBlock.fields = editableBlock.fields.filter((_, idx) => idx !== fieldIdx);
|
|
8108
|
+
editableBlocks[blockIdx] = editableBlock;
|
|
8109
|
+
this.editableBlocks = editableBlocks;
|
|
8110
|
+
const blocks = [...this.blocks];
|
|
8111
|
+
const schemaBlock = blocks[blockIdx];
|
|
8112
|
+
if (schemaBlock) {
|
|
8113
|
+
const nextFields = [...schemaBlock.fields];
|
|
8114
|
+
nextFields.splice(fieldIdx, 1);
|
|
8115
|
+
blocks[blockIdx] = { ...schemaBlock, fields: nextFields };
|
|
8116
|
+
}
|
|
8117
|
+
this.blocks = blocks;
|
|
8118
|
+
}
|
|
8119
|
+
updateBlockTitle(blockId, event) {
|
|
8120
|
+
const title = event.target?.value ?? '';
|
|
8121
|
+
const blockIdx = this.editableBlocks.findIndex(block => block.id === blockId);
|
|
8122
|
+
if (blockIdx === -1)
|
|
8123
|
+
return;
|
|
8124
|
+
const editableBlocks = [...this.editableBlocks];
|
|
8125
|
+
const editableBlock = editableBlocks[blockIdx];
|
|
8126
|
+
editableBlocks[blockIdx] = { ...editableBlock, title };
|
|
8127
|
+
this.editableBlocks = editableBlocks;
|
|
8128
|
+
const blocks = [...this.blocks];
|
|
8129
|
+
const schemaBlock = blocks[blockIdx] ?? { title: '', subtitle: '', fields: [] };
|
|
8130
|
+
blocks[blockIdx] = { ...schemaBlock, title };
|
|
8131
|
+
this.blocks = blocks;
|
|
8132
|
+
}
|
|
8133
|
+
updateBlockSubtitle(blockId, event) {
|
|
8134
|
+
const subtitle = event.target?.value ?? '';
|
|
8135
|
+
const blockIdx = this.editableBlocks.findIndex(block => block.id === blockId);
|
|
8136
|
+
if (blockIdx === -1)
|
|
8137
|
+
return;
|
|
8138
|
+
const editableBlocks = [...this.editableBlocks];
|
|
8139
|
+
const editableBlock = editableBlocks[blockIdx];
|
|
8140
|
+
editableBlocks[blockIdx] = { ...editableBlock, subtitle };
|
|
8141
|
+
this.editableBlocks = editableBlocks;
|
|
8142
|
+
const blocks = [...this.blocks];
|
|
8143
|
+
const schemaBlock = blocks[blockIdx] ?? { title: '', subtitle: '', fields: [] };
|
|
8144
|
+
blocks[blockIdx] = { ...schemaBlock, subtitle };
|
|
8145
|
+
this.blocks = blocks;
|
|
8146
|
+
}
|
|
8147
|
+
toggleBlockOptions(blockId) {
|
|
8148
|
+
const blockIdx = this.editableBlocks.findIndex(block => block.id === blockId);
|
|
8149
|
+
if (blockIdx === -1)
|
|
8150
|
+
return;
|
|
8151
|
+
const editableBlocks = [...this.editableBlocks];
|
|
8152
|
+
const editableBlock = editableBlocks[blockIdx];
|
|
8153
|
+
editableBlocks[blockIdx] = { ...editableBlock, showOptions: !editableBlock.showOptions };
|
|
8154
|
+
this.editableBlocks = editableBlocks;
|
|
8155
|
+
}
|
|
8156
|
+
getFormSchema() {
|
|
8157
|
+
return {
|
|
8158
|
+
cols: this.cols,
|
|
8159
|
+
blocks: this.blocks.map(block => ({
|
|
8160
|
+
...block,
|
|
8161
|
+
fields: block.fields.map(field => ({ ...field }))
|
|
8162
|
+
}))
|
|
8163
|
+
};
|
|
8164
|
+
}
|
|
8165
|
+
deleteBlock(idx) {
|
|
8166
|
+
}
|
|
8167
|
+
trackByBlock(_index, block) {
|
|
8168
|
+
return block.id;
|
|
8169
|
+
}
|
|
8170
|
+
trackByField(_index, field) {
|
|
8171
|
+
return field.id;
|
|
8172
|
+
}
|
|
8173
|
+
trackByType(_index, fieldType) {
|
|
8174
|
+
return fieldType.value;
|
|
8175
|
+
}
|
|
8176
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicUserFormbuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8177
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicUserFormbuilderComponent, isStandalone: true, selector: "ui-user-formbuilder", viewQueries: [{ propertyName: "fieldEditors", predicate: FieldEditorComponent, descendants: true }], ngImport: i0, template: "<ui-input label=\"Columnas\">\r\n <input type=\"text\" [(ngModel)]=\"cols\">\r\n</ui-input>\r\n\r\n<div class=\"field-editor-actions\">\r\n <ui-button type=\"bordered\" icon=\"ri-add-line\" color=\"black\" [text]=\"'form_builder.add_block' | uicTranslate\" (click)=\"addBlock()\"></ui-button>\r\n <div style=\"flex: 1;\"></div>\r\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-eye-line\" [text]=\"'form_builder.preview_form' | uicTranslate\" (click)=\"printForm()\"></ui-button>\r\n <ui-button color=\"black\" icon=\"ri-check-line\" [text]=\"'form_builder.submit_form' | uicTranslate\" (click)=\"submitForm()\"></ui-button>\r\n</div>\r\n\r\n<ui-tabs-button\r\n [tabs]=\"blockTabs\"\r\n [activeTab]=\"activeBlockId.toString()\"\r\n (activeTabChange)=\"selectBlock($event)\">\r\n</ui-tabs-button>\r\n\r\n@for (block of editableBlocks; track trackByBlock($index, block)) {\r\n <div class=\"field-block\" [style.display]=\"activeBlockId === block.id ? 'block' : 'none'\">\r\n <div class=\"block-editor\">\r\n <div class=\"field-editor-actions\">\r\n <div style=\"flex: 1 1;\">\r\n <div class=\"title-block\"> \r\n <div class=\"title-block-label\"> {{'form_builder.block_title' | uicTranslate}} </div>\r\n <ui-input> <input type=\"text\" [placeholder]=\"'form_builder.block_title' | uicTranslate\" [value]=\"block.title ?? ''\" (input)=\"updateBlockTitle(block.id, $event)\"> </ui-input>\r\n </div>\r\n <div class=\"title-block\">\r\n <div class=\"title-block-label\"> {{'form_builder.block_subtitle' | uicTranslate}} </div>\r\n <ui-input> <input type=\"text\" [placeholder]=\"'form_builder.block_subtitle' | uicTranslate\" [value]=\"block.subtitle ?? ''\" (input)=\"updateBlockSubtitle(block.id, $event)\"> </ui-input>\r\n </div>\r\n </div>\r\n <div class=\"block-actions\">\r\n <ui-button (click)=\"deleteBlock($index)\" color=\"red\" icon=\"ri-delete-bin-line\" type=\"bordered\"> {{'form_builder.delete_block' | uicTranslate}} </ui-button>\r\n <ui-overlay-card #overlayRef>\r\n <ui-button button color=\"black\" type=\"bordered\" icon=\"ri-add-line\" > {{'form_builder.add_new_field' | uicTranslate}} </ui-button>\r\n <div content class=\"field-types\">\r\n @for (type of types; track trackByType($index, type)) {\r\n <div (click)=\"addField(type, block.id,overlayRef)\" class=\"field-type\">\r\n <b>{{type.label}}</b>\r\n <p>{{type.detail}}</p>\r\n </div>\r\n }\r\n </div>\r\n </ui-overlay-card>\r\n </div>\r\n </div>\r\n\r\n @if (block.fields.length === 0) {\r\n <div\r\n class=\"field-drop-slot field-empty-slot\"\r\n [class.field-drop-slot--active]=\"isDropSlotActive(block.id, 0)\"\r\n (dragover)=\"onFieldDropSlotOver($event, block.id, 0)\"\r\n (dragleave)=\"onFieldDropSlotLeave($event, block.id, 0)\"\r\n (drop)=\"onFieldDrop($event, block.id, 0)\"\r\n (dragend)=\"onFieldDragEnd(block.id)\"\r\n >\r\n <i class=\"ri-hammer-line\"></i>\r\n {{'form_builder.no_fields' | uicTranslate}}\r\n </div>\r\n } @else {\r\n @for (field of block.fields; track trackByField($index, field); let i = $index) {\r\n <div\r\n class=\"field-drop-slot\"\r\n [class.field-drop-slot--active]=\"isDropSlotActive(block.id, i)\"\r\n (dragover)=\"onFieldDropSlotOver($event, block.id, i)\"\r\n (dragleave)=\"onFieldDropSlotLeave($event, block.id, i)\"\r\n (drop)=\"onFieldDrop($event, block.id, i)\"\r\n (dragend)=\"onFieldDragEnd(block.id)\"\r\n ></div>\r\n <div\r\n class=\"field-sort-zone\"\r\n >\r\n <lib-field-editor\r\n [fieldType]=\"field.fieldType\"\r\n (delete)=\"deleteField(block.id, i)\"\r\n (fieldChange)=\"updateField(block.id, i, $event)\"\r\n (dragStart)=\"onFieldDragStart(block.id, i, $event)\">\r\n </lib-field-editor>\r\n </div>\r\n }\r\n <div\r\n class=\"field-drop-slot field-drop-slot--last\"\r\n [class.field-drop-slot--active]=\"isDropSlotActive(block.id, block.fields.length)\"\r\n (dragover)=\"onFieldDropSlotOver($event, block.id, block.fields.length)\"\r\n (dragleave)=\"onFieldDropSlotLeave($event, block.id, block.fields.length)\"\r\n (drop)=\"onFieldDrop($event, block.id, block.fields.length)\"\r\n (dragend)=\"onFieldDragEnd(block.id)\"\r\n ></div>\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [".field-types{display:flex;gap:10px;flex-wrap:wrap;padding:10px;max-width:700px}.field-types>.field-type{padding:10px 15px;border:solid 1px var(--grey-300);border-radius:20px;max-width:150px;transition:border-color .3s ease,color .3s ease;cursor:pointer}.field-types>.field-type>p{margin-top:8px;font-size:13px;font-weight:300;white-space:wrap}.field-types>.field-type>b{font-weight:600}.field-types>.field-type:hover{border:solid 1px var(--primary-800)}.field-types>.field-type:hover>b{color:var(--primary-800)}.fileds-label{display:flex;justify-content:space-between}.fields-container{display:flex;flex-direction:column;gap:10px}.field-editor-actions{display:flex;justify-content:flex-end;gap:10px;padding:10px 0}.field-block{border:solid 1px var(--grey-300);border-radius:5px;padding:10px;margin:10px}.title-block{display:flex;gap:10px;margin-bottom:10px}.title-block-label{display:flex;align-items:center;justify-content:center;color:var(--grey-700);background-color:var(--grey-300);text-align:center;width:100px;border-radius:5px}.nofields{display:flex;flex-direction:column;align-items:center;gap:10px;padding:20px;color:var(--grey-500)}.nofields i{color:var(--grey-400);font-size:50px}.block-editor{display:flex;flex-direction:column;gap:10px}.field-sort-zone{display:block;border-radius:8px}.field-drop-slot{position:relative;height:12px;border-radius:8px;border:1px solid transparent}.field-drop-slot--active{height:28px;border-color:var(--primary-500);background-color:color-mix(in srgb,var(--primary-100) 40%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary-100) 45%,transparent)}.field-drop-slot--active:before{content:\"\";position:absolute;left:0;top:50%;transform:translateY(-50%);height:3px;width:100%;background:var(--primary-500)}.field-empty-slot{min-height:80px;display:flex;flex-direction:column;align-items:center;gap:10px;justify-content:center;color:var(--grey-500);border-style:dashed}.field-empty-slot i{color:var(--grey-400);font-size:50px}.field-drop-slot--last{margin-top:2px}.block-actions{display:flex;border-radius:10px;flex-direction:column;gap:10px;justify-content:center;align-items:center}\n"], dependencies: [{ kind: "component", type: FieldEditorComponent, selector: "lib-field-editor", inputs: ["fieldType"], outputs: ["delete", "duplicate", "fieldChange", "dragStart"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"], outputs: ["clickButton"] }, { kind: "component", type: UicOverlayCardComponent, selector: "ui-overlay-card" }, { kind: "component", type: UicTabsButtonComponent, selector: "ui-tabs-button", inputs: ["tabs", "activeTab"], outputs: ["activeTabChange"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { 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"] }] });
|
|
8178
|
+
}
|
|
8179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicUserFormbuilderComponent, decorators: [{
|
|
8180
|
+
type: Component,
|
|
8181
|
+
args: [{ selector: 'ui-user-formbuilder', imports: [FieldEditorComponent, UicButtonComponent, UicInputComponent, UicOverlayCardComponent, UicTabsButtonComponent, UicTranslatePipe, FormsModule], template: "<ui-input label=\"Columnas\">\r\n <input type=\"text\" [(ngModel)]=\"cols\">\r\n</ui-input>\r\n\r\n<div class=\"field-editor-actions\">\r\n <ui-button type=\"bordered\" icon=\"ri-add-line\" color=\"black\" [text]=\"'form_builder.add_block' | uicTranslate\" (click)=\"addBlock()\"></ui-button>\r\n <div style=\"flex: 1;\"></div>\r\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-eye-line\" [text]=\"'form_builder.preview_form' | uicTranslate\" (click)=\"printForm()\"></ui-button>\r\n <ui-button color=\"black\" icon=\"ri-check-line\" [text]=\"'form_builder.submit_form' | uicTranslate\" (click)=\"submitForm()\"></ui-button>\r\n</div>\r\n\r\n<ui-tabs-button\r\n [tabs]=\"blockTabs\"\r\n [activeTab]=\"activeBlockId.toString()\"\r\n (activeTabChange)=\"selectBlock($event)\">\r\n</ui-tabs-button>\r\n\r\n@for (block of editableBlocks; track trackByBlock($index, block)) {\r\n <div class=\"field-block\" [style.display]=\"activeBlockId === block.id ? 'block' : 'none'\">\r\n <div class=\"block-editor\">\r\n <div class=\"field-editor-actions\">\r\n <div style=\"flex: 1 1;\">\r\n <div class=\"title-block\"> \r\n <div class=\"title-block-label\"> {{'form_builder.block_title' | uicTranslate}} </div>\r\n <ui-input> <input type=\"text\" [placeholder]=\"'form_builder.block_title' | uicTranslate\" [value]=\"block.title ?? ''\" (input)=\"updateBlockTitle(block.id, $event)\"> </ui-input>\r\n </div>\r\n <div class=\"title-block\">\r\n <div class=\"title-block-label\"> {{'form_builder.block_subtitle' | uicTranslate}} </div>\r\n <ui-input> <input type=\"text\" [placeholder]=\"'form_builder.block_subtitle' | uicTranslate\" [value]=\"block.subtitle ?? ''\" (input)=\"updateBlockSubtitle(block.id, $event)\"> </ui-input>\r\n </div>\r\n </div>\r\n <div class=\"block-actions\">\r\n <ui-button (click)=\"deleteBlock($index)\" color=\"red\" icon=\"ri-delete-bin-line\" type=\"bordered\"> {{'form_builder.delete_block' | uicTranslate}} </ui-button>\r\n <ui-overlay-card #overlayRef>\r\n <ui-button button color=\"black\" type=\"bordered\" icon=\"ri-add-line\" > {{'form_builder.add_new_field' | uicTranslate}} </ui-button>\r\n <div content class=\"field-types\">\r\n @for (type of types; track trackByType($index, type)) {\r\n <div (click)=\"addField(type, block.id,overlayRef)\" class=\"field-type\">\r\n <b>{{type.label}}</b>\r\n <p>{{type.detail}}</p>\r\n </div>\r\n }\r\n </div>\r\n </ui-overlay-card>\r\n </div>\r\n </div>\r\n\r\n @if (block.fields.length === 0) {\r\n <div\r\n class=\"field-drop-slot field-empty-slot\"\r\n [class.field-drop-slot--active]=\"isDropSlotActive(block.id, 0)\"\r\n (dragover)=\"onFieldDropSlotOver($event, block.id, 0)\"\r\n (dragleave)=\"onFieldDropSlotLeave($event, block.id, 0)\"\r\n (drop)=\"onFieldDrop($event, block.id, 0)\"\r\n (dragend)=\"onFieldDragEnd(block.id)\"\r\n >\r\n <i class=\"ri-hammer-line\"></i>\r\n {{'form_builder.no_fields' | uicTranslate}}\r\n </div>\r\n } @else {\r\n @for (field of block.fields; track trackByField($index, field); let i = $index) {\r\n <div\r\n class=\"field-drop-slot\"\r\n [class.field-drop-slot--active]=\"isDropSlotActive(block.id, i)\"\r\n (dragover)=\"onFieldDropSlotOver($event, block.id, i)\"\r\n (dragleave)=\"onFieldDropSlotLeave($event, block.id, i)\"\r\n (drop)=\"onFieldDrop($event, block.id, i)\"\r\n (dragend)=\"onFieldDragEnd(block.id)\"\r\n ></div>\r\n <div\r\n class=\"field-sort-zone\"\r\n >\r\n <lib-field-editor\r\n [fieldType]=\"field.fieldType\"\r\n (delete)=\"deleteField(block.id, i)\"\r\n (fieldChange)=\"updateField(block.id, i, $event)\"\r\n (dragStart)=\"onFieldDragStart(block.id, i, $event)\">\r\n </lib-field-editor>\r\n </div>\r\n }\r\n <div\r\n class=\"field-drop-slot field-drop-slot--last\"\r\n [class.field-drop-slot--active]=\"isDropSlotActive(block.id, block.fields.length)\"\r\n (dragover)=\"onFieldDropSlotOver($event, block.id, block.fields.length)\"\r\n (dragleave)=\"onFieldDropSlotLeave($event, block.id, block.fields.length)\"\r\n (drop)=\"onFieldDrop($event, block.id, block.fields.length)\"\r\n (dragend)=\"onFieldDragEnd(block.id)\"\r\n ></div>\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [".field-types{display:flex;gap:10px;flex-wrap:wrap;padding:10px;max-width:700px}.field-types>.field-type{padding:10px 15px;border:solid 1px var(--grey-300);border-radius:20px;max-width:150px;transition:border-color .3s ease,color .3s ease;cursor:pointer}.field-types>.field-type>p{margin-top:8px;font-size:13px;font-weight:300;white-space:wrap}.field-types>.field-type>b{font-weight:600}.field-types>.field-type:hover{border:solid 1px var(--primary-800)}.field-types>.field-type:hover>b{color:var(--primary-800)}.fileds-label{display:flex;justify-content:space-between}.fields-container{display:flex;flex-direction:column;gap:10px}.field-editor-actions{display:flex;justify-content:flex-end;gap:10px;padding:10px 0}.field-block{border:solid 1px var(--grey-300);border-radius:5px;padding:10px;margin:10px}.title-block{display:flex;gap:10px;margin-bottom:10px}.title-block-label{display:flex;align-items:center;justify-content:center;color:var(--grey-700);background-color:var(--grey-300);text-align:center;width:100px;border-radius:5px}.nofields{display:flex;flex-direction:column;align-items:center;gap:10px;padding:20px;color:var(--grey-500)}.nofields i{color:var(--grey-400);font-size:50px}.block-editor{display:flex;flex-direction:column;gap:10px}.field-sort-zone{display:block;border-radius:8px}.field-drop-slot{position:relative;height:12px;border-radius:8px;border:1px solid transparent}.field-drop-slot--active{height:28px;border-color:var(--primary-500);background-color:color-mix(in srgb,var(--primary-100) 40%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary-100) 45%,transparent)}.field-drop-slot--active:before{content:\"\";position:absolute;left:0;top:50%;transform:translateY(-50%);height:3px;width:100%;background:var(--primary-500)}.field-empty-slot{min-height:80px;display:flex;flex-direction:column;align-items:center;gap:10px;justify-content:center;color:var(--grey-500);border-style:dashed}.field-empty-slot i{color:var(--grey-400);font-size:50px}.field-drop-slot--last{margin-top:2px}.block-actions{display:flex;border-radius:10px;flex-direction:column;gap:10px;justify-content:center;align-items:center}\n"] }]
|
|
8182
|
+
}], propDecorators: { fieldEditors: [{
|
|
8183
|
+
type: ViewChildren,
|
|
8184
|
+
args: [FieldEditorComponent]
|
|
8185
|
+
}] } });
|
|
8186
|
+
|
|
7297
8187
|
class FirstCapitalPipe {
|
|
7298
8188
|
transform(str, max = 0) {
|
|
7299
8189
|
if (str == null) {
|
|
@@ -7327,5 +8217,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7327
8217
|
* Generated bundle index. Do not edit.
|
|
7328
8218
|
*/
|
|
7329
8219
|
|
|
7330
|
-
export { BASE_FORM_FIELDS, DROPDOWN_OVERLAY_CONTROLS, EXTRA_FORM_FIELDS, FIELDS_CONFIG, FirstCapitalPipe, LAYOUT_FORM_FIELDS, MODAL_CLOSE_EVENT, MODAL_CLOSE_REQUEST, MODAL_COMPONENT, MODAL_CONFIG, MODAL_DATA, UIC_TRANSLATE_CONFIG, UiDropdownCloseDirective, UiModalRef, UicAccordionComponent, UicActionButtonComponent, UicAlertContainerComponent, UicButtonComponent, UicCheckboxComponent, UicDatePickerComponent, UicDropdownContainerComponent, UicExcelTableComponent, UicFileInputComponent, UicFormWrapperComponent, UicInputComponent, UicKpiCardComponent, UicModalService, UicMultySearcherComponent, UicMultySelectComponent, UicNameInitsPipe, UicOverlayCardComponent, UicPhoneInputComponent, UicPoolOptionsComponent, UicPortletCardComponent, UicProgressBarComponent, UicPushAlertService, UicRadioComponent, UicSearcherComponent, UicSelectComponent, UicShortTableComponent, UicSignaturePadComponent, UicSkeletonCardsComponent, UicSkeletonLoaderComponent, UicSliderComponent, UicStepTabsComponent, UicStepsFormComponent, UicSwichComponent, UicTableComponent, UicTabsButtonComponent, UicTagSelectorComponent, UicTextareaAutoresizeDirective, UicTextareaAutoresizeMaxRowsDirective, UicTextareaAutoresizeMinRowsDirective, UicTimePickerComponent, UicTinyAlertService, UicToolTipDirective, UicTranslatePipe, UicTranslateService, UicTreeAdminComponent, UicWorkPanelComponent, animatedRow, fadeAndRise, fadeBackdrop, helperFormMapFormdataToObject, helperTableMapDatoToColums, highlightRow, isMobile, provideUicTranslateConfig, pushTop, sideModal, simpleFade };
|
|
8220
|
+
export { BASE_FORM_FIELDS, DROPDOWN_OVERLAY_CONTROLS, EXTRA_FORM_FIELDS, FIELDS_CONFIG, FirstCapitalPipe, LAYOUT_FORM_FIELDS, MODAL_CLOSE_EVENT, MODAL_CLOSE_REQUEST, MODAL_COMPONENT, MODAL_CONFIG, MODAL_DATA, UIC_TRANSLATE_CONFIG, UiDropdownCloseDirective, UiModalRef, UicAccordionComponent, UicActionButtonComponent, UicAlertContainerComponent, UicButtonComponent, UicCheckboxComponent, UicDatePickerComponent, UicDropdownContainerComponent, UicEditableTableComponent, UicExcelTableComponent, UicFileInputComponent, UicFormWrapperComponent, UicInputComponent, UicKpiCardComponent, UicModalService, UicMultySearcherComponent, UicMultySelectComponent, UicNameInitsPipe, UicOverlayCardComponent, UicPhoneInputComponent, UicPoolOptionsComponent, UicPortletCardComponent, UicProgressBarComponent, UicPushAlertService, UicRadioComponent, UicSearcherComponent, UicSelectComponent, UicShortTableComponent, UicSignaturePadComponent, UicSkeletonCardsComponent, UicSkeletonLoaderComponent, UicSliderComponent, UicStepTabsComponent, UicStepsFormComponent, UicSwichComponent, UicTableComponent, UicTabsButtonComponent, UicTagSelectorComponent, UicTextareaAutoresizeDirective, UicTextareaAutoresizeMaxRowsDirective, UicTextareaAutoresizeMinRowsDirective, UicTimePickerComponent, UicTinyAlertService, UicToolTipDirective, UicTranslatePipe, UicTranslateService, UicTreeAdminComponent, UicUserFormbuilderComponent, UicWorkPanelComponent, animatedRow, fadeAndRise, fadeBackdrop, helperFormMapFormdataToObject, helperTableMapDatoToColums, highlightRow, isMobile, provideUicTranslateConfig, pushTop, sideModal, simpleFade };
|
|
7331
8221
|
//# sourceMappingURL=ui-core-abv.mjs.map
|