intelica-library-ui 0.1.119 → 0.1.121
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
2
|
import { inject, Injectable, signal, Pipe, Component, HostListener, Directive, EventEmitter, Output, Input, forwardRef, TemplateRef, ContentChild, ContentChildren, ViewChild, PLATFORM_ID, Inject } from '@angular/core';
|
|
4
|
-
import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription } from 'rxjs';
|
|
5
3
|
import { getCookie, Cookies, setCookie } from 'typescript-cookie';
|
|
4
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
5
|
+
import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription } from 'rxjs';
|
|
6
6
|
import Swal from 'sweetalert2';
|
|
7
7
|
import * as i1 from '@angular/common';
|
|
8
8
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
@@ -42,26 +42,6 @@ import JSEncrypt from 'jsencrypt';
|
|
|
42
42
|
import Aura from '@primeng/themes/aura';
|
|
43
43
|
import { definePreset } from '@primeng/themes';
|
|
44
44
|
|
|
45
|
-
// import { CookieAttributes } from "typescript-cookie/dist/types";
|
|
46
|
-
const domain = window.location.hostname.split(".").slice(-2).join(".");
|
|
47
|
-
const secure = !domain.includes("localhost");
|
|
48
|
-
const CookieAttributesGeneral = { domain: domain, path: "/", secure: secure };
|
|
49
|
-
|
|
50
|
-
const Color = {
|
|
51
|
-
mastercard: "#ff7f00",
|
|
52
|
-
visa: "#17375E",
|
|
53
|
-
amex: "#348AD5",
|
|
54
|
-
orange: "#ff7f00",
|
|
55
|
-
orangeDark: "#CC4900",
|
|
56
|
-
blue: "#17375E",
|
|
57
|
-
gray: "#D3D3D3",
|
|
58
|
-
gray3: "#a6a5a1",
|
|
59
|
-
gray5: "#e9e9e9",
|
|
60
|
-
};
|
|
61
|
-
const getColor = (name) => {
|
|
62
|
-
return Color[name];
|
|
63
|
-
};
|
|
64
|
-
|
|
65
45
|
class ConfigService {
|
|
66
46
|
Http = inject(HttpClient);
|
|
67
47
|
environment;
|
|
@@ -94,6 +74,186 @@ function InitializeConfigService(confg) {
|
|
|
94
74
|
return () => confg.init();
|
|
95
75
|
}
|
|
96
76
|
|
|
77
|
+
class TermService {
|
|
78
|
+
_http = inject(HttpClient);
|
|
79
|
+
_config = inject(ConfigService);
|
|
80
|
+
GetTerms(languageCode, pageRoot) {
|
|
81
|
+
return this._http.get(`${this._config.environment?.configurationPath}/TermPage/GetPageTerm/${languageCode}/${pageRoot}`);
|
|
82
|
+
}
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
84
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermService, providedIn: "root" });
|
|
85
|
+
}
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermService, decorators: [{
|
|
87
|
+
type: Injectable,
|
|
88
|
+
args: [{ providedIn: "root" }]
|
|
89
|
+
}] });
|
|
90
|
+
|
|
91
|
+
class GlobalTermService {
|
|
92
|
+
terms = [];
|
|
93
|
+
languageCode = "";
|
|
94
|
+
TermsReady = signal(false);
|
|
95
|
+
PageRoot = "";
|
|
96
|
+
termService = inject(TermService);
|
|
97
|
+
Initialize(pageRoot) {
|
|
98
|
+
let languageCode = getCookie("language") ?? "EN";
|
|
99
|
+
this.PageRoot = pageRoot;
|
|
100
|
+
if (pageRoot == "") {
|
|
101
|
+
this.TermsReady.set(true);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.termService.GetTerms(languageCode, pageRoot).subscribe(response => {
|
|
105
|
+
this.terms = response;
|
|
106
|
+
this.TermsReady.set(true);
|
|
107
|
+
this.SetTerms();
|
|
108
|
+
this.languageCode = languageCode;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
async SetTerms() {
|
|
112
|
+
while (true) {
|
|
113
|
+
await sleep$1(10);
|
|
114
|
+
if (document.querySelectorAll("[data-term]").length > 1)
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
let textsToChange = document.querySelectorAll("[data-term]");
|
|
118
|
+
textsToChange.forEach(async (element) => {
|
|
119
|
+
let dataValue = element.getAttribute("data-term");
|
|
120
|
+
let newText = this.terms.find(x => x.termName == dataValue)?.termValue ?? "";
|
|
121
|
+
element.innerHTML = newText;
|
|
122
|
+
element.setAttribute("placeholder", newText);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: GlobalTermService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
126
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: GlobalTermService, providedIn: "root" });
|
|
127
|
+
}
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: GlobalTermService, decorators: [{
|
|
129
|
+
type: Injectable,
|
|
130
|
+
args: [{ providedIn: "root" }]
|
|
131
|
+
}] });
|
|
132
|
+
function sleep$1(ms) {
|
|
133
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// import GlobalTermService from "../services/globalTerm.service";
|
|
137
|
+
class TermPipe {
|
|
138
|
+
globalTermService = inject(GlobalTermService);
|
|
139
|
+
transform(termName, language, mode = 1) {
|
|
140
|
+
let term = this.globalTermService.terms.find(x => x.termName == termName)?.termValue ?? "-";
|
|
141
|
+
if (mode == 2)
|
|
142
|
+
term = term.substring(0, 1);
|
|
143
|
+
if (mode == 3)
|
|
144
|
+
term = term.toUpperCase();
|
|
145
|
+
return term;
|
|
146
|
+
}
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
148
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: TermPipe, isStandalone: true, name: "term" });
|
|
149
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermPipe, providedIn: "root" });
|
|
150
|
+
}
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermPipe, decorators: [{
|
|
152
|
+
type: Injectable,
|
|
153
|
+
args: [{ providedIn: "root" }]
|
|
154
|
+
}, {
|
|
155
|
+
type: Pipe,
|
|
156
|
+
args: [{ name: "term" }]
|
|
157
|
+
}] });
|
|
158
|
+
|
|
159
|
+
class FormatAmountPipe {
|
|
160
|
+
transform(value, shortFormat = false, decimalPlaces = 2) {
|
|
161
|
+
if (value === null || value === undefined) {
|
|
162
|
+
return "0";
|
|
163
|
+
}
|
|
164
|
+
const numericValue = typeof value === "string" ? parseFloat(value) : value;
|
|
165
|
+
if (isNaN(numericValue)) {
|
|
166
|
+
return "0";
|
|
167
|
+
}
|
|
168
|
+
let formattedValue;
|
|
169
|
+
if (shortFormat) {
|
|
170
|
+
formattedValue = this.getShortFormat(numericValue, decimalPlaces);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
formattedValue = this.formatWithThousandSeparators(numericValue, decimalPlaces);
|
|
174
|
+
}
|
|
175
|
+
return formattedValue;
|
|
176
|
+
}
|
|
177
|
+
getShortFormat(value, decimalPlaces) {
|
|
178
|
+
const absValue = Math.abs(value);
|
|
179
|
+
const suffixes = [
|
|
180
|
+
{ limit: 1e12, suffix: "T" },
|
|
181
|
+
{ limit: 1e9, suffix: "B" },
|
|
182
|
+
{ limit: 1e6, suffix: "M" },
|
|
183
|
+
{ limit: 1e3, suffix: "K" },
|
|
184
|
+
];
|
|
185
|
+
for (const { limit, suffix } of suffixes) {
|
|
186
|
+
if (absValue >= limit) {
|
|
187
|
+
return (value / limit).toFixed(decimalPlaces) + suffix;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return value.toFixed(decimalPlaces);
|
|
191
|
+
}
|
|
192
|
+
formatWithThousandSeparators(value, decimalPlaces) {
|
|
193
|
+
return new Intl.NumberFormat("en-US", {
|
|
194
|
+
minimumFractionDigits: decimalPlaces,
|
|
195
|
+
maximumFractionDigits: decimalPlaces,
|
|
196
|
+
}).format(value);
|
|
197
|
+
}
|
|
198
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FormatAmountPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
199
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: FormatAmountPipe, isStandalone: true, name: "amount" });
|
|
200
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FormatAmountPipe, providedIn: "root" });
|
|
201
|
+
}
|
|
202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FormatAmountPipe, decorators: [{
|
|
203
|
+
type: Injectable,
|
|
204
|
+
args: [{
|
|
205
|
+
providedIn: "root",
|
|
206
|
+
}]
|
|
207
|
+
}, {
|
|
208
|
+
type: Pipe,
|
|
209
|
+
args: [{
|
|
210
|
+
name: "amount",
|
|
211
|
+
}]
|
|
212
|
+
}] });
|
|
213
|
+
|
|
214
|
+
class TruncatePipe {
|
|
215
|
+
transform(value, size = 15, original = false) {
|
|
216
|
+
if (!value)
|
|
217
|
+
return value;
|
|
218
|
+
if (value.length <= size)
|
|
219
|
+
return value;
|
|
220
|
+
let truncateString = value.substring(0, size);
|
|
221
|
+
return !original ? `${truncateString}...` : truncateString.toUpperCase();
|
|
222
|
+
}
|
|
223
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
224
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: TruncatePipe, isStandalone: true, name: "truncate" });
|
|
225
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TruncatePipe, providedIn: "root" });
|
|
226
|
+
}
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TruncatePipe, decorators: [{
|
|
228
|
+
type: Injectable,
|
|
229
|
+
args: [{ providedIn: "root" }]
|
|
230
|
+
}, {
|
|
231
|
+
type: Pipe,
|
|
232
|
+
args: [{
|
|
233
|
+
name: "truncate",
|
|
234
|
+
}]
|
|
235
|
+
}] });
|
|
236
|
+
|
|
237
|
+
// import { CookieAttributes } from "typescript-cookie/dist/types";
|
|
238
|
+
const domain = window.location.hostname.split(".").slice(-2).join(".");
|
|
239
|
+
const secure = !domain.includes("localhost");
|
|
240
|
+
const CookieAttributesGeneral = { domain: domain, path: "/", secure: secure };
|
|
241
|
+
|
|
242
|
+
const Color = {
|
|
243
|
+
mastercard: "#ff7f00",
|
|
244
|
+
visa: "#17375E",
|
|
245
|
+
amex: "#348AD5",
|
|
246
|
+
orange: "#ff7f00",
|
|
247
|
+
orangeDark: "#CC4900",
|
|
248
|
+
blue: "#17375E",
|
|
249
|
+
gray: "#D3D3D3",
|
|
250
|
+
gray3: "#a6a5a1",
|
|
251
|
+
gray5: "#e9e9e9",
|
|
252
|
+
};
|
|
253
|
+
const getColor = (name) => {
|
|
254
|
+
return Color[name];
|
|
255
|
+
};
|
|
256
|
+
|
|
97
257
|
class FeatureFlagService {
|
|
98
258
|
_http = inject(HttpClient);
|
|
99
259
|
_configService = inject(ConfigService);
|
|
@@ -311,7 +471,7 @@ class PermissionsService {
|
|
|
311
471
|
constructor() { }
|
|
312
472
|
async canActivate(next, state) {
|
|
313
473
|
while (true) {
|
|
314
|
-
await sleep
|
|
474
|
+
await sleep(10);
|
|
315
475
|
if (document.querySelectorAll("[data-security]").length > 0)
|
|
316
476
|
break;
|
|
317
477
|
}
|
|
@@ -337,7 +497,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
337
497
|
providedIn: "root",
|
|
338
498
|
}]
|
|
339
499
|
}], ctorParameters: () => [] });
|
|
340
|
-
function sleep
|
|
500
|
+
function sleep(ms) {
|
|
341
501
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
342
502
|
}
|
|
343
503
|
const TermGuard = (next, state) => {
|
|
@@ -345,165 +505,34 @@ const TermGuard = (next, state) => {
|
|
|
345
505
|
return true;
|
|
346
506
|
};
|
|
347
507
|
|
|
348
|
-
class
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
355
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermService, providedIn: "root" });
|
|
356
|
-
}
|
|
357
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermService, decorators: [{
|
|
358
|
-
type: Injectable,
|
|
359
|
-
args: [{ providedIn: "root" }]
|
|
360
|
-
}] });
|
|
361
|
-
|
|
362
|
-
class GlobalTermService {
|
|
363
|
-
terms = [];
|
|
364
|
-
languageCode = "";
|
|
365
|
-
TermsReady = signal(false);
|
|
366
|
-
PageRoot = "";
|
|
367
|
-
termService = inject(TermService);
|
|
368
|
-
Initialize(pageRoot) {
|
|
369
|
-
let languageCode = getCookie("language") ?? "EN";
|
|
370
|
-
this.PageRoot = pageRoot;
|
|
371
|
-
if (pageRoot == "") {
|
|
372
|
-
this.TermsReady.set(true);
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
this.termService.GetTerms(languageCode, pageRoot).subscribe(response => {
|
|
376
|
-
this.terms = response;
|
|
377
|
-
this.TermsReady.set(true);
|
|
378
|
-
this.SetTerms();
|
|
379
|
-
this.languageCode = languageCode;
|
|
380
|
-
});
|
|
508
|
+
class RouteGuardService {
|
|
509
|
+
HttpClient = inject(HttpClient);
|
|
510
|
+
ConfigService = inject(ConfigService);
|
|
511
|
+
constructor() { }
|
|
512
|
+
async canActivate(next, state) {
|
|
513
|
+
this.ChangeRoute(next.data["pageRoot"]);
|
|
381
514
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
let textsToChange = document.querySelectorAll("[data-term]");
|
|
389
|
-
textsToChange.forEach(async (element) => {
|
|
390
|
-
let dataValue = element.getAttribute("data-term");
|
|
391
|
-
let newText = this.terms.find(x => x.termName == dataValue)?.termValue ?? "";
|
|
392
|
-
element.innerHTML = newText;
|
|
393
|
-
element.setAttribute("placeholder", newText);
|
|
515
|
+
ChangeRoute(pageRoot) {
|
|
516
|
+
this.HttpClient.get(`${this.ConfigService.environment?.securityPath}/Menu/GetBreadcrumbs/${pageRoot}`).subscribe(response => {
|
|
517
|
+
let eventChangeRoute = new CustomEvent("ChangeRoute", {
|
|
518
|
+
detail: { Breadcrumbs: response },
|
|
519
|
+
});
|
|
520
|
+
window.dispatchEvent(eventChangeRoute);
|
|
394
521
|
});
|
|
395
522
|
}
|
|
396
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type:
|
|
397
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type:
|
|
398
|
-
}
|
|
399
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: GlobalTermService, decorators: [{
|
|
400
|
-
type: Injectable,
|
|
401
|
-
args: [{ providedIn: "root" }]
|
|
402
|
-
}] });
|
|
403
|
-
function sleep(ms) {
|
|
404
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
// import GlobalTermService from "../services/globalTerm.service";
|
|
408
|
-
class TermPipe {
|
|
409
|
-
globalTermService = inject(GlobalTermService);
|
|
410
|
-
transform(termName, language, mode = 1) {
|
|
411
|
-
let term = this.globalTermService.terms.find(x => x.termName == termName)?.termValue ?? "-";
|
|
412
|
-
if (mode == 2)
|
|
413
|
-
term = term.substring(0, 1);
|
|
414
|
-
if (mode == 3)
|
|
415
|
-
term = term.toUpperCase();
|
|
416
|
-
return term;
|
|
417
|
-
}
|
|
418
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
419
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: TermPipe, isStandalone: true, name: "term" });
|
|
420
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermPipe, providedIn: "root" });
|
|
421
|
-
}
|
|
422
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TermPipe, decorators: [{
|
|
423
|
-
type: Injectable,
|
|
424
|
-
args: [{ providedIn: "root" }]
|
|
425
|
-
}, {
|
|
426
|
-
type: Pipe,
|
|
427
|
-
args: [{ name: "term" }]
|
|
428
|
-
}] });
|
|
429
|
-
|
|
430
|
-
class FormatAmountPipe {
|
|
431
|
-
transform(value, shortFormat = false, decimalPlaces = 2) {
|
|
432
|
-
if (value === null || value === undefined) {
|
|
433
|
-
return "0";
|
|
434
|
-
}
|
|
435
|
-
const numericValue = typeof value === "string" ? parseFloat(value) : value;
|
|
436
|
-
if (isNaN(numericValue)) {
|
|
437
|
-
return "0";
|
|
438
|
-
}
|
|
439
|
-
let formattedValue;
|
|
440
|
-
if (shortFormat) {
|
|
441
|
-
formattedValue = this.getShortFormat(numericValue, decimalPlaces);
|
|
442
|
-
}
|
|
443
|
-
else {
|
|
444
|
-
formattedValue = this.formatWithThousandSeparators(numericValue, decimalPlaces);
|
|
445
|
-
}
|
|
446
|
-
return formattedValue;
|
|
447
|
-
}
|
|
448
|
-
getShortFormat(value, decimalPlaces) {
|
|
449
|
-
const absValue = Math.abs(value);
|
|
450
|
-
const suffixes = [
|
|
451
|
-
{ limit: 1e12, suffix: "T" },
|
|
452
|
-
{ limit: 1e9, suffix: "B" },
|
|
453
|
-
{ limit: 1e6, suffix: "M" },
|
|
454
|
-
{ limit: 1e3, suffix: "K" },
|
|
455
|
-
];
|
|
456
|
-
for (const { limit, suffix } of suffixes) {
|
|
457
|
-
if (absValue >= limit) {
|
|
458
|
-
return (value / limit).toFixed(decimalPlaces) + suffix;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
return value.toFixed(decimalPlaces);
|
|
462
|
-
}
|
|
463
|
-
formatWithThousandSeparators(value, decimalPlaces) {
|
|
464
|
-
return new Intl.NumberFormat("en-US", {
|
|
465
|
-
minimumFractionDigits: decimalPlaces,
|
|
466
|
-
maximumFractionDigits: decimalPlaces,
|
|
467
|
-
}).format(value);
|
|
468
|
-
}
|
|
469
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FormatAmountPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
470
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: FormatAmountPipe, isStandalone: true, name: "amount" });
|
|
471
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FormatAmountPipe, providedIn: "root" });
|
|
523
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: RouteGuardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
524
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: RouteGuardService, providedIn: "root" });
|
|
472
525
|
}
|
|
473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type:
|
|
526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: RouteGuardService, decorators: [{
|
|
474
527
|
type: Injectable,
|
|
475
528
|
args: [{
|
|
476
529
|
providedIn: "root",
|
|
477
530
|
}]
|
|
478
|
-
},
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
}] });
|
|
484
|
-
|
|
485
|
-
class TruncatePipe {
|
|
486
|
-
transform(value, size = 15, original = false) {
|
|
487
|
-
if (!value)
|
|
488
|
-
return value;
|
|
489
|
-
if (value.length <= size)
|
|
490
|
-
return value;
|
|
491
|
-
let truncateString = value.substring(0, size);
|
|
492
|
-
return !original ? `${truncateString}...` : truncateString.toUpperCase();
|
|
493
|
-
}
|
|
494
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
495
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: TruncatePipe, isStandalone: true, name: "truncate" });
|
|
496
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TruncatePipe, providedIn: "root" });
|
|
497
|
-
}
|
|
498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TruncatePipe, decorators: [{
|
|
499
|
-
type: Injectable,
|
|
500
|
-
args: [{ providedIn: "root" }]
|
|
501
|
-
}, {
|
|
502
|
-
type: Pipe,
|
|
503
|
-
args: [{
|
|
504
|
-
name: "truncate",
|
|
505
|
-
}]
|
|
506
|
-
}] });
|
|
531
|
+
}], ctorParameters: () => [] });
|
|
532
|
+
const RouteGuard = (next, state) => {
|
|
533
|
+
inject(RouteGuardService).canActivate(next, state);
|
|
534
|
+
return true;
|
|
535
|
+
};
|
|
507
536
|
|
|
508
537
|
class SpinnerComponent {
|
|
509
538
|
spinerService = inject(SpinnerService);
|
|
@@ -2901,24 +2930,55 @@ class MultiSelectComponent {
|
|
|
2901
2930
|
onChangeEvent = new EventEmitter();
|
|
2902
2931
|
checked = false;
|
|
2903
2932
|
selectedOptions = [];
|
|
2933
|
+
onChange = () => { };
|
|
2934
|
+
onTouched = () => { };
|
|
2904
2935
|
toggleAllSelection(event) {
|
|
2905
2936
|
this.selectedOptions = event.checked ? this.options.map(option => option.value) : [];
|
|
2906
2937
|
this.emitChangeEvent();
|
|
2938
|
+
this.onChange(this.selectedOptions);
|
|
2939
|
+
this.onTouched();
|
|
2907
2940
|
}
|
|
2908
2941
|
onChangeSelect(event) {
|
|
2909
2942
|
console.log("onChange -> ", event);
|
|
2910
2943
|
this.checked = this.selectedOptions.length === this.options.length;
|
|
2911
2944
|
this.emitChangeEvent();
|
|
2945
|
+
this.onChange(this.selectedOptions);
|
|
2946
|
+
this.onTouched();
|
|
2912
2947
|
}
|
|
2913
2948
|
emitChangeEvent() {
|
|
2914
2949
|
this.onChangeEvent.emit(this.selectedOptions);
|
|
2915
2950
|
}
|
|
2951
|
+
writeValue(value) {
|
|
2952
|
+
this.selectedOptions = value || [];
|
|
2953
|
+
this.checked = this.selectedOptions.length === this.options.length;
|
|
2954
|
+
}
|
|
2955
|
+
registerOnChange(fn) {
|
|
2956
|
+
this.onChange = fn;
|
|
2957
|
+
}
|
|
2958
|
+
registerOnTouched(fn) {
|
|
2959
|
+
this.onTouched = fn;
|
|
2960
|
+
}
|
|
2961
|
+
setDisabledState(isDisabled) {
|
|
2962
|
+
// Aquí puedes manejar el estado disabled si es necesario
|
|
2963
|
+
}
|
|
2916
2964
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2917
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: MultiSelectComponent, isStandalone: true, selector: "intelica-multi-select", inputs: { id: "id", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", placeholder: "placeholder", showFilter: "showFilter", showAll: "showAll", allText: "allText", maxSelectedLabels: "maxSelectedLabels", appendTo: "appendTo", panelStyleClass: "panelStyleClass", virtualScroll: "virtualScroll", selectedItemsLabel: "selectedItemsLabel" }, outputs: { onChangeEvent: "onChange" },
|
|
2965
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: MultiSelectComponent, isStandalone: true, selector: "intelica-multi-select", inputs: { id: "id", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", placeholder: "placeholder", showFilter: "showFilter", showAll: "showAll", allText: "allText", maxSelectedLabels: "maxSelectedLabels", appendTo: "appendTo", panelStyleClass: "panelStyleClass", virtualScroll: "virtualScroll", selectedItemsLabel: "selectedItemsLabel" }, outputs: { onChangeEvent: "onChange" }, providers: [
|
|
2966
|
+
{
|
|
2967
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2968
|
+
useExisting: forwardRef(() => MultiSelectComponent),
|
|
2969
|
+
multi: true,
|
|
2970
|
+
},
|
|
2971
|
+
], ngImport: i0, template: "<p-multiSelect\r\n\tclass=\"prMultiselect\"\r\n\t[options]=\"options\"\r\n\t[(ngModel)]=\"selectedOptions\"\r\n\t[optionLabel]=\"optionLabel\"\r\n\t[optionValue]=\"optionValue\"\r\n\t[placeholder]=\"placeholder\"\r\n\t[maxSelectedLabels]=\"maxSelectedLabels\"\r\n\t[filter]=\"showFilter\"\r\n\t[showToggleAll]=\"false\"\r\n\t(onChange)=\"onChangeSelect($event)\"\r\n\t[appendTo]=\"appendTo\"\r\n\t[panelStyleClass]=\"panelStyleClass\"\r\n\t[virtualScroll]=\"virtualScroll\"\r\n\t[virtualScrollOptions]=\"{ itemSize: 25, scrollHeight: '200px' }\"\r\n\tselectedItemsLabel=\"{0} {{ selectedItemsLabel }}\"\r\n>\r\n\t@if(showAll){\r\n\t<ng-template #header>\r\n\t\t<div class=\"prMultiselect__all\">\r\n\t\t\t<label [for]=\"id + '-all'\">\r\n\t\t\t\t<p-checkbox [inputId]=\"id + '-all'\" [binary]=\"true\" [(ngModel)]=\"checked\" (onChange)=\"toggleAllSelection($event)\"></p-checkbox>\r\n\t\t\t\t{{ allText }}\r\n\t\t\t</label>\r\n\t\t</div>\r\n\t</ng-template>\r\n\t}\r\n</p-multiSelect>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i2$2.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i5.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }] });
|
|
2918
2972
|
}
|
|
2919
2973
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
2920
2974
|
type: Component,
|
|
2921
|
-
args: [{ selector: "intelica-multi-select", imports: [FormsModule, MultiSelectModule, CheckboxModule],
|
|
2975
|
+
args: [{ selector: "intelica-multi-select", imports: [FormsModule, MultiSelectModule, CheckboxModule], providers: [
|
|
2976
|
+
{
|
|
2977
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2978
|
+
useExisting: forwardRef(() => MultiSelectComponent),
|
|
2979
|
+
multi: true,
|
|
2980
|
+
},
|
|
2981
|
+
], template: "<p-multiSelect\r\n\tclass=\"prMultiselect\"\r\n\t[options]=\"options\"\r\n\t[(ngModel)]=\"selectedOptions\"\r\n\t[optionLabel]=\"optionLabel\"\r\n\t[optionValue]=\"optionValue\"\r\n\t[placeholder]=\"placeholder\"\r\n\t[maxSelectedLabels]=\"maxSelectedLabels\"\r\n\t[filter]=\"showFilter\"\r\n\t[showToggleAll]=\"false\"\r\n\t(onChange)=\"onChangeSelect($event)\"\r\n\t[appendTo]=\"appendTo\"\r\n\t[panelStyleClass]=\"panelStyleClass\"\r\n\t[virtualScroll]=\"virtualScroll\"\r\n\t[virtualScrollOptions]=\"{ itemSize: 25, scrollHeight: '200px' }\"\r\n\tselectedItemsLabel=\"{0} {{ selectedItemsLabel }}\"\r\n>\r\n\t@if(showAll){\r\n\t<ng-template #header>\r\n\t\t<div class=\"prMultiselect__all\">\r\n\t\t\t<label [for]=\"id + '-all'\">\r\n\t\t\t\t<p-checkbox [inputId]=\"id + '-all'\" [binary]=\"true\" [(ngModel)]=\"checked\" (onChange)=\"toggleAllSelection($event)\"></p-checkbox>\r\n\t\t\t\t{{ allText }}\r\n\t\t\t</label>\r\n\t\t</div>\r\n\t</ng-template>\r\n\t}\r\n</p-multiSelect>\r\n" }]
|
|
2922
2982
|
}], propDecorators: { id: [{
|
|
2923
2983
|
type: Input
|
|
2924
2984
|
}], options: [{
|
|
@@ -6385,9 +6445,11 @@ const IntelicaTheme = definePreset(Aura, {
|
|
|
6385
6445
|
},
|
|
6386
6446
|
});
|
|
6387
6447
|
|
|
6448
|
+
//Pipes
|
|
6449
|
+
|
|
6388
6450
|
/**
|
|
6389
6451
|
* Generated bundle index. Do not edit.
|
|
6390
6452
|
*/
|
|
6391
6453
|
|
|
6392
|
-
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DataDirective, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FormatAmountPipe, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RowResumenComponent, SearchComponent, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TemplateMenuComponent, TermGuard, TermPipe, TermService, TruncatePipe, decryptData, encryptData, getColor };
|
|
6454
|
+
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DataDirective, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FormatAmountPipe, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, RowResumenComponent, SearchComponent, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TemplateMenuComponent, TermGuard, TermPipe, TermService, TruncatePipe, decryptData, encryptData, getColor };
|
|
6393
6455
|
//# sourceMappingURL=intelica-library-ui.mjs.map
|