ng-components-tsi 0.0.38 → 0.0.39
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/ng-components-tsi.mjs +5063 -0
- package/fesm2022/ng-components-tsi.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/directivas/acciones/atajos.directive.d.ts +8 -0
- package/lib/directivas/animaciones/fade-animation.d.ts +3 -0
- package/lib/directivas/estilos/animated-checkbox.directive.d.ts +9 -0
- package/lib/directivas/estilos/button.constants.d.ts +64 -0
- package/lib/directivas/estilos/buttons-modal.directive.d.ts +11 -0
- package/lib/directivas/estilos/buttons-outline-directive.d.ts +11 -0
- package/lib/directivas/estilos/icons.directive.d.ts +11 -0
- package/lib/directivas/inputs/caracteres-codigo.directive.d.ts +12 -0
- package/lib/directivas/inputs/decimal.directive.d.ts +13 -0
- package/lib/directivas/inputs/only-day.directive.d.ts +8 -0
- package/lib/directivas/inputs/only-number-flex.directive.d.ts +9 -0
- package/lib/directivas/inputs/only-number.directive.d.ts +8 -0
- package/lib/enums/table-events.d.ts +5 -0
- package/lib/modals/general/md-generico/md-generico.component.d.ts +25 -0
- package/lib/models/button-color.model.d.ts +3 -0
- package/{src/lib/models/button-properties.model.ts → lib/models/button-properties.model.d.ts} +7 -8
- package/lib/models/cell-rendered.d.ts +11 -0
- package/lib/models/comercial/documentos-cab-auxiliares.model.d.ts +17 -0
- package/{src/lib/models/dropdownoption.model.ts → lib/models/dropdownoption.model.d.ts} +14 -15
- package/lib/models/general/recursos.model.d.ts +271 -0
- package/lib/models/general/utils.interface.d.ts +57 -0
- package/lib/models/input-config.d.ts +25 -0
- package/{src/lib/models/selected-row.ts → lib/models/selected-row.d.ts} +4 -4
- package/{src/lib/models/table-data.model.ts → lib/models/table-data.model.d.ts} +21 -21
- package/lib/service/alert-confirmation.service.d.ts +26 -0
- package/lib/service/alert-error.service.d.ts +9 -0
- package/lib/service/alert.service.d.ts +33 -0
- package/lib/service/formateador.service.d.ts +10 -0
- package/lib/service/toast.service.d.ts +25 -0
- package/lib/ui/alerts/alert-confirmation/alert-confirmation.component.d.ts +32 -0
- package/lib/ui/alerts/alert-error/alert-error.component.d.ts +9 -0
- package/lib/ui/alerts/alerta/alerta.component.d.ts +12 -0
- package/lib/ui/alerts/badge/badge.component.d.ts +8 -0
- package/lib/ui/alerts/toaster/toaster.component.d.ts +17 -0
- package/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.d.ts +11 -0
- package/lib/ui/dropdown/dropdown-simple/dropdown.component.d.ts +13 -0
- package/lib/ui/forms/button/button.component.d.ts +47 -0
- package/lib/ui/forms/filter-toggle/filter-toggle.component.d.ts +9 -0
- package/lib/ui/forms/header/header.component.d.ts +17 -0
- package/lib/ui/forms/inputs/autocomplete/autocomplete.component.d.ts +43 -0
- package/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.d.ts +48 -0
- package/lib/ui/forms/inputs/check-box/check-box.component.d.ts +14 -0
- package/lib/ui/forms/inputs/doble-input/doble-input.component.d.ts +47 -0
- package/lib/ui/forms/inputs/input/input.component.d.ts +60 -0
- package/lib/ui/forms/inputs/input-clase/input-clase.component.d.ts +13 -0
- package/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.d.ts +8 -0
- package/lib/ui/forms/inputs/input-radio/input-radio.component.d.ts +24 -0
- package/lib/ui/forms/inputs/multiselected/multiselected.component.d.ts +39 -0
- package/lib/ui/forms/inputs/radio/radio.component.d.ts +14 -0
- package/lib/ui/forms/inputs/switch/switch.component.d.ts +20 -0
- package/lib/ui/forms/inputs/switch-activo/switch-activo.component.d.ts +21 -0
- package/lib/ui/forms/lists/list-option/list-option.component.d.ts +23 -0
- package/lib/ui/forms/lists/list-situaciones/list-situaciones.component.d.ts +28 -0
- package/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.d.ts +26 -0
- package/lib/ui/forms/sidebar/sidebar.component.d.ts +15 -0
- package/lib/ui/general/detalle-credito/detalle-credito.component.d.ts +8 -0
- package/lib/ui/general/montos-calcular/montos-calcular.component.d.ts +12 -0
- package/lib/ui/general/spinner/spinner.component.d.ts +5 -0
- package/lib/ui/tables/card-mobile/card-mobile.component.d.ts +17 -0
- package/lib/ui/tables/dropdown-menu/dropdown-menu.component.d.ts +43 -0
- package/lib/ui/tables/paginador/paginador.component.d.ts +20 -0
- package/lib/ui/tables/table-advance/table-advance.component.d.ts +94 -0
- package/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.d.ts +82 -0
- package/lib/ui/tables/table-agrupada/table-agrupada.component.d.ts +96 -0
- package/lib/ui/tables/table-busqueda/table-busqueda.component.d.ts +48 -0
- package/lib/ui/tables/table-detalle/table-detalle.component.d.ts +59 -0
- package/lib/ui/tables/table-simple/table-simple.component.d.ts +39 -0
- package/lib/ui/tables/table-ultimate/table-ultimate.component.d.ts +84 -0
- package/lib/ui/tabs/nav-tabs/nav-tabs.component.d.ts +9 -0
- package/lib/ui/tabs/tab-item/tab-item.component.d.ts +9 -0
- package/lib/utils/general/validaciones-simple.d.ts +2 -0
- package/lib/utils/general/validaciones.d.ts +11 -0
- package/lib/utils/helpers/api-result.d.ts +17 -0
- package/lib/utils/helpers/modal-result.d.ts +10 -0
- package/ng-components-tsi-0.0.39.tgz +0 -0
- package/package.json +31 -23
- package/{src/public-api.ts → public-api.d.ts} +68 -99
- package/ng-package.json +0 -7
- package/src/lib/directivas/acciones/atajos.directive.ts +0 -26
- package/src/lib/directivas/animaciones/fade-animation.ts +0 -45
- package/src/lib/directivas/animaciones/fade.directive.ts +0 -43
- package/src/lib/directivas/estilos/animated-checkbox.directive.ts +0 -26
- package/src/lib/directivas/estilos/button.constants.ts +0 -66
- package/src/lib/directivas/estilos/buttons-modal.directive.ts +0 -36
- package/src/lib/directivas/estilos/buttons-outline-directive.ts +0 -27
- package/src/lib/directivas/estilos/icons.directive.ts +0 -26
- package/src/lib/directivas/inputs/caracteres-codigo.directive.ts +0 -63
- package/src/lib/directivas/inputs/decimal.directive.ts +0 -51
- package/src/lib/directivas/inputs/only-day.directive.ts +0 -53
- package/src/lib/directivas/inputs/only-number-flex.directive.ts +0 -50
- package/src/lib/directivas/inputs/only-number.directive.ts +0 -53
- package/src/lib/enums/table-events.ts +0 -5
- package/src/lib/modals/general/md-generico/md-generico.component.html +0 -44
- package/src/lib/modals/general/md-generico/md-generico.component.scss +0 -4
- package/src/lib/modals/general/md-generico/md-generico.component.ts +0 -50
- package/src/lib/models/button-color.model.ts +0 -9
- package/src/lib/models/cell-rendered.ts +0 -12
- package/src/lib/models/comercial/documentos-cab-auxiliares.model.ts +0 -18
- package/src/lib/models/general/recursos.model.ts +0 -285
- package/src/lib/models/general/utils.interface.ts +0 -66
- package/src/lib/models/input-config.ts +0 -26
- package/src/lib/service/alert-confirmation.service.ts +0 -87
- package/src/lib/service/alert-error.service.ts +0 -27
- package/src/lib/service/alert.service.ts +0 -216
- package/src/lib/service/formateador.service.ts +0 -49
- package/src/lib/service/toast.service.ts +0 -75
- package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.html +0 -40
- package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.scss +0 -42
- package/src/lib/ui/alerts/alert-confirmation/alert-confirmation.component.ts +0 -118
- package/src/lib/ui/alerts/alert-error/alert-error.component.html +0 -11
- package/src/lib/ui/alerts/alert-error/alert-error.component.scss +0 -39
- package/src/lib/ui/alerts/alert-error/alert-error.component.ts +0 -27
- package/src/lib/ui/alerts/alerta/alerta.component.html +0 -18
- package/src/lib/ui/alerts/alerta/alerta.component.scss +0 -104
- package/src/lib/ui/alerts/alerta/alerta.component.ts +0 -25
- package/src/lib/ui/alerts/badge/badge.component.ts +0 -16
- package/src/lib/ui/alerts/toaster/toaster.component.html +0 -52
- package/src/lib/ui/alerts/toaster/toaster.component.scss +0 -275
- package/src/lib/ui/alerts/toaster/toaster.component.ts +0 -50
- package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.html +0 -20
- package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.scss +0 -11
- package/src/lib/ui/dropdown/dropdown-cdk/dropdown-cdk.component.ts +0 -18
- package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.html +0 -10
- package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.scss +0 -54
- package/src/lib/ui/dropdown/dropdown-simple/dropdown.component.ts +0 -36
- package/src/lib/ui/forms/button/button.component.html +0 -69
- package/src/lib/ui/forms/button/button.component.scss +0 -126
- package/src/lib/ui/forms/button/button.component.ts +0 -137
- package/src/lib/ui/forms/filter-toggle/filter-toggle.component.scss +0 -22
- package/src/lib/ui/forms/filter-toggle/filter-toggle.component.ts +0 -29
- package/src/lib/ui/forms/header/header.component.html +0 -22
- package/src/lib/ui/forms/header/header.component.scss +0 -22
- package/src/lib/ui/forms/header/header.component.ts +0 -40
- package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.html +0 -46
- package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.scss +0 -90
- package/src/lib/ui/forms/inputs/autocomplete/autocomplete.component.ts +0 -203
- package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.html +0 -61
- package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.scss +0 -128
- package/src/lib/ui/forms/inputs/autocomplete-cdk/autocomplete.component.ts +0 -145
- package/src/lib/ui/forms/inputs/check-box/check-box.component.html +0 -6
- package/src/lib/ui/forms/inputs/check-box/check-box.component.ts +0 -24
- package/src/lib/ui/forms/inputs/doble-input/doble-input.component.html +0 -60
- package/src/lib/ui/forms/inputs/doble-input/doble-input.component.scss +0 -86
- package/src/lib/ui/forms/inputs/doble-input/doble-input.component.ts +0 -129
- package/src/lib/ui/forms/inputs/input/input.component.html +0 -169
- package/src/lib/ui/forms/inputs/input/input.component.scss +0 -74
- package/src/lib/ui/forms/inputs/input/input.component.ts +0 -147
- package/src/lib/ui/forms/inputs/input-clase/input-clase.component.html +0 -30
- package/src/lib/ui/forms/inputs/input-clase/input-clase.component.scss +0 -0
- package/src/lib/ui/forms/inputs/input-clase/input-clase.component.ts +0 -28
- package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.html +0 -41
- package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.scss +0 -0
- package/src/lib/ui/forms/inputs/input-dinamico/input-dinamico.component.ts +0 -17
- package/src/lib/ui/forms/inputs/input-radio/input-radio.component.html +0 -26
- package/src/lib/ui/forms/inputs/input-radio/input-radio.component.scss +0 -53
- package/src/lib/ui/forms/inputs/input-radio/input-radio.component.ts +0 -36
- package/src/lib/ui/forms/inputs/multiselected/multiselected.component.html +0 -56
- package/src/lib/ui/forms/inputs/multiselected/multiselected.component.scss +0 -145
- package/src/lib/ui/forms/inputs/multiselected/multiselected.component.ts +0 -109
- package/src/lib/ui/forms/inputs/radio/radio.component.html +0 -7
- package/src/lib/ui/forms/inputs/radio/radio.component.scss +0 -0
- package/src/lib/ui/forms/inputs/radio/radio.component.ts +0 -23
- package/src/lib/ui/forms/inputs/switch/switch.component.html +0 -12
- package/src/lib/ui/forms/inputs/switch/switch.component.scss +0 -48
- package/src/lib/ui/forms/inputs/switch/switch.component.ts +0 -50
- package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.html +0 -12
- package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.scss +0 -65
- package/src/lib/ui/forms/inputs/switch-activo/switch-activo.component.ts +0 -52
- package/src/lib/ui/forms/lists/list-option/list-option.component.html +0 -24
- package/src/lib/ui/forms/lists/list-option/list-option.component.scss +0 -49
- package/src/lib/ui/forms/lists/list-option/list-option.component.ts +0 -35
- package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.html +0 -29
- package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.scss +0 -0
- package/src/lib/ui/forms/lists/list-situaciones/list-situaciones.component.ts +0 -99
- package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.html +0 -46
- package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.scss +0 -30
- package/src/lib/ui/forms/lists/multi-select-dropdown/multi-select-dropdown.component.ts +0 -96
- package/src/lib/ui/forms/sidebar/sidebar.component.html +0 -33
- package/src/lib/ui/forms/sidebar/sidebar.component.scss +0 -85
- package/src/lib/ui/forms/sidebar/sidebar.component.ts +0 -61
- package/src/lib/ui/general/detalle-credito/detalle-credito.component.html +0 -35
- package/src/lib/ui/general/detalle-credito/detalle-credito.component.scss +0 -35
- package/src/lib/ui/general/detalle-credito/detalle-credito.component.ts +0 -14
- package/src/lib/ui/general/montos-calcular/montos-calcular.component.html +0 -17
- package/src/lib/ui/general/montos-calcular/montos-calcular.component.scss +0 -36
- package/src/lib/ui/general/montos-calcular/montos-calcular.component.ts +0 -19
- package/src/lib/ui/general/spinner/spinner.component.html +0 -8
- package/src/lib/ui/general/spinner/spinner.component.scss +0 -96
- package/src/lib/ui/general/spinner/spinner.component.ts +0 -11
- package/src/lib/ui/tables/card-mobile/card-mobile.component.html +0 -34
- package/src/lib/ui/tables/card-mobile/card-mobile.component.scss +0 -0
- package/src/lib/ui/tables/card-mobile/card-mobile.component.ts +0 -36
- package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.html +0 -59
- package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.scss +0 -88
- package/src/lib/ui/tables/dropdown-menu/dropdown-menu.component.ts +0 -171
- package/src/lib/ui/tables/paginador/paginador.component.html +0 -12
- package/src/lib/ui/tables/paginador/paginador.component.scss +0 -27
- package/src/lib/ui/tables/paginador/paginador.component.ts +0 -49
- package/src/lib/ui/tables/table-advance/table-advance.component.html +0 -322
- package/src/lib/ui/tables/table-advance/table-advance.component.scss +0 -282
- package/src/lib/ui/tables/table-advance/table-advance.component.ts +0 -421
- package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.html +0 -226
- package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.scss +0 -282
- package/src/lib/ui/tables/table-advance-optimizada/table-advance-optimizada.component.ts +0 -352
- package/src/lib/ui/tables/table-agrupada/table-agrupada.component.html +0 -340
- package/src/lib/ui/tables/table-agrupada/table-agrupada.component.scss +0 -282
- package/src/lib/ui/tables/table-agrupada/table-agrupada.component.ts +0 -425
- package/src/lib/ui/tables/table-busqueda/table-busqueda.component.html +0 -130
- package/src/lib/ui/tables/table-busqueda/table-busqueda.component.scss +0 -189
- package/src/lib/ui/tables/table-busqueda/table-busqueda.component.ts +0 -199
- package/src/lib/ui/tables/table-detalle/table-detalle.component.html +0 -220
- package/src/lib/ui/tables/table-detalle/table-detalle.component.scss +0 -135
- package/src/lib/ui/tables/table-detalle/table-detalle.component.ts +0 -336
- package/src/lib/ui/tables/table-simple/table-simple.component.html +0 -116
- package/src/lib/ui/tables/table-simple/table-simple.component.scss +0 -70
- package/src/lib/ui/tables/table-simple/table-simple.component.ts +0 -141
- package/src/lib/ui/tables/table-ultimate/table-ultimate.component.html +0 -268
- package/src/lib/ui/tables/table-ultimate/table-ultimate.component.scss +0 -282
- package/src/lib/ui/tables/table-ultimate/table-ultimate.component.ts +0 -383
- package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.html +0 -12
- package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.scss +0 -100
- package/src/lib/ui/tabs/nav-tabs/nav-tabs.component.ts +0 -19
- package/src/lib/ui/tabs/tab-item/tab-item.component.html +0 -0
- package/src/lib/ui/tabs/tab-item/tab-item.component.scss +0 -0
- package/src/lib/ui/tabs/tab-item/tab-item.component.ts +0 -13
- package/src/lib/utils/ayuda-global/datatable.ts +0 -67
- package/src/lib/utils/ayuda-global/filtros-busqueda.ts +0 -51
- package/src/lib/utils/general/validaciones-simple.ts +0 -14
- package/src/lib/utils/general/validaciones.ts +0 -123
- package/src/lib/utils/helpers/api-result.ts +0 -95
- package/src/lib/utils/helpers/modal-result.ts +0 -34
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { Component, effect, ElementRef, input, model, output, QueryList, signal, ViewChildren } from '@angular/core';
|
|
2
|
-
import { NgClass } from '@angular/common';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { Subject, debounceTime, distinctUntilChanged } from 'rxjs';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-autocomplete',
|
|
8
|
-
imports: [NgClass, FormsModule],
|
|
9
|
-
templateUrl: './autocomplete.component.html',
|
|
10
|
-
styleUrl: './autocomplete.component.scss',
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
export class AutocompleteComponent {
|
|
14
|
-
|
|
15
|
-
private searchByIdSubject = new Subject<string>()
|
|
16
|
-
|
|
17
|
-
@ViewChildren('autocompleteItem') autocompleteItems!: QueryList<ElementRef>
|
|
18
|
-
|
|
19
|
-
wlabel = input<number>(0)
|
|
20
|
-
label = input<string>('')
|
|
21
|
-
isRequired = input<boolean>(false)
|
|
22
|
-
lista = input<any[]>([])
|
|
23
|
-
filteredItems = signal<any[]>([])
|
|
24
|
-
searchText = model<string>('')
|
|
25
|
-
selectedItem = signal<any>({})
|
|
26
|
-
showDropdown = signal<boolean>(false)
|
|
27
|
-
|
|
28
|
-
keyCodigo = input<string>('')
|
|
29
|
-
keyDescri = input<string>('')
|
|
30
|
-
|
|
31
|
-
withTodos = input<boolean>(false)
|
|
32
|
-
valuecod = model<any>()
|
|
33
|
-
searchIdText = model<string>('')
|
|
34
|
-
|
|
35
|
-
disabled1 = model<boolean>()
|
|
36
|
-
disabled2 = model<boolean>()
|
|
37
|
-
|
|
38
|
-
isVertical = input<boolean>(false)
|
|
39
|
-
showId = input<boolean>(false)
|
|
40
|
-
highlightedIndex = signal<number>(-1)
|
|
41
|
-
joinInfo = input<boolean>(false)
|
|
42
|
-
|
|
43
|
-
changeInput = output<void>()
|
|
44
|
-
|
|
45
|
-
activeFocus = input<boolean>(true)
|
|
46
|
-
|
|
47
|
-
customBorderColor = input<string>('')
|
|
48
|
-
customBoxShadow = input<string>('')
|
|
49
|
-
customTransition = input<string>('')
|
|
50
|
-
|
|
51
|
-
constructor() {
|
|
52
|
-
this.searchByIdSubject.pipe(
|
|
53
|
-
debounceTime(300),
|
|
54
|
-
distinctUntilChanged()
|
|
55
|
-
).subscribe(id => this.handleSearchById(id))
|
|
56
|
-
effect(() => {
|
|
57
|
-
const lista = this.lista()
|
|
58
|
-
const id = this.valuecod()
|
|
59
|
-
|
|
60
|
-
if (lista.length > 0) {
|
|
61
|
-
if (id == 'noption' || id == null || id == undefined || id == '') {
|
|
62
|
-
this.clearInputFields()
|
|
63
|
-
this.searchIdText.set('')
|
|
64
|
-
} else {
|
|
65
|
-
const item = lista.find(it => String(it[this.keyCodigo()]) == String(id))
|
|
66
|
-
if (item) {
|
|
67
|
-
this.updateFieldsForItem(item)
|
|
68
|
-
} else {
|
|
69
|
-
this.searchIdText.set(String(id))
|
|
70
|
-
this.searchText.set('')
|
|
71
|
-
this.selectedItem.set({})
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
onSearch() {
|
|
79
|
-
const searchTerm = this.searchText().trim()
|
|
80
|
-
if (searchTerm == '') {
|
|
81
|
-
this.filteredItems.set([...this.lista()])
|
|
82
|
-
if (this.joinInfo()) {
|
|
83
|
-
this.valuecod.set('noption')
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
const filtered = this.lista().filter(item => {
|
|
87
|
-
const matchesEntrada = item[this.keyDescri()].toLowerCase().includes(searchTerm.toLowerCase())
|
|
88
|
-
|
|
89
|
-
if (this.joinInfo()) {
|
|
90
|
-
const matchesSalida = String(item[this.keyCodigo()]).toLowerCase().includes(searchTerm.toLowerCase())
|
|
91
|
-
return matchesEntrada || matchesSalida
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return matchesEntrada
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
this.filteredItems.set(filtered)
|
|
98
|
-
|
|
99
|
-
if (this.joinInfo() && filtered.length == 0) {
|
|
100
|
-
this.valuecod.set('noption')
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
this.highlightedIndex.set(-1)
|
|
104
|
-
this.showDropdown.set(this.filteredItems().length > 0)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
onSearchById() {
|
|
108
|
-
this.searchByIdSubject.next(this.searchIdText().trim())
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
onClick() {
|
|
112
|
-
if (this.showDropdown()) {
|
|
113
|
-
this.showDropdown.set(false)
|
|
114
|
-
} else {
|
|
115
|
-
this.filteredItems.set([...this.lista()])
|
|
116
|
-
this.showDropdown.set(true)
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
selectItem(item: any) {
|
|
121
|
-
this.selectedItem.set(item)
|
|
122
|
-
this.valuecod.set(item[this.keyCodigo()])
|
|
123
|
-
this.updateFieldsForItem(item)
|
|
124
|
-
this.showDropdown.set(false)
|
|
125
|
-
this.emitirChange()
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
onKeyDown(event: KeyboardEvent) {
|
|
129
|
-
const items = this.filteredItems()
|
|
130
|
-
if (!items.length) return
|
|
131
|
-
|
|
132
|
-
switch (event.key) {
|
|
133
|
-
case 'ArrowDown':
|
|
134
|
-
event.preventDefault()
|
|
135
|
-
this.highlightedIndex.update(i => (i + 1) % items.length)
|
|
136
|
-
this.scrollToItem(this.highlightedIndex())
|
|
137
|
-
break
|
|
138
|
-
case 'ArrowUp':
|
|
139
|
-
event.preventDefault()
|
|
140
|
-
this.highlightedIndex.update(i => (i - 1 + items.length) % items.length)
|
|
141
|
-
this.scrollToItem(this.highlightedIndex())
|
|
142
|
-
break
|
|
143
|
-
case 'Enter':
|
|
144
|
-
event.preventDefault()
|
|
145
|
-
if (this.highlightedIndex() >= 0) {
|
|
146
|
-
this.selectItem(items[this.highlightedIndex()])
|
|
147
|
-
}
|
|
148
|
-
break
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
handleSearchById(id: string) {
|
|
153
|
-
if (id == '') {
|
|
154
|
-
this.clearInputFields()
|
|
155
|
-
this.valuecod.set('noption')
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const itemExists = this.lista().some(it => String(it[this.keyCodigo()]) == id)
|
|
160
|
-
|
|
161
|
-
if (!itemExists) {
|
|
162
|
-
this.valuecod.set('noption')
|
|
163
|
-
this.searchIdText.set(id)
|
|
164
|
-
this.searchText.set('')
|
|
165
|
-
this.selectedItem.set({})
|
|
166
|
-
return
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
this.valuecod.set(id)
|
|
170
|
-
const item = this.lista().find(it => String(it[this.keyCodigo()]) == id)
|
|
171
|
-
if (item) {
|
|
172
|
-
this.updateFieldsForItem(item)
|
|
173
|
-
} else {
|
|
174
|
-
this.searchIdText.set(id)
|
|
175
|
-
this.searchText.set('')
|
|
176
|
-
this.selectedItem.set({})
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
updateFieldsForItem(item: any) {
|
|
181
|
-
this.selectedItem.set(item)
|
|
182
|
-
this.searchIdText.set(item[this.keyCodigo()])
|
|
183
|
-
this.searchText.set(
|
|
184
|
-
this.joinInfo()
|
|
185
|
-
? `${item[this.keyCodigo()]} - ${item[this.keyDescri()]}`
|
|
186
|
-
: item[this.keyDescri()]
|
|
187
|
-
)
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
clearInputFields() {
|
|
191
|
-
this.searchText.set('')
|
|
192
|
-
this.selectedItem.set({})
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
scrollToItem(index: number) {
|
|
196
|
-
const itemElement = this.autocompleteItems?.toArray()[index]?.nativeElement
|
|
197
|
-
itemElement?.scrollIntoView({ block: 'nearest', behavior: 'smooth' })
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
emitirChange() {
|
|
201
|
-
this.changeInput.emit()
|
|
202
|
-
}
|
|
203
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
@if (isVertical()) {
|
|
2
|
-
<label for="{{'id_' + label()}}" [style.min-width]="wlabel() + 'px'"> {{label()}} @if (isRequired()) {<span
|
|
3
|
-
class="fw-bold text-danger">(*)</span>}</label>
|
|
4
|
-
}
|
|
5
|
-
<div class="d-flex align-items-center">
|
|
6
|
-
@if (!isVertical()) {
|
|
7
|
-
<label for="{{'id_' + label()}}" [style.min-width]="wlabel() + 'px'">{{label()}} @if (isRequired()) { <span
|
|
8
|
-
class="fw-bold text-danger">(*)</span>}</label>
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
<div class="autocomplete d-flex ">
|
|
12
|
-
@if(computedType()){
|
|
13
|
-
<div class="content-1 me-1">
|
|
14
|
-
<input type="text" class="form-control show-input"
|
|
15
|
-
[attr.data-active-focus]="activeFocus() == false ? 'false' : ''"
|
|
16
|
-
[style.--focus-border-color]="customBorderColor()" [style.--focus-box-shadow]="customBoxShadow()"
|
|
17
|
-
[style.--focus-transition]="customTransition()" [disabled]="allDisabled() ? true : disabled1()"
|
|
18
|
-
[(ngModel)]="value" (blur)="blurKey()" id="{{'id_' + label()}}" name="{{'id_' + label()}}" />
|
|
19
|
-
</div>
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
<div class="input-container content-2 me-2">
|
|
23
|
-
<input type="text" [(ngModel)]="searchText" class="form-control pe-4" cdkOverlayOrigin
|
|
24
|
-
#autocomplete="cdkOverlayOrigin" #inputRef [attr.data-active-focus]="activeFocus() == false ? 'false' : ''"
|
|
25
|
-
[style.--focus-border-color]="customBorderColor()" [style.--focus-box-shadow]="customBoxShadow()"
|
|
26
|
-
[style.--focus-transition]="customTransition()" [disabled]="allDisabled() ? true : disabled2()" (input)="null"
|
|
27
|
-
(blur)="showDropdown.set(false)" (focus)="showDropdown.set(true)" (keydown)="onKeyDown($event)" />
|
|
28
|
-
@if (searchText().length > 0) {
|
|
29
|
-
<button @fadeInOut type="button" class="btn-clear text-dark" (click)="clear(); inputRef.focus()">
|
|
30
|
-
×
|
|
31
|
-
</button>
|
|
32
|
-
}
|
|
33
|
-
<ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]="autocomplete"
|
|
34
|
-
[cdkConnectedOverlayOpen]="showDropdown()" [cdkConnectedOverlayHasBackdrop]="true"
|
|
35
|
-
[cdkConnectedOverlayWidth]="withInput()" (backdropClick)="showDropdown.set(false)"
|
|
36
|
-
cdkConnectedOverlayPanelClass="autocomplete-overlay" cdkConnectedOverlayBackdropClass="transparent-backdrop">
|
|
37
|
-
|
|
38
|
-
<ul [style.maxHeight.px]="altoContainer()">
|
|
39
|
-
@for (item of filteredItems(); track $index) {
|
|
40
|
-
<li #autocompleteItem class="text-dark"
|
|
41
|
-
[ngClass]="{'fw-bold': item[keyCodigo()] == value(), 'bg-primary text-white': highlightedIndex() == $index}"
|
|
42
|
-
(mousedown)="selectItem(item)">
|
|
43
|
-
@if (joinInfo()) {
|
|
44
|
-
{{ item[keyCodigo()] }} - {{ item[keyDescri()] }}
|
|
45
|
-
} @else{
|
|
46
|
-
{{ item[keyDescri()] }}
|
|
47
|
-
}
|
|
48
|
-
@if (item[keyCodigo()] == value()) {
|
|
49
|
-
<i class="far fa-check-circle fw-bold text-success cw-20"></i>
|
|
50
|
-
}
|
|
51
|
-
</li>
|
|
52
|
-
}
|
|
53
|
-
</ul>
|
|
54
|
-
</ng-template>
|
|
55
|
-
</div>
|
|
56
|
-
@if (withCheckTodos()) {
|
|
57
|
-
<div class="px-2"> <app-check-box label="Todos" name="check_todos" [value]="true" [(binding)]="allDisabled"
|
|
58
|
-
(bindingChange)="value.set('');" /></div>
|
|
59
|
-
}
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
.autocomplete {
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
ul {
|
|
7
|
-
width: 100%;
|
|
8
|
-
list-style: none;
|
|
9
|
-
padding: 0;
|
|
10
|
-
margin: 0;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
|
|
13
|
-
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
|
|
14
|
-
overflow-y: auto;
|
|
15
|
-
border-radius: 0 0 8px 8px;
|
|
16
|
-
z-index: 9999;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
li {
|
|
20
|
-
padding: 8px;
|
|
21
|
-
font-size: 0.7rem;
|
|
22
|
-
font-weight: 400;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
opacity: 80%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
li:hover {
|
|
28
|
-
opacity: 100%;
|
|
29
|
-
background: #16161616;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// .autocomplete ul {
|
|
33
|
-
// position: absolute;
|
|
34
|
-
// width: 100%;
|
|
35
|
-
// border: 1px solid #ccc;
|
|
36
|
-
// background: white;
|
|
37
|
-
// list-style: none;
|
|
38
|
-
// padding: 0;
|
|
39
|
-
// margin: 0;
|
|
40
|
-
// top: 100%;
|
|
41
|
-
// left: 0;
|
|
42
|
-
// max-height: 0;
|
|
43
|
-
// overflow: hidden;
|
|
44
|
-
// transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
|
|
45
|
-
// z-index: 1000;
|
|
46
|
-
// opacity: 0;
|
|
47
|
-
// box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
|
|
48
|
-
// }
|
|
49
|
-
|
|
50
|
-
// .autocomplete ul.show {
|
|
51
|
-
// max-height: 250px;
|
|
52
|
-
// overflow-y: auto;
|
|
53
|
-
// opacity: 1;
|
|
54
|
-
// }
|
|
55
|
-
|
|
56
|
-
// .autocomplete li {
|
|
57
|
-
// padding: 8px;
|
|
58
|
-
// font-size: 0.7rem;
|
|
59
|
-
// font-weight: 400;
|
|
60
|
-
// color: rgb(53, 53, 53);
|
|
61
|
-
// cursor: pointer;
|
|
62
|
-
// }
|
|
63
|
-
|
|
64
|
-
// .autocomplete li:hover {
|
|
65
|
-
// background: #f0f0f0;
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
.dropdown-arrow {
|
|
69
|
-
position: absolute;
|
|
70
|
-
right: 15px;
|
|
71
|
-
font-size: 11px;
|
|
72
|
-
transition: transform 0.3s ease-in-out;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
user-select: none;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@media (max-width: 442px) {
|
|
78
|
-
.d-flex {
|
|
79
|
-
flex-direction: column !important;
|
|
80
|
-
align-items: stretch !important;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.content-1 {
|
|
85
|
-
flex-basis: 23%;
|
|
86
|
-
display: flex;
|
|
87
|
-
align-items: center;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.content-2 {
|
|
91
|
-
flex-grow: 1;
|
|
92
|
-
display: flex;
|
|
93
|
-
align-items: center;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.input-container {
|
|
97
|
-
position: relative;
|
|
98
|
-
display: flex;
|
|
99
|
-
align-items: center;
|
|
100
|
-
width: 70%;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.show-input {
|
|
104
|
-
display: block;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
@media (max-width: 443px) {
|
|
108
|
-
.show-input {
|
|
109
|
-
display: none;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.input-container {
|
|
113
|
-
width: 100%;
|
|
114
|
-
padding-right: 8px;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.btn-clear {
|
|
119
|
-
position: absolute;
|
|
120
|
-
right: 8px;
|
|
121
|
-
background: transparent;
|
|
122
|
-
border: none;
|
|
123
|
-
font-size: 1.3rem;
|
|
124
|
-
font-weight: 500;
|
|
125
|
-
line-height: 1;
|
|
126
|
-
cursor: pointer;
|
|
127
|
-
padding: 0;
|
|
128
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { Component, computed, effect, ElementRef, input, model, output, QueryList, signal, viewChild, ViewChildren } from '@angular/core';
|
|
2
|
-
import { NgClass } from '@angular/common';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { OverlayModule } from '@angular/cdk/overlay';
|
|
5
|
-
import { CheckBoxComponent } from "../check-box/check-box.component";
|
|
6
|
-
import { fadeInOut } from '../../../../directivas/animaciones/fade-animation';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'app-autocomplete-v2',
|
|
10
|
-
imports: [NgClass, FormsModule, OverlayModule, CheckBoxComponent],
|
|
11
|
-
templateUrl: './autocomplete.component.html',
|
|
12
|
-
styleUrl: './autocomplete.component.scss',
|
|
13
|
-
animations:[fadeInOut]
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
export class AutocompleteV2Component {
|
|
17
|
-
|
|
18
|
-
@ViewChildren('autocompleteItem') autocompleteItems!: QueryList<ElementRef>
|
|
19
|
-
inputRef = viewChild<ElementRef>('inputRef')
|
|
20
|
-
withInput = signal<number>(null)
|
|
21
|
-
|
|
22
|
-
inputFocus = signal<boolean>(false)
|
|
23
|
-
wlabel = input<number>(0)
|
|
24
|
-
label = input<string>('')
|
|
25
|
-
isRequired = input<boolean>(false)
|
|
26
|
-
showDropdown = signal<boolean>(false)
|
|
27
|
-
|
|
28
|
-
keyCodigo = input<string>('')
|
|
29
|
-
keyDescri = input<string>('')
|
|
30
|
-
|
|
31
|
-
withTodos = input<boolean>(false)
|
|
32
|
-
searchIdText = model<string>('')
|
|
33
|
-
|
|
34
|
-
disabled1 = model<boolean>()
|
|
35
|
-
disabled2 = model<boolean>()
|
|
36
|
-
|
|
37
|
-
isVertical = input<boolean>(false)
|
|
38
|
-
highlightedIndex = signal<number>(-1)
|
|
39
|
-
joinInfo = input<boolean>(false)
|
|
40
|
-
|
|
41
|
-
changeInput = output<void>()
|
|
42
|
-
activeFocus = input<boolean>(true)
|
|
43
|
-
customBorderColor = input<string>('')
|
|
44
|
-
customBoxShadow = input<string>('')
|
|
45
|
-
customTransition = input<string>('')
|
|
46
|
-
|
|
47
|
-
// NUEVAS VARIABLES
|
|
48
|
-
lista = input<any[]>([])
|
|
49
|
-
filteredItems = computed(() => this.filterList(this.searchText()))
|
|
50
|
-
type = input<'simple'| 'doble'>('simple')
|
|
51
|
-
computedType = computed(() => this.type() == 'doble')
|
|
52
|
-
|
|
53
|
-
value = model<any>(null)
|
|
54
|
-
searchText = model<string>('')
|
|
55
|
-
listaMap = computed(() => this.toKeyValue(this.lista(), this.keyCodigo(), this.keyDescri()))
|
|
56
|
-
withCheckTodos = input<boolean>(false)
|
|
57
|
-
|
|
58
|
-
allDisabled = model<boolean>()
|
|
59
|
-
altoContainer = input<number>(200)
|
|
60
|
-
|
|
61
|
-
private resizeObserver?: ResizeObserver;
|
|
62
|
-
|
|
63
|
-
constructor() {
|
|
64
|
-
effect(() => {
|
|
65
|
-
const map = this.listaMap()
|
|
66
|
-
if(Object.keys(map).length == 0) return;
|
|
67
|
-
this.blurKey()
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
effect(() => {
|
|
71
|
-
const el = this.inputRef()?.nativeElement;
|
|
72
|
-
if (!el) return;
|
|
73
|
-
this.resizeObserver?.disconnect();
|
|
74
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
75
|
-
this.withInput.set(el.offsetWidth);
|
|
76
|
-
});
|
|
77
|
-
this.resizeObserver.observe(el);
|
|
78
|
-
this.withInput.set(el.offsetWidth);
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
filterList (text: string) {
|
|
83
|
-
const searchTerm = text.trim().toLowerCase()
|
|
84
|
-
return this.lista().filter(item => item[this.keyDescri()].toLowerCase().includes(searchTerm))
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
selectItem(item: any) {
|
|
88
|
-
this.value.set(item[this.keyCodigo()])
|
|
89
|
-
this.searchText.set(item[this.keyDescri()])
|
|
90
|
-
this.showDropdown.set(false)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
blurKey() {
|
|
94
|
-
this.searchText.set(this.listaMap()[this.value()] ?? '')
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
get descriSelected() {
|
|
98
|
-
return this.listaMap()[this.value()] ?? '';
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
toKeyValue<T extends Record<string, any>, K extends keyof T, V extends keyof T>(
|
|
102
|
-
arr: T[],
|
|
103
|
-
keyField: K,
|
|
104
|
-
valueField: V
|
|
105
|
-
): Record<T[K] & (string | number), T[V]> {
|
|
106
|
-
return arr.reduce((acc, item) => {
|
|
107
|
-
acc[item[keyField]] = item[valueField];
|
|
108
|
-
return acc;
|
|
109
|
-
}, {} as Record<T[K] & (string | number), T[V]>);
|
|
110
|
-
}
|
|
111
|
-
clear() {
|
|
112
|
-
if(this.allDisabled()) return;
|
|
113
|
-
this.searchText.set('')
|
|
114
|
-
this.value.set(null)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
onKeyDown(event: KeyboardEvent) {
|
|
118
|
-
const items = this.filteredItems()
|
|
119
|
-
if (!items.length) return
|
|
120
|
-
|
|
121
|
-
switch (event.key) {
|
|
122
|
-
case 'ArrowDown':
|
|
123
|
-
event.preventDefault()
|
|
124
|
-
this.highlightedIndex.update(i => (i + 1) % items.length)
|
|
125
|
-
this.scrollToItem(this.highlightedIndex())
|
|
126
|
-
break
|
|
127
|
-
case 'ArrowUp':
|
|
128
|
-
event.preventDefault()
|
|
129
|
-
this.highlightedIndex.update(i => (i - 1 + items.length) % items.length)
|
|
130
|
-
this.scrollToItem(this.highlightedIndex())
|
|
131
|
-
break
|
|
132
|
-
case 'Enter':
|
|
133
|
-
event.preventDefault()
|
|
134
|
-
if (this.highlightedIndex() >= 0) {
|
|
135
|
-
this.selectItem(items[this.highlightedIndex()])
|
|
136
|
-
}
|
|
137
|
-
break
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
scrollToItem(index: number) {
|
|
142
|
-
const itemElement = this.autocompleteItems?.toArray()[index]?.nativeElement
|
|
143
|
-
itemElement?.scrollIntoView({ block: 'nearest', behavior: 'smooth' })
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<label [ngClass]="class()" >
|
|
2
|
-
<input type="checkbox" animatedCheckbox [name]="name()" [id]="id()" [value]="value()" [(ngModel)]="binding" [disabled]="disabled()"
|
|
3
|
-
[checked]="checked()" (change)="changeCheck.emit($event)"
|
|
4
|
-
>
|
|
5
|
-
<span class="text-dark">{{ label() }}</span>
|
|
6
|
-
</label>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NgClass } from '@angular/common';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, input, model, output, signal } from '@angular/core';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { AnimatedCheckboxDirective } from '../../../../../lib/directivas/estilos/animated-checkbox.directive';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-check-box',
|
|
8
|
-
imports: [FormsModule,NgClass, AnimatedCheckboxDirective],
|
|
9
|
-
templateUrl: './check-box.component.html',
|
|
10
|
-
styles:``,
|
|
11
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
12
|
-
})
|
|
13
|
-
export class CheckBoxComponent {
|
|
14
|
-
name = input<string>()
|
|
15
|
-
id = input<string>()
|
|
16
|
-
label = input<string>()
|
|
17
|
-
value = input<any>()
|
|
18
|
-
disabled = input<boolean>(false)
|
|
19
|
-
binding = model<any>()
|
|
20
|
-
class = input<'success' | 'danger' | 'warning' | 'info' | ''>('')
|
|
21
|
-
checked = input<boolean>(false)
|
|
22
|
-
changeCheck = output<Event>()
|
|
23
|
-
|
|
24
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
@if (isVertical()) {
|
|
2
|
-
<label for="{{'id_' + label()}}" [style.min-width]="wlabel() + 'px'"> {{label()}} @if (isRequired()) {<span
|
|
3
|
-
class="fw-bold text-danger">(*)</span>}</label>
|
|
4
|
-
}
|
|
5
|
-
<div class="d-flex align-items-center">
|
|
6
|
-
@if (!isVertical()) {
|
|
7
|
-
<label for="{{'id_' + label()}}" [style.min-width]="wlabel() + 'px'"> {{label()}} @if (isRequired()) {<span
|
|
8
|
-
class="fw-bold text-danger">(*)</span>}</label>
|
|
9
|
-
}
|
|
10
|
-
<div class="content-1 me-1">
|
|
11
|
-
<input type="text" class="form-control show-input"
|
|
12
|
-
(blur)="blur1()?.(); validaItem()" (keyup.enter)="enter1()?.()"
|
|
13
|
-
[attr.data-active-focus]="activeFocus() == false ? 'false' : ''"
|
|
14
|
-
[style.--focus-border-color]="customBorderColor()" [style.--focus-box-shadow]="customBoxShadow()"
|
|
15
|
-
[style.--focus-transition]="customTransition()" [disabled]="disabled1()" [(ngModel)]="value"
|
|
16
|
-
id="{{'id_' + label()}}" name="{{'id_' + label()}}" [attr.maxlength]="maxLength()" (focus)="invalidInput.set(false)">
|
|
17
|
-
@if (withBuscar()) {
|
|
18
|
-
<button class="btn btn-dark boton-buscar fs-7" (click)="accion1.emit()">
|
|
19
|
-
<i class="fa fa-search"></i>
|
|
20
|
-
</button>
|
|
21
|
-
}
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div class="w-100">
|
|
25
|
-
<div class="content-2 position-relative me-2">
|
|
26
|
-
@if (tipoInput2() == 2) {
|
|
27
|
-
<select class="form-select" [attr.data-active-focus]="activeFocus() == false ? 'false' : ''"
|
|
28
|
-
[style.--focus-border-color]="customBorderColor()" [style.--focus-box-shadow]="customBoxShadow()"
|
|
29
|
-
[style.--focus-transition]="customTransition()" [(ngModel)]="value" [disabled]="disabled2()"
|
|
30
|
-
id="{{'id_content' + label()}}" name="{{'id_content' + label()}}" (change)="emitirChange()" (focus)="invalidInput.set(false)">
|
|
31
|
-
@if (withTodos()) {
|
|
32
|
-
<option [value]="typeKey() == 'number' ? -1 : ''">Todos</option>
|
|
33
|
-
}
|
|
34
|
-
@for (item of lista(); track $index) {
|
|
35
|
-
<option [value]="item[keyCodigo()]"> {{ joinInfoReal() ? item[keyCodigo()] + ' - ' + item[keyDescri()] :
|
|
36
|
-
item[keyDescri()]}}</option>
|
|
37
|
-
}
|
|
38
|
-
</select>
|
|
39
|
-
}
|
|
40
|
-
@if (tipoInput2() == 1) {
|
|
41
|
-
<input type="text" class="form-control" (blur)="blur2()?.()" (keyup.enter)="enter2()?.()" [attr.data-active-focus]="activeFocus() == false ? 'false' : ''"
|
|
42
|
-
[style.--focus-border-color]="customBorderColor()" [style.--focus-box-shadow]="customBoxShadow()"
|
|
43
|
-
[style.--focus-transition]="customTransition()" [disabled]="disabled2()" id="{{'id_content' + label()}}"
|
|
44
|
-
[(ngModel)]="value2"
|
|
45
|
-
name="{{'id_content' + label()}}" [attr.maxlength]="maxLength()" (focus)="invalidInput.set(false)">
|
|
46
|
-
}
|
|
47
|
-
@if (withBuscar2()) {
|
|
48
|
-
<button class="btn btn-dark boton-buscar fs-7" (click)="accion2.emit()">
|
|
49
|
-
<i class="fa fa-search"></i>
|
|
50
|
-
</button>
|
|
51
|
-
}
|
|
52
|
-
@if (invalidInput()) {
|
|
53
|
-
<div class="infoBox" @fadeInOut><i class="fas fa-exclamation-triangle fs-9 text-danger"></i> Ocurrió un
|
|
54
|
-
error: El campo es obligatorio, asegúrese de ingresar datos válidos.</div>
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
</div>
|