@iamgld/ui 21.1.0 → 21.1.2
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/iamgld-ui.mjs +1416 -1429
- package/fesm2022/iamgld-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/iamgld-ui.d.ts +266 -268
package/fesm2022/iamgld-ui.mjs
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { AuthStore as AuthStore$1 } from '@ui/stores';
|
|
4
|
-
import { HttpParams, HttpClient } from '@angular/common/http';
|
|
5
|
-
import { TranslocoLanguageName as TranslocoLanguageName$1, TranslocoLanguageKey as TranslocoLanguageKey$1, CookiesKeys as CookiesKeys$1, Icons as Icons$1, UiTheme as UiTheme$1, IconsSpace as IconsSpace$1, IconsSize as IconsSize$1, ButtonColor as ButtonColor$1, ButtonSize as ButtonSize$1, DropdownDirection as DropdownDirection$1, DropdownType as DropdownType$1, LinkType as LinkType$1, LinkAlign as LinkAlign$1, RadioDirection as RadioDirection$1, TableSearchAction as TableSearchAction$1, TileColor as TileColor$1, TilePaddingSize as TilePaddingSize$1 } from '@ui/models';
|
|
6
|
-
import { TranslocoService as TranslocoService$1, AuthService as AuthService$1, UiService as UiService$1 } from '@ui/services';
|
|
7
|
-
import { Subject, switchMap, catchError, throwError, map, of, debounceTime } from 'rxjs';
|
|
8
|
-
import { Router, RouterLink } from '@angular/router';
|
|
9
|
-
import { CookieService } from 'ngx-cookie-service';
|
|
10
|
-
import { signalStore, withState, withMethods, patchState, withHooks, watchState } from '@ngrx/signals';
|
|
11
|
-
import { TranslocoService as TranslocoService$2 } from '@jsverse/transloco';
|
|
2
|
+
import { input, numberAttribute, booleanAttribute, output, ChangeDetectionStrategy, Component, signal, computed, viewChild, ElementRef, Directive, contentChildren, effect, inject, DestroyRef, ChangeDetectorRef, forwardRef, InjectionToken, Injectable, RendererFactory2 } from '@angular/core';
|
|
12
3
|
import { NgTemplateOutlet, NgOptimizedImage } from '@angular/common';
|
|
13
|
-
import {
|
|
4
|
+
import { RouterLink, Router } from '@angular/router';
|
|
14
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
15
6
|
import * as i1 from '@angular/forms';
|
|
16
7
|
import { FormControl, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormBuilder } from '@angular/forms';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
8
|
+
import { debounceTime, map, catchError, throwError, of, Subject, switchMap } from 'rxjs';
|
|
9
|
+
import { CookieService } from 'ngx-cookie-service';
|
|
10
|
+
import { signalStore, withState, withMethods, patchState, withHooks, watchState } from '@ngrx/signals';
|
|
11
|
+
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
12
|
+
import { TranslocoService as TranslocoService$1 } from '@jsverse/transloco';
|
|
19
13
|
|
|
20
14
|
var ButtonColor;
|
|
21
15
|
(function (ButtonColor) {
|
|
@@ -189,922 +183,604 @@ var UiTheme;
|
|
|
189
183
|
UiTheme["system"] = "theme--system";
|
|
190
184
|
})(UiTheme || (UiTheme = {}));
|
|
191
185
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
186
|
+
// Angular Imports
|
|
187
|
+
class IconComponent {
|
|
188
|
+
IconsSpace = IconsSpace;
|
|
189
|
+
Icons = Icons;
|
|
190
|
+
icon = input.required({ ...(ngDevMode ? { debugName: "icon" } : {}) });
|
|
191
|
+
size = input(IconsSize.normal, { ...(ngDevMode ? { debugName: "size" } : {}) });
|
|
192
|
+
space = input(IconsSpace.none, { ...(ngDevMode ? { debugName: "space" } : {}) });
|
|
193
|
+
moveTopToBottom = input(0, { ...(ngDevMode ? { debugName: "moveTopToBottom" } : {}), transform: numberAttribute });
|
|
194
|
+
moveLeftToRight = input(0, { ...(ngDevMode ? { debugName: "moveLeftToRight" } : {}), transform: numberAttribute });
|
|
195
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
196
|
+
clicked = output();
|
|
197
|
+
emitClick() {
|
|
198
|
+
if (!this.disabled())
|
|
199
|
+
this.clicked.emit();
|
|
200
|
+
}
|
|
201
|
+
keyup() {
|
|
202
|
+
this.emitClick();
|
|
203
|
+
}
|
|
204
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
205
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: IconComponent, isStandalone: true, selector: "gld-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, space: { classPropertyName: "space", publicName: "space", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<span\r\n tabindex=\"-1\"\r\n (click)=\"emitClick()\"\r\n (keyup.enter)=\"keyup()\"\r\n class=\"icon icon--{{ size() }}\"\r\n [class.icon--left]=\"space() === IconsSpace.left\"\r\n [class.icon--right]=\"space() === IconsSpace.right\"\r\n [style.right.px]=\"moveLeftToRight()\"\r\n [style.top.px]=\"moveTopToBottom()\">\r\n @switch (icon()) {\r\n @case (Icons.arrowDownSLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.arrowUpSLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.checkboxCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.checkboxBlankCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.loader4Fill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M18.364 5.63604L16.9497 7.05025C15.683 5.7835 13.933 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12H21C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C14.4853 3 16.7353 4.00736 18.364 5.63604Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.logoutCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 11H13V13H5V16L0 12L5 8V11ZM3.99927 18H6.70835C8.11862 19.2447 9.97111 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.97111 4 8.11862 4.75527 6.70835 6H3.99927C5.82368 3.57111 8.72836 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C8.72836 22 5.82368 20.4289 3.99927 18Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.loginCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M10 11V8L15 12L10 16V13H1V11H10ZM2.4578 15H4.58152C5.76829 17.9318 8.64262 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C8.64262 4 5.76829 6.06817 4.58152 9H2.4578C3.73207 4.94289 7.52236 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C7.52236 22 3.73207 19.0571 2.4578 15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitRepositoryLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13 21V23.5L10 21.5L7 23.5V21H6.5C4.567 21 3 19.433 3 17.5V5C3 3.34315 4.34315 2 6 2H20C20.5523 2 21 2.44772 21 3V20C21 20.5523 20.5523 21 20 21H13ZM13 19H19V16H6.5C5.67157 16 5 16.6716 5 17.5C5 18.3284 5.67157 19 6.5 19H7V17H13V19ZM19 14V4H6V14.0354C6.1633 14.0121 6.33024 14 6.5 14H19ZM7 5H9V7H7V5ZM7 8H9V10H7V8ZM7 11H9V13H7V11Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.fileList3Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M19 22H5C3.34315 22 2 20.6569 2 19V3C2 2.44772 2.44772 2 3 2H17C17.5523 2 18 2.44772 18 3V15H22V19C22 20.6569 20.6569 22 19 22ZM18 17V19C18 19.5523 18.4477 20 19 20C19.5523 20 20 19.5523 20 19V17H18ZM16 20V4H4V19C4 19.5523 4.44772 20 5 20H16ZM6 7H14V9H6V7ZM6 11H14V13H6V11ZM6 15H11V17H6V15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.menuLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path d=\"M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.sunLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 18C8.68629 18 6 15.3137 6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 15.3137 15.3137 18 12 18ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16ZM11 1H13V4H11V1ZM11 20H13V23H11V20ZM3.51472 4.92893L4.92893 3.51472L7.05025 5.63604L5.63604 7.05025L3.51472 4.92893ZM16.9497 18.364L18.364 16.9497L20.4853 19.0711L19.0711 20.4853L16.9497 18.364ZM19.0711 3.51472L20.4853 4.92893L18.364 7.05025L16.9497 5.63604L19.0711 3.51472ZM5.63604 16.9497L7.05025 18.364L4.92893 20.4853L3.51472 19.0711L5.63604 16.9497ZM23 11V13H20V11H23ZM4 11V13H1V11H4Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.moonClearLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M10 6C10 10.4183 13.5817 14 18 14C19.4386 14 20.7885 13.6203 21.9549 12.9556C21.4738 18.0302 17.2005 22 12 22C6.47715 22 2 17.5228 2 12C2 6.79948 5.9698 2.52616 11.0444 2.04507C10.3797 3.21152 10 4.56142 10 6ZM4 12C4 16.4183 7.58172 20 12 20C14.9654 20 17.5757 18.3788 18.9571 15.9546C18.6407 15.9848 18.3214 16 18 16C12.4772 16 8 11.5228 8 6C8 5.67863 8.01524 5.35933 8.04536 5.04293C5.62119 6.42426 4 9.03458 4 12ZM18.1642 2.29104L19 2.5V3.5L18.1642 3.70896C17.4476 3.8881 16.8881 4.4476 16.709 5.16417L16.5 6H15.5L15.291 5.16417C15.1119 4.4476 14.5524 3.8881 13.8358 3.70896L13 3.5V2.5L13.8358 2.29104C14.5524 2.1119 15.1119 1.5524 15.291 0.835829L15.5 0H16.5L16.709 0.835829C16.8881 1.5524 17.4476 2.1119 18.1642 2.29104ZM23.1642 7.29104L24 7.5V8.5L23.1642 8.70896C22.4476 8.8881 21.8881 9.4476 21.709 10.1642L21.5 11H20.5L20.291 10.1642C20.1119 9.4476 19.5524 8.8881 18.8358 8.70896L18 8.5V7.5L18.8358 7.29104C19.5524 7.1119 20.1119 6.5524 20.291 5.83583L20.5 5H21.5L21.709 5.83583C21.8881 6.5524 22.4476 7.1119 23.1642 7.29104Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.englishInput) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M14 10H16L16.0005 10.7574C16.7154 10.279 17.5751 10 18.5 10C20.9853 10 23 12.0147 23 14.5V20H21V14.5C21 13.07 19.8255 12 18.5 12C17.1745 12 16 13.07 16 14.5V20H14V10ZM12 4V6H4V11H12V13H4V18H12V20H2V4H12Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.translate) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 15V17C5 18.0544 5.81588 18.9182 6.85074 18.9945L7 19H10V21H7C4.79086 21 3 19.2091 3 17V15H5ZM18 10L22.4 21H20.245L19.044 18H14.954L13.755 21H11.601L16 10H18ZM17 12.8852L15.753 16H18.245L17 12.8852ZM8 2V4H12V11H8V14H6V11H2V4H6V2H8ZM17 3C19.2091 3 21 4.79086 21 7V9H19V7C19 5.89543 18.1046 5 17 5H14V3H17ZM6 6H4V9H6V6ZM10 6H8V9H10V6Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.user4Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 20H19V22H5V20ZM12 18C7.58172 18 4 14.4183 4 10C4 5.58172 7.58172 2 12 2C16.4183 2 20 5.58172 20 10C20 14.4183 16.4183 18 12 18ZM12 16C15.3137 16 18 13.3137 18 10C18 6.68629 15.3137 4 12 4C8.68629 4 6 6.68629 6 10C6 13.3137 8.68629 16 12 16Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.shapesLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9998 1L6 11H18L11.9998 1ZM11.9998 4.8873L14.4676 9H9.53232L11.9998 4.8873ZM6.75 20C5.23122 20 4 18.7688 4 17.25C4 15.7312 5.23122 14.5 6.75 14.5C8.26878 14.5 9.5 15.7312 9.5 17.25C9.5 18.7688 8.26878 20 6.75 20ZM6.75 22C9.37335 22 11.5 19.8734 11.5 17.25C11.5 14.6266 9.37335 12.5 6.75 12.5C4.12665 12.5 2 14.6266 2 17.25C2 19.8734 4.12665 22 6.75 22ZM15 15.5V19.5H19V15.5H15ZM13 21.5V13.5H21V21.5H13Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.closeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.eyeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.eyeCloseLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M9.34268 18.7819L7.41083 18.2642L8.1983 15.3254C7.00919 14.8874 5.91661 14.2498 4.96116 13.4534L2.80783 15.6067L1.39362 14.1925L3.54695 12.0392C2.35581 10.6103 1.52014 8.87466 1.17578 6.96818L3.14386 6.61035C3.90289 10.8126 7.57931 14.0001 12.0002 14.0001C16.4211 14.0001 20.0976 10.8126 20.8566 6.61035L22.8247 6.96818C22.4803 8.87466 21.6446 10.6103 20.4535 12.0392L22.6068 14.1925L21.1926 15.6067L19.0393 13.4534C18.0838 14.2498 16.9912 14.8874 15.8021 15.3254L16.5896 18.2642L14.6578 18.7819L13.87 15.8418C13.2623 15.9459 12.6376 16.0001 12.0002 16.0001C11.3629 16.0001 10.7381 15.9459 10.1305 15.8418L9.34268 18.7819Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.linkedinBoxFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M18.3362 18.339H15.6707V14.1622C15.6707 13.1662 15.6505 11.8845 14.2817 11.8845C12.892 11.8845 12.6797 12.9683 12.6797 14.0887V18.339H10.0142V9.75H12.5747V10.9207H12.6092C12.967 10.2457 13.837 9.53325 15.1367 9.53325C17.8375 9.53325 18.337 11.3108 18.337 13.6245V18.339H18.3362ZM7.00373 8.57475C6.14573 8.57475 5.45648 7.88025 5.45648 7.026C5.45648 6.1725 6.14648 5.47875 7.00373 5.47875C7.85873 5.47875 8.55173 6.1725 8.55173 7.026C8.55173 7.88025 7.85798 8.57475 7.00373 8.57475ZM8.34023 18.339H5.66723V9.75H8.34023V18.339ZM19.6697 3H4.32923C3.59498 3 3.00098 3.5805 3.00098 4.29675V19.7033C3.00098 20.4202 3.59498 21 4.32923 21H19.6675C20.401 21 21.001 20.4202 21.001 19.7033V4.29675C21.001 3.5805 20.401 3 19.6675 3H19.6697Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.githubFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.001 2C6.47598 2 2.00098 6.475 2.00098 12C2.00098 16.425 4.86348 20.1625 8.83848 21.4875C9.33848 21.575 9.52598 21.275 9.52598 21.0125C9.52598 20.775 9.51348 19.9875 9.51348 19.15C7.00098 19.6125 6.35098 18.5375 6.15098 17.975C6.03848 17.6875 5.55098 16.8 5.12598 16.5625C4.77598 16.375 4.27598 15.9125 5.11348 15.9C5.90098 15.8875 6.46348 16.625 6.65098 16.925C7.55098 18.4375 8.98848 18.0125 9.56348 17.75C9.65098 17.1 9.91348 16.6625 10.201 16.4125C7.97598 16.1625 5.65098 15.3 5.65098 11.475C5.65098 10.3875 6.03848 9.4875 6.67598 8.7875C6.57598 8.5375 6.22598 7.5125 6.77598 6.1375C6.77598 6.1375 7.61348 5.875 9.52598 7.1625C10.326 6.9375 11.176 6.825 12.026 6.825C12.876 6.825 13.726 6.9375 14.526 7.1625C16.4385 5.8625 17.276 6.1375 17.276 6.1375C17.826 7.5125 17.476 8.5375 17.376 8.7875C18.0135 9.4875 18.401 10.375 18.401 11.475C18.401 15.3125 16.0635 16.1625 13.8385 16.4125C14.201 16.725 14.5135 17.325 14.5135 18.2625C14.5135 19.6 14.501 20.675 14.501 21.0125C14.501 21.275 14.6885 21.5875 15.1885 21.4875C19.259 20.1133 21.9999 16.2963 22.001 12C22.001 6.475 17.526 2 12.001 2Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.instagramFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13.0281 2.00073C14.1535 2.00259 14.7238 2.00855 15.2166 2.02322L15.4107 2.02956C15.6349 2.03753 15.8561 2.04753 16.1228 2.06003C17.1869 2.1092 17.9128 2.27753 18.5503 2.52503C19.2094 2.7792 19.7661 3.12253 20.3219 3.67837C20.8769 4.2342 21.2203 4.79253 21.4753 5.45003C21.7219 6.0867 21.8903 6.81337 21.9403 7.87753C21.9522 8.1442 21.9618 8.3654 21.9697 8.58964L21.976 8.78373C21.9906 9.27647 21.9973 9.84686 21.9994 10.9723L22.0002 11.7179C22.0003 11.809 22.0003 11.903 22.0003 12L22.0002 12.2821L21.9996 13.0278C21.9977 14.1532 21.9918 14.7236 21.9771 15.2163L21.9707 15.4104C21.9628 15.6347 21.9528 15.8559 21.9403 16.1225C21.8911 17.1867 21.7219 17.9125 21.4753 18.55C21.2211 19.2092 20.8769 19.7659 20.3219 20.3217C19.7661 20.8767 19.2069 21.22 18.5503 21.475C17.9128 21.7217 17.1869 21.89 16.1228 21.94C15.8561 21.9519 15.6349 21.9616 15.4107 21.9694L15.2166 21.9757C14.7238 21.9904 14.1535 21.997 13.0281 21.9992L12.2824 22C12.1913 22 12.0973 22 12.0003 22L11.7182 22L10.9725 21.9993C9.8471 21.9975 9.27672 21.9915 8.78397 21.9768L8.58989 21.9705C8.36564 21.9625 8.14444 21.9525 7.87778 21.94C6.81361 21.8909 6.08861 21.7217 5.45028 21.475C4.79194 21.2209 4.23444 20.8767 3.67861 20.3217C3.12278 19.7659 2.78028 19.2067 2.52528 18.55C2.27778 17.9125 2.11028 17.1867 2.06028 16.1225C2.0484 15.8559 2.03871 15.6347 2.03086 15.4104L2.02457 15.2163C2.00994 14.7236 2.00327 14.1532 2.00111 13.0278L2.00098 10.9723C2.00284 9.84686 2.00879 9.27647 2.02346 8.78373L2.02981 8.58964C2.03778 8.3654 2.04778 8.1442 2.06028 7.87753C2.10944 6.81253 2.27778 6.08753 2.52528 5.45003C2.77944 4.7917 3.12278 4.2342 3.67861 3.67837C4.23444 3.12253 4.79278 2.78003 5.45028 2.52503C6.08778 2.27753 6.81278 2.11003 7.87778 2.06003C8.14444 2.04816 8.36564 2.03847 8.58989 2.03062L8.78397 2.02433C9.27672 2.00969 9.8471 2.00302 10.9725 2.00086L13.0281 2.00073ZM12.0003 7.00003C9.23738 7.00003 7.00028 9.23956 7.00028 12C7.00028 14.7629 9.23981 17 12.0003 17C14.7632 17 17.0003 14.7605 17.0003 12C17.0003 9.23713 14.7607 7.00003 12.0003 7.00003ZM12.0003 9.00003C13.6572 9.00003 15.0003 10.3427 15.0003 12C15.0003 13.6569 13.6576 15 12.0003 15C10.3434 15 9.00028 13.6574 9.00028 12C9.00028 10.3431 10.3429 9.00003 12.0003 9.00003ZM17.2503 5.50003C16.561 5.50003 16.0003 6.05994 16.0003 6.74918C16.0003 7.43843 16.5602 7.9992 17.2503 7.9992C17.9395 7.9992 18.5003 7.4393 18.5003 6.74918C18.5003 6.05994 17.9386 5.49917 17.2503 5.50003Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.twitterXFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M17.6874 3.0625L12.6907 8.77425L8.37045 3.0625H2.11328L9.58961 12.8387L2.50378 20.9375H5.53795L11.0068 14.6886L15.7863 20.9375H21.8885L14.095 10.6342L20.7198 3.0625H17.6874ZM16.6232 19.1225L5.65436 4.78217H7.45745L18.3034 19.1225H16.6232Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.downloadCloud2Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13 13V18.585L14.8284 16.7574L16.2426 18.1716L12 22.4142L7.75736 18.1716L9.17157 16.7574L11 18.585V13H13ZM12 2C15.5934 2 18.5544 4.70761 18.9541 8.19395C21.2858 8.83154 23 10.9656 23 13.5C23 16.3688 20.8036 18.7246 18.0006 18.9776L18.0009 16.9644C19.6966 16.7214 21 15.2629 21 13.5C21 11.567 19.433 10 17.5 10C17.2912 10 17.0867 10.0183 16.8887 10.054C16.9616 9.7142 17 9.36158 17 9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9C7 9.36158 7.03838 9.7142 7.11205 10.0533C6.91331 10.0183 6.70879 10 6.5 10C4.567 10 3 11.567 3 13.5C3 15.2003 4.21241 16.6174 5.81986 16.934L6.00005 16.9646L6.00039 18.9776C3.19696 18.7252 1 16.3692 1 13.5C1 10.9656 2.71424 8.83154 5.04648 8.19411C5.44561 4.70761 8.40661 2 12 2Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.globeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13.0003 21H18.0003V23H6.00032V21H11.0003V19.9506C7.70689 19.6236 4.88351 17.6987 3.31641 14.9622L5.05319 13.9697C6.43208 16.3776 9.02674 18 12.0003 18C16.4186 18 20.0003 14.4182 20.0003 9.99995C20.0003 7.02637 18.378 4.43171 15.9701 3.05282L16.9626 1.31604C19.9724 3.03965 22.0003 6.28297 22.0003 9.99995C22.0003 15.1853 18.0536 19.4489 13.0003 19.9506V21ZM12.0003 17C8.13433 17 5.00032 13.8659 5.00032 9.99995C5.00032 6.13396 8.13433 2.99995 12.0003 2.99995C15.8663 2.99995 19.0003 6.13396 19.0003 9.99995C19.0003 13.8659 15.8663 17 12.0003 17ZM12.0003 15C14.7617 15 17.0003 12.7614 17.0003 9.99995C17.0003 7.23853 14.7617 4.99995 12.0003 4.99995C9.2389 4.99995 7.00032 7.23853 7.00032 9.99995C7.00032 12.7614 9.2389 15 12.0003 15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.mailSendLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M21 3C21.5523 3 22 3.44772 22 4V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V19H20V7.3L12 14.5L2 5.5V4C2 3.44772 2.44772 3 3 3H21ZM8 15V17H0V15H8ZM5 10V12H0V10H5ZM19.5659 5H4.43414L12 11.8093L19.5659 5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.pagesLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 8V20H19V8H5ZM5 6H19V4H5V6ZM20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM7 10H11V14H7V10ZM7 16H17V18H7V16ZM13 11H17V13H13V11Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitForkLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6 5C5.44772 5 5 5.44772 5 6C5 6.55228 5.44772 7 6 7C6.55228 7 7 6.55228 7 6C7 5.44772 6.55228 5 6 5ZM3 6C3 4.34315 4.34315 3 6 3C7.65685 3 9 4.34315 9 6C9 7.30622 8.16519 8.41746 7 8.82929V9C7 10.1046 7.89543 11 9 11H15C16.1046 11 17 10.1046 17 9V8.82929C15.8348 8.41746 15 7.30622 15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.30622 20.1652 8.41746 19 8.82929V9C19 11.2091 17.2091 13 15 13H13V15.1707C14.1652 15.5825 15 16.6938 15 18C15 19.6569 13.6569 21 12 21C10.3431 21 9 19.6569 9 18C9 16.6938 9.83481 15.5825 11 15.1707V13H9C6.79086 13 5 11.2091 5 9V8.82929C3.83481 8.41746 3 7.30622 3 6ZM18 5C17.4477 5 17 5.44772 17 6C17 6.55228 17.4477 7 18 7C18.5523 7 19 6.55228 19 6C19 5.44772 18.5523 5 18 5ZM12 17C11.4477 17 11 17.4477 11 18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18C13 17.4477 12.5523 17 12 17Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitRepositoryPrivateLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6 10V20H19V10H6ZM18 8H20C20.5523 8 21 8.44772 21 9V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V9C3 8.44772 3.44772 8 4 8H6V7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7V8ZM16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8H16ZM7 11H9V13H7V11ZM7 14H9V16H7V14ZM7 17H9V19H7V17Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.starLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.0006 18.26L4.94715 22.2082L6.52248 14.2799L0.587891 8.7918L8.61493 7.84006L12.0006 0.5L15.3862 7.84006L23.4132 8.7918L17.4787 14.2799L19.054 22.2082L12.0006 18.26ZM12.0006 15.968L16.2473 18.3451L15.2988 13.5717L18.8719 10.2674L14.039 9.69434L12.0006 5.27502L9.96214 9.69434L5.12921 10.2674L8.70231 13.5717L7.75383 18.3451L12.0006 15.968Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.calendar2Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM8 13V15H6V13H8ZM13 13V15H11V13H13ZM18 13V15H16V13H18ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.macLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M14 18V20L16 21V22H8L7.99639 21.0036L10 20V18H2.9918C2.44405 18 2 17.5511 2 16.9925V4.00748C2 3.45107 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44892 22 4.00748V16.9925C22 17.5489 21.5447 18 21.0082 18H14ZM4 5V14H20V5H4Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.more2Fill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 3C10.9 3 10 3.9 10 5C10 6.1 10.9 7 12 7C13.1 7 14 6.1 14 5C14 3.9 13.1 3 12 3ZM12 17C10.9 17 10 17.9 10 19C10 20.1 10.9 21 12 21C13.1 21 14 20.1 14 19C14 17.9 13.1 17 12 17ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.editLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.deleteBinLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z\"></path>\r\n </svg>\r\n }\r\n }\r\n</span>\r\n", styles: [":host{color:inherit;display:inline-flex}:host:has(.icon--left){margin-left:var(--gld-spacing--xxxs)}:host:has(.icon--right){margin-right:var(--gld-spacing--xxxs)}.icon{--gld-icon-size: var(--gld-icon-size--normal);position:relative;color:inherit;font-weight:400;width:var(--gld-icon-size);height:var(--gld-icon-size);margin:auto}.icon--tiny{--gld-icon-size: var(--gld-icon-size--tiny)}.icon--small{--gld-icon-size: var(--gld-icon-size--small)}.icon--medium{--gld-icon-size: var(--gld-icon-size--medium)}.icon--large{--gld-icon-size: var(--gld-icon-size--large)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
210
206
|
}
|
|
207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: IconComponent, decorators: [{
|
|
208
|
+
type: Component,
|
|
209
|
+
args: [{ selector: 'gld-icon', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\r\n tabindex=\"-1\"\r\n (click)=\"emitClick()\"\r\n (keyup.enter)=\"keyup()\"\r\n class=\"icon icon--{{ size() }}\"\r\n [class.icon--left]=\"space() === IconsSpace.left\"\r\n [class.icon--right]=\"space() === IconsSpace.right\"\r\n [style.right.px]=\"moveLeftToRight()\"\r\n [style.top.px]=\"moveTopToBottom()\">\r\n @switch (icon()) {\r\n @case (Icons.arrowDownSLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.arrowUpSLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.checkboxCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.checkboxBlankCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.loader4Fill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M18.364 5.63604L16.9497 7.05025C15.683 5.7835 13.933 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12H21C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C14.4853 3 16.7353 4.00736 18.364 5.63604Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.logoutCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 11H13V13H5V16L0 12L5 8V11ZM3.99927 18H6.70835C8.11862 19.2447 9.97111 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.97111 4 8.11862 4.75527 6.70835 6H3.99927C5.82368 3.57111 8.72836 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C8.72836 22 5.82368 20.4289 3.99927 18Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.loginCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M10 11V8L15 12L10 16V13H1V11H10ZM2.4578 15H4.58152C5.76829 17.9318 8.64262 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C8.64262 4 5.76829 6.06817 4.58152 9H2.4578C3.73207 4.94289 7.52236 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C7.52236 22 3.73207 19.0571 2.4578 15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitRepositoryLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13 21V23.5L10 21.5L7 23.5V21H6.5C4.567 21 3 19.433 3 17.5V5C3 3.34315 4.34315 2 6 2H20C20.5523 2 21 2.44772 21 3V20C21 20.5523 20.5523 21 20 21H13ZM13 19H19V16H6.5C5.67157 16 5 16.6716 5 17.5C5 18.3284 5.67157 19 6.5 19H7V17H13V19ZM19 14V4H6V14.0354C6.1633 14.0121 6.33024 14 6.5 14H19ZM7 5H9V7H7V5ZM7 8H9V10H7V8ZM7 11H9V13H7V11Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.fileList3Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M19 22H5C3.34315 22 2 20.6569 2 19V3C2 2.44772 2.44772 2 3 2H17C17.5523 2 18 2.44772 18 3V15H22V19C22 20.6569 20.6569 22 19 22ZM18 17V19C18 19.5523 18.4477 20 19 20C19.5523 20 20 19.5523 20 19V17H18ZM16 20V4H4V19C4 19.5523 4.44772 20 5 20H16ZM6 7H14V9H6V7ZM6 11H14V13H6V11ZM6 15H11V17H6V15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.menuLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path d=\"M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.sunLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 18C8.68629 18 6 15.3137 6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 15.3137 15.3137 18 12 18ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16ZM11 1H13V4H11V1ZM11 20H13V23H11V20ZM3.51472 4.92893L4.92893 3.51472L7.05025 5.63604L5.63604 7.05025L3.51472 4.92893ZM16.9497 18.364L18.364 16.9497L20.4853 19.0711L19.0711 20.4853L16.9497 18.364ZM19.0711 3.51472L20.4853 4.92893L18.364 7.05025L16.9497 5.63604L19.0711 3.51472ZM5.63604 16.9497L7.05025 18.364L4.92893 20.4853L3.51472 19.0711L5.63604 16.9497ZM23 11V13H20V11H23ZM4 11V13H1V11H4Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.moonClearLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M10 6C10 10.4183 13.5817 14 18 14C19.4386 14 20.7885 13.6203 21.9549 12.9556C21.4738 18.0302 17.2005 22 12 22C6.47715 22 2 17.5228 2 12C2 6.79948 5.9698 2.52616 11.0444 2.04507C10.3797 3.21152 10 4.56142 10 6ZM4 12C4 16.4183 7.58172 20 12 20C14.9654 20 17.5757 18.3788 18.9571 15.9546C18.6407 15.9848 18.3214 16 18 16C12.4772 16 8 11.5228 8 6C8 5.67863 8.01524 5.35933 8.04536 5.04293C5.62119 6.42426 4 9.03458 4 12ZM18.1642 2.29104L19 2.5V3.5L18.1642 3.70896C17.4476 3.8881 16.8881 4.4476 16.709 5.16417L16.5 6H15.5L15.291 5.16417C15.1119 4.4476 14.5524 3.8881 13.8358 3.70896L13 3.5V2.5L13.8358 2.29104C14.5524 2.1119 15.1119 1.5524 15.291 0.835829L15.5 0H16.5L16.709 0.835829C16.8881 1.5524 17.4476 2.1119 18.1642 2.29104ZM23.1642 7.29104L24 7.5V8.5L23.1642 8.70896C22.4476 8.8881 21.8881 9.4476 21.709 10.1642L21.5 11H20.5L20.291 10.1642C20.1119 9.4476 19.5524 8.8881 18.8358 8.70896L18 8.5V7.5L18.8358 7.29104C19.5524 7.1119 20.1119 6.5524 20.291 5.83583L20.5 5H21.5L21.709 5.83583C21.8881 6.5524 22.4476 7.1119 23.1642 7.29104Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.englishInput) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M14 10H16L16.0005 10.7574C16.7154 10.279 17.5751 10 18.5 10C20.9853 10 23 12.0147 23 14.5V20H21V14.5C21 13.07 19.8255 12 18.5 12C17.1745 12 16 13.07 16 14.5V20H14V10ZM12 4V6H4V11H12V13H4V18H12V20H2V4H12Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.translate) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 15V17C5 18.0544 5.81588 18.9182 6.85074 18.9945L7 19H10V21H7C4.79086 21 3 19.2091 3 17V15H5ZM18 10L22.4 21H20.245L19.044 18H14.954L13.755 21H11.601L16 10H18ZM17 12.8852L15.753 16H18.245L17 12.8852ZM8 2V4H12V11H8V14H6V11H2V4H6V2H8ZM17 3C19.2091 3 21 4.79086 21 7V9H19V7C19 5.89543 18.1046 5 17 5H14V3H17ZM6 6H4V9H6V6ZM10 6H8V9H10V6Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.user4Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 20H19V22H5V20ZM12 18C7.58172 18 4 14.4183 4 10C4 5.58172 7.58172 2 12 2C16.4183 2 20 5.58172 20 10C20 14.4183 16.4183 18 12 18ZM12 16C15.3137 16 18 13.3137 18 10C18 6.68629 15.3137 4 12 4C8.68629 4 6 6.68629 6 10C6 13.3137 8.68629 16 12 16Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.shapesLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9998 1L6 11H18L11.9998 1ZM11.9998 4.8873L14.4676 9H9.53232L11.9998 4.8873ZM6.75 20C5.23122 20 4 18.7688 4 17.25C4 15.7312 5.23122 14.5 6.75 14.5C8.26878 14.5 9.5 15.7312 9.5 17.25C9.5 18.7688 8.26878 20 6.75 20ZM6.75 22C9.37335 22 11.5 19.8734 11.5 17.25C11.5 14.6266 9.37335 12.5 6.75 12.5C4.12665 12.5 2 14.6266 2 17.25C2 19.8734 4.12665 22 6.75 22ZM15 15.5V19.5H19V15.5H15ZM13 21.5V13.5H21V21.5H13Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.closeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.eyeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.eyeCloseLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M9.34268 18.7819L7.41083 18.2642L8.1983 15.3254C7.00919 14.8874 5.91661 14.2498 4.96116 13.4534L2.80783 15.6067L1.39362 14.1925L3.54695 12.0392C2.35581 10.6103 1.52014 8.87466 1.17578 6.96818L3.14386 6.61035C3.90289 10.8126 7.57931 14.0001 12.0002 14.0001C16.4211 14.0001 20.0976 10.8126 20.8566 6.61035L22.8247 6.96818C22.4803 8.87466 21.6446 10.6103 20.4535 12.0392L22.6068 14.1925L21.1926 15.6067L19.0393 13.4534C18.0838 14.2498 16.9912 14.8874 15.8021 15.3254L16.5896 18.2642L14.6578 18.7819L13.87 15.8418C13.2623 15.9459 12.6376 16.0001 12.0002 16.0001C11.3629 16.0001 10.7381 15.9459 10.1305 15.8418L9.34268 18.7819Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.linkedinBoxFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M18.3362 18.339H15.6707V14.1622C15.6707 13.1662 15.6505 11.8845 14.2817 11.8845C12.892 11.8845 12.6797 12.9683 12.6797 14.0887V18.339H10.0142V9.75H12.5747V10.9207H12.6092C12.967 10.2457 13.837 9.53325 15.1367 9.53325C17.8375 9.53325 18.337 11.3108 18.337 13.6245V18.339H18.3362ZM7.00373 8.57475C6.14573 8.57475 5.45648 7.88025 5.45648 7.026C5.45648 6.1725 6.14648 5.47875 7.00373 5.47875C7.85873 5.47875 8.55173 6.1725 8.55173 7.026C8.55173 7.88025 7.85798 8.57475 7.00373 8.57475ZM8.34023 18.339H5.66723V9.75H8.34023V18.339ZM19.6697 3H4.32923C3.59498 3 3.00098 3.5805 3.00098 4.29675V19.7033C3.00098 20.4202 3.59498 21 4.32923 21H19.6675C20.401 21 21.001 20.4202 21.001 19.7033V4.29675C21.001 3.5805 20.401 3 19.6675 3H19.6697Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.githubFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.001 2C6.47598 2 2.00098 6.475 2.00098 12C2.00098 16.425 4.86348 20.1625 8.83848 21.4875C9.33848 21.575 9.52598 21.275 9.52598 21.0125C9.52598 20.775 9.51348 19.9875 9.51348 19.15C7.00098 19.6125 6.35098 18.5375 6.15098 17.975C6.03848 17.6875 5.55098 16.8 5.12598 16.5625C4.77598 16.375 4.27598 15.9125 5.11348 15.9C5.90098 15.8875 6.46348 16.625 6.65098 16.925C7.55098 18.4375 8.98848 18.0125 9.56348 17.75C9.65098 17.1 9.91348 16.6625 10.201 16.4125C7.97598 16.1625 5.65098 15.3 5.65098 11.475C5.65098 10.3875 6.03848 9.4875 6.67598 8.7875C6.57598 8.5375 6.22598 7.5125 6.77598 6.1375C6.77598 6.1375 7.61348 5.875 9.52598 7.1625C10.326 6.9375 11.176 6.825 12.026 6.825C12.876 6.825 13.726 6.9375 14.526 7.1625C16.4385 5.8625 17.276 6.1375 17.276 6.1375C17.826 7.5125 17.476 8.5375 17.376 8.7875C18.0135 9.4875 18.401 10.375 18.401 11.475C18.401 15.3125 16.0635 16.1625 13.8385 16.4125C14.201 16.725 14.5135 17.325 14.5135 18.2625C14.5135 19.6 14.501 20.675 14.501 21.0125C14.501 21.275 14.6885 21.5875 15.1885 21.4875C19.259 20.1133 21.9999 16.2963 22.001 12C22.001 6.475 17.526 2 12.001 2Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.instagramFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13.0281 2.00073C14.1535 2.00259 14.7238 2.00855 15.2166 2.02322L15.4107 2.02956C15.6349 2.03753 15.8561 2.04753 16.1228 2.06003C17.1869 2.1092 17.9128 2.27753 18.5503 2.52503C19.2094 2.7792 19.7661 3.12253 20.3219 3.67837C20.8769 4.2342 21.2203 4.79253 21.4753 5.45003C21.7219 6.0867 21.8903 6.81337 21.9403 7.87753C21.9522 8.1442 21.9618 8.3654 21.9697 8.58964L21.976 8.78373C21.9906 9.27647 21.9973 9.84686 21.9994 10.9723L22.0002 11.7179C22.0003 11.809 22.0003 11.903 22.0003 12L22.0002 12.2821L21.9996 13.0278C21.9977 14.1532 21.9918 14.7236 21.9771 15.2163L21.9707 15.4104C21.9628 15.6347 21.9528 15.8559 21.9403 16.1225C21.8911 17.1867 21.7219 17.9125 21.4753 18.55C21.2211 19.2092 20.8769 19.7659 20.3219 20.3217C19.7661 20.8767 19.2069 21.22 18.5503 21.475C17.9128 21.7217 17.1869 21.89 16.1228 21.94C15.8561 21.9519 15.6349 21.9616 15.4107 21.9694L15.2166 21.9757C14.7238 21.9904 14.1535 21.997 13.0281 21.9992L12.2824 22C12.1913 22 12.0973 22 12.0003 22L11.7182 22L10.9725 21.9993C9.8471 21.9975 9.27672 21.9915 8.78397 21.9768L8.58989 21.9705C8.36564 21.9625 8.14444 21.9525 7.87778 21.94C6.81361 21.8909 6.08861 21.7217 5.45028 21.475C4.79194 21.2209 4.23444 20.8767 3.67861 20.3217C3.12278 19.7659 2.78028 19.2067 2.52528 18.55C2.27778 17.9125 2.11028 17.1867 2.06028 16.1225C2.0484 15.8559 2.03871 15.6347 2.03086 15.4104L2.02457 15.2163C2.00994 14.7236 2.00327 14.1532 2.00111 13.0278L2.00098 10.9723C2.00284 9.84686 2.00879 9.27647 2.02346 8.78373L2.02981 8.58964C2.03778 8.3654 2.04778 8.1442 2.06028 7.87753C2.10944 6.81253 2.27778 6.08753 2.52528 5.45003C2.77944 4.7917 3.12278 4.2342 3.67861 3.67837C4.23444 3.12253 4.79278 2.78003 5.45028 2.52503C6.08778 2.27753 6.81278 2.11003 7.87778 2.06003C8.14444 2.04816 8.36564 2.03847 8.58989 2.03062L8.78397 2.02433C9.27672 2.00969 9.8471 2.00302 10.9725 2.00086L13.0281 2.00073ZM12.0003 7.00003C9.23738 7.00003 7.00028 9.23956 7.00028 12C7.00028 14.7629 9.23981 17 12.0003 17C14.7632 17 17.0003 14.7605 17.0003 12C17.0003 9.23713 14.7607 7.00003 12.0003 7.00003ZM12.0003 9.00003C13.6572 9.00003 15.0003 10.3427 15.0003 12C15.0003 13.6569 13.6576 15 12.0003 15C10.3434 15 9.00028 13.6574 9.00028 12C9.00028 10.3431 10.3429 9.00003 12.0003 9.00003ZM17.2503 5.50003C16.561 5.50003 16.0003 6.05994 16.0003 6.74918C16.0003 7.43843 16.5602 7.9992 17.2503 7.9992C17.9395 7.9992 18.5003 7.4393 18.5003 6.74918C18.5003 6.05994 17.9386 5.49917 17.2503 5.50003Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.twitterXFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M17.6874 3.0625L12.6907 8.77425L8.37045 3.0625H2.11328L9.58961 12.8387L2.50378 20.9375H5.53795L11.0068 14.6886L15.7863 20.9375H21.8885L14.095 10.6342L20.7198 3.0625H17.6874ZM16.6232 19.1225L5.65436 4.78217H7.45745L18.3034 19.1225H16.6232Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.downloadCloud2Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13 13V18.585L14.8284 16.7574L16.2426 18.1716L12 22.4142L7.75736 18.1716L9.17157 16.7574L11 18.585V13H13ZM12 2C15.5934 2 18.5544 4.70761 18.9541 8.19395C21.2858 8.83154 23 10.9656 23 13.5C23 16.3688 20.8036 18.7246 18.0006 18.9776L18.0009 16.9644C19.6966 16.7214 21 15.2629 21 13.5C21 11.567 19.433 10 17.5 10C17.2912 10 17.0867 10.0183 16.8887 10.054C16.9616 9.7142 17 9.36158 17 9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9C7 9.36158 7.03838 9.7142 7.11205 10.0533C6.91331 10.0183 6.70879 10 6.5 10C4.567 10 3 11.567 3 13.5C3 15.2003 4.21241 16.6174 5.81986 16.934L6.00005 16.9646L6.00039 18.9776C3.19696 18.7252 1 16.3692 1 13.5C1 10.9656 2.71424 8.83154 5.04648 8.19411C5.44561 4.70761 8.40661 2 12 2Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.globeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13.0003 21H18.0003V23H6.00032V21H11.0003V19.9506C7.70689 19.6236 4.88351 17.6987 3.31641 14.9622L5.05319 13.9697C6.43208 16.3776 9.02674 18 12.0003 18C16.4186 18 20.0003 14.4182 20.0003 9.99995C20.0003 7.02637 18.378 4.43171 15.9701 3.05282L16.9626 1.31604C19.9724 3.03965 22.0003 6.28297 22.0003 9.99995C22.0003 15.1853 18.0536 19.4489 13.0003 19.9506V21ZM12.0003 17C8.13433 17 5.00032 13.8659 5.00032 9.99995C5.00032 6.13396 8.13433 2.99995 12.0003 2.99995C15.8663 2.99995 19.0003 6.13396 19.0003 9.99995C19.0003 13.8659 15.8663 17 12.0003 17ZM12.0003 15C14.7617 15 17.0003 12.7614 17.0003 9.99995C17.0003 7.23853 14.7617 4.99995 12.0003 4.99995C9.2389 4.99995 7.00032 7.23853 7.00032 9.99995C7.00032 12.7614 9.2389 15 12.0003 15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.mailSendLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M21 3C21.5523 3 22 3.44772 22 4V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V19H20V7.3L12 14.5L2 5.5V4C2 3.44772 2.44772 3 3 3H21ZM8 15V17H0V15H8ZM5 10V12H0V10H5ZM19.5659 5H4.43414L12 11.8093L19.5659 5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.pagesLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 8V20H19V8H5ZM5 6H19V4H5V6ZM20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM7 10H11V14H7V10ZM7 16H17V18H7V16ZM13 11H17V13H13V11Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitForkLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6 5C5.44772 5 5 5.44772 5 6C5 6.55228 5.44772 7 6 7C6.55228 7 7 6.55228 7 6C7 5.44772 6.55228 5 6 5ZM3 6C3 4.34315 4.34315 3 6 3C7.65685 3 9 4.34315 9 6C9 7.30622 8.16519 8.41746 7 8.82929V9C7 10.1046 7.89543 11 9 11H15C16.1046 11 17 10.1046 17 9V8.82929C15.8348 8.41746 15 7.30622 15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.30622 20.1652 8.41746 19 8.82929V9C19 11.2091 17.2091 13 15 13H13V15.1707C14.1652 15.5825 15 16.6938 15 18C15 19.6569 13.6569 21 12 21C10.3431 21 9 19.6569 9 18C9 16.6938 9.83481 15.5825 11 15.1707V13H9C6.79086 13 5 11.2091 5 9V8.82929C3.83481 8.41746 3 7.30622 3 6ZM18 5C17.4477 5 17 5.44772 17 6C17 6.55228 17.4477 7 18 7C18.5523 7 19 6.55228 19 6C19 5.44772 18.5523 5 18 5ZM12 17C11.4477 17 11 17.4477 11 18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18C13 17.4477 12.5523 17 12 17Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitRepositoryPrivateLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6 10V20H19V10H6ZM18 8H20C20.5523 8 21 8.44772 21 9V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V9C3 8.44772 3.44772 8 4 8H6V7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7V8ZM16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8H16ZM7 11H9V13H7V11ZM7 14H9V16H7V14ZM7 17H9V19H7V17Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.starLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.0006 18.26L4.94715 22.2082L6.52248 14.2799L0.587891 8.7918L8.61493 7.84006L12.0006 0.5L15.3862 7.84006L23.4132 8.7918L17.4787 14.2799L19.054 22.2082L12.0006 18.26ZM12.0006 15.968L16.2473 18.3451L15.2988 13.5717L18.8719 10.2674L14.039 9.69434L12.0006 5.27502L9.96214 9.69434L5.12921 10.2674L8.70231 13.5717L7.75383 18.3451L12.0006 15.968Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.calendar2Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM8 13V15H6V13H8ZM13 13V15H11V13H13ZM18 13V15H16V13H18ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.macLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M14 18V20L16 21V22H8L7.99639 21.0036L10 20V18H2.9918C2.44405 18 2 17.5511 2 16.9925V4.00748C2 3.45107 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44892 22 4.00748V16.9925C22 17.5489 21.5447 18 21.0082 18H14ZM4 5V14H20V5H4Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.more2Fill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 3C10.9 3 10 3.9 10 5C10 6.1 10.9 7 12 7C13.1 7 14 6.1 14 5C14 3.9 13.1 3 12 3ZM12 17C10.9 17 10 17.9 10 19C10 20.1 10.9 21 12 21C13.1 21 14 20.1 14 19C14 17.9 13.1 17 12 17ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.editLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.deleteBinLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z\"></path>\r\n </svg>\r\n }\r\n }\r\n</span>\r\n", styles: [":host{color:inherit;display:inline-flex}:host:has(.icon--left){margin-left:var(--gld-spacing--xxxs)}:host:has(.icon--right){margin-right:var(--gld-spacing--xxxs)}.icon{--gld-icon-size: var(--gld-icon-size--normal);position:relative;color:inherit;font-weight:400;width:var(--gld-icon-size);height:var(--gld-icon-size);margin:auto}.icon--tiny{--gld-icon-size: var(--gld-icon-size--tiny)}.icon--small{--gld-icon-size: var(--gld-icon-size--small)}.icon--medium{--gld-icon-size: var(--gld-icon-size--medium)}.icon--large{--gld-icon-size: var(--gld-icon-size--large)}\n"] }]
|
|
210
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], space: [{ type: i0.Input, args: [{ isSignal: true, alias: "space", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
211
211
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
const _date = new Date(ms);
|
|
229
|
-
if (!Number.isNaN(_date.getTime()))
|
|
230
|
-
return _date.toISOString().split('T')[0];
|
|
231
|
-
else
|
|
232
|
-
return null;
|
|
233
|
-
}
|
|
234
|
-
// If it has 13 digits, it's a timestamp in milliseconds
|
|
235
|
-
if (date.length === 13 || date.length === 12) {
|
|
236
|
-
const ms = Number.parseInt(date, 10);
|
|
237
|
-
const _date = new Date(ms);
|
|
238
|
-
if (!Number.isNaN(_date.getTime()))
|
|
239
|
-
return _date.toISOString().split('T')[0];
|
|
240
|
-
else
|
|
241
|
-
return null;
|
|
242
|
-
}
|
|
212
|
+
// Angular Imports
|
|
213
|
+
class ButtonComponent {
|
|
214
|
+
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `button-id-${value.trim().split(' ').join('-')}` });
|
|
215
|
+
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `button-name-${value.trim().split(' ').join('-')}` });
|
|
216
|
+
color = input(ButtonColor.pink, { ...(ngDevMode ? { debugName: "color" } : {}) });
|
|
217
|
+
size = input(ButtonSize.normal, { ...(ngDevMode ? { debugName: "size" } : {}) });
|
|
218
|
+
icon = input(null, { ...(ngDevMode ? { debugName: "icon" } : {}) });
|
|
219
|
+
iconSize = input(undefined, { ...(ngDevMode ? { debugName: "iconSize" } : {}) });
|
|
220
|
+
moveTopToBottom = input(0, { ...(ngDevMode ? { debugName: "moveTopToBottom" } : {}), transform: numberAttribute });
|
|
221
|
+
moveLeftToRight = input(0, { ...(ngDevMode ? { debugName: "moveLeftToRight" } : {}), transform: numberAttribute });
|
|
222
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
223
|
+
full = input(false, { ...(ngDevMode ? { debugName: "full" } : {}), transform: booleanAttribute });
|
|
224
|
+
clicked = output();
|
|
225
|
+
emitClick() {
|
|
226
|
+
if (!this.disabled())
|
|
227
|
+
this.clicked.emit();
|
|
243
228
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
const { date } = options;
|
|
250
|
-
const isValidDate = !Number.isNaN(new Date(date).getTime());
|
|
251
|
-
// It isn't a valid date
|
|
252
|
-
if (!isValidDate)
|
|
253
|
-
return null;
|
|
254
|
-
// If it's a Date or date string
|
|
255
|
-
const [year, month, day] = date.split('-').map(Number);
|
|
256
|
-
const _date = new Date(year, month - 1, day);
|
|
257
|
-
// Hora local, pero sin problemas de zona horaria
|
|
258
|
-
return _date;
|
|
259
|
-
}
|
|
260
|
-
function formatDDMMYYYYToISODate(options) {
|
|
261
|
-
const { date } = options;
|
|
262
|
-
// It isn't a valid date
|
|
263
|
-
if (!date)
|
|
264
|
-
return null;
|
|
265
|
-
const [day, month, year] = date.split('/').map(Number);
|
|
266
|
-
// It isn't a valid date
|
|
267
|
-
if (!day ||
|
|
268
|
-
day < MIN_DAY ||
|
|
269
|
-
day > MAX_DAY ||
|
|
270
|
-
!month ||
|
|
271
|
-
month < MIN_MONTH ||
|
|
272
|
-
month > MAX_MONTH ||
|
|
273
|
-
!year ||
|
|
274
|
-
String(year).length < YEAR_LENGTH)
|
|
275
|
-
return null;
|
|
276
|
-
// Create the date and subtract 1 so that JavaScript interprets the month correctly
|
|
277
|
-
const _date = new Date(Date.UTC(year, month - 1, day));
|
|
278
|
-
// It isn't a valid date
|
|
279
|
-
const isValidDate = !Number.isNaN(_date.getTime());
|
|
280
|
-
if (!isValidDate)
|
|
281
|
-
return null;
|
|
282
|
-
return formatDateToISODate({ date: _date });
|
|
283
|
-
}
|
|
284
|
-
function formatISODateToDDMMYYYY(options) {
|
|
285
|
-
const { date } = options;
|
|
286
|
-
const isValidDate = !Number.isNaN(new Date(date).getTime());
|
|
287
|
-
// It isn't a valid date
|
|
288
|
-
if (!isValidDate)
|
|
289
|
-
return null;
|
|
290
|
-
// If it's a Date or date string
|
|
291
|
-
const _date = new Date(date);
|
|
292
|
-
const year = _date.getUTCFullYear();
|
|
293
|
-
const month = String(_date.getUTCMonth() + 1).padStart(2, '0');
|
|
294
|
-
const day = String(_date.getUTCDate()).padStart(2, '0');
|
|
295
|
-
return `${day}/${month}/${year}`;
|
|
296
|
-
}
|
|
297
|
-
function addDaysToISODate(options) {
|
|
298
|
-
const { date, days } = options;
|
|
299
|
-
const isValidDate = !Number.isNaN(new Date(date).getTime());
|
|
300
|
-
// It isn't a valid date
|
|
301
|
-
if (!isValidDate)
|
|
302
|
-
return null;
|
|
303
|
-
// It's a valid date
|
|
304
|
-
const _date = new Date(date);
|
|
305
|
-
_date.setUTCDate(_date.getUTCDate() + days);
|
|
306
|
-
return _date.toISOString().split('T')[0];
|
|
229
|
+
keyup() {
|
|
230
|
+
this.emitClick();
|
|
231
|
+
}
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
233
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: ButtonComponent, isStandalone: true, selector: "gld-button", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, full: { classPropertyName: "full", publicName: "full", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"button button--{{ color() }} button--{{ size() }}\"\n [class.button--disabled]=\"disabled()\"\n [class.button--full]=\"full()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <!-- Icon -->\n @let innerIcon = icon();\n @if (innerIcon) {\n <gld-icon\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [icon]=\"innerIcon\"\n [size]=\"iconSize() ?? size()\"\n [disabled]=\"disabled()\" />\n }\n <!-- Content -->\n <span>\n <ng-content>no content</ng-content>\n </span>\n</button>\n\n<!-- Only used by DropdownMenuComponent -->\n<ng-content select=\"[gldDropdownMenuTemplate]\" />\n", styles: [":host{display:inline-block;height:inherit;max-width:inherit}:host:has(.button--full){width:100%}.button{--gld-color: inherit;--gld-background: transparent;--gld-background--hover: transparent;--gld-padding: var(--gld-spacing--xxs) var(--gld-spacing--xs);--gld-radius: var(--gld-radius--xxs);--gld-font-size: var(--gld-font-size--normal);outline:none;border:0;padding:var(--gld-padding);border-radius:var(--gld-radius);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size);font-weight:600;line-height:1.25;cursor:pointer;width:inherit;color:var(--gld-color);background:var(--gld-background);display:inline-flex;align-items:center;justify-content:center;gap:var(--gld-spacing--xxxs);will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover,.button:focus{--gld-background: var(--gld-background--hover)}.button:active{transform:scale(.95)}.button span{text-transform:capitalize;-webkit-user-select:none;user-select:none}.button--pink{--gld-color: var(--gld-pink);--gld-background: var(--gld-pink-transparent--010);--gld-background--hover: var(--gld-pink-transparent--020)}.button--purple{--gld-color: var(--gld-purple);--gld-background: var(--gld-purple-transparent--010);--gld-background--hover: var(--gld-purple-transparent--020)}.button--mustard{--gld-color: var(--gld-mustard);--gld-background: var(--gld-mustard-transparent--010);--gld-background--hover: var(--gld-mustard-transparent--020)}.button--orange{--gld-color: var(--gld-orange);--gld-background: var(--gld-orange-transparent--010);--gld-background--hover: var(--gld-orange-transparent--020)}.button--blue{--gld-color: var(--gld-blue);--gld-background: var(--gld-blue-transparent--010);--gld-background--hover: var(--gld-blue-transparent--020)}.button--red{--gld-color: var(--gld-red);--gld-background: var(--gld-red-transparent--010);--gld-background--hover: var(--gld-red-transparent--020)}.button--green{--gld-color: var(--gld-green);--gld-background: var(--gld-green-transparent--010);--gld-background--hover: var(--gld-green-transparent--020)}.button--tiny{--gld-font-size: var(--gld-font-size--small);--gld-padding: var(--gld-spacing--xxxs) var(--gld-spacing--xxs)}.button--small{--gld-font-size: var(--gld-font-size--small);--gld-padding: var(--gld-spacing--xxs)}.button--normal{--gld-font-size: var(--gld-font-size--normal);--gld-padding: var(--gld-spacing--xxs) var(--gld-spacing--xs)}.button--medium{--gld-padding: var(--gld-spacing--xs) var(--gld-spacing--m)}.button--large{--gld-font-size: var(--gld-font-size--heading-three);--gld-padding: var(--gld-spacing--xs) var(--gld-spacing--l)}.button--disabled{--gld-color: var(--gld-gray);--gld-background: var(--gld-gray-transparent--020);--gld-background--hover: var(--gld-gray-transparent--020);pointer-events:none;cursor:not-allowed}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gld-icon", inputs: ["icon", "size", "space", "moveTopToBottom", "moveLeftToRight", "disabled"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
307
234
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
236
|
+
type: Component,
|
|
237
|
+
args: [{ selector: 'gld-button', imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"button button--{{ color() }} button--{{ size() }}\"\n [class.button--disabled]=\"disabled()\"\n [class.button--full]=\"full()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <!-- Icon -->\n @let innerIcon = icon();\n @if (innerIcon) {\n <gld-icon\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [icon]=\"innerIcon\"\n [size]=\"iconSize() ?? size()\"\n [disabled]=\"disabled()\" />\n }\n <!-- Content -->\n <span>\n <ng-content>no content</ng-content>\n </span>\n</button>\n\n<!-- Only used by DropdownMenuComponent -->\n<ng-content select=\"[gldDropdownMenuTemplate]\" />\n", styles: [":host{display:inline-block;height:inherit;max-width:inherit}:host:has(.button--full){width:100%}.button{--gld-color: inherit;--gld-background: transparent;--gld-background--hover: transparent;--gld-padding: var(--gld-spacing--xxs) var(--gld-spacing--xs);--gld-radius: var(--gld-radius--xxs);--gld-font-size: var(--gld-font-size--normal);outline:none;border:0;padding:var(--gld-padding);border-radius:var(--gld-radius);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size);font-weight:600;line-height:1.25;cursor:pointer;width:inherit;color:var(--gld-color);background:var(--gld-background);display:inline-flex;align-items:center;justify-content:center;gap:var(--gld-spacing--xxxs);will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover,.button:focus{--gld-background: var(--gld-background--hover)}.button:active{transform:scale(.95)}.button span{text-transform:capitalize;-webkit-user-select:none;user-select:none}.button--pink{--gld-color: var(--gld-pink);--gld-background: var(--gld-pink-transparent--010);--gld-background--hover: var(--gld-pink-transparent--020)}.button--purple{--gld-color: var(--gld-purple);--gld-background: var(--gld-purple-transparent--010);--gld-background--hover: var(--gld-purple-transparent--020)}.button--mustard{--gld-color: var(--gld-mustard);--gld-background: var(--gld-mustard-transparent--010);--gld-background--hover: var(--gld-mustard-transparent--020)}.button--orange{--gld-color: var(--gld-orange);--gld-background: var(--gld-orange-transparent--010);--gld-background--hover: var(--gld-orange-transparent--020)}.button--blue{--gld-color: var(--gld-blue);--gld-background: var(--gld-blue-transparent--010);--gld-background--hover: var(--gld-blue-transparent--020)}.button--red{--gld-color: var(--gld-red);--gld-background: var(--gld-red-transparent--010);--gld-background--hover: var(--gld-red-transparent--020)}.button--green{--gld-color: var(--gld-green);--gld-background: var(--gld-green-transparent--010);--gld-background--hover: var(--gld-green-transparent--020)}.button--tiny{--gld-font-size: var(--gld-font-size--small);--gld-padding: var(--gld-spacing--xxxs) var(--gld-spacing--xxs)}.button--small{--gld-font-size: var(--gld-font-size--small);--gld-padding: var(--gld-spacing--xxs)}.button--normal{--gld-font-size: var(--gld-font-size--normal);--gld-padding: var(--gld-spacing--xxs) var(--gld-spacing--xs)}.button--medium{--gld-padding: var(--gld-spacing--xs) var(--gld-spacing--m)}.button--large{--gld-font-size: var(--gld-font-size--heading-three);--gld-padding: var(--gld-spacing--xs) var(--gld-spacing--l)}.button--disabled{--gld-color: var(--gld-gray);--gld-background: var(--gld-gray-transparent--020);--gld-background--hover: var(--gld-gray-transparent--020);pointer-events:none;cursor:not-allowed}\n"] }]
|
|
238
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], full: [{ type: i0.Input, args: [{ isSignal: true, alias: "full", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
239
|
+
|
|
240
|
+
// Angular Imports
|
|
241
|
+
const components$7 = [IconComponent];
|
|
242
|
+
class DropdownButtonComponent {
|
|
243
|
+
value = input.required({ ...(ngDevMode ? { debugName: "value" } : {}) });
|
|
244
|
+
icon = input(null, { ...(ngDevMode ? { debugName: "icon" } : {}) });
|
|
245
|
+
iconSize = input(IconsSize.normal, { ...(ngDevMode ? { debugName: "iconSize" } : {}) });
|
|
246
|
+
iconSpace = input(IconsSpace.none, { ...(ngDevMode ? { debugName: "iconSpace" } : {}) });
|
|
247
|
+
moveTopToBottom = input(0, { ...(ngDevMode ? { debugName: "moveTopToBottom" } : {}), transform: numberAttribute });
|
|
248
|
+
moveLeftToRight = input(0, { ...(ngDevMode ? { debugName: "moveLeftToRight" } : {}), transform: numberAttribute });
|
|
249
|
+
direction = input(DropdownDirection.left, { ...(ngDevMode ? { debugName: "direction" } : {}) });
|
|
250
|
+
changeValue = output();
|
|
251
|
+
current = signal(null, { ...(ngDevMode ? { debugName: "current" } : {}) });
|
|
252
|
+
disabled = signal(false, { ...(ngDevMode ? { debugName: "disabled" } : {}) });
|
|
253
|
+
error = signal(false, { ...(ngDevMode ? { debugName: "error" } : {}) });
|
|
254
|
+
selected = computed(() => Boolean(this.current() === this.value()), { ...(ngDevMode ? { debugName: "selected" } : {}) });
|
|
255
|
+
buttonChild = viewChild('buttonChild', { ...(ngDevMode ? { debugName: "buttonChild" } : {}), read: ElementRef });
|
|
256
|
+
select(value) {
|
|
257
|
+
this.changeValue.emit(value);
|
|
258
|
+
this.buttonChild()?.nativeElement.blur();
|
|
259
|
+
}
|
|
260
|
+
keyup(value) {
|
|
261
|
+
this.select(value);
|
|
262
|
+
}
|
|
263
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
264
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: DropdownButtonComponent, isStandalone: true, selector: "gld-dropdown-button", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconSpace: { classPropertyName: "iconSpace", publicName: "iconSpace", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValue: "changeValue" }, viewQueries: [{ propertyName: "buttonChild", first: true, predicate: ["buttonChild"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\r\n #buttonChild\r\n [tabindex]=\"disabled() ? '-1' : '0'\"\r\n class=\"button button--direction-{{ direction() }}\"\r\n [class.button--selected]=\"selected()\"\r\n (keyup.enter)=\"keyup(value())\"\r\n (click)=\"select(value())\">\r\n <!-- Icon -->\r\n @let innerIcon = icon();\r\n @if (innerIcon) {\r\n <gld-icon\r\n [moveTopToBottom]=\"moveTopToBottom()\"\r\n [moveLeftToRight]=\"moveLeftToRight()\"\r\n [icon]=\"innerIcon\"\r\n [size]=\"iconSize()\"\r\n [space]=\"iconSpace()\"\r\n [disabled]=\"disabled()\" />\r\n }\r\n <!-- Content -->\r\n <span>\r\n <ng-content> no content </ng-content>\r\n </span>\r\n</button>\r\n", styles: [":host{position:relative;width:100%}.button{--gld-background: transparent;--gld-background--hover: var(--gld-gray-transparent--010);--gld-color: var(--gld-foreground-color);--gld-color--selected: var(--gld-pink);--gld-color--hover: var(--gld-blue);--gld-radius: var(--gld-radius--xxxs);--gld-height: 40px;padding:var(--gld-spacing--xxs) var(--gld-spacing--xs);width:100%;height:var(--gld-height);background:var(--gld-background);color:var(--gld-color);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:var(--gld-line-height);text-align:left;-webkit-user-select:none;user-select:none;outline:none;border:none;border-radius:var(--gld-radius);cursor:pointer;display:inline-flex;align-items:center;gap:var(--gld-spacing--xxs);will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover{--gld-color: var(--gld-color--hover);--gld-background: var(--gld-background--hover)}.button:active{transform:scale(.95)}.button span{text-transform:capitalize;-webkit-user-select:none;user-select:none}.button--direction-left{justify-content:flex-start}.button--direction-right{justify-content:flex-end}.button--selected,.button--selected:hover{--gld-color: var(--gld-color--selected)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gld-icon", inputs: ["icon", "size", "space", "moveTopToBottom", "moveLeftToRight", "disabled"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
318
265
|
}
|
|
266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownButtonComponent, decorators: [{
|
|
267
|
+
type: Component,
|
|
268
|
+
args: [{ selector: 'gld-dropdown-button', imports: [...components$7], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\r\n #buttonChild\r\n [tabindex]=\"disabled() ? '-1' : '0'\"\r\n class=\"button button--direction-{{ direction() }}\"\r\n [class.button--selected]=\"selected()\"\r\n (keyup.enter)=\"keyup(value())\"\r\n (click)=\"select(value())\">\r\n <!-- Icon -->\r\n @let innerIcon = icon();\r\n @if (innerIcon) {\r\n <gld-icon\r\n [moveTopToBottom]=\"moveTopToBottom()\"\r\n [moveLeftToRight]=\"moveLeftToRight()\"\r\n [icon]=\"innerIcon\"\r\n [size]=\"iconSize()\"\r\n [space]=\"iconSpace()\"\r\n [disabled]=\"disabled()\" />\r\n }\r\n <!-- Content -->\r\n <span>\r\n <ng-content> no content </ng-content>\r\n </span>\r\n</button>\r\n", styles: [":host{position:relative;width:100%}.button{--gld-background: transparent;--gld-background--hover: var(--gld-gray-transparent--010);--gld-color: var(--gld-foreground-color);--gld-color--selected: var(--gld-pink);--gld-color--hover: var(--gld-blue);--gld-radius: var(--gld-radius--xxxs);--gld-height: 40px;padding:var(--gld-spacing--xxs) var(--gld-spacing--xs);width:100%;height:var(--gld-height);background:var(--gld-background);color:var(--gld-color);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:var(--gld-line-height);text-align:left;-webkit-user-select:none;user-select:none;outline:none;border:none;border-radius:var(--gld-radius);cursor:pointer;display:inline-flex;align-items:center;gap:var(--gld-spacing--xxs);will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover{--gld-color: var(--gld-color--hover);--gld-background: var(--gld-background--hover)}.button:active{transform:scale(.95)}.button span{text-transform:capitalize;-webkit-user-select:none;user-select:none}.button--direction-left{justify-content:flex-start}.button--direction-right{justify-content:flex-end}.button--selected,.button--selected:hover{--gld-color: var(--gld-color--selected)}\n"] }]
|
|
269
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSpace", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], changeValue: [{ type: i0.Output, args: ["changeValue"] }], buttonChild: [{ type: i0.ViewChild, args: ['buttonChild', { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
319
270
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
271
|
+
// Angular Imports
|
|
272
|
+
class DropdownMenuTemplateDirective {
|
|
273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownMenuTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
274
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.1", type: DropdownMenuTemplateDirective, isStandalone: true, selector: "[gldDropdownMenuTemplate]", ngImport: i0 });
|
|
324
275
|
}
|
|
276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownMenuTemplateDirective, decorators: [{
|
|
277
|
+
type: Directive,
|
|
278
|
+
args: [{
|
|
279
|
+
selector: '[gldDropdownMenuTemplate]',
|
|
280
|
+
}]
|
|
281
|
+
}] });
|
|
325
282
|
|
|
326
|
-
//
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
function isDateValidator() {
|
|
331
|
-
return (control) => {
|
|
332
|
-
// const value = formatDateFromISOToYYYYMMDD(control.value)
|
|
333
|
-
const value = control.value;
|
|
334
|
-
if (!value)
|
|
335
|
-
return null;
|
|
336
|
-
if (!ISO_DATE_REGEX.test(value))
|
|
337
|
-
return {
|
|
338
|
-
isDate: 'This field must be a valid date in the format YYYY-MM-DD!',
|
|
339
|
-
};
|
|
340
|
-
// Verify if the date is valid (additional logic)
|
|
341
|
-
const [year, month, day] = value.split('-').map(Number);
|
|
342
|
-
const date = new Date(year, month - 1, day);
|
|
343
|
-
// Verify if the date is logical and corresponds to the format
|
|
344
|
-
if (date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day)
|
|
345
|
-
return null;
|
|
346
|
-
return { isDate: 'This field must be a valid date!' };
|
|
347
|
-
};
|
|
283
|
+
// Angular Imports
|
|
284
|
+
class InputErrorMessageDirective {
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputErrorMessageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
286
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.1", type: InputErrorMessageDirective, isStandalone: true, selector: "[gldInputErrorMessage]", ngImport: i0 });
|
|
348
287
|
}
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputErrorMessageDirective, decorators: [{
|
|
289
|
+
type: Directive,
|
|
290
|
+
args: [{
|
|
291
|
+
selector: '[gldInputErrorMessage]',
|
|
292
|
+
}]
|
|
293
|
+
}] });
|
|
349
294
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
message: 'Este campo debe contener 11 dígitos!',
|
|
373
|
-
},
|
|
374
|
-
],
|
|
375
|
-
CL: [
|
|
376
|
-
{
|
|
377
|
-
regex: /^\d+$/,
|
|
378
|
-
message: 'Este campo debe contener solo números!',
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
regex: /^.{11}$/,
|
|
382
|
-
message: 'Este campo debe contener 11 dígitos!',
|
|
383
|
-
},
|
|
384
|
-
],
|
|
385
|
-
};
|
|
386
|
-
const patternsToValid = patterns[documentType];
|
|
387
|
-
if (!value)
|
|
388
|
-
return null;
|
|
389
|
-
const pattern = patternsToValid.find((pattern) => !pattern.regex.test(value));
|
|
390
|
-
return pattern ? { isDocument: pattern.message } : null;
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
// Regex para validar emails
|
|
395
|
-
const EMAIL_REGEX = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
|
|
396
|
-
function isEmailValidator() {
|
|
397
|
-
return (control) => {
|
|
398
|
-
const value = control.value;
|
|
399
|
-
if (!value)
|
|
400
|
-
return null;
|
|
401
|
-
if (EMAIL_REGEX.test(value))
|
|
402
|
-
return null;
|
|
403
|
-
return { email: 'This field must be a valid email!' };
|
|
404
|
-
};
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
function isFormSelectItemValidator() {
|
|
408
|
-
return (control) => {
|
|
409
|
-
const value = control.value;
|
|
410
|
-
if (!value)
|
|
411
|
-
return null;
|
|
412
|
-
if (typeof value === 'string')
|
|
413
|
-
return { isFormSelectItem: 'Este campo debe ser una opción valida!' };
|
|
414
|
-
if (typeof value === 'object') {
|
|
415
|
-
if ('value' in value && 'label' in value)
|
|
416
|
-
return null;
|
|
417
|
-
}
|
|
418
|
-
return { isFormSelectItem: 'Este campo debe ser una opción valida!' };
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// Regex para validar números naturales (0, 1, 2, 3, ...)
|
|
423
|
-
const NATURAL_NUMBER_REGEX = /^[0-9]+$/;
|
|
424
|
-
const NATURAL_NUMBER_REGEX_TO_CLEAN = /[^0-9]/g;
|
|
425
|
-
function isNaturalNumberValidator() {
|
|
426
|
-
return (control) => {
|
|
427
|
-
const value = String(control.value).trim();
|
|
428
|
-
if (!value)
|
|
429
|
-
return null;
|
|
430
|
-
if (NATURAL_NUMBER_REGEX.test(value))
|
|
431
|
-
return null;
|
|
432
|
-
return { isNaturalNumber: 'Debes ingresar solo números.' };
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
// Regex para validar string y acepta acentos y espacios
|
|
437
|
-
const STRING_REGEX = /^[a-zA-ZáéíóúÁÉÍÓÚñÑüÜ\s]+$/;
|
|
438
|
-
const STRING_REGEX_TO_CLEAN = /[^a-zA-ZáéíóúÁÉÍÓÚñÑüÜ\s]/g;
|
|
439
|
-
function isStringValidator() {
|
|
440
|
-
return (control) => {
|
|
441
|
-
const value = String(control.value).trim();
|
|
442
|
-
if (!value)
|
|
443
|
-
return null;
|
|
444
|
-
if (STRING_REGEX.test(value))
|
|
445
|
-
return null;
|
|
446
|
-
return { isString: 'Debes ingresar solo caracteres.' };
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
// Shared Imports
|
|
451
|
-
// import { formatDateFromISOToYYYYMMDD } from '@ui/utils'
|
|
452
|
-
function minimumAgeValidator({ minAge }) {
|
|
453
|
-
return (control) => {
|
|
454
|
-
// const value = formatDateFromISOToYYYYMMDD(control.value)
|
|
455
|
-
const value = control.value;
|
|
456
|
-
if (!value)
|
|
457
|
-
return null;
|
|
458
|
-
// Verify if the date is valid (additional logic)
|
|
459
|
-
const [year, month, day] = value.split('-').map(Number);
|
|
460
|
-
const birthDay = new Date(year, month - 1, day);
|
|
461
|
-
// Get the current date and calculate the difference in years
|
|
462
|
-
const today = new Date();
|
|
463
|
-
today.setHours(0, 0, 0, 0);
|
|
464
|
-
const age = today.getFullYear() - birthDay.getFullYear();
|
|
465
|
-
const isMonthPast = today.getMonth() > birthDay.getMonth();
|
|
466
|
-
const isSameMonthDayPast = today.getMonth() === birthDay.getMonth() && today.getDate() >= birthDay.getDate();
|
|
467
|
-
const isValidAge = age > minAge || (age === minAge && (isMonthPast || isSameMonthDayPast));
|
|
468
|
-
// Retornar el error si la edad es menor al mínimo
|
|
469
|
-
return isValidAge ? null : { minimumAge: { requiredAge: minAge, actualAge: age } };
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
function mustMatchValidator({ controlName, mustMatchControlName, errorMessage, }) {
|
|
474
|
-
return (formGroup) => {
|
|
475
|
-
const firstControl = formGroup.get(controlName);
|
|
476
|
-
const mustMatchControl = formGroup.get(mustMatchControlName);
|
|
477
|
-
// Validar que ambos controles existan
|
|
478
|
-
if (!firstControl || !mustMatchControl)
|
|
479
|
-
return null;
|
|
480
|
-
// Verificar si los valores coinciden
|
|
481
|
-
if (firstControl.value && firstControl.value !== mustMatchControl.value) {
|
|
482
|
-
mustMatchControl.setErrors({ ...mustMatchControl.errors, mustMatch: errorMessage ?? true });
|
|
483
|
-
return { mustMatch: errorMessage ?? true };
|
|
484
|
-
}
|
|
485
|
-
return null; // Es válido si no hay errores
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
function mustUnmatchValidator({ controlName, mustUnmatchControlName, errorMessage, }) {
|
|
490
|
-
return (formGroup) => {
|
|
491
|
-
const firstControl = formGroup.get(controlName);
|
|
492
|
-
const mustUnmatchControl = formGroup.get(mustUnmatchControlName);
|
|
493
|
-
// Validar que ambos controles existan
|
|
494
|
-
if (!firstControl || !mustUnmatchControl)
|
|
495
|
-
return null;
|
|
496
|
-
// Verificar si los valores coinciden
|
|
497
|
-
if (firstControl.value && firstControl.value === mustUnmatchControl.value) {
|
|
498
|
-
mustUnmatchControl.setErrors({
|
|
499
|
-
...mustUnmatchControl.errors,
|
|
500
|
-
mustUnmatch: errorMessage ?? true,
|
|
501
|
-
});
|
|
502
|
-
return { mustUnmatch: errorMessage ?? true };
|
|
503
|
-
}
|
|
504
|
-
return null; // Es válido si no hay errores
|
|
505
|
-
};
|
|
295
|
+
// Angular Imports
|
|
296
|
+
class IconButtonComponent {
|
|
297
|
+
icon = input.required({ ...(ngDevMode ? { debugName: "icon" } : {}) });
|
|
298
|
+
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `button-id-${value.trim().split(' ').join('-')}` });
|
|
299
|
+
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `button-name-${value.trim().split(' ').join('-')}` });
|
|
300
|
+
iconSize = input(IconsSize.normal, { ...(ngDevMode ? { debugName: "iconSize" } : {}) });
|
|
301
|
+
space = input(IconsSpace.none, { ...(ngDevMode ? { debugName: "space" } : {}) });
|
|
302
|
+
moveTopToBottom = input(0, { ...(ngDevMode ? { debugName: "moveTopToBottom" } : {}), transform: numberAttribute });
|
|
303
|
+
moveLeftToRight = input(0, { ...(ngDevMode ? { debugName: "moveLeftToRight" } : {}), transform: numberAttribute });
|
|
304
|
+
background = input(false, { ...(ngDevMode ? { debugName: "background" } : {}), transform: booleanAttribute });
|
|
305
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
306
|
+
color = input(ButtonColor.pink, { ...(ngDevMode ? { debugName: "color" } : {}) });
|
|
307
|
+
clicked = output();
|
|
308
|
+
emitClick() {
|
|
309
|
+
if (!this.disabled())
|
|
310
|
+
this.clicked.emit();
|
|
311
|
+
}
|
|
312
|
+
keyup() {
|
|
313
|
+
this.emitClick();
|
|
314
|
+
}
|
|
315
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
316
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: IconButtonComponent, isStandalone: true, selector: "gld-icon-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, space: { classPropertyName: "space", publicName: "space", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"button button--{{ color() }}\"\n [class.button--disabled]=\"disabled()\"\n [class.button--background]=\"background()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <!-- Icon -->\n <gld-icon\n [icon]=\"icon()\"\n [size]=\"iconSize()\"\n [space]=\"space()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [disabled]=\"disabled()\" />\n</button>\n\n<!-- Only used by DropdownMenuComponent -->\n<ng-content select=\"[gldDropdownMenuTemplate]\" />\n", styles: [":host{display:inline-block;max-width:inherit}.button{--gld-color: inherit;--gld-background: transparent;--gld-background--hover: transparent;--gld-radius: var(--gld-radius--xxs);--gld-font-size: var(--gld-font-size--normal);outline:none;border:none;padding:var(--gld-spacing--xxxs);border-radius:var(--gld-radius);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size);font-weight:600;line-height:1.25;cursor:pointer;width:inherit;color:var(--gld-color);background:var(--gld-background);display:inline-flex;align-items:center;justify-content:center;gap:var(--gld-spacing--xxxs);-webkit-user-select:none;user-select:none;will-change:background,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover,.button:focus{background:var(--gld-background--hover)}.button:active{transform:scale(.98)}.button--pink{--gld-color: var(--gld-pink)}.button--pink.button--background{--gld-background: var(--gld-pink-transparent--010);--gld-background--hover: var(--gld-pink-transparent--020)}.button--purple{--gld-color: var(--gld-purple)}.button--purple.button--background{--gld-background: var(--gld-purple-transparent--010);--gld-background--hover: var(--gld-purple-transparent--020)}.button--mustard{--gld-color: var(--gld-mustard)}.button--mustard.button--background{--gld-background: var(--gld-mustard-transparent--010);--gld-background--hover: var(--gld-mustard-transparent--020)}.button--orange{--gld-color: var(--gld-orange)}.button--orange.button--background{--gld-background: var(--gld-orange-transparent--010);--gld-background--hover: var(--gld-orange-transparent--020)}.button--blue{--gld-color: var(--gld-blue)}.button--blue.button--background{--gld-background: var(--gld-blue-transparent--010);--gld-background--hover: var(--gld-blue-transparent--020)}.button--red{--gld-color: var(--gld-red)}.button--red.button--background{--gld-background: var(--gld-red-transparent--010);--gld-background--hover: var(--gld-red-transparent--020)}.button--green{--gld-color: var(--gld-green)}.button--green.button--background{--gld-background: var(--gld-green-transparent--010);--gld-background--hover: var(--gld-green-transparent--020)}.button--disabled{--gld-color: var(--gld-gray-transparent--060);pointer-events:none;cursor:not-allowed}.button--disabled.button--background{--gld-background: var(--gld-gray-transparent--020);--gld-background--hover: var(--gld-gray-transparent--020)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gld-icon", inputs: ["icon", "size", "space", "moveTopToBottom", "moveLeftToRight", "disabled"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
506
317
|
}
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
319
|
+
type: Component,
|
|
320
|
+
args: [{ selector: 'gld-icon-button', imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"button button--{{ color() }}\"\n [class.button--disabled]=\"disabled()\"\n [class.button--background]=\"background()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <!-- Icon -->\n <gld-icon\n [icon]=\"icon()\"\n [size]=\"iconSize()\"\n [space]=\"space()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [disabled]=\"disabled()\" />\n</button>\n\n<!-- Only used by DropdownMenuComponent -->\n<ng-content select=\"[gldDropdownMenuTemplate]\" />\n", styles: [":host{display:inline-block;max-width:inherit}.button{--gld-color: inherit;--gld-background: transparent;--gld-background--hover: transparent;--gld-radius: var(--gld-radius--xxs);--gld-font-size: var(--gld-font-size--normal);outline:none;border:none;padding:var(--gld-spacing--xxxs);border-radius:var(--gld-radius);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size);font-weight:600;line-height:1.25;cursor:pointer;width:inherit;color:var(--gld-color);background:var(--gld-background);display:inline-flex;align-items:center;justify-content:center;gap:var(--gld-spacing--xxxs);-webkit-user-select:none;user-select:none;will-change:background,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover,.button:focus{background:var(--gld-background--hover)}.button:active{transform:scale(.98)}.button--pink{--gld-color: var(--gld-pink)}.button--pink.button--background{--gld-background: var(--gld-pink-transparent--010);--gld-background--hover: var(--gld-pink-transparent--020)}.button--purple{--gld-color: var(--gld-purple)}.button--purple.button--background{--gld-background: var(--gld-purple-transparent--010);--gld-background--hover: var(--gld-purple-transparent--020)}.button--mustard{--gld-color: var(--gld-mustard)}.button--mustard.button--background{--gld-background: var(--gld-mustard-transparent--010);--gld-background--hover: var(--gld-mustard-transparent--020)}.button--orange{--gld-color: var(--gld-orange)}.button--orange.button--background{--gld-background: var(--gld-orange-transparent--010);--gld-background--hover: var(--gld-orange-transparent--020)}.button--blue{--gld-color: var(--gld-blue)}.button--blue.button--background{--gld-background: var(--gld-blue-transparent--010);--gld-background--hover: var(--gld-blue-transparent--020)}.button--red{--gld-color: var(--gld-red)}.button--red.button--background{--gld-background: var(--gld-red-transparent--010);--gld-background--hover: var(--gld-red-transparent--020)}.button--green{--gld-color: var(--gld-green)}.button--green.button--background{--gld-background: var(--gld-green-transparent--010);--gld-background--hover: var(--gld-green-transparent--020)}.button--disabled{--gld-color: var(--gld-gray-transparent--060);pointer-events:none;cursor:not-allowed}.button--disabled.button--background{--gld-background: var(--gld-gray-transparent--020);--gld-background--hover: var(--gld-gray-transparent--020)}\n"] }]
|
|
321
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], space: [{ type: i0.Input, args: [{ isSignal: true, alias: "space", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
507
322
|
|
|
508
323
|
// Angular Imports
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
324
|
+
const components$6 = [ButtonComponent, IconButtonComponent];
|
|
325
|
+
const directives = [DropdownMenuTemplateDirective];
|
|
326
|
+
class DropdownMenuComponent {
|
|
327
|
+
DropdownType = DropdownType;
|
|
328
|
+
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `dropdown-id-${value.trim().split(' ').join('-')}` });
|
|
329
|
+
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `dropdown-name-${value.trim().split(' ').join('-')}` });
|
|
330
|
+
type = input.required({ ...(ngDevMode ? { debugName: "type" } : {}) });
|
|
331
|
+
color = input(ButtonColor.pink, { ...(ngDevMode ? { debugName: "color" } : {}) });
|
|
332
|
+
size = input(ButtonSize.normal, { ...(ngDevMode ? { debugName: "size" } : {}) });
|
|
333
|
+
icon = input(null, { ...(ngDevMode ? { debugName: "icon" } : {}) });
|
|
334
|
+
iconSize = input(undefined, { ...(ngDevMode ? { debugName: "iconSize" } : {}) });
|
|
335
|
+
moveTopToBottom = input(0, { ...(ngDevMode ? { debugName: "moveTopToBottom" } : {}), transform: numberAttribute });
|
|
336
|
+
moveLeftToRight = input(0, { ...(ngDevMode ? { debugName: "moveLeftToRight" } : {}), transform: numberAttribute });
|
|
337
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
338
|
+
full = input(false, { ...(ngDevMode ? { debugName: "full" } : {}), transform: booleanAttribute });
|
|
339
|
+
direction = input(DropdownDirection.right, { ...(ngDevMode ? { debugName: "direction" } : {}) });
|
|
340
|
+
background = input(false, { ...(ngDevMode ? { debugName: "background" } : {}), transform: booleanAttribute });
|
|
341
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : {}), transform: booleanAttribute });
|
|
342
|
+
initialValue = input(null, { ...(ngDevMode ? { debugName: "initialValue" } : {}) });
|
|
343
|
+
changeValue = output();
|
|
344
|
+
changeFocus = output();
|
|
345
|
+
dropdownButtonChildren = contentChildren(DropdownButtonComponent, { ...(ngDevMode ? { debugName: "dropdownButtonChildren" } : {}) });
|
|
346
|
+
constructor() {
|
|
347
|
+
effect(() => {
|
|
348
|
+
const initialValue = this.initialValue();
|
|
349
|
+
if (initialValue)
|
|
350
|
+
this.updateCurrentInChildren(initialValue);
|
|
517
351
|
});
|
|
518
352
|
}
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
const changeLanguageInterceptor = (request, next) => {
|
|
524
|
-
const translocoService = inject(TranslocoService$1);
|
|
525
|
-
let cloneRequest = request;
|
|
526
|
-
if (request.headers.has('Language')) {
|
|
527
|
-
if (request.method.toLowerCase() === 'get') {
|
|
528
|
-
let language = TranslocoLanguageName$1.english;
|
|
529
|
-
switch (translocoService.getLanguage()) {
|
|
530
|
-
case TranslocoLanguageKey$1.english:
|
|
531
|
-
language = TranslocoLanguageName$1.english;
|
|
532
|
-
break;
|
|
533
|
-
case TranslocoLanguageKey$1.spanish:
|
|
534
|
-
language = TranslocoLanguageName$1.spanish;
|
|
535
|
-
break;
|
|
536
|
-
default:
|
|
537
|
-
language = TranslocoLanguageName$1.english;
|
|
538
|
-
break;
|
|
539
|
-
}
|
|
540
|
-
const params = new HttpParams({ fromObject: { language } });
|
|
541
|
-
// const headers = request.headers.set('Language', language)
|
|
542
|
-
const headers = request.headers.delete('Language');
|
|
543
|
-
cloneRequest = request.clone({ headers, params });
|
|
544
|
-
}
|
|
353
|
+
ngAfterContentInit() {
|
|
354
|
+
this.dropdownButtonChildren().map((dropdownButton) => {
|
|
355
|
+
dropdownButton.changeValue.subscribe((value) => this.updateCurrentInChildren(value));
|
|
356
|
+
});
|
|
545
357
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
const accessToken = computed(() => authStore.accessToken(), { ...(ngDevMode ? { debugName: "accessToken" } : {}) });
|
|
554
|
-
const refreshToken = computed(() => authStore.refreshToken(), { ...(ngDevMode ? { debugName: "refreshToken" } : {}) });
|
|
555
|
-
const refreshAccessTokenInProgress = signal(false, { ...(ngDevMode ? { debugName: "refreshAccessTokenInProgress" } : {}) });
|
|
556
|
-
const doSameRequestCallStack = new Subject();
|
|
557
|
-
const handlerRefreshAccessToken = (request, next) => {
|
|
558
|
-
if (refreshAccessTokenInProgress()) {
|
|
559
|
-
return doSameRequestCallStack.pipe(switchMap((newAccessToken) => {
|
|
560
|
-
return next(doSameRequestWithNewAccessToken(request, newAccessToken));
|
|
561
|
-
}));
|
|
562
|
-
}
|
|
563
|
-
refreshAccessTokenInProgress.set(true);
|
|
564
|
-
return authService.refreshAccessToken({ refreshToken: refreshToken() }).pipe(switchMap(() => {
|
|
565
|
-
refreshAccessTokenInProgress.set(false);
|
|
566
|
-
doSameRequestCallStack.next(accessToken());
|
|
567
|
-
return next(doSameRequestWithNewAccessToken(request, accessToken()));
|
|
568
|
-
}));
|
|
569
|
-
};
|
|
570
|
-
const doSameRequestWithNewAccessToken = (request, newAccessToken) => {
|
|
571
|
-
return request.clone({
|
|
572
|
-
headers: request.headers.set('Authorization', `Bearer ${newAccessToken}`),
|
|
358
|
+
updateCurrentInChildren(value) {
|
|
359
|
+
this.dropdownButtonChildren().map((dropdownButton, index) => {
|
|
360
|
+
if (this.selected())
|
|
361
|
+
dropdownButton.current.set(value);
|
|
362
|
+
// Set current one time
|
|
363
|
+
if (index === 0)
|
|
364
|
+
this.changeValue.emit(value);
|
|
573
365
|
});
|
|
574
|
-
};
|
|
575
|
-
return next(request).pipe(catchError((error) => {
|
|
576
|
-
// console.log('error', error)
|
|
577
|
-
if (logged() && request.headers.has('Authorization')) {
|
|
578
|
-
const errorTyped = error;
|
|
579
|
-
if (errorTyped?.status === 401) {
|
|
580
|
-
console.log('Refreshing access token...');
|
|
581
|
-
return handlerRefreshAccessToken(request, next);
|
|
582
|
-
}
|
|
583
|
-
return throwError(() => error);
|
|
584
|
-
}
|
|
585
|
-
else {
|
|
586
|
-
return throwError(() => error);
|
|
587
|
-
}
|
|
588
|
-
}));
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
// Angular Imports
|
|
592
|
-
const isLoggedGuard = () => {
|
|
593
|
-
// console.log('[Guard] isLoggedGuard')
|
|
594
|
-
const router = inject(Router);
|
|
595
|
-
const authStore = inject(AuthStore$1);
|
|
596
|
-
const cookiesService = inject(CookieService);
|
|
597
|
-
// Check if the code is running in the browser
|
|
598
|
-
const isBrowser = typeof window !== 'undefined';
|
|
599
|
-
if (!isBrowser)
|
|
600
|
-
return false;
|
|
601
|
-
const accessToken = cookiesService.get(CookiesKeys$1.accessToken);
|
|
602
|
-
const refreshToken = cookiesService.get(CookiesKeys$1.refreshToken);
|
|
603
|
-
if (accessToken && refreshToken) {
|
|
604
|
-
if (!authStore.logged()) {
|
|
605
|
-
authStore.signin({ accessToken, refreshToken });
|
|
606
|
-
}
|
|
607
|
-
return true;
|
|
608
366
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
if (authStore.logged()) {
|
|
612
|
-
authStore.signout();
|
|
613
|
-
}
|
|
614
|
-
router.navigate(['/signin']);
|
|
615
|
-
return false;
|
|
367
|
+
updateErrorInChildren(error) {
|
|
368
|
+
this.dropdownButtonChildren().map((dropdownButton) => dropdownButton.error.set(error));
|
|
616
369
|
}
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
// Angular Imports
|
|
620
|
-
class DropdownMenuTemplateDirective {
|
|
621
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownMenuTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
622
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.1", type: DropdownMenuTemplateDirective, isStandalone: true, selector: "[gldDropdownMenuTemplate]", ngImport: i0 });
|
|
623
|
-
}
|
|
624
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownMenuTemplateDirective, decorators: [{
|
|
625
|
-
type: Directive,
|
|
626
|
-
args: [{
|
|
627
|
-
selector: '[gldDropdownMenuTemplate]',
|
|
628
|
-
}]
|
|
629
|
-
}] });
|
|
630
|
-
|
|
631
|
-
// Angular Imports
|
|
632
|
-
class InputErrorMessageDirective {
|
|
633
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputErrorMessageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
634
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.1", type: InputErrorMessageDirective, isStandalone: true, selector: "[gldInputErrorMessage]", ngImport: i0 });
|
|
370
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
371
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: DropdownMenuComponent, isStandalone: true, selector: "gld-dropdown-menu", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, full: { classPropertyName: "full", publicName: "full", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValue: "changeValue", changeFocus: "changeFocus" }, queries: [{ propertyName: "dropdownButtonChildren", predicate: DropdownButtonComponent, isSignal: true }], ngImport: i0, template: "<!-- Button -->\n@if (type() === DropdownType.button) {\n <gld-button\n #buttonChild\n [id]=\"id()\"\n [name]=\"name()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [icon]=\"icon()\"\n [iconSize]=\"iconSize()\"\n [disabled]=\"disabled()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [full]=\"full()\">\n <ng-content />\n\n <ng-container gldDropdownMenuTemplate [ngTemplateOutlet]=\"dropdownMenu\" />\n </gld-button>\n} @else {\n <!-- Icon Button -->\n @let innerIcon = icon();\n @if (innerIcon) {\n <gld-icon-button\n #buttonChild\n [id]=\"id()\"\n [name]=\"name()\"\n [color]=\"color()\"\n [icon]=\"innerIcon\"\n [iconSize]=\"iconSize() ?? size()\"\n [disabled]=\"disabled()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [background]=\"background()\">\n <ng-container gldDropdownMenuTemplate [ngTemplateOutlet]=\"dropdownMenu\" />\n </gld-icon-button>\n }\n}\n\n<ng-template #dropdownMenu>\n <!-- Menu -->\n <section\n class=\"dropdown-menu dropdown-menu--{{ type() }} dropdown-menu--{{ size() }}\n dropdown-menu--direction-{{ direction() }}\">\n <ng-content select=\"gld-dropdown-button\">no buttons</ng-content>\n </section>\n</ng-template>\n", styles: [":host{max-width:inherit}.dropdown-menu{--gld-background: light-dark(var(--gld-whitelight), var(--gld-darkblue));--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-radius: var(--gld-radius--xxs);--gld-dropdown-min-width: 100px;--gld-dropdown-bottom-position: 0;padding:var(--gld-spacing--xxxs);border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);background:var(--gld-background);display:none;position:absolute;scale:0;z-index:1;min-width:var(--gld-dropdown-min-width);max-width:inherit}.dropdown-menu--direction-right{left:0;transform-origin:top left;transform:translateY(var(--gld-dropdown-bottom-position))}.dropdown-menu--direction-left{transform-origin:top right;transform:translate(-100%,var(--gld-dropdown-bottom-position))}.dropdown-menu--tiny{--gld-dropdown-bottom-position: 26px}.dropdown-menu--small{--gld-dropdown-bottom-position: 34px}.dropdown-menu--normal{--gld-dropdown-bottom-position: 39px}.dropdown-menu--normal.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 42px}.dropdown-menu--medium{--gld-dropdown-bottom-position: 47px}.dropdown-menu--medium.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 50px}.dropdown-menu--large{--gld-dropdown-bottom-position: 52px}.dropdown-menu--large.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 58px}gld-button:focus-within .dropdown-menu,gld-icon-button:focus-within .dropdown-menu{display:initial;scale:1;z-index:1}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ButtonComponent, selector: "gld-button", inputs: ["id", "name", "color", "size", "icon", "iconSize", "moveTopToBottom", "moveLeftToRight", "disabled", "full"], outputs: ["clicked"] }, { kind: "component", type: IconButtonComponent, selector: "gld-icon-button", inputs: ["icon", "id", "name", "iconSize", "space", "moveTopToBottom", "moveLeftToRight", "background", "disabled", "color"], outputs: ["clicked"] }, { kind: "directive", type: DropdownMenuTemplateDirective, selector: "[gldDropdownMenuTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
635
372
|
}
|
|
636
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
637
|
-
type:
|
|
638
|
-
args: [{
|
|
639
|
-
|
|
640
|
-
}]
|
|
641
|
-
}] });
|
|
642
|
-
|
|
643
|
-
// Store Imports
|
|
644
|
-
const initialAuthState = {
|
|
645
|
-
logged: false,
|
|
646
|
-
accessToken: '',
|
|
647
|
-
refreshToken: '',
|
|
648
|
-
};
|
|
649
|
-
const AuthStore = signalStore(withState(initialAuthState), withMethods((store, cookiesService = inject(CookieService)) => ({
|
|
650
|
-
signin: (parameters) => {
|
|
651
|
-
const { accessToken, refreshToken, saveCookie = true } = parameters;
|
|
652
|
-
if (saveCookie) {
|
|
653
|
-
cookiesService.set(CookiesKeys$1.accessToken, accessToken);
|
|
654
|
-
cookiesService.set(CookiesKeys$1.refreshToken, refreshToken);
|
|
655
|
-
}
|
|
656
|
-
patchState(store, (previous) => ({
|
|
657
|
-
...previous,
|
|
658
|
-
logged: true,
|
|
659
|
-
accessToken,
|
|
660
|
-
refreshToken,
|
|
661
|
-
}));
|
|
662
|
-
},
|
|
663
|
-
signout: () => {
|
|
664
|
-
cookiesService.delete(CookiesKeys$1.accessToken);
|
|
665
|
-
cookiesService.delete(CookiesKeys$1.refreshToken);
|
|
666
|
-
patchState(store, (previous) => ({
|
|
667
|
-
...previous,
|
|
668
|
-
logged: false,
|
|
669
|
-
accessToken: '',
|
|
670
|
-
refreshToken: '',
|
|
671
|
-
}));
|
|
672
|
-
},
|
|
673
|
-
})));
|
|
373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownMenuComponent, decorators: [{
|
|
374
|
+
type: Component,
|
|
375
|
+
args: [{ selector: 'gld-dropdown-menu', imports: [NgTemplateOutlet, ...components$6, directives], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Button -->\n@if (type() === DropdownType.button) {\n <gld-button\n #buttonChild\n [id]=\"id()\"\n [name]=\"name()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [icon]=\"icon()\"\n [iconSize]=\"iconSize()\"\n [disabled]=\"disabled()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [full]=\"full()\">\n <ng-content />\n\n <ng-container gldDropdownMenuTemplate [ngTemplateOutlet]=\"dropdownMenu\" />\n </gld-button>\n} @else {\n <!-- Icon Button -->\n @let innerIcon = icon();\n @if (innerIcon) {\n <gld-icon-button\n #buttonChild\n [id]=\"id()\"\n [name]=\"name()\"\n [color]=\"color()\"\n [icon]=\"innerIcon\"\n [iconSize]=\"iconSize() ?? size()\"\n [disabled]=\"disabled()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [background]=\"background()\">\n <ng-container gldDropdownMenuTemplate [ngTemplateOutlet]=\"dropdownMenu\" />\n </gld-icon-button>\n }\n}\n\n<ng-template #dropdownMenu>\n <!-- Menu -->\n <section\n class=\"dropdown-menu dropdown-menu--{{ type() }} dropdown-menu--{{ size() }}\n dropdown-menu--direction-{{ direction() }}\">\n <ng-content select=\"gld-dropdown-button\">no buttons</ng-content>\n </section>\n</ng-template>\n", styles: [":host{max-width:inherit}.dropdown-menu{--gld-background: light-dark(var(--gld-whitelight), var(--gld-darkblue));--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-radius: var(--gld-radius--xxs);--gld-dropdown-min-width: 100px;--gld-dropdown-bottom-position: 0;padding:var(--gld-spacing--xxxs);border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);background:var(--gld-background);display:none;position:absolute;scale:0;z-index:1;min-width:var(--gld-dropdown-min-width);max-width:inherit}.dropdown-menu--direction-right{left:0;transform-origin:top left;transform:translateY(var(--gld-dropdown-bottom-position))}.dropdown-menu--direction-left{transform-origin:top right;transform:translate(-100%,var(--gld-dropdown-bottom-position))}.dropdown-menu--tiny{--gld-dropdown-bottom-position: 26px}.dropdown-menu--small{--gld-dropdown-bottom-position: 34px}.dropdown-menu--normal{--gld-dropdown-bottom-position: 39px}.dropdown-menu--normal.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 42px}.dropdown-menu--medium{--gld-dropdown-bottom-position: 47px}.dropdown-menu--medium.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 50px}.dropdown-menu--large{--gld-dropdown-bottom-position: 52px}.dropdown-menu--large.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 58px}gld-button:focus-within .dropdown-menu,gld-icon-button:focus-within .dropdown-menu{display:initial;scale:1;z-index:1}\n"] }]
|
|
376
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], full: [{ type: i0.Input, args: [{ isSignal: true, alias: "full", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValue", required: false }] }], changeValue: [{ type: i0.Output, args: ["changeValue"] }], changeFocus: [{ type: i0.Output, args: ["changeFocus"] }], dropdownButtonChildren: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => DropdownButtonComponent), { isSignal: true }] }] } });
|
|
674
377
|
|
|
675
378
|
// Angular Imports
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
};
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
},
|
|
694
|
-
}
|
|
379
|
+
class LinkComponent {
|
|
380
|
+
LinkType = LinkType;
|
|
381
|
+
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `input-id-${value.trim().split(' ').join('-')}` });
|
|
382
|
+
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `input-name-${value.trim().split(' ').join('-')}` });
|
|
383
|
+
redirect = input('', { ...(ngDevMode ? { debugName: "redirect" } : {}) });
|
|
384
|
+
active = input(false, { ...(ngDevMode ? { debugName: "active" } : {}), transform: booleanAttribute });
|
|
385
|
+
external = input(false, { ...(ngDevMode ? { debugName: "external" } : {}), transform: booleanAttribute });
|
|
386
|
+
type = input(LinkType.default, { ...(ngDevMode ? { debugName: "type" } : {}) });
|
|
387
|
+
align = input(LinkAlign.center, { ...(ngDevMode ? { debugName: "align" } : {}) });
|
|
388
|
+
clicked = output();
|
|
389
|
+
emitClick() {
|
|
390
|
+
this.clicked.emit();
|
|
391
|
+
}
|
|
392
|
+
keyup() {
|
|
393
|
+
this.emitClick();
|
|
394
|
+
}
|
|
395
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: LinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
396
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: LinkComponent, isStandalone: true, selector: "gld-link", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, redirect: { classPropertyName: "redirect", publicName: "redirect", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, external: { classPropertyName: "external", publicName: "external", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "@if (external()) {\n <!-- It's external link -->\n <ng-container\n [ngTemplateOutlet]=\"buttonTemplate\"\n [ngTemplateOutletContext]=\"{ buttonType: 'anchor' }\" />\n} @else {\n <!-- It isn't external link -->\n <ng-container\n [ngTemplateOutlet]=\"buttonTemplate\"\n [ngTemplateOutletContext]=\"{ buttonType: 'button' }\" />\n}\n\n<!-- Button Template -->\n<ng-template #buttonTemplate let-buttonType=\"buttonType\">\n @switch (buttonType) {\n @case ('anchor') {\n <a\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n [href]=\"redirect()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\"\n target=\"_blank\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </a>\n }\n @case ('button') {\n @if (redirect()) {\n <!-- It has path to redirect -->\n <button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\"\n [routerLink]=\"redirect()\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </button>\n } @else {\n <!-- It doesn't have path to redirect -->\n <button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </button>\n }\n }\n }\n</ng-template>\n\n<!-- Content Button Template -->\n<ng-template #contentButtonTemplate>\n <ng-content />\n</ng-template>\n", styles: [":host{position:relative;z-index:1}.link{--gld-color: var(--gld-foreground-color);position:relative;display:inline-flex;align-items:center;padding:0;font:600 var(--gld-font-size--normal)/var(--gld-line-height) var(--gld-font--poppins);color:var(--gld-color);background:none;border:none;cursor:pointer;text-decoration:underline;will-change:color;transition:color var(--gld-animation-time--150)}.link--active,.link:active,.link:hover{--gld-color: var(--gld-purple)}.link--left{text-align:left}.link--right{text-align:right}.link--center{text-align:center}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
397
|
+
}
|
|
398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: LinkComponent, decorators: [{
|
|
399
|
+
type: Component,
|
|
400
|
+
args: [{ selector: 'gld-link', standalone: true, imports: [NgTemplateOutlet, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (external()) {\n <!-- It's external link -->\n <ng-container\n [ngTemplateOutlet]=\"buttonTemplate\"\n [ngTemplateOutletContext]=\"{ buttonType: 'anchor' }\" />\n} @else {\n <!-- It isn't external link -->\n <ng-container\n [ngTemplateOutlet]=\"buttonTemplate\"\n [ngTemplateOutletContext]=\"{ buttonType: 'button' }\" />\n}\n\n<!-- Button Template -->\n<ng-template #buttonTemplate let-buttonType=\"buttonType\">\n @switch (buttonType) {\n @case ('anchor') {\n <a\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n [href]=\"redirect()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\"\n target=\"_blank\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </a>\n }\n @case ('button') {\n @if (redirect()) {\n <!-- It has path to redirect -->\n <button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\"\n [routerLink]=\"redirect()\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </button>\n } @else {\n <!-- It doesn't have path to redirect -->\n <button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </button>\n }\n }\n }\n</ng-template>\n\n<!-- Content Button Template -->\n<ng-template #contentButtonTemplate>\n <ng-content />\n</ng-template>\n", styles: [":host{position:relative;z-index:1}.link{--gld-color: var(--gld-foreground-color);position:relative;display:inline-flex;align-items:center;padding:0;font:600 var(--gld-font-size--normal)/var(--gld-line-height) var(--gld-font--poppins);color:var(--gld-color);background:none;border:none;cursor:pointer;text-decoration:underline;will-change:color;transition:color var(--gld-animation-time--150)}.link--active,.link:active,.link:hover{--gld-color: var(--gld-purple)}.link--left{text-align:left}.link--right{text-align:right}.link--center{text-align:center}\n"] }]
|
|
401
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], redirect: [{ type: i0.Input, args: [{ isSignal: true, alias: "redirect", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], external: [{ type: i0.Input, args: [{ isSignal: true, alias: "external", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
695
402
|
|
|
696
403
|
// Angular Imports
|
|
697
|
-
|
|
404
|
+
class ToggleButtonComponent {
|
|
405
|
+
value = input.required({ ...(ngDevMode ? { debugName: "value" } : {}) });
|
|
406
|
+
changeValue = output();
|
|
407
|
+
current = signal(null, { ...(ngDevMode ? { debugName: "current" } : {}) });
|
|
408
|
+
disabled = signal(false, { ...(ngDevMode ? { debugName: "disabled" } : {}) });
|
|
409
|
+
error = signal(false, { ...(ngDevMode ? { debugName: "error" } : {}) });
|
|
410
|
+
selected = computed(() => Boolean(this.current() === this.value()), { ...(ngDevMode ? { debugName: "selected" } : {}) });
|
|
411
|
+
select(value) {
|
|
412
|
+
this.changeValue.emit(value);
|
|
413
|
+
}
|
|
414
|
+
keyup(value) {
|
|
415
|
+
this.select(value);
|
|
416
|
+
}
|
|
417
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ToggleButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
418
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: ToggleButtonComponent, isStandalone: true, selector: "gld-toggle-button", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { changeValue: "changeValue" }, ngImport: i0, template: "<button\r\n [tabindex]=\"disabled() ? '-1' : '0'\"\r\n class=\"button\"\r\n [class.button--selected]=\"selected()\"\r\n (keyup.enter)=\"keyup(value())\"\r\n (click)=\"select(value())\">\r\n <ng-content> empty button </ng-content>\r\n</button>\r\n", styles: [".button{--gld-background: transparent;--gld-background--hover: var(--gld-pink-transparent--010);--gld-color: var(--gld-foreground-color);--gld-color--selected: var(--gld-pink);--gld-color--hover: var(--gld-blue);--gld-radius: var(--gld-radius--xxxs);padding:var(--gld-spacing--xxxs);width:100%;height:100%;max-width:100%;background:var(--gld-background);color:var(--gld-color);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:var(--gld-line-height);-webkit-user-select:none;user-select:none;outline:none;border:none;border-radius:var(--gld-radius);cursor:pointer;will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover{--gld-color: var(--gld-color--hover)}.button:active{transform:scale(.95)}.button--selected{--gld-background: var(--gld-background--hover);--gld-color: var(--gld-color--selected)}.button--selected:hover{--gld-color: var(--gld-color--selected)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
419
|
+
}
|
|
420
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ToggleButtonComponent, decorators: [{
|
|
421
|
+
type: Component,
|
|
422
|
+
args: [{ selector: 'gld-toggle-button', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\r\n [tabindex]=\"disabled() ? '-1' : '0'\"\r\n class=\"button\"\r\n [class.button--selected]=\"selected()\"\r\n (keyup.enter)=\"keyup(value())\"\r\n (click)=\"select(value())\">\r\n <ng-content> empty button </ng-content>\r\n</button>\r\n", styles: [".button{--gld-background: transparent;--gld-background--hover: var(--gld-pink-transparent--010);--gld-color: var(--gld-foreground-color);--gld-color--selected: var(--gld-pink);--gld-color--hover: var(--gld-blue);--gld-radius: var(--gld-radius--xxxs);padding:var(--gld-spacing--xxxs);width:100%;height:100%;max-width:100%;background:var(--gld-background);color:var(--gld-color);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:var(--gld-line-height);-webkit-user-select:none;user-select:none;outline:none;border:none;border-radius:var(--gld-radius);cursor:pointer;will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover{--gld-color: var(--gld-color--hover)}.button:active{transform:scale(.95)}.button--selected{--gld-background: var(--gld-background--hover);--gld-color: var(--gld-color--selected)}.button--selected:hover{--gld-color: var(--gld-color--selected)}\n"] }]
|
|
423
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], changeValue: [{ type: i0.Output, args: ["changeValue"] }] } });
|
|
698
424
|
|
|
699
425
|
// Angular Imports
|
|
700
|
-
class
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
};
|
|
713
|
-
return this.http.post(url, payload).pipe(map((response) => {
|
|
714
|
-
if (response && response.accessToken && response.refreshToken) {
|
|
715
|
-
this.authStore.signin({
|
|
716
|
-
accessToken: response.accessToken,
|
|
717
|
-
refreshToken: response.refreshToken,
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
else {
|
|
721
|
-
throw new Error('An unexpected error occurred when we were trying to hit this api - signin');
|
|
722
|
-
}
|
|
723
|
-
}));
|
|
426
|
+
class ToggleGroupComponent {
|
|
427
|
+
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `toggle-id-${value.trim().split(' ').join('-')}` });
|
|
428
|
+
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `toggle-name-${value.trim().split(' ').join('-')}` });
|
|
429
|
+
initialValue = input(null, { ...(ngDevMode ? { debugName: "initialValue" } : {}) });
|
|
430
|
+
changeValue = output();
|
|
431
|
+
changeFocus = output();
|
|
432
|
+
toggleButtonChildren = contentChildren(ToggleButtonComponent, { ...(ngDevMode ? { debugName: "toggleButtonChildren" } : {}) });
|
|
433
|
+
constructor() {
|
|
434
|
+
effect(() => {
|
|
435
|
+
const initialValue = this.initialValue();
|
|
436
|
+
if (initialValue)
|
|
437
|
+
this.updateCurrentInChildren(initialValue);
|
|
438
|
+
});
|
|
724
439
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
refreshToken,
|
|
730
|
-
};
|
|
731
|
-
return this.http.post(url, payload).pipe(catchError((error) => {
|
|
732
|
-
if (error &&
|
|
733
|
-
error.error &&
|
|
734
|
-
error.error.statusCode === 401 &&
|
|
735
|
-
error.error.message === 'jwt expired') {
|
|
736
|
-
// console.log('logout')
|
|
737
|
-
this.authStore.signout();
|
|
738
|
-
this.router.navigate(['/signin']);
|
|
739
|
-
return throwError(() => new Error('Session expired. Please log in again.'));
|
|
740
|
-
}
|
|
741
|
-
return throwError(() => error);
|
|
742
|
-
}), map((response) => {
|
|
743
|
-
if (response && response.accessToken && response.refreshToken) {
|
|
744
|
-
this.authStore.signin({
|
|
745
|
-
accessToken: response.accessToken,
|
|
746
|
-
refreshToken: response.refreshToken,
|
|
747
|
-
saveCookie: false,
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
else {
|
|
751
|
-
this.authStore.signout();
|
|
752
|
-
this.router.navigate(['/signin']);
|
|
753
|
-
throw new Error('An unexpected error occurred when we were trying to hit this api - refreshAccessToken');
|
|
754
|
-
}
|
|
755
|
-
}));
|
|
440
|
+
ngAfterContentInit() {
|
|
441
|
+
this.toggleButtonChildren().map((toggleButton) => {
|
|
442
|
+
toggleButton.changeValue.subscribe((value) => this.updateCurrentInChildren(value));
|
|
443
|
+
});
|
|
756
444
|
}
|
|
757
|
-
|
|
758
|
-
|
|
445
|
+
updateCurrentInChildren(value) {
|
|
446
|
+
this.toggleButtonChildren().map((toggleButton, index) => {
|
|
447
|
+
toggleButton.current.set(value);
|
|
448
|
+
// Set current one time
|
|
449
|
+
if (index === 0)
|
|
450
|
+
this.changeValue.emit(value);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
updateErrorInChildren(error) {
|
|
454
|
+
this.toggleButtonChildren().map((toggleButton) => toggleButton.error.set(error));
|
|
455
|
+
}
|
|
456
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ToggleGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
457
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.1", type: ToggleGroupComponent, isStandalone: true, selector: "gld-toggle-group", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValue: "changeValue", changeFocus: "changeFocus" }, queries: [{ propertyName: "toggleButtonChildren", predicate: ToggleButtonComponent, isSignal: true }], ngImport: i0, template: "<section class=\"toggle\" id=\"{{ id() }}\" [attr.name]=\"name()\">\n <ng-content select=\"gld-toggle-button\" />\n</section>\n", styles: [":host{display:inline-block}.toggle{--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-radius: var(--gld-radius--xxs);padding:2px;border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);display:flex}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
759
458
|
}
|
|
760
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
761
|
-
type:
|
|
762
|
-
|
|
459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ToggleGroupComponent, decorators: [{
|
|
460
|
+
type: Component,
|
|
461
|
+
args: [{ selector: 'gld-toggle-group', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section class=\"toggle\" id=\"{{ id() }}\" [attr.name]=\"name()\">\n <ng-content select=\"gld-toggle-button\" />\n</section>\n", styles: [":host{display:inline-block}.toggle{--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-radius: var(--gld-radius--xxs);padding:2px;border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);display:flex}\n"] }]
|
|
462
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValue", required: false }] }], changeValue: [{ type: i0.Output, args: ["changeValue"] }], changeFocus: [{ type: i0.Output, args: ["changeFocus"] }], toggleButtonChildren: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ToggleButtonComponent), { isSignal: true }] }] } });
|
|
763
463
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
464
|
+
function updateValueWithMask({ mask, value }) {
|
|
465
|
+
if (!value)
|
|
466
|
+
return value;
|
|
467
|
+
if (!value.length)
|
|
468
|
+
return value;
|
|
469
|
+
let accumulate = 0;
|
|
470
|
+
const maskApplied = [];
|
|
471
|
+
value.split('').map((character, index) => {
|
|
472
|
+
const placeholder = mask.split('')[index + accumulate];
|
|
473
|
+
if (placeholder === '0' || character === placeholder)
|
|
474
|
+
maskApplied.push(character);
|
|
475
|
+
else {
|
|
476
|
+
maskApplied.push(placeholder);
|
|
477
|
+
maskApplied.push(character);
|
|
478
|
+
accumulate += 1;
|
|
771
479
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: CustomPreloadingStrategyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
775
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: CustomPreloadingStrategyService, providedIn: 'root' });
|
|
480
|
+
});
|
|
481
|
+
return maskApplied.join('');
|
|
776
482
|
}
|
|
777
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: CustomPreloadingStrategyService, decorators: [{
|
|
778
|
-
type: Injectable,
|
|
779
|
-
args: [{ providedIn: 'root' }]
|
|
780
|
-
}] });
|
|
781
483
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
484
|
+
const YEAR_LENGTH = 4;
|
|
485
|
+
const MIN_MONTH = 1;
|
|
486
|
+
const MAX_MONTH = 12;
|
|
487
|
+
const MIN_DAY = 1;
|
|
488
|
+
const MAX_DAY = 31;
|
|
489
|
+
function formatDateToISODate(options) {
|
|
490
|
+
const { date } = options;
|
|
491
|
+
const isValidDate = !Number.isNaN(new Date(date).getTime());
|
|
492
|
+
// It isn't a valid date
|
|
493
|
+
if (!isValidDate)
|
|
494
|
+
return null;
|
|
495
|
+
// If it's a numeric string (timestamp in seconds)
|
|
496
|
+
if (typeof date === 'string' && /^\d+$/.test(date)) {
|
|
497
|
+
// If it has 10 digits, it's a timestamp in seconds
|
|
498
|
+
if (date.length === 10) {
|
|
499
|
+
const ms = Number.parseInt(date, 10) * 1000;
|
|
500
|
+
const _date = new Date(ms);
|
|
501
|
+
if (!Number.isNaN(_date.getTime()))
|
|
502
|
+
return _date.toISOString().split('T')[0];
|
|
503
|
+
else
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
// If it has 13 digits, it's a timestamp in milliseconds
|
|
507
|
+
if (date.length === 13 || date.length === 12) {
|
|
508
|
+
const ms = Number.parseInt(date, 10);
|
|
509
|
+
const _date = new Date(ms);
|
|
510
|
+
if (!Number.isNaN(_date.getTime()))
|
|
511
|
+
return _date.toISOString().split('T')[0];
|
|
512
|
+
else
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
790
515
|
}
|
|
791
|
-
|
|
792
|
-
|
|
516
|
+
// If it's a Date or date string
|
|
517
|
+
const _date = new Date(date);
|
|
518
|
+
return _date.toISOString().split('T')[0];
|
|
519
|
+
}
|
|
520
|
+
function formatISODateToDate(options) {
|
|
521
|
+
const { date } = options;
|
|
522
|
+
const isValidDate = !Number.isNaN(new Date(date).getTime());
|
|
523
|
+
// It isn't a valid date
|
|
524
|
+
if (!isValidDate)
|
|
525
|
+
return null;
|
|
526
|
+
// If it's a Date or date string
|
|
527
|
+
const [year, month, day] = date.split('-').map(Number);
|
|
528
|
+
const _date = new Date(year, month - 1, day);
|
|
529
|
+
// Hora local, pero sin problemas de zona horaria
|
|
530
|
+
return _date;
|
|
531
|
+
}
|
|
532
|
+
function formatDDMMYYYYToISODate(options) {
|
|
533
|
+
const { date } = options;
|
|
534
|
+
// It isn't a valid date
|
|
535
|
+
if (!date)
|
|
536
|
+
return null;
|
|
537
|
+
const [day, month, year] = date.split('/').map(Number);
|
|
538
|
+
// It isn't a valid date
|
|
539
|
+
if (!day ||
|
|
540
|
+
day < MIN_DAY ||
|
|
541
|
+
day > MAX_DAY ||
|
|
542
|
+
!month ||
|
|
543
|
+
month < MIN_MONTH ||
|
|
544
|
+
month > MAX_MONTH ||
|
|
545
|
+
!year ||
|
|
546
|
+
String(year).length < YEAR_LENGTH)
|
|
547
|
+
return null;
|
|
548
|
+
// Create the date and subtract 1 so that JavaScript interprets the month correctly
|
|
549
|
+
const _date = new Date(Date.UTC(year, month - 1, day));
|
|
550
|
+
// It isn't a valid date
|
|
551
|
+
const isValidDate = !Number.isNaN(_date.getTime());
|
|
552
|
+
if (!isValidDate)
|
|
553
|
+
return null;
|
|
554
|
+
return formatDateToISODate({ date: _date });
|
|
555
|
+
}
|
|
556
|
+
function formatISODateToDDMMYYYY(options) {
|
|
557
|
+
const { date } = options;
|
|
558
|
+
const isValidDate = !Number.isNaN(new Date(date).getTime());
|
|
559
|
+
// It isn't a valid date
|
|
560
|
+
if (!isValidDate)
|
|
561
|
+
return null;
|
|
562
|
+
// If it's a Date or date string
|
|
563
|
+
const _date = new Date(date);
|
|
564
|
+
const year = _date.getUTCFullYear();
|
|
565
|
+
const month = String(_date.getUTCMonth() + 1).padStart(2, '0');
|
|
566
|
+
const day = String(_date.getUTCDate()).padStart(2, '0');
|
|
567
|
+
return `${day}/${month}/${year}`;
|
|
568
|
+
}
|
|
569
|
+
function addDaysToISODate(options) {
|
|
570
|
+
const { date, days } = options;
|
|
571
|
+
const isValidDate = !Number.isNaN(new Date(date).getTime());
|
|
572
|
+
// It isn't a valid date
|
|
573
|
+
if (!isValidDate)
|
|
574
|
+
return null;
|
|
575
|
+
// It's a valid date
|
|
576
|
+
const _date = new Date(date);
|
|
577
|
+
_date.setUTCDate(_date.getUTCDate() + days);
|
|
578
|
+
return _date.toISOString().split('T')[0];
|
|
793
579
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
getLanguage() {
|
|
805
|
-
return this.translocoService.getActiveLang();
|
|
806
|
-
}
|
|
807
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
808
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoService });
|
|
580
|
+
function addYearsToISODate(options) {
|
|
581
|
+
const { date, years } = options;
|
|
582
|
+
const isValidDate = !Number.isNaN(new Date(date).getTime());
|
|
583
|
+
// It isn't a valid date
|
|
584
|
+
if (!isValidDate)
|
|
585
|
+
return null;
|
|
586
|
+
// It's a valid date
|
|
587
|
+
const _date = new Date(date);
|
|
588
|
+
_date.setUTCFullYear(_date.getUTCFullYear() + years);
|
|
589
|
+
return _date.toISOString().split('T')[0];
|
|
809
590
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
getTranslation(lang) {
|
|
816
|
-
return this.httpClient.get(`assets/i18n/${lang}.json`);
|
|
817
|
-
}
|
|
818
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoHttpLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
819
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoHttpLoader });
|
|
591
|
+
|
|
592
|
+
function capitalizeFirstLetter(value) {
|
|
593
|
+
if (!value)
|
|
594
|
+
return value; // Catch when the value is empty
|
|
595
|
+
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
820
596
|
}
|
|
821
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoHttpLoader, decorators: [{
|
|
822
|
-
type: Injectable
|
|
823
|
-
}] });
|
|
824
597
|
|
|
825
|
-
//
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
if (
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
598
|
+
// import { formatDateFromISOToYYYYMMDD } from '../../utils'
|
|
599
|
+
// Regex to validate the ISO date format (YYYY-MM-DD)
|
|
600
|
+
const ISO_DATE_REGEX = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/;
|
|
601
|
+
function isDateValidator() {
|
|
602
|
+
return (control) => {
|
|
603
|
+
// const value = formatDateFromISOToYYYYMMDD(control.value)
|
|
604
|
+
const value = control.value;
|
|
605
|
+
if (!value)
|
|
606
|
+
return null;
|
|
607
|
+
if (!ISO_DATE_REGEX.test(value))
|
|
608
|
+
return {
|
|
609
|
+
isDate: 'This field must be a valid date in the format YYYY-MM-DD!',
|
|
610
|
+
};
|
|
611
|
+
// Verify if the date is valid (additional logic)
|
|
612
|
+
const [year, month, day] = value.split('-').map(Number);
|
|
613
|
+
const date = new Date(year, month - 1, day);
|
|
614
|
+
// Verify if the date is logical and corresponds to the format
|
|
615
|
+
if (date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day)
|
|
616
|
+
return null;
|
|
617
|
+
return { isDate: 'This field must be a valid date!' };
|
|
618
|
+
};
|
|
843
619
|
}
|
|
844
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: UiService, decorators: [{
|
|
845
|
-
type: Injectable
|
|
846
|
-
}], ctorParameters: () => [] });
|
|
847
620
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: IconComponent, isStandalone: true, selector: "gld-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, space: { classPropertyName: "space", publicName: "space", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<span\r\n tabindex=\"-1\"\r\n (click)=\"emitClick()\"\r\n (keyup.enter)=\"keyup()\"\r\n class=\"icon icon--{{ size() }}\"\r\n [class.icon--left]=\"space() === IconsSpace.left\"\r\n [class.icon--right]=\"space() === IconsSpace.right\"\r\n [style.right.px]=\"moveLeftToRight()\"\r\n [style.top.px]=\"moveTopToBottom()\">\r\n @switch (icon()) {\r\n @case (Icons.arrowDownSLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.arrowUpSLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.checkboxCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.checkboxBlankCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.loader4Fill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M18.364 5.63604L16.9497 7.05025C15.683 5.7835 13.933 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12H21C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C14.4853 3 16.7353 4.00736 18.364 5.63604Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.logoutCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 11H13V13H5V16L0 12L5 8V11ZM3.99927 18H6.70835C8.11862 19.2447 9.97111 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.97111 4 8.11862 4.75527 6.70835 6H3.99927C5.82368 3.57111 8.72836 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C8.72836 22 5.82368 20.4289 3.99927 18Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.loginCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M10 11V8L15 12L10 16V13H1V11H10ZM2.4578 15H4.58152C5.76829 17.9318 8.64262 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C8.64262 4 5.76829 6.06817 4.58152 9H2.4578C3.73207 4.94289 7.52236 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C7.52236 22 3.73207 19.0571 2.4578 15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitRepositoryLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13 21V23.5L10 21.5L7 23.5V21H6.5C4.567 21 3 19.433 3 17.5V5C3 3.34315 4.34315 2 6 2H20C20.5523 2 21 2.44772 21 3V20C21 20.5523 20.5523 21 20 21H13ZM13 19H19V16H6.5C5.67157 16 5 16.6716 5 17.5C5 18.3284 5.67157 19 6.5 19H7V17H13V19ZM19 14V4H6V14.0354C6.1633 14.0121 6.33024 14 6.5 14H19ZM7 5H9V7H7V5ZM7 8H9V10H7V8ZM7 11H9V13H7V11Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.fileList3Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M19 22H5C3.34315 22 2 20.6569 2 19V3C2 2.44772 2.44772 2 3 2H17C17.5523 2 18 2.44772 18 3V15H22V19C22 20.6569 20.6569 22 19 22ZM18 17V19C18 19.5523 18.4477 20 19 20C19.5523 20 20 19.5523 20 19V17H18ZM16 20V4H4V19C4 19.5523 4.44772 20 5 20H16ZM6 7H14V9H6V7ZM6 11H14V13H6V11ZM6 15H11V17H6V15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.menuLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path d=\"M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.sunLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 18C8.68629 18 6 15.3137 6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 15.3137 15.3137 18 12 18ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16ZM11 1H13V4H11V1ZM11 20H13V23H11V20ZM3.51472 4.92893L4.92893 3.51472L7.05025 5.63604L5.63604 7.05025L3.51472 4.92893ZM16.9497 18.364L18.364 16.9497L20.4853 19.0711L19.0711 20.4853L16.9497 18.364ZM19.0711 3.51472L20.4853 4.92893L18.364 7.05025L16.9497 5.63604L19.0711 3.51472ZM5.63604 16.9497L7.05025 18.364L4.92893 20.4853L3.51472 19.0711L5.63604 16.9497ZM23 11V13H20V11H23ZM4 11V13H1V11H4Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.moonClearLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M10 6C10 10.4183 13.5817 14 18 14C19.4386 14 20.7885 13.6203 21.9549 12.9556C21.4738 18.0302 17.2005 22 12 22C6.47715 22 2 17.5228 2 12C2 6.79948 5.9698 2.52616 11.0444 2.04507C10.3797 3.21152 10 4.56142 10 6ZM4 12C4 16.4183 7.58172 20 12 20C14.9654 20 17.5757 18.3788 18.9571 15.9546C18.6407 15.9848 18.3214 16 18 16C12.4772 16 8 11.5228 8 6C8 5.67863 8.01524 5.35933 8.04536 5.04293C5.62119 6.42426 4 9.03458 4 12ZM18.1642 2.29104L19 2.5V3.5L18.1642 3.70896C17.4476 3.8881 16.8881 4.4476 16.709 5.16417L16.5 6H15.5L15.291 5.16417C15.1119 4.4476 14.5524 3.8881 13.8358 3.70896L13 3.5V2.5L13.8358 2.29104C14.5524 2.1119 15.1119 1.5524 15.291 0.835829L15.5 0H16.5L16.709 0.835829C16.8881 1.5524 17.4476 2.1119 18.1642 2.29104ZM23.1642 7.29104L24 7.5V8.5L23.1642 8.70896C22.4476 8.8881 21.8881 9.4476 21.709 10.1642L21.5 11H20.5L20.291 10.1642C20.1119 9.4476 19.5524 8.8881 18.8358 8.70896L18 8.5V7.5L18.8358 7.29104C19.5524 7.1119 20.1119 6.5524 20.291 5.83583L20.5 5H21.5L21.709 5.83583C21.8881 6.5524 22.4476 7.1119 23.1642 7.29104Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.englishInput) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M14 10H16L16.0005 10.7574C16.7154 10.279 17.5751 10 18.5 10C20.9853 10 23 12.0147 23 14.5V20H21V14.5C21 13.07 19.8255 12 18.5 12C17.1745 12 16 13.07 16 14.5V20H14V10ZM12 4V6H4V11H12V13H4V18H12V20H2V4H12Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.translate) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 15V17C5 18.0544 5.81588 18.9182 6.85074 18.9945L7 19H10V21H7C4.79086 21 3 19.2091 3 17V15H5ZM18 10L22.4 21H20.245L19.044 18H14.954L13.755 21H11.601L16 10H18ZM17 12.8852L15.753 16H18.245L17 12.8852ZM8 2V4H12V11H8V14H6V11H2V4H6V2H8ZM17 3C19.2091 3 21 4.79086 21 7V9H19V7C19 5.89543 18.1046 5 17 5H14V3H17ZM6 6H4V9H6V6ZM10 6H8V9H10V6Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.user4Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 20H19V22H5V20ZM12 18C7.58172 18 4 14.4183 4 10C4 5.58172 7.58172 2 12 2C16.4183 2 20 5.58172 20 10C20 14.4183 16.4183 18 12 18ZM12 16C15.3137 16 18 13.3137 18 10C18 6.68629 15.3137 4 12 4C8.68629 4 6 6.68629 6 10C6 13.3137 8.68629 16 12 16Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.shapesLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9998 1L6 11H18L11.9998 1ZM11.9998 4.8873L14.4676 9H9.53232L11.9998 4.8873ZM6.75 20C5.23122 20 4 18.7688 4 17.25C4 15.7312 5.23122 14.5 6.75 14.5C8.26878 14.5 9.5 15.7312 9.5 17.25C9.5 18.7688 8.26878 20 6.75 20ZM6.75 22C9.37335 22 11.5 19.8734 11.5 17.25C11.5 14.6266 9.37335 12.5 6.75 12.5C4.12665 12.5 2 14.6266 2 17.25C2 19.8734 4.12665 22 6.75 22ZM15 15.5V19.5H19V15.5H15ZM13 21.5V13.5H21V21.5H13Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.closeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.eyeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.eyeCloseLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M9.34268 18.7819L7.41083 18.2642L8.1983 15.3254C7.00919 14.8874 5.91661 14.2498 4.96116 13.4534L2.80783 15.6067L1.39362 14.1925L3.54695 12.0392C2.35581 10.6103 1.52014 8.87466 1.17578 6.96818L3.14386 6.61035C3.90289 10.8126 7.57931 14.0001 12.0002 14.0001C16.4211 14.0001 20.0976 10.8126 20.8566 6.61035L22.8247 6.96818C22.4803 8.87466 21.6446 10.6103 20.4535 12.0392L22.6068 14.1925L21.1926 15.6067L19.0393 13.4534C18.0838 14.2498 16.9912 14.8874 15.8021 15.3254L16.5896 18.2642L14.6578 18.7819L13.87 15.8418C13.2623 15.9459 12.6376 16.0001 12.0002 16.0001C11.3629 16.0001 10.7381 15.9459 10.1305 15.8418L9.34268 18.7819Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.linkedinBoxFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M18.3362 18.339H15.6707V14.1622C15.6707 13.1662 15.6505 11.8845 14.2817 11.8845C12.892 11.8845 12.6797 12.9683 12.6797 14.0887V18.339H10.0142V9.75H12.5747V10.9207H12.6092C12.967 10.2457 13.837 9.53325 15.1367 9.53325C17.8375 9.53325 18.337 11.3108 18.337 13.6245V18.339H18.3362ZM7.00373 8.57475C6.14573 8.57475 5.45648 7.88025 5.45648 7.026C5.45648 6.1725 6.14648 5.47875 7.00373 5.47875C7.85873 5.47875 8.55173 6.1725 8.55173 7.026C8.55173 7.88025 7.85798 8.57475 7.00373 8.57475ZM8.34023 18.339H5.66723V9.75H8.34023V18.339ZM19.6697 3H4.32923C3.59498 3 3.00098 3.5805 3.00098 4.29675V19.7033C3.00098 20.4202 3.59498 21 4.32923 21H19.6675C20.401 21 21.001 20.4202 21.001 19.7033V4.29675C21.001 3.5805 20.401 3 19.6675 3H19.6697Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.githubFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.001 2C6.47598 2 2.00098 6.475 2.00098 12C2.00098 16.425 4.86348 20.1625 8.83848 21.4875C9.33848 21.575 9.52598 21.275 9.52598 21.0125C9.52598 20.775 9.51348 19.9875 9.51348 19.15C7.00098 19.6125 6.35098 18.5375 6.15098 17.975C6.03848 17.6875 5.55098 16.8 5.12598 16.5625C4.77598 16.375 4.27598 15.9125 5.11348 15.9C5.90098 15.8875 6.46348 16.625 6.65098 16.925C7.55098 18.4375 8.98848 18.0125 9.56348 17.75C9.65098 17.1 9.91348 16.6625 10.201 16.4125C7.97598 16.1625 5.65098 15.3 5.65098 11.475C5.65098 10.3875 6.03848 9.4875 6.67598 8.7875C6.57598 8.5375 6.22598 7.5125 6.77598 6.1375C6.77598 6.1375 7.61348 5.875 9.52598 7.1625C10.326 6.9375 11.176 6.825 12.026 6.825C12.876 6.825 13.726 6.9375 14.526 7.1625C16.4385 5.8625 17.276 6.1375 17.276 6.1375C17.826 7.5125 17.476 8.5375 17.376 8.7875C18.0135 9.4875 18.401 10.375 18.401 11.475C18.401 15.3125 16.0635 16.1625 13.8385 16.4125C14.201 16.725 14.5135 17.325 14.5135 18.2625C14.5135 19.6 14.501 20.675 14.501 21.0125C14.501 21.275 14.6885 21.5875 15.1885 21.4875C19.259 20.1133 21.9999 16.2963 22.001 12C22.001 6.475 17.526 2 12.001 2Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.instagramFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13.0281 2.00073C14.1535 2.00259 14.7238 2.00855 15.2166 2.02322L15.4107 2.02956C15.6349 2.03753 15.8561 2.04753 16.1228 2.06003C17.1869 2.1092 17.9128 2.27753 18.5503 2.52503C19.2094 2.7792 19.7661 3.12253 20.3219 3.67837C20.8769 4.2342 21.2203 4.79253 21.4753 5.45003C21.7219 6.0867 21.8903 6.81337 21.9403 7.87753C21.9522 8.1442 21.9618 8.3654 21.9697 8.58964L21.976 8.78373C21.9906 9.27647 21.9973 9.84686 21.9994 10.9723L22.0002 11.7179C22.0003 11.809 22.0003 11.903 22.0003 12L22.0002 12.2821L21.9996 13.0278C21.9977 14.1532 21.9918 14.7236 21.9771 15.2163L21.9707 15.4104C21.9628 15.6347 21.9528 15.8559 21.9403 16.1225C21.8911 17.1867 21.7219 17.9125 21.4753 18.55C21.2211 19.2092 20.8769 19.7659 20.3219 20.3217C19.7661 20.8767 19.2069 21.22 18.5503 21.475C17.9128 21.7217 17.1869 21.89 16.1228 21.94C15.8561 21.9519 15.6349 21.9616 15.4107 21.9694L15.2166 21.9757C14.7238 21.9904 14.1535 21.997 13.0281 21.9992L12.2824 22C12.1913 22 12.0973 22 12.0003 22L11.7182 22L10.9725 21.9993C9.8471 21.9975 9.27672 21.9915 8.78397 21.9768L8.58989 21.9705C8.36564 21.9625 8.14444 21.9525 7.87778 21.94C6.81361 21.8909 6.08861 21.7217 5.45028 21.475C4.79194 21.2209 4.23444 20.8767 3.67861 20.3217C3.12278 19.7659 2.78028 19.2067 2.52528 18.55C2.27778 17.9125 2.11028 17.1867 2.06028 16.1225C2.0484 15.8559 2.03871 15.6347 2.03086 15.4104L2.02457 15.2163C2.00994 14.7236 2.00327 14.1532 2.00111 13.0278L2.00098 10.9723C2.00284 9.84686 2.00879 9.27647 2.02346 8.78373L2.02981 8.58964C2.03778 8.3654 2.04778 8.1442 2.06028 7.87753C2.10944 6.81253 2.27778 6.08753 2.52528 5.45003C2.77944 4.7917 3.12278 4.2342 3.67861 3.67837C4.23444 3.12253 4.79278 2.78003 5.45028 2.52503C6.08778 2.27753 6.81278 2.11003 7.87778 2.06003C8.14444 2.04816 8.36564 2.03847 8.58989 2.03062L8.78397 2.02433C9.27672 2.00969 9.8471 2.00302 10.9725 2.00086L13.0281 2.00073ZM12.0003 7.00003C9.23738 7.00003 7.00028 9.23956 7.00028 12C7.00028 14.7629 9.23981 17 12.0003 17C14.7632 17 17.0003 14.7605 17.0003 12C17.0003 9.23713 14.7607 7.00003 12.0003 7.00003ZM12.0003 9.00003C13.6572 9.00003 15.0003 10.3427 15.0003 12C15.0003 13.6569 13.6576 15 12.0003 15C10.3434 15 9.00028 13.6574 9.00028 12C9.00028 10.3431 10.3429 9.00003 12.0003 9.00003ZM17.2503 5.50003C16.561 5.50003 16.0003 6.05994 16.0003 6.74918C16.0003 7.43843 16.5602 7.9992 17.2503 7.9992C17.9395 7.9992 18.5003 7.4393 18.5003 6.74918C18.5003 6.05994 17.9386 5.49917 17.2503 5.50003Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.twitterXFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M17.6874 3.0625L12.6907 8.77425L8.37045 3.0625H2.11328L9.58961 12.8387L2.50378 20.9375H5.53795L11.0068 14.6886L15.7863 20.9375H21.8885L14.095 10.6342L20.7198 3.0625H17.6874ZM16.6232 19.1225L5.65436 4.78217H7.45745L18.3034 19.1225H16.6232Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.downloadCloud2Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13 13V18.585L14.8284 16.7574L16.2426 18.1716L12 22.4142L7.75736 18.1716L9.17157 16.7574L11 18.585V13H13ZM12 2C15.5934 2 18.5544 4.70761 18.9541 8.19395C21.2858 8.83154 23 10.9656 23 13.5C23 16.3688 20.8036 18.7246 18.0006 18.9776L18.0009 16.9644C19.6966 16.7214 21 15.2629 21 13.5C21 11.567 19.433 10 17.5 10C17.2912 10 17.0867 10.0183 16.8887 10.054C16.9616 9.7142 17 9.36158 17 9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9C7 9.36158 7.03838 9.7142 7.11205 10.0533C6.91331 10.0183 6.70879 10 6.5 10C4.567 10 3 11.567 3 13.5C3 15.2003 4.21241 16.6174 5.81986 16.934L6.00005 16.9646L6.00039 18.9776C3.19696 18.7252 1 16.3692 1 13.5C1 10.9656 2.71424 8.83154 5.04648 8.19411C5.44561 4.70761 8.40661 2 12 2Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.globeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13.0003 21H18.0003V23H6.00032V21H11.0003V19.9506C7.70689 19.6236 4.88351 17.6987 3.31641 14.9622L5.05319 13.9697C6.43208 16.3776 9.02674 18 12.0003 18C16.4186 18 20.0003 14.4182 20.0003 9.99995C20.0003 7.02637 18.378 4.43171 15.9701 3.05282L16.9626 1.31604C19.9724 3.03965 22.0003 6.28297 22.0003 9.99995C22.0003 15.1853 18.0536 19.4489 13.0003 19.9506V21ZM12.0003 17C8.13433 17 5.00032 13.8659 5.00032 9.99995C5.00032 6.13396 8.13433 2.99995 12.0003 2.99995C15.8663 2.99995 19.0003 6.13396 19.0003 9.99995C19.0003 13.8659 15.8663 17 12.0003 17ZM12.0003 15C14.7617 15 17.0003 12.7614 17.0003 9.99995C17.0003 7.23853 14.7617 4.99995 12.0003 4.99995C9.2389 4.99995 7.00032 7.23853 7.00032 9.99995C7.00032 12.7614 9.2389 15 12.0003 15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.mailSendLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M21 3C21.5523 3 22 3.44772 22 4V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V19H20V7.3L12 14.5L2 5.5V4C2 3.44772 2.44772 3 3 3H21ZM8 15V17H0V15H8ZM5 10V12H0V10H5ZM19.5659 5H4.43414L12 11.8093L19.5659 5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.pagesLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 8V20H19V8H5ZM5 6H19V4H5V6ZM20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM7 10H11V14H7V10ZM7 16H17V18H7V16ZM13 11H17V13H13V11Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitForkLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6 5C5.44772 5 5 5.44772 5 6C5 6.55228 5.44772 7 6 7C6.55228 7 7 6.55228 7 6C7 5.44772 6.55228 5 6 5ZM3 6C3 4.34315 4.34315 3 6 3C7.65685 3 9 4.34315 9 6C9 7.30622 8.16519 8.41746 7 8.82929V9C7 10.1046 7.89543 11 9 11H15C16.1046 11 17 10.1046 17 9V8.82929C15.8348 8.41746 15 7.30622 15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.30622 20.1652 8.41746 19 8.82929V9C19 11.2091 17.2091 13 15 13H13V15.1707C14.1652 15.5825 15 16.6938 15 18C15 19.6569 13.6569 21 12 21C10.3431 21 9 19.6569 9 18C9 16.6938 9.83481 15.5825 11 15.1707V13H9C6.79086 13 5 11.2091 5 9V8.82929C3.83481 8.41746 3 7.30622 3 6ZM18 5C17.4477 5 17 5.44772 17 6C17 6.55228 17.4477 7 18 7C18.5523 7 19 6.55228 19 6C19 5.44772 18.5523 5 18 5ZM12 17C11.4477 17 11 17.4477 11 18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18C13 17.4477 12.5523 17 12 17Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitRepositoryPrivateLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6 10V20H19V10H6ZM18 8H20C20.5523 8 21 8.44772 21 9V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V9C3 8.44772 3.44772 8 4 8H6V7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7V8ZM16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8H16ZM7 11H9V13H7V11ZM7 14H9V16H7V14ZM7 17H9V19H7V17Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.starLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.0006 18.26L4.94715 22.2082L6.52248 14.2799L0.587891 8.7918L8.61493 7.84006L12.0006 0.5L15.3862 7.84006L23.4132 8.7918L17.4787 14.2799L19.054 22.2082L12.0006 18.26ZM12.0006 15.968L16.2473 18.3451L15.2988 13.5717L18.8719 10.2674L14.039 9.69434L12.0006 5.27502L9.96214 9.69434L5.12921 10.2674L8.70231 13.5717L7.75383 18.3451L12.0006 15.968Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.calendar2Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM8 13V15H6V13H8ZM13 13V15H11V13H13ZM18 13V15H16V13H18ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.macLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M14 18V20L16 21V22H8L7.99639 21.0036L10 20V18H2.9918C2.44405 18 2 17.5511 2 16.9925V4.00748C2 3.45107 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44892 22 4.00748V16.9925C22 17.5489 21.5447 18 21.0082 18H14ZM4 5V14H20V5H4Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.more2Fill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 3C10.9 3 10 3.9 10 5C10 6.1 10.9 7 12 7C13.1 7 14 6.1 14 5C14 3.9 13.1 3 12 3ZM12 17C10.9 17 10 17.9 10 19C10 20.1 10.9 21 12 21C13.1 21 14 20.1 14 19C14 17.9 13.1 17 12 17ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.editLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.deleteBinLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z\"></path>\r\n </svg>\r\n }\r\n }\r\n</span>\r\n", styles: [":host{color:inherit;display:inline-flex}:host:has(.icon--left){margin-left:var(--gld-spacing--xxxs)}:host:has(.icon--right){margin-right:var(--gld-spacing--xxxs)}.icon{--gld-icon-size: var(--gld-icon-size--normal);position:relative;color:inherit;font-weight:400;width:var(--gld-icon-size);height:var(--gld-icon-size);margin:auto}.icon--tiny{--gld-icon-size: var(--gld-icon-size--tiny)}.icon--small{--gld-icon-size: var(--gld-icon-size--small)}.icon--medium{--gld-icon-size: var(--gld-icon-size--medium)}.icon--large{--gld-icon-size: var(--gld-icon-size--large)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
621
|
+
function isDocumentValidator({ documentType }) {
|
|
622
|
+
return (control) => {
|
|
623
|
+
const value = control.value;
|
|
624
|
+
// Definir los patrones de acuerdo al tipo de vehículo
|
|
625
|
+
const patterns = {
|
|
626
|
+
DNI: [
|
|
627
|
+
{
|
|
628
|
+
regex: /^\d+$/,
|
|
629
|
+
message: 'Este campo debe contener solo números!',
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
regex: /^.{7,8}$/,
|
|
633
|
+
message: 'Este campo debe contener entre 7 y 8 dígitos!',
|
|
634
|
+
},
|
|
635
|
+
],
|
|
636
|
+
CT: [
|
|
637
|
+
{
|
|
638
|
+
regex: /^\d+$/,
|
|
639
|
+
message: 'Este campo debe contener solo números!',
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
regex: /^.{11}$/,
|
|
643
|
+
message: 'Este campo debe contener 11 dígitos!',
|
|
644
|
+
},
|
|
645
|
+
],
|
|
646
|
+
CL: [
|
|
647
|
+
{
|
|
648
|
+
regex: /^\d+$/,
|
|
649
|
+
message: 'Este campo debe contener solo números!',
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
regex: /^.{11}$/,
|
|
653
|
+
message: 'Este campo debe contener 11 dígitos!',
|
|
654
|
+
},
|
|
655
|
+
],
|
|
656
|
+
};
|
|
657
|
+
const patternsToValid = patterns[documentType];
|
|
658
|
+
if (!value)
|
|
659
|
+
return null;
|
|
660
|
+
const pattern = patternsToValid.find((pattern) => !pattern.regex.test(value));
|
|
661
|
+
return pattern ? { isDocument: pattern.message } : null;
|
|
662
|
+
};
|
|
868
663
|
}
|
|
869
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: IconComponent, decorators: [{
|
|
870
|
-
type: Component,
|
|
871
|
-
args: [{ selector: 'gld-icon', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\r\n tabindex=\"-1\"\r\n (click)=\"emitClick()\"\r\n (keyup.enter)=\"keyup()\"\r\n class=\"icon icon--{{ size() }}\"\r\n [class.icon--left]=\"space() === IconsSpace.left\"\r\n [class.icon--right]=\"space() === IconsSpace.right\"\r\n [style.right.px]=\"moveLeftToRight()\"\r\n [style.top.px]=\"moveTopToBottom()\">\r\n @switch (icon()) {\r\n @case (Icons.arrowDownSLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.arrowUpSLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.checkboxCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.checkboxBlankCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.loader4Fill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M18.364 5.63604L16.9497 7.05025C15.683 5.7835 13.933 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12H21C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C14.4853 3 16.7353 4.00736 18.364 5.63604Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.logoutCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 11H13V13H5V16L0 12L5 8V11ZM3.99927 18H6.70835C8.11862 19.2447 9.97111 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.97111 4 8.11862 4.75527 6.70835 6H3.99927C5.82368 3.57111 8.72836 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C8.72836 22 5.82368 20.4289 3.99927 18Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.loginCircleLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M10 11V8L15 12L10 16V13H1V11H10ZM2.4578 15H4.58152C5.76829 17.9318 8.64262 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C8.64262 4 5.76829 6.06817 4.58152 9H2.4578C3.73207 4.94289 7.52236 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C7.52236 22 3.73207 19.0571 2.4578 15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitRepositoryLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13 21V23.5L10 21.5L7 23.5V21H6.5C4.567 21 3 19.433 3 17.5V5C3 3.34315 4.34315 2 6 2H20C20.5523 2 21 2.44772 21 3V20C21 20.5523 20.5523 21 20 21H13ZM13 19H19V16H6.5C5.67157 16 5 16.6716 5 17.5C5 18.3284 5.67157 19 6.5 19H7V17H13V19ZM19 14V4H6V14.0354C6.1633 14.0121 6.33024 14 6.5 14H19ZM7 5H9V7H7V5ZM7 8H9V10H7V8ZM7 11H9V13H7V11Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.fileList3Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M19 22H5C3.34315 22 2 20.6569 2 19V3C2 2.44772 2.44772 2 3 2H17C17.5523 2 18 2.44772 18 3V15H22V19C22 20.6569 20.6569 22 19 22ZM18 17V19C18 19.5523 18.4477 20 19 20C19.5523 20 20 19.5523 20 19V17H18ZM16 20V4H4V19C4 19.5523 4.44772 20 5 20H16ZM6 7H14V9H6V7ZM6 11H14V13H6V11ZM6 15H11V17H6V15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.menuLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path d=\"M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.sunLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 18C8.68629 18 6 15.3137 6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 15.3137 15.3137 18 12 18ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16ZM11 1H13V4H11V1ZM11 20H13V23H11V20ZM3.51472 4.92893L4.92893 3.51472L7.05025 5.63604L5.63604 7.05025L3.51472 4.92893ZM16.9497 18.364L18.364 16.9497L20.4853 19.0711L19.0711 20.4853L16.9497 18.364ZM19.0711 3.51472L20.4853 4.92893L18.364 7.05025L16.9497 5.63604L19.0711 3.51472ZM5.63604 16.9497L7.05025 18.364L4.92893 20.4853L3.51472 19.0711L5.63604 16.9497ZM23 11V13H20V11H23ZM4 11V13H1V11H4Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.moonClearLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M10 6C10 10.4183 13.5817 14 18 14C19.4386 14 20.7885 13.6203 21.9549 12.9556C21.4738 18.0302 17.2005 22 12 22C6.47715 22 2 17.5228 2 12C2 6.79948 5.9698 2.52616 11.0444 2.04507C10.3797 3.21152 10 4.56142 10 6ZM4 12C4 16.4183 7.58172 20 12 20C14.9654 20 17.5757 18.3788 18.9571 15.9546C18.6407 15.9848 18.3214 16 18 16C12.4772 16 8 11.5228 8 6C8 5.67863 8.01524 5.35933 8.04536 5.04293C5.62119 6.42426 4 9.03458 4 12ZM18.1642 2.29104L19 2.5V3.5L18.1642 3.70896C17.4476 3.8881 16.8881 4.4476 16.709 5.16417L16.5 6H15.5L15.291 5.16417C15.1119 4.4476 14.5524 3.8881 13.8358 3.70896L13 3.5V2.5L13.8358 2.29104C14.5524 2.1119 15.1119 1.5524 15.291 0.835829L15.5 0H16.5L16.709 0.835829C16.8881 1.5524 17.4476 2.1119 18.1642 2.29104ZM23.1642 7.29104L24 7.5V8.5L23.1642 8.70896C22.4476 8.8881 21.8881 9.4476 21.709 10.1642L21.5 11H20.5L20.291 10.1642C20.1119 9.4476 19.5524 8.8881 18.8358 8.70896L18 8.5V7.5L18.8358 7.29104C19.5524 7.1119 20.1119 6.5524 20.291 5.83583L20.5 5H21.5L21.709 5.83583C21.8881 6.5524 22.4476 7.1119 23.1642 7.29104Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.englishInput) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M14 10H16L16.0005 10.7574C16.7154 10.279 17.5751 10 18.5 10C20.9853 10 23 12.0147 23 14.5V20H21V14.5C21 13.07 19.8255 12 18.5 12C17.1745 12 16 13.07 16 14.5V20H14V10ZM12 4V6H4V11H12V13H4V18H12V20H2V4H12Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.translate) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 15V17C5 18.0544 5.81588 18.9182 6.85074 18.9945L7 19H10V21H7C4.79086 21 3 19.2091 3 17V15H5ZM18 10L22.4 21H20.245L19.044 18H14.954L13.755 21H11.601L16 10H18ZM17 12.8852L15.753 16H18.245L17 12.8852ZM8 2V4H12V11H8V14H6V11H2V4H6V2H8ZM17 3C19.2091 3 21 4.79086 21 7V9H19V7C19 5.89543 18.1046 5 17 5H14V3H17ZM6 6H4V9H6V6ZM10 6H8V9H10V6Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.user4Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 20H19V22H5V20ZM12 18C7.58172 18 4 14.4183 4 10C4 5.58172 7.58172 2 12 2C16.4183 2 20 5.58172 20 10C20 14.4183 16.4183 18 12 18ZM12 16C15.3137 16 18 13.3137 18 10C18 6.68629 15.3137 4 12 4C8.68629 4 6 6.68629 6 10C6 13.3137 8.68629 16 12 16Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.shapesLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9998 1L6 11H18L11.9998 1ZM11.9998 4.8873L14.4676 9H9.53232L11.9998 4.8873ZM6.75 20C5.23122 20 4 18.7688 4 17.25C4 15.7312 5.23122 14.5 6.75 14.5C8.26878 14.5 9.5 15.7312 9.5 17.25C9.5 18.7688 8.26878 20 6.75 20ZM6.75 22C9.37335 22 11.5 19.8734 11.5 17.25C11.5 14.6266 9.37335 12.5 6.75 12.5C4.12665 12.5 2 14.6266 2 17.25C2 19.8734 4.12665 22 6.75 22ZM15 15.5V19.5H19V15.5H15ZM13 21.5V13.5H21V21.5H13Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.closeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.eyeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.eyeCloseLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M9.34268 18.7819L7.41083 18.2642L8.1983 15.3254C7.00919 14.8874 5.91661 14.2498 4.96116 13.4534L2.80783 15.6067L1.39362 14.1925L3.54695 12.0392C2.35581 10.6103 1.52014 8.87466 1.17578 6.96818L3.14386 6.61035C3.90289 10.8126 7.57931 14.0001 12.0002 14.0001C16.4211 14.0001 20.0976 10.8126 20.8566 6.61035L22.8247 6.96818C22.4803 8.87466 21.6446 10.6103 20.4535 12.0392L22.6068 14.1925L21.1926 15.6067L19.0393 13.4534C18.0838 14.2498 16.9912 14.8874 15.8021 15.3254L16.5896 18.2642L14.6578 18.7819L13.87 15.8418C13.2623 15.9459 12.6376 16.0001 12.0002 16.0001C11.3629 16.0001 10.7381 15.9459 10.1305 15.8418L9.34268 18.7819Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.linkedinBoxFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M18.3362 18.339H15.6707V14.1622C15.6707 13.1662 15.6505 11.8845 14.2817 11.8845C12.892 11.8845 12.6797 12.9683 12.6797 14.0887V18.339H10.0142V9.75H12.5747V10.9207H12.6092C12.967 10.2457 13.837 9.53325 15.1367 9.53325C17.8375 9.53325 18.337 11.3108 18.337 13.6245V18.339H18.3362ZM7.00373 8.57475C6.14573 8.57475 5.45648 7.88025 5.45648 7.026C5.45648 6.1725 6.14648 5.47875 7.00373 5.47875C7.85873 5.47875 8.55173 6.1725 8.55173 7.026C8.55173 7.88025 7.85798 8.57475 7.00373 8.57475ZM8.34023 18.339H5.66723V9.75H8.34023V18.339ZM19.6697 3H4.32923C3.59498 3 3.00098 3.5805 3.00098 4.29675V19.7033C3.00098 20.4202 3.59498 21 4.32923 21H19.6675C20.401 21 21.001 20.4202 21.001 19.7033V4.29675C21.001 3.5805 20.401 3 19.6675 3H19.6697Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.githubFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.001 2C6.47598 2 2.00098 6.475 2.00098 12C2.00098 16.425 4.86348 20.1625 8.83848 21.4875C9.33848 21.575 9.52598 21.275 9.52598 21.0125C9.52598 20.775 9.51348 19.9875 9.51348 19.15C7.00098 19.6125 6.35098 18.5375 6.15098 17.975C6.03848 17.6875 5.55098 16.8 5.12598 16.5625C4.77598 16.375 4.27598 15.9125 5.11348 15.9C5.90098 15.8875 6.46348 16.625 6.65098 16.925C7.55098 18.4375 8.98848 18.0125 9.56348 17.75C9.65098 17.1 9.91348 16.6625 10.201 16.4125C7.97598 16.1625 5.65098 15.3 5.65098 11.475C5.65098 10.3875 6.03848 9.4875 6.67598 8.7875C6.57598 8.5375 6.22598 7.5125 6.77598 6.1375C6.77598 6.1375 7.61348 5.875 9.52598 7.1625C10.326 6.9375 11.176 6.825 12.026 6.825C12.876 6.825 13.726 6.9375 14.526 7.1625C16.4385 5.8625 17.276 6.1375 17.276 6.1375C17.826 7.5125 17.476 8.5375 17.376 8.7875C18.0135 9.4875 18.401 10.375 18.401 11.475C18.401 15.3125 16.0635 16.1625 13.8385 16.4125C14.201 16.725 14.5135 17.325 14.5135 18.2625C14.5135 19.6 14.501 20.675 14.501 21.0125C14.501 21.275 14.6885 21.5875 15.1885 21.4875C19.259 20.1133 21.9999 16.2963 22.001 12C22.001 6.475 17.526 2 12.001 2Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.instagramFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13.0281 2.00073C14.1535 2.00259 14.7238 2.00855 15.2166 2.02322L15.4107 2.02956C15.6349 2.03753 15.8561 2.04753 16.1228 2.06003C17.1869 2.1092 17.9128 2.27753 18.5503 2.52503C19.2094 2.7792 19.7661 3.12253 20.3219 3.67837C20.8769 4.2342 21.2203 4.79253 21.4753 5.45003C21.7219 6.0867 21.8903 6.81337 21.9403 7.87753C21.9522 8.1442 21.9618 8.3654 21.9697 8.58964L21.976 8.78373C21.9906 9.27647 21.9973 9.84686 21.9994 10.9723L22.0002 11.7179C22.0003 11.809 22.0003 11.903 22.0003 12L22.0002 12.2821L21.9996 13.0278C21.9977 14.1532 21.9918 14.7236 21.9771 15.2163L21.9707 15.4104C21.9628 15.6347 21.9528 15.8559 21.9403 16.1225C21.8911 17.1867 21.7219 17.9125 21.4753 18.55C21.2211 19.2092 20.8769 19.7659 20.3219 20.3217C19.7661 20.8767 19.2069 21.22 18.5503 21.475C17.9128 21.7217 17.1869 21.89 16.1228 21.94C15.8561 21.9519 15.6349 21.9616 15.4107 21.9694L15.2166 21.9757C14.7238 21.9904 14.1535 21.997 13.0281 21.9992L12.2824 22C12.1913 22 12.0973 22 12.0003 22L11.7182 22L10.9725 21.9993C9.8471 21.9975 9.27672 21.9915 8.78397 21.9768L8.58989 21.9705C8.36564 21.9625 8.14444 21.9525 7.87778 21.94C6.81361 21.8909 6.08861 21.7217 5.45028 21.475C4.79194 21.2209 4.23444 20.8767 3.67861 20.3217C3.12278 19.7659 2.78028 19.2067 2.52528 18.55C2.27778 17.9125 2.11028 17.1867 2.06028 16.1225C2.0484 15.8559 2.03871 15.6347 2.03086 15.4104L2.02457 15.2163C2.00994 14.7236 2.00327 14.1532 2.00111 13.0278L2.00098 10.9723C2.00284 9.84686 2.00879 9.27647 2.02346 8.78373L2.02981 8.58964C2.03778 8.3654 2.04778 8.1442 2.06028 7.87753C2.10944 6.81253 2.27778 6.08753 2.52528 5.45003C2.77944 4.7917 3.12278 4.2342 3.67861 3.67837C4.23444 3.12253 4.79278 2.78003 5.45028 2.52503C6.08778 2.27753 6.81278 2.11003 7.87778 2.06003C8.14444 2.04816 8.36564 2.03847 8.58989 2.03062L8.78397 2.02433C9.27672 2.00969 9.8471 2.00302 10.9725 2.00086L13.0281 2.00073ZM12.0003 7.00003C9.23738 7.00003 7.00028 9.23956 7.00028 12C7.00028 14.7629 9.23981 17 12.0003 17C14.7632 17 17.0003 14.7605 17.0003 12C17.0003 9.23713 14.7607 7.00003 12.0003 7.00003ZM12.0003 9.00003C13.6572 9.00003 15.0003 10.3427 15.0003 12C15.0003 13.6569 13.6576 15 12.0003 15C10.3434 15 9.00028 13.6574 9.00028 12C9.00028 10.3431 10.3429 9.00003 12.0003 9.00003ZM17.2503 5.50003C16.561 5.50003 16.0003 6.05994 16.0003 6.74918C16.0003 7.43843 16.5602 7.9992 17.2503 7.9992C17.9395 7.9992 18.5003 7.4393 18.5003 6.74918C18.5003 6.05994 17.9386 5.49917 17.2503 5.50003Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.twitterXFill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M17.6874 3.0625L12.6907 8.77425L8.37045 3.0625H2.11328L9.58961 12.8387L2.50378 20.9375H5.53795L11.0068 14.6886L15.7863 20.9375H21.8885L14.095 10.6342L20.7198 3.0625H17.6874ZM16.6232 19.1225L5.65436 4.78217H7.45745L18.3034 19.1225H16.6232Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.downloadCloud2Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13 13V18.585L14.8284 16.7574L16.2426 18.1716L12 22.4142L7.75736 18.1716L9.17157 16.7574L11 18.585V13H13ZM12 2C15.5934 2 18.5544 4.70761 18.9541 8.19395C21.2858 8.83154 23 10.9656 23 13.5C23 16.3688 20.8036 18.7246 18.0006 18.9776L18.0009 16.9644C19.6966 16.7214 21 15.2629 21 13.5C21 11.567 19.433 10 17.5 10C17.2912 10 17.0867 10.0183 16.8887 10.054C16.9616 9.7142 17 9.36158 17 9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9C7 9.36158 7.03838 9.7142 7.11205 10.0533C6.91331 10.0183 6.70879 10 6.5 10C4.567 10 3 11.567 3 13.5C3 15.2003 4.21241 16.6174 5.81986 16.934L6.00005 16.9646L6.00039 18.9776C3.19696 18.7252 1 16.3692 1 13.5C1 10.9656 2.71424 8.83154 5.04648 8.19411C5.44561 4.70761 8.40661 2 12 2Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.globeLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M13.0003 21H18.0003V23H6.00032V21H11.0003V19.9506C7.70689 19.6236 4.88351 17.6987 3.31641 14.9622L5.05319 13.9697C6.43208 16.3776 9.02674 18 12.0003 18C16.4186 18 20.0003 14.4182 20.0003 9.99995C20.0003 7.02637 18.378 4.43171 15.9701 3.05282L16.9626 1.31604C19.9724 3.03965 22.0003 6.28297 22.0003 9.99995C22.0003 15.1853 18.0536 19.4489 13.0003 19.9506V21ZM12.0003 17C8.13433 17 5.00032 13.8659 5.00032 9.99995C5.00032 6.13396 8.13433 2.99995 12.0003 2.99995C15.8663 2.99995 19.0003 6.13396 19.0003 9.99995C19.0003 13.8659 15.8663 17 12.0003 17ZM12.0003 15C14.7617 15 17.0003 12.7614 17.0003 9.99995C17.0003 7.23853 14.7617 4.99995 12.0003 4.99995C9.2389 4.99995 7.00032 7.23853 7.00032 9.99995C7.00032 12.7614 9.2389 15 12.0003 15Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.mailSendLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M21 3C21.5523 3 22 3.44772 22 4V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V19H20V7.3L12 14.5L2 5.5V4C2 3.44772 2.44772 3 3 3H21ZM8 15V17H0V15H8ZM5 10V12H0V10H5ZM19.5659 5H4.43414L12 11.8093L19.5659 5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.pagesLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M5 8V20H19V8H5ZM5 6H19V4H5V6ZM20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM7 10H11V14H7V10ZM7 16H17V18H7V16ZM13 11H17V13H13V11Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitForkLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6 5C5.44772 5 5 5.44772 5 6C5 6.55228 5.44772 7 6 7C6.55228 7 7 6.55228 7 6C7 5.44772 6.55228 5 6 5ZM3 6C3 4.34315 4.34315 3 6 3C7.65685 3 9 4.34315 9 6C9 7.30622 8.16519 8.41746 7 8.82929V9C7 10.1046 7.89543 11 9 11H15C16.1046 11 17 10.1046 17 9V8.82929C15.8348 8.41746 15 7.30622 15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.30622 20.1652 8.41746 19 8.82929V9C19 11.2091 17.2091 13 15 13H13V15.1707C14.1652 15.5825 15 16.6938 15 18C15 19.6569 13.6569 21 12 21C10.3431 21 9 19.6569 9 18C9 16.6938 9.83481 15.5825 11 15.1707V13H9C6.79086 13 5 11.2091 5 9V8.82929C3.83481 8.41746 3 7.30622 3 6ZM18 5C17.4477 5 17 5.44772 17 6C17 6.55228 17.4477 7 18 7C18.5523 7 19 6.55228 19 6C19 5.44772 18.5523 5 18 5ZM12 17C11.4477 17 11 17.4477 11 18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18C13 17.4477 12.5523 17 12 17Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.gitRepositoryPrivateLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6 10V20H19V10H6ZM18 8H20C20.5523 8 21 8.44772 21 9V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V9C3 8.44772 3.44772 8 4 8H6V7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7V8ZM16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8H16ZM7 11H9V13H7V11ZM7 14H9V16H7V14ZM7 17H9V19H7V17Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.starLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12.0006 18.26L4.94715 22.2082L6.52248 14.2799L0.587891 8.7918L8.61493 7.84006L12.0006 0.5L15.3862 7.84006L23.4132 8.7918L17.4787 14.2799L19.054 22.2082L12.0006 18.26ZM12.0006 15.968L16.2473 18.3451L15.2988 13.5717L18.8719 10.2674L14.039 9.69434L12.0006 5.27502L9.96214 9.69434L5.12921 10.2674L8.70231 13.5717L7.75383 18.3451L12.0006 15.968Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.calendar2Line) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM8 13V15H6V13H8ZM13 13V15H11V13H13ZM18 13V15H16V13H18ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.macLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M14 18V20L16 21V22H8L7.99639 21.0036L10 20V18H2.9918C2.44405 18 2 17.5511 2 16.9925V4.00748C2 3.45107 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44892 22 4.00748V16.9925C22 17.5489 21.5447 18 21.0082 18H14ZM4 5V14H20V5H4Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.more2Fill) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M12 3C10.9 3 10 3.9 10 5C10 6.1 10.9 7 12 7C13.1 7 14 6.1 14 5C14 3.9 13.1 3 12 3ZM12 17C10.9 17 10 17.9 10 19C10 20.1 10.9 21 12 21C13.1 21 14 20.1 14 19C14 17.9 13.1 17 12 17ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.editLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z\"></path>\r\n </svg>\r\n }\r\n @case (Icons.deleteBinLine) {\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <path\r\n d=\"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z\"></path>\r\n </svg>\r\n }\r\n }\r\n</span>\r\n", styles: [":host{color:inherit;display:inline-flex}:host:has(.icon--left){margin-left:var(--gld-spacing--xxxs)}:host:has(.icon--right){margin-right:var(--gld-spacing--xxxs)}.icon{--gld-icon-size: var(--gld-icon-size--normal);position:relative;color:inherit;font-weight:400;width:var(--gld-icon-size);height:var(--gld-icon-size);margin:auto}.icon--tiny{--gld-icon-size: var(--gld-icon-size--tiny)}.icon--small{--gld-icon-size: var(--gld-icon-size--small)}.icon--medium{--gld-icon-size: var(--gld-icon-size--medium)}.icon--large{--gld-icon-size: var(--gld-icon-size--large)}\n"] }]
|
|
872
|
-
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], space: [{ type: i0.Input, args: [{ isSignal: true, alias: "space", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
873
664
|
|
|
874
|
-
//
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
full = input(false, { ...(ngDevMode ? { debugName: "full" } : {}), transform: booleanAttribute });
|
|
886
|
-
clicked = output();
|
|
887
|
-
emitClick() {
|
|
888
|
-
if (!this.disabled())
|
|
889
|
-
this.clicked.emit();
|
|
890
|
-
}
|
|
891
|
-
keyup() {
|
|
892
|
-
this.emitClick();
|
|
893
|
-
}
|
|
894
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
895
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: ButtonComponent, isStandalone: true, selector: "gld-button", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, full: { classPropertyName: "full", publicName: "full", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"button button--{{ color() }} button--{{ size() }}\"\n [class.button--disabled]=\"disabled()\"\n [class.button--full]=\"full()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <!-- Icon -->\n @let innerIcon = icon();\n @if (innerIcon) {\n <gld-icon\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [icon]=\"innerIcon\"\n [size]=\"iconSize() ?? size()\"\n [disabled]=\"disabled()\" />\n }\n <!-- Content -->\n <span>\n <ng-content>no content</ng-content>\n </span>\n</button>\n\n<!-- Only used by DropdownMenuComponent -->\n<ng-content select=\"[gldDropdownMenuTemplate]\" />\n", styles: [":host{display:inline-block;height:inherit;max-width:inherit}:host:has(.button--full){width:100%}.button{--gld-color: inherit;--gld-background: transparent;--gld-background--hover: transparent;--gld-padding: var(--gld-spacing--xxs) var(--gld-spacing--xs);--gld-radius: var(--gld-radius--xxs);--gld-font-size: var(--gld-font-size--normal);outline:none;border:0;padding:var(--gld-padding);border-radius:var(--gld-radius);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size);font-weight:600;line-height:1.25;cursor:pointer;width:inherit;color:var(--gld-color);background:var(--gld-background);display:inline-flex;align-items:center;justify-content:center;gap:var(--gld-spacing--xxxs);will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover,.button:focus{--gld-background: var(--gld-background--hover)}.button:active{transform:scale(.95)}.button span{text-transform:capitalize;-webkit-user-select:none;user-select:none}.button--pink{--gld-color: var(--gld-pink);--gld-background: var(--gld-pink-transparent--010);--gld-background--hover: var(--gld-pink-transparent--020)}.button--purple{--gld-color: var(--gld-purple);--gld-background: var(--gld-purple-transparent--010);--gld-background--hover: var(--gld-purple-transparent--020)}.button--mustard{--gld-color: var(--gld-mustard);--gld-background: var(--gld-mustard-transparent--010);--gld-background--hover: var(--gld-mustard-transparent--020)}.button--orange{--gld-color: var(--gld-orange);--gld-background: var(--gld-orange-transparent--010);--gld-background--hover: var(--gld-orange-transparent--020)}.button--blue{--gld-color: var(--gld-blue);--gld-background: var(--gld-blue-transparent--010);--gld-background--hover: var(--gld-blue-transparent--020)}.button--red{--gld-color: var(--gld-red);--gld-background: var(--gld-red-transparent--010);--gld-background--hover: var(--gld-red-transparent--020)}.button--green{--gld-color: var(--gld-green);--gld-background: var(--gld-green-transparent--010);--gld-background--hover: var(--gld-green-transparent--020)}.button--tiny{--gld-font-size: var(--gld-font-size--small);--gld-padding: var(--gld-spacing--xxxs) var(--gld-spacing--xxs)}.button--small{--gld-font-size: var(--gld-font-size--small);--gld-padding: var(--gld-spacing--xxs)}.button--normal{--gld-font-size: var(--gld-font-size--normal);--gld-padding: var(--gld-spacing--xxs) var(--gld-spacing--xs)}.button--medium{--gld-padding: var(--gld-spacing--xs) var(--gld-spacing--m)}.button--large{--gld-font-size: var(--gld-font-size--heading-three);--gld-padding: var(--gld-spacing--xs) var(--gld-spacing--l)}.button--disabled{--gld-color: var(--gld-gray);--gld-background: var(--gld-gray-transparent--020);--gld-background--hover: var(--gld-gray-transparent--020);pointer-events:none;cursor:not-allowed}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gld-icon", inputs: ["icon", "size", "space", "moveTopToBottom", "moveLeftToRight", "disabled"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
665
|
+
// Regex para validar emails
|
|
666
|
+
const EMAIL_REGEX = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
|
|
667
|
+
function isEmailValidator() {
|
|
668
|
+
return (control) => {
|
|
669
|
+
const value = control.value;
|
|
670
|
+
if (!value)
|
|
671
|
+
return null;
|
|
672
|
+
if (EMAIL_REGEX.test(value))
|
|
673
|
+
return null;
|
|
674
|
+
return { email: 'This field must be a valid email!' };
|
|
675
|
+
};
|
|
896
676
|
}
|
|
897
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
898
|
-
type: Component,
|
|
899
|
-
args: [{ selector: 'gld-button', imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"button button--{{ color() }} button--{{ size() }}\"\n [class.button--disabled]=\"disabled()\"\n [class.button--full]=\"full()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <!-- Icon -->\n @let innerIcon = icon();\n @if (innerIcon) {\n <gld-icon\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [icon]=\"innerIcon\"\n [size]=\"iconSize() ?? size()\"\n [disabled]=\"disabled()\" />\n }\n <!-- Content -->\n <span>\n <ng-content>no content</ng-content>\n </span>\n</button>\n\n<!-- Only used by DropdownMenuComponent -->\n<ng-content select=\"[gldDropdownMenuTemplate]\" />\n", styles: [":host{display:inline-block;height:inherit;max-width:inherit}:host:has(.button--full){width:100%}.button{--gld-color: inherit;--gld-background: transparent;--gld-background--hover: transparent;--gld-padding: var(--gld-spacing--xxs) var(--gld-spacing--xs);--gld-radius: var(--gld-radius--xxs);--gld-font-size: var(--gld-font-size--normal);outline:none;border:0;padding:var(--gld-padding);border-radius:var(--gld-radius);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size);font-weight:600;line-height:1.25;cursor:pointer;width:inherit;color:var(--gld-color);background:var(--gld-background);display:inline-flex;align-items:center;justify-content:center;gap:var(--gld-spacing--xxxs);will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover,.button:focus{--gld-background: var(--gld-background--hover)}.button:active{transform:scale(.95)}.button span{text-transform:capitalize;-webkit-user-select:none;user-select:none}.button--pink{--gld-color: var(--gld-pink);--gld-background: var(--gld-pink-transparent--010);--gld-background--hover: var(--gld-pink-transparent--020)}.button--purple{--gld-color: var(--gld-purple);--gld-background: var(--gld-purple-transparent--010);--gld-background--hover: var(--gld-purple-transparent--020)}.button--mustard{--gld-color: var(--gld-mustard);--gld-background: var(--gld-mustard-transparent--010);--gld-background--hover: var(--gld-mustard-transparent--020)}.button--orange{--gld-color: var(--gld-orange);--gld-background: var(--gld-orange-transparent--010);--gld-background--hover: var(--gld-orange-transparent--020)}.button--blue{--gld-color: var(--gld-blue);--gld-background: var(--gld-blue-transparent--010);--gld-background--hover: var(--gld-blue-transparent--020)}.button--red{--gld-color: var(--gld-red);--gld-background: var(--gld-red-transparent--010);--gld-background--hover: var(--gld-red-transparent--020)}.button--green{--gld-color: var(--gld-green);--gld-background: var(--gld-green-transparent--010);--gld-background--hover: var(--gld-green-transparent--020)}.button--tiny{--gld-font-size: var(--gld-font-size--small);--gld-padding: var(--gld-spacing--xxxs) var(--gld-spacing--xxs)}.button--small{--gld-font-size: var(--gld-font-size--small);--gld-padding: var(--gld-spacing--xxs)}.button--normal{--gld-font-size: var(--gld-font-size--normal);--gld-padding: var(--gld-spacing--xxs) var(--gld-spacing--xs)}.button--medium{--gld-padding: var(--gld-spacing--xs) var(--gld-spacing--m)}.button--large{--gld-font-size: var(--gld-font-size--heading-three);--gld-padding: var(--gld-spacing--xs) var(--gld-spacing--l)}.button--disabled{--gld-color: var(--gld-gray);--gld-background: var(--gld-gray-transparent--020);--gld-background--hover: var(--gld-gray-transparent--020);pointer-events:none;cursor:not-allowed}\n"] }]
|
|
900
|
-
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], full: [{ type: i0.Input, args: [{ isSignal: true, alias: "full", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
901
677
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
error = signal(false, { ...(ngDevMode ? { debugName: "error" } : {}) });
|
|
916
|
-
selected = computed(() => Boolean(this.current() === this.value()), { ...(ngDevMode ? { debugName: "selected" } : {}) });
|
|
917
|
-
buttonChild = viewChild('buttonChild', { ...(ngDevMode ? { debugName: "buttonChild" } : {}), read: ElementRef });
|
|
918
|
-
select(value) {
|
|
919
|
-
this.changeValue.emit(value);
|
|
920
|
-
this.buttonChild()?.nativeElement.blur();
|
|
921
|
-
}
|
|
922
|
-
keyup(value) {
|
|
923
|
-
this.select(value);
|
|
924
|
-
}
|
|
925
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
926
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: DropdownButtonComponent, isStandalone: true, selector: "gld-dropdown-button", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconSpace: { classPropertyName: "iconSpace", publicName: "iconSpace", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValue: "changeValue" }, viewQueries: [{ propertyName: "buttonChild", first: true, predicate: ["buttonChild"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\r\n #buttonChild\r\n [tabindex]=\"disabled() ? '-1' : '0'\"\r\n class=\"button button--direction-{{ direction() }}\"\r\n [class.button--selected]=\"selected()\"\r\n (keyup.enter)=\"keyup(value())\"\r\n (click)=\"select(value())\">\r\n <!-- Icon -->\r\n @let innerIcon = icon();\r\n @if (innerIcon) {\r\n <gld-icon\r\n [moveTopToBottom]=\"moveTopToBottom()\"\r\n [moveLeftToRight]=\"moveLeftToRight()\"\r\n [icon]=\"innerIcon\"\r\n [size]=\"iconSize()\"\r\n [space]=\"iconSpace()\"\r\n [disabled]=\"disabled()\" />\r\n }\r\n <!-- Content -->\r\n <span>\r\n <ng-content> no content </ng-content>\r\n </span>\r\n</button>\r\n", styles: [":host{position:relative;width:100%}.button{--gld-background: transparent;--gld-background--hover: var(--gld-gray-transparent--010);--gld-color: var(--gld-foreground-color);--gld-color--selected: var(--gld-pink);--gld-color--hover: var(--gld-blue);--gld-radius: var(--gld-radius--xxxs);--gld-height: 40px;padding:var(--gld-spacing--xxs) var(--gld-spacing--xs);width:100%;height:var(--gld-height);background:var(--gld-background);color:var(--gld-color);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:var(--gld-line-height);text-align:left;-webkit-user-select:none;user-select:none;outline:none;border:none;border-radius:var(--gld-radius);cursor:pointer;display:inline-flex;align-items:center;gap:var(--gld-spacing--xxs);will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover{--gld-color: var(--gld-color--hover);--gld-background: var(--gld-background--hover)}.button:active{transform:scale(.95)}.button span{text-transform:capitalize;-webkit-user-select:none;user-select:none}.button--direction-left{justify-content:flex-start}.button--direction-right{justify-content:flex-end}.button--selected,.button--selected:hover{--gld-color: var(--gld-color--selected)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gld-icon", inputs: ["icon", "size", "space", "moveTopToBottom", "moveLeftToRight", "disabled"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
678
|
+
function isFormSelectItemValidator() {
|
|
679
|
+
return (control) => {
|
|
680
|
+
const value = control.value;
|
|
681
|
+
if (!value)
|
|
682
|
+
return null;
|
|
683
|
+
if (typeof value === 'string')
|
|
684
|
+
return { isFormSelectItem: 'Este campo debe ser una opción valida!' };
|
|
685
|
+
if (typeof value === 'object') {
|
|
686
|
+
if ('value' in value && 'label' in value)
|
|
687
|
+
return null;
|
|
688
|
+
}
|
|
689
|
+
return { isFormSelectItem: 'Este campo debe ser una opción valida!' };
|
|
690
|
+
};
|
|
927
691
|
}
|
|
928
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownButtonComponent, decorators: [{
|
|
929
|
-
type: Component,
|
|
930
|
-
args: [{ selector: 'gld-dropdown-button', imports: [...components$7], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\r\n #buttonChild\r\n [tabindex]=\"disabled() ? '-1' : '0'\"\r\n class=\"button button--direction-{{ direction() }}\"\r\n [class.button--selected]=\"selected()\"\r\n (keyup.enter)=\"keyup(value())\"\r\n (click)=\"select(value())\">\r\n <!-- Icon -->\r\n @let innerIcon = icon();\r\n @if (innerIcon) {\r\n <gld-icon\r\n [moveTopToBottom]=\"moveTopToBottom()\"\r\n [moveLeftToRight]=\"moveLeftToRight()\"\r\n [icon]=\"innerIcon\"\r\n [size]=\"iconSize()\"\r\n [space]=\"iconSpace()\"\r\n [disabled]=\"disabled()\" />\r\n }\r\n <!-- Content -->\r\n <span>\r\n <ng-content> no content </ng-content>\r\n </span>\r\n</button>\r\n", styles: [":host{position:relative;width:100%}.button{--gld-background: transparent;--gld-background--hover: var(--gld-gray-transparent--010);--gld-color: var(--gld-foreground-color);--gld-color--selected: var(--gld-pink);--gld-color--hover: var(--gld-blue);--gld-radius: var(--gld-radius--xxxs);--gld-height: 40px;padding:var(--gld-spacing--xxs) var(--gld-spacing--xs);width:100%;height:var(--gld-height);background:var(--gld-background);color:var(--gld-color);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:var(--gld-line-height);text-align:left;-webkit-user-select:none;user-select:none;outline:none;border:none;border-radius:var(--gld-radius);cursor:pointer;display:inline-flex;align-items:center;gap:var(--gld-spacing--xxs);will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover{--gld-color: var(--gld-color--hover);--gld-background: var(--gld-background--hover)}.button:active{transform:scale(.95)}.button span{text-transform:capitalize;-webkit-user-select:none;user-select:none}.button--direction-left{justify-content:flex-start}.button--direction-right{justify-content:flex-end}.button--selected,.button--selected:hover{--gld-color: var(--gld-color--selected)}\n"] }]
|
|
931
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSpace", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], changeValue: [{ type: i0.Output, args: ["changeValue"] }], buttonChild: [{ type: i0.ViewChild, args: ['buttonChild', { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
932
692
|
|
|
933
|
-
//
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
clicked = output();
|
|
946
|
-
emitClick() {
|
|
947
|
-
if (!this.disabled())
|
|
948
|
-
this.clicked.emit();
|
|
949
|
-
}
|
|
950
|
-
keyup() {
|
|
951
|
-
this.emitClick();
|
|
952
|
-
}
|
|
953
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
954
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: IconButtonComponent, isStandalone: true, selector: "gld-icon-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, space: { classPropertyName: "space", publicName: "space", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"button button--{{ color() }}\"\n [class.button--disabled]=\"disabled()\"\n [class.button--background]=\"background()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <!-- Icon -->\n <gld-icon\n [icon]=\"icon()\"\n [size]=\"iconSize()\"\n [space]=\"space()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [disabled]=\"disabled()\" />\n</button>\n\n<!-- Only used by DropdownMenuComponent -->\n<ng-content select=\"[gldDropdownMenuTemplate]\" />\n", styles: [":host{display:inline-block;max-width:inherit}.button{--gld-color: inherit;--gld-background: transparent;--gld-background--hover: transparent;--gld-radius: var(--gld-radius--xxs);--gld-font-size: var(--gld-font-size--normal);outline:none;border:none;padding:var(--gld-spacing--xxxs);border-radius:var(--gld-radius);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size);font-weight:600;line-height:1.25;cursor:pointer;width:inherit;color:var(--gld-color);background:var(--gld-background);display:inline-flex;align-items:center;justify-content:center;gap:var(--gld-spacing--xxxs);-webkit-user-select:none;user-select:none;will-change:background,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover,.button:focus{background:var(--gld-background--hover)}.button:active{transform:scale(.98)}.button--pink{--gld-color: var(--gld-pink)}.button--pink.button--background{--gld-background: var(--gld-pink-transparent--010);--gld-background--hover: var(--gld-pink-transparent--020)}.button--purple{--gld-color: var(--gld-purple)}.button--purple.button--background{--gld-background: var(--gld-purple-transparent--010);--gld-background--hover: var(--gld-purple-transparent--020)}.button--mustard{--gld-color: var(--gld-mustard)}.button--mustard.button--background{--gld-background: var(--gld-mustard-transparent--010);--gld-background--hover: var(--gld-mustard-transparent--020)}.button--orange{--gld-color: var(--gld-orange)}.button--orange.button--background{--gld-background: var(--gld-orange-transparent--010);--gld-background--hover: var(--gld-orange-transparent--020)}.button--blue{--gld-color: var(--gld-blue)}.button--blue.button--background{--gld-background: var(--gld-blue-transparent--010);--gld-background--hover: var(--gld-blue-transparent--020)}.button--red{--gld-color: var(--gld-red)}.button--red.button--background{--gld-background: var(--gld-red-transparent--010);--gld-background--hover: var(--gld-red-transparent--020)}.button--green{--gld-color: var(--gld-green)}.button--green.button--background{--gld-background: var(--gld-green-transparent--010);--gld-background--hover: var(--gld-green-transparent--020)}.button--disabled{--gld-color: var(--gld-gray-transparent--060);pointer-events:none;cursor:not-allowed}.button--disabled.button--background{--gld-background: var(--gld-gray-transparent--020);--gld-background--hover: var(--gld-gray-transparent--020)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gld-icon", inputs: ["icon", "size", "space", "moveTopToBottom", "moveLeftToRight", "disabled"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
693
|
+
// Regex para validar números naturales (0, 1, 2, 3, ...)
|
|
694
|
+
const NATURAL_NUMBER_REGEX = /^[0-9]+$/;
|
|
695
|
+
const NATURAL_NUMBER_REGEX_TO_CLEAN = /[^0-9]/g;
|
|
696
|
+
function isNaturalNumberValidator() {
|
|
697
|
+
return (control) => {
|
|
698
|
+
const value = String(control.value).trim();
|
|
699
|
+
if (!value)
|
|
700
|
+
return null;
|
|
701
|
+
if (NATURAL_NUMBER_REGEX.test(value))
|
|
702
|
+
return null;
|
|
703
|
+
return { isNaturalNumber: 'Debes ingresar solo números.' };
|
|
704
|
+
};
|
|
955
705
|
}
|
|
956
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
957
|
-
type: Component,
|
|
958
|
-
args: [{ selector: 'gld-icon-button', imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"button button--{{ color() }}\"\n [class.button--disabled]=\"disabled()\"\n [class.button--background]=\"background()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <!-- Icon -->\n <gld-icon\n [icon]=\"icon()\"\n [size]=\"iconSize()\"\n [space]=\"space()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [disabled]=\"disabled()\" />\n</button>\n\n<!-- Only used by DropdownMenuComponent -->\n<ng-content select=\"[gldDropdownMenuTemplate]\" />\n", styles: [":host{display:inline-block;max-width:inherit}.button{--gld-color: inherit;--gld-background: transparent;--gld-background--hover: transparent;--gld-radius: var(--gld-radius--xxs);--gld-font-size: var(--gld-font-size--normal);outline:none;border:none;padding:var(--gld-spacing--xxxs);border-radius:var(--gld-radius);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size);font-weight:600;line-height:1.25;cursor:pointer;width:inherit;color:var(--gld-color);background:var(--gld-background);display:inline-flex;align-items:center;justify-content:center;gap:var(--gld-spacing--xxxs);-webkit-user-select:none;user-select:none;will-change:background,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover,.button:focus{background:var(--gld-background--hover)}.button:active{transform:scale(.98)}.button--pink{--gld-color: var(--gld-pink)}.button--pink.button--background{--gld-background: var(--gld-pink-transparent--010);--gld-background--hover: var(--gld-pink-transparent--020)}.button--purple{--gld-color: var(--gld-purple)}.button--purple.button--background{--gld-background: var(--gld-purple-transparent--010);--gld-background--hover: var(--gld-purple-transparent--020)}.button--mustard{--gld-color: var(--gld-mustard)}.button--mustard.button--background{--gld-background: var(--gld-mustard-transparent--010);--gld-background--hover: var(--gld-mustard-transparent--020)}.button--orange{--gld-color: var(--gld-orange)}.button--orange.button--background{--gld-background: var(--gld-orange-transparent--010);--gld-background--hover: var(--gld-orange-transparent--020)}.button--blue{--gld-color: var(--gld-blue)}.button--blue.button--background{--gld-background: var(--gld-blue-transparent--010);--gld-background--hover: var(--gld-blue-transparent--020)}.button--red{--gld-color: var(--gld-red)}.button--red.button--background{--gld-background: var(--gld-red-transparent--010);--gld-background--hover: var(--gld-red-transparent--020)}.button--green{--gld-color: var(--gld-green)}.button--green.button--background{--gld-background: var(--gld-green-transparent--010);--gld-background--hover: var(--gld-green-transparent--020)}.button--disabled{--gld-color: var(--gld-gray-transparent--060);pointer-events:none;cursor:not-allowed}.button--disabled.button--background{--gld-background: var(--gld-gray-transparent--020);--gld-background--hover: var(--gld-gray-transparent--020)}\n"] }]
|
|
959
|
-
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], space: [{ type: i0.Input, args: [{ isSignal: true, alias: "space", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
960
706
|
|
|
961
|
-
//
|
|
962
|
-
const
|
|
963
|
-
const
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
moveTopToBottom = input(0, { ...(ngDevMode ? { debugName: "moveTopToBottom" } : {}), transform: numberAttribute });
|
|
974
|
-
moveLeftToRight = input(0, { ...(ngDevMode ? { debugName: "moveLeftToRight" } : {}), transform: numberAttribute });
|
|
975
|
-
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
976
|
-
full = input(false, { ...(ngDevMode ? { debugName: "full" } : {}), transform: booleanAttribute });
|
|
977
|
-
direction = input(DropdownDirection$1.right, { ...(ngDevMode ? { debugName: "direction" } : {}) });
|
|
978
|
-
background = input(false, { ...(ngDevMode ? { debugName: "background" } : {}), transform: booleanAttribute });
|
|
979
|
-
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : {}), transform: booleanAttribute });
|
|
980
|
-
initialValue = input(null, { ...(ngDevMode ? { debugName: "initialValue" } : {}) });
|
|
981
|
-
changeValue = output();
|
|
982
|
-
changeFocus = output();
|
|
983
|
-
dropdownButtonChildren = contentChildren(DropdownButtonComponent, { ...(ngDevMode ? { debugName: "dropdownButtonChildren" } : {}) });
|
|
984
|
-
constructor() {
|
|
985
|
-
effect(() => {
|
|
986
|
-
const initialValue = this.initialValue();
|
|
987
|
-
if (initialValue)
|
|
988
|
-
this.updateCurrentInChildren(initialValue);
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
ngAfterContentInit() {
|
|
992
|
-
this.dropdownButtonChildren().map((dropdownButton) => {
|
|
993
|
-
dropdownButton.changeValue.subscribe((value) => this.updateCurrentInChildren(value));
|
|
994
|
-
});
|
|
995
|
-
}
|
|
996
|
-
updateCurrentInChildren(value) {
|
|
997
|
-
this.dropdownButtonChildren().map((dropdownButton, index) => {
|
|
998
|
-
if (this.selected())
|
|
999
|
-
dropdownButton.current.set(value);
|
|
1000
|
-
// Set current one time
|
|
1001
|
-
if (index === 0)
|
|
1002
|
-
this.changeValue.emit(value);
|
|
1003
|
-
});
|
|
1004
|
-
}
|
|
1005
|
-
updateErrorInChildren(error) {
|
|
1006
|
-
this.dropdownButtonChildren().map((dropdownButton) => dropdownButton.error.set(error));
|
|
1007
|
-
}
|
|
1008
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1009
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: DropdownMenuComponent, isStandalone: true, selector: "gld-dropdown-menu", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, moveTopToBottom: { classPropertyName: "moveTopToBottom", publicName: "moveTopToBottom", isSignal: true, isRequired: false, transformFunction: null }, moveLeftToRight: { classPropertyName: "moveLeftToRight", publicName: "moveLeftToRight", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, full: { classPropertyName: "full", publicName: "full", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValue: "changeValue", changeFocus: "changeFocus" }, queries: [{ propertyName: "dropdownButtonChildren", predicate: DropdownButtonComponent, isSignal: true }], ngImport: i0, template: "<!-- Button -->\n@if (type() === DropdownType.button) {\n <gld-button\n #buttonChild\n [id]=\"id()\"\n [name]=\"name()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [icon]=\"icon()\"\n [iconSize]=\"iconSize()\"\n [disabled]=\"disabled()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [full]=\"full()\">\n <ng-content />\n\n <ng-container gldDropdownMenuTemplate [ngTemplateOutlet]=\"dropdownMenu\" />\n </gld-button>\n} @else {\n <!-- Icon Button -->\n @let innerIcon = icon();\n @if (innerIcon) {\n <gld-icon-button\n #buttonChild\n [id]=\"id()\"\n [name]=\"name()\"\n [color]=\"color()\"\n [icon]=\"innerIcon\"\n [iconSize]=\"iconSize() ?? size()\"\n [disabled]=\"disabled()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [background]=\"background()\">\n <ng-container gldDropdownMenuTemplate [ngTemplateOutlet]=\"dropdownMenu\" />\n </gld-icon-button>\n }\n}\n\n<ng-template #dropdownMenu>\n <!-- Menu -->\n <section\n class=\"dropdown-menu dropdown-menu--{{ type() }} dropdown-menu--{{ size() }}\n dropdown-menu--direction-{{ direction() }}\">\n <ng-content select=\"gld-dropdown-button\">no buttons</ng-content>\n </section>\n</ng-template>\n", styles: [":host{max-width:inherit}.dropdown-menu{--gld-background: light-dark(var(--gld-whitelight), var(--gld-darkblue));--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-radius: var(--gld-radius--xxs);--gld-dropdown-min-width: 100px;--gld-dropdown-bottom-position: 0;padding:var(--gld-spacing--xxxs);border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);background:var(--gld-background);display:none;position:absolute;scale:0;z-index:1;min-width:var(--gld-dropdown-min-width);max-width:inherit}.dropdown-menu--direction-right{left:0;transform-origin:top left;transform:translateY(var(--gld-dropdown-bottom-position))}.dropdown-menu--direction-left{transform-origin:top right;transform:translate(-100%,var(--gld-dropdown-bottom-position))}.dropdown-menu--tiny{--gld-dropdown-bottom-position: 26px}.dropdown-menu--small{--gld-dropdown-bottom-position: 34px}.dropdown-menu--normal{--gld-dropdown-bottom-position: 39px}.dropdown-menu--normal.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 42px}.dropdown-menu--medium{--gld-dropdown-bottom-position: 47px}.dropdown-menu--medium.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 50px}.dropdown-menu--large{--gld-dropdown-bottom-position: 52px}.dropdown-menu--large.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 58px}gld-button:focus-within .dropdown-menu,gld-icon-button:focus-within .dropdown-menu{display:initial;scale:1;z-index:1}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ButtonComponent, selector: "gld-button", inputs: ["id", "name", "color", "size", "icon", "iconSize", "moveTopToBottom", "moveLeftToRight", "disabled", "full"], outputs: ["clicked"] }, { kind: "component", type: IconButtonComponent, selector: "gld-icon-button", inputs: ["icon", "id", "name", "iconSize", "space", "moveTopToBottom", "moveLeftToRight", "background", "disabled", "color"], outputs: ["clicked"] }, { kind: "directive", type: DropdownMenuTemplateDirective$1, selector: "[gldDropdownMenuTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
707
|
+
// Regex para validar string y acepta acentos y espacios
|
|
708
|
+
const STRING_REGEX = /^[a-zA-ZáéíóúÁÉÍÓÚñÑüÜ\s]+$/;
|
|
709
|
+
const STRING_REGEX_TO_CLEAN = /[^a-zA-ZáéíóúÁÉÍÓÚñÑüÜ\s]/g;
|
|
710
|
+
function isStringValidator() {
|
|
711
|
+
return (control) => {
|
|
712
|
+
const value = String(control.value).trim();
|
|
713
|
+
if (!value)
|
|
714
|
+
return null;
|
|
715
|
+
if (STRING_REGEX.test(value))
|
|
716
|
+
return null;
|
|
717
|
+
return { isString: 'Debes ingresar solo caracteres.' };
|
|
718
|
+
};
|
|
1010
719
|
}
|
|
1011
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: DropdownMenuComponent, decorators: [{
|
|
1012
|
-
type: Component,
|
|
1013
|
-
args: [{ selector: 'gld-dropdown-menu', imports: [NgTemplateOutlet, ...components$6, directives], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Button -->\n@if (type() === DropdownType.button) {\n <gld-button\n #buttonChild\n [id]=\"id()\"\n [name]=\"name()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [icon]=\"icon()\"\n [iconSize]=\"iconSize()\"\n [disabled]=\"disabled()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [full]=\"full()\">\n <ng-content />\n\n <ng-container gldDropdownMenuTemplate [ngTemplateOutlet]=\"dropdownMenu\" />\n </gld-button>\n} @else {\n <!-- Icon Button -->\n @let innerIcon = icon();\n @if (innerIcon) {\n <gld-icon-button\n #buttonChild\n [id]=\"id()\"\n [name]=\"name()\"\n [color]=\"color()\"\n [icon]=\"innerIcon\"\n [iconSize]=\"iconSize() ?? size()\"\n [disabled]=\"disabled()\"\n [moveTopToBottom]=\"moveTopToBottom()\"\n [moveLeftToRight]=\"moveLeftToRight()\"\n [background]=\"background()\">\n <ng-container gldDropdownMenuTemplate [ngTemplateOutlet]=\"dropdownMenu\" />\n </gld-icon-button>\n }\n}\n\n<ng-template #dropdownMenu>\n <!-- Menu -->\n <section\n class=\"dropdown-menu dropdown-menu--{{ type() }} dropdown-menu--{{ size() }}\n dropdown-menu--direction-{{ direction() }}\">\n <ng-content select=\"gld-dropdown-button\">no buttons</ng-content>\n </section>\n</ng-template>\n", styles: [":host{max-width:inherit}.dropdown-menu{--gld-background: light-dark(var(--gld-whitelight), var(--gld-darkblue));--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-radius: var(--gld-radius--xxs);--gld-dropdown-min-width: 100px;--gld-dropdown-bottom-position: 0;padding:var(--gld-spacing--xxxs);border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);background:var(--gld-background);display:none;position:absolute;scale:0;z-index:1;min-width:var(--gld-dropdown-min-width);max-width:inherit}.dropdown-menu--direction-right{left:0;transform-origin:top left;transform:translateY(var(--gld-dropdown-bottom-position))}.dropdown-menu--direction-left{transform-origin:top right;transform:translate(-100%,var(--gld-dropdown-bottom-position))}.dropdown-menu--tiny{--gld-dropdown-bottom-position: 26px}.dropdown-menu--small{--gld-dropdown-bottom-position: 34px}.dropdown-menu--normal{--gld-dropdown-bottom-position: 39px}.dropdown-menu--normal.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 42px}.dropdown-menu--medium{--gld-dropdown-bottom-position: 47px}.dropdown-menu--medium.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 50px}.dropdown-menu--large{--gld-dropdown-bottom-position: 52px}.dropdown-menu--large.dropdown-menu--iconButton{--gld-dropdown-bottom-position: 58px}gld-button:focus-within .dropdown-menu,gld-icon-button:focus-within .dropdown-menu{display:initial;scale:1;z-index:1}\n"] }]
|
|
1014
|
-
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], moveTopToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveTopToBottom", required: false }] }], moveLeftToRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "moveLeftToRight", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], full: [{ type: i0.Input, args: [{ isSignal: true, alias: "full", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValue", required: false }] }], changeValue: [{ type: i0.Output, args: ["changeValue"] }], changeFocus: [{ type: i0.Output, args: ["changeFocus"] }], dropdownButtonChildren: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => DropdownButtonComponent), { isSignal: true }] }] } });
|
|
1015
720
|
|
|
1016
|
-
//
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
721
|
+
// import { formatDateFromISOToYYYYMMDD } from '../../utils'
|
|
722
|
+
function minimumAgeValidator({ minAge }) {
|
|
723
|
+
return (control) => {
|
|
724
|
+
// const value = formatDateFromISOToYYYYMMDD(control.value)
|
|
725
|
+
const value = control.value;
|
|
726
|
+
if (!value)
|
|
727
|
+
return null;
|
|
728
|
+
// Verify if the date is valid (additional logic)
|
|
729
|
+
const [year, month, day] = value.split('-').map(Number);
|
|
730
|
+
const birthDay = new Date(year, month - 1, day);
|
|
731
|
+
// Get the current date and calculate the difference in years
|
|
732
|
+
const today = new Date();
|
|
733
|
+
today.setHours(0, 0, 0, 0);
|
|
734
|
+
const age = today.getFullYear() - birthDay.getFullYear();
|
|
735
|
+
const isMonthPast = today.getMonth() > birthDay.getMonth();
|
|
736
|
+
const isSameMonthDayPast = today.getMonth() === birthDay.getMonth() && today.getDate() >= birthDay.getDate();
|
|
737
|
+
const isValidAge = age > minAge || (age === minAge && (isMonthPast || isSameMonthDayPast));
|
|
738
|
+
// Retornar el error si la edad es menor al mínimo
|
|
739
|
+
return isValidAge ? null : { minimumAge: { requiredAge: minAge, actualAge: age } };
|
|
740
|
+
};
|
|
1035
741
|
}
|
|
1036
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: LinkComponent, decorators: [{
|
|
1037
|
-
type: Component,
|
|
1038
|
-
args: [{ selector: 'gld-link', standalone: true, imports: [NgTemplateOutlet, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (external()) {\n <!-- It's external link -->\n <ng-container\n [ngTemplateOutlet]=\"buttonTemplate\"\n [ngTemplateOutletContext]=\"{ buttonType: 'anchor' }\" />\n} @else {\n <!-- It isn't external link -->\n <ng-container\n [ngTemplateOutlet]=\"buttonTemplate\"\n [ngTemplateOutletContext]=\"{ buttonType: 'button' }\" />\n}\n\n<!-- Button Template -->\n<ng-template #buttonTemplate let-buttonType=\"buttonType\">\n @switch (buttonType) {\n @case ('anchor') {\n <a\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n [href]=\"redirect()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\"\n target=\"_blank\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </a>\n }\n @case ('button') {\n @if (redirect()) {\n <!-- It has path to redirect -->\n <button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\"\n [routerLink]=\"redirect()\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </button>\n } @else {\n <!-- It doesn't have path to redirect -->\n <button\n id=\"{{ id() }}\"\n attr.aria-label=\"{{ name() }}\"\n class=\"link link--{{ align() }}\"\n [class.link--active]=\"active()\"\n (click)=\"emitClick()\"\n (keyup.enter)=\"keyup()\">\n <ng-container [ngTemplateOutlet]=\"contentButtonTemplate\" />\n </button>\n }\n }\n }\n</ng-template>\n\n<!-- Content Button Template -->\n<ng-template #contentButtonTemplate>\n <ng-content />\n</ng-template>\n", styles: [":host{position:relative;z-index:1}.link{--gld-color: var(--gld-foreground-color);position:relative;display:inline-flex;align-items:center;padding:0;font:600 var(--gld-font-size--normal)/var(--gld-line-height) var(--gld-font--poppins);color:var(--gld-color);background:none;border:none;cursor:pointer;text-decoration:underline;will-change:color;transition:color var(--gld-animation-time--150)}.link--active,.link:active,.link:hover{--gld-color: var(--gld-purple)}.link--left{text-align:left}.link--right{text-align:right}.link--center{text-align:center}\n"] }]
|
|
1039
|
-
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], redirect: [{ type: i0.Input, args: [{ isSignal: true, alias: "redirect", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], external: [{ type: i0.Input, args: [{ isSignal: true, alias: "external", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
1040
742
|
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
}
|
|
1055
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ToggleButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1056
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: ToggleButtonComponent, isStandalone: true, selector: "gld-toggle-button", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { changeValue: "changeValue" }, ngImport: i0, template: "<button\r\n [tabindex]=\"disabled() ? '-1' : '0'\"\r\n class=\"button\"\r\n [class.button--selected]=\"selected()\"\r\n (keyup.enter)=\"keyup(value())\"\r\n (click)=\"select(value())\">\r\n <ng-content> empty button </ng-content>\r\n</button>\r\n", styles: [".button{--gld-background: transparent;--gld-background--hover: var(--gld-pink-transparent--010);--gld-color: var(--gld-foreground-color);--gld-color--selected: var(--gld-pink);--gld-color--hover: var(--gld-blue);--gld-radius: var(--gld-radius--xxxs);padding:var(--gld-spacing--xxxs);width:100%;height:100%;max-width:100%;background:var(--gld-background);color:var(--gld-color);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:var(--gld-line-height);-webkit-user-select:none;user-select:none;outline:none;border:none;border-radius:var(--gld-radius);cursor:pointer;will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover{--gld-color: var(--gld-color--hover)}.button:active{transform:scale(.95)}.button--selected{--gld-background: var(--gld-background--hover);--gld-color: var(--gld-color--selected)}.button--selected:hover{--gld-color: var(--gld-color--selected)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
743
|
+
function mustMatchValidator({ controlName, mustMatchControlName, errorMessage, }) {
|
|
744
|
+
return (formGroup) => {
|
|
745
|
+
const firstControl = formGroup.get(controlName);
|
|
746
|
+
const mustMatchControl = formGroup.get(mustMatchControlName);
|
|
747
|
+
// Validar que ambos controles existan
|
|
748
|
+
if (!firstControl || !mustMatchControl)
|
|
749
|
+
return null;
|
|
750
|
+
// Verificar si los valores coinciden
|
|
751
|
+
if (firstControl.value && firstControl.value !== mustMatchControl.value) {
|
|
752
|
+
mustMatchControl.setErrors({ ...mustMatchControl.errors, mustMatch: errorMessage ?? true });
|
|
753
|
+
return { mustMatch: errorMessage ?? true };
|
|
754
|
+
}
|
|
755
|
+
return null; // Es válido si no hay errores
|
|
756
|
+
};
|
|
1057
757
|
}
|
|
1058
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ToggleButtonComponent, decorators: [{
|
|
1059
|
-
type: Component,
|
|
1060
|
-
args: [{ selector: 'gld-toggle-button', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\r\n [tabindex]=\"disabled() ? '-1' : '0'\"\r\n class=\"button\"\r\n [class.button--selected]=\"selected()\"\r\n (keyup.enter)=\"keyup(value())\"\r\n (click)=\"select(value())\">\r\n <ng-content> empty button </ng-content>\r\n</button>\r\n", styles: [".button{--gld-background: transparent;--gld-background--hover: var(--gld-pink-transparent--010);--gld-color: var(--gld-foreground-color);--gld-color--selected: var(--gld-pink);--gld-color--hover: var(--gld-blue);--gld-radius: var(--gld-radius--xxxs);padding:var(--gld-spacing--xxxs);width:100%;height:100%;max-width:100%;background:var(--gld-background);color:var(--gld-color);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:var(--gld-line-height);-webkit-user-select:none;user-select:none;outline:none;border:none;border-radius:var(--gld-radius);cursor:pointer;will-change:background,transform,color;transition:background var(--gld-animation-time--150),transform var(--gld-animation-time--150),color var(--gld-animation-time--150)}.button:hover{--gld-color: var(--gld-color--hover)}.button:active{transform:scale(.95)}.button--selected{--gld-background: var(--gld-background--hover);--gld-color: var(--gld-color--selected)}.button--selected:hover{--gld-color: var(--gld-color--selected)}\n"] }]
|
|
1061
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], changeValue: [{ type: i0.Output, args: ["changeValue"] }] } });
|
|
1062
758
|
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
toggleButton.changeValue.subscribe((value) => this.updateCurrentInChildren(value));
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
updateCurrentInChildren(value) {
|
|
1084
|
-
this.toggleButtonChildren().map((toggleButton, index) => {
|
|
1085
|
-
toggleButton.current.set(value);
|
|
1086
|
-
// Set current one time
|
|
1087
|
-
if (index === 0)
|
|
1088
|
-
this.changeValue.emit(value);
|
|
1089
|
-
});
|
|
1090
|
-
}
|
|
1091
|
-
updateErrorInChildren(error) {
|
|
1092
|
-
this.toggleButtonChildren().map((toggleButton) => toggleButton.error.set(error));
|
|
1093
|
-
}
|
|
1094
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ToggleGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1095
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.1", type: ToggleGroupComponent, isStandalone: true, selector: "gld-toggle-group", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValue: "changeValue", changeFocus: "changeFocus" }, queries: [{ propertyName: "toggleButtonChildren", predicate: ToggleButtonComponent, isSignal: true }], ngImport: i0, template: "<section class=\"toggle\" id=\"{{ id() }}\" [attr.name]=\"name()\">\n <ng-content select=\"gld-toggle-button\" />\n</section>\n", styles: [":host{display:inline-block}.toggle{--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-radius: var(--gld-radius--xxs);padding:2px;border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);display:flex}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
759
|
+
function mustUnmatchValidator({ controlName, mustUnmatchControlName, errorMessage, }) {
|
|
760
|
+
return (formGroup) => {
|
|
761
|
+
const firstControl = formGroup.get(controlName);
|
|
762
|
+
const mustUnmatchControl = formGroup.get(mustUnmatchControlName);
|
|
763
|
+
// Validar que ambos controles existan
|
|
764
|
+
if (!firstControl || !mustUnmatchControl)
|
|
765
|
+
return null;
|
|
766
|
+
// Verificar si los valores coinciden
|
|
767
|
+
if (firstControl.value && firstControl.value === mustUnmatchControl.value) {
|
|
768
|
+
mustUnmatchControl.setErrors({
|
|
769
|
+
...mustUnmatchControl.errors,
|
|
770
|
+
mustUnmatch: errorMessage ?? true,
|
|
771
|
+
});
|
|
772
|
+
return { mustUnmatch: errorMessage ?? true };
|
|
773
|
+
}
|
|
774
|
+
return null; // Es válido si no hay errores
|
|
775
|
+
};
|
|
1096
776
|
}
|
|
1097
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ToggleGroupComponent, decorators: [{
|
|
1098
|
-
type: Component,
|
|
1099
|
-
args: [{ selector: 'gld-toggle-group', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section class=\"toggle\" id=\"{{ id() }}\" [attr.name]=\"name()\">\n <ng-content select=\"gld-toggle-button\" />\n</section>\n", styles: [":host{display:inline-block}.toggle{--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-radius: var(--gld-radius--xxs);padding:2px;border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);display:flex}\n"] }]
|
|
1100
|
-
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValue", required: false }] }], changeValue: [{ type: i0.Output, args: ["changeValue"] }], changeFocus: [{ type: i0.Output, args: ["changeFocus"] }], toggleButtonChildren: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ToggleButtonComponent), { isSignal: true }] }] } });
|
|
1101
777
|
|
|
1102
778
|
// Angular Imports
|
|
1103
779
|
class InputErrorComponent {
|
|
1104
780
|
Boolean = Boolean;
|
|
1105
781
|
errors = input.required({ ...(ngDevMode ? { debugName: "errors" } : {}) });
|
|
1106
782
|
border = input(false, { ...(ngDevMode ? { debugName: "border" } : {}), transform: booleanAttribute });
|
|
1107
|
-
content = contentChildren(InputErrorMessageDirective
|
|
783
|
+
content = contentChildren(InputErrorMessageDirective, { ...(ngDevMode ? { debugName: "content" } : {}), descendants: true });
|
|
1108
784
|
hasContent = signal(false, { ...(ngDevMode ? { debugName: "hasContent" } : {}) });
|
|
1109
785
|
firstErrorKey = signal(null, { ...(ngDevMode ? { debugName: "firstErrorKey" } : {}) });
|
|
1110
786
|
constructor() {
|
|
@@ -1117,27 +793,26 @@ class InputErrorComponent {
|
|
|
1117
793
|
this.firstErrorKey.set(Object.keys(errors || {})[0] ?? null);
|
|
1118
794
|
}
|
|
1119
795
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1120
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: InputErrorComponent, isStandalone: true, selector: "gld-input-error", inputs: { errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: true, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "content", predicate: InputErrorMessageDirective
|
|
796
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: InputErrorComponent, isStandalone: true, selector: "gld-input-error", inputs: { errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: true, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "content", predicate: InputErrorMessageDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<section class=\"error\" [class.error--with-border]=\"border()\">\n <span class=\"error__message\">\n @if (hasContent()) {\n <ng-content />\n } @else {\n <ng-container [ngTemplateOutlet]=\"errorsMessageDefault\" />\n }\n </span>\n</section>\n\n<ng-template #errorsMessageDefault>\n @switch (firstErrorKey()) {\n @case ('required') {\n This field is required!\n }\n @case ('email') {\n {{ this.errors()?.['email'] }}\n }\n @case ('maxlength') {\n This field must have a maximum of\n {{ this.errors()?.['maxlength'].requiredLength }}\n characters!\n }\n @case ('minlength') {\n This field must have a minimum of\n {{ this.errors()?.['minlength'].requiredLength }}\n characters!\n }\n @case ('isDate') {\n {{ this.errors()?.['isDate'] }}\n }\n @case ('minimumAge') {\n This field must meet the minimum age requirement of\n {{ this.errors()?.['minimumAge'].requiredAge }} years\n }\n @case ('isNaturalNumber') {\n {{ this.errors()?.['isNaturalNumber'] }}\n }\n @case ('mustMatch') {\n {{ this.errors()?.['mustMatch'] }}\n }\n @case ('mustUnmatch') {\n {{ this.errors()?.['mustUnmatch'] }}\n }\n @case ('isString') {\n {{ this.errors()?.['isString'] }}\n }\n @default {\n empty error message\n }\n }\n</ng-template>\n", styles: [".error{--gld-color: var(--gld-red);--gld-background: var(--gld-red-transparent--010);--gld-radius: var(--gld-radius--xxs);--gld-border-color: var(--gld-red);color:var(--gld-color);background:var(--gld-background);border-radius:0 0 var(--gld-radius) var(--gld-radius);padding:var(--gld-spacing--xxxs) var(--gld-spacing--xxs);display:flex;align-items:flex-start;gap:var(--gld-spacing--xxxs)}.error__icon{display:flex;align-items:center}.error__message{font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--small);font-weight:400;line-height:1.25;text-transform:lowercase}.error__message:first-letter{text-transform:uppercase}.error--with-border{border-top:var(--gld-border-size) solid var(--gld-border-color)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1121
797
|
}
|
|
1122
798
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputErrorComponent, decorators: [{
|
|
1123
799
|
type: Component,
|
|
1124
800
|
args: [{ selector: 'gld-input-error', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section class=\"error\" [class.error--with-border]=\"border()\">\n <span class=\"error__message\">\n @if (hasContent()) {\n <ng-content />\n } @else {\n <ng-container [ngTemplateOutlet]=\"errorsMessageDefault\" />\n }\n </span>\n</section>\n\n<ng-template #errorsMessageDefault>\n @switch (firstErrorKey()) {\n @case ('required') {\n This field is required!\n }\n @case ('email') {\n {{ this.errors()?.['email'] }}\n }\n @case ('maxlength') {\n This field must have a maximum of\n {{ this.errors()?.['maxlength'].requiredLength }}\n characters!\n }\n @case ('minlength') {\n This field must have a minimum of\n {{ this.errors()?.['minlength'].requiredLength }}\n characters!\n }\n @case ('isDate') {\n {{ this.errors()?.['isDate'] }}\n }\n @case ('minimumAge') {\n This field must meet the minimum age requirement of\n {{ this.errors()?.['minimumAge'].requiredAge }} years\n }\n @case ('isNaturalNumber') {\n {{ this.errors()?.['isNaturalNumber'] }}\n }\n @case ('mustMatch') {\n {{ this.errors()?.['mustMatch'] }}\n }\n @case ('mustUnmatch') {\n {{ this.errors()?.['mustUnmatch'] }}\n }\n @case ('isString') {\n {{ this.errors()?.['isString'] }}\n }\n @default {\n empty error message\n }\n }\n</ng-template>\n", styles: [".error{--gld-color: var(--gld-red);--gld-background: var(--gld-red-transparent--010);--gld-radius: var(--gld-radius--xxs);--gld-border-color: var(--gld-red);color:var(--gld-color);background:var(--gld-background);border-radius:0 0 var(--gld-radius) var(--gld-radius);padding:var(--gld-spacing--xxxs) var(--gld-spacing--xxs);display:flex;align-items:flex-start;gap:var(--gld-spacing--xxxs)}.error__icon{display:flex;align-items:center}.error__message{font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--small);font-weight:400;line-height:1.25;text-transform:lowercase}.error__message:first-letter{text-transform:uppercase}.error--with-border{border-top:var(--gld-border-size) solid var(--gld-border-color)}\n"] }]
|
|
1125
|
-
}], ctorParameters: () => [], propDecorators: { errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: true }] }], border: [{ type: i0.Input, args: [{ isSignal: true, alias: "border", required: false }] }], content: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => InputErrorMessageDirective
|
|
801
|
+
}], ctorParameters: () => [], propDecorators: { errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: true }] }], border: [{ type: i0.Input, args: [{ isSignal: true, alias: "border", required: false }] }], content: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => InputErrorMessageDirective), { ...{
|
|
1126
802
|
descendants: true,
|
|
1127
803
|
}, isSignal: true }] }] } });
|
|
1128
804
|
|
|
1129
805
|
// Angular Imports
|
|
1130
806
|
const components$5 = [InputErrorComponent];
|
|
1131
|
-
class
|
|
807
|
+
class InputComponent {
|
|
1132
808
|
#destroyRef = inject(DestroyRef);
|
|
1133
809
|
#changeDetectorRef = inject(ChangeDetectorRef);
|
|
1134
810
|
control = input.required({ ...(ngDevMode ? { debugName: "control" } : {}) });
|
|
1135
811
|
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `input-id-${value.trim().split(' ').join('-')}` });
|
|
1136
812
|
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `input-name-${value.trim().split(' ').join('-')}` });
|
|
1137
813
|
label = input('', { ...(ngDevMode ? { debugName: "label" } : {}) });
|
|
1138
|
-
min = input('', { ...(ngDevMode ? { debugName: "min" } : {}), transform: (value) => formatISODateToDDMMYYYY$1({ date: value }) });
|
|
1139
|
-
max = input('', { ...(ngDevMode ? { debugName: "max" } : {}), transform: (value) => formatISODateToDDMMYYYY$1({ date: value }) });
|
|
1140
814
|
placeholder = input('', { ...(ngDevMode ? { debugName: "placeholder" } : {}) });
|
|
815
|
+
type = input('text', { ...(ngDevMode ? { debugName: "type" } : {}) });
|
|
1141
816
|
mask = input('', { ...(ngDevMode ? { debugName: "mask" } : {}) });
|
|
1142
817
|
suffix = input(false, { ...(ngDevMode ? { debugName: "suffix" } : {}), transform: booleanAttribute });
|
|
1143
818
|
innerControl = signal(new FormControl('', { nonNullable: true }), { ...(ngDevMode ? { debugName: "innerControl" } : {}) });
|
|
@@ -1147,32 +822,45 @@ class InputDateComponent {
|
|
|
1147
822
|
string: false,
|
|
1148
823
|
maxLength: null,
|
|
1149
824
|
}, { ...(ngDevMode ? { debugName: "hasValidators" } : {}) });
|
|
1150
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
|
|
1151
825
|
onChange = (value) => { };
|
|
1152
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1153
826
|
onTouched = () => { };
|
|
1154
827
|
constructor() {
|
|
1155
828
|
this.innerControl()
|
|
1156
829
|
.valueChanges.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
1157
830
|
.subscribe((value) => {
|
|
831
|
+
let _value = value;
|
|
1158
832
|
/**
|
|
1159
|
-
* Removes all non-digit
|
|
1160
|
-
* This sanitizes the
|
|
1161
|
-
* which are typically used in date formats like MM/DD/YYYY or DD/MM/YYYY.
|
|
833
|
+
* Removes all non-digit characters from the input value string.
|
|
834
|
+
* This sanitizes the value input by keeping only numbers (0-9)
|
|
1162
835
|
*
|
|
1163
836
|
* @example
|
|
1164
837
|
* // Input: "12/34/abcd2023!@_"
|
|
1165
|
-
* // Output: "
|
|
838
|
+
* // Output: "12342023"
|
|
1166
839
|
*/
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
this.innerControl().setValue(masked, { emitEvent: false });
|
|
840
|
+
if (String(value) && this.hasValidators().naturalNumber) {
|
|
841
|
+
_value = String(value).replaceAll(NATURAL_NUMBER_REGEX_TO_CLEAN, '');
|
|
842
|
+
this.innerControl().markAsUntouched();
|
|
1171
843
|
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
844
|
+
/**
|
|
845
|
+
* Removes all non-letter and non-space characters from the input value string.
|
|
846
|
+
* This sanitizes the value input by keeping only letters (a-z, A-Z, with accents like á, é, í, ó, ú, ñ) and spaces.
|
|
847
|
+
* Numbers, special characters, and symbols are removed.
|
|
848
|
+
*
|
|
849
|
+
* @example
|
|
850
|
+
* // Input: "Juan123@García#456 Pérez$"
|
|
851
|
+
* // Output: "JuanGarcía Pérez"
|
|
852
|
+
*/
|
|
853
|
+
if (String(value) && this.hasValidators().string) {
|
|
854
|
+
_value = String(value).replaceAll(STRING_REGEX_TO_CLEAN, '');
|
|
855
|
+
this.innerControl().markAsUntouched();
|
|
856
|
+
}
|
|
857
|
+
// Apply mask depends on the mask input
|
|
858
|
+
if (value && Boolean(this.mask())) {
|
|
859
|
+
const mask = updateValueWithMask({ value: String(_value), mask: this.mask() });
|
|
860
|
+
this.innerControl().setValue(mask, { emitEvent: false });
|
|
861
|
+
}
|
|
862
|
+
// Emit value
|
|
863
|
+
this.onChange(_value);
|
|
1176
864
|
});
|
|
1177
865
|
}
|
|
1178
866
|
ngOnInit() {
|
|
@@ -1190,7 +878,7 @@ class InputDateComponent {
|
|
|
1190
878
|
writeValue(value) {
|
|
1191
879
|
// console.log('writeValue')
|
|
1192
880
|
if (value !== this.innerControl().value)
|
|
1193
|
-
this.innerControl().setValue(
|
|
881
|
+
this.innerControl().setValue(value);
|
|
1194
882
|
}
|
|
1195
883
|
registerOnChange(onChange) {
|
|
1196
884
|
// console.log('registerOnChange')
|
|
@@ -1236,47 +924,38 @@ class InputDateComponent {
|
|
|
1236
924
|
});
|
|
1237
925
|
// console.log('hasValidators', this.hasValidators())
|
|
1238
926
|
}
|
|
1239
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
1240
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type:
|
|
927
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
928
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: InputComponent, isStandalone: true, selector: "gld-input", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1241
929
|
{
|
|
1242
930
|
provide: NG_VALUE_ACCESSOR,
|
|
1243
|
-
useExisting: forwardRef(() =>
|
|
931
|
+
useExisting: forwardRef(() => InputComponent),
|
|
1244
932
|
multi: true,
|
|
1245
933
|
},
|
|
1246
|
-
], ngImport: i0, template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <input\n
|
|
934
|
+
], ngImport: i0, template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <input\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onTouched()\"\n (keyup.escape)=\"onBlur()\" />\n\n <!-- Suffix -->\n @if (suffix()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n }\n</section>\n<!-- Errors -->\n@if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n} @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n}\n\n<!-- Suffix Template -->\n<ng-template #suffixTemplate>\n <span tabindex=\"-1\" class=\"input-icon\" [class.input-icon--error]=\"errors\">\n <ng-content select=\"[inputSuffix]\" />\n </span>\n</ng-template>\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n<!-- <section>status: {{ control().status }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-height: 40px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input input{width:100%;min-width:var(--gld-min-with);height:var(--gld-height);padding:var(--gld-spacing--xxs);padding-right:var(--gld-spacing--m);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input input:focus{--gld-border-color: var(--gld-blue)}.input input::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:0;display:inline-block;color:var(--gld-color);will-change:transform,color;transition:color var(--gld-animation-time) ease;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputErrorComponent, selector: "gld-input-error", inputs: ["errors", "border"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1247
935
|
}
|
|
1248
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
936
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputComponent, decorators: [{
|
|
1249
937
|
type: Component,
|
|
1250
|
-
args: [{ selector: 'gld-input
|
|
938
|
+
args: [{ selector: 'gld-input', standalone: true, imports: [ReactiveFormsModule, NgTemplateOutlet, ...components$5], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1251
939
|
{
|
|
1252
940
|
provide: NG_VALUE_ACCESSOR,
|
|
1253
|
-
useExisting: forwardRef(() =>
|
|
941
|
+
useExisting: forwardRef(() => InputComponent),
|
|
1254
942
|
multi: true,
|
|
1255
|
-
},
|
|
1256
|
-
], template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <input\n
|
|
1257
|
-
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }],
|
|
1258
|
-
|
|
1259
|
-
// Angular Imports
|
|
1260
|
-
class InputHintComponent {
|
|
1261
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1262
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.1", type: InputHintComponent, isStandalone: true, selector: "gld-input-hint", ngImport: i0, template: "<section class=\"hint\">\r\n <span class=\"hint__message\">\r\n <ng-content>hint empty</ng-content>\r\n </span>\r\n</section>\r\n", styles: [".hint{--gld-color: var(--gld-foreground-color);--gld-background: var(--gld-gray-transparent--020);--gld-radius: var(--gld-radius--xxs);color:var(--gld-color);background:var(--gld-background);border-radius:0 0 var(--gld-radius) var(--gld-radius);padding:var(--gld-spacing--xxxs) var(--gld-spacing--xxs);display:flex;align-items:flex-start;gap:var(--gld-spacing--xxxs)}.hint__icon{display:flex;align-items:center}.hint__message{font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--small);font-weight:400;line-height:1.25;text-transform:lowercase}.hint__message:first-letter{text-transform:uppercase}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1263
|
-
}
|
|
1264
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputHintComponent, decorators: [{
|
|
1265
|
-
type: Component,
|
|
1266
|
-
args: [{ selector: 'gld-input-hint', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section class=\"hint\">\r\n <span class=\"hint__message\">\r\n <ng-content>hint empty</ng-content>\r\n </span>\r\n</section>\r\n", styles: [".hint{--gld-color: var(--gld-foreground-color);--gld-background: var(--gld-gray-transparent--020);--gld-radius: var(--gld-radius--xxs);color:var(--gld-color);background:var(--gld-background);border-radius:0 0 var(--gld-radius) var(--gld-radius);padding:var(--gld-spacing--xxxs) var(--gld-spacing--xxs);display:flex;align-items:flex-start;gap:var(--gld-spacing--xxxs)}.hint__icon{display:flex;align-items:center}.hint__message{font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--small);font-weight:400;line-height:1.25;text-transform:lowercase}.hint__message:first-letter{text-transform:uppercase}\n"] }]
|
|
1267
|
-
}] });
|
|
943
|
+
},
|
|
944
|
+
], template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <input\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onTouched()\"\n (keyup.escape)=\"onBlur()\" />\n\n <!-- Suffix -->\n @if (suffix()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n }\n</section>\n<!-- Errors -->\n@if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n} @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n}\n\n<!-- Suffix Template -->\n<ng-template #suffixTemplate>\n <span tabindex=\"-1\" class=\"input-icon\" [class.input-icon--error]=\"errors\">\n <ng-content select=\"[inputSuffix]\" />\n </span>\n</ng-template>\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n<!-- <section>status: {{ control().status }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-height: 40px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input input{width:100%;min-width:var(--gld-min-with);height:var(--gld-height);padding:var(--gld-spacing--xxs);padding-right:var(--gld-spacing--m);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input input:focus{--gld-border-color: var(--gld-blue)}.input input::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:0;display:inline-block;color:var(--gld-color);will-change:transform,color;transition:color var(--gld-animation-time) ease;cursor:pointer}\n"] }]
|
|
945
|
+
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }] } });
|
|
1268
946
|
|
|
1269
947
|
// Angular Imports
|
|
1270
948
|
const components$4 = [InputErrorComponent];
|
|
1271
|
-
class
|
|
949
|
+
class InputDateComponent {
|
|
1272
950
|
#destroyRef = inject(DestroyRef);
|
|
1273
951
|
#changeDetectorRef = inject(ChangeDetectorRef);
|
|
1274
952
|
control = input.required({ ...(ngDevMode ? { debugName: "control" } : {}) });
|
|
1275
953
|
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `input-id-${value.trim().split(' ').join('-')}` });
|
|
1276
954
|
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `input-name-${value.trim().split(' ').join('-')}` });
|
|
1277
955
|
label = input('', { ...(ngDevMode ? { debugName: "label" } : {}) });
|
|
956
|
+
min = input('', { ...(ngDevMode ? { debugName: "min" } : {}), transform: (value) => formatISODateToDDMMYYYY({ date: value }) });
|
|
957
|
+
max = input('', { ...(ngDevMode ? { debugName: "max" } : {}), transform: (value) => formatISODateToDDMMYYYY({ date: value }) });
|
|
1278
958
|
placeholder = input('', { ...(ngDevMode ? { debugName: "placeholder" } : {}) });
|
|
1279
|
-
type = input('text', { ...(ngDevMode ? { debugName: "type" } : {}) });
|
|
1280
959
|
mask = input('', { ...(ngDevMode ? { debugName: "mask" } : {}) });
|
|
1281
960
|
suffix = input(false, { ...(ngDevMode ? { debugName: "suffix" } : {}), transform: booleanAttribute });
|
|
1282
961
|
innerControl = signal(new FormControl('', { nonNullable: true }), { ...(ngDevMode ? { debugName: "innerControl" } : {}) });
|
|
@@ -1286,47 +965,30 @@ class InputComponent {
|
|
|
1286
965
|
string: false,
|
|
1287
966
|
maxLength: null,
|
|
1288
967
|
}, { ...(ngDevMode ? { debugName: "hasValidators" } : {}) });
|
|
1289
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
|
|
1290
968
|
onChange = (value) => { };
|
|
1291
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1292
969
|
onTouched = () => { };
|
|
1293
970
|
constructor() {
|
|
1294
971
|
this.innerControl()
|
|
1295
972
|
.valueChanges.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
1296
973
|
.subscribe((value) => {
|
|
1297
|
-
let _value = value;
|
|
1298
974
|
/**
|
|
1299
|
-
* Removes all non-digit characters from the input value string.
|
|
1300
|
-
* This sanitizes the
|
|
975
|
+
* Removes all non-digit and non-slash characters from the input value string.
|
|
976
|
+
* This sanitizes the date input by keeping only numbers (0-9) and forward slashes (/)
|
|
977
|
+
* which are typically used in date formats like MM/DD/YYYY or DD/MM/YYYY.
|
|
1301
978
|
*
|
|
1302
979
|
* @example
|
|
1303
980
|
* // Input: "12/34/abcd2023!@_"
|
|
1304
|
-
* // Output: "
|
|
1305
|
-
*/
|
|
1306
|
-
if (String(value) && this.hasValidators().naturalNumber) {
|
|
1307
|
-
_value = String(value).replaceAll(NATURAL_NUMBER_REGEX_TO_CLEAN$1, '');
|
|
1308
|
-
this.innerControl().markAsUntouched();
|
|
1309
|
-
}
|
|
1310
|
-
/**
|
|
1311
|
-
* Removes all non-letter and non-space characters from the input value string.
|
|
1312
|
-
* This sanitizes the value input by keeping only letters (a-z, A-Z, with accents like á, é, í, ó, ú, ñ) and spaces.
|
|
1313
|
-
* Numbers, special characters, and symbols are removed.
|
|
1314
|
-
*
|
|
1315
|
-
* @example
|
|
1316
|
-
* // Input: "Juan123@García#456 Pérez$"
|
|
1317
|
-
* // Output: "JuanGarcía Pérez"
|
|
981
|
+
* // Output: "12/34/2023"
|
|
1318
982
|
*/
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
this.
|
|
1322
|
-
|
|
1323
|
-
// Apply mask depends on the mask input
|
|
1324
|
-
if (value && Boolean(this.mask())) {
|
|
1325
|
-
const mask = updateValueWithMask$1({ value: String(_value), mask: this.mask() });
|
|
1326
|
-
this.innerControl().setValue(mask, { emitEvent: false });
|
|
983
|
+
const _value = String(value).replaceAll(/[^\d/]/g, '');
|
|
984
|
+
if (String(value) && Boolean(this.mask())) {
|
|
985
|
+
const masked = updateValueWithMask({ value: _value, mask: this.mask() });
|
|
986
|
+
this.innerControl().setValue(masked, { emitEvent: false });
|
|
1327
987
|
}
|
|
1328
|
-
|
|
1329
|
-
|
|
988
|
+
const valueTransformed = formatDDMMYYYYToISODate({
|
|
989
|
+
date: _value,
|
|
990
|
+
});
|
|
991
|
+
this.onChange(valueTransformed ?? 'Invalid Date');
|
|
1330
992
|
});
|
|
1331
993
|
}
|
|
1332
994
|
ngOnInit() {
|
|
@@ -1344,7 +1006,7 @@ class InputComponent {
|
|
|
1344
1006
|
writeValue(value) {
|
|
1345
1007
|
// console.log('writeValue')
|
|
1346
1008
|
if (value !== this.innerControl().value)
|
|
1347
|
-
this.innerControl().setValue(value);
|
|
1009
|
+
this.innerControl().setValue(String(value));
|
|
1348
1010
|
}
|
|
1349
1011
|
registerOnChange(onChange) {
|
|
1350
1012
|
// console.log('registerOnChange')
|
|
@@ -1390,25 +1052,35 @@ class InputComponent {
|
|
|
1390
1052
|
});
|
|
1391
1053
|
// console.log('hasValidators', this.hasValidators())
|
|
1392
1054
|
}
|
|
1393
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
1394
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type:
|
|
1055
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1056
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: InputDateComponent, isStandalone: true, selector: "gld-input-date", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1395
1057
|
{
|
|
1396
1058
|
provide: NG_VALUE_ACCESSOR,
|
|
1397
|
-
useExisting: forwardRef(() =>
|
|
1059
|
+
useExisting: forwardRef(() => InputDateComponent),
|
|
1398
1060
|
multi: true,
|
|
1399
1061
|
},
|
|
1400
|
-
], ngImport: i0, template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <input\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [
|
|
1062
|
+
], ngImport: i0, template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <input\n type=\"date\"\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onTouched()\"\n (keyup.escape)=\"onBlur()\" />\n\n <!-- Suffix -->\n @if (suffix()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n }\n</section>\n<!-- Errors -->\n@if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n} @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n}\n\n<!-- Suffix Template -->\n<ng-template #suffixTemplate>\n <span tabindex=\"-1\" class=\"input-icon\" [class.input-icon--error]=\"errors\">\n <ng-content select=\"[inputSuffix]\" />\n </span>\n</ng-template>\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n<!-- <section>status: {{ control().status }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-height: 40px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input input{width:100%;min-width:var(--gld-min-with);height:var(--gld-height);padding:var(--gld-spacing--xxs);padding-right:var(--gld-spacing--m);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input input:focus{--gld-border-color: var(--gld-blue)}.input input::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:0;display:inline-block;color:var(--gld-color);will-change:transform,color;transition:color var(--gld-animation-time) ease;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputErrorComponent, selector: "gld-input-error", inputs: ["errors", "border"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1401
1063
|
}
|
|
1402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
1064
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputDateComponent, decorators: [{
|
|
1403
1065
|
type: Component,
|
|
1404
|
-
args: [{ selector: 'gld-input', standalone: true, imports: [ReactiveFormsModule, NgTemplateOutlet, ...components$4], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1066
|
+
args: [{ selector: 'gld-input-date', standalone: true, imports: [ReactiveFormsModule, NgTemplateOutlet, ...components$4], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1405
1067
|
{
|
|
1406
1068
|
provide: NG_VALUE_ACCESSOR,
|
|
1407
|
-
useExisting: forwardRef(() =>
|
|
1069
|
+
useExisting: forwardRef(() => InputDateComponent),
|
|
1408
1070
|
multi: true,
|
|
1409
1071
|
},
|
|
1410
|
-
], template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <input\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [
|
|
1411
|
-
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }],
|
|
1072
|
+
], template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <input\n type=\"date\"\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onTouched()\"\n (keyup.escape)=\"onBlur()\" />\n\n <!-- Suffix -->\n @if (suffix()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n }\n</section>\n<!-- Errors -->\n@if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n} @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n}\n\n<!-- Suffix Template -->\n<ng-template #suffixTemplate>\n <span tabindex=\"-1\" class=\"input-icon\" [class.input-icon--error]=\"errors\">\n <ng-content select=\"[inputSuffix]\" />\n </span>\n</ng-template>\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n<!-- <section>status: {{ control().status }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-height: 40px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input input{width:100%;min-width:var(--gld-min-with);height:var(--gld-height);padding:var(--gld-spacing--xxs);padding-right:var(--gld-spacing--m);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input input:focus{--gld-border-color: var(--gld-blue)}.input input::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:0;display:inline-block;color:var(--gld-color);will-change:transform,color;transition:color var(--gld-animation-time) ease;cursor:pointer}\n"] }]
|
|
1073
|
+
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }] } });
|
|
1074
|
+
|
|
1075
|
+
// Angular Imports
|
|
1076
|
+
class InputHintComponent {
|
|
1077
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1078
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.1", type: InputHintComponent, isStandalone: true, selector: "gld-input-hint", ngImport: i0, template: "<section class=\"hint\">\r\n <span class=\"hint__message\">\r\n <ng-content>hint empty</ng-content>\r\n </span>\r\n</section>\r\n", styles: [".hint{--gld-color: var(--gld-foreground-color);--gld-background: var(--gld-gray-transparent--020);--gld-radius: var(--gld-radius--xxs);color:var(--gld-color);background:var(--gld-background);border-radius:0 0 var(--gld-radius) var(--gld-radius);padding:var(--gld-spacing--xxxs) var(--gld-spacing--xxs);display:flex;align-items:flex-start;gap:var(--gld-spacing--xxxs)}.hint__icon{display:flex;align-items:center}.hint__message{font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--small);font-weight:400;line-height:1.25;text-transform:lowercase}.hint__message:first-letter{text-transform:uppercase}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1079
|
+
}
|
|
1080
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: InputHintComponent, decorators: [{
|
|
1081
|
+
type: Component,
|
|
1082
|
+
args: [{ selector: 'gld-input-hint', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section class=\"hint\">\r\n <span class=\"hint__message\">\r\n <ng-content>hint empty</ng-content>\r\n </span>\r\n</section>\r\n", styles: [".hint{--gld-color: var(--gld-foreground-color);--gld-background: var(--gld-gray-transparent--020);--gld-radius: var(--gld-radius--xxs);color:var(--gld-color);background:var(--gld-background);border-radius:0 0 var(--gld-radius) var(--gld-radius);padding:var(--gld-spacing--xxxs) var(--gld-spacing--xxs);display:flex;align-items:flex-start;gap:var(--gld-spacing--xxxs)}.hint__icon{display:flex;align-items:center}.hint__message{font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--small);font-weight:400;line-height:1.25;text-transform:lowercase}.hint__message:first-letter{text-transform:uppercase}\n"] }]
|
|
1083
|
+
}] });
|
|
1412
1084
|
|
|
1413
1085
|
// Angular Imports
|
|
1414
1086
|
class RadioButtonComponent {
|
|
@@ -1448,15 +1120,13 @@ class RadioGroupComponent {
|
|
|
1448
1120
|
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `input-id-${value.trim().split(' ').join('-')}` });
|
|
1449
1121
|
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `input-name-${value.trim().split(' ').join('-')}` });
|
|
1450
1122
|
label = input('', { ...(ngDevMode ? { debugName: "label" } : {}) });
|
|
1451
|
-
direction = input(RadioDirection
|
|
1123
|
+
direction = input(RadioDirection.horizontal, { ...(ngDevMode ? { debugName: "direction" } : {}) });
|
|
1452
1124
|
radioButtonChildren = contentChildren(RadioButtonComponent, { ...(ngDevMode ? { debugName: "radioButtonChildren" } : {}) });
|
|
1453
1125
|
innerControl = signal(new FormControl('', { nonNullable: true }), { ...(ngDevMode ? { debugName: "innerControl" } : {}) });
|
|
1454
1126
|
hasValidators = signal({
|
|
1455
1127
|
required: false,
|
|
1456
1128
|
}, { ...(ngDevMode ? { debugName: "hasValidators" } : {}) });
|
|
1457
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
|
|
1458
1129
|
onChange = (value) => { };
|
|
1459
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1460
1130
|
onTouched = () => { };
|
|
1461
1131
|
constructor() {
|
|
1462
1132
|
this.innerControl()
|
|
@@ -1592,7 +1262,7 @@ const components$2 = [IconComponent, InputErrorComponent];
|
|
|
1592
1262
|
class SelectComponent {
|
|
1593
1263
|
#destroyRef = inject(DestroyRef);
|
|
1594
1264
|
#changeDetectorRef = inject(ChangeDetectorRef);
|
|
1595
|
-
Icons = Icons
|
|
1265
|
+
Icons = Icons;
|
|
1596
1266
|
control = input.required({ ...(ngDevMode ? { debugName: "control" } : {}) });
|
|
1597
1267
|
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `input-id-${value.trim().split(' ').join('-')}` });
|
|
1598
1268
|
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `input-name-${value.trim().split(' ').join('-')}` });
|
|
@@ -1609,20 +1279,215 @@ class SelectComponent {
|
|
|
1609
1279
|
string: false,
|
|
1610
1280
|
maxLength: null,
|
|
1611
1281
|
}, { ...(ngDevMode ? { debugName: "hasValidators" } : {}) });
|
|
1612
|
-
isMenuOpen = signal(false, { ...(ngDevMode ? { debugName: "isMenuOpen" } : {}) });
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1282
|
+
isMenuOpen = signal(false, { ...(ngDevMode ? { debugName: "isMenuOpen" } : {}) });
|
|
1283
|
+
onChange = (value) => { };
|
|
1284
|
+
onTouched = () => { };
|
|
1285
|
+
constructor() {
|
|
1286
|
+
effect(() => {
|
|
1287
|
+
if (this.selectOptionChildren())
|
|
1288
|
+
this.#detectSelectOptionChildren();
|
|
1289
|
+
});
|
|
1290
|
+
this.innerControl()
|
|
1291
|
+
.valueChanges.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
1292
|
+
.subscribe((value) => {
|
|
1293
|
+
let _value = value;
|
|
1294
|
+
/**
|
|
1295
|
+
* Removes all non-letter and non-space characters from the input value string.
|
|
1296
|
+
* This sanitizes the value input by keeping only letters (a-z, A-Z, with accents like á, é, í, ó, ú, ñ) and spaces.
|
|
1297
|
+
* Numbers, special characters, and symbols are removed.
|
|
1298
|
+
*
|
|
1299
|
+
* @example
|
|
1300
|
+
* // Input: "Juan123@García#456 Pérez$"
|
|
1301
|
+
* // Output: "JuanGarcía Pérez"
|
|
1302
|
+
*/
|
|
1303
|
+
if (String(value) && this.hasValidators().string) {
|
|
1304
|
+
_value = String(value).replaceAll(STRING_REGEX_TO_CLEAN, '');
|
|
1305
|
+
this.innerControl().markAsUntouched();
|
|
1306
|
+
}
|
|
1307
|
+
// Apply mask depends on the mask input
|
|
1308
|
+
const valueTransformed = this.#transformValue(_value) ?? '';
|
|
1309
|
+
if (value && Boolean(this.mask())) {
|
|
1310
|
+
const mask = updateValueWithMask({ value: valueTransformed, mask: this.mask() });
|
|
1311
|
+
this.innerControl().setValue(mask, { emitEvent: false });
|
|
1312
|
+
}
|
|
1313
|
+
else {
|
|
1314
|
+
this.innerControl().setValue(valueTransformed, { emitEvent: false });
|
|
1315
|
+
}
|
|
1316
|
+
// Emit value
|
|
1317
|
+
this.onChange(value);
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
ngOnInit() {
|
|
1321
|
+
// Initialize validators cache
|
|
1322
|
+
this.#updateHasValidators();
|
|
1323
|
+
// Update validators when then changed in control
|
|
1324
|
+
this.control()
|
|
1325
|
+
.statusChanges.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
1326
|
+
.subscribe(() => this.#updateHasValidators());
|
|
1327
|
+
// Subscribes to the form control's events and triggers change detection to update the view accordingly.
|
|
1328
|
+
this.control()
|
|
1329
|
+
.events.pipe(takeUntilDestroyed(this.#destroyRef), debounceTime(10))
|
|
1330
|
+
.subscribe(() => this.#changeDetectorRef.detectChanges());
|
|
1331
|
+
}
|
|
1332
|
+
ngAfterContentInit() {
|
|
1333
|
+
this.#detectSelectOptionChildren();
|
|
1334
|
+
this.selectOptionChildren().map((selectOption) => {
|
|
1335
|
+
selectOption.changeFocus.subscribe((focus) => {
|
|
1336
|
+
// console.log('focus', focus)
|
|
1337
|
+
if (focus)
|
|
1338
|
+
this.onFocus();
|
|
1339
|
+
else
|
|
1340
|
+
this.onBlur();
|
|
1341
|
+
});
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
writeValue(value) {
|
|
1345
|
+
// console.log('writeValue')
|
|
1346
|
+
if (value !== this.innerControl().value) {
|
|
1347
|
+
// const valueTransformed = this.#transformValue(value)
|
|
1348
|
+
this.innerControl().setValue(value);
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
registerOnChange(onChange) {
|
|
1352
|
+
// console.log('registerOnChange')
|
|
1353
|
+
this.onChange = onChange;
|
|
1354
|
+
}
|
|
1355
|
+
registerOnTouched(onTouched) {
|
|
1356
|
+
// console.log('registerOnTouched')
|
|
1357
|
+
this.onTouched = onTouched;
|
|
1358
|
+
}
|
|
1359
|
+
onFocus() {
|
|
1360
|
+
this.isMenuOpen.set(true);
|
|
1361
|
+
}
|
|
1362
|
+
onBlur() {
|
|
1363
|
+
// console.log('blur')
|
|
1364
|
+
this.onTouched();
|
|
1365
|
+
this.isMenuOpen.set(false);
|
|
1366
|
+
}
|
|
1367
|
+
arrowIconClicked() {
|
|
1368
|
+
// FIXME: This is a workaround to prevent the menu from closing when the arrow icon is clicked.
|
|
1369
|
+
// console.log('clicked - init', this.isMenuOpen())
|
|
1370
|
+
if (this.isMenuOpen())
|
|
1371
|
+
this.onTouched();
|
|
1372
|
+
this.isMenuOpen.update((open) => !open);
|
|
1373
|
+
// console.log('clicked - end', this.isMenuOpen())
|
|
1374
|
+
}
|
|
1375
|
+
#transformValue(value) {
|
|
1376
|
+
let valueTransformed;
|
|
1377
|
+
if (value === null || value === undefined)
|
|
1378
|
+
valueTransformed = null;
|
|
1379
|
+
else
|
|
1380
|
+
valueTransformed = this.transform()(value);
|
|
1381
|
+
return valueTransformed;
|
|
1382
|
+
}
|
|
1383
|
+
#detectSelectOptionChildren() {
|
|
1384
|
+
const selectOptionChildren = this.selectOptionChildren();
|
|
1385
|
+
const selectElement = this.selectElement()?.nativeElement;
|
|
1386
|
+
selectElement?.style.setProperty('--gld-option-items', String(selectOptionChildren.length));
|
|
1387
|
+
const clientHeight = selectElement?.querySelector('gld-select-option')?.clientHeight;
|
|
1388
|
+
if (clientHeight)
|
|
1389
|
+
selectElement?.style.setProperty('--gld-option-height', `${clientHeight}px`);
|
|
1390
|
+
selectOptionChildren.map((selectOption) => {
|
|
1391
|
+
selectOption.selected.subscribe((value) => {
|
|
1392
|
+
if (value) {
|
|
1393
|
+
const buttons = Array.from(selectElement?.querySelectorAll('gld-select-option button') ?? []);
|
|
1394
|
+
buttons.map((button) => button.blur());
|
|
1395
|
+
const valueTransformed = this.#transformValue(value);
|
|
1396
|
+
this.innerControl().setValue(valueTransformed, { emitEvent: false });
|
|
1397
|
+
this.onChange(value);
|
|
1398
|
+
this.onTouched();
|
|
1399
|
+
this.isMenuOpen.set(false);
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
#updateHasValidators() {
|
|
1405
|
+
const control = this.control();
|
|
1406
|
+
const validatorFn = control.validator;
|
|
1407
|
+
const maskSpacers = this.mask()
|
|
1408
|
+
.split('')
|
|
1409
|
+
.filter((char) => char !== '0').length;
|
|
1410
|
+
// It isn't validators
|
|
1411
|
+
if (validatorFn === null) {
|
|
1412
|
+
this.hasValidators.set({
|
|
1413
|
+
required: false,
|
|
1414
|
+
naturalNumber: false,
|
|
1415
|
+
string: false,
|
|
1416
|
+
maxLength: null,
|
|
1417
|
+
});
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
// Detect all validators
|
|
1421
|
+
const requiredErrors = validatorFn(new FormControl(''));
|
|
1422
|
+
const typeErrors = validatorFn(new FormControl('abc123'));
|
|
1423
|
+
const maxLengthErrors = validatorFn(new FormControl({ length: Infinity }));
|
|
1424
|
+
const maxLength = maxLengthErrors?.['maxlength']?.['requiredLength'];
|
|
1425
|
+
this.hasValidators.set({
|
|
1426
|
+
required: Boolean(requiredErrors?.['required']),
|
|
1427
|
+
naturalNumber: Boolean(typeErrors?.['isNaturalNumber']),
|
|
1428
|
+
string: Boolean(typeErrors?.['isString']),
|
|
1429
|
+
maxLength: maxLength ? maxLength + maskSpacers : null,
|
|
1430
|
+
});
|
|
1431
|
+
// console.log('hasValidators', this.hasValidators())
|
|
1432
|
+
}
|
|
1433
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1434
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: SelectComponent, isStandalone: true, selector: "gld-select", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, transform: { classPropertyName: "transform", publicName: "transform", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1435
|
+
{
|
|
1436
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1437
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
1438
|
+
multi: true,
|
|
1439
|
+
},
|
|
1440
|
+
], queries: [{ propertyName: "selectOptionChildren", predicate: SelectOptionComponent, isSignal: true }], viewQueries: [{ propertyName: "selectElement", first: true, predicate: ["selectElement"], descendants: true, isSignal: true }], ngImport: i0, template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section #selectElement class=\"select\">\n <section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n <!-- Input -->\n <input\n type=\"text\"\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keyup.escape)=\"onBlur()\" />\n\n <!-- Suffix -->\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n\n <!-- Menu -->\n <ng-container [ngTemplateOutlet]=\"menuTemplate\" />\n </section>\n <!-- Errors -->\n @if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n } @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n }\n</section>\n\n<!-- Menu Template -->\n<ng-template #menuTemplate>\n <section class=\"select-menu\" [class.select-menu--opened]=\"isMenuOpen()\">\n <ng-content select=\"gld-select-option\" />\n </section>\n</ng-template>\n\n<!-- Suffix Template -->\n<ng-template #suffixTemplate>\n @if (control().pending) {\n <gld-icon\n size=\"small\"\n class=\"input-icon input-icon--animated\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.loader4Fill\"\n [disabled]=\"disabled\" />\n } @else {\n <gld-icon\n size=\"small\"\n class=\"input-icon\"\n [class.input-icon--rotated]=\"isMenuOpen()\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.arrowDownSLine\"\n [disabled]=\"disabled\"\n (clicked)=\"arrowIconClicked()\" />\n }\n</ng-template>\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n<!-- <section>status: {{ control().status }}</section> -->\n\n<!-- FIXME: Verify why this element is here -->\n<!-- Suffix Template -->\n<!-- <ng-template #suffixTemplate>\n <gld-icon\n size=\"small\"\n class=\"input-icon\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.arrowDownSLine\" />\n</ng-template> -->\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-height: 40px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input input{width:100%;min-width:var(--gld-min-with);height:var(--gld-height);padding:var(--gld-spacing--xxs);padding-right:var(--gld-spacing--m);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input input:focus{--gld-border-color: var(--gld-blue)}.input input::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:var(--gld-spacing--xxs);color:var(--gld-color);-webkit-user-select:none;user-select:none;will-change:transform,color;transition:transform var(--gld-animation-time) ease,color var(--gld-animation-time) ease-in-out;cursor:pointer}.input-icon--animated{animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.input-icon--rotated{transform:rotate(180deg)}.select{--gld-background: light-dark(var(--gld-whitelight), var(--gld-darkblue));--gld-shadow: light-dark(var(--gld-gray-transparent--040), var(--gld-gray-transparent--020));--gld-height: 40px;--gld-option-items: 0;--gld-option-height: 40px;--gld-animation-time: var(--gld-animation-time--150);--gld-padding: var(--gld-spacing--xxxs);--gld-radius: var(--gld-radius--xxs);position:relative;background:transparent}.select-menu{position:absolute;z-index:1;top:calc(var(--gld-height) + 22px);left:0;height:0;padding:0;display:grid;grid-template-columns:1fr;background:var(--gld-background);box-shadow:inset 0 0 0 var(--gld-border-size) var(--gld-shadow);border-radius:var(--gld-radius);min-width:100%;max-width:100%;max-height:calc(var(--gld-option-height) * 5);overflow-y:auto;will-change:height,padding;transition:var(--gld-animation-time) height ease-in-out,var(--gld-animation-time) padding ease-in-out}.select-menu--opened{height:calc(var(--gld-option-height) * var(--gld-option-items) + var(--gld-padding) * 2);padding:var(--gld-padding)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "gld-icon", inputs: ["icon", "size", "space", "moveTopToBottom", "moveLeftToRight", "disabled"], outputs: ["clicked"] }, { kind: "component", type: InputErrorComponent, selector: "gld-input-error", inputs: ["errors", "border"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1441
|
+
}
|
|
1442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: SelectComponent, decorators: [{
|
|
1443
|
+
type: Component,
|
|
1444
|
+
args: [{ selector: 'gld-select', standalone: true, imports: [ReactiveFormsModule, NgTemplateOutlet, ...components$2], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1445
|
+
{
|
|
1446
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1447
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
1448
|
+
multi: true,
|
|
1449
|
+
},
|
|
1450
|
+
], template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section #selectElement class=\"select\">\n <section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n <!-- Input -->\n <input\n type=\"text\"\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keyup.escape)=\"onBlur()\" />\n\n <!-- Suffix -->\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n\n <!-- Menu -->\n <ng-container [ngTemplateOutlet]=\"menuTemplate\" />\n </section>\n <!-- Errors -->\n @if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n } @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n }\n</section>\n\n<!-- Menu Template -->\n<ng-template #menuTemplate>\n <section class=\"select-menu\" [class.select-menu--opened]=\"isMenuOpen()\">\n <ng-content select=\"gld-select-option\" />\n </section>\n</ng-template>\n\n<!-- Suffix Template -->\n<ng-template #suffixTemplate>\n @if (control().pending) {\n <gld-icon\n size=\"small\"\n class=\"input-icon input-icon--animated\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.loader4Fill\"\n [disabled]=\"disabled\" />\n } @else {\n <gld-icon\n size=\"small\"\n class=\"input-icon\"\n [class.input-icon--rotated]=\"isMenuOpen()\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.arrowDownSLine\"\n [disabled]=\"disabled\"\n (clicked)=\"arrowIconClicked()\" />\n }\n</ng-template>\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n<!-- <section>status: {{ control().status }}</section> -->\n\n<!-- FIXME: Verify why this element is here -->\n<!-- Suffix Template -->\n<!-- <ng-template #suffixTemplate>\n <gld-icon\n size=\"small\"\n class=\"input-icon\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.arrowDownSLine\" />\n</ng-template> -->\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-height: 40px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input input{width:100%;min-width:var(--gld-min-with);height:var(--gld-height);padding:var(--gld-spacing--xxs);padding-right:var(--gld-spacing--m);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input input:focus{--gld-border-color: var(--gld-blue)}.input input::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:var(--gld-spacing--xxs);color:var(--gld-color);-webkit-user-select:none;user-select:none;will-change:transform,color;transition:transform var(--gld-animation-time) ease,color var(--gld-animation-time) ease-in-out;cursor:pointer}.input-icon--animated{animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.input-icon--rotated{transform:rotate(180deg)}.select{--gld-background: light-dark(var(--gld-whitelight), var(--gld-darkblue));--gld-shadow: light-dark(var(--gld-gray-transparent--040), var(--gld-gray-transparent--020));--gld-height: 40px;--gld-option-items: 0;--gld-option-height: 40px;--gld-animation-time: var(--gld-animation-time--150);--gld-padding: var(--gld-spacing--xxxs);--gld-radius: var(--gld-radius--xxs);position:relative;background:transparent}.select-menu{position:absolute;z-index:1;top:calc(var(--gld-height) + 22px);left:0;height:0;padding:0;display:grid;grid-template-columns:1fr;background:var(--gld-background);box-shadow:inset 0 0 0 var(--gld-border-size) var(--gld-shadow);border-radius:var(--gld-radius);min-width:100%;max-width:100%;max-height:calc(var(--gld-option-height) * 5);overflow-y:auto;will-change:height,padding;transition:var(--gld-animation-time) height ease-in-out,var(--gld-animation-time) padding ease-in-out}.select-menu--opened{height:calc(var(--gld-option-height) * var(--gld-option-items) + var(--gld-padding) * 2);padding:var(--gld-padding)}\n"] }]
|
|
1451
|
+
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], transform: [{ type: i0.Input, args: [{ isSignal: true, alias: "transform", required: false }] }], selectElement: [{ type: i0.ViewChild, args: ['selectElement', { isSignal: true }] }], selectOptionChildren: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SelectOptionComponent), { isSignal: true }] }] } });
|
|
1452
|
+
|
|
1453
|
+
// Angular Imports
|
|
1454
|
+
const components$1 = [InputErrorComponent];
|
|
1455
|
+
class TextareaComponent {
|
|
1456
|
+
#destroyRef = inject(DestroyRef);
|
|
1457
|
+
#changeDetectorRef = inject(ChangeDetectorRef);
|
|
1458
|
+
control = input.required({ ...(ngDevMode ? { debugName: "control" } : {}) });
|
|
1459
|
+
id = input.required({ ...(ngDevMode ? { debugName: "id" } : {}), transform: (value) => `input-id-${value.trim().split(' ').join('-')}` });
|
|
1460
|
+
name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}), transform: (value) => `input-name-${value.trim().split(' ').join('-')}` });
|
|
1461
|
+
label = input('', { ...(ngDevMode ? { debugName: "label" } : {}) });
|
|
1462
|
+
placeholder = input('', { ...(ngDevMode ? { debugName: "placeholder" } : {}) });
|
|
1463
|
+
type = input('text', { ...(ngDevMode ? { debugName: "type" } : {}) });
|
|
1464
|
+
suffix = input(false, { ...(ngDevMode ? { debugName: "suffix" } : {}), transform: booleanAttribute });
|
|
1465
|
+
onChange = (value) => { };
|
|
1466
|
+
onTouched = () => { };
|
|
1467
|
+
innerControl = signal(new FormControl('', { nonNullable: true }), { ...(ngDevMode ? { debugName: "innerControl" } : {}) });
|
|
1468
|
+
hasValidators = signal({
|
|
1469
|
+
required: false,
|
|
1470
|
+
naturalNumber: false,
|
|
1471
|
+
string: false,
|
|
1472
|
+
maxLength: null,
|
|
1473
|
+
}, { ...(ngDevMode ? { debugName: "hasValidators" } : {}) });
|
|
1617
1474
|
constructor() {
|
|
1618
|
-
effect(() => {
|
|
1619
|
-
if (this.selectOptionChildren())
|
|
1620
|
-
this.#detectSelectOptionChildren();
|
|
1621
|
-
});
|
|
1622
1475
|
this.innerControl()
|
|
1623
1476
|
.valueChanges.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
1624
1477
|
.subscribe((value) => {
|
|
1625
1478
|
let _value = value;
|
|
1479
|
+
/**
|
|
1480
|
+
* Removes all non-digit characters from the input value string.
|
|
1481
|
+
* This sanitizes the value input by keeping only numbers (0-9)
|
|
1482
|
+
*
|
|
1483
|
+
* @example
|
|
1484
|
+
* // Input: "12/34/abcd2023!@_"
|
|
1485
|
+
* // Output: "12342023"
|
|
1486
|
+
*/
|
|
1487
|
+
if (String(value) && this.hasValidators().naturalNumber) {
|
|
1488
|
+
_value = String(value).replaceAll(NATURAL_NUMBER_REGEX_TO_CLEAN, '');
|
|
1489
|
+
this.innerControl().markAsUntouched();
|
|
1490
|
+
}
|
|
1626
1491
|
/**
|
|
1627
1492
|
* Removes all non-letter and non-space characters from the input value string.
|
|
1628
1493
|
* This sanitizes the value input by keeping only letters (a-z, A-Z, with accents like á, é, í, ó, ú, ñ) and spaces.
|
|
@@ -1633,20 +1498,11 @@ class SelectComponent {
|
|
|
1633
1498
|
* // Output: "JuanGarcía Pérez"
|
|
1634
1499
|
*/
|
|
1635
1500
|
if (String(value) && this.hasValidators().string) {
|
|
1636
|
-
_value = String(value).replaceAll(STRING_REGEX_TO_CLEAN
|
|
1501
|
+
_value = String(value).replaceAll(STRING_REGEX_TO_CLEAN, '');
|
|
1637
1502
|
this.innerControl().markAsUntouched();
|
|
1638
1503
|
}
|
|
1639
|
-
// Apply mask depends on the mask input
|
|
1640
|
-
const valueTransformed = this.#transformValue(_value) ?? '';
|
|
1641
|
-
if (value && Boolean(this.mask())) {
|
|
1642
|
-
const mask = updateValueWithMask$1({ value: valueTransformed, mask: this.mask() });
|
|
1643
|
-
this.innerControl().setValue(mask, { emitEvent: false });
|
|
1644
|
-
}
|
|
1645
|
-
else {
|
|
1646
|
-
this.innerControl().setValue(valueTransformed, { emitEvent: false });
|
|
1647
|
-
}
|
|
1648
1504
|
// Emit value
|
|
1649
|
-
this.onChange(
|
|
1505
|
+
this.onChange(_value);
|
|
1650
1506
|
});
|
|
1651
1507
|
}
|
|
1652
1508
|
ngOnInit() {
|
|
@@ -1661,24 +1517,10 @@ class SelectComponent {
|
|
|
1661
1517
|
.events.pipe(takeUntilDestroyed(this.#destroyRef), debounceTime(10))
|
|
1662
1518
|
.subscribe(() => this.#changeDetectorRef.detectChanges());
|
|
1663
1519
|
}
|
|
1664
|
-
ngAfterContentInit() {
|
|
1665
|
-
this.#detectSelectOptionChildren();
|
|
1666
|
-
this.selectOptionChildren().map((selectOption) => {
|
|
1667
|
-
selectOption.changeFocus.subscribe((focus) => {
|
|
1668
|
-
// console.log('focus', focus)
|
|
1669
|
-
if (focus)
|
|
1670
|
-
this.onFocus();
|
|
1671
|
-
else
|
|
1672
|
-
this.onBlur();
|
|
1673
|
-
});
|
|
1674
|
-
});
|
|
1675
|
-
}
|
|
1676
1520
|
writeValue(value) {
|
|
1677
1521
|
// console.log('writeValue')
|
|
1678
|
-
if (value !== this.innerControl().value)
|
|
1679
|
-
// const valueTransformed = this.#transformValue(value)
|
|
1522
|
+
if (value !== this.innerControl().value)
|
|
1680
1523
|
this.innerControl().setValue(value);
|
|
1681
|
-
}
|
|
1682
1524
|
}
|
|
1683
1525
|
registerOnChange(onChange) {
|
|
1684
1526
|
// console.log('registerOnChange')
|
|
@@ -1689,493 +1531,638 @@ class SelectComponent {
|
|
|
1689
1531
|
this.onTouched = onTouched;
|
|
1690
1532
|
}
|
|
1691
1533
|
onFocus() {
|
|
1692
|
-
this.isMenuOpen.set(true)
|
|
1534
|
+
// this.isMenuOpen.set(true)
|
|
1693
1535
|
}
|
|
1694
1536
|
onBlur() {
|
|
1695
|
-
// console.log('blur')
|
|
1696
1537
|
this.onTouched();
|
|
1697
|
-
this.isMenuOpen.set(false)
|
|
1538
|
+
// this.isMenuOpen.set(false)
|
|
1698
1539
|
}
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1540
|
+
#updateHasValidators() {
|
|
1541
|
+
const control = this.control();
|
|
1542
|
+
const validatorFn = control.validator;
|
|
1543
|
+
// It isn't validators
|
|
1544
|
+
if (validatorFn === null) {
|
|
1545
|
+
this.hasValidators.set({
|
|
1546
|
+
required: false,
|
|
1547
|
+
naturalNumber: false,
|
|
1548
|
+
string: false,
|
|
1549
|
+
maxLength: null,
|
|
1550
|
+
});
|
|
1551
|
+
return;
|
|
1552
|
+
}
|
|
1553
|
+
// Detect all validators
|
|
1554
|
+
const requiredErrors = validatorFn(new FormControl(''));
|
|
1555
|
+
const typeErrors = validatorFn(new FormControl('abc123'));
|
|
1556
|
+
const maxLengthErrors = validatorFn(new FormControl({ length: Infinity }));
|
|
1557
|
+
const maxLength = maxLengthErrors?.['maxlength']?.['requiredLength'];
|
|
1558
|
+
this.hasValidators.set({
|
|
1559
|
+
required: Boolean(requiredErrors?.['required']),
|
|
1560
|
+
naturalNumber: Boolean(typeErrors?.['isNaturalNumber']),
|
|
1561
|
+
string: Boolean(typeErrors?.['isString']),
|
|
1562
|
+
maxLength: maxLength ? maxLength : null,
|
|
1563
|
+
});
|
|
1564
|
+
// console.log('hasValidators', this.hasValidators())
|
|
1565
|
+
}
|
|
1566
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1567
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: TextareaComponent, isStandalone: true, selector: "gld-textarea", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1568
|
+
{
|
|
1569
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1570
|
+
useExisting: forwardRef(() => TextareaComponent),
|
|
1571
|
+
multi: true,
|
|
1572
|
+
},
|
|
1573
|
+
], ngImport: i0, template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <textarea\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onTouched()\"\n (keyup.escape)=\"onBlur()\"></textarea>\n\n <!-- Suffix -->\n @if (suffix()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n }\n</section>\n<!-- Errors -->\n@if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n} @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n}\n\n<!-- Suffix emplate -->\n<ng-template #suffixTemplate>\n <span tabindex=\"-1\" class=\"input-icon\" [class.input-icon--error]=\"errors\">\n <ng-content select=\"[inputSuffix]\" />\n </span>\n</ng-template>\n\n<!-- <h3>Debugging</h3>\n<section>errors: {{ errors }}</section>\n<section>invalid: {{ control().invalid }}</section>\n<section>dirty: {{ control().dirty }}</section>\n<section>touched: {{ control().touched }}</section>\n<section>disable: {{ control().disabled }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-min-height: 120px;--gld-max-height: 240px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input textarea{display:flex;width:100%;min-width:var(--gld-min-with);min-height:var(--gld-min-height);max-height:var(--gld-max-height);padding:var(--gld-spacing--xxs);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;resize:vertical;form-sizing:content;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input textarea:focus{--gld-border-color: var(--gld-blue)}.input textarea::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:0;display:inline-block;color:var(--gld-color);will-change:transform,color;transition:color var(--gld-animation-time) ease;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputErrorComponent, selector: "gld-input-error", inputs: ["errors", "border"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1574
|
+
}
|
|
1575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1576
|
+
type: Component,
|
|
1577
|
+
args: [{ selector: 'gld-textarea', standalone: true, imports: [ReactiveFormsModule, NgTemplateOutlet, ...components$1], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1578
|
+
{
|
|
1579
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1580
|
+
useExisting: forwardRef(() => TextareaComponent),
|
|
1581
|
+
multi: true,
|
|
1582
|
+
},
|
|
1583
|
+
], template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <textarea\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onTouched()\"\n (keyup.escape)=\"onBlur()\"></textarea>\n\n <!-- Suffix -->\n @if (suffix()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n }\n</section>\n<!-- Errors -->\n@if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n} @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n}\n\n<!-- Suffix emplate -->\n<ng-template #suffixTemplate>\n <span tabindex=\"-1\" class=\"input-icon\" [class.input-icon--error]=\"errors\">\n <ng-content select=\"[inputSuffix]\" />\n </span>\n</ng-template>\n\n<!-- <h3>Debugging</h3>\n<section>errors: {{ errors }}</section>\n<section>invalid: {{ control().invalid }}</section>\n<section>dirty: {{ control().dirty }}</section>\n<section>touched: {{ control().touched }}</section>\n<section>disable: {{ control().disabled }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-min-height: 120px;--gld-max-height: 240px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input textarea{display:flex;width:100%;min-width:var(--gld-min-with);min-height:var(--gld-min-height);max-height:var(--gld-max-height);padding:var(--gld-spacing--xxs);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;resize:vertical;form-sizing:content;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input textarea:focus{--gld-border-color: var(--gld-blue)}.input textarea::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:0;display:inline-block;color:var(--gld-color);will-change:transform,color;transition:color var(--gld-animation-time) ease;cursor:pointer}\n"] }]
|
|
1584
|
+
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }] } });
|
|
1585
|
+
|
|
1586
|
+
// Angular Imports
|
|
1587
|
+
class ImageComponent {
|
|
1588
|
+
src = input.required({ ...(ngDevMode ? { debugName: "src" } : {}) });
|
|
1589
|
+
alt = input.required({ ...(ngDevMode ? { debugName: "alt" } : {}) });
|
|
1590
|
+
// srcset = input<string>('')
|
|
1591
|
+
// sizes = input<string>('')
|
|
1592
|
+
priority = input(false, { ...(ngDevMode ? { debugName: "priority" } : {}), transform: booleanAttribute });
|
|
1593
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1594
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: ImageComponent, isStandalone: true, selector: "gld-image", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: true, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: true, transformFunction: null }, priority: { classPropertyName: "priority", publicName: "priority", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- @if (srcset() && sizes()) {\r\n @if (priority()) {\r\n <img fill priority alt=\"{{ alt() }}\" [ngSrc]=\"src()\" [ngSrcset]=\"srcset()\" [sizes]=\"sizes()\" />\r\n } @else {\r\n <img\r\n fill\r\n alt=\"{{ alt() }}\"\r\n [ngSrc]=\"src()\"\r\n [ngSrcset]=\"srcset()\"\r\n [sizes]=\"sizes()\"\r\n loading=\"lazy\" />\r\n }\r\n} @else {\r\n @if (priority()) {\r\n <img fill priority alt=\"{{ alt() }}\" [ngSrc]=\"src()\" />\r\n } @else {\r\n <img fill alt=\"{{ alt() }}\" [ngSrc]=\"src()\" loading=\"lazy\" />\r\n }\r\n} -->\r\n\r\n@if (priority()) {\r\n <img fill priority alt=\"{{ alt() }}\" [ngSrc]=\"src()\" />\r\n} @else {\r\n <img fill alt=\"{{ alt() }}\" [ngSrc]=\"src()\" loading=\"lazy\" />\r\n}\r\n", styles: [":host{position:relative;aspect-ratio:1/1;overflow:hidden;display:inline-block;object-fit:inherit;width:inherit;height:inherit}img{width:inherit;height:inherit;max-width:100%;max-height:100%;display:inherit;aspect-ratio:inherit;z-index:inherit;object-fit:inherit;border-radius:inherit;border:inherit;background-color:inherit;-webkit-user-select:none;user-select:none;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1595
|
+
}
|
|
1596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: ImageComponent, decorators: [{
|
|
1597
|
+
type: Component,
|
|
1598
|
+
args: [{ selector: 'gld-image', standalone: true, imports: [NgOptimizedImage], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- @if (srcset() && sizes()) {\r\n @if (priority()) {\r\n <img fill priority alt=\"{{ alt() }}\" [ngSrc]=\"src()\" [ngSrcset]=\"srcset()\" [sizes]=\"sizes()\" />\r\n } @else {\r\n <img\r\n fill\r\n alt=\"{{ alt() }}\"\r\n [ngSrc]=\"src()\"\r\n [ngSrcset]=\"srcset()\"\r\n [sizes]=\"sizes()\"\r\n loading=\"lazy\" />\r\n }\r\n} @else {\r\n @if (priority()) {\r\n <img fill priority alt=\"{{ alt() }}\" [ngSrc]=\"src()\" />\r\n } @else {\r\n <img fill alt=\"{{ alt() }}\" [ngSrc]=\"src()\" loading=\"lazy\" />\r\n }\r\n} -->\r\n\r\n@if (priority()) {\r\n <img fill priority alt=\"{{ alt() }}\" [ngSrc]=\"src()\" />\r\n} @else {\r\n <img fill alt=\"{{ alt() }}\" [ngSrc]=\"src()\" loading=\"lazy\" />\r\n}\r\n", styles: [":host{position:relative;aspect-ratio:1/1;overflow:hidden;display:inline-block;object-fit:inherit;width:inherit;height:inherit}img{width:inherit;height:inherit;max-width:100%;max-height:100%;display:inherit;aspect-ratio:inherit;z-index:inherit;object-fit:inherit;border-radius:inherit;border:inherit;background-color:inherit;-webkit-user-select:none;user-select:none;pointer-events:none}\n"] }]
|
|
1599
|
+
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: true }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: true }] }], priority: [{ type: i0.Input, args: [{ isSignal: true, alias: "priority", required: false }] }] } });
|
|
1600
|
+
|
|
1601
|
+
// Angular Imports
|
|
1602
|
+
class CircleLoaderComponent {
|
|
1603
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
1604
|
+
background = input(false, { ...(ngDevMode ? { debugName: "background" } : {}), transform: booleanAttribute });
|
|
1605
|
+
radius = input(false, { ...(ngDevMode ? { debugName: "radius" } : {}), transform: booleanAttribute });
|
|
1606
|
+
minHeight = input('auto', { ...(ngDevMode ? { debugName: "minHeight" } : {}) });
|
|
1607
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: CircleLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1608
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: CircleLoaderComponent, isStandalone: true, selector: "gld-circle-loader", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<article\r\n class=\"loader\"\r\n [class.loader--loading]=\"loading()\"\r\n [class.loader--background]=\"background()\"\r\n [class.loader--radius]=\"radius()\"\r\n [style.minHeight]=\"minHeight()\">\r\n <!-- Content -->\r\n <ng-content />\r\n\r\n <!-- Loader -->\r\n @if (loading()) {\r\n <section class=\"loader-loading\">\r\n <svg class=\"container\" viewBox=\"0 0 40 40\" height=\"40\" width=\"40\">\r\n <circle\r\n class=\"track\"\r\n cx=\"20\"\r\n cy=\"20\"\r\n r=\"17.5\"\r\n pathlength=\"100\"\r\n stroke-width=\"5px\"\r\n fill=\"none\" />\r\n <circle\r\n class=\"car\"\r\n cx=\"20\"\r\n cy=\"20\"\r\n r=\"17.5\"\r\n pathlength=\"100\"\r\n stroke-width=\"5px\"\r\n fill=\"none\" />\r\n </svg>\r\n </section>\r\n }\r\n</article>\r\n", styles: [":host{width:100%}.loader{--gld-color: var(--gld-foreground-color);--gld-background: light-dark( var(--gld-whitelight-transparent--080), var(--gld-darkblue-transparent--080) );position:relative;color:var(--color)}.loader--radius{border-radius:var(--gld-spacing--xxxs)}.loader-loading{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:1}.loader--background .loader-loading{background:var(--gld-background)}.container{--uib-size: 40px;--uib-color: var(--gld-orange);--uib-speed: .8s;--uib-bg-opacity: .1;width:var(--uib-size);height:var(--uib-size);transform-origin:center;animation:rotate var(--uib-speed) linear infinite;will-change:transform;overflow:visible}.car{fill:none;stroke:var(--uib-color);stroke-dasharray:25,75;stroke-dashoffset:0;stroke-linecap:round;transition:stroke .5s ease}.track{fill:none;stroke:var(--uib-color);opacity:var(--uib-bg-opacity);transition:stroke .5s ease}@keyframes rotate{to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1609
|
+
}
|
|
1610
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: CircleLoaderComponent, decorators: [{
|
|
1611
|
+
type: Component,
|
|
1612
|
+
args: [{ standalone: true, selector: 'gld-circle-loader', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article\r\n class=\"loader\"\r\n [class.loader--loading]=\"loading()\"\r\n [class.loader--background]=\"background()\"\r\n [class.loader--radius]=\"radius()\"\r\n [style.minHeight]=\"minHeight()\">\r\n <!-- Content -->\r\n <ng-content />\r\n\r\n <!-- Loader -->\r\n @if (loading()) {\r\n <section class=\"loader-loading\">\r\n <svg class=\"container\" viewBox=\"0 0 40 40\" height=\"40\" width=\"40\">\r\n <circle\r\n class=\"track\"\r\n cx=\"20\"\r\n cy=\"20\"\r\n r=\"17.5\"\r\n pathlength=\"100\"\r\n stroke-width=\"5px\"\r\n fill=\"none\" />\r\n <circle\r\n class=\"car\"\r\n cx=\"20\"\r\n cy=\"20\"\r\n r=\"17.5\"\r\n pathlength=\"100\"\r\n stroke-width=\"5px\"\r\n fill=\"none\" />\r\n </svg>\r\n </section>\r\n }\r\n</article>\r\n", styles: [":host{width:100%}.loader{--gld-color: var(--gld-foreground-color);--gld-background: light-dark( var(--gld-whitelight-transparent--080), var(--gld-darkblue-transparent--080) );position:relative;color:var(--color)}.loader--radius{border-radius:var(--gld-spacing--xxxs)}.loader-loading{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:1}.loader--background .loader-loading{background:var(--gld-background)}.container{--uib-size: 40px;--uib-color: var(--gld-orange);--uib-speed: .8s;--uib-bg-opacity: .1;width:var(--uib-size);height:var(--uib-size);transform-origin:center;animation:rotate var(--uib-speed) linear infinite;will-change:transform;overflow:visible}.car{fill:none;stroke:var(--uib-color);stroke-dasharray:25,75;stroke-dashoffset:0;stroke-linecap:round;transition:stroke .5s ease}.track{fill:none;stroke:var(--uib-color);opacity:var(--uib-bg-opacity);transition:stroke .5s ease}@keyframes rotate{to{transform:rotate(360deg)}}\n"] }]
|
|
1613
|
+
}], propDecorators: { loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }] } });
|
|
1614
|
+
|
|
1615
|
+
// Angular Imports
|
|
1616
|
+
const components = [DropdownButtonComponent, DropdownMenuComponent, CircleLoaderComponent];
|
|
1617
|
+
class TableComponent {
|
|
1618
|
+
Icons = Icons;
|
|
1619
|
+
tableColumns = input.required({ ...(ngDevMode ? { debugName: "tableColumns" } : {}) });
|
|
1620
|
+
emptyMessage = input('', { ...(ngDevMode ? { debugName: "emptyMessage" } : {}) });
|
|
1621
|
+
tableHeight = input('auto', { ...(ngDevMode ? { debugName: "tableHeight" } : {}) });
|
|
1622
|
+
loading = input(true, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
1623
|
+
selects = input(false, { ...(ngDevMode ? { debugName: "selects" } : {}), transform: booleanAttribute });
|
|
1624
|
+
selectsAll = input(false, { ...(ngDevMode ? { debugName: "selectsAll" } : {}), transform: booleanAttribute });
|
|
1625
|
+
search = input(false, { ...(ngDevMode ? { debugName: "search" } : {}), transform: booleanAttribute });
|
|
1626
|
+
pagination = input(false, { ...(ngDevMode ? { debugName: "pagination" } : {}), transform: booleanAttribute });
|
|
1627
|
+
tableColumnAction = output();
|
|
1628
|
+
tableColumnsToShow = computed(() => this.tableColumns().filter((column) => !column.hide), { ...(ngDevMode ? { debugName: "tableColumnsToShow" } : {}) });
|
|
1629
|
+
tableColumnActions = signal([], { ...(ngDevMode ? { debugName: "tableColumnActions" } : {}) });
|
|
1630
|
+
tableActionFunction({ tableColumnActionAsEvent, tableColumns, index }) {
|
|
1631
|
+
const tableColumnAction = tableColumnActionAsEvent;
|
|
1632
|
+
const object = this.#buildObjectFromTableColumn({ tableColumns, index });
|
|
1633
|
+
const event = {
|
|
1634
|
+
tableColumnAction,
|
|
1635
|
+
object,
|
|
1636
|
+
};
|
|
1637
|
+
this.tableColumnAction.emit(event);
|
|
1638
|
+
}
|
|
1639
|
+
changeValue() {
|
|
1640
|
+
// event: unknown
|
|
1641
|
+
// console.log('event', event)
|
|
1642
|
+
}
|
|
1643
|
+
// We build each column and in case it doesn't exist or update it in case it already exists
|
|
1644
|
+
buildTableColumns({ tableColumnStructures, tableColumnActions, dataStructures, }) {
|
|
1645
|
+
const tableColumns = [];
|
|
1646
|
+
const structures = dataStructures;
|
|
1647
|
+
this.tableColumnActions.set(tableColumnActions);
|
|
1648
|
+
// console.log('buildTableColumns')
|
|
1649
|
+
tableColumnStructures.map((column) => {
|
|
1650
|
+
structures.map((dataItem) => {
|
|
1651
|
+
// We check if the property we pass it exists within the object we receive
|
|
1652
|
+
if (dataItem?.hasOwnProperty(column.name)) {
|
|
1653
|
+
const propertyValue = dataItem[column.name];
|
|
1654
|
+
// We check if a column already exists in our array with the name of that property
|
|
1655
|
+
const currentTableColumn = tableColumns.find((_column) => _column.name === column.name);
|
|
1656
|
+
if (currentTableColumn) {
|
|
1657
|
+
// If it exists, we update it
|
|
1658
|
+
const tableColumn = currentTableColumn;
|
|
1659
|
+
tableColumn.values = [...currentTableColumn.values, propertyValue];
|
|
1660
|
+
}
|
|
1661
|
+
else {
|
|
1662
|
+
// If it doesn't exist, we add it
|
|
1663
|
+
const tableColumnToAdd = {
|
|
1664
|
+
name: column.name,
|
|
1665
|
+
label: column.label,
|
|
1666
|
+
width: column.width ? column.width : 'auto',
|
|
1667
|
+
minWidth: column.minWidth ? column.minWidth : 'auto',
|
|
1668
|
+
maxWidth: column.maxWidth ? column.maxWidth : 'auto',
|
|
1669
|
+
hide: column.hide ?? false,
|
|
1670
|
+
template: column.template ?? undefined,
|
|
1671
|
+
justify: column.justify ? column.justify : 'left',
|
|
1672
|
+
transform: column.transform
|
|
1673
|
+
? column.transform
|
|
1674
|
+
: (value) => {
|
|
1675
|
+
if (typeof value === 'string' || typeof value === 'number')
|
|
1676
|
+
return value;
|
|
1677
|
+
else
|
|
1678
|
+
return String(value);
|
|
1679
|
+
},
|
|
1680
|
+
values: [propertyValue],
|
|
1681
|
+
};
|
|
1682
|
+
tableColumns.push(tableColumnToAdd);
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
else {
|
|
1686
|
+
console.error(`this column "${column.name}" doesn't exist in this data structure`, dataStructures);
|
|
1687
|
+
}
|
|
1688
|
+
});
|
|
1689
|
+
});
|
|
1690
|
+
return tableColumns;
|
|
1691
|
+
}
|
|
1692
|
+
buildDataStructure({ index }) {
|
|
1693
|
+
return this.#buildObjectFromTableColumn({ tableColumns: this.tableColumns(), index });
|
|
1694
|
+
}
|
|
1695
|
+
#buildObjectFromTableColumn({ tableColumns, index }) {
|
|
1696
|
+
// We reconstruct the object passed to us from the selected index and the columns we receive
|
|
1697
|
+
/* INFO:
|
|
1698
|
+
Using this data as an input:
|
|
1699
|
+
index: 0
|
|
1700
|
+
columns = [
|
|
1701
|
+
{
|
|
1702
|
+
label: 'Id',
|
|
1703
|
+
name: 'id',
|
|
1704
|
+
values: ['333333', '222222'],
|
|
1705
|
+
width: '100px',
|
|
1706
|
+
},
|
|
1707
|
+
{
|
|
1708
|
+
label: 'Name',
|
|
1709
|
+
name: 'name',
|
|
1710
|
+
values: ['Buenos Aires', 'Mendoza'],
|
|
1711
|
+
width: 'auto',
|
|
1712
|
+
},
|
|
1713
|
+
{
|
|
1714
|
+
label: 'Chargers',
|
|
1715
|
+
name: 'chargers',
|
|
1716
|
+
values: [24, 27],
|
|
1717
|
+
width: '150px',
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
label: 'Hoses',
|
|
1721
|
+
name: 'hoses',
|
|
1722
|
+
values: [23, 26],
|
|
1723
|
+
width: '150px',
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
label: 'Drivers',
|
|
1727
|
+
name: 'drivers',
|
|
1728
|
+
values: [25, 29],
|
|
1729
|
+
width: '150px',
|
|
1730
|
+
},
|
|
1731
|
+
]
|
|
1732
|
+
|
|
1733
|
+
We will receive this result:
|
|
1734
|
+
{
|
|
1735
|
+
chargers: 24
|
|
1736
|
+
drivers: 25
|
|
1737
|
+
hoses: 23
|
|
1738
|
+
id: '333333'
|
|
1739
|
+
name: 'Buenos Aires'
|
|
1740
|
+
}
|
|
1741
|
+
*/
|
|
1742
|
+
return tableColumns.reduce((previous, current) => {
|
|
1743
|
+
return { ...previous, [current.name]: current.values[index] };
|
|
1744
|
+
}, {});
|
|
1706
1745
|
}
|
|
1707
|
-
|
|
1708
|
-
let valueTransformed;
|
|
1709
|
-
|
|
1710
|
-
|
|
1746
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1747
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: TableComponent, isStandalone: true, selector: "gld-table", inputs: { tableColumns: { classPropertyName: "tableColumns", publicName: "tableColumns", isSignal: true, isRequired: true, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, tableHeight: { classPropertyName: "tableHeight", publicName: "tableHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, selects: { classPropertyName: "selects", publicName: "selects", isSignal: true, isRequired: false, transformFunction: null }, selectsAll: { classPropertyName: "selectsAll", publicName: "selectsAll", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tableColumnAction: "tableColumnAction" }, ngImport: i0, template: "<!-- Search -->\n@if (search()) {\n <section class=\"table-search\">\n <ng-content select=\"gld-table-search\" />\n </section>\n}\n\n<!-- Table -->\n<article\n class=\"table\"\n [class.table--empty]=\"!tableColumnsToShow().length\"\n [style.height]=\"tableHeight()\">\n <!-- Table Content -->\n <section\n class=\"table-content\"\n [class.table-content--actions]=\"tableColumnActions().length\"\n [class.table-content--selects]=\"selects()\">\n <!-- Loading -->\n @if (loading()) {\n <gld-circle-loader loading background minHeight=\"100px\" />\n } @else {\n <!-- Table Columns -->\n @for (tableColumn of tableColumnsToShow(); track tableColumn) {\n <section\n class=\"table-column\"\n [style.flexBasis]=\"tableColumn.width\"\n [style.flexShrink]=\"tableColumn.width === 'auto' ? '1' : '0'\"\n [style.flexGrow]=\"tableColumn.width === 'auto' ? '1' : '0'\"\n [style.minWidth]=\"tableColumn.minWidth\"\n [style.maxWidth]=\"tableColumn.maxWidth\">\n <section class=\"table-header\">\n <span class=\"table-header-ellipsis\">{{ tableColumn.label }}</span>\n </section>\n @for (value of tableColumn.values; track $index) {\n <section\n class=\"table-cell\"\n [style.justifyContent]=\"tableColumn.justify\"\n [style.textAlign]=\"tableColumn.justify\">\n @if (tableColumn.transform(value) !== undefined) {\n @switch (true) {\n @case (tableColumn.template !== undefined) {\n <ng-container\n [ngTemplateOutlet]=\"tableColumn.template\"\n [ngTemplateOutletContext]=\"{ value: tableColumn.transform(value) }\" />\n }\n @default {\n <span class=\"table-cell-ellipsis\">{{ tableColumn.transform(value) }}</span>\n }\n }\n } @else {\n <span>-</span>\n }\n </section>\n }\n </section>\n } @empty {\n <!-- Empty -->\n <section class=\"table-empty\">\n <p>{{ emptyMessage() ? emptyMessage() : 'We have not data to show yet!' }}</p>\n </section>\n }\n }\n </section>\n\n <!-- Table Actions -->\n @if ((tableColumnActions().length || selects()) && !loading() && tableColumnsToShow().length) {\n <section\n class=\"table-column\"\n [class.table-column--actions]=\"tableColumnActions().length\"\n [class.table-column--selects]=\"selects()\">\n <!-- Header -->\n <section\n class=\"table-header\"\n [class.table-header--actions]=\"tableColumnActions().length\"\n [class.table-header--selects]=\"selects()\">\n <!-- Select All Checkbox -->\n @if (selectsAll()) {\n <!-- <mat-checkbox\n color=\"primary\"\n matTooltip=\"Todo\"\n matTooltipClass=\"Tooltip\"\n class=\"Checkbox\"\n [checked]=\"\n dragAndDropColumnSelected().length === dragAndDropColumns().at(0)?.values?.length\n \"\n [indeterminate]=\"\n !!dragAndDropColumnSelected().length &&\n dragAndDropColumnSelected().length !== dragAndDropColumns().at(0)?.values?.length\n \"\n (change)=\"onSelectOrUnselectAll($event, dragAndDropColumns())\"\n /> -->\n }\n </section>\n @for (value of tableColumnsToShow().at(0)?.values; track $index; let index = $index) {\n <!-- Cell -->\n <section class=\"table-cell table-cell--actions\">\n <!-- Select Checkbox -->\n @if (selects()) {\n <!-- <mat-checkbox\n color=\"primary\"\n class=\"Checkbox\"\n matTooltip=\"Seleccionar\"\n matTooltipClass=\"Tooltip\"\n [checked]=\"isSelected(dragAndDropColumns(), index)\"\n (change)=\"onSelect($event, dragAndDropColumns(), index)\" /> -->\n }\n @if (tableColumnActions()) {\n <!-- Dropdown Menu -->\n <gld-dropdown-menu\n background\n id=\"more button of table cell\"\n name=\"more button of table cell\"\n type=\"iconButton\"\n color=\"blue\"\n iconSize=\"small\"\n direction=\"left\"\n [icon]=\"Icons.more2Fill\"\n (changeValue)=\"\n tableActionFunction({\n tableColumnActionAsEvent: $event,\n tableColumns: tableColumns(),\n index,\n })\n \">\n @for (tableColumnAction of tableColumnActions(); track tableColumnAction.type) {\n <gld-dropdown-button\n [value]=\"tableColumnAction\"\n [icon]=\"tableColumnAction.icon\"\n iconSize=\"tiny\">\n {{ tableColumnAction.label }}\n </gld-dropdown-button>\n }\n </gld-dropdown-menu>\n <!-- <gld-icon-button\n background\n name=\"more button of table cell\"\n iconSize=\"small\"\n [icon]=\"Icons.more2Fill\"> -->\n <!-- <gld-tile color=\"blue-to-green\" class=\"Menu\">\n <section class=\"Menu-content\">\n @for (tableColumnAction of tableColumnActions(); track tableColumnAction.type) {\n <button\n class=\"Menu-button {{ tableColumnAction?.classToHover ?? '' }}\"\n [class.Menu-button--hidden]=\"\n !tableColumnAction.showWhen(buildDataStructure({ index }))\n \"\n (click)=\"\n tableActionFunction({\n tableColumnAction,\n tableColumns: tableColumns(),\n index,\n })\n \">\n <gld-icon size=\"tiny\" [icon]=\"tableColumnAction.icon\" />\n <span class=\"Menu-button-ellipsis\">{{ tableColumnAction.label }}</span>\n </button>\n }\n </section>\n </gld-tile> -->\n <!-- </gld-icon-button> -->\n }\n </section>\n }\n </section>\n }\n</article>\n\n<!-- Pagination -->\n@if (pagination()) {\n <section class=\"table-pagination\">\n <ng-content select=\"gld-table-pagination\" />\n </section>\n}\n", styles: [":host{width:100%}.table{--gld-color: var(--gld-foreground-color);--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-border-radius: var(--gld-radius--xxs);--gld-background: var(--gld-background-color);--gld-column-actions-or-selects-width: 40px;--gld-column-actions-and-selects-width: 80px;--gld-header-height: 40px;--gld-cell-height: 40px;--gld-min-height: 100px;min-height:var(--gld-min-height);display:grid;grid-template-columns:1fr;position:relative;border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-border-radius);background:var(--gld-background);overflow:hidden}.table-content{display:flex;flex-wrap:nowrap}.table-header,.table-cell{color:var(--color);font-family:var(--gld-font--poppins);padding:var(--gld-spacing--xxs) var(--gld-spacing--s);border-bottom:var(--gld-border-size) solid var(--gld-border-color)}.table-header-ellipsis,.table-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.table-header-ellipsis--hover,.table-cell-ellipsis--hover{cursor:pointer}.table-header{display:flex;align-items:center;font:600 var(--gld-font-size--small)/var(--gld-line-height) var(--gld-font--poppins);height:var(--gld-header-height)}.table-header.table-header--actions,.table-header.table-header--selects{justify-content:center}.table-header.table-header--actions.table-header--selects{justify-content:flex-start}.table-header--actions{background:var(--gld-background);border-left:var(--gld-border-size) solid var(--gld-border-color)}.table-header--actions:before{content:\"\";position:absolute;inset:0}.table-cell{display:flex;align-items:center;height:var(--gld-cell-height);font:400 var(--gld-font-size--small)/var(--gld-line-height) var(--gld-font--poppins)}.table-cell:last-of-type{margin-bottom:0;border-bottom:none}.table-cell.table-cell--actions,.table-cell.table-cell--selects{justify-content:center;padding:0}.table-cell--actions{position:relative;display:flex;justify-content:center;align-items:center;gap:var(--gld-spacing--xxxs);background:var(--gld-background);border-left:var(--gld-border-size) solid var(--gld-border-color)}.table-column{flex:1 1 auto}.table-column--actions,.table-column--selects,.table-column--actions.table-column--selects{position:absolute;top:0;right:0}.table-column--actions.table-column--selects{width:var(--gld-column-actions-and-selects-width)}.table-column--actions,.table-column--selects{width:var(--gld-column-actions-or-selects-width)}.table-empty{width:100%;display:flex;color:var(--gld-color);padding:var(--gld-spacing--xs)}.table-empty p{font:400 var(--gld-font-size--normal)/var(--gld-line-height) var(--gld-font--poppins);text-transform:lowercase;margin:auto}.table-empty p:first-letter{text-transform:uppercase}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DropdownButtonComponent, selector: "gld-dropdown-button", inputs: ["value", "icon", "iconSize", "iconSpace", "moveTopToBottom", "moveLeftToRight", "direction"], outputs: ["changeValue"] }, { kind: "component", type: DropdownMenuComponent, selector: "gld-dropdown-menu", inputs: ["id", "name", "type", "color", "size", "icon", "iconSize", "moveTopToBottom", "moveLeftToRight", "disabled", "full", "direction", "background", "selected", "initialValue"], outputs: ["changeValue", "changeFocus"] }, { kind: "component", type: CircleLoaderComponent, selector: "gld-circle-loader", inputs: ["loading", "background", "radius", "minHeight"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1748
|
+
}
|
|
1749
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TableComponent, decorators: [{
|
|
1750
|
+
type: Component,
|
|
1751
|
+
args: [{ selector: 'gld-table', standalone: true, imports: [NgTemplateOutlet, ...components], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Search -->\n@if (search()) {\n <section class=\"table-search\">\n <ng-content select=\"gld-table-search\" />\n </section>\n}\n\n<!-- Table -->\n<article\n class=\"table\"\n [class.table--empty]=\"!tableColumnsToShow().length\"\n [style.height]=\"tableHeight()\">\n <!-- Table Content -->\n <section\n class=\"table-content\"\n [class.table-content--actions]=\"tableColumnActions().length\"\n [class.table-content--selects]=\"selects()\">\n <!-- Loading -->\n @if (loading()) {\n <gld-circle-loader loading background minHeight=\"100px\" />\n } @else {\n <!-- Table Columns -->\n @for (tableColumn of tableColumnsToShow(); track tableColumn) {\n <section\n class=\"table-column\"\n [style.flexBasis]=\"tableColumn.width\"\n [style.flexShrink]=\"tableColumn.width === 'auto' ? '1' : '0'\"\n [style.flexGrow]=\"tableColumn.width === 'auto' ? '1' : '0'\"\n [style.minWidth]=\"tableColumn.minWidth\"\n [style.maxWidth]=\"tableColumn.maxWidth\">\n <section class=\"table-header\">\n <span class=\"table-header-ellipsis\">{{ tableColumn.label }}</span>\n </section>\n @for (value of tableColumn.values; track $index) {\n <section\n class=\"table-cell\"\n [style.justifyContent]=\"tableColumn.justify\"\n [style.textAlign]=\"tableColumn.justify\">\n @if (tableColumn.transform(value) !== undefined) {\n @switch (true) {\n @case (tableColumn.template !== undefined) {\n <ng-container\n [ngTemplateOutlet]=\"tableColumn.template\"\n [ngTemplateOutletContext]=\"{ value: tableColumn.transform(value) }\" />\n }\n @default {\n <span class=\"table-cell-ellipsis\">{{ tableColumn.transform(value) }}</span>\n }\n }\n } @else {\n <span>-</span>\n }\n </section>\n }\n </section>\n } @empty {\n <!-- Empty -->\n <section class=\"table-empty\">\n <p>{{ emptyMessage() ? emptyMessage() : 'We have not data to show yet!' }}</p>\n </section>\n }\n }\n </section>\n\n <!-- Table Actions -->\n @if ((tableColumnActions().length || selects()) && !loading() && tableColumnsToShow().length) {\n <section\n class=\"table-column\"\n [class.table-column--actions]=\"tableColumnActions().length\"\n [class.table-column--selects]=\"selects()\">\n <!-- Header -->\n <section\n class=\"table-header\"\n [class.table-header--actions]=\"tableColumnActions().length\"\n [class.table-header--selects]=\"selects()\">\n <!-- Select All Checkbox -->\n @if (selectsAll()) {\n <!-- <mat-checkbox\n color=\"primary\"\n matTooltip=\"Todo\"\n matTooltipClass=\"Tooltip\"\n class=\"Checkbox\"\n [checked]=\"\n dragAndDropColumnSelected().length === dragAndDropColumns().at(0)?.values?.length\n \"\n [indeterminate]=\"\n !!dragAndDropColumnSelected().length &&\n dragAndDropColumnSelected().length !== dragAndDropColumns().at(0)?.values?.length\n \"\n (change)=\"onSelectOrUnselectAll($event, dragAndDropColumns())\"\n /> -->\n }\n </section>\n @for (value of tableColumnsToShow().at(0)?.values; track $index; let index = $index) {\n <!-- Cell -->\n <section class=\"table-cell table-cell--actions\">\n <!-- Select Checkbox -->\n @if (selects()) {\n <!-- <mat-checkbox\n color=\"primary\"\n class=\"Checkbox\"\n matTooltip=\"Seleccionar\"\n matTooltipClass=\"Tooltip\"\n [checked]=\"isSelected(dragAndDropColumns(), index)\"\n (change)=\"onSelect($event, dragAndDropColumns(), index)\" /> -->\n }\n @if (tableColumnActions()) {\n <!-- Dropdown Menu -->\n <gld-dropdown-menu\n background\n id=\"more button of table cell\"\n name=\"more button of table cell\"\n type=\"iconButton\"\n color=\"blue\"\n iconSize=\"small\"\n direction=\"left\"\n [icon]=\"Icons.more2Fill\"\n (changeValue)=\"\n tableActionFunction({\n tableColumnActionAsEvent: $event,\n tableColumns: tableColumns(),\n index,\n })\n \">\n @for (tableColumnAction of tableColumnActions(); track tableColumnAction.type) {\n <gld-dropdown-button\n [value]=\"tableColumnAction\"\n [icon]=\"tableColumnAction.icon\"\n iconSize=\"tiny\">\n {{ tableColumnAction.label }}\n </gld-dropdown-button>\n }\n </gld-dropdown-menu>\n <!-- <gld-icon-button\n background\n name=\"more button of table cell\"\n iconSize=\"small\"\n [icon]=\"Icons.more2Fill\"> -->\n <!-- <gld-tile color=\"blue-to-green\" class=\"Menu\">\n <section class=\"Menu-content\">\n @for (tableColumnAction of tableColumnActions(); track tableColumnAction.type) {\n <button\n class=\"Menu-button {{ tableColumnAction?.classToHover ?? '' }}\"\n [class.Menu-button--hidden]=\"\n !tableColumnAction.showWhen(buildDataStructure({ index }))\n \"\n (click)=\"\n tableActionFunction({\n tableColumnAction,\n tableColumns: tableColumns(),\n index,\n })\n \">\n <gld-icon size=\"tiny\" [icon]=\"tableColumnAction.icon\" />\n <span class=\"Menu-button-ellipsis\">{{ tableColumnAction.label }}</span>\n </button>\n }\n </section>\n </gld-tile> -->\n <!-- </gld-icon-button> -->\n }\n </section>\n }\n </section>\n }\n</article>\n\n<!-- Pagination -->\n@if (pagination()) {\n <section class=\"table-pagination\">\n <ng-content select=\"gld-table-pagination\" />\n </section>\n}\n", styles: [":host{width:100%}.table{--gld-color: var(--gld-foreground-color);--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-border-radius: var(--gld-radius--xxs);--gld-background: var(--gld-background-color);--gld-column-actions-or-selects-width: 40px;--gld-column-actions-and-selects-width: 80px;--gld-header-height: 40px;--gld-cell-height: 40px;--gld-min-height: 100px;min-height:var(--gld-min-height);display:grid;grid-template-columns:1fr;position:relative;border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-border-radius);background:var(--gld-background);overflow:hidden}.table-content{display:flex;flex-wrap:nowrap}.table-header,.table-cell{color:var(--color);font-family:var(--gld-font--poppins);padding:var(--gld-spacing--xxs) var(--gld-spacing--s);border-bottom:var(--gld-border-size) solid var(--gld-border-color)}.table-header-ellipsis,.table-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.table-header-ellipsis--hover,.table-cell-ellipsis--hover{cursor:pointer}.table-header{display:flex;align-items:center;font:600 var(--gld-font-size--small)/var(--gld-line-height) var(--gld-font--poppins);height:var(--gld-header-height)}.table-header.table-header--actions,.table-header.table-header--selects{justify-content:center}.table-header.table-header--actions.table-header--selects{justify-content:flex-start}.table-header--actions{background:var(--gld-background);border-left:var(--gld-border-size) solid var(--gld-border-color)}.table-header--actions:before{content:\"\";position:absolute;inset:0}.table-cell{display:flex;align-items:center;height:var(--gld-cell-height);font:400 var(--gld-font-size--small)/var(--gld-line-height) var(--gld-font--poppins)}.table-cell:last-of-type{margin-bottom:0;border-bottom:none}.table-cell.table-cell--actions,.table-cell.table-cell--selects{justify-content:center;padding:0}.table-cell--actions{position:relative;display:flex;justify-content:center;align-items:center;gap:var(--gld-spacing--xxxs);background:var(--gld-background);border-left:var(--gld-border-size) solid var(--gld-border-color)}.table-column{flex:1 1 auto}.table-column--actions,.table-column--selects,.table-column--actions.table-column--selects{position:absolute;top:0;right:0}.table-column--actions.table-column--selects{width:var(--gld-column-actions-and-selects-width)}.table-column--actions,.table-column--selects{width:var(--gld-column-actions-or-selects-width)}.table-empty{width:100%;display:flex;color:var(--gld-color);padding:var(--gld-spacing--xs)}.table-empty p{font:400 var(--gld-font-size--normal)/var(--gld-line-height) var(--gld-font--poppins);text-transform:lowercase;margin:auto}.table-empty p:first-letter{text-transform:uppercase}\n"] }]
|
|
1752
|
+
}], propDecorators: { tableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableColumns", required: true }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], tableHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableHeight", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], selects: [{ type: i0.Input, args: [{ isSignal: true, alias: "selects", required: false }] }], selectsAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectsAll", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }], tableColumnAction: [{ type: i0.Output, args: ["tableColumnAction"] }] } });
|
|
1753
|
+
|
|
1754
|
+
// Angular Imports
|
|
1755
|
+
class TablePaginationComponent {
|
|
1756
|
+
Icons = Icons;
|
|
1757
|
+
pagination = input.required({ ...(ngDevMode ? { debugName: "pagination" } : {}) });
|
|
1758
|
+
page = output();
|
|
1759
|
+
changeToNext = output();
|
|
1760
|
+
changeToPrevious = output();
|
|
1761
|
+
currentPage = signal(0, { ...(ngDevMode ? { debugName: "currentPage" } : {}) });
|
|
1762
|
+
maxPages = computed(() => {
|
|
1763
|
+
if (this.pagination().itemsPerPage > this.pagination().maxItems)
|
|
1764
|
+
return 1;
|
|
1711
1765
|
else
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
if (clientHeight)
|
|
1721
|
-
selectElement?.style.setProperty('--gld-option-height', `${clientHeight}px`);
|
|
1722
|
-
selectOptionChildren.map((selectOption) => {
|
|
1723
|
-
selectOption.selected.subscribe((value) => {
|
|
1724
|
-
if (value) {
|
|
1725
|
-
const buttons = Array.from(selectElement?.querySelectorAll('gld-select-option button') ?? []);
|
|
1726
|
-
buttons.map((button) => button.blur());
|
|
1727
|
-
const valueTransformed = this.#transformValue(value);
|
|
1728
|
-
this.innerControl().setValue(valueTransformed, { emitEvent: false });
|
|
1729
|
-
this.onChange(value);
|
|
1730
|
-
this.onTouched();
|
|
1731
|
-
this.isMenuOpen.set(false);
|
|
1732
|
-
}
|
|
1733
|
-
});
|
|
1766
|
+
return Math.ceil(this.pagination().maxItems / this.pagination().itemsPerPage);
|
|
1767
|
+
}, { ...(ngDevMode ? { debugName: "maxPages" } : {}) });
|
|
1768
|
+
constructor() {
|
|
1769
|
+
effect(() => this.page.emit(this.currentPage()));
|
|
1770
|
+
effect(() => {
|
|
1771
|
+
const initialPage = this.pagination().initialPage;
|
|
1772
|
+
if (initialPage)
|
|
1773
|
+
this.currentPage.set(initialPage);
|
|
1734
1774
|
});
|
|
1735
1775
|
}
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
// It isn't validators
|
|
1743
|
-
if (validatorFn === null) {
|
|
1744
|
-
this.hasValidators.set({
|
|
1745
|
-
required: false,
|
|
1746
|
-
naturalNumber: false,
|
|
1747
|
-
string: false,
|
|
1748
|
-
maxLength: null,
|
|
1749
|
-
});
|
|
1750
|
-
return;
|
|
1776
|
+
nextPage() {
|
|
1777
|
+
if (this.pagination().maxItems !== 0) {
|
|
1778
|
+
if (this.currentPage() !==
|
|
1779
|
+
Math.ceil(this.pagination().maxItems / this.pagination().itemsPerPage)) {
|
|
1780
|
+
this.currentPage.update((previousPage) => previousPage + 1);
|
|
1781
|
+
}
|
|
1751
1782
|
}
|
|
1752
|
-
|
|
1753
|
-
const requiredErrors = validatorFn(new FormControl(''));
|
|
1754
|
-
const typeErrors = validatorFn(new FormControl('abc123'));
|
|
1755
|
-
const maxLengthErrors = validatorFn(new FormControl({ length: Infinity }));
|
|
1756
|
-
const maxLength = maxLengthErrors?.['maxlength']?.['requiredLength'];
|
|
1757
|
-
this.hasValidators.set({
|
|
1758
|
-
required: Boolean(requiredErrors?.['required']),
|
|
1759
|
-
naturalNumber: Boolean(typeErrors?.['isNaturalNumber']),
|
|
1760
|
-
string: Boolean(typeErrors?.['isString']),
|
|
1761
|
-
maxLength: maxLength ? maxLength + maskSpacers : null,
|
|
1762
|
-
});
|
|
1763
|
-
// console.log('hasValidators', this.hasValidators())
|
|
1783
|
+
this.changeToNext.emit(this.currentPage());
|
|
1764
1784
|
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1785
|
+
previousPage() {
|
|
1786
|
+
if (this.currentPage() === 1) {
|
|
1787
|
+
this.currentPage.set(1);
|
|
1788
|
+
}
|
|
1789
|
+
else {
|
|
1790
|
+
this.currentPage.update((previousPage) => previousPage - 1);
|
|
1791
|
+
}
|
|
1792
|
+
this.changeToPrevious.emit(this.currentPage());
|
|
1793
|
+
}
|
|
1794
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TablePaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1795
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: TablePaginationComponent, isStandalone: true, selector: "gld-table-pagination", inputs: { pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { page: "page", changeToNext: "changeToNext", changeToPrevious: "changeToPrevious" }, ngImport: i0, template: "<article class=\"Pagination\">\r\n <section class=\"Pagination-info\">\r\n <p class=\"Pagination-label\">P\u00E1gina {{ currentPage() }} de {{ maxPages() }}</p>\r\n </section>\r\n <section class=\"Pagination-actions\">\r\n <!-- <gld-icon-button\r\n class=\"\"\r\n name=\"button-next\"\r\n iconSize=\"small\"\r\n [icon]=\"Icons.arrowLeftSLine\"\r\n (clicked)=\"previousPage()\" />\r\n <gld-icon-button\r\n class=\"\"\r\n name=\"button-previous\"\r\n iconSize=\"small\"\r\n [icon]=\"Icons.arrowRightSLine\"\r\n (clicked)=\"nextPage()\" /> -->\r\n </section>\r\n</article>\r\n", styles: [".Pagination{--color: var(--darkblue);--height: 40px;display:flex;justify-content:space-between;align-items:center;gap:var(--spacing--s);margin:var(--spacing--s) 0;height:var(--height);padding-left:var(--spacing--s)}.Pagination.Theme--dark{--color: var(--whitelight)}.Pagination-label{margin:0;font:600 var(--font-size--normal) var(--font--poppins);color:var(--color)}.Pagination-actions{display:flex;gap:var(--spacing--xxxs)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1773
1796
|
}
|
|
1774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
1797
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TablePaginationComponent, decorators: [{
|
|
1775
1798
|
type: Component,
|
|
1776
|
-
args: [{ selector: 'gld-
|
|
1777
|
-
|
|
1778
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1779
|
-
useExisting: forwardRef(() => SelectComponent),
|
|
1780
|
-
multi: true,
|
|
1781
|
-
},
|
|
1782
|
-
], template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section #selectElement class=\"select\">\n <section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n <!-- Input -->\n <input\n type=\"text\"\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keyup.escape)=\"onBlur()\" />\n\n <!-- Suffix -->\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n\n <!-- Menu -->\n <ng-container [ngTemplateOutlet]=\"menuTemplate\" />\n </section>\n <!-- Errors -->\n @if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n } @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n }\n</section>\n\n<!-- Menu Template -->\n<ng-template #menuTemplate>\n <section class=\"select-menu\" [class.select-menu--opened]=\"isMenuOpen()\">\n <ng-content select=\"gld-select-option\" />\n </section>\n</ng-template>\n\n<!-- Suffix Template -->\n<ng-template #suffixTemplate>\n @if (control().pending) {\n <gld-icon\n size=\"small\"\n class=\"input-icon input-icon--animated\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.loader4Fill\"\n [disabled]=\"disabled\" />\n } @else {\n <gld-icon\n size=\"small\"\n class=\"input-icon\"\n [class.input-icon--rotated]=\"isMenuOpen()\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.arrowDownSLine\"\n [disabled]=\"disabled\"\n (clicked)=\"arrowIconClicked()\" />\n }\n</ng-template>\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n<!-- <section>status: {{ control().status }}</section> -->\n\n<!-- FIXME: Verify why this element is here -->\n<!-- Suffix Template -->\n<!-- <ng-template #suffixTemplate>\n <gld-icon\n size=\"small\"\n class=\"input-icon\"\n [class.input-icon--error]=\"errors\"\n [icon]=\"Icons.arrowDownSLine\" />\n</ng-template> -->\n\n<!-- <h3>Debugging</h3> -->\n<!-- <section>errors: {{ control().errors | json }}</section> -->\n<!-- <section>errors: {{ errors }}</section> -->\n<!-- <section>invalid: {{ control().invalid }}</section> -->\n<!-- <section>dirty: {{ control().dirty }}</section> -->\n<!-- <section>touched: {{ control().touched }}</section> -->\n<!-- <section>disable: {{ control().disabled }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-height: 40px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input input{width:100%;min-width:var(--gld-min-with);height:var(--gld-height);padding:var(--gld-spacing--xxs);padding-right:var(--gld-spacing--m);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input input:focus{--gld-border-color: var(--gld-blue)}.input input::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:var(--gld-spacing--xxs);color:var(--gld-color);-webkit-user-select:none;user-select:none;will-change:transform,color;transition:transform var(--gld-animation-time) ease,color var(--gld-animation-time) ease-in-out;cursor:pointer}.input-icon--animated{animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.input-icon--rotated{transform:rotate(180deg)}.select{--gld-background: light-dark(var(--gld-whitelight), var(--gld-darkblue));--gld-shadow: light-dark(var(--gld-gray-transparent--040), var(--gld-gray-transparent--020));--gld-height: 40px;--gld-option-items: 0;--gld-option-height: 40px;--gld-animation-time: var(--gld-animation-time--150);--gld-padding: var(--gld-spacing--xxxs);--gld-radius: var(--gld-radius--xxs);position:relative;background:transparent}.select-menu{position:absolute;z-index:1;top:calc(var(--gld-height) + 22px);left:0;height:0;padding:0;display:grid;grid-template-columns:1fr;background:var(--gld-background);box-shadow:inset 0 0 0 var(--gld-border-size) var(--gld-shadow);border-radius:var(--gld-radius);min-width:100%;max-width:100%;max-height:calc(var(--gld-option-height) * 5);overflow-y:auto;will-change:height,padding;transition:var(--gld-animation-time) height ease-in-out,var(--gld-animation-time) padding ease-in-out}.select-menu--opened{height:calc(var(--gld-option-height) * var(--gld-option-items) + var(--gld-padding) * 2);padding:var(--gld-padding)}\n"] }]
|
|
1783
|
-
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], transform: [{ type: i0.Input, args: [{ isSignal: true, alias: "transform", required: false }] }], selectElement: [{ type: i0.ViewChild, args: ['selectElement', { isSignal: true }] }], selectOptionChildren: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SelectOptionComponent), { isSignal: true }] }] } });
|
|
1799
|
+
args: [{ selector: 'gld-table-pagination', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article class=\"Pagination\">\r\n <section class=\"Pagination-info\">\r\n <p class=\"Pagination-label\">P\u00E1gina {{ currentPage() }} de {{ maxPages() }}</p>\r\n </section>\r\n <section class=\"Pagination-actions\">\r\n <!-- <gld-icon-button\r\n class=\"\"\r\n name=\"button-next\"\r\n iconSize=\"small\"\r\n [icon]=\"Icons.arrowLeftSLine\"\r\n (clicked)=\"previousPage()\" />\r\n <gld-icon-button\r\n class=\"\"\r\n name=\"button-previous\"\r\n iconSize=\"small\"\r\n [icon]=\"Icons.arrowRightSLine\"\r\n (clicked)=\"nextPage()\" /> -->\r\n </section>\r\n</article>\r\n", styles: [".Pagination{--color: var(--darkblue);--height: 40px;display:flex;justify-content:space-between;align-items:center;gap:var(--spacing--s);margin:var(--spacing--s) 0;height:var(--height);padding-left:var(--spacing--s)}.Pagination.Theme--dark{--color: var(--whitelight)}.Pagination-label{margin:0;font:600 var(--font-size--normal) var(--font--poppins);color:var(--color)}.Pagination-actions{display:flex;gap:var(--spacing--xxxs)}\n"] }]
|
|
1800
|
+
}], ctorParameters: () => [], propDecorators: { pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: true }] }], page: [{ type: i0.Output, args: ["page"] }], changeToNext: [{ type: i0.Output, args: ["changeToNext"] }], changeToPrevious: [{ type: i0.Output, args: ["changeToPrevious"] }] } });
|
|
1784
1801
|
|
|
1785
1802
|
// Angular Imports
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
placeholder = input('', { ...(ngDevMode ? { debugName: "placeholder" } : {}) });
|
|
1795
|
-
type = input('text', { ...(ngDevMode ? { debugName: "type" } : {}) });
|
|
1796
|
-
suffix = input(false, { ...(ngDevMode ? { debugName: "suffix" } : {}), transform: booleanAttribute });
|
|
1797
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
|
|
1798
|
-
onChange = (value) => { };
|
|
1799
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1800
|
-
onTouched = () => { };
|
|
1801
|
-
innerControl = signal(new FormControl('', { nonNullable: true }), { ...(ngDevMode ? { debugName: "innerControl" } : {}) });
|
|
1802
|
-
hasValidators = signal({
|
|
1803
|
-
required: false,
|
|
1804
|
-
naturalNumber: false,
|
|
1805
|
-
string: false,
|
|
1806
|
-
maxLength: null,
|
|
1807
|
-
}, { ...(ngDevMode ? { debugName: "hasValidators" } : {}) });
|
|
1803
|
+
class TableSearchComponent {
|
|
1804
|
+
#formBuilder = inject(FormBuilder);
|
|
1805
|
+
Icons = Icons;
|
|
1806
|
+
placeholder = input('buscar', { ...(ngDevMode ? { debugName: "placeholder" } : {}) });
|
|
1807
|
+
width = input('auto', { ...(ngDevMode ? { debugName: "width" } : {}) });
|
|
1808
|
+
debounceTime = input(250, { ...(ngDevMode ? { debugName: "debounceTime" } : {}) });
|
|
1809
|
+
searching = output();
|
|
1810
|
+
control = this.#formBuilder.control('');
|
|
1808
1811
|
constructor() {
|
|
1809
|
-
this.
|
|
1810
|
-
.
|
|
1812
|
+
this.control.valueChanges
|
|
1813
|
+
.pipe(debounceTime(this.debounceTime()))
|
|
1811
1814
|
.subscribe((value) => {
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1815
|
+
const action = value?.length
|
|
1816
|
+
? TableSearchAction.searching
|
|
1817
|
+
: TableSearchAction.cleared;
|
|
1818
|
+
const searching = value?.length ? value : '';
|
|
1819
|
+
this.searching.emit({
|
|
1820
|
+
action,
|
|
1821
|
+
searching,
|
|
1822
|
+
});
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TableSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1826
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: TableSearchComponent, isStandalone: true, selector: "gld-table-search", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searching: "searching" }, ngImport: i0, template: "<article class=\"Search\">\r\n <section class=\"Input\" [style.width]=\"width()\">\r\n <!-- <gld-icon [icon]=\"Icons.search2Line\" /> -->\r\n\r\n <input\r\n id=\"search\"\r\n name=\"search\"\r\n type=\"search\"\r\n [placeholder]=\"placeholder()\"\r\n [formControl]=\"control\" />\r\n </section>\r\n</article>\r\n", styles: [".Search{margin-bottom:24px}.Input{--radius: 100px;--background: var(--whitelight);--color: var(--darkblue);--placeholder-color: var(--gray);--border-color: var(--gray);--outline-color: var(--blue);--label-color: var(--darkblue);--height: 40px;--min-with: 350px;--icon-size: 20px;--animation-time: var(--animation-time--150);position:relative}.Input input{position:relative;width:100%;min-width:var(--min-with);height:var(--height);padding:12px 24px 12px calc(24px + var(--icon-size) + 12px);font-size:16px;font-family:inherit;color:var(--color);background:var(--background);border:1px solid var(--border-color);border-radius:var(--radius)}.Input input:focus{outline-color:var(--outline-color)}.Input input::placeholder{color:var(--color)}.Input gld-icon{position:absolute;left:24px;top:calc(50% - 11px);z-index:1;color:var(--border-color)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1827
|
+
}
|
|
1828
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TableSearchComponent, decorators: [{
|
|
1829
|
+
type: Component,
|
|
1830
|
+
args: [{ selector: 'gld-table-search', standalone: true, imports: [ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article class=\"Search\">\r\n <section class=\"Input\" [style.width]=\"width()\">\r\n <!-- <gld-icon [icon]=\"Icons.search2Line\" /> -->\r\n\r\n <input\r\n id=\"search\"\r\n name=\"search\"\r\n type=\"search\"\r\n [placeholder]=\"placeholder()\"\r\n [formControl]=\"control\" />\r\n </section>\r\n</article>\r\n", styles: [".Search{margin-bottom:24px}.Input{--radius: 100px;--background: var(--whitelight);--color: var(--darkblue);--placeholder-color: var(--gray);--border-color: var(--gray);--outline-color: var(--blue);--label-color: var(--darkblue);--height: 40px;--min-with: 350px;--icon-size: 20px;--animation-time: var(--animation-time--150);position:relative}.Input input{position:relative;width:100%;min-width:var(--min-with);height:var(--height);padding:12px 24px 12px calc(24px + var(--icon-size) + 12px);font-size:16px;font-family:inherit;color:var(--color);background:var(--background);border:1px solid var(--border-color);border-radius:var(--radius)}.Input input:focus{outline-color:var(--outline-color)}.Input input::placeholder{color:var(--color)}.Input gld-icon{position:absolute;left:24px;top:calc(50% - 11px);z-index:1;color:var(--border-color)}\n"] }]
|
|
1831
|
+
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }], searching: [{ type: i0.Output, args: ["searching"] }] } });
|
|
1832
|
+
|
|
1833
|
+
// Angular Imports
|
|
1834
|
+
class TileComponent {
|
|
1835
|
+
color = input(TileColor.default, { ...(ngDevMode ? { debugName: "color" } : {}) });
|
|
1836
|
+
paddingSize = input(TilePaddingSize.zero, { ...(ngDevMode ? { debugName: "paddingSize" } : {}) });
|
|
1837
|
+
background = input(false, { ...(ngDevMode ? { debugName: "background" } : {}), transform: booleanAttribute });
|
|
1838
|
+
hover = input(false, { ...(ngDevMode ? { debugName: "hover" } : {}), transform: booleanAttribute });
|
|
1839
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1840
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: TileComponent, isStandalone: true, selector: "gld-tile", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, paddingSize: { classPropertyName: "paddingSize", publicName: "paddingSize", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, hover: { classPropertyName: "hover", publicName: "hover", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<article\r\n class=\"tile tile--{{ color() }} tile--padding-{{ paddingSize() }}\"\r\n [class.tile--background]=\"background()\"\r\n [class.tile--hover]=\"hover()\">\r\n <section class=\"tile-content\">\r\n <ng-content />\r\n </section>\r\n</article>\r\n", styles: [":host{width:100%;height:auto;position:relative;z-index:1}.tile{--gld-background: initial;--gld-background--hover: initial;--gld-border-color: transparent;--gld-padding-size: 0;--gld-radius: var(--gld-radius--xxs);width:inherit;height:inherit;position:relative;padding:var(--gld-padding-size);background:var(--gld-background);border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);overflow:hidden;will-change:background;transition:background var(--gld-animation-time--150)}.tile--hover:hover,.tile--hover:focus{background:var(--gld-background--hover)}.tile.tile--hover{cursor:pointer}.tile--default{--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) )}.tile--default.tile--background{--gld-background: var(--gld-gray-transparent--010)}.tile--default.tile--hover{--gld-background--hover: var(--gld-gray-transparent--020)}.tile--blue{--gld-border-color: var(--gld-blue-transparent--020)}.tile--blue.tile--background{--gld-background: var(--gld-blue-transparent--005)}.tile--blue.tile--hover{--gld-background--hover: var(--gld-blue-transparent--010)}.tile--green{--gld-border-color: var(--gld-green-transparent--020)}.tile--green.tile--background{--gld-background: var(--gld-green-transparent--005)}.tile--green.tile--hover{--gld-background--hover: var(--gld-green-transparent--010)}.tile--purple{--gld-border-color: var(--gld-purple-transparent--020)}.tile--purple.tile--background{--gld-background: var(--gld-purple-transparent--005)}.tile--purple.tile--hover{--gld-background--hover: var(--gld-purple-transparent--010)}.tile--mustard{--gld-border-color: var(--gld-mustard-transparent--020)}.tile--mustard.tile--background{--gld-background: var(--gld-mustard-transparent--005)}.tile--mustard.tile--hover{--gld-background--hover: var(--gld-mustard-transparent--010)}.tile--orange{--gld-border-color: var(--gld-orange-transparent--020)}.tile--orange.tile--background{--gld-background: var(--gld-orange-transparent--005)}.tile--orange.tile--hover{--gld-background--hover: var(--gld-orange-transparent--010)}.tile--pink{--gld-border-color: var(--gld-pink-transparent--020)}.tile--pink.tile--background{--gld-background: var(--gld-pink-transparent--005)}.tile--pink.tile--hover{--gld-background--hover: var(--gld-pink-transparent--010)}.tile--red{--gld-border-color: var(--gld-red-transparent--020)}.tile--red.tile--background{--gld-background: var(--gld-red-transparent--005)}.tile--red.tile--hover{--gld-background--hover: var(--gld-red-transparent--010)}.tile--padding-tiny{--gld-padding-size: var(--gld-spacing--xxxs)}.tile--padding-small{--gld-padding-size: var(--gld-spacing--xs)}.tile--padding-normal{--gld-padding-size: var(--gld-spacing--s)}.tile--padding-medium{--gld-padding-size: var(--gld-spacing--l)}.tile--padding-large{--gld-padding-size: var(--gld-spacing--xl)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1841
|
+
}
|
|
1842
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TileComponent, decorators: [{
|
|
1843
|
+
type: Component,
|
|
1844
|
+
args: [{ selector: 'gld-tile', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article\r\n class=\"tile tile--{{ color() }} tile--padding-{{ paddingSize() }}\"\r\n [class.tile--background]=\"background()\"\r\n [class.tile--hover]=\"hover()\">\r\n <section class=\"tile-content\">\r\n <ng-content />\r\n </section>\r\n</article>\r\n", styles: [":host{width:100%;height:auto;position:relative;z-index:1}.tile{--gld-background: initial;--gld-background--hover: initial;--gld-border-color: transparent;--gld-padding-size: 0;--gld-radius: var(--gld-radius--xxs);width:inherit;height:inherit;position:relative;padding:var(--gld-padding-size);background:var(--gld-background);border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);overflow:hidden;will-change:background;transition:background var(--gld-animation-time--150)}.tile--hover:hover,.tile--hover:focus{background:var(--gld-background--hover)}.tile.tile--hover{cursor:pointer}.tile--default{--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) )}.tile--default.tile--background{--gld-background: var(--gld-gray-transparent--010)}.tile--default.tile--hover{--gld-background--hover: var(--gld-gray-transparent--020)}.tile--blue{--gld-border-color: var(--gld-blue-transparent--020)}.tile--blue.tile--background{--gld-background: var(--gld-blue-transparent--005)}.tile--blue.tile--hover{--gld-background--hover: var(--gld-blue-transparent--010)}.tile--green{--gld-border-color: var(--gld-green-transparent--020)}.tile--green.tile--background{--gld-background: var(--gld-green-transparent--005)}.tile--green.tile--hover{--gld-background--hover: var(--gld-green-transparent--010)}.tile--purple{--gld-border-color: var(--gld-purple-transparent--020)}.tile--purple.tile--background{--gld-background: var(--gld-purple-transparent--005)}.tile--purple.tile--hover{--gld-background--hover: var(--gld-purple-transparent--010)}.tile--mustard{--gld-border-color: var(--gld-mustard-transparent--020)}.tile--mustard.tile--background{--gld-background: var(--gld-mustard-transparent--005)}.tile--mustard.tile--hover{--gld-background--hover: var(--gld-mustard-transparent--010)}.tile--orange{--gld-border-color: var(--gld-orange-transparent--020)}.tile--orange.tile--background{--gld-background: var(--gld-orange-transparent--005)}.tile--orange.tile--hover{--gld-background--hover: var(--gld-orange-transparent--010)}.tile--pink{--gld-border-color: var(--gld-pink-transparent--020)}.tile--pink.tile--background{--gld-background: var(--gld-pink-transparent--005)}.tile--pink.tile--hover{--gld-background--hover: var(--gld-pink-transparent--010)}.tile--red{--gld-border-color: var(--gld-red-transparent--020)}.tile--red.tile--background{--gld-background: var(--gld-red-transparent--005)}.tile--red.tile--hover{--gld-background--hover: var(--gld-red-transparent--010)}.tile--padding-tiny{--gld-padding-size: var(--gld-spacing--xxxs)}.tile--padding-small{--gld-padding-size: var(--gld-spacing--xs)}.tile--padding-normal{--gld-padding-size: var(--gld-spacing--s)}.tile--padding-medium{--gld-padding-size: var(--gld-spacing--l)}.tile--padding-large{--gld-padding-size: var(--gld-spacing--xl)}\n"] }]
|
|
1845
|
+
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], paddingSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingSize", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], hover: [{ type: i0.Input, args: [{ isSignal: true, alias: "hover", required: false }] }] } });
|
|
1846
|
+
|
|
1847
|
+
// Store Imports
|
|
1848
|
+
const initialAuthState = {
|
|
1849
|
+
logged: false,
|
|
1850
|
+
accessToken: '',
|
|
1851
|
+
refreshToken: '',
|
|
1852
|
+
};
|
|
1853
|
+
const AuthStore = signalStore(withState(initialAuthState), withMethods((store, cookiesService = inject(CookieService)) => ({
|
|
1854
|
+
signin: (parameters) => {
|
|
1855
|
+
const { accessToken, refreshToken, saveCookie = true } = parameters;
|
|
1856
|
+
if (saveCookie) {
|
|
1857
|
+
cookiesService.set(CookiesKeys.accessToken, accessToken);
|
|
1858
|
+
cookiesService.set(CookiesKeys.refreshToken, refreshToken);
|
|
1859
|
+
}
|
|
1860
|
+
patchState(store, (previous) => ({
|
|
1861
|
+
...previous,
|
|
1862
|
+
logged: true,
|
|
1863
|
+
accessToken,
|
|
1864
|
+
refreshToken,
|
|
1865
|
+
}));
|
|
1866
|
+
},
|
|
1867
|
+
signout: () => {
|
|
1868
|
+
cookiesService.delete(CookiesKeys.accessToken);
|
|
1869
|
+
cookiesService.delete(CookiesKeys.refreshToken);
|
|
1870
|
+
patchState(store, (previous) => ({
|
|
1871
|
+
...previous,
|
|
1872
|
+
logged: false,
|
|
1873
|
+
accessToken: '',
|
|
1874
|
+
refreshToken: '',
|
|
1875
|
+
}));
|
|
1876
|
+
},
|
|
1877
|
+
})));
|
|
1878
|
+
|
|
1879
|
+
// Angular Imports
|
|
1880
|
+
const STORES_ENVIRONMENT = new InjectionToken('stores-environment');
|
|
1881
|
+
|
|
1882
|
+
// Angular Imports
|
|
1883
|
+
const SERVICES_ENVIRONMENT = new InjectionToken('services-environment');
|
|
1884
|
+
|
|
1885
|
+
// Angular Imports
|
|
1886
|
+
class AuthService {
|
|
1887
|
+
environment = inject(SERVICES_ENVIRONMENT);
|
|
1888
|
+
router = inject(Router);
|
|
1889
|
+
http = inject(HttpClient);
|
|
1890
|
+
authStore = inject(AuthStore);
|
|
1891
|
+
iamgldApi = computed(() => this.environment.iamgldApi, { ...(ngDevMode ? { debugName: "iamgldApi" } : {}) });
|
|
1892
|
+
signin(parameters) {
|
|
1893
|
+
const { email, password } = parameters;
|
|
1894
|
+
const url = `${this.iamgldApi()}/v1/auth/signin`;
|
|
1895
|
+
const payload = {
|
|
1896
|
+
email,
|
|
1897
|
+
password,
|
|
1898
|
+
};
|
|
1899
|
+
return this.http.post(url, payload).pipe(map((response) => {
|
|
1900
|
+
if (response && response.accessToken && response.refreshToken) {
|
|
1901
|
+
this.authStore.signin({
|
|
1902
|
+
accessToken: response.accessToken,
|
|
1903
|
+
refreshToken: response.refreshToken,
|
|
1904
|
+
});
|
|
1824
1905
|
}
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
* This sanitizes the value input by keeping only letters (a-z, A-Z, with accents like á, é, í, ó, ú, ñ) and spaces.
|
|
1828
|
-
* Numbers, special characters, and symbols are removed.
|
|
1829
|
-
*
|
|
1830
|
-
* @example
|
|
1831
|
-
* // Input: "Juan123@García#456 Pérez$"
|
|
1832
|
-
* // Output: "JuanGarcía Pérez"
|
|
1833
|
-
*/
|
|
1834
|
-
if (String(value) && this.hasValidators().string) {
|
|
1835
|
-
_value = String(value).replaceAll(STRING_REGEX_TO_CLEAN$1, '');
|
|
1836
|
-
this.innerControl().markAsUntouched();
|
|
1906
|
+
else {
|
|
1907
|
+
throw new Error('An unexpected error occurred when we were trying to hit this api - signin');
|
|
1837
1908
|
}
|
|
1838
|
-
|
|
1839
|
-
this.onChange(_value);
|
|
1840
|
-
});
|
|
1909
|
+
}));
|
|
1841
1910
|
}
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
this
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1911
|
+
refreshAccessToken(parameters) {
|
|
1912
|
+
const { refreshToken } = parameters;
|
|
1913
|
+
const url = `${this.iamgldApi()}/v1/auth/refresh`;
|
|
1914
|
+
const payload = {
|
|
1915
|
+
refreshToken,
|
|
1916
|
+
};
|
|
1917
|
+
return this.http.post(url, payload).pipe(catchError((error) => {
|
|
1918
|
+
if (error &&
|
|
1919
|
+
error.error &&
|
|
1920
|
+
error.error.statusCode === 401 &&
|
|
1921
|
+
error.error.message === 'jwt expired') {
|
|
1922
|
+
// console.log('logout')
|
|
1923
|
+
this.authStore.signout();
|
|
1924
|
+
this.router.navigate(['/signin']);
|
|
1925
|
+
return throwError(() => new Error('Session expired. Please log in again.'));
|
|
1926
|
+
}
|
|
1927
|
+
return throwError(() => error);
|
|
1928
|
+
}), map((response) => {
|
|
1929
|
+
if (response && response.accessToken && response.refreshToken) {
|
|
1930
|
+
this.authStore.signin({
|
|
1931
|
+
accessToken: response.accessToken,
|
|
1932
|
+
refreshToken: response.refreshToken,
|
|
1933
|
+
saveCookie: false,
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
else {
|
|
1937
|
+
this.authStore.signout();
|
|
1938
|
+
this.router.navigate(['/signin']);
|
|
1939
|
+
throw new Error('An unexpected error occurred when we were trying to hit this api - refreshAccessToken');
|
|
1940
|
+
}
|
|
1941
|
+
}));
|
|
1853
1942
|
}
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1943
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1944
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: AuthService });
|
|
1945
|
+
}
|
|
1946
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: AuthService, decorators: [{
|
|
1947
|
+
type: Injectable
|
|
1948
|
+
}] });
|
|
1949
|
+
|
|
1950
|
+
// Angular Imports
|
|
1951
|
+
// Don't remove providedIn: 'root' decorator, it's important for the custom preloading works
|
|
1952
|
+
class CustomPreloadingStrategyService {
|
|
1953
|
+
preload(route, load) {
|
|
1954
|
+
if (route && route.data && route.data['preload']) {
|
|
1955
|
+
console.log(`[preloading] Precargando ${route.path}`);
|
|
1956
|
+
return load();
|
|
1957
|
+
}
|
|
1958
|
+
return of(null);
|
|
1858
1959
|
}
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1960
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: CustomPreloadingStrategyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1961
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: CustomPreloadingStrategyService, providedIn: 'root' });
|
|
1962
|
+
}
|
|
1963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: CustomPreloadingStrategyService, decorators: [{
|
|
1964
|
+
type: Injectable,
|
|
1965
|
+
args: [{ providedIn: 'root' }]
|
|
1966
|
+
}] });
|
|
1967
|
+
|
|
1968
|
+
// Angular Imports
|
|
1969
|
+
class EnvironmentsService {
|
|
1970
|
+
environment = inject(SERVICES_ENVIRONMENT);
|
|
1971
|
+
getEnvironment() {
|
|
1972
|
+
return this.environment;
|
|
1862
1973
|
}
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
this.onTouched = onTouched;
|
|
1974
|
+
getEnvironmentLabel() {
|
|
1975
|
+
return this.environment.environmentType;
|
|
1866
1976
|
}
|
|
1867
|
-
|
|
1868
|
-
|
|
1977
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: EnvironmentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1978
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: EnvironmentsService });
|
|
1979
|
+
}
|
|
1980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: EnvironmentsService, decorators: [{
|
|
1981
|
+
type: Injectable
|
|
1982
|
+
}] });
|
|
1983
|
+
|
|
1984
|
+
// Shared Imports
|
|
1985
|
+
class TranslocoService {
|
|
1986
|
+
translocoService = inject(TranslocoService$1);
|
|
1987
|
+
changeLanguage(language) {
|
|
1988
|
+
this.translocoService.setActiveLang(language);
|
|
1869
1989
|
}
|
|
1870
|
-
|
|
1871
|
-
this.
|
|
1872
|
-
// this.isMenuOpen.set(false)
|
|
1990
|
+
getLanguage() {
|
|
1991
|
+
return this.translocoService.getActiveLang();
|
|
1873
1992
|
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
});
|
|
1885
|
-
return;
|
|
1886
|
-
}
|
|
1887
|
-
// Detect all validators
|
|
1888
|
-
const requiredErrors = validatorFn(new FormControl(''));
|
|
1889
|
-
const typeErrors = validatorFn(new FormControl('abc123'));
|
|
1890
|
-
const maxLengthErrors = validatorFn(new FormControl({ length: Infinity }));
|
|
1891
|
-
const maxLength = maxLengthErrors?.['maxlength']?.['requiredLength'];
|
|
1892
|
-
this.hasValidators.set({
|
|
1893
|
-
required: Boolean(requiredErrors?.['required']),
|
|
1894
|
-
naturalNumber: Boolean(typeErrors?.['isNaturalNumber']),
|
|
1895
|
-
string: Boolean(typeErrors?.['isString']),
|
|
1896
|
-
maxLength: maxLength ? maxLength : null,
|
|
1897
|
-
});
|
|
1898
|
-
// console.log('hasValidators', this.hasValidators())
|
|
1993
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1994
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoService });
|
|
1995
|
+
}
|
|
1996
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoService, decorators: [{
|
|
1997
|
+
type: Injectable
|
|
1998
|
+
}] });
|
|
1999
|
+
class TranslocoHttpLoader {
|
|
2000
|
+
httpClient = inject(HttpClient);
|
|
2001
|
+
getTranslation(lang) {
|
|
2002
|
+
return this.httpClient.get(`public/i18n/${lang}.json`);
|
|
1899
2003
|
}
|
|
1900
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
1901
|
-
static
|
|
1902
|
-
{
|
|
1903
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1904
|
-
useExisting: forwardRef(() => TextareaComponent),
|
|
1905
|
-
multi: true,
|
|
1906
|
-
},
|
|
1907
|
-
], ngImport: i0, template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <textarea\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onTouched()\"\n (keyup.escape)=\"onBlur()\"></textarea>\n\n <!-- Suffix -->\n @if (suffix()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n }\n</section>\n<!-- Errors -->\n@if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n} @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n}\n\n<!-- Suffix emplate -->\n<ng-template #suffixTemplate>\n <span tabindex=\"-1\" class=\"input-icon\" [class.input-icon--error]=\"errors\">\n <ng-content select=\"[inputSuffix]\" />\n </span>\n</ng-template>\n\n<!-- <h3>Debugging</h3>\n<section>errors: {{ errors }}</section>\n<section>invalid: {{ control().invalid }}</section>\n<section>dirty: {{ control().dirty }}</section>\n<section>touched: {{ control().touched }}</section>\n<section>disable: {{ control().disabled }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-min-height: 120px;--gld-max-height: 240px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input textarea{display:flex;width:100%;min-width:var(--gld-min-with);min-height:var(--gld-min-height);max-height:var(--gld-max-height);padding:var(--gld-spacing--xxs);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;resize:vertical;form-sizing:content;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input textarea:focus{--gld-border-color: var(--gld-blue)}.input textarea::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:0;display:inline-block;color:var(--gld-color);will-change:transform,color;transition:color var(--gld-animation-time) ease;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputErrorComponent, selector: "gld-input-error", inputs: ["errors", "border"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2004
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoHttpLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2005
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoHttpLoader });
|
|
1908
2006
|
}
|
|
1909
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
1910
|
-
type:
|
|
1911
|
-
|
|
1912
|
-
{
|
|
1913
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1914
|
-
useExisting: forwardRef(() => TextareaComponent),
|
|
1915
|
-
multi: true,
|
|
1916
|
-
},
|
|
1917
|
-
], template: "@let errors = control().invalid && (control().dirty || control().touched);\n@let disabled = control().disabled || (control().pending && control().disabled);\n\n<section class=\"input\" [class.input--disabled]=\"disabled\" [class.input--error]=\"errors\">\n <!-- Label -->\n @if (label()) {\n <label for=\"{{ id() }}\">\n <span>{{ label() }}</span>\n @if (hasValidators().required) {\n <span>*</span>\n }\n </label>\n }\n\n <!-- Input -->\n <textarea\n id=\"{{ id() }}\"\n name=\"{{ name() }}\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"innerControl()\"\n [attr.maxlength]=\"hasValidators().maxLength\"\n (focus)=\"onFocus()\"\n (blur)=\"onTouched()\"\n (keyup.escape)=\"onBlur()\"></textarea>\n\n <!-- Suffix -->\n @if (suffix()) {\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\" />\n }\n</section>\n<!-- Errors -->\n@if (errors) {\n <ng-content select=\"gld-input-error\">\n <gld-input-error [errors]=\"control().errors\" />\n </ng-content>\n} @else {\n <!-- Hint -->\n <ng-content select=\"gld-input-hint\" />\n}\n\n<!-- Suffix emplate -->\n<ng-template #suffixTemplate>\n <span tabindex=\"-1\" class=\"input-icon\" [class.input-icon--error]=\"errors\">\n <ng-content select=\"[inputSuffix]\" />\n </span>\n</ng-template>\n\n<!-- <h3>Debugging</h3>\n<section>errors: {{ errors }}</section>\n<section>invalid: {{ control().invalid }}</section>\n<section>dirty: {{ control().dirty }}</section>\n<section>touched: {{ control().touched }}</section>\n<section>disable: {{ control().disabled }}</section> -->\n", styles: [".input{--gld-color: var(--gld-foreground-color);--gld-color--disabled: var(--gld-gray-transparent--060);--gld-color--error: var(--gld-red);--gld-placeholder-color: var(--gld-gray-transparent--060);--gld-border-color: var(--gld-gray-transparent--060);--gld-label-color: var(--gld-foreground-color);--gld-min-height: 120px;--gld-max-height: 240px;--gld-min-with: 50px;--gld-animation-time: var(--gld-animation-time--150);position:relative;background:transparent}.input label{padding:0;font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;color:var(--gld-label-color);will-change:color;transition:color var(--gld-animation-time) ease;cursor:text}.input textarea{display:flex;width:100%;min-width:var(--gld-min-with);min-height:var(--gld-min-height);max-height:var(--gld-max-height);padding:var(--gld-spacing--xxs);font-family:var(--gld-font--poppins);font-size:var(--gld-font-size--normal);font-weight:400;line-height:1.25;border:none;outline:none;border-bottom:var(--gld-border-size) solid var(--gld-border-color);color:var(--gld-color);background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;resize:vertical;form-sizing:content;will-change:color;transition:color var(--gld-animation-time) ease-in-out}.input textarea:focus{--gld-border-color: var(--gld-blue)}.input textarea::placeholder{color:var(--gld-placeholder-color)}.input--error{--gld-color: var(--gld-color--error);--gld-label-color: var(--gld-color--error);--gld-border-color: var(--gld-color--error);--gld-placeholder-color: var(--gld-color--error)}.input--disabled{--gld-color: var(--gld-color--disabled);--gld-border-color: var(--gld-color--disabled);--gld-label-color: var(--gld-color--disabled);--gld-placeholder-color: var(--gld-color--disabled);pointer-events:none;cursor:not-allowed}.input-icon{position:absolute;right:var(--gld-spacing--xxs);bottom:0;display:inline-block;color:var(--gld-color);will-change:transform,color;transition:color var(--gld-animation-time) ease;cursor:pointer}\n"] }]
|
|
1918
|
-
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }] } });
|
|
2007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TranslocoHttpLoader, decorators: [{
|
|
2008
|
+
type: Injectable
|
|
2009
|
+
}] });
|
|
1919
2010
|
|
|
1920
2011
|
// Angular Imports
|
|
1921
|
-
class
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2012
|
+
class UiService {
|
|
2013
|
+
rendererFactory = inject(RendererFactory2);
|
|
2014
|
+
renderer;
|
|
2015
|
+
allThemes = [UiTheme.dark, UiTheme.light, UiTheme.system];
|
|
2016
|
+
constructor() {
|
|
2017
|
+
this.renderer = this.rendererFactory.createRenderer(null, null);
|
|
2018
|
+
}
|
|
2019
|
+
changeTheme(theme) {
|
|
2020
|
+
if (document && document.body) {
|
|
2021
|
+
// Remove all previous themes
|
|
2022
|
+
this.allThemes.map((theme) => this.renderer.removeClass(document.body, theme));
|
|
2023
|
+
// Add the new theme
|
|
2024
|
+
this.renderer.addClass(document.body, theme);
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: UiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2028
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: UiService });
|
|
1929
2029
|
}
|
|
1930
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type:
|
|
1931
|
-
type:
|
|
1932
|
-
|
|
1933
|
-
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: true }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: true }] }], priority: [{ type: i0.Input, args: [{ isSignal: true, alias: "priority", required: false }] }] } });
|
|
2030
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: UiService, decorators: [{
|
|
2031
|
+
type: Injectable
|
|
2032
|
+
}], ctorParameters: () => [] });
|
|
1934
2033
|
|
|
1935
|
-
//
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
2034
|
+
// Store Imports
|
|
2035
|
+
const initialUiState = {
|
|
2036
|
+
theme: UiTheme.system,
|
|
2037
|
+
iconTheme: Icons.macLine,
|
|
2038
|
+
};
|
|
2039
|
+
const UiStore = signalStore(withState(initialUiState), withHooks({
|
|
2040
|
+
onInit(store) {
|
|
2041
|
+
watchState(store, () => {
|
|
2042
|
+
// console.log('[ui-store]', state)
|
|
2043
|
+
});
|
|
2044
|
+
},
|
|
2045
|
+
}), withMethods((store, uiService = inject(UiService)) => ({
|
|
2046
|
+
changeTheme: ({ theme, iconTheme, }) => {
|
|
2047
|
+
uiService.changeTheme(theme);
|
|
2048
|
+
patchState(store, () => ({ theme, iconTheme }));
|
|
2049
|
+
},
|
|
2050
|
+
})));
|
|
1948
2051
|
|
|
1949
2052
|
// Angular Imports
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
effect(() => this.page.emit(this.currentPage()));
|
|
1965
|
-
effect(() => {
|
|
1966
|
-
const initialPage = this.pagination().initialPage;
|
|
1967
|
-
if (initialPage)
|
|
1968
|
-
this.currentPage.set(initialPage);
|
|
1969
|
-
});
|
|
1970
|
-
}
|
|
1971
|
-
nextPage() {
|
|
1972
|
-
if (this.pagination().maxItems !== 0) {
|
|
1973
|
-
if (this.currentPage() !==
|
|
1974
|
-
Math.ceil(this.pagination().maxItems / this.pagination().itemsPerPage)) {
|
|
1975
|
-
this.currentPage.update((previousPage) => previousPage + 1);
|
|
1976
|
-
}
|
|
2053
|
+
const isLoggedGuard = () => {
|
|
2054
|
+
// console.log('[Guard] isLoggedGuard')
|
|
2055
|
+
const router = inject(Router);
|
|
2056
|
+
const authStore = inject(AuthStore);
|
|
2057
|
+
const cookiesService = inject(CookieService);
|
|
2058
|
+
// Check if the code is running in the browser
|
|
2059
|
+
const isBrowser = typeof window !== 'undefined';
|
|
2060
|
+
if (!isBrowser)
|
|
2061
|
+
return false;
|
|
2062
|
+
const accessToken = cookiesService.get(CookiesKeys.accessToken);
|
|
2063
|
+
const refreshToken = cookiesService.get(CookiesKeys.refreshToken);
|
|
2064
|
+
if (accessToken && refreshToken) {
|
|
2065
|
+
if (!authStore.logged()) {
|
|
2066
|
+
authStore.signin({ accessToken, refreshToken });
|
|
1977
2067
|
}
|
|
1978
|
-
|
|
2068
|
+
return true;
|
|
1979
2069
|
}
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
else {
|
|
1985
|
-
this.currentPage.update((previousPage) => previousPage - 1);
|
|
2070
|
+
else {
|
|
2071
|
+
console.error(`The value of the accessToken (${accessToken}) and the refreshToken (${refreshToken}) is not a valid one`);
|
|
2072
|
+
if (authStore.logged()) {
|
|
2073
|
+
authStore.signout();
|
|
1986
2074
|
}
|
|
1987
|
-
|
|
2075
|
+
router.navigate(['/signin']);
|
|
2076
|
+
return false;
|
|
1988
2077
|
}
|
|
1989
|
-
|
|
1990
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: TablePaginationComponent, isStandalone: true, selector: "gld-table-pagination", inputs: { pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { page: "page", changeToNext: "changeToNext", changeToPrevious: "changeToPrevious" }, ngImport: i0, template: "<article class=\"Pagination\">\r\n <section class=\"Pagination-info\">\r\n <p class=\"Pagination-label\">P\u00E1gina {{ currentPage() }} de {{ maxPages() }}</p>\r\n </section>\r\n <section class=\"Pagination-actions\">\r\n <!-- <gld-icon-button\r\n class=\"\"\r\n name=\"button-next\"\r\n iconSize=\"small\"\r\n [icon]=\"Icons.arrowLeftSLine\"\r\n (clicked)=\"previousPage()\" />\r\n <gld-icon-button\r\n class=\"\"\r\n name=\"button-previous\"\r\n iconSize=\"small\"\r\n [icon]=\"Icons.arrowRightSLine\"\r\n (clicked)=\"nextPage()\" /> -->\r\n </section>\r\n</article>\r\n", styles: [".Pagination{--color: var(--darkblue);--height: 40px;display:flex;justify-content:space-between;align-items:center;gap:var(--spacing--s);margin:var(--spacing--s) 0;height:var(--height);padding-left:var(--spacing--s)}.Pagination.Theme--dark{--color: var(--whitelight)}.Pagination-label{margin:0;font:600 var(--font-size--normal) var(--font--poppins);color:var(--color)}.Pagination-actions{display:flex;gap:var(--spacing--xxxs)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1991
|
-
}
|
|
1992
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TablePaginationComponent, decorators: [{
|
|
1993
|
-
type: Component,
|
|
1994
|
-
args: [{ selector: 'gld-table-pagination', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article class=\"Pagination\">\r\n <section class=\"Pagination-info\">\r\n <p class=\"Pagination-label\">P\u00E1gina {{ currentPage() }} de {{ maxPages() }}</p>\r\n </section>\r\n <section class=\"Pagination-actions\">\r\n <!-- <gld-icon-button\r\n class=\"\"\r\n name=\"button-next\"\r\n iconSize=\"small\"\r\n [icon]=\"Icons.arrowLeftSLine\"\r\n (clicked)=\"previousPage()\" />\r\n <gld-icon-button\r\n class=\"\"\r\n name=\"button-previous\"\r\n iconSize=\"small\"\r\n [icon]=\"Icons.arrowRightSLine\"\r\n (clicked)=\"nextPage()\" /> -->\r\n </section>\r\n</article>\r\n", styles: [".Pagination{--color: var(--darkblue);--height: 40px;display:flex;justify-content:space-between;align-items:center;gap:var(--spacing--s);margin:var(--spacing--s) 0;height:var(--height);padding-left:var(--spacing--s)}.Pagination.Theme--dark{--color: var(--whitelight)}.Pagination-label{margin:0;font:600 var(--font-size--normal) var(--font--poppins);color:var(--color)}.Pagination-actions{display:flex;gap:var(--spacing--xxxs)}\n"] }]
|
|
1995
|
-
}], ctorParameters: () => [], propDecorators: { pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: true }] }], page: [{ type: i0.Output, args: ["page"] }], changeToNext: [{ type: i0.Output, args: ["changeToNext"] }], changeToPrevious: [{ type: i0.Output, args: ["changeToPrevious"] }] } });
|
|
2078
|
+
};
|
|
1996
2079
|
|
|
1997
2080
|
// Angular Imports
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
constructor() {
|
|
2007
|
-
this.control.valueChanges
|
|
2008
|
-
.pipe(debounceTime(this.debounceTime()))
|
|
2009
|
-
.subscribe((value) => {
|
|
2010
|
-
const action = value?.length ? TableSearchAction$1.searching : TableSearchAction$1.cleared;
|
|
2011
|
-
const searching = value?.length ? value : '';
|
|
2012
|
-
this.searching.emit({
|
|
2013
|
-
action,
|
|
2014
|
-
searching,
|
|
2015
|
-
});
|
|
2081
|
+
const addTokenInterceptor = (request, next) => {
|
|
2082
|
+
const authStore = inject(AuthStore);
|
|
2083
|
+
const logged = computed(() => authStore.logged(), { ...(ngDevMode ? { debugName: "logged" } : {}) });
|
|
2084
|
+
const accessToken = computed(() => authStore.accessToken(), { ...(ngDevMode ? { debugName: "accessToken" } : {}) });
|
|
2085
|
+
let cloneRequest = request;
|
|
2086
|
+
if (logged() && request.headers.has('Authorization')) {
|
|
2087
|
+
cloneRequest = request.clone({
|
|
2088
|
+
headers: request.headers.set('Authorization', `Bearer ${accessToken()}`),
|
|
2016
2089
|
});
|
|
2017
2090
|
}
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
}
|
|
2021
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TableSearchComponent, decorators: [{
|
|
2022
|
-
type: Component,
|
|
2023
|
-
args: [{ selector: 'gld-table-search', standalone: true, imports: [ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article class=\"Search\">\r\n <section class=\"Input\" [style.width]=\"width()\">\r\n <!-- <gld-icon [icon]=\"Icons.search2Line\" /> -->\r\n\r\n <input\r\n id=\"search\"\r\n name=\"search\"\r\n type=\"search\"\r\n [placeholder]=\"placeholder()\"\r\n [formControl]=\"control\" />\r\n </section>\r\n</article>\r\n", styles: [".Search{margin-bottom:24px}.Input{--radius: 100px;--background: var(--whitelight);--color: var(--darkblue);--placeholder-color: var(--gray);--border-color: var(--gray);--outline-color: var(--blue);--label-color: var(--darkblue);--height: 40px;--min-with: 350px;--icon-size: 20px;--animation-time: var(--animation-time--150);position:relative}.Input input{position:relative;width:100%;min-width:var(--min-with);height:var(--height);padding:12px 24px 12px calc(24px + var(--icon-size) + 12px);font-size:16px;font-family:inherit;color:var(--color);background:var(--background);border:1px solid var(--border-color);border-radius:var(--radius)}.Input input:focus{outline-color:var(--outline-color)}.Input input::placeholder{color:var(--color)}.Input gld-icon{position:absolute;left:24px;top:calc(50% - 11px);z-index:1;color:var(--border-color)}\n"] }]
|
|
2024
|
-
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }], searching: [{ type: i0.Output, args: ["searching"] }] } });
|
|
2091
|
+
return next(cloneRequest);
|
|
2092
|
+
};
|
|
2025
2093
|
|
|
2026
2094
|
// Angular Imports
|
|
2027
|
-
const
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
}
|
|
2050
|
-
changeValue() {
|
|
2051
|
-
// event: unknown
|
|
2052
|
-
// console.log('event', event)
|
|
2095
|
+
const changeLanguageInterceptor = (request, next) => {
|
|
2096
|
+
const translocoService = inject(TranslocoService);
|
|
2097
|
+
let cloneRequest = request;
|
|
2098
|
+
if (request.headers.has('Language')) {
|
|
2099
|
+
if (request.method.toLowerCase() === 'get') {
|
|
2100
|
+
let language = TranslocoLanguageName.english;
|
|
2101
|
+
switch (translocoService.getLanguage()) {
|
|
2102
|
+
case TranslocoLanguageKey.english:
|
|
2103
|
+
language = TranslocoLanguageName.english;
|
|
2104
|
+
break;
|
|
2105
|
+
case TranslocoLanguageKey.spanish:
|
|
2106
|
+
language = TranslocoLanguageName.spanish;
|
|
2107
|
+
break;
|
|
2108
|
+
default:
|
|
2109
|
+
language = TranslocoLanguageName.english;
|
|
2110
|
+
break;
|
|
2111
|
+
}
|
|
2112
|
+
const params = new HttpParams({ fromObject: { language } });
|
|
2113
|
+
// const headers = request.headers.set('Language', language)
|
|
2114
|
+
const headers = request.headers.delete('Language');
|
|
2115
|
+
cloneRequest = request.clone({ headers, params });
|
|
2116
|
+
}
|
|
2053
2117
|
}
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
hide: column.hide ?? false,
|
|
2082
|
-
template: column.template ?? undefined,
|
|
2083
|
-
justify: column.justify ? column.justify : 'left',
|
|
2084
|
-
transform: column.transform ?
|
|
2085
|
-
column.transform
|
|
2086
|
-
: (value) => {
|
|
2087
|
-
if (typeof value === 'string' || typeof value === 'number')
|
|
2088
|
-
return value;
|
|
2089
|
-
else
|
|
2090
|
-
return String(value);
|
|
2091
|
-
},
|
|
2092
|
-
values: [propertyValue],
|
|
2093
|
-
};
|
|
2094
|
-
tableColumns.push(tableColumnToAdd);
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
else {
|
|
2098
|
-
console.error(`this column "${column.name}" doesn't exist in this data structure`, dataStructures);
|
|
2099
|
-
}
|
|
2100
|
-
});
|
|
2118
|
+
return next(cloneRequest);
|
|
2119
|
+
};
|
|
2120
|
+
|
|
2121
|
+
const refreshTokenInterceptor = (request, next) => {
|
|
2122
|
+
const authStore = inject(AuthStore);
|
|
2123
|
+
const authService = inject(AuthService);
|
|
2124
|
+
const logged = computed(() => authStore.logged(), { ...(ngDevMode ? { debugName: "logged" } : {}) });
|
|
2125
|
+
const accessToken = computed(() => authStore.accessToken(), { ...(ngDevMode ? { debugName: "accessToken" } : {}) });
|
|
2126
|
+
const refreshToken = computed(() => authStore.refreshToken(), { ...(ngDevMode ? { debugName: "refreshToken" } : {}) });
|
|
2127
|
+
const refreshAccessTokenInProgress = signal(false, { ...(ngDevMode ? { debugName: "refreshAccessTokenInProgress" } : {}) });
|
|
2128
|
+
const doSameRequestCallStack = new Subject();
|
|
2129
|
+
const handlerRefreshAccessToken = (request, next) => {
|
|
2130
|
+
if (refreshAccessTokenInProgress()) {
|
|
2131
|
+
return doSameRequestCallStack.pipe(switchMap((newAccessToken) => {
|
|
2132
|
+
return next(doSameRequestWithNewAccessToken(request, newAccessToken));
|
|
2133
|
+
}));
|
|
2134
|
+
}
|
|
2135
|
+
refreshAccessTokenInProgress.set(true);
|
|
2136
|
+
return authService.refreshAccessToken({ refreshToken: refreshToken() }).pipe(switchMap(() => {
|
|
2137
|
+
refreshAccessTokenInProgress.set(false);
|
|
2138
|
+
doSameRequestCallStack.next(accessToken());
|
|
2139
|
+
return next(doSameRequestWithNewAccessToken(request, accessToken()));
|
|
2140
|
+
}));
|
|
2141
|
+
};
|
|
2142
|
+
const doSameRequestWithNewAccessToken = (request, newAccessToken) => {
|
|
2143
|
+
return request.clone({
|
|
2144
|
+
headers: request.headers.set('Authorization', `Bearer ${newAccessToken}`),
|
|
2101
2145
|
});
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
},
|
|
2119
|
-
{
|
|
2120
|
-
label: 'Name',
|
|
2121
|
-
name: 'name',
|
|
2122
|
-
values: ['Buenos Aires', 'Mendoza'],
|
|
2123
|
-
width: 'auto',
|
|
2124
|
-
},
|
|
2125
|
-
{
|
|
2126
|
-
label: 'Chargers',
|
|
2127
|
-
name: 'chargers',
|
|
2128
|
-
values: [24, 27],
|
|
2129
|
-
width: '150px',
|
|
2130
|
-
},
|
|
2131
|
-
{
|
|
2132
|
-
label: 'Hoses',
|
|
2133
|
-
name: 'hoses',
|
|
2134
|
-
values: [23, 26],
|
|
2135
|
-
width: '150px',
|
|
2136
|
-
},
|
|
2137
|
-
{
|
|
2138
|
-
label: 'Drivers',
|
|
2139
|
-
name: 'drivers',
|
|
2140
|
-
values: [25, 29],
|
|
2141
|
-
width: '150px',
|
|
2142
|
-
},
|
|
2143
|
-
]
|
|
2144
|
-
|
|
2145
|
-
We will receive this result:
|
|
2146
|
-
{
|
|
2147
|
-
chargers: 24
|
|
2148
|
-
drivers: 25
|
|
2149
|
-
hoses: 23
|
|
2150
|
-
id: '333333'
|
|
2151
|
-
name: 'Buenos Aires'
|
|
2152
|
-
}
|
|
2153
|
-
*/
|
|
2154
|
-
return tableColumns.reduce((previous, current) => {
|
|
2155
|
-
return { ...previous, [current.name]: current.values[index] };
|
|
2156
|
-
}, {});
|
|
2157
|
-
}
|
|
2158
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2159
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.1", type: TableComponent, isStandalone: true, selector: "gld-table", inputs: { tableColumns: { classPropertyName: "tableColumns", publicName: "tableColumns", isSignal: true, isRequired: true, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, tableHeight: { classPropertyName: "tableHeight", publicName: "tableHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, selects: { classPropertyName: "selects", publicName: "selects", isSignal: true, isRequired: false, transformFunction: null }, selectsAll: { classPropertyName: "selectsAll", publicName: "selectsAll", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tableColumnAction: "tableColumnAction" }, ngImport: i0, template: "<!-- Search -->\n@if (search()) {\n <section class=\"table-search\">\n <ng-content select=\"gld-table-search\" />\n </section>\n}\n\n<!-- Table -->\n<article\n class=\"table\"\n [class.table--empty]=\"!tableColumnsToShow().length\"\n [style.height]=\"tableHeight()\">\n <!-- Table Content -->\n <section\n class=\"table-content\"\n [class.table-content--actions]=\"tableColumnActions().length\"\n [class.table-content--selects]=\"selects()\">\n <!-- Loading -->\n @if (loading()) {\n <gld-circle-loader loading background minHeight=\"100px\" />\n } @else {\n <!-- Table Columns -->\n @for (tableColumn of tableColumnsToShow(); track tableColumn) {\n <section\n class=\"table-column\"\n [style.flexBasis]=\"tableColumn.width\"\n [style.flexShrink]=\"tableColumn.width === 'auto' ? '1' : '0'\"\n [style.flexGrow]=\"tableColumn.width === 'auto' ? '1' : '0'\"\n [style.minWidth]=\"tableColumn.minWidth\"\n [style.maxWidth]=\"tableColumn.maxWidth\">\n <section class=\"table-header\">\n <span class=\"table-header-ellipsis\">{{ tableColumn.label }}</span>\n </section>\n @for (value of tableColumn.values; track $index) {\n <section\n class=\"table-cell\"\n [style.justifyContent]=\"tableColumn.justify\"\n [style.textAlign]=\"tableColumn.justify\">\n @if (tableColumn.transform(value) !== undefined) {\n @switch (true) {\n @case (tableColumn.template !== undefined) {\n <ng-container\n [ngTemplateOutlet]=\"tableColumn.template\"\n [ngTemplateOutletContext]=\"{ value: tableColumn.transform(value) }\" />\n }\n @default {\n <span class=\"table-cell-ellipsis\">{{ tableColumn.transform(value) }}</span>\n }\n }\n } @else {\n <span>-</span>\n }\n </section>\n }\n </section>\n } @empty {\n <!-- Empty -->\n <section class=\"table-empty\">\n <p>{{ emptyMessage() ? emptyMessage() : 'We have not data to show yet!' }}</p>\n </section>\n }\n }\n </section>\n\n <!-- Table Actions -->\n @if ((tableColumnActions().length || selects()) && !loading() && tableColumnsToShow().length) {\n <section\n class=\"table-column\"\n [class.table-column--actions]=\"tableColumnActions().length\"\n [class.table-column--selects]=\"selects()\">\n <!-- Header -->\n <section\n class=\"table-header\"\n [class.table-header--actions]=\"tableColumnActions().length\"\n [class.table-header--selects]=\"selects()\">\n <!-- Select All Checkbox -->\n @if (selectsAll()) {\n <!-- <mat-checkbox\n color=\"primary\"\n matTooltip=\"Todo\"\n matTooltipClass=\"Tooltip\"\n class=\"Checkbox\"\n [checked]=\"\n dragAndDropColumnSelected().length === dragAndDropColumns().at(0)?.values?.length\n \"\n [indeterminate]=\"\n !!dragAndDropColumnSelected().length &&\n dragAndDropColumnSelected().length !== dragAndDropColumns().at(0)?.values?.length\n \"\n (change)=\"onSelectOrUnselectAll($event, dragAndDropColumns())\"\n /> -->\n }\n </section>\n @for (value of tableColumnsToShow().at(0)?.values; track $index; let index = $index) {\n <!-- Cell -->\n <section class=\"table-cell table-cell--actions\">\n <!-- Select Checkbox -->\n @if (selects()) {\n <!-- <mat-checkbox\n color=\"primary\"\n class=\"Checkbox\"\n matTooltip=\"Seleccionar\"\n matTooltipClass=\"Tooltip\"\n [checked]=\"isSelected(dragAndDropColumns(), index)\"\n (change)=\"onSelect($event, dragAndDropColumns(), index)\" /> -->\n }\n @if (tableColumnActions()) {\n <!-- Dropdown Menu -->\n <gld-dropdown-menu\n background\n id=\"more button of table cell\"\n name=\"more button of table cell\"\n type=\"iconButton\"\n color=\"blue\"\n iconSize=\"small\"\n direction=\"left\"\n [icon]=\"Icons.more2Fill\"\n (changeValue)=\"\n tableActionFunction({\n tableColumnActionAsEvent: $event,\n tableColumns: tableColumns(),\n index,\n })\n \">\n @for (tableColumnAction of tableColumnActions(); track tableColumnAction.type) {\n <gld-dropdown-button\n [value]=\"tableColumnAction\"\n [icon]=\"tableColumnAction.icon\"\n iconSize=\"tiny\">\n {{ tableColumnAction.label }}\n </gld-dropdown-button>\n }\n </gld-dropdown-menu>\n <!-- <gld-icon-button\n background\n name=\"more button of table cell\"\n iconSize=\"small\"\n [icon]=\"Icons.more2Fill\"> -->\n <!-- <gld-tile color=\"blue-to-green\" class=\"Menu\">\n <section class=\"Menu-content\">\n @for (tableColumnAction of tableColumnActions(); track tableColumnAction.type) {\n <button\n class=\"Menu-button {{ tableColumnAction?.classToHover ?? '' }}\"\n [class.Menu-button--hidden]=\"\n !tableColumnAction.showWhen(buildDataStructure({ index }))\n \"\n (click)=\"\n tableActionFunction({\n tableColumnAction,\n tableColumns: tableColumns(),\n index,\n })\n \">\n <gld-icon size=\"tiny\" [icon]=\"tableColumnAction.icon\" />\n <span class=\"Menu-button-ellipsis\">{{ tableColumnAction.label }}</span>\n </button>\n }\n </section>\n </gld-tile> -->\n <!-- </gld-icon-button> -->\n }\n </section>\n }\n </section>\n }\n</article>\n\n<!-- Pagination -->\n@if (pagination()) {\n <section class=\"table-pagination\">\n <ng-content select=\"gld-table-pagination\" />\n </section>\n}\n", styles: [":host{width:100%}.table{--gld-color: var(--gld-foreground-color);--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-border-radius: var(--gld-radius--xxs);--gld-background: var(--gld-background-color);--gld-column-actions-or-selects-width: 40px;--gld-column-actions-and-selects-width: 80px;--gld-header-height: 40px;--gld-cell-height: 40px;--gld-min-height: 100px;min-height:var(--gld-min-height);display:grid;grid-template-columns:1fr;position:relative;border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-border-radius);background:var(--gld-background);overflow:hidden}.table-content{display:flex;flex-wrap:nowrap}.table-header,.table-cell{color:var(--color);font-family:var(--gld-font--poppins);padding:var(--gld-spacing--xxs) var(--gld-spacing--s);border-bottom:var(--gld-border-size) solid var(--gld-border-color)}.table-header-ellipsis,.table-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.table-header-ellipsis--hover,.table-cell-ellipsis--hover{cursor:pointer}.table-header{display:flex;align-items:center;font:600 var(--gld-font-size--small)/var(--gld-line-height) var(--gld-font--poppins);height:var(--gld-header-height)}.table-header.table-header--actions,.table-header.table-header--selects{justify-content:center}.table-header.table-header--actions.table-header--selects{justify-content:flex-start}.table-header--actions{background:var(--gld-background);border-left:var(--gld-border-size) solid var(--gld-border-color)}.table-header--actions:before{content:\"\";position:absolute;inset:0}.table-cell{display:flex;align-items:center;height:var(--gld-cell-height);font:400 var(--gld-font-size--small)/var(--gld-line-height) var(--gld-font--poppins)}.table-cell:last-of-type{margin-bottom:0;border-bottom:none}.table-cell.table-cell--actions,.table-cell.table-cell--selects{justify-content:center;padding:0}.table-cell--actions{position:relative;display:flex;justify-content:center;align-items:center;gap:var(--gld-spacing--xxxs);background:var(--gld-background);border-left:var(--gld-border-size) solid var(--gld-border-color)}.table-column{flex:1 1 auto}.table-column--actions,.table-column--selects,.table-column--actions.table-column--selects{position:absolute;top:0;right:0}.table-column--actions.table-column--selects{width:var(--gld-column-actions-and-selects-width)}.table-column--actions,.table-column--selects{width:var(--gld-column-actions-or-selects-width)}.table-empty{width:100%;display:flex;color:var(--gld-color);padding:var(--gld-spacing--xs)}.table-empty p{font:400 var(--gld-font-size--normal)/var(--gld-line-height) var(--gld-font--poppins);text-transform:lowercase;margin:auto}.table-empty p:first-letter{text-transform:uppercase}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DropdownButtonComponent, selector: "gld-dropdown-button", inputs: ["value", "icon", "iconSize", "iconSpace", "moveTopToBottom", "moveLeftToRight", "direction"], outputs: ["changeValue"] }, { kind: "component", type: DropdownMenuComponent, selector: "gld-dropdown-menu", inputs: ["id", "name", "type", "color", "size", "icon", "iconSize", "moveTopToBottom", "moveLeftToRight", "disabled", "full", "direction", "background", "selected", "initialValue"], outputs: ["changeValue", "changeFocus"] }, { kind: "component", type: CircleLoaderComponent, selector: "gld-circle-loader", inputs: ["loading", "background", "radius", "minHeight"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2160
|
-
}
|
|
2161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TableComponent, decorators: [{
|
|
2162
|
-
type: Component,
|
|
2163
|
-
args: [{ selector: 'gld-table', standalone: true, imports: [NgTemplateOutlet, ...components], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Search -->\n@if (search()) {\n <section class=\"table-search\">\n <ng-content select=\"gld-table-search\" />\n </section>\n}\n\n<!-- Table -->\n<article\n class=\"table\"\n [class.table--empty]=\"!tableColumnsToShow().length\"\n [style.height]=\"tableHeight()\">\n <!-- Table Content -->\n <section\n class=\"table-content\"\n [class.table-content--actions]=\"tableColumnActions().length\"\n [class.table-content--selects]=\"selects()\">\n <!-- Loading -->\n @if (loading()) {\n <gld-circle-loader loading background minHeight=\"100px\" />\n } @else {\n <!-- Table Columns -->\n @for (tableColumn of tableColumnsToShow(); track tableColumn) {\n <section\n class=\"table-column\"\n [style.flexBasis]=\"tableColumn.width\"\n [style.flexShrink]=\"tableColumn.width === 'auto' ? '1' : '0'\"\n [style.flexGrow]=\"tableColumn.width === 'auto' ? '1' : '0'\"\n [style.minWidth]=\"tableColumn.minWidth\"\n [style.maxWidth]=\"tableColumn.maxWidth\">\n <section class=\"table-header\">\n <span class=\"table-header-ellipsis\">{{ tableColumn.label }}</span>\n </section>\n @for (value of tableColumn.values; track $index) {\n <section\n class=\"table-cell\"\n [style.justifyContent]=\"tableColumn.justify\"\n [style.textAlign]=\"tableColumn.justify\">\n @if (tableColumn.transform(value) !== undefined) {\n @switch (true) {\n @case (tableColumn.template !== undefined) {\n <ng-container\n [ngTemplateOutlet]=\"tableColumn.template\"\n [ngTemplateOutletContext]=\"{ value: tableColumn.transform(value) }\" />\n }\n @default {\n <span class=\"table-cell-ellipsis\">{{ tableColumn.transform(value) }}</span>\n }\n }\n } @else {\n <span>-</span>\n }\n </section>\n }\n </section>\n } @empty {\n <!-- Empty -->\n <section class=\"table-empty\">\n <p>{{ emptyMessage() ? emptyMessage() : 'We have not data to show yet!' }}</p>\n </section>\n }\n }\n </section>\n\n <!-- Table Actions -->\n @if ((tableColumnActions().length || selects()) && !loading() && tableColumnsToShow().length) {\n <section\n class=\"table-column\"\n [class.table-column--actions]=\"tableColumnActions().length\"\n [class.table-column--selects]=\"selects()\">\n <!-- Header -->\n <section\n class=\"table-header\"\n [class.table-header--actions]=\"tableColumnActions().length\"\n [class.table-header--selects]=\"selects()\">\n <!-- Select All Checkbox -->\n @if (selectsAll()) {\n <!-- <mat-checkbox\n color=\"primary\"\n matTooltip=\"Todo\"\n matTooltipClass=\"Tooltip\"\n class=\"Checkbox\"\n [checked]=\"\n dragAndDropColumnSelected().length === dragAndDropColumns().at(0)?.values?.length\n \"\n [indeterminate]=\"\n !!dragAndDropColumnSelected().length &&\n dragAndDropColumnSelected().length !== dragAndDropColumns().at(0)?.values?.length\n \"\n (change)=\"onSelectOrUnselectAll($event, dragAndDropColumns())\"\n /> -->\n }\n </section>\n @for (value of tableColumnsToShow().at(0)?.values; track $index; let index = $index) {\n <!-- Cell -->\n <section class=\"table-cell table-cell--actions\">\n <!-- Select Checkbox -->\n @if (selects()) {\n <!-- <mat-checkbox\n color=\"primary\"\n class=\"Checkbox\"\n matTooltip=\"Seleccionar\"\n matTooltipClass=\"Tooltip\"\n [checked]=\"isSelected(dragAndDropColumns(), index)\"\n (change)=\"onSelect($event, dragAndDropColumns(), index)\" /> -->\n }\n @if (tableColumnActions()) {\n <!-- Dropdown Menu -->\n <gld-dropdown-menu\n background\n id=\"more button of table cell\"\n name=\"more button of table cell\"\n type=\"iconButton\"\n color=\"blue\"\n iconSize=\"small\"\n direction=\"left\"\n [icon]=\"Icons.more2Fill\"\n (changeValue)=\"\n tableActionFunction({\n tableColumnActionAsEvent: $event,\n tableColumns: tableColumns(),\n index,\n })\n \">\n @for (tableColumnAction of tableColumnActions(); track tableColumnAction.type) {\n <gld-dropdown-button\n [value]=\"tableColumnAction\"\n [icon]=\"tableColumnAction.icon\"\n iconSize=\"tiny\">\n {{ tableColumnAction.label }}\n </gld-dropdown-button>\n }\n </gld-dropdown-menu>\n <!-- <gld-icon-button\n background\n name=\"more button of table cell\"\n iconSize=\"small\"\n [icon]=\"Icons.more2Fill\"> -->\n <!-- <gld-tile color=\"blue-to-green\" class=\"Menu\">\n <section class=\"Menu-content\">\n @for (tableColumnAction of tableColumnActions(); track tableColumnAction.type) {\n <button\n class=\"Menu-button {{ tableColumnAction?.classToHover ?? '' }}\"\n [class.Menu-button--hidden]=\"\n !tableColumnAction.showWhen(buildDataStructure({ index }))\n \"\n (click)=\"\n tableActionFunction({\n tableColumnAction,\n tableColumns: tableColumns(),\n index,\n })\n \">\n <gld-icon size=\"tiny\" [icon]=\"tableColumnAction.icon\" />\n <span class=\"Menu-button-ellipsis\">{{ tableColumnAction.label }}</span>\n </button>\n }\n </section>\n </gld-tile> -->\n <!-- </gld-icon-button> -->\n }\n </section>\n }\n </section>\n }\n</article>\n\n<!-- Pagination -->\n@if (pagination()) {\n <section class=\"table-pagination\">\n <ng-content select=\"gld-table-pagination\" />\n </section>\n}\n", styles: [":host{width:100%}.table{--gld-color: var(--gld-foreground-color);--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) );--gld-border-radius: var(--gld-radius--xxs);--gld-background: var(--gld-background-color);--gld-column-actions-or-selects-width: 40px;--gld-column-actions-and-selects-width: 80px;--gld-header-height: 40px;--gld-cell-height: 40px;--gld-min-height: 100px;min-height:var(--gld-min-height);display:grid;grid-template-columns:1fr;position:relative;border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-border-radius);background:var(--gld-background);overflow:hidden}.table-content{display:flex;flex-wrap:nowrap}.table-header,.table-cell{color:var(--color);font-family:var(--gld-font--poppins);padding:var(--gld-spacing--xxs) var(--gld-spacing--s);border-bottom:var(--gld-border-size) solid var(--gld-border-color)}.table-header-ellipsis,.table-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.table-header-ellipsis--hover,.table-cell-ellipsis--hover{cursor:pointer}.table-header{display:flex;align-items:center;font:600 var(--gld-font-size--small)/var(--gld-line-height) var(--gld-font--poppins);height:var(--gld-header-height)}.table-header.table-header--actions,.table-header.table-header--selects{justify-content:center}.table-header.table-header--actions.table-header--selects{justify-content:flex-start}.table-header--actions{background:var(--gld-background);border-left:var(--gld-border-size) solid var(--gld-border-color)}.table-header--actions:before{content:\"\";position:absolute;inset:0}.table-cell{display:flex;align-items:center;height:var(--gld-cell-height);font:400 var(--gld-font-size--small)/var(--gld-line-height) var(--gld-font--poppins)}.table-cell:last-of-type{margin-bottom:0;border-bottom:none}.table-cell.table-cell--actions,.table-cell.table-cell--selects{justify-content:center;padding:0}.table-cell--actions{position:relative;display:flex;justify-content:center;align-items:center;gap:var(--gld-spacing--xxxs);background:var(--gld-background);border-left:var(--gld-border-size) solid var(--gld-border-color)}.table-column{flex:1 1 auto}.table-column--actions,.table-column--selects,.table-column--actions.table-column--selects{position:absolute;top:0;right:0}.table-column--actions.table-column--selects{width:var(--gld-column-actions-and-selects-width)}.table-column--actions,.table-column--selects{width:var(--gld-column-actions-or-selects-width)}.table-empty{width:100%;display:flex;color:var(--gld-color);padding:var(--gld-spacing--xs)}.table-empty p{font:400 var(--gld-font-size--normal)/var(--gld-line-height) var(--gld-font--poppins);text-transform:lowercase;margin:auto}.table-empty p:first-letter{text-transform:uppercase}\n"] }]
|
|
2164
|
-
}], propDecorators: { tableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableColumns", required: true }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], tableHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableHeight", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], selects: [{ type: i0.Input, args: [{ isSignal: true, alias: "selects", required: false }] }], selectsAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectsAll", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }], tableColumnAction: [{ type: i0.Output, args: ["tableColumnAction"] }] } });
|
|
2146
|
+
};
|
|
2147
|
+
return next(request).pipe(catchError((error) => {
|
|
2148
|
+
// console.log('error', error)
|
|
2149
|
+
if (logged() && request.headers.has('Authorization')) {
|
|
2150
|
+
const errorTyped = error;
|
|
2151
|
+
if (errorTyped?.status === 401) {
|
|
2152
|
+
console.log('Refreshing access token...');
|
|
2153
|
+
return handlerRefreshAccessToken(request, next);
|
|
2154
|
+
}
|
|
2155
|
+
return throwError(() => error);
|
|
2156
|
+
}
|
|
2157
|
+
else {
|
|
2158
|
+
return throwError(() => error);
|
|
2159
|
+
}
|
|
2160
|
+
}));
|
|
2161
|
+
};
|
|
2165
2162
|
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
paddingSize = input(TilePaddingSize$1.zero, { ...(ngDevMode ? { debugName: "paddingSize" } : {}) });
|
|
2170
|
-
background = input(false, { ...(ngDevMode ? { debugName: "background" } : {}), transform: booleanAttribute });
|
|
2171
|
-
hover = input(false, { ...(ngDevMode ? { debugName: "hover" } : {}), transform: booleanAttribute });
|
|
2172
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2173
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: TileComponent, isStandalone: true, selector: "gld-tile", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, paddingSize: { classPropertyName: "paddingSize", publicName: "paddingSize", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, hover: { classPropertyName: "hover", publicName: "hover", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<article\r\n class=\"tile tile--{{ color() }} tile--padding-{{ paddingSize() }}\"\r\n [class.tile--background]=\"background()\"\r\n [class.tile--hover]=\"hover()\">\r\n <section class=\"tile-content\">\r\n <ng-content />\r\n </section>\r\n</article>\r\n", styles: [":host{width:100%;height:auto;position:relative;z-index:1}.tile{--gld-background: initial;--gld-background--hover: initial;--gld-border-color: transparent;--gld-padding-size: 0;--gld-radius: var(--gld-radius--xxs);width:inherit;height:inherit;position:relative;padding:var(--gld-padding-size);background:var(--gld-background);border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);overflow:hidden;will-change:background;transition:background var(--gld-animation-time--150)}.tile--hover:hover,.tile--hover:focus{background:var(--gld-background--hover)}.tile.tile--hover{cursor:pointer}.tile--default{--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) )}.tile--default.tile--background{--gld-background: var(--gld-gray-transparent--010)}.tile--default.tile--hover{--gld-background--hover: var(--gld-gray-transparent--020)}.tile--blue{--gld-border-color: var(--gld-blue-transparent--020)}.tile--blue.tile--background{--gld-background: var(--gld-blue-transparent--005)}.tile--blue.tile--hover{--gld-background--hover: var(--gld-blue-transparent--010)}.tile--green{--gld-border-color: var(--gld-green-transparent--020)}.tile--green.tile--background{--gld-background: var(--gld-green-transparent--005)}.tile--green.tile--hover{--gld-background--hover: var(--gld-green-transparent--010)}.tile--purple{--gld-border-color: var(--gld-purple-transparent--020)}.tile--purple.tile--background{--gld-background: var(--gld-purple-transparent--005)}.tile--purple.tile--hover{--gld-background--hover: var(--gld-purple-transparent--010)}.tile--mustard{--gld-border-color: var(--gld-mustard-transparent--020)}.tile--mustard.tile--background{--gld-background: var(--gld-mustard-transparent--005)}.tile--mustard.tile--hover{--gld-background--hover: var(--gld-mustard-transparent--010)}.tile--orange{--gld-border-color: var(--gld-orange-transparent--020)}.tile--orange.tile--background{--gld-background: var(--gld-orange-transparent--005)}.tile--orange.tile--hover{--gld-background--hover: var(--gld-orange-transparent--010)}.tile--pink{--gld-border-color: var(--gld-pink-transparent--020)}.tile--pink.tile--background{--gld-background: var(--gld-pink-transparent--005)}.tile--pink.tile--hover{--gld-background--hover: var(--gld-pink-transparent--010)}.tile--red{--gld-border-color: var(--gld-red-transparent--020)}.tile--red.tile--background{--gld-background: var(--gld-red-transparent--005)}.tile--red.tile--hover{--gld-background--hover: var(--gld-red-transparent--010)}.tile--padding-tiny{--gld-padding-size: var(--gld-spacing--xxxs)}.tile--padding-small{--gld-padding-size: var(--gld-spacing--xs)}.tile--padding-normal{--gld-padding-size: var(--gld-spacing--s)}.tile--padding-medium{--gld-padding-size: var(--gld-spacing--l)}.tile--padding-large{--gld-padding-size: var(--gld-spacing--xl)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2174
|
-
}
|
|
2175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: TileComponent, decorators: [{
|
|
2176
|
-
type: Component,
|
|
2177
|
-
args: [{ selector: 'gld-tile', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article\r\n class=\"tile tile--{{ color() }} tile--padding-{{ paddingSize() }}\"\r\n [class.tile--background]=\"background()\"\r\n [class.tile--hover]=\"hover()\">\r\n <section class=\"tile-content\">\r\n <ng-content />\r\n </section>\r\n</article>\r\n", styles: [":host{width:100%;height:auto;position:relative;z-index:1}.tile{--gld-background: initial;--gld-background--hover: initial;--gld-border-color: transparent;--gld-padding-size: 0;--gld-radius: var(--gld-radius--xxs);width:inherit;height:inherit;position:relative;padding:var(--gld-padding-size);background:var(--gld-background);border:var(--gld-border-size) solid var(--gld-border-color);border-radius:var(--gld-radius);overflow:hidden;will-change:background;transition:background var(--gld-animation-time--150)}.tile--hover:hover,.tile--hover:focus{background:var(--gld-background--hover)}.tile.tile--hover{cursor:pointer}.tile--default{--gld-border-color: light-dark( var(--gld-gray-transparent--040), var(--gld-gray-transparent--020) )}.tile--default.tile--background{--gld-background: var(--gld-gray-transparent--010)}.tile--default.tile--hover{--gld-background--hover: var(--gld-gray-transparent--020)}.tile--blue{--gld-border-color: var(--gld-blue-transparent--020)}.tile--blue.tile--background{--gld-background: var(--gld-blue-transparent--005)}.tile--blue.tile--hover{--gld-background--hover: var(--gld-blue-transparent--010)}.tile--green{--gld-border-color: var(--gld-green-transparent--020)}.tile--green.tile--background{--gld-background: var(--gld-green-transparent--005)}.tile--green.tile--hover{--gld-background--hover: var(--gld-green-transparent--010)}.tile--purple{--gld-border-color: var(--gld-purple-transparent--020)}.tile--purple.tile--background{--gld-background: var(--gld-purple-transparent--005)}.tile--purple.tile--hover{--gld-background--hover: var(--gld-purple-transparent--010)}.tile--mustard{--gld-border-color: var(--gld-mustard-transparent--020)}.tile--mustard.tile--background{--gld-background: var(--gld-mustard-transparent--005)}.tile--mustard.tile--hover{--gld-background--hover: var(--gld-mustard-transparent--010)}.tile--orange{--gld-border-color: var(--gld-orange-transparent--020)}.tile--orange.tile--background{--gld-background: var(--gld-orange-transparent--005)}.tile--orange.tile--hover{--gld-background--hover: var(--gld-orange-transparent--010)}.tile--pink{--gld-border-color: var(--gld-pink-transparent--020)}.tile--pink.tile--background{--gld-background: var(--gld-pink-transparent--005)}.tile--pink.tile--hover{--gld-background--hover: var(--gld-pink-transparent--010)}.tile--red{--gld-border-color: var(--gld-red-transparent--020)}.tile--red.tile--background{--gld-background: var(--gld-red-transparent--005)}.tile--red.tile--hover{--gld-background--hover: var(--gld-red-transparent--010)}.tile--padding-tiny{--gld-padding-size: var(--gld-spacing--xxxs)}.tile--padding-small{--gld-padding-size: var(--gld-spacing--xs)}.tile--padding-normal{--gld-padding-size: var(--gld-spacing--s)}.tile--padding-medium{--gld-padding-size: var(--gld-spacing--l)}.tile--padding-large{--gld-padding-size: var(--gld-spacing--xl)}\n"] }]
|
|
2178
|
-
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], paddingSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "paddingSize", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], hover: [{ type: i0.Input, args: [{ isSignal: true, alias: "hover", required: false }] }] } });
|
|
2163
|
+
/*
|
|
2164
|
+
* Public API Surface of @iamgld/ui
|
|
2165
|
+
*/
|
|
2179
2166
|
|
|
2180
2167
|
/**
|
|
2181
2168
|
* Generated bundle index. Do not edit.
|