@ngflux/ngflux 1.0.4 → 2.0.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/README.md +46 -9
- package/_index.scss +1 -0
- package/fesm2022/ngflux-ngflux.mjs +404 -342
- package/fesm2022/ngflux-ngflux.mjs.map +1 -1
- package/lib/components/button/button.component.scss +126 -0
- package/lib/components/dialog/body/body.component.scss +4 -0
- package/lib/components/dialog/boxes/alert/alert.dialog.scss +6 -0
- package/lib/components/dialog/boxes/confirm/confirm.dialog.scss +6 -0
- package/lib/components/dialog/boxes/prompt/prompt.dialog.scss +24 -0
- package/lib/components/dialog/footer/footer.component.scss +12 -0
- package/lib/components/dialog/header/header.component.scss +38 -0
- package/lib/components/dialog/main/main.component.scss +24 -0
- package/lib/components/dialog/root/root.component.scss +6 -0
- package/lib/components/loading/main/main.component.scss +42 -0
- package/lib/components/loading/root/root.component.scss +21 -0
- package/lib/components/pagination/info/info.component.scss +58 -0
- package/lib/components/pagination/pagination.component.scss +7 -0
- package/package.json +4 -3
- package/types/ngflux-ngflux.d.ts +12 -12
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
3
|
-
import {
|
|
2
|
+
import { InjectionToken, inject, ElementRef, input, computed, HostBinding, ChangeDetectionStrategy, Component, Injector, viewChild, ViewContainerRef, ApplicationRef, signal, createComponent, effect, Injectable, output, model, untracked, HostListener, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
|
|
3
|
+
import { Router, NavigationStart, NavigationEnd, NavigationCancel, NavigationError } from '@angular/router';
|
|
4
|
+
import { filter, AsyncSubject } from 'rxjs';
|
|
4
5
|
import { NgClass } from '@angular/common';
|
|
5
6
|
import * as i1 from '@angular/forms';
|
|
6
7
|
import { FormsModule } from '@angular/forms';
|
|
@@ -9,63 +10,113 @@ const NGF_CONFIG = new InjectionToken('ngf-config');
|
|
|
9
10
|
|
|
10
11
|
const NGF_DIALOG_DATA = new InjectionToken('ngf-dialog-data');
|
|
11
12
|
|
|
12
|
-
class
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
class NgFluxButton {
|
|
14
|
+
ref = inject(ElementRef);
|
|
15
|
+
icon = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
17
|
+
theme = input(/* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [undefined, { debugName: "theme" }] : /* istanbul ignore next */ []));
|
|
19
|
+
type = input(/* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [undefined, { debugName: "type" }] : /* istanbul ignore next */ []));
|
|
21
|
+
size = input(/* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [undefined, { debugName: "size" }] : /* istanbul ignore next */ []));
|
|
23
|
+
direction = input(/* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [undefined, { debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
25
|
+
block = input(false, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "block" }] : /* istanbul ignore next */ []));
|
|
27
|
+
disabled = input(false, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
29
|
+
btnClassNames = computed(() => {
|
|
30
|
+
const names = [];
|
|
31
|
+
const direction = this.direction() ?? 'normal';
|
|
32
|
+
if (direction === 'reversed')
|
|
33
|
+
names.push(direction);
|
|
34
|
+
return names;
|
|
35
|
+
}, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "btnClassNames" }] : /* istanbul ignore next */ []));
|
|
37
|
+
classNames = computed(() => [this.theme() ?? 'default', this.size() ?? 'md'].join(' '), /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "classNames" }] : /* istanbul ignore next */ []));
|
|
39
|
+
get bindClass() {
|
|
40
|
+
return this.classNames();
|
|
41
|
+
}
|
|
42
|
+
get isBlock() {
|
|
43
|
+
return this.block();
|
|
44
|
+
}
|
|
45
|
+
get isDisabled() {
|
|
46
|
+
return this.disabled();
|
|
47
|
+
}
|
|
48
|
+
constructor() {
|
|
49
|
+
const { ref: { nativeElement }, } = this;
|
|
50
|
+
nativeElement.tabIndex = 1;
|
|
51
|
+
}
|
|
52
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
53
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NgFluxButton, isStandalone: true, selector: "ngf-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, block: { classPropertyName: "block", publicName: "block", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.bindClass", "class.block": "this.isBlock", "class.disabled": "this.isDisabled" } }, ngImport: i0, template: "<button [type]=\"type()\" [disabled]=\"disabled()\">\n <div class=\"wrapper\" [ngClass]=\"btnClassNames()\">\n @if (icon(); as ico) {\n <div class=\"icon\">\n <i [ngClass]=\"ico\"></i>\n </div>\n }\n\n <div class=\"content\">\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</button>\n", styles: [":host{display:inline-block;border:1px solid rgba(0,0,0,.2);border-radius:3px;cursor:pointer;font-size:1rem;overflow:clip}:host.block{display:block}:host.disabled{opacity:.5!important;-webkit-user-select:none!important;user-select:none!important;cursor:not-allowed}:host.xs{font-size:.6rem}:host.sm{font-size:.8rem}:host.md{font-size:1rem}:host.lg{font-size:1.25rem}:host.xl{font-size:1.5rem}:host.default{background-color:var(--ngf-default)!important;color:var(--ngf-default-fg)!important}:host.primary{background-color:var(--ngf-primary)!important;color:var(--ngf-primary-fg)!important}:host.secondary{background-color:var(--ngf-secondary)!important;color:var(--ngf-secondary-fg)!important}:host.error{background-color:var(--ngf-error)!important;color:var(--ngf-error-fg)!important}:host.danger{background-color:var(--ngf-danger)!important;color:var(--ngf-danger-fg)!important}:host.success{background-color:var(--ngf-success)!important;color:var(--ngf-success-fg)!important}:host.warning{background-color:var(--ngf-warning)!important;color:var(--ngf-warning-fg)!important}:host.info{background-color:var(--ngf-info)!important;color:var(--ngf-info-fg)!important}:host.light{background-color:var(--ngf-light)!important;color:var(--ngf-light-fg)!important}:host.dark{background-color:var(--ngf-dark)!important;color:var(--ngf-dark-fg)!important}:host>button{display:block;padding:0!important;background-color:transparent;border:none!important;width:100%!important;cursor:inherit!important;color:inherit!important;font-weight:500;font-size:1em}:host>button:focus{outline:none!important}:host .wrapper{display:flex;flex-direction:var(--flex-direction)!important;--flex-direction: row;--icon-border-left: none;--icon-border-right: 1px solid rgba(0, 0, 0, .2)}:host .wrapper.reversed{--flex-direction: row-reverse;--icon-border-left: 1px solid rgba(0, 0, 0, .2);--icon-border-right: none}:host .wrapper>.icon{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:1.05em;border-left:var(--icon-border-left)!important;border-right:var(--icon-border-right)!important;padding:0 .5em}:host .wrapper>.content{display:block;flex-grow:1;padding:.5em 1em;white-space:nowrap!important;text-align:center!important;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
32
54
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
34
|
-
type:
|
|
35
|
-
args: [{
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxButton, decorators: [{
|
|
56
|
+
type: Component,
|
|
57
|
+
args: [{ selector: 'ngf-button', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgClass], template: "<button [type]=\"type()\" [disabled]=\"disabled()\">\n <div class=\"wrapper\" [ngClass]=\"btnClassNames()\">\n @if (icon(); as ico) {\n <div class=\"icon\">\n <i [ngClass]=\"ico\"></i>\n </div>\n }\n\n <div class=\"content\">\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</button>\n", styles: [":host{display:inline-block;border:1px solid rgba(0,0,0,.2);border-radius:3px;cursor:pointer;font-size:1rem;overflow:clip}:host.block{display:block}:host.disabled{opacity:.5!important;-webkit-user-select:none!important;user-select:none!important;cursor:not-allowed}:host.xs{font-size:.6rem}:host.sm{font-size:.8rem}:host.md{font-size:1rem}:host.lg{font-size:1.25rem}:host.xl{font-size:1.5rem}:host.default{background-color:var(--ngf-default)!important;color:var(--ngf-default-fg)!important}:host.primary{background-color:var(--ngf-primary)!important;color:var(--ngf-primary-fg)!important}:host.secondary{background-color:var(--ngf-secondary)!important;color:var(--ngf-secondary-fg)!important}:host.error{background-color:var(--ngf-error)!important;color:var(--ngf-error-fg)!important}:host.danger{background-color:var(--ngf-danger)!important;color:var(--ngf-danger-fg)!important}:host.success{background-color:var(--ngf-success)!important;color:var(--ngf-success-fg)!important}:host.warning{background-color:var(--ngf-warning)!important;color:var(--ngf-warning-fg)!important}:host.info{background-color:var(--ngf-info)!important;color:var(--ngf-info-fg)!important}:host.light{background-color:var(--ngf-light)!important;color:var(--ngf-light-fg)!important}:host.dark{background-color:var(--ngf-dark)!important;color:var(--ngf-dark-fg)!important}:host>button{display:block;padding:0!important;background-color:transparent;border:none!important;width:100%!important;cursor:inherit!important;color:inherit!important;font-weight:500;font-size:1em}:host>button:focus{outline:none!important}:host .wrapper{display:flex;flex-direction:var(--flex-direction)!important;--flex-direction: row;--icon-border-left: none;--icon-border-right: 1px solid rgba(0, 0, 0, .2)}:host .wrapper.reversed{--flex-direction: row-reverse;--icon-border-left: 1px solid rgba(0, 0, 0, .2);--icon-border-right: none}:host .wrapper>.icon{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:1.05em;border-left:var(--icon-border-left)!important;border-right:var(--icon-border-right)!important;padding:0 .5em}:host .wrapper>.content{display:block;flex-grow:1;padding:.5em 1em;white-space:nowrap!important;text-align:center!important;text-overflow:ellipsis;overflow:hidden}\n"] }]
|
|
58
|
+
}], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], block: [{ type: i0.Input, args: [{ isSignal: true, alias: "block", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], bindClass: [{
|
|
59
|
+
type: HostBinding,
|
|
60
|
+
args: ['class']
|
|
61
|
+
}], isBlock: [{
|
|
62
|
+
type: HostBinding,
|
|
63
|
+
args: ['class.block']
|
|
64
|
+
}], isDisabled: [{
|
|
65
|
+
type: HostBinding,
|
|
66
|
+
args: ['class.disabled']
|
|
67
|
+
}] } });
|
|
68
|
+
|
|
69
|
+
class NgFluxDialogBodyComponent {
|
|
70
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
71
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: NgFluxDialogBodyComponent, isStandalone: true, selector: "ngf-dialog-body", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:block;padding:20px}\n"], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
72
|
+
}
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogBodyComponent, decorators: [{
|
|
74
|
+
type: Component,
|
|
75
|
+
args: [{ selector: 'ngf-dialog-body', changeDetection: ChangeDetectionStrategy.Eager, imports: [], template: "<ng-content></ng-content>\n", styles: [":host{display:block;padding:20px}\n"] }]
|
|
36
76
|
}] });
|
|
37
77
|
|
|
38
|
-
class
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
isLoading = computed(() => this.internal.isLoading(), ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
42
|
-
start(text = '') {
|
|
43
|
-
this.internal.start(text);
|
|
44
|
-
}
|
|
45
|
-
stop() {
|
|
46
|
-
this.internal.stop();
|
|
47
|
-
}
|
|
48
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxLoading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
49
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxLoading, providedIn: 'root' });
|
|
78
|
+
class NgFluxDialogFooterComponent {
|
|
79
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
80
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: NgFluxDialogFooterComponent, isStandalone: true, selector: "ngf-dialog-footer", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;flex-direction:row;align-items:center;justify-content:end;position:sticky;background-color:var(--ngf-dialog-background-color)!important;border-top:var(--ngf-dialog-border)!important;padding:7px 15px;bottom:0;gap:10px}\n"], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
50
81
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
52
|
-
type:
|
|
53
|
-
args: [{
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogFooterComponent, decorators: [{
|
|
83
|
+
type: Component,
|
|
84
|
+
args: [{ selector: 'ngf-dialog-footer', changeDetection: ChangeDetectionStrategy.Eager, imports: [], template: "<ng-content></ng-content>\n", styles: [":host{display:flex;flex-direction:row;align-items:center;justify-content:end;position:sticky;background-color:var(--ngf-dialog-background-color)!important;border-top:var(--ngf-dialog-border)!important;padding:7px 15px;bottom:0;gap:10px}\n"] }]
|
|
54
85
|
}] });
|
|
55
86
|
|
|
87
|
+
class NgFluxDialogRootComponent {
|
|
88
|
+
injector = inject(Injector);
|
|
89
|
+
viewContainer = viewChild.required('container', { read: ViewContainerRef });
|
|
90
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogRootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
91
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.0", type: NgFluxDialogRootComponent, isStandalone: true, selector: "ngf-dialog-root", viewQueries: [{ propertyName: "viewContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<ng-template #container></ng-template>\n", styles: [":host{display:block;width:0px;height:0px;visibility:hidden}\n"] });
|
|
92
|
+
}
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogRootComponent, decorators: [{
|
|
94
|
+
type: Component,
|
|
95
|
+
args: [{ selector: 'ngf-dialog-root', imports: [], template: "<ng-template #container></ng-template>\n", styles: [":host{display:block;width:0px;height:0px;visibility:hidden}\n"] }]
|
|
96
|
+
}], propDecorators: { viewContainer: [{ type: i0.ViewChild, args: ['container', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
97
|
+
|
|
56
98
|
class NgFluxDialogInternal {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
99
|
+
appRef = inject(ApplicationRef);
|
|
100
|
+
list = signal([], /* @ts-ignore */
|
|
101
|
+
...(ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []));
|
|
102
|
+
count = computed(() => this.list().length, /* @ts-ignore */
|
|
103
|
+
...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
104
|
+
isOpen = computed(() => this.count() > 0, /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
60
106
|
active = computed(() => {
|
|
61
107
|
const entries = this.cloneList();
|
|
62
108
|
if (!entries.length)
|
|
63
109
|
return null;
|
|
64
110
|
const lastIndex = entries.length - 1;
|
|
65
111
|
return entries[lastIndex];
|
|
66
|
-
},
|
|
67
|
-
|
|
112
|
+
}, /* @ts-ignore */
|
|
113
|
+
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
114
|
+
rootRef;
|
|
68
115
|
constructor() {
|
|
116
|
+
const { appRef } = this;
|
|
117
|
+
this.rootRef = createComponent(NgFluxDialogRootComponent, {
|
|
118
|
+
environmentInjector: appRef.injector,
|
|
119
|
+
});
|
|
69
120
|
const body = document.querySelector('body');
|
|
70
121
|
effect(() => {
|
|
71
122
|
const isOpen = this.isOpen();
|
|
@@ -82,6 +133,13 @@ class NgFluxDialogInternal {
|
|
|
82
133
|
}
|
|
83
134
|
});
|
|
84
135
|
}
|
|
136
|
+
initialize() {
|
|
137
|
+
const { appRef, rootRef } = this;
|
|
138
|
+
appRef.attachView(rootRef.hostView);
|
|
139
|
+
const elem = rootRef.location.nativeElement;
|
|
140
|
+
document.body.appendChild(elem);
|
|
141
|
+
}
|
|
142
|
+
// ==========================
|
|
85
143
|
cloneList = () => Array.from(this.list());
|
|
86
144
|
indexOf = (item) => {
|
|
87
145
|
const entries = this.list();
|
|
@@ -116,10 +174,10 @@ class NgFluxDialogInternal {
|
|
|
116
174
|
clear = () => {
|
|
117
175
|
this.list.set([]);
|
|
118
176
|
};
|
|
119
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
120
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogInternal, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
178
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogInternal, providedIn: 'root' });
|
|
121
179
|
}
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogInternal, decorators: [{
|
|
123
181
|
type: Injectable,
|
|
124
182
|
args: [{ providedIn: 'root' }]
|
|
125
183
|
}], ctorParameters: () => [] });
|
|
@@ -129,6 +187,234 @@ const NGF_DIALOG_CONFIG = new InjectionToken('ngf-dialog-config');
|
|
|
129
187
|
const NGF_DIALOG_INSTANCE = new InjectionToken('ngf-dialog-instance');
|
|
130
188
|
const NGF_DIALOG_CLOSE_FN = new InjectionToken('ngf-dialog-close-fn');
|
|
131
189
|
|
|
190
|
+
class NgFluxDialogHeaderComponent {
|
|
191
|
+
config = inject(NGF_DIALOG_CONFIG);
|
|
192
|
+
dialogRef = inject(NgFluxDialogRef);
|
|
193
|
+
icon = input(/* @ts-ignore */
|
|
194
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
195
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
196
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NgFluxDialogHeaderComponent, isStandalone: true, selector: "ngf-dialog-header", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (icon(); as ico) {\n <div class=\"left\">\n <i [ngClass]=\"ico\"></i>\n </div>\n}\n\n<div class=\"middle\">\n <ng-content></ng-content>\n</div>\n\n@if (config.closeBtn) {\n <div class=\"right\" title=\"Close\" (click)=\"dialogRef.close()\">\n <i class=\"ngf-icon close\"></i>\n </div>\n}\n", styles: [":host{display:flex;flex-direction:row;position:sticky;background-color:var(--ngf-dialog-background-color)!important;border-bottom:var(--ngf-dialog-border)!important;min-height:50px;top:0}:host>.left{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:10px}:host>.middle{display:flex;flex-direction:column;justify-content:center;align-items:start;overflow:hidden;text-overflow:ellipsis;padding:10px 20px;flex:1 0 0;width:0px}:host>.right{display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;padding:10px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
197
|
+
}
|
|
198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogHeaderComponent, decorators: [{
|
|
199
|
+
type: Component,
|
|
200
|
+
args: [{ selector: 'ngf-dialog-header', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgClass], template: "@if (icon(); as ico) {\n <div class=\"left\">\n <i [ngClass]=\"ico\"></i>\n </div>\n}\n\n<div class=\"middle\">\n <ng-content></ng-content>\n</div>\n\n@if (config.closeBtn) {\n <div class=\"right\" title=\"Close\" (click)=\"dialogRef.close()\">\n <i class=\"ngf-icon close\"></i>\n </div>\n}\n", styles: [":host{display:flex;flex-direction:row;position:sticky;background-color:var(--ngf-dialog-background-color)!important;border-bottom:var(--ngf-dialog-border)!important;min-height:50px;top:0}:host>.left{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:10px}:host>.middle{display:flex;flex-direction:column;justify-content:center;align-items:start;overflow:hidden;text-overflow:ellipsis;padding:10px 20px;flex:1 0 0;width:0px}:host>.right{display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;padding:10px}\n"] }]
|
|
201
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
|
|
202
|
+
|
|
203
|
+
class NgFluxLoadingComponent {
|
|
204
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
205
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: NgFluxLoadingComponent, isStandalone: true, selector: "ngf-loading", ngImport: i0, template: "<svg viewBox=\"25 25 50 50\">\n <circle r=\"20\" cy=\"50\" cx=\"50\"></circle>\n</svg>\n", styles: [":host{display:block}:host svg{width:3.25em;transform-origin:center;animation:rotate4 2s linear infinite}:host circle{fill:none;stroke:var(--ngf-loading-foreground)!important;stroke-width:5;stroke-dasharray:1,200;stroke-dashoffset:0;stroke-linecap:round;animation:dash4 1.5s ease-in-out infinite}@keyframes rotate4{to{transform:rotate(360deg)}}@keyframes dash4{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,200;stroke-dashoffset:-35px}to{stroke-dashoffset:-125px}}\n"], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
206
|
+
}
|
|
207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoadingComponent, decorators: [{
|
|
208
|
+
type: Component,
|
|
209
|
+
args: [{ selector: 'ngf-loading', changeDetection: ChangeDetectionStrategy.Eager, imports: [], template: "<svg viewBox=\"25 25 50 50\">\n <circle r=\"20\" cy=\"50\" cx=\"50\"></circle>\n</svg>\n", styles: [":host{display:block}:host svg{width:3.25em;transform-origin:center;animation:rotate4 2s linear infinite}:host circle{fill:none;stroke:var(--ngf-loading-foreground)!important;stroke-width:5;stroke-dasharray:1,200;stroke-dashoffset:0;stroke-linecap:round;animation:dash4 1.5s ease-in-out infinite}@keyframes rotate4{to{transform:rotate(360deg)}}@keyframes dash4{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,200;stroke-dashoffset:-35px}to{stroke-dashoffset:-125px}}\n"] }]
|
|
210
|
+
}] });
|
|
211
|
+
|
|
212
|
+
class NgFluxLoadingRootComponent {
|
|
213
|
+
config = inject(NGF_CONFIG);
|
|
214
|
+
injector = inject(Injector);
|
|
215
|
+
entries = signal([], /* @ts-ignore */
|
|
216
|
+
...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
|
|
217
|
+
count = computed(() => this.entries().length, /* @ts-ignore */
|
|
218
|
+
...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
219
|
+
isLoading = computed(() => this.count() > 0, /* @ts-ignore */
|
|
220
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
221
|
+
get showLoading() { return this.isLoading(); }
|
|
222
|
+
viewContainer = viewChild.required('container', { read: ViewContainerRef });
|
|
223
|
+
componentRef;
|
|
224
|
+
constructor() {
|
|
225
|
+
const { config, injector } = this;
|
|
226
|
+
effect(() => {
|
|
227
|
+
const viewContainer = this.viewContainer();
|
|
228
|
+
const component = config.loading?.component ?? NgFluxLoadingComponent;
|
|
229
|
+
const newInjector = Injector.create({
|
|
230
|
+
parent: injector,
|
|
231
|
+
providers: [],
|
|
232
|
+
});
|
|
233
|
+
this.componentRef = viewContainer.createComponent(component, {
|
|
234
|
+
injector: newInjector,
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
entry = computed(() => {
|
|
239
|
+
const entries = this.entries();
|
|
240
|
+
return entries.at(entries.length - 1);
|
|
241
|
+
}, /* @ts-ignore */
|
|
242
|
+
...(ngDevMode ? [{ debugName: "entry" }] : /* istanbul ignore next */ []));
|
|
243
|
+
start = (text = '') => this.entries.update(v => {
|
|
244
|
+
const entries = Array.from(v);
|
|
245
|
+
entries.push({ text });
|
|
246
|
+
return entries;
|
|
247
|
+
});
|
|
248
|
+
stop = () => this.entries.update(v => {
|
|
249
|
+
const entries = Array.from(v);
|
|
250
|
+
entries.pop();
|
|
251
|
+
return entries;
|
|
252
|
+
});
|
|
253
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoadingRootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
254
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.0", type: NgFluxLoadingRootComponent, isStandalone: true, selector: "ngf-loading-root", host: { properties: { "class.show": "this.showLoading" } }, viewQueries: [{ propertyName: "viewContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<div class=\"wrapper\">\n <ng-template #container></ng-template>\n</div>\n", styles: [":host{display:none;position:fixed;z-index:var(--ngf-loading-z-index)!important;inset:0}:host.show{display:block}:host>.wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:var(--ngf-loading-background)!important;height:100%!important;width:100%!important}\n"] });
|
|
255
|
+
}
|
|
256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoadingRootComponent, decorators: [{
|
|
257
|
+
type: Component,
|
|
258
|
+
args: [{ selector: 'ngf-loading-root', imports: [], template: "<div class=\"wrapper\">\n <ng-template #container></ng-template>\n</div>\n", styles: [":host{display:none;position:fixed;z-index:var(--ngf-loading-z-index)!important;inset:0}:host.show{display:block}:host>.wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:var(--ngf-loading-background)!important;height:100%!important;width:100%!important}\n"] }]
|
|
259
|
+
}], ctorParameters: () => [], propDecorators: { showLoading: [{
|
|
260
|
+
type: HostBinding,
|
|
261
|
+
args: ['class.show']
|
|
262
|
+
}], viewContainer: [{ type: i0.ViewChild, args: ['container', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
263
|
+
|
|
264
|
+
class NgFluxPaginationInfo {
|
|
265
|
+
data = input.required(/* @ts-ignore */
|
|
266
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
267
|
+
callback = output();
|
|
268
|
+
limit = model.required(/* @ts-ignore */
|
|
269
|
+
...(ngDevMode ? [{ debugName: "limit" }] : /* istanbul ignore next */ []));
|
|
270
|
+
limitEntries = input.required(/* @ts-ignore */
|
|
271
|
+
...(ngDevMode ? [{ debugName: "limitEntries" }] : /* istanbul ignore next */ []));
|
|
272
|
+
info = computed(() => {
|
|
273
|
+
const data = this.data();
|
|
274
|
+
const from = data.from.toLocaleString();
|
|
275
|
+
const to = data.to.toLocaleString();
|
|
276
|
+
const total = data.total.toLocaleString();
|
|
277
|
+
return `${from} - ${to} of ${total}`;
|
|
278
|
+
}, /* @ts-ignore */
|
|
279
|
+
...(ngDevMode ? [{ debugName: "info" }] : /* istanbul ignore next */ []));
|
|
280
|
+
disablePrev = computed(() => {
|
|
281
|
+
const data = this.data();
|
|
282
|
+
return data.currentPage <= 1;
|
|
283
|
+
}, /* @ts-ignore */
|
|
284
|
+
...(ngDevMode ? [{ debugName: "disablePrev" }] : /* istanbul ignore next */ []));
|
|
285
|
+
disableNext = computed(() => {
|
|
286
|
+
const data = this.data();
|
|
287
|
+
return data.currentPage >= data.lastPage;
|
|
288
|
+
}, /* @ts-ignore */
|
|
289
|
+
...(ngDevMode ? [{ debugName: "disableNext" }] : /* istanbul ignore next */ []));
|
|
290
|
+
prev() {
|
|
291
|
+
const data = this.data();
|
|
292
|
+
this.callback.emit({
|
|
293
|
+
page: data.currentPage - 1,
|
|
294
|
+
limit: data.perPage,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
next() {
|
|
298
|
+
const data = this.data();
|
|
299
|
+
this.callback.emit({
|
|
300
|
+
page: data.currentPage + 1,
|
|
301
|
+
limit: data.perPage,
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxPaginationInfo, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
305
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NgFluxPaginationInfo, isStandalone: true, selector: "ngf-pagination-info", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: true, transformFunction: null }, limitEntries: { classPropertyName: "limitEntries", publicName: "limitEntries", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { callback: "callback", limit: "limitChange" }, ngImport: i0, template: "<div class=\"wrapper\">\n <div class=\"block limit\">\n <div>Per page</div>\n <select name=\"\" id=\"\" [(ngModel)]=\"limit\">\n @for (entry of limitEntries(); track $index) {\n <option [value]=\"entry\">{{ entry }}</option>\n }\n </select>\n </div>\n\n <div class=\"block info\">\n <div>{{ info() }}</div>\n </div>\n\n <div class=\"block nav\">\n <button (click)=\"prev()\" [disabled]=\"disablePrev()\">\n <i class=\"ngf-icon chevron-left\"></i>\n </button>\n\n <button (click)=\"next()\" [disabled]=\"disableNext()\">\n <i class=\"ngf-icon chevron-right\"></i>\n </button>\n </div>\n</div>\n", styles: [":host{display:block;container:pagination/inline-size}:host .wrapper{display:flex;flex-direction:column;font-family:Poppins,sans-serif;align-items:end;text-align:center;font-size:.8rem;gap:5px}@container pagination (min-width: 400px){:host .wrapper{flex-direction:row;justify-content:end;align-items:center;gap:15px}}:host .wrapper .block{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:5px}:host .wrapper .limit>select{display:block;padding:2px 5px;font-size:inherit;outline:none!important;width:50px}:host .wrapper .nav>button{display:block;background-color:transparent;box-shadow:none!important;outline:none!important;cursor:pointer;border:none;padding:0}:host .wrapper .nav>button:disabled{cursor:default;color:#aaa}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
306
|
+
}
|
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxPaginationInfo, decorators: [{
|
|
308
|
+
type: Component,
|
|
309
|
+
args: [{ selector: 'ngf-pagination-info', changeDetection: ChangeDetectionStrategy.Eager, imports: [FormsModule], template: "<div class=\"wrapper\">\n <div class=\"block limit\">\n <div>Per page</div>\n <select name=\"\" id=\"\" [(ngModel)]=\"limit\">\n @for (entry of limitEntries(); track $index) {\n <option [value]=\"entry\">{{ entry }}</option>\n }\n </select>\n </div>\n\n <div class=\"block info\">\n <div>{{ info() }}</div>\n </div>\n\n <div class=\"block nav\">\n <button (click)=\"prev()\" [disabled]=\"disablePrev()\">\n <i class=\"ngf-icon chevron-left\"></i>\n </button>\n\n <button (click)=\"next()\" [disabled]=\"disableNext()\">\n <i class=\"ngf-icon chevron-right\"></i>\n </button>\n </div>\n</div>\n", styles: [":host{display:block;container:pagination/inline-size}:host .wrapper{display:flex;flex-direction:column;font-family:Poppins,sans-serif;align-items:end;text-align:center;font-size:.8rem;gap:5px}@container pagination (min-width: 400px){:host .wrapper{flex-direction:row;justify-content:end;align-items:center;gap:15px}}:host .wrapper .block{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:5px}:host .wrapper .limit>select{display:block;padding:2px 5px;font-size:inherit;outline:none!important;width:50px}:host .wrapper .nav>button{display:block;background-color:transparent;box-shadow:none!important;outline:none!important;cursor:pointer;border:none;padding:0}:host .wrapper .nav>button:disabled{cursor:default;color:#aaa}\n"] }]
|
|
310
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], callback: [{ type: i0.Output, args: ["callback"] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: true }] }, { type: i0.Output, args: ["limitChange"] }], limitEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "limitEntries", required: true }] }] } });
|
|
311
|
+
|
|
312
|
+
class NgFluxPagination {
|
|
313
|
+
config = inject(NGF_CONFIG);
|
|
314
|
+
data = input.required(/* @ts-ignore */
|
|
315
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
316
|
+
preload = input(this.config.pagination?.preload ?? false, /* @ts-ignore */
|
|
317
|
+
...(ngDevMode ? [{ debugName: "preload" }] : /* istanbul ignore next */ []));
|
|
318
|
+
transform = input(/* @ts-ignore */
|
|
319
|
+
...(ngDevMode ? [undefined, { debugName: "transform" }] : /* istanbul ignore next */ []));
|
|
320
|
+
limit = model(this.config.pagination?.limit ?? 10, /* @ts-ignore */
|
|
321
|
+
...(ngDevMode ? [{ debugName: "limit" }] : /* istanbul ignore next */ []));
|
|
322
|
+
limitEntries = input(this.config.pagination?.limitEntries ?? [5, 10, 20, 30, 40, 50], /* @ts-ignore */
|
|
323
|
+
...(ngDevMode ? [{ debugName: "limitEntries" }] : /* istanbul ignore next */ []));
|
|
324
|
+
callback = output();
|
|
325
|
+
value = computed(() => {
|
|
326
|
+
const { config } = this;
|
|
327
|
+
const data = this.data();
|
|
328
|
+
const transform = this.transform() ?? config.pagination?.transform;
|
|
329
|
+
if (!transform)
|
|
330
|
+
return data;
|
|
331
|
+
return {
|
|
332
|
+
currentPage: transform.getCurrentPage(data),
|
|
333
|
+
lastPage: transform.getLastPage(data),
|
|
334
|
+
perPage: transform.getPerPage(data),
|
|
335
|
+
from: transform.getFrom(data),
|
|
336
|
+
to: transform.getTo(data),
|
|
337
|
+
total: transform.getTotal(data),
|
|
338
|
+
data: transform.getData(data),
|
|
339
|
+
};
|
|
340
|
+
}, /* @ts-ignore */
|
|
341
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
342
|
+
constructor() {
|
|
343
|
+
let init = false;
|
|
344
|
+
effect(() => {
|
|
345
|
+
const limit = Number(this.limit());
|
|
346
|
+
const preload = untracked(this.preload);
|
|
347
|
+
const { currentPage: page } = untracked(this.value);
|
|
348
|
+
if (preload || init) {
|
|
349
|
+
this.callback.emit({ limit, page });
|
|
350
|
+
}
|
|
351
|
+
init = true;
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxPagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
355
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.0", type: NgFluxPagination, isStandalone: true, selector: "ngf-pagination", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, preload: { classPropertyName: "preload", publicName: "preload", isSignal: true, isRequired: false, transformFunction: null }, transform: { classPropertyName: "transform", publicName: "transform", isSignal: true, isRequired: false, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: false, transformFunction: null }, limitEntries: { classPropertyName: "limitEntries", publicName: "limitEntries", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { limit: "limitChange", callback: "callback" }, ngImport: i0, template: "<ngf-pagination-info\n [data]=\"value()\"\n [(limit)]=\"limit\"\n [limitEntries]=\"limitEntries()\"\n (callback)=\"callback.emit($event)\"\n></ngf-pagination-info>\n\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n\n<ngf-pagination-info\n [data]=\"value()\"\n [(limit)]=\"limit\"\n [limitEntries]=\"limitEntries()\"\n (callback)=\"callback.emit($event)\"\n></ngf-pagination-info>\n", styles: [":host{display:block}:host>.content{margin:20px 0}\n"], dependencies: [{ kind: "component", type: NgFluxPaginationInfo, selector: "ngf-pagination-info", inputs: ["data", "limit", "limitEntries"], outputs: ["callback", "limitChange"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
356
|
+
}
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxPagination, decorators: [{
|
|
358
|
+
type: Component,
|
|
359
|
+
args: [{ selector: 'ngf-pagination', changeDetection: ChangeDetectionStrategy.Eager, imports: [NgFluxPaginationInfo], template: "<ngf-pagination-info\n [data]=\"value()\"\n [(limit)]=\"limit\"\n [limitEntries]=\"limitEntries()\"\n (callback)=\"callback.emit($event)\"\n></ngf-pagination-info>\n\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n\n<ngf-pagination-info\n [data]=\"value()\"\n [(limit)]=\"limit\"\n [limitEntries]=\"limitEntries()\"\n (callback)=\"callback.emit($event)\"\n></ngf-pagination-info>\n", styles: [":host{display:block}:host>.content{margin:20px 0}\n"] }]
|
|
360
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], preload: [{ type: i0.Input, args: [{ isSignal: true, alias: "preload", required: false }] }], transform: [{ type: i0.Input, args: [{ isSignal: true, alias: "transform", required: false }] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: false }] }, { type: i0.Output, args: ["limitChange"] }], limitEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "limitEntries", required: false }] }], callback: [{ type: i0.Output, args: ["callback"] }] } });
|
|
361
|
+
|
|
362
|
+
class NgFluxLoadingInternal {
|
|
363
|
+
config = inject(NGF_CONFIG);
|
|
364
|
+
appRef = inject(ApplicationRef);
|
|
365
|
+
router = inject(Router, { optional: true });
|
|
366
|
+
rootRef;
|
|
367
|
+
constructor() {
|
|
368
|
+
const { appRef } = this;
|
|
369
|
+
this.rootRef = createComponent(NgFluxLoadingRootComponent, {
|
|
370
|
+
environmentInjector: appRef.injector,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
initialize() {
|
|
374
|
+
const { appRef, rootRef } = this;
|
|
375
|
+
appRef.attachView(rootRef.hostView);
|
|
376
|
+
const elem = rootRef.location.nativeElement;
|
|
377
|
+
document.body.appendChild(elem);
|
|
378
|
+
}
|
|
379
|
+
showOnRouteNavigation() {
|
|
380
|
+
const { config, router } = this;
|
|
381
|
+
if (router && config.loading?.showOnRouteNavigation) {
|
|
382
|
+
const root = this.rootRef.instance;
|
|
383
|
+
const navStart = filter(nav => nav instanceof NavigationStart);
|
|
384
|
+
router.events.pipe(navStart).subscribe(nav => root.start());
|
|
385
|
+
const navEnd = filter(nav => nav instanceof NavigationEnd);
|
|
386
|
+
router.events.pipe(navEnd).subscribe(nav => root.stop());
|
|
387
|
+
const navCancel = filter(nav => nav instanceof NavigationCancel);
|
|
388
|
+
router.events.pipe(navCancel).subscribe(nav => root.stop());
|
|
389
|
+
const navError = filter(nav => nav instanceof NavigationError);
|
|
390
|
+
router.events.pipe(navError).subscribe(nav => root.stop());
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoadingInternal, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
394
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoadingInternal, providedIn: 'root' });
|
|
395
|
+
}
|
|
396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoadingInternal, decorators: [{
|
|
397
|
+
type: Injectable,
|
|
398
|
+
args: [{ providedIn: 'root' }]
|
|
399
|
+
}], ctorParameters: () => [] });
|
|
400
|
+
|
|
401
|
+
class NgFluxLoading {
|
|
402
|
+
internal = inject(NgFluxLoadingInternal);
|
|
403
|
+
root = this.internal.rootRef.instance;
|
|
404
|
+
data = computed(() => this.root.entry(), /* @ts-ignore */
|
|
405
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
406
|
+
isLoading = computed(() => this.root.isLoading(), /* @ts-ignore */
|
|
407
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
408
|
+
start = (text = '') => this.root.start(text);
|
|
409
|
+
stop = () => this.root.stop();
|
|
410
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
411
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoading, providedIn: 'root' });
|
|
412
|
+
}
|
|
413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxLoading, decorators: [{
|
|
414
|
+
type: Injectable,
|
|
415
|
+
args: [{ providedIn: 'root' }]
|
|
416
|
+
}] });
|
|
417
|
+
|
|
132
418
|
class NgFluxDialogComponent {
|
|
133
419
|
injector = inject(Injector);
|
|
134
420
|
instance = inject(NgFluxDialogInstance);
|
|
@@ -144,9 +430,7 @@ class NgFluxDialogComponent {
|
|
|
144
430
|
const viewContainer = this.viewContainer();
|
|
145
431
|
const newInjector = Injector.create({
|
|
146
432
|
parent: injector,
|
|
147
|
-
providers: [
|
|
148
|
-
{ provide: NGF_DIALOG_DATA, useValue: config?.data ?? null },
|
|
149
|
-
]
|
|
433
|
+
providers: [{ provide: NGF_DIALOG_DATA, useValue: config?.data ?? null }],
|
|
150
434
|
});
|
|
151
435
|
this.componentRef = viewContainer.createComponent(content, {
|
|
152
436
|
injector: newInjector,
|
|
@@ -176,7 +460,8 @@ class NgFluxDialogComponent {
|
|
|
176
460
|
onAnimationComplete = (e) => {
|
|
177
461
|
switch (e.animationName) {
|
|
178
462
|
case 'ngfDialogOpen':
|
|
179
|
-
{
|
|
463
|
+
{
|
|
464
|
+
}
|
|
180
465
|
break;
|
|
181
466
|
case 'ngfDialogClose':
|
|
182
467
|
{
|
|
@@ -194,12 +479,12 @@ class NgFluxDialogComponent {
|
|
|
194
479
|
const ref = this.componentRef.location;
|
|
195
480
|
ref.nativeElement.classList.add('close');
|
|
196
481
|
}
|
|
197
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
198
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
482
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
483
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.0", type: NgFluxDialogComponent, isStandalone: true, selector: "ngf-dialog", host: { listeners: { "click": "onBackdropClick($event)" } }, viewQueries: [{ propertyName: "viewContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<div class=\"wrapper\">\n <div class=\"content\">\n <ng-template #container></ng-template>\n </div>\n</div>\n", styles: [":host{display:block;position:fixed;background-color:var(--ngf-dialog-backdrop-color)!important;visibility:visible!important;z-index:var(--ngf-dialog-z-index)!important;inset:0}:host>.wrapper{display:block;width:100%!important;height:100%!important;overflow:hidden auto}:host>.wrapper>.content{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:100%;min-height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
199
484
|
}
|
|
200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
485
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialogComponent, decorators: [{
|
|
201
486
|
type: Component,
|
|
202
|
-
args: [{ selector: 'ngf-dialog', imports: [], template: "<div class=\"wrapper\">\n <div class=\"content\">\n <ng-template #container></ng-template>\n </div>\n</div>\n", styles: [":host{display:block;position:fixed;background-color:var(--ngf-dialog-backdrop-color)!important;visibility:visible!important;z-index:var(--ngf-dialog-z-index)!important;inset:0}:host>.wrapper{display:block;width:100%!important;height:100%!important;overflow:hidden auto}:host>.wrapper>.content{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:100%;min-height:100%}\n"] }]
|
|
487
|
+
args: [{ selector: 'ngf-dialog', changeDetection: ChangeDetectionStrategy.Eager, imports: [], template: "<div class=\"wrapper\">\n <div class=\"content\">\n <ng-template #container></ng-template>\n </div>\n</div>\n", styles: [":host{display:block;position:fixed;background-color:var(--ngf-dialog-backdrop-color)!important;visibility:visible!important;z-index:var(--ngf-dialog-z-index)!important;inset:0}:host>.wrapper{display:block;width:100%!important;height:100%!important;overflow:hidden auto}:host>.wrapper>.content{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:100%;min-height:100%}\n"] }]
|
|
203
488
|
}], ctorParameters: () => [], propDecorators: { viewContainer: [{ type: i0.ViewChild, args: ['container', { ...{ read: ViewContainerRef }, isSignal: true }] }], onBackdropClick: [{
|
|
204
489
|
type: HostListener,
|
|
205
490
|
args: ['click', ['$event']]
|
|
@@ -301,96 +586,21 @@ class NgFluxDialogInstance {
|
|
|
301
586
|
}
|
|
302
587
|
}
|
|
303
588
|
|
|
304
|
-
class NgFluxDialogHeaderComponent {
|
|
305
|
-
config = inject(NGF_DIALOG_CONFIG);
|
|
306
|
-
dialogRef = inject(NgFluxDialogRef);
|
|
307
|
-
icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
308
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxDialogHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
309
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: NgFluxDialogHeaderComponent, isStandalone: true, selector: "ngf-dialog-header", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (icon(); as ico) {\n <div class=\"left\">\n <i [ngClass]=\"ico\"></i>\n </div>\n}\n\n<div class=\"middle\">\n <ng-content></ng-content>\n</div>\n\n@if (config.closeBtn) {\n <div class=\"right\" title=\"Close\" (click)=\"dialogRef.close()\">\n <i class=\"ngf-icon close\"></i>\n </div>\n}\n", styles: [":host{display:flex;flex-direction:row;position:sticky;background-color:var(--ngf-dialog-background-color)!important;border-bottom:var(--ngf-dialog-border)!important;min-height:50px;top:0}:host>.left{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:10px}:host>.middle{display:flex;flex-direction:column;justify-content:center;align-items:start;overflow:hidden;text-overflow:ellipsis;padding:10px 20px;flex:1 0 0;width:0px}:host>.right{display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;padding:10px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
310
|
-
}
|
|
311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxDialogHeaderComponent, decorators: [{
|
|
312
|
-
type: Component,
|
|
313
|
-
args: [{ selector: 'ngf-dialog-header', imports: [
|
|
314
|
-
NgClass,
|
|
315
|
-
], template: "@if (icon(); as ico) {\n <div class=\"left\">\n <i [ngClass]=\"ico\"></i>\n </div>\n}\n\n<div class=\"middle\">\n <ng-content></ng-content>\n</div>\n\n@if (config.closeBtn) {\n <div class=\"right\" title=\"Close\" (click)=\"dialogRef.close()\">\n <i class=\"ngf-icon close\"></i>\n </div>\n}\n", styles: [":host{display:flex;flex-direction:row;position:sticky;background-color:var(--ngf-dialog-background-color)!important;border-bottom:var(--ngf-dialog-border)!important;min-height:50px;top:0}:host>.left{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:10px}:host>.middle{display:flex;flex-direction:column;justify-content:center;align-items:start;overflow:hidden;text-overflow:ellipsis;padding:10px 20px;flex:1 0 0;width:0px}:host>.right{display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;padding:10px}\n"] }]
|
|
316
|
-
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
|
|
317
|
-
|
|
318
|
-
class NgFluxDialogBodyComponent {
|
|
319
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxDialogBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
320
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: NgFluxDialogBodyComponent, isStandalone: true, selector: "ngf-dialog-body", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:block;padding:20px}\n"] });
|
|
321
|
-
}
|
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxDialogBodyComponent, decorators: [{
|
|
323
|
-
type: Component,
|
|
324
|
-
args: [{ selector: 'ngf-dialog-body', imports: [], template: "<ng-content></ng-content>\n", styles: [":host{display:block;padding:20px}\n"] }]
|
|
325
|
-
}] });
|
|
326
|
-
|
|
327
|
-
class NgFluxDialogFooterComponent {
|
|
328
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxDialogFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
329
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: NgFluxDialogFooterComponent, isStandalone: true, selector: "ngf-dialog-footer", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;flex-direction:row;align-items:center;justify-content:end;position:sticky;background-color:var(--ngf-dialog-background-color)!important;border-top:var(--ngf-dialog-border)!important;padding:7px 15px;bottom:0;gap:10px}\n"] });
|
|
330
|
-
}
|
|
331
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxDialogFooterComponent, decorators: [{
|
|
332
|
-
type: Component,
|
|
333
|
-
args: [{ selector: 'ngf-dialog-footer', imports: [], template: "<ng-content></ng-content>\n", styles: [":host{display:flex;flex-direction:row;align-items:center;justify-content:end;position:sticky;background-color:var(--ngf-dialog-background-color)!important;border-top:var(--ngf-dialog-border)!important;padding:7px 15px;bottom:0;gap:10px}\n"] }]
|
|
334
|
-
}] });
|
|
335
|
-
|
|
336
|
-
class NgFluxButton {
|
|
337
|
-
ref = inject(ElementRef);
|
|
338
|
-
icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
339
|
-
theme = input(...(ngDevMode ? [undefined, { debugName: "theme" }] : /* istanbul ignore next */ []));
|
|
340
|
-
type = input(...(ngDevMode ? [undefined, { debugName: "type" }] : /* istanbul ignore next */ []));
|
|
341
|
-
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : /* istanbul ignore next */ []));
|
|
342
|
-
direction = input(...(ngDevMode ? [undefined, { debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
343
|
-
block = input(false, ...(ngDevMode ? [{ debugName: "block" }] : /* istanbul ignore next */ []));
|
|
344
|
-
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
345
|
-
btnClassNames = computed(() => {
|
|
346
|
-
const names = [];
|
|
347
|
-
const direction = this.direction() ?? 'normal';
|
|
348
|
-
if (direction === 'reversed')
|
|
349
|
-
names.push(direction);
|
|
350
|
-
return names;
|
|
351
|
-
}, ...(ngDevMode ? [{ debugName: "btnClassNames" }] : /* istanbul ignore next */ []));
|
|
352
|
-
classNames = computed(() => [
|
|
353
|
-
this.theme() ?? 'default',
|
|
354
|
-
this.size() ?? 'md',
|
|
355
|
-
].join(' '), ...(ngDevMode ? [{ debugName: "classNames" }] : /* istanbul ignore next */ []));
|
|
356
|
-
get bindClass() { return this.classNames(); }
|
|
357
|
-
get isBlock() { return this.block(); }
|
|
358
|
-
get isDisabled() { return this.disabled(); }
|
|
359
|
-
constructor() {
|
|
360
|
-
const { ref: { nativeElement } } = this;
|
|
361
|
-
nativeElement.tabIndex = 1;
|
|
362
|
-
}
|
|
363
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
364
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: NgFluxButton, isStandalone: true, selector: "ngf-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, block: { classPropertyName: "block", publicName: "block", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.bindClass", "class.block": "this.isBlock", "class.disabled": "this.isDisabled" } }, ngImport: i0, template: "<button [type]=\"type()\" [disabled]=\"disabled()\">\n <div class=\"wrapper\" [ngClass]=\"btnClassNames()\">\n @if (icon(); as ico) {\n <div class=\"icon\">\n <i [ngClass]=\"ico\"></i>\n </div>\n }\n\n <div class=\"content\">\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</button>\n", styles: [":host{display:inline-block;border:1px solid rgba(0,0,0,.2);border-radius:3px;cursor:pointer;font-size:1rem;overflow:clip}:host.block{display:block}:host.disabled{opacity:.5!important;-webkit-user-select:none!important;user-select:none!important;cursor:not-allowed}:host.xs{font-size:.6rem}:host.sm{font-size:.8rem}:host.md{font-size:1rem}:host.lg{font-size:1.25rem}:host.xl{font-size:1.5rem}:host.default{background-color:var(--ngf-default)!important;color:var(--ngf-default-fg)!important}:host.primary{background-color:var(--ngf-primary)!important;color:var(--ngf-primary-fg)!important}:host.secondary{background-color:var(--ngf-secondary)!important;color:var(--ngf-secondary-fg)!important}:host.error{background-color:var(--ngf-error)!important;color:var(--ngf-error-fg)!important}:host.danger{background-color:var(--ngf-danger)!important;color:var(--ngf-danger-fg)!important}:host.success{background-color:var(--ngf-success)!important;color:var(--ngf-success-fg)!important}:host.warning{background-color:var(--ngf-warning)!important;color:var(--ngf-warning-fg)!important}:host.info{background-color:var(--ngf-info)!important;color:var(--ngf-info-fg)!important}:host.light{background-color:var(--ngf-light)!important;color:var(--ngf-light-fg)!important}:host.dark{background-color:var(--ngf-dark)!important;color:var(--ngf-dark-fg)!important}:host>button{display:block;padding:0!important;background-color:transparent;border:none!important;width:100%!important;cursor:inherit!important;color:inherit!important;font-weight:500;font-size:1em}:host>button:focus{outline:none!important}:host .wrapper{display:flex;flex-direction:var(--flex-direction)!important;--flex-direction: row;--icon-border-left: none;--icon-border-right: 1px solid rgba(0, 0, 0, .2)}:host .wrapper.reversed{--flex-direction: row-reverse;--icon-border-left: 1px solid rgba(0, 0, 0, .2);--icon-border-right: none}:host .wrapper>.icon{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:1.05em;border-left:var(--icon-border-left)!important;border-right:var(--icon-border-right)!important;padding:0 .5em}:host .wrapper>.content{display:block;flex-grow:1;padding:.5em 1em;white-space:nowrap!important;text-align:center!important;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
365
|
-
}
|
|
366
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxButton, decorators: [{
|
|
367
|
-
type: Component,
|
|
368
|
-
args: [{ selector: 'ngf-button', imports: [NgClass], template: "<button [type]=\"type()\" [disabled]=\"disabled()\">\n <div class=\"wrapper\" [ngClass]=\"btnClassNames()\">\n @if (icon(); as ico) {\n <div class=\"icon\">\n <i [ngClass]=\"ico\"></i>\n </div>\n }\n\n <div class=\"content\">\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</button>\n", styles: [":host{display:inline-block;border:1px solid rgba(0,0,0,.2);border-radius:3px;cursor:pointer;font-size:1rem;overflow:clip}:host.block{display:block}:host.disabled{opacity:.5!important;-webkit-user-select:none!important;user-select:none!important;cursor:not-allowed}:host.xs{font-size:.6rem}:host.sm{font-size:.8rem}:host.md{font-size:1rem}:host.lg{font-size:1.25rem}:host.xl{font-size:1.5rem}:host.default{background-color:var(--ngf-default)!important;color:var(--ngf-default-fg)!important}:host.primary{background-color:var(--ngf-primary)!important;color:var(--ngf-primary-fg)!important}:host.secondary{background-color:var(--ngf-secondary)!important;color:var(--ngf-secondary-fg)!important}:host.error{background-color:var(--ngf-error)!important;color:var(--ngf-error-fg)!important}:host.danger{background-color:var(--ngf-danger)!important;color:var(--ngf-danger-fg)!important}:host.success{background-color:var(--ngf-success)!important;color:var(--ngf-success-fg)!important}:host.warning{background-color:var(--ngf-warning)!important;color:var(--ngf-warning-fg)!important}:host.info{background-color:var(--ngf-info)!important;color:var(--ngf-info-fg)!important}:host.light{background-color:var(--ngf-light)!important;color:var(--ngf-light-fg)!important}:host.dark{background-color:var(--ngf-dark)!important;color:var(--ngf-dark-fg)!important}:host>button{display:block;padding:0!important;background-color:transparent;border:none!important;width:100%!important;cursor:inherit!important;color:inherit!important;font-weight:500;font-size:1em}:host>button:focus{outline:none!important}:host .wrapper{display:flex;flex-direction:var(--flex-direction)!important;--flex-direction: row;--icon-border-left: none;--icon-border-right: 1px solid rgba(0, 0, 0, .2)}:host .wrapper.reversed{--flex-direction: row-reverse;--icon-border-left: 1px solid rgba(0, 0, 0, .2);--icon-border-right: none}:host .wrapper>.icon{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:1.05em;border-left:var(--icon-border-left)!important;border-right:var(--icon-border-right)!important;padding:0 .5em}:host .wrapper>.content{display:block;flex-grow:1;padding:.5em 1em;white-space:nowrap!important;text-align:center!important;text-overflow:ellipsis;overflow:hidden}\n"] }]
|
|
369
|
-
}], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], block: [{ type: i0.Input, args: [{ isSignal: true, alias: "block", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], bindClass: [{
|
|
370
|
-
type: HostBinding,
|
|
371
|
-
args: ['class']
|
|
372
|
-
}], isBlock: [{
|
|
373
|
-
type: HostBinding,
|
|
374
|
-
args: ['class.block']
|
|
375
|
-
}], isDisabled: [{
|
|
376
|
-
type: HostBinding,
|
|
377
|
-
args: ['class.disabled']
|
|
378
|
-
}] } });
|
|
379
|
-
|
|
380
589
|
class NgFluxAlertDialog {
|
|
381
590
|
config = inject(NGF_CONFIG);
|
|
382
591
|
dialogRef = inject(NgFluxDialogRef);
|
|
383
592
|
options = inject(NGF_DIALOG_DATA);
|
|
384
593
|
buttons = computed(() => {
|
|
385
594
|
const config = this.config.dialog?.alert || {};
|
|
386
|
-
return this.options.buttons ?? [
|
|
595
|
+
return (this.options.buttons ?? [
|
|
387
596
|
Object.assign({
|
|
388
597
|
text: 'Okay',
|
|
389
598
|
theme: 'primary',
|
|
390
599
|
onClick: (e, btn, ref) => ref.close(),
|
|
391
600
|
}, config.okayButton),
|
|
392
|
-
];
|
|
393
|
-
},
|
|
601
|
+
]);
|
|
602
|
+
}, /* @ts-ignore */
|
|
603
|
+
...(ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []));
|
|
394
604
|
onButtonClick(e, btn) {
|
|
395
605
|
const { dialogRef } = this;
|
|
396
606
|
if (btn.onClick) {
|
|
@@ -400,12 +610,12 @@ class NgFluxAlertDialog {
|
|
|
400
610
|
dialogRef.close();
|
|
401
611
|
}
|
|
402
612
|
}
|
|
403
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
404
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
613
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxAlertDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
614
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NgFluxAlertDialog, isStandalone: true, selector: "ngf-dialog-box-alert", ngImport: i0, template: "<ngf-dialog-header>\n <h1 ngf-dialog-title>{{ options.title }}</h1>\n</ngf-dialog-header>\n\n<ngf-dialog-body>\n <div [innerHTML]=\"options.content\"></div>\n</ngf-dialog-body>\n\n<ngf-dialog-footer>\n @for (btn of buttons(); track $index) {\n @switch (btn) {\n @case ('flex') {<div ngf-flex-x></div>}\n\n @default {\n <ngf-button [theme]=\"btn.theme\" [size]=\"btn.size\" [direction]=\"btn.direction\" (click)=\"onButtonClick($event, btn)\">\n <span>{{ btn.text }}</span>\n </ngf-button>\n }\n }\n }\n</ngf-dialog-footer>\n", styles: [":host{display:block;width:90%;max-width:500px;background-color:#fff}\n"], dependencies: [{ kind: "component", type: NgFluxButton, selector: "ngf-button", inputs: ["icon", "theme", "type", "size", "direction", "block", "disabled"] }, { kind: "component", type: NgFluxDialogHeaderComponent, selector: "ngf-dialog-header", inputs: ["icon"] }, { kind: "component", type: NgFluxDialogBodyComponent, selector: "ngf-dialog-body" }, { kind: "component", type: NgFluxDialogFooterComponent, selector: "ngf-dialog-footer" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
405
615
|
}
|
|
406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
616
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxAlertDialog, decorators: [{
|
|
407
617
|
type: Component,
|
|
408
|
-
args: [{ selector: 'ngf-dialog-box-alert', imports: [
|
|
618
|
+
args: [{ selector: 'ngf-dialog-box-alert', changeDetection: ChangeDetectionStrategy.Eager, imports: [
|
|
409
619
|
NgFluxButton,
|
|
410
620
|
NgFluxDialogHeaderComponent,
|
|
411
621
|
NgFluxDialogBodyComponent,
|
|
@@ -420,27 +630,30 @@ class NgFluxConfirmDialog {
|
|
|
420
630
|
buttons = computed(() => {
|
|
421
631
|
const config = this.config.dialog?.prompt ?? {};
|
|
422
632
|
return [
|
|
423
|
-
this.options.cancelButton ??
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
633
|
+
this.options.cancelButton ??
|
|
634
|
+
Object.assign({
|
|
635
|
+
text: 'Cancel',
|
|
636
|
+
theme: 'dark',
|
|
637
|
+
onClick: (e, btn, dialogRef) => dialogRef.close(),
|
|
638
|
+
}, config.cancelButton),
|
|
639
|
+
this.options.okayButton ??
|
|
640
|
+
Object.assign({
|
|
641
|
+
text: 'Okay',
|
|
642
|
+
theme: 'primary',
|
|
643
|
+
onClick: (e, btn, dialogRef) => dialogRef.close(true),
|
|
644
|
+
}, config.submitButton),
|
|
433
645
|
];
|
|
434
|
-
},
|
|
646
|
+
}, /* @ts-ignore */
|
|
647
|
+
...(ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []));
|
|
435
648
|
onButtonClick(e, btn) {
|
|
436
649
|
btn.onClick?.call(null, e, btn, this.dialogRef);
|
|
437
650
|
}
|
|
438
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
439
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
651
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxConfirmDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
652
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NgFluxConfirmDialog, isStandalone: true, selector: "ngf-dialog-box-confirm", ngImport: i0, template: "<ngf-dialog-header>\n <h1 ngf-dialog-title>{{ options.title }}</h1>\n</ngf-dialog-header>\n\n<ngf-dialog-body>\n <div [innerHTML]=\"options.content\"></div>\n</ngf-dialog-body>\n\n<ngf-dialog-footer>\n @for (btn of buttons(); track $index) {\n <ngf-button [theme]=\"btn.theme\" (click)=\"onButtonClick($event, btn)\">\n <span>{{ btn.text }}</span>\n </ngf-button>\n }\n</ngf-dialog-footer>\n", styles: [":host{display:block;width:90%;max-width:500px;background-color:#fff}\n"], dependencies: [{ kind: "component", type: NgFluxButton, selector: "ngf-button", inputs: ["icon", "theme", "type", "size", "direction", "block", "disabled"] }, { kind: "component", type: NgFluxDialogHeaderComponent, selector: "ngf-dialog-header", inputs: ["icon"] }, { kind: "component", type: NgFluxDialogFooterComponent, selector: "ngf-dialog-footer" }, { kind: "component", type: NgFluxDialogBodyComponent, selector: "ngf-dialog-body" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
440
653
|
}
|
|
441
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
654
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxConfirmDialog, decorators: [{
|
|
442
655
|
type: Component,
|
|
443
|
-
args: [{ selector: 'ngf-dialog-box-confirm', imports: [
|
|
656
|
+
args: [{ selector: 'ngf-dialog-box-confirm', changeDetection: ChangeDetectionStrategy.Eager, imports: [
|
|
444
657
|
NgFluxButton,
|
|
445
658
|
NgFluxDialogHeaderComponent,
|
|
446
659
|
NgFluxDialogFooterComponent,
|
|
@@ -452,34 +665,39 @@ class NgFluxPromptDialog {
|
|
|
452
665
|
config = inject(NGF_CONFIG);
|
|
453
666
|
dialogRef = inject(NgFluxDialogRef);
|
|
454
667
|
options = inject(NGF_DIALOG_DATA);
|
|
455
|
-
text = signal('',
|
|
456
|
-
|
|
668
|
+
text = signal('', /* @ts-ignore */
|
|
669
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
670
|
+
value = computed(() => this.text().trim(), /* @ts-ignore */
|
|
671
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
457
672
|
buttons = computed(() => {
|
|
458
673
|
const config = this.config.dialog?.prompt ?? {};
|
|
459
674
|
const value = this.value();
|
|
460
675
|
return [
|
|
461
|
-
this.options.cancelButton ??
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
676
|
+
this.options.cancelButton ??
|
|
677
|
+
Object.assign({
|
|
678
|
+
text: 'Cancel',
|
|
679
|
+
theme: 'dark',
|
|
680
|
+
onClick: (e, btn, dialogRef) => dialogRef.close(),
|
|
681
|
+
}, config.cancelButton),
|
|
682
|
+
this.options.submitButton ??
|
|
683
|
+
Object.assign({
|
|
684
|
+
text: 'Submit',
|
|
685
|
+
theme: 'primary',
|
|
686
|
+
onClick: (e, btn, dialogRef) => dialogRef.close(value),
|
|
687
|
+
disabled: () => !value,
|
|
688
|
+
}, config.submitButton),
|
|
472
689
|
];
|
|
473
|
-
},
|
|
690
|
+
}, /* @ts-ignore */
|
|
691
|
+
...(ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []));
|
|
474
692
|
onButtonClick(e, btn) {
|
|
475
693
|
btn.onClick?.call(null, e, btn, this.dialogRef);
|
|
476
694
|
}
|
|
477
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
478
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
695
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxPromptDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
696
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NgFluxPromptDialog, isStandalone: true, selector: "ngf-dialog-box-prompt", ngImport: i0, template: "<ngf-dialog-header>\n <h1 ngf-dialog-title>{{ options.title }}</h1>\n</ngf-dialog-header>\n\n<ngf-dialog-body>\n <div class=\"content\" [innerHTML]=\"options.content\"></div>\n <input type=\"text\" name=\"text\" [(ngModel)]=\"text\">\n</ngf-dialog-body>\n\n<ngf-dialog-footer>\n @for (btn of buttons(); track $index) {\n <ngf-button [theme]=\"btn.theme\" (click)=\"onButtonClick($event, btn)\" [disabled]=\"btn.disabled?.() ?? false\">\n <span>{{ btn.text }}</span>\n </ngf-button>\n }\n</ngf-dialog-footer>\n", styles: [":host{display:block;width:90%;max-width:350px;background-color:#fff}:host .content{margin:0 0 10px}:host input{display:block;width:100%!important;border:1px solid #DDD;background-color:#fff;padding:10px 15px;font-size:1.2rem}:host input:focus{outline:2px solid #DDD;box-shadow:none!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: NgFluxButton, selector: "ngf-button", inputs: ["icon", "theme", "type", "size", "direction", "block", "disabled"] }, { kind: "component", type: NgFluxDialogHeaderComponent, selector: "ngf-dialog-header", inputs: ["icon"] }, { kind: "component", type: NgFluxDialogFooterComponent, selector: "ngf-dialog-footer" }, { kind: "component", type: NgFluxDialogBodyComponent, selector: "ngf-dialog-body" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
479
697
|
}
|
|
480
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxPromptDialog, decorators: [{
|
|
481
699
|
type: Component,
|
|
482
|
-
args: [{ selector: 'ngf-dialog-box-prompt', imports: [
|
|
700
|
+
args: [{ selector: 'ngf-dialog-box-prompt', changeDetection: ChangeDetectionStrategy.Eager, imports: [
|
|
483
701
|
FormsModule,
|
|
484
702
|
NgFluxButton,
|
|
485
703
|
NgFluxDialogHeaderComponent,
|
|
@@ -497,11 +715,7 @@ class NgFluxDialog {
|
|
|
497
715
|
config.closeOnBackBtn ??= true;
|
|
498
716
|
config.closeOnEsc ??= true;
|
|
499
717
|
const { internal } = this;
|
|
500
|
-
const root = internal.
|
|
501
|
-
if (!root)
|
|
502
|
-
throw new Error('"ngf-dialog-root" component not found. ' +
|
|
503
|
-
'Use "<ngf-root></ngf-root>" in your root component to enable all NgFlux features or ' +
|
|
504
|
-
'add "<ngf-dialog-root></ngf-dialog-root>" to your root component to enable the NgFluxDialog feature.');
|
|
718
|
+
const root = internal.rootRef.instance;
|
|
505
719
|
const onClosed = (ins) => {
|
|
506
720
|
internal.remove(ins);
|
|
507
721
|
};
|
|
@@ -546,10 +760,10 @@ class NgFluxDialog {
|
|
|
546
760
|
});
|
|
547
761
|
return dialog.closed;
|
|
548
762
|
}
|
|
549
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
550
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
763
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialog, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
764
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialog, providedIn: 'root' });
|
|
551
765
|
}
|
|
552
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NgFluxDialog, decorators: [{
|
|
553
767
|
type: Injectable,
|
|
554
768
|
args: [{ providedIn: 'root' }]
|
|
555
769
|
}] });
|
|
@@ -562,170 +776,18 @@ const provideNgFlux = (config) => {
|
|
|
562
776
|
NgFluxDialogInternal,
|
|
563
777
|
NgFluxLoading,
|
|
564
778
|
NgFluxLoadingInternal,
|
|
779
|
+
provideAppInitializer(() => {
|
|
780
|
+
const dialog = inject(NgFluxDialogInternal);
|
|
781
|
+
dialog.initialize();
|
|
782
|
+
}),
|
|
783
|
+
provideAppInitializer(() => {
|
|
784
|
+
const loading = inject(NgFluxLoadingInternal);
|
|
785
|
+
loading.initialize();
|
|
786
|
+
loading.showOnRouteNavigation();
|
|
787
|
+
}),
|
|
565
788
|
]);
|
|
566
789
|
};
|
|
567
790
|
|
|
568
|
-
class NgFluxDialogRootComponent {
|
|
569
|
-
internal = inject(NgFluxDialogInternal);
|
|
570
|
-
injector = inject(Injector);
|
|
571
|
-
viewContainer = viewChild.required('container', { read: ViewContainerRef });
|
|
572
|
-
constructor() {
|
|
573
|
-
const { internal } = this;
|
|
574
|
-
internal.root.set(this);
|
|
575
|
-
}
|
|
576
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxDialogRootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
577
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.14", type: NgFluxDialogRootComponent, isStandalone: true, selector: "ngf-dialog-root", viewQueries: [{ propertyName: "viewContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<ng-template #container></ng-template>\n", styles: [":host{display:block;width:0px;height:0px;visibility:hidden}\n"] });
|
|
578
|
-
}
|
|
579
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxDialogRootComponent, decorators: [{
|
|
580
|
-
type: Component,
|
|
581
|
-
args: [{ selector: 'ngf-dialog-root', imports: [], template: "<ng-template #container></ng-template>\n", styles: [":host{display:block;width:0px;height:0px;visibility:hidden}\n"] }]
|
|
582
|
-
}], ctorParameters: () => [], propDecorators: { viewContainer: [{ type: i0.ViewChild, args: ['container', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
583
|
-
|
|
584
|
-
class NgFluxLoadingComponent {
|
|
585
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxLoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
586
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: NgFluxLoadingComponent, isStandalone: true, selector: "ngf-loading", ngImport: i0, template: "<svg viewBox=\"25 25 50 50\">\n <circle r=\"20\" cy=\"50\" cx=\"50\"></circle>\n</svg>\n", styles: [":host{display:block}:host svg{width:3.25em;transform-origin:center;animation:rotate4 2s linear infinite}:host circle{fill:none;stroke:var(--ngf-loading-foreground)!important;stroke-width:5;stroke-dasharray:1,200;stroke-dashoffset:0;stroke-linecap:round;animation:dash4 1.5s ease-in-out infinite}@keyframes rotate4{to{transform:rotate(360deg)}}@keyframes dash4{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,200;stroke-dashoffset:-35px}to{stroke-dashoffset:-125px}}\n"] });
|
|
587
|
-
}
|
|
588
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxLoadingComponent, decorators: [{
|
|
589
|
-
type: Component,
|
|
590
|
-
args: [{ selector: 'ngf-loading', imports: [], template: "<svg viewBox=\"25 25 50 50\">\n <circle r=\"20\" cy=\"50\" cx=\"50\"></circle>\n</svg>\n", styles: [":host{display:block}:host svg{width:3.25em;transform-origin:center;animation:rotate4 2s linear infinite}:host circle{fill:none;stroke:var(--ngf-loading-foreground)!important;stroke-width:5;stroke-dasharray:1,200;stroke-dashoffset:0;stroke-linecap:round;animation:dash4 1.5s ease-in-out infinite}@keyframes rotate4{to{transform:rotate(360deg)}}@keyframes dash4{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,200;stroke-dashoffset:-35px}to{stroke-dashoffset:-125px}}\n"] }]
|
|
591
|
-
}] });
|
|
592
|
-
|
|
593
|
-
class NgFluxLoadingRootComponent {
|
|
594
|
-
config = inject(NGF_CONFIG);
|
|
595
|
-
internal = inject(NgFluxLoadingInternal);
|
|
596
|
-
injector = inject(Injector);
|
|
597
|
-
get isLoading() { return this.internal.isLoading(); }
|
|
598
|
-
viewContainer = viewChild.required('container', { read: ViewContainerRef });
|
|
599
|
-
componentRef;
|
|
600
|
-
constructor() {
|
|
601
|
-
const { config, injector } = this;
|
|
602
|
-
effect(() => {
|
|
603
|
-
const viewContainer = this.viewContainer();
|
|
604
|
-
const component = config.loading?.component ?? NgFluxLoadingComponent;
|
|
605
|
-
const newInjector = Injector.create({
|
|
606
|
-
parent: injector,
|
|
607
|
-
providers: [],
|
|
608
|
-
});
|
|
609
|
-
this.componentRef = viewContainer.createComponent(component, {
|
|
610
|
-
injector: newInjector,
|
|
611
|
-
});
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxLoadingRootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
615
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.14", type: NgFluxLoadingRootComponent, isStandalone: true, selector: "ngf-loading-root", host: { properties: { "class.show": "this.isLoading" } }, viewQueries: [{ propertyName: "viewContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<div class=\"wrapper\">\n <ng-template #container></ng-template>\n</div>\n", styles: [":host{display:none;position:fixed;z-index:var(--ngf-loading-z-index)!important;inset:0}:host.show{display:block}:host>.wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:var(--ngf-loading-background)!important;height:100%!important;width:100%!important}\n"] });
|
|
616
|
-
}
|
|
617
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxLoadingRootComponent, decorators: [{
|
|
618
|
-
type: Component,
|
|
619
|
-
args: [{ selector: 'ngf-loading-root', imports: [], template: "<div class=\"wrapper\">\n <ng-template #container></ng-template>\n</div>\n", styles: [":host{display:none;position:fixed;z-index:var(--ngf-loading-z-index)!important;inset:0}:host.show{display:block}:host>.wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:var(--ngf-loading-background)!important;height:100%!important;width:100%!important}\n"] }]
|
|
620
|
-
}], ctorParameters: () => [], propDecorators: { isLoading: [{
|
|
621
|
-
type: HostBinding,
|
|
622
|
-
args: ['class.show']
|
|
623
|
-
}], viewContainer: [{ type: i0.ViewChild, args: ['container', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
624
|
-
|
|
625
|
-
class NgFluxRootComponent {
|
|
626
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxRootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
627
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: NgFluxRootComponent, isStandalone: true, selector: "ngf-root", ngImport: i0, template: "<ng-content></ng-content>\n\n<ngf-dialog-root></ngf-dialog-root>\n<ngf-loading-root></ngf-loading-root>\n", styles: [""], dependencies: [{ kind: "component", type: NgFluxDialogRootComponent, selector: "ngf-dialog-root" }, { kind: "component", type: NgFluxLoadingRootComponent, selector: "ngf-loading-root" }] });
|
|
628
|
-
}
|
|
629
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxRootComponent, decorators: [{
|
|
630
|
-
type: Component,
|
|
631
|
-
args: [{ selector: 'ngf-root', imports: [
|
|
632
|
-
NgFluxDialogRootComponent,
|
|
633
|
-
NgFluxLoadingRootComponent,
|
|
634
|
-
], template: "<ng-content></ng-content>\n\n<ngf-dialog-root></ngf-dialog-root>\n<ngf-loading-root></ngf-loading-root>\n" }]
|
|
635
|
-
}] });
|
|
636
|
-
|
|
637
|
-
class NgFluxPaginationInfo {
|
|
638
|
-
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
639
|
-
callback = output();
|
|
640
|
-
limit = model.required(...(ngDevMode ? [{ debugName: "limit" }] : /* istanbul ignore next */ []));
|
|
641
|
-
limitEntries = input.required(...(ngDevMode ? [{ debugName: "limitEntries" }] : /* istanbul ignore next */ []));
|
|
642
|
-
info = computed(() => {
|
|
643
|
-
const data = this.data();
|
|
644
|
-
const from = data.from.toLocaleString();
|
|
645
|
-
const to = data.to.toLocaleString();
|
|
646
|
-
const total = data.total.toLocaleString();
|
|
647
|
-
return `${from} - ${to} of ${total}`;
|
|
648
|
-
}, ...(ngDevMode ? [{ debugName: "info" }] : /* istanbul ignore next */ []));
|
|
649
|
-
disablePrev = computed(() => {
|
|
650
|
-
const data = this.data();
|
|
651
|
-
return data.currentPage <= 1;
|
|
652
|
-
}, ...(ngDevMode ? [{ debugName: "disablePrev" }] : /* istanbul ignore next */ []));
|
|
653
|
-
disableNext = computed(() => {
|
|
654
|
-
const data = this.data();
|
|
655
|
-
return data.currentPage >= data.lastPage;
|
|
656
|
-
}, ...(ngDevMode ? [{ debugName: "disableNext" }] : /* istanbul ignore next */ []));
|
|
657
|
-
prev() {
|
|
658
|
-
const data = this.data();
|
|
659
|
-
this.callback.emit({
|
|
660
|
-
page: data.currentPage - 1,
|
|
661
|
-
limit: data.perPage,
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
next() {
|
|
665
|
-
const data = this.data();
|
|
666
|
-
this.callback.emit({
|
|
667
|
-
page: data.currentPage + 1,
|
|
668
|
-
limit: data.perPage,
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxPaginationInfo, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
672
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: NgFluxPaginationInfo, isStandalone: true, selector: "ngf-pagination-info", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: true, transformFunction: null }, limitEntries: { classPropertyName: "limitEntries", publicName: "limitEntries", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { callback: "callback", limit: "limitChange" }, ngImport: i0, template: "<div class=\"wrapper\">\n <div class=\"block limit\">\n <div>Per page</div>\n <select name=\"\" id=\"\" [(ngModel)]=\"limit\">\n @for (entry of limitEntries(); track $index) {\n <option [value]=\"entry\">{{ entry }}</option>\n }\n </select>\n </div>\n\n <div class=\"block info\">\n <div>{{ info() }}</div>\n </div>\n\n <div class=\"block nav\">\n <button (click)=\"prev()\" [disabled]=\"disablePrev()\">\n <i class=\"ngf-icon chevron-left\"></i>\n </button>\n\n <button (click)=\"next()\" [disabled]=\"disableNext()\">\n <i class=\"ngf-icon chevron-right\"></i>\n </button>\n </div>\n</div>\n", styles: [":host{display:block;container:pagination/inline-size}:host .wrapper{display:flex;flex-direction:column;font-family:Poppins,sans-serif;align-items:end;text-align:center;font-size:.8rem;gap:5px}@container pagination (min-width: 400px){:host .wrapper{flex-direction:row;justify-content:end;align-items:center;gap:15px}}:host .wrapper .block{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:5px}:host .wrapper .limit>select{display:block;padding:2px 5px;font-size:inherit;outline:none!important;width:50px}:host .wrapper .nav>button{display:block;background-color:transparent;box-shadow:none!important;outline:none!important;cursor:pointer;border:none;padding:0}:host .wrapper .nav>button:disabled{cursor:default;color:#aaa}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
673
|
-
}
|
|
674
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxPaginationInfo, decorators: [{
|
|
675
|
-
type: Component,
|
|
676
|
-
args: [{ selector: 'ngf-pagination-info', imports: [
|
|
677
|
-
FormsModule,
|
|
678
|
-
], template: "<div class=\"wrapper\">\n <div class=\"block limit\">\n <div>Per page</div>\n <select name=\"\" id=\"\" [(ngModel)]=\"limit\">\n @for (entry of limitEntries(); track $index) {\n <option [value]=\"entry\">{{ entry }}</option>\n }\n </select>\n </div>\n\n <div class=\"block info\">\n <div>{{ info() }}</div>\n </div>\n\n <div class=\"block nav\">\n <button (click)=\"prev()\" [disabled]=\"disablePrev()\">\n <i class=\"ngf-icon chevron-left\"></i>\n </button>\n\n <button (click)=\"next()\" [disabled]=\"disableNext()\">\n <i class=\"ngf-icon chevron-right\"></i>\n </button>\n </div>\n</div>\n", styles: [":host{display:block;container:pagination/inline-size}:host .wrapper{display:flex;flex-direction:column;font-family:Poppins,sans-serif;align-items:end;text-align:center;font-size:.8rem;gap:5px}@container pagination (min-width: 400px){:host .wrapper{flex-direction:row;justify-content:end;align-items:center;gap:15px}}:host .wrapper .block{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:5px}:host .wrapper .limit>select{display:block;padding:2px 5px;font-size:inherit;outline:none!important;width:50px}:host .wrapper .nav>button{display:block;background-color:transparent;box-shadow:none!important;outline:none!important;cursor:pointer;border:none;padding:0}:host .wrapper .nav>button:disabled{cursor:default;color:#aaa}\n"] }]
|
|
679
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], callback: [{ type: i0.Output, args: ["callback"] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: true }] }, { type: i0.Output, args: ["limitChange"] }], limitEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "limitEntries", required: true }] }] } });
|
|
680
|
-
|
|
681
|
-
class NgFluxPagination {
|
|
682
|
-
config = inject(NGF_CONFIG);
|
|
683
|
-
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
684
|
-
preload = input(this.config.pagination?.preload ?? false, ...(ngDevMode ? [{ debugName: "preload" }] : /* istanbul ignore next */ []));
|
|
685
|
-
transform = input(...(ngDevMode ? [undefined, { debugName: "transform" }] : /* istanbul ignore next */ []));
|
|
686
|
-
limit = model(this.config.pagination?.limit ?? 10, ...(ngDevMode ? [{ debugName: "limit" }] : /* istanbul ignore next */ []));
|
|
687
|
-
limitEntries = input(this.config.pagination?.limitEntries ?? [5, 10, 20, 30, 40, 50], ...(ngDevMode ? [{ debugName: "limitEntries" }] : /* istanbul ignore next */ []));
|
|
688
|
-
callback = output();
|
|
689
|
-
value = computed(() => {
|
|
690
|
-
const { config } = this;
|
|
691
|
-
const data = this.data();
|
|
692
|
-
const transform = this.transform() ?? config.pagination?.transform;
|
|
693
|
-
if (!transform)
|
|
694
|
-
return data;
|
|
695
|
-
return {
|
|
696
|
-
currentPage: transform.getCurrentPage(data),
|
|
697
|
-
lastPage: transform.getLastPage(data),
|
|
698
|
-
perPage: transform.getPerPage(data),
|
|
699
|
-
from: transform.getFrom(data),
|
|
700
|
-
to: transform.getTo(data),
|
|
701
|
-
total: transform.getTotal(data),
|
|
702
|
-
data: transform.getData(data),
|
|
703
|
-
};
|
|
704
|
-
}, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
705
|
-
constructor() {
|
|
706
|
-
let init = false;
|
|
707
|
-
effect(() => {
|
|
708
|
-
const limit = Number(this.limit());
|
|
709
|
-
const preload = untracked(this.preload);
|
|
710
|
-
const { currentPage: page } = untracked(this.value);
|
|
711
|
-
if (preload || init) {
|
|
712
|
-
this.callback.emit({ limit, page });
|
|
713
|
-
}
|
|
714
|
-
init = true;
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxPagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
718
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: NgFluxPagination, isStandalone: true, selector: "ngf-pagination", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, preload: { classPropertyName: "preload", publicName: "preload", isSignal: true, isRequired: false, transformFunction: null }, transform: { classPropertyName: "transform", publicName: "transform", isSignal: true, isRequired: false, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: false, transformFunction: null }, limitEntries: { classPropertyName: "limitEntries", publicName: "limitEntries", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { limit: "limitChange", callback: "callback" }, ngImport: i0, template: "<ngf-pagination-info\n [data]=\"value()\"\n [(limit)]=\"limit\"\n [limitEntries]=\"limitEntries()\"\n (callback)=\"callback.emit($event)\"\n></ngf-pagination-info>\n\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n\n<ngf-pagination-info\n [data]=\"value()\"\n [(limit)]=\"limit\"\n [limitEntries]=\"limitEntries()\"\n (callback)=\"callback.emit($event)\"\n></ngf-pagination-info>\n", styles: [":host{display:block}:host>.content{margin:20px 0}\n"], dependencies: [{ kind: "component", type: NgFluxPaginationInfo, selector: "ngf-pagination-info", inputs: ["data", "limit", "limitEntries"], outputs: ["callback", "limitChange"] }] });
|
|
719
|
-
}
|
|
720
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgFluxPagination, decorators: [{
|
|
721
|
-
type: Component,
|
|
722
|
-
args: [{ selector: 'ngf-pagination', imports: [
|
|
723
|
-
NgFluxPaginationInfo,
|
|
724
|
-
], template: "<ngf-pagination-info\n [data]=\"value()\"\n [(limit)]=\"limit\"\n [limitEntries]=\"limitEntries()\"\n (callback)=\"callback.emit($event)\"\n></ngf-pagination-info>\n\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n\n<ngf-pagination-info\n [data]=\"value()\"\n [(limit)]=\"limit\"\n [limitEntries]=\"limitEntries()\"\n (callback)=\"callback.emit($event)\"\n></ngf-pagination-info>\n", styles: [":host{display:block}:host>.content{margin:20px 0}\n"] }]
|
|
725
|
-
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], preload: [{ type: i0.Input, args: [{ isSignal: true, alias: "preload", required: false }] }], transform: [{ type: i0.Input, args: [{ isSignal: true, alias: "transform", required: false }] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: false }] }, { type: i0.Output, args: ["limitChange"] }], limitEntries: [{ type: i0.Input, args: [{ isSignal: true, alias: "limitEntries", required: false }] }], callback: [{ type: i0.Output, args: ["callback"] }] } });
|
|
726
|
-
|
|
727
|
-
// export * from './pagination/info/info.component';
|
|
728
|
-
|
|
729
791
|
/*
|
|
730
792
|
* Public API Surface of ngflux
|
|
731
793
|
*/
|
|
@@ -734,5 +796,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
734
796
|
* Generated bundle index. Do not edit.
|
|
735
797
|
*/
|
|
736
798
|
|
|
737
|
-
export { NGF_CONFIG, NGF_DIALOG_DATA, NgFluxButton, NgFluxDialog, NgFluxDialogBodyComponent, NgFluxDialogFooterComponent, NgFluxDialogHeaderComponent, NgFluxDialogInstance, NgFluxDialogRef, NgFluxDialogRootComponent, NgFluxLoading, NgFluxLoadingRootComponent, NgFluxPagination,
|
|
799
|
+
export { NGF_CONFIG, NGF_DIALOG_DATA, NgFluxButton, NgFluxDialog, NgFluxDialogBodyComponent, NgFluxDialogFooterComponent, NgFluxDialogHeaderComponent, NgFluxDialogInstance, NgFluxDialogRef, NgFluxDialogRootComponent, NgFluxLoading, NgFluxLoadingRootComponent, NgFluxPagination, provideNgFlux };
|
|
738
800
|
//# sourceMappingURL=ngflux-ngflux.mjs.map
|