@seniorsistemas/platform-components 7.2.0 → 7.2.1-develop-c3823f83
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/esm2022/modules/advanced-filter/advanced-filter.module.mjs +32 -35
- package/esm2022/modules/advanced-filter/components/advanced-filter/advanced-filter.component.mjs +33 -9
- package/esm2022/modules/advanced-filter/components/form-filter/form-filter.component.mjs +132 -85
- package/esm2022/modules/advanced-filter/locale/fallback.mjs +1 -46
- package/esm2022/modules/advanced-filter/services/advanced-filter.service.mjs +110 -31
- package/esm2022/modules/advanced-filter/services/calendar-options.service.mjs +13 -64
- package/esm2022/modules/advanced-filter/utils/filter-value/index.mjs +7 -11
- package/esm2022/modules/advanced-filter/utils/form-field/index.mjs +10 -9
- package/esm2022/modules/spotlight/component/spotlight.component.mjs +7 -8
- package/esm2022/modules/spotlight/spotlight.module.mjs +7 -14
- package/esm2022/modules/translations/translations.module.mjs +4 -4
- package/fesm2022/seniorsistemas-platform-components.mjs +336 -296
- package/fesm2022/seniorsistemas-platform-components.mjs.map +1 -1
- package/modules/advanced-filter/advanced-filter.module.d.ts +10 -11
- package/modules/advanced-filter/components/advanced-filter/advanced-filter.component.d.ts +9 -1
- package/modules/advanced-filter/components/form-filter/form-filter.component.d.ts +13 -5
- package/modules/advanced-filter/locale/fallback.d.ts +0 -45
- package/modules/advanced-filter/services/advanced-filter.service.d.ts +20 -0
- package/modules/advanced-filter/services/calendar-options.service.d.ts +8 -12
- package/modules/spotlight/spotlight.module.d.ts +5 -6
- package/modules/translations/translations.module.d.ts +1 -1
- package/package.json +12 -2
- package/schematics/collection.json +10 -0
- package/schematics/migrations/migrate-v8/index.d.ts +57 -0
- package/schematics/migrations/migrate-v8/index.js +281 -0
- package/schematics/migrations/migrate-v8/index.js.map +1 -0
- package/schematics/migrations/migrate-v8/schema.json +17 -0
- package/schematics/migrations.json +11 -0
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Pipe, inject, InjectionToken, APP_INITIALIZER, Injector, NgModule, Injectable, ChangeDetectorRef, EventEmitter, Component, Input, Output, HostListener, ElementRef, ViewEncapsulation, ViewChild } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i3$2 from '@angular/common';
|
|
4
4
|
import { LOCATION_INITIALIZED, CommonModule, DatePipe } from '@angular/common';
|
|
5
5
|
import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
-
import
|
|
7
|
-
import { ButtonModule as ButtonModule$1 } from 'primeng/button';
|
|
8
|
-
import * as i1$2 from 'primeng/dialog';
|
|
9
|
-
import { DialogModule } from 'primeng/dialog';
|
|
10
|
-
import * as i1$1 from 'primeng/tabview';
|
|
11
|
-
import { TabViewModule } from 'primeng/tabview';
|
|
12
|
-
import * as i5 from 'primeng/toast';
|
|
13
|
-
import { ToastModule } from 'primeng/toast';
|
|
14
|
-
import * as i3$2 from 'primeng/tooltip';
|
|
15
|
-
import { TooltipModule } from 'primeng/tooltip';
|
|
16
|
-
import * as i2$1 from 'primeng/api';
|
|
17
|
-
import { MessageService } from 'primeng/api';
|
|
18
|
-
import { LocaleService } from '@seniorsistemas/angular-components/locale';
|
|
6
|
+
import { parseLocalizedDate, formatLocalizedDate, DEFAULT_DATE_FORMAT, LocaleService } from '@seniorsistemas/angular-components/locale';
|
|
19
7
|
import * as i3 from '@seniorsistemas/angular-components/empty-state';
|
|
20
|
-
import {
|
|
21
|
-
import * as
|
|
22
|
-
import {
|
|
8
|
+
import { EmptyStateComponent } from '@seniorsistemas/angular-components/empty-state';
|
|
9
|
+
import * as i4 from '@seniorsistemas/angular-components/button';
|
|
10
|
+
import { ButtonComponent } from '@seniorsistemas/angular-components/button';
|
|
23
11
|
import * as i2 from '@seniorsistemas/angular-components/dynamic-form';
|
|
24
|
-
import { dynamicTypeToDynamicStructure,
|
|
12
|
+
import { dynamicTypeToDynamicStructure, DynamicFormComponent } from '@seniorsistemas/angular-components/dynamic-form';
|
|
13
|
+
import * as i1$2 from '@seniorsistemas/angular-components/badge';
|
|
14
|
+
import { BadgeComponent } from '@seniorsistemas/angular-components/badge';
|
|
15
|
+
import * as i2$1 from '@seniorsistemas/angular-components/dialog';
|
|
16
|
+
import { DialogComponent } from '@seniorsistemas/angular-components/dialog';
|
|
17
|
+
import * as i1$1 from '@seniorsistemas/angular-components/tabs';
|
|
18
|
+
import { TabsComponent, TabItemComponent } from '@seniorsistemas/angular-components/tabs';
|
|
19
|
+
import * as i3$1 from '@seniorsistemas/angular-components/template';
|
|
20
|
+
import { TemplateDirective } from '@seniorsistemas/angular-components/template';
|
|
25
21
|
import * as i1 from '@ngx-translate/core';
|
|
26
22
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
27
23
|
import { HttpClient, provideHttpClient, withInterceptorsFromDi, HttpParams, HttpHeaders, HttpResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
28
24
|
import { user, service } from '@seniorsistemas/senior-platform-data';
|
|
29
|
-
import { CookieService } from '
|
|
30
|
-
import { Subject, BehaviorSubject, Observable, from, defer, forkJoin, throwError,
|
|
31
|
-
import { map, takeUntil, filter, tap, mergeMap,
|
|
25
|
+
import { CookieService } from '@seniorsistemas/angular-components/cookie';
|
|
26
|
+
import { Subject, BehaviorSubject, Observable, of, from, defer, forkJoin, throwError, takeUntil as takeUntil$1 } from 'rxjs';
|
|
27
|
+
import { map, switchMap, catchError, takeUntil, filter, tap, mergeMap, shareReplay } from 'rxjs/operators';
|
|
32
28
|
import { Router, NavigationEnd } from '@angular/router';
|
|
33
29
|
import { ToastService } from '@seniorsistemas/angular-components/toast';
|
|
34
30
|
import { contains, equals, clone } from 'ramda';
|
|
35
|
-
import * as momentNs from 'moment';
|
|
36
31
|
import * as jc from 'json-cycle';
|
|
37
32
|
import * as i1$3 from '@angular/cdk/a11y';
|
|
38
33
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
@@ -101,11 +96,11 @@ class TranslationsModule {
|
|
|
101
96
|
}
|
|
102
97
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TranslationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
103
98
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: TranslationsModule, imports: [i1.TranslateModule] });
|
|
104
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TranslationsModule, providers: [
|
|
99
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TranslationsModule, providers: [provideHttpClient(withInterceptorsFromDi())], imports: [TranslateModule.forChild()] });
|
|
105
100
|
}
|
|
106
101
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TranslationsModule, decorators: [{
|
|
107
102
|
type: NgModule,
|
|
108
|
-
args: [{ imports: [TranslateModule.forChild()], providers: [
|
|
103
|
+
args: [{ imports: [TranslateModule.forChild()], providers: [provideHttpClient(withInterceptorsFromDi())] }]
|
|
109
104
|
}] });
|
|
110
105
|
function resolveImmediately(resolve) {
|
|
111
106
|
resolve();
|
|
@@ -272,51 +267,6 @@ const fallback$1 = {
|
|
|
272
267
|
'platform.filter_service.hour_format': '24',
|
|
273
268
|
'platform.filter_service.clear': 'Limpar',
|
|
274
269
|
'platform.filter_service.today': 'Hoje',
|
|
275
|
-
'platform.filter_service.name_january': 'Janeiro',
|
|
276
|
-
'platform.filter_service.name_february': 'Fevereiro',
|
|
277
|
-
'platform.filter_service.name_march': 'Março',
|
|
278
|
-
'platform.filter_service.name_april': 'Abril',
|
|
279
|
-
'platform.filter_service.name_may': 'Maio',
|
|
280
|
-
'platform.filter_service.name_june': 'Junho',
|
|
281
|
-
'platform.filter_service.name_july': 'Julho',
|
|
282
|
-
'platform.filter_service.name_august': 'Agosto',
|
|
283
|
-
'platform.filter_service.name_september': 'Setembro',
|
|
284
|
-
'platform.filter_service.name_october': 'Outubro',
|
|
285
|
-
'platform.filter_service.name_november': 'Novembro',
|
|
286
|
-
'platform.filter_service.name_december': 'Dezembro',
|
|
287
|
-
'platform.filter_service.short_january': 'Jan',
|
|
288
|
-
'platform.filter_service.short_february': 'Fev',
|
|
289
|
-
'platform.filter_service.short_march': 'Mar',
|
|
290
|
-
'platform.filter_service.short_april': 'Abr',
|
|
291
|
-
'platform.filter_service.short_may': 'Mai',
|
|
292
|
-
'platform.filter_service.short_june': 'Jun',
|
|
293
|
-
'platform.filter_service.short_july': 'Jul',
|
|
294
|
-
'platform.filter_service.short_august': 'Ago',
|
|
295
|
-
'platform.filter_service.short_september': 'Set',
|
|
296
|
-
'platform.filter_service.short_october': 'Out',
|
|
297
|
-
'platform.filter_service.short_november': 'Nov',
|
|
298
|
-
'platform.filter_service.short_december': 'Dez',
|
|
299
|
-
'platform.filter_service.name_sunday': 'Domingo',
|
|
300
|
-
'platform.filter_service.name_monday': 'Segunda',
|
|
301
|
-
'platform.filter_service.name_tuesday': 'Terça',
|
|
302
|
-
'platform.filter_service.name_wednesday': 'Quarta',
|
|
303
|
-
'platform.filter_service.name_thursday': 'Quinta',
|
|
304
|
-
'platform.filter_service.name_friday': 'Sexta',
|
|
305
|
-
'platform.filter_service.name_saturday': 'Sábado',
|
|
306
|
-
'platform.filter_service.min_sunday': 'D',
|
|
307
|
-
'platform.filter_service.min_monday': 'S',
|
|
308
|
-
'platform.filter_service.min_tuesday': 'T',
|
|
309
|
-
'platform.filter_service.min_wednesday': 'Q',
|
|
310
|
-
'platform.filter_service.min_thursday': 'Q',
|
|
311
|
-
'platform.filter_service.min_friday': 'S',
|
|
312
|
-
'platform.filter_service.min_saturday': 'S',
|
|
313
|
-
'platform.filter_service.short_sunday': 'Dom',
|
|
314
|
-
'platform.filter_service.short_monday': 'Seg',
|
|
315
|
-
'platform.filter_service.short_tuesday': 'Ter',
|
|
316
|
-
'platform.filter_service.short_wednesday': 'Qua',
|
|
317
|
-
'platform.filter_service.short_thursday': 'Qui',
|
|
318
|
-
'platform.filter_service.short_friday': 'Sex',
|
|
319
|
-
'platform.filter_service.short_saturday': 'Sab',
|
|
320
270
|
'platform.filter_service.yes': 'Sim',
|
|
321
271
|
'platform.filter_service.no': 'Não',
|
|
322
272
|
'platform.filter_service.search_empty_message': 'Nenhum resultado encontrado',
|
|
@@ -397,16 +347,97 @@ class AdvancedFilterService {
|
|
|
397
347
|
getFilters(serviceContexts, applyFilter) {
|
|
398
348
|
this.http
|
|
399
349
|
.post(GET_FILTERS_URL, { serviceContexts })
|
|
400
|
-
.pipe(
|
|
350
|
+
.pipe(switchMap((response) => this.applyTicketValues(response.filters)), map((filters) => this.mapFilters(filters)))
|
|
401
351
|
.subscribe((filters) => this.filtersObservable.next({ filters, applyFilter }), //
|
|
402
352
|
(err) => this.filtersObservable.next({ error: true, message: err }));
|
|
403
353
|
}
|
|
354
|
+
applyTicketValues(filters) {
|
|
355
|
+
if (!this.ticketFilter) {
|
|
356
|
+
return of(filters);
|
|
357
|
+
}
|
|
358
|
+
return this.fetchFiltersByTicket().pipe(map((ticketFilters) => this.mergeTicketValues(filters, ticketFilters)));
|
|
359
|
+
}
|
|
360
|
+
fetchFiltersByTicket() {
|
|
361
|
+
return this.http
|
|
362
|
+
.get(GET_FILTERS_BY_TICKET, { params: { ticket: this.ticketFilter } })
|
|
363
|
+
.pipe(map((response) => response.filters ?? []), catchError(() => of([])));
|
|
364
|
+
}
|
|
365
|
+
mergeTicketValues(filters, ticketFilters) {
|
|
366
|
+
if (!ticketFilters.length) {
|
|
367
|
+
return filters;
|
|
368
|
+
}
|
|
369
|
+
const ticketValueMap = this.buildTicketValueMap(ticketFilters);
|
|
370
|
+
return filters.map((filter) => {
|
|
371
|
+
const key = this.getTicketKey(filter.domain, filter.name);
|
|
372
|
+
const ticketValue = ticketValueMap.get(key);
|
|
373
|
+
if (ticketValue === undefined) {
|
|
374
|
+
return filter;
|
|
375
|
+
}
|
|
376
|
+
return { ...filter, value: this.buildMergedValue(filter, ticketValue) };
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Reconstrói o valor do filtro a partir dos itens do ticket (que contém apenas as chaves),
|
|
381
|
+
* reaproveitando o objeto completo já presente no filtro base quando a chave corresponde —
|
|
382
|
+
* preservando assim o texto de exibição. Chaves ausentes no base são mantidas como estão
|
|
383
|
+
* e resolvidas posteriormente pela busca de sugestões.
|
|
384
|
+
*/
|
|
385
|
+
buildMergedValue(filter, ticketValue) {
|
|
386
|
+
const ticketItems = this.parseJsonArray(ticketValue);
|
|
387
|
+
if (!ticketItems) {
|
|
388
|
+
return ticketValue;
|
|
389
|
+
}
|
|
390
|
+
const baseItemsByKey = this.indexBaseItemsByKey(filter);
|
|
391
|
+
const mergedItems = ticketItems.map((ticketItem) => baseItemsByKey.get(String(ticketItem)) ?? ticketItem);
|
|
392
|
+
return JSON.stringify(mergedItems);
|
|
393
|
+
}
|
|
394
|
+
indexBaseItemsByKey(filter) {
|
|
395
|
+
const baseItems = this.parseJsonArray(filter.value);
|
|
396
|
+
const keyFields = this.getSearchOutput(filter)?.keyFields ?? [];
|
|
397
|
+
const itemsByKey = new Map();
|
|
398
|
+
if (!baseItems || !keyFields.length) {
|
|
399
|
+
return itemsByKey;
|
|
400
|
+
}
|
|
401
|
+
baseItems.forEach((item) => {
|
|
402
|
+
if (item && typeof item === 'object') {
|
|
403
|
+
const record = item;
|
|
404
|
+
const compositeKey = keyFields.map((field) => record[field]).join(', ');
|
|
405
|
+
itemsByKey.set(compositeKey, item);
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
return itemsByKey;
|
|
409
|
+
}
|
|
410
|
+
getSearchOutput(filter) {
|
|
411
|
+
return filter.search?.basicSearch?.output ?? filter.search?.entitySearch?.output;
|
|
412
|
+
}
|
|
413
|
+
parseJsonArray(value) {
|
|
414
|
+
try {
|
|
415
|
+
const parsed = value && JSON.parse(value);
|
|
416
|
+
return Array.isArray(parsed) ? parsed : null;
|
|
417
|
+
}
|
|
418
|
+
catch {
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
buildTicketValueMap(ticketFilters) {
|
|
423
|
+
return ticketFilters.reduce((valueMap, ticketFilter) => {
|
|
424
|
+
const key = this.getTicketKey(ticketFilter.domain, ticketFilter.name);
|
|
425
|
+
valueMap.set(key, this.normalizeTicketValue(ticketFilter.value));
|
|
426
|
+
return valueMap;
|
|
427
|
+
}, new Map());
|
|
428
|
+
}
|
|
429
|
+
normalizeTicketValue(value) {
|
|
430
|
+
return typeof value === 'string' ? value : JSON.stringify(value);
|
|
431
|
+
}
|
|
432
|
+
getTicketKey(domain, name) {
|
|
433
|
+
return `${domain}:${name}`;
|
|
434
|
+
}
|
|
404
435
|
mapFilters(filters) {
|
|
405
436
|
return filters.map((filter) => {
|
|
406
437
|
try {
|
|
407
438
|
const value = filter.value && JSON.parse(filter.value);
|
|
408
|
-
this.applySearchMapping(filter, value);
|
|
409
|
-
this.assignFilterValue(filter,
|
|
439
|
+
const mappedValue = this.applySearchMapping(filter, value);
|
|
440
|
+
this.assignFilterValue(filter, mappedValue);
|
|
410
441
|
}
|
|
411
442
|
catch (ex) {
|
|
412
443
|
console.error(`Global: filter ${filter.name} has value error. `, ex);
|
|
@@ -416,15 +447,11 @@ class AdvancedFilterService {
|
|
|
416
447
|
});
|
|
417
448
|
}
|
|
418
449
|
applySearchMapping(filter, value) {
|
|
419
|
-
const
|
|
420
|
-
if (value &&
|
|
421
|
-
this.mapValues(value,
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
const entityOutput = filter.search?.entitySearch?.output;
|
|
425
|
-
if (value && entityOutput) {
|
|
426
|
-
this.mapValues(value, entityOutput.keyFields, entityOutput.displayFields);
|
|
450
|
+
const output = filter.search?.basicSearch?.output ?? filter.search?.entitySearch?.output;
|
|
451
|
+
if (value && output) {
|
|
452
|
+
return this.mapValues(value, output.keyFields, output.displayFields);
|
|
427
453
|
}
|
|
454
|
+
return value;
|
|
428
455
|
}
|
|
429
456
|
assignFilterValue(filter, value) {
|
|
430
457
|
if (!value) {
|
|
@@ -453,29 +480,31 @@ class AdvancedFilterService {
|
|
|
453
480
|
}
|
|
454
481
|
mapValues(value, keyFields, displayFields) {
|
|
455
482
|
if (Array.isArray(value)) {
|
|
456
|
-
value.
|
|
457
|
-
this.mapValue(e, keyFields, displayFields);
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
this.mapValue(value, keyFields, displayFields);
|
|
483
|
+
return value.map((item) => this.mapValue(item, keyFields, displayFields));
|
|
462
484
|
}
|
|
485
|
+
return this.mapValue(value, keyFields, displayFields);
|
|
463
486
|
}
|
|
464
487
|
mapValue(value, keyFields, displayFields) {
|
|
465
488
|
if (!value) {
|
|
466
|
-
return;
|
|
489
|
+
return value;
|
|
467
490
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
keyFields.filter((e) => value[e] !== undefined).forEach((e) => ids.push(value[e]));
|
|
471
|
-
displayFields.filter((e) => value[e] !== undefined).forEach((e) => displays.push(value[e]));
|
|
472
|
-
if (ids.length > 0 && displays.length > 0) {
|
|
473
|
-
value[searchKeyName] = ids.join(', ');
|
|
474
|
-
value[searchDisplayName] = displays.join(', ');
|
|
491
|
+
if (this.isPrimitiveValue(value)) {
|
|
492
|
+
return { [searchKeyName]: value, [searchDisplayName]: value };
|
|
475
493
|
}
|
|
476
|
-
|
|
477
|
-
|
|
494
|
+
const ids = keyFields.filter((field) => value[field] !== undefined).map((field) => value[field]);
|
|
495
|
+
const displays = displayFields.filter((field) => value[field] !== undefined).map((field) => value[field]);
|
|
496
|
+
const { value: _conflictingValue, ...rest } = value;
|
|
497
|
+
if (ids.length > 0 && displays.length > 0) {
|
|
498
|
+
return {
|
|
499
|
+
...rest,
|
|
500
|
+
[searchKeyName]: ids.join(', '),
|
|
501
|
+
[searchDisplayName]: displays.join(', ')
|
|
502
|
+
};
|
|
478
503
|
}
|
|
504
|
+
return rest;
|
|
505
|
+
}
|
|
506
|
+
isPrimitiveValue(value) {
|
|
507
|
+
return typeof value === 'string' || typeof value === 'number';
|
|
479
508
|
}
|
|
480
509
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
481
510
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterService });
|
|
@@ -658,12 +687,6 @@ function getTabId(domain, contextId) {
|
|
|
658
687
|
return `${domain}${FILTER_ID_SEPARATOR}${contextId}`;
|
|
659
688
|
}
|
|
660
689
|
|
|
661
|
-
// NOSONAR
|
|
662
|
-
/**
|
|
663
|
-
*@description Necessary because of https://github.com/rollup/rollup/issues/670
|
|
664
|
-
*
|
|
665
|
-
* */
|
|
666
|
-
const moment$1 = momentNs.default || momentNs;
|
|
667
690
|
const { DATETIME: DATETIME$1, TIME: TIME$1, DATE: DATE$1 } = FilterType;
|
|
668
691
|
const parsers$1 = {
|
|
669
692
|
[DATE$1]: (value) => dateParser$1(value, 'YYYY-MM-DD'),
|
|
@@ -677,9 +700,11 @@ function parseFilterValue(value, type) {
|
|
|
677
700
|
}
|
|
678
701
|
return value;
|
|
679
702
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
703
|
+
/** Texto devolvido para datas inválidas (mesmo valor que o moment gerava). */
|
|
704
|
+
const INVALID_DATE = 'Invalid date';
|
|
705
|
+
function dateParser$1(value, format = DEFAULT_DATE_FORMAT) {
|
|
706
|
+
const date = parseLocalizedDate(value);
|
|
707
|
+
return date ? formatLocalizedDate(date, format) : INVALID_DATE;
|
|
683
708
|
}
|
|
684
709
|
|
|
685
710
|
function jsonPath(obj, path) {
|
|
@@ -755,12 +780,6 @@ function getSearchType(search) {
|
|
|
755
780
|
return search.basicSearch ? search.basicSearch : search.entitySearch;
|
|
756
781
|
}
|
|
757
782
|
|
|
758
|
-
/* sonar-ignore */
|
|
759
|
-
/**
|
|
760
|
-
*@description Necessary because of https://github.com/rollup/rollup/issues/670
|
|
761
|
-
*
|
|
762
|
-
* */
|
|
763
|
-
const moment = momentNs.default || momentNs;
|
|
764
783
|
const { DATE, DATETIME, TIME } = FilterType;
|
|
765
784
|
const parsers = {
|
|
766
785
|
[DATE]: (v) => dateParser(v),
|
|
@@ -800,75 +819,31 @@ function createValidators(minValue, maxValue, regExp) {
|
|
|
800
819
|
return validators;
|
|
801
820
|
}
|
|
802
821
|
function dateParser(value, format) {
|
|
803
|
-
|
|
822
|
+
if (value === null || value === '') {
|
|
823
|
+
return '';
|
|
824
|
+
}
|
|
825
|
+
// Sem valor e sem formato, o comportamento histórico é a data/hora atual.
|
|
826
|
+
if (value === undefined && !format) {
|
|
827
|
+
return new Date();
|
|
828
|
+
}
|
|
829
|
+
return parseLocalizedDate(value, format) ?? new Date(Number.NaN);
|
|
804
830
|
}
|
|
805
831
|
|
|
806
832
|
const TRANSLATE_PREFIX$2 = 'platform.filter_service';
|
|
807
833
|
class CalendarOptionsService {
|
|
808
834
|
translate = inject(TranslateService);
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
],
|
|
822
|
-
dayNamesMin: [
|
|
823
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.min_sunday`),
|
|
824
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.min_monday`),
|
|
825
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.min_tuesday`),
|
|
826
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.min_wednesday`),
|
|
827
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.min_thursday`),
|
|
828
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.min_friday`),
|
|
829
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.min_saturday`)
|
|
830
|
-
],
|
|
831
|
-
dayNamesShort: [
|
|
832
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_sunday`),
|
|
833
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_monday`),
|
|
834
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_tuesday`),
|
|
835
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_wednesday`),
|
|
836
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_thursday`),
|
|
837
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_friday`),
|
|
838
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_saturday`)
|
|
839
|
-
],
|
|
840
|
-
firstDayOfWeek: 0,
|
|
841
|
-
hourFormat: this.translate.instant(`${TRANSLATE_PREFIX$2}.hour_format`),
|
|
842
|
-
monthNames: [
|
|
843
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_january`),
|
|
844
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_february`),
|
|
845
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_march`),
|
|
846
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_april`),
|
|
847
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_may`),
|
|
848
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_june`),
|
|
849
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_july`),
|
|
850
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_august`),
|
|
851
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_september`),
|
|
852
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_october`),
|
|
853
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_november`),
|
|
854
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.name_december`),
|
|
855
|
-
],
|
|
856
|
-
monthNamesShort: [
|
|
857
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_january`),
|
|
858
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_february`),
|
|
859
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_march`),
|
|
860
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_april`),
|
|
861
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_may`),
|
|
862
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_june`),
|
|
863
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_july`),
|
|
864
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_august`),
|
|
865
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_september`),
|
|
866
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_october`),
|
|
867
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_november`),
|
|
868
|
-
this.translate.instant(`${TRANSLATE_PREFIX$2}.short_december`),
|
|
869
|
-
],
|
|
870
|
-
today: this.translate.instant(`${TRANSLATE_PREFIX$2}.today`)
|
|
871
|
-
};
|
|
835
|
+
/**
|
|
836
|
+
* Formato de data do locale ativo no padrão do `s-datepicker` (ex.: `dd/MM/yyyy`).
|
|
837
|
+
*
|
|
838
|
+
* As traduções `platform.filter_service.date_format` seguem o padrão legado do PrimeNG
|
|
839
|
+
* (`dd/mm/yy`), por isso são convertidas: `mm` → `MM` e `yy` → `yyyy`.
|
|
840
|
+
*/
|
|
841
|
+
getDateFormat() {
|
|
842
|
+
const primeFormat = this.translate.instant(`${TRANSLATE_PREFIX$2}.date_format`);
|
|
843
|
+
return primeFormat.replace(/mm/g, 'MM').replace(/(?<!y)yy(?!y)/g, 'yyyy');
|
|
844
|
+
}
|
|
845
|
+
getHourFormat() {
|
|
846
|
+
return this.translate.instant(`${TRANSLATE_PREFIX$2}.hour_format`) === '12' ? '12' : '24';
|
|
872
847
|
}
|
|
873
848
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CalendarOptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
874
849
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CalendarOptionsService });
|
|
@@ -892,6 +867,7 @@ class FormFilterComponent {
|
|
|
892
867
|
formFilters = [];
|
|
893
868
|
oldFormFilters = [];
|
|
894
869
|
actualFormFilters = [];
|
|
870
|
+
lastSuggestions = new Map();
|
|
895
871
|
general = new TabView({ name: 'Geral' });
|
|
896
872
|
totalFiltersActive = 0;
|
|
897
873
|
isMobile = false;
|
|
@@ -919,7 +895,7 @@ class FormFilterComponent {
|
|
|
919
895
|
this.tabViewOrientation = this.isMobile ? 'top' : 'left';
|
|
920
896
|
this.subscribeContextsObservable();
|
|
921
897
|
this.subscribeFiltersObservable();
|
|
922
|
-
window.addEventListener('message', event => {
|
|
898
|
+
window.addEventListener('message', (event) => {
|
|
923
899
|
const data = event.data;
|
|
924
900
|
const message = data.message && data.message.split(':')[1];
|
|
925
901
|
if (message === 'addContext') {
|
|
@@ -958,7 +934,9 @@ class FormFilterComponent {
|
|
|
958
934
|
const message = {
|
|
959
935
|
severity: 'info',
|
|
960
936
|
duration: TOAST_LIFE,
|
|
961
|
-
text: this.translate.instant(`${TRANSLATE_PREFIX$1}.applied_filter_nochange`, {
|
|
937
|
+
text: this.translate.instant(`${TRANSLATE_PREFIX$1}.applied_filter_nochange`, {
|
|
938
|
+
activeFilters: this.totalFiltersActive
|
|
939
|
+
})
|
|
962
940
|
};
|
|
963
941
|
this.sendMessage(message);
|
|
964
942
|
}
|
|
@@ -972,7 +950,7 @@ class FormFilterComponent {
|
|
|
972
950
|
}
|
|
973
951
|
clearFilters() {
|
|
974
952
|
const keys = Object.keys(this.formFilters);
|
|
975
|
-
keys.forEach(key => this.cleanFieldAndSetDefaultValue(key));
|
|
953
|
+
keys.forEach((key) => this.cleanFieldAndSetDefaultValue(key));
|
|
976
954
|
}
|
|
977
955
|
sendCloseMessage() {
|
|
978
956
|
window.parent.postMessage({
|
|
@@ -1003,7 +981,9 @@ class FormFilterComponent {
|
|
|
1003
981
|
const message = {
|
|
1004
982
|
severity: 'info',
|
|
1005
983
|
duration: TOAST_LIFE,
|
|
1006
|
-
text: this.translate.instant(`${TRANSLATE_PREFIX$1}.saved_filters_success`, {
|
|
984
|
+
text: this.translate.instant(`${TRANSLATE_PREFIX$1}.saved_filters_success`, {
|
|
985
|
+
activeFilters: this.totalFiltersActive
|
|
986
|
+
})
|
|
1007
987
|
};
|
|
1008
988
|
this.sendMessage(message);
|
|
1009
989
|
}
|
|
@@ -1013,19 +993,17 @@ class FormFilterComponent {
|
|
|
1013
993
|
const message = {
|
|
1014
994
|
severity: 'error',
|
|
1015
995
|
duration: TOAST_LIFE,
|
|
1016
|
-
text: this.translate.instant(`${TRANSLATE_PREFIX$1}.saved_filters_error`, {
|
|
996
|
+
text: this.translate.instant(`${TRANSLATE_PREFIX$1}.saved_filters_error`, {
|
|
997
|
+
activeFilters: this.totalFiltersActive
|
|
998
|
+
})
|
|
1017
999
|
};
|
|
1018
1000
|
this.sendMessage(message);
|
|
1019
1001
|
};
|
|
1020
|
-
this.filterService
|
|
1021
|
-
.saveFilters(filters)
|
|
1022
|
-
.subscribe(savedFilterSuccess, savedFiltersError);
|
|
1002
|
+
this.filterService.saveFilters(filters).subscribe(savedFilterSuccess, savedFiltersError);
|
|
1023
1003
|
}
|
|
1024
1004
|
saveFiltersWithCallbackFunction(callbackFunction) {
|
|
1025
1005
|
const filters = this.parseToUserFilters(this.formFilters);
|
|
1026
|
-
this.filterService
|
|
1027
|
-
.saveFilters(filters)
|
|
1028
|
-
.subscribe(callbackFunction);
|
|
1006
|
+
this.filterService.saveFilters(filters).subscribe(callbackFunction);
|
|
1029
1007
|
}
|
|
1030
1008
|
counterUpdate() {
|
|
1031
1009
|
this.totalFiltersActive = this.countActiveFilters(this.tabs);
|
|
@@ -1033,7 +1011,7 @@ class FormFilterComponent {
|
|
|
1033
1011
|
}
|
|
1034
1012
|
countActiveFilters(tabs) {
|
|
1035
1013
|
let totalFiltersActive = 0;
|
|
1036
|
-
tabs.forEach(tabView => {
|
|
1014
|
+
tabs.forEach((tabView) => {
|
|
1037
1015
|
const { value } = tabView.form;
|
|
1038
1016
|
tabView.activeFilters = Object.keys(value).reduce((appliedFilters, key) => {
|
|
1039
1017
|
const filterValue = value[key];
|
|
@@ -1054,7 +1032,7 @@ class FormFilterComponent {
|
|
|
1054
1032
|
return ids.reduce((all, filterId) => {
|
|
1055
1033
|
const { type, services, name, value, domain, contexts } = filtersAsObject[filterId];
|
|
1056
1034
|
const filterValue = toUserFormat(value, type);
|
|
1057
|
-
const values = services.map(service => ({ name, service, value: filterValue, domain, contexts }));
|
|
1035
|
+
const values = services.map((service) => ({ name, service, value: filterValue, domain, contexts }));
|
|
1058
1036
|
return [...all, ...values];
|
|
1059
1037
|
}, []);
|
|
1060
1038
|
}
|
|
@@ -1064,7 +1042,7 @@ class FormFilterComponent {
|
|
|
1064
1042
|
return ids.reduce((all, filterId) => {
|
|
1065
1043
|
const { type, services, name, value, domain } = filtersAsObject[filterId];
|
|
1066
1044
|
const filterValue = toFilterFormat(value, type);
|
|
1067
|
-
const values = services.map(service => ({ name, service, value: filterValue, domain }));
|
|
1045
|
+
const values = services.map((service) => ({ name, service, value: filterValue, domain }));
|
|
1068
1046
|
return [...all, ...values];
|
|
1069
1047
|
}, []);
|
|
1070
1048
|
}
|
|
@@ -1077,9 +1055,7 @@ class FormFilterComponent {
|
|
|
1077
1055
|
}
|
|
1078
1056
|
subscribeFiltersObservable() {
|
|
1079
1057
|
const { filtersObserver } = this.filterService;
|
|
1080
|
-
filtersObserver
|
|
1081
|
-
.pipe(takeUntil(this.destroy$))
|
|
1082
|
-
.subscribe(({ filters, applyFilter, error, message }) => {
|
|
1058
|
+
filtersObserver.pipe(takeUntil(this.destroy$)).subscribe(({ filters, applyFilter, error, message }) => {
|
|
1083
1059
|
this.errorOutput.emit(error);
|
|
1084
1060
|
this.error = error;
|
|
1085
1061
|
this.errorState = message;
|
|
@@ -1099,15 +1075,15 @@ class FormFilterComponent {
|
|
|
1099
1075
|
}
|
|
1100
1076
|
setDependencies(filters) {
|
|
1101
1077
|
const filtersMap = {};
|
|
1102
|
-
filters.forEach(f => {
|
|
1078
|
+
filters.forEach((f) => {
|
|
1103
1079
|
const id = getFilterId(f.domain, f.name);
|
|
1104
1080
|
filtersMap[id] = f;
|
|
1105
1081
|
});
|
|
1106
1082
|
const names = Object.keys(filtersMap);
|
|
1107
|
-
const dependencies = from(names).pipe(map(key => filtersMap[key]), filter(({ dependsOn }) => dependsOn && dependsOn.length > 0), tap(({ dependsOn, domain, filterControl }) => {
|
|
1083
|
+
const dependencies = from(names).pipe(map((key) => filtersMap[key]), filter(({ dependsOn }) => dependsOn && dependsOn.length > 0), tap(({ dependsOn, domain, filterControl }) => {
|
|
1108
1084
|
const invalidFilters = dependsOn
|
|
1109
|
-
.filter(dep => dep.required)
|
|
1110
|
-
.filter(dep => {
|
|
1085
|
+
.filter((dep) => dep.required)
|
|
1086
|
+
.filter((dep) => {
|
|
1111
1087
|
const id = getFilterId(domain, dep.filterName);
|
|
1112
1088
|
const formFilter = filtersMap[id];
|
|
1113
1089
|
if (!formFilter) {
|
|
@@ -1126,8 +1102,8 @@ class FormFilterComponent {
|
|
|
1126
1102
|
}
|
|
1127
1103
|
}), map(({ domain, dependsOn, filterControl }) => ({ domain, dependsOn, filterControl })));
|
|
1128
1104
|
dependencies.subscribe(({ dependsOn, domain, filterControl }) => from(dependsOn)
|
|
1129
|
-
.pipe(filter(dep => dep.required), map(({ filterName }) => getFilterId(domain, filterName)), map(filterId => filtersMap[filterId]), mergeMap(formFilter => from(formFilter.valueChanges || [])), map(val => {
|
|
1130
|
-
const comparation = dependsOn.every(dep => {
|
|
1105
|
+
.pipe(filter((dep) => dep.required), map(({ filterName }) => getFilterId(domain, filterName)), map((filterId) => filtersMap[filterId]), mergeMap((formFilter) => from(formFilter.valueChanges || [])), map((val) => {
|
|
1106
|
+
const comparation = dependsOn.every((dep) => {
|
|
1131
1107
|
const filterId = getFilterId(domain, dep.filterName);
|
|
1132
1108
|
if (this.formFilters[filterId]) {
|
|
1133
1109
|
const type = this.formFilters[filterId].type;
|
|
@@ -1142,15 +1118,15 @@ class FormFilterComponent {
|
|
|
1142
1118
|
});
|
|
1143
1119
|
return !this.IsEmpty(val) && comparation ? 'enable' : 'disable';
|
|
1144
1120
|
}))
|
|
1145
|
-
.subscribe(status => filterControl[status]()));
|
|
1121
|
+
.subscribe((status) => filterControl[status]()));
|
|
1146
1122
|
}
|
|
1147
1123
|
addGeneralField(filter) {
|
|
1148
1124
|
const { name, domain, type } = filter;
|
|
1149
1125
|
const controlName = getFilterId(domain, name);
|
|
1150
1126
|
const fieldControl = createFormControl(filter);
|
|
1151
1127
|
fieldControl.valueChanges
|
|
1152
|
-
.pipe(takeUntil(this.destroy$), map(v => parseFilterValue(v, type)), tap(value => (this.formFilters[controlName].value = value)))
|
|
1153
|
-
.subscribe(val => this.tabs.forEach(tab => {
|
|
1128
|
+
.pipe(takeUntil(this.destroy$), map((v) => parseFilterValue(v, type)), tap((value) => (this.formFilters[controlName].value = value)))
|
|
1129
|
+
.subscribe((val) => this.tabs.forEach((tab) => {
|
|
1154
1130
|
const control = tab.form.controls[name];
|
|
1155
1131
|
if (control && tab.domain === domain) {
|
|
1156
1132
|
control.setValue(val, { emitEvent: false });
|
|
@@ -1171,7 +1147,7 @@ class FormFilterComponent {
|
|
|
1171
1147
|
if (!myContexts.length) {
|
|
1172
1148
|
return true;
|
|
1173
1149
|
}
|
|
1174
|
-
const allContexts = this.contexts.map(data => data.contextId);
|
|
1150
|
+
const allContexts = this.contexts.map((data) => data.contextId);
|
|
1175
1151
|
return equals(myContexts.sort(), allContexts.sort());
|
|
1176
1152
|
}
|
|
1177
1153
|
/**
|
|
@@ -1201,18 +1177,18 @@ class FormFilterComponent {
|
|
|
1201
1177
|
if (scope === Scope.DOMAIN && this.containsAllContexts(contexts)) {
|
|
1202
1178
|
this.addGeneralField(filter);
|
|
1203
1179
|
}
|
|
1204
|
-
contexts.forEach(contextId => {
|
|
1205
|
-
if (
|
|
1180
|
+
contexts.forEach((contextId) => {
|
|
1181
|
+
if (contextId === this.contextId || this.contextId === '') {
|
|
1206
1182
|
const tabId = getTabId(domain, contextId);
|
|
1207
1183
|
const fieldControl = createFormControl(filter);
|
|
1208
1184
|
if (!tabs.has(tabId)) {
|
|
1209
|
-
const { contextLabel } = this.contexts.find(context => context.contextId === contextId);
|
|
1185
|
+
const { contextLabel } = this.contexts.find((context) => context.contextId === contextId);
|
|
1210
1186
|
const tab = new ContextTab({ domain, name: contextLabel });
|
|
1211
1187
|
tabs.set(tabId, tab);
|
|
1212
1188
|
}
|
|
1213
|
-
fieldControl.valueChanges
|
|
1214
|
-
.
|
|
1215
|
-
|
|
1189
|
+
fieldControl.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((val) => {
|
|
1190
|
+
this.updateFilterValue(tabId, name, val, domain, type);
|
|
1191
|
+
});
|
|
1216
1192
|
const contextTab = tabs.get(tabId);
|
|
1217
1193
|
contextTab.addField(field);
|
|
1218
1194
|
contextTab.form.addControl(filter.name, fieldControl);
|
|
@@ -1226,20 +1202,36 @@ class FormFilterComponent {
|
|
|
1226
1202
|
}
|
|
1227
1203
|
updateFilterValue(tabId, filterName, value, domain, type) {
|
|
1228
1204
|
const controlOpts = { emitEvent: false };
|
|
1229
|
-
const fieldValue = parseFilterValue(value, type);
|
|
1230
1205
|
const filterId = getFilterId(domain, filterName);
|
|
1206
|
+
const normalizedValue = this.normalizeSearchValue(value, type, filterId);
|
|
1207
|
+
const fieldValue = parseFilterValue(normalizedValue, type);
|
|
1231
1208
|
const generalFieldControl = this.general.form.controls[filterId];
|
|
1209
|
+
const valueChanged = !equals(value, normalizedValue);
|
|
1232
1210
|
this.tabs.forEach(({ form }, key) => {
|
|
1233
1211
|
const control = form.controls[filterName];
|
|
1234
|
-
if (tabId !== key
|
|
1235
|
-
control.setValue(
|
|
1212
|
+
if (control && (tabId !== key || valueChanged)) {
|
|
1213
|
+
control.setValue(normalizedValue, controlOpts);
|
|
1236
1214
|
}
|
|
1237
1215
|
});
|
|
1238
1216
|
const { childs } = this.formFilters[filterId];
|
|
1239
1217
|
childs && childs.forEach((child) => this.cleanFieldAndSetDefaultValue(child.filter.key));
|
|
1240
|
-
generalFieldControl && generalFieldControl.setValue(
|
|
1218
|
+
generalFieldControl && generalFieldControl.setValue(normalizedValue, controlOpts);
|
|
1241
1219
|
this.formFilters[filterId].value = fieldValue;
|
|
1242
1220
|
}
|
|
1221
|
+
normalizeSearchValue(value, type, filterId) {
|
|
1222
|
+
if (type !== FilterType.SEARCH || !Array.isArray(value)) {
|
|
1223
|
+
return value;
|
|
1224
|
+
}
|
|
1225
|
+
const suggestions = this.lastSuggestions.get(filterId) ?? [];
|
|
1226
|
+
return value.map((item) => this.resolveSearchItem(item, suggestions));
|
|
1227
|
+
}
|
|
1228
|
+
resolveSearchItem(item, suggestions) {
|
|
1229
|
+
if (item === null || item === '' || typeof item === 'object') {
|
|
1230
|
+
return item;
|
|
1231
|
+
}
|
|
1232
|
+
const matched = suggestions.find((suggestion) => suggestion[searchDisplayName] === item || suggestion[searchKeyName] === item);
|
|
1233
|
+
return matched ?? { [searchKeyName]: item, [searchDisplayName]: item };
|
|
1234
|
+
}
|
|
1243
1235
|
cleanFieldAndSetDefaultValue(key) {
|
|
1244
1236
|
const { isMultiple, defaultValue, filterControl, type } = this.formFilters[key];
|
|
1245
1237
|
const finalValue = this.getDefaultValue(defaultValue, isMultiple);
|
|
@@ -1257,7 +1249,7 @@ class FormFilterComponent {
|
|
|
1257
1249
|
}
|
|
1258
1250
|
createChildArray() {
|
|
1259
1251
|
const keys = Object.keys(this.formFilters);
|
|
1260
|
-
keys.forEach(key => {
|
|
1252
|
+
keys.forEach((key) => {
|
|
1261
1253
|
const { dependsOn, domain } = this.formFilters[key];
|
|
1262
1254
|
dependsOn.forEach((field) => {
|
|
1263
1255
|
const filterId = getFilterId(domain, field.filterName);
|
|
@@ -1272,11 +1264,16 @@ class FormFilterComponent {
|
|
|
1272
1264
|
}
|
|
1273
1265
|
createField(filter) {
|
|
1274
1266
|
const { name, label, enumItems, type, mask } = filter;
|
|
1275
|
-
const translatedEnumItems = enumItems &&
|
|
1276
|
-
|
|
1267
|
+
const translatedEnumItems = enumItems &&
|
|
1268
|
+
enumItems.map((item) => ({ label: this.translate.instant(item.label), value: item.value }));
|
|
1269
|
+
const field = {
|
|
1270
|
+
name,
|
|
1271
|
+
label: this.translate.instant(label),
|
|
1272
|
+
placeholder: ''
|
|
1273
|
+
};
|
|
1277
1274
|
const creators = {
|
|
1278
1275
|
[FilterType.STRING]: () => ({ ...field, mask: mask ? () => mask : null, type: 'string' }),
|
|
1279
|
-
[FilterType.MONEY]: () => ({ ...field, type: 'money'
|
|
1276
|
+
[FilterType.MONEY]: () => ({ ...field, type: 'money' }),
|
|
1280
1277
|
[FilterType.BOOLEAN]: () => this.createRadioButton({ ...field }),
|
|
1281
1278
|
[FilterType.DATE]: () => this.createCalendar({ ...field, type: 'date' }),
|
|
1282
1279
|
[FilterType.DATETIME]: () => this.createCalendar({ ...field, type: 'dateTime' }),
|
|
@@ -1285,14 +1282,15 @@ class FormFilterComponent {
|
|
|
1285
1282
|
...field,
|
|
1286
1283
|
type: 'enum',
|
|
1287
1284
|
placeholder: this.translate.instant('platform.filter_service.select'),
|
|
1288
|
-
appendTo: 'body',
|
|
1289
1285
|
options: [...translatedEnumItems]
|
|
1290
1286
|
}),
|
|
1291
1287
|
[FilterType.INTEGER]: () => ({
|
|
1292
1288
|
...field,
|
|
1293
|
-
numberLocaleOptions: this.optionsInteger(),
|
|
1294
1289
|
mask: mask ? () => mask : null,
|
|
1295
|
-
type: '
|
|
1290
|
+
type: 'number',
|
|
1291
|
+
scale: 0,
|
|
1292
|
+
allowNegative: false,
|
|
1293
|
+
autoClear: false
|
|
1296
1294
|
}),
|
|
1297
1295
|
[FilterType.DOUBLE]: () => ({ ...field, type: 'double' }),
|
|
1298
1296
|
[FilterType.SEARCH]: () => this.createAutocompleteField(field, filter)
|
|
@@ -1310,19 +1308,22 @@ class FormFilterComponent {
|
|
|
1310
1308
|
const calendar = {
|
|
1311
1309
|
...config,
|
|
1312
1310
|
type: config.type,
|
|
1313
|
-
name: config.name ?? ''
|
|
1311
|
+
name: config.name ?? ''
|
|
1314
1312
|
};
|
|
1315
|
-
calendar.
|
|
1316
|
-
calendar.
|
|
1313
|
+
calendar.dateFormat = this.calendarOptionsService.getDateFormat();
|
|
1314
|
+
calendar.hourFormat = this.calendarOptionsService.getHourFormat();
|
|
1317
1315
|
return calendar;
|
|
1318
1316
|
}
|
|
1319
1317
|
createAutocompleteField(field, { dependsOn, search, domain, name }) {
|
|
1320
|
-
const suggestionsObservable = new BehaviorSubject([]);
|
|
1321
1318
|
const { queryParam } = getSearchType(search).input;
|
|
1322
1319
|
const { displayFields, keyFields, resultDataJsonPath, displayFieldConcatToken, maxSelectedItems } = getSearchType(search).output;
|
|
1323
1320
|
const filterId = getFilterId(domain, name);
|
|
1324
1321
|
const suggestionsError = (messageError) => {
|
|
1325
|
-
const messageDetail = messageError
|
|
1322
|
+
const messageDetail = messageError
|
|
1323
|
+
? messageError
|
|
1324
|
+
: this.translate.instant(`${TRANSLATE_PREFIX$1}.find_suggestions_error`, {
|
|
1325
|
+
activeFilters: this.totalFiltersActive
|
|
1326
|
+
});
|
|
1326
1327
|
const message = {
|
|
1327
1328
|
severity: 'error',
|
|
1328
1329
|
duration: TOAST_LIFE,
|
|
@@ -1330,7 +1331,7 @@ class FormFilterComponent {
|
|
|
1330
1331
|
};
|
|
1331
1332
|
this.sendMessage(message);
|
|
1332
1333
|
};
|
|
1333
|
-
const onSearch = (val) => {
|
|
1334
|
+
const onSearch = ({ query: val, response }) => {
|
|
1334
1335
|
const params = { [queryParam]: val };
|
|
1335
1336
|
dependsOn && Object.assign(params, this.getDependenciesValues(dependsOn, domain));
|
|
1336
1337
|
const searchUrl = search && search.type === 'ENTITY'
|
|
@@ -1338,15 +1339,13 @@ class FormFilterComponent {
|
|
|
1338
1339
|
: getSearchType(search).input.url;
|
|
1339
1340
|
this.filterService
|
|
1340
1341
|
.searchFieldSuggestions(searchUrl, params, search.type)
|
|
1341
|
-
.pipe(map(
|
|
1342
|
-
.subscribe(result => {
|
|
1343
|
-
|
|
1342
|
+
.pipe(map((httpResponse) => jsonPath(httpResponse, resultDataJsonPath)), map((suggestions) => this.addSuggestionFields(suggestions, displayFields, keyFields, displayFieldConcatToken, filterId)))
|
|
1343
|
+
.subscribe((result) => {
|
|
1344
|
+
response(result);
|
|
1344
1345
|
this.changeDetectorRef.detectChanges();
|
|
1345
1346
|
}, (error) => {
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
messageError = error.error.message;
|
|
1349
|
-
suggestionsError(messageError);
|
|
1347
|
+
response([]);
|
|
1348
|
+
suggestionsError(error?.error?.message);
|
|
1350
1349
|
});
|
|
1351
1350
|
};
|
|
1352
1351
|
return {
|
|
@@ -1354,13 +1353,11 @@ class FormFilterComponent {
|
|
|
1354
1353
|
name: field.name,
|
|
1355
1354
|
type: 'autocomplete',
|
|
1356
1355
|
onSearch,
|
|
1357
|
-
appendTo: 'body',
|
|
1358
|
-
suggestionsObservable,
|
|
1359
1356
|
displayField: searchDisplayName,
|
|
1360
1357
|
dataKey: searchKeyName,
|
|
1361
1358
|
multiple: maxSelectedItems > 1,
|
|
1362
1359
|
size: { lg: 12, md: 12, xl: 12 },
|
|
1363
|
-
emptyMessage: this.translate.instant(`${TRANSLATE_PREFIX$1}.search_empty_message`)
|
|
1360
|
+
emptyMessage: this.translate.instant(`${TRANSLATE_PREFIX$1}.search_empty_message`)
|
|
1364
1361
|
};
|
|
1365
1362
|
}
|
|
1366
1363
|
safeReplaceCommas(input, operator) {
|
|
@@ -1421,9 +1418,9 @@ class FormFilterComponent {
|
|
|
1421
1418
|
getEntitySearchUrl(search, value, dependsOn) {
|
|
1422
1419
|
const { attributes, domainName, entityName, serviceName } = search;
|
|
1423
1420
|
const url = `${domainName}/${serviceName}/entities/${entityName}/?filter=`;
|
|
1424
|
-
const filters = attributes.map(attr => filterOperators[attr.comparator](attr.name, value));
|
|
1421
|
+
const filters = attributes.map((attr) => filterOperators[attr.comparator](attr.name, value));
|
|
1425
1422
|
dependsOn &&
|
|
1426
|
-
dependsOn.forEach(obj => {
|
|
1423
|
+
dependsOn.forEach((obj) => {
|
|
1427
1424
|
const filterId = getFilterId(domainName, obj.filterName);
|
|
1428
1425
|
const fieldValue = this.formFilters[filterId].value[searchKeyName];
|
|
1429
1426
|
filters.push(`${obj.entityAttribute} eq '${fieldValue}'`);
|
|
@@ -1434,18 +1431,22 @@ class FormFilterComponent {
|
|
|
1434
1431
|
}
|
|
1435
1432
|
addSuggestionFields(suggestions, displayFields, keyFields, separator, filterId) {
|
|
1436
1433
|
const addValue = (acc, value, token) => (acc ? `${acc}${token}${value}` : value);
|
|
1437
|
-
const result = suggestions.map(suggestion =>
|
|
1438
|
-
...suggestion
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1434
|
+
const result = suggestions.map((suggestion) => {
|
|
1435
|
+
const { value: _conflictingValue, ...rest } = suggestion;
|
|
1436
|
+
return {
|
|
1437
|
+
...rest,
|
|
1438
|
+
[searchDisplayName]: displayFields.reduce((display, field) => {
|
|
1439
|
+
return addValue(display, this.translate.instant(suggestion[field]), separator);
|
|
1440
|
+
}, ''),
|
|
1441
|
+
[searchKeyName]: keyFields.reduce((key, field) => addValue(key, suggestion[field], ', '), '')
|
|
1442
|
+
};
|
|
1443
|
+
});
|
|
1444
1444
|
this.formFilters[filterId].invalidValue = result.length === 0;
|
|
1445
|
-
|
|
1445
|
+
this.lastSuggestions.set(filterId, result);
|
|
1446
|
+
return result.filter((item) => {
|
|
1446
1447
|
const { value } = this.formFilters[filterId];
|
|
1447
1448
|
if (Array.isArray(value)) {
|
|
1448
|
-
const index = value.findIndex((
|
|
1449
|
+
const index = value.findIndex((selected) => this.isSameSuggestion(selected, item));
|
|
1449
1450
|
if (index === -1) {
|
|
1450
1451
|
return item;
|
|
1451
1452
|
}
|
|
@@ -1455,6 +1456,33 @@ class FormFilterComponent {
|
|
|
1455
1456
|
}
|
|
1456
1457
|
});
|
|
1457
1458
|
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Verifica se um item já selecionado corresponde a uma sugestão retornada pela busca.
|
|
1461
|
+
* A comparação primária é pelo keyValue. Para filtros salvos em formato antigo — onde o
|
|
1462
|
+
* keyValue foi gravado com o displayValue (ou o item é uma string pura) e portanto não casa
|
|
1463
|
+
* com o id atual das sugestões — é feito fallback pela comparação de displayValue.
|
|
1464
|
+
*/
|
|
1465
|
+
isSameSuggestion(selected, suggestion) {
|
|
1466
|
+
const selectedKey = this.getSuggestionKey(selected);
|
|
1467
|
+
const selectedDisplay = this.getSuggestionDisplay(selected);
|
|
1468
|
+
if (selectedKey !== undefined && selectedKey === suggestion[searchKeyName]) {
|
|
1469
|
+
return true;
|
|
1470
|
+
}
|
|
1471
|
+
const isLegacySelected = selectedKey === undefined || selectedKey === selectedDisplay;
|
|
1472
|
+
return isLegacySelected && selectedDisplay !== undefined && selectedDisplay === suggestion[searchDisplayName];
|
|
1473
|
+
}
|
|
1474
|
+
getSuggestionKey(selected) {
|
|
1475
|
+
if (selected === null || selected === undefined) {
|
|
1476
|
+
return undefined;
|
|
1477
|
+
}
|
|
1478
|
+
return typeof selected === 'object' ? selected[searchKeyName] : selected;
|
|
1479
|
+
}
|
|
1480
|
+
getSuggestionDisplay(selected) {
|
|
1481
|
+
if (selected === null || selected === undefined) {
|
|
1482
|
+
return undefined;
|
|
1483
|
+
}
|
|
1484
|
+
return typeof selected === 'object' ? selected[searchDisplayName] : selected;
|
|
1485
|
+
}
|
|
1458
1486
|
getDependenciesValues(dependencies, domain) {
|
|
1459
1487
|
return dependencies.reduce((params, { filterName }) => {
|
|
1460
1488
|
const filterId = getFilterId(domain, filterName);
|
|
@@ -1465,7 +1493,7 @@ class FormFilterComponent {
|
|
|
1465
1493
|
}
|
|
1466
1494
|
else {
|
|
1467
1495
|
if (Array.isArray(value)) {
|
|
1468
|
-
params[filterName] = value.map(arr => arr[searchKeyName]);
|
|
1496
|
+
params[filterName] = value.map((arr) => arr[searchKeyName]);
|
|
1469
1497
|
}
|
|
1470
1498
|
else {
|
|
1471
1499
|
params[filterName] = value ? value[searchKeyName] : [''];
|
|
@@ -1480,20 +1508,14 @@ class FormFilterComponent {
|
|
|
1480
1508
|
* Verifica se o valor informado é falso, em arrays, é verificado cada item
|
|
1481
1509
|
*/
|
|
1482
1510
|
IsEmpty(value) {
|
|
1483
|
-
return Array.isArray(value) ? value.every(data => !data) : !value;
|
|
1484
|
-
}
|
|
1485
|
-
/**
|
|
1486
|
-
* Return format to specify for integer type field
|
|
1487
|
-
*/
|
|
1488
|
-
optionsInteger() {
|
|
1489
|
-
return { currencySymbol: '', decimalSeparator: '', thousandsSeparator: '' };
|
|
1511
|
+
return Array.isArray(value) ? value.every((data) => !data) : !value;
|
|
1490
1512
|
}
|
|
1491
1513
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1492
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: FormFilterComponent, selector: "s-app-form-filter", inputs: { showMessages: "showMessages", contextId: "contextId" }, outputs: { totalFiltersActiveOutput: "totalFiltersActiveOutput", errorOutput: "errorOutput", showDialogOutput: "showDialogOutput", closeModalOutput: "closeModalOutput" }, host: { listeners: { "window:resize": "onResizeWindow($event)" } }, ngImport: i0, template: "@if (error) {\n <div role=\"alert\" aria-live=\"assertive\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"errorState?.status + ' - ' + errorState?.statusText\"\n (primaryAction)=\"errorStateAction()\"\n [primaryActionLabel]=\"translate.instant('platform.filter_service.try')\"\n [description]=\"translate.instant('platform.filter_service.error_state')\"\n ></s-empty-state>\n </div>\n} @else {\n @if (tabs && tabs.size > 1) {\n <
|
|
1514
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: FormFilterComponent, selector: "s-app-form-filter", inputs: { showMessages: "showMessages", contextId: "contextId" }, outputs: { totalFiltersActiveOutput: "totalFiltersActiveOutput", errorOutput: "errorOutput", showDialogOutput: "showDialogOutput", closeModalOutput: "closeModalOutput" }, host: { listeners: { "window:resize": "onResizeWindow($event)" } }, ngImport: i0, template: "@if (error) {\n <div role=\"alert\" aria-live=\"assertive\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"errorState?.status + ' - ' + errorState?.statusText\"\n (primaryAction)=\"errorStateAction()\"\n [primaryActionLabel]=\"translate.instant('platform.filter_service.try')\"\n [description]=\"translate.instant('platform.filter_service.error_state')\"\n ></s-empty-state>\n </div>\n} @else {\n @if (tabs && tabs.size > 1) {\n <s-tabs [(activeTab)]=\"activeIndex\">\n @if (general.configs.length) {\n <s-tab-item [header]=\"general.name\">\n <s-dynamic-form [errorMessages]=\"errorMessages\" [configs]=\"general.configs\" [form]=\"general.form\" />\n </s-tab-item>\n }\n\n @for (tab of tabs | mapValues; track $index) {\n <s-tab-item [header]=\"tab.label\">\n <s-dynamic-form [errorMessages]=\"errorMessages\" [configs]=\"tab.configs\" [form]=\"tab.form\" />\n </s-tab-item>\n }\n </s-tabs>\n }\n\n @if (tabs && tabs.size === 1) {\n @for (tab of tabs | mapValues; track $index) {\n <s-dynamic-form [errorMessages]=\"errorMessages\" [configs]=\"tab.configs\" [form]=\"tab.form\" />\n }\n }\n}\n", dependencies: [{ kind: "component", type: i1$1.TabsComponent, selector: "s-tabs", inputs: ["activeTab", "layoutType"], outputs: ["activeTabChange"] }, { kind: "component", type: i1$1.TabItemComponent, selector: "s-tab-item", inputs: ["icon", "header", "disabled", "value", "destroyOnHide"], outputs: ["valueChange"] }, { kind: "component", type: i2.DynamicFormComponent, selector: "s-dynamic-form", inputs: ["id", "configs", "form", "errorMessages", "focusFirstInvalidOnSubmit"] }, { kind: "component", type: i3.EmptyStateComponent, selector: "s-empty-state", inputs: ["id", "title", "iconClass", "description", "showPrimaryAction", "showSecondaryAction", "primaryActionLabel", "secondaryActionLabel", "primaryModel"], outputs: ["primaryAction", "secondaryAction"] }, { kind: "pipe", type: MapValuesPipe, name: "mapValues" }] });
|
|
1493
1515
|
}
|
|
1494
1516
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormFilterComponent, decorators: [{
|
|
1495
1517
|
type: Component,
|
|
1496
|
-
args: [{ selector: 's-app-form-filter', template: "@if (error) {\n <div role=\"alert\" aria-live=\"assertive\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"errorState?.status + ' - ' + errorState?.statusText\"\n (primaryAction)=\"errorStateAction()\"\n [primaryActionLabel]=\"translate.instant('platform.filter_service.try')\"\n [description]=\"translate.instant('platform.filter_service.error_state')\"\n ></s-empty-state>\n </div>\n} @else {\n @if (tabs && tabs.size > 1) {\n <
|
|
1518
|
+
args: [{ selector: 's-app-form-filter', template: "@if (error) {\n <div role=\"alert\" aria-live=\"assertive\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"errorState?.status + ' - ' + errorState?.statusText\"\n (primaryAction)=\"errorStateAction()\"\n [primaryActionLabel]=\"translate.instant('platform.filter_service.try')\"\n [description]=\"translate.instant('platform.filter_service.error_state')\"\n ></s-empty-state>\n </div>\n} @else {\n @if (tabs && tabs.size > 1) {\n <s-tabs [(activeTab)]=\"activeIndex\">\n @if (general.configs.length) {\n <s-tab-item [header]=\"general.name\">\n <s-dynamic-form [errorMessages]=\"errorMessages\" [configs]=\"general.configs\" [form]=\"general.form\" />\n </s-tab-item>\n }\n\n @for (tab of tabs | mapValues; track $index) {\n <s-tab-item [header]=\"tab.label\">\n <s-dynamic-form [errorMessages]=\"errorMessages\" [configs]=\"tab.configs\" [form]=\"tab.form\" />\n </s-tab-item>\n }\n </s-tabs>\n }\n\n @if (tabs && tabs.size === 1) {\n @for (tab of tabs | mapValues; track $index) {\n <s-dynamic-form [errorMessages]=\"errorMessages\" [configs]=\"tab.configs\" [form]=\"tab.form\" />\n }\n }\n}\n" }]
|
|
1497
1519
|
}], propDecorators: { showMessages: [{
|
|
1498
1520
|
type: Input
|
|
1499
1521
|
}], contextId: [{
|
|
@@ -1526,9 +1548,29 @@ class AdvancedFilterComponent {
|
|
|
1526
1548
|
isMobile = false;
|
|
1527
1549
|
tabViewOrientation = 'left';
|
|
1528
1550
|
totalFiltersActive = 0;
|
|
1529
|
-
showDialog = false;
|
|
1530
1551
|
error = false;
|
|
1531
1552
|
currentTicket = '';
|
|
1553
|
+
_showDialog = false;
|
|
1554
|
+
hideTimeout;
|
|
1555
|
+
/**
|
|
1556
|
+
* Visibilidade do diálogo de filtros. Qualquer transição (pelo usuário ou programática) dispara os
|
|
1557
|
+
* mesmos efeitos que o antigo p-dialog disparava em `onShow`/`onHide`.
|
|
1558
|
+
*/
|
|
1559
|
+
get showDialog() {
|
|
1560
|
+
return this._showDialog;
|
|
1561
|
+
}
|
|
1562
|
+
set showDialog(value) {
|
|
1563
|
+
const wasVisible = this._showDialog;
|
|
1564
|
+
this._showDialog = value;
|
|
1565
|
+
if (!wasVisible && value) {
|
|
1566
|
+
this.onDialogShow();
|
|
1567
|
+
}
|
|
1568
|
+
else if (wasVisible && !value) {
|
|
1569
|
+
// Executa após o fluxo atual (ex.: applyFilters), como o onHide do p-dialog fazia após a animação.
|
|
1570
|
+
clearTimeout(this.hideTimeout);
|
|
1571
|
+
this.hideTimeout = setTimeout(() => this.onDialogHide());
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1532
1574
|
modalComponent;
|
|
1533
1575
|
filterButtonRef;
|
|
1534
1576
|
mobileButtonActions = [
|
|
@@ -1547,6 +1589,7 @@ class AdvancedFilterComponent {
|
|
|
1547
1589
|
}
|
|
1548
1590
|
ngOnDestroy() {
|
|
1549
1591
|
this.subscriptions.forEach((v) => v.unsubscribe());
|
|
1592
|
+
clearTimeout(this.hideTimeout);
|
|
1550
1593
|
}
|
|
1551
1594
|
onResizeWindow(event) {
|
|
1552
1595
|
const { innerWidth } = event.target;
|
|
@@ -1601,6 +1644,9 @@ class AdvancedFilterComponent {
|
|
|
1601
1644
|
toggleDialog() {
|
|
1602
1645
|
this.showDialog = !this.showDialog;
|
|
1603
1646
|
}
|
|
1647
|
+
onDialogShow() {
|
|
1648
|
+
this.focusFirstField();
|
|
1649
|
+
}
|
|
1604
1650
|
onDialogHide() {
|
|
1605
1651
|
this.showDialog = false;
|
|
1606
1652
|
this.close();
|
|
@@ -1620,11 +1666,11 @@ class AdvancedFilterComponent {
|
|
|
1620
1666
|
this.totalFiltersActive = event;
|
|
1621
1667
|
}
|
|
1622
1668
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1623
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: AdvancedFilterComponent, selector: "s-advanced-filter", inputs: { labelButton: "labelButton", onlyContent: "onlyContent", hideButtons: "hideButtons", canOpenFilter: "canOpenFilter", showActiveFiltersCountBadge: "showActiveFiltersCountBadge", filterAndSave: "filterAndSave", contextId: "contextId" }, host: { listeners: { "window:resize": "onResizeWindow($event)" } }, viewQueries: [{ propertyName: "modalComponent", first: true, predicate: FormFilterComponent, descendants: true }, { propertyName: "filterButtonRef", first: true, predicate: ["filterButtonRef"], descendants: true, read: ElementRef }], ngImport: i0, template: "<s-button\n #filterButtonRef\n *ngIf=\"!onlyContent\"\n [id]=\"'filterButton'\"\n [disabled]=\"!canOpenFilter\"\n (clicked)=\"canOpenFilter ? toggleDialog() : ''\"\n iconClass=\"fa fa-filter\"\n priority=\"default\"\n [label]=\"labelButton\"\n [auxiliary]=\"true\"\n [tooltip]=\"appliedFiltersTooltip\"\n>\n <span aria-live=\"polite\">\n <
|
|
1669
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: AdvancedFilterComponent, selector: "s-advanced-filter", inputs: { labelButton: "labelButton", onlyContent: "onlyContent", hideButtons: "hideButtons", canOpenFilter: "canOpenFilter", showActiveFiltersCountBadge: "showActiveFiltersCountBadge", filterAndSave: "filterAndSave", contextId: "contextId" }, host: { listeners: { "window:resize": "onResizeWindow($event)" } }, viewQueries: [{ propertyName: "modalComponent", first: true, predicate: FormFilterComponent, descendants: true }, { propertyName: "filterButtonRef", first: true, predicate: ["filterButtonRef"], descendants: true, read: ElementRef }], ngImport: i0, template: "<s-button\n #filterButtonRef\n *ngIf=\"!onlyContent\"\n [id]=\"'filterButton'\"\n [disabled]=\"!canOpenFilter\"\n (clicked)=\"canOpenFilter ? toggleDialog() : ''\"\n iconClass=\"fa fa-filter\"\n priority=\"default\"\n [label]=\"labelButton\"\n [auxiliary]=\"true\"\n [tooltip]=\"appliedFiltersTooltip\"\n>\n <span aria-live=\"polite\">\n <s-badge\n *ngIf=\"totalFiltersActive && showActiveFiltersCountBadge\"\n class=\"s-filter-count-badge custom-badge\"\n color=\"primary\"\n [text]=\"totalFiltersActive.toString()\"\n ></s-badge>\n <span class=\"sr-only\" *ngIf=\"totalFiltersActive && showActiveFiltersCountBadge\">\n {{ totalFiltersActive }} {{ 'platform.filter_service.active_filters' | translate }}\n </span>\n </span>\n</s-button>\n\n<section *ngIf=\"onlyContent\">\n <div class=\"only-content-wrapper\">\n <div class=\"header\">\n <h3 id=\"filter-heading\">{{ 'platform.filter_service.filters' | translate }}</h3>\n <button\n type=\"button\"\n (click)=\"close()\"\n class=\"close_btn\"\n [attr.aria-label]=\"'platform.filter_service.aria_close_filters' | translate\"\n >\n <span class=\"fa fa-times\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <div class=\"app-form-filter\">\n <s-app-form-filter\n [showMessages]=\"false\"\n (totalFiltersActiveOutput)=\"updateTotalFiltersActive($event)\"\n (closeModalOutput)=\"close()\"\n [contextId]=\"contextId\"\n ></s-app-form-filter>\n </div>\n <div class=\"filter-footer\" *ngIf=\"!error\">\n <s-button\n priority=\"link\"\n [label]=\"translate.instant('platform.filter_service.cancel')\"\n (clicked)=\"close()\"\n ></s-button>\n <s-button\n *ngIf=\"isMobile\"\n priority=\"default\"\n [label]=\"translate.instant('platform.filter_service.actions')\"\n [auxiliary]=\"true\"\n [menuOptions]=\"mobileButtonActions\"\n ></s-button>\n <ng-container *ngIf=\"!isMobile\">\n <s-button\n priority=\"secondary\"\n [label]=\"translate.instant('platform.filter_service.clear')\"\n (clicked)=\"clearFilters()\"\n ></s-button>\n <s-button\n priority=\"secondary\"\n [label]=\"translate.instant('platform.filter_service.save')\"\n (clicked)=\"saveFilters()\"\n ></s-button>\n </ng-container>\n <s-button\n type=\"submit\"\n priority=\"primary\"\n [label]=\"translate.instant('platform.filter_service.filter')\"\n (clicked)=\"onApplyFilters()\"\n ></s-button>\n </div>\n </div>\n</section>\n\n<s-dialog\n *ngIf=\"!onlyContent\"\n size=\"lg\"\n contentClassName=\"filter-dialog\"\n [header]=\"'platform.filter_service.filters' | translate\"\n [closeAriaLabel]=\"'platform.filter_service.aria_close_dialog' | translate\"\n [escapeOnEsc]=\"true\"\n [destroyClickOutside]=\"false\"\n [blockScroll]=\"true\"\n [(visible)]=\"showDialog\"\n>\n\n <s-app-form-filter\n [showMessages]=\"true\"\n (errorOutput)=\"onError($event)\"\n (totalFiltersActiveOutput)=\"updateTotalFiltersActive($event)\"\n [contextId]=\"contextId\"\n ></s-app-form-filter>\n\n <ng-template sTemplate=\"footer\">\n <div class=\"filter-dialog-footer\" *ngIf=\"!error && !hideButtons\">\n <s-button\n type=\"submit\"\n priority=\"primary\"\n [label]=\"translate.instant('platform.filter_service.filter')\"\n (clicked)=\"applyFilters()\"\n ></s-button>\n <ng-container *ngIf=\"!isMobile\">\n <s-button\n priority=\"secondary\"\n [label]=\"translate.instant('platform.filter_service.save')\"\n (clicked)=\"saveFilters()\"\n ></s-button>\n <s-button\n priority=\"secondary\"\n [label]=\"translate.instant('platform.filter_service.clear')\"\n (clicked)=\"clearFilters()\"\n ></s-button>\n </ng-container>\n <s-button\n *ngIf=\"isMobile\"\n priority=\"default\"\n [label]=\"translate.instant('platform.filter_service.actions')\"\n [auxiliary]=\"true\"\n [menuOptions]=\"mobileButtonActions\"\n ></s-button>\n <s-button\n priority=\"link\"\n [label]=\"translate.instant('platform.filter_service.cancel')\"\n (clicked)=\"toggleDialog(); close()\"\n ></s-button>\n </div>\n </ng-template>\n</s-dialog>\n\n", styles: [".custom-badge{position:absolute!important;right:-4px;top:-10px;height:20px;vertical-align:middle;display:table;min-width:22px}.filter-button{position:relative;border:solid 1px black;border-radius:1.5rem;background:transparent;padding:.5rem 1rem;cursor:pointer}.filter-footer{text-align:end;border-top:1px solid #e5eaea;padding:13px}.app-form-filter{height:335px;max-height:335px;overflow:auto}.only-content-wrapper{background-color:#fff}.close_btn{align-content:center;justify-self:right;margin-left:auto;background:none;border:none;padding:0;font:inherit;color:inherit}.close_btn:hover{cursor:pointer}.header{text-transform:uppercase;display:flex;width:100%;border-bottom:1px solid #e5eaea;padding:15px;margin-left:0}@media (min-width: 641px) and (max-width: 1024px){.filter-dialog{width:75vw}}@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: portrait){.filter-dialog{width:75vw}}@media (min-width: 320px) and (max-width: 640px){.filter-dialog{width:95vw;left:0;top:0;opacity:1;margin:auto;height:93vh}}@media (min-width: 320px) and (max-width: 640px) and (max-width: 360px){.filter-dialog button{padding:0!important}}.filter-dialog-footer{display:flex;flex-direction:row-reverse;flex-wrap:wrap;gap:10px}.filter-dialog-footer s-button+s-button{margin-left:0!important}\n"], dependencies: [{ kind: "component", type: i1$2.BadgeComponent, selector: "s-badge", inputs: ["type", "color", "title", "text", "selectable", "iconClass", "ariaLabel", "iconPosition", "infoSign", "enableTruncateText"], outputs: ["selected"] }, { kind: "component", type: i2$1.DialogComponent, selector: "s-dialog", inputs: ["header", "visible", "size", "contentClassName", "escapeOnEsc", "destroyClickOutside", "closeAriaLabel", "ariaLabel", "dialogRole", "ariaDescribedBy", "blockScroll"], outputs: ["visibleChange"] }, { kind: "directive", type: i3$1.TemplateDirective, selector: "[sTemplate]", inputs: ["sTemplate"] }, { kind: "component", type: i4.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "tooltipShowDelay", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor", "menuAriaLabel", "ariaLabel"], outputs: ["clicked", "tieredMenuOpened", "tieredMenuClosed"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormFilterComponent, selector: "s-app-form-filter", inputs: ["showMessages", "contextId"], outputs: ["totalFiltersActiveOutput", "errorOutput", "showDialogOutput", "closeModalOutput"] }, { kind: "pipe", type: TranslatePipe$1, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1624
1670
|
}
|
|
1625
1671
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterComponent, decorators: [{
|
|
1626
1672
|
type: Component,
|
|
1627
|
-
args: [{ selector: 's-advanced-filter', encapsulation: ViewEncapsulation.None, template: "<s-button\n #filterButtonRef\n *ngIf=\"!onlyContent\"\n [id]=\"'filterButton'\"\n [disabled]=\"!canOpenFilter\"\n (clicked)=\"canOpenFilter ? toggleDialog() : ''\"\n iconClass=\"fa fa-filter\"\n priority=\"default\"\n [label]=\"labelButton\"\n [auxiliary]=\"true\"\n [tooltip]=\"appliedFiltersTooltip\"\n>\n <span aria-live=\"polite\">\n <
|
|
1673
|
+
args: [{ selector: 's-advanced-filter', encapsulation: ViewEncapsulation.None, template: "<s-button\n #filterButtonRef\n *ngIf=\"!onlyContent\"\n [id]=\"'filterButton'\"\n [disabled]=\"!canOpenFilter\"\n (clicked)=\"canOpenFilter ? toggleDialog() : ''\"\n iconClass=\"fa fa-filter\"\n priority=\"default\"\n [label]=\"labelButton\"\n [auxiliary]=\"true\"\n [tooltip]=\"appliedFiltersTooltip\"\n>\n <span aria-live=\"polite\">\n <s-badge\n *ngIf=\"totalFiltersActive && showActiveFiltersCountBadge\"\n class=\"s-filter-count-badge custom-badge\"\n color=\"primary\"\n [text]=\"totalFiltersActive.toString()\"\n ></s-badge>\n <span class=\"sr-only\" *ngIf=\"totalFiltersActive && showActiveFiltersCountBadge\">\n {{ totalFiltersActive }} {{ 'platform.filter_service.active_filters' | translate }}\n </span>\n </span>\n</s-button>\n\n<section *ngIf=\"onlyContent\">\n <div class=\"only-content-wrapper\">\n <div class=\"header\">\n <h3 id=\"filter-heading\">{{ 'platform.filter_service.filters' | translate }}</h3>\n <button\n type=\"button\"\n (click)=\"close()\"\n class=\"close_btn\"\n [attr.aria-label]=\"'platform.filter_service.aria_close_filters' | translate\"\n >\n <span class=\"fa fa-times\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <div class=\"app-form-filter\">\n <s-app-form-filter\n [showMessages]=\"false\"\n (totalFiltersActiveOutput)=\"updateTotalFiltersActive($event)\"\n (closeModalOutput)=\"close()\"\n [contextId]=\"contextId\"\n ></s-app-form-filter>\n </div>\n <div class=\"filter-footer\" *ngIf=\"!error\">\n <s-button\n priority=\"link\"\n [label]=\"translate.instant('platform.filter_service.cancel')\"\n (clicked)=\"close()\"\n ></s-button>\n <s-button\n *ngIf=\"isMobile\"\n priority=\"default\"\n [label]=\"translate.instant('platform.filter_service.actions')\"\n [auxiliary]=\"true\"\n [menuOptions]=\"mobileButtonActions\"\n ></s-button>\n <ng-container *ngIf=\"!isMobile\">\n <s-button\n priority=\"secondary\"\n [label]=\"translate.instant('platform.filter_service.clear')\"\n (clicked)=\"clearFilters()\"\n ></s-button>\n <s-button\n priority=\"secondary\"\n [label]=\"translate.instant('platform.filter_service.save')\"\n (clicked)=\"saveFilters()\"\n ></s-button>\n </ng-container>\n <s-button\n type=\"submit\"\n priority=\"primary\"\n [label]=\"translate.instant('platform.filter_service.filter')\"\n (clicked)=\"onApplyFilters()\"\n ></s-button>\n </div>\n </div>\n</section>\n\n<s-dialog\n *ngIf=\"!onlyContent\"\n size=\"lg\"\n contentClassName=\"filter-dialog\"\n [header]=\"'platform.filter_service.filters' | translate\"\n [closeAriaLabel]=\"'platform.filter_service.aria_close_dialog' | translate\"\n [escapeOnEsc]=\"true\"\n [destroyClickOutside]=\"false\"\n [blockScroll]=\"true\"\n [(visible)]=\"showDialog\"\n>\n\n <s-app-form-filter\n [showMessages]=\"true\"\n (errorOutput)=\"onError($event)\"\n (totalFiltersActiveOutput)=\"updateTotalFiltersActive($event)\"\n [contextId]=\"contextId\"\n ></s-app-form-filter>\n\n <ng-template sTemplate=\"footer\">\n <div class=\"filter-dialog-footer\" *ngIf=\"!error && !hideButtons\">\n <s-button\n type=\"submit\"\n priority=\"primary\"\n [label]=\"translate.instant('platform.filter_service.filter')\"\n (clicked)=\"applyFilters()\"\n ></s-button>\n <ng-container *ngIf=\"!isMobile\">\n <s-button\n priority=\"secondary\"\n [label]=\"translate.instant('platform.filter_service.save')\"\n (clicked)=\"saveFilters()\"\n ></s-button>\n <s-button\n priority=\"secondary\"\n [label]=\"translate.instant('platform.filter_service.clear')\"\n (clicked)=\"clearFilters()\"\n ></s-button>\n </ng-container>\n <s-button\n *ngIf=\"isMobile\"\n priority=\"default\"\n [label]=\"translate.instant('platform.filter_service.actions')\"\n [auxiliary]=\"true\"\n [menuOptions]=\"mobileButtonActions\"\n ></s-button>\n <s-button\n priority=\"link\"\n [label]=\"translate.instant('platform.filter_service.cancel')\"\n (clicked)=\"toggleDialog(); close()\"\n ></s-button>\n </div>\n </ng-template>\n</s-dialog>\n\n", styles: [".custom-badge{position:absolute!important;right:-4px;top:-10px;height:20px;vertical-align:middle;display:table;min-width:22px}.filter-button{position:relative;border:solid 1px black;border-radius:1.5rem;background:transparent;padding:.5rem 1rem;cursor:pointer}.filter-footer{text-align:end;border-top:1px solid #e5eaea;padding:13px}.app-form-filter{height:335px;max-height:335px;overflow:auto}.only-content-wrapper{background-color:#fff}.close_btn{align-content:center;justify-self:right;margin-left:auto;background:none;border:none;padding:0;font:inherit;color:inherit}.close_btn:hover{cursor:pointer}.header{text-transform:uppercase;display:flex;width:100%;border-bottom:1px solid #e5eaea;padding:15px;margin-left:0}@media (min-width: 641px) and (max-width: 1024px){.filter-dialog{width:75vw}}@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: portrait){.filter-dialog{width:75vw}}@media (min-width: 320px) and (max-width: 640px){.filter-dialog{width:95vw;left:0;top:0;opacity:1;margin:auto;height:93vh}}@media (min-width: 320px) and (max-width: 640px) and (max-width: 360px){.filter-dialog button{padding:0!important}}.filter-dialog-footer{display:flex;flex-direction:row-reverse;flex-wrap:wrap;gap:10px}.filter-dialog-footer s-button+s-button{margin-left:0!important}\n"] }]
|
|
1628
1674
|
}], propDecorators: { labelButton: [{
|
|
1629
1675
|
type: Input
|
|
1630
1676
|
}], onlyContent: [{
|
|
@@ -1654,48 +1700,47 @@ class AppRoutingModule {
|
|
|
1654
1700
|
}
|
|
1655
1701
|
class AdvancedFilterModule {
|
|
1656
1702
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1657
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterModule, declarations: [AdvancedFilterComponent, FormFilterComponent, MapValuesPipe, TranslatePipe$1], imports: [
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1703
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterModule, declarations: [AdvancedFilterComponent, FormFilterComponent, MapValuesPipe, TranslatePipe$1], imports: [BadgeComponent,
|
|
1704
|
+
DialogComponent,
|
|
1705
|
+
TemplateDirective,
|
|
1706
|
+
ButtonComponent,
|
|
1707
|
+
TabsComponent,
|
|
1708
|
+
TabItemComponent,
|
|
1661
1709
|
CommonModule,
|
|
1662
1710
|
FormsModule,
|
|
1663
1711
|
ReactiveFormsModule,
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
TabViewModule,
|
|
1712
|
+
DynamicFormComponent,
|
|
1713
|
+
EmptyStateComponent, TranslationsModule], exports: [AdvancedFilterComponent, FormFilterComponent] });
|
|
1714
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterModule, providers: [AdvancedFilterService, LocaleService, TranslateService, CalendarOptionsService], imports: [BadgeComponent,
|
|
1715
|
+
DialogComponent,
|
|
1716
|
+
ButtonComponent,
|
|
1717
|
+
TabsComponent,
|
|
1718
|
+
TabItemComponent,
|
|
1672
1719
|
CommonModule,
|
|
1673
1720
|
FormsModule,
|
|
1674
1721
|
ReactiveFormsModule,
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
EmptyStateModule,
|
|
1678
|
-
TooltipModule,
|
|
1722
|
+
DynamicFormComponent,
|
|
1723
|
+
EmptyStateComponent,
|
|
1679
1724
|
TranslationsModule.forChild([{ domain: 'platform', service: 'filter_service', fallback: fallback$1 }])] });
|
|
1680
1725
|
}
|
|
1681
1726
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AdvancedFilterModule, decorators: [{
|
|
1682
1727
|
type: NgModule,
|
|
1683
1728
|
args: [{
|
|
1684
1729
|
imports: [
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1730
|
+
BadgeComponent,
|
|
1731
|
+
DialogComponent,
|
|
1732
|
+
TemplateDirective,
|
|
1733
|
+
ButtonComponent,
|
|
1734
|
+
TabsComponent,
|
|
1735
|
+
TabItemComponent,
|
|
1689
1736
|
CommonModule,
|
|
1690
1737
|
FormsModule,
|
|
1691
1738
|
ReactiveFormsModule,
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
EmptyStateModule,
|
|
1695
|
-
TooltipModule,
|
|
1739
|
+
DynamicFormComponent,
|
|
1740
|
+
EmptyStateComponent,
|
|
1696
1741
|
TranslationsModule.forChild([{ domain: 'platform', service: 'filter_service', fallback: fallback$1 }]),
|
|
1697
1742
|
],
|
|
1698
|
-
providers: [AdvancedFilterService, LocaleService,
|
|
1743
|
+
providers: [AdvancedFilterService, LocaleService, TranslateService, CalendarOptionsService],
|
|
1699
1744
|
declarations: [AdvancedFilterComponent, FormFilterComponent, MapValuesPipe, TranslatePipe$1],
|
|
1700
1745
|
exports: [AdvancedFilterComponent, FormFilterComponent]
|
|
1701
1746
|
}]
|
|
@@ -2472,11 +2517,11 @@ class SpotlightComponent {
|
|
|
2472
2517
|
});
|
|
2473
2518
|
}
|
|
2474
2519
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpotlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2475
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: SpotlightComponent, selector: "s-spotlight", inputs: { visible: "visible", menuId: "menuId", fade: "fade", altText: "altText" }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<dialog class=\"s-spotlight-overlay\" id=\"ol\" *ngIf=\"canAppear && visible\"\n aria-modal=\"true\" aria-labelledby=\"spotlight-title\"\n cdkTrapFocus (keydown.escape)=\"close()\">\n <div class=\"s-spotlight\" id=\"sl\" [ngClass]=\"{'s-effect-fadein': fade}\">\n <div class=\"s-spotlight-header\">\n <span class=\"s-spotlight-title\" id=\"spotlight-title\">{{header.toUpperCase()}}</span>\n <button\n type=\"button\"\n class=\"s-spotlight-close\"\n aria-label=\"Fechar spotlight\"\n (click)=\"close()\">\n <span class=\"fa fa-times\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <div class=\"s-img\">\n <img src=\"{{imgUrl}}\" [alt]=\"altText || ''\" width=\"800\" height=\"450\">\n </div>\n <div class=\"s-spotlight-footer\">\n <div class=\"s-spotlight-footer-left\">\n <button\n
|
|
2520
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: SpotlightComponent, selector: "s-spotlight", inputs: { visible: "visible", menuId: "menuId", fade: "fade", altText: "altText" }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<dialog class=\"s-spotlight-overlay\" id=\"ol\" *ngIf=\"canAppear && visible\"\n aria-modal=\"true\" aria-labelledby=\"spotlight-title\"\n cdkTrapFocus (keydown.escape)=\"close()\">\n <div class=\"s-spotlight\" id=\"sl\" [ngClass]=\"{'s-effect-fadein': fade}\">\n <div class=\"s-spotlight-header\">\n <span class=\"s-spotlight-title\" id=\"spotlight-title\">{{header.toUpperCase()}}</span>\n <button\n type=\"button\"\n class=\"s-spotlight-close\"\n aria-label=\"Fechar spotlight\"\n (click)=\"close()\">\n <span class=\"fa fa-times\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <div class=\"s-img\">\n <img src=\"{{imgUrl}}\" [alt]=\"altText || ''\" width=\"800\" height=\"450\">\n </div>\n <div class=\"s-spotlight-footer\">\n <div class=\"s-spotlight-footer-left\">\n <s-button\n type=\"submit\"\n id=\"decline-button\"\n priority=\"link\"\n [label]=\"'platform.spotlight.no_interest' | translate\"\n (clicked)=\"onTertiary()\">\n </s-button>\n </div>\n <div class=\"s-spotlight-footer-right\">\n <s-button\n type=\"submit\"\n id=\"remember-button\"\n priority=\"secondary\"\n [label]=\"'platform.spotlight.remember_late' | translate\"\n (clicked)=\"onSecondary()\">\n </s-button>\n <s-button\n type=\"submit\"\n id=\"submit-button\"\n priority=\"primary\"\n [label]=\"primaryButtonLabel\"\n [tooltip]=\"primaryButtonTooltip\"\n tooltipPosition=\"top\"\n (clicked)=\"onPrimary()\">\n </s-button>\n </div>\n </div>\n </div>\n</dialog>", styles: [".s-spotlight-overlay{display:flex;position:fixed;z-index:10;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:#0006}.s-spotlight{border-radius:3px;background:#fff;margin:auto;overflow:hidden;animation:move .15s forwards}.s-spotlight-header,.s-spotlight-footer{display:flex;padding:15px}.s-spotlight-header{align-items:center;justify-content:space-between}.s-spotlight-footer,.s-spotlight-footer-right,.s-spotlight-footer-left{display:flex}.s-spotlight-footer-right{flex:2;justify-content:flex-end}.s-spotlight-footer-left{flex:1;justify-content:flex-start}.s-spotlight-title{font-family:Open Sans,sans-serif;font-size:16px;font-weight:400;color:#333}.s-spotlight-close{display:block;margin-left:15px;color:#000;background:none;border:none;padding:0;font:inherit;cursor:pointer}.s-img{width:100%;display:flex;align-items:center;justify-content:center}.s-img img{width:100%}.s-effect-fadein{animation:fade .15s forwards}@keyframes fade{0%{opacity:0}to{opacity:1}}@media (max-width: 595px){.s-spotlight-footer,.s-spotlight-footer-right,.s-spotlight-footer-left{align-items:center;flex-direction:column-reverse}.s-spotlight-footer s-button{margin:0 0 15px!important;width:100%!important}.s-spotlight-footer s-button ::ng-deep button{width:100%!important}}@media (min-width: 576px){.s-spotlight{width:100%}}@media (min-width: 768px){.s-spotlight{width:720px}.s-spotlight-footer,.s-spotlight-footer-right,.s-spotlight-footer-left{flex-direction:row}}@media (min-width: 992px){.s-spotlight{width:960px}}@media (min-width: 1200px){.s-spotlight{width:50%}}\n"], dependencies: [{ kind: "directive", type: i1$3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: i4.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "tooltipShowDelay", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor", "menuAriaLabel", "ariaLabel"], outputs: ["clicked", "tieredMenuOpened", "tieredMenuClosed"] }, { kind: "directive", type: i3$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
2476
2521
|
}
|
|
2477
2522
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpotlightComponent, decorators: [{
|
|
2478
2523
|
type: Component,
|
|
2479
|
-
args: [{ selector: 's-spotlight', template: "<dialog class=\"s-spotlight-overlay\" id=\"ol\" *ngIf=\"canAppear && visible\"\n aria-modal=\"true\" aria-labelledby=\"spotlight-title\"\n cdkTrapFocus (keydown.escape)=\"close()\">\n <div class=\"s-spotlight\" id=\"sl\" [ngClass]=\"{'s-effect-fadein': fade}\">\n <div class=\"s-spotlight-header\">\n <span class=\"s-spotlight-title\" id=\"spotlight-title\">{{header.toUpperCase()}}</span>\n <button\n type=\"button\"\n class=\"s-spotlight-close\"\n aria-label=\"Fechar spotlight\"\n (click)=\"close()\">\n <span class=\"fa fa-times\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <div class=\"s-img\">\n <img src=\"{{imgUrl}}\" [alt]=\"altText || ''\" width=\"800\" height=\"450\">\n </div>\n <div class=\"s-spotlight-footer\">\n <div class=\"s-spotlight-footer-left\">\n <button\n
|
|
2524
|
+
args: [{ selector: 's-spotlight', template: "<dialog class=\"s-spotlight-overlay\" id=\"ol\" *ngIf=\"canAppear && visible\"\n aria-modal=\"true\" aria-labelledby=\"spotlight-title\"\n cdkTrapFocus (keydown.escape)=\"close()\">\n <div class=\"s-spotlight\" id=\"sl\" [ngClass]=\"{'s-effect-fadein': fade}\">\n <div class=\"s-spotlight-header\">\n <span class=\"s-spotlight-title\" id=\"spotlight-title\">{{header.toUpperCase()}}</span>\n <button\n type=\"button\"\n class=\"s-spotlight-close\"\n aria-label=\"Fechar spotlight\"\n (click)=\"close()\">\n <span class=\"fa fa-times\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <div class=\"s-img\">\n <img src=\"{{imgUrl}}\" [alt]=\"altText || ''\" width=\"800\" height=\"450\">\n </div>\n <div class=\"s-spotlight-footer\">\n <div class=\"s-spotlight-footer-left\">\n <s-button\n type=\"submit\"\n id=\"decline-button\"\n priority=\"link\"\n [label]=\"'platform.spotlight.no_interest' | translate\"\n (clicked)=\"onTertiary()\">\n </s-button>\n </div>\n <div class=\"s-spotlight-footer-right\">\n <s-button\n type=\"submit\"\n id=\"remember-button\"\n priority=\"secondary\"\n [label]=\"'platform.spotlight.remember_late' | translate\"\n (clicked)=\"onSecondary()\">\n </s-button>\n <s-button\n type=\"submit\"\n id=\"submit-button\"\n priority=\"primary\"\n [label]=\"primaryButtonLabel\"\n [tooltip]=\"primaryButtonTooltip\"\n tooltipPosition=\"top\"\n (clicked)=\"onPrimary()\">\n </s-button>\n </div>\n </div>\n </div>\n</dialog>", styles: [".s-spotlight-overlay{display:flex;position:fixed;z-index:10;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:#0006}.s-spotlight{border-radius:3px;background:#fff;margin:auto;overflow:hidden;animation:move .15s forwards}.s-spotlight-header,.s-spotlight-footer{display:flex;padding:15px}.s-spotlight-header{align-items:center;justify-content:space-between}.s-spotlight-footer,.s-spotlight-footer-right,.s-spotlight-footer-left{display:flex}.s-spotlight-footer-right{flex:2;justify-content:flex-end}.s-spotlight-footer-left{flex:1;justify-content:flex-start}.s-spotlight-title{font-family:Open Sans,sans-serif;font-size:16px;font-weight:400;color:#333}.s-spotlight-close{display:block;margin-left:15px;color:#000;background:none;border:none;padding:0;font:inherit;cursor:pointer}.s-img{width:100%;display:flex;align-items:center;justify-content:center}.s-img img{width:100%}.s-effect-fadein{animation:fade .15s forwards}@keyframes fade{0%{opacity:0}to{opacity:1}}@media (max-width: 595px){.s-spotlight-footer,.s-spotlight-footer-right,.s-spotlight-footer-left{align-items:center;flex-direction:column-reverse}.s-spotlight-footer s-button{margin:0 0 15px!important;width:100%!important}.s-spotlight-footer s-button ::ng-deep button{width:100%!important}}@media (min-width: 576px){.s-spotlight{width:100%}}@media (min-width: 768px){.s-spotlight{width:720px}.s-spotlight-footer,.s-spotlight-footer-right,.s-spotlight-footer-left{flex-direction:row}}@media (min-width: 992px){.s-spotlight{width:960px}}@media (min-width: 1200px){.s-spotlight{width:50%}}\n"] }]
|
|
2480
2525
|
}], propDecorators: { visible: [{
|
|
2481
2526
|
type: Input
|
|
2482
2527
|
}], menuId: [{
|
|
@@ -2498,17 +2543,14 @@ class SpotlightModule {
|
|
|
2498
2543
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpotlightModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2499
2544
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: SpotlightModule, declarations: [SpotlightComponent,
|
|
2500
2545
|
TranslatePipe], imports: [A11yModule,
|
|
2501
|
-
|
|
2502
|
-
TooltipModule,
|
|
2546
|
+
ButtonComponent,
|
|
2503
2547
|
CommonModule,
|
|
2504
2548
|
HttpInterceptorModule, TranslationsModule], exports: [SpotlightComponent] });
|
|
2505
2549
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpotlightModule, providers: [
|
|
2506
2550
|
SpotlightService,
|
|
2507
|
-
DatePipe
|
|
2508
|
-
CookieService
|
|
2551
|
+
DatePipe
|
|
2509
2552
|
], imports: [A11yModule,
|
|
2510
|
-
|
|
2511
|
-
TooltipModule,
|
|
2553
|
+
ButtonComponent,
|
|
2512
2554
|
CommonModule,
|
|
2513
2555
|
HttpInterceptorModule,
|
|
2514
2556
|
TranslationsModule.forChild([{ domain: 'platform', service: 'spotlight', fallback }])] });
|
|
@@ -2518,16 +2560,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2518
2560
|
args: [{
|
|
2519
2561
|
imports: [
|
|
2520
2562
|
A11yModule,
|
|
2521
|
-
|
|
2522
|
-
TooltipModule,
|
|
2563
|
+
ButtonComponent,
|
|
2523
2564
|
CommonModule,
|
|
2524
2565
|
HttpInterceptorModule,
|
|
2525
2566
|
TranslationsModule.forChild([{ domain: 'platform', service: 'spotlight', fallback }]),
|
|
2526
2567
|
],
|
|
2527
2568
|
providers: [
|
|
2528
2569
|
SpotlightService,
|
|
2529
|
-
DatePipe
|
|
2530
|
-
CookieService
|
|
2570
|
+
DatePipe
|
|
2531
2571
|
],
|
|
2532
2572
|
declarations: [
|
|
2533
2573
|
SpotlightComponent,
|