dolfo-angular 1.224.0 → 1.227.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/dolfo-angular.mjs +76 -120
- package/fesm2022/dolfo-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/components/input.scss +1 -1
- package/types/dolfo-angular.d.ts +148 -156
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, ChangeDetectionStrategy, Component, InjectionToken, Service, inject, signal, Pipe, EventEmitter, Output, ViewChild, forwardRef, booleanAttribute, Injector,
|
|
2
|
+
import { Directive, Input, ChangeDetectionStrategy, Component, InjectionToken, Service, inject, signal, ElementRef, Pipe, EventEmitter, Output, ViewChild, forwardRef, ChangeDetectorRef, booleanAttribute, Injector, ViewChildren, TemplateRef, ContentChild, EnvironmentInjector, createComponent, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/forms';
|
|
4
4
|
import { ControlContainer, FormControl, Validators, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroupDirective, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { BehaviorSubject, map, tap, distinctUntilChanged, filter, delay, mergeMap, of, catchError, throwError, zip, fromEvent, from, concatAll, race } from 'rxjs';
|
|
6
6
|
import * as i1 from '@angular/common';
|
|
7
7
|
import { formatDate, DecimalPipe, APP_BASE_HREF, CommonModule } from '@angular/common';
|
|
8
8
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
|
9
|
-
import * as i2 from '@angular/router';
|
|
10
9
|
import { Router } from '@angular/router';
|
|
11
|
-
import * as i1$2 from '@angular/platform-browser';
|
|
12
10
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
13
11
|
|
|
14
12
|
class Subscriptable {
|
|
@@ -269,7 +267,7 @@ class DialogService {
|
|
|
269
267
|
this.getLastWaiter()?.complete();
|
|
270
268
|
this.waiters = this.waiters.slice(0, this.waiters.length - 1);
|
|
271
269
|
};
|
|
272
|
-
action = (action) => this.getLastWaiter()
|
|
270
|
+
action = (action) => this.getLastWaiter()?.next(action);
|
|
273
271
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
274
272
|
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.5", ngImport: i0, type: DialogService });
|
|
275
273
|
}
|
|
@@ -411,20 +409,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
411
409
|
}] });
|
|
412
410
|
|
|
413
411
|
class TooltipDirective extends Subscriptable {
|
|
414
|
-
ts;
|
|
415
412
|
content;
|
|
416
413
|
direction = "top";
|
|
417
|
-
|
|
414
|
+
el = inject(ElementRef);
|
|
415
|
+
ts = inject(TooltipService);
|
|
416
|
+
constructor() {
|
|
418
417
|
super();
|
|
419
|
-
this.ts
|
|
420
|
-
this.addSubscription(fromEvent(el.nativeElement, "
|
|
421
|
-
this.addSubscription(fromEvent(el.nativeElement, "mouseenter").pipe(filter(() => !!this.content)).subscribe(() => this.ts.showTooltip({
|
|
418
|
+
this.addSubscription(fromEvent(this.el.nativeElement, "mousedown").pipe(filter(() => !!this.ts.getTooltip())).subscribe(() => this.ts.hide()));
|
|
419
|
+
this.addSubscription(fromEvent(this.el.nativeElement, "mouseenter").pipe(filter(() => !!this.content)).subscribe(() => this.ts.showTooltip({
|
|
422
420
|
content: this.content,
|
|
423
|
-
elementRef: el,
|
|
421
|
+
elementRef: this.el,
|
|
424
422
|
direction: this.direction
|
|
425
423
|
})));
|
|
426
424
|
}
|
|
427
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, deps: [
|
|
425
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
428
426
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: TooltipDirective, isStandalone: false, selector: "[dolfoTooltip]", inputs: { content: ["dolfoTooltip", "content"], direction: "direction" }, usesInheritance: true, ngImport: i0 });
|
|
429
427
|
}
|
|
430
428
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
@@ -433,7 +431,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
433
431
|
selector: "[dolfoTooltip]",
|
|
434
432
|
standalone: false
|
|
435
433
|
}]
|
|
436
|
-
}], ctorParameters: () => [
|
|
434
|
+
}], ctorParameters: () => [], propDecorators: { content: [{
|
|
437
435
|
type: Input,
|
|
438
436
|
args: [{ required: true, alias: "dolfoTooltip" }]
|
|
439
437
|
}], direction: [{
|
|
@@ -441,12 +439,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
441
439
|
}] } });
|
|
442
440
|
|
|
443
441
|
class TranslatePipe {
|
|
444
|
-
ts;
|
|
445
|
-
constructor(ts) {
|
|
446
|
-
this.ts = ts;
|
|
447
|
-
}
|
|
442
|
+
ts = inject(TranslateService);
|
|
448
443
|
transform = (value, args) => this.ts.translate(value, args);
|
|
449
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TranslatePipe, deps: [
|
|
444
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TranslatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
450
445
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.5", ngImport: i0, type: TranslatePipe, isStandalone: true, name: "translate", pure: false });
|
|
451
446
|
}
|
|
452
447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TranslatePipe, decorators: [{
|
|
@@ -456,13 +451,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
456
451
|
standalone: true,
|
|
457
452
|
pure: false
|
|
458
453
|
}]
|
|
459
|
-
}]
|
|
454
|
+
}] });
|
|
460
455
|
|
|
461
456
|
class InputContainerComponent {
|
|
462
|
-
input;
|
|
463
|
-
elRef;
|
|
464
|
-
translateService;
|
|
465
|
-
cp;
|
|
466
457
|
errors$ = new BehaviorSubject(null);
|
|
467
458
|
decodedError$ = this.errors$.pipe(distinctUntilChanged((a, b) => isDeepEqual(a, b)), map(val => {
|
|
468
459
|
if (val) {
|
|
@@ -482,18 +473,16 @@ class InputContainerComponent {
|
|
|
482
473
|
}
|
|
483
474
|
return null;
|
|
484
475
|
}));
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
this.cp = cp;
|
|
490
|
-
}
|
|
476
|
+
input = inject(BaseFormInput);
|
|
477
|
+
elRef = inject(ElementRef);
|
|
478
|
+
translateService = inject(TranslateService);
|
|
479
|
+
cp = inject(DecimalPipe);
|
|
491
480
|
focus = () => {
|
|
492
481
|
const input = this.elRef.nativeElement.querySelector("input");
|
|
493
482
|
if (input)
|
|
494
483
|
input.focus();
|
|
495
484
|
};
|
|
496
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputContainerComponent, deps: [
|
|
485
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
497
486
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: InputContainerComponent, isStandalone: false, selector: "dolfo-input-container", providers: [DecimalPipe], ngImport: i0, template: `<div class="input-container" [class.error]="decodedError$ | async">
|
|
498
487
|
@if(input.label){
|
|
499
488
|
<label>
|
|
@@ -542,7 +531,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
542
531
|
providers: [DecimalPipe],
|
|
543
532
|
standalone: false
|
|
544
533
|
}]
|
|
545
|
-
}]
|
|
534
|
+
}] });
|
|
546
535
|
|
|
547
536
|
class BaseFormInput extends Subscriptable {
|
|
548
537
|
container;
|
|
@@ -809,22 +798,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
809
798
|
}] } });
|
|
810
799
|
|
|
811
800
|
class ComboboxComponent extends BaseFormInput {
|
|
812
|
-
cdr;
|
|
813
801
|
combo;
|
|
814
802
|
options;
|
|
815
803
|
placeHolder;
|
|
816
804
|
multiple = false;
|
|
817
805
|
onFocus = new EventEmitter();
|
|
818
806
|
onBlur = new EventEmitter();
|
|
807
|
+
cdr = inject(ChangeDetectorRef);
|
|
819
808
|
opened = signal(false, /* @ts-ignore */
|
|
820
809
|
...(ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []));
|
|
821
810
|
currentFocus = signal(null, /* @ts-ignore */
|
|
822
811
|
...(ngDevMode ? [{ debugName: "currentFocus" }] : /* istanbul ignore next */ []));
|
|
823
812
|
comboLabel = signal("", /* @ts-ignore */
|
|
824
813
|
...(ngDevMode ? [{ debugName: "comboLabel" }] : /* istanbul ignore next */ []));
|
|
825
|
-
constructor(
|
|
814
|
+
constructor() {
|
|
826
815
|
super();
|
|
827
|
-
this.cdr = cdr;
|
|
828
816
|
this.addSubscription(fromEvent(window, "click").pipe(filter(() => !!this.combo && !this.input.disabled), map(ev => ev.target), map(target => !this.combo.nativeElement.contains(target) && !target.isEqualNode(this.combo.nativeElement))).subscribe(condition => {
|
|
829
817
|
if (condition && this.opened())
|
|
830
818
|
this.opened.set(false);
|
|
@@ -903,7 +891,7 @@ class ComboboxComponent extends BaseFormInput {
|
|
|
903
891
|
get hasValue() {
|
|
904
892
|
return this.multiple ? this.input.value != null && this.input.value.length > 0 : this.input.value != null;
|
|
905
893
|
}
|
|
906
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ComboboxComponent, deps: [
|
|
894
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
907
895
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ComboboxComponent, isStandalone: false, selector: "dolfo-combobox", inputs: { options: "options", placeHolder: "placeHolder", multiple: ["multiple", "multiple", booleanAttribute] }, outputs: { onFocus: "onFocus", onBlur: "onBlur" }, providers: [
|
|
908
896
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ComboboxComponent), multi: true },
|
|
909
897
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => ComboboxComponent), multi: true },
|
|
@@ -965,7 +953,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
965
953
|
],
|
|
966
954
|
standalone: false
|
|
967
955
|
}]
|
|
968
|
-
}], ctorParameters: () => [
|
|
956
|
+
}], ctorParameters: () => [], propDecorators: { combo: [{
|
|
969
957
|
type: ViewChild,
|
|
970
958
|
args: ["combo"]
|
|
971
959
|
}], options: [{
|
|
@@ -1354,15 +1342,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1354
1342
|
}] } });
|
|
1355
1343
|
|
|
1356
1344
|
class DialogContentComponent {
|
|
1357
|
-
cdr;
|
|
1358
1345
|
template;
|
|
1359
|
-
|
|
1360
|
-
this.cdr = cdr;
|
|
1361
|
-
}
|
|
1346
|
+
cdr = inject(ChangeDetectorRef);
|
|
1362
1347
|
ngOnInit() {
|
|
1363
1348
|
this.cdr.detectChanges();
|
|
1364
1349
|
}
|
|
1365
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogContentComponent, deps: [
|
|
1350
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1366
1351
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: DialogContentComponent, isStandalone: false, selector: "dolfo-dialog-content", viewQueries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: `<ng-template><ng-content></ng-content></ng-template>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1367
1352
|
}
|
|
1368
1353
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogContentComponent, decorators: [{
|
|
@@ -1373,7 +1358,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1373
1358
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1374
1359
|
standalone: false
|
|
1375
1360
|
}]
|
|
1376
|
-
}],
|
|
1361
|
+
}], propDecorators: { template: [{
|
|
1377
1362
|
type: ViewChild,
|
|
1378
1363
|
args: [TemplateRef]
|
|
1379
1364
|
}] } });
|
|
@@ -1444,16 +1429,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1444
1429
|
}] } });
|
|
1445
1430
|
|
|
1446
1431
|
class DialogHeaderComponent {
|
|
1447
|
-
cdr;
|
|
1448
|
-
dialogService;
|
|
1449
1432
|
template;
|
|
1450
1433
|
title;
|
|
1451
1434
|
icon;
|
|
1452
1435
|
showCloseX = true;
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
this.dialogService = dialogService;
|
|
1456
|
-
}
|
|
1436
|
+
cdr = inject(ChangeDetectorRef);
|
|
1437
|
+
dialogService = inject(DialogService);
|
|
1457
1438
|
ngOnInit() {
|
|
1458
1439
|
this.cdr.detectChanges();
|
|
1459
1440
|
}
|
|
@@ -1462,7 +1443,7 @@ class DialogHeaderComponent {
|
|
|
1462
1443
|
this.dialogService.close();
|
|
1463
1444
|
};
|
|
1464
1445
|
getIcon = () => this.icon.icon;
|
|
1465
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogHeaderComponent, deps: [
|
|
1446
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1466
1447
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DialogHeaderComponent, isStandalone: false, selector: "dolfo-dialog-header", inputs: { title: "title", icon: "icon", showCloseX: ["showCloseX", "showCloseX", booleanAttribute] }, viewQueries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: `<ng-template>
|
|
1467
1448
|
<h5>
|
|
1468
1449
|
@if(icon){
|
|
@@ -1497,7 +1478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1497
1478
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1498
1479
|
standalone: false
|
|
1499
1480
|
}]
|
|
1500
|
-
}],
|
|
1481
|
+
}], propDecorators: { template: [{
|
|
1501
1482
|
type: ViewChild,
|
|
1502
1483
|
args: [TemplateRef]
|
|
1503
1484
|
}], title: [{
|
|
@@ -1771,17 +1752,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1771
1752
|
}] } });
|
|
1772
1753
|
|
|
1773
1754
|
class NotificationComponent {
|
|
1774
|
-
ns;
|
|
1775
|
-
ts;
|
|
1776
1755
|
title;
|
|
1777
1756
|
message;
|
|
1778
1757
|
type = "info";
|
|
1779
1758
|
action;
|
|
1780
1759
|
timeout;
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
this.ts = ts;
|
|
1784
|
-
}
|
|
1760
|
+
ns = inject(NotificationService);
|
|
1761
|
+
ts = inject(TranslateService);
|
|
1785
1762
|
ngOnInit() {
|
|
1786
1763
|
this.mouseLeave();
|
|
1787
1764
|
}
|
|
@@ -1792,7 +1769,7 @@ class NotificationComponent {
|
|
|
1792
1769
|
this.ns.hide();
|
|
1793
1770
|
};
|
|
1794
1771
|
getTitleByType = () => this.ts.translate("notification." + this.type);
|
|
1795
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NotificationComponent, deps: [
|
|
1772
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1796
1773
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: NotificationComponent, isStandalone: false, selector: "dolfo-notification", inputs: { title: "title", message: "message", type: "type", action: "action" }, ngImport: i0, template: `<div class="notification" [ngClass]="{
|
|
1797
1774
|
success: type === 'success',
|
|
1798
1775
|
error: type === 'error',
|
|
@@ -1843,7 +1820,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1843
1820
|
</div>`,
|
|
1844
1821
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1845
1822
|
}]
|
|
1846
|
-
}],
|
|
1823
|
+
}], propDecorators: { title: [{
|
|
1847
1824
|
type: Input,
|
|
1848
1825
|
args: [{ required: true }]
|
|
1849
1826
|
}], message: [{
|
|
@@ -1857,8 +1834,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1857
1834
|
|
|
1858
1835
|
const POPOVER_DESTROY_TOKEN = new InjectionToken("POPOVER_DESTROY_TOKEN");
|
|
1859
1836
|
class PopoverComponent extends Subscriptable {
|
|
1860
|
-
cdr;
|
|
1861
|
-
sanitizer;
|
|
1862
1837
|
tooltipRef;
|
|
1863
1838
|
content;
|
|
1864
1839
|
elementRef;
|
|
@@ -1866,15 +1841,12 @@ class PopoverComponent extends Subscriptable {
|
|
|
1866
1841
|
context;
|
|
1867
1842
|
destroyFn = inject(POPOVER_DESTROY_TOKEN);
|
|
1868
1843
|
checkCount = 0;
|
|
1844
|
+
cdr = inject(ChangeDetectorRef);
|
|
1845
|
+
sanitizer = inject(DomSanitizer);
|
|
1869
1846
|
currentDirection$ = new BehaviorSubject(null);
|
|
1870
1847
|
completed$ = new BehaviorSubject(false);
|
|
1871
1848
|
x$ = new BehaviorSubject(0);
|
|
1872
1849
|
y$ = new BehaviorSubject(0);
|
|
1873
|
-
constructor(cdr, sanitizer) {
|
|
1874
|
-
super();
|
|
1875
|
-
this.cdr = cdr;
|
|
1876
|
-
this.sanitizer = sanitizer;
|
|
1877
|
-
}
|
|
1878
1850
|
ngOnInit() {
|
|
1879
1851
|
this.currentDirection$.next(this.direction);
|
|
1880
1852
|
this.addSubscription(race([
|
|
@@ -1927,7 +1899,7 @@ class PopoverComponent extends Subscriptable {
|
|
|
1927
1899
|
getContentStr = () => this.sanitizer.bypassSecurityTrustHtml(this.content);
|
|
1928
1900
|
isTemplate = () => this.content instanceof TemplateRef;
|
|
1929
1901
|
getContentTemplate = () => this.content;
|
|
1930
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PopoverComponent, deps:
|
|
1902
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PopoverComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1931
1903
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: PopoverComponent, isStandalone: false, selector: "dolfo-popover", inputs: { content: "content", elementRef: "elementRef", direction: "direction", context: "context" }, viewQueries: [{ propertyName: "tooltipRef", first: true, predicate: ["tooltipRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: `<div class="tooltip popover" #tooltipRef [ngStyle]="{
|
|
1932
1904
|
left: (x$ | async) + 'px',
|
|
1933
1905
|
top: (y$ | async) + 'px'
|
|
@@ -1956,7 +1928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1956
1928
|
</div>`,
|
|
1957
1929
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1958
1930
|
}]
|
|
1959
|
-
}],
|
|
1931
|
+
}], propDecorators: { tooltipRef: [{
|
|
1960
1932
|
type: ViewChild,
|
|
1961
1933
|
args: ["tooltipRef"]
|
|
1962
1934
|
}], content: [{
|
|
@@ -1974,21 +1946,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1974
1946
|
|
|
1975
1947
|
const TOOLTIP_DESTROY_TOKEN = new InjectionToken("TOOLTIP_DESTROY_TOKEN");
|
|
1976
1948
|
class TooltipComponent extends Subscriptable {
|
|
1977
|
-
cdr;
|
|
1978
1949
|
tooltipRef;
|
|
1979
1950
|
content;
|
|
1980
1951
|
elementRef;
|
|
1981
1952
|
direction;
|
|
1982
1953
|
destroyFn = inject(TOOLTIP_DESTROY_TOKEN);
|
|
1983
1954
|
checkCount = 0;
|
|
1955
|
+
cdr = inject(ChangeDetectorRef);
|
|
1984
1956
|
currentDirection$ = new BehaviorSubject(null);
|
|
1985
1957
|
completed$ = new BehaviorSubject(false);
|
|
1986
1958
|
x$ = new BehaviorSubject(0);
|
|
1987
1959
|
y$ = new BehaviorSubject(0);
|
|
1988
|
-
constructor(cdr) {
|
|
1989
|
-
super();
|
|
1990
|
-
this.cdr = cdr;
|
|
1991
|
-
}
|
|
1992
1960
|
ngOnInit() {
|
|
1993
1961
|
this.currentDirection$.next(this.direction);
|
|
1994
1962
|
this.addSubscription(race([
|
|
@@ -2038,7 +2006,7 @@ class TooltipComponent extends Subscriptable {
|
|
|
2038
2006
|
const { top, left, bottom, right } = this.tooltipRef.nativeElement.getBoundingClientRect();
|
|
2039
2007
|
return top >= 0 && left >= 0 && bottom <= window.innerHeight && right <= window.innerWidth;
|
|
2040
2008
|
};
|
|
2041
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipComponent, deps:
|
|
2009
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2042
2010
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: TooltipComponent, isStandalone: false, selector: "dolfo-tooltip", inputs: { content: "content", elementRef: "elementRef", direction: "direction" }, viewQueries: [{ propertyName: "tooltipRef", first: true, predicate: ["tooltipRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: `<div class="tooltip" #tooltipRef [ngStyle]="{
|
|
2043
2011
|
left: (x$ | async) + 'px',
|
|
2044
2012
|
top: (y$ | async) + 'px'
|
|
@@ -2059,7 +2027,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2059
2027
|
</div>`,
|
|
2060
2028
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
2061
2029
|
}]
|
|
2062
|
-
}],
|
|
2030
|
+
}], propDecorators: { tooltipRef: [{
|
|
2063
2031
|
type: ViewChild,
|
|
2064
2032
|
args: ["tooltipRef"]
|
|
2065
2033
|
}], content: [{
|
|
@@ -2202,17 +2170,12 @@ class RouteConfig {
|
|
|
2202
2170
|
}
|
|
2203
2171
|
|
|
2204
2172
|
class ContextMenuDirective extends Subscriptable {
|
|
2205
|
-
contextMenuService;
|
|
2206
|
-
elRef;
|
|
2207
2173
|
contextMenu;
|
|
2208
2174
|
openOnClick;
|
|
2209
2175
|
useElRef;
|
|
2210
2176
|
position = "bottom-left";
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
this.contextMenuService = contextMenuService;
|
|
2214
|
-
this.elRef = elRef;
|
|
2215
|
-
}
|
|
2177
|
+
contextMenuService = inject(ContextMenuService);
|
|
2178
|
+
elRef = inject(ElementRef);
|
|
2216
2179
|
ngOnInit() {
|
|
2217
2180
|
this.addSubscription(fromEvent(this.elRef.nativeElement, this.openOnClick ? "click" : "contextmenu").subscribe(e => {
|
|
2218
2181
|
e.preventDefault();
|
|
@@ -2239,7 +2202,7 @@ class ContextMenuDirective extends Subscriptable {
|
|
|
2239
2202
|
return [diff, top];
|
|
2240
2203
|
return [this.elRef.nativeElement.offsetLeft, top];
|
|
2241
2204
|
};
|
|
2242
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ContextMenuDirective, deps:
|
|
2205
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ContextMenuDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
2243
2206
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "22.0.5", type: ContextMenuDirective, isStandalone: false, selector: "[dolfoContextMenu]", inputs: { contextMenu: ["dolfoContextMenu", "contextMenu"], openOnClick: ["openOnClick", "openOnClick", booleanAttribute], useElRef: ["useElRef", "useElRef", booleanAttribute], position: "position" }, usesInheritance: true, ngImport: i0 });
|
|
2244
2207
|
}
|
|
2245
2208
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ContextMenuDirective, decorators: [{
|
|
@@ -2248,7 +2211,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2248
2211
|
selector: "[dolfoContextMenu]",
|
|
2249
2212
|
standalone: false
|
|
2250
2213
|
}]
|
|
2251
|
-
}],
|
|
2214
|
+
}], propDecorators: { contextMenu: [{
|
|
2252
2215
|
type: Input,
|
|
2253
2216
|
args: [{ required: true, alias: "dolfoContextMenu" }]
|
|
2254
2217
|
}], openOnClick: [{
|
|
@@ -2262,23 +2225,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2262
2225
|
}] } });
|
|
2263
2226
|
|
|
2264
2227
|
class NavigateDirective extends Subscriptable {
|
|
2265
|
-
elementRef;
|
|
2266
2228
|
url;
|
|
2267
2229
|
isLink;
|
|
2268
2230
|
publicUrl = inject(APP_BASE_HREF);
|
|
2269
|
-
|
|
2231
|
+
storeService = inject(StoreService);
|
|
2232
|
+
router = inject(Router);
|
|
2233
|
+
elementRef = inject(ElementRef);
|
|
2234
|
+
constructor() {
|
|
2270
2235
|
super();
|
|
2271
|
-
this.
|
|
2272
|
-
this.
|
|
2273
|
-
this.addSubscription(fromEvent(elementRef.nativeElement, "click").subscribe(e => {
|
|
2236
|
+
this.isLink = this.elementRef.nativeElement.tagName.toLowerCase() === "a";
|
|
2237
|
+
this.addSubscription(fromEvent(this.elementRef.nativeElement, "click").subscribe(e => {
|
|
2274
2238
|
if (this.isLink)
|
|
2275
2239
|
e.preventDefault();
|
|
2276
|
-
if (storeService.isPressingCtrl())
|
|
2240
|
+
if (this.storeService.isPressingCtrl())
|
|
2277
2241
|
this.openBlank();
|
|
2278
2242
|
else
|
|
2279
|
-
router.navigateByUrl(this.url);
|
|
2243
|
+
this.router.navigateByUrl(this.url);
|
|
2280
2244
|
}));
|
|
2281
|
-
this.addSubscription(fromEvent(elementRef.nativeElement, "mousedown").pipe(filter(e => e.button === 1)).subscribe(e => {
|
|
2245
|
+
this.addSubscription(fromEvent(this.elementRef.nativeElement, "mousedown").pipe(filter(e => e.button === 1)).subscribe(e => {
|
|
2282
2246
|
if (this.isLink)
|
|
2283
2247
|
e.stopPropagation();
|
|
2284
2248
|
else
|
|
@@ -2290,7 +2254,7 @@ class NavigateDirective extends Subscriptable {
|
|
|
2290
2254
|
this.elementRef.nativeElement.setAttribute("href", this.url);
|
|
2291
2255
|
}
|
|
2292
2256
|
openBlank = () => window.open(this.publicUrl + this.url, "_blank");
|
|
2293
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NavigateDirective, deps: [
|
|
2257
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NavigateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2294
2258
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: NavigateDirective, isStandalone: false, selector: "[dolfoNavigate]", inputs: { url: ["dolfoNavigate", "url"] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
2295
2259
|
}
|
|
2296
2260
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NavigateDirective, decorators: [{
|
|
@@ -2299,22 +2263,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2299
2263
|
selector: "[dolfoNavigate]",
|
|
2300
2264
|
standalone: false
|
|
2301
2265
|
}]
|
|
2302
|
-
}], ctorParameters: () => [
|
|
2266
|
+
}], ctorParameters: () => [], propDecorators: { url: [{
|
|
2303
2267
|
type: Input,
|
|
2304
2268
|
args: [{ required: true, alias: "dolfoNavigate" }]
|
|
2305
2269
|
}] } });
|
|
2306
2270
|
|
|
2307
2271
|
class PopoverDirective extends Subscriptable {
|
|
2308
|
-
el;
|
|
2309
|
-
ps;
|
|
2310
2272
|
content;
|
|
2311
2273
|
context;
|
|
2312
2274
|
direction = "top";
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
this.el = el;
|
|
2316
|
-
this.ps = ps;
|
|
2317
|
-
}
|
|
2275
|
+
el = inject(ElementRef);
|
|
2276
|
+
ps = inject(PopoverService);
|
|
2318
2277
|
ngOnInit() {
|
|
2319
2278
|
this.addSubscription(fromEvent(this.el.nativeElement, "mousedown").pipe(filter(() => !!this.ps.getPopover())).subscribe(() => this.ps.hide()));
|
|
2320
2279
|
this.addSubscription(fromEvent(this.el.nativeElement, "click").pipe(filter(() => !!this.content)).subscribe(() => this.ps.showPopover({
|
|
@@ -2324,7 +2283,7 @@ class PopoverDirective extends Subscriptable {
|
|
|
2324
2283
|
context: this.context
|
|
2325
2284
|
})));
|
|
2326
2285
|
}
|
|
2327
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PopoverDirective, deps:
|
|
2286
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PopoverDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
2328
2287
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: PopoverDirective, isStandalone: false, selector: "[dolfoPopover]", inputs: { content: ["dolfoPopover", "content"], context: ["dolfoPopoverContext", "context"], direction: "direction" }, usesInheritance: true, ngImport: i0 });
|
|
2329
2288
|
}
|
|
2330
2289
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PopoverDirective, decorators: [{
|
|
@@ -2333,7 +2292,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2333
2292
|
selector: "[dolfoPopover]",
|
|
2334
2293
|
standalone: false
|
|
2335
2294
|
}]
|
|
2336
|
-
}],
|
|
2295
|
+
}], propDecorators: { content: [{
|
|
2337
2296
|
type: Input,
|
|
2338
2297
|
args: [{ required: true, alias: "dolfoPopover" }]
|
|
2339
2298
|
}], context: [{
|
|
@@ -2350,23 +2309,24 @@ class ScrollDragDirective extends Subscriptable {
|
|
|
2350
2309
|
mouseDownY;
|
|
2351
2310
|
initialScrollY = 0;
|
|
2352
2311
|
diffY = 0;
|
|
2353
|
-
|
|
2312
|
+
elementRef = inject(ElementRef);
|
|
2313
|
+
constructor() {
|
|
2354
2314
|
super();
|
|
2355
|
-
this.addSubscription(fromEvent(elementRef.nativeElement, "mousedown").pipe(filter(e => e.button === 0)).subscribe(e => {
|
|
2315
|
+
this.addSubscription(fromEvent(this.elementRef.nativeElement, "mousedown").pipe(filter(e => e.button === 0)).subscribe(e => {
|
|
2356
2316
|
e.preventDefault();
|
|
2357
2317
|
e.stopPropagation();
|
|
2358
2318
|
this.mouseDownX = e.clientX;
|
|
2359
2319
|
this.mouseDownY = e.clientY;
|
|
2360
|
-
this.initialScrollX = elementRef.nativeElement.scrollLeft;
|
|
2361
|
-
this.initialScrollY = elementRef.nativeElement.scrollTop;
|
|
2362
|
-
elementRef.nativeElement.classList.add("dragging");
|
|
2320
|
+
this.initialScrollX = this.elementRef.nativeElement.scrollLeft;
|
|
2321
|
+
this.initialScrollY = this.elementRef.nativeElement.scrollTop;
|
|
2322
|
+
this.elementRef.nativeElement.classList.add("dragging");
|
|
2363
2323
|
}));
|
|
2364
2324
|
this.addSubscription(fromEvent(document, "mouseup", { capture: true }).subscribe(() => {
|
|
2365
2325
|
this.mouseDownX = null;
|
|
2366
2326
|
this.mouseDownY = null;
|
|
2367
|
-
elementRef.nativeElement.classList.remove("dragging");
|
|
2327
|
+
this.elementRef.nativeElement.classList.remove("dragging");
|
|
2368
2328
|
}));
|
|
2369
|
-
this.addSubscription(fromEvent(elementRef.nativeElement, "click", { capture: true }).pipe(filter(() => this.diffX != 0 || this.diffY != 0)).subscribe(e => {
|
|
2329
|
+
this.addSubscription(fromEvent(this.elementRef.nativeElement, "click", { capture: true }).pipe(filter(() => this.diffX != 0 || this.diffY != 0)).subscribe(e => {
|
|
2370
2330
|
e.stopPropagation();
|
|
2371
2331
|
this.diffX = 0;
|
|
2372
2332
|
this.diffY = 0;
|
|
@@ -2375,15 +2335,15 @@ class ScrollDragDirective extends Subscriptable {
|
|
|
2375
2335
|
e.stopPropagation();
|
|
2376
2336
|
if (this.mouseDownX != null) {
|
|
2377
2337
|
this.diffX = this.initialScrollX + (this.mouseDownX - e.clientX);
|
|
2378
|
-
elementRef.nativeElement.scrollLeft = this.diffX;
|
|
2338
|
+
this.elementRef.nativeElement.scrollLeft = this.diffX;
|
|
2379
2339
|
}
|
|
2380
2340
|
if (this.mouseDownY != null) {
|
|
2381
2341
|
this.diffY = this.initialScrollY + (this.mouseDownY - e.clientY);
|
|
2382
|
-
elementRef.nativeElement.scrollTop = this.diffY;
|
|
2342
|
+
this.elementRef.nativeElement.scrollTop = this.diffY;
|
|
2383
2343
|
}
|
|
2384
2344
|
}));
|
|
2385
2345
|
}
|
|
2386
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ScrollDragDirective, deps: [
|
|
2346
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ScrollDragDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2387
2347
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: ScrollDragDirective, isStandalone: false, selector: "[dolfoScrollDrag]", usesInheritance: true, ngImport: i0 });
|
|
2388
2348
|
}
|
|
2389
2349
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ScrollDragDirective, decorators: [{
|
|
@@ -2392,7 +2352,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2392
2352
|
selector: "[dolfoScrollDrag]",
|
|
2393
2353
|
standalone: false
|
|
2394
2354
|
}]
|
|
2395
|
-
}], ctorParameters: () => [
|
|
2355
|
+
}], ctorParameters: () => [] });
|
|
2396
2356
|
|
|
2397
2357
|
class DirectivesModule {
|
|
2398
2358
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -2507,13 +2467,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2507
2467
|
}] });
|
|
2508
2468
|
|
|
2509
2469
|
class GridComponent {
|
|
2510
|
-
translateService;
|
|
2511
|
-
sanitizer;
|
|
2512
2470
|
config;
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
this.sanitizer = sanitizer;
|
|
2516
|
-
}
|
|
2471
|
+
translateService = inject(TranslateService);
|
|
2472
|
+
sanitizer = inject(DomSanitizer);
|
|
2517
2473
|
resolveField = (item, { field, formatter, dataType, onLink }) => {
|
|
2518
2474
|
let value = field
|
|
2519
2475
|
.toString()
|
|
@@ -2543,13 +2499,13 @@ class GridComponent {
|
|
|
2543
2499
|
col.onLink(colValue);
|
|
2544
2500
|
}
|
|
2545
2501
|
};
|
|
2546
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: GridComponent, deps: [
|
|
2502
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: GridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2547
2503
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: GridComponent, isStandalone: false, selector: "dolfo-grid", inputs: { config: "config" }, ngImport: i0, template: "@let loading = config.isLoading$() | async;\r\n\r\n<div class=\"grid-container\" [class.loading]=\"loading\">\r\n @if(loading){\r\n <div class=\"grid-loading\">\r\n <dolfo-icon name=\"spinner2\"></dolfo-icon>\r\n </div>\r\n }\r\n\r\n <table>\r\n @let columns = config.getColumns();\r\n @let showActions = config.hasActions;\r\n @let selection = config.getSelectionConfig();\r\n @let colSpan = columns.length + (showActions ? 1 : 0) + (selection ? 1 : 0);\r\n \r\n <thead>\r\n <tr>\r\n @if(selection){\r\n <th [style]=\"{ width: 0 }\">\r\n @if(selection.showSelectAll && selection.type === \"multiple\"){\r\n <input type=\"checkbox\" [checked]=\"config.isAllSelected()\" (change)=\"config.toggleSelectAll()\" />\r\n }\r\n </th>\r\n }\r\n\r\n @for(col of columns; track col.label){\r\n <th [ngStyle]=\"{ width: col.width + 'px', maxWidth: col.width + 'px' }\">{{ col.label | translate }}</th>\r\n }\r\n \r\n @if(showActions){\r\n <th>{{ \"grid.actions\" | translate }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n \r\n <tbody>\r\n @let list = config.getList$() | async;\r\n \r\n @if(list.length > 0){\r\n @for(item of list; track config.getUniqueId(item)){\r\n @let itemActions = config.getActions$(item) | async;\r\n @let rowClass = config.getRowClass(item);\r\n \r\n <tr (click)=\"config.getEvents()?.onRowClick?.(item)\" [dolfoContextMenu]=\"itemActions\" position=\"bottom-right\">\r\n @if(selection){\r\n <td [ngClass]=\"rowClass\" class=\"align-center\">\r\n <input type=\"checkbox\" [checked]=\"config.isItemSelected(item)\" (change)=\"config.toggleSelection(item)\" />\r\n </td>\r\n }\r\n\r\n @for(col of columns; track col.label){\r\n <td #cell [ngStyle]=\"{ width: col.width + 'px' }\" [ngClass]=\"rowClass\" [class.align-right]=\"col.align === 'right'\" [class.align-center]=\"col.align === 'center'\" (click)=\"checkLink($event, col, item, cell)\" [innerHTML]=\"resolveField(item, col)\"></td>\r\n }\r\n \r\n @if(showActions){\r\n <td class=\"align-center actions\" [ngClass]=\"rowClass\">\r\n @if(itemActions.length > 0){\r\n <dolfo-button color=\"secondary\" [dolfoTooltip]=\"'grid.showActions' | translate\" [dolfoContextMenu]=\"itemActions\" position=\"bottom-right\" openOnClick>\r\n <dolfo-icon name=\"flickr\"></dolfo-icon>\r\n </dolfo-button>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }@else {\r\n <tr>\r\n <td [colSpan]=\"colSpan\" class=\"align-center\">{{ \"grid.noResults\" | translate }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n</div>", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: ContextMenuDirective, selector: "[dolfoContextMenu]", inputs: ["dolfoContextMenu", "openOnClick", "useElRef", "position"] }, { kind: "directive", type: TooltipDirective, selector: "[dolfoTooltip]", inputs: ["dolfoTooltip", "direction"] }, { kind: "component", type: ButtonComponent, selector: "dolfo-button", inputs: ["type", "disabled", "color", "loading", "size", "textButton"], outputs: ["onClick", "onBlur", "onFocus"] }, { kind: "component", type: IconWrapperComponent, selector: "dolfo-icon", inputs: ["name"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
2548
2504
|
}
|
|
2549
2505
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: GridComponent, decorators: [{
|
|
2550
2506
|
type: Component,
|
|
2551
2507
|
args: [{ selector: "dolfo-grid", standalone: false, template: "@let loading = config.isLoading$() | async;\r\n\r\n<div class=\"grid-container\" [class.loading]=\"loading\">\r\n @if(loading){\r\n <div class=\"grid-loading\">\r\n <dolfo-icon name=\"spinner2\"></dolfo-icon>\r\n </div>\r\n }\r\n\r\n <table>\r\n @let columns = config.getColumns();\r\n @let showActions = config.hasActions;\r\n @let selection = config.getSelectionConfig();\r\n @let colSpan = columns.length + (showActions ? 1 : 0) + (selection ? 1 : 0);\r\n \r\n <thead>\r\n <tr>\r\n @if(selection){\r\n <th [style]=\"{ width: 0 }\">\r\n @if(selection.showSelectAll && selection.type === \"multiple\"){\r\n <input type=\"checkbox\" [checked]=\"config.isAllSelected()\" (change)=\"config.toggleSelectAll()\" />\r\n }\r\n </th>\r\n }\r\n\r\n @for(col of columns; track col.label){\r\n <th [ngStyle]=\"{ width: col.width + 'px', maxWidth: col.width + 'px' }\">{{ col.label | translate }}</th>\r\n }\r\n \r\n @if(showActions){\r\n <th>{{ \"grid.actions\" | translate }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n \r\n <tbody>\r\n @let list = config.getList$() | async;\r\n \r\n @if(list.length > 0){\r\n @for(item of list; track config.getUniqueId(item)){\r\n @let itemActions = config.getActions$(item) | async;\r\n @let rowClass = config.getRowClass(item);\r\n \r\n <tr (click)=\"config.getEvents()?.onRowClick?.(item)\" [dolfoContextMenu]=\"itemActions\" position=\"bottom-right\">\r\n @if(selection){\r\n <td [ngClass]=\"rowClass\" class=\"align-center\">\r\n <input type=\"checkbox\" [checked]=\"config.isItemSelected(item)\" (change)=\"config.toggleSelection(item)\" />\r\n </td>\r\n }\r\n\r\n @for(col of columns; track col.label){\r\n <td #cell [ngStyle]=\"{ width: col.width + 'px' }\" [ngClass]=\"rowClass\" [class.align-right]=\"col.align === 'right'\" [class.align-center]=\"col.align === 'center'\" (click)=\"checkLink($event, col, item, cell)\" [innerHTML]=\"resolveField(item, col)\"></td>\r\n }\r\n \r\n @if(showActions){\r\n <td class=\"align-center actions\" [ngClass]=\"rowClass\">\r\n @if(itemActions.length > 0){\r\n <dolfo-button color=\"secondary\" [dolfoTooltip]=\"'grid.showActions' | translate\" [dolfoContextMenu]=\"itemActions\" position=\"bottom-right\" openOnClick>\r\n <dolfo-icon name=\"flickr\"></dolfo-icon>\r\n </dolfo-button>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }@else {\r\n <tr>\r\n <td [colSpan]=\"colSpan\" class=\"align-center\">{{ \"grid.noResults\" | translate }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n</div>" }]
|
|
2552
|
-
}],
|
|
2508
|
+
}], propDecorators: { config: [{
|
|
2553
2509
|
type: Input,
|
|
2554
2510
|
args: [{ required: true }]
|
|
2555
2511
|
}] } });
|