@ferhaps/easy-ui-lib 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -3
- package/fesm2022/ferhaps-easy-ui-lib.mjs +610 -0
- package/fesm2022/ferhaps-easy-ui-lib.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/chip/chip.component.d.ts +10 -0
- package/lib/components/default-dialog/default-dialog.component.d.ts +11 -0
- package/lib/components/error-dispaly.component.d.ts +10 -0
- package/lib/components/error-handler/error-handler.component.d.ts +12 -0
- package/lib/components/error-handler/error-popup/error-popup.component.d.ts +9 -0
- package/lib/components/global-loader/global-loader.component.d.ts +7 -0
- package/lib/components/search-bar.component.d.ts +10 -0
- package/lib/components/table/table.component.d.ts +46 -0
- package/lib/components/table-sort-header/table-sort-header.component.d.ts +10 -0
- package/lib/directives/fields-match-validator.directive.d.ts +10 -0
- package/lib/directives/phone-validation.directive.d.ts +7 -0
- package/lib/pipes/blank-filler.pipe.d.ts +7 -0
- package/lib/pipes/snake-case-parser.pipe.d.ts +7 -0
- package/lib/services/error.service.d.ts +9 -0
- package/lib/services/loader.service.d.ts +8 -0
- package/lib/utils/animations.d.ts +3 -0
- package/{src/lib/utils/types.ts → lib/utils/types.d.ts} +2 -3
- package/lib/utils/utils.d.ts +1 -0
- package/package.json +22 -4
- package/public-api.d.ts +16 -0
- package/ng-package.json +0 -7
- package/src/lib/components/chip/chip.component.html +0 -3
- package/src/lib/components/chip/chip.component.scss +0 -19
- package/src/lib/components/chip/chip.component.ts +0 -23
- package/src/lib/components/default-dialog/default-dialog.component.html +0 -19
- package/src/lib/components/default-dialog/default-dialog.component.scss +0 -41
- package/src/lib/components/default-dialog/default-dialog.component.ts +0 -23
- package/src/lib/components/error-dispaly.component.ts +0 -48
- package/src/lib/components/error-handler/error-handler.component.html +0 -0
- package/src/lib/components/error-handler/error-handler.component.scss +0 -0
- package/src/lib/components/error-handler/error-handler.component.ts +0 -44
- package/src/lib/components/error-handler/error-popup/error-popup.component.html +0 -13
- package/src/lib/components/error-handler/error-popup/error-popup.component.scss +0 -19
- package/src/lib/components/error-handler/error-popup/error-popup.component.ts +0 -21
- package/src/lib/components/global-loader/global-loader.component.html +0 -5
- package/src/lib/components/global-loader/global-loader.component.scss +0 -12
- package/src/lib/components/global-loader/global-loader.component.ts +0 -17
- package/src/lib/components/search-bar.component.ts +0 -70
- package/src/lib/components/table/table.component.html +0 -121
- package/src/lib/components/table/table.component.scss +0 -116
- package/src/lib/components/table/table.component.ts +0 -105
- package/src/lib/components/table-sort-header/table-sort-header.component.html +0 -7
- package/src/lib/components/table-sort-header/table-sort-header.component.scss +0 -17
- package/src/lib/components/table-sort-header/table-sort-header.component.ts +0 -31
- package/src/lib/directives/fields-match-validator.directive.ts +0 -35
- package/src/lib/directives/password-validator.directive.ts +0 -26
- package/src/lib/directives/phone-validation.directive.ts +0 -24
- package/src/lib/pipes/blank-filler.pipe.ts +0 -13
- package/src/lib/pipes/snake-case-parser.pipe.ts +0 -17
- package/src/lib/services/error.service.ts +0 -15
- package/src/lib/services/loader.service.ts +0 -14
- package/src/lib/utils/animations.ts +0 -29
- package/src/lib/utils/utils.ts +0 -65
- package/src/public-api.ts +0 -20
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe, input, Directive, HostListener, output, Component, Input, viewChild, Injectable, inject, Inject } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/forms';
|
|
4
|
+
import { NG_VALIDATORS, FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import * as i1$1 from '@angular/material/icon';
|
|
6
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import * as i3 from '@angular/material/dialog';
|
|
8
|
+
import { MatDialogModule, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
|
|
9
|
+
import * as i1 from '@angular/common';
|
|
10
|
+
import { CommonModule, AsyncPipe } from '@angular/common';
|
|
11
|
+
import * as i1$4 from '@angular/common/http';
|
|
12
|
+
import { HttpErrorResponse } from '@angular/common/http';
|
|
13
|
+
import { debounceTime, distinctUntilChanged, BehaviorSubject, Subject, Subscription } from 'rxjs';
|
|
14
|
+
import { trigger, transition, style, animate, state } from '@angular/animations';
|
|
15
|
+
import * as i1$2 from '@angular/material/menu';
|
|
16
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
17
|
+
import * as i3$1 from '@angular/material/button';
|
|
18
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
19
|
+
import * as i4 from '@angular/cdk/drag-drop';
|
|
20
|
+
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
21
|
+
import * as i1$3 from '@angular/material/progress-spinner';
|
|
22
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
23
|
+
import { NoopScrollStrategy } from '@angular/cdk/overlay';
|
|
24
|
+
|
|
25
|
+
class WhiteSpaceFillerPipe {
|
|
26
|
+
transform(value, fillWith = '-') {
|
|
27
|
+
if (value === 0) {
|
|
28
|
+
return '0';
|
|
29
|
+
}
|
|
30
|
+
return value ? value : fillWith;
|
|
31
|
+
}
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: WhiteSpaceFillerPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
33
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: WhiteSpaceFillerPipe, isStandalone: true, name: "blankFiller" }); }
|
|
34
|
+
}
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: WhiteSpaceFillerPipe, decorators: [{
|
|
36
|
+
type: Pipe,
|
|
37
|
+
args: [{
|
|
38
|
+
name: 'blankFiller',
|
|
39
|
+
}]
|
|
40
|
+
}] });
|
|
41
|
+
|
|
42
|
+
var blankFiller_pipe = /*#__PURE__*/Object.freeze({
|
|
43
|
+
__proto__: null,
|
|
44
|
+
WhiteSpaceFillerPipe: WhiteSpaceFillerPipe
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
let SnakeCaseParserPipe$1 = class SnakeCaseParserPipe {
|
|
48
|
+
transform(str) {
|
|
49
|
+
if (str) {
|
|
50
|
+
let temp = str.split('_').map(word => {
|
|
51
|
+
return word.toLowerCase();
|
|
52
|
+
}).join(' ');
|
|
53
|
+
return temp.charAt(0).toUpperCase() + temp.slice(1);
|
|
54
|
+
}
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SnakeCaseParserPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
58
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: SnakeCaseParserPipe, isStandalone: true, name: "snakeCaseParser" }); }
|
|
59
|
+
};
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SnakeCaseParserPipe$1, decorators: [{
|
|
61
|
+
type: Pipe,
|
|
62
|
+
args: [{
|
|
63
|
+
name: 'snakeCaseParser',
|
|
64
|
+
}]
|
|
65
|
+
}] });
|
|
66
|
+
|
|
67
|
+
var snakeCaseParser_pipe = /*#__PURE__*/Object.freeze({
|
|
68
|
+
__proto__: null,
|
|
69
|
+
SnakeCaseParserPipe: SnakeCaseParserPipe$1
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
let FieldsMatchValidatorDirective$1 = class FieldsMatchValidatorDirective {
|
|
73
|
+
constructor() {
|
|
74
|
+
this.fieldToMatch = input.required();
|
|
75
|
+
}
|
|
76
|
+
validate(control) {
|
|
77
|
+
const value = control.value;
|
|
78
|
+
if (!value) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const matchingControl = control.root.get(this.fieldToMatch());
|
|
82
|
+
if (!matchingControl) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
if (value !== matchingControl.value) {
|
|
86
|
+
return { mismatch: true };
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FieldsMatchValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
91
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: FieldsMatchValidatorDirective, isStandalone: true, selector: "[libFieldsMatchValidator]", inputs: { fieldToMatch: { classPropertyName: "fieldToMatch", publicName: "fieldToMatch", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
92
|
+
{
|
|
93
|
+
provide: NG_VALIDATORS,
|
|
94
|
+
useExisting: FieldsMatchValidatorDirective,
|
|
95
|
+
multi: true,
|
|
96
|
+
},
|
|
97
|
+
], ngImport: i0 }); }
|
|
98
|
+
};
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FieldsMatchValidatorDirective$1, decorators: [{
|
|
100
|
+
type: Directive,
|
|
101
|
+
args: [{
|
|
102
|
+
selector: '[libFieldsMatchValidator]',
|
|
103
|
+
providers: [
|
|
104
|
+
{
|
|
105
|
+
provide: NG_VALIDATORS,
|
|
106
|
+
useExisting: FieldsMatchValidatorDirective$1,
|
|
107
|
+
multi: true,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
}]
|
|
111
|
+
}] });
|
|
112
|
+
|
|
113
|
+
var fieldsMatchValidator_directive = /*#__PURE__*/Object.freeze({
|
|
114
|
+
__proto__: null,
|
|
115
|
+
FieldsMatchValidatorDirective: FieldsMatchValidatorDirective$1
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
let PhoneValidationDirective$1 = class PhoneValidationDirective {
|
|
119
|
+
onInput(event) {
|
|
120
|
+
const input = event.target;
|
|
121
|
+
if (!input.value.includes('+')) {
|
|
122
|
+
input.value = `+${input.value}`;
|
|
123
|
+
}
|
|
124
|
+
const regex = /^[0-9+]*$/;
|
|
125
|
+
if (!regex.test(input.value)) {
|
|
126
|
+
input.value = input.value.replace(/[^0-9+]/g, '');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
onKeyDown(event) {
|
|
130
|
+
const inputValue = event.target.value;
|
|
131
|
+
if (event.key === 'Backspace' && inputValue === '+') {
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PhoneValidationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
136
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: PhoneValidationDirective, isStandalone: true, selector: "[libPhoneValidation]", host: { listeners: { "input": "onInput($event)", "keydown": "onKeyDown($event)" } }, ngImport: i0 }); }
|
|
137
|
+
};
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PhoneValidationDirective$1, decorators: [{
|
|
139
|
+
type: Directive,
|
|
140
|
+
args: [{
|
|
141
|
+
selector: '[libPhoneValidation]',
|
|
142
|
+
}]
|
|
143
|
+
}], propDecorators: { onInput: [{
|
|
144
|
+
type: HostListener,
|
|
145
|
+
args: ['input', ['$event']]
|
|
146
|
+
}], onKeyDown: [{
|
|
147
|
+
type: HostListener,
|
|
148
|
+
args: ['keydown', ['$event']]
|
|
149
|
+
}] } });
|
|
150
|
+
|
|
151
|
+
var phoneValidation_directive = /*#__PURE__*/Object.freeze({
|
|
152
|
+
__proto__: null,
|
|
153
|
+
PhoneValidationDirective: PhoneValidationDirective$1
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
let DefaultDialogComponent$1 = class DefaultDialogComponent {
|
|
157
|
+
constructor() {
|
|
158
|
+
this.height = input();
|
|
159
|
+
this.dialogTitle = input();
|
|
160
|
+
this.withBack = input();
|
|
161
|
+
this.back = output();
|
|
162
|
+
}
|
|
163
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DefaultDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
164
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: DefaultDialogComponent, isStandalone: true, selector: "lib-default-dialog", inputs: { temRef: { classPropertyName: "temRef", publicName: "temRef", isSignal: false, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, dialogTitle: { classPropertyName: "dialogTitle", publicName: "dialogTitle", isSignal: true, isRequired: false, transformFunction: null }, withBack: { classPropertyName: "withBack", publicName: "withBack", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { back: "back" }, ngImport: i0, template: "<div class=\"modal\" [style]=\"{'height': height()}\">\r\n <div class=\"dialog-title\">\r\n @if (withBack()) {\r\n <div class=\"back-arrow\" (click)=\"back.emit()\">\r\n <mat-icon>keyboard_arrow_left</mat-icon>\r\n </div>\r\n }\r\n <h4 class=\"title\">{{ dialogTitle() }}</h4>\r\n <div class=\"closer\" mat-dialog-close>\r\n <mat-icon>close</mat-icon>\r\n </div>\r\n </div>\r\n\r\n <div class=\"dialog-content\">\r\n <ng-content select=\".dialog-content\"></ng-content>\r\n <ng-template #tempBody></ng-template>\r\n <ng-container *ngTemplateOutlet=\"temRef ? temRef: tempBody\" />\r\n </div>\r\n</div>", styles: [".modal{display:flex;flex-direction:column}.dialog-title{padding-inline:2rem;padding-top:1rem;margin-bottom:1rem;position:relative;display:flex;font-size:20px;justify-content:center}.dialog-title .back-arrow{cursor:pointer;margin-right:.5rem}.dialog-title .title{font-weight:700;font-size:24px;margin:0!important}.dialog-title .closer{right:3%;position:absolute;cursor:pointer}.dialog-content{flex:1;min-height:0;overflow:hidden;padding-bottom:1rem;display:flex;flex-direction:column;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] }); }
|
|
165
|
+
};
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DefaultDialogComponent$1, decorators: [{
|
|
167
|
+
type: Component,
|
|
168
|
+
args: [{ selector: 'lib-default-dialog', imports: [
|
|
169
|
+
CommonModule,
|
|
170
|
+
MatIconModule,
|
|
171
|
+
MatDialogModule
|
|
172
|
+
], template: "<div class=\"modal\" [style]=\"{'height': height()}\">\r\n <div class=\"dialog-title\">\r\n @if (withBack()) {\r\n <div class=\"back-arrow\" (click)=\"back.emit()\">\r\n <mat-icon>keyboard_arrow_left</mat-icon>\r\n </div>\r\n }\r\n <h4 class=\"title\">{{ dialogTitle() }}</h4>\r\n <div class=\"closer\" mat-dialog-close>\r\n <mat-icon>close</mat-icon>\r\n </div>\r\n </div>\r\n\r\n <div class=\"dialog-content\">\r\n <ng-content select=\".dialog-content\"></ng-content>\r\n <ng-template #tempBody></ng-template>\r\n <ng-container *ngTemplateOutlet=\"temRef ? temRef: tempBody\" />\r\n </div>\r\n</div>", styles: [".modal{display:flex;flex-direction:column}.dialog-title{padding-inline:2rem;padding-top:1rem;margin-bottom:1rem;position:relative;display:flex;font-size:20px;justify-content:center}.dialog-title .back-arrow{cursor:pointer;margin-right:.5rem}.dialog-title .title{font-weight:700;font-size:24px;margin:0!important}.dialog-title .closer{right:3%;position:absolute;cursor:pointer}.dialog-content{flex:1;min-height:0;overflow:hidden;padding-bottom:1rem;display:flex;flex-direction:column;align-items:center}\n"] }]
|
|
173
|
+
}], propDecorators: { temRef: [{
|
|
174
|
+
type: Input
|
|
175
|
+
}] } });
|
|
176
|
+
|
|
177
|
+
var defaultDialog_component = /*#__PURE__*/Object.freeze({
|
|
178
|
+
__proto__: null,
|
|
179
|
+
DefaultDialogComponent: DefaultDialogComponent$1
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
let ErrorDispalyComponent$1 = class ErrorDispalyComponent {
|
|
183
|
+
constructor() {
|
|
184
|
+
this.error = input.required();
|
|
185
|
+
this.displayError = '';
|
|
186
|
+
}
|
|
187
|
+
ngOnInit() {
|
|
188
|
+
if (this.error() instanceof HttpErrorResponse) {
|
|
189
|
+
if (typeof this.error().error === 'string') {
|
|
190
|
+
this.displayError = this.error().error;
|
|
191
|
+
}
|
|
192
|
+
else if (this.error && this.error()?.error?.message) {
|
|
193
|
+
this.displayError = this.error().error.message;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this.displayError = 'Unknown error';
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
else if (typeof this.error() === 'string') {
|
|
200
|
+
this.displayError = this.error();
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
this.displayError = 'Unknown error';
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorDispalyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
207
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: ErrorDispalyComponent, isStandalone: true, selector: "lib-error-dispaly", inputs: { error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<strong class="err-container">{{ displayError | snakeCaseParser }}</strong>`, isInline: true, styles: [".err-container{display:block;max-width:300px;font-size:20px;text-align:center;border:1px solid red;border-radius:5px;padding:.5rem 1.5rem;background-color:#ffe6e6;color:red;overflow-wrap:break-word}\n"], dependencies: [{ kind: "pipe", type: SnakeCaseParserPipe$1, name: "snakeCaseParser" }] }); }
|
|
208
|
+
};
|
|
209
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorDispalyComponent$1, decorators: [{
|
|
210
|
+
type: Component,
|
|
211
|
+
args: [{ selector: 'lib-error-dispaly', imports: [
|
|
212
|
+
SnakeCaseParserPipe$1
|
|
213
|
+
], template: `<strong class="err-container">{{ displayError | snakeCaseParser }}</strong>`, styles: [".err-container{display:block;max-width:300px;font-size:20px;text-align:center;border:1px solid red;border-radius:5px;padding:.5rem 1.5rem;background-color:#ffe6e6;color:red;overflow-wrap:break-word}\n"] }]
|
|
214
|
+
}] });
|
|
215
|
+
|
|
216
|
+
var errorDispaly_component = /*#__PURE__*/Object.freeze({
|
|
217
|
+
__proto__: null,
|
|
218
|
+
ErrorDispalyComponent: ErrorDispalyComponent$1
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
let SearchBarComponent$1 = class SearchBarComponent {
|
|
222
|
+
constructor() {
|
|
223
|
+
this.for = input.required();
|
|
224
|
+
this.search = output();
|
|
225
|
+
this.searchForm = new FormGroup({
|
|
226
|
+
search: new FormControl('')
|
|
227
|
+
});
|
|
228
|
+
this.searchForm.get('search')?.valueChanges.
|
|
229
|
+
pipe(debounceTime(1000), distinctUntilChanged()).subscribe((searchTerm) => {
|
|
230
|
+
if (searchTerm.trim() !== '') {
|
|
231
|
+
this.search.emit(searchTerm);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SearchBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
236
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: SearchBarComponent, isStandalone: true, selector: "lib-search-bar", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { search: "search" }, ngImport: i0, template: `
|
|
237
|
+
<form class="search-bar" [formGroup]="searchForm">
|
|
238
|
+
<mat-icon>search</mat-icon>
|
|
239
|
+
<input class="search-input" type="search" name="field"
|
|
240
|
+
[placeholder]="'Search ' + for()" autocomplete="off" formControlName="search" />
|
|
241
|
+
</form>
|
|
242
|
+
`, isInline: true, styles: [".search-bar{width:270px;border:1px solid #A4A4A4;display:flex;align-items:center}.search-input{border:none;padding:7px 11px;height:100%;width:100%;background-color:transparent}mat-icon{margin-inline:8px}.search-input:focus{border:none;outline:none}@media (max-width: 1086px){.search-bar{width:170px}}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
|
|
243
|
+
};
|
|
244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SearchBarComponent$1, decorators: [{
|
|
245
|
+
type: Component,
|
|
246
|
+
args: [{ selector: 'lib-search-bar', template: `
|
|
247
|
+
<form class="search-bar" [formGroup]="searchForm">
|
|
248
|
+
<mat-icon>search</mat-icon>
|
|
249
|
+
<input class="search-input" type="search" name="field"
|
|
250
|
+
[placeholder]="'Search ' + for()" autocomplete="off" formControlName="search" />
|
|
251
|
+
</form>
|
|
252
|
+
`, imports: [
|
|
253
|
+
MatIconModule,
|
|
254
|
+
ReactiveFormsModule
|
|
255
|
+
], styles: [".search-bar{width:270px;border:1px solid #A4A4A4;display:flex;align-items:center}.search-input{border:none;padding:7px 11px;height:100%;width:100%;background-color:transparent}mat-icon{margin-inline:8px}.search-input:focus{border:none;outline:none}@media (max-width: 1086px){.search-bar{width:170px}}\n"] }]
|
|
256
|
+
}], ctorParameters: () => [] });
|
|
257
|
+
|
|
258
|
+
var searchBar_component = /*#__PURE__*/Object.freeze({
|
|
259
|
+
__proto__: null,
|
|
260
|
+
SearchBarComponent: SearchBarComponent$1
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
const fader = trigger('fadeInOut', [
|
|
264
|
+
transition(':enter', [
|
|
265
|
+
style({ opacity: 0 }),
|
|
266
|
+
animate('200ms', style({ opacity: 1 })),
|
|
267
|
+
]),
|
|
268
|
+
transition(':leave', [
|
|
269
|
+
animate('200ms', style({ opacity: 0 })),
|
|
270
|
+
]),
|
|
271
|
+
]);
|
|
272
|
+
const openDropdown = trigger('open-close-dropdown', [
|
|
273
|
+
transition(':enter', [
|
|
274
|
+
style({ height: 0, overflow: 'hidden' }),
|
|
275
|
+
animate('200ms ease', style({ height: '*' }))
|
|
276
|
+
]),
|
|
277
|
+
transition(':leave', [
|
|
278
|
+
style({ height: '*', overflow: 'hidden' }),
|
|
279
|
+
animate('200ms ease', style({ height: 0 }))
|
|
280
|
+
])
|
|
281
|
+
]);
|
|
282
|
+
const textFader = trigger('textFader', [
|
|
283
|
+
state('void', style({ opacity: 0 })),
|
|
284
|
+
state('*', style({ opacity: 1 })),
|
|
285
|
+
transition('void => *', [animate('0.3s 0.3s ease-in')]),
|
|
286
|
+
transition('* => void', [animate('0.3s ease-in')])
|
|
287
|
+
]);
|
|
288
|
+
|
|
289
|
+
let TableSortHeaderComponent$1 = class TableSortHeaderComponent {
|
|
290
|
+
constructor() {
|
|
291
|
+
this.selected = input.required();
|
|
292
|
+
this.sort = output();
|
|
293
|
+
this.sortState = 'none';
|
|
294
|
+
}
|
|
295
|
+
onSortClick() {
|
|
296
|
+
if (this.sortState === 'none') {
|
|
297
|
+
this.sortState = 'desc';
|
|
298
|
+
}
|
|
299
|
+
else if (this.sortState === 'desc') {
|
|
300
|
+
this.sortState = 'asc';
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
this.sortState = 'none';
|
|
304
|
+
}
|
|
305
|
+
this.sort.emit(this.sortState);
|
|
306
|
+
}
|
|
307
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableSortHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
308
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: TableSortHeaderComponent, isStandalone: true, selector: "lib-table-sort-header", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { sort: "sort" }, ngImport: i0, template: "<div class=\"sorting-container\" (click)=\"onSortClick()\">\r\n <mat-icon\r\n [class.selected]=\"selected() && sortState != 'none'\"\r\n [class.rotated]=\"sortState == 'asc'\">\r\n sort\r\n </mat-icon>\r\n</div>", styles: [".sorting-container{display:flex;align-items:center}.sorting-container *{cursor:pointer}.sorting-container .selected{color:#31adff;background-color:#ebf7fc}.sorting-container .rotated{transform:rotate(180deg) scaleX(-1)}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
309
|
+
};
|
|
310
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableSortHeaderComponent$1, decorators: [{
|
|
311
|
+
type: Component,
|
|
312
|
+
args: [{ selector: 'lib-table-sort-header', imports: [
|
|
313
|
+
MatIconModule,
|
|
314
|
+
], template: "<div class=\"sorting-container\" (click)=\"onSortClick()\">\r\n <mat-icon\r\n [class.selected]=\"selected() && sortState != 'none'\"\r\n [class.rotated]=\"sortState == 'asc'\">\r\n sort\r\n </mat-icon>\r\n</div>", styles: [".sorting-container{display:flex;align-items:center}.sorting-container *{cursor:pointer}.sorting-container .selected{color:#31adff;background-color:#ebf7fc}.sorting-container .rotated{transform:rotate(180deg) scaleX(-1)}\n"] }]
|
|
315
|
+
}] });
|
|
316
|
+
|
|
317
|
+
var tableSortHeader_component = /*#__PURE__*/Object.freeze({
|
|
318
|
+
__proto__: null,
|
|
319
|
+
TableSortHeaderComponent: TableSortHeaderComponent$1
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
let TableComponent$1 = class TableComponent {
|
|
323
|
+
constructor() {
|
|
324
|
+
this.config = input.required();
|
|
325
|
+
this.action = output();
|
|
326
|
+
this.scrollContainer = viewChild.required('scrollContainer');
|
|
327
|
+
this.selectedRowIndex = -1;
|
|
328
|
+
this.hoverRowIndex = -1;
|
|
329
|
+
this.currentSortColumn = -1;
|
|
330
|
+
}
|
|
331
|
+
getClass(obj, prop) {
|
|
332
|
+
if (!this.config().classRules)
|
|
333
|
+
return '';
|
|
334
|
+
const classes = [];
|
|
335
|
+
for (let rule of this.config().classRules) {
|
|
336
|
+
if (rule.condition(obj, prop)) {
|
|
337
|
+
classes.push(rule.className);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return classes.join(' ');
|
|
341
|
+
}
|
|
342
|
+
drop(event) {
|
|
343
|
+
if (this.config().draggable) {
|
|
344
|
+
moveItemInArray(this.config().data, event.previousIndex, event.currentIndex);
|
|
345
|
+
this.action.emit({ action: 'drag', obj: this.config().data[event.currentIndex], index: event.currentIndex });
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
onScroll() {
|
|
349
|
+
const container = this.scrollContainer().nativeElement;
|
|
350
|
+
// console.log(Math.ceil(container.scrollTop), container.offsetHeight, container.scrollHeight)
|
|
351
|
+
if ((Math.ceil(container.scrollTop) + container.offsetHeight) >= container.scrollHeight) {
|
|
352
|
+
this.action.emit({ action: 'scrolled' });
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
onRowClick(event, obj, index) {
|
|
356
|
+
this.selectedRowIndex = index === this.selectedRowIndex ? -1 : index;
|
|
357
|
+
this.action.emit({ action: 'rowClick', obj, index, selected: this.selectedRowIndex === index, event });
|
|
358
|
+
}
|
|
359
|
+
selectOption(оption, obj, index) {
|
|
360
|
+
this.action.emit({ action: оption.toLowerCase(), obj, index, selected: this.selectedRowIndex === index });
|
|
361
|
+
}
|
|
362
|
+
sortByProp(prop, sortState) {
|
|
363
|
+
this.action.emit({ action: 'sort', prop, sortState });
|
|
364
|
+
}
|
|
365
|
+
trackById(index, obj) {
|
|
366
|
+
return obj.id || index;
|
|
367
|
+
}
|
|
368
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
369
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: TableComponent, isStandalone: true, selector: "lib-table", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { action: "action" }, viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flexer\">\r\n @if (config().title) {\r\n <div class=\"row-heading-labels mb05\">{{config().title}}</div>\r\n }\r\n <ng-content select=\".upper-part\"></ng-content>\r\n @if (config().withAdd) {\r\n <div class=\"flexer action pointer gap05 mb05\" (click)=\"action.emit({action: 'add'})\">\r\n <mat-icon>add_circle_outline</mat-icon>\r\n <div>add</div>\r\n </div>\r\n }\r\n</div>\r\n\r\n<div class=\"scroll\" #scrollContainer (scroll)=\"onScroll()\">\r\n <table [class.with-options]=\"config().options?.length\">\r\n <thead>\r\n <tr>\r\n @for (heading of config().tableHeadings; track heading; let i = $index) {\r\n <th>\r\n <div class=\"flexer gap05\">\r\n {{heading}}\r\n @if (config().sortable && !config().draggable) {\r\n <lib-table-sort-header\r\n [selected]=\"currentSortColumn === i\"\r\n (click)=\"currentSortColumn = i\"\r\n (sort)=\"sortByProp(config().dataProps[i], $event)\"\r\n />\r\n }\r\n </div>\r\n </th>\r\n }\r\n @if (config().options?.length) {\r\n <th></th>\r\n }\r\n </tr>\r\n </thead>\r\n @if (config().draggable) {\r\n <tbody cdkDropList (cdkDropListDropped)=\"drop($event)\">\r\n @for (obj of config().data; track trackById(i, obj); let i = $index) {\r\n <tr\r\n (mouseover)=\"hoverRowIndex = i\"\r\n (mouseleave)=\"hoverRowIndex = -1\"\r\n cdkDrag cdkDragLockAxis=\"y\"\r\n [class.pointer]=\"config().selectableRows\"\r\n [class.hover-row]=\"hoverRowIndex == i\"\r\n [class.selected-row]=\"config().selectableRows && selectedRowIndex == i\"\r\n (click)=\"onRowClick($event, obj, i)\"\r\n @fadeInOut>\r\n @for (prop of config().dataProps; track prop; let cellIndex = $index) {\r\n <td\r\n [class.dragCol]=\"cellIndex === 0\">\r\n <div class=\"data\" [classList]=\"getClass(obj, prop)\"\r\n [class.flexer]=\"cellIndex === 0\">\r\n @if (cellIndex === 0) {\r\n <mat-icon class=\"draggable\" cdkDragHandle>\r\n drag_indicator\r\n </mat-icon>\r\n }\r\n {{obj[prop] | blankFiller}}\r\n </div>\r\n </td>\r\n }\r\n @if (config().options?.length) {\r\n <td class=\"right-align\" (click)=\"$event.stopPropagation()\">\r\n <button mat-icon-button class=\"pointer dots right\" [matMenuTriggerFor]=\"optionsMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #optionsMenu=\"matMenu\">\r\n @for (option of config().options; track option) {\r\n <div\r\n mat-menu-item (click)=\"selectOption(option, obj, i)\"\r\n [class.red]=\"option == 'Remove' || option == 'Delete'\">\r\n {{option}}\r\n </div>\r\n }\r\n </mat-menu>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n } @else {\r\n <tbody>\r\n @for (obj of config().data; track trackById(i, obj); let i = $index) {\r\n <tr\r\n (mouseover)=\"hoverRowIndex = i\"\r\n (mouseleave)=\"hoverRowIndex = -1\"\r\n [class.pointer]=\"config().selectableRows\"\r\n [class.hover-row]=\"hoverRowIndex == i\"\r\n [class.selected-row]=\"config().selectableRows && selectedRowIndex == i\"\r\n (click)=\"onRowClick($event, obj, i)\"\r\n @fadeInOut>\r\n @for (prop of config().dataProps; track prop; let cellIndex = $index) {\r\n <td>\r\n <div class=\"data\" [classList]=\"getClass(obj, prop)\">\r\n {{obj[prop] | blankFiller}}\r\n </div>\r\n </td>\r\n }\r\n @if (config().options?.length) {\r\n <td class=\"right-align\" (click)=\"$event.stopPropagation()\">\r\n <button mat-icon-button class=\"pointer dots right\" [matMenuTriggerFor]=\"optionsMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #optionsMenu=\"matMenu\">\r\n @for (option of config().options; track option) {\r\n <div\r\n mat-menu-item (click)=\"selectOption(option, obj, i)\"\r\n [class.red]=\"option == 'Remove' || option == 'Delete'\">\r\n {{option}}\r\n </div>\r\n }\r\n </mat-menu>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n }\r\n </table>\r\n</div>", styles: [".scroll{overflow-y:auto;max-height:94%}table{width:100%;border-collapse:collapse;border-spacing:0px}table.with-options td{padding-block:3px!important}.flexer{display:flex;align-items:center}.action{color:#009ddc;font-weight:500;text-align:right;margin-left:auto}.pointer{cursor:pointer}.gap05{gap:.5rem}.mb05{margin-bottom:.5}.data{white-space:pre-wrap}.row-heading-labels{font-weight:700;font-size:20px}.selected-row td{background-color:#d3edf8}.hover-row{background-color:#ebf7fc}.red{color:red}@media (max-width: 1086px){table td,table th{padding:3px!important;width:auto!important}}td,th{padding:.5rem 1rem;font-size:14px}th{background-color:#f6f6f6;text-align:left;position:sticky;top:0;z-index:2;border-top:2px solid #E5E4E7}td{border-bottom:2px solid #E5E4E7;border-top:2px solid #E5E4E7}.dots{width:fit-content}.draggable{cursor:grabbing}.dragCol{padding-left:0!important}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;font-size:1.5em;text-align:center;opacity:.8;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.dragdrop-placeholder{background:#ccc;border:dotted 3px #999;min-height:30px;transition:transform .1s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "pipe", type: WhiteSpaceFillerPipe, name: "blankFiller" }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: TableSortHeaderComponent$1, selector: "lib-table-sort-header", inputs: ["selected"], outputs: ["sort"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i4.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i4.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }], animations: [fader] }); }
|
|
370
|
+
};
|
|
371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableComponent$1, decorators: [{
|
|
372
|
+
type: Component,
|
|
373
|
+
args: [{ selector: 'lib-table', animations: [fader], imports: [
|
|
374
|
+
WhiteSpaceFillerPipe,
|
|
375
|
+
MatMenuModule,
|
|
376
|
+
MatIconModule,
|
|
377
|
+
MatButtonModule,
|
|
378
|
+
TableSortHeaderComponent$1,
|
|
379
|
+
DragDropModule
|
|
380
|
+
], template: "<div class=\"flexer\">\r\n @if (config().title) {\r\n <div class=\"row-heading-labels mb05\">{{config().title}}</div>\r\n }\r\n <ng-content select=\".upper-part\"></ng-content>\r\n @if (config().withAdd) {\r\n <div class=\"flexer action pointer gap05 mb05\" (click)=\"action.emit({action: 'add'})\">\r\n <mat-icon>add_circle_outline</mat-icon>\r\n <div>add</div>\r\n </div>\r\n }\r\n</div>\r\n\r\n<div class=\"scroll\" #scrollContainer (scroll)=\"onScroll()\">\r\n <table [class.with-options]=\"config().options?.length\">\r\n <thead>\r\n <tr>\r\n @for (heading of config().tableHeadings; track heading; let i = $index) {\r\n <th>\r\n <div class=\"flexer gap05\">\r\n {{heading}}\r\n @if (config().sortable && !config().draggable) {\r\n <lib-table-sort-header\r\n [selected]=\"currentSortColumn === i\"\r\n (click)=\"currentSortColumn = i\"\r\n (sort)=\"sortByProp(config().dataProps[i], $event)\"\r\n />\r\n }\r\n </div>\r\n </th>\r\n }\r\n @if (config().options?.length) {\r\n <th></th>\r\n }\r\n </tr>\r\n </thead>\r\n @if (config().draggable) {\r\n <tbody cdkDropList (cdkDropListDropped)=\"drop($event)\">\r\n @for (obj of config().data; track trackById(i, obj); let i = $index) {\r\n <tr\r\n (mouseover)=\"hoverRowIndex = i\"\r\n (mouseleave)=\"hoverRowIndex = -1\"\r\n cdkDrag cdkDragLockAxis=\"y\"\r\n [class.pointer]=\"config().selectableRows\"\r\n [class.hover-row]=\"hoverRowIndex == i\"\r\n [class.selected-row]=\"config().selectableRows && selectedRowIndex == i\"\r\n (click)=\"onRowClick($event, obj, i)\"\r\n @fadeInOut>\r\n @for (prop of config().dataProps; track prop; let cellIndex = $index) {\r\n <td\r\n [class.dragCol]=\"cellIndex === 0\">\r\n <div class=\"data\" [classList]=\"getClass(obj, prop)\"\r\n [class.flexer]=\"cellIndex === 0\">\r\n @if (cellIndex === 0) {\r\n <mat-icon class=\"draggable\" cdkDragHandle>\r\n drag_indicator\r\n </mat-icon>\r\n }\r\n {{obj[prop] | blankFiller}}\r\n </div>\r\n </td>\r\n }\r\n @if (config().options?.length) {\r\n <td class=\"right-align\" (click)=\"$event.stopPropagation()\">\r\n <button mat-icon-button class=\"pointer dots right\" [matMenuTriggerFor]=\"optionsMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #optionsMenu=\"matMenu\">\r\n @for (option of config().options; track option) {\r\n <div\r\n mat-menu-item (click)=\"selectOption(option, obj, i)\"\r\n [class.red]=\"option == 'Remove' || option == 'Delete'\">\r\n {{option}}\r\n </div>\r\n }\r\n </mat-menu>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n } @else {\r\n <tbody>\r\n @for (obj of config().data; track trackById(i, obj); let i = $index) {\r\n <tr\r\n (mouseover)=\"hoverRowIndex = i\"\r\n (mouseleave)=\"hoverRowIndex = -1\"\r\n [class.pointer]=\"config().selectableRows\"\r\n [class.hover-row]=\"hoverRowIndex == i\"\r\n [class.selected-row]=\"config().selectableRows && selectedRowIndex == i\"\r\n (click)=\"onRowClick($event, obj, i)\"\r\n @fadeInOut>\r\n @for (prop of config().dataProps; track prop; let cellIndex = $index) {\r\n <td>\r\n <div class=\"data\" [classList]=\"getClass(obj, prop)\">\r\n {{obj[prop] | blankFiller}}\r\n </div>\r\n </td>\r\n }\r\n @if (config().options?.length) {\r\n <td class=\"right-align\" (click)=\"$event.stopPropagation()\">\r\n <button mat-icon-button class=\"pointer dots right\" [matMenuTriggerFor]=\"optionsMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #optionsMenu=\"matMenu\">\r\n @for (option of config().options; track option) {\r\n <div\r\n mat-menu-item (click)=\"selectOption(option, obj, i)\"\r\n [class.red]=\"option == 'Remove' || option == 'Delete'\">\r\n {{option}}\r\n </div>\r\n }\r\n </mat-menu>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n }\r\n </table>\r\n</div>", styles: [".scroll{overflow-y:auto;max-height:94%}table{width:100%;border-collapse:collapse;border-spacing:0px}table.with-options td{padding-block:3px!important}.flexer{display:flex;align-items:center}.action{color:#009ddc;font-weight:500;text-align:right;margin-left:auto}.pointer{cursor:pointer}.gap05{gap:.5rem}.mb05{margin-bottom:.5}.data{white-space:pre-wrap}.row-heading-labels{font-weight:700;font-size:20px}.selected-row td{background-color:#d3edf8}.hover-row{background-color:#ebf7fc}.red{color:red}@media (max-width: 1086px){table td,table th{padding:3px!important;width:auto!important}}td,th{padding:.5rem 1rem;font-size:14px}th{background-color:#f6f6f6;text-align:left;position:sticky;top:0;z-index:2;border-top:2px solid #E5E4E7}td{border-bottom:2px solid #E5E4E7;border-top:2px solid #E5E4E7}.dots{width:fit-content}.draggable{cursor:grabbing}.dragCol{padding-left:0!important}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;font-size:1.5em;text-align:center;opacity:.8;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.dragdrop-placeholder{background:#ccc;border:dotted 3px #999;min-height:30px;transition:transform .1s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
381
|
+
}] });
|
|
382
|
+
|
|
383
|
+
var table_component = /*#__PURE__*/Object.freeze({
|
|
384
|
+
__proto__: null,
|
|
385
|
+
TableComponent: TableComponent$1
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
let LoaderService$1 = class LoaderService {
|
|
389
|
+
constructor() {
|
|
390
|
+
this.loadingSubject = new BehaviorSubject(false);
|
|
391
|
+
this.loading$ = this.loadingSubject.asObservable();
|
|
392
|
+
}
|
|
393
|
+
setLoading(loadingState) {
|
|
394
|
+
this.loadingSubject.next(loadingState);
|
|
395
|
+
}
|
|
396
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: LoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
397
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: LoaderService, providedIn: 'root' }); }
|
|
398
|
+
};
|
|
399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: LoaderService$1, decorators: [{
|
|
400
|
+
type: Injectable,
|
|
401
|
+
args: [{
|
|
402
|
+
providedIn: 'root'
|
|
403
|
+
}]
|
|
404
|
+
}] });
|
|
405
|
+
|
|
406
|
+
var loader_service = /*#__PURE__*/Object.freeze({
|
|
407
|
+
__proto__: null,
|
|
408
|
+
LoaderService: LoaderService$1
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
let GlobalLoaderComponent$1 = class GlobalLoaderComponent {
|
|
412
|
+
constructor() {
|
|
413
|
+
this.loaderService = inject(LoaderService$1);
|
|
414
|
+
}
|
|
415
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: GlobalLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
416
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: GlobalLoaderComponent, isStandalone: true, selector: "lib-global-loader", ngImport: i0, template: "@if (loaderService.loading$ | async) {\r\n <div class=\"loader\">\r\n <mat-spinner />\r\n </div>\r\n}", styles: [".loader{display:flex;justify-content:center;align-items:center;height:100%;width:100%;position:fixed;top:0;left:0;background-color:#0003;z-index:9999}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1$3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] }); }
|
|
417
|
+
};
|
|
418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: GlobalLoaderComponent$1, decorators: [{
|
|
419
|
+
type: Component,
|
|
420
|
+
args: [{ selector: 'lib-global-loader', imports: [
|
|
421
|
+
AsyncPipe,
|
|
422
|
+
MatProgressSpinnerModule
|
|
423
|
+
], template: "@if (loaderService.loading$ | async) {\r\n <div class=\"loader\">\r\n <mat-spinner />\r\n </div>\r\n}", styles: [".loader{display:flex;justify-content:center;align-items:center;height:100%;width:100%;position:fixed;top:0;left:0;background-color:#0003;z-index:9999}\n"] }]
|
|
424
|
+
}] });
|
|
425
|
+
|
|
426
|
+
var globalLoader_component = /*#__PURE__*/Object.freeze({
|
|
427
|
+
__proto__: null,
|
|
428
|
+
GlobalLoaderComponent: GlobalLoaderComponent$1
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
let ErrorService$1 = class ErrorService {
|
|
432
|
+
constructor() {
|
|
433
|
+
this.errorSubject = new Subject();
|
|
434
|
+
this.error$ = this.errorSubject.asObservable();
|
|
435
|
+
}
|
|
436
|
+
sendError(error) {
|
|
437
|
+
this.errorSubject.next(error);
|
|
438
|
+
}
|
|
439
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
440
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorService, providedIn: 'root' }); }
|
|
441
|
+
};
|
|
442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorService$1, decorators: [{
|
|
443
|
+
type: Injectable,
|
|
444
|
+
args: [{
|
|
445
|
+
providedIn: 'root'
|
|
446
|
+
}]
|
|
447
|
+
}] });
|
|
448
|
+
|
|
449
|
+
var error_service = /*#__PURE__*/Object.freeze({
|
|
450
|
+
__proto__: null,
|
|
451
|
+
ErrorService: ErrorService$1
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
const HTTP_STATUS_CODES = {
|
|
455
|
+
100: 'Continue',
|
|
456
|
+
101: 'Switching Protocols',
|
|
457
|
+
102: 'Processing',
|
|
458
|
+
103: 'Early Hints',
|
|
459
|
+
200: 'OK',
|
|
460
|
+
201: 'Created',
|
|
461
|
+
202: 'Accepted',
|
|
462
|
+
203: 'Non-Authoritative Information',
|
|
463
|
+
204: 'No Content',
|
|
464
|
+
205: 'Reset Content',
|
|
465
|
+
206: 'Partial Content',
|
|
466
|
+
207: 'Multi-Status',
|
|
467
|
+
208: 'Already Reported',
|
|
468
|
+
226: 'IM Used',
|
|
469
|
+
300: 'Multiple Choices',
|
|
470
|
+
301: 'Moved Permanently',
|
|
471
|
+
302: 'Found',
|
|
472
|
+
303: 'See Other',
|
|
473
|
+
304: 'Not Modified',
|
|
474
|
+
305: 'Use Proxy',
|
|
475
|
+
306: '(Unused)',
|
|
476
|
+
307: 'Temporary Redirect',
|
|
477
|
+
308: 'Permanent Redirect',
|
|
478
|
+
400: 'Bad Request',
|
|
479
|
+
401: 'Unauthorized',
|
|
480
|
+
402: 'Payment Required',
|
|
481
|
+
403: 'Forbidden',
|
|
482
|
+
404: 'Not Found',
|
|
483
|
+
405: 'Method Not Allowed',
|
|
484
|
+
406: 'Not Acceptable',
|
|
485
|
+
407: 'Proxy Authentication Required',
|
|
486
|
+
408: 'Request Timeout',
|
|
487
|
+
409: 'Conflict',
|
|
488
|
+
410: 'Gone',
|
|
489
|
+
411: 'Length Required',
|
|
490
|
+
412: 'Precondition Failed',
|
|
491
|
+
413: 'Payload Too Large',
|
|
492
|
+
414: 'URI Too Long',
|
|
493
|
+
415: 'Unsupported Media Type',
|
|
494
|
+
416: 'Range Not Satisfiable',
|
|
495
|
+
417: 'Expectation Failed',
|
|
496
|
+
418: "I'm a teapot",
|
|
497
|
+
421: 'Misdirected Request',
|
|
498
|
+
422: 'Unprocessable Entity',
|
|
499
|
+
423: 'Locked',
|
|
500
|
+
424: 'Failed Dependency',
|
|
501
|
+
425: 'Too Early',
|
|
502
|
+
426: 'Upgrade Required',
|
|
503
|
+
428: 'Precondition Required',
|
|
504
|
+
429: 'Too Many Requests',
|
|
505
|
+
431: 'Request Header Fields Too Large',
|
|
506
|
+
451: 'Unavailable For Legal Reasons',
|
|
507
|
+
500: 'Internal Server Error',
|
|
508
|
+
501: 'Not Implemented',
|
|
509
|
+
502: 'Bad Gateway',
|
|
510
|
+
503: 'Service Unavailable',
|
|
511
|
+
504: 'Gateway Timeout',
|
|
512
|
+
505: 'HTTP Version Not Supported',
|
|
513
|
+
506: 'Variant Also Negotiates',
|
|
514
|
+
507: 'Insufficient Storage',
|
|
515
|
+
508: 'Loop Detected',
|
|
516
|
+
510: 'Not Extended',
|
|
517
|
+
511: 'Network Authentication Required'
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
class ErrorPopupComponent {
|
|
521
|
+
constructor(error) {
|
|
522
|
+
this.error = error;
|
|
523
|
+
this.httpStatusCodes = HTTP_STATUS_CODES;
|
|
524
|
+
}
|
|
525
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPopupComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
526
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: ErrorPopupComponent, isStandalone: true, selector: "lib-error-popup", ngImport: i0, template: "<lib-default-dialog [title]=\"'\u0410n error has occurred'\">\r\n <div class=\"dialog-content\">\r\n <div class=\"status-info\">\r\n <div>{{ error.status }}</div>\r\n @if (error.status) {\r\n <div>{{ httpStatusCodes[error.status] }}</div>\r\n }\r\n </div>\r\n <div class=\"error-info\">\r\n <lib-error-dispaly [error]=\"error\" />\r\n </div>\r\n </div>\r\n</lib-default-dialog>", styles: [".dialog-content{display:flex;flex-direction:column;align-items:center;padding-inline:1rem}.dialog-content .status-info{display:flex;margin-bottom:.5rem;font-weight:600;font-size:18px;gap:.5rem}.dialog-content .error-info{display:grid;place-items:center}\n"], dependencies: [{ kind: "component", type: DefaultDialogComponent$1, selector: "lib-default-dialog", inputs: ["temRef", "height", "dialogTitle", "withBack"], outputs: ["back"] }, { kind: "component", type: ErrorDispalyComponent$1, selector: "lib-error-dispaly", inputs: ["error"] }] }); }
|
|
527
|
+
}
|
|
528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPopupComponent, decorators: [{
|
|
529
|
+
type: Component,
|
|
530
|
+
args: [{ selector: 'lib-error-popup', imports: [
|
|
531
|
+
DefaultDialogComponent$1,
|
|
532
|
+
ErrorDispalyComponent$1
|
|
533
|
+
], template: "<lib-default-dialog [title]=\"'\u0410n error has occurred'\">\r\n <div class=\"dialog-content\">\r\n <div class=\"status-info\">\r\n <div>{{ error.status }}</div>\r\n @if (error.status) {\r\n <div>{{ httpStatusCodes[error.status] }}</div>\r\n }\r\n </div>\r\n <div class=\"error-info\">\r\n <lib-error-dispaly [error]=\"error\" />\r\n </div>\r\n </div>\r\n</lib-default-dialog>", styles: [".dialog-content{display:flex;flex-direction:column;align-items:center;padding-inline:1rem}.dialog-content .status-info{display:flex;margin-bottom:.5rem;font-weight:600;font-size:18px;gap:.5rem}.dialog-content .error-info{display:grid;place-items:center}\n"] }]
|
|
534
|
+
}], ctorParameters: () => [{ type: i1$4.HttpErrorResponse, decorators: [{
|
|
535
|
+
type: Inject,
|
|
536
|
+
args: [MAT_DIALOG_DATA]
|
|
537
|
+
}] }] });
|
|
538
|
+
|
|
539
|
+
let ErrorHandlerComponent$1 = class ErrorHandlerComponent {
|
|
540
|
+
constructor() {
|
|
541
|
+
this.errSubscriptions = new Subscription();
|
|
542
|
+
this.errorService = inject(ErrorService$1);
|
|
543
|
+
this.dialog = inject(MatDialog);
|
|
544
|
+
this.errSubscriptions.add(this.errorService.error$.subscribe((err) => {
|
|
545
|
+
console.log(err);
|
|
546
|
+
this.showPopup(err);
|
|
547
|
+
}));
|
|
548
|
+
}
|
|
549
|
+
showPopup(error) {
|
|
550
|
+
this.dialog.closeAll();
|
|
551
|
+
this.dialog.open(ErrorPopupComponent, {
|
|
552
|
+
data: error,
|
|
553
|
+
width: '400px',
|
|
554
|
+
scrollStrategy: new NoopScrollStrategy(),
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
ngOnDestroy() {
|
|
558
|
+
this.errSubscriptions.unsubscribe();
|
|
559
|
+
}
|
|
560
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorHandlerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
561
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: ErrorHandlerComponent, isStandalone: true, selector: "lib-error-handler", ngImport: i0, template: "", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }] }); }
|
|
562
|
+
};
|
|
563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorHandlerComponent$1, decorators: [{
|
|
564
|
+
type: Component,
|
|
565
|
+
args: [{ selector: 'lib-error-handler', imports: [
|
|
566
|
+
MatDialogModule
|
|
567
|
+
], template: "" }]
|
|
568
|
+
}], ctorParameters: () => [] });
|
|
569
|
+
|
|
570
|
+
var errorHandler_component = /*#__PURE__*/Object.freeze({
|
|
571
|
+
__proto__: null,
|
|
572
|
+
ErrorHandlerComponent: ErrorHandlerComponent$1
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
let ChipComponent$1 = class ChipComponent {
|
|
576
|
+
constructor() {
|
|
577
|
+
this.value = input.required();
|
|
578
|
+
this.isSelected = input.required();
|
|
579
|
+
this.text = input.required();
|
|
580
|
+
this.selected = output();
|
|
581
|
+
}
|
|
582
|
+
onClick() {
|
|
583
|
+
if (this.isSelected()) {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
this.selected.emit(this.value());
|
|
587
|
+
}
|
|
588
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
589
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: ChipComponent, isStandalone: true, selector: "lib-chip", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, isSelected: { classPropertyName: "isSelected", publicName: "isSelected", isSignal: true, isRequired: true, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selected: "selected" }, ngImport: i0, template: "<div class=\"chip\" [class.selected]=\"isSelected()\" (click)=\"onClick()\">\r\n {{text()}}\r\n</div>\r\n", styles: [".chip{display:inline-block;padding:.5rem 1rem;border-radius:1rem;background-color:#e6e6e6;color:#333;font-size:1rem;cursor:pointer;transition:all .2s}.chip:hover{background-color:#ccc}.chip.selected{background-color:var(--primary-color);color:#fff}\n"] }); }
|
|
590
|
+
};
|
|
591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ChipComponent$1, decorators: [{
|
|
592
|
+
type: Component,
|
|
593
|
+
args: [{ selector: 'lib-chip', imports: [], template: "<div class=\"chip\" [class.selected]=\"isSelected()\" (click)=\"onClick()\">\r\n {{text()}}\r\n</div>\r\n", styles: [".chip{display:inline-block;padding:.5rem 1rem;border-radius:1rem;background-color:#e6e6e6;color:#333;font-size:1rem;cursor:pointer;transition:all .2s}.chip:hover{background-color:#ccc}.chip.selected{background-color:var(--primary-color);color:#fff}\n"] }]
|
|
594
|
+
}] });
|
|
595
|
+
|
|
596
|
+
var chip_component = /*#__PURE__*/Object.freeze({
|
|
597
|
+
__proto__: null,
|
|
598
|
+
ChipComponent: ChipComponent$1
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
/*
|
|
602
|
+
* Public API Surface of ui-lib
|
|
603
|
+
*/
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Generated bundle index. Do not edit.
|
|
607
|
+
*/
|
|
608
|
+
|
|
609
|
+
export { blankFiller_pipe as BlakFillerPipe, chip_component as ChipComponent, defaultDialog_component as DefaultDialogComponent, errorDispaly_component as ErrorDispalyComponent, errorHandler_component as ErrorHandlerComponent, error_service as ErrorService, fieldsMatchValidator_directive as FieldsMatchValidatorDirective, globalLoader_component as GlobalLoaderComponent, loader_service as LoaderService, phoneValidation_directive as PhoneValidationDirective, searchBar_component as SearchBarComponent, snakeCaseParser_pipe as SnakeCaseParserPipe, table_component as TableComponent, tableSortHeader_component as TableSortHeaderComponent, fader, openDropdown, textFader };
|
|
610
|
+
//# sourceMappingURL=ferhaps-easy-ui-lib.mjs.map
|