ui-core-abv 0.0.2 → 0.0.4
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 +948 -1012
- package/fesm2022/ui-core-abv.mjs.map +1 -1
- package/lib/{dynamic-form → components/dynamic-form}/form/dynamic-form.component.d.ts +1 -1
- package/lib/{dynamic-form → components/dynamic-form}/form-wrapper/form-wrapper.component.d.ts +2 -2
- package/lib/{inputs → components/inputs}/input/input.component.d.ts +2 -1
- package/lib/{modal → components/modal}/floating-modal/modal.component.d.ts +4 -4
- package/lib/{modal → components/modal}/side-modal/side-modal.component.d.ts +5 -5
- package/lib/{table → components/table}/table-list/table-list.component.d.ts +1 -1
- package/lib/{table → components/table}/table-pagination/table-pagination.component.d.ts +1 -1
- package/lib/{table → components/table}/table-searcher/table-searcher.component.d.ts +2 -2
- package/lib/{table → components/table}/table-user/table-user.component.d.ts +1 -1
- package/lib/{table → components/table}/table.component.d.ts +3 -3
- package/lib/{tiny-alert → components/tiny-alert}/tiny-alert.component.d.ts +1 -1
- package/lib/components/tooltip/tooltip.component.d.ts +8 -0
- package/lib/{modal → services}/modal.service.d.ts +2 -2
- package/lib/{push-alerts → services}/push-alert.service.d.ts +1 -1
- package/lib/{tiny-alert → services}/tiny-alert.service.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +15 -20
- package/src/lib/styles/_colors.scss +0 -0
- package/src/lib/styles/_default_colors.scss +101 -0
- package/src/lib/styles/_mixins.scss +13 -0
- package/src/lib/styles/_tokens.scss +53 -0
- package/src/lib/styles/_variables.scss +48 -0
- package/lib/push-alerts/alert/alert.component.d.ts +0 -16
- package/lib/push-alerts/alert-container/alert-container.component.d.ts +0 -13
- package/lib/tooltip/tooltip.component.d.ts +0 -8
- /package/lib/{button → components/button}/button.component.d.ts +0 -0
- /package/lib/{checkbox → components/checkbox}/checkbox.component.d.ts +0 -0
- /package/lib/{base-value-accessot.d.ts → components/dynamic-form/base-value-accessot.d.ts} +0 -0
- /package/lib/{dynamic-form → components/dynamic-form}/form.models.d.ts +0 -0
- /package/lib/{inputs → components/inputs}/searcher/searcher.component.d.ts +0 -0
- /package/lib/{inputs → components/inputs}/select/select.component.d.ts +0 -0
- /package/lib/{modal → components/modal}/floating-modal/modalconfig.model.d.ts +0 -0
- /package/lib/{modal → components/modal}/side-modal/sideModalConfig.model.d.ts +0 -0
- /package/lib/{push-alerts → components/push-alerts}/alert.helpers.d.ts +0 -0
- /package/lib/{push-alerts → components/push-alerts}/alert.model.d.ts +0 -0
- /package/lib/{skeleton-loader → components/skeleton-loader}/skeleton-loader.component.d.ts +0 -0
- /package/lib/{table → components/table}/table.models.d.ts +0 -0
- /package/lib/{tiny-alert → components/tiny-alert}/tiny-alert.model.d.ts +0 -0
- /package/lib/{toggle-button → components/toggle-button}/toggle-button.component.d.ts +0 -0
- /package/lib/{tooltip → directives}/tool-tip.directive.d.ts +0 -0
- /package/lib/{modal → services}/modaRef.d.ts +0 -0
- /package/lib/{modal → services}/modal.constant.d.ts +0 -0
package/fesm2022/ui-core-abv.mjs
CHANGED
|
@@ -1,15 +1,55 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, Directive, forwardRef, Component, Injectable, Pipe, createComponent, HostListener, inject, Renderer2, ViewChild, Injector, Inject, EnvironmentInjector } from '@angular/core';
|
|
3
|
-
import * as i1$1 from '@angular/forms';
|
|
4
|
-
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormBuilder, Validators } from '@angular/forms';
|
|
5
1
|
import * as i1 from '@angular/common';
|
|
6
2
|
import { CommonModule, AsyncPipe } from '@angular/common';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import * as i1$2 from '@angular/
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Input, Component, EventEmitter, Output, Directive, forwardRef, inject, Renderer2, ViewChild, Pipe, createComponent, HostListener, Injector, Inject, EnvironmentInjector, Injectable } from '@angular/core';
|
|
5
|
+
import * as i1$2 from '@angular/forms';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule, FormBuilder, Validators } from '@angular/forms';
|
|
7
|
+
import * as i1$1 from '@angular/cdk/overlay';
|
|
10
8
|
import { OverlayModule, Overlay, OverlayRef } from '@angular/cdk/overlay';
|
|
11
|
-
import
|
|
9
|
+
import { trigger, transition, style, animate, state, keyframes } from '@angular/animations';
|
|
10
|
+
import * as i1$3 from '@angular/cdk/portal';
|
|
12
11
|
import { TemplatePortal, ComponentPortal, PortalModule, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
12
|
+
import { Subject, debounceTime, distinctUntilChanged, tap, switchMap, of, finalize } from 'rxjs';
|
|
13
|
+
|
|
14
|
+
class UicButtonComponent {
|
|
15
|
+
text = '';
|
|
16
|
+
icon = '';
|
|
17
|
+
rightIcon = '';
|
|
18
|
+
iconOnly = false;
|
|
19
|
+
disabled = false;
|
|
20
|
+
loading = false;
|
|
21
|
+
size = 'm';
|
|
22
|
+
type = 'filled';
|
|
23
|
+
color = 'primary';
|
|
24
|
+
buttonTypeClass = "";
|
|
25
|
+
ngOnInit() {
|
|
26
|
+
this.buttonTypeClass = 'btn-' + this.type + ' btn-' + this.color + "-" + this.type;
|
|
27
|
+
}
|
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicButtonComponent, isStandalone: true, selector: "ui-button", inputs: { text: "text", icon: "icon", rightIcon: "rightIcon", iconOnly: "iconOnly", disabled: "disabled", loading: "loading", size: "size", type: "type", color: "color" }, ngImport: i0, template: "<button\r\n [class]=\"'main-btn ' + buttonTypeClass\"\r\n [disabled]=\"disabled || loading\"\r\n [ngClass]=\"{\r\n 'btn-tiny' :size=='t',\r\n 'btn-small' :size=='s', \r\n 'btn-medium' :size=='m',\r\n 'btn-large' :size=='l', \r\n 'btn-gigant' :size=='g'\r\n }\" >\r\n \r\n @if (!loading) {\r\n @if (icon!='' ) {\r\n <i class=\"{{icon}}\"></i>\r\n }\r\n @if (!iconOnly) {\r\n <div class=\"btn-text\" [class.norighticon]=\"rightIcon==''\" [class.noicon]=\"icon==''\">\r\n {{text}}\r\n <ng-content ></ng-content>\r\n </div>\r\n }\r\n @if (rightIcon!='' ) {\r\n <i class=\"{{rightIcon}}\"></i>\r\n }\r\n } @else {\r\n <div class=\"btn-loader-container\"> <div class=\"btn-loader\"></div> </div>\r\n }\r\n</button>", styles: [":host{width:fit-content;display:block}.main-btn{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;text-align:center;border-radius:var(--button-radius);padding:0;white-space:nowrap;outline:none}.main-btn:focus,.main-btn:focus-visible{box-shadow:0 0 0 3px rgba(var(--secondary-400),.4)}.noicon{padding-left:1rem}.norighticon{padding-right:1rem}.btn-text{font-weight:500}.btn-tiny{height:22px;min-width:22px}.btn-tiny>.btn-text{font-size:.625rem;line-height:22px}.btn-tiny i{font-size:.875rem;line-height:22px;width:22px}.btn-tiny .btn-loader{line-height:.625rem;width:.625rem}.btn-small{height:30px;min-width:30px}.btn-small>.btn-text{font-size:.75rem;line-height:30px}.btn-small i{font-size:1rem;line-height:30px;width:30px}.btn-small .btn-loader{line-height:.75rem;width:.75rem}.btn-medium{height:38px;min-width:38px}.btn-medium>.btn-text{font-size:.875rem;line-height:38px}.btn-medium i{font-size:1.625rem;line-height:38px;width:38px}.btn-medium .btn-loader{line-height:.875rem;width:.875rem}.btn-large{height:46px;min-width:46px}.btn-large>.btn-text{font-size:1rem;line-height:46px}.btn-large i{font-size:1.625rem;line-height:46px;width:46px}.btn-large .btn-loader{line-height:1rem;width:1rem}.btn-gigant{height:54px;min-width:54px}.btn-gigant>.btn-text{font-size:1.125rem;line-height:54px}.btn-gigant i{font-size:1.625rem;line-height:54px;width:54px}.btn-gigant .btn-loader{line-height:1.125rem;width:1.125rem}.btn-filled{color:var(--white);transition:background .3s ease;cursor:pointer}.btn-filled:disabled{cursor:not-allowed;color:var(--grey-300)}.btn-bordered{border:solid 1px var(--grey-200);background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-bordered:disabled{cursor:not-allowed;color:var(--grey-300);border-color:var(--grey-300)}.btn-ghost{color:var(--grey-800);background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-ghost:disabled{cursor:not-allowed;color:var(--grey-300)}.btn-primary-filled{background-color:var(--primary-400)}.btn-primary-filled:hover{background-color:var(--primary-600)}.btn-primary-filled:active{background-color:var(--primary-900)}.btn-primary-filled:disabled{background-color:var(--primary-100)}.btn-primary-bordered{color:var(--primary-400)}.btn-primary-bordered:hover{background-color:var(--primary-100)}.btn-primary-bordered:active{background-color:var(--primary-300)}.btn-primary-bordered:disabled{background-color:var(--primary-100)}.btn-primary-ghost:hover{background-color:var(--primary-100)}.btn-primary-ghost:active{background-color:var(--primary-300)}.btn-primary-ghost:disabled{background-color:transparent}.btn-black-filled{background-color:var(--grey-950)}.btn-black-filled:hover{background-color:var(--secondary-500)}.btn-black-filled:active{background-color:var(--secondary-800)}.btn-black-filled:disabled{background-color:var(--grey-100)}.btn-black-bordered{color:var(--grey-700)}.btn-black-bordered:hover{background-color:var(--secondary-100)}.btn-black-bordered:active{background-color:var(--secondary-300)}.btn-black-bordered:disabled{background-color:var(--grey-50)}.btn-black-ghost:hover{background-color:var(--secondary-100)}.btn-black-ghost:active{background-color:var(--secondary-300)}.btn-black-ghost:disabled{background-color:transparent}.btn-green-filled{background-color:var(--green-400)}.btn-green-filled:hover{background-color:var(--green-600)}.btn-green-filled:active{background-color:var(--green-900)}.btn-green-filled:disabled{background-color:var(--green-100)}.btn-green-bordered{color:var(--green-400)}.btn-green-bordered:hover{background-color:var(--green-100)}.btn-green-bordered:active{background-color:var(--green-300)}.btn-green-bordered:disabled{background-color:var(--green-100)}.btn-green-ghost:hover{background-color:var(--green-100)}.btn-green-ghost:active{background-color:var(--green-300)}.btn-green-ghost:disabled{background-color:transparent}.btn-yellow-filled{background-color:var(--yellow-400)}.btn-yellow-filled:hover{background-color:var(--yellow-600)}.btn-yellow-filled:active{background-color:var(--yellow-900)}.btn-yellow-filled:disabled{background-color:var(--yellow-100)}.btn-yellow-bordered{color:var(--yellow-400)}.btn-yellow-bordered:hover{background-color:var(--yellow-100)}.btn-yellow-bordered:active{background-color:var(--yellow-300)}.btn-yellow-bordered:disabled{background-color:var(--yellow-100)}.btn-yellow-ghost:hover{background-color:var(--yellow-100)}.btn-yellow-ghost:active{background-color:var(--yellow-300)}.btn-yellow-ghost:disabled{background-color:transparent}.btn-blue-filled{background-color:var(--blue-400)}.btn-blue-filled:hover{background-color:var(--blue-600)}.btn-blue-filled:active{background-color:var(--blue-900)}.btn-blue-filled:disabled{background-color:var(--blue-100)}.btn-blue-bordered{color:var(--blue-400)}.btn-blue-bordered:hover{background-color:var(--blue-100)}.btn-blue-bordered:active{background-color:var(--blue-300)}.btn-blue-bordered:disabled{background-color:var(--blue-100)}.btn-blue-ghost:hover{background-color:var(--blue-100)}.btn-blue-ghost:active{background-color:var(--blue-300)}.btn-blue-ghost:disabled{background-color:transparent}.btn-red-filled{background-color:var(--red-400)}.btn-red-filled:hover{background-color:var(--red-600)}.btn-red-filled:active{background-color:var(--red-900)}.btn-red-filled:disabled{background-color:var(--red-100)}.btn-red-bordered{color:var(--red-400)}.btn-red-bordered:hover{background-color:var(--red-100)}.btn-red-bordered:active{background-color:var(--red-300)}.btn-red-bordered:disabled{background-color:var(--red-100)}.btn-red-ghost:hover{background-color:var(--red-100)}.btn-red-ghost:active{background-color:var(--red-300)}.btn-red-ghost:disabled{background-color:transparent}.btn-loader{width:14px;aspect-ratio:1;border-radius:50%;animation:l5 1s infinite linear alternate;margin:2px}.btn-loader-container{line-height:14px;margin:3px 0;display:flex;justify-content:center;width:65px}@keyframes l5{0%{box-shadow:20px 0 var(--primary-200),-20px 0 var(--primary-600);background:var(--primary-200)}33%{box-shadow:20px 0 var(--primary-200),-20px 0 var(--primary-600);background:var(--primary-600)}66%{box-shadow:20px 0 var(--primary-600),-20px 0 var(--primary-200);background:var(--primary-600)}to{box-shadow:20px 0 var(--primary-600),-20px 0 var(--primary-200);background:var(--primary-200)}}.btn-loader:before,.btn-loader:after{content:\"\";grid-area:1/1;margin:15%;border-radius:50%;background:inherit;transform:rotate(0) translate(150%);animation:l22 1s infinite}.btn-loader:after{animation-delay:-.5s}@keyframes l22-0{to{transform:rotate(1turn)}}@keyframes l22{to{transform:rotate(1turn) translate(150%)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
30
|
+
}
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicButtonComponent, decorators: [{
|
|
32
|
+
type: Component,
|
|
33
|
+
args: [{ selector: 'ui-button', imports: [CommonModule], template: "<button\r\n [class]=\"'main-btn ' + buttonTypeClass\"\r\n [disabled]=\"disabled || loading\"\r\n [ngClass]=\"{\r\n 'btn-tiny' :size=='t',\r\n 'btn-small' :size=='s', \r\n 'btn-medium' :size=='m',\r\n 'btn-large' :size=='l', \r\n 'btn-gigant' :size=='g'\r\n }\" >\r\n \r\n @if (!loading) {\r\n @if (icon!='' ) {\r\n <i class=\"{{icon}}\"></i>\r\n }\r\n @if (!iconOnly) {\r\n <div class=\"btn-text\" [class.norighticon]=\"rightIcon==''\" [class.noicon]=\"icon==''\">\r\n {{text}}\r\n <ng-content ></ng-content>\r\n </div>\r\n }\r\n @if (rightIcon!='' ) {\r\n <i class=\"{{rightIcon}}\"></i>\r\n }\r\n } @else {\r\n <div class=\"btn-loader-container\"> <div class=\"btn-loader\"></div> </div>\r\n }\r\n</button>", styles: [":host{width:fit-content;display:block}.main-btn{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;text-align:center;border-radius:var(--button-radius);padding:0;white-space:nowrap;outline:none}.main-btn:focus,.main-btn:focus-visible{box-shadow:0 0 0 3px rgba(var(--secondary-400),.4)}.noicon{padding-left:1rem}.norighticon{padding-right:1rem}.btn-text{font-weight:500}.btn-tiny{height:22px;min-width:22px}.btn-tiny>.btn-text{font-size:.625rem;line-height:22px}.btn-tiny i{font-size:.875rem;line-height:22px;width:22px}.btn-tiny .btn-loader{line-height:.625rem;width:.625rem}.btn-small{height:30px;min-width:30px}.btn-small>.btn-text{font-size:.75rem;line-height:30px}.btn-small i{font-size:1rem;line-height:30px;width:30px}.btn-small .btn-loader{line-height:.75rem;width:.75rem}.btn-medium{height:38px;min-width:38px}.btn-medium>.btn-text{font-size:.875rem;line-height:38px}.btn-medium i{font-size:1.625rem;line-height:38px;width:38px}.btn-medium .btn-loader{line-height:.875rem;width:.875rem}.btn-large{height:46px;min-width:46px}.btn-large>.btn-text{font-size:1rem;line-height:46px}.btn-large i{font-size:1.625rem;line-height:46px;width:46px}.btn-large .btn-loader{line-height:1rem;width:1rem}.btn-gigant{height:54px;min-width:54px}.btn-gigant>.btn-text{font-size:1.125rem;line-height:54px}.btn-gigant i{font-size:1.625rem;line-height:54px;width:54px}.btn-gigant .btn-loader{line-height:1.125rem;width:1.125rem}.btn-filled{color:var(--white);transition:background .3s ease;cursor:pointer}.btn-filled:disabled{cursor:not-allowed;color:var(--grey-300)}.btn-bordered{border:solid 1px var(--grey-200);background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-bordered:disabled{cursor:not-allowed;color:var(--grey-300);border-color:var(--grey-300)}.btn-ghost{color:var(--grey-800);background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-ghost:disabled{cursor:not-allowed;color:var(--grey-300)}.btn-primary-filled{background-color:var(--primary-400)}.btn-primary-filled:hover{background-color:var(--primary-600)}.btn-primary-filled:active{background-color:var(--primary-900)}.btn-primary-filled:disabled{background-color:var(--primary-100)}.btn-primary-bordered{color:var(--primary-400)}.btn-primary-bordered:hover{background-color:var(--primary-100)}.btn-primary-bordered:active{background-color:var(--primary-300)}.btn-primary-bordered:disabled{background-color:var(--primary-100)}.btn-primary-ghost:hover{background-color:var(--primary-100)}.btn-primary-ghost:active{background-color:var(--primary-300)}.btn-primary-ghost:disabled{background-color:transparent}.btn-black-filled{background-color:var(--grey-950)}.btn-black-filled:hover{background-color:var(--secondary-500)}.btn-black-filled:active{background-color:var(--secondary-800)}.btn-black-filled:disabled{background-color:var(--grey-100)}.btn-black-bordered{color:var(--grey-700)}.btn-black-bordered:hover{background-color:var(--secondary-100)}.btn-black-bordered:active{background-color:var(--secondary-300)}.btn-black-bordered:disabled{background-color:var(--grey-50)}.btn-black-ghost:hover{background-color:var(--secondary-100)}.btn-black-ghost:active{background-color:var(--secondary-300)}.btn-black-ghost:disabled{background-color:transparent}.btn-green-filled{background-color:var(--green-400)}.btn-green-filled:hover{background-color:var(--green-600)}.btn-green-filled:active{background-color:var(--green-900)}.btn-green-filled:disabled{background-color:var(--green-100)}.btn-green-bordered{color:var(--green-400)}.btn-green-bordered:hover{background-color:var(--green-100)}.btn-green-bordered:active{background-color:var(--green-300)}.btn-green-bordered:disabled{background-color:var(--green-100)}.btn-green-ghost:hover{background-color:var(--green-100)}.btn-green-ghost:active{background-color:var(--green-300)}.btn-green-ghost:disabled{background-color:transparent}.btn-yellow-filled{background-color:var(--yellow-400)}.btn-yellow-filled:hover{background-color:var(--yellow-600)}.btn-yellow-filled:active{background-color:var(--yellow-900)}.btn-yellow-filled:disabled{background-color:var(--yellow-100)}.btn-yellow-bordered{color:var(--yellow-400)}.btn-yellow-bordered:hover{background-color:var(--yellow-100)}.btn-yellow-bordered:active{background-color:var(--yellow-300)}.btn-yellow-bordered:disabled{background-color:var(--yellow-100)}.btn-yellow-ghost:hover{background-color:var(--yellow-100)}.btn-yellow-ghost:active{background-color:var(--yellow-300)}.btn-yellow-ghost:disabled{background-color:transparent}.btn-blue-filled{background-color:var(--blue-400)}.btn-blue-filled:hover{background-color:var(--blue-600)}.btn-blue-filled:active{background-color:var(--blue-900)}.btn-blue-filled:disabled{background-color:var(--blue-100)}.btn-blue-bordered{color:var(--blue-400)}.btn-blue-bordered:hover{background-color:var(--blue-100)}.btn-blue-bordered:active{background-color:var(--blue-300)}.btn-blue-bordered:disabled{background-color:var(--blue-100)}.btn-blue-ghost:hover{background-color:var(--blue-100)}.btn-blue-ghost:active{background-color:var(--blue-300)}.btn-blue-ghost:disabled{background-color:transparent}.btn-red-filled{background-color:var(--red-400)}.btn-red-filled:hover{background-color:var(--red-600)}.btn-red-filled:active{background-color:var(--red-900)}.btn-red-filled:disabled{background-color:var(--red-100)}.btn-red-bordered{color:var(--red-400)}.btn-red-bordered:hover{background-color:var(--red-100)}.btn-red-bordered:active{background-color:var(--red-300)}.btn-red-bordered:disabled{background-color:var(--red-100)}.btn-red-ghost:hover{background-color:var(--red-100)}.btn-red-ghost:active{background-color:var(--red-300)}.btn-red-ghost:disabled{background-color:transparent}.btn-loader{width:14px;aspect-ratio:1;border-radius:50%;animation:l5 1s infinite linear alternate;margin:2px}.btn-loader-container{line-height:14px;margin:3px 0;display:flex;justify-content:center;width:65px}@keyframes l5{0%{box-shadow:20px 0 var(--primary-200),-20px 0 var(--primary-600);background:var(--primary-200)}33%{box-shadow:20px 0 var(--primary-200),-20px 0 var(--primary-600);background:var(--primary-600)}66%{box-shadow:20px 0 var(--primary-600),-20px 0 var(--primary-200);background:var(--primary-600)}to{box-shadow:20px 0 var(--primary-600),-20px 0 var(--primary-200);background:var(--primary-200)}}.btn-loader:before,.btn-loader:after{content:\"\";grid-area:1/1;margin:15%;border-radius:50%;background:inherit;transform:rotate(0) translate(150%);animation:l22 1s infinite}.btn-loader:after{animation-delay:-.5s}@keyframes l22-0{to{transform:rotate(1turn)}}@keyframes l22{to{transform:rotate(1turn) translate(150%)}}\n"] }]
|
|
34
|
+
}], propDecorators: { text: [{
|
|
35
|
+
type: Input
|
|
36
|
+
}], icon: [{
|
|
37
|
+
type: Input
|
|
38
|
+
}], rightIcon: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}], iconOnly: [{
|
|
41
|
+
type: Input
|
|
42
|
+
}], disabled: [{
|
|
43
|
+
type: Input
|
|
44
|
+
}], loading: [{
|
|
45
|
+
type: Input
|
|
46
|
+
}], size: [{
|
|
47
|
+
type: Input
|
|
48
|
+
}], type: [{
|
|
49
|
+
type: Input
|
|
50
|
+
}], color: [{
|
|
51
|
+
type: Input
|
|
52
|
+
}] } });
|
|
13
53
|
|
|
14
54
|
function createValueAccessor() {
|
|
15
55
|
class BaseValueAccessor {
|
|
@@ -66,7 +106,7 @@ class UicCheckboxComponent extends base$1 {
|
|
|
66
106
|
useExisting: forwardRef(() => UicCheckboxComponent),
|
|
67
107
|
multi: true
|
|
68
108
|
}
|
|
69
|
-
], usesInheritance: true, ngImport: i0, template: "@if (label){\r\n <label for=\"\">{{label}} </label>\r\n}\r\n<div class=\"check-wrapper\">\r\n <button\r\n type=\"button\"\r\n class=\"checkbox\"\r\n [disabled]=\"disabled\"\r\n [class.checked]=\"value\"\r\n (click)=\"toggle()\"\r\n (keydown.enter)=\"toggle()\"\r\n (keydown.space)=\"toggle()\"\r\n >\r\n <span class=\"icon\">\r\n @if (value) {\r\n \u2714\r\n }@else {\r\n \u2212\r\n }\r\n </span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".check-wrapper{padding:2px;display:flex;align-items:center;font-size:
|
|
109
|
+
], usesInheritance: true, ngImport: i0, template: "@if (label){\r\n <label for=\"\">{{label}} </label>\r\n}\r\n<div class=\"check-wrapper\">\r\n <button\r\n type=\"button\"\r\n class=\"checkbox\"\r\n [disabled]=\"disabled\"\r\n [class.checked]=\"value\"\r\n (click)=\"toggle()\"\r\n (keydown.enter)=\"toggle()\"\r\n (keydown.space)=\"toggle()\"\r\n >\r\n <span class=\"icon\">\r\n @if (value) {\r\n \u2714\r\n }@else {\r\n \u2212\r\n }\r\n </span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".check-wrapper{padding:2px;display:flex;align-items:center;font-size:1rem}.check-wrapper button{margin-right:.5rem}.checkbox{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:2px solid var(--grey-500);border-radius:6px;background:var(--white);cursor:pointer;transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease;outline:none}.checkbox:hover:not(:disabled){border-color:var(--secondary-400)}.checkbox:focus,.checkbox:focus-visible{box-shadow:0 0 0 3px rgba(var(--secondary-400),.4)}.checkbox:disabled{background:var(--grey-300);border-color:var(--grey-300);cursor:not-allowed}.checkbox:disabled .icon{opacity:.5}.checkbox.checked{background:var(--secondary-500);border-color:var(--secondary-500)}.checkbox.checked:hover:not(:disabled){background:var(--secondary-400);border-color:var(--secondary-400)}.checkbox.checked .icon{color:var(--white)}.checkbox.indeterminate{background:var(--secondary-500);border-color:var(--secondary-500)}.checkbox.indeterminate .icon{color:var(--white)}.checkbox .icon{font-size:1rem;font-weight:700;color:transparent;line-height:1;transition:color .2s ease}\n"] });
|
|
70
110
|
}
|
|
71
111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicCheckboxComponent, decorators: [{
|
|
72
112
|
type: Component,
|
|
@@ -76,7 +116,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
76
116
|
useExisting: forwardRef(() => UicCheckboxComponent),
|
|
77
117
|
multi: true
|
|
78
118
|
}
|
|
79
|
-
], template: "@if (label){\r\n <label for=\"\">{{label}} </label>\r\n}\r\n<div class=\"check-wrapper\">\r\n <button\r\n type=\"button\"\r\n class=\"checkbox\"\r\n [disabled]=\"disabled\"\r\n [class.checked]=\"value\"\r\n (click)=\"toggle()\"\r\n (keydown.enter)=\"toggle()\"\r\n (keydown.space)=\"toggle()\"\r\n >\r\n <span class=\"icon\">\r\n @if (value) {\r\n \u2714\r\n }@else {\r\n \u2212\r\n }\r\n </span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".check-wrapper{padding:2px;display:flex;align-items:center;font-size:
|
|
119
|
+
], template: "@if (label){\r\n <label for=\"\">{{label}} </label>\r\n}\r\n<div class=\"check-wrapper\">\r\n <button\r\n type=\"button\"\r\n class=\"checkbox\"\r\n [disabled]=\"disabled\"\r\n [class.checked]=\"value\"\r\n (click)=\"toggle()\"\r\n (keydown.enter)=\"toggle()\"\r\n (keydown.space)=\"toggle()\"\r\n >\r\n <span class=\"icon\">\r\n @if (value) {\r\n \u2714\r\n }@else {\r\n \u2212\r\n }\r\n </span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".check-wrapper{padding:2px;display:flex;align-items:center;font-size:1rem}.check-wrapper button{margin-right:.5rem}.checkbox{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:2px solid var(--grey-500);border-radius:6px;background:var(--white);cursor:pointer;transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease;outline:none}.checkbox:hover:not(:disabled){border-color:var(--secondary-400)}.checkbox:focus,.checkbox:focus-visible{box-shadow:0 0 0 3px rgba(var(--secondary-400),.4)}.checkbox:disabled{background:var(--grey-300);border-color:var(--grey-300);cursor:not-allowed}.checkbox:disabled .icon{opacity:.5}.checkbox.checked{background:var(--secondary-500);border-color:var(--secondary-500)}.checkbox.checked:hover:not(:disabled){background:var(--secondary-400);border-color:var(--secondary-400)}.checkbox.checked .icon{color:var(--white)}.checkbox.indeterminate{background:var(--secondary-500);border-color:var(--secondary-500)}.checkbox.indeterminate .icon{color:var(--white)}.checkbox .icon{font-size:1rem;font-weight:700;color:transparent;line-height:1;transition:color .2s ease}\n"] }]
|
|
80
120
|
}], propDecorators: { label: [{
|
|
81
121
|
type: Input
|
|
82
122
|
}], placeholder: [{
|
|
@@ -87,31 +127,181 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
87
127
|
type: Input
|
|
88
128
|
}] } });
|
|
89
129
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
130
|
+
const fadeAndRise = trigger('fadeAndRise', [
|
|
131
|
+
transition(':enter', [style({ opacity: 0, maxHeight: '0px' }), animate('.3s ease', style({ opacity: 1, maxHeight: '200px' }))]),
|
|
132
|
+
transition(':leave', [animate('.3s ease', style({ opacity: 0 }))])
|
|
133
|
+
]);
|
|
134
|
+
|
|
135
|
+
const base = createValueAccessor();
|
|
136
|
+
class UicSelectComponent extends base {
|
|
137
|
+
icon = ''; // Icono externo
|
|
138
|
+
iconColor = 'primary'; //color de ícono externo
|
|
139
|
+
internalIcon = ''; //Icono interno
|
|
140
|
+
size = 'm'; // tamaño general del input
|
|
141
|
+
label = '';
|
|
142
|
+
error = '';
|
|
143
|
+
tip = '';
|
|
93
144
|
disabled = false;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
145
|
+
nullable = false;
|
|
146
|
+
options = [];
|
|
147
|
+
showSubtitle = false;
|
|
148
|
+
overlayPositions = [
|
|
149
|
+
{
|
|
150
|
+
originX: 'start',
|
|
151
|
+
originY: 'bottom',
|
|
152
|
+
overlayX: 'start',
|
|
153
|
+
overlayY: 'top'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
originX: 'start',
|
|
157
|
+
originY: 'top',
|
|
158
|
+
overlayX: 'start',
|
|
159
|
+
overlayY: 'bottom'
|
|
160
|
+
}
|
|
161
|
+
];
|
|
162
|
+
open = false;
|
|
163
|
+
emptyText = '- Seleccionar -';
|
|
164
|
+
renderer = inject(Renderer2);
|
|
165
|
+
toggleButton;
|
|
166
|
+
unlistener;
|
|
167
|
+
ngOnInit() {
|
|
168
|
+
this.emptyText = this.disabled ? '-' : '- Seleccionar -';
|
|
100
169
|
}
|
|
101
|
-
|
|
102
|
-
|
|
170
|
+
openList() {
|
|
171
|
+
if (!this.disabled) {
|
|
172
|
+
this.open = !this.open;
|
|
173
|
+
if (this.open) {
|
|
174
|
+
setTimeout(() => {
|
|
175
|
+
this.unlistener = this.renderer.listen('window', 'click', (e) => {
|
|
176
|
+
if (!this.toggleButton.nativeElement.contains(e.target)) {
|
|
177
|
+
this.open = false;
|
|
178
|
+
this.unlistener();
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}, 200);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
selectOption(option) {
|
|
186
|
+
this.open = false;
|
|
187
|
+
this.unlistener();
|
|
188
|
+
this.notifyChange(option);
|
|
189
|
+
}
|
|
190
|
+
//( overlay)
|
|
191
|
+
closeList() {
|
|
192
|
+
this.open = false;
|
|
193
|
+
}
|
|
194
|
+
openListOverlay() {
|
|
195
|
+
if (!this.disabled) {
|
|
196
|
+
this.open = !this.open;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
200
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSelectComponent, isStandalone: true, selector: "ui-select", inputs: { icon: "icon", iconColor: "iconColor", internalIcon: "internalIcon", size: "size", label: "label", error: "error", tip: "tip", disabled: "disabled", nullable: "nullable", options: "options", showSubtitle: "showSubtitle" }, providers: [
|
|
201
|
+
{
|
|
202
|
+
provide: NG_VALUE_ACCESSOR,
|
|
203
|
+
useExisting: forwardRef(() => UicSelectComponent),
|
|
204
|
+
multi: true
|
|
205
|
+
}
|
|
206
|
+
], viewQueries: [{ propertyName: "toggleButton", first: true, predicate: ["inputwrapp"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"input-wrapper \">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n <div class=\"fakeinput-wrapp\" #inputwrapp cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" > \r\n\r\n <!-- INPUT -->\r\n <div (click)=\"openList()\" class=\"fakeinput\" [ngClass]=\"{'activeselect':open, 'errorinput':error, 'disabledinput':disabled}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"fakeinput-content\">{{(value?.text || emptyText)}}</div>\r\n @if (!disabled) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n @if (open) {\r\n\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"trigger\"\r\n [cdkConnectedOverlayOpen]=\"open\"\r\n [cdkConnectedOverlayHasBackdrop]=\"true\"\r\n (backdropClick)=\"closeList()\"\r\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\r\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\r\n >\r\n\r\n <div class=\"input-options\" @fadeAndRise >\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;\" >- Ninguno -</div>\r\n <div class=\"option-divider\"></div>\r\n }\r\n\r\n @for (option of options; track $index) {\r\n <div (click)=\"selectOption(option)\" class=\"input-option\">\r\n <div style=\"padding: 2px;\">\r\n <div class=\"f-medium\">{{option.text }}</div>\r\n <div *ngIf=\"showSubtitle\" class=\"f-extralight\">{{option.detail}}</div>\r\n </div>\r\n </div>\r\n @if ($index < (options.length - 1)){\r\n <div class=\"option-divider\"></div>\r\n }\r\n }\r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n }\r\n\r\n </div>\r\n <!-- ALERTS -->\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert f-red\">{{error}}</div>\r\n }\r\n </div>\r\n</div>", styles: [":host{width:100%}.input-container{flex:1 1;padding:.25rem;overflow:hidden}.input-options{position:absolute;border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:.875rem;z-index:50;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.input-option{line-height:1rem;display:flex;align-items:center;padding:6px 12px;-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-s{color:var(--grey-200);font-size:1rem}.input-internalicon-m{color:var(--grey-200);font-size:1.125rem}.input-internalicon-l{color:var(--grey-200);font-size:1.25rem}.label{font-size:.875rem;line-height:1.125rem;font-weight:400;color:var(--grey-950);margin-bottom:var(--input-label-space)}.fakeinput{border-radius:var(--input-radius);overflow:hidden;border:solid 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;padding-left:.25rem;-webkit-user-select:none;user-select:none;background-color:var(--white);transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--grey-300)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--grey-200);color:var(--grey-800)}.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(--grey-200);color:var(--red-500)}.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 3px var(--primary-400)}.fakeinput:focus-within button{background-color:var(--primary-500);color:var(--white)}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput:focus-within button:enabled:active{background-color:var(--primary-600)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-color:var(--red-500)}.t-disabled{color:var(--grey-300);padding:5px;text-align:center}.disabledinput{background-color:var(--grey-50) -disabled;color:var(--grey-800)}.disabledinput ::ng-deep input{color:var(--grey-800)}.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)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-300)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}\n"], dependencies: [{ 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: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], animations: [fadeAndRise] });
|
|
103
207
|
}
|
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSelectComponent, decorators: [{
|
|
105
209
|
type: Component,
|
|
106
|
-
args: [{ selector: 'ui-
|
|
107
|
-
|
|
210
|
+
args: [{ selector: 'ui-select', imports: [CommonModule, OverlayModule], providers: [
|
|
211
|
+
{
|
|
212
|
+
provide: NG_VALUE_ACCESSOR,
|
|
213
|
+
useExisting: forwardRef(() => UicSelectComponent),
|
|
214
|
+
multi: true
|
|
215
|
+
}
|
|
216
|
+
], animations: [fadeAndRise], template: "<div class=\"input-wrapper \">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n <div class=\"fakeinput-wrapp\" #inputwrapp cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" > \r\n\r\n <!-- INPUT -->\r\n <div (click)=\"openList()\" class=\"fakeinput\" [ngClass]=\"{'activeselect':open, 'errorinput':error, 'disabledinput':disabled}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"fakeinput-content\">{{(value?.text || emptyText)}}</div>\r\n @if (!disabled) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n @if (open) {\r\n\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"trigger\"\r\n [cdkConnectedOverlayOpen]=\"open\"\r\n [cdkConnectedOverlayHasBackdrop]=\"true\"\r\n (backdropClick)=\"closeList()\"\r\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\r\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\r\n >\r\n\r\n <div class=\"input-options\" @fadeAndRise >\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;\" >- Ninguno -</div>\r\n <div class=\"option-divider\"></div>\r\n }\r\n\r\n @for (option of options; track $index) {\r\n <div (click)=\"selectOption(option)\" class=\"input-option\">\r\n <div style=\"padding: 2px;\">\r\n <div class=\"f-medium\">{{option.text }}</div>\r\n <div *ngIf=\"showSubtitle\" class=\"f-extralight\">{{option.detail}}</div>\r\n </div>\r\n </div>\r\n @if ($index < (options.length - 1)){\r\n <div class=\"option-divider\"></div>\r\n }\r\n }\r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n }\r\n\r\n </div>\r\n <!-- ALERTS -->\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert f-red\">{{error}}</div>\r\n }\r\n </div>\r\n</div>", styles: [":host{width:100%}.input-container{flex:1 1;padding:.25rem;overflow:hidden}.input-options{position:absolute;border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:.875rem;z-index:50;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.input-option{line-height:1rem;display:flex;align-items:center;padding:6px 12px;-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-s{color:var(--grey-200);font-size:1rem}.input-internalicon-m{color:var(--grey-200);font-size:1.125rem}.input-internalicon-l{color:var(--grey-200);font-size:1.25rem}.label{font-size:.875rem;line-height:1.125rem;font-weight:400;color:var(--grey-950);margin-bottom:var(--input-label-space)}.fakeinput{border-radius:var(--input-radius);overflow:hidden;border:solid 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;padding-left:.25rem;-webkit-user-select:none;user-select:none;background-color:var(--white);transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--grey-300)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--grey-200);color:var(--grey-800)}.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(--grey-200);color:var(--red-500)}.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 3px var(--primary-400)}.fakeinput:focus-within button{background-color:var(--primary-500);color:var(--white)}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput:focus-within button:enabled:active{background-color:var(--primary-600)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-color:var(--red-500)}.t-disabled{color:var(--grey-300);padding:5px;text-align:center}.disabledinput{background-color:var(--grey-50) -disabled;color:var(--grey-800)}.disabledinput ::ng-deep input{color:var(--grey-800)}.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)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-300)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}\n"] }]
|
|
217
|
+
}], propDecorators: { icon: [{
|
|
218
|
+
type: Input
|
|
219
|
+
}], iconColor: [{
|
|
220
|
+
type: Input
|
|
221
|
+
}], internalIcon: [{
|
|
222
|
+
type: Input
|
|
223
|
+
}], size: [{
|
|
224
|
+
type: Input
|
|
225
|
+
}], label: [{
|
|
226
|
+
type: Input
|
|
227
|
+
}], error: [{
|
|
228
|
+
type: Input
|
|
229
|
+
}], tip: [{
|
|
108
230
|
type: Input
|
|
109
|
-
}], checkedChange: [{
|
|
110
|
-
type: Output
|
|
111
231
|
}], disabled: [{
|
|
112
232
|
type: Input
|
|
113
|
-
}],
|
|
233
|
+
}], nullable: [{
|
|
234
|
+
type: Input
|
|
235
|
+
}], options: [{
|
|
236
|
+
type: Input
|
|
237
|
+
}], showSubtitle: [{
|
|
238
|
+
type: Input
|
|
239
|
+
}], toggleButton: [{
|
|
240
|
+
type: ViewChild,
|
|
241
|
+
args: ['inputwrapp']
|
|
242
|
+
}] } });
|
|
243
|
+
|
|
244
|
+
class UicInputComponent {
|
|
245
|
+
icon = ''; // Icono externo
|
|
246
|
+
iconColor = 'black';
|
|
247
|
+
internalIcon = ''; //Icono interno
|
|
248
|
+
size = 'm'; // tamaño general del input
|
|
249
|
+
// TEXTO
|
|
250
|
+
label = '';
|
|
251
|
+
error = '';
|
|
252
|
+
tip = '';
|
|
253
|
+
// FUNCTIONS
|
|
254
|
+
disabled = false;
|
|
255
|
+
clickButton = new EventEmitter();
|
|
256
|
+
disableBtn = false;
|
|
257
|
+
disableButton() {
|
|
258
|
+
this.clickButton.emit();
|
|
259
|
+
this.disableBtn = true;
|
|
260
|
+
setTimeout(() => {
|
|
261
|
+
this.disableBtn = false;
|
|
262
|
+
}, 200);
|
|
263
|
+
}
|
|
264
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
265
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicInputComponent, isStandalone: true, selector: "ui-input", inputs: { icon: "icon", iconColor: "iconColor", internalIcon: "internalIcon", size: "size", label: "label", error: "error", tip: "tip", disabled: "disabled" }, outputs: { clickButton: "clickButton" }, ngImport: i0, template: "<div class=\"input-wrapper\">\r\n \r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n \r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n \r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <ng-content class=\"myinput\"></ng-content>\r\n </div> \r\n </div>\r\n\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert f-red\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n", styles: [":host{width:100%}.input-container{flex:1 1;padding:.25rem;overflow:hidden}.input-options{position:absolute;border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:.875rem;z-index:50;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.input-option{line-height:1rem;display:flex;align-items:center;padding:6px 12px;-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-s{color:var(--grey-200);font-size:1rem}.input-internalicon-m{color:var(--grey-200);font-size:1.125rem}.input-internalicon-l{color:var(--grey-200);font-size:1.25rem}.label{font-size:.875rem;line-height:1.125rem;font-weight:400;color:var(--grey-950);margin-bottom:var(--input-label-space)}.fakeinput{border-radius:var(--input-radius);overflow:hidden;border:solid 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;padding-left:.25rem;-webkit-user-select:none;user-select:none;background-color:var(--white);transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--grey-300)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--grey-200);color:var(--grey-800)}.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(--grey-200);color:var(--red-500)}.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 3px var(--primary-400)}.fakeinput:focus-within button{background-color:var(--primary-500);color:var(--white)}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput:focus-within button:enabled:active{background-color:var(--primary-600)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-color:var(--red-500)}.t-disabled{color:var(--grey-300);padding:5px;text-align:center}.disabledinput{background-color:var(--grey-50) -disabled;color:var(--grey-800)}.disabledinput ::ng-deep input{color:var(--grey-800)}.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)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-300)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
266
|
+
}
|
|
267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicInputComponent, decorators: [{
|
|
268
|
+
type: Component,
|
|
269
|
+
args: [{ selector: 'ui-input', imports: [CommonModule], template: "<div class=\"input-wrapper\">\r\n \r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n \r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n \r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <ng-content class=\"myinput\"></ng-content>\r\n </div> \r\n </div>\r\n\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert f-red\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n", styles: [":host{width:100%}.input-container{flex:1 1;padding:.25rem;overflow:hidden}.input-options{position:absolute;border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:.875rem;z-index:50;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.input-option{line-height:1rem;display:flex;align-items:center;padding:6px 12px;-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-s{color:var(--grey-200);font-size:1rem}.input-internalicon-m{color:var(--grey-200);font-size:1.125rem}.input-internalicon-l{color:var(--grey-200);font-size:1.25rem}.label{font-size:.875rem;line-height:1.125rem;font-weight:400;color:var(--grey-950);margin-bottom:var(--input-label-space)}.fakeinput{border-radius:var(--input-radius);overflow:hidden;border:solid 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;padding-left:.25rem;-webkit-user-select:none;user-select:none;background-color:var(--white);transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--grey-300)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--grey-200);color:var(--grey-800)}.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(--grey-200);color:var(--red-500)}.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 3px var(--primary-400)}.fakeinput:focus-within button{background-color:var(--primary-500);color:var(--white)}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput:focus-within button:enabled:active{background-color:var(--primary-600)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-color:var(--red-500)}.t-disabled{color:var(--grey-300);padding:5px;text-align:center}.disabledinput{background-color:var(--grey-50) -disabled;color:var(--grey-800)}.disabledinput ::ng-deep input{color:var(--grey-800)}.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)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-300)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}\n"] }]
|
|
270
|
+
}], propDecorators: { icon: [{
|
|
271
|
+
type: Input
|
|
272
|
+
}], iconColor: [{
|
|
273
|
+
type: Input
|
|
274
|
+
}], internalIcon: [{
|
|
114
275
|
type: Input
|
|
276
|
+
}], size: [{
|
|
277
|
+
type: Input
|
|
278
|
+
}], label: [{
|
|
279
|
+
type: Input
|
|
280
|
+
}], error: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}], tip: [{
|
|
283
|
+
type: Input
|
|
284
|
+
}], disabled: [{
|
|
285
|
+
type: Input
|
|
286
|
+
}], clickButton: [{
|
|
287
|
+
type: Output
|
|
288
|
+
}] } });
|
|
289
|
+
|
|
290
|
+
class UicDynamicFormComponent {
|
|
291
|
+
fields = [];
|
|
292
|
+
form;
|
|
293
|
+
flag = false;
|
|
294
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
295
|
+
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" }, ngImport: i0, template: "<div class=\"form\" [formGroup]=\"form\">\r\n @for (field of fields; track field.name) {\r\n <div class=\"col-span-{{field.colSpan || 1}}\">\r\n \r\n @if ( ['text','number','date'].includes(field.type) ) {\r\n <ui-input \r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\">\r\n <input \r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"field.placeholder??field.label\"\r\n />\r\n </ui-input>\r\n\r\n }\r\n\r\n @if (field.type === 'select') {\r\n <ui-select\r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-select>\r\n }\r\n\r\n @if (field.type === 'checkbox') {\r\n <ui-checkbox\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [placeholder]=\"field.placeholder??''\"\r\n [label]=\"field.label\"\r\n ></ui-checkbox>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:1rem;padding-bottom:1.5rem}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}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "size", "label", "error", "tip", "disabled", "nullable", "options", "showSubtitle"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "size", "label", "error", "tip", "disabled"], outputs: ["clickButton"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["label", "placeholder", "disabled", "loading"] }, { kind: "ngmodule", type: FormsModule }] });
|
|
296
|
+
}
|
|
297
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDynamicFormComponent, decorators: [{
|
|
298
|
+
type: Component,
|
|
299
|
+
args: [{ selector: 'ui-dynamic-form', imports: [ReactiveFormsModule, UicSelectComponent, UicInputComponent, UicCheckboxComponent, FormsModule], template: "<div class=\"form\" [formGroup]=\"form\">\r\n @for (field of fields; track field.name) {\r\n <div class=\"col-span-{{field.colSpan || 1}}\">\r\n \r\n @if ( ['text','number','date'].includes(field.type) ) {\r\n <ui-input \r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\">\r\n <input \r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"field.placeholder??field.label\"\r\n />\r\n </ui-input>\r\n\r\n }\r\n\r\n @if (field.type === 'select') {\r\n <ui-select\r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-select>\r\n }\r\n\r\n @if (field.type === 'checkbox') {\r\n <ui-checkbox\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [placeholder]=\"field.placeholder??''\"\r\n [label]=\"field.label\"\r\n ></ui-checkbox>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:1rem;padding-bottom:1.5rem}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}\n"] }]
|
|
300
|
+
}], propDecorators: { fields: [{
|
|
301
|
+
type: Input
|
|
302
|
+
}], form: [{
|
|
303
|
+
type: Input,
|
|
304
|
+
args: [{ required: true }]
|
|
115
305
|
}] } });
|
|
116
306
|
|
|
117
307
|
class UicSkeletonLoaderComponent {
|
|
@@ -123,1089 +313,768 @@ class UicSkeletonLoaderComponent {
|
|
|
123
313
|
};
|
|
124
314
|
}
|
|
125
315
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
126
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSkeletonLoaderComponent, isStandalone: true, selector: "ui-skeleton-loader", inputs: { inputs: "inputs", cols: "cols" }, ngImport: i0, template: "<div class=\"skeleton-form\" [ngStyle]=\"gridStyle\">\r\n @for (r of [].constructor(inputs); track $index) {\r\n <div class=\"skeleton-input-container\">\r\n <div class=\"skeleton-
|
|
316
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSkeletonLoaderComponent, isStandalone: true, selector: "ui-skeleton-loader", inputs: { inputs: "inputs", cols: "cols" }, ngImport: i0, template: "<div class=\"skeleton-form\" [ngStyle]=\"gridStyle\">\r\n @for (r of [].constructor(inputs); track $index) {\r\n <div class=\"skeleton-input-container\">\r\n <div class=\"skeleton-gradient skeleton-label\"></div>\r\n <div class=\"skeleton-gradient skeleton-input\"></div>\r\n </div>\r\n }\r\n</div>", styles: [".skeleton-form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:16px;padding:24px 0}.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;border-radius:var(--input-radius)}.skeleton-label{height:20px;width:50%;margin-bottom:var(--input-label-space)}.skeleton-input{height:40px;width:100%}@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"] }] });
|
|
127
317
|
}
|
|
128
318
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSkeletonLoaderComponent, decorators: [{
|
|
129
319
|
type: Component,
|
|
130
|
-
args: [{ selector: 'ui-skeleton-loader', imports: [CommonModule], template: "<div class=\"skeleton-form\" [ngStyle]=\"gridStyle\">\r\n @for (r of [].constructor(inputs); track $index) {\r\n <div class=\"skeleton-input-container\">\r\n <div class=\"skeleton-
|
|
320
|
+
args: [{ selector: 'ui-skeleton-loader', imports: [CommonModule], template: "<div class=\"skeleton-form\" [ngStyle]=\"gridStyle\">\r\n @for (r of [].constructor(inputs); track $index) {\r\n <div class=\"skeleton-input-container\">\r\n <div class=\"skeleton-gradient skeleton-label\"></div>\r\n <div class=\"skeleton-gradient skeleton-input\"></div>\r\n </div>\r\n }\r\n</div>", styles: [".skeleton-form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:16px;padding:24px 0}.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;border-radius:var(--input-radius)}.skeleton-label{height:20px;width:50%;margin-bottom:var(--input-label-space)}.skeleton-input{height:40px;width:100%}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"] }]
|
|
131
321
|
}], propDecorators: { inputs: [{
|
|
132
322
|
type: Input
|
|
133
323
|
}], cols: [{
|
|
134
324
|
type: Input
|
|
135
325
|
}] } });
|
|
136
326
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
function createErrorAlert(message, options) {
|
|
148
|
-
return {
|
|
149
|
-
id: nextId++,
|
|
150
|
-
message,
|
|
151
|
-
type: 'error',
|
|
152
|
-
duration: 5000,
|
|
153
|
-
...options,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
function createWarningAlert(message, options) {
|
|
157
|
-
return {
|
|
158
|
-
id: nextId++,
|
|
159
|
-
message,
|
|
160
|
-
type: 'warning',
|
|
161
|
-
duration: 4000,
|
|
162
|
-
...options,
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function createInfoAlert(message, options) {
|
|
166
|
-
return {
|
|
167
|
-
id: nextId++,
|
|
168
|
-
message,
|
|
169
|
-
type: 'info',
|
|
170
|
-
duration: 3000,
|
|
171
|
-
...options,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
class UicPushAlertService {
|
|
176
|
-
autoIncId = 0;
|
|
177
|
-
alerts$ = new Subject();
|
|
178
|
-
get stream() {
|
|
179
|
-
return this.alerts$.asObservable();
|
|
180
|
-
}
|
|
181
|
-
show(alertData) {
|
|
182
|
-
this.autoIncId++;
|
|
183
|
-
const alert = { ...alertData, id: this.autoIncId };
|
|
184
|
-
this.alerts$.next(alert);
|
|
185
|
-
}
|
|
186
|
-
success(message, options) {
|
|
187
|
-
this.show(createSuccessAlert(message, options));
|
|
188
|
-
}
|
|
189
|
-
error(message, options) {
|
|
190
|
-
this.show(createErrorAlert(message, options));
|
|
191
|
-
}
|
|
192
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicPushAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
193
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicPushAlertService, providedIn: 'root' });
|
|
194
|
-
}
|
|
195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicPushAlertService, decorators: [{
|
|
196
|
-
type: Injectable,
|
|
197
|
-
args: [{
|
|
198
|
-
providedIn: 'root'
|
|
199
|
-
}]
|
|
200
|
-
}] });
|
|
201
|
-
|
|
202
|
-
class AlertComponent {
|
|
203
|
-
alert;
|
|
204
|
-
closeAlert = new EventEmitter();
|
|
205
|
-
interval;
|
|
206
|
-
progressValue = 0;
|
|
207
|
-
animationIntevalMs = 100;
|
|
208
|
-
pauseAnimation = false;
|
|
209
|
-
id = 0;
|
|
327
|
+
class UicFormWrapperComponent {
|
|
328
|
+
schema;
|
|
329
|
+
loading = false;
|
|
330
|
+
initialValues = {};
|
|
331
|
+
useSteps = false;
|
|
332
|
+
formSubmit = new EventEmitter();
|
|
333
|
+
fb = inject(FormBuilder);
|
|
334
|
+
form = this.fb.group({});
|
|
335
|
+
currentStep = 0;
|
|
210
336
|
ngOnInit() {
|
|
211
|
-
this.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}, this.animationIntevalMs);
|
|
337
|
+
this.buildForm();
|
|
338
|
+
this.useSteps = !!this.schema.steps && this.schema.steps.length > 0;
|
|
339
|
+
}
|
|
340
|
+
ngOnChanges(changes) {
|
|
341
|
+
if (changes['schema']) {
|
|
342
|
+
this.buildForm();
|
|
343
|
+
this.useSteps = !!this.schema.steps && this.schema.steps.length > 0;
|
|
344
|
+
if (this.useSteps && this.schema?.steps) {
|
|
345
|
+
this.currentStep = Math.min(this.currentStep, (this.schema.steps.length - 1) || 0);
|
|
346
|
+
}
|
|
222
347
|
}
|
|
223
348
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
349
|
+
handleSubmit() {
|
|
350
|
+
if (this.form.valid) {
|
|
351
|
+
this.formSubmit.emit({ result: true, form: this.form.value });
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
this.form.markAllAsTouched();
|
|
355
|
+
this.formSubmit.emit({ result: false, form: null });
|
|
356
|
+
}
|
|
227
357
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
type: Input
|
|
236
|
-
}], closeAlert: [{
|
|
237
|
-
type: Output
|
|
238
|
-
}] } });
|
|
239
|
-
|
|
240
|
-
class AlertContainerComponent {
|
|
241
|
-
alertService;
|
|
242
|
-
alerts = [];
|
|
243
|
-
constructor(alertService) {
|
|
244
|
-
this.alertService = alertService;
|
|
358
|
+
collectAllFields() {
|
|
359
|
+
if (!this.schema)
|
|
360
|
+
return [];
|
|
361
|
+
if (this.useSteps && this.schema.steps) {
|
|
362
|
+
return this.schema.steps.flatMap(step => (step.blocks ?? []).flatMap(b => b.fields ?? []));
|
|
363
|
+
}
|
|
364
|
+
return (this.schema.blocks ?? []).flatMap(b => b.fields ?? []);
|
|
245
365
|
}
|
|
246
|
-
|
|
247
|
-
this.
|
|
248
|
-
|
|
366
|
+
buildForm() {
|
|
367
|
+
const fields = this.collectAllFields();
|
|
368
|
+
fields.forEach(f => {
|
|
369
|
+
if (!this.form.contains(f.name)) {
|
|
370
|
+
const validators = this.mapValidatorsFromField(f);
|
|
371
|
+
let initial = this.initialValues[f.name] ?? null;
|
|
372
|
+
if (f.type == 'checkbox' && initial == null)
|
|
373
|
+
initial = false;
|
|
374
|
+
this.form.addControl(f.name, this.fb.control(initial, validators));
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
const namesToKeep = new Set(fields.map(f => f.name));
|
|
378
|
+
Object.keys(this.form.controls).forEach(name => {
|
|
379
|
+
if (!namesToKeep.has(name)) {
|
|
380
|
+
this.form.removeControl(name);
|
|
381
|
+
}
|
|
249
382
|
});
|
|
250
383
|
}
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
class UicButtonComponent {
|
|
264
|
-
text = '';
|
|
265
|
-
icon = '';
|
|
266
|
-
rightIcon = '';
|
|
267
|
-
iconOnly = false;
|
|
268
|
-
disabled = false;
|
|
269
|
-
loading = false;
|
|
270
|
-
size = 'm';
|
|
271
|
-
type = 'filled';
|
|
272
|
-
color = 'primary';
|
|
273
|
-
buttonTypeClass = "";
|
|
274
|
-
ngOnInit() {
|
|
275
|
-
this.buttonTypeClass = 'btn-' + this.type + ' btn-' + this.color + "-" + this.type;
|
|
276
|
-
}
|
|
277
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
278
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicButtonComponent, isStandalone: true, selector: "ui-button", inputs: { text: "text", icon: "icon", rightIcon: "rightIcon", iconOnly: "iconOnly", disabled: "disabled", loading: "loading", size: "size", type: "type", color: "color" }, ngImport: i0, template: "<button\r\n [class]=\"'main-btn ' + buttonTypeClass\"\r\n [disabled]=\"disabled || loading\"\r\n [ngClass]=\"{\r\n 'btn-tiny' :size=='t',\r\n 'btn-small' :size=='s', \r\n 'btn-medium' :size=='m',\r\n 'btn-large' :size=='l', \r\n 'btn-gigant' :size=='g'\r\n }\" >\r\n \r\n @if (!loading) {\r\n @if (icon!='' ) {\r\n <i class=\"{{icon}}\"></i>\r\n }\r\n @if (!iconOnly) {\r\n <div class=\"btn-text\" [class.norighticon]=\"rightIcon==''\" [class.noicon]=\"icon==''\">\r\n {{text}}\r\n <ng-content ></ng-content>\r\n </div>\r\n }\r\n @if (rightIcon!='' ) {\r\n <i class=\"{{rightIcon}}\"></i>\r\n }\r\n } @else {\r\n <div class=\"btn-loader-container\"> <div class=\"btn-loader\"></div> </div>\r\n }\r\n</button>", styles: [":host{width:fit-content;display:block}.main-btn{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;text-align:center;border-radius:8px;padding:0;white-space:nowrap;outline:none}.main-btn:focus,.main-btn:focus-visible{box-shadow:0 0 0 3px #8230c466}.noicon{padding-left:16px}.norighticon{padding-right:16px}.btn-text{font-weight:500}.btn-tiny{height:22px;min-width:22px}.btn-tiny>.btn-text{font-size:10px;line-height:22px}.btn-tiny i{font-size:14px;line-height:22px;width:22px}.btn-tiny .btn-loader{line-height:10px;width:10px}.btn-small{height:30px;min-width:30px}.btn-small>.btn-text{font-size:12px;line-height:30px}.btn-small i{font-size:16px;line-height:30px;width:30px}.btn-small .btn-loader{line-height:12px;width:12px}.btn-medium{height:38px;min-width:38px}.btn-medium>.btn-text{font-size:14px;line-height:38px}.btn-medium i{font-size:24px;line-height:38px;width:38px}.btn-medium .btn-loader{line-height:14px;width:14px}.btn-large{height:46px;min-width:46px}.btn-large>.btn-text{font-size:16px;line-height:46px}.btn-large i{font-size:24px;line-height:46px;width:46px}.btn-large .btn-loader{line-height:16px;width:16px}.btn-gigant{height:54px;min-width:54px}.btn-gigant>.btn-text{font-size:18px;line-height:54px}.btn-gigant i{font-size:24px;line-height:54px;width:54px}.btn-gigant .btn-loader{line-height:18px;width:18px}.btn-filled{color:#fff;transition:background .3s ease;cursor:pointer}.btn-filled:disabled{cursor:not-allowed;color:#d5d7da}.btn-bordered{border:solid 1px #e9eaeb;background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-bordered:disabled{cursor:not-allowed;color:#d5d7da;border-color:#d5d7da}.btn-ghost{color:#252b37;background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-ghost:disabled{cursor:not-allowed;color:#d5d7da}.btn-primary-filled{background-color:#63277d}.btn-primary-filled:hover{background-color:#4f1f64}.btn-primary-filled:active{background-color:#2d1238}.btn-primary-filled:disabled{background-color:#efe9f2}.btn-primary-bordered{color:#63277d}.btn-primary-bordered:hover{background-color:#efe9f2}.btn-primary-bordered:active{background-color:#cfbcd7}.btn-primary-bordered:disabled{background-color:#efe9f2}.btn-primary-ghost:hover{background-color:#efe9f2}.btn-primary-ghost:active{background-color:#cfbcd7}.btn-primary-ghost:disabled{background-color:transparent}.btn-black-filled{background-color:#0a0d12}.btn-black-filled:hover{background-color:#752bb0}.btn-black-filled:active{background-color:#4e1d76}.btn-black-filled:disabled{background-color:#f5f5f5}.btn-black-bordered{color:#414651}.btn-black-bordered:hover{background-color:#f3eaf9}.btn-black-bordered:active{background-color:#d8bfed}.btn-black-bordered:disabled{background-color:#fafafa}.btn-black-ghost:hover{background-color:#f3eaf9}.btn-black-ghost:active{background-color:#d8bfed}.btn-black-ghost:disabled{background-color:transparent}.btn-green-filled{background-color:#22c55e}.btn-green-filled:hover{background-color:#15803d}.btn-green-filled:active{background-color:#1a2e21}.btn-green-filled:disabled{background-color:#bbf7d0}.btn-green-bordered{color:#22c55e}.btn-green-bordered:hover{background-color:#bbf7d0}.btn-green-bordered:active{background-color:#4ade80}.btn-green-bordered:disabled{background-color:#bbf7d0}.btn-green-ghost:hover{background-color:#bbf7d0}.btn-green-ghost:active{background-color:#4ade80}.btn-green-ghost:disabled{background-color:transparent}.btn-yellow-filled{background-color:#fdb022}.btn-yellow-filled:hover{background-color:#dc6803}.btn-yellow-filled:active{background-color:#792e0d}.btn-yellow-filled:disabled{background-color:#fef0c7}.btn-yellow-bordered{color:#fdb022}.btn-yellow-bordered:hover{background-color:#fef0c7}.btn-yellow-bordered:active{background-color:#fec84b}.btn-yellow-bordered:disabled{background-color:#fef0c7}.btn-yellow-ghost:hover{background-color:#fef0c7}.btn-yellow-ghost:active{background-color:#fec84b}.btn-yellow-ghost:disabled{background-color:transparent}.btn-blue-filled{background-color:#93bbf0}.btn-blue-filled:hover{background-color:#6193d5}.btn-blue-filled:active{background-color:#273b55}.btn-blue-filled:disabled{background-color:#e4eefb}.btn-blue-bordered{color:#93bbf0}.btn-blue-bordered:hover{background-color:#e4eefb}.btn-blue-bordered:active{background-color:#aeccf4}.btn-blue-bordered:disabled{background-color:#e4eefb}.btn-blue-ghost:hover{background-color:#e4eefb}.btn-blue-ghost:active{background-color:#aeccf4}.btn-blue-ghost:disabled{background-color:transparent}.btn-red-filled{background-color:#f97066}.btn-red-filled:hover{background-color:#d92d20}.btn-red-filled:active{background-color:#7a271a}.btn-red-filled:disabled{background-color:#fee4e2}.btn-red-bordered{color:#f97066}.btn-red-bordered:hover{background-color:#fee4e2}.btn-red-bordered:active{background-color:#fda29b}.btn-red-bordered:disabled{background-color:#fee4e2}.btn-red-ghost:hover{background-color:#fee4e2}.btn-red-ghost:active{background-color:#fda29b}.btn-red-ghost:disabled{background-color:transparent}.btn-loader{width:14px;aspect-ratio:1;border-radius:50%;animation:l5 1s infinite linear alternate;margin:2px}.btn-loader-container{line-height:14px;margin:3px 0;display:flex;justify-content:center;width:65px}@keyframes l5{0%{box-shadow:20px 0 #e8dfec,-20px 0 #4f1f64;background:#e8dfec}33%{box-shadow:20px 0 #e8dfec,-20px 0 #4f1f64;background:#4f1f64}66%{box-shadow:20px 0 #4f1f64,-20px 0 #e8dfec;background:#4f1f64}to{box-shadow:20px 0 #4f1f64,-20px 0 #e8dfec;background:#e8dfec}}.btn-loader:before,.btn-loader:after{content:\"\";grid-area:1/1;margin:15%;border-radius:50%;background:inherit;transform:rotate(0) translate(150%);animation:l22 1s infinite}.btn-loader:after{animation-delay:-.5s}@keyframes l22-0{to{transform:rotate(1turn)}}@keyframes l22{to{transform:rotate(1turn) translate(150%)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
279
|
-
}
|
|
280
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicButtonComponent, decorators: [{
|
|
281
|
-
type: Component,
|
|
282
|
-
args: [{ selector: 'ui-button', imports: [CommonModule], template: "<button\r\n [class]=\"'main-btn ' + buttonTypeClass\"\r\n [disabled]=\"disabled || loading\"\r\n [ngClass]=\"{\r\n 'btn-tiny' :size=='t',\r\n 'btn-small' :size=='s', \r\n 'btn-medium' :size=='m',\r\n 'btn-large' :size=='l', \r\n 'btn-gigant' :size=='g'\r\n }\" >\r\n \r\n @if (!loading) {\r\n @if (icon!='' ) {\r\n <i class=\"{{icon}}\"></i>\r\n }\r\n @if (!iconOnly) {\r\n <div class=\"btn-text\" [class.norighticon]=\"rightIcon==''\" [class.noicon]=\"icon==''\">\r\n {{text}}\r\n <ng-content ></ng-content>\r\n </div>\r\n }\r\n @if (rightIcon!='' ) {\r\n <i class=\"{{rightIcon}}\"></i>\r\n }\r\n } @else {\r\n <div class=\"btn-loader-container\"> <div class=\"btn-loader\"></div> </div>\r\n }\r\n</button>", styles: [":host{width:fit-content;display:block}.main-btn{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;text-align:center;border-radius:8px;padding:0;white-space:nowrap;outline:none}.main-btn:focus,.main-btn:focus-visible{box-shadow:0 0 0 3px #8230c466}.noicon{padding-left:16px}.norighticon{padding-right:16px}.btn-text{font-weight:500}.btn-tiny{height:22px;min-width:22px}.btn-tiny>.btn-text{font-size:10px;line-height:22px}.btn-tiny i{font-size:14px;line-height:22px;width:22px}.btn-tiny .btn-loader{line-height:10px;width:10px}.btn-small{height:30px;min-width:30px}.btn-small>.btn-text{font-size:12px;line-height:30px}.btn-small i{font-size:16px;line-height:30px;width:30px}.btn-small .btn-loader{line-height:12px;width:12px}.btn-medium{height:38px;min-width:38px}.btn-medium>.btn-text{font-size:14px;line-height:38px}.btn-medium i{font-size:24px;line-height:38px;width:38px}.btn-medium .btn-loader{line-height:14px;width:14px}.btn-large{height:46px;min-width:46px}.btn-large>.btn-text{font-size:16px;line-height:46px}.btn-large i{font-size:24px;line-height:46px;width:46px}.btn-large .btn-loader{line-height:16px;width:16px}.btn-gigant{height:54px;min-width:54px}.btn-gigant>.btn-text{font-size:18px;line-height:54px}.btn-gigant i{font-size:24px;line-height:54px;width:54px}.btn-gigant .btn-loader{line-height:18px;width:18px}.btn-filled{color:#fff;transition:background .3s ease;cursor:pointer}.btn-filled:disabled{cursor:not-allowed;color:#d5d7da}.btn-bordered{border:solid 1px #e9eaeb;background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-bordered:disabled{cursor:not-allowed;color:#d5d7da;border-color:#d5d7da}.btn-ghost{color:#252b37;background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-ghost:disabled{cursor:not-allowed;color:#d5d7da}.btn-primary-filled{background-color:#63277d}.btn-primary-filled:hover{background-color:#4f1f64}.btn-primary-filled:active{background-color:#2d1238}.btn-primary-filled:disabled{background-color:#efe9f2}.btn-primary-bordered{color:#63277d}.btn-primary-bordered:hover{background-color:#efe9f2}.btn-primary-bordered:active{background-color:#cfbcd7}.btn-primary-bordered:disabled{background-color:#efe9f2}.btn-primary-ghost:hover{background-color:#efe9f2}.btn-primary-ghost:active{background-color:#cfbcd7}.btn-primary-ghost:disabled{background-color:transparent}.btn-black-filled{background-color:#0a0d12}.btn-black-filled:hover{background-color:#752bb0}.btn-black-filled:active{background-color:#4e1d76}.btn-black-filled:disabled{background-color:#f5f5f5}.btn-black-bordered{color:#414651}.btn-black-bordered:hover{background-color:#f3eaf9}.btn-black-bordered:active{background-color:#d8bfed}.btn-black-bordered:disabled{background-color:#fafafa}.btn-black-ghost:hover{background-color:#f3eaf9}.btn-black-ghost:active{background-color:#d8bfed}.btn-black-ghost:disabled{background-color:transparent}.btn-green-filled{background-color:#22c55e}.btn-green-filled:hover{background-color:#15803d}.btn-green-filled:active{background-color:#1a2e21}.btn-green-filled:disabled{background-color:#bbf7d0}.btn-green-bordered{color:#22c55e}.btn-green-bordered:hover{background-color:#bbf7d0}.btn-green-bordered:active{background-color:#4ade80}.btn-green-bordered:disabled{background-color:#bbf7d0}.btn-green-ghost:hover{background-color:#bbf7d0}.btn-green-ghost:active{background-color:#4ade80}.btn-green-ghost:disabled{background-color:transparent}.btn-yellow-filled{background-color:#fdb022}.btn-yellow-filled:hover{background-color:#dc6803}.btn-yellow-filled:active{background-color:#792e0d}.btn-yellow-filled:disabled{background-color:#fef0c7}.btn-yellow-bordered{color:#fdb022}.btn-yellow-bordered:hover{background-color:#fef0c7}.btn-yellow-bordered:active{background-color:#fec84b}.btn-yellow-bordered:disabled{background-color:#fef0c7}.btn-yellow-ghost:hover{background-color:#fef0c7}.btn-yellow-ghost:active{background-color:#fec84b}.btn-yellow-ghost:disabled{background-color:transparent}.btn-blue-filled{background-color:#93bbf0}.btn-blue-filled:hover{background-color:#6193d5}.btn-blue-filled:active{background-color:#273b55}.btn-blue-filled:disabled{background-color:#e4eefb}.btn-blue-bordered{color:#93bbf0}.btn-blue-bordered:hover{background-color:#e4eefb}.btn-blue-bordered:active{background-color:#aeccf4}.btn-blue-bordered:disabled{background-color:#e4eefb}.btn-blue-ghost:hover{background-color:#e4eefb}.btn-blue-ghost:active{background-color:#aeccf4}.btn-blue-ghost:disabled{background-color:transparent}.btn-red-filled{background-color:#f97066}.btn-red-filled:hover{background-color:#d92d20}.btn-red-filled:active{background-color:#7a271a}.btn-red-filled:disabled{background-color:#fee4e2}.btn-red-bordered{color:#f97066}.btn-red-bordered:hover{background-color:#fee4e2}.btn-red-bordered:active{background-color:#fda29b}.btn-red-bordered:disabled{background-color:#fee4e2}.btn-red-ghost:hover{background-color:#fee4e2}.btn-red-ghost:active{background-color:#fda29b}.btn-red-ghost:disabled{background-color:transparent}.btn-loader{width:14px;aspect-ratio:1;border-radius:50%;animation:l5 1s infinite linear alternate;margin:2px}.btn-loader-container{line-height:14px;margin:3px 0;display:flex;justify-content:center;width:65px}@keyframes l5{0%{box-shadow:20px 0 #e8dfec,-20px 0 #4f1f64;background:#e8dfec}33%{box-shadow:20px 0 #e8dfec,-20px 0 #4f1f64;background:#4f1f64}66%{box-shadow:20px 0 #4f1f64,-20px 0 #e8dfec;background:#4f1f64}to{box-shadow:20px 0 #4f1f64,-20px 0 #e8dfec;background:#e8dfec}}.btn-loader:before,.btn-loader:after{content:\"\";grid-area:1/1;margin:15%;border-radius:50%;background:inherit;transform:rotate(0) translate(150%);animation:l22 1s infinite}.btn-loader:after{animation-delay:-.5s}@keyframes l22-0{to{transform:rotate(1turn)}}@keyframes l22{to{transform:rotate(1turn) translate(150%)}}\n"] }]
|
|
283
|
-
}], propDecorators: { text: [{
|
|
284
|
-
type: Input
|
|
285
|
-
}], icon: [{
|
|
286
|
-
type: Input
|
|
287
|
-
}], rightIcon: [{
|
|
288
|
-
type: Input
|
|
289
|
-
}], iconOnly: [{
|
|
290
|
-
type: Input
|
|
291
|
-
}], disabled: [{
|
|
292
|
-
type: Input
|
|
293
|
-
}], loading: [{
|
|
294
|
-
type: Input
|
|
295
|
-
}], size: [{
|
|
296
|
-
type: Input
|
|
297
|
-
}], type: [{
|
|
298
|
-
type: Input
|
|
299
|
-
}], color: [{
|
|
300
|
-
type: Input
|
|
301
|
-
}] } });
|
|
302
|
-
|
|
303
|
-
class UicTableUicSearcherComponent {
|
|
304
|
-
placeholder = '';
|
|
305
|
-
label = 'Buscar';
|
|
306
|
-
searchOnKeydown = false;
|
|
307
|
-
search = new EventEmitter();
|
|
308
|
-
text = "";
|
|
309
|
-
reset() {
|
|
310
|
-
this.text = '';
|
|
311
|
-
this.search.emit(this.text);
|
|
384
|
+
mapValidatorsFromField(f) {
|
|
385
|
+
const validators = [];
|
|
386
|
+
if (f.required)
|
|
387
|
+
validators.push(Validators.required);
|
|
388
|
+
if (typeof f.min === 'number')
|
|
389
|
+
validators.push(Validators.min(f.min));
|
|
390
|
+
if (typeof f.max === 'number')
|
|
391
|
+
validators.push(Validators.max(f.max));
|
|
392
|
+
if (f.pattern instanceof RegExp)
|
|
393
|
+
validators.push(Validators.pattern(f.pattern));
|
|
394
|
+
return validators;
|
|
312
395
|
}
|
|
313
|
-
|
|
314
|
-
if (this.
|
|
315
|
-
|
|
396
|
+
getCurrentBlocks() {
|
|
397
|
+
if (!this.schema)
|
|
398
|
+
return [];
|
|
399
|
+
if (this.useSteps) {
|
|
400
|
+
const step = this.schema.steps?.[this.currentStep];
|
|
401
|
+
return step?.blocks ?? [];
|
|
316
402
|
}
|
|
403
|
+
return this.schema.blocks ?? [];
|
|
317
404
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
type: Component,
|
|
323
|
-
args: [{ selector: 'table-searcher', imports: [UicButtonComponent, FormsModule], template: "\r\n<div class=\"searcher\">\r\n <div class=\"fakeinput\">\r\n <i class=\"ri-search-line\"></i>\r\n <input [(ngModel)]=\"text\" type=\"text\" (ngModelChange)=\"updateText()\" (keydown.enter)=\"search.emit(text)\" placeholder=\"{{placeholder}}\">\r\n </div>\r\n <ui-button (click)=\"search.emit(text)\" color=\"black\" type=\"bordered\" rightIcon=\"ri-search-2-line\" size=\"m\">Buscar</ui-button>\r\n <ui-button (click)=\"reset()\" color=\"black\" type=\"bordered\" rightIcon=\"ri-close-circle-line\" size=\"m\">Limpiar</ui-button>\r\n</div>", styles: [".searcher{display:flex;gap:8px;align-items:center;flex-wrap:wrap}@media (max-width: 767px){.searcher{margin-bottom:16px}}.searcher .fakeinput{display:flex;align-items:center;border:solid 1px #e9eaeb;height:40px;padding:2px 1px 2px 10px;border-radius:8px;transition:ease .3s;width:350px}@media (max-width: 767px){.searcher .fakeinput{width:100%}}.searcher .fakeinput i{font-size:24px;margin-right:8px}.searcher .fakeinput input{border:none}.searcher .fakeinput:focus-within{border-color:#4f1f64}\n"] }]
|
|
324
|
-
}], propDecorators: { placeholder: [{
|
|
325
|
-
type: Input
|
|
326
|
-
}], label: [{
|
|
327
|
-
type: Input
|
|
328
|
-
}], searchOnKeydown: [{
|
|
329
|
-
type: Input
|
|
330
|
-
}], search: [{
|
|
331
|
-
type: Output
|
|
332
|
-
}] } });
|
|
333
|
-
|
|
334
|
-
class UicTablePaginationComponent {
|
|
335
|
-
currentPage = 1;
|
|
336
|
-
totalPages = 1;
|
|
337
|
-
size = 25;
|
|
338
|
-
loading = false;
|
|
339
|
-
visiblePages = 3;
|
|
340
|
-
pagesInView = [];
|
|
341
|
-
pageChange = new EventEmitter();
|
|
342
|
-
sizeChange = new EventEmitter();
|
|
343
|
-
get pages() {
|
|
344
|
-
const pages = [];
|
|
345
|
-
const range = Math.floor(this.visiblePages / 2);
|
|
346
|
-
let start = Math.max(1, this.currentPage - range);
|
|
347
|
-
let end = Math.min(this.totalPages, this.currentPage + range);
|
|
348
|
-
if (end === this.totalPages) {
|
|
349
|
-
start = Math.max(1, this.totalPages - (this.visiblePages - 1));
|
|
350
|
-
}
|
|
351
|
-
if (start === 1) {
|
|
352
|
-
end = Math.min(this.totalPages, this.visiblePages);
|
|
353
|
-
}
|
|
354
|
-
if (start > 1) {
|
|
355
|
-
pages.push(1);
|
|
356
|
-
if (start > 2)
|
|
357
|
-
pages.push('...');
|
|
358
|
-
}
|
|
359
|
-
for (let i = start; i <= end; i++) {
|
|
360
|
-
pages.push(i);
|
|
361
|
-
}
|
|
362
|
-
if (end < this.totalPages) {
|
|
363
|
-
if (end < this.totalPages - 1)
|
|
364
|
-
pages.push('...');
|
|
365
|
-
pages.push(this.totalPages);
|
|
405
|
+
nextStep() {
|
|
406
|
+
const stepsCount = this.schema?.steps?.length ?? 0;
|
|
407
|
+
if (this.useSteps && this.currentStep < stepsCount - 1) {
|
|
408
|
+
this.currentStep++;
|
|
366
409
|
}
|
|
367
|
-
return pages;
|
|
368
410
|
}
|
|
369
|
-
|
|
370
|
-
if (
|
|
371
|
-
this.
|
|
372
|
-
this.pageChange.emit(this.currentPage);
|
|
411
|
+
prevStep() {
|
|
412
|
+
if (this.useSteps && this.currentStep > 0) {
|
|
413
|
+
this.currentStep--;
|
|
373
414
|
}
|
|
374
415
|
}
|
|
375
|
-
|
|
376
|
-
|
|
416
|
+
getStepTitle() {
|
|
417
|
+
return this.schema.steps?.[this.currentStep]?.title ?? '';
|
|
418
|
+
}
|
|
419
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
420
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFormWrapperComponent, isStandalone: true, selector: "ui-form-wrapper", inputs: { schema: "schema", loading: "loading", initialValues: "initialValues" }, outputs: { formSubmit: "formSubmit" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n\r\n @if (useSteps) {\r\n @if (schema.steps?.length) {\r\n\r\n <div class=\"step-title\">{{ getStepTitle()}}</div>\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"(schema.steps?.[currentStep]?.blocks?.[0]?.fields?.length) ?? 0\"\r\n ></ui-skeleton-loader>\r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\r\n <section class=\"form-block\">\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n <ui-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </ui-dynamic-form>\r\n </section>\r\n }\r\n }\r\n <div class=\"step-controls\">\r\n <button type=\"button\" (click)=\"prevStep()\" [disabled]=\"currentStep === 0\">Anterior</button>\r\n\r\n @if ((schema.steps?.length ?? 0) > 0 && currentStep < ((schema.steps?.length ?? 1) - 1)) {\r\n <button type=\"button\" (click)=\"nextStep()\">Siguiente</button>\r\n } @else {\r\n <button type=\"submit\">Guardar</button>\r\n }\r\n </div>\r\n } \r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\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 (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <ui-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </ui-dynamic-form>\r\n }\r\n </section>\r\n }\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:1.5rem 0;color:var(--grey-950)}\n"], dependencies: [{ kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "form"] }, { kind: "component", type: UicSkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
377
421
|
}
|
|
378
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
422
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, decorators: [{
|
|
379
423
|
type: Component,
|
|
380
|
-
args: [{ selector: '
|
|
381
|
-
}], propDecorators: {
|
|
382
|
-
type: Input
|
|
383
|
-
}], totalPages: [{
|
|
384
|
-
type: Input
|
|
385
|
-
}], size: [{
|
|
424
|
+
args: [{ selector: 'ui-form-wrapper', imports: [UicDynamicFormComponent, UicSkeletonLoaderComponent, ReactiveFormsModule], template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n\r\n @if (useSteps) {\r\n @if (schema.steps?.length) {\r\n\r\n <div class=\"step-title\">{{ getStepTitle()}}</div>\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"(schema.steps?.[currentStep]?.blocks?.[0]?.fields?.length) ?? 0\"\r\n ></ui-skeleton-loader>\r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\r\n <section class=\"form-block\">\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n <ui-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </ui-dynamic-form>\r\n </section>\r\n }\r\n }\r\n <div class=\"step-controls\">\r\n <button type=\"button\" (click)=\"prevStep()\" [disabled]=\"currentStep === 0\">Anterior</button>\r\n\r\n @if ((schema.steps?.length ?? 0) > 0 && currentStep < ((schema.steps?.length ?? 1) - 1)) {\r\n <button type=\"button\" (click)=\"nextStep()\">Siguiente</button>\r\n } @else {\r\n <button type=\"submit\">Guardar</button>\r\n }\r\n </div>\r\n } \r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\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 (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <ui-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </ui-dynamic-form>\r\n }\r\n </section>\r\n }\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:1.5rem 0;color:var(--grey-950)}\n"] }]
|
|
425
|
+
}], propDecorators: { schema: [{
|
|
386
426
|
type: Input
|
|
387
427
|
}], loading: [{
|
|
388
428
|
type: Input
|
|
389
|
-
}],
|
|
390
|
-
type: Output
|
|
391
|
-
}], sizeChange: [{
|
|
392
|
-
type: Output
|
|
393
|
-
}] } });
|
|
394
|
-
|
|
395
|
-
class UicTableListComponent {
|
|
396
|
-
list = [];
|
|
397
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
398
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTableListComponent, isStandalone: true, selector: "app-table-list", inputs: { list: "list" }, ngImport: i0, template: "@for (item of list; track $index) {\r\n <div class=\"list-item\">\r\n <i [class]=\"item.icon??'ri-capsule-fill'\"></i>\r\n <div class=\"list-item-data\">\r\n <div>{{item.text}}</div>\r\n <p>{{item.subtext}}</p>\r\n </div> \r\n </div>\r\n\r\n}\r\n", styles: [".list-item{display:flex;margin-bottom:5px;align-items:center}.list-item i{color:#717680;margin-right:5px}.list-item-data p{color:#d5d7da;font-size:13px}\n"] });
|
|
399
|
-
}
|
|
400
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableListComponent, decorators: [{
|
|
401
|
-
type: Component,
|
|
402
|
-
args: [{ selector: 'app-table-list', imports: [], template: "@for (item of list; track $index) {\r\n <div class=\"list-item\">\r\n <i [class]=\"item.icon??'ri-capsule-fill'\"></i>\r\n <div class=\"list-item-data\">\r\n <div>{{item.text}}</div>\r\n <p>{{item.subtext}}</p>\r\n </div> \r\n </div>\r\n\r\n}\r\n", styles: [".list-item{display:flex;margin-bottom:5px;align-items:center}.list-item i{color:#717680;margin-right:5px}.list-item-data p{color:#d5d7da;font-size:13px}\n"] }]
|
|
403
|
-
}], propDecorators: { list: [{
|
|
429
|
+
}], initialValues: [{
|
|
404
430
|
type: Input
|
|
431
|
+
}], formSubmit: [{
|
|
432
|
+
type: Output
|
|
405
433
|
}] } });
|
|
406
434
|
|
|
407
|
-
class
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
else {
|
|
420
|
-
return '';
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicNameInitsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
424
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: UicNameInitsPipe, isStandalone: true, name: "nameInitials" });
|
|
425
|
-
}
|
|
426
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicNameInitsPipe, decorators: [{
|
|
427
|
-
type: Pipe,
|
|
428
|
-
args: [{
|
|
429
|
-
name: 'nameInitials'
|
|
430
|
-
}]
|
|
431
|
-
}] });
|
|
432
|
-
|
|
433
|
-
class UicTableUserComponent {
|
|
434
|
-
user;
|
|
435
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
436
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTableUserComponent, isStandalone: true, selector: "app-table-user", inputs: { user: "user" }, ngImport: i0, template: "@if (user) {\r\n <div class=\"user-row\">\r\n <div class=\"user-inits\">\r\n {{user.name | nameInitials}}\r\n </div>\r\n <div class=\"user-row-data\">\r\n <div>{{user.name}}</div>\r\n <p>{{user.id}}</p>\r\n </div>\r\n </div>\r\n}@else{\r\n -\r\n}", styles: [".user-inits{width:32px;height:32px;border-radius:50px;border:solid 1px #68269d;background-color:#d8bfed;color:#68269d;display:flex;justify-content:center;align-items:center;margin-right:12px}.user-row{display:flex;align-items:center;width:fit-content}.user-row-data{flex:1 1;font-weight:600;color:#181d27;font-size:14px}.user-row-data p{color:#717680;font-weight:400;font-size:12px;line-height:16px}\n"], dependencies: [{ kind: "pipe", type: UicNameInitsPipe, name: "nameInitials" }] });
|
|
437
|
-
}
|
|
438
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableUserComponent, decorators: [{
|
|
439
|
-
type: Component,
|
|
440
|
-
args: [{ selector: 'app-table-user', imports: [UicNameInitsPipe], template: "@if (user) {\r\n <div class=\"user-row\">\r\n <div class=\"user-inits\">\r\n {{user.name | nameInitials}}\r\n </div>\r\n <div class=\"user-row-data\">\r\n <div>{{user.name}}</div>\r\n <p>{{user.id}}</p>\r\n </div>\r\n </div>\r\n}@else{\r\n -\r\n}", styles: [".user-inits{width:32px;height:32px;border-radius:50px;border:solid 1px #68269d;background-color:#d8bfed;color:#68269d;display:flex;justify-content:center;align-items:center;margin-right:12px}.user-row{display:flex;align-items:center;width:fit-content}.user-row-data{flex:1 1;font-weight:600;color:#181d27;font-size:14px}.user-row-data p{color:#717680;font-weight:400;font-size:12px;line-height:16px}\n"] }]
|
|
441
|
-
}], propDecorators: { user: [{
|
|
442
|
-
type: Input
|
|
443
|
-
}] } });
|
|
444
|
-
|
|
445
|
-
const fadeAndRise = trigger('fadeAndRise', [
|
|
446
|
-
transition(':enter', [style({ opacity: 0, maxHeight: '0px' }), animate('.3s ease', style({ opacity: 1, maxHeight: '200px' }))]),
|
|
447
|
-
transition(':leave', [animate('.3s ease', style({ opacity: 0 }))])
|
|
448
|
-
]);
|
|
449
|
-
|
|
450
|
-
class TooltipComponent {
|
|
451
|
-
tooltip = '';
|
|
452
|
-
left = 0;
|
|
453
|
-
top = 0;
|
|
454
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
455
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TooltipComponent, isStandalone: true, selector: "app-tooltip", ngImport: i0, template: "<div @fadeAndRise class=\"tooltip\" \r\n [style.left]=\"left + 'px'\" [style.top]=\"top + 'px'\" [innerHTML]=\"tooltip\">\r\n</div>", styles: [".tooltip{position:fixed;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;max-width:400px;color:#0a0d12;-webkit-user-select:none;user-select:none;padding:5px 10px;border-radius:4px;font-size:14px;margin-top:5px;transform:translate(-50%);z-index:1000}.tooltip:before{content:\"\";width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #ffffff;position:absolute;left:calc(50% - 8px);top:-8px}\n"], animations: [fadeAndRise] });
|
|
456
|
-
}
|
|
457
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
458
|
-
type: Component,
|
|
459
|
-
args: [{ selector: 'app-tooltip', imports: [], animations: [fadeAndRise], template: "<div @fadeAndRise class=\"tooltip\" \r\n [style.left]=\"left + 'px'\" [style.top]=\"top + 'px'\" [innerHTML]=\"tooltip\">\r\n</div>", styles: [".tooltip{position:fixed;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;max-width:400px;color:#0a0d12;-webkit-user-select:none;user-select:none;padding:5px 10px;border-radius:4px;font-size:14px;margin-top:5px;transform:translate(-50%);z-index:1000}.tooltip:before{content:\"\";width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #ffffff;position:absolute;left:calc(50% - 8px);top:-8px}\n"] }]
|
|
460
|
-
}] });
|
|
461
|
-
|
|
462
|
-
class UicToolTipDirective {
|
|
463
|
-
elementRef;
|
|
464
|
-
appRef;
|
|
465
|
-
injector;
|
|
435
|
+
class UicSearcherComponent {
|
|
436
|
+
renderer;
|
|
437
|
+
overlay;
|
|
438
|
+
positionBuilder;
|
|
439
|
+
vcr;
|
|
440
|
+
icon = ''; // Icono externo
|
|
441
|
+
iconColor = 'secondary'; //color de ícono externo
|
|
442
|
+
internalIcon = ''; //Icono interno
|
|
443
|
+
size = 'm'; // tamaño general del input
|
|
444
|
+
// TEXTO
|
|
445
|
+
label = '';
|
|
446
|
+
error = '';
|
|
466
447
|
tip = '';
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
448
|
+
// FUNCTIONS
|
|
449
|
+
disabled = false;
|
|
450
|
+
showSelected = true;
|
|
451
|
+
placeholder = 'Buscar...';
|
|
452
|
+
open = false;
|
|
453
|
+
searchFn;
|
|
454
|
+
itemDisplayFn = item => String(item);
|
|
455
|
+
itemIsEnabledFn = () => true;
|
|
456
|
+
manualSearch = false;
|
|
457
|
+
selectedItem = null;
|
|
458
|
+
selectedItemChange = new EventEmitter();
|
|
459
|
+
isLoading = false;
|
|
460
|
+
searchText = '';
|
|
461
|
+
searchSubject = new Subject();
|
|
462
|
+
results$;
|
|
463
|
+
toggleButton;
|
|
464
|
+
unlistener;
|
|
465
|
+
constructor(renderer, overlay, positionBuilder, vcr) {
|
|
466
|
+
this.renderer = renderer;
|
|
467
|
+
this.overlay = overlay;
|
|
468
|
+
this.positionBuilder = positionBuilder;
|
|
469
|
+
this.vcr = vcr;
|
|
470
|
+
this.results$ = this.searchSubject.pipe(debounceTime(300), distinctUntilChanged(), tap(() => this.isLoading = true), switchMap(v => {
|
|
471
|
+
if (v.length < 3) {
|
|
472
|
+
this.isLoading = false;
|
|
473
|
+
return of([]);
|
|
474
|
+
}
|
|
475
|
+
return this.searchFn(v).pipe(finalize(() => this.isLoading = false));
|
|
476
|
+
}));
|
|
472
477
|
}
|
|
473
|
-
|
|
474
|
-
if (this.
|
|
475
|
-
this.
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
openList() {
|
|
479
|
+
if (!this.disabled && !this.open) {
|
|
480
|
+
this.open = true;
|
|
481
|
+
this.openOverlay();
|
|
482
|
+
if (this.open) {
|
|
483
|
+
setTimeout(() => {
|
|
484
|
+
this.unlistener = this.renderer.listen('window', 'click', (e) => {
|
|
485
|
+
if (!this.toggleButton.nativeElement.contains(e.target)) {
|
|
486
|
+
this.clearSearch();
|
|
487
|
+
this.unlistener();
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
}, 200);
|
|
491
|
+
}
|
|
483
492
|
}
|
|
484
493
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
this.componentRef.instance.left = (right - left) / 2 + left;
|
|
490
|
-
this.componentRef.instance.top = bottom;
|
|
494
|
+
onSearchChange(value) {
|
|
495
|
+
this.searchText = value;
|
|
496
|
+
if (!this.manualSearch) {
|
|
497
|
+
this.searchSubject.next(value);
|
|
491
498
|
}
|
|
492
499
|
}
|
|
493
|
-
|
|
494
|
-
this.
|
|
495
|
-
}
|
|
496
|
-
ngOnDestroy() {
|
|
497
|
-
this.destroy();
|
|
500
|
+
triggerSearch() {
|
|
501
|
+
this.searchSubject.next(this.searchText);
|
|
498
502
|
}
|
|
499
|
-
|
|
500
|
-
if (this.
|
|
501
|
-
this.
|
|
502
|
-
this.
|
|
503
|
-
this.
|
|
503
|
+
selectItem(item) {
|
|
504
|
+
if (this.itemIsEnabledFn(item)) {
|
|
505
|
+
this.clearSearch();
|
|
506
|
+
this.selectedItemChange.emit(item);
|
|
507
|
+
if (this.showSelected)
|
|
508
|
+
this.selectedItem = item;
|
|
504
509
|
}
|
|
505
510
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
args: [{
|
|
512
|
-
selector: '[tip]'
|
|
513
|
-
}]
|
|
514
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }], propDecorators: { tip: [{
|
|
515
|
-
type: Input
|
|
516
|
-
}], onMouseEnter: [{
|
|
517
|
-
type: HostListener,
|
|
518
|
-
args: ['mouseenter']
|
|
519
|
-
}], onMouseLeave: [{
|
|
520
|
-
type: HostListener,
|
|
521
|
-
args: ['mouseleave']
|
|
522
|
-
}] } });
|
|
523
|
-
|
|
524
|
-
const highlightRow = trigger('highlightRow', [
|
|
525
|
-
state('highlighted', style({ backgroundColor: '#efe1f5' })),
|
|
526
|
-
transition('* => highlighted', [
|
|
527
|
-
animate('1000ms ease-in', keyframes([
|
|
528
|
-
style({ backgroundColor: '#ffffff', offset: 0 }),
|
|
529
|
-
style({ backgroundColor: '#efe1f5', offset: 0.3 }),
|
|
530
|
-
style({ backgroundColor: '#ffffff', offset: 1.0 }),
|
|
531
|
-
]))
|
|
532
|
-
])
|
|
533
|
-
]);
|
|
534
|
-
|
|
535
|
-
const animatedRow = trigger('animatedRow', [
|
|
536
|
-
transition(':enter', [
|
|
537
|
-
style({ opacity: 0, transform: 'translateY(-15px)' }),
|
|
538
|
-
animate('300ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
|
|
539
|
-
]),
|
|
540
|
-
transition(':leave', [
|
|
541
|
-
animate('300ms ease-in', style({ opacity: 0, height: 0, padding: 0, margin: 0 }))
|
|
542
|
-
]),
|
|
543
|
-
]);
|
|
544
|
-
|
|
545
|
-
class UicTableComponent {
|
|
546
|
-
columns = [];
|
|
547
|
-
data = [];
|
|
548
|
-
loading = false;
|
|
549
|
-
pages = 0;
|
|
550
|
-
size = 25;
|
|
551
|
-
highlightedId = 0;
|
|
552
|
-
headerText = '';
|
|
553
|
-
totalItems = 0;
|
|
554
|
-
searchEnabled = true;
|
|
555
|
-
searchLabel = 'Buscar';
|
|
556
|
-
searchPlaceholder = 'Buscar';
|
|
557
|
-
striped = false;
|
|
558
|
-
showPagination = true;
|
|
559
|
-
showEmptyMessage = false;
|
|
560
|
-
emptyMessage = 'No hay elementos';
|
|
561
|
-
action = new EventEmitter();
|
|
562
|
-
update = new EventEmitter();
|
|
563
|
-
checkedChange = new EventEmitter();
|
|
564
|
-
checkedIds = new Set();
|
|
565
|
-
sortKey = '';
|
|
566
|
-
sortAsc = true;
|
|
567
|
-
filter = '';
|
|
568
|
-
page = 1;
|
|
569
|
-
getValue(data, key) {
|
|
570
|
-
const col = data.find(col => col.key == key);
|
|
571
|
-
return col?.value ?? '-';
|
|
572
|
-
}
|
|
573
|
-
getFontColor(data, key) {
|
|
574
|
-
const col = data.find(col => col.key == key);
|
|
575
|
-
return 'trc-' + (col?.textColor ?? 'black');
|
|
576
|
-
}
|
|
577
|
-
getBackgroundColor(data, key) {
|
|
578
|
-
const col = data.find(col => col.key == key);
|
|
579
|
-
return col?.color ?? 'transparent';
|
|
580
|
-
}
|
|
581
|
-
isValidRule(data, key) {
|
|
582
|
-
if (!key)
|
|
583
|
-
return true;
|
|
584
|
-
let valid = true;
|
|
585
|
-
key.forEach(k => {
|
|
586
|
-
const col = data.find(col => col.key == k);
|
|
587
|
-
valid = valid && !!(col?.value);
|
|
588
|
-
});
|
|
589
|
-
return valid;
|
|
590
|
-
}
|
|
591
|
-
getIcon(data, key) {
|
|
592
|
-
const col = data.find(col => col.key == key);
|
|
593
|
-
return '<i class="' + col?.icon + '"></i>';
|
|
594
|
-
}
|
|
595
|
-
getList(data, key) {
|
|
596
|
-
const col = data.find(col => col.key == key);
|
|
597
|
-
return col?.list ?? [];
|
|
511
|
+
clearSearch() {
|
|
512
|
+
this.searchText = '';
|
|
513
|
+
this.open = false;
|
|
514
|
+
this.closeOverlay();
|
|
515
|
+
this.searchSubject.next('');
|
|
598
516
|
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
517
|
+
unselect() {
|
|
518
|
+
this.selectedItem = null;
|
|
519
|
+
this.selectedItemChange.emit(null);
|
|
602
520
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
this.sortAsc = false;
|
|
610
|
-
}
|
|
611
|
-
else {
|
|
612
|
-
this.sortKey = '';
|
|
613
|
-
this.sortAsc = true;
|
|
521
|
+
dropdownTemplateRef;
|
|
522
|
+
overlayRef;
|
|
523
|
+
closeOverlay() {
|
|
524
|
+
if (this.overlayRef) {
|
|
525
|
+
this.overlayRef.dispose();
|
|
526
|
+
this.overlayRef = null;
|
|
614
527
|
}
|
|
615
|
-
this.updateData();
|
|
616
|
-
}
|
|
617
|
-
sizeChabge(newSize) {
|
|
618
|
-
this.size = newSize;
|
|
619
|
-
this.updateData();
|
|
620
|
-
}
|
|
621
|
-
pageChage(newPage) {
|
|
622
|
-
this.page = newPage;
|
|
623
|
-
this.updateData();
|
|
624
|
-
}
|
|
625
|
-
search(text) {
|
|
626
|
-
this.filter = text;
|
|
627
|
-
this.updateData();
|
|
628
528
|
}
|
|
629
|
-
|
|
630
|
-
this.
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
529
|
+
openOverlay() {
|
|
530
|
+
if (this.overlayRef)
|
|
531
|
+
return;
|
|
532
|
+
const width = this.toggleButton.nativeElement.getBoundingClientRect().width;
|
|
533
|
+
const positionStrategy = this.positionBuilder
|
|
534
|
+
.flexibleConnectedTo(this.toggleButton)
|
|
535
|
+
.withPositions([
|
|
536
|
+
{
|
|
537
|
+
originX: 'start',
|
|
538
|
+
originY: 'bottom',
|
|
539
|
+
overlayX: 'start',
|
|
540
|
+
overlayY: 'top',
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
originX: 'start',
|
|
544
|
+
originY: 'top',
|
|
545
|
+
overlayX: 'start',
|
|
546
|
+
overlayY: 'bottom',
|
|
547
|
+
}
|
|
548
|
+
])
|
|
549
|
+
.withFlexibleDimensions(false)
|
|
550
|
+
.withPush(false);
|
|
551
|
+
this.overlayRef = this.overlay.create({
|
|
552
|
+
positionStrategy,
|
|
553
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
554
|
+
hasBackdrop: true,
|
|
555
|
+
backdropClass: 'transparent-backdrop'
|
|
636
556
|
});
|
|
557
|
+
const templatePortal = new TemplatePortal(this.dropdownTemplateRef, this.vcr);
|
|
558
|
+
this.overlayRef.attach(templatePortal);
|
|
559
|
+
this.overlayRef.backdropClick().subscribe(() => this.closeOverlay());
|
|
560
|
+
this.overlayRef.overlayElement.style.width = `${width}px`;
|
|
637
561
|
}
|
|
638
|
-
|
|
639
|
-
if (
|
|
640
|
-
this.checkedIds.add(id);
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
this.checkedIds.delete(id);
|
|
644
|
-
}
|
|
645
|
-
this.areAllSelected();
|
|
646
|
-
this.checkedChange.emit(Array.from(this.checkedIds));
|
|
647
|
-
}
|
|
648
|
-
toggleAll(checked) {
|
|
649
|
-
if (checked) {
|
|
650
|
-
this.data.forEach(item => this.checkedIds.add(item.id));
|
|
651
|
-
}
|
|
652
|
-
else {
|
|
653
|
-
this.checkedIds.clear();
|
|
654
|
-
}
|
|
655
|
-
this.checkedChange.emit(Array.from(this.checkedIds));
|
|
656
|
-
}
|
|
657
|
-
areAllSelected() {
|
|
658
|
-
this.allSelected = this.checkedIds.size === this.data.length;
|
|
659
|
-
}
|
|
660
|
-
allSelected = false;
|
|
661
|
-
ngOnChanges() {
|
|
662
|
-
this.areAllSelected();
|
|
663
|
-
}
|
|
664
|
-
doAction(rowId, key) {
|
|
665
|
-
this.action.emit({ rowId, key });
|
|
666
|
-
}
|
|
667
|
-
resetCheckedIds() {
|
|
668
|
-
this.checkedIds.clear();
|
|
669
|
-
this.checkedChange.emit([]);
|
|
670
|
-
}
|
|
671
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
672
|
-
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", pages: "pages", size: "size", highlightedId: "highlightedId", headerText: "headerText", totalItems: "totalItems", searchEnabled: "searchEnabled", searchLabel: "searchLabel", searchPlaceholder: "searchPlaceholder", striped: "striped", showPagination: "showPagination", showEmptyMessage: "showEmptyMessage", emptyMessage: "emptyMessage" }, outputs: { action: "action", update: "update", checkedChange: "checkedChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"table-filters\">\r\n @if (searchEnabled) {\r\n <table-searcher (search)=\"search($event)\" [placeholder]=\"searchPlaceholder\" ></table-searcher>\r\n }\r\n <div class=\"filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n<div class=\"table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"table-topbar\"> {{headerText}} <span class=\"hightlited-note\"> {{totalItems}} </span> </div>\r\n }\r\n <div class=\"table-container\"> \r\n <table [class.striped]=\"striped\">\r\n <thead>\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <th>\r\n <div class=\"th-wrap\">{{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div (click)=\"sortClick(header.key)\" [ngClass]=\"{'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 @if (header.type=='checkbox') {\r\n <ui-checkbox [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\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(10); track $index) {\r\n <tr class=\"\">\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"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\" [class.tr-highlighted]=\"row.highlighted\">\r\n @for (header of columns; track $index) {\r\n \r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\">\r\n @if (header.type == 'text') {\r\n {{ getValue(row.data,header.key) }} \r\n }\r\n @if (header.type == 'icon-list') {\r\n <div class=\"table-icon-wrap\">\r\n @for (alert of getList(row.data,header.key); track $index) {\r\n <i [tip]=\"alert.text\" [class]=\"alert.icon + ' alert'\" ></i>\r\n }\r\n </div>\r\n }\r\n @else if (header.type == 'list'){\r\n <app-table-list [list]=\"getList(row.data,header.key)\"></app-table-list> \r\n }\r\n @else if (header.type == 'user'){\r\n <app-table-user [user]=\"getUser(row.data,header.key)\"></app-table-user> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [ngModel]=\"checkedIds.has(row.id)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (header.type == 'actions') { \r\n <div class=\"table-actions\">\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 [iconOnly]=\"btn.text==null\"\r\n [text]=\"btn.text??''\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color\"\r\n (click)=\"doAction(row.id,btn.key)\">\r\n </ui-button> \r\n }\r\n } \r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }@empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"empty\">{{emptyMessage}} </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 <app-table-pagination \r\n [loading]=\"loading\" \r\n [totalPages]=\"pages\" \r\n [size]=\"size\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </app-table-pagination>\r\n }\r\n</div>", styles: [".table-wrapper{overflow:hidden;border:solid 1px #e9eaeb;border-radius:12px}table{width:100%;font-weight:400;color:#535862}table th{font-size:12px;height:44px;font-weight:500;background-color:#fafafa;border-left:solid 6px #fafafa}table th .th-wrap{white-space:nowrap;display:flex;align-items:center}table th .th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;margin-left:10px;cursor:pointer;transition:ease .3s;color:#a4a7ae}table th .th-wrap div:hover{color:#592371}table td{font-size:14px;height:64px}table td,table th{padding:4px 24px;vertical-align:middle;border-bottom:solid 1px #e9eaeb}table tr{transition:ease .3s}table tr:hover{background-color:#fafafa}.table-container{width:100%;overflow-x:auto}.table-topbar{padding:20px 24px;font-weight:600;font-size:18px;line-height:28px;gap:16px;display:flex;align-items:center;color:#181d27;border-bottom:solid 1px #e9eaeb}.table-actions{display:flex;gap:2px}.table-icon-wrap{display:flex;justify-content:center;gap:8px;font-size:18px;margin-right:5px}.loader-tr{border-bottom:none!important}.loader-tr td{padding:0}.sort-active{color:#752bb0!important;border:solid 1px}.empty{text-align:center;color:#d5d7da}.table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}.filter-actions{display:flex;gap:8px}.alert{width:24px;height:24px;font-size:18px;background-color:#f04438;color:#fff;border-radius:50%;padding:3px}.loader{height:5px;width:100%;--c:no-repeat linear-gradient(#592371 0 0);background:var(--c),var(--c),#592371;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}}.striped tbody tr:nth-child(odd){background-color:#fafafa;transition:ease .3s}.striped tbody tr:nth-child(odd):hover{background-color:#592371}.tr-highlighted{border-left:solid 6px #16a34a}.trc-primary{color:#592371}.trc-red{color:#f04438}.trc-blue{color:#78aaec}.trc-green{color:#16a34a}.trc-yellow{color:#f79009}.trc-black{color:#181d27}.trc-grey{color:#d5d7da}.row-loader{background:linear-gradient(90deg,#e0e0e0 25%,#f5f5f5,#e0e0e0 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}}\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: UicTableUserComponent, selector: "app-table-user", inputs: ["user"] }, { kind: "component", type: UicTableListComponent, selector: "app-table-list", inputs: ["list"] }, { kind: "component", type: UicTableUicSearcherComponent, selector: "table-searcher", inputs: ["placeholder", "label", "searchOnKeydown"], outputs: ["search"] }, { kind: "component", type: UicTablePaginationComponent, selector: "app-table-pagination", inputs: ["currentPage", "totalPages", "size", "loading"], outputs: ["pageChange", "sizeChange"] }, { kind: "directive", type: UicToolTipDirective, selector: "[tip]", inputs: ["tip"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["label", "placeholder", "disabled", "loading"] }, { 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"] }], animations: [highlightRow, animatedRow] });
|
|
562
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSearcherComponent, deps: [{ token: i0.Renderer2 }, { token: i1$1.Overlay }, { token: i1$1.OverlayPositionBuilder }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
563
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSearcherComponent, isStandalone: true, selector: "ui-searcher", inputs: { icon: "icon", iconColor: "iconColor", internalIcon: "internalIcon", size: "size", label: "label", error: "error", tip: "tip", disabled: "disabled", showSelected: "showSelected", placeholder: "placeholder", searchFn: "searchFn", itemDisplayFn: "itemDisplayFn", itemIsEnabledFn: "itemIsEnabledFn", manualSearch: "manualSearch", selectedItem: "selectedItem" }, outputs: { selectedItemChange: "selectedItemChange" }, viewQueries: [{ propertyName: "toggleButton", first: true, predicate: ["inputwrapp"], descendants: true }, { propertyName: "dropdownTemplateRef", first: true, predicate: ["dropdownTemplate"], descendants: true }], ngImport: i0, template: "\r\n<div class=\"input-wrapper\">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\"> \r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n \r\n <div class=\"fakeinput-wrapp\" #inputwrapp >\r\n <!-- INPUT -->\r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (selectedItem == null) { \r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <input\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\"\r\n />\r\n </div> \r\n @if (manualSearch) {\r\n <ui-button (click)=\"triggerSearch()\" size=\"t\" ></ui-button>\r\n }\r\n <ui-button size=\"t\" icon=\"ri-close-large-line\" (click)=\"clearSearch()\"></ui-button>\r\n }@else {\r\n <div class=\"input-container pad-{{size}}\" >\r\n <div class=\"selected-item\" >\r\n <div class=\"selected-item-text\" [innerHTML]=\"itemDisplayFn(selectedItem)\"></div> \r\n <ui-button (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 @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert f-red\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n\r\n<ng-template #dropdownTemplate>\r\n @if (results$ | async; as items){\r\n <div class=\"results\">\r\n @if (isLoading) {\r\n <div class=\"loader\"></div>\r\n }\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(item)\" (click)=\"selectItem(item)\" [innerHTML]=\"itemDisplayFn(item)\">\r\n </div>\r\n }@empty {\r\n <div class=\"t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n\r\n", styles: [".loader{height:4px;width:100%;--c:no-repeat linear-gradient(#6100ee 0 0);background:var(--c),var(--c),#d7b8fc;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}}.wrapp-fakeinput{position:relative}.selected-item{border-radius:5px;background-color:var(--primary-500);padding-left:10px;height:25px;display:flex;align-items:center;justify-content:space-between}.selected-item-text{overflow:hidden;white-space:nowrap}.results{background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;border:solid 1px var(--grey-200);border-radius:5px;font-size:13px;z-index:150;overflow:hidden}\n", ":host{width:100%}.input-container{flex:1 1;padding:.25rem;overflow:hidden}.input-options{position:absolute;border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:.875rem;z-index:50;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.input-option{line-height:1rem;display:flex;align-items:center;padding:6px 12px;-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-s{color:var(--grey-200);font-size:1rem}.input-internalicon-m{color:var(--grey-200);font-size:1.125rem}.input-internalicon-l{color:var(--grey-200);font-size:1.25rem}.label{font-size:.875rem;line-height:1.125rem;font-weight:400;color:var(--grey-950);margin-bottom:var(--input-label-space)}.fakeinput{border-radius:var(--input-radius);overflow:hidden;border:solid 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;padding-left:.25rem;-webkit-user-select:none;user-select:none;background-color:var(--white);transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--grey-300)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--grey-200);color:var(--grey-800)}.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(--grey-200);color:var(--red-500)}.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 3px var(--primary-400)}.fakeinput:focus-within button{background-color:var(--primary-500);color:var(--white)}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput:focus-within button:enabled:active{background-color:var(--primary-600)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-color:var(--red-500)}.t-disabled{color:var(--grey-300);padding:5px;text-align:center}.disabledinput{background-color:var(--grey-50) -disabled;color:var(--grey-800)}.disabledinput ::ng-deep input{color:var(--grey-800)}.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)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-300)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}\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$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.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"] }] });
|
|
673
564
|
}
|
|
674
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
565
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSearcherComponent, decorators: [{
|
|
675
566
|
type: Component,
|
|
676
|
-
args: [{ selector: 'ui-
|
|
677
|
-
|
|
678
|
-
}], propDecorators: { columns: [{
|
|
679
|
-
type: Input
|
|
680
|
-
}], data: [{
|
|
567
|
+
args: [{ selector: 'ui-searcher', imports: [CommonModule, FormsModule, AsyncPipe, UicButtonComponent], template: "\r\n<div class=\"input-wrapper\">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\"> \r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n \r\n <div class=\"fakeinput-wrapp\" #inputwrapp >\r\n <!-- INPUT -->\r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (selectedItem == null) { \r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <input\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\"\r\n />\r\n </div> \r\n @if (manualSearch) {\r\n <ui-button (click)=\"triggerSearch()\" size=\"t\" ></ui-button>\r\n }\r\n <ui-button size=\"t\" icon=\"ri-close-large-line\" (click)=\"clearSearch()\"></ui-button>\r\n }@else {\r\n <div class=\"input-container pad-{{size}}\" >\r\n <div class=\"selected-item\" >\r\n <div class=\"selected-item-text\" [innerHTML]=\"itemDisplayFn(selectedItem)\"></div> \r\n <ui-button (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 @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert f-red\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n\r\n<ng-template #dropdownTemplate>\r\n @if (results$ | async; as items){\r\n <div class=\"results\">\r\n @if (isLoading) {\r\n <div class=\"loader\"></div>\r\n }\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(item)\" (click)=\"selectItem(item)\" [innerHTML]=\"itemDisplayFn(item)\">\r\n </div>\r\n }@empty {\r\n <div class=\"t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n\r\n", styles: [".loader{height:4px;width:100%;--c:no-repeat linear-gradient(#6100ee 0 0);background:var(--c),var(--c),#d7b8fc;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}}.wrapp-fakeinput{position:relative}.selected-item{border-radius:5px;background-color:var(--primary-500);padding-left:10px;height:25px;display:flex;align-items:center;justify-content:space-between}.selected-item-text{overflow:hidden;white-space:nowrap}.results{background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;border:solid 1px var(--grey-200);border-radius:5px;font-size:13px;z-index:150;overflow:hidden}\n", ":host{width:100%}.input-container{flex:1 1;padding:.25rem;overflow:hidden}.input-options{position:absolute;border-radius:var(--input-radius);background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:.875rem;z-index:50;overflow:hidden}.option-divider{width:98%;margin:auto;border-bottom:1px solid var(--grey-200)}.input-option{line-height:1rem;display:flex;align-items:center;padding:6px 12px;-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-s{color:var(--grey-200);font-size:1rem}.input-internalicon-m{color:var(--grey-200);font-size:1.125rem}.input-internalicon-l{color:var(--grey-200);font-size:1.25rem}.label{font-size:.875rem;line-height:1.125rem;font-weight:400;color:var(--grey-950);margin-bottom:var(--input-label-space)}.fakeinput{border-radius:var(--input-radius);overflow:hidden;border:solid 1px var(--grey-200);display:flex;align-items:center;font-size:.875rem;padding-left:.25rem;-webkit-user-select:none;user-select:none;background-color:var(--white);transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:var(--grey-300)}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:var(--grey-200);color:var(--grey-800)}.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(--grey-200);color:var(--red-500)}.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 3px var(--primary-400)}.fakeinput:focus-within button{background-color:var(--primary-500);color:var(--white)}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:var(--primary-300);color:var(--white)}.fakeinput:focus-within button:enabled:active{background-color:var(--primary-600)}.fakeinput:hover{border-color:var(--grey-400);cursor:text}.activeselect{border-color:var(--primary-600)}.errorinput{border-color:var(--red-500)}.t-disabled{color:var(--grey-300);padding:5px;text-align:center}.disabledinput{background-color:var(--grey-50) -disabled;color:var(--grey-800)}.disabledinput ::ng-deep input{color:var(--grey-800)}.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)}.tip{color:var(--grey-500)}.item-disabled{color:var(--grey-300)}.item-disabled:hover{background-color:var(--white);cursor:not-allowed}\n"] }]
|
|
568
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i1$1.Overlay }, { type: i1$1.OverlayPositionBuilder }, { type: i0.ViewContainerRef }], propDecorators: { icon: [{
|
|
681
569
|
type: Input
|
|
682
|
-
}],
|
|
570
|
+
}], iconColor: [{
|
|
683
571
|
type: Input
|
|
684
|
-
}],
|
|
572
|
+
}], internalIcon: [{
|
|
685
573
|
type: Input
|
|
686
574
|
}], size: [{
|
|
687
575
|
type: Input
|
|
688
|
-
}],
|
|
576
|
+
}], label: [{
|
|
689
577
|
type: Input
|
|
690
|
-
}],
|
|
578
|
+
}], error: [{
|
|
691
579
|
type: Input
|
|
692
|
-
}],
|
|
580
|
+
}], tip: [{
|
|
693
581
|
type: Input
|
|
694
|
-
}],
|
|
582
|
+
}], disabled: [{
|
|
695
583
|
type: Input
|
|
696
|
-
}],
|
|
584
|
+
}], showSelected: [{
|
|
697
585
|
type: Input
|
|
698
|
-
}],
|
|
586
|
+
}], placeholder: [{
|
|
699
587
|
type: Input
|
|
700
|
-
}],
|
|
588
|
+
}], searchFn: [{
|
|
701
589
|
type: Input
|
|
702
|
-
}],
|
|
590
|
+
}], itemDisplayFn: [{
|
|
703
591
|
type: Input
|
|
704
|
-
}],
|
|
592
|
+
}], itemIsEnabledFn: [{
|
|
705
593
|
type: Input
|
|
706
|
-
}],
|
|
594
|
+
}], manualSearch: [{
|
|
707
595
|
type: Input
|
|
708
|
-
}],
|
|
709
|
-
type:
|
|
710
|
-
}],
|
|
711
|
-
type: Output
|
|
712
|
-
}], checkedChange: [{
|
|
596
|
+
}], selectedItem: [{
|
|
597
|
+
type: Input
|
|
598
|
+
}], selectedItemChange: [{
|
|
713
599
|
type: Output
|
|
600
|
+
}], toggleButton: [{
|
|
601
|
+
type: ViewChild,
|
|
602
|
+
args: ['inputwrapp']
|
|
603
|
+
}], dropdownTemplateRef: [{
|
|
604
|
+
type: ViewChild,
|
|
605
|
+
args: ['dropdownTemplate']
|
|
714
606
|
}] } });
|
|
715
607
|
|
|
716
|
-
|
|
717
|
-
;
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
state('visible', style({ transform: 'translateX(0)' })),
|
|
726
|
-
state('hidden', style({ transform: 'translateX(100%)' })),
|
|
727
|
-
// animación al CREARSE
|
|
728
|
-
transition('void => visible', [
|
|
729
|
-
style({ opacity: .8, transform: 'translateX(100%)' }),
|
|
730
|
-
animate('.5s ease')
|
|
731
|
-
]),
|
|
732
|
-
// animación al CERRAR
|
|
733
|
-
transition('visible => hidden', [
|
|
734
|
-
animate('.5s ease')
|
|
735
|
-
])
|
|
736
|
-
]);
|
|
737
|
-
const fadeBackdrop = trigger('fadeBackdrop', [
|
|
738
|
-
state('visible', style({ opacity: 1 })),
|
|
739
|
-
state('hidden', style({ opacity: 0 })),
|
|
740
|
-
transition('void => visible', [
|
|
741
|
-
style({ opacity: 0 }),
|
|
742
|
-
animate('300ms ease-out')
|
|
743
|
-
]),
|
|
744
|
-
transition('visible => hidden', [
|
|
745
|
-
animate('300ms ease-in')
|
|
746
|
-
])
|
|
747
|
-
]);
|
|
748
|
-
|
|
749
|
-
const simpleFade = trigger('simpleFade', [
|
|
750
|
-
transition(':enter', [style({ opacity: 0 }), animate('.3s ease', style({ opacity: 1 }))]),
|
|
751
|
-
transition(':leave', [animate('.3s ease', style({ opacity: 0 }))])
|
|
752
|
-
]);
|
|
753
|
-
|
|
754
|
-
const base = createValueAccessor();
|
|
755
|
-
class UicSelectComponent extends base {
|
|
756
|
-
icon = ''; // Icono externo
|
|
757
|
-
iconColor = 'primary'; //color de ícono externo
|
|
758
|
-
internalIcon = ''; //Icono interno
|
|
759
|
-
size = 'm'; // tamaño general del input
|
|
760
|
-
label = '';
|
|
761
|
-
error = '';
|
|
762
|
-
tip = '';
|
|
763
|
-
disabled = false;
|
|
764
|
-
nullable = false;
|
|
765
|
-
options = [];
|
|
766
|
-
showSubtitle = false;
|
|
767
|
-
overlayPositions = [
|
|
768
|
-
{
|
|
769
|
-
originX: 'start',
|
|
770
|
-
originY: 'bottom',
|
|
771
|
-
overlayX: 'start',
|
|
772
|
-
overlayY: 'top'
|
|
773
|
-
},
|
|
774
|
-
{
|
|
775
|
-
originX: 'start',
|
|
776
|
-
originY: 'top',
|
|
777
|
-
overlayX: 'start',
|
|
778
|
-
overlayY: 'bottom'
|
|
779
|
-
}
|
|
780
|
-
];
|
|
781
|
-
open = false;
|
|
782
|
-
emptyText = '- Seleccionar -';
|
|
783
|
-
renderer = inject(Renderer2);
|
|
784
|
-
toggleButton;
|
|
785
|
-
unlistener;
|
|
786
|
-
ngOnInit() {
|
|
787
|
-
this.emptyText = this.disabled ? '-' : '- Seleccionar -';
|
|
788
|
-
}
|
|
789
|
-
openList() {
|
|
790
|
-
if (!this.disabled) {
|
|
791
|
-
this.open = !this.open;
|
|
792
|
-
if (this.open) {
|
|
793
|
-
setTimeout(() => {
|
|
794
|
-
this.unlistener = this.renderer.listen('window', 'click', (e) => {
|
|
795
|
-
if (!this.toggleButton.nativeElement.contains(e.target)) {
|
|
796
|
-
this.open = false;
|
|
797
|
-
this.unlistener();
|
|
798
|
-
}
|
|
799
|
-
});
|
|
800
|
-
}, 200);
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
selectOption(option) {
|
|
805
|
-
this.open = false;
|
|
806
|
-
this.unlistener();
|
|
807
|
-
this.notifyChange(option);
|
|
808
|
-
}
|
|
809
|
-
//( overlay)
|
|
810
|
-
closeList() {
|
|
811
|
-
this.open = false;
|
|
608
|
+
class UicTableUicSearcherComponent {
|
|
609
|
+
placeholder = '';
|
|
610
|
+
label = 'Buscar';
|
|
611
|
+
searchOnKeydown = false;
|
|
612
|
+
filter = new EventEmitter();
|
|
613
|
+
text = "";
|
|
614
|
+
reset() {
|
|
615
|
+
this.text = '';
|
|
616
|
+
this.filter.emit(this.text);
|
|
812
617
|
}
|
|
813
|
-
|
|
814
|
-
if (
|
|
815
|
-
this.
|
|
618
|
+
updateText() {
|
|
619
|
+
if (this.searchOnKeydown) {
|
|
620
|
+
this.filter.emit(this.text);
|
|
816
621
|
}
|
|
817
622
|
}
|
|
818
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
819
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
820
|
-
{
|
|
821
|
-
provide: NG_VALUE_ACCESSOR,
|
|
822
|
-
useExisting: forwardRef(() => UicSelectComponent),
|
|
823
|
-
multi: true
|
|
824
|
-
}
|
|
825
|
-
], viewQueries: [{ propertyName: "toggleButton", first: true, predicate: ["inputwrapp"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"input-wrapper \">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n <div class=\"fakeinput-wrapp\" #inputwrapp cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" > \r\n\r\n <!-- INPUT -->\r\n <div (click)=\"openList()\" class=\"fakeinput\" [ngClass]=\"{'activeselect':open, 'errorinput':error, 'disabledinput':disabled}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"fakeinput-content\">{{(value?.text || emptyText)}}</div>\r\n @if (!disabled) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n @if (open) {\r\n\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"trigger\"\r\n [cdkConnectedOverlayOpen]=\"open\"\r\n [cdkConnectedOverlayHasBackdrop]=\"true\"\r\n (backdropClick)=\"closeList()\"\r\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\r\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\r\n >\r\n\r\n <div class=\"input-options\" @fadeAndRise >\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;\" >- Ninguno -</div>\r\n }\r\n\r\n @for (option of options; track $index) {\r\n <div (click)=\"selectOption(option)\" class=\"input-option\">\r\n <div style=\"padding: 2px;\">\r\n <div class=\"f-medium\">{{option.text }}</div>\r\n <div *ngIf=\"showSubtitle\" class=\"f-extralight\">{{option.detail}}</div>\r\n </div>\r\n </div>\r\n }\r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n }\r\n\r\n </div>\r\n <!-- ALERTS -->\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n </div>\r\n</div>", styles: [":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;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:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\n"], dependencies: [{ 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: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$2.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], animations: [fadeAndRise] });
|
|
623
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableUicSearcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
624
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UicTableUicSearcherComponent, isStandalone: true, selector: "uic-table-searcher", inputs: { placeholder: "placeholder", label: "label", searchOnKeydown: "searchOnKeydown" }, outputs: { filter: "filter" }, ngImport: i0, template: "\r\n<div class=\"searcher\">\r\n <div class=\"fakeinput\">\r\n <i class=\"ri-search-line\"></i>\r\n <input [(ngModel)]=\"text\" type=\"text\" (ngModelChange)=\"updateText()\" (keydown.enter)=\"filter.emit(text)\" placeholder=\"{{placeholder}}\">\r\n </div>\r\n <ui-button (click)=\"filter.emit(text)\" color=\"black\" type=\"bordered\" rightIcon=\"ri-search-2-line\" size=\"m\">Buscar</ui-button>\r\n <ui-button (click)=\"reset()\" color=\"black\" type=\"bordered\" rightIcon=\"ri-close-circle-line\" size=\"m\">Limpiar</ui-button>\r\n</div>", styles: [".searcher{display:flex;gap:8px;align-items:center;flex-wrap:wrap}@media (max-width: 767px){.searcher{margin-bottom:16px}}.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: 767px){.searcher .fakeinput{width:100%}}.searcher .fakeinput i{font-size:24px;margin-right:8px}.searcher .fakeinput input{border:none}.searcher .fakeinput:focus-within{border-color:var(--primary-600)}\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$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
826
625
|
}
|
|
827
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableUicSearcherComponent, decorators: [{
|
|
828
627
|
type: Component,
|
|
829
|
-
args: [{ selector: '
|
|
830
|
-
|
|
831
|
-
provide: NG_VALUE_ACCESSOR,
|
|
832
|
-
useExisting: forwardRef(() => UicSelectComponent),
|
|
833
|
-
multi: true
|
|
834
|
-
}
|
|
835
|
-
], animations: [fadeAndRise], template: "<div class=\"input-wrapper \">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n <div class=\"fakeinput-wrapp\" #inputwrapp cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" > \r\n\r\n <!-- INPUT -->\r\n <div (click)=\"openList()\" class=\"fakeinput\" [ngClass]=\"{'activeselect':open, 'errorinput':error, 'disabledinput':disabled}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"fakeinput-content\">{{(value?.text || emptyText)}}</div>\r\n @if (!disabled) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n @if (open) {\r\n\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"trigger\"\r\n [cdkConnectedOverlayOpen]=\"open\"\r\n [cdkConnectedOverlayHasBackdrop]=\"true\"\r\n (backdropClick)=\"closeList()\"\r\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\r\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\r\n >\r\n\r\n <div class=\"input-options\" @fadeAndRise >\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;\" >- Ninguno -</div>\r\n }\r\n\r\n @for (option of options; track $index) {\r\n <div (click)=\"selectOption(option)\" class=\"input-option\">\r\n <div style=\"padding: 2px;\">\r\n <div class=\"f-medium\">{{option.text }}</div>\r\n <div *ngIf=\"showSubtitle\" class=\"f-extralight\">{{option.detail}}</div>\r\n </div>\r\n </div>\r\n }\r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n }\r\n\r\n </div>\r\n <!-- ALERTS -->\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n </div>\r\n</div>", styles: [":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;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:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\n"] }]
|
|
836
|
-
}], propDecorators: { icon: [{
|
|
837
|
-
type: Input
|
|
838
|
-
}], iconColor: [{
|
|
839
|
-
type: Input
|
|
840
|
-
}], internalIcon: [{
|
|
841
|
-
type: Input
|
|
842
|
-
}], size: [{
|
|
628
|
+
args: [{ selector: 'uic-table-searcher', imports: [UicButtonComponent, FormsModule], template: "\r\n<div class=\"searcher\">\r\n <div class=\"fakeinput\">\r\n <i class=\"ri-search-line\"></i>\r\n <input [(ngModel)]=\"text\" type=\"text\" (ngModelChange)=\"updateText()\" (keydown.enter)=\"filter.emit(text)\" placeholder=\"{{placeholder}}\">\r\n </div>\r\n <ui-button (click)=\"filter.emit(text)\" color=\"black\" type=\"bordered\" rightIcon=\"ri-search-2-line\" size=\"m\">Buscar</ui-button>\r\n <ui-button (click)=\"reset()\" color=\"black\" type=\"bordered\" rightIcon=\"ri-close-circle-line\" size=\"m\">Limpiar</ui-button>\r\n</div>", styles: [".searcher{display:flex;gap:8px;align-items:center;flex-wrap:wrap}@media (max-width: 767px){.searcher{margin-bottom:16px}}.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: 767px){.searcher .fakeinput{width:100%}}.searcher .fakeinput i{font-size:24px;margin-right:8px}.searcher .fakeinput input{border:none}.searcher .fakeinput:focus-within{border-color:var(--primary-600)}\n"] }]
|
|
629
|
+
}], propDecorators: { placeholder: [{
|
|
843
630
|
type: Input
|
|
844
631
|
}], label: [{
|
|
845
632
|
type: Input
|
|
846
|
-
}],
|
|
847
|
-
type: Input
|
|
848
|
-
}], tip: [{
|
|
849
|
-
type: Input
|
|
850
|
-
}], disabled: [{
|
|
851
|
-
type: Input
|
|
852
|
-
}], nullable: [{
|
|
853
|
-
type: Input
|
|
854
|
-
}], options: [{
|
|
855
|
-
type: Input
|
|
856
|
-
}], showSubtitle: [{
|
|
633
|
+
}], searchOnKeydown: [{
|
|
857
634
|
type: Input
|
|
858
|
-
}],
|
|
859
|
-
type:
|
|
860
|
-
args: ['inputwrapp']
|
|
635
|
+
}], filter: [{
|
|
636
|
+
type: Output
|
|
861
637
|
}] } });
|
|
862
638
|
|
|
863
|
-
class
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
this.
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
639
|
+
class UicTablePaginationComponent {
|
|
640
|
+
currentPage = 1;
|
|
641
|
+
totalPages = 1;
|
|
642
|
+
size = 25;
|
|
643
|
+
loading = false;
|
|
644
|
+
visiblePages = 3;
|
|
645
|
+
pagesInView = [];
|
|
646
|
+
pageChange = new EventEmitter();
|
|
647
|
+
sizeChange = new EventEmitter();
|
|
648
|
+
get pages() {
|
|
649
|
+
const pages = [];
|
|
650
|
+
const range = Math.floor(this.visiblePages / 2);
|
|
651
|
+
let start = Math.max(1, this.currentPage - range);
|
|
652
|
+
let end = Math.min(this.totalPages, this.currentPage + range);
|
|
653
|
+
if (end === this.totalPages) {
|
|
654
|
+
start = Math.max(1, this.totalPages - (this.visiblePages - 1));
|
|
655
|
+
}
|
|
656
|
+
if (start === 1) {
|
|
657
|
+
end = Math.min(this.totalPages, this.visiblePages);
|
|
658
|
+
}
|
|
659
|
+
if (start > 1) {
|
|
660
|
+
pages.push(1);
|
|
661
|
+
if (start > 2)
|
|
662
|
+
pages.push('...');
|
|
663
|
+
}
|
|
664
|
+
for (let i = start; i <= end; i++) {
|
|
665
|
+
pages.push(i);
|
|
666
|
+
}
|
|
667
|
+
if (end < this.totalPages) {
|
|
668
|
+
if (end < this.totalPages - 1)
|
|
669
|
+
pages.push('...');
|
|
670
|
+
pages.push(this.totalPages);
|
|
671
|
+
}
|
|
672
|
+
return pages;
|
|
882
673
|
}
|
|
883
|
-
|
|
884
|
-
|
|
674
|
+
changePage(newPage) {
|
|
675
|
+
if (newPage >= 1 && newPage <= this.totalPages && newPage !== this.currentPage) {
|
|
676
|
+
this.currentPage = newPage;
|
|
677
|
+
this.pageChange.emit(this.currentPage);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTablePaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
681
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTablePaginationComponent, isStandalone: true, selector: "uic-table-pagination", inputs: { currentPage: "currentPage", totalPages: "totalPages", size: "size", loading: "loading" }, outputs: { pageChange: "pageChange", sizeChange: "sizeChange" }, ngImport: i0, template: "\r\n<div class=\"table-page\">\r\n <ui-button [disabled]=\"loading || currentPage == 1\" (click)=\"changePage(currentPage - 1)\" size=\"m\" color=\"black\" type=\"bordered\" text=\"Anterior\" icon=\"ri-arrow-left-line\" > </ui-button> \r\n <div class=\"table-numbers\">\r\n @for (p of pages; track $index) {\r\n @if ( p!= '...' ){\r\n <button [disabled]=\"loading\" (click)=\"changePage(+p)\" [ngClass]=\"{'selected':currentPage==p}\" class=\"number\">{{p}}</button>\r\n } @else {\r\n <div class=\"space\">...</div>\r\n }\r\n \r\n }\r\n </div>\r\n <ui-button [disabled]=\"loading || currentPage == totalPages\" (click)=\"changePage(currentPage + 1)\" size=\"m\" color=\"black\" type=\"bordered\" text=\"Siguiente\" rightIcon=\"ri-arrow-right-line\" > </ui-button>\r\n</div>", styles: [".table-page{display:flex;align-items:center;justify-content:space-between;width:100%;gap:20px;padding:16px 24px}.table-numbers{display:flex;align-items:center;justify-content:center;gap:2px;-webkit-user-select:none;user-select:none;min-width:250px}.number{border:none;color:var(--grey-500);width:40px;height:40px;background-color:var(--white);border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer}.number:hover{background-color:var(--secondary-500)}.selected{background-color:var(--grey-100);font-weight:600;color:var(--secondary-500)}.space{letter-spacing:5px}.page-size{flex:1 1;display:flex;font-size:13px;color:var(--grey-500);align-items:center;justify-content:flex-end}.page-size select{padding:5px 8px;margin-right:10px;color:var(--grey-500);border:solid 1px var(--primary-500);border-radius:5px}\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: "ngmodule", type: FormsModule }] });
|
|
885
682
|
}
|
|
886
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
683
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTablePaginationComponent, decorators: [{
|
|
887
684
|
type: Component,
|
|
888
|
-
args: [{ selector: '
|
|
889
|
-
}], propDecorators: {
|
|
890
|
-
type: Input
|
|
891
|
-
}], iconColor: [{
|
|
685
|
+
args: [{ selector: 'uic-table-pagination', imports: [CommonModule, UicButtonComponent, FormsModule], template: "\r\n<div class=\"table-page\">\r\n <ui-button [disabled]=\"loading || currentPage == 1\" (click)=\"changePage(currentPage - 1)\" size=\"m\" color=\"black\" type=\"bordered\" text=\"Anterior\" icon=\"ri-arrow-left-line\" > </ui-button> \r\n <div class=\"table-numbers\">\r\n @for (p of pages; track $index) {\r\n @if ( p!= '...' ){\r\n <button [disabled]=\"loading\" (click)=\"changePage(+p)\" [ngClass]=\"{'selected':currentPage==p}\" class=\"number\">{{p}}</button>\r\n } @else {\r\n <div class=\"space\">...</div>\r\n }\r\n \r\n }\r\n </div>\r\n <ui-button [disabled]=\"loading || currentPage == totalPages\" (click)=\"changePage(currentPage + 1)\" size=\"m\" color=\"black\" type=\"bordered\" text=\"Siguiente\" rightIcon=\"ri-arrow-right-line\" > </ui-button>\r\n</div>", styles: [".table-page{display:flex;align-items:center;justify-content:space-between;width:100%;gap:20px;padding:16px 24px}.table-numbers{display:flex;align-items:center;justify-content:center;gap:2px;-webkit-user-select:none;user-select:none;min-width:250px}.number{border:none;color:var(--grey-500);width:40px;height:40px;background-color:var(--white);border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer}.number:hover{background-color:var(--secondary-500)}.selected{background-color:var(--grey-100);font-weight:600;color:var(--secondary-500)}.space{letter-spacing:5px}.page-size{flex:1 1;display:flex;font-size:13px;color:var(--grey-500);align-items:center;justify-content:flex-end}.page-size select{padding:5px 8px;margin-right:10px;color:var(--grey-500);border:solid 1px var(--primary-500);border-radius:5px}\n"] }]
|
|
686
|
+
}], propDecorators: { currentPage: [{
|
|
892
687
|
type: Input
|
|
893
|
-
}],
|
|
688
|
+
}], totalPages: [{
|
|
894
689
|
type: Input
|
|
895
690
|
}], size: [{
|
|
896
691
|
type: Input
|
|
897
|
-
}],
|
|
898
|
-
type: Input
|
|
899
|
-
}], error: [{
|
|
900
|
-
type: Input
|
|
901
|
-
}], tip: [{
|
|
902
|
-
type: Input
|
|
903
|
-
}], disabled: [{
|
|
692
|
+
}], loading: [{
|
|
904
693
|
type: Input
|
|
905
|
-
}],
|
|
694
|
+
}], pageChange: [{
|
|
695
|
+
type: Output
|
|
696
|
+
}], sizeChange: [{
|
|
906
697
|
type: Output
|
|
907
698
|
}] } });
|
|
908
699
|
|
|
909
|
-
class
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicDynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
914
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicDynamicFormComponent, isStandalone: true, selector: "app-dynamic-form", inputs: { fields: "fields", form: "form" }, ngImport: i0, template: "<div class=\"form\" [formGroup]=\"form\">\r\n @for (field of fields; track field.name) {\r\n <div class=\"col-span-{{field.colSpan || 1}}\">\r\n \r\n @if ( ['text','number','date'].includes(field.type) ) {\r\n <ui-input \r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\">\r\n <input \r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"field.placeholder??field.label\"\r\n />\r\n </ui-input>\r\n\r\n }\r\n\r\n @if (field.type === 'select') {\r\n <ui-select\r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-select>\r\n }\r\n\r\n @if (field.type === 'checkbox') {\r\n <ui-checkbox\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [placeholder]=\"field.placeholder??''\"\r\n [label]=\"field.label\"\r\n ></ui-checkbox>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:16px;padding-bottom:24px}h2{margin-top:24px}.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}\n"], dependencies: [{ 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.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: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "size", "label", "error", "tip", "disabled", "nullable", "options", "showSubtitle"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "size", "label", "error", "tip", "disabled"], outputs: ["clickButton"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["label", "placeholder", "disabled", "loading"] }, { kind: "ngmodule", type: FormsModule }] });
|
|
700
|
+
class UicTableListComponent {
|
|
701
|
+
list = [];
|
|
702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
703
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTableListComponent, isStandalone: true, selector: "uic-table-list", inputs: { list: "list" }, ngImport: i0, template: "@for (item of list; track $index) {\r\n <div class=\"list-item\">\r\n <i [class]=\"item.icon??'ri-capsule-fill'\"></i>\r\n <div class=\"list-item-data\">\r\n <div>{{item.text}}</div>\r\n <p>{{item.subtext}}</p>\r\n </div> \r\n </div>\r\n\r\n}\r\n", styles: [".list-item{display:flex;margin-bottom:5px;align-items:center}.list-item i{color:var(--grey-500);margin-right:5px}.list-item-data p{color:var(--grey-300);font-size:13px}\n"] });
|
|
915
704
|
}
|
|
916
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableListComponent, decorators: [{
|
|
917
706
|
type: Component,
|
|
918
|
-
args: [{ selector: '
|
|
919
|
-
}], propDecorators: {
|
|
707
|
+
args: [{ selector: 'uic-table-list', imports: [], template: "@for (item of list; track $index) {\r\n <div class=\"list-item\">\r\n <i [class]=\"item.icon??'ri-capsule-fill'\"></i>\r\n <div class=\"list-item-data\">\r\n <div>{{item.text}}</div>\r\n <p>{{item.subtext}}</p>\r\n </div> \r\n </div>\r\n\r\n}\r\n", styles: [".list-item{display:flex;margin-bottom:5px;align-items:center}.list-item i{color:var(--grey-500);margin-right:5px}.list-item-data p{color:var(--grey-300);font-size:13px}\n"] }]
|
|
708
|
+
}], propDecorators: { list: [{
|
|
920
709
|
type: Input
|
|
921
|
-
}], form: [{
|
|
922
|
-
type: Input,
|
|
923
|
-
args: [{ required: true }]
|
|
924
710
|
}] } });
|
|
925
711
|
|
|
926
|
-
class
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
useSteps = false;
|
|
931
|
-
formSubmit = new EventEmitter();
|
|
932
|
-
fb = inject(FormBuilder);
|
|
933
|
-
form = this.fb.group({});
|
|
934
|
-
currentStep = 0;
|
|
935
|
-
ngOnInit() {
|
|
936
|
-
this.buildForm();
|
|
937
|
-
this.useSteps = !!this.schema.steps && this.schema.steps.length > 0;
|
|
938
|
-
}
|
|
939
|
-
// rebuild form controls when schema changes (revisar)
|
|
940
|
-
ngOnChanges(changes) {
|
|
941
|
-
if (changes['schema']) {
|
|
942
|
-
this.buildForm();
|
|
943
|
-
this.useSteps = !!this.schema.steps && this.schema.steps.length > 0;
|
|
944
|
-
if (this.useSteps && this.schema?.steps) {
|
|
945
|
-
this.currentStep = Math.min(this.currentStep, (this.schema.steps.length - 1) || 0);
|
|
946
|
-
}
|
|
712
|
+
class UicNameInitsPipe {
|
|
713
|
+
transform(value) {
|
|
714
|
+
if (!value) {
|
|
715
|
+
return "";
|
|
947
716
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
this.formSubmit.emit({ result: true, form: this.form.value });
|
|
717
|
+
const names = value.split(" ");
|
|
718
|
+
if (names.length > 1) {
|
|
719
|
+
return names[0].charAt(0) + names[1].charAt(0).toUpperCase();
|
|
952
720
|
}
|
|
953
|
-
else {
|
|
954
|
-
|
|
955
|
-
this.formSubmit.emit({ result: false, form: null });
|
|
721
|
+
else if (names[0].length >= 2) {
|
|
722
|
+
return names[0].substring(0, 2).toUpperCase();
|
|
956
723
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
if (!this.schema)
|
|
960
|
-
return [];
|
|
961
|
-
if (this.useSteps && this.schema.steps) {
|
|
962
|
-
return this.schema.steps.flatMap(step => (step.blocks ?? []).flatMap(b => b.fields ?? []));
|
|
724
|
+
else {
|
|
725
|
+
return '';
|
|
963
726
|
}
|
|
964
|
-
// modo sin steps: tomamos blocks del root (si existen)
|
|
965
|
-
return (this.schema.blocks ?? []).flatMap(b => b.fields ?? []);
|
|
966
|
-
}
|
|
967
|
-
buildForm() {
|
|
968
|
-
const fields = this.collectAllFields();
|
|
969
|
-
fields.forEach(f => {
|
|
970
|
-
if (!this.form.contains(f.name)) {
|
|
971
|
-
const validators = this.mapValidatorsFromField(f);
|
|
972
|
-
let initial = this.initialValues[f.name] ?? null;
|
|
973
|
-
if (f.type == 'checkbox' && initial == null)
|
|
974
|
-
initial = false;
|
|
975
|
-
this.form.addControl(f.name, this.fb.control(initial, validators));
|
|
976
|
-
}
|
|
977
|
-
});
|
|
978
|
-
const namesToKeep = new Set(fields.map(f => f.name));
|
|
979
|
-
Object.keys(this.form.controls).forEach(name => {
|
|
980
|
-
if (!namesToKeep.has(name)) {
|
|
981
|
-
this.form.removeControl(name);
|
|
982
|
-
}
|
|
983
|
-
});
|
|
984
727
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
728
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicNameInitsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
729
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: UicNameInitsPipe, isStandalone: true, name: "nameInitials" });
|
|
730
|
+
}
|
|
731
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicNameInitsPipe, decorators: [{
|
|
732
|
+
type: Pipe,
|
|
733
|
+
args: [{
|
|
734
|
+
name: 'nameInitials'
|
|
735
|
+
}]
|
|
736
|
+
}] });
|
|
737
|
+
|
|
738
|
+
class UicTableUserComponent {
|
|
739
|
+
user;
|
|
740
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
741
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicTableUserComponent, isStandalone: true, selector: "uic-table-user", inputs: { user: "user" }, ngImport: i0, template: "@if (user) {\r\n <div class=\"user-row\">\r\n <div class=\"user-inits\">\r\n {{user.name | nameInitials}}\r\n </div>\r\n <div class=\"user-row-data\">\r\n <div>{{user.name}}</div>\r\n <p>{{user.id}}</p>\r\n </div>\r\n </div>\r\n}@else{\r\n -\r\n}", styles: [".user-inits{width:32px;height:32px;border-radius:50px;border:solid 1px var(--secondary-600);background-color:var(--secondary-300);color:var(--secondary-600);display:flex;justify-content:center;align-items:center;margin-right:12px}.user-row{display:flex;align-items:center;width:fit-content}.user-row-data{flex:1 1;font-weight:600;color:var(--grey-900);font-size:14px}.user-row-data p{color:var(--grey-500);font-weight:400;font-size:12px;line-height:16px}\n"], dependencies: [{ kind: "pipe", type: UicNameInitsPipe, name: "nameInitials" }] });
|
|
742
|
+
}
|
|
743
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableUserComponent, decorators: [{
|
|
744
|
+
type: Component,
|
|
745
|
+
args: [{ selector: 'uic-table-user', imports: [UicNameInitsPipe], template: "@if (user) {\r\n <div class=\"user-row\">\r\n <div class=\"user-inits\">\r\n {{user.name | nameInitials}}\r\n </div>\r\n <div class=\"user-row-data\">\r\n <div>{{user.name}}</div>\r\n <p>{{user.id}}</p>\r\n </div>\r\n </div>\r\n}@else{\r\n -\r\n}", styles: [".user-inits{width:32px;height:32px;border-radius:50px;border:solid 1px var(--secondary-600);background-color:var(--secondary-300);color:var(--secondary-600);display:flex;justify-content:center;align-items:center;margin-right:12px}.user-row{display:flex;align-items:center;width:fit-content}.user-row-data{flex:1 1;font-weight:600;color:var(--grey-900);font-size:14px}.user-row-data p{color:var(--grey-500);font-weight:400;font-size:12px;line-height:16px}\n"] }]
|
|
746
|
+
}], propDecorators: { user: [{
|
|
747
|
+
type: Input
|
|
748
|
+
}] } });
|
|
749
|
+
|
|
750
|
+
class UicTooltipComponent {
|
|
751
|
+
tooltip = '';
|
|
752
|
+
left = 0;
|
|
753
|
+
top = 0;
|
|
754
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
755
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UicTooltipComponent, isStandalone: true, selector: "ui-tooltip", ngImport: i0, template: "<div @fadeAndRise class=\"tooltip\" \r\n [style.left]=\"left + 'px'\" [style.top]=\"top + 'px'\" [innerHTML]=\"tooltip\">\r\n</div>", styles: [".tooltip{position:fixed;background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;max-width:400px;color:var(--grey-950);-webkit-user-select:none;user-select:none;padding:5px 10px;border-radius:4px;font-size:14px;margin-top:5px;transform:translate(-50%);z-index:1000}.tooltip:before{content:\"\";width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid var(--white);position:absolute;left:calc(50% - 8px);top:-8px}\n"], animations: [fadeAndRise] });
|
|
756
|
+
}
|
|
757
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTooltipComponent, decorators: [{
|
|
758
|
+
type: Component,
|
|
759
|
+
args: [{ selector: 'ui-tooltip', imports: [], animations: [fadeAndRise], template: "<div @fadeAndRise class=\"tooltip\" \r\n [style.left]=\"left + 'px'\" [style.top]=\"top + 'px'\" [innerHTML]=\"tooltip\">\r\n</div>", styles: [".tooltip{position:fixed;background-color:var(--white);box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;max-width:400px;color:var(--grey-950);-webkit-user-select:none;user-select:none;padding:5px 10px;border-radius:4px;font-size:14px;margin-top:5px;transform:translate(-50%);z-index:1000}.tooltip:before{content:\"\";width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid var(--white);position:absolute;left:calc(50% - 8px);top:-8px}\n"] }]
|
|
760
|
+
}] });
|
|
761
|
+
|
|
762
|
+
class UicToolTipDirective {
|
|
763
|
+
elementRef;
|
|
764
|
+
appRef;
|
|
765
|
+
injector;
|
|
766
|
+
tip = '';
|
|
767
|
+
componentRef = null;
|
|
768
|
+
constructor(elementRef, appRef, injector) {
|
|
769
|
+
this.elementRef = elementRef;
|
|
770
|
+
this.appRef = appRef;
|
|
771
|
+
this.injector = injector;
|
|
996
772
|
}
|
|
997
|
-
|
|
998
|
-
if (
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
773
|
+
onMouseEnter() {
|
|
774
|
+
if (this.componentRef === null && this.tip != '' && this.tip != null) {
|
|
775
|
+
this.componentRef = createComponent(UicTooltipComponent, {
|
|
776
|
+
environmentInjector: this.injector
|
|
777
|
+
});
|
|
778
|
+
this.appRef.attachView(this.componentRef.hostView);
|
|
779
|
+
const domElem = this.componentRef.hostView
|
|
780
|
+
.rootNodes[0];
|
|
781
|
+
document.body.appendChild(domElem);
|
|
782
|
+
this.setTooltipComponentProperties();
|
|
1003
783
|
}
|
|
1004
|
-
return this.schema.blocks ?? [];
|
|
1005
784
|
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
this.
|
|
785
|
+
setTooltipComponentProperties() {
|
|
786
|
+
if (this.componentRef !== null) {
|
|
787
|
+
this.componentRef.instance.tooltip = this.tip;
|
|
788
|
+
const { left, right, bottom } = this.elementRef.nativeElement.getBoundingClientRect();
|
|
789
|
+
this.componentRef.instance.left = (right - left) / 2 + left;
|
|
790
|
+
this.componentRef.instance.top = bottom;
|
|
1010
791
|
}
|
|
1011
792
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
793
|
+
onMouseLeave() {
|
|
794
|
+
this.destroy();
|
|
795
|
+
}
|
|
796
|
+
ngOnDestroy() {
|
|
797
|
+
this.destroy();
|
|
798
|
+
}
|
|
799
|
+
destroy() {
|
|
800
|
+
if (this.componentRef !== null) {
|
|
801
|
+
this.appRef.detachView(this.componentRef.hostView);
|
|
802
|
+
this.componentRef.destroy();
|
|
803
|
+
this.componentRef = null;
|
|
1015
804
|
}
|
|
1016
805
|
}
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
}
|
|
1020
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1021
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFormWrapperComponent, isStandalone: true, selector: "ui-form-wrapper", inputs: { schema: "schema", loading: "loading", initialValues: "initialValues" }, outputs: { formSubmit: "formSubmit" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n\r\n @if (useSteps) {\r\n @if (schema.steps?.length) {\r\n\r\n <div class=\"step-title\">{{ getStepTitle()}}</div>\r\n\r\n <!-- cuerpo: loader o bloques del step -->\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"(schema.steps?.[currentStep]?.blocks?.[0]?.fields?.length) ?? 0\"\r\n ></ui-skeleton-loader>\r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\r\n <section class=\"form-block\">\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n <!-- pasamos solo fields y el formGroup -->\r\n <app-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </app-dynamic-form>\r\n </section>\r\n }\r\n }\r\n\r\n <!-- controles de navegaci\u00F3n -->\r\n <div class=\"step-controls\">\r\n <button type=\"button\" (click)=\"prevStep()\" [disabled]=\"currentStep === 0\">Anterior</button>\r\n\r\n @if ((schema.steps?.length ?? 0) > 0 && currentStep < ((schema.steps?.length ?? 1) - 1)) {\r\n <button type=\"button\" (click)=\"nextStep()\">Siguiente</button>\r\n } @else {\r\n <button type=\"submit\">Guardar</button>\r\n }\r\n </div>\r\n } \r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\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 (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <app-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </app-dynamic-form>\r\n }\r\n </section>\r\n }\r\n }\r\n</form>\r\n", styles: [":host{display:block;padding:4px 0}.block-title{font-weight:600;margin:24px 0;font-size:24px;line-height:28px;color:#0a0d12}\n"], dependencies: [{ kind: "component", type: UicDynamicFormComponent, selector: "app-dynamic-form", inputs: ["fields", "form"] }, { kind: "component", type: UicSkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }, { 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"] }] });
|
|
806
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicToolTipDirective, deps: [{ token: i0.ElementRef }, { token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
807
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: UicToolTipDirective, isStandalone: true, selector: "[tip]", inputs: { tip: "tip" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 });
|
|
1022
808
|
}
|
|
1023
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1024
|
-
type:
|
|
1025
|
-
args: [{
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
type: Input
|
|
1030
|
-
}], initialValues: [{
|
|
809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicToolTipDirective, decorators: [{
|
|
810
|
+
type: Directive,
|
|
811
|
+
args: [{
|
|
812
|
+
selector: '[tip]'
|
|
813
|
+
}]
|
|
814
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }], propDecorators: { tip: [{
|
|
1031
815
|
type: Input
|
|
1032
|
-
}],
|
|
1033
|
-
type:
|
|
816
|
+
}], onMouseEnter: [{
|
|
817
|
+
type: HostListener,
|
|
818
|
+
args: ['mouseenter']
|
|
819
|
+
}], onMouseLeave: [{
|
|
820
|
+
type: HostListener,
|
|
821
|
+
args: ['mouseleave']
|
|
1034
822
|
}] } });
|
|
1035
823
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
824
|
+
const highlightRow = trigger('highlightRow', [
|
|
825
|
+
state('highlighted', style({ backgroundColor: '#efe1f5' })),
|
|
826
|
+
transition('* => highlighted', [
|
|
827
|
+
animate('1000ms ease-in', keyframes([
|
|
828
|
+
style({ backgroundColor: '#ffffff', offset: 0 }),
|
|
829
|
+
style({ backgroundColor: '#efe1f5', offset: 0.3 }),
|
|
830
|
+
style({ backgroundColor: '#ffffff', offset: 1.0 }),
|
|
831
|
+
]))
|
|
832
|
+
])
|
|
833
|
+
]);
|
|
834
|
+
|
|
835
|
+
const animatedRow = trigger('animatedRow', [
|
|
836
|
+
transition(':enter', [
|
|
837
|
+
style({ opacity: 0, transform: 'translateY(-15px)' }),
|
|
838
|
+
animate('300ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
|
|
839
|
+
]),
|
|
840
|
+
transition(':leave', [
|
|
841
|
+
animate('300ms ease-in', style({ opacity: 0, height: 0, padding: 0, margin: 0 }))
|
|
842
|
+
]),
|
|
843
|
+
]);
|
|
844
|
+
|
|
845
|
+
class UicTableComponent {
|
|
846
|
+
columns = [];
|
|
847
|
+
data = [];
|
|
848
|
+
loading = false;
|
|
849
|
+
pages = 0;
|
|
850
|
+
size = 25;
|
|
851
|
+
highlightedId = 0;
|
|
852
|
+
headerText = '';
|
|
853
|
+
totalItems = 0;
|
|
854
|
+
searchEnabled = true;
|
|
855
|
+
searchLabel = 'Buscar';
|
|
856
|
+
searchPlaceholder = 'Buscar';
|
|
857
|
+
striped = false;
|
|
858
|
+
showPagination = true;
|
|
859
|
+
showEmptyMessage = false;
|
|
860
|
+
emptyMessage = 'No hay elementos';
|
|
861
|
+
action = new EventEmitter();
|
|
862
|
+
update = new EventEmitter();
|
|
863
|
+
checkedChange = new EventEmitter();
|
|
864
|
+
checkedIds = new Set();
|
|
865
|
+
sortKey = '';
|
|
866
|
+
sortAsc = true;
|
|
867
|
+
filter = '';
|
|
868
|
+
page = 1;
|
|
869
|
+
getValue(data, key) {
|
|
870
|
+
const col = data.find(col => col.key == key);
|
|
871
|
+
return col?.value ?? '-';
|
|
1078
872
|
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
this.openOverlay();
|
|
1083
|
-
if (this.open) {
|
|
1084
|
-
setTimeout(() => {
|
|
1085
|
-
this.unlistener = this.renderer.listen('window', 'click', (e) => {
|
|
1086
|
-
if (!this.toggleButton.nativeElement.contains(e.target)) {
|
|
1087
|
-
this.clearSearch();
|
|
1088
|
-
this.unlistener();
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
}, 200);
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
873
|
+
getFontColor(data, key) {
|
|
874
|
+
const col = data.find(col => col.key == key);
|
|
875
|
+
return 'trc-' + (col?.textColor ?? 'black');
|
|
1094
876
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
this.searchSubject.next(value);
|
|
1099
|
-
}
|
|
877
|
+
getBackgroundColor(data, key) {
|
|
878
|
+
const col = data.find(col => col.key == key);
|
|
879
|
+
return col?.color ?? 'transparent';
|
|
1100
880
|
}
|
|
1101
|
-
|
|
1102
|
-
|
|
881
|
+
isValidRule(data, key) {
|
|
882
|
+
if (!key)
|
|
883
|
+
return true;
|
|
884
|
+
let valid = true;
|
|
885
|
+
key.forEach(k => {
|
|
886
|
+
const col = data.find(col => col.key == k);
|
|
887
|
+
valid = valid && !!(col?.value);
|
|
888
|
+
});
|
|
889
|
+
return valid;
|
|
1103
890
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
this.selectedItemChange.emit(item);
|
|
1108
|
-
if (this.showSelected)
|
|
1109
|
-
this.selectedItem = item;
|
|
1110
|
-
}
|
|
891
|
+
getIcon(data, key) {
|
|
892
|
+
const col = data.find(col => col.key == key);
|
|
893
|
+
return '<i class="' + col?.icon + '"></i>';
|
|
1111
894
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
this.closeOverlay();
|
|
1116
|
-
this.searchSubject.next('');
|
|
895
|
+
getList(data, key) {
|
|
896
|
+
const col = data.find(col => col.key == key);
|
|
897
|
+
return col?.list ?? [];
|
|
1117
898
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
899
|
+
getUser(data, key) {
|
|
900
|
+
const col = data.find(col => col.key == key);
|
|
901
|
+
return col?.user;
|
|
1121
902
|
}
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
903
|
+
sortClick(key) {
|
|
904
|
+
if (this.sortKey != key) {
|
|
905
|
+
this.sortKey = key;
|
|
906
|
+
this.sortAsc = true;
|
|
907
|
+
}
|
|
908
|
+
else if (this.sortAsc) {
|
|
909
|
+
this.sortAsc = false;
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
this.sortKey = '';
|
|
913
|
+
this.sortAsc = true;
|
|
1128
914
|
}
|
|
915
|
+
this.updateData();
|
|
1129
916
|
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
])
|
|
1150
|
-
.withFlexibleDimensions(false)
|
|
1151
|
-
.withPush(false);
|
|
1152
|
-
this.overlayRef = this.overlay.create({
|
|
1153
|
-
positionStrategy,
|
|
1154
|
-
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
1155
|
-
hasBackdrop: true,
|
|
1156
|
-
backdropClass: 'transparent-backdrop'
|
|
917
|
+
sizeChabge(newSize) {
|
|
918
|
+
this.size = newSize;
|
|
919
|
+
this.updateData();
|
|
920
|
+
}
|
|
921
|
+
pageChage(newPage) {
|
|
922
|
+
this.page = newPage;
|
|
923
|
+
this.updateData();
|
|
924
|
+
}
|
|
925
|
+
search(text) {
|
|
926
|
+
this.filter = text;
|
|
927
|
+
this.updateData();
|
|
928
|
+
}
|
|
929
|
+
updateData() {
|
|
930
|
+
this.update.emit({
|
|
931
|
+
sortBy: this.sortKey,
|
|
932
|
+
isSortAscending: this.sortAsc,
|
|
933
|
+
pageNumber: this.page,
|
|
934
|
+
pageSize: this.size,
|
|
935
|
+
filter: this.filter
|
|
1157
936
|
});
|
|
1158
|
-
const templatePortal = new TemplatePortal(this.dropdownTemplateRef, this.vcr);
|
|
1159
|
-
this.overlayRef.attach(templatePortal);
|
|
1160
|
-
this.overlayRef.backdropClick().subscribe(() => this.closeOverlay());
|
|
1161
|
-
this.overlayRef.overlayElement.style.width = `${width}px`;
|
|
1162
937
|
}
|
|
1163
|
-
|
|
1164
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicSearcherComponent, isStandalone: true, selector: "ui-searcher", inputs: { icon: "icon", iconColor: "iconColor", internalIcon: "internalIcon", size: "size", label: "label", error: "error", tip: "tip", disabled: "disabled", showSelected: "showSelected", placeholder: "placeholder", searchFn: "searchFn", itemDisplayFn: "itemDisplayFn", itemIsEnabledFn: "itemIsEnabledFn", manualSearch: "manualSearch", selectedItem: "selectedItem" }, outputs: { selectedItemChange: "selectedItemChange" }, viewQueries: [{ propertyName: "toggleButton", first: true, predicate: ["inputwrapp"], descendants: true }, { propertyName: "dropdownTemplateRef", first: true, predicate: ["dropdownTemplate"], descendants: true }], ngImport: i0, template: "\r\n<div class=\"input-wrapper\">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\"> \r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n \r\n <div class=\"fakeinput-wrapp\" #inputwrapp >\r\n <!-- INPUT -->\r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (selectedItem == null) { \r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <input\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\"\r\n />\r\n </div> \r\n @if (manualSearch) {\r\n <ui-button (click)=\"triggerSearch()\" size=\"t\" ></ui-button>\r\n }\r\n <ui-button size=\"t\" icon=\"ri-close-large-line\" (click)=\"clearSearch()\"></ui-button>\r\n }@else {\r\n <div class=\"input-container pad-{{size}}\" >\r\n <div class=\"selected-item\" >\r\n <div class=\"selected-item-text\" [innerHTML]=\"itemDisplayFn(selectedItem)\"></div> \r\n <ui-button (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 @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n\r\n<ng-template #dropdownTemplate>\r\n @if (results$ | async; as items){\r\n <div class=\"results\">\r\n @if (isLoading) {\r\n <div class=\"loader\"></div>\r\n }\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(item)\" (click)=\"selectItem(item)\" [innerHTML]=\"itemDisplayFn(item)\">\r\n </div>\r\n }@empty {\r\n <div class=\"t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n\r\n", styles: [".loader{height:4px;width:100%;--c:no-repeat linear-gradient(#6100ee 0 0);background:var(--c),var(--c),#d7b8fc;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}}.wrapp-fakeinput{position:relative}.selected-item{border-radius:5px;background-color:#592371;padding-left:10px;height:25px;display:flex;align-items:center;justify-content:space-between}.selected-item-text{overflow:hidden;white-space:nowrap}.results{background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;border:solid 1px #e9eaeb;border-radius:5px;font-size:13px;z-index:150;overflow:hidden}\n", ":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;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:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\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"] }] });
|
|
938
|
+
toggleSelection(id, checked) {
|
|
939
|
+
if (checked) {
|
|
940
|
+
this.checkedIds.add(id);
|
|
941
|
+
}
|
|
942
|
+
else {
|
|
943
|
+
this.checkedIds.delete(id);
|
|
944
|
+
}
|
|
945
|
+
this.areAllSelected();
|
|
946
|
+
this.checkedChange.emit(Array.from(this.checkedIds));
|
|
947
|
+
}
|
|
948
|
+
toggleAll(checked) {
|
|
949
|
+
if (checked) {
|
|
950
|
+
this.data.forEach(item => this.checkedIds.add(item.id));
|
|
951
|
+
}
|
|
952
|
+
else {
|
|
953
|
+
this.checkedIds.clear();
|
|
954
|
+
}
|
|
955
|
+
this.checkedChange.emit(Array.from(this.checkedIds));
|
|
956
|
+
}
|
|
957
|
+
areAllSelected() {
|
|
958
|
+
this.allSelected = this.checkedIds.size === this.data.length;
|
|
959
|
+
}
|
|
960
|
+
allSelected = false;
|
|
961
|
+
ngOnChanges() {
|
|
962
|
+
this.areAllSelected();
|
|
963
|
+
}
|
|
964
|
+
doAction(rowId, key) {
|
|
965
|
+
this.action.emit({ rowId, key });
|
|
966
|
+
}
|
|
967
|
+
resetCheckedIds() {
|
|
968
|
+
this.checkedIds.clear();
|
|
969
|
+
this.checkedChange.emit([]);
|
|
970
|
+
}
|
|
971
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
972
|
+
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", pages: "pages", size: "size", highlightedId: "highlightedId", headerText: "headerText", totalItems: "totalItems", searchEnabled: "searchEnabled", searchLabel: "searchLabel", searchPlaceholder: "searchPlaceholder", striped: "striped", showPagination: "showPagination", showEmptyMessage: "showEmptyMessage", emptyMessage: "emptyMessage" }, outputs: { action: "action", update: "update", checkedChange: "checkedChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"table-filters\">\r\n @if (searchEnabled) {\r\n <uic-table-searcher (filter)=\"search($event)\" [placeholder]=\"searchPlaceholder\" ></uic-table-searcher>\r\n }\r\n <div class=\"filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n<div class=\"table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"table-topbar\"> {{headerText}} <span class=\"hightlited-note\"> {{totalItems}} </span> </div>\r\n }\r\n <div class=\"table-container\"> \r\n <table [class.striped]=\"striped\">\r\n <thead>\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <th>\r\n <div class=\"th-wrap\">{{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div (click)=\"sortClick(header.key)\" [ngClass]=\"{'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 @if (header.type=='checkbox') {\r\n <ui-checkbox [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\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(5); track $index) {\r\n <tr class=\"\">\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"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\" [class.tr-highlighted]=\"row.highlighted\">\r\n @for (header of columns; track $index) {\r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\">\r\n @if (header.type == 'text') {\r\n {{ getValue(row.data,header.key) }} \r\n }\r\n @if (header.type == 'icon-list') {\r\n <div class=\"table-icon-wrap\">\r\n @for (alert of getList(row.data,header.key); track $index) {\r\n <i [tip]=\"alert.text\" [class]=\"alert.icon + ' alert'\" ></i>\r\n }\r\n </div>\r\n }\r\n @else if (header.type == 'list'){\r\n <uic-table-list [list]=\"getList(row.data,header.key)\"></uic-table-list> \r\n }\r\n @else if (header.type == 'user'){\r\n <uic-table-user [user]=\"getUser(row.data,header.key)\"></uic-table-user> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [ngModel]=\"checkedIds.has(row.id)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (header.type == 'actions') { \r\n <div class=\"table-actions\">\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 [iconOnly]=\"btn.text==null\"\r\n [text]=\"btn.text??''\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color\"\r\n (click)=\"doAction(row.id,btn.key)\">\r\n </ui-button> \r\n }\r\n } \r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }@empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"empty\">{{emptyMessage}} </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 [size]=\"size\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </uic-table-pagination>\r\n }\r\n</div>", styles: [".table-wrapper{overflow:hidden;border:solid 1px var(--grey-200);border-radius:12px}table{width:100%;font-weight:400;color:var(--grey-600)}table th{font-size:12px;height:44px;font-weight:500;background-color:var(--grey-50);border-left:solid 6px var(--grey-50)}table th .th-wrap{white-space:nowrap;display:flex;align-items:center}table th .th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;margin-left:10px;cursor:pointer;transition:ease .3s;color:var(--grey-400)}table th .th-wrap div:hover{color:var(--primary-500)}table td{font-size:14px;height:64px}table td,table th{padding:4px 24px;vertical-align:middle;border-bottom:solid 1px var(--grey-200)}table tr{transition:ease .3s}table tr:hover{background-color:var(--grey-50)}.table-container{width:100%;overflow-x:auto}.table-topbar{padding:20px 24px;font-weight:600;font-size:18px;line-height:28px;gap:16px;display:flex;align-items:center;color:var(--grey-900);border-bottom:solid 1px var(--grey-200)}.table-actions{display:flex;gap:2px}.table-icon-wrap{display:flex;justify-content:center;gap:8px;font-size:18px;margin-right:5px}.loader-tr{border-bottom:none!important}.loader-tr td{padding:0}.sort-active{color:var(--secondary-500)!important;border:solid 1px}.empty{text-align:center;color:var(--grey-300)}.table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}.filter-actions{display:flex;gap:8px}.alert{width:24px;height:24px;font-size:18px;background-color:var(--red-500);color:var(--white);border-radius:50%;padding:3px}.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}}.striped tbody tr:nth-child(odd){background-color:var(--grey-50);transition:ease .3s}.striped tbody tr:nth-child(odd):hover{background-color:var(--primary-500)}.tr-highlighted{border-left:solid 6px var(--green-500)}.trc-primary{color:var(--primary-500)}.trc-red{color:var(--red-500)}.trc-blue{color:var(--blue-500)}.trc-green{color:var(--green-500)}.trc-yellow{color:var(--yellow-500)}.trc-black{color:var(--grey-900)}.trc-grey{color:var(--grey-300)}.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}}\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: UicTableUserComponent, selector: "uic-table-user", inputs: ["user"] }, { kind: "component", type: UicTableListComponent, selector: "uic-table-list", inputs: ["list"] }, { kind: "component", type: UicTableUicSearcherComponent, selector: "uic-table-searcher", inputs: ["placeholder", "label", "searchOnKeydown"], outputs: ["filter"] }, { kind: "component", type: UicTablePaginationComponent, selector: "uic-table-pagination", inputs: ["currentPage", "totalPages", "size", "loading"], outputs: ["pageChange", "sizeChange"] }, { kind: "directive", type: UicToolTipDirective, selector: "[tip]", inputs: ["tip"] }, { kind: "component", type: UicCheckboxComponent, selector: "ui-checkbox", inputs: ["label", "placeholder", "disabled", "loading"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], animations: [highlightRow, animatedRow] });
|
|
1165
973
|
}
|
|
1166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
974
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicTableComponent, decorators: [{
|
|
1167
975
|
type: Component,
|
|
1168
|
-
args: [{ selector: 'ui-
|
|
1169
|
-
}]
|
|
976
|
+
args: [{ selector: 'ui-table', imports: [CommonModule, UicButtonComponent, UicTableUserComponent, UicTableListComponent, UicTableUicSearcherComponent,
|
|
977
|
+
UicTablePaginationComponent, UicToolTipDirective, UicCheckboxComponent, FormsModule], animations: [highlightRow, animatedRow], template: "<div class=\"table-filters\">\r\n @if (searchEnabled) {\r\n <uic-table-searcher (filter)=\"search($event)\" [placeholder]=\"searchPlaceholder\" ></uic-table-searcher>\r\n }\r\n <div class=\"filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n<div class=\"table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"table-topbar\"> {{headerText}} <span class=\"hightlited-note\"> {{totalItems}} </span> </div>\r\n }\r\n <div class=\"table-container\"> \r\n <table [class.striped]=\"striped\">\r\n <thead>\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <th>\r\n <div class=\"th-wrap\">{{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div (click)=\"sortClick(header.key)\" [ngClass]=\"{'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 @if (header.type=='checkbox') {\r\n <ui-checkbox [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\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(5); track $index) {\r\n <tr class=\"\">\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"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\" [class.tr-highlighted]=\"row.highlighted\">\r\n @for (header of columns; track $index) {\r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\">\r\n @if (header.type == 'text') {\r\n {{ getValue(row.data,header.key) }} \r\n }\r\n @if (header.type == 'icon-list') {\r\n <div class=\"table-icon-wrap\">\r\n @for (alert of getList(row.data,header.key); track $index) {\r\n <i [tip]=\"alert.text\" [class]=\"alert.icon + ' alert'\" ></i>\r\n }\r\n </div>\r\n }\r\n @else if (header.type == 'list'){\r\n <uic-table-list [list]=\"getList(row.data,header.key)\"></uic-table-list> \r\n }\r\n @else if (header.type == 'user'){\r\n <uic-table-user [user]=\"getUser(row.data,header.key)\"></uic-table-user> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [ngModel]=\"checkedIds.has(row.id)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (header.type == 'actions') { \r\n <div class=\"table-actions\">\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 [iconOnly]=\"btn.text==null\"\r\n [text]=\"btn.text??''\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color\"\r\n (click)=\"doAction(row.id,btn.key)\">\r\n </ui-button> \r\n }\r\n } \r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }@empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"empty\">{{emptyMessage}} </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 [size]=\"size\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </uic-table-pagination>\r\n }\r\n</div>", styles: [".table-wrapper{overflow:hidden;border:solid 1px var(--grey-200);border-radius:12px}table{width:100%;font-weight:400;color:var(--grey-600)}table th{font-size:12px;height:44px;font-weight:500;background-color:var(--grey-50);border-left:solid 6px var(--grey-50)}table th .th-wrap{white-space:nowrap;display:flex;align-items:center}table th .th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;margin-left:10px;cursor:pointer;transition:ease .3s;color:var(--grey-400)}table th .th-wrap div:hover{color:var(--primary-500)}table td{font-size:14px;height:64px}table td,table th{padding:4px 24px;vertical-align:middle;border-bottom:solid 1px var(--grey-200)}table tr{transition:ease .3s}table tr:hover{background-color:var(--grey-50)}.table-container{width:100%;overflow-x:auto}.table-topbar{padding:20px 24px;font-weight:600;font-size:18px;line-height:28px;gap:16px;display:flex;align-items:center;color:var(--grey-900);border-bottom:solid 1px var(--grey-200)}.table-actions{display:flex;gap:2px}.table-icon-wrap{display:flex;justify-content:center;gap:8px;font-size:18px;margin-right:5px}.loader-tr{border-bottom:none!important}.loader-tr td{padding:0}.sort-active{color:var(--secondary-500)!important;border:solid 1px}.empty{text-align:center;color:var(--grey-300)}.table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}.filter-actions{display:flex;gap:8px}.alert{width:24px;height:24px;font-size:18px;background-color:var(--red-500);color:var(--white);border-radius:50%;padding:3px}.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}}.striped tbody tr:nth-child(odd){background-color:var(--grey-50);transition:ease .3s}.striped tbody tr:nth-child(odd):hover{background-color:var(--primary-500)}.tr-highlighted{border-left:solid 6px var(--green-500)}.trc-primary{color:var(--primary-500)}.trc-red{color:var(--red-500)}.trc-blue{color:var(--blue-500)}.trc-green{color:var(--green-500)}.trc-yellow{color:var(--yellow-500)}.trc-black{color:var(--grey-900)}.trc-grey{color:var(--grey-300)}.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}}\n"] }]
|
|
978
|
+
}], propDecorators: { columns: [{
|
|
1170
979
|
type: Input
|
|
1171
|
-
}],
|
|
980
|
+
}], data: [{
|
|
1172
981
|
type: Input
|
|
1173
|
-
}],
|
|
982
|
+
}], loading: [{
|
|
983
|
+
type: Input
|
|
984
|
+
}], pages: [{
|
|
1174
985
|
type: Input
|
|
1175
986
|
}], size: [{
|
|
1176
987
|
type: Input
|
|
1177
|
-
}],
|
|
988
|
+
}], highlightedId: [{
|
|
1178
989
|
type: Input
|
|
1179
|
-
}],
|
|
990
|
+
}], headerText: [{
|
|
1180
991
|
type: Input
|
|
1181
|
-
}],
|
|
992
|
+
}], totalItems: [{
|
|
1182
993
|
type: Input
|
|
1183
|
-
}],
|
|
994
|
+
}], searchEnabled: [{
|
|
1184
995
|
type: Input
|
|
1185
|
-
}],
|
|
996
|
+
}], searchLabel: [{
|
|
1186
997
|
type: Input
|
|
1187
|
-
}],
|
|
998
|
+
}], searchPlaceholder: [{
|
|
1188
999
|
type: Input
|
|
1189
|
-
}],
|
|
1000
|
+
}], striped: [{
|
|
1190
1001
|
type: Input
|
|
1191
|
-
}],
|
|
1002
|
+
}], showPagination: [{
|
|
1192
1003
|
type: Input
|
|
1193
|
-
}],
|
|
1004
|
+
}], showEmptyMessage: [{
|
|
1194
1005
|
type: Input
|
|
1195
|
-
}],
|
|
1006
|
+
}], emptyMessage: [{
|
|
1196
1007
|
type: Input
|
|
1197
|
-
}],
|
|
1008
|
+
}], action: [{
|
|
1009
|
+
type: Output
|
|
1010
|
+
}], update: [{
|
|
1011
|
+
type: Output
|
|
1012
|
+
}], checkedChange: [{
|
|
1013
|
+
type: Output
|
|
1014
|
+
}] } });
|
|
1015
|
+
|
|
1016
|
+
class UicSwichComponent {
|
|
1017
|
+
checked = false;
|
|
1018
|
+
checkedChange = new EventEmitter();
|
|
1019
|
+
disabled = false;
|
|
1020
|
+
placeholder = '';
|
|
1021
|
+
toggle() {
|
|
1022
|
+
if (this.disabled)
|
|
1023
|
+
return;
|
|
1024
|
+
this.checked = !this.checked;
|
|
1025
|
+
this.checkedChange.emit(this.checked);
|
|
1026
|
+
}
|
|
1027
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSwichComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1028
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UicSwichComponent, isStandalone: true, selector: "ui-switch", inputs: { checked: "checked", disabled: "disabled", placeholder: "placeholder" }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<div class=\"toggle-wrapper\" [class.disabled]=\"disabled\">\r\n <button\r\n type=\"button\"\r\n class=\"toggle\"\r\n [class.checked]=\"checked\"\r\n [disabled]=\"disabled\"\r\n (click)=\"toggle()\"\r\n >\r\n <span class=\"thumb\"></span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".toggle-wrapper{padding:2px;display:flex;align-items:center;font-size:16px}.toggle-wrapper button{margin-right:8px}.disabled{color:var(--grey-300)}.toggle{position:relative;width:44px;height:22px;border:none;border-radius:22px;background:var(--grey-200);cursor:pointer;padding:2px;display:flex;align-items:center;transition:background .2s ease}.toggle:disabled{background:var(--grey-300);cursor:not-allowed}.toggle:disabled .thumb{opacity:.7}.toggle:hover:not(:disabled){background:var(--secondary-400)}.toggle:focus,.toggle:focus-visible{box-shadow:0 0 0 3px rgba(var(--secondary-400),.4)}.toggle.checked{background:var(--secondary-500)}.toggle.checked:hover:not(:disabled){background:var(--secondary-400)}.toggle.checked .thumb{transform:translate(22px)}.toggle .thumb{width:18px;height:18px;background:var(--white);border-radius:50%;transition:transform .2s ease;transform:translate(0)}\n"] });
|
|
1029
|
+
}
|
|
1030
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSwichComponent, decorators: [{
|
|
1031
|
+
type: Component,
|
|
1032
|
+
args: [{ selector: 'ui-switch', imports: [], template: "<div class=\"toggle-wrapper\" [class.disabled]=\"disabled\">\r\n <button\r\n type=\"button\"\r\n class=\"toggle\"\r\n [class.checked]=\"checked\"\r\n [disabled]=\"disabled\"\r\n (click)=\"toggle()\"\r\n >\r\n <span class=\"thumb\"></span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".toggle-wrapper{padding:2px;display:flex;align-items:center;font-size:16px}.toggle-wrapper button{margin-right:8px}.disabled{color:var(--grey-300)}.toggle{position:relative;width:44px;height:22px;border:none;border-radius:22px;background:var(--grey-200);cursor:pointer;padding:2px;display:flex;align-items:center;transition:background .2s ease}.toggle:disabled{background:var(--grey-300);cursor:not-allowed}.toggle:disabled .thumb{opacity:.7}.toggle:hover:not(:disabled){background:var(--secondary-400)}.toggle:focus,.toggle:focus-visible{box-shadow:0 0 0 3px rgba(var(--secondary-400),.4)}.toggle.checked{background:var(--secondary-500)}.toggle.checked:hover:not(:disabled){background:var(--secondary-400)}.toggle.checked .thumb{transform:translate(22px)}.toggle .thumb{width:18px;height:18px;background:var(--white);border-radius:50%;transition:transform .2s ease;transform:translate(0)}\n"] }]
|
|
1033
|
+
}], propDecorators: { checked: [{
|
|
1198
1034
|
type: Input
|
|
1199
|
-
}],
|
|
1035
|
+
}], checkedChange: [{
|
|
1200
1036
|
type: Output
|
|
1201
|
-
}],
|
|
1202
|
-
type:
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
type: ViewChild,
|
|
1206
|
-
args: ['dropdownTemplate']
|
|
1037
|
+
}], disabled: [{
|
|
1038
|
+
type: Input
|
|
1039
|
+
}], placeholder: [{
|
|
1040
|
+
type: Input
|
|
1207
1041
|
}] } });
|
|
1208
1042
|
|
|
1043
|
+
const pushTop = trigger('pushTop', [
|
|
1044
|
+
transition(':enter', [style({ opacity: 0, transform: 'translateY(20px)' }), animate('.3s ease', style({ opacity: 1, transform: 'translateY(0)' }))]),
|
|
1045
|
+
transition(':leave', [animate('.3s ease', style({ opacity: 0, transform: 'translateY(-20px)' }))])
|
|
1046
|
+
]);
|
|
1047
|
+
|
|
1048
|
+
const sideModal = trigger('sideModal', [
|
|
1049
|
+
state('visible', style({ transform: 'translateX(0)' })),
|
|
1050
|
+
state('hidden', style({ transform: 'translateX(100%)' })),
|
|
1051
|
+
// animación al CREARSE
|
|
1052
|
+
transition('void => visible', [
|
|
1053
|
+
style({ opacity: .8, transform: 'translateX(100%)' }),
|
|
1054
|
+
animate('.5s ease')
|
|
1055
|
+
]),
|
|
1056
|
+
// animación al CERRAR
|
|
1057
|
+
transition('visible => hidden', [
|
|
1058
|
+
animate('.5s ease')
|
|
1059
|
+
])
|
|
1060
|
+
]);
|
|
1061
|
+
const fadeBackdrop = trigger('fadeBackdrop', [
|
|
1062
|
+
state('visible', style({ opacity: 1 })),
|
|
1063
|
+
state('hidden', style({ opacity: 0 })),
|
|
1064
|
+
transition('void => visible', [
|
|
1065
|
+
style({ opacity: 0 }),
|
|
1066
|
+
animate('300ms ease-out')
|
|
1067
|
+
]),
|
|
1068
|
+
transition('visible => hidden', [
|
|
1069
|
+
animate('300ms ease-in')
|
|
1070
|
+
])
|
|
1071
|
+
]);
|
|
1072
|
+
|
|
1073
|
+
const simpleFade = trigger('simpleFade', [
|
|
1074
|
+
transition(':enter', [style({ opacity: 0 }), animate('.3s ease', style({ opacity: 1 }))]),
|
|
1075
|
+
transition(':leave', [animate('.3s ease', style({ opacity: 0 }))])
|
|
1076
|
+
]);
|
|
1077
|
+
|
|
1209
1078
|
const MODAL_DATA = 'MODAL_DATA';
|
|
1210
1079
|
const MODAL_COMPONENT = 'MODAL_COMPONENT';
|
|
1211
1080
|
const MODAL_CONFIG = 'MODAL_CONFIG';
|
|
@@ -1235,34 +1104,22 @@ class UiModalRef {
|
|
|
1235
1104
|
}
|
|
1236
1105
|
}
|
|
1237
1106
|
|
|
1238
|
-
class
|
|
1107
|
+
class UicModalComponent {
|
|
1239
1108
|
modalRef;
|
|
1240
1109
|
component;
|
|
1241
1110
|
congif;
|
|
1242
1111
|
injector;
|
|
1243
|
-
modal;
|
|
1244
|
-
overlayRef; // lo setea el servicio
|
|
1245
|
-
state = 'visible';
|
|
1246
|
-
show = true;
|
|
1247
1112
|
myConfig = {};
|
|
1248
1113
|
ready = false;
|
|
1249
1114
|
title = '';
|
|
1250
1115
|
portalOutlet;
|
|
1251
|
-
constructor(modalRef, component, congif, injector
|
|
1116
|
+
constructor(modalRef, component, congif, injector) {
|
|
1252
1117
|
this.modalRef = modalRef;
|
|
1253
1118
|
this.component = component;
|
|
1254
1119
|
this.congif = congif;
|
|
1255
1120
|
this.injector = injector;
|
|
1256
|
-
this.modal = modal;
|
|
1257
1121
|
this.myConfig = congif;
|
|
1258
1122
|
}
|
|
1259
|
-
ngOnInit() {
|
|
1260
|
-
if (this.overlayRef) {
|
|
1261
|
-
this.overlayRef.hostElement.addEventListener(MODAL_CLOSE_REQUEST, () => {
|
|
1262
|
-
this.close();
|
|
1263
|
-
});
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
1123
|
ngAfterViewInit() {
|
|
1267
1124
|
const childInjector = Injector.create({
|
|
1268
1125
|
providers: [
|
|
@@ -1276,26 +1133,18 @@ class SideModalComponent {
|
|
|
1276
1133
|
}
|
|
1277
1134
|
closeOuside() {
|
|
1278
1135
|
if (!this.congif.preventCloseingOutside === true) {
|
|
1279
|
-
this.
|
|
1136
|
+
this.modalRef.closeFloating(null);
|
|
1280
1137
|
}
|
|
1281
1138
|
}
|
|
1282
1139
|
close() {
|
|
1283
|
-
this.
|
|
1284
|
-
}
|
|
1285
|
-
onAnimationDone(event) {
|
|
1286
|
-
if (event.toState === 'hidden' && event.triggerName === 'sideModal') {
|
|
1287
|
-
this.overlayRef.dispose();
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
save() {
|
|
1291
|
-
this.modal.triggerSave();
|
|
1140
|
+
this.modalRef.closeFloating(null);
|
|
1292
1141
|
}
|
|
1293
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1294
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type:
|
|
1142
|
+
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 });
|
|
1143
|
+
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=\"backdrop\" (click)=\"closeOuside()\"> \r\n <div @pushTop class=\"modal\" \r\n [class]=\"myConfig.size\"\r\n (click)=\"$event.stopPropagation()\">\r\n \r\n @if ( myConfig.title) {\r\n <div class=\"modal-header\">\r\n {{myConfig.title}}\r\n <ui-button color=\"red\" type=\"ghost\" icon=\"ri-close-large-line\" (click)=\"close()\" [iconOnly]=\"true\"></ui-button>\r\n </div>\r\n }\r\n <div class=\"modal-body\" [class.body-padding]=\"myConfig.title!='' && !myConfig.noPadding\">\r\n <ng-template cdkPortalOutlet></ng-template>\r\n </div>\r\n\r\n </div>\r\n</div>", styles: [".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: 767px){.backdrop{align-items:flex-start;padding-top:20px}}.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;padding:0 10px;display:flex;flex-direction:column}.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: 767px){.modal-header{padding:5px}}.modal-body{flex:1 1;overflow-y:auto}.body-padding{padding:25px}@media (max-width: 767px){.body-padding{padding:10px}}.medium{width:70%;max-width:800px;max-height:80%}@media (max-width: 767px){.medium{width:90%}}.large{width:80%;max-width:900px}@media (max-width: 767px){.large{width:95%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1$3.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] });
|
|
1295
1144
|
}
|
|
1296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicModalComponent, decorators: [{
|
|
1297
1146
|
type: Component,
|
|
1298
|
-
args: [{ selector: '
|
|
1147
|
+
args: [{ selector: 'ui-modal', imports: [CommonModule, PortalModule, UicButtonComponent], animations: [pushTop], template: "<div class=\"backdrop\" (click)=\"closeOuside()\"> \r\n <div @pushTop class=\"modal\" \r\n [class]=\"myConfig.size\"\r\n (click)=\"$event.stopPropagation()\">\r\n \r\n @if ( myConfig.title) {\r\n <div class=\"modal-header\">\r\n {{myConfig.title}}\r\n <ui-button color=\"red\" type=\"ghost\" icon=\"ri-close-large-line\" (click)=\"close()\" [iconOnly]=\"true\"></ui-button>\r\n </div>\r\n }\r\n <div class=\"modal-body\" [class.body-padding]=\"myConfig.title!='' && !myConfig.noPadding\">\r\n <ng-template cdkPortalOutlet></ng-template>\r\n </div>\r\n\r\n </div>\r\n</div>", styles: [".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: 767px){.backdrop{align-items:flex-start;padding-top:20px}}.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;padding:0 10px;display:flex;flex-direction:column}.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: 767px){.modal-header{padding:5px}}.modal-body{flex:1 1;overflow-y:auto}.body-padding{padding:25px}@media (max-width: 767px){.body-padding{padding:10px}}.medium{width:70%;max-width:800px;max-height:80%}@media (max-width: 767px){.medium{width:90%}}.large{width:80%;max-width:900px}@media (max-width: 767px){.large{width:95%}}\n"] }]
|
|
1299
1148
|
}], ctorParameters: () => [{ type: UiModalRef, decorators: [{
|
|
1300
1149
|
type: Inject,
|
|
1301
1150
|
args: [UiModalRef]
|
|
@@ -1305,27 +1154,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1305
1154
|
}] }, { type: undefined, decorators: [{
|
|
1306
1155
|
type: Inject,
|
|
1307
1156
|
args: [MODAL_CONFIG]
|
|
1308
|
-
}] }, { type: i0.Injector }
|
|
1157
|
+
}] }, { type: i0.Injector }], propDecorators: { portalOutlet: [{
|
|
1309
1158
|
type: ViewChild,
|
|
1310
1159
|
args: [CdkPortalOutlet, { static: true }]
|
|
1311
1160
|
}] } });
|
|
1312
1161
|
|
|
1313
|
-
class
|
|
1162
|
+
class UicSideModalComponent {
|
|
1314
1163
|
modalRef;
|
|
1315
1164
|
component;
|
|
1316
1165
|
congif;
|
|
1317
1166
|
injector;
|
|
1167
|
+
modal;
|
|
1168
|
+
overlayRef; // lo setea el servicio
|
|
1169
|
+
state = 'visible';
|
|
1170
|
+
show = true;
|
|
1318
1171
|
myConfig = {};
|
|
1319
1172
|
ready = false;
|
|
1320
1173
|
title = '';
|
|
1321
1174
|
portalOutlet;
|
|
1322
|
-
constructor(modalRef, component, congif, injector) {
|
|
1175
|
+
constructor(modalRef, component, congif, injector, modal) {
|
|
1323
1176
|
this.modalRef = modalRef;
|
|
1324
1177
|
this.component = component;
|
|
1325
1178
|
this.congif = congif;
|
|
1326
1179
|
this.injector = injector;
|
|
1180
|
+
this.modal = modal;
|
|
1327
1181
|
this.myConfig = congif;
|
|
1328
1182
|
}
|
|
1183
|
+
ngOnInit() {
|
|
1184
|
+
if (this.overlayRef) {
|
|
1185
|
+
this.overlayRef.hostElement.addEventListener(MODAL_CLOSE_REQUEST, () => {
|
|
1186
|
+
this.close();
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1329
1190
|
ngAfterViewInit() {
|
|
1330
1191
|
const childInjector = Injector.create({
|
|
1331
1192
|
providers: [
|
|
@@ -1339,18 +1200,26 @@ class ModalComponent {
|
|
|
1339
1200
|
}
|
|
1340
1201
|
closeOuside() {
|
|
1341
1202
|
if (!this.congif.preventCloseingOutside === true) {
|
|
1342
|
-
this.
|
|
1203
|
+
this.close();
|
|
1343
1204
|
}
|
|
1344
1205
|
}
|
|
1345
1206
|
close() {
|
|
1346
|
-
this.
|
|
1207
|
+
this.state = 'hidden';
|
|
1208
|
+
}
|
|
1209
|
+
onAnimationDone(event) {
|
|
1210
|
+
if (event.toState === 'hidden' && event.triggerName === 'sideModal') {
|
|
1211
|
+
this.overlayRef.dispose();
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
save() {
|
|
1215
|
+
this.modal.triggerSave();
|
|
1347
1216
|
}
|
|
1348
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1349
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type:
|
|
1217
|
+
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 });
|
|
1218
|
+
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\" (@sideModal.done)=\"onAnimationDone($event)\" class=\"sidemodal\" [style.width]=\"myConfig.width??'60%'\" (click)=\"$event.stopPropagation()\">\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 class=\"sidemodal-body\" [class.body-padding]=\"myConfig.title!=''\">\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)=\"close()\" color=\"black\" size=\"l\" type=\"bordered\" icon=\"ri-close-line\">{{myConfig.footerCancelButtonText??'Cancelar'}}</ui-button>\r\n }\r\n <ui-button (click)=\"save()\" color=\"black\" size=\"l\" rightIcon=\"ri-check-line\">{{myConfig.footerOkButtonText??'Siguiente'}}</ui-button>\r\n </div>\r\n }\r\n</div>", 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}.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}.close-icon{position:absolute;right:30px;height:30px}.sidemodal{position:fixed;right:0;top:0;height:100%;background-color:var(--white);display:flex;flex-direction:column;padding-top:28px}.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:32px}.sidemodal-footer{height:96px;padding:24px 40px;width:100%;display:flex;gap:8px;justify-content:flex-end;border-top:1px solid var(--grey-300)}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1$3.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: [sideModal, fadeBackdrop] });
|
|
1350
1219
|
}
|
|
1351
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicSideModalComponent, decorators: [{
|
|
1352
1221
|
type: Component,
|
|
1353
|
-
args: [{ selector: '
|
|
1222
|
+
args: [{ selector: 'ui-side-modal', imports: [PortalModule, UicButtonComponent], animations: [sideModal, fadeBackdrop], template: "<div [@fadeBackdrop]=\"state\" class=\"backdrop\" (click)=\"closeOuside()\"> \r\n</div>\r\n<div [@sideModal]=\"state\" (@sideModal.done)=\"onAnimationDone($event)\" class=\"sidemodal\" [style.width]=\"myConfig.width??'60%'\" (click)=\"$event.stopPropagation()\">\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 class=\"sidemodal-body\" [class.body-padding]=\"myConfig.title!=''\">\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)=\"close()\" color=\"black\" size=\"l\" type=\"bordered\" icon=\"ri-close-line\">{{myConfig.footerCancelButtonText??'Cancelar'}}</ui-button>\r\n }\r\n <ui-button (click)=\"save()\" color=\"black\" size=\"l\" rightIcon=\"ri-check-line\">{{myConfig.footerOkButtonText??'Siguiente'}}</ui-button>\r\n </div>\r\n }\r\n</div>", 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}.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}.close-icon{position:absolute;right:30px;height:30px}.sidemodal{position:fixed;right:0;top:0;height:100%;background-color:var(--white);display:flex;flex-direction:column;padding-top:28px}.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:32px}.sidemodal-footer{height:96px;padding:24px 40px;width:100%;display:flex;gap:8px;justify-content:flex-end;border-top:1px solid var(--grey-300)}\n"] }]
|
|
1354
1223
|
}], ctorParameters: () => [{ type: UiModalRef, decorators: [{
|
|
1355
1224
|
type: Inject,
|
|
1356
1225
|
args: [UiModalRef]
|
|
@@ -1360,7 +1229,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1360
1229
|
}] }, { type: undefined, decorators: [{
|
|
1361
1230
|
type: Inject,
|
|
1362
1231
|
args: [MODAL_CONFIG]
|
|
1363
|
-
}] }, { type: i0.Injector }], propDecorators: { portalOutlet: [{
|
|
1232
|
+
}] }, { type: i0.Injector }, { type: UicModalService }], propDecorators: { portalOutlet: [{
|
|
1364
1233
|
type: ViewChild,
|
|
1365
1234
|
args: [CdkPortalOutlet, { static: true }]
|
|
1366
1235
|
}] } });
|
|
@@ -1380,11 +1249,11 @@ class UicModalService {
|
|
|
1380
1249
|
const modalRef = new UiModalRef(overlayRef, this);
|
|
1381
1250
|
const injector = this.createModalInjector(overlayRef, modalRef, component, config);
|
|
1382
1251
|
if (isFloating) {
|
|
1383
|
-
const modalPortal = new ComponentPortal(
|
|
1252
|
+
const modalPortal = new ComponentPortal(UicModalComponent, null, injector);
|
|
1384
1253
|
overlayRef.attach(modalPortal);
|
|
1385
1254
|
}
|
|
1386
1255
|
else {
|
|
1387
|
-
const modalPortal = new ComponentPortal(
|
|
1256
|
+
const modalPortal = new ComponentPortal(UicSideModalComponent, null, injector);
|
|
1388
1257
|
const componentRef = overlayRef.attach(modalPortal);
|
|
1389
1258
|
componentRef.instance.overlayRef = overlayRef;
|
|
1390
1259
|
}
|
|
@@ -1447,11 +1316,11 @@ class TinyAlertComponent {
|
|
|
1447
1316
|
this.modalRef.closeFloating(value ? this.response : null);
|
|
1448
1317
|
}
|
|
1449
1318
|
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 });
|
|
1450
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TinyAlertComponent, isStandalone: true, selector: "lib-tiny-alert", ngImport: i0, template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath != '') {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }\r\n <h3> {{data.title}} </h3>\r\n <div class=\"alert-body\" [innerHTML]=\"data.body\"> </div>\r\n <div class=\"card-buttons\">\r\n @if (data.showCancelButton) {\r\n <ui-button (click)=\"close(false)\" type=\"bordered\" [color]=\"data.cancelButtonColor??'primary'\" size=\"l\"> {{data.cancelButtonText??'Cancelar'}} </ui-button>\r\n }\r\n <ui-button (click)=\"close(true)\" [color]=\"data.okButtonColor??'primary'\" size=\"l\"> {{data.okButtonText??'Continuar'}} </ui-button>\r\n </div>\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}h3{font-size:24px;font-weight:800;margin-bottom:10px}.alert-body{font-size:18px;font-weight:700;line-height:24px;text-align:center;color
|
|
1319
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TinyAlertComponent, isStandalone: true, selector: "lib-tiny-alert", ngImport: i0, template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath != '') {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }\r\n <h3> {{data.title}} </h3>\r\n <div class=\"alert-body\" [innerHTML]=\"data.body\"> </div>\r\n <div class=\"card-buttons\">\r\n @if (data.showCancelButton) {\r\n <ui-button (click)=\"close(false)\" type=\"bordered\" [color]=\"data.cancelButtonColor??'primary'\" size=\"l\"> {{data.cancelButtonText??'Cancelar'}} </ui-button>\r\n }\r\n <ui-button (click)=\"close(true)\" [color]=\"data.okButtonColor??'primary'\" size=\"l\"> {{data.okButtonText??'Continuar'}} </ui-button>\r\n </div>\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}h3{font-size:24px;font-weight:800;margin-bottom:10px}.alert-body{font-size:18px;font-weight:700;line-height:24px;text-align:center;color:var(--grey-500)}.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: 767px){.floating-close{top:0;right:-5px}}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }] });
|
|
1451
1320
|
}
|
|
1452
1321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TinyAlertComponent, decorators: [{
|
|
1453
1322
|
type: Component,
|
|
1454
|
-
args: [{ selector: 'lib-tiny-alert', imports: [UicButtonComponent], template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath != '') {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }\r\n <h3> {{data.title}} </h3>\r\n <div class=\"alert-body\" [innerHTML]=\"data.body\"> </div>\r\n <div class=\"card-buttons\">\r\n @if (data.showCancelButton) {\r\n <ui-button (click)=\"close(false)\" type=\"bordered\" [color]=\"data.cancelButtonColor??'primary'\" size=\"l\"> {{data.cancelButtonText??'Cancelar'}} </ui-button>\r\n }\r\n <ui-button (click)=\"close(true)\" [color]=\"data.okButtonColor??'primary'\" size=\"l\"> {{data.okButtonText??'Continuar'}} </ui-button>\r\n </div>\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}h3{font-size:24px;font-weight:800;margin-bottom:10px}.alert-body{font-size:18px;font-weight:700;line-height:24px;text-align:center;color
|
|
1323
|
+
args: [{ selector: 'lib-tiny-alert', imports: [UicButtonComponent], template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath != '') {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }\r\n <h3> {{data.title}} </h3>\r\n <div class=\"alert-body\" [innerHTML]=\"data.body\"> </div>\r\n <div class=\"card-buttons\">\r\n @if (data.showCancelButton) {\r\n <ui-button (click)=\"close(false)\" type=\"bordered\" [color]=\"data.cancelButtonColor??'primary'\" size=\"l\"> {{data.cancelButtonText??'Cancelar'}} </ui-button>\r\n }\r\n <ui-button (click)=\"close(true)\" [color]=\"data.okButtonColor??'primary'\" size=\"l\"> {{data.okButtonText??'Continuar'}} </ui-button>\r\n </div>\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}h3{font-size:24px;font-weight:800;margin-bottom:10px}.alert-body{font-size:18px;font-weight:700;line-height:24px;text-align:center;color:var(--grey-500)}.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: 767px){.floating-close{top:0;right:-5px}}\n"] }]
|
|
1455
1324
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1456
1325
|
type: Inject,
|
|
1457
1326
|
args: [MODAL_DATA]
|
|
@@ -1484,9 +1353,76 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1484
1353
|
}]
|
|
1485
1354
|
}] });
|
|
1486
1355
|
|
|
1356
|
+
let nextId = 1;
|
|
1357
|
+
function createSuccessAlert(message, options) {
|
|
1358
|
+
return {
|
|
1359
|
+
id: nextId++,
|
|
1360
|
+
message,
|
|
1361
|
+
type: 'success',
|
|
1362
|
+
duration: 3000,
|
|
1363
|
+
...options,
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
function createErrorAlert(message, options) {
|
|
1367
|
+
return {
|
|
1368
|
+
id: nextId++,
|
|
1369
|
+
message,
|
|
1370
|
+
type: 'error',
|
|
1371
|
+
duration: 5000,
|
|
1372
|
+
...options,
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
function createWarningAlert(message, options) {
|
|
1376
|
+
return {
|
|
1377
|
+
id: nextId++,
|
|
1378
|
+
message,
|
|
1379
|
+
type: 'warning',
|
|
1380
|
+
duration: 4000,
|
|
1381
|
+
...options,
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
function createInfoAlert(message, options) {
|
|
1385
|
+
return {
|
|
1386
|
+
id: nextId++,
|
|
1387
|
+
message,
|
|
1388
|
+
type: 'info',
|
|
1389
|
+
duration: 3000,
|
|
1390
|
+
...options,
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
class UicPushAlertService {
|
|
1395
|
+
autoIncId = 0;
|
|
1396
|
+
alerts$ = new Subject();
|
|
1397
|
+
get stream() {
|
|
1398
|
+
return this.alerts$.asObservable();
|
|
1399
|
+
}
|
|
1400
|
+
show(alertData) {
|
|
1401
|
+
this.autoIncId++;
|
|
1402
|
+
const alert = { ...alertData, id: this.autoIncId };
|
|
1403
|
+
this.alerts$.next(alert);
|
|
1404
|
+
}
|
|
1405
|
+
success(message, options) {
|
|
1406
|
+
this.show(createSuccessAlert(message, options));
|
|
1407
|
+
}
|
|
1408
|
+
error(message, options) {
|
|
1409
|
+
this.show(createErrorAlert(message, options));
|
|
1410
|
+
}
|
|
1411
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicPushAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1412
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicPushAlertService, providedIn: 'root' });
|
|
1413
|
+
}
|
|
1414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicPushAlertService, decorators: [{
|
|
1415
|
+
type: Injectable,
|
|
1416
|
+
args: [{
|
|
1417
|
+
providedIn: 'root'
|
|
1418
|
+
}]
|
|
1419
|
+
}] });
|
|
1420
|
+
|
|
1421
|
+
// COMPONENTS
|
|
1422
|
+
|
|
1487
1423
|
/**
|
|
1488
1424
|
* Generated bundle index. Do not edit.
|
|
1489
1425
|
*/
|
|
1490
1426
|
|
|
1491
|
-
export {
|
|
1427
|
+
export { MODAL_CLOSE_EVENT, MODAL_CLOSE_REQUEST, MODAL_COMPONENT, MODAL_CONFIG, MODAL_DATA, UiModalRef, UicButtonComponent, UicCheckboxComponent, UicFormWrapperComponent, UicInputComponent, UicModalService, UicNameInitsPipe, UicPushAlertService, UicSearcherComponent, UicSelectComponent, UicSwichComponent, UicTableComponent, UicTinyAlertService, UicToolTipDirective, animatedRow, fadeAndRise, fadeBackdrop, highlightRow, pushTop, sideModal, simpleFade };
|
|
1492
1428
|
//# sourceMappingURL=ui-core-abv.mjs.map
|