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,41 +0,0 @@
|
|
|
1
|
-
@for (input of inputs(); track $index) {
|
|
2
|
-
<div class="{{ input.class }}">
|
|
3
|
-
@switch (input.modelo) {
|
|
4
|
-
@case ('input-buscar') {
|
|
5
|
-
<!-- <app-doble-input-buscar
|
|
6
|
-
label="{{ input.label }}"
|
|
7
|
-
[(disabled)]="input.disabled"
|
|
8
|
-
[isRequired]="input.required"
|
|
9
|
-
[wlabel]="input.wlabel"
|
|
10
|
-
[maxLength]="input.maxlen"
|
|
11
|
-
[(valuecod)]="sender()[input.fieldname]"
|
|
12
|
-
[type]="input.buscar"
|
|
13
|
-
[oneinput]="true"
|
|
14
|
-
[withBuscar2]="true"
|
|
15
|
-
[joinInfo]="input.joinInfo"
|
|
16
|
-
[withBuscar]="true"
|
|
17
|
-
[viewInput]="input.viewInput"
|
|
18
|
-
/> -->
|
|
19
|
-
}
|
|
20
|
-
@default {
|
|
21
|
-
<app-input
|
|
22
|
-
label="{{ input.label }}"
|
|
23
|
-
[(disabled)]="input.disabled"
|
|
24
|
-
[isRequired]="input.required"
|
|
25
|
-
[wlabel]="input.wlabel"
|
|
26
|
-
[maxLength]="input.maxlen"
|
|
27
|
-
[(value)]="sender()[input.fieldname]"
|
|
28
|
-
[position]="input.position"
|
|
29
|
-
[type]="input.type"
|
|
30
|
-
[lista]="input.lista"
|
|
31
|
-
[keyCodigo]="input.keyCodigo"
|
|
32
|
-
[keyDescri]="input.keyDescri"
|
|
33
|
-
[withTodos]="input.withTodos"
|
|
34
|
-
[joinInfo]="input.joinInfo"
|
|
35
|
-
/>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
</div>
|
|
41
|
-
}
|
|
File without changes
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Component, input, model } from '@angular/core';
|
|
2
|
-
import { InputConfig } from '../../../../models/input-config';
|
|
3
|
-
import { InputComponent } from "../input/input.component";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'app-input-dinamico',
|
|
7
|
-
imports: [InputComponent],
|
|
8
|
-
templateUrl: './input-dinamico.component.html',
|
|
9
|
-
styleUrl: './input-dinamico.component.scss'
|
|
10
|
-
})
|
|
11
|
-
export class InputDinamicoComponent {
|
|
12
|
-
|
|
13
|
-
inputs = input<InputConfig[]>([])
|
|
14
|
-
sender = model<any>()
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<div class="d-flex" [attr.data-force]="onlyRow() ? 'true' : 'false'">
|
|
2
|
-
@if (isVertical()) {
|
|
3
|
-
<label for="{{'id_' + label()}}" [style.min-width]="wlabel() + 'px'"> {{label()}} @if (isRequired()) {<span
|
|
4
|
-
class="fw-bold text-danger">(*)</span>}</label>
|
|
5
|
-
}
|
|
6
|
-
<div class="d-flex align-items-{{position_row()}}">
|
|
7
|
-
@if (!isVertical()) {
|
|
8
|
-
<label for="{{'id_' + label()}}" [style.min-width]="wlabel() + 'px'"> {{label()}} @if (isRequired()) {<span
|
|
9
|
-
class="fw-bold text-danger">(*)</span>}</label>
|
|
10
|
-
}
|
|
11
|
-
<div class="flex-grow-1 me-2">
|
|
12
|
-
<div class="d-flex" [attr.data-force]="onlyRow() ? 'true' : 'false'"
|
|
13
|
-
[ngClass]="onlyRow() ? 'flex-row-force' : 'flex-' + position()">
|
|
14
|
-
@for (item of lista(); track $index) {
|
|
15
|
-
@switch (type()) {
|
|
16
|
-
@case ('radio') {
|
|
17
|
-
<app-radio [name]="name()" [label]="item[keyDescri()]" [disabled]="allDisabled()"
|
|
18
|
-
[value]="item[keyCodigo()]" [id]="`radio_${item[keyCodigo()]}_${item[keyDescri()]}`"
|
|
19
|
-
[(binding)]="value" />
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
.d-flex[data-force="true"] {
|
|
2
|
-
flex-direction: row !important;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
@media (max-width: 442px) {
|
|
6
|
-
.d-flex[data-force="false"] {
|
|
7
|
-
flex-direction: column !important;
|
|
8
|
-
align-items: stretch !important;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.infoBox {
|
|
12
|
-
font-size: 12px;
|
|
13
|
-
padding: 8px 12px;
|
|
14
|
-
width: 100% !important;
|
|
15
|
-
max-width: 100% !important;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@media (max-width: 900px) {
|
|
20
|
-
|
|
21
|
-
.infoBox {
|
|
22
|
-
width: 250px !important;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.infoBox {
|
|
27
|
-
position: absolute;
|
|
28
|
-
width: 400px;
|
|
29
|
-
top: calc(100% + 10px);
|
|
30
|
-
left: 0;
|
|
31
|
-
right: 0;
|
|
32
|
-
margin-top: 2px;
|
|
33
|
-
background: rgba(190, 0, 0, 0.835);
|
|
34
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
|
35
|
-
border-radius: 6px;
|
|
36
|
-
padding: 15px 12px;
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
color: #dbdbdb;
|
|
39
|
-
z-index: 10;
|
|
40
|
-
font-size: 12px;
|
|
41
|
-
font-weight: 600;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.infoBox::before {
|
|
45
|
-
content: "";
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: -10px;
|
|
48
|
-
left: 20px;
|
|
49
|
-
border-width: 0 8px 10px 8px;
|
|
50
|
-
border-style: solid;
|
|
51
|
-
border-color: transparent transparent rgba(190, 0, 0, 0.835) transparent;
|
|
52
|
-
filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.1));
|
|
53
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component,input, model } from '@angular/core';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { RadioComponent } from "../radio/radio.component";
|
|
5
|
-
import { fadeInOut } from '../../../../directivas/animaciones/fade-animation';
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-input-radio',
|
|
8
|
-
imports: [FormsModule, CommonModule, RadioComponent],
|
|
9
|
-
templateUrl: './input-radio.component.html',
|
|
10
|
-
styleUrl: './input-radio.component.scss',
|
|
11
|
-
animations: [fadeInOut]
|
|
12
|
-
})
|
|
13
|
-
export class InputRadioComponent {
|
|
14
|
-
|
|
15
|
-
wlabel = input<number>(0)
|
|
16
|
-
label = input<string>('')
|
|
17
|
-
isRequired = input<boolean>(false)
|
|
18
|
-
type = input<'check' | 'radio'>('check')
|
|
19
|
-
name = input<string>('')
|
|
20
|
-
position = input<'row' | 'column'>('row')
|
|
21
|
-
onlyRow = input<boolean>(false)
|
|
22
|
-
value = model<any>()
|
|
23
|
-
position_row = input<'center' | 'start' | 'end'>('center')
|
|
24
|
-
disabled = model<boolean>(false)
|
|
25
|
-
|
|
26
|
-
lista = input<any[]>([])
|
|
27
|
-
keyCodigo = input<string>('')
|
|
28
|
-
keyDescri = input<string>('')
|
|
29
|
-
allDisabled = model<boolean>(false)
|
|
30
|
-
isVertical = input<boolean>(false)
|
|
31
|
-
activeFocus = input<boolean>(true)
|
|
32
|
-
customBorderColor = input<string>('')
|
|
33
|
-
customBoxShadow = input<string>('')
|
|
34
|
-
customTransition = input<string>('')
|
|
35
|
-
|
|
36
|
-
}
|
|
@@ -1,56 +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="multiselect d-flex ">
|
|
11
|
-
@if(computedType()){
|
|
12
|
-
<div class="content-1 me-1">
|
|
13
|
-
<input type="text" class="form-control show-input"
|
|
14
|
-
[attr.data-active-focus]="activeFocus() == false ? 'false' : ''"
|
|
15
|
-
[style.--focus-border-color]="customBorderColor()" [style.--focus-box-shadow]="customBoxShadow()"
|
|
16
|
-
[style.--focus-transition]="customTransition()" [(ngModel)]="value" [disabled]="allDisabled()"
|
|
17
|
-
id="{{'id_' + label()}}" name="{{'id_' + label()}}" />
|
|
18
|
-
</div>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
<div class="input-container content-2 me-2">
|
|
22
|
-
<input type="text" [value]="selectedItems" class="form-control pe-4" cdkOverlayOrigin readonly
|
|
23
|
-
#autocomplete="cdkOverlayOrigin" #inputRef [attr.data-active-focus]="activeFocus() == false ? 'false' : ''"
|
|
24
|
-
[style.--focus-border-color]="customBorderColor()" [style.--focus-box-shadow]="customBoxShadow()"
|
|
25
|
-
[style.--focus-transition]="customTransition()" (input)="null"
|
|
26
|
-
(focus)="showDropdown.set(true);" [disabled]="allDisabled()" />
|
|
27
|
-
@if (selectedItems.length > 0) {
|
|
28
|
-
<button @fadeInOut type="button" class="btn-clear text-dark" (click)="clear(); inputRef.focus()">
|
|
29
|
-
×
|
|
30
|
-
</button>
|
|
31
|
-
}
|
|
32
|
-
<ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]="autocomplete"
|
|
33
|
-
[cdkConnectedOverlayOpen]="showDropdown()" [cdkConnectedOverlayHasBackdrop]="true"
|
|
34
|
-
[cdkConnectedOverlayWidth]="withInput()" (backdropClick)="showDropdown.set(false)"
|
|
35
|
-
cdkConnectedOverlayPanelClass="autocomplete-overlay" cdkConnectedOverlayBackdropClass="transparent-backdrop">
|
|
36
|
-
|
|
37
|
-
<ul [style.maxHeight.px]="altoContainer()">
|
|
38
|
-
@for (item of lista(); track $index) {
|
|
39
|
-
<li>
|
|
40
|
-
<label class="checkbox-animated">
|
|
41
|
-
<input type="checkbox" [id]="item[keyCodigo()]" [checked]="selection.isSelected(item)" (change)="selection.toggle(item)">
|
|
42
|
-
<span class="text-dark">{{item[keyDescri()]}}</span>
|
|
43
|
-
</label>
|
|
44
|
-
</li>
|
|
45
|
-
}
|
|
46
|
-
<li>
|
|
47
|
-
<label class="checkbox-animated">
|
|
48
|
-
<input type="checkbox" [id]="-1" [checked]="allSelected" (change)="toogleAllSelection()">
|
|
49
|
-
<span class="text-dark">Todos</span>
|
|
50
|
-
</label>
|
|
51
|
-
</li>
|
|
52
|
-
</ul>
|
|
53
|
-
</ng-template>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
.multiselect {
|
|
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
|
-
color: rgb(53, 53, 53);
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
opacity: 90%;
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
li:hover {
|
|
30
|
-
opacity: 100%;
|
|
31
|
-
background: #1010100b;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@media (max-width: 442px) {
|
|
35
|
-
.d-flex {
|
|
36
|
-
flex-direction: column !important;
|
|
37
|
-
align-items: stretch !important;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.content-1 {
|
|
42
|
-
flex-basis: 23%;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.content-2 {
|
|
48
|
-
flex-grow: 1;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.input-container {
|
|
54
|
-
position: relative;
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
width: 70%;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@media (max-width: 443px) {
|
|
61
|
-
.input-container {
|
|
62
|
-
width: 100%;
|
|
63
|
-
padding-right: 8px;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.btn-clear {
|
|
68
|
-
position: absolute;
|
|
69
|
-
right: 8px;
|
|
70
|
-
background: transparent;
|
|
71
|
-
border: none;
|
|
72
|
-
font-size: 1.3rem;
|
|
73
|
-
font-weight: 500;
|
|
74
|
-
line-height: 1;
|
|
75
|
-
cursor: pointer;
|
|
76
|
-
padding: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.checkbox-animated {
|
|
80
|
-
display: flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
gap: 10px;
|
|
83
|
-
cursor: pointer;
|
|
84
|
-
font-family: "Inter", sans-serif;
|
|
85
|
-
font-size: 15px;
|
|
86
|
-
color: #333;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.checkbox-animated input[type="checkbox"] {
|
|
90
|
-
appearance: none;
|
|
91
|
-
-webkit-appearance: none;
|
|
92
|
-
width: 18px;
|
|
93
|
-
height: 18px;
|
|
94
|
-
min-height: 18px;
|
|
95
|
-
min-width: 18px;
|
|
96
|
-
border: 2px solid #999;
|
|
97
|
-
border-radius: 6px;
|
|
98
|
-
background-color: white;
|
|
99
|
-
position: relative;
|
|
100
|
-
outline: none;
|
|
101
|
-
cursor: pointer;
|
|
102
|
-
transition: all 0.25s ease;
|
|
103
|
-
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.checkbox-animated input[type="checkbox"]:hover {
|
|
107
|
-
border-color: #00cf00;
|
|
108
|
-
transform: scale(1.05);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.checkbox-animated input[type="checkbox"]:active {
|
|
112
|
-
transform: scale(0.9);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.checkbox-animated input[type="checkbox"]::after {
|
|
116
|
-
content: "";
|
|
117
|
-
position: absolute;
|
|
118
|
-
top: 1px;
|
|
119
|
-
left: 5px;
|
|
120
|
-
width: 5px;
|
|
121
|
-
height: 10px;
|
|
122
|
-
border: solid white;
|
|
123
|
-
border-width: 0 2px 2px 0;
|
|
124
|
-
opacity: 0;
|
|
125
|
-
transform: rotate(45deg) scale(0.5);
|
|
126
|
-
transition: all 0.3s ease;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.checkbox-animated input[type="checkbox"]:checked {
|
|
130
|
-
background-color: #0044ff;
|
|
131
|
-
border-color: #0044ff;
|
|
132
|
-
box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
|
|
133
|
-
animation: pop 0.25s ease;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.checkbox-animated input[type="checkbox"]:checked::after {
|
|
137
|
-
opacity: 1;
|
|
138
|
-
transform: rotate(45deg) scale(1);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
@keyframes pop {
|
|
142
|
-
0% { transform: scale(1); }
|
|
143
|
-
50% { transform: scale(1.3); }
|
|
144
|
-
100% { transform: scale(1); }
|
|
145
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { SelectionModel } from '@angular/cdk/collections';
|
|
2
|
-
import { OverlayModule } from '@angular/cdk/overlay';
|
|
3
|
-
import { Component, computed, effect, ElementRef, input, model, signal, viewChild } from '@angular/core';
|
|
4
|
-
import { FormsModule } from '@angular/forms';
|
|
5
|
-
import { fadeInOut } from '../../../../directivas/animaciones/fade-animation';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'app-multiselected',
|
|
9
|
-
imports: [OverlayModule,FormsModule],
|
|
10
|
-
templateUrl: './multiselected.component.html',
|
|
11
|
-
styleUrl: './multiselected.component.scss',
|
|
12
|
-
animations:[fadeInOut]
|
|
13
|
-
})
|
|
14
|
-
export class MultiselectedComponent {
|
|
15
|
-
|
|
16
|
-
selection = new SelectionModel<any>(true, [])
|
|
17
|
-
|
|
18
|
-
inputRef = viewChild<ElementRef>('inputRef')
|
|
19
|
-
withInput = signal<number>(null)
|
|
20
|
-
|
|
21
|
-
lista = input<any[]>([])
|
|
22
|
-
type = input<'simple'| 'doble'>('simple')
|
|
23
|
-
viewInput = input<'cod' | 'descri'>('descri')
|
|
24
|
-
computedKey = computed(() => this.viewInput() == 'cod' ? this.keyCodigo() : this.keyDescri())
|
|
25
|
-
computedType = computed(() => this.type() == 'doble')
|
|
26
|
-
withTodos = input<boolean>(true)
|
|
27
|
-
value = model<any>()
|
|
28
|
-
|
|
29
|
-
showDropdown = signal<boolean>(false)
|
|
30
|
-
|
|
31
|
-
keyCodigo = input<string>('')
|
|
32
|
-
keyDescri = input<string>('')
|
|
33
|
-
joinInfo = input<boolean>(false)
|
|
34
|
-
wlabel = input<number>(0)
|
|
35
|
-
label = input<string>('')
|
|
36
|
-
isRequired = input<boolean>(false)
|
|
37
|
-
isVertical = input<boolean>(false)
|
|
38
|
-
allDisabled = input<boolean>(false)
|
|
39
|
-
activeFocus = input<boolean>(true)
|
|
40
|
-
customBorderColor = input<string>('')
|
|
41
|
-
customBoxShadow = input<string>('')
|
|
42
|
-
customTransition = input<string>('')
|
|
43
|
-
|
|
44
|
-
selectionChanged = signal(0);
|
|
45
|
-
|
|
46
|
-
altoContainer = input<number>(200)
|
|
47
|
-
private resizeObserver?: ResizeObserver;
|
|
48
|
-
|
|
49
|
-
constructor(){
|
|
50
|
-
this.selection.changed.subscribe(() => {
|
|
51
|
-
this.selectionChanged.update(n => n + 1);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
effect(() => {
|
|
55
|
-
this.selectionChanged();
|
|
56
|
-
const result = this.selection.selected
|
|
57
|
-
.sort((a, b) => a[this.keyCodigo()] - b[this.keyCodigo()])
|
|
58
|
-
.map(item => item[this.computedKey()]);
|
|
59
|
-
|
|
60
|
-
const format = result.join(',');
|
|
61
|
-
this.value.set(format);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
effect(() => {
|
|
65
|
-
if(!this.value()){
|
|
66
|
-
this.selection.clear()
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
effect(() => {
|
|
72
|
-
const el = this.inputRef()?.nativeElement;
|
|
73
|
-
if (!el) return;
|
|
74
|
-
this.resizeObserver?.disconnect();
|
|
75
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
76
|
-
this.withInput.set(el.offsetWidth);
|
|
77
|
-
});
|
|
78
|
-
this.resizeObserver.observe(el);
|
|
79
|
-
this.withInput.set(el.offsetWidth);
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
get allSelected():boolean {
|
|
85
|
-
return (!!this.lista().length && this.selection.selected.length === this.lista().length)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
toogleAllSelection() {
|
|
89
|
-
if(this.allSelected){
|
|
90
|
-
this.selection.clear()
|
|
91
|
-
return
|
|
92
|
-
}
|
|
93
|
-
this.selection.select(...this.lista())
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
get selectedItems () {
|
|
97
|
-
return this.value() ?? ''
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
filterList (text: string) {
|
|
101
|
-
const searchTerm = text.trim().toLowerCase()
|
|
102
|
-
return this.lista().filter(item => item[this.keyDescri()].toLowerCase().includes(searchTerm))
|
|
103
|
-
}
|
|
104
|
-
clear() {
|
|
105
|
-
this.selection.clear()
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<div class="form-check me-2">
|
|
2
|
-
<input class="form-check-input" type="radio" [name]="name()" [id]="id()" [value]="value()" [disabled]="disabled()"
|
|
3
|
-
(change)="handleChange()" [(ngModel)]="binding" >
|
|
4
|
-
<label class="form-check-label cursor-pointer" [for]="id()">
|
|
5
|
-
{{ label() }}
|
|
6
|
-
</label>
|
|
7
|
-
</div>
|
|
File without changes
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Component, input, model, output } from '@angular/core';
|
|
2
|
-
import { FormsModule } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'app-radio',
|
|
6
|
-
imports: [FormsModule],
|
|
7
|
-
templateUrl: './radio.component.html',
|
|
8
|
-
styleUrl: './radio.component.scss'
|
|
9
|
-
})
|
|
10
|
-
export class RadioComponent {
|
|
11
|
-
name = input<string>()
|
|
12
|
-
id = input<string>()
|
|
13
|
-
label = input<string>()
|
|
14
|
-
value = input<any>()
|
|
15
|
-
binding = model<any>()
|
|
16
|
-
checked = input<boolean>(false)
|
|
17
|
-
changed = output<any>()
|
|
18
|
-
disabled = input<boolean>(false)
|
|
19
|
-
|
|
20
|
-
handleChange() {
|
|
21
|
-
this.changed.emit(this.value())
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<div class="form-check form-switch d-flex align-items-center">
|
|
2
|
-
<input class="form-check-input" type="checkbox" role="switch" [checked]="_checked" [ngClass]="currentColor()"
|
|
3
|
-
(change)="toggle($event)" id="switchControl">
|
|
4
|
-
|
|
5
|
-
<span class="switch-circle">
|
|
6
|
-
<i [class]="currentIcon()"></i>
|
|
7
|
-
</span>
|
|
8
|
-
|
|
9
|
-
<label class="label-toggle ms-2" for="switchControl">
|
|
10
|
-
{{ currentLabel() }}
|
|
11
|
-
</label>
|
|
12
|
-
</div>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
.form-check {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
gap: 0.5rem;
|
|
5
|
-
position: relative;
|
|
6
|
-
padding-left: 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.form-check-input {
|
|
10
|
-
width: 50px !important;
|
|
11
|
-
height: 25px !important;
|
|
12
|
-
border-radius: 1.5rem;
|
|
13
|
-
appearance: none;
|
|
14
|
-
outline: none;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
background-color: #e9ecef;
|
|
17
|
-
border: 1px solid #a0a0a0;
|
|
18
|
-
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
|
|
19
|
-
position: relative;
|
|
20
|
-
margin: 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.switch-circle {
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: 50%;
|
|
26
|
-
left: 3px;
|
|
27
|
-
transform: translateY(-50%);
|
|
28
|
-
width: 19px;
|
|
29
|
-
height: 19px;
|
|
30
|
-
background-color: #fff;
|
|
31
|
-
border: 1px solid #a0a0a0;
|
|
32
|
-
border-radius: 50%;
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
font-size: 10px;
|
|
37
|
-
color: #000;
|
|
38
|
-
transition: left 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s, border-color 0.2s;
|
|
39
|
-
pointer-events: none;
|
|
40
|
-
z-index: 1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.form-check-input:checked~.switch-circle {
|
|
44
|
-
left: 28px;
|
|
45
|
-
background-color: #000;
|
|
46
|
-
border-color: #000;
|
|
47
|
-
color: #fff;
|
|
48
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, effect, input, model } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'app-switch',
|
|
6
|
-
imports: [CommonModule],
|
|
7
|
-
templateUrl: './switch.component.html',
|
|
8
|
-
styleUrl: './switch.component.scss'
|
|
9
|
-
})
|
|
10
|
-
export class SwitchComponent {
|
|
11
|
-
|
|
12
|
-
valueOn = input.required<any>()
|
|
13
|
-
valueOff = input.required<any>()
|
|
14
|
-
|
|
15
|
-
labelOn = input<string>('Activo')
|
|
16
|
-
labelOff = input<string>('Inactivo')
|
|
17
|
-
|
|
18
|
-
iconOn = input<string>('fas fa-check')
|
|
19
|
-
iconOff = input<string>('fas fa-times')
|
|
20
|
-
|
|
21
|
-
colorOn = input<string>('bg-success')
|
|
22
|
-
colorOff = input<string>('bg-danger')
|
|
23
|
-
|
|
24
|
-
model = model<any>()
|
|
25
|
-
|
|
26
|
-
_checked = false
|
|
27
|
-
|
|
28
|
-
constructor() {
|
|
29
|
-
effect(() => {
|
|
30
|
-
this._checked = this.model() === this.valueOn()
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
toggle(event: Event) {
|
|
35
|
-
const checkbox = event.target as HTMLInputElement
|
|
36
|
-
this.model.set(checkbox.checked ? this.valueOn() : this.valueOff())
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
currentLabel() {
|
|
40
|
-
return this._checked ? this.labelOn() : this.labelOff()
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
currentColor() {
|
|
44
|
-
return this._checked ? this.colorOn() : this.colorOff()
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
currentIcon() {
|
|
48
|
-
return this._checked ? this.iconOn() : this.iconOff()
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<div class="form-check form-switch d-flex align-items-center">
|
|
2
|
-
<input class="form-check-input" type="checkbox" role="switch" [checked]="_checked" [ngClass]="currentColor()"
|
|
3
|
-
(change)="toggle($event)" [id]="`toogle-${id()}`" >
|
|
4
|
-
|
|
5
|
-
<span class="switch-circle">
|
|
6
|
-
<i [class]="currentIcon()"></i>
|
|
7
|
-
</span>
|
|
8
|
-
|
|
9
|
-
<label class="label-toggle" [for]="`toogle-${id()}`" >
|
|
10
|
-
{{ currentLabel() }}
|
|
11
|
-
</label>
|
|
12
|
-
</div>
|