coer-elements 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/components/index.d.ts +12 -0
- package/components/lib/coer-button/coer-button.component.d.ts +3 -3
- package/components/lib/coer-checkbox/coer-checkbox.component.d.ts +28 -0
- package/components/lib/coer-filebox/coer-filebox.component.d.ts +33 -0
- package/components/lib/coer-form/coer-form.component.d.ts +33 -0
- package/components/lib/coer-grid/coer-grid.component.d.ts +53 -0
- package/components/lib/coer-grid/coer-grid.extension.d.ts +105 -0
- package/components/lib/coer-modal/coer-modal.component.d.ts +38 -0
- package/components/lib/coer-numberbox/coer-numberbox.component.d.ts +56 -0
- package/components/lib/coer-page-title/coer-page-title.component.d.ts +12 -0
- package/components/lib/coer-selectbox/coer-selectbox.component.d.ts +75 -0
- package/components/lib/coer-switch/coer-switch.component.d.ts +31 -0
- package/components/lib/coer-tab/coer-tab.component.d.ts +35 -0
- package/components/lib/coer-textarea/coer-textarea.component.d.ts +51 -0
- package/components/lib/coer-textbox/coer-textbox.component.d.ts +57 -0
- package/components/lib/components.module.d.ts +24 -5
- package/directives/index.d.ts +3 -0
- package/directives/lib/coer-ref.directive.d.ts +14 -0
- package/directives/lib/directives.module.d.ts +8 -0
- package/directives/lib/life-cycle.directive.d.ts +14 -0
- package/esm2022/components/index.mjs +13 -1
- package/esm2022/components/lib/coer-button/coer-button.component.mjs +2 -2
- package/esm2022/components/lib/coer-checkbox/coer-checkbox.component.mjs +84 -0
- package/esm2022/components/lib/coer-filebox/coer-filebox.component.mjs +104 -0
- package/esm2022/components/lib/coer-form/coer-form.component.mjs +102 -0
- package/esm2022/components/lib/coer-grid/coer-grid.component.mjs +515 -0
- package/esm2022/components/lib/coer-grid/coer-grid.extension.mjs +412 -0
- package/esm2022/components/lib/coer-modal/coer-modal.component.mjs +108 -0
- package/esm2022/components/lib/coer-numberbox/coer-numberbox.component.mjs +260 -0
- package/esm2022/components/lib/coer-page-title/coer-page-title.component.mjs +44 -0
- package/esm2022/components/lib/coer-selectbox/coer-selectbox.component.mjs +339 -0
- package/esm2022/components/lib/coer-switch/coer-switch.component.mjs +94 -0
- package/esm2022/components/lib/coer-tab/coer-tab.component.mjs +116 -0
- package/esm2022/components/lib/coer-textarea/coer-textarea.component.mjs +157 -0
- package/esm2022/components/lib/coer-textbox/coer-textbox.component.mjs +196 -0
- package/esm2022/components/lib/components.module.mjs +93 -57
- package/esm2022/directives/index.mjs +4 -0
- package/esm2022/directives/lib/coer-ref.directive.mjs +23 -0
- package/esm2022/directives/lib/directives.module.mjs +25 -0
- package/esm2022/directives/lib/life-cycle.directive.mjs +29 -0
- package/esm2022/interfaces/coer-filebox/index.mjs +3 -0
- package/esm2022/interfaces/coer-grid/index.mjs +21 -0
- package/esm2022/interfaces/index.mjs +1 -3
- package/esm2022/interfaces/lib/coer-filebox/file-image.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-filebox/file.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-button-by-row.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-checkbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-coer-numberbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-coer-selectbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-coer-switch.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-coer-textbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-column.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-data-source.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-header-button.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-header-export-button.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-header.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-import.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-input-checkbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-input-switch-change.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-input-textbox.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-item.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-keyup-enter.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-length.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-search.interface.mjs +2 -0
- package/esm2022/interfaces/lib/coer-grid/grid-sort.interface.mjs +2 -0
- package/esm2022/interfaces/lib/menu/menu-option-selected.interface.mjs +2 -0
- package/esm2022/interfaces/lib/menu/menu.interface.mjs +2 -0
- package/esm2022/interfaces/lib/page-title/breadcrumb.interface.mjs +2 -0
- package/esm2022/interfaces/lib/page-title/go-back.interface.mjs +2 -0
- package/esm2022/interfaces/page-title/index.mjs +3 -0
- package/esm2022/pipes/index.mjs +5 -0
- package/esm2022/pipes/lib/html.pipe.mjs +18 -0
- package/esm2022/pipes/lib/no-image.pipe.mjs +23 -0
- package/esm2022/pipes/lib/numeric-format.pipe.mjs +15 -0
- package/esm2022/pipes/lib/pipes.module.mjs +31 -0
- package/esm2022/public_api.mjs +3 -1
- package/esm2022/signals/lib/breakpoint.signal.mjs +2 -2
- package/esm2022/signals/lib/is-loading.signal.mjs +2 -2
- package/esm2022/signals/lib/is-modal-open.signal.mjs +2 -2
- package/esm2022/tools/index.mjs +3 -2
- package/esm2022/tools/lib/breadcrumbs.class.mjs +2 -2
- package/esm2022/tools/lib/date-time.class.mjs +14 -7
- package/esm2022/tools/lib/files.class.mjs +2 -2
- package/esm2022/tools/lib/menu.class.mjs +23 -0
- package/esm2022/tools/lib/page.class.mjs +6 -6
- package/esm2022/tools/lib/screen.class.mjs +9 -1
- package/esm2022/tools/lib/source.class.mjs +3 -3
- package/esm2022/tools/lib/tools.mjs +220 -0
- package/fesm2022/coer-elements.mjs +3266 -603
- package/fesm2022/coer-elements.mjs.map +1 -1
- package/interfaces/coer-filebox/index.d.ts +2 -0
- package/interfaces/coer-grid/index.d.ts +20 -0
- package/interfaces/index.d.ts +0 -2
- package/interfaces/lib/coer-filebox/file-image.interface.d.ts +14 -0
- package/interfaces/lib/coer-filebox/file.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-button-by-row.interface.d.ts +6 -0
- package/interfaces/lib/coer-grid/grid-checkbox.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-coer-numberbox.interface.d.ts +12 -0
- package/interfaces/lib/coer-grid/grid-coer-selectbox.interface.d.ts +9 -0
- package/interfaces/lib/coer-grid/grid-coer-switch.interface.d.ts +6 -0
- package/interfaces/lib/coer-grid/grid-coer-textbox.interface.d.ts +11 -0
- package/interfaces/lib/coer-grid/grid-column.interface.d.ts +22 -0
- package/interfaces/lib/coer-grid/grid-data-source.interface.d.ts +6 -0
- package/interfaces/lib/coer-grid/grid-header-button.interface.d.ts +8 -0
- package/interfaces/lib/coer-grid/grid-header-export-button.interface.d.ts +10 -0
- package/interfaces/lib/coer-grid/grid-header.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-import.interface.d.ts +4 -0
- package/interfaces/lib/coer-grid/grid-input-checkbox.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-input-switch-change.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-input-textbox.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-item.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-keyup-enter.interface.d.ts +6 -0
- package/interfaces/lib/coer-grid/grid-length.interface.d.ts +5 -0
- package/interfaces/lib/coer-grid/grid-search.interface.d.ts +4 -0
- package/interfaces/lib/coer-grid/grid-sort.interface.d.ts +5 -0
- package/interfaces/lib/menu/menu-option-selected.interface.d.ts +9 -0
- package/interfaces/lib/menu/menu.interface.d.ts +6 -0
- package/interfaces/page-title/index.d.ts +2 -0
- package/package.json +1 -1
- package/pipes/index.d.ts +4 -0
- package/pipes/lib/html.pipe.d.ts +10 -0
- package/pipes/lib/no-image.pipe.d.ts +7 -0
- package/pipes/lib/numeric-format.pipe.d.ts +7 -0
- package/pipes/lib/pipes.module.d.ts +9 -0
- package/public_api.d.ts +2 -0
- package/signals/lib/is-loading.signal.d.ts +1 -1
- package/signals/lib/is-modal-open.signal.d.ts +1 -1
- package/src/interfaces/coer-filebox/index.ts +2 -0
- package/src/interfaces/coer-grid/index.ts +20 -0
- package/src/interfaces/index.ts +1 -3
- package/src/interfaces/lib/coer-filebox/file-image.interface.ts +14 -0
- package/src/interfaces/lib/coer-filebox/file.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-button-by-row.interface.ts +7 -0
- package/src/interfaces/lib/coer-grid/grid-checkbox.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-coer-numberbox.interface.ts +12 -0
- package/src/interfaces/lib/coer-grid/grid-coer-selectbox.interface.ts +9 -0
- package/src/interfaces/lib/coer-grid/grid-coer-switch.interface.ts +6 -0
- package/src/interfaces/lib/coer-grid/grid-coer-textbox.interface.ts +11 -0
- package/src/interfaces/lib/coer-grid/grid-column.interface.ts +23 -0
- package/src/interfaces/lib/coer-grid/grid-data-source.interface.ts +6 -0
- package/src/interfaces/lib/coer-grid/grid-header-button.interface.ts +8 -0
- package/src/interfaces/lib/coer-grid/grid-header-export-button.interface.ts +10 -0
- package/src/interfaces/lib/coer-grid/grid-header.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-import.interface.ts +4 -0
- package/src/interfaces/lib/coer-grid/grid-input-checkbox.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-input-switch-change.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-input-textbox.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-item.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-keyup-enter.interface.ts +6 -0
- package/src/interfaces/lib/coer-grid/grid-length.interface.ts +5 -0
- package/src/interfaces/lib/coer-grid/grid-search.interface.ts +4 -0
- package/src/interfaces/lib/coer-grid/grid-sort.interface.ts +5 -0
- package/src/interfaces/lib/menu/menu-option-selected.interface.ts +10 -0
- package/src/interfaces/lib/menu/menu-selected.interface.ts +11 -0
- package/src/interfaces/lib/menu/menu.interface.ts +6 -0
- package/src/interfaces/menu/index.ts +3 -0
- package/src/interfaces/page-title/index.ts +2 -0
- package/tools/index.d.ts +2 -1
- package/tools/lib/breadcrumbs.class.d.ts +1 -1
- package/tools/lib/date-time.class.d.ts +4 -2
- package/tools/lib/menu.class.d.ts +8 -0
- package/tools/lib/page.class.d.ts +4 -3
- package/tools/lib/screen.class.d.ts +3 -1
- package/tools/lib/source.class.d.ts +1 -1
- package/tools/lib/{generi-tools.d.ts → tools.d.ts} +7 -5
- package/esm2022/interfaces/lib/breadcrumb.interface.mjs +0 -2
- package/esm2022/interfaces/lib/go-back.interface.mjs +0 -2
- package/esm2022/tools/lib/generi-tools.mjs +0 -199
- /package/interfaces/lib/{breadcrumb.interface.d.ts → page-title/breadcrumb.interface.d.ts} +0 -0
- /package/interfaces/lib/{go-back.interface.d.ts → page-title/go-back.interface.d.ts} +0 -0
- /package/src/interfaces/lib/{breadcrumb.interface.ts → page-title/breadcrumb.interface.ts} +0 -0
- /package/src/interfaces/lib/{go-back.interface.ts → page-title/go-back.interface.ts} +0 -0
- /package/src/styles/{coer-elements.scss → index.scss} +0 -0
@@ -1,18 +1,390 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import {
|
3
|
-
import * as i1 from '@angular/common';
|
2
|
+
import { input, Directive, output, NgModule, Pipe, signal, Component, EventEmitter, computed, Input, Output, forwardRef, ContentChildren, inject, viewChild, viewChildren, ViewChild, Inject } from '@angular/core';
|
3
|
+
import * as i1$1 from '@angular/common';
|
4
4
|
import { CommonModule } from '@angular/common';
|
5
5
|
import * as i2 from '@angular/router';
|
6
|
-
import { Router, ActivatedRoute
|
6
|
+
import { RouterModule, Router, ActivatedRoute } from '@angular/router';
|
7
|
+
import * as i2$1 from '@angular/forms';
|
7
8
|
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
9
|
+
import * as i1 from '@angular/platform-browser';
|
8
10
|
import * as i3 from '@angular/material/button';
|
9
11
|
import { MatButtonModule } from '@angular/material/button';
|
12
|
+
import * as i3$1 from '@angular/material/checkbox';
|
13
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
14
|
+
import * as i2$2 from '@angular/material/input';
|
15
|
+
import { MatInputModule } from '@angular/material/input';
|
16
|
+
import * as i3$2 from '@angular/material/form-field';
|
17
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
18
|
+
import * as i2$3 from '@angular/material/slide-toggle';
|
19
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
20
|
+
import * as i2$4 from '@angular/material/tabs';
|
21
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
10
22
|
import * as bootstrap from 'bootstrap';
|
11
|
-
import { Tooltip } from 'bootstrap';
|
23
|
+
import { Tooltip, Modal } from 'bootstrap';
|
12
24
|
import Swal from 'sweetalert2';
|
13
|
-
import moment from 'moment';
|
14
25
|
import * as XLSX from 'xlsx';
|
15
26
|
import { Observable } from 'rxjs';
|
27
|
+
import moment from 'moment';
|
28
|
+
|
29
|
+
class CoerRefDirective {
|
30
|
+
constructor(template) {
|
31
|
+
this.template = template;
|
32
|
+
//Inputs
|
33
|
+
this.coerRef = input('');
|
34
|
+
this.title = input('');
|
35
|
+
this.icon = input('');
|
36
|
+
this.isDisabled = input(false);
|
37
|
+
this.show = input(true);
|
38
|
+
this.tooltip = input('');
|
39
|
+
}
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerRefDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
41
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.12", type: CoerRefDirective, selector: "[coerRef]", inputs: { coerRef: { classPropertyName: "coerRef", publicName: "coerRef", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
42
|
+
}
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerRefDirective, decorators: [{
|
44
|
+
type: Directive,
|
45
|
+
args: [{
|
46
|
+
selector: '[coerRef]'
|
47
|
+
}]
|
48
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
49
|
+
|
50
|
+
class LifeCycleDirective {
|
51
|
+
constructor(element) {
|
52
|
+
this.element = element;
|
53
|
+
//Outputs
|
54
|
+
this.onInit = output();
|
55
|
+
this.afterViewInit = output();
|
56
|
+
this.onDestroy = output();
|
57
|
+
}
|
58
|
+
ngOnInit() {
|
59
|
+
this.onInit.emit(this.element.nativeElement);
|
60
|
+
}
|
61
|
+
ngAfterViewInit() {
|
62
|
+
this.afterViewInit.emit(this.element.nativeElement);
|
63
|
+
}
|
64
|
+
ngOnDestroy() {
|
65
|
+
this.onDestroy.emit(this.element.nativeElement);
|
66
|
+
}
|
67
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LifeCycleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
68
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: LifeCycleDirective, selector: "[lifecycle]", outputs: { onInit: "onInit", afterViewInit: "afterViewInit", onDestroy: "onDestroy" }, ngImport: i0 }); }
|
69
|
+
}
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LifeCycleDirective, decorators: [{
|
71
|
+
type: Directive,
|
72
|
+
args: [{
|
73
|
+
selector: '[lifecycle]'
|
74
|
+
}]
|
75
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
76
|
+
|
77
|
+
class DirectivesModule {
|
78
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
79
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: DirectivesModule, declarations: [CoerRefDirective,
|
80
|
+
LifeCycleDirective], exports: [CoerRefDirective,
|
81
|
+
LifeCycleDirective] }); }
|
82
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DirectivesModule }); }
|
83
|
+
}
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DirectivesModule, decorators: [{
|
85
|
+
type: NgModule,
|
86
|
+
args: [{
|
87
|
+
declarations: [
|
88
|
+
CoerRefDirective,
|
89
|
+
LifeCycleDirective,
|
90
|
+
],
|
91
|
+
exports: [
|
92
|
+
CoerRefDirective,
|
93
|
+
LifeCycleDirective
|
94
|
+
]
|
95
|
+
}]
|
96
|
+
}] });
|
97
|
+
|
98
|
+
class HtmlPipe {
|
99
|
+
constructor(sanitizer) {
|
100
|
+
this.sanitizer = sanitizer;
|
101
|
+
}
|
102
|
+
transform(value) {
|
103
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
104
|
+
}
|
105
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
106
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: HtmlPipe, name: "html" }); }
|
107
|
+
}
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HtmlPipe, decorators: [{
|
109
|
+
type: Pipe,
|
110
|
+
args: [{ name: 'html' }]
|
111
|
+
}], ctorParameters: () => [{ type: i1.DomSanitizer }] });
|
112
|
+
|
113
|
+
const reference_signal = signal({});
|
114
|
+
const Tools = {
|
115
|
+
/** Generate a Guid */
|
116
|
+
GetGuid: (seed = 'coer-system') => {
|
117
|
+
let time = new Date().getTime();
|
118
|
+
seed = seed.toString().trim();
|
119
|
+
return seed + `-xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g, (c) => {
|
120
|
+
const random = (time + Math.random() * 16) % 16 | 0;
|
121
|
+
time = Math.floor(time / 16);
|
122
|
+
return (c == 'x' ? random : (random & 0x3 | 0x8)).toString(16);
|
123
|
+
});
|
124
|
+
},
|
125
|
+
/** Returns true if the value is null or undefined, false otherwise */
|
126
|
+
IsNull: (value) => {
|
127
|
+
if (value === undefined)
|
128
|
+
return true;
|
129
|
+
if (value === null)
|
130
|
+
return true;
|
131
|
+
return false;
|
132
|
+
},
|
133
|
+
/** Returns true if the value is not null or undefined, false otherwise */
|
134
|
+
IsNotNull: (value) => {
|
135
|
+
if (value === undefined)
|
136
|
+
return false;
|
137
|
+
if (value === null)
|
138
|
+
return false;
|
139
|
+
return true;
|
140
|
+
},
|
141
|
+
/** Returns true if the value is null or undefined or contains only whitespace, false otherwise */
|
142
|
+
IsOnlyWhiteSpace: (value) => {
|
143
|
+
if (value === undefined)
|
144
|
+
return true;
|
145
|
+
if (value === null)
|
146
|
+
return true;
|
147
|
+
if (typeof value === 'string' && value.trim() === '')
|
148
|
+
return true;
|
149
|
+
return false;
|
150
|
+
},
|
151
|
+
/** Returns true if has string value and is not only whitespace, false otherwise */
|
152
|
+
IsNotOnlyWhiteSpace: (value) => {
|
153
|
+
if (value === undefined)
|
154
|
+
return false;
|
155
|
+
if (value === null)
|
156
|
+
return false;
|
157
|
+
if (typeof value === 'string' && value.trim() === '')
|
158
|
+
return false;
|
159
|
+
return true;
|
160
|
+
},
|
161
|
+
/** Break reference of a object or array */
|
162
|
+
BreakReference: (object) => {
|
163
|
+
if (object === null)
|
164
|
+
return object;
|
165
|
+
if (typeof object === 'undefined')
|
166
|
+
return object;
|
167
|
+
if (typeof object === 'string')
|
168
|
+
return object;
|
169
|
+
if (typeof object === 'number')
|
170
|
+
return object;
|
171
|
+
if (typeof object === 'boolean')
|
172
|
+
return object;
|
173
|
+
const OBJECT = JSON.parse(JSON.stringify(object));
|
174
|
+
return (Array.isArray(OBJECT)) ? [...OBJECT] : { ...OBJECT };
|
175
|
+
},
|
176
|
+
/** Clean extra whitespaces */
|
177
|
+
CleanUpBlanks: (text) => {
|
178
|
+
if (Tools.IsNull(text))
|
179
|
+
return '';
|
180
|
+
let worlds = String(text).split(' ');
|
181
|
+
worlds = worlds.filter(x => x.length > 0);
|
182
|
+
return worlds.join(' ');
|
183
|
+
},
|
184
|
+
/** Get properties of an object */
|
185
|
+
GetObjectProperties: (obj) => {
|
186
|
+
const properties = [];
|
187
|
+
if (obj === null)
|
188
|
+
return properties;
|
189
|
+
if (typeof obj === 'undefined')
|
190
|
+
return properties;
|
191
|
+
if (typeof obj === 'string')
|
192
|
+
return properties;
|
193
|
+
if (typeof obj === 'number')
|
194
|
+
return properties;
|
195
|
+
if (typeof obj === 'boolean')
|
196
|
+
return properties;
|
197
|
+
for (const property in obj)
|
198
|
+
properties.push(String(property));
|
199
|
+
return properties;
|
200
|
+
},
|
201
|
+
/**
|
202
|
+
* Set an index and merge more arrays of the same type
|
203
|
+
* */
|
204
|
+
SetIndex: (array, ...args) => {
|
205
|
+
let index = 0;
|
206
|
+
for (const arg of args) {
|
207
|
+
array = Tools.BreakReference(array).concat(Tools.BreakReference(arg));
|
208
|
+
}
|
209
|
+
return Tools.BreakReference(array).map(item => Object.assign({ index: index++ }, item));
|
210
|
+
},
|
211
|
+
/** Set First Char To Lower */
|
212
|
+
FirstCharToLower: (text) => {
|
213
|
+
if (Tools.IsOnlyWhiteSpace(text))
|
214
|
+
return '';
|
215
|
+
const textArray = [];
|
216
|
+
for (let i = 0; i < text.length; i++) {
|
217
|
+
if (i === 0)
|
218
|
+
textArray.push(text[i].toLowerCase());
|
219
|
+
else
|
220
|
+
textArray.push(text[i]);
|
221
|
+
}
|
222
|
+
return textArray.join('');
|
223
|
+
},
|
224
|
+
/** Set First Char To Upper */
|
225
|
+
FirstCharToUpper: (text) => {
|
226
|
+
if (Tools.IsOnlyWhiteSpace(text))
|
227
|
+
return '';
|
228
|
+
const textArray = [];
|
229
|
+
for (let i = 0; i < text.length; i++) {
|
230
|
+
if (i === 0)
|
231
|
+
textArray.push(text[i].toUpperCase());
|
232
|
+
else
|
233
|
+
textArray.push(text[i]);
|
234
|
+
}
|
235
|
+
return textArray.join('');
|
236
|
+
},
|
237
|
+
/** Sort an array in ascending order by property */
|
238
|
+
SortBy: (array, property, propertyType = 'string') => {
|
239
|
+
switch (propertyType) {
|
240
|
+
case 'string': {
|
241
|
+
return array.sort((x, y) => {
|
242
|
+
if (String(x[property]).toUpperCase().trim() < String(y[property]).toUpperCase().trim())
|
243
|
+
return -1;
|
244
|
+
else if (String(x[property]).toUpperCase().trim() > String(y[property]).toUpperCase().trim())
|
245
|
+
return 1;
|
246
|
+
else
|
247
|
+
return 0;
|
248
|
+
});
|
249
|
+
}
|
250
|
+
case 'number': {
|
251
|
+
return array.sort((x, y) => Number(x[property] - Number(y[property])));
|
252
|
+
}
|
253
|
+
}
|
254
|
+
},
|
255
|
+
/** Sort an array in descending order by property */
|
256
|
+
SortByDesc: (array, property, propertyType = 'string') => {
|
257
|
+
switch (propertyType) {
|
258
|
+
case 'string': {
|
259
|
+
return array.sort((x, y) => {
|
260
|
+
if (String(x[property]).toUpperCase().trim() < String(y[property]).toUpperCase().trim())
|
261
|
+
return 1;
|
262
|
+
else if (String(x[property]).toUpperCase().trim() > String(y[property]).toUpperCase().trim())
|
263
|
+
return -1;
|
264
|
+
else
|
265
|
+
return 0;
|
266
|
+
});
|
267
|
+
}
|
268
|
+
case 'number': {
|
269
|
+
return array.sort((x, y) => Number(Number(y[property])) - x[property]);
|
270
|
+
}
|
271
|
+
}
|
272
|
+
},
|
273
|
+
/** Return a string with forman numeric */
|
274
|
+
GetNumericFormat: (value, decimals = 0) => {
|
275
|
+
if (Tools.IsOnlyWhiteSpace(value) || isNaN(Number(value))) {
|
276
|
+
return '0';
|
277
|
+
}
|
278
|
+
let valueInteger = '';
|
279
|
+
let valueDecimal = '';
|
280
|
+
value = value.toString().replaceAll(' ', '');
|
281
|
+
if (value.includes('.') || (decimals > 0)) {
|
282
|
+
valueInteger = value.includes('.') ? value.split('.')[0] : value;
|
283
|
+
if (decimals > 0) {
|
284
|
+
const PADDING = decimals - valueDecimal.length;
|
285
|
+
valueDecimal = value.includes('.') ? value.split('.')[1] : '';
|
286
|
+
for (let i = 0; i < PADDING; i++)
|
287
|
+
valueDecimal += '0';
|
288
|
+
valueDecimal = valueDecimal.substring(0, decimals);
|
289
|
+
valueDecimal = `.${valueDecimal}`;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
else {
|
293
|
+
valueInteger = value;
|
294
|
+
}
|
295
|
+
let counter = 0;
|
296
|
+
const VALUE_INTEGER_ARRAY = [];
|
297
|
+
for (const char of valueInteger.split('').reverse()) {
|
298
|
+
if (counter == 3) {
|
299
|
+
VALUE_INTEGER_ARRAY.push(',');
|
300
|
+
counter = 0;
|
301
|
+
}
|
302
|
+
VALUE_INTEGER_ARRAY.push(char);
|
303
|
+
++counter;
|
304
|
+
}
|
305
|
+
valueInteger = VALUE_INTEGER_ARRAY.reverse().join('');
|
306
|
+
return `${valueInteger}${valueDecimal}`;
|
307
|
+
},
|
308
|
+
/** Wait the time indicated */
|
309
|
+
Sleep: (milliseconds = 0, reference = null) => {
|
310
|
+
if (Tools.IsNull(reference)) {
|
311
|
+
return new Promise(Resolve => setTimeout(Resolve, milliseconds));
|
312
|
+
}
|
313
|
+
else
|
314
|
+
return new Promise(Resolve => {
|
315
|
+
reference = reference.replaceAll(' ', '_').toLowerCase();
|
316
|
+
if (reference_signal().hasOwnProperty(reference)) {
|
317
|
+
clearInterval(reference_signal()[reference]);
|
318
|
+
}
|
319
|
+
reference_signal.set(Object.assign(reference_signal(), {
|
320
|
+
[reference]: setTimeout(() => {
|
321
|
+
Resolve();
|
322
|
+
clearInterval(reference_signal()[reference]);
|
323
|
+
const _reference = { ...reference_signal() };
|
324
|
+
delete _reference[reference];
|
325
|
+
reference_signal.set({ ..._reference });
|
326
|
+
}, milliseconds)
|
327
|
+
}));
|
328
|
+
});
|
329
|
+
}
|
330
|
+
};
|
331
|
+
|
332
|
+
class NoImagePipe {
|
333
|
+
transform(value) {
|
334
|
+
const NO_IMAGE = '../../images/no-image.png';
|
335
|
+
if (Tools.IsOnlyWhiteSpace(value)) {
|
336
|
+
return NO_IMAGE;
|
337
|
+
}
|
338
|
+
else if (typeof value === 'string') {
|
339
|
+
return value;
|
340
|
+
}
|
341
|
+
//Files.ConvertToBase64(value as File).then(base64 => { return base64 });
|
342
|
+
return NO_IMAGE;
|
343
|
+
}
|
344
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoImagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
345
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NoImagePipe, name: "noImage" }); }
|
346
|
+
}
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoImagePipe, decorators: [{
|
348
|
+
type: Pipe,
|
349
|
+
args: [{ name: 'noImage' }]
|
350
|
+
}] });
|
351
|
+
|
352
|
+
class NumericFormatPipe {
|
353
|
+
transform(value, decimals = 0) {
|
354
|
+
return Tools.GetNumericFormat(value, decimals);
|
355
|
+
}
|
356
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NumericFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
357
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NumericFormatPipe, name: "numericFormat" }); }
|
358
|
+
}
|
359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NumericFormatPipe, decorators: [{
|
360
|
+
type: Pipe,
|
361
|
+
args: [{ name: 'numericFormat' }]
|
362
|
+
}] });
|
363
|
+
|
364
|
+
class PipesModule {
|
365
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
366
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: PipesModule, declarations: [HtmlPipe,
|
367
|
+
NoImagePipe,
|
368
|
+
NumericFormatPipe], exports: [HtmlPipe,
|
369
|
+
NoImagePipe,
|
370
|
+
NumericFormatPipe] }); }
|
371
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PipesModule }); }
|
372
|
+
}
|
373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PipesModule, decorators: [{
|
374
|
+
type: NgModule,
|
375
|
+
args: [{
|
376
|
+
declarations: [
|
377
|
+
HtmlPipe,
|
378
|
+
NoImagePipe,
|
379
|
+
NumericFormatPipe
|
380
|
+
],
|
381
|
+
exports: [
|
382
|
+
HtmlPipe,
|
383
|
+
NoImagePipe,
|
384
|
+
NumericFormatPipe
|
385
|
+
]
|
386
|
+
}]
|
387
|
+
}] });
|
16
388
|
|
17
389
|
class CoerAlert {
|
18
390
|
/** */
|
@@ -237,417 +609,2963 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
237
609
|
args: [{ selector: 'coer-alert', template: "<aside class=\"toast-container coer-alert\">\r\n <!-- Success -->\r\n <div id=\"alert-success\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-success-icon\"></i>\r\n <strong id=\"alert-success-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-success')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-success-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div id=\"alert-error\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-error-icon\"></i>\r\n <strong id=\"alert-error-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-error')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-error-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Info -->\r\n <div id=\"alert-info\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-info-icon\"></i>\r\n <strong id=\"alert-info-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-info')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-info-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Warning -->\r\n <div id=\"alert-warning\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-warning-icon\"></i>\r\n <strong id=\"alert-warning-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-warning')\" class=\"btn-close\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-warning-message\"></pre>\r\n </div>\r\n </div>\r\n</aside>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.border-blue{border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.border-gray{border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.border-green{border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.border-yellow{border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.border-red{border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.border-white{border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.border-black{border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}.border-orange{border-color:#fd6031!important}aside.toast-container{position:fixed;bottom:0;right:0;padding:15px!important;z-index:2000!important}aside.toast-container i,aside.toast-container svg{display:flex;align-items:center}aside.toast-container strong{margin:0 auto 0 5px}aside.toast-container div.toast,aside.toast-container div.toast-header{border-top-left-radius:10px;border-top-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast,aside.toast-container div.toast-body{border-bottom-left-radius:10px;border-bottom-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast-body{min-height:36px}aside.toast-container pre{font-family:Roboto,RobotoFallback,Noto Kufi Arabic,Helvetica,Arial,sans-serif;white-space:pre-wrap;font-size:medium}aside.toast-container button{margin:0 2px!important;width:10px!important;height:10px!important;box-shadow:none!important;outline:none!important;border:none!important}aside.toast-container div#alert-success div.toast-header,aside.toast-container div#alert-success div.toast-body{background-color:#198754}aside.toast-container div#alert-info div.toast-header,aside.toast-container div#alert-info div.toast-body{background-color:#0d6efd}aside.toast-container div#alert-error div.toast-header,aside.toast-container div#alert-error div.toast-body{background-color:#dc3545}aside.toast-container div#alert-warning div.toast-header,aside.toast-container div#alert-warning div.toast-body{background-color:#ffc107;border-color:#252525;color:#252525}aside.toast-container div#alert-success:hover,aside.toast-container div#alert-info:hover,aside.toast-container div#alert-error:hover,aside.toast-container div#alert-warning:hover{transform:scale(1.01);box-shadow:2px 2px 10px #789;cursor:default}button.sweet-alert-button{width:100px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0 5px!important;outline:none!important;border:none!important;box-shadow:none!important}aside.toast-container>*{border:none!important;z-index:2000!important;margin:15px 0 0!important}\n"] }]
|
238
610
|
}] });
|
239
611
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
612
|
+
class CoerButton {
|
613
|
+
constructor() {
|
614
|
+
//Variables
|
615
|
+
this._id = Tools.GetGuid('coer-button');
|
616
|
+
this._tooltip = '';
|
617
|
+
//Inputs
|
618
|
+
this.id = '';
|
619
|
+
this.color = input('default');
|
620
|
+
this.type = input('filled');
|
621
|
+
this.icon = input('');
|
622
|
+
this.iconPosition = input('left');
|
623
|
+
this.animation = input(false);
|
624
|
+
this.isLoading = input(false);
|
625
|
+
this.isDisabled = input(false);
|
626
|
+
this.isInvisible = input(false);
|
627
|
+
this.width = input('125px');
|
628
|
+
this.minWidth = input('30px');
|
629
|
+
this.height = input('40px');
|
630
|
+
this.minHeight = input('30px');
|
631
|
+
this.marginTop = input('0px');
|
632
|
+
this.marginRight = input('0px');
|
633
|
+
this.marginBottom = input('0px');
|
634
|
+
this.marginLeft = input('0px');
|
635
|
+
this.path = input([]);
|
636
|
+
this.tooltipPosition = input('left');
|
637
|
+
//Outputs
|
638
|
+
this.onClick = new EventEmitter();
|
639
|
+
//computed
|
640
|
+
this._isEnable = computed(() => {
|
641
|
+
return !this.isLoading() && !this.isDisabled() && !this.isInvisible();
|
642
|
+
});
|
643
|
+
//computed
|
644
|
+
this._icon = computed(() => {
|
645
|
+
switch (this.icon()) {
|
646
|
+
case 'new': return 'fa-solid fa-plus fa-lg';
|
647
|
+
case 'save': return 'fa-solid fa-floppy-disk fa-lg';
|
648
|
+
case 'cancel': return 'fa-solid fa-xmark fa-lg';
|
649
|
+
case 'import': return 'fa-solid fa-file-arrow-up fa-lg';
|
650
|
+
case 'excel': return 'bi bi-filetype-xlsx fa-lg';
|
651
|
+
case 'menu': return 'fa-solid fa-bars';
|
652
|
+
case 'delete': return 'fa-solid fa-trash-can';
|
653
|
+
case 'edit': return 'fa-solid fa-pen fa-lg';
|
654
|
+
case 'go': return 'bi bi-box-arrow-right';
|
655
|
+
case 'back': return 'bi bi-box-arrow-left';
|
656
|
+
default: return '';
|
657
|
+
}
|
658
|
+
});
|
659
|
+
}
|
660
|
+
set tooltip(value) {
|
661
|
+
this._tooltip = value;
|
662
|
+
if (value && this._tooltipElement) {
|
663
|
+
this._tooltipElement.setContent({ '.tooltip-inner': this._tooltip });
|
664
|
+
}
|
665
|
+
}
|
666
|
+
ngOnInit() {
|
667
|
+
this.SetToolTip();
|
668
|
+
this.SetEvents();
|
669
|
+
}
|
670
|
+
ngOnDestroy() {
|
671
|
+
if (this._tooltipElement) {
|
672
|
+
Tools.Sleep().then(() => this._tooltipElement.dispose());
|
673
|
+
}
|
674
|
+
}
|
675
|
+
/** */
|
676
|
+
SetEvents() {
|
677
|
+
Tools.Sleep().then(() => {
|
678
|
+
this._element = document.getElementById(`${this._id}-inner-button`);
|
679
|
+
if (Tools.IsNotNull(this._element)) {
|
680
|
+
this._element.addEventListener('focus', () => {
|
681
|
+
if (!this._isEnable())
|
682
|
+
this.Blur();
|
683
|
+
});
|
684
|
+
}
|
685
|
+
});
|
686
|
+
}
|
687
|
+
SetToolTip() {
|
688
|
+
Tools.Sleep().then(() => {
|
689
|
+
const htmlElement = document.getElementById(`${this._id}-container`);
|
690
|
+
if (Tools.IsNotNull(htmlElement)) {
|
691
|
+
htmlElement.addEventListener('mouseleave', () => {
|
692
|
+
if (Tools.IsNotNull(htmlElement) && Tools.IsNotNull(this._tooltipElement)) {
|
693
|
+
this._tooltipElement.hide();
|
694
|
+
}
|
695
|
+
});
|
696
|
+
this._tooltipElement = new Tooltip(htmlElement, {
|
697
|
+
html: true,
|
698
|
+
title: this._tooltip,
|
699
|
+
placement: this.tooltipPosition
|
700
|
+
});
|
701
|
+
}
|
702
|
+
});
|
703
|
+
}
|
704
|
+
/** */
|
705
|
+
Click(event) {
|
706
|
+
if (this._isEnable()) {
|
707
|
+
this.onClick.emit(event);
|
708
|
+
}
|
709
|
+
this.Blur();
|
710
|
+
}
|
711
|
+
/** */
|
712
|
+
Focus(timeout = 0) {
|
713
|
+
Tools.Sleep(timeout).then(() => {
|
714
|
+
if (this._isEnable())
|
715
|
+
this._element.focus();
|
716
|
+
});
|
717
|
+
}
|
718
|
+
/** */
|
719
|
+
Blur() {
|
720
|
+
Tools.Sleep().then(() => {
|
721
|
+
this._element.blur();
|
722
|
+
});
|
723
|
+
}
|
724
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
725
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerButton, selector: "coer-button", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "animation", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isInvisible: { classPropertyName: "isInvisible", publicName: "isInvisible", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, marginTop: { classPropertyName: "marginTop", publicName: "marginTop", isSignal: true, isRequired: false, transformFunction: null }, marginRight: { classPropertyName: "marginRight", publicName: "marginRight", isSignal: true, isRequired: false, transformFunction: null }, marginBottom: { classPropertyName: "marginBottom", publicName: "marginBottom", isSignal: true, isRequired: false, transformFunction: null }, marginLeft: { classPropertyName: "marginLeft", publicName: "marginLeft", isSignal: true, isRequired: false, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<div [ngClass]=\"{ 'coer-button': true, 'invisible': isInvisible() }\">\r\n <a [id]=\"_id + '-container'\"\r\n [routerLink]=\"(path().length > 0 && _isEnable()) ? path() : null\"\r\n [ngClass]=\"{ 'loading': isLoading(), 'animate__animated animate__zoomIn': true, 'animate__disabled': !animation() }\"\r\n [ngStyle]=\"{ 'margin-top': marginTop(), 'margin-right': marginRight(), 'margin-bottom': marginBottom(), 'margin-left': marginLeft() }\">\r\n @if(type() =='filled' || type() == 'outline') {\r\n <button mat-button\r\n [id]=\"_id + '-inner-button'\"\r\n type=\"button\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-filled': (color() == 'primary' && type() =='filled'),\r\n 'secondary-filled': (color() == 'secondary' && type() =='filled'),\r\n 'success-filled': (color() == 'success' && type() =='filled'),\r\n 'warning-filled': (color() == 'warning' && type() =='filled'),\r\n 'danger-filled': (color() == 'danger' && type() =='filled'),\r\n 'navigation-filled': (color() == 'navigation' && type() =='filled'),\r\n 'primary-outline': (color() == 'primary' && type() =='outline'),\r\n 'secondary-outline': (color() == 'secondary' && type() =='outline'),\r\n 'success-outline': (color() == 'success' && type() =='outline'),\r\n 'warning-outline': (color() == 'warning' && type() =='outline'),\r\n 'danger-outline': (color() == 'danger' && type() =='outline'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': isDisabled(),\r\n 'cursor-wait': isLoading()\r\n }\"\r\n [ngStyle]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'height': height(),\r\n 'min-height': minHeight()\r\n }\">\r\n <span class=\"slot\" *ngIf=\"!isLoading(); else loading\" >\r\n <span *ngIf=\"(iconPosition() == 'left')\">\r\n <i [class]=\"_icon()\"></i>\r\n </span>\r\n\r\n <span [ngClass]=\"{ 'ms-2': (iconPosition() == 'left'), 'me-2': (iconPosition() == 'right') }\">\r\n <ng-content></ng-content>\r\n </span>\r\n\r\n <span *ngIf=\"(iconPosition() == 'right')\">\r\n <i [class]=\"_icon()\"></i>\r\n </span>\r\n </span>\r\n\r\n <ng-template #loading>\r\n <span class=\"slot fa-fade\">\r\n <span class=\"me-2\"> Loading </span>\r\n <i class=\"spinner-border\"></i>\r\n </span>\r\n </ng-template>\r\n </button>\r\n }\r\n\r\n @else {\r\n @if (type() == 'icon') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-filled': (color() == 'primary'),\r\n 'secondary-filled': (color() == 'secondary'),\r\n 'success-filled': (color() == 'success'),\r\n 'warning-filled': (color() == 'warning'),\r\n 'danger-filled': (color() == 'danger'),\r\n 'navigation-filled': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'cursor-wait': isLoading()\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n\r\n @else if (type() == 'icon-outline') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-outline': (color() == 'primary'),\r\n 'secondary-outline': (color() == 'secondary'),\r\n 'success-outline': (color() == 'success'),\r\n 'warning-outline': (color() == 'warning'),\r\n 'danger-outline': (color() == 'danger'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'cursor-wait': isLoading()\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n\r\n @else if (type() == 'icon-no-border') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-outline': (color() == 'primary'),\r\n 'secondary-outline': (color() == 'secondary'),\r\n 'success-outline': (color() == 'success'),\r\n 'warning-outline': (color() == 'warning'),\r\n 'danger-outline': (color() == 'danger'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'icon-no-border': true\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n }\r\n </a>\r\n</div>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.border-blue{border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.border-gray{border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.border-green{border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.border-yellow{border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.border-red{border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.border-white{border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.border-black{border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}.border-orange{border-color:#fd6031!important}coer-button{display:contents!important}div.coer-button{display:contents!important}div.coer-button a{display:inline-block!important}div.coer-button a.animate__disabled{animation-duration:0s!important}div.coer-button button{font-size:17px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}div.coer-button .slot{width:100px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-overflow:ellipsis!important;overflow:hidden!important}div.coer-button button.primary-filled{background-color:#0d6efd!important;color:#f5f5f5!important}div.coer-button button.secondary-filled{background-color:#6c757d!important;color:#f5f5f5!important}div.coer-button button.success-filled{background-color:#198754!important;color:#f5f5f5!important}div.coer-button button.warning-filled{background-color:#ffc107!important;color:#252525!important}div.coer-button button.danger-filled{background-color:#dc3545!important;color:#f5f5f5!important}div.coer-button button.navigation-filled{background-color:#fd6031!important;color:#f5f5f5!important}div.coer-button button.primary-outline{background-color:#fff!important;border:1px solid #0d6efd!important;color:#0d6efd!important}div.coer-button button.secondary-outline{background-color:#fff!important;border:1px solid #6c757d!important;color:#6c757d!important}div.coer-button button.success-outline{background-color:#fff!important;border:1px solid #198754!important;color:#198754!important}div.coer-button button.warning-outline{background-color:#fff!important;border:1px solid #ffc107!important;color:#ffc107!important}div.coer-button button.danger-outline{background-color:#fff!important;border:1px solid #dc3545!important;color:#dc3545!important}div.coer-button button.navigation-outline{background-color:#fff!important;border:1px solid #fd6031!important;color:#fd6031!important}div.coer-button button.primary-filled:not(.readonly):hover,div.coer-button button.primary-filled:not(.readonly):focus,div.coer-button button.primary-outline:not(.readonly):hover,div.coer-button button.primary-outline:not(.readonly):focus,div.coer-button button.secondary-filled:not(.readonly):hover,div.coer-button button.secondary-filled:not(.readonly):focus,div.coer-button button.secondary-outline:not(.readonly):hover,div.coer-button button.secondary-outline:not(.readonly):focus,div.coer-button button.success-filled:not(.readonly):hover,div.coer-button button.success-filled:not(.readonly):focus,div.coer-button button.success-outline:not(.readonly):hover,div.coer-button button.success-outline:not(.readonly):focus,div.coer-button button.warning-filled:not(.readonly):hover,div.coer-button button.warning-filled:not(.readonly):focus,div.coer-button button.warning-outline:not(.readonly):hover,div.coer-button button.warning-outline:not(.readonly):focus,div.coer-button button.danger-filled:not(.readonly):hover,div.coer-button button.danger-filled:not(.readonly):focus,div.coer-button button.danger-outline:not(.readonly):hover,div.coer-button button.danger-outline:not(.readonly):focus{filter:brightness(1.1)!important}div.coer-button button.primary-filled:not(.readonly):focus,div.coer-button button.primary-outline:not(.readonly):focus{box-shadow:0 0 20px #0d6efd!important}div.coer-button button.secondary-filled:not(.readonly):focus,div.coer-button button.secondary-outline:not(.readonly):focus{box-shadow:0 0 20px #6c757d!important}div.coer-button button.success-filled:not(.readonly):focus,div.coer-button button.success-outline:not(.readonly):focus{box-shadow:0 0 20px #198754!important}div.coer-button button.warning-filled:not(.readonly):focus,div.coer-button button.warning-outline:not(.readonly):focus{box-shadow:0 0 20px #ffc107!important}div.coer-button button.danger-filled:not(.readonly):focus,div.coer-button button.danger-outline:not(.readonly):focus{box-shadow:0 0 20px #dc3545!important}div.coer-button button.navigation-filled:not(.readonly):focus,div.coer-button button.navigation-outline:not(.readonly):focus{box-shadow:0 0 20px #fd6031!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button{width:40px!important;height:40px!important;padding:0!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border{width:25px!important;height:25px!important;background-color:transparent!important;border:none!important;overflow:visible!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border *{font-size:medium!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border i.bi-box-arrow-left,div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border i.bi-box-arrow-in-right{font-size:20px!important}div.coer-button button.readonly,div.coer-button button.readonly:hover,div.coer-button button.readonly:focus{background-color:#dfdede!important;border-color:#dfdede!important;color:#fff!important}div.coer-button coer-button[ishidden=true],div.coer-button coer-button[ng-reflect-invisible=true]{position:relative!important;top:10000vh;left:10000vw}div.coer-button a.loading{cursor:wait!important}div.coer-button i{vertical-align:middle!important}div.coer-button i.spinner-border{width:15px!important;height:15px!important;font-size:16px!important}div.coer-button span{font-weight:700!important}div#coer-tool-bar coer-button *{color:#fd6031!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
|
726
|
+
}
|
727
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerButton, decorators: [{
|
728
|
+
type: Component,
|
729
|
+
args: [{ selector: 'coer-button', template: "<div [ngClass]=\"{ 'coer-button': true, 'invisible': isInvisible() }\">\r\n <a [id]=\"_id + '-container'\"\r\n [routerLink]=\"(path().length > 0 && _isEnable()) ? path() : null\"\r\n [ngClass]=\"{ 'loading': isLoading(), 'animate__animated animate__zoomIn': true, 'animate__disabled': !animation() }\"\r\n [ngStyle]=\"{ 'margin-top': marginTop(), 'margin-right': marginRight(), 'margin-bottom': marginBottom(), 'margin-left': marginLeft() }\">\r\n @if(type() =='filled' || type() == 'outline') {\r\n <button mat-button\r\n [id]=\"_id + '-inner-button'\"\r\n type=\"button\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-filled': (color() == 'primary' && type() =='filled'),\r\n 'secondary-filled': (color() == 'secondary' && type() =='filled'),\r\n 'success-filled': (color() == 'success' && type() =='filled'),\r\n 'warning-filled': (color() == 'warning' && type() =='filled'),\r\n 'danger-filled': (color() == 'danger' && type() =='filled'),\r\n 'navigation-filled': (color() == 'navigation' && type() =='filled'),\r\n 'primary-outline': (color() == 'primary' && type() =='outline'),\r\n 'secondary-outline': (color() == 'secondary' && type() =='outline'),\r\n 'success-outline': (color() == 'success' && type() =='outline'),\r\n 'warning-outline': (color() == 'warning' && type() =='outline'),\r\n 'danger-outline': (color() == 'danger' && type() =='outline'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': isDisabled(),\r\n 'cursor-wait': isLoading()\r\n }\"\r\n [ngStyle]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'height': height(),\r\n 'min-height': minHeight()\r\n }\">\r\n <span class=\"slot\" *ngIf=\"!isLoading(); else loading\" >\r\n <span *ngIf=\"(iconPosition() == 'left')\">\r\n <i [class]=\"_icon()\"></i>\r\n </span>\r\n\r\n <span [ngClass]=\"{ 'ms-2': (iconPosition() == 'left'), 'me-2': (iconPosition() == 'right') }\">\r\n <ng-content></ng-content>\r\n </span>\r\n\r\n <span *ngIf=\"(iconPosition() == 'right')\">\r\n <i [class]=\"_icon()\"></i>\r\n </span>\r\n </span>\r\n\r\n <ng-template #loading>\r\n <span class=\"slot fa-fade\">\r\n <span class=\"me-2\"> Loading </span>\r\n <i class=\"spinner-border\"></i>\r\n </span>\r\n </ng-template>\r\n </button>\r\n }\r\n\r\n @else {\r\n @if (type() == 'icon') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-filled': (color() == 'primary'),\r\n 'secondary-filled': (color() == 'secondary'),\r\n 'success-filled': (color() == 'success'),\r\n 'warning-filled': (color() == 'warning'),\r\n 'danger-filled': (color() == 'danger'),\r\n 'navigation-filled': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'cursor-wait': isLoading()\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n\r\n @else if (type() == 'icon-outline') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-outline': (color() == 'primary'),\r\n 'secondary-outline': (color() == 'secondary'),\r\n 'success-outline': (color() == 'success'),\r\n 'warning-outline': (color() == 'warning'),\r\n 'danger-outline': (color() == 'danger'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'cursor-wait': isLoading()\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n\r\n @else if (type() == 'icon-no-border') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-outline': (color() == 'primary'),\r\n 'secondary-outline': (color() == 'secondary'),\r\n 'success-outline': (color() == 'success'),\r\n 'warning-outline': (color() == 'warning'),\r\n 'danger-outline': (color() == 'danger'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'icon-no-border': true\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n }\r\n </a>\r\n</div>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.border-blue{border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.border-gray{border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.border-green{border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.border-yellow{border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.border-red{border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.border-white{border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.border-black{border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}.border-orange{border-color:#fd6031!important}coer-button{display:contents!important}div.coer-button{display:contents!important}div.coer-button a{display:inline-block!important}div.coer-button a.animate__disabled{animation-duration:0s!important}div.coer-button button{font-size:17px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}div.coer-button .slot{width:100px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-overflow:ellipsis!important;overflow:hidden!important}div.coer-button button.primary-filled{background-color:#0d6efd!important;color:#f5f5f5!important}div.coer-button button.secondary-filled{background-color:#6c757d!important;color:#f5f5f5!important}div.coer-button button.success-filled{background-color:#198754!important;color:#f5f5f5!important}div.coer-button button.warning-filled{background-color:#ffc107!important;color:#252525!important}div.coer-button button.danger-filled{background-color:#dc3545!important;color:#f5f5f5!important}div.coer-button button.navigation-filled{background-color:#fd6031!important;color:#f5f5f5!important}div.coer-button button.primary-outline{background-color:#fff!important;border:1px solid #0d6efd!important;color:#0d6efd!important}div.coer-button button.secondary-outline{background-color:#fff!important;border:1px solid #6c757d!important;color:#6c757d!important}div.coer-button button.success-outline{background-color:#fff!important;border:1px solid #198754!important;color:#198754!important}div.coer-button button.warning-outline{background-color:#fff!important;border:1px solid #ffc107!important;color:#ffc107!important}div.coer-button button.danger-outline{background-color:#fff!important;border:1px solid #dc3545!important;color:#dc3545!important}div.coer-button button.navigation-outline{background-color:#fff!important;border:1px solid #fd6031!important;color:#fd6031!important}div.coer-button button.primary-filled:not(.readonly):hover,div.coer-button button.primary-filled:not(.readonly):focus,div.coer-button button.primary-outline:not(.readonly):hover,div.coer-button button.primary-outline:not(.readonly):focus,div.coer-button button.secondary-filled:not(.readonly):hover,div.coer-button button.secondary-filled:not(.readonly):focus,div.coer-button button.secondary-outline:not(.readonly):hover,div.coer-button button.secondary-outline:not(.readonly):focus,div.coer-button button.success-filled:not(.readonly):hover,div.coer-button button.success-filled:not(.readonly):focus,div.coer-button button.success-outline:not(.readonly):hover,div.coer-button button.success-outline:not(.readonly):focus,div.coer-button button.warning-filled:not(.readonly):hover,div.coer-button button.warning-filled:not(.readonly):focus,div.coer-button button.warning-outline:not(.readonly):hover,div.coer-button button.warning-outline:not(.readonly):focus,div.coer-button button.danger-filled:not(.readonly):hover,div.coer-button button.danger-filled:not(.readonly):focus,div.coer-button button.danger-outline:not(.readonly):hover,div.coer-button button.danger-outline:not(.readonly):focus{filter:brightness(1.1)!important}div.coer-button button.primary-filled:not(.readonly):focus,div.coer-button button.primary-outline:not(.readonly):focus{box-shadow:0 0 20px #0d6efd!important}div.coer-button button.secondary-filled:not(.readonly):focus,div.coer-button button.secondary-outline:not(.readonly):focus{box-shadow:0 0 20px #6c757d!important}div.coer-button button.success-filled:not(.readonly):focus,div.coer-button button.success-outline:not(.readonly):focus{box-shadow:0 0 20px #198754!important}div.coer-button button.warning-filled:not(.readonly):focus,div.coer-button button.warning-outline:not(.readonly):focus{box-shadow:0 0 20px #ffc107!important}div.coer-button button.danger-filled:not(.readonly):focus,div.coer-button button.danger-outline:not(.readonly):focus{box-shadow:0 0 20px #dc3545!important}div.coer-button button.navigation-filled:not(.readonly):focus,div.coer-button button.navigation-outline:not(.readonly):focus{box-shadow:0 0 20px #fd6031!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button{width:40px!important;height:40px!important;padding:0!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border{width:25px!important;height:25px!important;background-color:transparent!important;border:none!important;overflow:visible!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border *{font-size:medium!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border i.bi-box-arrow-left,div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border i.bi-box-arrow-in-right{font-size:20px!important}div.coer-button button.readonly,div.coer-button button.readonly:hover,div.coer-button button.readonly:focus{background-color:#dfdede!important;border-color:#dfdede!important;color:#fff!important}div.coer-button coer-button[ishidden=true],div.coer-button coer-button[ng-reflect-invisible=true]{position:relative!important;top:10000vh;left:10000vw}div.coer-button a.loading{cursor:wait!important}div.coer-button i{vertical-align:middle!important}div.coer-button i.spinner-border{width:15px!important;height:15px!important;font-size:16px!important}div.coer-button span{font-weight:700!important}div#coer-tool-bar coer-button *{color:#fd6031!important}\n"] }]
|
730
|
+
}], propDecorators: { id: [{
|
731
|
+
type: Input
|
732
|
+
}], tooltip: [{
|
733
|
+
type: Input
|
734
|
+
}], onClick: [{
|
735
|
+
type: Output
|
736
|
+
}] } });
|
737
|
+
|
738
|
+
const CONTROL_VALUE = (component) => {
|
739
|
+
return {
|
740
|
+
provide: NG_VALUE_ACCESSOR,
|
741
|
+
useExisting: forwardRef(() => component),
|
742
|
+
multi: true
|
743
|
+
};
|
744
|
+
};
|
745
|
+
class ControlValue {
|
746
|
+
constructor() {
|
747
|
+
this._isTouched = false;
|
748
|
+
}
|
749
|
+
get isTouched() {
|
750
|
+
return this._isTouched;
|
751
|
+
}
|
752
|
+
/** */
|
753
|
+
SetValue(value) {
|
754
|
+
if (typeof this._UpdateValue === 'function') {
|
755
|
+
this._UpdateValue(value);
|
756
|
+
}
|
757
|
+
this._value = value;
|
758
|
+
}
|
759
|
+
/** */
|
760
|
+
SetTouched(isTouched) {
|
761
|
+
if (typeof this._IsTouched === 'function') {
|
762
|
+
this._IsTouched(isTouched);
|
763
|
+
}
|
764
|
+
this._isTouched = isTouched;
|
765
|
+
}
|
766
|
+
/** */
|
767
|
+
writeValue(value) {
|
768
|
+
this._value = value;
|
769
|
+
}
|
770
|
+
/** */
|
771
|
+
registerOnChange(callback) {
|
772
|
+
this._UpdateValue = callback;
|
773
|
+
}
|
774
|
+
/** */
|
775
|
+
registerOnTouched(callback) {
|
776
|
+
this._IsTouched = callback;
|
777
|
+
}
|
778
|
+
/** */
|
779
|
+
setDisabledState(isDisabled) { }
|
780
|
+
}
|
781
|
+
|
782
|
+
class CoerCheckbox extends ControlValue {
|
783
|
+
constructor() {
|
784
|
+
super(...arguments);
|
785
|
+
//Variables
|
786
|
+
this._value = false;
|
787
|
+
this._id = Tools.GetGuid('coer-checkbox');
|
788
|
+
this._isLoading = true;
|
789
|
+
this.id = input('');
|
790
|
+
this.label = input('');
|
791
|
+
this.labelPosition = input('after');
|
792
|
+
this.isDisabled = input(false);
|
793
|
+
this.isLoading = input(false);
|
794
|
+
this.isInvisible = input(false);
|
795
|
+
this.ignoreModel = input(false);
|
796
|
+
//Outputs
|
797
|
+
this.onChange = output();
|
798
|
+
//computed
|
799
|
+
this._isEnable = computed(() => {
|
800
|
+
return !this.isLoading() && !this.isDisabled() && !this.isInvisible();
|
801
|
+
});
|
802
|
+
}
|
803
|
+
//Inputs
|
804
|
+
set value(value) {
|
805
|
+
if (Tools.IsNull(value))
|
806
|
+
value = false;
|
807
|
+
this.SetValue(value);
|
808
|
+
}
|
809
|
+
//getter
|
810
|
+
get value() {
|
811
|
+
return this._value;
|
812
|
+
}
|
813
|
+
ngAfterViewInit() {
|
814
|
+
Tools.Sleep().then(_ => this._isLoading = false);
|
815
|
+
}
|
816
|
+
//ControlValueAccessor
|
817
|
+
SetValue(value) {
|
818
|
+
if (Tools.IsNotNull(value)) {
|
819
|
+
if (!this.ignoreModel()) {
|
820
|
+
this._UpdateValue(value);
|
821
|
+
}
|
822
|
+
this._value = value;
|
823
|
+
if (!this._isLoading && this._isEnable()) {
|
824
|
+
this.onChange.emit(value);
|
825
|
+
}
|
826
|
+
}
|
827
|
+
}
|
828
|
+
//ControlValueAccessor
|
829
|
+
writeValue(value) {
|
830
|
+
if (Tools.IsNotNull(value)) {
|
831
|
+
this._value = value;
|
832
|
+
if (!this._isLoading && this._isEnable()) {
|
833
|
+
this.onChange.emit(value);
|
834
|
+
}
|
835
|
+
}
|
836
|
+
}
|
837
|
+
/** */
|
838
|
+
Check() {
|
839
|
+
if (!this._isLoading && this._isEnable()) {
|
840
|
+
this.SetValue(true);
|
841
|
+
}
|
842
|
+
}
|
843
|
+
/** */
|
844
|
+
Uncheck() {
|
845
|
+
if (!this._isLoading && this._isEnable()) {
|
846
|
+
this.SetValue(false);
|
847
|
+
}
|
848
|
+
}
|
849
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
850
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: CoerCheckbox, selector: "coer-checkbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isInvisible: { classPropertyName: "isInvisible", publicName: "isInvisible", isSignal: true, isRequired: false, transformFunction: null }, ignoreModel: { classPropertyName: "ignoreModel", publicName: "ignoreModel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onChange: "onChange" }, providers: [CONTROL_VALUE(CoerCheckbox)], usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"{ 'coer-checkbox': true, 'placeholder-glow': isLoading(), 'invisible': isInvisible() }\">\r\n <div [id]=\"_id\" [ngClass]=\"{ 'placeholder': isLoading() }\">\r\n <mat-checkbox\r\n [ngModel]=\"_value\"\r\n [indeterminate]=\"false\"\r\n [labelPosition]=\"labelPosition()\"\r\n [disabled]=\"!_isEnable()\"\r\n (change)=\"this.SetValue($event.checked)\"\r\n > {{ label() }} </mat-checkbox>\r\n </div>\r\n</div>", styles: ["div.coer-checkbox .text-blue{color:#0d6efd!important}div.coer-checkbox .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-checkbox .background-blue{background-color:#0d6efd!important}div.coer-checkbox .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-checkbox .border-blue{border-color:#0d6efd!important}div.coer-checkbox .text-gray{color:#6c757d!important}div.coer-checkbox .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-checkbox .background-gray{background-color:#6c757d!important}div.coer-checkbox .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-checkbox .border-gray{border-color:#6c757d!important}div.coer-checkbox .text-green{color:#198754!important}div.coer-checkbox .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-checkbox .background-green{background-color:#198754!important}div.coer-checkbox .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-checkbox .border-green{border-color:#198754!important}div.coer-checkbox .text-yellow{color:#ffc107!important}div.coer-checkbox .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-checkbox .background-yellow{background-color:#ffc107!important}div.coer-checkbox .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-checkbox .border-yellow{border-color:#ffc107!important}div.coer-checkbox .text-red{color:#dc3545!important}div.coer-checkbox .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-checkbox .background-red{background-color:#dc3545!important}div.coer-checkbox .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-checkbox .border-red{border-color:#dc3545!important}div.coer-checkbox .text-white{color:#f5f5f5!important}div.coer-checkbox .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-checkbox .background-white{background-color:#f5f5f5!important}div.coer-checkbox .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-checkbox .border-white{border-color:#f5f5f5!important}div.coer-checkbox .text-black{color:#252525!important}div.coer-checkbox .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-checkbox .background-black{background-color:#252525!important}div.coer-checkbox .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-checkbox .border-black{border-color:#252525!important}div.coer-checkbox .text-orange{color:#fd6031!important}div.coer-checkbox .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-checkbox .background-orange{background-color:#fd6031!important}div.coer-checkbox .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-checkbox .border-orange{border-color:#fd6031!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox{padding:10px!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__background{background-color:#f5f5f5!important;border-radius:5px!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__ripple{width:30px!important;height:30px!important;top:5px!important;left:5px!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mat-ripple.mat-mdc-checkbox-ripple.mat-mdc-focus-indicator *{display:none!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field label.mdc-label{padding-top:3px!important;padding-left:0!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field label.mdc-label::selection{background-color:transparent!important}div.coer-checkbox mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__background{background-color:#fd6031!important;border-color:#fd6031!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox{padding:0!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mat-mdc-checkbox-touch-target,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mat-mdc-checkbox-touch-target{top:8px!important;width:39px!important;height:30px!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox input,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox input{display:none!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__ripple,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__ripple{top:-7px!important;left:-6px!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__background,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__background{transform:translateY(-1px)!important;position:static!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field label.mdc-label,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field label.mdc-label{display:none!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }] }); }
|
851
|
+
}
|
852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerCheckbox, decorators: [{
|
853
|
+
type: Component,
|
854
|
+
args: [{ selector: 'coer-checkbox', providers: [CONTROL_VALUE(CoerCheckbox)], template: "<div [ngClass]=\"{ 'coer-checkbox': true, 'placeholder-glow': isLoading(), 'invisible': isInvisible() }\">\r\n <div [id]=\"_id\" [ngClass]=\"{ 'placeholder': isLoading() }\">\r\n <mat-checkbox\r\n [ngModel]=\"_value\"\r\n [indeterminate]=\"false\"\r\n [labelPosition]=\"labelPosition()\"\r\n [disabled]=\"!_isEnable()\"\r\n (change)=\"this.SetValue($event.checked)\"\r\n > {{ label() }} </mat-checkbox>\r\n </div>\r\n</div>", styles: ["div.coer-checkbox .text-blue{color:#0d6efd!important}div.coer-checkbox .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-checkbox .background-blue{background-color:#0d6efd!important}div.coer-checkbox .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-checkbox .border-blue{border-color:#0d6efd!important}div.coer-checkbox .text-gray{color:#6c757d!important}div.coer-checkbox .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-checkbox .background-gray{background-color:#6c757d!important}div.coer-checkbox .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-checkbox .border-gray{border-color:#6c757d!important}div.coer-checkbox .text-green{color:#198754!important}div.coer-checkbox .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-checkbox .background-green{background-color:#198754!important}div.coer-checkbox .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-checkbox .border-green{border-color:#198754!important}div.coer-checkbox .text-yellow{color:#ffc107!important}div.coer-checkbox .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-checkbox .background-yellow{background-color:#ffc107!important}div.coer-checkbox .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-checkbox .border-yellow{border-color:#ffc107!important}div.coer-checkbox .text-red{color:#dc3545!important}div.coer-checkbox .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-checkbox .background-red{background-color:#dc3545!important}div.coer-checkbox .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-checkbox .border-red{border-color:#dc3545!important}div.coer-checkbox .text-white{color:#f5f5f5!important}div.coer-checkbox .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-checkbox .background-white{background-color:#f5f5f5!important}div.coer-checkbox .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-checkbox .border-white{border-color:#f5f5f5!important}div.coer-checkbox .text-black{color:#252525!important}div.coer-checkbox .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-checkbox .background-black{background-color:#252525!important}div.coer-checkbox .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-checkbox .border-black{border-color:#252525!important}div.coer-checkbox .text-orange{color:#fd6031!important}div.coer-checkbox .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-checkbox .background-orange{background-color:#fd6031!important}div.coer-checkbox .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-checkbox .border-orange{border-color:#fd6031!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox{padding:10px!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__background{background-color:#f5f5f5!important;border-radius:5px!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__ripple{width:30px!important;height:30px!important;top:5px!important;left:5px!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mat-ripple.mat-mdc-checkbox-ripple.mat-mdc-focus-indicator *{display:none!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field label.mdc-label{padding-top:3px!important;padding-left:0!important}div.coer-checkbox mat-checkbox div.mdc-form-field.mat-internal-form-field label.mdc-label::selection{background-color:transparent!important}div.coer-checkbox mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__background{background-color:#fd6031!important;border-color:#fd6031!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox{padding:0!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mat-mdc-checkbox-touch-target,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mat-mdc-checkbox-touch-target{top:8px!important;width:39px!important;height:30px!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox input,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox input{display:none!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__ripple,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__ripple{top:-7px!important;left:-6px!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__background,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field div.mdc-checkbox div.mdc-checkbox__background{transform:translateY(-1px)!important;position:static!important}coer-grid table tbody tr td.check-box mat-checkbox div.mdc-form-field.mat-internal-form-field label.mdc-label,coer-grid table tbody tr td.check-box mat-checkbox.mat-mdc-checkbox-checked div.mdc-form-field.mat-internal-form-field label.mdc-label{display:none!important}\n"] }]
|
855
|
+
}], propDecorators: { value: [{
|
856
|
+
type: Input
|
857
|
+
}] } });
|
858
|
+
|
859
|
+
class Files {
|
860
|
+
static { this.EXCEL_EXTENSIONS = ['xls', 'xlsx', 'csv']; }
|
861
|
+
/** Get Extension File */
|
862
|
+
static GetExtension(file) {
|
863
|
+
const fileName = file.name;
|
864
|
+
if (fileName.includes('.')) {
|
865
|
+
let worlds = fileName.split('.');
|
866
|
+
if (worlds.length > 0) {
|
867
|
+
let extension = worlds.pop();
|
868
|
+
extension = extension.trim().toLowerCase();
|
869
|
+
if (extension.length > 0)
|
870
|
+
return extension;
|
871
|
+
}
|
872
|
+
}
|
873
|
+
return null;
|
874
|
+
}
|
875
|
+
/** Is Excel File */
|
876
|
+
static IsExcel(file) {
|
877
|
+
const EXTENSION = Files.GetExtension(file);
|
878
|
+
return Tools.IsNotNull(EXTENSION)
|
879
|
+
? this.EXCEL_EXTENSIONS.includes(EXTENSION)
|
880
|
+
: false;
|
881
|
+
}
|
882
|
+
/** Read excel file */
|
883
|
+
static ReadExcel(file) {
|
884
|
+
return new Promise(Resolve => {
|
885
|
+
let columns = [];
|
886
|
+
let rows = [];
|
887
|
+
const reader = new FileReader();
|
888
|
+
reader.readAsArrayBuffer(file);
|
889
|
+
reader.onload = () => {
|
890
|
+
const dataBytes = new Uint8Array(reader.result);
|
891
|
+
if (dataBytes) {
|
892
|
+
const workbook = XLSX.read(dataBytes, {});
|
893
|
+
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
894
|
+
let dataSheet = XLSX.utils.sheet_to_json(sheet, {
|
895
|
+
header: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
|
896
|
+
});
|
897
|
+
//Get Headers
|
898
|
+
for (const column in dataSheet[0]) {
|
899
|
+
columns.push(Tools.FirstCharToLower(String(dataSheet[0][column]).replaceAll(' ', '')));
|
900
|
+
}
|
901
|
+
//Get Rows
|
902
|
+
rows = XLSX.utils.sheet_to_json(sheet, { header: columns });
|
903
|
+
rows.shift();
|
904
|
+
rows = rows.map(row => {
|
905
|
+
const item = Tools.BreakReference(row);
|
906
|
+
delete item['__rowNum__'];
|
907
|
+
return item;
|
908
|
+
});
|
909
|
+
}
|
910
|
+
Resolve({ columns, rows });
|
911
|
+
};
|
912
|
+
reader.onerror = () => { Resolve({ columns, rows }); };
|
913
|
+
});
|
914
|
+
}
|
915
|
+
/** Export to excel file */
|
916
|
+
static ExportExcel(data, fileName = 'coer_report', sheetName = 'Sheet1') {
|
917
|
+
sheetName = Tools.CleanUpBlanks(sheetName);
|
918
|
+
fileName = Tools.CleanUpBlanks(fileName);
|
919
|
+
if (fileName.endsWith('.xls') || fileName.endsWith('.xlsx') || fileName.endsWith('.csv')) {
|
920
|
+
if (fileName.includes('.xls')) {
|
921
|
+
fileName = fileName.replaceAll('.xls', '.xlsx');
|
922
|
+
}
|
923
|
+
if (fileName.includes('.csv')) {
|
924
|
+
fileName = fileName.replaceAll('.csv', '.xlsx');
|
925
|
+
}
|
926
|
+
}
|
927
|
+
else {
|
928
|
+
fileName += '.xlsx';
|
929
|
+
}
|
930
|
+
const WORK_SHEET = XLSX.utils.json_to_sheet(data);
|
931
|
+
const WORK_BOOK = XLSX.utils.book_new();
|
932
|
+
XLSX.utils.book_append_sheet(WORK_BOOK, WORK_SHEET, sheetName);
|
933
|
+
XLSX.writeFile(WORK_BOOK, fileName);
|
934
|
+
}
|
935
|
+
/** Convert file to string base64 */
|
936
|
+
static ConvertToBase64(file) {
|
937
|
+
return new Promise(Resolve => {
|
938
|
+
const reader = new FileReader();
|
939
|
+
reader.readAsDataURL(file);
|
940
|
+
reader.onload = () => {
|
941
|
+
Resolve(reader.result?.toString() || '');
|
942
|
+
};
|
943
|
+
reader.onerror = () => Resolve('');
|
944
|
+
});
|
945
|
+
}
|
946
|
+
}
|
947
|
+
|
948
|
+
const isModalOpenSIGNAL = signal(false);
|
949
|
+
|
950
|
+
class Screen {
|
951
|
+
static get WINDOW_WIDTH() {
|
952
|
+
return window.innerWidth;
|
953
|
+
}
|
954
|
+
static get WINDOW_HEIGHT() {
|
955
|
+
return window.innerHeight;
|
956
|
+
}
|
957
|
+
static get DEVICE_WIDTH() {
|
958
|
+
return window.screen.width;
|
959
|
+
}
|
960
|
+
static get DEVICE_HEIGHT() {
|
961
|
+
return window.screen.height;
|
962
|
+
}
|
963
|
+
static get BREAKPOINT() {
|
964
|
+
if (window.innerWidth < 576)
|
965
|
+
return 'xs';
|
966
|
+
else if (window.innerWidth >= 576 && window.innerWidth < 768)
|
967
|
+
return 'sm';
|
968
|
+
else if (window.innerWidth >= 768 && window.innerWidth < 992)
|
969
|
+
return 'md';
|
970
|
+
else if (window.innerWidth >= 992 && window.innerWidth < 1200)
|
971
|
+
return 'lg';
|
972
|
+
else if (window.innerWidth >= 1200 && window.innerWidth < 1400)
|
973
|
+
return 'xl';
|
974
|
+
else
|
975
|
+
return 'xxl';
|
976
|
+
}
|
977
|
+
/** */
|
978
|
+
static { this.Resize = new Observable(subscriber => {
|
979
|
+
window.addEventListener("load", () => {
|
980
|
+
window.dispatchEvent(new Event('resize'));
|
981
|
+
});
|
982
|
+
window.onresize = () => {
|
983
|
+
subscriber.next({
|
984
|
+
width: this.WINDOW_WIDTH,
|
985
|
+
height: this.WINDOW_HEIGHT,
|
986
|
+
breakpoin: this.BREAKPOINT
|
987
|
+
});
|
988
|
+
};
|
989
|
+
}); }
|
990
|
+
/** */
|
991
|
+
static { this.BackButtonBrowser = new Observable(subscriber => {
|
992
|
+
window.addEventListener('popstate', popStateEvent => {
|
993
|
+
if (popStateEvent.state && popStateEvent.target) {
|
994
|
+
subscriber.next(popStateEvent.target.location.href);
|
995
|
+
}
|
996
|
+
});
|
997
|
+
}); }
|
998
|
+
}
|
999
|
+
|
1000
|
+
class CoerModal {
|
1001
|
+
constructor() {
|
1002
|
+
//Variables
|
1003
|
+
this._id = Tools.GetGuid('coer-modal');
|
1004
|
+
this._isOpen = false;
|
1005
|
+
this._isModalOpen = isModalOpenSIGNAL;
|
1006
|
+
this.windowWidth = Screen.WINDOW_WIDTH;
|
1007
|
+
//Inputs
|
1008
|
+
this.id = '';
|
1009
|
+
this.title = input('');
|
1010
|
+
this.icon = input('');
|
1011
|
+
this.showCloseButton = input(true);
|
1012
|
+
this.width = input('small');
|
1013
|
+
this.height = input('auto');
|
1014
|
+
this.maxHeight = input('');
|
1015
|
+
//Computed
|
1016
|
+
this.contentList = computed(() => Array.from(this.contentRef._results));
|
1017
|
+
//Computed
|
1018
|
+
this.header = computed(() => {
|
1019
|
+
const header = this.contentList().find(x => x.coerRef() === 'header');
|
1020
|
+
return Tools.IsNotNull(header) ? header : null;
|
1021
|
+
});
|
1022
|
+
//Computed
|
1023
|
+
this.body = computed(() => {
|
1024
|
+
const body = this.contentList().find(x => x.coerRef() === '' || x.coerRef() === 'body');
|
1025
|
+
return Tools.IsNotNull(body) ? body : null;
|
1026
|
+
});
|
1027
|
+
//Computed
|
1028
|
+
this.footer = computed(() => {
|
1029
|
+
const footer = this.contentList().find(x => x.coerRef() === 'footer');
|
1030
|
+
return Tools.IsNotNull(footer) ? footer : null;
|
1031
|
+
});
|
1032
|
+
//Computed
|
1033
|
+
this._title = computed(() => {
|
1034
|
+
return Tools.IsNotNull(this.header()) && this.header().title().length > 0
|
1035
|
+
? this.header().title() : this.title();
|
1036
|
+
});
|
1037
|
+
//Computed
|
1038
|
+
this._icon = computed(() => {
|
1039
|
+
return Tools.IsNotNull(this.header()) && this.header().icon().length > 0
|
1040
|
+
? this.header().icon() : this.icon();
|
1041
|
+
});
|
1042
|
+
//Outputs
|
1043
|
+
this.onOpen = output();
|
1044
|
+
this.onClose = output();
|
1045
|
+
//Generic Tools
|
1046
|
+
this.IsNull = Tools.IsNull;
|
1047
|
+
this.IsNotNull = Tools.IsNotNull;
|
1048
|
+
}
|
1049
|
+
//getter
|
1050
|
+
get isOpen() {
|
1051
|
+
return this._isOpen;
|
1052
|
+
}
|
1053
|
+
//getter
|
1054
|
+
get _width() {
|
1055
|
+
switch (this.width()) {
|
1056
|
+
case 'small': return '450px';
|
1057
|
+
case 'full': return `${this.windowWidth - 50}px`;
|
1058
|
+
default: return 'auto';
|
1059
|
+
}
|
1060
|
+
}
|
1061
|
+
ngOnInit() {
|
1062
|
+
Screen.Resize.subscribe((response) => {
|
1063
|
+
this.windowWidth = response.width;
|
1064
|
+
});
|
1065
|
+
Tools.Sleep().then(() => {
|
1066
|
+
this._modal = new Modal(document.getElementById(this._id));
|
1067
|
+
});
|
1068
|
+
}
|
1069
|
+
/** */
|
1070
|
+
Open() {
|
1071
|
+
this._modal.show();
|
1072
|
+
if (!this._isOpen) {
|
1073
|
+
this._isOpen = true;
|
1074
|
+
this._isModalOpen.set(true);
|
1075
|
+
Tools.Sleep(1000).then(() => this.onOpen.emit());
|
1076
|
+
}
|
1077
|
+
}
|
1078
|
+
/** */
|
1079
|
+
Close() {
|
1080
|
+
this._modal.hide();
|
1081
|
+
if (this._isOpen) {
|
1082
|
+
this._isOpen = false;
|
1083
|
+
this._isModalOpen.set(false);
|
1084
|
+
Tools.Sleep(1000).then(() => this.onClose.emit());
|
1085
|
+
}
|
1086
|
+
}
|
1087
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerModal, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1088
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerModal, selector: "coer-modal", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onOpen: "onOpen", onClose: "onClose" }, queries: [{ propertyName: "contentRef", predicate: CoerRefDirective }], ngImport: i0, template: "<aside title='' [id]=\"_id\" class=\"modal fade\" data-bs-backdrop=\"static\" tabindex=\"-1\">\r\n <div class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable\" [ngStyle]=\"{ 'max-width': _width }\">\r\n <div class=\"modal-content\">\r\n @if(IsNull(header()) || (IsNotNull(header()) && header()?.show())) {\r\n <header class=\"modal-header\">\r\n <h6 class=\"modal-title\">\r\n <i [class]=\"_icon()\"></i>\r\n <span [ngClass]=\"{ 'ms-1': _icon().length > 0 }\"> {{ _title() }} </span>\r\n </h6>\r\n\r\n @if(showCloseButton()) {\r\n <button type=\"button\" class=\"btn-close\" (click)=\"Close()\"></button>\r\n }\r\n </header>\r\n }\r\n\r\n <section class=\"modal-body\" [ngStyle]=\"{\r\n 'height': height(),\r\n 'max-height': maxHeight(),\r\n 'overflow': maxHeight() === '' ? 'visible' : 'auto'\r\n }\">\r\n @if(IsNotNull(body()) && body()?.show()) {\r\n <ng-container [ngTemplateOutlet]=\"body()!.template\"></ng-container>\r\n }\r\n\r\n @else {\r\n <ng-content></ng-content>\r\n }\r\n </section>\r\n\r\n @if(IsNotNull(footer())) {\r\n <footer class=\"modal-footer\">\r\n @if(footer()?.show()) {\r\n <ng-container [ngTemplateOutlet]=\"footer()!.template\"></ng-container>\r\n }\r\n </footer>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div [ngClass]=\"{ 'backdrop': _isModalOpen() }\"></div>\r\n</aside>", styles: [".modal-dialog{margin:auto!important;height:100vh}.modal-header{padding:8px 16px!important}.modal-title{font-weight:700!important;font-size:17px!important}.modal-body{padding-top:16px!important;padding-bottom:0!important;min-width:60px!important}div.coer-filebox .modal-body{padding:0!important}.modal-footer{border:none!important;display:flex!important;align-items:flex-end!important;justify-content:flex-end!important;max-height:64px!important;min-height:64px!important;gap:10px!important}.btn-close:focus{box-shadow:none!important}div.modal-backdrop{z-index:0!important}aside.modal div.backdrop{width:100vw;height:100vh;position:fixed;top:0;left:0;background-color:#0000005b;z-index:1500}div.modal-content{z-index:1501;overflow:visible!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
1089
|
+
}
|
1090
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerModal, decorators: [{
|
1091
|
+
type: Component,
|
1092
|
+
args: [{ selector: 'coer-modal', template: "<aside title='' [id]=\"_id\" class=\"modal fade\" data-bs-backdrop=\"static\" tabindex=\"-1\">\r\n <div class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable\" [ngStyle]=\"{ 'max-width': _width }\">\r\n <div class=\"modal-content\">\r\n @if(IsNull(header()) || (IsNotNull(header()) && header()?.show())) {\r\n <header class=\"modal-header\">\r\n <h6 class=\"modal-title\">\r\n <i [class]=\"_icon()\"></i>\r\n <span [ngClass]=\"{ 'ms-1': _icon().length > 0 }\"> {{ _title() }} </span>\r\n </h6>\r\n\r\n @if(showCloseButton()) {\r\n <button type=\"button\" class=\"btn-close\" (click)=\"Close()\"></button>\r\n }\r\n </header>\r\n }\r\n\r\n <section class=\"modal-body\" [ngStyle]=\"{\r\n 'height': height(),\r\n 'max-height': maxHeight(),\r\n 'overflow': maxHeight() === '' ? 'visible' : 'auto'\r\n }\">\r\n @if(IsNotNull(body()) && body()?.show()) {\r\n <ng-container [ngTemplateOutlet]=\"body()!.template\"></ng-container>\r\n }\r\n\r\n @else {\r\n <ng-content></ng-content>\r\n }\r\n </section>\r\n\r\n @if(IsNotNull(footer())) {\r\n <footer class=\"modal-footer\">\r\n @if(footer()?.show()) {\r\n <ng-container [ngTemplateOutlet]=\"footer()!.template\"></ng-container>\r\n }\r\n </footer>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div [ngClass]=\"{ 'backdrop': _isModalOpen() }\"></div>\r\n</aside>", styles: [".modal-dialog{margin:auto!important;height:100vh}.modal-header{padding:8px 16px!important}.modal-title{font-weight:700!important;font-size:17px!important}.modal-body{padding-top:16px!important;padding-bottom:0!important;min-width:60px!important}div.coer-filebox .modal-body{padding:0!important}.modal-footer{border:none!important;display:flex!important;align-items:flex-end!important;justify-content:flex-end!important;max-height:64px!important;min-height:64px!important;gap:10px!important}.btn-close:focus{box-shadow:none!important}div.modal-backdrop{z-index:0!important}aside.modal div.backdrop{width:100vw;height:100vh;position:fixed;top:0;left:0;background-color:#0000005b;z-index:1500}div.modal-content{z-index:1501;overflow:visible!important}\n"] }]
|
1093
|
+
}], propDecorators: { contentRef: [{
|
1094
|
+
type: ContentChildren,
|
1095
|
+
args: [CoerRefDirective]
|
1096
|
+
}], id: [{
|
1097
|
+
type: Input
|
1098
|
+
}] } });
|
1099
|
+
|
1100
|
+
class CoerFilebox {
|
1101
|
+
constructor() {
|
1102
|
+
//Injections
|
1103
|
+
this.alert = inject(CoerAlert);
|
1104
|
+
this.IsNull = Tools.IsNull;
|
1105
|
+
this.IsNotNull = Tools.IsNotNull;
|
1106
|
+
//Elements
|
1107
|
+
this.inputFileImage = viewChild.required('inputFileImage');
|
1108
|
+
this.modal = viewChild.required('modal');
|
1109
|
+
//Variables
|
1110
|
+
this.base64 = '';
|
1111
|
+
this._image = null;
|
1112
|
+
this.imageExtensions = ['png', 'jpeg', 'jpg', 'gif', 'svg'];
|
1113
|
+
//Inputs
|
1114
|
+
this.type = input('image');
|
1115
|
+
this.multiple = input(false);
|
1116
|
+
this.isLoading = input(false);
|
1117
|
+
this.isDisabled = input(false);
|
1118
|
+
//Outputs
|
1119
|
+
this.onSelected = output();
|
1120
|
+
this.onDeleteImage = output();
|
1121
|
+
//computed
|
1122
|
+
this._isEnable = computed(() => {
|
1123
|
+
return !this.isLoading() && !this.isDisabled();
|
1124
|
+
});
|
1125
|
+
/** */
|
1126
|
+
this.GetExtensionFile = (fileName) => {
|
1127
|
+
if (fileName.includes('.')) {
|
1128
|
+
let worlds = fileName.split('.');
|
1129
|
+
if (worlds.length > 0) {
|
1130
|
+
let extension = worlds.pop();
|
1131
|
+
extension = extension.trim();
|
1132
|
+
extension = extension.toLowerCase();
|
1133
|
+
if (extension.length > 0)
|
1134
|
+
return extension;
|
1135
|
+
}
|
1136
|
+
}
|
1137
|
+
this.alert.Warning('The file extension could not be recognized', 'Files');
|
1138
|
+
return null;
|
1139
|
+
};
|
1140
|
+
}
|
1141
|
+
set image(value) {
|
1142
|
+
this._image = Tools.IsNotNull(value) ? value : null;
|
1143
|
+
if (Tools.IsNotNull(value)) {
|
1144
|
+
if (value?.value?.name) {
|
1145
|
+
Files.ConvertToBase64(value?.value).then(base64 => {
|
1146
|
+
return this.base64 = base64;
|
1147
|
+
});
|
1148
|
+
}
|
1149
|
+
else
|
1150
|
+
this.base64 = value?.value;
|
1151
|
+
}
|
1152
|
+
}
|
1153
|
+
/** */
|
1154
|
+
async UploadImages(event) {
|
1155
|
+
const selectedFiles = Array.from(event.target.files);
|
1156
|
+
const files = [];
|
1157
|
+
let extension = null;
|
1158
|
+
for (const file of selectedFiles) {
|
1159
|
+
extension = this.GetExtensionFile(file.name) || '';
|
1160
|
+
if (this.imageExtensions.includes(extension)) {
|
1161
|
+
files.push({
|
1162
|
+
file: file,
|
1163
|
+
extension: extension,
|
1164
|
+
base64: await Files.ConvertToBase64(file)
|
1165
|
+
});
|
1166
|
+
}
|
1167
|
+
else
|
1168
|
+
this.alert.Warning(`<b>.${extension}</b> extension not allowed`, 'Files');
|
1169
|
+
}
|
1170
|
+
//Response
|
1171
|
+
this.inputFileImage().nativeElement.value = null;
|
1172
|
+
this.onSelected.emit([...files]);
|
1173
|
+
}
|
1174
|
+
/** */
|
1175
|
+
DeleteImage(event) {
|
1176
|
+
event.stopPropagation();
|
1177
|
+
if (this._isEnable()) {
|
1178
|
+
this.onDeleteImage.emit();
|
1179
|
+
}
|
1180
|
+
}
|
1181
|
+
/** */
|
1182
|
+
ExpandImage(event) {
|
1183
|
+
event.stopPropagation();
|
1184
|
+
this.modal().Open();
|
1185
|
+
}
|
1186
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerFilebox, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1187
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerFilebox, selector: "coer-filebox", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onSelected: "onSelected", onDeleteImage: "onDeleteImage" }, viewQueries: [{ propertyName: "inputFileImage", first: true, predicate: ["inputFileImage"], descendants: true, isSignal: true }, { propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"coer-filebox\">\r\n @if(type() == 'image') {\r\n <figure (click)=\"_isEnable() ? inputFileImage.click() : null\"\r\n [ngClass]=\"{ 'dashed': IsNull(_image?.value) }\"\r\n [ngStyle]=\"{\r\n 'margin-top': _image?.marginTop || '',\r\n 'margin-right': _image?.marginRight || '',\r\n 'margin-bottom': _image?.marginBottom || '',\r\n 'margin-left': _image?.marginLeft || ''\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"loading\">\r\n <i class=\"spinner-border\"></i>\r\n </div>\r\n\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <img [src]=\"base64 | noImage\"\r\n [ngStyle]=\"{\r\n 'width': _image?.width || '',\r\n 'max-width': _image?.maxWidth || '',\r\n 'height': _image?.height || '',\r\n 'max-height': _image?.maxHeight || '210px'\r\n }\">\r\n\r\n <input #inputFileImage\r\n type=\"file\"\r\n accept=\"image/png, image/jpeg, image/gif, image/svg+xml\"\r\n (change)=\"UploadImages($event)\"\r\n [multiple]=\"multiple()\">\r\n\r\n @if(_isEnable() && IsNotNull(_image) && IsNotNull(_image!.value)) {\r\n <div class=\"icon-container\">\r\n @if(IsNull(_image?.allowDelete) || _image!.allowDelete) {\r\n <i class=\"fa-solid fa-trash-can\" (click)=\"DeleteImage($event)\"></i>\r\n }\r\n\r\n @if(IsNull(_image?.allowExpand) || _image!.allowExpand) {\r\n <i class=\"fa-solid fa-expand\" (click)=\"ExpandImage($event)\"></i>\r\n }\r\n </div>\r\n }\r\n </figure>\r\n }\r\n\r\n <!-- Modal -->\r\n <coer-modal #modal [title]=\"_image?.name || ''\" height=\"90vh\" width=\"full\">\r\n <div class=\"modal-image\" [ngStyle]=\"{ 'background-image': 'url(' + base64 + ')' }\"></div>\r\n </coer-modal>\r\n</div>", styles: ["div.coer-filebox .text-blue{color:#0d6efd!important}div.coer-filebox .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-filebox .background-blue{background-color:#0d6efd!important}div.coer-filebox .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-filebox .border-blue{border-color:#0d6efd!important}div.coer-filebox .text-gray{color:#6c757d!important}div.coer-filebox .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-filebox .background-gray{background-color:#6c757d!important}div.coer-filebox .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-filebox .border-gray{border-color:#6c757d!important}div.coer-filebox .text-green{color:#198754!important}div.coer-filebox .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-filebox .background-green{background-color:#198754!important}div.coer-filebox .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-filebox .border-green{border-color:#198754!important}div.coer-filebox .text-yellow{color:#ffc107!important}div.coer-filebox .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-filebox .background-yellow{background-color:#ffc107!important}div.coer-filebox .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-filebox .border-yellow{border-color:#ffc107!important}div.coer-filebox .text-red{color:#dc3545!important}div.coer-filebox .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-filebox .background-red{background-color:#dc3545!important}div.coer-filebox .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-filebox .border-red{border-color:#dc3545!important}div.coer-filebox .text-white{color:#f5f5f5!important}div.coer-filebox .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-filebox .background-white{background-color:#f5f5f5!important}div.coer-filebox .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-filebox .border-white{border-color:#f5f5f5!important}div.coer-filebox .text-black{color:#252525!important}div.coer-filebox .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-filebox .background-black{background-color:#252525!important}div.coer-filebox .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-filebox .border-black{border-color:#252525!important}div.coer-filebox .text-orange{color:#fd6031!important}div.coer-filebox .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-filebox .background-orange{background-color:#fd6031!important}div.coer-filebox .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-filebox .border-orange{border-color:#fd6031!important}div.coer-filebox figure{position:relative;display:flex;align-items:center;justify-content:center;border-radius:3px;overflow:hidden;cursor:pointer;min-height:210px;z-index:1}div.coer-filebox .dashed{border:1px dashed #6c757d;background-color:transparent}div.coer-filebox div.loading{position:absolute;display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:25px;background-color:#bbbbbb83!important;flex-direction:column!important;gap:10px!important;cursor:default!important}div.coer-filebox div.loading span.fa-fade{position:relative!important;top:50px!important}div.coer-filebox div.loading i.spinner-border{color:#fd6031!important;width:70px!important;height:70px!important;font-size:20px!important;position:absolute!important}div.coer-filebox span.placeholder{width:calc(100% + 32px)!important;height:100%!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-filebox div.icon-container{position:absolute;bottom:5px;right:5px;z-index:2;display:flex;align-items:center;justify-content:flex-end;gap:7px}div.coer-filebox div.icon-container i{color:#6c757d;font-size:20px}div.coer-filebox div.icon-container i:hover{zoom:1.1}div.coer-filebox div.modal-image{width:100%;height:100%;border-bottom-left-radius:5px;border-bottom-right-radius:5px;background-size:contain;background-repeat:no-repeat;background-position:center}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: CoerModal, selector: "coer-modal", inputs: ["id", "title", "icon", "showCloseButton", "width", "height", "maxHeight"], outputs: ["onOpen", "onClose"] }, { kind: "pipe", type: NoImagePipe, name: "noImage" }] }); }
|
1188
|
+
}
|
1189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerFilebox, decorators: [{
|
1190
|
+
type: Component,
|
1191
|
+
args: [{ selector: 'coer-filebox', template: "<div class=\"coer-filebox\">\r\n @if(type() == 'image') {\r\n <figure (click)=\"_isEnable() ? inputFileImage.click() : null\"\r\n [ngClass]=\"{ 'dashed': IsNull(_image?.value) }\"\r\n [ngStyle]=\"{\r\n 'margin-top': _image?.marginTop || '',\r\n 'margin-right': _image?.marginRight || '',\r\n 'margin-bottom': _image?.marginBottom || '',\r\n 'margin-left': _image?.marginLeft || ''\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"loading\">\r\n <i class=\"spinner-border\"></i>\r\n </div>\r\n\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <img [src]=\"base64 | noImage\"\r\n [ngStyle]=\"{\r\n 'width': _image?.width || '',\r\n 'max-width': _image?.maxWidth || '',\r\n 'height': _image?.height || '',\r\n 'max-height': _image?.maxHeight || '210px'\r\n }\">\r\n\r\n <input #inputFileImage\r\n type=\"file\"\r\n accept=\"image/png, image/jpeg, image/gif, image/svg+xml\"\r\n (change)=\"UploadImages($event)\"\r\n [multiple]=\"multiple()\">\r\n\r\n @if(_isEnable() && IsNotNull(_image) && IsNotNull(_image!.value)) {\r\n <div class=\"icon-container\">\r\n @if(IsNull(_image?.allowDelete) || _image!.allowDelete) {\r\n <i class=\"fa-solid fa-trash-can\" (click)=\"DeleteImage($event)\"></i>\r\n }\r\n\r\n @if(IsNull(_image?.allowExpand) || _image!.allowExpand) {\r\n <i class=\"fa-solid fa-expand\" (click)=\"ExpandImage($event)\"></i>\r\n }\r\n </div>\r\n }\r\n </figure>\r\n }\r\n\r\n <!-- Modal -->\r\n <coer-modal #modal [title]=\"_image?.name || ''\" height=\"90vh\" width=\"full\">\r\n <div class=\"modal-image\" [ngStyle]=\"{ 'background-image': 'url(' + base64 + ')' }\"></div>\r\n </coer-modal>\r\n</div>", styles: ["div.coer-filebox .text-blue{color:#0d6efd!important}div.coer-filebox .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-filebox .background-blue{background-color:#0d6efd!important}div.coer-filebox .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-filebox .border-blue{border-color:#0d6efd!important}div.coer-filebox .text-gray{color:#6c757d!important}div.coer-filebox .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-filebox .background-gray{background-color:#6c757d!important}div.coer-filebox .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-filebox .border-gray{border-color:#6c757d!important}div.coer-filebox .text-green{color:#198754!important}div.coer-filebox .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-filebox .background-green{background-color:#198754!important}div.coer-filebox .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-filebox .border-green{border-color:#198754!important}div.coer-filebox .text-yellow{color:#ffc107!important}div.coer-filebox .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-filebox .background-yellow{background-color:#ffc107!important}div.coer-filebox .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-filebox .border-yellow{border-color:#ffc107!important}div.coer-filebox .text-red{color:#dc3545!important}div.coer-filebox .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-filebox .background-red{background-color:#dc3545!important}div.coer-filebox .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-filebox .border-red{border-color:#dc3545!important}div.coer-filebox .text-white{color:#f5f5f5!important}div.coer-filebox .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-filebox .background-white{background-color:#f5f5f5!important}div.coer-filebox .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-filebox .border-white{border-color:#f5f5f5!important}div.coer-filebox .text-black{color:#252525!important}div.coer-filebox .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-filebox .background-black{background-color:#252525!important}div.coer-filebox .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-filebox .border-black{border-color:#252525!important}div.coer-filebox .text-orange{color:#fd6031!important}div.coer-filebox .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-filebox .background-orange{background-color:#fd6031!important}div.coer-filebox .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-filebox .border-orange{border-color:#fd6031!important}div.coer-filebox figure{position:relative;display:flex;align-items:center;justify-content:center;border-radius:3px;overflow:hidden;cursor:pointer;min-height:210px;z-index:1}div.coer-filebox .dashed{border:1px dashed #6c757d;background-color:transparent}div.coer-filebox div.loading{position:absolute;display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:25px;background-color:#bbbbbb83!important;flex-direction:column!important;gap:10px!important;cursor:default!important}div.coer-filebox div.loading span.fa-fade{position:relative!important;top:50px!important}div.coer-filebox div.loading i.spinner-border{color:#fd6031!important;width:70px!important;height:70px!important;font-size:20px!important;position:absolute!important}div.coer-filebox span.placeholder{width:calc(100% + 32px)!important;height:100%!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-filebox div.icon-container{position:absolute;bottom:5px;right:5px;z-index:2;display:flex;align-items:center;justify-content:flex-end;gap:7px}div.coer-filebox div.icon-container i{color:#6c757d;font-size:20px}div.coer-filebox div.icon-container i:hover{zoom:1.1}div.coer-filebox div.modal-image{width:100%;height:100%;border-bottom-left-radius:5px;border-bottom-right-radius:5px;background-size:contain;background-repeat:no-repeat;background-position:center}\n"] }]
|
1192
|
+
}], propDecorators: { image: [{
|
1193
|
+
type: Input
|
1194
|
+
}] } });
|
1195
|
+
|
1196
|
+
class CoerForm {
|
1197
|
+
constructor() {
|
1198
|
+
//Injection
|
1199
|
+
this.alert = inject(CoerAlert);
|
1200
|
+
this.formGroup = input.required();
|
1201
|
+
this.isLoading = input(false);
|
1202
|
+
this.isDisabled = input(false);
|
1203
|
+
/** */
|
1204
|
+
this.IsInvalidControl = (formControlName) => {
|
1205
|
+
return Tools.IsNotNull(this.formGroup().get(formControlName))
|
1206
|
+
? (this.formGroup().get(formControlName).touched && this.formGroup().get(formControlName).invalid)
|
1207
|
+
: true;
|
1208
|
+
};
|
1209
|
+
}
|
1210
|
+
get _isDisabled() {
|
1211
|
+
return this.isLoading() || this.isDisabled();
|
1212
|
+
}
|
1213
|
+
/** */
|
1214
|
+
TouchForm() {
|
1215
|
+
this.formGroup().markAllAsTouched();
|
1216
|
+
}
|
1217
|
+
/** */
|
1218
|
+
SetControlValue(formControlName, value) {
|
1219
|
+
if (Tools.IsNotNull(this.formGroup().get(formControlName))) {
|
1220
|
+
this.formGroup().get(formControlName).setValue(value);
|
1221
|
+
}
|
1222
|
+
else {
|
1223
|
+
this.alert.Warning(`${formControlName} Control`, 'Not Found');
|
1224
|
+
}
|
1225
|
+
}
|
1226
|
+
/** */
|
1227
|
+
GetControlValue(formControlName) {
|
1228
|
+
return Tools.IsNotNull(this.formGroup().get(formControlName))
|
1229
|
+
? this.formGroup().get(formControlName).value
|
1230
|
+
: null;
|
1231
|
+
}
|
1232
|
+
/** Get form value */
|
1233
|
+
GetValue() {
|
1234
|
+
return Tools.BreakReference(this.formGroup().value);
|
1235
|
+
}
|
1236
|
+
/** */
|
1237
|
+
Reset(properties = null) {
|
1238
|
+
if (Tools.IsNull(properties))
|
1239
|
+
this.formGroup().reset();
|
1240
|
+
else
|
1241
|
+
this.formGroup().reset(properties);
|
1242
|
+
}
|
1243
|
+
/**
|
1244
|
+
* Mark all controls as touched.
|
1245
|
+
* If form is invalid emit a warning and focus first invalid control.
|
1246
|
+
*/
|
1247
|
+
IsValid() {
|
1248
|
+
this.TouchForm();
|
1249
|
+
if (this.formGroup().invalid) {
|
1250
|
+
this.alert.Warning('Please complete the required fields', 'Instructions', 'fa-solid fa-list-check');
|
1251
|
+
this.Focus();
|
1252
|
+
}
|
1253
|
+
return {
|
1254
|
+
isValid: this.formGroup().valid,
|
1255
|
+
formValue: this.GetValue()
|
1256
|
+
};
|
1257
|
+
}
|
1258
|
+
/** Focus the especified control or first invalid control */
|
1259
|
+
Focus(formControl = null) {
|
1260
|
+
const formControlCollection = new Map();
|
1261
|
+
const formControlErrorCollection = new Map();
|
1262
|
+
for (const property of Tools.GetObjectProperties(this.formGroup().controls)) {
|
1263
|
+
formControlErrorCollection.set(property, this.formGroup().controls[property].errors);
|
1264
|
+
const htmlElement = document.querySelector(`[formcontrolname='${property}'] input`);
|
1265
|
+
if (Tools.IsNotNull(htmlElement))
|
1266
|
+
formControlCollection.set(property, htmlElement);
|
1267
|
+
}
|
1268
|
+
if (formControlCollection.size > 0) {
|
1269
|
+
if (Tools.IsNull(formControl)) {
|
1270
|
+
for (const [property, error] of formControlErrorCollection) {
|
1271
|
+
if (Tools.IsNotNull(error)) {
|
1272
|
+
formControl = property;
|
1273
|
+
break;
|
1274
|
+
}
|
1275
|
+
}
|
1276
|
+
if (Tools.IsNull(formControl)) {
|
1277
|
+
formControl = Array.from(formControlCollection.keys())[0];
|
1278
|
+
}
|
1279
|
+
}
|
1280
|
+
const element = formControlCollection.get(formControl);
|
1281
|
+
if (Tools.IsNotNull(element))
|
1282
|
+
element.focus();
|
1283
|
+
}
|
1284
|
+
}
|
1285
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerForm, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1286
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: CoerForm, selector: "coer-form", inputs: { formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\" autocomplete=\"off\" class=\"coer-form\">\r\n <fieldset [disabled]=\"_isDisabled\">\r\n <ng-content></ng-content>\r\n </fieldset>\r\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
|
1287
|
+
}
|
1288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerForm, decorators: [{
|
1289
|
+
type: Component,
|
1290
|
+
args: [{ selector: 'coer-form', template: "<form [formGroup]=\"formGroup()\" autocomplete=\"off\" class=\"coer-form\">\r\n <fieldset [disabled]=\"_isDisabled\">\r\n <ng-content></ng-content>\r\n </fieldset>\r\n</form>" }]
|
1291
|
+
}] });
|
1292
|
+
|
1293
|
+
class CoerNumberBox extends ControlValue {
|
1294
|
+
constructor() {
|
1295
|
+
super(...arguments);
|
1296
|
+
//Injections
|
1297
|
+
this.alert = inject(CoerAlert);
|
1298
|
+
//Component Value
|
1299
|
+
this._value = '';
|
1300
|
+
this.matFormField = viewChild.required('matFormField');
|
1301
|
+
this.coerNumberbox = viewChild.required('coerNumberbox');
|
1302
|
+
//Variables
|
1303
|
+
this._id = Tools.GetGuid('coer-numberbox');
|
1304
|
+
this._isLoadingEvent = signal(false);
|
1305
|
+
this.hideCaret = false;
|
1306
|
+
this.id = '';
|
1307
|
+
this.label = input('');
|
1308
|
+
this.placeholder = input('');
|
1309
|
+
this.min = input(0);
|
1310
|
+
this.max = input(2147483647);
|
1311
|
+
this.decimals = input(0);
|
1312
|
+
this.width = input('100%');
|
1313
|
+
this.minWidth = input('190px');
|
1314
|
+
this.maxWidth = input('100%');
|
1315
|
+
this.marginTop = input('0px');
|
1316
|
+
this.marginRight = input('0px');
|
1317
|
+
this.marginBottom = input('0px');
|
1318
|
+
this.marginLeft = input('0px');
|
1319
|
+
this.isInvalid = input(false);
|
1320
|
+
this.isValid = input(false);
|
1321
|
+
this.isDisabled = input(false);
|
1322
|
+
this.isReadonly = input(false);
|
1323
|
+
this.isLoading = input(false);
|
1324
|
+
this.selectOnFocus = input(true);
|
1325
|
+
this.textPosition = input('right');
|
1326
|
+
//Outputs
|
1327
|
+
this.onKeyupEnter = output();
|
1328
|
+
this.onInput = output();
|
1329
|
+
//computed
|
1330
|
+
this._isEnable = computed(() => {
|
1331
|
+
return !this.isDisabled() && !this.isLoading() && !this.isReadonly();
|
1332
|
+
});
|
1333
|
+
//computed
|
1334
|
+
this.floatLabel = computed(() => {
|
1335
|
+
return this.label() == '' ? 'always' : 'auto';
|
1336
|
+
});
|
1337
|
+
//computed
|
1338
|
+
this.paddingRight = computed(() => {
|
1339
|
+
return this.isInvalid() || this.isValid()
|
1340
|
+
? '18px' : '0px';
|
1341
|
+
});
|
1342
|
+
}
|
1343
|
+
//Inputs
|
1344
|
+
set value(value) {
|
1345
|
+
if (Tools.IsNull(value))
|
1346
|
+
value = 0;
|
1347
|
+
this.SetValue(value);
|
1348
|
+
}
|
1349
|
+
ngOnInit() {
|
1350
|
+
Tools.Sleep().then(() => {
|
1351
|
+
this.element = document.getElementById(this._id);
|
1352
|
+
if (this.element) {
|
1353
|
+
this.element.addEventListener('focus', () => {
|
1354
|
+
if (!this._isEnable())
|
1355
|
+
this.Blur();
|
1356
|
+
else if (this.selectOnFocus())
|
1357
|
+
this.Select();
|
1358
|
+
});
|
1359
|
+
this.element.addEventListener('blur', () => this.Blur());
|
1360
|
+
this.element.addEventListener('keyup', (event) => {
|
1361
|
+
if (this._isEnable()) {
|
1362
|
+
const { key } = event;
|
1363
|
+
if (key === 'Enter') {
|
1364
|
+
let value = this.coerNumberbox().nativeElement.value;
|
1365
|
+
value = this.OnlyNumbers(value);
|
1366
|
+
value = this.ValidateRangeValue(value);
|
1367
|
+
this.onKeyupEnter.emit(value);
|
1368
|
+
this.Blur();
|
1369
|
+
}
|
1370
|
+
if (key === 'ArrowUp') {
|
1371
|
+
this.hideCaret = true;
|
1372
|
+
this.SetValue(Number(this._value) + 1);
|
1373
|
+
Tools.Sleep(500, 'ArrowUp').then(() => this.hideCaret = false);
|
1374
|
+
}
|
1375
|
+
if (key === 'ArrowDown') {
|
1376
|
+
this.hideCaret = true;
|
1377
|
+
this.SetValue(Number(this._value) - 1);
|
1378
|
+
Tools.Sleep(500, 'ArrowDown').then(() => this.hideCaret = false);
|
1379
|
+
}
|
1380
|
+
}
|
1381
|
+
});
|
1382
|
+
this.element.addEventListener('input', () => {
|
1383
|
+
Tools.Sleep().then(() => {
|
1384
|
+
let value = this.coerNumberbox().nativeElement.value;
|
1385
|
+
value = this.OnlyNumbers(value);
|
1386
|
+
value = this.ValidateRangeValue(value);
|
1387
|
+
if (this._isEnable())
|
1388
|
+
this.onInput.emit(value);
|
1389
|
+
});
|
1390
|
+
});
|
1391
|
+
}
|
1392
|
+
});
|
1393
|
+
}
|
1394
|
+
//getter
|
1395
|
+
get value() {
|
1396
|
+
return this._value;
|
1397
|
+
}
|
1398
|
+
//ControlValueAccessor
|
1399
|
+
SetValue(value) {
|
1400
|
+
value = this.OnlyNumbers(value);
|
1401
|
+
value = this.ValidateRangeValue(value);
|
1402
|
+
this._UpdateValue(value);
|
1403
|
+
this.coerNumberbox().nativeElement.value = value;
|
1404
|
+
this._value = value;
|
1405
|
+
}
|
1406
|
+
//ControlValueAccessor
|
1407
|
+
writeValue(value) {
|
1408
|
+
value = this.OnlyNumbers(value);
|
1409
|
+
value = this.ValidateRangeValue(value);
|
1410
|
+
this.coerNumberbox().nativeElement.value = value;
|
1411
|
+
this._value = value;
|
1412
|
+
}
|
1413
|
+
/** */
|
1414
|
+
OnlyNumbers(value) {
|
1415
|
+
let isNegative = false;
|
1416
|
+
let valueString = String(value).trim();
|
1417
|
+
//Negatives
|
1418
|
+
if (valueString.includes('-')) {
|
1419
|
+
if (this.min() < 0) {
|
1420
|
+
isNegative = valueString.startsWith('-');
|
1421
|
+
if (valueString == '-')
|
1422
|
+
return '-';
|
1423
|
+
if (valueString == '-.')
|
1424
|
+
return '-0.';
|
1425
|
+
if (valueString == '-0')
|
1426
|
+
return '-0';
|
1427
|
+
if (valueString == '-0.')
|
1428
|
+
return '-0.';
|
1429
|
+
}
|
1430
|
+
else if (Number(value) < this.min()) {
|
1431
|
+
this.alert.Warning(`Minimum ${this.min()}`, 'Out of range', 'fa-solid fa-hashtag');
|
1432
|
+
valueString = '0';
|
1433
|
+
}
|
1434
|
+
}
|
1435
|
+
const charArray = [];
|
1436
|
+
for (const char of valueString) {
|
1437
|
+
if (['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char)) {
|
1438
|
+
charArray.push(char);
|
1439
|
+
}
|
1440
|
+
else if (char == '.' && this.decimals() > 0) {
|
1441
|
+
charArray.push(char);
|
1442
|
+
}
|
1443
|
+
}
|
1444
|
+
valueString = charArray.join('');
|
1445
|
+
//Decimals
|
1446
|
+
if (this.decimals() > 0) {
|
1447
|
+
let integerString = valueString.split('.')[0] || '';
|
1448
|
+
let decimalString = valueString.split('.')[1] || '';
|
1449
|
+
decimalString = decimalString.substring(0, this.decimals());
|
1450
|
+
if (valueString == '.')
|
1451
|
+
return '0.';
|
1452
|
+
else if (valueString.includes('.') && decimalString == '') {
|
1453
|
+
return (isNegative) ? `-${integerString}.` : `${integerString}.`;
|
1454
|
+
}
|
1455
|
+
else if (valueString.includes('.') && decimalString.endsWith('0')) {
|
1456
|
+
return (isNegative) ? `-${integerString}.${decimalString}` : `${integerString}.${decimalString}`;
|
1457
|
+
}
|
1458
|
+
else if (integerString == '' && decimalString == '') {
|
1459
|
+
return '0';
|
1460
|
+
}
|
1461
|
+
valueString = `${integerString}.${decimalString}`;
|
1462
|
+
}
|
1463
|
+
if (isNegative) {
|
1464
|
+
valueString = `-${valueString}`;
|
1465
|
+
}
|
1466
|
+
return Number(valueString);
|
1467
|
+
}
|
1468
|
+
/** */
|
1469
|
+
ValidateRangeValue(value) {
|
1470
|
+
if (['-', '.', '-.', '-0', '-0.'].includes(String(value))) {
|
1471
|
+
return String(value);
|
1472
|
+
}
|
1473
|
+
if (Number(value) < this.min()) {
|
1474
|
+
this.alert.Warning(`Minimum ${this.min()}`, 'Out of range', 'fa-solid fa-hashtag');
|
1475
|
+
value = this.min();
|
1476
|
+
}
|
1477
|
+
if (Number(value) > this.max()) {
|
1478
|
+
this.alert.Warning(`Cannot exceed ${this.max()}`, 'Out of range', 'fa-solid fa-hashtag');
|
1479
|
+
value = this.max();
|
1480
|
+
}
|
1481
|
+
if (this.decimals() <= 0) {
|
1482
|
+
if (String(value).includes('.')) {
|
1483
|
+
value = String(value).split('.')[0];
|
1484
|
+
}
|
1485
|
+
}
|
1486
|
+
return String(value);
|
1487
|
+
}
|
1488
|
+
/** */
|
1489
|
+
Focus(timeout = 0) {
|
1490
|
+
if (this._isLoadingEvent())
|
1491
|
+
return;
|
1492
|
+
else
|
1493
|
+
this._isLoadingEvent.set(true);
|
1494
|
+
Tools.Sleep(timeout).then(() => {
|
1495
|
+
if (this._isEnable()) {
|
1496
|
+
this.element.focus();
|
1497
|
+
}
|
1498
|
+
this._isLoadingEvent.set(false);
|
1499
|
+
});
|
1500
|
+
}
|
1501
|
+
/** */
|
1502
|
+
Select(timeout = 0) {
|
1503
|
+
if (this._isLoadingEvent())
|
1504
|
+
return;
|
1505
|
+
else
|
1506
|
+
this._isLoadingEvent.set(true);
|
1507
|
+
Tools.Sleep(timeout).then(() => {
|
1508
|
+
if (this._isEnable()) {
|
1509
|
+
this.element.focus();
|
1510
|
+
this.element.select();
|
1511
|
+
}
|
1512
|
+
this._isLoadingEvent.set(false);
|
1513
|
+
});
|
1514
|
+
}
|
1515
|
+
/** */
|
1516
|
+
Blur() {
|
1517
|
+
if (this._isLoadingEvent())
|
1518
|
+
return;
|
1519
|
+
else
|
1520
|
+
this._isLoadingEvent.set(true);
|
1521
|
+
Tools.Sleep().then(() => {
|
1522
|
+
if (this.element) {
|
1523
|
+
this.element.blur();
|
1524
|
+
setTimeout(() => {
|
1525
|
+
const element = document.querySelector(`#${this._id}-container .mdc-line-ripple--active`);
|
1526
|
+
if (element)
|
1527
|
+
element.classList.remove('mdc-line-ripple--active');
|
1528
|
+
this._isLoadingEvent.set(false);
|
1529
|
+
});
|
1530
|
+
}
|
1531
|
+
});
|
1532
|
+
}
|
1533
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerNumberBox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
1534
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerNumberBox, selector: "coer-numberbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, marginTop: { classPropertyName: "marginTop", publicName: "marginTop", isSignal: true, isRequired: false, transformFunction: null }, marginRight: { classPropertyName: "marginRight", publicName: "marginRight", isSignal: true, isRequired: false, transformFunction: null }, marginBottom: { classPropertyName: "marginBottom", publicName: "marginBottom", isSignal: true, isRequired: false, transformFunction: null }, marginLeft: { classPropertyName: "marginLeft", publicName: "marginLeft", isSignal: true, isRequired: false, transformFunction: null }, isInvalid: { classPropertyName: "isInvalid", publicName: "isInvalid", isSignal: true, isRequired: false, transformFunction: null }, isValid: { classPropertyName: "isValid", publicName: "isValid", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, textPosition: { classPropertyName: "textPosition", publicName: "textPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onKeyupEnter: "onKeyupEnter", onInput: "onInput" }, providers: [CONTROL_VALUE(CoerNumberBox)], viewQueries: [{ propertyName: "matFormField", first: true, predicate: ["matFormField"], descendants: true, isSignal: true }, { propertyName: "coerNumberbox", first: true, predicate: ["coerNumberbox"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"coer-number-box\">\r\n <mat-form-field\r\n [id]=\"_id + '-container'\"\r\n [floatLabel]=\"floatLabel()\"\r\n [ngClass]=\"{\r\n 'readonly': isReadonly() && !isLoading()\r\n }\"\r\n [style]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'max-width': maxWidth(),\r\n 'margin-top': marginTop(),\r\n 'margin-right': marginRight(),\r\n 'margin-bottom': marginBottom(),\r\n 'margin-left': marginLeft()\r\n }\">\r\n <mat-label>{{ label() }}</mat-label>\r\n\r\n <input #coerNumberbox matInput\r\n [id]=\"_id\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"!_isEnable()\"\r\n [value]=\"_value\"\r\n (input)=\"SetValue(coerNumberbox.value)\"\r\n (blur)=\"SetTouched(true)\"\r\n [ngClass]=\"{ 'caret-none': hideCaret }\"\r\n [style]=\"{\r\n 'cursor': isLoading() ? 'wait' : null,\r\n 'margin-top': (floatLabel() == 'auto') ? '15px' : '9px',\r\n 'padding-right': paddingRight(),\r\n 'text-align': textPosition()\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <span ngClass=\"icon-container\">\r\n @if(isInvalid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-exclamation\"></i>\r\n }\r\n\r\n @else if(isValid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-check text-green\"></i>\r\n }\r\n </span>\r\n </mat-form-field>\r\n</div>", styles: ["div.coer-number-box .text-blue{color:#0d6efd!important}div.coer-number-box .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-number-box .background-blue{background-color:#0d6efd!important}div.coer-number-box .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-number-box .border-blue{border-color:#0d6efd!important}div.coer-number-box .text-gray{color:#6c757d!important}div.coer-number-box .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-number-box .background-gray{background-color:#6c757d!important}div.coer-number-box .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-number-box .border-gray{border-color:#6c757d!important}div.coer-number-box .text-green{color:#198754!important}div.coer-number-box .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-number-box .background-green{background-color:#198754!important}div.coer-number-box .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-number-box .border-green{border-color:#198754!important}div.coer-number-box .text-yellow{color:#ffc107!important}div.coer-number-box .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-number-box .background-yellow{background-color:#ffc107!important}div.coer-number-box .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-number-box .border-yellow{border-color:#ffc107!important}div.coer-number-box .text-red{color:#dc3545!important}div.coer-number-box .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-number-box .background-red{background-color:#dc3545!important}div.coer-number-box .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-number-box .border-red{border-color:#dc3545!important}div.coer-number-box .text-white{color:#f5f5f5!important}div.coer-number-box .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-number-box .background-white{background-color:#f5f5f5!important}div.coer-number-box .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-number-box .border-white{border-color:#f5f5f5!important}div.coer-number-box .text-black{color:#252525!important}div.coer-number-box .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-number-box .background-black{background-color:#252525!important}div.coer-number-box .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-number-box .border-black{border-color:#252525!important}div.coer-number-box .text-orange{color:#fd6031!important}div.coer-number-box .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-number-box .background-orange{background-color:#fd6031!important}div.coer-number-box .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-number-box .border-orange{border-color:#fd6031!important}div.coer-number-box mat-form-field{position:relative!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:40px!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{width:100%!important;height:40px!important;padding:0!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label{overflow:visible!important;position:absolute!important;top:20px!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label.mdc-floating-label--float-above mat-label{color:#fd6031;font-weight:700;position:relative;left:-10px;top:2px}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{font-weight:400!important;font-size:17px!important;color:#252525!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input.caret-none{caret-color:transparent!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active,div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:before,div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:after{border-bottom-color:#fd6031!important}div.coer-number-box mat-form-field div.mat-mdc-form-field-subscript-wrapper.mat-mdc-form-field-bottom-align{height:0px!important}div.coer-number-box mat-form-field span.icon-container{position:absolute!important;top:1px!important;right:-14px!important;z-index:5!important;width:30px;height:40px;display:flex;align-items:center;justify-content:center}div.coer-number-box mat-form-field span.icon-container i{font-size:20px!important}div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-xmark,div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass{color:#caced1!important;cursor:pointer!important}div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-xmark:hover,div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass:hover{color:#6c757d!important}div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-circle-check{color:#198754!important}div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-circle-exclamation{color:#dc3545!important}div.coer-number-box mat-form-field span.placeholder{width:calc(100% + 32px)!important;height:40px!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important}div.coer-number-box mat-form-field .placeholder,div.coer-number-box mat-form-field .placeholder *,div.coer-number-box mat-form-field .placeholder-glow,div.coer-number-box mat-form-field .placeholder-glow *{cursor:wait!important}div.coer-number-box mat-form-field.readonly div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:#bbbbbb83!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:transparent!important;padding-left:9px!important;padding-right:9px!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple,coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:before,coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:after{border-bottom-color:transparent!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:28px!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{height:28px!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{margin-top:3px!important;font-size:14px!important}coer-grid table tbody tr td.coer-numberbox mat-form-field span.icon-container{transform:translate(-5px,-6px)!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }] }); }
|
1535
|
+
}
|
1536
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerNumberBox, decorators: [{
|
1537
|
+
type: Component,
|
1538
|
+
args: [{ selector: 'coer-numberbox', providers: [CONTROL_VALUE(CoerNumberBox)], template: "<div class=\"coer-number-box\">\r\n <mat-form-field\r\n [id]=\"_id + '-container'\"\r\n [floatLabel]=\"floatLabel()\"\r\n [ngClass]=\"{\r\n 'readonly': isReadonly() && !isLoading()\r\n }\"\r\n [style]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'max-width': maxWidth(),\r\n 'margin-top': marginTop(),\r\n 'margin-right': marginRight(),\r\n 'margin-bottom': marginBottom(),\r\n 'margin-left': marginLeft()\r\n }\">\r\n <mat-label>{{ label() }}</mat-label>\r\n\r\n <input #coerNumberbox matInput\r\n [id]=\"_id\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"!_isEnable()\"\r\n [value]=\"_value\"\r\n (input)=\"SetValue(coerNumberbox.value)\"\r\n (blur)=\"SetTouched(true)\"\r\n [ngClass]=\"{ 'caret-none': hideCaret }\"\r\n [style]=\"{\r\n 'cursor': isLoading() ? 'wait' : null,\r\n 'margin-top': (floatLabel() == 'auto') ? '15px' : '9px',\r\n 'padding-right': paddingRight(),\r\n 'text-align': textPosition()\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <span ngClass=\"icon-container\">\r\n @if(isInvalid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-exclamation\"></i>\r\n }\r\n\r\n @else if(isValid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-check text-green\"></i>\r\n }\r\n </span>\r\n </mat-form-field>\r\n</div>", styles: ["div.coer-number-box .text-blue{color:#0d6efd!important}div.coer-number-box .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-number-box .background-blue{background-color:#0d6efd!important}div.coer-number-box .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-number-box .border-blue{border-color:#0d6efd!important}div.coer-number-box .text-gray{color:#6c757d!important}div.coer-number-box .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-number-box .background-gray{background-color:#6c757d!important}div.coer-number-box .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-number-box .border-gray{border-color:#6c757d!important}div.coer-number-box .text-green{color:#198754!important}div.coer-number-box .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-number-box .background-green{background-color:#198754!important}div.coer-number-box .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-number-box .border-green{border-color:#198754!important}div.coer-number-box .text-yellow{color:#ffc107!important}div.coer-number-box .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-number-box .background-yellow{background-color:#ffc107!important}div.coer-number-box .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-number-box .border-yellow{border-color:#ffc107!important}div.coer-number-box .text-red{color:#dc3545!important}div.coer-number-box .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-number-box .background-red{background-color:#dc3545!important}div.coer-number-box .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-number-box .border-red{border-color:#dc3545!important}div.coer-number-box .text-white{color:#f5f5f5!important}div.coer-number-box .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-number-box .background-white{background-color:#f5f5f5!important}div.coer-number-box .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-number-box .border-white{border-color:#f5f5f5!important}div.coer-number-box .text-black{color:#252525!important}div.coer-number-box .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-number-box .background-black{background-color:#252525!important}div.coer-number-box .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-number-box .border-black{border-color:#252525!important}div.coer-number-box .text-orange{color:#fd6031!important}div.coer-number-box .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-number-box .background-orange{background-color:#fd6031!important}div.coer-number-box .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-number-box .border-orange{border-color:#fd6031!important}div.coer-number-box mat-form-field{position:relative!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:40px!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{width:100%!important;height:40px!important;padding:0!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label{overflow:visible!important;position:absolute!important;top:20px!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label.mdc-floating-label--float-above mat-label{color:#fd6031;font-weight:700;position:relative;left:-10px;top:2px}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{font-weight:400!important;font-size:17px!important;color:#252525!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input.caret-none{caret-color:transparent!important}div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active,div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:before,div.coer-number-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:after{border-bottom-color:#fd6031!important}div.coer-number-box mat-form-field div.mat-mdc-form-field-subscript-wrapper.mat-mdc-form-field-bottom-align{height:0px!important}div.coer-number-box mat-form-field span.icon-container{position:absolute!important;top:1px!important;right:-14px!important;z-index:5!important;width:30px;height:40px;display:flex;align-items:center;justify-content:center}div.coer-number-box mat-form-field span.icon-container i{font-size:20px!important}div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-xmark,div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass{color:#caced1!important;cursor:pointer!important}div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-xmark:hover,div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass:hover{color:#6c757d!important}div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-circle-check{color:#198754!important}div.coer-number-box mat-form-field span.icon-container i.fa-solid.fa-circle-exclamation{color:#dc3545!important}div.coer-number-box mat-form-field span.placeholder{width:calc(100% + 32px)!important;height:40px!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important}div.coer-number-box mat-form-field .placeholder,div.coer-number-box mat-form-field .placeholder *,div.coer-number-box mat-form-field .placeholder-glow,div.coer-number-box mat-form-field .placeholder-glow *{cursor:wait!important}div.coer-number-box mat-form-field.readonly div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:#bbbbbb83!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:transparent!important;padding-left:9px!important;padding-right:9px!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple,coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:before,coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:after{border-bottom-color:transparent!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:28px!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{height:28px!important}coer-grid table tbody tr td.coer-numberbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{margin-top:3px!important;font-size:14px!important}coer-grid table tbody tr td.coer-numberbox mat-form-field span.icon-container{transform:translate(-5px,-6px)!important}\n"] }]
|
1539
|
+
}], propDecorators: { value: [{
|
1540
|
+
type: Input
|
1541
|
+
}], id: [{
|
1542
|
+
type: Input
|
1543
|
+
}] } });
|
1544
|
+
|
1545
|
+
class CoerSelectbox extends ControlValue {
|
1546
|
+
constructor() {
|
1547
|
+
super(...arguments);
|
1548
|
+
//Component Value
|
1549
|
+
this._value = null;
|
1550
|
+
//Variables
|
1551
|
+
this._scrollByRow = 40.8;
|
1552
|
+
this._coerTextBox = viewChild.required('coerTextBox');
|
1553
|
+
this._id = Tools.GetGuid('coer-selectBox');
|
1554
|
+
this._index = signal(-1);
|
1555
|
+
this._search = signal('');
|
1556
|
+
this._isOpen = signal(false);
|
1557
|
+
this._isDirty = signal(false);
|
1558
|
+
this._isOverMenu = signal(false);
|
1559
|
+
this._isLoadingEvent = signal(false);
|
1560
|
+
this._scroll = signal(0);
|
1561
|
+
this.id = '';
|
1562
|
+
this.label = input('');
|
1563
|
+
this.dataSource = input([]);
|
1564
|
+
this.propDisplay = input('name');
|
1565
|
+
this.rowsByPage = input(50);
|
1566
|
+
this.placeholder = input('-- Select --');
|
1567
|
+
this.width = input('100%');
|
1568
|
+
this.minWidth = input('190px');
|
1569
|
+
this.maxWidth = input('100%');
|
1570
|
+
this.marginTop = input('0px');
|
1571
|
+
this.marginRight = input('0px');
|
1572
|
+
this.marginBottom = input('0px');
|
1573
|
+
this.marginLeft = input('0px');
|
1574
|
+
this.isInvalid = input(false);
|
1575
|
+
this.isValid = input(false);
|
1576
|
+
this.isDisabled = input(false);
|
1577
|
+
this.isReadonly = input(false);
|
1578
|
+
this.isLoading = input(false);
|
1579
|
+
//Outputs
|
1580
|
+
this.onSelected = output();
|
1581
|
+
//computed
|
1582
|
+
this._isEnable = computed(() => {
|
1583
|
+
return !this.isDisabled() && !this.isLoading() && !this.isReadonly();
|
1584
|
+
});
|
1585
|
+
//computed
|
1586
|
+
this.floatLabel = computed(() => {
|
1587
|
+
return this.label() == '' ? 'always' : 'auto';
|
1588
|
+
});
|
1589
|
+
//computed
|
1590
|
+
this._dataSource = computed(() => {
|
1591
|
+
let index = 0;
|
1592
|
+
const search = this._search();
|
1593
|
+
const propDisplay = this.propDisplay();
|
1594
|
+
let dataSource = this.dataSource().map((item) => Object.assign(item, { index: index++ }));
|
1595
|
+
if (this._isDirty() && !this._isLoadingEvent()) {
|
1596
|
+
dataSource = [...dataSource].filter((item) => String(item[propDisplay]).trim().toUpperCase().includes(search.trim().toUpperCase()));
|
1597
|
+
}
|
1598
|
+
let indexRow = 0;
|
1599
|
+
return Tools.BreakReference(dataSource)
|
1600
|
+
.splice(0, this.rowsByPage())
|
1601
|
+
.map((item) => Object.assign(item, { indexRow: indexRow++ }));
|
1602
|
+
});
|
1603
|
+
/** */
|
1604
|
+
this.GetIndexRow = (item) => {
|
1605
|
+
return item['indexRow'];
|
1606
|
+
};
|
1607
|
+
/** */
|
1608
|
+
this.GetDisplay = (item) => {
|
1609
|
+
return Tools.IsNotNull(item) ? item[this.propDisplay()] : '';
|
1610
|
+
};
|
1611
|
+
}
|
1612
|
+
//Inputs
|
1613
|
+
set value(value) {
|
1614
|
+
if (Tools.IsNull(value))
|
1615
|
+
value = null;
|
1616
|
+
this.SetValue(value);
|
1617
|
+
}
|
1618
|
+
ngOnInit() {
|
1619
|
+
this.SetEvents();
|
1620
|
+
}
|
1621
|
+
//getter
|
1622
|
+
get value() {
|
1623
|
+
return this._value;
|
1624
|
+
}
|
1625
|
+
//getter
|
1626
|
+
get _displayed() {
|
1627
|
+
return Tools.IsNotNull(this._value) ? this._value[this.propDisplay()] : '';
|
1628
|
+
}
|
1629
|
+
//getter
|
1630
|
+
get _placeholder() {
|
1631
|
+
let placeholder = this.placeholder();
|
1632
|
+
if (this.dataSource().length <= 0) {
|
1633
|
+
placeholder = '-- No Options --';
|
1634
|
+
}
|
1635
|
+
return Tools.IsNotNull(this._value)
|
1636
|
+
? this._displayed
|
1637
|
+
: placeholder;
|
1638
|
+
}
|
1639
|
+
//computed
|
1640
|
+
get _showCancel() {
|
1641
|
+
return Tools.IsNotNull(this._value)
|
1642
|
+
&& this._search().length <= 0;
|
1643
|
+
}
|
1644
|
+
//computed
|
1645
|
+
get paddingRight() {
|
1646
|
+
return this.isInvalid() || this.isValid() || this._showCancel
|
1647
|
+
? '40px' : '15px';
|
1648
|
+
}
|
1649
|
+
//computed
|
1650
|
+
get widthIcons() {
|
1651
|
+
return this.isInvalid() || this.isValid() || this._showCancel
|
1652
|
+
? '55px' : '30px';
|
1653
|
+
}
|
1654
|
+
/** */
|
1655
|
+
SetValue(_value) {
|
1656
|
+
if (_value === undefined)
|
1657
|
+
_value = null;
|
1658
|
+
this._UpdateValue(_value);
|
1659
|
+
this._value = _value;
|
1660
|
+
this._search.set(this.GetDisplay(_value));
|
1661
|
+
}
|
1662
|
+
/** */
|
1663
|
+
writeValue(_value) {
|
1664
|
+
if (_value === undefined)
|
1665
|
+
_value = null;
|
1666
|
+
this._value = _value;
|
1667
|
+
this._search.set(this.GetDisplay(_value));
|
1668
|
+
}
|
1669
|
+
/** */
|
1670
|
+
SetEvents() {
|
1671
|
+
Tools.Sleep().then(() => {
|
1672
|
+
//Container
|
1673
|
+
this._container = document.getElementById(`${this._id}-container`);
|
1674
|
+
this._container.addEventListener('mouseenter', () => {
|
1675
|
+
this._isOverMenu.set(true);
|
1676
|
+
});
|
1677
|
+
this._container.addEventListener('mouseleave', () => {
|
1678
|
+
this._isOverMenu.set(false);
|
1679
|
+
});
|
1680
|
+
//DropDown
|
1681
|
+
this._dropDownMenu = document.getElementById(`${this._id}-dropdown-menu`);
|
1682
|
+
this._dropDownMenu.addEventListener('mouseenter', () => {
|
1683
|
+
this._isOverMenu.set(true);
|
1684
|
+
});
|
1685
|
+
this._dropDownMenu.addEventListener('mouseleave', () => {
|
1686
|
+
this._isOverMenu.set(false);
|
1687
|
+
});
|
1688
|
+
//TextBox
|
1689
|
+
this._textbox = document.getElementById(this._id);
|
1690
|
+
this._textbox.addEventListener('focus', () => {
|
1691
|
+
if (this._isEnable())
|
1692
|
+
this.Focus();
|
1693
|
+
else
|
1694
|
+
this.Blur();
|
1695
|
+
});
|
1696
|
+
this._textbox.addEventListener('keyup', (event) => {
|
1697
|
+
const { key } = event;
|
1698
|
+
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) {
|
1699
|
+
if (key === 'ArrowUp') {
|
1700
|
+
const firstIndex = (this._dataSource().length <= 0) ? -1 : 0;
|
1701
|
+
if ((this._index() - 1) >= firstIndex) {
|
1702
|
+
this._index.update(index => index - 1);
|
1703
|
+
if (this._index() >= 3)
|
1704
|
+
this._scroll.update(scroll => scroll -= this._scrollByRow);
|
1705
|
+
else
|
1706
|
+
this._scroll.set(0);
|
1707
|
+
this._dropDownMenu.scrollTo(0, this._scroll());
|
1708
|
+
}
|
1709
|
+
else {
|
1710
|
+
this._scroll.set(0);
|
1711
|
+
this._index.set(-1);
|
1712
|
+
this._textbox.focus();
|
1713
|
+
this._textbox.select();
|
1714
|
+
}
|
1715
|
+
this._dropDownMenu.scrollTo(0, this._scroll());
|
1716
|
+
}
|
1717
|
+
else if (key === 'ArrowDown') {
|
1718
|
+
const lastIndex = (this._dataSource().length - 1);
|
1719
|
+
if ((this._index() + 1) <= lastIndex) {
|
1720
|
+
this._index.update(index => index + 1);
|
1721
|
+
if (this._index() >= 3)
|
1722
|
+
this._scroll.update(scroll => scroll += this._scrollByRow);
|
1723
|
+
}
|
1724
|
+
this._dropDownMenu.scrollTo(0, this._scroll());
|
1725
|
+
}
|
1726
|
+
else if (['ArrowLeft', 'ArrowRight'].includes(key)) {
|
1727
|
+
if (Tools.IsNotNull(this._value) && !this._isDirty()) {
|
1728
|
+
this._scroll.set(0);
|
1729
|
+
this._dropDownMenu.scrollTo(0, this._scroll());
|
1730
|
+
this.Search(this._displayed);
|
1731
|
+
}
|
1732
|
+
this._isDirty.set(true);
|
1733
|
+
}
|
1734
|
+
}
|
1735
|
+
else {
|
1736
|
+
if (key == 'Delete' && this._search() == '') {
|
1737
|
+
this.Unselect();
|
1738
|
+
}
|
1739
|
+
this._isDirty.set(true);
|
1740
|
+
}
|
1741
|
+
});
|
1742
|
+
this._textbox.addEventListener('mouseenter', () => {
|
1743
|
+
this._isOverMenu.set(true);
|
1744
|
+
});
|
1745
|
+
this._textbox.addEventListener('mouseleave', () => {
|
1746
|
+
this._isOverMenu.set(false);
|
1747
|
+
});
|
1748
|
+
this._textbox.addEventListener('paste', () => {
|
1749
|
+
Tools.Sleep().then(_ => {
|
1750
|
+
this._search.update(search => search = search.toString().trim());
|
1751
|
+
});
|
1752
|
+
});
|
1753
|
+
//Document
|
1754
|
+
document.addEventListener('click', () => {
|
1755
|
+
if (!this._isOverMenu())
|
1756
|
+
this.Blur();
|
1757
|
+
});
|
1758
|
+
document.addEventListener('keyup', (event) => {
|
1759
|
+
if (event.key === 'Enter') {
|
1760
|
+
if (this._index() >= 0) {
|
1761
|
+
if (Tools.IsNotNull(this._value) && this._search() == this._value[this.propDisplay()]) {
|
1762
|
+
this._isLoadingEvent.set(true);
|
1763
|
+
}
|
1764
|
+
const dataSource = Tools.BreakReference(this._dataSource());
|
1765
|
+
const _value = dataSource.find(x => x.indexRow == this._index());
|
1766
|
+
this.SelectItem(_value);
|
1767
|
+
this._isLoadingEvent.set(false);
|
1768
|
+
}
|
1769
|
+
this.Blur();
|
1770
|
+
}
|
1771
|
+
});
|
1772
|
+
});
|
1773
|
+
}
|
1774
|
+
/** */
|
1775
|
+
SelectItem(item) {
|
1776
|
+
if (Tools.IsNotNull(item)) {
|
1777
|
+
const _item = Tools.BreakReference(this.dataSource()[item.index]);
|
1778
|
+
if (Tools.IsNotNull(_item)) {
|
1779
|
+
this.SetValue(Tools.BreakReference(_item));
|
1780
|
+
this.Blur();
|
1781
|
+
}
|
1782
|
+
delete _item.indexRow;
|
1783
|
+
delete _item.index;
|
1784
|
+
this.onSelected.emit({ ..._item });
|
1785
|
+
}
|
1786
|
+
}
|
1787
|
+
/** */
|
1788
|
+
Unselect() {
|
1789
|
+
this._search.set('');
|
1790
|
+
this.SetValue(null);
|
1791
|
+
this.Blur();
|
1792
|
+
}
|
1793
|
+
/** */
|
1794
|
+
Focus(timeout = 0) {
|
1795
|
+
if (this._isLoadingEvent())
|
1796
|
+
return;
|
1797
|
+
else
|
1798
|
+
this._isLoadingEvent.set(true);
|
1799
|
+
Tools.Sleep(timeout).then(_ => {
|
1800
|
+
if (this._isEnable()) {
|
1801
|
+
this._textbox.focus();
|
1802
|
+
this._textbox.select();
|
1803
|
+
this.Open();
|
1804
|
+
}
|
1805
|
+
Tools.Sleep().then(_ => {
|
1806
|
+
if (Tools.IsNotNull(this._value)) {
|
1807
|
+
this.Search(this._displayed);
|
1808
|
+
}
|
1809
|
+
this._isLoadingEvent.set(false);
|
1810
|
+
});
|
1811
|
+
});
|
1812
|
+
}
|
1813
|
+
/** */
|
1814
|
+
Blur() {
|
1815
|
+
if (this._isLoadingEvent())
|
1816
|
+
return;
|
1817
|
+
this._isLoadingEvent.set(true);
|
1818
|
+
this._isDirty.set(false);
|
1819
|
+
this._index.set(-1);
|
1820
|
+
this._scroll.set(0);
|
1821
|
+
this._dropDownMenu.scrollTo(0, this._scroll());
|
1822
|
+
this._search.set(this._displayed);
|
1823
|
+
Tools.Sleep().then(_ => {
|
1824
|
+
this._textbox.blur();
|
1825
|
+
this.Close();
|
1826
|
+
Tools.Sleep().then(_ => {
|
1827
|
+
const element = document.querySelector(`#${this._id}-container .mdc-line-ripple--active`);
|
1828
|
+
if (element)
|
1829
|
+
element.classList.remove('mdc-line-ripple--active');
|
1830
|
+
this._isLoadingEvent.set(false);
|
1831
|
+
});
|
1832
|
+
});
|
1833
|
+
}
|
1834
|
+
/** */
|
1835
|
+
Open() {
|
1836
|
+
if (!this._dropDownMenu.classList.contains('show')) {
|
1837
|
+
this._dropDownMenu.classList.add('show');
|
1838
|
+
}
|
1839
|
+
this._isOpen.set(true);
|
1840
|
+
}
|
1841
|
+
/** */
|
1842
|
+
Close() {
|
1843
|
+
if (this._dropDownMenu.classList.contains('show')) {
|
1844
|
+
this._dropDownMenu.classList.remove('show');
|
1845
|
+
}
|
1846
|
+
this._isOpen.set(false);
|
1847
|
+
}
|
1848
|
+
/** */
|
1849
|
+
Search(_value) {
|
1850
|
+
this._search.set(String(_value));
|
1851
|
+
Tools.Sleep(0, `${this._id}-search`).then(_ => {
|
1852
|
+
const item = this._dataSource().find(item => String(item[this.propDisplay()]).trim().toUpperCase().includes(String(_value).trim().toUpperCase()));
|
1853
|
+
if (Tools.IsNotNull(item)) {
|
1854
|
+
this._index.set(item.indexRow);
|
1855
|
+
if (this._index() >= 3) {
|
1856
|
+
this._scroll.set((this._index() - 2) * this._scrollByRow);
|
1857
|
+
}
|
1858
|
+
else {
|
1859
|
+
this._scroll.set(0);
|
1860
|
+
}
|
1861
|
+
this._dropDownMenu.scrollTo(0, this._scroll());
|
1862
|
+
}
|
1863
|
+
});
|
1864
|
+
}
|
1865
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerSelectbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
1866
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerSelectbox, selector: "coer-selectbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, propDisplay: { classPropertyName: "propDisplay", publicName: "propDisplay", isSignal: true, isRequired: false, transformFunction: null }, rowsByPage: { classPropertyName: "rowsByPage", publicName: "rowsByPage", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, marginTop: { classPropertyName: "marginTop", publicName: "marginTop", isSignal: true, isRequired: false, transformFunction: null }, marginRight: { classPropertyName: "marginRight", publicName: "marginRight", isSignal: true, isRequired: false, transformFunction: null }, marginBottom: { classPropertyName: "marginBottom", publicName: "marginBottom", isSignal: true, isRequired: false, transformFunction: null }, marginLeft: { classPropertyName: "marginLeft", publicName: "marginLeft", isSignal: true, isRequired: false, transformFunction: null }, isInvalid: { classPropertyName: "isInvalid", publicName: "isInvalid", isSignal: true, isRequired: false, transformFunction: null }, isValid: { classPropertyName: "isValid", publicName: "isValid", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelected: "onSelected" }, providers: [CONTROL_VALUE(CoerSelectbox)], viewQueries: [{ propertyName: "_coerTextBox", first: true, predicate: ["coerTextBox"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"coer-select-box\">\r\n <mat-form-field\r\n [id]=\"_id + '-container'\"\r\n [floatLabel]=\"floatLabel()\"\r\n [ngClass]=\"{\r\n 'readonly': isReadonly() && !isLoading()\r\n }\"\r\n [style]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'max-width': maxWidth(),\r\n 'margin-top': marginTop(),\r\n 'margin-right': marginRight(),\r\n 'margin-bottom': marginBottom(),\r\n 'margin-left': marginLeft()\r\n }\">\r\n <mat-label>{{ label() }}</mat-label>\r\n\r\n <input #coerTextBox matInput\r\n [id]=\"_id\"\r\n type=\"text\"\r\n [value]=\"_search()\"\r\n [placeholder]=\"_placeholder\"\r\n [disabled]=\"!_isEnable()\"\r\n (input)=\"Search(coerTextBox.value)\"\r\n (blur)=\"SetTouched(true)\"\r\n [style]=\"{\r\n 'cursor': isLoading() ? 'wait' : null,\r\n 'margin-top': (floatLabel() == 'auto') ? '15px' : '9px',\r\n 'padding-right': paddingRight\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <span ngClass=\"icon-container\" [style]=\"{ 'width': widthIcons }\">\r\n @if(_showCancel && _isEnable() && !isLoading()) {\r\n <i class=\"fa-solid fa-xmark text-secondary\" (click)=\"Unselect()\"></i>\r\n }\r\n\r\n @else if(isInvalid() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-exclamation\"></i>\r\n }\r\n\r\n @else if(isValid() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-check text-green\"></i>\r\n }\r\n\r\n @if(_isOpen() && _isEnable() && !isLoading()) {\r\n <i class=\"fa-solid fa-caret-up cursor-pointer text-orange\" (click)=\"Blur()\"></i>\r\n }\r\n\r\n @else if(_isEnable() && !isLoading()) {\r\n <i class=\"fa-solid fa-caret-down cursor-pointer text-secondary\"></i>\r\n }\r\n </span>\r\n </mat-form-field>\r\n\r\n <!-- Options Container -->\r\n <div class=\"btn-group\">\r\n <ul [id]=\"_id + '-dropdown-menu'\" class=\"dropdown-menu\">\r\n @for(item of _dataSource(); track GetIndexRow(item)) {\r\n <li (click)=\"SelectItem(item)\">\r\n <div [id]=\"id + '-dropdown-option-' + GetIndexRow(item)\"\r\n [ngClass]=\"{\r\n 'dropdown-item': true,\r\n 'cursor-pointer': true,\r\n 'dropdown-item-focus': _index() == GetIndexRow(item)\r\n }\"\r\n >{{ GetDisplay(item) }} </div>\r\n <hr class=\"dropdown-divider\">\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</div>\r\n\r\n", styles: ["div.coer-select-box{position:relative!important}div.coer-select-box .text-blue{color:#0d6efd!important}div.coer-select-box .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-select-box .background-blue{background-color:#0d6efd!important}div.coer-select-box .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-select-box .border-blue{border-color:#0d6efd!important}div.coer-select-box .text-gray{color:#6c757d!important}div.coer-select-box .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-select-box .background-gray{background-color:#6c757d!important}div.coer-select-box .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-select-box .border-gray{border-color:#6c757d!important}div.coer-select-box .text-green{color:#198754!important}div.coer-select-box .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-select-box .background-green{background-color:#198754!important}div.coer-select-box .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-select-box .border-green{border-color:#198754!important}div.coer-select-box .text-yellow{color:#ffc107!important}div.coer-select-box .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-select-box .background-yellow{background-color:#ffc107!important}div.coer-select-box .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-select-box .border-yellow{border-color:#ffc107!important}div.coer-select-box .text-red{color:#dc3545!important}div.coer-select-box .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-select-box .background-red{background-color:#dc3545!important}div.coer-select-box .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-select-box .border-red{border-color:#dc3545!important}div.coer-select-box .text-white{color:#f5f5f5!important}div.coer-select-box .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-select-box .background-white{background-color:#f5f5f5!important}div.coer-select-box .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-select-box .border-white{border-color:#f5f5f5!important}div.coer-select-box .text-black{color:#252525!important}div.coer-select-box .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-select-box .background-black{background-color:#252525!important}div.coer-select-box .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-select-box .border-black{border-color:#252525!important}div.coer-select-box .text-orange{color:#fd6031!important}div.coer-select-box .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-select-box .background-orange{background-color:#fd6031!important}div.coer-select-box .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-select-box .border-orange{border-color:#fd6031!important}div.coer-select-box mat-form-field{position:relative!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:40px!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{width:100%!important;height:40px!important;padding:0!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label{overflow:visible!important;position:absolute!important;top:20px!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label.mdc-floating-label--float-above mat-label{color:#fd6031;font-weight:700;position:relative;left:-10px;top:2px}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{font-weight:400!important;font-size:17px!important;color:#252525!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active,div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:before,div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:after{border-bottom-color:#fd6031!important}div.coer-select-box mat-form-field div.mat-mdc-form-field-subscript-wrapper.mat-mdc-form-field-bottom-align{height:0px!important}div.coer-select-box mat-form-field span.icon-container{position:absolute!important;top:1px!important;right:-14px!important;z-index:5!important;height:40px;display:flex;align-items:center;justify-content:center;gap:5px}div.coer-select-box mat-form-field span.icon-container i{font-size:20px!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-xmark,div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass{color:#caced1!important;cursor:pointer!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-xmark:hover,div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass:hover{color:#6c757d!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-circle-check{color:#198754!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-circle-exclamation{color:#dc3545!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-xmark{font-size:22px!important;padding:2px!important}div.coer-select-box mat-form-field span.placeholder{width:calc(100% + 32px)!important;height:40px!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-select-box mat-form-field .placeholder,div.coer-select-box mat-form-field .placeholder *,div.coer-select-box mat-form-field .placeholder-glow,div.coer-select-box mat-form-field .placeholder-glow *{cursor:wait!important}div.coer-select-box .btn-group{position:absolute!important;top:40px;left:0!important;width:100%!important}div.coer-select-box ul.dropdown-menu{background-color:#fff!important;border-top-left-radius:0!important;border-top-right-radius:0!important;max-height:205px!important;width:100%!important;overflow:auto!important;padding:0!important}div.coer-select-box .dropdown-divider{margin:0!important;background-color:#fff!important}div.coer-select-box ul.dropdown-menu li:not(.dropdown-item-focus):hover,div.coer-select-box ul.dropdown-menu li>div:not(.dropdown-item-focus):hover{color:#000!important;background-color:#f1f6ff!important}div.coer-select-box ul.dropdown-menu li:last-child hr.dropdown-divider,div.coer-select-box ul.dropdown-menu li:last-child hr.dropdown-divider:hover{width:0px!important;border:none!important}div.coer-select-box ul.dropdown-menu li div{display:flex!important;align-items:center!important;height:40px!important}div.coer-select-box div.dropdown-item-focus{background-color:#cde1ff}div.coer-select-box mat-form-field.readonly div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:#bbbbbb83!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:transparent!important;padding-left:9px!important;padding-right:9px!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple,coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:before,coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:after{border-bottom-color:transparent!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:28px!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{height:28px!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{margin-top:3px!important;font-size:14px!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field span.icon-container{transform:translate(-5px,-6px)!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box .btn-group{top:28px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }] }); }
|
1867
|
+
}
|
1868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerSelectbox, decorators: [{
|
1869
|
+
type: Component,
|
1870
|
+
args: [{ selector: 'coer-selectbox', providers: [CONTROL_VALUE(CoerSelectbox)], template: "<div class=\"coer-select-box\">\r\n <mat-form-field\r\n [id]=\"_id + '-container'\"\r\n [floatLabel]=\"floatLabel()\"\r\n [ngClass]=\"{\r\n 'readonly': isReadonly() && !isLoading()\r\n }\"\r\n [style]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'max-width': maxWidth(),\r\n 'margin-top': marginTop(),\r\n 'margin-right': marginRight(),\r\n 'margin-bottom': marginBottom(),\r\n 'margin-left': marginLeft()\r\n }\">\r\n <mat-label>{{ label() }}</mat-label>\r\n\r\n <input #coerTextBox matInput\r\n [id]=\"_id\"\r\n type=\"text\"\r\n [value]=\"_search()\"\r\n [placeholder]=\"_placeholder\"\r\n [disabled]=\"!_isEnable()\"\r\n (input)=\"Search(coerTextBox.value)\"\r\n (blur)=\"SetTouched(true)\"\r\n [style]=\"{\r\n 'cursor': isLoading() ? 'wait' : null,\r\n 'margin-top': (floatLabel() == 'auto') ? '15px' : '9px',\r\n 'padding-right': paddingRight\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <span ngClass=\"icon-container\" [style]=\"{ 'width': widthIcons }\">\r\n @if(_showCancel && _isEnable() && !isLoading()) {\r\n <i class=\"fa-solid fa-xmark text-secondary\" (click)=\"Unselect()\"></i>\r\n }\r\n\r\n @else if(isInvalid() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-exclamation\"></i>\r\n }\r\n\r\n @else if(isValid() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-check text-green\"></i>\r\n }\r\n\r\n @if(_isOpen() && _isEnable() && !isLoading()) {\r\n <i class=\"fa-solid fa-caret-up cursor-pointer text-orange\" (click)=\"Blur()\"></i>\r\n }\r\n\r\n @else if(_isEnable() && !isLoading()) {\r\n <i class=\"fa-solid fa-caret-down cursor-pointer text-secondary\"></i>\r\n }\r\n </span>\r\n </mat-form-field>\r\n\r\n <!-- Options Container -->\r\n <div class=\"btn-group\">\r\n <ul [id]=\"_id + '-dropdown-menu'\" class=\"dropdown-menu\">\r\n @for(item of _dataSource(); track GetIndexRow(item)) {\r\n <li (click)=\"SelectItem(item)\">\r\n <div [id]=\"id + '-dropdown-option-' + GetIndexRow(item)\"\r\n [ngClass]=\"{\r\n 'dropdown-item': true,\r\n 'cursor-pointer': true,\r\n 'dropdown-item-focus': _index() == GetIndexRow(item)\r\n }\"\r\n >{{ GetDisplay(item) }} </div>\r\n <hr class=\"dropdown-divider\">\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</div>\r\n\r\n", styles: ["div.coer-select-box{position:relative!important}div.coer-select-box .text-blue{color:#0d6efd!important}div.coer-select-box .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-select-box .background-blue{background-color:#0d6efd!important}div.coer-select-box .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-select-box .border-blue{border-color:#0d6efd!important}div.coer-select-box .text-gray{color:#6c757d!important}div.coer-select-box .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-select-box .background-gray{background-color:#6c757d!important}div.coer-select-box .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-select-box .border-gray{border-color:#6c757d!important}div.coer-select-box .text-green{color:#198754!important}div.coer-select-box .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-select-box .background-green{background-color:#198754!important}div.coer-select-box .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-select-box .border-green{border-color:#198754!important}div.coer-select-box .text-yellow{color:#ffc107!important}div.coer-select-box .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-select-box .background-yellow{background-color:#ffc107!important}div.coer-select-box .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-select-box .border-yellow{border-color:#ffc107!important}div.coer-select-box .text-red{color:#dc3545!important}div.coer-select-box .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-select-box .background-red{background-color:#dc3545!important}div.coer-select-box .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-select-box .border-red{border-color:#dc3545!important}div.coer-select-box .text-white{color:#f5f5f5!important}div.coer-select-box .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-select-box .background-white{background-color:#f5f5f5!important}div.coer-select-box .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-select-box .border-white{border-color:#f5f5f5!important}div.coer-select-box .text-black{color:#252525!important}div.coer-select-box .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-select-box .background-black{background-color:#252525!important}div.coer-select-box .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-select-box .border-black{border-color:#252525!important}div.coer-select-box .text-orange{color:#fd6031!important}div.coer-select-box .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-select-box .background-orange{background-color:#fd6031!important}div.coer-select-box .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-select-box .border-orange{border-color:#fd6031!important}div.coer-select-box mat-form-field{position:relative!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:40px!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{width:100%!important;height:40px!important;padding:0!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label{overflow:visible!important;position:absolute!important;top:20px!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label.mdc-floating-label--float-above mat-label{color:#fd6031;font-weight:700;position:relative;left:-10px;top:2px}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{font-weight:400!important;font-size:17px!important;color:#252525!important}div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active,div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:before,div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:after{border-bottom-color:#fd6031!important}div.coer-select-box mat-form-field div.mat-mdc-form-field-subscript-wrapper.mat-mdc-form-field-bottom-align{height:0px!important}div.coer-select-box mat-form-field span.icon-container{position:absolute!important;top:1px!important;right:-14px!important;z-index:5!important;height:40px;display:flex;align-items:center;justify-content:center;gap:5px}div.coer-select-box mat-form-field span.icon-container i{font-size:20px!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-xmark,div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass{color:#caced1!important;cursor:pointer!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-xmark:hover,div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass:hover{color:#6c757d!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-circle-check{color:#198754!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-circle-exclamation{color:#dc3545!important}div.coer-select-box mat-form-field span.icon-container i.fa-solid.fa-xmark{font-size:22px!important;padding:2px!important}div.coer-select-box mat-form-field span.placeholder{width:calc(100% + 32px)!important;height:40px!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-select-box mat-form-field .placeholder,div.coer-select-box mat-form-field .placeholder *,div.coer-select-box mat-form-field .placeholder-glow,div.coer-select-box mat-form-field .placeholder-glow *{cursor:wait!important}div.coer-select-box .btn-group{position:absolute!important;top:40px;left:0!important;width:100%!important}div.coer-select-box ul.dropdown-menu{background-color:#fff!important;border-top-left-radius:0!important;border-top-right-radius:0!important;max-height:205px!important;width:100%!important;overflow:auto!important;padding:0!important}div.coer-select-box .dropdown-divider{margin:0!important;background-color:#fff!important}div.coer-select-box ul.dropdown-menu li:not(.dropdown-item-focus):hover,div.coer-select-box ul.dropdown-menu li>div:not(.dropdown-item-focus):hover{color:#000!important;background-color:#f1f6ff!important}div.coer-select-box ul.dropdown-menu li:last-child hr.dropdown-divider,div.coer-select-box ul.dropdown-menu li:last-child hr.dropdown-divider:hover{width:0px!important;border:none!important}div.coer-select-box ul.dropdown-menu li div{display:flex!important;align-items:center!important;height:40px!important}div.coer-select-box div.dropdown-item-focus{background-color:#cde1ff}div.coer-select-box mat-form-field.readonly div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:#bbbbbb83!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:transparent!important;padding-left:9px!important;padding-right:9px!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple,coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:before,coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:after{border-bottom-color:transparent!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:28px!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{height:28px!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{margin-top:3px!important;font-size:14px!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box mat-form-field span.icon-container{transform:translate(-5px,-6px)!important}coer-grid table tbody tr td.coer-selectbox div.coer-select-box .btn-group{top:28px!important}\n"] }]
|
1871
|
+
}], propDecorators: { value: [{
|
1872
|
+
type: Input
|
1873
|
+
}], id: [{
|
1874
|
+
type: Input
|
1875
|
+
}] } });
|
1876
|
+
|
1877
|
+
class CoerTextBox extends ControlValue {
|
1878
|
+
constructor() {
|
1879
|
+
super(...arguments);
|
1880
|
+
//Component Value
|
1881
|
+
this._value = '';
|
1882
|
+
this.matFormField = viewChild.required('matFormField');
|
1883
|
+
this.coerTextBox = viewChild.required('coerTextBox');
|
1884
|
+
//Variables
|
1885
|
+
this._id = Tools.GetGuid('coer-textBox');
|
1886
|
+
this._isLoadingEvent = signal(false);
|
1887
|
+
this.id = '';
|
1888
|
+
this.label = input('');
|
1889
|
+
this.placeholder = input('');
|
1890
|
+
this.minLength = input(0);
|
1891
|
+
this.maxLength = input(50);
|
1892
|
+
this.showSearchIcon = input(false);
|
1893
|
+
this.showClearIcon = input(false);
|
1894
|
+
this.width = input('100%');
|
1895
|
+
this.minWidth = input('190px');
|
1896
|
+
this.maxWidth = input('100%');
|
1897
|
+
this.marginTop = input('0px');
|
1898
|
+
this.marginRight = input('0px');
|
1899
|
+
this.marginBottom = input('0px');
|
1900
|
+
this.marginLeft = input('0px');
|
1901
|
+
this.isInvalid = input(false);
|
1902
|
+
this.isValid = input(false);
|
1903
|
+
this.isDisabled = input(false);
|
1904
|
+
this.isReadonly = input(false);
|
1905
|
+
this.isLoading = input(false);
|
1906
|
+
this.selectOnFocus = input(true);
|
1907
|
+
this.textPosition = input('left');
|
1908
|
+
//Outputs
|
1909
|
+
this.onKeyupEnter = output();
|
1910
|
+
this.onInput = output();
|
1911
|
+
this.onClickClear = output();
|
1912
|
+
//computed
|
1913
|
+
this._isEnable = computed(() => {
|
1914
|
+
return !this.isDisabled() && !this.isLoading() && !this.isReadonly();
|
1915
|
+
});
|
1916
|
+
//computed
|
1917
|
+
this.floatLabel = computed(() => {
|
1918
|
+
return this.label() == '' ? 'always' : 'auto';
|
1919
|
+
});
|
1920
|
+
//computed
|
1921
|
+
this.paddingRight = computed(() => {
|
1922
|
+
return this.isInvalid() || this.isValid()
|
1923
|
+
? '18px' : '0px';
|
1924
|
+
});
|
1925
|
+
}
|
1926
|
+
//Inputs
|
1927
|
+
set value(value) {
|
1928
|
+
if (Tools.IsNull(value))
|
1929
|
+
value = '';
|
1930
|
+
this.SetValue(value);
|
1931
|
+
}
|
1932
|
+
ngOnInit() {
|
1933
|
+
this.SetEvents();
|
1934
|
+
}
|
1935
|
+
//getter
|
1936
|
+
get _showSearchIcon() {
|
1937
|
+
return this.showSearchIcon()
|
1938
|
+
&& !this._showClearIcon
|
1939
|
+
&& !this.isDisabled()
|
1940
|
+
&& !this.isLoading();
|
1941
|
+
}
|
1942
|
+
//getter
|
1943
|
+
get _showClearIcon() {
|
1944
|
+
return this.showClearIcon()
|
1945
|
+
&& !this.isDisabled()
|
1946
|
+
&& !this.isLoading()
|
1947
|
+
&& this._value != undefined
|
1948
|
+
&& String(this._value).length > 0;
|
1949
|
+
}
|
1950
|
+
//getter
|
1951
|
+
get value() {
|
1952
|
+
return this._value;
|
1953
|
+
}
|
1954
|
+
/** */
|
1955
|
+
SetEvents() {
|
1956
|
+
Tools.Sleep().then(() => {
|
1957
|
+
this.element = document.getElementById(this._id);
|
1958
|
+
if (this.element) {
|
1959
|
+
this.element.addEventListener('focus', () => {
|
1960
|
+
if (!this._isEnable())
|
1961
|
+
this.Blur();
|
1962
|
+
else if (this.selectOnFocus())
|
1963
|
+
this.Select();
|
1964
|
+
});
|
1965
|
+
this.element.addEventListener('keyup', (event) => {
|
1966
|
+
if (this._isEnable()) {
|
1967
|
+
const { key } = event;
|
1968
|
+
if (key === 'Enter') {
|
1969
|
+
const value = this.coerTextBox().nativeElement.value;
|
1970
|
+
this.onKeyupEnter.emit(value);
|
1971
|
+
this.Blur();
|
1972
|
+
}
|
1973
|
+
}
|
1974
|
+
});
|
1975
|
+
this.element.addEventListener('blur', () => this.Blur());
|
1976
|
+
this.element.addEventListener('input', () => {
|
1977
|
+
Tools.Sleep().then(() => {
|
1978
|
+
const value = this.coerTextBox().nativeElement.value;
|
1979
|
+
if (this._isEnable())
|
1980
|
+
this.onInput.emit(value);
|
1981
|
+
});
|
1982
|
+
});
|
1983
|
+
this.element.addEventListener('paste', () => {
|
1984
|
+
Tools.Sleep().then(() => {
|
1985
|
+
this.SetValue(this._value.toString().trim());
|
1986
|
+
});
|
1987
|
+
});
|
1988
|
+
}
|
1989
|
+
});
|
1990
|
+
}
|
1991
|
+
/** */
|
1992
|
+
Focus(timeout = 0) {
|
1993
|
+
if (this._isLoadingEvent())
|
1994
|
+
return;
|
1995
|
+
else
|
1996
|
+
this._isLoadingEvent.set(true);
|
1997
|
+
Tools.Sleep(timeout).then(() => {
|
1998
|
+
if (this._isEnable()) {
|
1999
|
+
this.element.focus();
|
2000
|
+
}
|
2001
|
+
this._isLoadingEvent.set(false);
|
2002
|
+
});
|
2003
|
+
}
|
2004
|
+
/** */
|
2005
|
+
Select(timeout = 0) {
|
2006
|
+
if (this._isLoadingEvent())
|
2007
|
+
return;
|
2008
|
+
else
|
2009
|
+
this._isLoadingEvent.set(true);
|
2010
|
+
Tools.Sleep(timeout).then(() => {
|
2011
|
+
if (this._isEnable()) {
|
2012
|
+
this.element.focus();
|
2013
|
+
this.element.select();
|
2014
|
+
}
|
2015
|
+
this._isLoadingEvent.set(false);
|
250
2016
|
});
|
251
|
-
}
|
252
|
-
/**
|
253
|
-
|
254
|
-
if (
|
255
|
-
return
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
if (Tools.IsNull(text))
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
2017
|
+
}
|
2018
|
+
/** */
|
2019
|
+
Blur() {
|
2020
|
+
if (this._isLoadingEvent())
|
2021
|
+
return;
|
2022
|
+
else
|
2023
|
+
this._isLoadingEvent.set(true);
|
2024
|
+
Tools.Sleep().then(() => {
|
2025
|
+
if (this.element) {
|
2026
|
+
this.element.blur();
|
2027
|
+
Tools.Sleep().then(() => {
|
2028
|
+
const element = document.querySelector(`#${this._id}-container .mdc-line-ripple--active`);
|
2029
|
+
if (element)
|
2030
|
+
element.classList.remove('mdc-line-ripple--active');
|
2031
|
+
});
|
2032
|
+
}
|
2033
|
+
this._isLoadingEvent.set(false);
|
2034
|
+
});
|
2035
|
+
}
|
2036
|
+
/** */
|
2037
|
+
Clear() {
|
2038
|
+
this.SetValue('');
|
2039
|
+
this.Focus();
|
2040
|
+
}
|
2041
|
+
/** */
|
2042
|
+
ClickSearch() {
|
2043
|
+
Tools.Sleep().then(() => {
|
2044
|
+
if (this._isEnable()) {
|
2045
|
+
if (this.showClearIcon())
|
2046
|
+
this.Focus();
|
2047
|
+
else {
|
2048
|
+
this.onKeyupEnter.emit(this._value);
|
2049
|
+
this.Blur();
|
2050
|
+
}
|
2051
|
+
}
|
2052
|
+
});
|
2053
|
+
}
|
2054
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTextBox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
2055
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerTextBox, selector: "coer-textbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, showSearchIcon: { classPropertyName: "showSearchIcon", publicName: "showSearchIcon", isSignal: true, isRequired: false, transformFunction: null }, showClearIcon: { classPropertyName: "showClearIcon", publicName: "showClearIcon", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, marginTop: { classPropertyName: "marginTop", publicName: "marginTop", isSignal: true, isRequired: false, transformFunction: null }, marginRight: { classPropertyName: "marginRight", publicName: "marginRight", isSignal: true, isRequired: false, transformFunction: null }, marginBottom: { classPropertyName: "marginBottom", publicName: "marginBottom", isSignal: true, isRequired: false, transformFunction: null }, marginLeft: { classPropertyName: "marginLeft", publicName: "marginLeft", isSignal: true, isRequired: false, transformFunction: null }, isInvalid: { classPropertyName: "isInvalid", publicName: "isInvalid", isSignal: true, isRequired: false, transformFunction: null }, isValid: { classPropertyName: "isValid", publicName: "isValid", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, textPosition: { classPropertyName: "textPosition", publicName: "textPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onKeyupEnter: "onKeyupEnter", onInput: "onInput", onClickClear: "onClickClear" }, providers: [CONTROL_VALUE(CoerTextBox)], viewQueries: [{ propertyName: "matFormField", first: true, predicate: ["matFormField"], descendants: true, isSignal: true }, { propertyName: "coerTextBox", first: true, predicate: ["coerTextBox"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"coer-text-box\">\r\n <mat-form-field\r\n [id]=\"_id + '-container'\"\r\n [floatLabel]=\"floatLabel()\"\r\n [ngClass]=\"{\r\n 'readonly': isReadonly() && !isLoading()\r\n }\"\r\n [style]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'max-width': maxWidth(),\r\n 'margin-top': marginTop(),\r\n 'margin-right': marginRight(),\r\n 'margin-bottom': marginBottom(),\r\n 'margin-left': marginLeft()\r\n }\">\r\n <mat-label>{{ label() }}</mat-label>\r\n\r\n <input #coerTextBox matInput\r\n [id]=\"_id\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder()\"\r\n [minLength]=\"minLength()\"\r\n [maxLength]=\"maxLength()\"\r\n [disabled]=\"!_isEnable()\"\r\n [value]=\"_value\"\r\n (input)=\"SetValue(coerTextBox.value)\"\r\n (blur)=\"SetTouched(true)\"\r\n [style]=\"{\r\n 'cursor': isLoading() ? 'wait' : null,\r\n 'margin-top': (floatLabel() == 'auto') ? '15px' : '9px',\r\n 'padding-right': paddingRight(),\r\n 'text-align': textPosition()\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <span ngClass=\"icon-container\">\r\n @if(_showSearchIcon) {\r\n <i class=\"fa-solid fa-magnifying-glass cursor-pointer\" (click)=\"ClickSearch()\"></i>\r\n }\r\n\r\n @else if(_showClearIcon) {\r\n <i class=\"fa-solid fa-xmark cursor-pointer\" (click)=\"Clear(); this.onClickClear.emit();\"></i>\r\n }\r\n\r\n @else if(isInvalid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-exclamation\"></i>\r\n }\r\n\r\n @else if(isValid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-check text-green\"></i>\r\n }\r\n </span>\r\n </mat-form-field> \r\n</div>", styles: ["div.coer-text-box .text-blue{color:#0d6efd!important}div.coer-text-box .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-text-box .background-blue{background-color:#0d6efd!important}div.coer-text-box .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-text-box .border-blue{border-color:#0d6efd!important}div.coer-text-box .text-gray{color:#6c757d!important}div.coer-text-box .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-text-box .background-gray{background-color:#6c757d!important}div.coer-text-box .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-text-box .border-gray{border-color:#6c757d!important}div.coer-text-box .text-green{color:#198754!important}div.coer-text-box .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-text-box .background-green{background-color:#198754!important}div.coer-text-box .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-text-box .border-green{border-color:#198754!important}div.coer-text-box .text-yellow{color:#ffc107!important}div.coer-text-box .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-text-box .background-yellow{background-color:#ffc107!important}div.coer-text-box .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-text-box .border-yellow{border-color:#ffc107!important}div.coer-text-box .text-red{color:#dc3545!important}div.coer-text-box .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-text-box .background-red{background-color:#dc3545!important}div.coer-text-box .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-text-box .border-red{border-color:#dc3545!important}div.coer-text-box .text-white{color:#f5f5f5!important}div.coer-text-box .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-text-box .background-white{background-color:#f5f5f5!important}div.coer-text-box .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-text-box .border-white{border-color:#f5f5f5!important}div.coer-text-box .text-black{color:#252525!important}div.coer-text-box .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-text-box .background-black{background-color:#252525!important}div.coer-text-box .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-text-box .border-black{border-color:#252525!important}div.coer-text-box .text-orange{color:#fd6031!important}div.coer-text-box .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-text-box .background-orange{background-color:#fd6031!important}div.coer-text-box .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-text-box .border-orange{border-color:#fd6031!important}div.coer-text-box mat-form-field{position:relative!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:40px!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{width:100%!important;height:40px!important;padding:0!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label{overflow:visible!important;position:absolute!important;top:20px!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label.mdc-floating-label--float-above mat-label{color:#fd6031;font-weight:700;position:relative;left:-10px;top:2px}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{font-weight:400!important;font-size:17px!important;color:#252525!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active,div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:before,div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:after{border-bottom-color:#fd6031!important}div.coer-text-box mat-form-field div.mat-mdc-form-field-subscript-wrapper.mat-mdc-form-field-bottom-align{height:0px!important}div.coer-text-box mat-form-field span.icon-container{position:absolute!important;top:1px!important;right:-14px!important;z-index:5!important;width:30px;height:40px;display:flex;align-items:center;justify-content:center}div.coer-text-box mat-form-field span.icon-container i{font-size:20px!important}div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-xmark,div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass{color:#caced1!important;cursor:pointer!important}div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-xmark:hover,div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass:hover{color:#6c757d!important}div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-circle-check{color:#198754!important}div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-circle-exclamation{color:#dc3545!important}div.coer-text-box mat-form-field span.placeholder{width:calc(100% + 32px)!important;height:40px!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-text-box mat-form-field .placeholder,div.coer-text-box mat-form-field .placeholder *,div.coer-text-box mat-form-field .placeholder-glow,div.coer-text-box mat-form-field .placeholder-glow *{cursor:wait!important}div.coer-text-box mat-form-field.readonly div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:#bbbbbb83!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:transparent!important;padding-left:9px!important;padding-right:9px!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple,coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:before,coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:after{border-bottom-color:transparent!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:28px!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{height:28px!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{margin-top:3px!important;font-size:14px!important}coer-grid table tbody tr td.coer-textbox mat-form-field span.icon-container{transform:translate(-5px,-6px)!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }] }); }
|
2056
|
+
}
|
2057
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTextBox, decorators: [{
|
2058
|
+
type: Component,
|
2059
|
+
args: [{ selector: 'coer-textbox', providers: [CONTROL_VALUE(CoerTextBox)], template: "<div class=\"coer-text-box\">\r\n <mat-form-field\r\n [id]=\"_id + '-container'\"\r\n [floatLabel]=\"floatLabel()\"\r\n [ngClass]=\"{\r\n 'readonly': isReadonly() && !isLoading()\r\n }\"\r\n [style]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'max-width': maxWidth(),\r\n 'margin-top': marginTop(),\r\n 'margin-right': marginRight(),\r\n 'margin-bottom': marginBottom(),\r\n 'margin-left': marginLeft()\r\n }\">\r\n <mat-label>{{ label() }}</mat-label>\r\n\r\n <input #coerTextBox matInput\r\n [id]=\"_id\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder()\"\r\n [minLength]=\"minLength()\"\r\n [maxLength]=\"maxLength()\"\r\n [disabled]=\"!_isEnable()\"\r\n [value]=\"_value\"\r\n (input)=\"SetValue(coerTextBox.value)\"\r\n (blur)=\"SetTouched(true)\"\r\n [style]=\"{\r\n 'cursor': isLoading() ? 'wait' : null,\r\n 'margin-top': (floatLabel() == 'auto') ? '15px' : '9px',\r\n 'padding-right': paddingRight(),\r\n 'text-align': textPosition()\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <span ngClass=\"icon-container\">\r\n @if(_showSearchIcon) {\r\n <i class=\"fa-solid fa-magnifying-glass cursor-pointer\" (click)=\"ClickSearch()\"></i>\r\n }\r\n\r\n @else if(_showClearIcon) {\r\n <i class=\"fa-solid fa-xmark cursor-pointer\" (click)=\"Clear(); this.onClickClear.emit();\"></i>\r\n }\r\n\r\n @else if(isInvalid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-exclamation\"></i>\r\n }\r\n\r\n @else if(isValid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-check text-green\"></i>\r\n }\r\n </span>\r\n </mat-form-field> \r\n</div>", styles: ["div.coer-text-box .text-blue{color:#0d6efd!important}div.coer-text-box .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-text-box .background-blue{background-color:#0d6efd!important}div.coer-text-box .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-text-box .border-blue{border-color:#0d6efd!important}div.coer-text-box .text-gray{color:#6c757d!important}div.coer-text-box .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-text-box .background-gray{background-color:#6c757d!important}div.coer-text-box .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-text-box .border-gray{border-color:#6c757d!important}div.coer-text-box .text-green{color:#198754!important}div.coer-text-box .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-text-box .background-green{background-color:#198754!important}div.coer-text-box .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-text-box .border-green{border-color:#198754!important}div.coer-text-box .text-yellow{color:#ffc107!important}div.coer-text-box .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-text-box .background-yellow{background-color:#ffc107!important}div.coer-text-box .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-text-box .border-yellow{border-color:#ffc107!important}div.coer-text-box .text-red{color:#dc3545!important}div.coer-text-box .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-text-box .background-red{background-color:#dc3545!important}div.coer-text-box .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-text-box .border-red{border-color:#dc3545!important}div.coer-text-box .text-white{color:#f5f5f5!important}div.coer-text-box .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-text-box .background-white{background-color:#f5f5f5!important}div.coer-text-box .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-text-box .border-white{border-color:#f5f5f5!important}div.coer-text-box .text-black{color:#252525!important}div.coer-text-box .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-text-box .background-black{background-color:#252525!important}div.coer-text-box .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-text-box .border-black{border-color:#252525!important}div.coer-text-box .text-orange{color:#fd6031!important}div.coer-text-box .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-text-box .background-orange{background-color:#fd6031!important}div.coer-text-box .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-text-box .border-orange{border-color:#fd6031!important}div.coer-text-box mat-form-field{position:relative!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:40px!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{width:100%!important;height:40px!important;padding:0!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label{overflow:visible!important;position:absolute!important;top:20px!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label.mdc-floating-label--float-above mat-label{color:#fd6031;font-weight:700;position:relative;left:-10px;top:2px}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{font-weight:400!important;font-size:17px!important;color:#252525!important}div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active,div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:before,div.coer-text-box mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:after{border-bottom-color:#fd6031!important}div.coer-text-box mat-form-field div.mat-mdc-form-field-subscript-wrapper.mat-mdc-form-field-bottom-align{height:0px!important}div.coer-text-box mat-form-field span.icon-container{position:absolute!important;top:1px!important;right:-14px!important;z-index:5!important;width:30px;height:40px;display:flex;align-items:center;justify-content:center}div.coer-text-box mat-form-field span.icon-container i{font-size:20px!important}div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-xmark,div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass{color:#caced1!important;cursor:pointer!important}div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-xmark:hover,div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass:hover{color:#6c757d!important}div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-circle-check{color:#198754!important}div.coer-text-box mat-form-field span.icon-container i.fa-solid.fa-circle-exclamation{color:#dc3545!important}div.coer-text-box mat-form-field span.placeholder{width:calc(100% + 32px)!important;height:40px!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-text-box mat-form-field .placeholder,div.coer-text-box mat-form-field .placeholder *,div.coer-text-box mat-form-field .placeholder-glow,div.coer-text-box mat-form-field .placeholder-glow *{cursor:wait!important}div.coer-text-box mat-form-field.readonly div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:#bbbbbb83!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:transparent!important;padding-left:9px!important;padding-right:9px!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple,coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:before,coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple:after{border-bottom-color:transparent!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex{height:28px!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{height:28px!important}coer-grid table tbody tr td.coer-textbox mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix input{margin-top:3px!important;font-size:14px!important}coer-grid table tbody tr td.coer-textbox mat-form-field span.icon-container{transform:translate(-5px,-6px)!important}\n"] }]
|
2060
|
+
}], propDecorators: { value: [{
|
2061
|
+
type: Input
|
2062
|
+
}], id: [{
|
2063
|
+
type: Input
|
2064
|
+
}] } });
|
2065
|
+
|
2066
|
+
class DateTime {
|
2067
|
+
/** Get UTC Offset */
|
2068
|
+
static GetOffset() {
|
2069
|
+
return moment().utcOffset();
|
2070
|
+
}
|
2071
|
+
/** YYYY-MM-DD HH:mm:ss */
|
2072
|
+
static GetFormatDB(date) {
|
2073
|
+
if ((typeof date === 'string'))
|
2074
|
+
date = date.replaceAll('/', '-');
|
2075
|
+
return moment(date).format('YYYY-MM-DD HH:mm:ss');
|
2076
|
+
}
|
2077
|
+
/** Convert UTC Date to Local Zone */
|
2078
|
+
static ToLocalZone(date) {
|
2079
|
+
date = DateTime.GetFormatDB(date);
|
2080
|
+
return moment(date).add(DateTime.GetOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
|
2081
|
+
}
|
2082
|
+
/** Convert Local Zone Date to UTC */
|
2083
|
+
static ToUTC(date) {
|
2084
|
+
date = DateTime.GetFormatDB(date);
|
2085
|
+
return moment(date).subtract(DateTime.GetOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
|
2086
|
+
}
|
2087
|
+
/** DD MMM YYYY */
|
2088
|
+
static GetDateFormat(date) {
|
2089
|
+
date = DateTime.GetFormatDB(date);
|
2090
|
+
return moment(date).parseZone().local(true).format('DD MMM YYYY');
|
2091
|
+
}
|
2092
|
+
}
|
2093
|
+
|
2094
|
+
class CoerGridExtension extends ControlValue {
|
2095
|
+
constructor() {
|
2096
|
+
super(...arguments);
|
2097
|
+
//Injections
|
2098
|
+
this.alert = inject(CoerAlert);
|
2099
|
+
//Elements
|
2100
|
+
this.inputFile = viewChild.required('inputFileRef');
|
2101
|
+
this.inputSearch = viewChild.required('inputSearch');
|
2102
|
+
this.coerTextboxList = viewChildren(CoerTextBox);
|
2103
|
+
this.coerNumberboxList = viewChildren(CoerNumberBox);
|
2104
|
+
this.coerSelectboxList = viewChildren(CoerSelectbox);
|
2105
|
+
this.coerCheckboxList = viewChildren(CoerCheckbox);
|
2106
|
+
//Variables
|
2107
|
+
this._value = [];
|
2108
|
+
this.value_signal = signal([]);
|
2109
|
+
this._gridSearch = signal('');
|
2110
|
+
this._isLoading = true;
|
2111
|
+
this._isLoadingMessage = true;
|
2112
|
+
this._id = Tools.GetGuid('coer-grid');
|
2113
|
+
this._expandedGroups = [];
|
2114
|
+
this._enableAnimations = false;
|
2115
|
+
this._indexFocus = signal(0);
|
2116
|
+
this._sort = signal({ columnName: '', direction: 'none', icon: '' });
|
2117
|
+
//Generic Tools
|
2118
|
+
this.GetNumericFormat = Tools.GetNumericFormat;
|
2119
|
+
this.GetDateFormat = DateTime.GetDateFormat;
|
2120
|
+
//Inputs
|
2121
|
+
this.columns = input([]);
|
2122
|
+
this.cleanColumnName = input(true);
|
2123
|
+
this.addButton = { show: false };
|
2124
|
+
this.exportButton = { show: false };
|
2125
|
+
this.importButton = { show: false };
|
2126
|
+
this.search = { show: false, ignore: false };
|
2127
|
+
this.buttonByRow = {};
|
2128
|
+
this.checkbox = { show: false };
|
2129
|
+
this.tooltipByRow = input('');
|
2130
|
+
this.isLoading = input(false);
|
2131
|
+
this.isDisabled = input(false);
|
2132
|
+
this.rowsByPage = input(50);
|
2133
|
+
this.groupBy = input('');
|
2134
|
+
this.showColumnGrouped = input(false);
|
2135
|
+
this.rowsByGroup = input(50);
|
2136
|
+
this.isInvisible = input(false);
|
2137
|
+
this.showFooter = input(true);
|
2138
|
+
this.width = input('100%');
|
2139
|
+
this.MinWidth = input('250px');
|
2140
|
+
this.MaxWidth = input('100%');
|
2141
|
+
this.height = input('350px');
|
2142
|
+
this.minHeight = input('140px');
|
2143
|
+
this.maxHeight = input('100vh');
|
2144
|
+
this.margin = input('auto');
|
2145
|
+
this.enableSort = input(true);
|
2146
|
+
this.enableRowFocus = input(true);
|
2147
|
+
//Outputs
|
2148
|
+
this.onClickAdd = output();
|
2149
|
+
this.onClickImport = output();
|
2150
|
+
this.onClickExport = output();
|
2151
|
+
this.onClickRow = output();
|
2152
|
+
this.onDoubleClickRow = output();
|
2153
|
+
this.onClickDeleteRow = output();
|
2154
|
+
this.onClickEditRow = output();
|
2155
|
+
this.onClickGoRow = output();
|
2156
|
+
this.onKeyupEnter = output();
|
2157
|
+
this.onKeyupEnterLast = output();
|
2158
|
+
this.onSwitchChange = output();
|
2159
|
+
this.onTextboxChange = output();
|
2160
|
+
this.onSelectboxChange = output();
|
2161
|
+
this.onCheckboxChange = output();
|
2162
|
+
//computed
|
2163
|
+
this._isDisabled = computed(() => {
|
2164
|
+
return this.isDisabled() || this.isLoading() || this.isInvisible();
|
2165
|
+
});
|
2166
|
+
//computed
|
2167
|
+
this._isGrouped = computed(() => {
|
2168
|
+
return this.groupBy().length > 0;
|
2169
|
+
});
|
2170
|
+
//computed
|
2171
|
+
this.gridColumns = computed(() => {
|
2172
|
+
const SET_COLUMNS = new Set();
|
2173
|
+
//Has filter columns?
|
2174
|
+
if (this.columns().length > 0) {
|
2175
|
+
for (const { property } of this.columns()) {
|
2176
|
+
SET_COLUMNS.add(property);
|
2177
|
+
}
|
2178
|
+
}
|
2179
|
+
//Get all columns
|
2180
|
+
else
|
2181
|
+
for (const row of this.value_signal()) {
|
2182
|
+
for (const property in row) {
|
2183
|
+
SET_COLUMNS.add(property);
|
2184
|
+
}
|
2185
|
+
}
|
2186
|
+
//Remove indexRow column
|
2187
|
+
if (SET_COLUMNS.has('indexRow')) {
|
2188
|
+
SET_COLUMNS.delete('indexRow');
|
2189
|
+
}
|
2190
|
+
//Remove groupBy column
|
2191
|
+
if (this._isGrouped() && !this.showColumnGrouped() && SET_COLUMNS.has(this.groupBy())) {
|
2192
|
+
SET_COLUMNS.delete(this.groupBy());
|
2193
|
+
}
|
2194
|
+
//Set index column
|
2195
|
+
let indexColumn = 0;
|
2196
|
+
return Array.from(SET_COLUMNS).map(property => Tools.BreakReference({
|
2197
|
+
columnName: property,
|
2198
|
+
indexColumn: indexColumn++,
|
2199
|
+
width: this._GetColumnConfig(property)?.width || 'auto'
|
2200
|
+
}));
|
2201
|
+
});
|
2202
|
+
//computed
|
2203
|
+
this.gridDataSource = computed(() => {
|
2204
|
+
let list = this.gridDataSourceFiltered();
|
2205
|
+
//It's Grouped?
|
2206
|
+
if (this._isGrouped()) {
|
2207
|
+
//let indexRow = 0;
|
2208
|
+
let indexGroup = 0;
|
2209
|
+
const SET_COLUMN = new Set();
|
2210
|
+
for (const row of list) {
|
2211
|
+
SET_COLUMN.add(row[this.groupBy()]);
|
2212
|
+
}
|
2213
|
+
const DATA_SOURCE_GROPUED = [];
|
2214
|
+
for (const column of SET_COLUMN) {
|
2215
|
+
DATA_SOURCE_GROPUED.push({
|
2216
|
+
groupBy: column,
|
2217
|
+
indexGroup: indexGroup++,
|
2218
|
+
length: list.filter((item) => item[this.groupBy()] == column).length,
|
2219
|
+
rows: [...list]
|
2220
|
+
.filter((item) => item[this.groupBy()] == column)
|
2221
|
+
.splice(0, this.rowsByGroup())
|
2222
|
+
//.map((item: any) => Object.assign({ indexRow: indexRow++ }, item))
|
2223
|
+
});
|
2224
|
+
}
|
2225
|
+
//Response by group
|
2226
|
+
return [...DATA_SOURCE_GROPUED].splice(0, this.rowsByPage());
|
2227
|
+
}
|
2228
|
+
//Response
|
2229
|
+
return [{
|
2230
|
+
groupBy: 'Not Grouped',
|
2231
|
+
indexGroup: -1,
|
2232
|
+
length: -1,
|
2233
|
+
rows: [...list].splice(0, this.rowsByPage())
|
2234
|
+
}];
|
2235
|
+
});
|
2236
|
+
//computed
|
2237
|
+
this.gridDataSourceFiltered = computed(() => {
|
2238
|
+
let list = [];
|
2239
|
+
const dataSource = Tools.BreakReference(this.value_signal());
|
2240
|
+
//Ignore Filter
|
2241
|
+
if (this._gridSearch() == '' || this.search?.ignore) {
|
2242
|
+
list = dataSource;
|
2243
|
+
}
|
2244
|
+
//Filter by search
|
2245
|
+
else {
|
2246
|
+
const SET_ROW = new Set();
|
2247
|
+
let listFiltered = [];
|
2248
|
+
for (const { columnName } of this.gridColumns()) {
|
2249
|
+
listFiltered = dataSource.filter((item) => !SET_ROW.has(item['indexRow'])
|
2250
|
+
&& String(item[Tools.FirstCharToLower(columnName)]).trim().toUpperCase().includes(String(this._gridSearch()).trim().toUpperCase()));
|
2251
|
+
for (const { indexRow } of listFiltered) {
|
2252
|
+
SET_ROW.add(indexRow);
|
2253
|
+
}
|
2254
|
+
list = Tools.BreakReference(list.concat(listFiltered));
|
2255
|
+
}
|
2256
|
+
}
|
2257
|
+
return Tools.BreakReference(list);
|
2258
|
+
});
|
2259
|
+
/** Get Column Configuration */
|
2260
|
+
this._GetColumnConfig = (columnName) => {
|
2261
|
+
return this.columns().find(x => x.property.replaceAll(' ', '').toUpperCase() == columnName.replaceAll(' ', '').toUpperCase());
|
2262
|
+
};
|
2263
|
+
/** Clean Name or get alias */
|
2264
|
+
this._GetColumnName = (columnName) => {
|
2265
|
+
const columnConfig = this._GetColumnConfig(columnName);
|
2266
|
+
//Get Alias
|
2267
|
+
if (columnConfig && columnConfig.alias && columnConfig.alias.length > 0) {
|
2268
|
+
return columnConfig.alias;
|
2269
|
+
}
|
2270
|
+
//Clean headerName
|
2271
|
+
if (this.cleanColumnName() && columnName.length > 0) {
|
2272
|
+
columnName = Tools.FirstCharToLower(columnName);
|
2273
|
+
const charArray = [];
|
2274
|
+
for (const char of columnName) {
|
2275
|
+
if (char === char.toUpperCase())
|
2276
|
+
charArray.push(' ');
|
2277
|
+
charArray.push(char);
|
2278
|
+
}
|
2279
|
+
charArray[0] = charArray[0].toUpperCase();
|
2280
|
+
columnName = charArray.join('');
|
2281
|
+
}
|
2282
|
+
return columnName.trim();
|
2283
|
+
};
|
2284
|
+
/** */
|
2285
|
+
this._GetShortIcon = (columnName) => {
|
2286
|
+
return this._sort().columnName == columnName ? this._sort().icon : '';
|
2287
|
+
};
|
2288
|
+
/** */
|
2289
|
+
this._GetId = (indexRow, indexColumn, suffix = '') => {
|
2290
|
+
if (suffix.length > 0)
|
2291
|
+
suffix = `-${suffix}`;
|
2292
|
+
return `${this._id}-row${indexRow}column${indexColumn}${suffix}`;
|
2293
|
+
};
|
2294
|
+
/** */
|
2295
|
+
this._GetCellValue = (row, columnName) => {
|
2296
|
+
return row[Tools.FirstCharToLower(columnName).replaceAll(' ', '')];
|
2297
|
+
};
|
2298
|
+
/** */
|
2299
|
+
this._GetTooltip = (prefix, row, suffix = '') => {
|
2300
|
+
let column = Tools.FirstCharToLower(this.tooltipByRow()).replaceAll(' ', '');
|
2301
|
+
if (suffix.length > 0) {
|
2302
|
+
suffix = ` ${suffix}`;
|
2303
|
+
}
|
2304
|
+
return this.tooltipByRow().length > 0
|
2305
|
+
? `${prefix} ${row[column]}${suffix}`
|
2306
|
+
: `${prefix}${suffix}`;
|
2307
|
+
};
|
2308
|
+
/** */
|
2309
|
+
this._HideRow = (group) => {
|
2310
|
+
return (this._isGrouped() ? !(this._expandedGroups.some(x => x == group.groupBy)) : false);
|
2311
|
+
};
|
2312
|
+
}
|
2313
|
+
//getter
|
2314
|
+
get _height() {
|
2315
|
+
let height = this.height();
|
2316
|
+
if (height == 'full') {
|
2317
|
+
const TOOLBAR = 45;
|
2318
|
+
const PAGE_HEADER = 70;
|
2319
|
+
const GRID_HEADER = document.getElementById(`${this._id}-header`);
|
2320
|
+
const HEADER = (GRID_HEADER && GRID_HEADER.children.length > 0) ? 50 : 0;
|
2321
|
+
const MARGIN = 30;
|
2322
|
+
const PADDING = 20;
|
2323
|
+
const FOOTER = this.showFooter() ? 24.5 : 0;
|
2324
|
+
height = (Screen.WINDOW_HEIGHT - TOOLBAR - PAGE_HEADER - MARGIN - HEADER - PADDING - FOOTER) + 'px';
|
311
2325
|
}
|
312
|
-
return
|
313
|
-
}
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
2326
|
+
return height;
|
2327
|
+
}
|
2328
|
+
//getter
|
2329
|
+
get _onlyOneCheck() {
|
2330
|
+
return Tools.IsNotNull(this.checkbox.onlyOneCheck) && this.checkbox.onlyOneCheck;
|
2331
|
+
}
|
2332
|
+
ngAfterViewInit() {
|
2333
|
+
Tools.Sleep().then(() => {
|
2334
|
+
this._enableAnimations = true;
|
2335
|
+
this._isLoading = false;
|
2336
|
+
this._isLoadingMessage = false;
|
2337
|
+
});
|
2338
|
+
}
|
2339
|
+
//ControlValueAccessor
|
2340
|
+
SetValue(value) {
|
2341
|
+
let indexRow = 0;
|
2342
|
+
if (!Tools.IsNotNull(value))
|
2343
|
+
value = [];
|
2344
|
+
const dataSource = Tools.BreakReference(value).map((item) => Object.assign({ checked: false }, { ...item }, { indexRow: indexRow++ }));
|
2345
|
+
this._UpdateValue(dataSource);
|
2346
|
+
this._value = dataSource;
|
2347
|
+
this.value_signal.set(dataSource);
|
2348
|
+
}
|
2349
|
+
//ControlValueAccessor
|
2350
|
+
writeValue(value) {
|
2351
|
+
let indexRow = 0;
|
2352
|
+
if (!Tools.IsNotNull(value))
|
2353
|
+
value = [];
|
2354
|
+
const dataSource = Tools.BreakReference(value).map((item) => Object.assign({ checked: false }, { ...item }, { indexRow: indexRow++ }));
|
2355
|
+
this._value = dataSource;
|
2356
|
+
this.value_signal.set(dataSource);
|
2357
|
+
}
|
2358
|
+
/** */
|
2359
|
+
_IsCellType(property, data, type) {
|
2360
|
+
let response = false;
|
2361
|
+
const columnConfig = this._GetColumnConfig(property);
|
2362
|
+
const value = data[property];
|
2363
|
+
const row = Tools.BreakReference(data);
|
2364
|
+
if (columnConfig) {
|
2365
|
+
if (['coerTextbox', 'coerNumberbox', 'coerSelectbox', 'coerSwitch'].includes(type)) {
|
2366
|
+
const inputConfig = columnConfig;
|
2367
|
+
response = inputConfig.hasOwnProperty(type)
|
2368
|
+
&& typeof inputConfig[type] === 'function'
|
2369
|
+
&& inputConfig[type]({ property, row, value }).isInput;
|
2370
|
+
}
|
322
2371
|
else
|
323
|
-
|
2372
|
+
switch (type) {
|
2373
|
+
case 'number': {
|
2374
|
+
if (typeof columnConfig.typeNumber === 'boolean') {
|
2375
|
+
response = columnConfig.typeNumber;
|
2376
|
+
}
|
2377
|
+
else if (typeof columnConfig.typeNumber === 'function') {
|
2378
|
+
response = (data === null) ? false : columnConfig.typeNumber({ property, row, value });
|
2379
|
+
}
|
2380
|
+
break;
|
2381
|
+
}
|
2382
|
+
case 'date': {
|
2383
|
+
if (data === null)
|
2384
|
+
return false;
|
2385
|
+
if (typeof columnConfig.typeDate === 'boolean') {
|
2386
|
+
response = columnConfig.typeDate;
|
2387
|
+
}
|
2388
|
+
else if (typeof columnConfig.typeDate === 'function') {
|
2389
|
+
response = (data === null) ? false : columnConfig.typeDate({ property, row, value });
|
2390
|
+
}
|
2391
|
+
break;
|
2392
|
+
}
|
2393
|
+
case 'template': {
|
2394
|
+
if (data === null)
|
2395
|
+
return false;
|
2396
|
+
response = (typeof columnConfig.template === 'string') || (typeof columnConfig.template === 'function');
|
2397
|
+
break;
|
2398
|
+
}
|
2399
|
+
}
|
2400
|
+
}
|
2401
|
+
return response;
|
2402
|
+
}
|
2403
|
+
/** */
|
2404
|
+
_IsCellColor(property, data, color) {
|
2405
|
+
let response = false;
|
2406
|
+
const columnConfig = this._GetColumnConfig(property);
|
2407
|
+
if (columnConfig) {
|
2408
|
+
if (typeof columnConfig[color] === 'boolean') {
|
2409
|
+
response = columnConfig[color];
|
2410
|
+
}
|
2411
|
+
else if (typeof columnConfig[color] === 'function') {
|
2412
|
+
response = columnConfig[color]({
|
2413
|
+
property,
|
2414
|
+
row: Tools.BreakReference(data),
|
2415
|
+
value: data[property]
|
2416
|
+
});
|
2417
|
+
}
|
2418
|
+
}
|
2419
|
+
return response;
|
2420
|
+
}
|
2421
|
+
/** */
|
2422
|
+
GetAttribute(property, data, attribute, type) {
|
2423
|
+
const columnConfig = this._GetColumnConfig(property);
|
2424
|
+
const value = Tools.IsNotNull(data) ? data[property] : null;
|
2425
|
+
const row = Tools.BreakReference(data);
|
2426
|
+
if (columnConfig) {
|
2427
|
+
if (type === 'defaul-cell') {
|
2428
|
+
switch (attribute) {
|
2429
|
+
case 'textAlign': {
|
2430
|
+
return columnConfig?.textAlign || 'left';
|
2431
|
+
}
|
2432
|
+
case 'template': {
|
2433
|
+
const inputConfig = columnConfig;
|
2434
|
+
if (inputConfig.hasOwnProperty(attribute)) {
|
2435
|
+
if (typeof inputConfig[attribute] === 'string') {
|
2436
|
+
return inputConfig[attribute];
|
2437
|
+
}
|
2438
|
+
else if (typeof inputConfig[attribute] === 'function') {
|
2439
|
+
return inputConfig[attribute]({ property, row, value }) || '';
|
2440
|
+
}
|
2441
|
+
}
|
2442
|
+
}
|
2443
|
+
}
|
2444
|
+
}
|
2445
|
+
else if (['coerTextbox', 'coerNumberbox', 'coerSelectbox', 'coerSwitch'].includes(type)) {
|
2446
|
+
const inputConfig = columnConfig;
|
2447
|
+
if (inputConfig.hasOwnProperty(type) && typeof inputConfig[type] === 'function') {
|
2448
|
+
return inputConfig[type]({ property, row, value })[attribute] || null;
|
2449
|
+
}
|
2450
|
+
}
|
2451
|
+
}
|
2452
|
+
return null;
|
2453
|
+
}
|
2454
|
+
/** */
|
2455
|
+
ButtonByRow(property, data = null) {
|
2456
|
+
let response = false;
|
2457
|
+
const buttonByRow = this.buttonByRow;
|
2458
|
+
const row = Tools.IsNotNull(data) ? Tools.BreakReference(data) : null;
|
2459
|
+
if (buttonByRow.hasOwnProperty(property)) {
|
2460
|
+
if (row === null) {
|
2461
|
+
response = (typeof buttonByRow[property] === 'boolean') ? buttonByRow[property] : true;
|
2462
|
+
}
|
2463
|
+
else if (typeof buttonByRow[property] === 'boolean') {
|
2464
|
+
response = buttonByRow[property];
|
2465
|
+
}
|
2466
|
+
else if (typeof buttonByRow[property] === 'function') {
|
2467
|
+
response = buttonByRow[property]({ property, row, value: null });
|
2468
|
+
}
|
2469
|
+
}
|
2470
|
+
return response ? (this._value && this._value.length > 0) : false;
|
2471
|
+
}
|
2472
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerGridExtension, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
2473
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "17.3.12", type: CoerGridExtension, selector: "coer-grid-extension", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, cleanColumnName: { classPropertyName: "cleanColumnName", publicName: "cleanColumnName", isSignal: true, isRequired: false, transformFunction: null }, addButton: { classPropertyName: "addButton", publicName: "addButton", isSignal: false, isRequired: false, transformFunction: null }, exportButton: { classPropertyName: "exportButton", publicName: "exportButton", isSignal: false, isRequired: false, transformFunction: null }, importButton: { classPropertyName: "importButton", publicName: "importButton", isSignal: false, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: false, isRequired: false, transformFunction: null }, buttonByRow: { classPropertyName: "buttonByRow", publicName: "buttonByRow", isSignal: false, isRequired: false, transformFunction: null }, checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: false, isRequired: false, transformFunction: null }, tooltipByRow: { classPropertyName: "tooltipByRow", publicName: "tooltipByRow", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, rowsByPage: { classPropertyName: "rowsByPage", publicName: "rowsByPage", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, showColumnGrouped: { classPropertyName: "showColumnGrouped", publicName: "showColumnGrouped", isSignal: true, isRequired: false, transformFunction: null }, rowsByGroup: { classPropertyName: "rowsByGroup", publicName: "rowsByGroup", isSignal: true, isRequired: false, transformFunction: null }, isInvisible: { classPropertyName: "isInvisible", publicName: "isInvisible", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, MinWidth: { classPropertyName: "MinWidth", publicName: "MinWidth", isSignal: true, isRequired: false, transformFunction: null }, MaxWidth: { classPropertyName: "MaxWidth", publicName: "MaxWidth", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, margin: { classPropertyName: "margin", publicName: "margin", isSignal: true, isRequired: false, transformFunction: null }, enableSort: { classPropertyName: "enableSort", publicName: "enableSort", isSignal: true, isRequired: false, transformFunction: null }, enableRowFocus: { classPropertyName: "enableRowFocus", publicName: "enableRowFocus", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClickAdd: "onClickAdd", onClickImport: "onClickImport", onClickExport: "onClickExport", onClickRow: "onClickRow", onDoubleClickRow: "onDoubleClickRow", onClickDeleteRow: "onClickDeleteRow", onClickEditRow: "onClickEditRow", onClickGoRow: "onClickGoRow", onKeyupEnter: "onKeyupEnter", onKeyupEnterLast: "onKeyupEnterLast", onSwitchChange: "onSwitchChange", onTextboxChange: "onTextboxChange", onSelectboxChange: "onSelectboxChange", onCheckboxChange: "onCheckboxChange" }, viewQueries: [{ propertyName: "inputFile", first: true, predicate: ["inputFileRef"], descendants: true, isSignal: true }, { propertyName: "inputSearch", first: true, predicate: ["inputSearch"], descendants: true, isSignal: true }, { propertyName: "coerTextboxList", predicate: CoerTextBox, descendants: true, isSignal: true }, { propertyName: "coerNumberboxList", predicate: CoerNumberBox, descendants: true, isSignal: true }, { propertyName: "coerSelectboxList", predicate: CoerSelectbox, descendants: true, isSignal: true }, { propertyName: "coerCheckboxList", predicate: CoerCheckbox, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
2474
|
+
}
|
2475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerGridExtension, decorators: [{
|
2476
|
+
type: Component,
|
2477
|
+
args: [{
|
2478
|
+
selector: 'coer-grid-extension',
|
2479
|
+
template: ''
|
2480
|
+
}]
|
2481
|
+
}], propDecorators: { addButton: [{
|
2482
|
+
type: Input
|
2483
|
+
}], exportButton: [{
|
2484
|
+
type: Input
|
2485
|
+
}], importButton: [{
|
2486
|
+
type: Input
|
2487
|
+
}], search: [{
|
2488
|
+
type: Input
|
2489
|
+
}], buttonByRow: [{
|
2490
|
+
type: Input
|
2491
|
+
}], checkbox: [{
|
2492
|
+
type: Input
|
2493
|
+
}] } });
|
2494
|
+
|
2495
|
+
class CoerSwitch extends ControlValue {
|
2496
|
+
constructor() {
|
2497
|
+
super(...arguments);
|
2498
|
+
//Variables
|
2499
|
+
this._value = false;
|
2500
|
+
this._id = Tools.GetGuid('coer-switch');
|
2501
|
+
this._tooltip = '';
|
2502
|
+
this.id = '';
|
2503
|
+
this.label = input('');
|
2504
|
+
this.labelPosition = input('after');
|
2505
|
+
this.isDisabled = input(false);
|
2506
|
+
this.isLoading = input(false);
|
2507
|
+
this.isInvisible = input(false);
|
2508
|
+
this.tooltipPosition = input('top');
|
2509
|
+
//Outputs
|
2510
|
+
this.onChange = output();
|
2511
|
+
//conmputed
|
2512
|
+
this._isEnable = computed(() => {
|
2513
|
+
return !this.isLoading() && !this.isDisabled() && !this.isInvisible();
|
2514
|
+
});
|
2515
|
+
}
|
2516
|
+
//Inputs
|
2517
|
+
set value(value) {
|
2518
|
+
if (Tools.IsNull(value))
|
2519
|
+
value = false;
|
2520
|
+
this.SetValue(value);
|
2521
|
+
}
|
2522
|
+
set tooltip(value) {
|
2523
|
+
this._tooltip = value;
|
2524
|
+
if (value && this._tooltipElement) {
|
2525
|
+
this._tooltipElement.setContent({ '.tooltip-inner': this._tooltip });
|
2526
|
+
}
|
2527
|
+
}
|
2528
|
+
ngOnInit() {
|
2529
|
+
Tools.Sleep().then(() => {
|
2530
|
+
const htmlElement = document.getElementById(this._id);
|
2531
|
+
if (htmlElement) {
|
2532
|
+
htmlElement.addEventListener('mouseleave', () => {
|
2533
|
+
if (this._tooltipElement)
|
2534
|
+
this._tooltipElement.hide();
|
2535
|
+
});
|
2536
|
+
this._tooltipElement = new Tooltip(htmlElement, {
|
2537
|
+
html: true,
|
2538
|
+
title: this._tooltip,
|
2539
|
+
placement: this.tooltipPosition()
|
2540
|
+
});
|
2541
|
+
}
|
2542
|
+
});
|
2543
|
+
}
|
2544
|
+
ngOnDestroy() {
|
2545
|
+
if (this._tooltipElement) {
|
2546
|
+
Tools.Sleep().then(() => this._tooltipElement.dispose());
|
2547
|
+
}
|
2548
|
+
}
|
2549
|
+
//getter
|
2550
|
+
get value() {
|
2551
|
+
return this._value;
|
2552
|
+
}
|
2553
|
+
/** */
|
2554
|
+
Focus() {
|
2555
|
+
Tools.Sleep().then(() => {
|
2556
|
+
if (this._isEnable())
|
2557
|
+
this.coerSwitch.focus();
|
2558
|
+
});
|
2559
|
+
}
|
2560
|
+
/** */
|
2561
|
+
Change(value) {
|
2562
|
+
this.SetValue(value);
|
2563
|
+
this.onChange.emit(value);
|
2564
|
+
}
|
2565
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerSwitch, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
2566
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: CoerSwitch, selector: "coer-switch", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isInvisible: { classPropertyName: "isInvisible", publicName: "isInvisible", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onChange: "onChange" }, providers: [CONTROL_VALUE(CoerSwitch)], viewQueries: [{ propertyName: "coerSwitch", first: true, predicate: ["coerSwitch"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"{ 'coer-switch': true, 'placeholder-glow': isLoading(), 'invisible': isInvisible() }\">\r\n <div [id]=\"_id\" [ngClass]=\"{ 'placeholder': isLoading() }\">\r\n <mat-slide-toggle\r\n #coerSwitch\r\n [checked]=\"_value\"\r\n [disabled]=\"!_isEnable()\"\r\n [labelPosition]=\"labelPosition()\"\r\n (change)=\"Change($event.checked)\"\r\n >{{ label() }}</mat-slide-toggle>\r\n </div>\r\n</div>", styles: ["div.coer-switch{height:40px;display:flex!important;align-items:center!important;position:relative!important}div.coer-switch .text-blue{color:#0d6efd!important}div.coer-switch .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-switch .background-blue{background-color:#0d6efd!important}div.coer-switch .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-switch .border-blue{border-color:#0d6efd!important}div.coer-switch .text-gray{color:#6c757d!important}div.coer-switch .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-switch .background-gray{background-color:#6c757d!important}div.coer-switch .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-switch .border-gray{border-color:#6c757d!important}div.coer-switch .text-green{color:#198754!important}div.coer-switch .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-switch .background-green{background-color:#198754!important}div.coer-switch .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-switch .border-green{border-color:#198754!important}div.coer-switch .text-yellow{color:#ffc107!important}div.coer-switch .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-switch .background-yellow{background-color:#ffc107!important}div.coer-switch .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-switch .border-yellow{border-color:#ffc107!important}div.coer-switch .text-red{color:#dc3545!important}div.coer-switch .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-switch .background-red{background-color:#dc3545!important}div.coer-switch .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-switch .border-red{border-color:#dc3545!important}div.coer-switch .text-white{color:#f5f5f5!important}div.coer-switch .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-switch .background-white{background-color:#f5f5f5!important}div.coer-switch .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-switch .border-white{border-color:#f5f5f5!important}div.coer-switch .text-black{color:#252525!important}div.coer-switch .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-switch .background-black{background-color:#252525!important}div.coer-switch .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-switch .border-black{border-color:#252525!important}div.coer-switch .text-orange{color:#fd6031!important}div.coer-switch .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-switch .background-orange{background-color:#fd6031!important}div.coer-switch .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-switch .border-orange{border-color:#fd6031!important}div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field button div.mdc-switch__track:after{background-color:#fd6031!important;filter:opacity(.6)!important}div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field button div.mdc-switch__handle-track div.mdc-switch__ripple{width:30px!important;height:30px!important}div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field button.mdc-switch.mdc-switch--selected.mdc-switch--checked div.mdc-switch__handle-track div.mdc-switch__handle div.mdc-switch__icons{background-color:#fd6031!important;border-radius:20px!important}div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field label,div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field label::selection{font-weight:400;background-color:transparent!important;font-size:17px!important}div.coer-switch .placeholder{display:flex!important;height:27px!important}div.coer-switch .placeholder,div.coer-switch .placeholder *,div.coer-switch .placeholder-glow,div.coer-switch .placeholder-glow *{cursor:wait!important}coer-grid div.coer-switch{height:20px!important;justify-content:center!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }] }); }
|
2567
|
+
}
|
2568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerSwitch, decorators: [{
|
2569
|
+
type: Component,
|
2570
|
+
args: [{ selector: 'coer-switch', providers: [CONTROL_VALUE(CoerSwitch)], template: "<div [ngClass]=\"{ 'coer-switch': true, 'placeholder-glow': isLoading(), 'invisible': isInvisible() }\">\r\n <div [id]=\"_id\" [ngClass]=\"{ 'placeholder': isLoading() }\">\r\n <mat-slide-toggle\r\n #coerSwitch\r\n [checked]=\"_value\"\r\n [disabled]=\"!_isEnable()\"\r\n [labelPosition]=\"labelPosition()\"\r\n (change)=\"Change($event.checked)\"\r\n >{{ label() }}</mat-slide-toggle>\r\n </div>\r\n</div>", styles: ["div.coer-switch{height:40px;display:flex!important;align-items:center!important;position:relative!important}div.coer-switch .text-blue{color:#0d6efd!important}div.coer-switch .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-switch .background-blue{background-color:#0d6efd!important}div.coer-switch .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-switch .border-blue{border-color:#0d6efd!important}div.coer-switch .text-gray{color:#6c757d!important}div.coer-switch .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-switch .background-gray{background-color:#6c757d!important}div.coer-switch .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-switch .border-gray{border-color:#6c757d!important}div.coer-switch .text-green{color:#198754!important}div.coer-switch .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-switch .background-green{background-color:#198754!important}div.coer-switch .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-switch .border-green{border-color:#198754!important}div.coer-switch .text-yellow{color:#ffc107!important}div.coer-switch .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-switch .background-yellow{background-color:#ffc107!important}div.coer-switch .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-switch .border-yellow{border-color:#ffc107!important}div.coer-switch .text-red{color:#dc3545!important}div.coer-switch .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-switch .background-red{background-color:#dc3545!important}div.coer-switch .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-switch .border-red{border-color:#dc3545!important}div.coer-switch .text-white{color:#f5f5f5!important}div.coer-switch .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-switch .background-white{background-color:#f5f5f5!important}div.coer-switch .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-switch .border-white{border-color:#f5f5f5!important}div.coer-switch .text-black{color:#252525!important}div.coer-switch .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-switch .background-black{background-color:#252525!important}div.coer-switch .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-switch .border-black{border-color:#252525!important}div.coer-switch .text-orange{color:#fd6031!important}div.coer-switch .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-switch .background-orange{background-color:#fd6031!important}div.coer-switch .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-switch .border-orange{border-color:#fd6031!important}div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field button div.mdc-switch__track:after{background-color:#fd6031!important;filter:opacity(.6)!important}div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field button div.mdc-switch__handle-track div.mdc-switch__ripple{width:30px!important;height:30px!important}div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field button.mdc-switch.mdc-switch--selected.mdc-switch--checked div.mdc-switch__handle-track div.mdc-switch__handle div.mdc-switch__icons{background-color:#fd6031!important;border-radius:20px!important}div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field label,div.coer-switch mat-slide-toggle div.mdc-form-field.mat-internal-form-field label::selection{font-weight:400;background-color:transparent!important;font-size:17px!important}div.coer-switch .placeholder{display:flex!important;height:27px!important}div.coer-switch .placeholder,div.coer-switch .placeholder *,div.coer-switch .placeholder-glow,div.coer-switch .placeholder-glow *{cursor:wait!important}coer-grid div.coer-switch{height:20px!important;justify-content:center!important}\n"] }]
|
2571
|
+
}], propDecorators: { coerSwitch: [{
|
2572
|
+
type: ViewChild,
|
2573
|
+
args: ['coerSwitch']
|
2574
|
+
}], value: [{
|
2575
|
+
type: Input
|
2576
|
+
}], id: [{
|
2577
|
+
type: Input
|
2578
|
+
}], tooltip: [{
|
2579
|
+
type: Input
|
2580
|
+
}] } });
|
2581
|
+
|
2582
|
+
class CoerGrid extends CoerGridExtension {
|
2583
|
+
constructor() {
|
2584
|
+
super(...arguments);
|
2585
|
+
//computed
|
2586
|
+
this.dataSource = computed(() => {
|
2587
|
+
return Tools.BreakReference(this.value_signal()).map(item => {
|
2588
|
+
if (item.hasOwnProperty('checked'))
|
2589
|
+
delete item.checked;
|
2590
|
+
if (item.hasOwnProperty('indexRow'))
|
2591
|
+
delete item.indexRow;
|
2592
|
+
return item;
|
2593
|
+
});
|
2594
|
+
});
|
2595
|
+
//computed
|
2596
|
+
this.selectedItems = computed(() => {
|
2597
|
+
return Tools.BreakReference(this.value_signal()).filter(item => item.checked).map(item => {
|
2598
|
+
if (item.hasOwnProperty('checked'))
|
2599
|
+
delete item.checked;
|
2600
|
+
if (item.hasOwnProperty('indexRow'))
|
2601
|
+
delete item.indexRow;
|
2602
|
+
return item;
|
2603
|
+
});
|
2604
|
+
});
|
2605
|
+
//computed
|
2606
|
+
this.gridLength = computed(() => {
|
2607
|
+
return {
|
2608
|
+
dataSource: this.value_signal()?.length || 0,
|
2609
|
+
dataSourceFiltered: this.gridDataSourceFiltered()?.length || 0,
|
2610
|
+
dataSourceSelected: this.selectedItems()?.length || 0
|
2611
|
+
};
|
2612
|
+
});
|
2613
|
+
}
|
2614
|
+
//getter
|
2615
|
+
get isValid() {
|
2616
|
+
return (this.coerTextboxList().length > 0 ? this.coerTextboxList().every(x => !x.isInvalid()) : true)
|
2617
|
+
&& (this.coerNumberboxList().length > 0 ? this.coerNumberboxList().every(x => !x.isInvalid()) : true)
|
2618
|
+
&& (this.coerSelectboxList().length > 0 ? this.coerSelectboxList().every(x => !x.isInvalid()) : true);
|
2619
|
+
}
|
2620
|
+
//computed
|
2621
|
+
//protected _columnsFiltered = computed<IGridHeader[]>(() => {
|
2622
|
+
// return this.isGrouped() && !this.showColumnGrouped
|
2623
|
+
// ? this._columns().filter(x => x.columnName.toUpperCase() != this.groupBy.toUpperCase())
|
2624
|
+
// : this._columns();
|
2625
|
+
//});
|
2626
|
+
/** */
|
2627
|
+
FocusSearch() {
|
2628
|
+
Tools.Sleep(0).then(() => {
|
2629
|
+
if (this.inputSearch)
|
2630
|
+
this.inputSearch().Focus();
|
2631
|
+
});
|
2632
|
+
}
|
2633
|
+
/** */
|
2634
|
+
SelectSearch() {
|
2635
|
+
Tools.Sleep(0).then(() => {
|
2636
|
+
if (this.inputSearch)
|
2637
|
+
this.inputSearch().Select();
|
2638
|
+
});
|
2639
|
+
}
|
2640
|
+
/** */
|
2641
|
+
GetRowBy(callback) {
|
2642
|
+
const row = this._value.find(callback);
|
2643
|
+
return (row === undefined) ? null : row;
|
2644
|
+
}
|
2645
|
+
/** */
|
2646
|
+
async Import(event = null) {
|
2647
|
+
if (this.importButton?.preventDefault) {
|
2648
|
+
this.onClickImport.emit({ data: [], file: null });
|
2649
|
+
return;
|
324
2650
|
}
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
if (Tools.IsNull(text))
|
330
|
-
return '';
|
331
|
-
const textArray = [];
|
332
|
-
for (let i = 0; i < text.length; i++) {
|
333
|
-
if (i === 0)
|
334
|
-
textArray.push(text[i].toUpperCase());
|
335
|
-
else
|
336
|
-
textArray.push(text[i]);
|
2651
|
+
if (event === null) {
|
2652
|
+
this.inputFile().nativeElement.value = null;
|
2653
|
+
this.inputFile().nativeElement.click();
|
2654
|
+
return;
|
337
2655
|
}
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
return 0;
|
351
|
-
});
|
2656
|
+
else if (event.target.files.length > 0) {
|
2657
|
+
this._isLoading = true;
|
2658
|
+
const [selectedFile] = event.target.files;
|
2659
|
+
if (Files.IsExcel(selectedFile)) {
|
2660
|
+
const { rows } = await Files.ReadExcel(selectedFile);
|
2661
|
+
if (Tools.IsNull(this.importButton?.Autofill) || this.importButton.Autofill) {
|
2662
|
+
this.SetValue(rows.concat(this._value));
|
2663
|
+
this.onClickImport.emit({ data: this._value, file: selectedFile });
|
2664
|
+
}
|
2665
|
+
else {
|
2666
|
+
this.onClickImport.emit({ data: rows, file: selectedFile });
|
2667
|
+
}
|
352
2668
|
}
|
353
|
-
|
354
|
-
|
2669
|
+
else {
|
2670
|
+
let message = 'Allowed extensions:';
|
2671
|
+
for (const extension of Files.EXCEL_EXTENSIONS) {
|
2672
|
+
message += ` <b>${extension}</b>,`;
|
2673
|
+
}
|
2674
|
+
message = message.substring(0, message.length - 1);
|
2675
|
+
this.alert.Warning(message, 'Invalid File Type', 'bi bi-filetype-xlsx fa-lg');
|
2676
|
+
this.onClickImport.emit({ data: [], file: null });
|
355
2677
|
}
|
2678
|
+
this.inputFile().nativeElement.value = null;
|
2679
|
+
Tools.Sleep(1000).then(() => this._isLoading = false);
|
356
2680
|
}
|
357
|
-
}
|
358
|
-
/**
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
2681
|
+
}
|
2682
|
+
/** */
|
2683
|
+
Export(exportFile = true) {
|
2684
|
+
let item = {};
|
2685
|
+
this._isLoading = true;
|
2686
|
+
const FILE_NAME = (this.exportButton?.fileName || 'COER Report') + '.xlsx';
|
2687
|
+
let ROW_DATA_SOURCE = (this.exportButton.hasOwnProperty('onlyRowFiltered') && !this.exportButton.onlyRowFiltered)
|
2688
|
+
? this.value_signal() : this.gridDataSourceFiltered();
|
2689
|
+
const COLUMN_DATA_SOURCE = new Set();
|
2690
|
+
if (this.exportButton.hasOwnProperty('onlyColumnFiltered') && !this.exportButton.onlyColumnFiltered) {
|
2691
|
+
for (const row of this.value_signal()) {
|
2692
|
+
for (const columnName in row) {
|
2693
|
+
if (columnName == 'indexRow')
|
2694
|
+
continue;
|
2695
|
+
COLUMN_DATA_SOURCE.add(Tools.FirstCharToLower(columnName));
|
2696
|
+
}
|
370
2697
|
}
|
371
|
-
|
372
|
-
|
2698
|
+
}
|
2699
|
+
else {
|
2700
|
+
for (const { columnName } of this.gridColumns()) {
|
2701
|
+
if (columnName == 'indexRow')
|
2702
|
+
continue;
|
2703
|
+
COLUMN_DATA_SOURCE.add(Tools.FirstCharToLower(columnName));
|
373
2704
|
}
|
374
2705
|
}
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
return '0';
|
2706
|
+
const EXPORT_DATA = [];
|
2707
|
+
for (const row of ROW_DATA_SOURCE) {
|
2708
|
+
for (const column of COLUMN_DATA_SOURCE) {
|
2709
|
+
item = Object.assign(item, { [this._GetColumnName(column)]: row[column] });
|
2710
|
+
}
|
2711
|
+
EXPORT_DATA.push(item);
|
2712
|
+
item = Tools.BreakReference({});
|
383
2713
|
}
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
2714
|
+
if (exportFile) {
|
2715
|
+
Files.ExportExcel(EXPORT_DATA, FILE_NAME);
|
2716
|
+
}
|
2717
|
+
this.onClickExport.emit(EXPORT_DATA);
|
2718
|
+
Tools.Sleep(3000).then(() => this._isLoading = false);
|
2719
|
+
}
|
2720
|
+
/** */
|
2721
|
+
InputChange(indexRow, columnName, value, input) {
|
2722
|
+
if (input === 'coer-textbox-search') {
|
2723
|
+
if (this._isLoading)
|
2724
|
+
return;
|
2725
|
+
Tools.Sleep(0, `coerGridInputChange${columnName}`).then(async (_) => {
|
2726
|
+
this._gridSearch.set(value);
|
2727
|
+
if (this.checkbox.show) {
|
2728
|
+
this._isLoadingMessage = true;
|
2729
|
+
await Tools.Sleep();
|
2730
|
+
for (const row of this._value.filter((x) => x.checked)) {
|
2731
|
+
this.CheckBy((x) => x.indexRow == row.indexRow);
|
2732
|
+
}
|
2733
|
+
await Tools.Sleep();
|
2734
|
+
this._isLoadingMessage = false;
|
2735
|
+
}
|
2736
|
+
});
|
2737
|
+
return;
|
2738
|
+
}
|
2739
|
+
const property = Tools.FirstCharToLower(columnName);
|
2740
|
+
const row = this._value[indexRow];
|
2741
|
+
row[property] = value;
|
2742
|
+
if (input === 'coer-switch') {
|
2743
|
+
this.onSwitchChange.emit({ property, row: Tools.BreakReference(row), value });
|
2744
|
+
}
|
2745
|
+
else if (input === 'coer-textbox') {
|
2746
|
+
this.onTextboxChange.emit({ property, row: Tools.BreakReference(row), value });
|
2747
|
+
}
|
2748
|
+
else if (input === 'coer-selectbox') {
|
2749
|
+
this.onSelectboxChange.emit({ property, row: Tools.BreakReference(row), value });
|
2750
|
+
}
|
2751
|
+
else if (input === 'coer-numberbox') {
|
2752
|
+
this.onTextboxChange.emit({ property, row: Tools.BreakReference(row), value });
|
2753
|
+
}
|
2754
|
+
Tools.Sleep(1000, `coerGridInputChange${indexRow}${columnName}`).then(_ => {
|
2755
|
+
this._UpdateValue(this._value);
|
2756
|
+
this.value_signal.set(this._value);
|
2757
|
+
});
|
2758
|
+
}
|
2759
|
+
/** */
|
2760
|
+
KeyupEnter(indexColumn, row, input, value) {
|
2761
|
+
if (['coer-textbox', 'coer-numberbox', 'coer-selectbox'].includes(input)) {
|
2762
|
+
this.onKeyupEnter.emit({
|
2763
|
+
id: this._GetId(indexColumn, row.indexRow, input),
|
2764
|
+
input, row: Tools.BreakReference(row), value
|
2765
|
+
});
|
2766
|
+
this.NextInput(indexColumn, row.indexRow);
|
2767
|
+
}
|
2768
|
+
else if (input == 'coer-textbox-search') {
|
2769
|
+
this.onKeyupEnter.emit({
|
2770
|
+
id: this._GetId(indexColumn, row.indexRow, input),
|
2771
|
+
input, row: null, value
|
2772
|
+
});
|
2773
|
+
}
|
2774
|
+
}
|
2775
|
+
/** */
|
2776
|
+
NextInput(indexColumn, indexRow) {
|
2777
|
+
const INPUT_TEXT = this.columns().filter(x => Tools.IsNotNull(x.coerTextbox)).map(x => x.property);
|
2778
|
+
const INPUT_NUMBER = this.columns().filter(x => Tools.IsNotNull(x.coerNumberbox)).map(x => x.property);
|
2779
|
+
const INPUT_SELECT = this.columns().filter(x => Tools.IsNotNull(x.coerSelectbox)).map(x => x.property);
|
2780
|
+
let index = 0;
|
2781
|
+
const COLUMNS = [];
|
2782
|
+
const INPUT_COLUMNS = [];
|
2783
|
+
for (const { columnName } of this.gridColumns()) {
|
2784
|
+
if (INPUT_TEXT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
|
2785
|
+
COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerTextbox' });
|
2786
|
+
INPUT_COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerTextbox' });
|
2787
|
+
}
|
2788
|
+
else if (INPUT_NUMBER.some(property => property.toUpperCase() == columnName.toUpperCase())) {
|
2789
|
+
COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerNumberbox' });
|
2790
|
+
INPUT_COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerNumberbox' });
|
2791
|
+
}
|
2792
|
+
else if (INPUT_SELECT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
|
2793
|
+
COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerSelectbox' });
|
2794
|
+
INPUT_COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerSelectbox' });
|
2795
|
+
}
|
2796
|
+
else {
|
2797
|
+
COLUMNS.push({ indexColumn: index, property: columnName, type: 'default-cell' });
|
396
2798
|
}
|
2799
|
+
++index;
|
397
2800
|
}
|
398
|
-
|
399
|
-
|
2801
|
+
let lastRow = -1;
|
2802
|
+
for (const { rows } of this.gridDataSource()) {
|
2803
|
+
lastRow += rows.length;
|
400
2804
|
}
|
401
|
-
let
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
2805
|
+
let firstColumn = -1;
|
2806
|
+
if (INPUT_COLUMNS.length > 0) {
|
2807
|
+
firstColumn = [...INPUT_COLUMNS].shift().indexColumn;
|
2808
|
+
}
|
2809
|
+
let lastColumn = -1;
|
2810
|
+
if (INPUT_COLUMNS.length > 0) {
|
2811
|
+
lastColumn = [...INPUT_COLUMNS].pop().indexColumn;
|
2812
|
+
}
|
2813
|
+
//Is Last Row & Last Input Column?
|
2814
|
+
if (indexRow == lastRow && indexColumn == lastColumn) {
|
2815
|
+
this.onKeyupEnterLast.emit();
|
2816
|
+
}
|
2817
|
+
//Is Last Input Column?
|
2818
|
+
else if (indexColumn == lastColumn) {
|
2819
|
+
this.FocusInput((indexRow + 1), firstColumn);
|
2820
|
+
}
|
2821
|
+
//Next Column?
|
2822
|
+
else {
|
2823
|
+
for (index = (indexColumn + 1); index < COLUMNS.length; index++) {
|
2824
|
+
for (const input of COLUMNS) {
|
2825
|
+
if (index == input.indexColumn && ['coerTextbox', 'coerNumberbox', 'coerSelectbox'].includes(input.type)) {
|
2826
|
+
this.FocusInput(indexRow, input.indexColumn);
|
2827
|
+
return;
|
2828
|
+
}
|
2829
|
+
}
|
407
2830
|
}
|
408
|
-
VALUE_INTEGER_ARRAY.push(char);
|
409
|
-
++counter;
|
410
2831
|
}
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
2832
|
+
}
|
2833
|
+
/** */
|
2834
|
+
FocusInput(indexRow = -1, indexColumn = -1) {
|
2835
|
+
Tools.Sleep(0, 'FocusInput').then(() => {
|
2836
|
+
if (this._isDisabled())
|
2837
|
+
return;
|
2838
|
+
if (indexRow < 0 || indexColumn < 0) {
|
2839
|
+
const INPUT_TEXT = this.columns().filter(x => Tools.IsNotNull(x.coerTextbox)).map(x => x.property);
|
2840
|
+
const INPUT_NUMBER = this.columns().filter(x => Tools.IsNotNull(x.coerNumberbox)).map(x => x.property);
|
2841
|
+
const INPUT_SELECT = this.columns().filter(x => Tools.IsNotNull(x.coerSelectbox)).map(x => x.property);
|
2842
|
+
let index = 0;
|
2843
|
+
const COLUMNS = [];
|
2844
|
+
for (const { columnName } of this.gridColumns()) {
|
2845
|
+
if (INPUT_TEXT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
|
2846
|
+
COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerTextbox' });
|
2847
|
+
}
|
2848
|
+
else if (INPUT_NUMBER.some(property => property.toUpperCase() == columnName.toUpperCase())) {
|
2849
|
+
COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerNumberbox' });
|
2850
|
+
}
|
2851
|
+
else if (INPUT_SELECT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
|
2852
|
+
COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerSelectbox' });
|
2853
|
+
}
|
2854
|
+
else {
|
2855
|
+
COLUMNS.push({ indexColumn: index, property: columnName, type: 'default-cell' });
|
2856
|
+
}
|
2857
|
+
++index;
|
2858
|
+
}
|
2859
|
+
if (this.gridLength().dataSourceFiltered > 0) {
|
2860
|
+
const FIRST_INPUT_COLUMN = COLUMNS.find(x => ['coerTextbox', 'coerNumberbox', 'coerSelectbox'].includes(x.type));
|
2861
|
+
if (Tools.IsNotNull(FIRST_INPUT_COLUMN)) {
|
2862
|
+
this.FocusInput(0, FIRST_INPUT_COLUMN.indexColumn);
|
2863
|
+
}
|
2864
|
+
}
|
2865
|
+
}
|
2866
|
+
else {
|
2867
|
+
const id = this._GetId(indexRow, indexColumn);
|
2868
|
+
let element;
|
2869
|
+
this._indexFocus.set(indexRow);
|
2870
|
+
//Focus Textbox
|
2871
|
+
element = this.coerTextboxList().find(x => x.id == id);
|
2872
|
+
if (element) {
|
2873
|
+
element.Select();
|
2874
|
+
return;
|
2875
|
+
}
|
2876
|
+
//Focus Numberbox
|
2877
|
+
element = this.coerNumberboxList().find(x => x.id == id);
|
2878
|
+
if (element) {
|
2879
|
+
element.Select();
|
2880
|
+
return;
|
2881
|
+
}
|
2882
|
+
//Focus Selectbox
|
2883
|
+
element = this.coerSelectboxList().find(x => x.id == id);
|
2884
|
+
if (element) {
|
2885
|
+
Tools.Sleep(100).then(_ => element.Focus());
|
2886
|
+
return;
|
2887
|
+
}
|
2888
|
+
}
|
2889
|
+
});
|
2890
|
+
}
|
2891
|
+
/** */
|
2892
|
+
FocusRow(callback) {
|
2893
|
+
Tools.Sleep().then(_ => {
|
2894
|
+
if (this._value.length > 0) {
|
2895
|
+
const row = Tools.BreakReference(this._value.find(callback));
|
2896
|
+
if (Tools.IsNotNull(row))
|
2897
|
+
this._indexFocus.set(row.indexRow);
|
2898
|
+
}
|
2899
|
+
});
|
2900
|
+
}
|
2901
|
+
/** */
|
2902
|
+
async Sort(columnName) {
|
2903
|
+
if (this.enableSort()) {
|
2904
|
+
if (this._isLoading)
|
2905
|
+
return;
|
2906
|
+
this._isLoading = true;
|
2907
|
+
this._isLoadingMessage = true;
|
2908
|
+
const { direction } = this._sort();
|
2909
|
+
let dataSource = Tools.BreakReference(this._value);
|
2910
|
+
for (const checkbox of this.coerCheckboxList())
|
2911
|
+
checkbox.Uncheck();
|
2912
|
+
if (direction == 'descendant') {
|
2913
|
+
Tools.SortByDesc(dataSource, columnName);
|
2914
|
+
this._sort.set({ columnName, direction: 'ascendant', icon: 'fa-solid fa-arrow-down-short-wide' });
|
2915
|
+
}
|
2916
|
+
else {
|
2917
|
+
Tools.SortBy(dataSource, columnName);
|
2918
|
+
this._sort.set({ columnName, direction: 'descendant', icon: 'fa-solid fa-arrow-up-wide-short' });
|
2919
|
+
}
|
2920
|
+
let indexRow = 0;
|
2921
|
+
dataSource = Tools.BreakReference(dataSource).map((item) => Object.assign(item, { indexRow: indexRow++ }));
|
2922
|
+
this.SetValue(dataSource);
|
2923
|
+
this._isLoading = false;
|
2924
|
+
await Tools.Sleep();
|
2925
|
+
for (const row of dataSource.filter((x) => x.checked)) {
|
2926
|
+
this.CheckBy((x) => x.indexRow == row.indexRow);
|
2927
|
+
}
|
2928
|
+
this._isLoadingMessage = false;
|
418
2929
|
}
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
2930
|
+
return;
|
2931
|
+
}
|
2932
|
+
/** */
|
2933
|
+
ClickCheck(id, checked, all, row = null) {
|
2934
|
+
if (!this._isLoading)
|
2935
|
+
Tools.Sleep().then(async (_) => {
|
2936
|
+
this._isLoading = true;
|
2937
|
+
let element = this.coerCheckboxList().find(x => x.id() == id);
|
2938
|
+
if (Tools.IsNotNull(element)) {
|
2939
|
+
let response = { all, checked, rows: [] };
|
2940
|
+
//All Checkbox
|
2941
|
+
if (all) {
|
2942
|
+
if (checked)
|
2943
|
+
this.CheckAll();
|
2944
|
+
else
|
2945
|
+
this.UncheckAll();
|
2946
|
+
//Event
|
2947
|
+
response.rows = this.selectedItems();
|
2948
|
+
this.onCheckboxChange.emit(response);
|
2949
|
+
}
|
2950
|
+
//One Checkbox
|
2951
|
+
else {
|
2952
|
+
if (this._onlyOneCheck) {
|
2953
|
+
for (const row of this._value) {
|
2954
|
+
row.checked = false;
|
2955
|
+
}
|
2956
|
+
for (const checkbox of this.coerCheckboxList()) {
|
2957
|
+
if (checkbox.id() != id)
|
2958
|
+
checkbox.Uncheck();
|
2959
|
+
}
|
2960
|
+
}
|
2961
|
+
this._value[row.indexRow].checked = checked;
|
2962
|
+
this.SetValue(this._value);
|
2963
|
+
//Mark All checkbox
|
2964
|
+
const checkboxAll = this.coerCheckboxList().find(x => x.id() == this._GetId(0, 0, 'checkboxAll'));
|
2965
|
+
if (this.value_signal().every((x) => x.checked)) {
|
2966
|
+
checkboxAll?.Check();
|
2967
|
+
}
|
2968
|
+
else {
|
2969
|
+
checkboxAll?.Uncheck();
|
2970
|
+
}
|
2971
|
+
//Event
|
2972
|
+
response.rows = [{ ...row }];
|
2973
|
+
this.onCheckboxChange.emit(response);
|
2974
|
+
this._isLoading = false;
|
2975
|
+
}
|
424
2976
|
}
|
425
|
-
reference_signal.set(Object.assign(reference_signal(), {
|
426
|
-
[reference]: setTimeout(() => {
|
427
|
-
Resolve();
|
428
|
-
clearInterval(reference_signal()[reference]);
|
429
|
-
const _reference = { ...reference_signal() };
|
430
|
-
delete _reference[reference];
|
431
|
-
reference_signal.set({ ..._reference });
|
432
|
-
}, milliseconds)
|
433
|
-
}));
|
434
2977
|
});
|
435
2978
|
}
|
436
|
-
|
2979
|
+
/** */
|
2980
|
+
CheckAll() {
|
2981
|
+
this._isLoading = true;
|
2982
|
+
for (const row of this._value) {
|
2983
|
+
row.checked = true;
|
2984
|
+
}
|
2985
|
+
this.SetValue(this._value);
|
2986
|
+
for (const checkbox of this.coerCheckboxList()) {
|
2987
|
+
checkbox.Check();
|
2988
|
+
}
|
2989
|
+
this._isLoading = false;
|
2990
|
+
}
|
2991
|
+
/** */
|
2992
|
+
UncheckAll() {
|
2993
|
+
this._isLoading = true;
|
2994
|
+
for (const row of this._value) {
|
2995
|
+
row.checked = false;
|
2996
|
+
}
|
2997
|
+
this.SetValue(this._value);
|
2998
|
+
for (const checkbox of this.coerCheckboxList()) {
|
2999
|
+
checkbox.Uncheck();
|
3000
|
+
}
|
3001
|
+
this._isLoading = false;
|
3002
|
+
}
|
3003
|
+
/** */
|
3004
|
+
CheckBy(callback) {
|
3005
|
+
Tools.Sleep().then(_ => {
|
3006
|
+
if (this._value.length > 0) {
|
3007
|
+
const rowList = Tools.BreakReference(this._value.filter(callback));
|
3008
|
+
let element;
|
3009
|
+
for (const { indexRow } of rowList) {
|
3010
|
+
element = this.coerCheckboxList().find(x => x.id() == this._GetId(indexRow, 0, 'checkbox'));
|
3011
|
+
if (Tools.IsNotNull(element)) {
|
3012
|
+
element?.Check();
|
3013
|
+
}
|
3014
|
+
}
|
3015
|
+
}
|
3016
|
+
});
|
3017
|
+
}
|
3018
|
+
/** */
|
3019
|
+
UncheckBy(callback) {
|
3020
|
+
Tools.Sleep().then(_ => {
|
3021
|
+
if (this._value.length > 0) {
|
3022
|
+
const rowList = Tools.BreakReference(this._value.filter(callback));
|
3023
|
+
let element;
|
3024
|
+
for (const { indexRow } of rowList) {
|
3025
|
+
element = this.coerCheckboxList().find(x => x.id() == this._GetId(indexRow, 0, 'checkbox'));
|
3026
|
+
if (Tools.IsNotNull(element)) {
|
3027
|
+
element?.Uncheck();
|
3028
|
+
}
|
3029
|
+
}
|
3030
|
+
}
|
3031
|
+
});
|
3032
|
+
}
|
3033
|
+
/** */
|
3034
|
+
ClickOnRow(row) {
|
3035
|
+
if (this._isDisabled())
|
3036
|
+
return;
|
3037
|
+
if (Tools.IsNotNull(this.checkbox.checkOnRow) && this.checkbox.checkOnRow) {
|
3038
|
+
this.CheckBy((x) => x.indexRow == row.indexRow);
|
3039
|
+
}
|
3040
|
+
this.onClickRow.emit(row);
|
3041
|
+
}
|
3042
|
+
/** Inserts new elements at the start */
|
3043
|
+
Unshift(row) {
|
3044
|
+
const dataSource = Tools.BreakReference(this._value);
|
3045
|
+
dataSource.unshift(row);
|
3046
|
+
this.SetValue(dataSource);
|
3047
|
+
this.FocusInput();
|
3048
|
+
}
|
3049
|
+
/** Appends new elements to the end */
|
3050
|
+
Push(row) {
|
3051
|
+
const dataSource = Tools.BreakReference(this._value);
|
3052
|
+
dataSource.push(row);
|
3053
|
+
this.SetValue(dataSource);
|
3054
|
+
this.FocusInput();
|
3055
|
+
}
|
3056
|
+
/** Delete Row By index */
|
3057
|
+
async DeleteRow(indexRow) {
|
3058
|
+
const dataSource = Tools.BreakReference(this._value);
|
3059
|
+
dataSource.splice(indexRow, 1);
|
3060
|
+
this.SetValue(dataSource);
|
3061
|
+
}
|
3062
|
+
/** Delete row list by callback */
|
3063
|
+
async DeleteRowsBy(callback) {
|
3064
|
+
const indexList = Tools.BreakReference(this._value.filter(callback).map((item) => item.indexRow));
|
3065
|
+
let dataSource = [];
|
3066
|
+
for (const indexRow of indexList) {
|
3067
|
+
dataSource = Tools.BreakReference(this._value);
|
3068
|
+
dataSource.splice(indexRow, 1);
|
3069
|
+
this.SetValue(dataSource);
|
3070
|
+
await Tools.Sleep();
|
3071
|
+
}
|
3072
|
+
}
|
3073
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerGrid, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
3074
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerGrid, selector: "coer-grid", providers: [CONTROL_VALUE(CoerGrid)], usesInheritance: true, ngImport: i0, template: "<div class=\"coer-grid\" [ngStyle]=\"{ 'width': width(), 'min-Width': MinWidth(), 'max-Width': MaxWidth(), 'margin': margin() }\">\r\n <header [id]=\"_id + '-header'\" class=\"row\">\r\n <!-- Slot -->\r\n <ng-content></ng-content>\r\n\r\n <!-- Export Button -->\r\n @if(exportButton.show && gridLength().dataSource > 0) {\r\n <div class=\"col-auto\">\r\n <coer-button\r\n type=\"icon\"\r\n color=\"navigation\"\r\n icon=\"excel\"\r\n [tooltip]=\"_isLoading ? 'Loading' : (exportButton.tooltip || 'Export')\"\r\n [path]=\"(exportButton && exportButton.path) ? exportButton.path : []\"\r\n [isDisabled]=\"_isDisabled() || _isLoading || (exportButton.isDisabled || false)\"\r\n [isLoading]=\"_isLoading\"\r\n [animation]=\"_enableAnimations\"\r\n (onClick)=\"Export(!exportButton.preventDefault)\"\r\n ></coer-button>\r\n </div>\r\n }\r\n\r\n <!-- Import Button -->\r\n @if(importButton.show) {\r\n <div class=\"col-auto\">\r\n <input type=\"file\" #inputFileRef [multiple]=\"false\" (change)=\"Import($event)\">\r\n\r\n <coer-button\r\n type=\"icon\"\r\n color=\"navigation\"\r\n icon=\"import\"\r\n [tooltip]=\"importButton.tooltip || 'Import'\"\r\n [path]=\"(importButton && importButton.path) ? importButton.path : []\"\r\n [isDisabled]=\"importButton.isDisabled || false\"\r\n [animation]=\"_enableAnimations\"\r\n (onClick)=\"Import()\"\r\n ></coer-button>\r\n </div>\r\n }\r\n\r\n <!-- Add Button -->\r\n @if(addButton.show) {\r\n <div class=\"col-auto\">\r\n <coer-button\r\n type=\"icon\"\r\n color=\"navigation\"\r\n icon=\"new\"\r\n [tooltip]=\"addButton.tooltip || 'New'\"\r\n [path]=\"(addButton && addButton.path) ? addButton.path : []\"\r\n [isDisabled]=\"addButton.isDisabled || false\"\r\n [animation]=\"_enableAnimations\"\r\n (onClick)=\"onClickAdd.emit()\"\r\n ></coer-button>\r\n </div>\r\n }\r\n\r\n <!-- Search -->\r\n @if(search.show) {\r\n <div class=\"col-auto\">\r\n <coer-textbox\r\n #inputSearch\r\n [id]=\"_GetId(-1, -1, 'search')\"\r\n [ngModel]=\"_gridSearch()\"\r\n placeholder=\"Search\"\r\n [isDisabled]=\"_isDisabled() || _isLoading\"\r\n [selectOnFocus]=\"true\"\r\n width=\"250px\"\r\n [showSearchIcon]=\"true\"\r\n [showClearIcon]=\"true\"\r\n (onInput)=\"InputChange(-1, 'Search', $event, 'coer-textbox-search')\"\r\n (onClickClear)=\"InputChange(-1, 'Search', '', 'coer-textbox-search')\"\r\n (onKeyupEnter)=\"KeyupEnter(-1, { indexRow: -1 }, 'coer-textbox-search', $event);\"\r\n ></coer-textbox>\r\n </div>\r\n }\r\n </header>\r\n\r\n <section [ngClass]=\"{ 'grid-container': true, 'invisible': isInvisible() }\">\r\n <div [ngStyle]=\"{ 'height': _height, 'min-height': minHeight(), 'max-height': maxHeight() }\">\r\n @if(isLoading()) {\r\n <!-- Grid Message -->\r\n <div class=\"loading\">\r\n <i class=\"spinner-border\"></i>\r\n <span class=\"fa-fade\">Loading</span>\r\n </div>\r\n }\r\n\r\n @else if(!_isDisabled() && gridLength().dataSource <= 0) {\r\n <div class=\"no-data\"> No Data </div>\r\n }\r\n\r\n <table class=\"table table-sm table-responsive table-striped\">\r\n <thead>\r\n <tr>\r\n @if(checkbox.show && gridLength().dataSource > 0) {\r\n <!-- CheckBox Column -->\r\n <th scope=\"col\" class=\"check-box\">\r\n <div *ngIf=\"!_onlyOneCheck\" [ngClass]=\"{ 'invisible': _isLoadingMessage }\">\r\n <coer-checkbox\r\n [id]=\"_GetId(0, 0, 'checkboxAll')\"\r\n [ignoreModel]=\"true\"\r\n [isDisabled]=\"_isDisabled() || _isLoading\"\r\n (onChange)=\"ClickCheck(_GetId(0, 0, 'checkboxAll'), $event, true)\"\r\n ></coer-checkbox>\r\n </div>\r\n </th>\r\n }\r\n\r\n <!-- Dynamic Grid Column -->\r\n @for(header of gridColumns(); track header.indexColumn) {\r\n <th scope=\"col\" (dblclick)=\"Sort(header.columnName)\"\r\n [ngClass]=\"{\r\n 'no-selection': true,\r\n 'cursor-default': !enableSort() && !_isLoading,\r\n 'cursor-pointer': enableSort() && !_isLoading,\r\n 'cursor-wait': _isLoading\r\n }\"\r\n [ngStyle]=\"{\r\n 'width': header.width,\r\n 'text-align': GetAttribute(header.columnName, null, 'textAlign', 'defaul-cell')\r\n }\">\r\n <div class=\"no-selection\">\r\n {{ _GetColumnName(header.columnName) }}\r\n <i [class]=\"_GetShortIcon(header.columnName)\"></i>\r\n </div>\r\n </th>\r\n }\r\n\r\n <!-- Delete Button Column -->\r\n @if(ButtonByRow('showDeleteButton')) {\r\n <th scope=\"col\" class=\"action-button\"></th>\r\n }\r\n\r\n <!-- Edit Button Column -->\r\n @if(ButtonByRow('showEditButton')) {\r\n <th scope=\"col\" class=\"action-button\"></th>\r\n }\r\n\r\n <!-- Edit Button Column -->\r\n @if(ButtonByRow('showGoButton')) {\r\n <th scope=\"col\" class=\"action-button\"></th>\r\n }\r\n </tr>\r\n </thead>\r\n\r\n <!-- body -->\r\n @for(group of gridDataSource(); track group.indexGroup) {\r\n <tbody>\r\n <!--<tr v-if=\"_isGrouped\">\r\n <td :colspan=\"_colspan\" class=\"group\">\r\n <MesAccordion\r\n :ref=\"`accordion${group.indexGroup}-${id}`\"\r\n :title=\"`${_CleanHeaderName(groupBy)} (${group.length}): ${group.groupBy}`\"\r\n :isLoading=\"_isLoading\"\r\n @expanded=\"_ToogleAccordion(group.groupBy, true, group.indexGroup)\"\r\n @collapsed=\"_ToogleAccordion(group.groupBy, false, group.indexGroup)\"\r\n ></MesAccordion>\r\n </td>\r\n </tr>-->\r\n\r\n @for(row of group.rows; track row.indexRow) {\r\n <tr [id]=\"_GetId(row.indexRow, 0, 'row')\"\r\n [ngClass]=\"{ 'loading': isLoading(), 'd-none': _HideRow(group), 'row-focus': (row.indexRow == _indexFocus() && enableRowFocus()) }\"\r\n (click)=\"_indexFocus.set(row.indexRow)\">\r\n\r\n @if(checkbox.show) {\r\n <!-- CheckBox Column -->\r\n <td class=\"check-box\">\r\n <div [ngClass]=\"{ 'invisible': _isLoadingMessage }\">\r\n <coer-checkbox\r\n [id]=\"_GetId(row.indexRow, 0, 'checkbox')\"\r\n [ignoreModel]=\"true\"\r\n [isDisabled]=\"_isDisabled() || _isLoading\"\r\n (onChange)=\"ClickCheck(_GetId(row.indexRow, 0, 'checkbox'), $event, false, row)\"\r\n ></coer-checkbox>\r\n </div>\r\n\r\n <div [ngClass]=\"{ 'invisible': !_isLoadingMessage }\">\r\n <i class=\"spinner-border\"></i>\r\n </div>\r\n </td>\r\n }\r\n\r\n <!-- Dynamic Column -->\r\n @for(header of gridColumns(); track header.indexColumn) {\r\n @if(_IsCellType(header.columnName, row, 'template')) {\r\n <td class=\"template\"\r\n (click)=\"_isDisabled() ? null : onClickRow.emit(row)\"\r\n (dblclick)=\"_isDisabled() ? null : onDoubleClickRow.emit(row)\">\r\n <div [innerHTML]=\"GetAttribute(header.columnName, row, 'template', 'defaul-cell') | html\" class=\"template\"></div>\r\n </td>\r\n }\r\n\r\n @else if(_IsCellType(header.columnName, row, 'coerTextbox')) {\r\n <!-- coer-textbox -->\r\n <td class=\"coer-textbox\">\r\n <coer-textbox\r\n [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [(ngModel)]=\"row[header.columnName]\"\r\n [isDisabled]=\"GetAttribute(header.columnName, row, 'isDisabled', 'coerTextbox') || _isDisabled() || _isLoading\"\r\n [isValid]=\"GetAttribute(header.columnName, row, 'isValid', 'coerTextbox') || false\"\r\n [isInvalid]=\"GetAttribute(header.columnName, row, 'isInvalid', 'coerTextbox') || false\"\r\n [selectOnFocus]=\"GetAttribute(header.columnName, row, 'selectOnFocus', 'coerTextbox') || true\"\r\n [placeholder]=\"GetAttribute(header.columnName, row, 'placeholder', 'coerTextbox') || ('Type ' + header.columnName + '...')\"\r\n [textPosition]=\"GetAttribute(header.columnName, row, 'textPosition', 'coerTextbox') || 'left'\"\r\n [minLength]=\"GetAttribute(header.columnName, row, 'minLength', 'coerTextbox') || 0\"\r\n [maxLength]=\"GetAttribute(header.columnName, row, 'maxLength', 'coerTextbox') || 50\"\r\n (onInput)=\"InputChange(row.indexRow, header.columnName, $event, 'coer-textbox')\"\r\n (onKeyupEnter)=\"KeyupEnter(header.indexColumn, row, 'coer-textbox', $event)\"\r\n ></coer-textbox>\r\n </td>\r\n }\r\n\r\n\r\n @else if(_IsCellType(header.columnName, row, 'coerNumberbox')) {\r\n <!-- coer-numberbox -->\r\n <td class=\"coer-numberbox\">\r\n <coer-numberbox\r\n [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [(ngModel)]=\"row[header.columnName]\"\r\n [isDisabled]=\"GetAttribute(header.columnName, row, 'isDisabled', 'coerNumberbox') || _isDisabled() || _isLoading\"\r\n [isValid]=\"GetAttribute(header.columnName, row, 'isValid', 'coerNumberbox') || false\"\r\n [isInvalid]=\"GetAttribute(header.columnName, row, 'isInvalid', 'coerNumberbox') || false\"\r\n [selectOnFocus]=\"GetAttribute(header.columnName, row, 'selectOnFocus', 'coerNumberbox') || true\"\r\n [placeholder]=\"GetAttribute(header.columnName, row, 'placeholder', 'coerNumberbox') || ''\"\r\n [textPosition]=\"GetAttribute(header.columnName, row, 'textPosition', 'coerNumberbox') || 'right'\"\r\n [min]=\"GetAttribute(header.columnName, row, 'min', 'coerNumberbox') || 0\"\r\n [max]=\"GetAttribute(header.columnName, row, 'max', 'coerNumberbox') || 2147483647\"\r\n [decimals]=\"GetAttribute(header.columnName, row, 'decimals', 'coerNumberbox') || 0\"\r\n (onInput)=\"InputChange(row.indexRow, header.columnName, $event, 'coer-numberbox')\"\r\n (onKeyupEnter)=\"KeyupEnter(header.indexColumn, row, 'coer-numberbox', $event)\"\r\n ></coer-numberbox>\r\n </td>\r\n }\r\n\r\n\r\n @else if(_IsCellType(header.columnName, row, 'coerSelectbox')) {\r\n <!-- coer-numberbox -->\r\n <td class=\"coer-selectbox\">\r\n <coer-selectbox\r\n [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [(ngModel)]=\"row[header.columnName]\"\r\n [isDisabled]=\"GetAttribute(header.columnName, row, 'isDisabled', 'coerSelectbox') || _isDisabled() || _isLoading\"\r\n [isValid]=\"GetAttribute(header.columnName, row, 'isValid', 'coerSelectbox') || false\"\r\n [isInvalid]=\"GetAttribute(header.columnName, row, 'isInvalid', 'coerSelectbox') || false\"\r\n [dataSource]=\"GetAttribute(header.columnName, row, 'dataSource', 'coerSelectbox') || []\"\r\n [placeholder]=\"GetAttribute(header.columnName, row, 'placeholder', 'coerSelectbox') || '-- Select --'\"\r\n [propDisplay]=\"GetAttribute(header.columnName, row, 'propDisplay', 'coerSelectbox') || 'name'\"\r\n (onSelected)=\"InputChange(row.indexRow, header.columnName, $event, 'coer-selectbox'); KeyupEnter(header.indexColumn, row, 'coer-selectbox', $event)\"\r\n ></coer-selectbox>\r\n </td>\r\n }\r\n\r\n\r\n @else if(_IsCellType(header.columnName, row, 'coerSwitch')) {\r\n <!-- coer-switch -->\r\n <td>\r\n <coer-switch\r\n [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [(ngModel)]=\"row[header.columnName]\"\r\n [isDisabled]=\"GetAttribute(header.columnName, row, 'isDisabled', 'coerSwitch') || _isDisabled() || _isLoading\"\r\n [tooltip]=\"GetAttribute(header.columnName, row, 'tooltip', 'coerSwitch')\"\r\n [tooltipPosition]=\"GetAttribute(header.columnName, row, 'tooltipPosition', 'coerSwitch') || 'left'\"\r\n [isInvisible]=\"_isDisabled()\"\r\n (onChange)=\"InputChange(row.indexRow, header.columnName, $event, 'coer-switch')\"\r\n ></coer-switch>\r\n </td>\r\n }\r\n\r\n @else {\r\n <!-- Default Cell -->\r\n <td class=\"default-cell\"\r\n (click)=\"ClickOnRow(row)\"\r\n (dblclick)=\"_isDisabled() ? null : onDoubleClickRow.emit(row)\"\r\n [ngStyle]=\"{\r\n 'text-align': GetAttribute(header.columnName, row, 'textAlign', 'defaul-cell'),\r\n 'white-space': 'normal'\r\n }\">\r\n\r\n <div [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [ngClass]=\"{\r\n 'text-blue-bold': _IsCellColor(header.columnName, row, 'colorBlue'),\r\n 'text-green-bold': _IsCellColor(header.columnName, row, 'colorGreen'),\r\n 'text-yellow-bold': _IsCellColor(header.columnName, row, 'colorYellow'),\r\n 'text-red-bold': _IsCellColor(header.columnName, row, 'colorRed'),\r\n 'text-right-bold': _IsCellType(header.columnName, row, 'number')\r\n }\">\r\n\r\n @if(_IsCellType(header.columnName, row, 'number')) {\r\n <span> {{ GetNumericFormat(row[header.columnName]) }} </span>\r\n }\r\n\r\n @else if(_IsCellType(header.columnName, row, 'date')) {\r\n <span> {{ GetDateFormat(row[header.columnName]) }} </span>\r\n }\r\n\r\n @else {\r\n <span> {{ _GetCellValue(row, header.columnName) }} </span>\r\n }\r\n </div>\r\n </td>\r\n }\r\n }\r\n\r\n <!-- Delete Button -->\r\n @if(ButtonByRow('showDeleteButton')) {\r\n <td class=\"action-button\">\r\n @if(ButtonByRow('showDeleteButton', row)) {\r\n <coer-button\r\n type=\"icon-no-border\"\r\n color=\"navigation\"\r\n icon=\"delete\"\r\n [tooltip]=\"_GetTooltip('Delete', row)\"\r\n [isInvisible]=\"_isDisabled()\"\r\n [isDisabled]=\"_isLoading\"\r\n (onClick)=\"onClickDeleteRow.emit(row)\"\r\n ></coer-button>\r\n }\r\n </td>\r\n }\r\n\r\n <!-- Edit Button -->\r\n @if(ButtonByRow('showEditButton')) {\r\n <td class=\"action-button\">\r\n @if(ButtonByRow('showEditButton', row)) {\r\n <coer-button\r\n type=\"icon-no-border\"\r\n color=\"navigation\"\r\n icon=\"edit\"\r\n [tooltip]=\"_GetTooltip('Edit', row)\"\r\n [isInvisible]=\"_isDisabled()\"\r\n [isDisabled]=\"_isLoading\"\r\n (onClick)=\"onClickEditRow.emit(row)\"\r\n ></coer-button>\r\n }\r\n </td>\r\n }\r\n\r\n <!-- GO Button -->\r\n @if(ButtonByRow('showGoButton')) {\r\n <td class=\"action-button\">\r\n @if(ButtonByRow('showGoButton', row)) {\r\n <coer-button\r\n type=\"icon-no-border\"\r\n color=\"navigation\"\r\n icon=\"go\"\r\n [tooltip]=\"_GetTooltip('Go to', row, 'detail')\"\r\n [isInvisible]=\"_isDisabled()\"\r\n [isDisabled]=\"_isLoading\"\r\n (onClick)=\"onClickEditRow.emit(row)\"\r\n ></coer-button>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n }\r\n </table>\r\n </div>\r\n </section>\r\n\r\n @if(showFooter()) {\r\n <footer class=\"grid-footer\">\r\n <span>\r\n @if(_isLoadingMessage) {\r\n <span class=\"fa-fade\"> Loading </span>\r\n }\r\n\r\n @else if(gridLength().dataSourceSelected > 0) {\r\n <span>\r\n <i class=\"bi bi-check2-square ms-1\"></i>\r\n {{ gridLength().dataSourceSelected }}\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"me-1\"> {{ gridLength().dataSourceFiltered | numericFormat }} Rows </span>\r\n </footer>\r\n }\r\n</div>", styles: ["div.coer-grid .text-blue{color:#0d6efd!important}div.coer-grid .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-grid .background-blue{background-color:#0d6efd!important}div.coer-grid .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-grid .border-blue{border-color:#0d6efd!important}div.coer-grid .text-gray{color:#6c757d!important}div.coer-grid .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-grid .background-gray{background-color:#6c757d!important}div.coer-grid .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-grid .border-gray{border-color:#6c757d!important}div.coer-grid .text-green{color:#198754!important}div.coer-grid .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-grid .background-green{background-color:#198754!important}div.coer-grid .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-grid .border-green{border-color:#198754!important}div.coer-grid .text-yellow{color:#ffc107!important}div.coer-grid .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-grid .background-yellow{background-color:#ffc107!important}div.coer-grid .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-grid .border-yellow{border-color:#ffc107!important}div.coer-grid .text-red{color:#dc3545!important}div.coer-grid .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-grid .background-red{background-color:#dc3545!important}div.coer-grid .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-grid .border-red{border-color:#dc3545!important}div.coer-grid .text-white{color:#f5f5f5!important}div.coer-grid .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-grid .background-white{background-color:#f5f5f5!important}div.coer-grid .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-grid .border-white{border-color:#f5f5f5!important}div.coer-grid .text-black{color:#252525!important}div.coer-grid .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-grid .background-black{background-color:#252525!important}div.coer-grid .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-grid .border-black{border-color:#252525!important}div.coer-grid .text-orange{color:#fd6031!important}div.coer-grid .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-grid .background-orange{background-color:#fd6031!important}div.coer-grid .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-grid .border-orange{border-color:#fd6031!important}div.coer-grid header{align-items:flex-end;justify-content:flex-end;padding-right:8px;margin:0}div.coer-grid header>div{padding:0 0 10px 10px;display:flex;align-items:baseline}div.coer-grid header>div a{height:40px!important}div.coer-grid table{table-layout:auto;border-collapse:separate;border-spacing:1px 0px;margin:0;font-size:14px}div.coer-grid table thead tr th{position:sticky!important;z-index:100!important;top:0!important;background-color:#6c757d!important;color:#f5f5f5!important;padding:5px!important;vertical-align:middle!important;overflow:hidden;text-overflow:ellipsis;word-wrap:break-word;min-width:50px!important;white-space:nowrap!important}div.coer-grid table tbody{border:0px!important}div.coer-grid table tbody tr:not(.row-focus):hover td{color:#000!important;background-color:#f1f6ff!important}div.coer-grid table tbody tr td{border:0px!important;padding:5px!important;vertical-align:middle!important;white-space:break-spaces;text-overflow:ellipsis;overflow:hidden}div.coer-grid table tbody tr.row-focus td{background-color:#cde1ff}div.coer-grid table tbody tr td.coer-textbox,div.coer-grid table tbody tr td.coer-numberbox,div.coer-grid table tbody tr td.coer-selectbox{padding:0!important;overflow:visible!important}div.coer-grid table tbody tr td.default-cell{cursor:pointer!important}div.coer-grid table tbody tr td.template{display:block!important;white-space:nowrap!important;cursor:pointer!important;height:31px}div.coer-grid table tbody tr td.template>div.template{display:block!important}div.coer-grid table thead tr th.action-button,div.coer-grid table thead tr td.action-button,div.coer-grid table thead tr th.check-box,div.coer-grid table thead tr td.check-box,div.coer-grid table tbody tr th.action-button,div.coer-grid table tbody tr td.action-button,div.coer-grid table tbody tr th.check-box table tbody tr td.check-box{text-align:center!important;cursor:default!important;min-width:40px!important;max-width:40px!important;width:40px!important;padding:0!important}div.coer-grid footer.grid-footer{display:flex;align-items:center;justify-content:space-between;font-size:small;color:#999;padding-top:5px}div.coer-grid section.grid-container{position:relative;overflow:auto}div.coer-grid div.loading,div.coer-grid div.no-data{position:absolute;display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:25px;color:gray}div.coer-grid div.loading{background-color:#bbbbbb83!important;flex-direction:column!important;gap:10px!important}div.coer-grid div.loading span.fa-fade{position:relative!important;top:50px!important}div.coer-grid tr.loading{background-color:#bbbbbb83!important}div.coer-grid div.loading i.spinner-border{color:#fd6031!important;width:70px!important;height:70px!important;font-size:20px!important;position:absolute!important}div.coer-grid td.check-box i.spinner-border{width:15px!important;height:15px!important;color:#fd6031!important}div.coer-grid table thead tr th.check-box>div,div.coer-grid table tbody tr td.check-box>div{display:flex;align-items:center;justify-content:center;cursor:default!important}div.coer-grid input.form-check-input{box-shadow:none!important;margin:0}div.coer-grid input[type=checkbox]{cursor:pointer!important}div.coer-grid td.group{padding:0!important;margin:0!important}div.coer-grid td.group>*{border-top:1px solid #6c757d!important;border-bottom:1px solid #6c757d!important;padding:0!important;margin:0!important}div.coer-grid .template,div.coer-grid .template div{white-space:nowrap!important;display:flex!important;align-items:center!important;gap:5px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CoerButton, selector: "coer-button", inputs: ["id", "color", "type", "icon", "iconPosition", "animation", "isLoading", "isDisabled", "isInvisible", "width", "minWidth", "height", "minHeight", "marginTop", "marginRight", "marginBottom", "marginLeft", "path", "tooltipPosition", "tooltip"], outputs: ["onClick"] }, { kind: "component", type: CoerCheckbox, selector: "coer-checkbox", inputs: ["value", "id", "label", "labelPosition", "isDisabled", "isLoading", "isInvisible", "ignoreModel"], outputs: ["onChange"] }, { kind: "component", type: CoerNumberBox, selector: "coer-numberbox", inputs: ["value", "id", "label", "placeholder", "min", "max", "decimals", "width", "minWidth", "maxWidth", "marginTop", "marginRight", "marginBottom", "marginLeft", "isInvalid", "isValid", "isDisabled", "isReadonly", "isLoading", "selectOnFocus", "textPosition"], outputs: ["onKeyupEnter", "onInput"] }, { kind: "component", type: CoerSelectbox, selector: "coer-selectbox", inputs: ["value", "id", "label", "dataSource", "propDisplay", "rowsByPage", "placeholder", "width", "minWidth", "maxWidth", "marginTop", "marginRight", "marginBottom", "marginLeft", "isInvalid", "isValid", "isDisabled", "isReadonly", "isLoading"], outputs: ["onSelected"] }, { kind: "component", type: CoerSwitch, selector: "coer-switch", inputs: ["value", "id", "label", "labelPosition", "isDisabled", "isLoading", "isInvisible", "tooltipPosition", "tooltip"], outputs: ["onChange"] }, { kind: "component", type: CoerTextBox, selector: "coer-textbox", inputs: ["value", "id", "label", "placeholder", "minLength", "maxLength", "showSearchIcon", "showClearIcon", "width", "minWidth", "maxWidth", "marginTop", "marginRight", "marginBottom", "marginLeft", "isInvalid", "isValid", "isDisabled", "isReadonly", "isLoading", "selectOnFocus", "textPosition"], outputs: ["onKeyupEnter", "onInput", "onClickClear"] }, { kind: "pipe", type: HtmlPipe, name: "html" }, { kind: "pipe", type: NumericFormatPipe, name: "numericFormat" }] }); }
|
3075
|
+
}
|
3076
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerGrid, decorators: [{
|
3077
|
+
type: Component,
|
3078
|
+
args: [{ selector: 'coer-grid', providers: [CONTROL_VALUE(CoerGrid)], template: "<div class=\"coer-grid\" [ngStyle]=\"{ 'width': width(), 'min-Width': MinWidth(), 'max-Width': MaxWidth(), 'margin': margin() }\">\r\n <header [id]=\"_id + '-header'\" class=\"row\">\r\n <!-- Slot -->\r\n <ng-content></ng-content>\r\n\r\n <!-- Export Button -->\r\n @if(exportButton.show && gridLength().dataSource > 0) {\r\n <div class=\"col-auto\">\r\n <coer-button\r\n type=\"icon\"\r\n color=\"navigation\"\r\n icon=\"excel\"\r\n [tooltip]=\"_isLoading ? 'Loading' : (exportButton.tooltip || 'Export')\"\r\n [path]=\"(exportButton && exportButton.path) ? exportButton.path : []\"\r\n [isDisabled]=\"_isDisabled() || _isLoading || (exportButton.isDisabled || false)\"\r\n [isLoading]=\"_isLoading\"\r\n [animation]=\"_enableAnimations\"\r\n (onClick)=\"Export(!exportButton.preventDefault)\"\r\n ></coer-button>\r\n </div>\r\n }\r\n\r\n <!-- Import Button -->\r\n @if(importButton.show) {\r\n <div class=\"col-auto\">\r\n <input type=\"file\" #inputFileRef [multiple]=\"false\" (change)=\"Import($event)\">\r\n\r\n <coer-button\r\n type=\"icon\"\r\n color=\"navigation\"\r\n icon=\"import\"\r\n [tooltip]=\"importButton.tooltip || 'Import'\"\r\n [path]=\"(importButton && importButton.path) ? importButton.path : []\"\r\n [isDisabled]=\"importButton.isDisabled || false\"\r\n [animation]=\"_enableAnimations\"\r\n (onClick)=\"Import()\"\r\n ></coer-button>\r\n </div>\r\n }\r\n\r\n <!-- Add Button -->\r\n @if(addButton.show) {\r\n <div class=\"col-auto\">\r\n <coer-button\r\n type=\"icon\"\r\n color=\"navigation\"\r\n icon=\"new\"\r\n [tooltip]=\"addButton.tooltip || 'New'\"\r\n [path]=\"(addButton && addButton.path) ? addButton.path : []\"\r\n [isDisabled]=\"addButton.isDisabled || false\"\r\n [animation]=\"_enableAnimations\"\r\n (onClick)=\"onClickAdd.emit()\"\r\n ></coer-button>\r\n </div>\r\n }\r\n\r\n <!-- Search -->\r\n @if(search.show) {\r\n <div class=\"col-auto\">\r\n <coer-textbox\r\n #inputSearch\r\n [id]=\"_GetId(-1, -1, 'search')\"\r\n [ngModel]=\"_gridSearch()\"\r\n placeholder=\"Search\"\r\n [isDisabled]=\"_isDisabled() || _isLoading\"\r\n [selectOnFocus]=\"true\"\r\n width=\"250px\"\r\n [showSearchIcon]=\"true\"\r\n [showClearIcon]=\"true\"\r\n (onInput)=\"InputChange(-1, 'Search', $event, 'coer-textbox-search')\"\r\n (onClickClear)=\"InputChange(-1, 'Search', '', 'coer-textbox-search')\"\r\n (onKeyupEnter)=\"KeyupEnter(-1, { indexRow: -1 }, 'coer-textbox-search', $event);\"\r\n ></coer-textbox>\r\n </div>\r\n }\r\n </header>\r\n\r\n <section [ngClass]=\"{ 'grid-container': true, 'invisible': isInvisible() }\">\r\n <div [ngStyle]=\"{ 'height': _height, 'min-height': minHeight(), 'max-height': maxHeight() }\">\r\n @if(isLoading()) {\r\n <!-- Grid Message -->\r\n <div class=\"loading\">\r\n <i class=\"spinner-border\"></i>\r\n <span class=\"fa-fade\">Loading</span>\r\n </div>\r\n }\r\n\r\n @else if(!_isDisabled() && gridLength().dataSource <= 0) {\r\n <div class=\"no-data\"> No Data </div>\r\n }\r\n\r\n <table class=\"table table-sm table-responsive table-striped\">\r\n <thead>\r\n <tr>\r\n @if(checkbox.show && gridLength().dataSource > 0) {\r\n <!-- CheckBox Column -->\r\n <th scope=\"col\" class=\"check-box\">\r\n <div *ngIf=\"!_onlyOneCheck\" [ngClass]=\"{ 'invisible': _isLoadingMessage }\">\r\n <coer-checkbox\r\n [id]=\"_GetId(0, 0, 'checkboxAll')\"\r\n [ignoreModel]=\"true\"\r\n [isDisabled]=\"_isDisabled() || _isLoading\"\r\n (onChange)=\"ClickCheck(_GetId(0, 0, 'checkboxAll'), $event, true)\"\r\n ></coer-checkbox>\r\n </div>\r\n </th>\r\n }\r\n\r\n <!-- Dynamic Grid Column -->\r\n @for(header of gridColumns(); track header.indexColumn) {\r\n <th scope=\"col\" (dblclick)=\"Sort(header.columnName)\"\r\n [ngClass]=\"{\r\n 'no-selection': true,\r\n 'cursor-default': !enableSort() && !_isLoading,\r\n 'cursor-pointer': enableSort() && !_isLoading,\r\n 'cursor-wait': _isLoading\r\n }\"\r\n [ngStyle]=\"{\r\n 'width': header.width,\r\n 'text-align': GetAttribute(header.columnName, null, 'textAlign', 'defaul-cell')\r\n }\">\r\n <div class=\"no-selection\">\r\n {{ _GetColumnName(header.columnName) }}\r\n <i [class]=\"_GetShortIcon(header.columnName)\"></i>\r\n </div>\r\n </th>\r\n }\r\n\r\n <!-- Delete Button Column -->\r\n @if(ButtonByRow('showDeleteButton')) {\r\n <th scope=\"col\" class=\"action-button\"></th>\r\n }\r\n\r\n <!-- Edit Button Column -->\r\n @if(ButtonByRow('showEditButton')) {\r\n <th scope=\"col\" class=\"action-button\"></th>\r\n }\r\n\r\n <!-- Edit Button Column -->\r\n @if(ButtonByRow('showGoButton')) {\r\n <th scope=\"col\" class=\"action-button\"></th>\r\n }\r\n </tr>\r\n </thead>\r\n\r\n <!-- body -->\r\n @for(group of gridDataSource(); track group.indexGroup) {\r\n <tbody>\r\n <!--<tr v-if=\"_isGrouped\">\r\n <td :colspan=\"_colspan\" class=\"group\">\r\n <MesAccordion\r\n :ref=\"`accordion${group.indexGroup}-${id}`\"\r\n :title=\"`${_CleanHeaderName(groupBy)} (${group.length}): ${group.groupBy}`\"\r\n :isLoading=\"_isLoading\"\r\n @expanded=\"_ToogleAccordion(group.groupBy, true, group.indexGroup)\"\r\n @collapsed=\"_ToogleAccordion(group.groupBy, false, group.indexGroup)\"\r\n ></MesAccordion>\r\n </td>\r\n </tr>-->\r\n\r\n @for(row of group.rows; track row.indexRow) {\r\n <tr [id]=\"_GetId(row.indexRow, 0, 'row')\"\r\n [ngClass]=\"{ 'loading': isLoading(), 'd-none': _HideRow(group), 'row-focus': (row.indexRow == _indexFocus() && enableRowFocus()) }\"\r\n (click)=\"_indexFocus.set(row.indexRow)\">\r\n\r\n @if(checkbox.show) {\r\n <!-- CheckBox Column -->\r\n <td class=\"check-box\">\r\n <div [ngClass]=\"{ 'invisible': _isLoadingMessage }\">\r\n <coer-checkbox\r\n [id]=\"_GetId(row.indexRow, 0, 'checkbox')\"\r\n [ignoreModel]=\"true\"\r\n [isDisabled]=\"_isDisabled() || _isLoading\"\r\n (onChange)=\"ClickCheck(_GetId(row.indexRow, 0, 'checkbox'), $event, false, row)\"\r\n ></coer-checkbox>\r\n </div>\r\n\r\n <div [ngClass]=\"{ 'invisible': !_isLoadingMessage }\">\r\n <i class=\"spinner-border\"></i>\r\n </div>\r\n </td>\r\n }\r\n\r\n <!-- Dynamic Column -->\r\n @for(header of gridColumns(); track header.indexColumn) {\r\n @if(_IsCellType(header.columnName, row, 'template')) {\r\n <td class=\"template\"\r\n (click)=\"_isDisabled() ? null : onClickRow.emit(row)\"\r\n (dblclick)=\"_isDisabled() ? null : onDoubleClickRow.emit(row)\">\r\n <div [innerHTML]=\"GetAttribute(header.columnName, row, 'template', 'defaul-cell') | html\" class=\"template\"></div>\r\n </td>\r\n }\r\n\r\n @else if(_IsCellType(header.columnName, row, 'coerTextbox')) {\r\n <!-- coer-textbox -->\r\n <td class=\"coer-textbox\">\r\n <coer-textbox\r\n [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [(ngModel)]=\"row[header.columnName]\"\r\n [isDisabled]=\"GetAttribute(header.columnName, row, 'isDisabled', 'coerTextbox') || _isDisabled() || _isLoading\"\r\n [isValid]=\"GetAttribute(header.columnName, row, 'isValid', 'coerTextbox') || false\"\r\n [isInvalid]=\"GetAttribute(header.columnName, row, 'isInvalid', 'coerTextbox') || false\"\r\n [selectOnFocus]=\"GetAttribute(header.columnName, row, 'selectOnFocus', 'coerTextbox') || true\"\r\n [placeholder]=\"GetAttribute(header.columnName, row, 'placeholder', 'coerTextbox') || ('Type ' + header.columnName + '...')\"\r\n [textPosition]=\"GetAttribute(header.columnName, row, 'textPosition', 'coerTextbox') || 'left'\"\r\n [minLength]=\"GetAttribute(header.columnName, row, 'minLength', 'coerTextbox') || 0\"\r\n [maxLength]=\"GetAttribute(header.columnName, row, 'maxLength', 'coerTextbox') || 50\"\r\n (onInput)=\"InputChange(row.indexRow, header.columnName, $event, 'coer-textbox')\"\r\n (onKeyupEnter)=\"KeyupEnter(header.indexColumn, row, 'coer-textbox', $event)\"\r\n ></coer-textbox>\r\n </td>\r\n }\r\n\r\n\r\n @else if(_IsCellType(header.columnName, row, 'coerNumberbox')) {\r\n <!-- coer-numberbox -->\r\n <td class=\"coer-numberbox\">\r\n <coer-numberbox\r\n [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [(ngModel)]=\"row[header.columnName]\"\r\n [isDisabled]=\"GetAttribute(header.columnName, row, 'isDisabled', 'coerNumberbox') || _isDisabled() || _isLoading\"\r\n [isValid]=\"GetAttribute(header.columnName, row, 'isValid', 'coerNumberbox') || false\"\r\n [isInvalid]=\"GetAttribute(header.columnName, row, 'isInvalid', 'coerNumberbox') || false\"\r\n [selectOnFocus]=\"GetAttribute(header.columnName, row, 'selectOnFocus', 'coerNumberbox') || true\"\r\n [placeholder]=\"GetAttribute(header.columnName, row, 'placeholder', 'coerNumberbox') || ''\"\r\n [textPosition]=\"GetAttribute(header.columnName, row, 'textPosition', 'coerNumberbox') || 'right'\"\r\n [min]=\"GetAttribute(header.columnName, row, 'min', 'coerNumberbox') || 0\"\r\n [max]=\"GetAttribute(header.columnName, row, 'max', 'coerNumberbox') || 2147483647\"\r\n [decimals]=\"GetAttribute(header.columnName, row, 'decimals', 'coerNumberbox') || 0\"\r\n (onInput)=\"InputChange(row.indexRow, header.columnName, $event, 'coer-numberbox')\"\r\n (onKeyupEnter)=\"KeyupEnter(header.indexColumn, row, 'coer-numberbox', $event)\"\r\n ></coer-numberbox>\r\n </td>\r\n }\r\n\r\n\r\n @else if(_IsCellType(header.columnName, row, 'coerSelectbox')) {\r\n <!-- coer-numberbox -->\r\n <td class=\"coer-selectbox\">\r\n <coer-selectbox\r\n [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [(ngModel)]=\"row[header.columnName]\"\r\n [isDisabled]=\"GetAttribute(header.columnName, row, 'isDisabled', 'coerSelectbox') || _isDisabled() || _isLoading\"\r\n [isValid]=\"GetAttribute(header.columnName, row, 'isValid', 'coerSelectbox') || false\"\r\n [isInvalid]=\"GetAttribute(header.columnName, row, 'isInvalid', 'coerSelectbox') || false\"\r\n [dataSource]=\"GetAttribute(header.columnName, row, 'dataSource', 'coerSelectbox') || []\"\r\n [placeholder]=\"GetAttribute(header.columnName, row, 'placeholder', 'coerSelectbox') || '-- Select --'\"\r\n [propDisplay]=\"GetAttribute(header.columnName, row, 'propDisplay', 'coerSelectbox') || 'name'\"\r\n (onSelected)=\"InputChange(row.indexRow, header.columnName, $event, 'coer-selectbox'); KeyupEnter(header.indexColumn, row, 'coer-selectbox', $event)\"\r\n ></coer-selectbox>\r\n </td>\r\n }\r\n\r\n\r\n @else if(_IsCellType(header.columnName, row, 'coerSwitch')) {\r\n <!-- coer-switch -->\r\n <td>\r\n <coer-switch\r\n [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [(ngModel)]=\"row[header.columnName]\"\r\n [isDisabled]=\"GetAttribute(header.columnName, row, 'isDisabled', 'coerSwitch') || _isDisabled() || _isLoading\"\r\n [tooltip]=\"GetAttribute(header.columnName, row, 'tooltip', 'coerSwitch')\"\r\n [tooltipPosition]=\"GetAttribute(header.columnName, row, 'tooltipPosition', 'coerSwitch') || 'left'\"\r\n [isInvisible]=\"_isDisabled()\"\r\n (onChange)=\"InputChange(row.indexRow, header.columnName, $event, 'coer-switch')\"\r\n ></coer-switch>\r\n </td>\r\n }\r\n\r\n @else {\r\n <!-- Default Cell -->\r\n <td class=\"default-cell\"\r\n (click)=\"ClickOnRow(row)\"\r\n (dblclick)=\"_isDisabled() ? null : onDoubleClickRow.emit(row)\"\r\n [ngStyle]=\"{\r\n 'text-align': GetAttribute(header.columnName, row, 'textAlign', 'defaul-cell'),\r\n 'white-space': 'normal'\r\n }\">\r\n\r\n <div [id]=\"_GetId(row.indexRow, header.indexColumn)\"\r\n [ngClass]=\"{\r\n 'text-blue-bold': _IsCellColor(header.columnName, row, 'colorBlue'),\r\n 'text-green-bold': _IsCellColor(header.columnName, row, 'colorGreen'),\r\n 'text-yellow-bold': _IsCellColor(header.columnName, row, 'colorYellow'),\r\n 'text-red-bold': _IsCellColor(header.columnName, row, 'colorRed'),\r\n 'text-right-bold': _IsCellType(header.columnName, row, 'number')\r\n }\">\r\n\r\n @if(_IsCellType(header.columnName, row, 'number')) {\r\n <span> {{ GetNumericFormat(row[header.columnName]) }} </span>\r\n }\r\n\r\n @else if(_IsCellType(header.columnName, row, 'date')) {\r\n <span> {{ GetDateFormat(row[header.columnName]) }} </span>\r\n }\r\n\r\n @else {\r\n <span> {{ _GetCellValue(row, header.columnName) }} </span>\r\n }\r\n </div>\r\n </td>\r\n }\r\n }\r\n\r\n <!-- Delete Button -->\r\n @if(ButtonByRow('showDeleteButton')) {\r\n <td class=\"action-button\">\r\n @if(ButtonByRow('showDeleteButton', row)) {\r\n <coer-button\r\n type=\"icon-no-border\"\r\n color=\"navigation\"\r\n icon=\"delete\"\r\n [tooltip]=\"_GetTooltip('Delete', row)\"\r\n [isInvisible]=\"_isDisabled()\"\r\n [isDisabled]=\"_isLoading\"\r\n (onClick)=\"onClickDeleteRow.emit(row)\"\r\n ></coer-button>\r\n }\r\n </td>\r\n }\r\n\r\n <!-- Edit Button -->\r\n @if(ButtonByRow('showEditButton')) {\r\n <td class=\"action-button\">\r\n @if(ButtonByRow('showEditButton', row)) {\r\n <coer-button\r\n type=\"icon-no-border\"\r\n color=\"navigation\"\r\n icon=\"edit\"\r\n [tooltip]=\"_GetTooltip('Edit', row)\"\r\n [isInvisible]=\"_isDisabled()\"\r\n [isDisabled]=\"_isLoading\"\r\n (onClick)=\"onClickEditRow.emit(row)\"\r\n ></coer-button>\r\n }\r\n </td>\r\n }\r\n\r\n <!-- GO Button -->\r\n @if(ButtonByRow('showGoButton')) {\r\n <td class=\"action-button\">\r\n @if(ButtonByRow('showGoButton', row)) {\r\n <coer-button\r\n type=\"icon-no-border\"\r\n color=\"navigation\"\r\n icon=\"go\"\r\n [tooltip]=\"_GetTooltip('Go to', row, 'detail')\"\r\n [isInvisible]=\"_isDisabled()\"\r\n [isDisabled]=\"_isLoading\"\r\n (onClick)=\"onClickEditRow.emit(row)\"\r\n ></coer-button>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n }\r\n </table>\r\n </div>\r\n </section>\r\n\r\n @if(showFooter()) {\r\n <footer class=\"grid-footer\">\r\n <span>\r\n @if(_isLoadingMessage) {\r\n <span class=\"fa-fade\"> Loading </span>\r\n }\r\n\r\n @else if(gridLength().dataSourceSelected > 0) {\r\n <span>\r\n <i class=\"bi bi-check2-square ms-1\"></i>\r\n {{ gridLength().dataSourceSelected }}\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"me-1\"> {{ gridLength().dataSourceFiltered | numericFormat }} Rows </span>\r\n </footer>\r\n }\r\n</div>", styles: ["div.coer-grid .text-blue{color:#0d6efd!important}div.coer-grid .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-grid .background-blue{background-color:#0d6efd!important}div.coer-grid .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-grid .border-blue{border-color:#0d6efd!important}div.coer-grid .text-gray{color:#6c757d!important}div.coer-grid .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-grid .background-gray{background-color:#6c757d!important}div.coer-grid .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-grid .border-gray{border-color:#6c757d!important}div.coer-grid .text-green{color:#198754!important}div.coer-grid .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-grid .background-green{background-color:#198754!important}div.coer-grid .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-grid .border-green{border-color:#198754!important}div.coer-grid .text-yellow{color:#ffc107!important}div.coer-grid .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-grid .background-yellow{background-color:#ffc107!important}div.coer-grid .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-grid .border-yellow{border-color:#ffc107!important}div.coer-grid .text-red{color:#dc3545!important}div.coer-grid .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-grid .background-red{background-color:#dc3545!important}div.coer-grid .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-grid .border-red{border-color:#dc3545!important}div.coer-grid .text-white{color:#f5f5f5!important}div.coer-grid .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-grid .background-white{background-color:#f5f5f5!important}div.coer-grid .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-grid .border-white{border-color:#f5f5f5!important}div.coer-grid .text-black{color:#252525!important}div.coer-grid .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-grid .background-black{background-color:#252525!important}div.coer-grid .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-grid .border-black{border-color:#252525!important}div.coer-grid .text-orange{color:#fd6031!important}div.coer-grid .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-grid .background-orange{background-color:#fd6031!important}div.coer-grid .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-grid .border-orange{border-color:#fd6031!important}div.coer-grid header{align-items:flex-end;justify-content:flex-end;padding-right:8px;margin:0}div.coer-grid header>div{padding:0 0 10px 10px;display:flex;align-items:baseline}div.coer-grid header>div a{height:40px!important}div.coer-grid table{table-layout:auto;border-collapse:separate;border-spacing:1px 0px;margin:0;font-size:14px}div.coer-grid table thead tr th{position:sticky!important;z-index:100!important;top:0!important;background-color:#6c757d!important;color:#f5f5f5!important;padding:5px!important;vertical-align:middle!important;overflow:hidden;text-overflow:ellipsis;word-wrap:break-word;min-width:50px!important;white-space:nowrap!important}div.coer-grid table tbody{border:0px!important}div.coer-grid table tbody tr:not(.row-focus):hover td{color:#000!important;background-color:#f1f6ff!important}div.coer-grid table tbody tr td{border:0px!important;padding:5px!important;vertical-align:middle!important;white-space:break-spaces;text-overflow:ellipsis;overflow:hidden}div.coer-grid table tbody tr.row-focus td{background-color:#cde1ff}div.coer-grid table tbody tr td.coer-textbox,div.coer-grid table tbody tr td.coer-numberbox,div.coer-grid table tbody tr td.coer-selectbox{padding:0!important;overflow:visible!important}div.coer-grid table tbody tr td.default-cell{cursor:pointer!important}div.coer-grid table tbody tr td.template{display:block!important;white-space:nowrap!important;cursor:pointer!important;height:31px}div.coer-grid table tbody tr td.template>div.template{display:block!important}div.coer-grid table thead tr th.action-button,div.coer-grid table thead tr td.action-button,div.coer-grid table thead tr th.check-box,div.coer-grid table thead tr td.check-box,div.coer-grid table tbody tr th.action-button,div.coer-grid table tbody tr td.action-button,div.coer-grid table tbody tr th.check-box table tbody tr td.check-box{text-align:center!important;cursor:default!important;min-width:40px!important;max-width:40px!important;width:40px!important;padding:0!important}div.coer-grid footer.grid-footer{display:flex;align-items:center;justify-content:space-between;font-size:small;color:#999;padding-top:5px}div.coer-grid section.grid-container{position:relative;overflow:auto}div.coer-grid div.loading,div.coer-grid div.no-data{position:absolute;display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:25px;color:gray}div.coer-grid div.loading{background-color:#bbbbbb83!important;flex-direction:column!important;gap:10px!important}div.coer-grid div.loading span.fa-fade{position:relative!important;top:50px!important}div.coer-grid tr.loading{background-color:#bbbbbb83!important}div.coer-grid div.loading i.spinner-border{color:#fd6031!important;width:70px!important;height:70px!important;font-size:20px!important;position:absolute!important}div.coer-grid td.check-box i.spinner-border{width:15px!important;height:15px!important;color:#fd6031!important}div.coer-grid table thead tr th.check-box>div,div.coer-grid table tbody tr td.check-box>div{display:flex;align-items:center;justify-content:center;cursor:default!important}div.coer-grid input.form-check-input{box-shadow:none!important;margin:0}div.coer-grid input[type=checkbox]{cursor:pointer!important}div.coer-grid td.group{padding:0!important;margin:0!important}div.coer-grid td.group>*{border-top:1px solid #6c757d!important;border-bottom:1px solid #6c757d!important;padding:0!important;margin:0!important}div.coer-grid .template,div.coer-grid .template div{white-space:nowrap!important;display:flex!important;align-items:center!important;gap:5px!important}\n"] }]
|
3079
|
+
}] });
|
437
3080
|
|
438
|
-
class
|
3081
|
+
class Menu {
|
439
3082
|
static { this.storage = 'COER-System'; }
|
440
3083
|
/** */
|
441
|
-
static
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
}
|
3084
|
+
static Set(menu) {
|
3085
|
+
let storage = sessionStorage.getItem(this.storage);
|
3086
|
+
if (storage)
|
3087
|
+
storage = JSON.parse(storage);
|
3088
|
+
storage = Object.assign({}, storage, { menu });
|
3089
|
+
sessionStorage.setItem(this.storage, JSON.stringify(storage));
|
448
3090
|
}
|
449
3091
|
/** */
|
450
3092
|
static Get() {
|
451
3093
|
let storage = sessionStorage.getItem(this.storage);
|
452
3094
|
if (storage) {
|
453
3095
|
storage = JSON.parse(storage);
|
454
|
-
if (storage.hasOwnProperty('
|
455
|
-
return
|
3096
|
+
if (storage.hasOwnProperty('menu')) {
|
3097
|
+
return storage.menu;
|
3098
|
+
}
|
3099
|
+
}
|
3100
|
+
return null;
|
3101
|
+
}
|
3102
|
+
}
|
3103
|
+
|
3104
|
+
//import { navigation } from 'src/app/app-routing.sidenav';
|
3105
|
+
//import { Source } from 'src/app/modules/home/classes';
|
3106
|
+
//import { IAppNavigation, IGoBack } from 'src/app/modules/home/interfaces';
|
3107
|
+
class CoerPageTitle {
|
3108
|
+
constructor() {
|
3109
|
+
this.title = null;
|
3110
|
+
this.showNavigation = true;
|
3111
|
+
this.breadcrumbs = [];
|
3112
|
+
this.goBack = { show: false };
|
3113
|
+
this.showInformation = false;
|
3114
|
+
}
|
3115
|
+
get _icon() {
|
3116
|
+
const MENU = Menu.Get();
|
3117
|
+
if (MENU) {
|
3118
|
+
const MENU_SELECTED = MENU.tree.shift();
|
3119
|
+
if (MENU_SELECTED && MENU_SELECTED.icon) {
|
3120
|
+
return MENU_SELECTED.icon;
|
3121
|
+
}
|
3122
|
+
}
|
3123
|
+
return 'bi bi-house-door-fill';
|
3124
|
+
}
|
3125
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerPageTitle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
3126
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CoerPageTitle, selector: "coer-page-title", inputs: { title: "title", showNavigation: "showNavigation", breadcrumbs: "breadcrumbs", goBack: "goBack", showInformation: "showInformation" }, ngImport: i0, template: "<header class=\"coer-page-title\" title=''>\r\n <h2>\r\n <span> {{ title }} </span>\r\n\r\n <!-- Button Information -->\r\n <button\r\n *ngIf=\"showInformation\">\r\n <i class=\"bi bi-info-circle\"></i>\r\n </button>\r\n </h2>\r\n\r\n <!-- Navigation -->\r\n <nav *ngIf=\"showNavigation\" aria-label=\"breadcrumb\">\r\n <ol class=\"breadcrumb\">\r\n <li class=\"breadcrumb-item\">\r\n <a><i [class]=\"_icon\"></i></a>\r\n </li>\r\n\r\n <li *ngFor=\"let nav of breadcrumbs\" class=\"breadcrumb-item\">\r\n <a [routerLink]='(nav.path && nav.path.length > 0) ? nav.path : null'\r\n [queryParams]='nav.queryParams'\r\n (click)=\"(nav.click) ? nav.click() : null\">\r\n {{ nav.page }}\r\n </a>\r\n </li>\r\n </ol>\r\n\r\n <!-- Go Back -->\r\n <a *ngIf=\"goBack.show\"\r\n [routerLink]=\"goBack.path\"\r\n [queryParams]='goBack.queryParams'\r\n (click)=\"(goBack.click) ? goBack.click() : null\">\r\n Go back\r\n </a>\r\n </nav>\r\n\r\n <!-- Tooltip\r\n <dx-tooltip coer-tooltip target=\"#btn-information\" text='Information'></dx-tooltip> -->\r\n</header>\r\n\r\n\r\n<!-- Information\r\n<dx-popup\r\n [(visible)]=\"showModal\"\r\n minWidth=\"500px\" minHeight=\"430px\"\r\n [width]=\"width\" [height]=\"height\"\r\n [hideOnOutsideClick]=\"true\"\r\n [resizeEnabled]=\"false\"\r\n [dragEnabled]=\"true\"\r\n (onHidden)=\"(showModal = false)\"\r\n >\r\n\r\n -- Header --\r\n <header *dxTemplate=\"let data of 'title'\">\r\n <div class=\"modal-header\">\r\n <h5> <i [class]=\"informationIcon\" [style]=\"{ 'color': informationIconColor }\"></i> {{ informationTitle }} </h5>\r\n <button (click)=\"(showModal = false)\" class=\"btn btn-close\"></button>\r\n </div>\r\n </header>\r\n\r\n -- Body --\r\n <section *dxTemplate=\"let data of 'content'\">\r\n <dx-scroll-view width=\"100%\" height=\"100%\">\r\n <ol class=\"list-group list-group-numbered\">\r\n <li class=\"list-group-item\">Respects the order of the columns like the template.</li>\r\n\r\n <li class=\"list-group-item\">\r\n For more information<a [href]=\"urlTemplate\">click here </a>to download the template\r\n </li>\r\n </ol>\r\n </dx-scroll-view>\r\n </section>\r\n\r\n -- Button --\r\n <dxi-toolbar-item toolbar=\"bottom\" location=\"after\">\r\n <div *dxTemplate=\"let data of 'menu-item'\" class=\"h-100\">\r\n <dx-button\r\n coer-button\r\n icon=\"fa-solid fa-xmark\" text=\"CLOSE\"\r\n width=\"125px\" height=\"40px\"\r\n (onClick)=\"(showModal = false)\"\r\n color=\"red\"\r\n ></dx-button>\r\n </div>\r\n </dxi-toolbar-item>\r\n</dx-popup> -->", styles: ["header.coer-page-title{margin:15px 30px 0}header.coer-page-title .text-blue{color:#0d6efd!important}header.coer-page-title .text-blue-bold{color:#0d6efd!important;font-weight:700!important}header.coer-page-title .background-blue{background-color:#0d6efd!important}header.coer-page-title .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}header.coer-page-title .border-blue{border-color:#0d6efd!important}header.coer-page-title .text-gray{color:#6c757d!important}header.coer-page-title .text-gray-bold{color:#6c757d!important;font-weight:700!important}header.coer-page-title .background-gray{background-color:#6c757d!important}header.coer-page-title .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}header.coer-page-title .border-gray{border-color:#6c757d!important}header.coer-page-title .text-green{color:#198754!important}header.coer-page-title .text-green-bold{color:#198754!important;font-weight:700!important}header.coer-page-title .background-green{background-color:#198754!important}header.coer-page-title .background-border-green{background-color:#198754!important;border-color:#198754!important}header.coer-page-title .border-green{border-color:#198754!important}header.coer-page-title .text-yellow{color:#ffc107!important}header.coer-page-title .text-yellow-bold{color:#ffc107!important;font-weight:700!important}header.coer-page-title .background-yellow{background-color:#ffc107!important}header.coer-page-title .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}header.coer-page-title .border-yellow{border-color:#ffc107!important}header.coer-page-title .text-red{color:#dc3545!important}header.coer-page-title .text-red-bold{color:#dc3545!important;font-weight:700!important}header.coer-page-title .background-red{background-color:#dc3545!important}header.coer-page-title .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}header.coer-page-title .border-red{border-color:#dc3545!important}header.coer-page-title .text-white{color:#f5f5f5!important}header.coer-page-title .text-white-bold{color:#f5f5f5!important;font-weight:700!important}header.coer-page-title .background-white{background-color:#f5f5f5!important}header.coer-page-title .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}header.coer-page-title .border-white{border-color:#f5f5f5!important}header.coer-page-title .text-black{color:#252525!important}header.coer-page-title .text-black-bold{color:#252525!important;font-weight:700!important}header.coer-page-title .background-black{background-color:#252525!important}header.coer-page-title .background-border-black{background-color:#252525!important;border-color:#252525!important}header.coer-page-title .border-black{border-color:#252525!important}header.coer-page-title .text-orange{color:#fd6031!important}header.coer-page-title .text-orange-bold{color:#fd6031!important;font-weight:700!important}header.coer-page-title .background-orange{background-color:#fd6031!important}header.coer-page-title .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}header.coer-page-title .border-orange{border-color:#fd6031!important}header.coer-page-title h2{margin:0 0 10px;display:flex;align-items:center;justify-content:space-between;height:20px;font-size:20px}header.coer-page-title h2 span{font-size:20px!important}header.coer-page-title nav{height:25px;font-size:small;background-color:#f5f5f5;display:flex;align-items:center;justify-content:space-between}header.coer-page-title ol,header.coer-page-title a,header.coer-page-title .bi-info-circle{margin:0;padding-left:5px;text-decoration:none;color:#0d6efd!important;font-weight:400!important;cursor:pointer!important}header.coer-page-title ol::selection,header.coer-page-title a::selection{background-color:transparent!important}header.coer-page-title li{border:none}header.coer-page-title li.list-group-item a{color:#fd6031!important}header.coer-page-title button{border:none;outline:none;background-color:transparent;padding-right:8px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] }); }
|
3127
|
+
}
|
3128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerPageTitle, decorators: [{
|
3129
|
+
type: Component,
|
3130
|
+
args: [{ selector: 'coer-page-title', template: "<header class=\"coer-page-title\" title=''>\r\n <h2>\r\n <span> {{ title }} </span>\r\n\r\n <!-- Button Information -->\r\n <button\r\n *ngIf=\"showInformation\">\r\n <i class=\"bi bi-info-circle\"></i>\r\n </button>\r\n </h2>\r\n\r\n <!-- Navigation -->\r\n <nav *ngIf=\"showNavigation\" aria-label=\"breadcrumb\">\r\n <ol class=\"breadcrumb\">\r\n <li class=\"breadcrumb-item\">\r\n <a><i [class]=\"_icon\"></i></a>\r\n </li>\r\n\r\n <li *ngFor=\"let nav of breadcrumbs\" class=\"breadcrumb-item\">\r\n <a [routerLink]='(nav.path && nav.path.length > 0) ? nav.path : null'\r\n [queryParams]='nav.queryParams'\r\n (click)=\"(nav.click) ? nav.click() : null\">\r\n {{ nav.page }}\r\n </a>\r\n </li>\r\n </ol>\r\n\r\n <!-- Go Back -->\r\n <a *ngIf=\"goBack.show\"\r\n [routerLink]=\"goBack.path\"\r\n [queryParams]='goBack.queryParams'\r\n (click)=\"(goBack.click) ? goBack.click() : null\">\r\n Go back\r\n </a>\r\n </nav>\r\n\r\n <!-- Tooltip\r\n <dx-tooltip coer-tooltip target=\"#btn-information\" text='Information'></dx-tooltip> -->\r\n</header>\r\n\r\n\r\n<!-- Information\r\n<dx-popup\r\n [(visible)]=\"showModal\"\r\n minWidth=\"500px\" minHeight=\"430px\"\r\n [width]=\"width\" [height]=\"height\"\r\n [hideOnOutsideClick]=\"true\"\r\n [resizeEnabled]=\"false\"\r\n [dragEnabled]=\"true\"\r\n (onHidden)=\"(showModal = false)\"\r\n >\r\n\r\n -- Header --\r\n <header *dxTemplate=\"let data of 'title'\">\r\n <div class=\"modal-header\">\r\n <h5> <i [class]=\"informationIcon\" [style]=\"{ 'color': informationIconColor }\"></i> {{ informationTitle }} </h5>\r\n <button (click)=\"(showModal = false)\" class=\"btn btn-close\"></button>\r\n </div>\r\n </header>\r\n\r\n -- Body --\r\n <section *dxTemplate=\"let data of 'content'\">\r\n <dx-scroll-view width=\"100%\" height=\"100%\">\r\n <ol class=\"list-group list-group-numbered\">\r\n <li class=\"list-group-item\">Respects the order of the columns like the template.</li>\r\n\r\n <li class=\"list-group-item\">\r\n For more information<a [href]=\"urlTemplate\">click here </a>to download the template\r\n </li>\r\n </ol>\r\n </dx-scroll-view>\r\n </section>\r\n\r\n -- Button --\r\n <dxi-toolbar-item toolbar=\"bottom\" location=\"after\">\r\n <div *dxTemplate=\"let data of 'menu-item'\" class=\"h-100\">\r\n <dx-button\r\n coer-button\r\n icon=\"fa-solid fa-xmark\" text=\"CLOSE\"\r\n width=\"125px\" height=\"40px\"\r\n (onClick)=\"(showModal = false)\"\r\n color=\"red\"\r\n ></dx-button>\r\n </div>\r\n </dxi-toolbar-item>\r\n</dx-popup> -->", styles: ["header.coer-page-title{margin:15px 30px 0}header.coer-page-title .text-blue{color:#0d6efd!important}header.coer-page-title .text-blue-bold{color:#0d6efd!important;font-weight:700!important}header.coer-page-title .background-blue{background-color:#0d6efd!important}header.coer-page-title .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}header.coer-page-title .border-blue{border-color:#0d6efd!important}header.coer-page-title .text-gray{color:#6c757d!important}header.coer-page-title .text-gray-bold{color:#6c757d!important;font-weight:700!important}header.coer-page-title .background-gray{background-color:#6c757d!important}header.coer-page-title .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}header.coer-page-title .border-gray{border-color:#6c757d!important}header.coer-page-title .text-green{color:#198754!important}header.coer-page-title .text-green-bold{color:#198754!important;font-weight:700!important}header.coer-page-title .background-green{background-color:#198754!important}header.coer-page-title .background-border-green{background-color:#198754!important;border-color:#198754!important}header.coer-page-title .border-green{border-color:#198754!important}header.coer-page-title .text-yellow{color:#ffc107!important}header.coer-page-title .text-yellow-bold{color:#ffc107!important;font-weight:700!important}header.coer-page-title .background-yellow{background-color:#ffc107!important}header.coer-page-title .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}header.coer-page-title .border-yellow{border-color:#ffc107!important}header.coer-page-title .text-red{color:#dc3545!important}header.coer-page-title .text-red-bold{color:#dc3545!important;font-weight:700!important}header.coer-page-title .background-red{background-color:#dc3545!important}header.coer-page-title .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}header.coer-page-title .border-red{border-color:#dc3545!important}header.coer-page-title .text-white{color:#f5f5f5!important}header.coer-page-title .text-white-bold{color:#f5f5f5!important;font-weight:700!important}header.coer-page-title .background-white{background-color:#f5f5f5!important}header.coer-page-title .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}header.coer-page-title .border-white{border-color:#f5f5f5!important}header.coer-page-title .text-black{color:#252525!important}header.coer-page-title .text-black-bold{color:#252525!important;font-weight:700!important}header.coer-page-title .background-black{background-color:#252525!important}header.coer-page-title .background-border-black{background-color:#252525!important;border-color:#252525!important}header.coer-page-title .border-black{border-color:#252525!important}header.coer-page-title .text-orange{color:#fd6031!important}header.coer-page-title .text-orange-bold{color:#fd6031!important;font-weight:700!important}header.coer-page-title .background-orange{background-color:#fd6031!important}header.coer-page-title .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}header.coer-page-title .border-orange{border-color:#fd6031!important}header.coer-page-title h2{margin:0 0 10px;display:flex;align-items:center;justify-content:space-between;height:20px;font-size:20px}header.coer-page-title h2 span{font-size:20px!important}header.coer-page-title nav{height:25px;font-size:small;background-color:#f5f5f5;display:flex;align-items:center;justify-content:space-between}header.coer-page-title ol,header.coer-page-title a,header.coer-page-title .bi-info-circle{margin:0;padding-left:5px;text-decoration:none;color:#0d6efd!important;font-weight:400!important;cursor:pointer!important}header.coer-page-title ol::selection,header.coer-page-title a::selection{background-color:transparent!important}header.coer-page-title li{border:none}header.coer-page-title li.list-group-item a{color:#fd6031!important}header.coer-page-title button{border:none;outline:none;background-color:transparent;padding-right:8px}\n"] }]
|
3131
|
+
}], propDecorators: { title: [{
|
3132
|
+
type: Input
|
3133
|
+
}], showNavigation: [{
|
3134
|
+
type: Input
|
3135
|
+
}], breadcrumbs: [{
|
3136
|
+
type: Input
|
3137
|
+
}], goBack: [{
|
3138
|
+
type: Input
|
3139
|
+
}], showInformation: [{
|
3140
|
+
type: Input
|
3141
|
+
}] } });
|
3142
|
+
|
3143
|
+
class CoerTab {
|
3144
|
+
constructor() {
|
3145
|
+
//Variables
|
3146
|
+
this._id = Tools.GetGuid('coer-tab');
|
3147
|
+
this._selectedIndex = 0;
|
3148
|
+
this.matTabGroup = viewChild.required('matTabGroup');
|
3149
|
+
this._tooltipList = [];
|
3150
|
+
//Inputs
|
3151
|
+
this.height = input('auto');
|
3152
|
+
this.minHeight = input('300px');
|
3153
|
+
this.maxHeight = input('auto');
|
3154
|
+
//Computed
|
3155
|
+
this.contentList = computed(() => Array.from(this.contentRef._results));
|
3156
|
+
//Outputs
|
3157
|
+
this.onSelectedTab = output();
|
3158
|
+
}
|
3159
|
+
set selectedIndex(value) {
|
3160
|
+
if (Tools.IsNotNull(value)) {
|
3161
|
+
this._selectedIndex = value;
|
3162
|
+
}
|
3163
|
+
}
|
3164
|
+
set alignTabs(value) {
|
3165
|
+
if (Tools.IsNotNull(this._matTabGroup)) {
|
3166
|
+
if (Tools.IsNotNull(value)) {
|
3167
|
+
this._matTabGroup.removeAttribute('mat-align-tabs');
|
3168
|
+
Tools.Sleep().then(() => {
|
3169
|
+
this._matTabGroup.setAttribute('mat-align-tabs', value);
|
3170
|
+
});
|
456
3171
|
}
|
457
3172
|
}
|
458
|
-
|
3173
|
+
else
|
3174
|
+
Tools.Sleep().then(() => this.alignTabs = value);
|
3175
|
+
}
|
3176
|
+
ngOnInit() {
|
3177
|
+
this._matTabGroup = this.matTabGroup()._elementRef.nativeElement;
|
3178
|
+
}
|
3179
|
+
ngOnDestroy() {
|
3180
|
+
for (const _tooltip of this._tooltipList) {
|
3181
|
+
_tooltip.tooltip?.dispose();
|
3182
|
+
}
|
459
3183
|
}
|
460
3184
|
/** */
|
461
|
-
|
462
|
-
|
463
|
-
|
3185
|
+
SelectedIndexChange(selectedIndex) {
|
3186
|
+
this._selectedIndex = selectedIndex;
|
3187
|
+
this.onSelectedTab.emit(this.contentList()[selectedIndex]);
|
464
3188
|
}
|
465
3189
|
/** */
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
storage = JSON.parse(storage);
|
470
|
-
storage = Object.assign({}, storage, { breadcrumbs });
|
471
|
-
sessionStorage.setItem(this.storage, JSON.stringify(storage));
|
3190
|
+
GetTitle(tab) {
|
3191
|
+
const ref = this.contentList().find(x => x.coerRef() == tab.coerRef());
|
3192
|
+
return (ref.title().length > 0) ? ref.title() : ref.coerRef();
|
472
3193
|
}
|
473
3194
|
/** */
|
474
|
-
|
475
|
-
|
476
|
-
const index = breadcrumbs.findIndex(x => x.path.toLowerCase().trim() === path.toLowerCase().trim());
|
477
|
-
if (index >= 0) {
|
478
|
-
breadcrumbs = Tools.BreakReference(breadcrumbs).splice(0, index + 1);
|
479
|
-
this.Save(breadcrumbs);
|
480
|
-
}
|
3195
|
+
GetIcon(tab) {
|
3196
|
+
return this.contentList().find(x => x.coerRef() == tab.coerRef()).icon();
|
481
3197
|
}
|
482
3198
|
/** */
|
483
|
-
|
484
|
-
const
|
485
|
-
if (
|
486
|
-
|
487
|
-
this.Save(breadcrumbs);
|
488
|
-
}
|
3199
|
+
SelectTabBy(callback) {
|
3200
|
+
const index = this.contentList().findIndex(callback);
|
3201
|
+
if (index >= 0)
|
3202
|
+
this._selectedIndex = index;
|
489
3203
|
}
|
490
3204
|
/** */
|
491
|
-
|
492
|
-
const
|
493
|
-
if (
|
494
|
-
|
495
|
-
|
3205
|
+
SetToolTip(tab) {
|
3206
|
+
const id = `${this._id}-${tab.coerRef()}`;
|
3207
|
+
if (!this._tooltipList.some(x => x.id == id) && tab.tooltip().length > 0) {
|
3208
|
+
this._tooltipList.push({ id });
|
3209
|
+
Tools.Sleep().then(() => {
|
3210
|
+
const htmlElement = document.getElementById(id);
|
3211
|
+
if (htmlElement) {
|
3212
|
+
const tooltip = new Tooltip(htmlElement, {
|
3213
|
+
html: true,
|
3214
|
+
title: tab.tooltip(),
|
3215
|
+
placement: 'top'
|
3216
|
+
});
|
3217
|
+
htmlElement.addEventListener('mouseleave', () => {
|
3218
|
+
if (htmlElement)
|
3219
|
+
tooltip.hide();
|
3220
|
+
});
|
3221
|
+
const index = this._tooltipList.findIndex(x => x.id == id);
|
3222
|
+
if (index >= 0)
|
3223
|
+
this._tooltipList[index].tooltip = tooltip;
|
3224
|
+
}
|
3225
|
+
});
|
496
3226
|
}
|
3227
|
+
return id;
|
497
3228
|
}
|
3229
|
+
/** */
|
3230
|
+
RemoveTooltip(element) {
|
3231
|
+
const id = element.getAttribute('id');
|
3232
|
+
const index = this._tooltipList.findIndex(x => x.id == id);
|
3233
|
+
if (index >= 0)
|
3234
|
+
this._tooltipList.splice(index, 1);
|
3235
|
+
}
|
3236
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTab, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
3237
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerTab, selector: "coer-tab", inputs: { height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: false, isRequired: false, transformFunction: null }, alignTabs: { classPropertyName: "alignTabs", publicName: "alignTabs", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onSelectedTab: "onSelectedTab" }, queries: [{ propertyName: "contentRef", predicate: CoerRefDirective }], viewQueries: [{ propertyName: "matTabGroup", first: true, predicate: ["matTabGroup"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"coer-tab\">\r\n <mat-tab-group #matTabGroup\r\n mat-stretch-tabs=\"false\"\r\n [selectedIndex]=\"_selectedIndex\"\r\n (selectedIndexChange)=\"SelectedIndexChange($event)\">\r\n\r\n @for(tab of contentList(); track tab.coerRef()) {\r\n @if(tab.show()) {\r\n <mat-tab [label]=\"tab.coerRef()\" [disabled]=\"tab.isDisabled()\">\r\n <ng-template mat-tab-label>\r\n <span [id]=\"SetToolTip(tab)\" class=\"tab\" lifecycle (onDestroy)=\"RemoveTooltip($event)\">\r\n <i [class]=\"GetIcon(tab)\"></i>\r\n <span [class]=\"GetIcon(tab).length > 0 ? 'ms-2' : ''\">\r\n {{ GetTitle(tab) }}\r\n </span>\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template matTabContent>\r\n <div class=\"tab-content\"\r\n [ngStyle]=\"{\r\n 'height': height(),\r\n 'min-height': minHeight(),\r\n 'max-height': maxHeight()\r\n }\">\r\n\r\n <ng-container [ngTemplateOutlet]=\"tab.template\"></ng-container>\r\n </div>\r\n </ng-template>\r\n </mat-tab>\r\n }\r\n }\r\n </mat-tab-group>\r\n</div>", styles: ["div.coer-tab .text-blue{color:#0d6efd!important}div.coer-tab .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-tab .background-blue{background-color:#0d6efd!important}div.coer-tab .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-tab .border-blue{border-color:#0d6efd!important}div.coer-tab .text-gray{color:#6c757d!important}div.coer-tab .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-tab .background-gray{background-color:#6c757d!important}div.coer-tab .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-tab .border-gray{border-color:#6c757d!important}div.coer-tab .text-green{color:#198754!important}div.coer-tab .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-tab .background-green{background-color:#198754!important}div.coer-tab .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-tab .border-green{border-color:#198754!important}div.coer-tab .text-yellow{color:#ffc107!important}div.coer-tab .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-tab .background-yellow{background-color:#ffc107!important}div.coer-tab .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-tab .border-yellow{border-color:#ffc107!important}div.coer-tab .text-red{color:#dc3545!important}div.coer-tab .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-tab .background-red{background-color:#dc3545!important}div.coer-tab .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-tab .border-red{border-color:#dc3545!important}div.coer-tab .text-white{color:#f5f5f5!important}div.coer-tab .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-tab .background-white{background-color:#f5f5f5!important}div.coer-tab .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-tab .border-white{border-color:#f5f5f5!important}div.coer-tab .text-black{color:#252525!important}div.coer-tab .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-tab .background-black{background-color:#252525!important}div.coer-tab .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-tab .border-black{border-color:#252525!important}div.coer-tab .text-orange{color:#fd6031!important}div.coer-tab .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-tab .background-orange{background-color:#fd6031!important}div.coer-tab .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-tab .border-orange{border-color:#fd6031!important}div.coer-tab mat-tab-group mat-tab-header.mat-mdc-tab-header{background-color:#f5f5f562!important;border-bottom:1px solid whitesmoke!important}div.coer-tab mat-tab-group mat-tab-header.mat-mdc-tab-header div.mat-mdc-tab-label-container div.mat-mdc-tab-list div.mat-mdc-tab-labels div.mdc-tab.mat-mdc-tab{padding:0!important;height:35px!important}div.coer-tab mat-tab-group mat-tab-header.mat-mdc-tab-header div.mat-mdc-tab-label-container div.mat-mdc-tab-list div.mat-mdc-tab-labels div.mdc-tab--active.mdc-tab-indicator--active *{color:#fd6031!important;border-color:#fd6031!important}div.coer-tab mat-tab-group mat-tab-header.mat-mdc-tab-header span.tab{padding:10px 20px!important}div.coer-tab mat-tab-group div.mat-mdc-tab-body-wrapper{overflow:visible!important}div.coer-tab mat-tab-group div.mat-mdc-tab-body-wrapper mat-tab-body{overflow:visible!important}div.coer-tab mat-tab-group div.mat-mdc-tab-body-wrapper mat-tab-body div.mat-mdc-tab-body-content{width:auto!important;overflow:visible!important}div.coer-tab mat-tab-group div.mat-mdc-tab-body-wrapper mat-tab-body div.mat-mdc-tab-body-content div.tab-content{padding:5px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$4.MatTabContent, selector: "[matTabContent]" }, { kind: "directive", type: i2$4.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i2$4.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i2$4.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: LifeCycleDirective, selector: "[lifecycle]", outputs: ["onInit", "afterViewInit", "onDestroy"] }] }); }
|
498
3238
|
}
|
3239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTab, decorators: [{
|
3240
|
+
type: Component,
|
3241
|
+
args: [{ selector: 'coer-tab', template: "<div class=\"coer-tab\">\r\n <mat-tab-group #matTabGroup\r\n mat-stretch-tabs=\"false\"\r\n [selectedIndex]=\"_selectedIndex\"\r\n (selectedIndexChange)=\"SelectedIndexChange($event)\">\r\n\r\n @for(tab of contentList(); track tab.coerRef()) {\r\n @if(tab.show()) {\r\n <mat-tab [label]=\"tab.coerRef()\" [disabled]=\"tab.isDisabled()\">\r\n <ng-template mat-tab-label>\r\n <span [id]=\"SetToolTip(tab)\" class=\"tab\" lifecycle (onDestroy)=\"RemoveTooltip($event)\">\r\n <i [class]=\"GetIcon(tab)\"></i>\r\n <span [class]=\"GetIcon(tab).length > 0 ? 'ms-2' : ''\">\r\n {{ GetTitle(tab) }}\r\n </span>\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template matTabContent>\r\n <div class=\"tab-content\"\r\n [ngStyle]=\"{\r\n 'height': height(),\r\n 'min-height': minHeight(),\r\n 'max-height': maxHeight()\r\n }\">\r\n\r\n <ng-container [ngTemplateOutlet]=\"tab.template\"></ng-container>\r\n </div>\r\n </ng-template>\r\n </mat-tab>\r\n }\r\n }\r\n </mat-tab-group>\r\n</div>", styles: ["div.coer-tab .text-blue{color:#0d6efd!important}div.coer-tab .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-tab .background-blue{background-color:#0d6efd!important}div.coer-tab .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-tab .border-blue{border-color:#0d6efd!important}div.coer-tab .text-gray{color:#6c757d!important}div.coer-tab .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-tab .background-gray{background-color:#6c757d!important}div.coer-tab .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-tab .border-gray{border-color:#6c757d!important}div.coer-tab .text-green{color:#198754!important}div.coer-tab .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-tab .background-green{background-color:#198754!important}div.coer-tab .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-tab .border-green{border-color:#198754!important}div.coer-tab .text-yellow{color:#ffc107!important}div.coer-tab .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-tab .background-yellow{background-color:#ffc107!important}div.coer-tab .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-tab .border-yellow{border-color:#ffc107!important}div.coer-tab .text-red{color:#dc3545!important}div.coer-tab .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-tab .background-red{background-color:#dc3545!important}div.coer-tab .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-tab .border-red{border-color:#dc3545!important}div.coer-tab .text-white{color:#f5f5f5!important}div.coer-tab .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-tab .background-white{background-color:#f5f5f5!important}div.coer-tab .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-tab .border-white{border-color:#f5f5f5!important}div.coer-tab .text-black{color:#252525!important}div.coer-tab .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-tab .background-black{background-color:#252525!important}div.coer-tab .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-tab .border-black{border-color:#252525!important}div.coer-tab .text-orange{color:#fd6031!important}div.coer-tab .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-tab .background-orange{background-color:#fd6031!important}div.coer-tab .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-tab .border-orange{border-color:#fd6031!important}div.coer-tab mat-tab-group mat-tab-header.mat-mdc-tab-header{background-color:#f5f5f562!important;border-bottom:1px solid whitesmoke!important}div.coer-tab mat-tab-group mat-tab-header.mat-mdc-tab-header div.mat-mdc-tab-label-container div.mat-mdc-tab-list div.mat-mdc-tab-labels div.mdc-tab.mat-mdc-tab{padding:0!important;height:35px!important}div.coer-tab mat-tab-group mat-tab-header.mat-mdc-tab-header div.mat-mdc-tab-label-container div.mat-mdc-tab-list div.mat-mdc-tab-labels div.mdc-tab--active.mdc-tab-indicator--active *{color:#fd6031!important;border-color:#fd6031!important}div.coer-tab mat-tab-group mat-tab-header.mat-mdc-tab-header span.tab{padding:10px 20px!important}div.coer-tab mat-tab-group div.mat-mdc-tab-body-wrapper{overflow:visible!important}div.coer-tab mat-tab-group div.mat-mdc-tab-body-wrapper mat-tab-body{overflow:visible!important}div.coer-tab mat-tab-group div.mat-mdc-tab-body-wrapper mat-tab-body div.mat-mdc-tab-body-content{width:auto!important;overflow:visible!important}div.coer-tab mat-tab-group div.mat-mdc-tab-body-wrapper mat-tab-body div.mat-mdc-tab-body-content div.tab-content{padding:5px}\n"] }]
|
3242
|
+
}], propDecorators: { contentRef: [{
|
3243
|
+
type: ContentChildren,
|
3244
|
+
args: [CoerRefDirective]
|
3245
|
+
}], selectedIndex: [{
|
3246
|
+
type: Input
|
3247
|
+
}], alignTabs: [{
|
3248
|
+
type: Input
|
3249
|
+
}] } });
|
499
3250
|
|
500
|
-
|
501
|
-
return {
|
502
|
-
provide: NG_VALUE_ACCESSOR,
|
503
|
-
useExisting: forwardRef(() => component),
|
504
|
-
multi: true
|
505
|
-
};
|
506
|
-
};
|
507
|
-
class ControlValue {
|
3251
|
+
class CoerTextarea extends ControlValue {
|
508
3252
|
constructor() {
|
509
|
-
|
3253
|
+
super(...arguments);
|
3254
|
+
//Component Value
|
3255
|
+
this._value = '';
|
3256
|
+
this.matFormField = viewChild.required('matFormField');
|
3257
|
+
this.coerTextBox = viewChild.required('coerTextArea');
|
3258
|
+
//Variables
|
3259
|
+
this._id = Tools.GetGuid('coer-textArea');
|
3260
|
+
this._isLoadingEvent = signal(false);
|
3261
|
+
this.id = '';
|
3262
|
+
this.label = input('');
|
3263
|
+
this.placeholder = input('');
|
3264
|
+
this.minLength = input(0);
|
3265
|
+
this.maxLength = input(2500);
|
3266
|
+
this.width = input('100%');
|
3267
|
+
this.minWidth = input('190px');
|
3268
|
+
this.maxWidth = input('100%');
|
3269
|
+
this.marginTop = input('0px');
|
3270
|
+
this.marginRight = input('0px');
|
3271
|
+
this.marginBottom = input('0px');
|
3272
|
+
this.marginLeft = input('0px');
|
3273
|
+
this.isInvalid = input(false);
|
3274
|
+
this.isValid = input(false);
|
3275
|
+
this.isDisabled = input(false);
|
3276
|
+
this.isReadonly = input(false);
|
3277
|
+
this.isLoading = input(false);
|
3278
|
+
this.showFooter = input(true);
|
3279
|
+
this.resize = input(false);
|
3280
|
+
this.textPosition = input('left');
|
3281
|
+
//Outputs
|
3282
|
+
this.onInput = output();
|
3283
|
+
//computed
|
3284
|
+
this._isEnable = computed(() => {
|
3285
|
+
return !this.isDisabled() && !this.isLoading() && !this.isReadonly();
|
3286
|
+
});
|
3287
|
+
//computed
|
3288
|
+
this.floatLabel = computed(() => {
|
3289
|
+
return this.label() == '' ? 'always' : 'auto';
|
3290
|
+
});
|
3291
|
+
//computed
|
3292
|
+
this.paddingRight = computed(() => {
|
3293
|
+
return this.isInvalid() || this.isValid()
|
3294
|
+
? '18px' : '0px';
|
3295
|
+
});
|
510
3296
|
}
|
511
|
-
|
512
|
-
|
3297
|
+
//Inputs
|
3298
|
+
set value(value) {
|
3299
|
+
if (Tools.IsNull(value))
|
3300
|
+
value = '';
|
3301
|
+
this.SetValue(value);
|
513
3302
|
}
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
this._value
|
3303
|
+
ngOnInit() {
|
3304
|
+
this.SetEvents();
|
3305
|
+
}
|
3306
|
+
//getter
|
3307
|
+
get value() {
|
3308
|
+
return this._value;
|
3309
|
+
}
|
3310
|
+
//getter
|
3311
|
+
get footer() {
|
3312
|
+
return `${Tools.IsNotNull(this._value) ? String(this._value).length : '0'} / ${this.maxLength()}`;
|
520
3313
|
}
|
521
3314
|
/** */
|
522
|
-
|
523
|
-
|
524
|
-
this.
|
525
|
-
|
526
|
-
|
3315
|
+
SetEvents() {
|
3316
|
+
Tools.Sleep().then(() => {
|
3317
|
+
this.element = document.getElementById(this._id);
|
3318
|
+
if (this.element) {
|
3319
|
+
this.element.addEventListener('focus', () => {
|
3320
|
+
if (!this._isEnable())
|
3321
|
+
this.Blur();
|
3322
|
+
});
|
3323
|
+
this.element.addEventListener('blur', () => this.Blur());
|
3324
|
+
this.element.addEventListener('input', () => {
|
3325
|
+
Tools.Sleep().then(() => {
|
3326
|
+
const value = this.coerTextBox().nativeElement.value;
|
3327
|
+
if (this._isEnable())
|
3328
|
+
this.onInput.emit(value);
|
3329
|
+
});
|
3330
|
+
});
|
3331
|
+
this.element.addEventListener('paste', () => {
|
3332
|
+
Tools.Sleep().then(() => {
|
3333
|
+
this.SetValue(this._value.toString().trim());
|
3334
|
+
});
|
3335
|
+
});
|
3336
|
+
}
|
3337
|
+
});
|
527
3338
|
}
|
528
3339
|
/** */
|
529
|
-
|
530
|
-
this.
|
3340
|
+
Focus(timeout = 0) {
|
3341
|
+
if (this._isLoadingEvent())
|
3342
|
+
return;
|
3343
|
+
else
|
3344
|
+
this._isLoadingEvent.set(true);
|
3345
|
+
Tools.Sleep(timeout).then(() => {
|
3346
|
+
if (this._isEnable()) {
|
3347
|
+
this.element.focus();
|
3348
|
+
}
|
3349
|
+
this._isLoadingEvent.set(false);
|
3350
|
+
});
|
531
3351
|
}
|
532
3352
|
/** */
|
533
|
-
|
534
|
-
this.
|
3353
|
+
Select(timeout = 0) {
|
3354
|
+
if (this._isLoadingEvent())
|
3355
|
+
return;
|
3356
|
+
else
|
3357
|
+
this._isLoadingEvent.set(true);
|
3358
|
+
Tools.Sleep(timeout).then(() => {
|
3359
|
+
if (this._isEnable()) {
|
3360
|
+
this.element.focus();
|
3361
|
+
this.element.select();
|
3362
|
+
}
|
3363
|
+
this._isLoadingEvent.set(false);
|
3364
|
+
});
|
535
3365
|
}
|
536
3366
|
/** */
|
537
|
-
|
538
|
-
this.
|
3367
|
+
Blur() {
|
3368
|
+
if (this._isLoadingEvent())
|
3369
|
+
return;
|
3370
|
+
else
|
3371
|
+
this._isLoadingEvent.set(true);
|
3372
|
+
Tools.Sleep().then(() => {
|
3373
|
+
if (this.element) {
|
3374
|
+
this.element.blur();
|
3375
|
+
Tools.Sleep().then(() => {
|
3376
|
+
const element = document.querySelector(`#${this._id}-container .mdc-line-ripple--active`);
|
3377
|
+
if (element)
|
3378
|
+
element.classList.remove('mdc-line-ripple--active');
|
3379
|
+
});
|
3380
|
+
}
|
3381
|
+
this._isLoadingEvent.set(false);
|
3382
|
+
});
|
539
3383
|
}
|
540
3384
|
/** */
|
541
|
-
|
3385
|
+
Clear() {
|
3386
|
+
this.SetValue('');
|
3387
|
+
this.Focus();
|
3388
|
+
}
|
3389
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTextarea, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
3390
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerTextarea, selector: "coer-textarea", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, marginTop: { classPropertyName: "marginTop", publicName: "marginTop", isSignal: true, isRequired: false, transformFunction: null }, marginRight: { classPropertyName: "marginRight", publicName: "marginRight", isSignal: true, isRequired: false, transformFunction: null }, marginBottom: { classPropertyName: "marginBottom", publicName: "marginBottom", isSignal: true, isRequired: false, transformFunction: null }, marginLeft: { classPropertyName: "marginLeft", publicName: "marginLeft", isSignal: true, isRequired: false, transformFunction: null }, isInvalid: { classPropertyName: "isInvalid", publicName: "isInvalid", isSignal: true, isRequired: false, transformFunction: null }, isValid: { classPropertyName: "isValid", publicName: "isValid", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, textPosition: { classPropertyName: "textPosition", publicName: "textPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onInput: "onInput" }, providers: [CONTROL_VALUE(CoerTextarea)], viewQueries: [{ propertyName: "matFormField", first: true, predicate: ["matFormField"], descendants: true, isSignal: true }, { propertyName: "coerTextBox", first: true, predicate: ["coerTextArea"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"coer-textarea\">\r\n <mat-form-field\r\n [id]=\"_id + '-container'\"\r\n [floatLabel]=\"floatLabel()\"\r\n [ngClass]=\"{\r\n 'readonly': isReadonly() && !isLoading()\r\n }\"\r\n [style]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'max-width': maxWidth(),\r\n 'margin-top': marginTop(),\r\n 'margin-right': marginRight(),\r\n 'margin-bottom': marginBottom(),\r\n 'margin-left': marginLeft()\r\n }\">\r\n <mat-label>{{ label() }}</mat-label>\r\n\r\n <textarea #coerTextArea matInput\r\n [id]=\"_id\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder()\"\r\n [minLength]=\"minLength()\"\r\n [maxLength]=\"maxLength()\"\r\n [disabled]=\"!_isEnable()\"\r\n [value]=\"_value\"\r\n (input)=\"SetValue(coerTextArea.value)\"\r\n (blur)=\"SetTouched(true)\"\r\n [style]=\"{\r\n 'cursor': isLoading() ? 'wait' : null,\r\n 'margin-top': (floatLabel() == 'auto') ? '15px' : '9px',\r\n 'padding-right': paddingRight(),\r\n 'text-align': textPosition(),\r\n 'resize': (!resize() || !_isEnable()) ? 'none' : ''\r\n }\"></textarea>\r\n\r\n @if(isLoading()) {\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <span ngClass=\"icon-container\">\r\n @if(isInvalid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-exclamation\"></i>\r\n }\r\n\r\n @else if(isValid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-check text-green\"></i>\r\n }\r\n </span>\r\n </mat-form-field>\r\n\r\n @if(showFooter()) {\r\n <footer> {{ footer }} </footer>\r\n }\r\n</div>", styles: ["div.coer-textarea .text-blue{color:#0d6efd!important}div.coer-textarea .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-textarea .background-blue{background-color:#0d6efd!important}div.coer-textarea .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-textarea .border-blue{border-color:#0d6efd!important}div.coer-textarea .text-gray{color:#6c757d!important}div.coer-textarea .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-textarea .background-gray{background-color:#6c757d!important}div.coer-textarea .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-textarea .border-gray{border-color:#6c757d!important}div.coer-textarea .text-green{color:#198754!important}div.coer-textarea .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-textarea .background-green{background-color:#198754!important}div.coer-textarea .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-textarea .border-green{border-color:#198754!important}div.coer-textarea .text-yellow{color:#ffc107!important}div.coer-textarea .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-textarea .background-yellow{background-color:#ffc107!important}div.coer-textarea .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-textarea .border-yellow{border-color:#ffc107!important}div.coer-textarea .text-red{color:#dc3545!important}div.coer-textarea .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-textarea .background-red{background-color:#dc3545!important}div.coer-textarea .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-textarea .border-red{border-color:#dc3545!important}div.coer-textarea .text-white{color:#f5f5f5!important}div.coer-textarea .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-textarea .background-white{background-color:#f5f5f5!important}div.coer-textarea .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-textarea .border-white{border-color:#f5f5f5!important}div.coer-textarea .text-black{color:#252525!important}div.coer-textarea .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-textarea .background-black{background-color:#252525!important}div.coer-textarea .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-textarea .border-black{border-color:#252525!important}div.coer-textarea .text-orange{color:#fd6031!important}div.coer-textarea .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-textarea .background-orange{background-color:#fd6031!important}div.coer-textarea .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-textarea .border-orange{border-color:#fd6031!important}div.coer-textarea mat-form-field{position:relative!important}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{width:100%!important;padding:0!important}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label{overflow:visible!important;position:absolute!important;top:20px!important}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label.mdc-floating-label--float-above mat-label{color:#fd6031;font-weight:700;position:relative;left:-10px;top:2px}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix textarea{font-weight:400!important;font-size:17px!important;color:#252525!important;min-height:80px}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active,div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:before,div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:after{border-bottom-color:#fd6031!important}div.coer-textarea mat-form-field div.mat-mdc-form-field-subscript-wrapper.mat-mdc-form-field-bottom-align{height:0px!important}div.coer-textarea mat-form-field span.icon-container{position:absolute!important;top:1px!important;right:-14px!important;z-index:5!important;width:30px;height:40px;display:flex;align-items:center;justify-content:center}div.coer-textarea mat-form-field span.icon-container i{font-size:20px!important}div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-xmark,div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass{color:#caced1!important;cursor:pointer!important}div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-xmark:hover,div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass:hover{color:#6c757d!important}div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-circle-check{color:#198754!important}div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-circle-exclamation{color:#dc3545!important}div.coer-textarea mat-form-field span.placeholder{width:calc(100% + 32px)!important;height:100%!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-textarea mat-form-field .placeholder,div.coer-textarea mat-form-field .placeholder *,div.coer-textarea mat-form-field .placeholder-glow,div.coer-textarea mat-form-field .placeholder-glow *{cursor:wait!important}div.coer-textarea footer{padding-top:2px;text-align:right;font-size:10px;color:#6c757d}div.coer-textarea mat-form-field.readonly div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:#bbbbbb83!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }] }); }
|
542
3391
|
}
|
3392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTextarea, decorators: [{
|
3393
|
+
type: Component,
|
3394
|
+
args: [{ selector: 'coer-textarea', providers: [CONTROL_VALUE(CoerTextarea)], template: "<div class=\"coer-textarea\">\r\n <mat-form-field\r\n [id]=\"_id + '-container'\"\r\n [floatLabel]=\"floatLabel()\"\r\n [ngClass]=\"{\r\n 'readonly': isReadonly() && !isLoading()\r\n }\"\r\n [style]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'max-width': maxWidth(),\r\n 'margin-top': marginTop(),\r\n 'margin-right': marginRight(),\r\n 'margin-bottom': marginBottom(),\r\n 'margin-left': marginLeft()\r\n }\">\r\n <mat-label>{{ label() }}</mat-label>\r\n\r\n <textarea #coerTextArea matInput\r\n [id]=\"_id\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder()\"\r\n [minLength]=\"minLength()\"\r\n [maxLength]=\"maxLength()\"\r\n [disabled]=\"!_isEnable()\"\r\n [value]=\"_value\"\r\n (input)=\"SetValue(coerTextArea.value)\"\r\n (blur)=\"SetTouched(true)\"\r\n [style]=\"{\r\n 'cursor': isLoading() ? 'wait' : null,\r\n 'margin-top': (floatLabel() == 'auto') ? '15px' : '9px',\r\n 'padding-right': paddingRight(),\r\n 'text-align': textPosition(),\r\n 'resize': (!resize() || !_isEnable()) ? 'none' : ''\r\n }\"></textarea>\r\n\r\n @if(isLoading()) {\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <span ngClass=\"icon-container\">\r\n @if(isInvalid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-exclamation\"></i>\r\n }\r\n\r\n @else if(isValid() && !isDisabled() && !isLoading()) {\r\n <i class=\"fa-solid fa-circle-check text-green\"></i>\r\n }\r\n </span>\r\n </mat-form-field>\r\n\r\n @if(showFooter()) {\r\n <footer> {{ footer }} </footer>\r\n }\r\n</div>", styles: ["div.coer-textarea .text-blue{color:#0d6efd!important}div.coer-textarea .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-textarea .background-blue{background-color:#0d6efd!important}div.coer-textarea .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-textarea .border-blue{border-color:#0d6efd!important}div.coer-textarea .text-gray{color:#6c757d!important}div.coer-textarea .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-textarea .background-gray{background-color:#6c757d!important}div.coer-textarea .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-textarea .border-gray{border-color:#6c757d!important}div.coer-textarea .text-green{color:#198754!important}div.coer-textarea .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-textarea .background-green{background-color:#198754!important}div.coer-textarea .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-textarea .border-green{border-color:#198754!important}div.coer-textarea .text-yellow{color:#ffc107!important}div.coer-textarea .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-textarea .background-yellow{background-color:#ffc107!important}div.coer-textarea .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-textarea .border-yellow{border-color:#ffc107!important}div.coer-textarea .text-red{color:#dc3545!important}div.coer-textarea .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-textarea .background-red{background-color:#dc3545!important}div.coer-textarea .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-textarea .border-red{border-color:#dc3545!important}div.coer-textarea .text-white{color:#f5f5f5!important}div.coer-textarea .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-textarea .background-white{background-color:#f5f5f5!important}div.coer-textarea .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-textarea .border-white{border-color:#f5f5f5!important}div.coer-textarea .text-black{color:#252525!important}div.coer-textarea .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-textarea .background-black{background-color:#252525!important}div.coer-textarea .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-textarea .border-black{border-color:#252525!important}div.coer-textarea .text-orange{color:#fd6031!important}div.coer-textarea .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-textarea .background-orange{background-color:#fd6031!important}div.coer-textarea .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-textarea .border-orange{border-color:#fd6031!important}div.coer-textarea mat-form-field{position:relative!important}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix{width:100%!important;padding:0!important}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label{overflow:visible!important;position:absolute!important;top:20px!important}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix label.mdc-floating-label--float-above mat-label{color:#fd6031;font-weight:700;position:relative;left:-10px;top:2px}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mat-mdc-form-field-flex div.mat-mdc-form-field-infix textarea{font-weight:400!important;font-size:17px!important;color:#252525!important;min-height:80px}div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active,div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:before,div.coer-textarea mat-form-field div.mat-mdc-text-field-wrapper.mdc-text-field div.mdc-line-ripple.mdc-line-ripple--active:after{border-bottom-color:#fd6031!important}div.coer-textarea mat-form-field div.mat-mdc-form-field-subscript-wrapper.mat-mdc-form-field-bottom-align{height:0px!important}div.coer-textarea mat-form-field span.icon-container{position:absolute!important;top:1px!important;right:-14px!important;z-index:5!important;width:30px;height:40px;display:flex;align-items:center;justify-content:center}div.coer-textarea mat-form-field span.icon-container i{font-size:20px!important}div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-xmark,div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass{color:#caced1!important;cursor:pointer!important}div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-xmark:hover,div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-magnifying-glass:hover{color:#6c757d!important}div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-circle-check{color:#198754!important}div.coer-textarea mat-form-field span.icon-container i.fa-solid.fa-circle-exclamation{color:#dc3545!important}div.coer-textarea mat-form-field span.placeholder{width:calc(100% + 32px)!important;height:100%!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-textarea mat-form-field .placeholder,div.coer-textarea mat-form-field .placeholder *,div.coer-textarea mat-form-field .placeholder-glow,div.coer-textarea mat-form-field .placeholder-glow *{cursor:wait!important}div.coer-textarea footer{padding-top:2px;text-align:right;font-size:10px;color:#6c757d}div.coer-textarea mat-form-field.readonly div.mat-mdc-text-field-wrapper.mdc-text-field{background-color:#bbbbbb83!important}\n"] }]
|
3395
|
+
}], propDecorators: { value: [{
|
3396
|
+
type: Input
|
3397
|
+
}], id: [{
|
3398
|
+
type: Input
|
3399
|
+
}] } });
|
543
3400
|
|
544
|
-
class
|
545
|
-
|
546
|
-
static
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
3401
|
+
class ComponentsModule {
|
3402
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
3403
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, declarations: [CoerAlert,
|
3404
|
+
CoerButton,
|
3405
|
+
CoerCheckbox,
|
3406
|
+
CoerFilebox,
|
3407
|
+
CoerForm,
|
3408
|
+
CoerGrid,
|
3409
|
+
CoerModal,
|
3410
|
+
CoerNumberBox,
|
3411
|
+
CoerPageTitle,
|
3412
|
+
CoerSelectbox,
|
3413
|
+
CoerSwitch,
|
3414
|
+
CoerTab,
|
3415
|
+
CoerTextarea,
|
3416
|
+
CoerTextBox], imports: [CommonModule,
|
3417
|
+
RouterModule,
|
3418
|
+
FormsModule,
|
3419
|
+
ReactiveFormsModule,
|
3420
|
+
PipesModule,
|
3421
|
+
MatButtonModule,
|
3422
|
+
MatCheckboxModule,
|
3423
|
+
MatInputModule,
|
3424
|
+
MatFormFieldModule,
|
3425
|
+
MatSlideToggleModule,
|
3426
|
+
MatTabsModule,
|
3427
|
+
DirectivesModule], exports: [CoerAlert,
|
3428
|
+
CoerButton,
|
3429
|
+
CoerCheckbox,
|
3430
|
+
CoerFilebox,
|
3431
|
+
CoerForm,
|
3432
|
+
CoerGrid,
|
3433
|
+
CoerModal,
|
3434
|
+
CoerNumberBox,
|
3435
|
+
CoerPageTitle,
|
3436
|
+
CoerSelectbox,
|
3437
|
+
CoerSwitch,
|
3438
|
+
CoerTab,
|
3439
|
+
CoerTextarea,
|
3440
|
+
CoerTextBox] }); }
|
3441
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, imports: [CommonModule,
|
3442
|
+
RouterModule,
|
3443
|
+
FormsModule,
|
3444
|
+
ReactiveFormsModule,
|
3445
|
+
PipesModule,
|
3446
|
+
MatButtonModule,
|
3447
|
+
MatCheckboxModule,
|
3448
|
+
MatInputModule,
|
3449
|
+
MatFormFieldModule,
|
3450
|
+
MatSlideToggleModule,
|
3451
|
+
MatTabsModule,
|
3452
|
+
DirectivesModule] }); }
|
563
3453
|
}
|
3454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, decorators: [{
|
3455
|
+
type: NgModule,
|
3456
|
+
args: [{
|
3457
|
+
imports: [
|
3458
|
+
CommonModule,
|
3459
|
+
RouterModule,
|
3460
|
+
FormsModule,
|
3461
|
+
ReactiveFormsModule,
|
3462
|
+
PipesModule,
|
3463
|
+
MatButtonModule,
|
3464
|
+
MatCheckboxModule,
|
3465
|
+
MatInputModule,
|
3466
|
+
MatFormFieldModule,
|
3467
|
+
MatSlideToggleModule,
|
3468
|
+
MatTabsModule,
|
3469
|
+
DirectivesModule
|
3470
|
+
],
|
3471
|
+
declarations: [
|
3472
|
+
CoerAlert,
|
3473
|
+
CoerButton,
|
3474
|
+
CoerCheckbox,
|
3475
|
+
CoerFilebox,
|
3476
|
+
CoerForm,
|
3477
|
+
CoerGrid,
|
3478
|
+
CoerModal,
|
3479
|
+
CoerNumberBox,
|
3480
|
+
CoerPageTitle,
|
3481
|
+
CoerSelectbox,
|
3482
|
+
CoerSwitch,
|
3483
|
+
CoerTab,
|
3484
|
+
CoerTextarea,
|
3485
|
+
CoerTextBox,
|
3486
|
+
],
|
3487
|
+
exports: [
|
3488
|
+
CoerAlert,
|
3489
|
+
CoerButton,
|
3490
|
+
CoerCheckbox,
|
3491
|
+
CoerFilebox,
|
3492
|
+
CoerForm,
|
3493
|
+
CoerGrid,
|
3494
|
+
CoerModal,
|
3495
|
+
CoerNumberBox,
|
3496
|
+
CoerPageTitle,
|
3497
|
+
CoerSelectbox,
|
3498
|
+
CoerSwitch,
|
3499
|
+
CoerTab,
|
3500
|
+
CoerTextarea,
|
3501
|
+
CoerTextBox,
|
3502
|
+
]
|
3503
|
+
}]
|
3504
|
+
}] });
|
564
3505
|
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
3506
|
+
const breakpointSIGNAL = signal(Screen?.BREAKPOINT || 'xs');
|
3507
|
+
|
3508
|
+
const isLoadingSIGNAL = signal(false);
|
3509
|
+
|
3510
|
+
class Breadcrumbs {
|
3511
|
+
static { this.storage = 'COER-System'; }
|
3512
|
+
/** */
|
3513
|
+
static Add(page, path) {
|
3514
|
+
const breadcrumbs = this.Get();
|
3515
|
+
const paths = breadcrumbs.map(item => item.path);
|
3516
|
+
if (!paths.includes(path)) {
|
3517
|
+
breadcrumbs.push({ page, path });
|
3518
|
+
this.Save(breadcrumbs);
|
578
3519
|
}
|
579
|
-
return null;
|
580
|
-
}
|
581
|
-
/** Is Excel File */
|
582
|
-
static IsExcel(file) {
|
583
|
-
const EXTENSION = Files.GetExtension(file);
|
584
|
-
return Tools.IsNotNull(EXTENSION)
|
585
|
-
? this.EXCEL_EXTENSIONS.includes(EXTENSION)
|
586
|
-
: false;
|
587
|
-
}
|
588
|
-
/** Read excel file */
|
589
|
-
static ReadExcel(file) {
|
590
|
-
return new Promise(Resolve => {
|
591
|
-
let columns = [];
|
592
|
-
let rows = [];
|
593
|
-
const reader = new FileReader();
|
594
|
-
reader.readAsArrayBuffer(file);
|
595
|
-
reader.onload = () => {
|
596
|
-
const dataBytes = new Uint8Array(reader.result);
|
597
|
-
if (dataBytes) {
|
598
|
-
const workbook = XLSX.read(dataBytes, {});
|
599
|
-
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
600
|
-
let dataSheet = XLSX.utils.sheet_to_json(sheet, {
|
601
|
-
header: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
|
602
|
-
});
|
603
|
-
//Get Headers
|
604
|
-
for (const column in dataSheet[0]) {
|
605
|
-
columns.push(Tools.FirstCharToLower(String(dataSheet[0][column]).replaceAll(' ', '')));
|
606
|
-
}
|
607
|
-
//Get Rows
|
608
|
-
rows = XLSX.utils.sheet_to_json(sheet, { header: columns });
|
609
|
-
rows.shift();
|
610
|
-
rows = rows.map(row => {
|
611
|
-
const item = Tools.BreakReference(row);
|
612
|
-
delete item['__rowNum__'];
|
613
|
-
return item;
|
614
|
-
});
|
615
|
-
}
|
616
|
-
Resolve({ columns, rows });
|
617
|
-
};
|
618
|
-
reader.onerror = () => { Resolve({ columns, rows }); };
|
619
|
-
});
|
620
3520
|
}
|
621
|
-
/**
|
622
|
-
static
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
if (
|
627
|
-
|
628
|
-
}
|
629
|
-
if (fileName.includes('.csv')) {
|
630
|
-
fileName = fileName.replaceAll('.csv', '.xlsx');
|
3521
|
+
/** */
|
3522
|
+
static Get() {
|
3523
|
+
let storage = sessionStorage.getItem(this.storage);
|
3524
|
+
if (storage) {
|
3525
|
+
storage = JSON.parse(storage);
|
3526
|
+
if (storage.hasOwnProperty('breadcrumbs')) {
|
3527
|
+
return Tools.BreakReference(storage.breadcrumbs);
|
631
3528
|
}
|
632
3529
|
}
|
633
|
-
|
634
|
-
|
3530
|
+
return [];
|
3531
|
+
}
|
3532
|
+
/** */
|
3533
|
+
static GetFirst() {
|
3534
|
+
const breadcrumbs = this.Get();
|
3535
|
+
return (breadcrumbs.length > 0) ? breadcrumbs.shift() : null;
|
3536
|
+
}
|
3537
|
+
/** */
|
3538
|
+
static Save(breadcrumbs) {
|
3539
|
+
let storage = sessionStorage.getItem(this.storage);
|
3540
|
+
if (storage)
|
3541
|
+
storage = JSON.parse(storage);
|
3542
|
+
storage = Object.assign({}, storage, { breadcrumbs });
|
3543
|
+
sessionStorage.setItem(this.storage, JSON.stringify(storage));
|
3544
|
+
}
|
3545
|
+
/** */
|
3546
|
+
static Remove(path) {
|
3547
|
+
let breadcrumbs = this.Get();
|
3548
|
+
const index = breadcrumbs.findIndex(x => x.path.toLowerCase().trim() === path.toLowerCase().trim());
|
3549
|
+
if (index >= 0) {
|
3550
|
+
breadcrumbs = Tools.BreakReference(breadcrumbs).splice(0, index + 1);
|
3551
|
+
this.Save(breadcrumbs);
|
635
3552
|
}
|
636
|
-
const WORK_SHEET = XLSX.utils.json_to_sheet(data);
|
637
|
-
const WORK_BOOK = XLSX.utils.book_new();
|
638
|
-
XLSX.utils.book_append_sheet(WORK_BOOK, WORK_SHEET, sheetName);
|
639
|
-
XLSX.writeFile(WORK_BOOK, fileName);
|
640
3553
|
}
|
641
|
-
/**
|
642
|
-
static
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
3554
|
+
/** */
|
3555
|
+
static SetLast(page, path) {
|
3556
|
+
const breadcrumbs = this.Get();
|
3557
|
+
if (breadcrumbs.length > 0) {
|
3558
|
+
breadcrumbs[breadcrumbs.length - 1] = { page, path };
|
3559
|
+
this.Save(breadcrumbs);
|
3560
|
+
}
|
3561
|
+
}
|
3562
|
+
/** */
|
3563
|
+
static RemoveLast() {
|
3564
|
+
const breadcrumbs = this.Get();
|
3565
|
+
if (breadcrumbs.length > 0) {
|
3566
|
+
breadcrumbs.pop();
|
3567
|
+
this.Save(breadcrumbs);
|
3568
|
+
}
|
651
3569
|
}
|
652
3570
|
}
|
653
3571
|
|
@@ -876,264 +3794,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
876
3794
|
args: [String]
|
877
3795
|
}] }] });
|
878
3796
|
|
879
|
-
class Screen {
|
880
|
-
static get WINDOW_WIDTH() {
|
881
|
-
return window.innerWidth;
|
882
|
-
}
|
883
|
-
static get WINDOW_HEIGHT() {
|
884
|
-
return window.innerHeight;
|
885
|
-
}
|
886
|
-
static get DEVICE_WIDTH() {
|
887
|
-
return window.screen.width;
|
888
|
-
}
|
889
|
-
static get DEVICE_HEIGHT() {
|
890
|
-
return window.screen.height;
|
891
|
-
}
|
892
|
-
static get BREAKPOINT() {
|
893
|
-
if (window.innerWidth < 576)
|
894
|
-
return 'xs';
|
895
|
-
else if (window.innerWidth >= 576 && window.innerWidth < 768)
|
896
|
-
return 'sm';
|
897
|
-
else if (window.innerWidth >= 768 && window.innerWidth < 992)
|
898
|
-
return 'md';
|
899
|
-
else if (window.innerWidth >= 992 && window.innerWidth < 1200)
|
900
|
-
return 'lg';
|
901
|
-
else if (window.innerWidth >= 1200 && window.innerWidth < 1400)
|
902
|
-
return 'xl';
|
903
|
-
else
|
904
|
-
return 'xxl';
|
905
|
-
}
|
906
|
-
/** */
|
907
|
-
static { this.Resize = new Observable(subscriber => {
|
908
|
-
window.addEventListener("load", () => {
|
909
|
-
window.dispatchEvent(new Event('resize'));
|
910
|
-
});
|
911
|
-
window.onresize = () => {
|
912
|
-
subscriber.next({
|
913
|
-
width: this.WINDOW_WIDTH,
|
914
|
-
height: this.WINDOW_HEIGHT,
|
915
|
-
breakpoin: this.BREAKPOINT
|
916
|
-
});
|
917
|
-
};
|
918
|
-
}); }
|
919
|
-
}
|
920
|
-
|
921
|
-
class CoerButton {
|
922
|
-
constructor() {
|
923
|
-
//Variables
|
924
|
-
this._id = Tools.GetGuid('coer-button');
|
925
|
-
this._tooltip = '';
|
926
|
-
//Inputs
|
927
|
-
this.id = '';
|
928
|
-
this.color = input('default');
|
929
|
-
this.type = input('filled');
|
930
|
-
this.icon = input('');
|
931
|
-
this.iconPosition = input('left');
|
932
|
-
this.animation = input(false);
|
933
|
-
this.isLoading = input(false);
|
934
|
-
this.isDisabled = input(false);
|
935
|
-
this.isInvisible = input(false);
|
936
|
-
this.width = input('125px');
|
937
|
-
this.minWidth = input('30px');
|
938
|
-
this.height = input('40px');
|
939
|
-
this.minHeight = input('30px');
|
940
|
-
this.marginTop = input('0px');
|
941
|
-
this.marginRight = input('0px');
|
942
|
-
this.marginBottom = input('0px');
|
943
|
-
this.marginLeft = input('0px');
|
944
|
-
this.path = input([]);
|
945
|
-
this.tooltipPosition = input('left');
|
946
|
-
//Outputs
|
947
|
-
this.onClick = new EventEmitter();
|
948
|
-
//computed
|
949
|
-
this._isEnable = computed(() => {
|
950
|
-
return !this.isLoading() && !this.isDisabled() && !this.isInvisible();
|
951
|
-
});
|
952
|
-
//computed
|
953
|
-
this._icon = computed(() => {
|
954
|
-
switch (this.icon()) {
|
955
|
-
case 'new': return 'fa-solid fa-plus fa-lg';
|
956
|
-
case 'save': return 'fa-solid fa-floppy-disk fa-lg';
|
957
|
-
case 'cancel': return 'fa-solid fa-xmark fa-lg';
|
958
|
-
case 'import': return 'fa-solid fa-file-arrow-up fa-lg';
|
959
|
-
case 'excel': return 'bi bi-filetype-xlsx fa-lg';
|
960
|
-
case 'menu': return 'fa-solid fa-bars';
|
961
|
-
case 'delete': return 'fa-solid fa-trash-can';
|
962
|
-
case 'edit': return 'fa-solid fa-pen fa-lg';
|
963
|
-
case 'go': return 'bi bi-box-arrow-right';
|
964
|
-
case 'back': return 'bi bi-box-arrow-left';
|
965
|
-
default: return '';
|
966
|
-
}
|
967
|
-
});
|
968
|
-
}
|
969
|
-
set tooltip(value) {
|
970
|
-
this._tooltip = value;
|
971
|
-
if (value && this._tooltipElement) {
|
972
|
-
this._tooltipElement.setContent({ '.tooltip-inner': this._tooltip });
|
973
|
-
}
|
974
|
-
}
|
975
|
-
ngOnInit() {
|
976
|
-
this.SetToolTip();
|
977
|
-
this.SetEvents();
|
978
|
-
}
|
979
|
-
ngOnDestroy() {
|
980
|
-
if (this._tooltipElement) {
|
981
|
-
Tools.Sleep().then(() => this._tooltipElement.dispose());
|
982
|
-
}
|
983
|
-
}
|
984
|
-
/** */
|
985
|
-
SetEvents() {
|
986
|
-
Tools.Sleep().then(() => {
|
987
|
-
this._element = document.getElementById(`${this._id}-inner-button`);
|
988
|
-
if (Tools.IsNotNull(this._element)) {
|
989
|
-
this._element.addEventListener('focus', () => {
|
990
|
-
if (!this._isEnable())
|
991
|
-
this.Blur();
|
992
|
-
});
|
993
|
-
}
|
994
|
-
});
|
995
|
-
}
|
996
|
-
SetToolTip() {
|
997
|
-
Tools.Sleep().then(() => {
|
998
|
-
const htmlElement = document.getElementById(`${this._id}-container`);
|
999
|
-
if (Tools.IsNotNull(htmlElement)) {
|
1000
|
-
htmlElement.addEventListener('mouseleave', () => {
|
1001
|
-
if (Tools.IsNotNull(htmlElement) && Tools.IsNotNull(this._tooltipElement)) {
|
1002
|
-
this._tooltipElement.hide();
|
1003
|
-
}
|
1004
|
-
});
|
1005
|
-
this._tooltipElement = new Tooltip(htmlElement, {
|
1006
|
-
html: true,
|
1007
|
-
title: this._tooltip,
|
1008
|
-
placement: this.tooltipPosition
|
1009
|
-
});
|
1010
|
-
}
|
1011
|
-
});
|
1012
|
-
}
|
1013
|
-
/** */
|
1014
|
-
Click(event) {
|
1015
|
-
if (this._isEnable()) {
|
1016
|
-
this.onClick.emit(event);
|
1017
|
-
}
|
1018
|
-
this.Blur();
|
1019
|
-
}
|
1020
|
-
/** */
|
1021
|
-
Focus(timeout = 0) {
|
1022
|
-
Tools.Sleep(timeout).then(() => {
|
1023
|
-
if (this._isEnable())
|
1024
|
-
this._element.focus();
|
1025
|
-
});
|
1026
|
-
}
|
1027
|
-
/** */
|
1028
|
-
Blur() {
|
1029
|
-
Tools.Sleep().then(() => {
|
1030
|
-
this._element.blur();
|
1031
|
-
});
|
1032
|
-
}
|
1033
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1034
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerButton, selector: "coer-button", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "animation", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isInvisible: { classPropertyName: "isInvisible", publicName: "isInvisible", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, marginTop: { classPropertyName: "marginTop", publicName: "marginTop", isSignal: true, isRequired: false, transformFunction: null }, marginRight: { classPropertyName: "marginRight", publicName: "marginRight", isSignal: true, isRequired: false, transformFunction: null }, marginBottom: { classPropertyName: "marginBottom", publicName: "marginBottom", isSignal: true, isRequired: false, transformFunction: null }, marginLeft: { classPropertyName: "marginLeft", publicName: "marginLeft", isSignal: true, isRequired: false, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<div [ngClass]=\"{ 'coer-button': true, 'invisible': isInvisible() }\">\r\n <a [id]=\"_id + '-container'\"\r\n [routerLink]=\"(path().length > 0 && _isEnable()) ? path() : null\"\r\n [ngClass]=\"{ 'loading': isLoading(), 'animate__animated animate__zoomIn': true, 'animate__disabled': !animation() }\"\r\n [ngStyle]=\"{ 'margin-top': marginTop(), 'margin-right': marginRight(), 'margin-bottom': marginBottom(), 'margin-left': marginLeft() }\">\r\n @if(type() =='filled' || type() == 'outline') {\r\n <button mat-button\r\n [id]=\"_id + '-inner-button'\"\r\n type=\"button\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-filled': (color() == 'primary' && type() =='filled'),\r\n 'secondary-filled': (color() == 'secondary' && type() =='filled'),\r\n 'success-filled': (color() == 'success' && type() =='filled'),\r\n 'warning-filled': (color() == 'warning' && type() =='filled'),\r\n 'danger-filled': (color() == 'danger' && type() =='filled'),\r\n 'navigation-filled': (color() == 'navigation' && type() =='filled'),\r\n 'primary-outline': (color() == 'primary' && type() =='outline'),\r\n 'secondary-outline': (color() == 'secondary' && type() =='outline'),\r\n 'success-outline': (color() == 'success' && type() =='outline'),\r\n 'warning-outline': (color() == 'warning' && type() =='outline'),\r\n 'danger-outline': (color() == 'danger' && type() =='outline'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': isDisabled(),\r\n 'cursor-wait': isLoading()\r\n }\"\r\n [ngStyle]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'height': height(),\r\n 'min-height': minHeight()\r\n }\">\r\n <span class=\"slot\" *ngIf=\"!isLoading(); else loading\" >\r\n <span *ngIf=\"(iconPosition() == 'left')\">\r\n <i [class]=\"_icon()\"></i>\r\n </span>\r\n\r\n <span [ngClass]=\"{ 'ms-2': (iconPosition() == 'left'), 'me-2': (iconPosition() == 'right') }\">\r\n <ng-content></ng-content>\r\n </span>\r\n\r\n <span *ngIf=\"(iconPosition() == 'right')\">\r\n <i [class]=\"_icon()\"></i>\r\n </span>\r\n </span>\r\n\r\n <ng-template #loading>\r\n <span class=\"slot fa-fade\">\r\n <span class=\"me-2\"> Loading </span>\r\n <i class=\"spinner-border\"></i>\r\n </span>\r\n </ng-template>\r\n </button>\r\n }\r\n\r\n @else {\r\n @if (type() == 'icon') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-filled': (color() == 'primary'),\r\n 'secondary-filled': (color() == 'secondary'),\r\n 'success-filled': (color() == 'success'),\r\n 'warning-filled': (color() == 'warning'),\r\n 'danger-filled': (color() == 'danger'),\r\n 'navigation-filled': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'cursor-wait': isLoading()\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n\r\n @else if (type() == 'icon-outline') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-outline': (color() == 'primary'),\r\n 'secondary-outline': (color() == 'secondary'),\r\n 'success-outline': (color() == 'success'),\r\n 'warning-outline': (color() == 'warning'),\r\n 'danger-outline': (color() == 'danger'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'cursor-wait': isLoading()\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n\r\n @else if (type() == 'icon-no-border') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-outline': (color() == 'primary'),\r\n 'secondary-outline': (color() == 'secondary'),\r\n 'success-outline': (color() == 'success'),\r\n 'warning-outline': (color() == 'warning'),\r\n 'danger-outline': (color() == 'danger'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'icon-no-border': true\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n }\r\n </a>\r\n</div>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.border-blue{border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.border-gray{border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.border-green{border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.border-yellow{border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.border-red{border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.border-white{border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.border-black{border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}.border-orange{border-color:#fd6031!important}coer-button{display:contents!important}div.coer-button{display:contents!important}div.coer-button a{display:inline-block!important}div.coer-button a.animate__disabled{animation-duration:0s!important}div.coer-button button{font-size:17px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}div.coer-button .slot{width:100px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-overflow:ellipsis!important;overflow:hidden!important}div.coer-button button.primary-filled{background-color:#0d6efd!important;color:#f5f5f5!important}div.coer-button button.secondary-filled{background-color:#6c757d!important;color:#f5f5f5!important}div.coer-button button.success-filled{background-color:#198754!important;color:#f5f5f5!important}div.coer-button button.warning-filled{background-color:#ffc107!important;color:#252525!important}div.coer-button button.danger-filled{background-color:#dc3545!important;color:#f5f5f5!important}div.coer-button button.navigation-filled{background-color:#fd6031!important;color:#f5f5f5!important}div.coer-button button.primary-outline{background-color:#fff!important;border:1px solid #0d6efd!important;color:#0d6efd!important}div.coer-button button.secondary-outline{background-color:#fff!important;border:1px solid #6c757d!important;color:#6c757d!important}div.coer-button button.success-outline{background-color:#fff!important;border:1px solid #198754!important;color:#198754!important}div.coer-button button.warning-outline{background-color:#fff!important;border:1px solid #ffc107!important;color:#ffc107!important}div.coer-button button.danger-outline{background-color:#fff!important;border:1px solid #dc3545!important;color:#dc3545!important}div.coer-button button.navigation-outline{background-color:#fff!important;border:1px solid #fd6031!important;color:#fd6031!important}div.coer-button button.primary-filled:not(.readonly):hover,div.coer-button button.primary-filled:not(.readonly):focus,div.coer-button button.primary-outline:not(.readonly):hover,div.coer-button button.primary-outline:not(.readonly):focus,div.coer-button button.secondary-filled:not(.readonly):hover,div.coer-button button.secondary-filled:not(.readonly):focus,div.coer-button button.secondary-outline:not(.readonly):hover,div.coer-button button.secondary-outline:not(.readonly):focus,div.coer-button button.success-filled:not(.readonly):hover,div.coer-button button.success-filled:not(.readonly):focus,div.coer-button button.success-outline:not(.readonly):hover,div.coer-button button.success-outline:not(.readonly):focus,div.coer-button button.warning-filled:not(.readonly):hover,div.coer-button button.warning-filled:not(.readonly):focus,div.coer-button button.warning-outline:not(.readonly):hover,div.coer-button button.warning-outline:not(.readonly):focus,div.coer-button button.danger-filled:not(.readonly):hover,div.coer-button button.danger-filled:not(.readonly):focus,div.coer-button button.danger-outline:not(.readonly):hover,div.coer-button button.danger-outline:not(.readonly):focus{filter:brightness(1.1)!important}div.coer-button button.primary-filled:not(.readonly):focus,div.coer-button button.primary-outline:not(.readonly):focus{box-shadow:0 0 20px #0d6efd!important}div.coer-button button.secondary-filled:not(.readonly):focus,div.coer-button button.secondary-outline:not(.readonly):focus{box-shadow:0 0 20px #6c757d!important}div.coer-button button.success-filled:not(.readonly):focus,div.coer-button button.success-outline:not(.readonly):focus{box-shadow:0 0 20px #198754!important}div.coer-button button.warning-filled:not(.readonly):focus,div.coer-button button.warning-outline:not(.readonly):focus{box-shadow:0 0 20px #ffc107!important}div.coer-button button.danger-filled:not(.readonly):focus,div.coer-button button.danger-outline:not(.readonly):focus{box-shadow:0 0 20px #dc3545!important}div.coer-button button.navigation-filled:not(.readonly):focus,div.coer-button button.navigation-outline:not(.readonly):focus{box-shadow:0 0 20px #fd6031!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button{width:40px!important;height:40px!important;padding:0!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border{width:25px!important;height:25px!important;background-color:transparent!important;border:none!important;overflow:visible!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border *{font-size:medium!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border i.bi-box-arrow-left,div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border i.bi-box-arrow-in-right{font-size:20px!important}div.coer-button button.readonly,div.coer-button button.readonly:hover,div.coer-button button.readonly:focus{background-color:#dfdede!important;border-color:#dfdede!important;color:#fff!important}div.coer-button coer-button[ishidden=true],div.coer-button coer-button[ng-reflect-invisible=true]{position:relative!important;top:10000vh;left:10000vw}div.coer-button a.loading{cursor:wait!important}div.coer-button i{vertical-align:middle!important}div.coer-button i.spinner-border{width:15px!important;height:15px!important;font-size:16px!important}div.coer-button span{font-weight:700!important}div#coer-tool-bar coer-button *{color:#fd6031!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
|
1035
|
-
}
|
1036
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerButton, decorators: [{
|
1037
|
-
type: Component,
|
1038
|
-
args: [{ selector: 'coer-button', template: "<div [ngClass]=\"{ 'coer-button': true, 'invisible': isInvisible() }\">\r\n <a [id]=\"_id + '-container'\"\r\n [routerLink]=\"(path().length > 0 && _isEnable()) ? path() : null\"\r\n [ngClass]=\"{ 'loading': isLoading(), 'animate__animated animate__zoomIn': true, 'animate__disabled': !animation() }\"\r\n [ngStyle]=\"{ 'margin-top': marginTop(), 'margin-right': marginRight(), 'margin-bottom': marginBottom(), 'margin-left': marginLeft() }\">\r\n @if(type() =='filled' || type() == 'outline') {\r\n <button mat-button\r\n [id]=\"_id + '-inner-button'\"\r\n type=\"button\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-filled': (color() == 'primary' && type() =='filled'),\r\n 'secondary-filled': (color() == 'secondary' && type() =='filled'),\r\n 'success-filled': (color() == 'success' && type() =='filled'),\r\n 'warning-filled': (color() == 'warning' && type() =='filled'),\r\n 'danger-filled': (color() == 'danger' && type() =='filled'),\r\n 'navigation-filled': (color() == 'navigation' && type() =='filled'),\r\n 'primary-outline': (color() == 'primary' && type() =='outline'),\r\n 'secondary-outline': (color() == 'secondary' && type() =='outline'),\r\n 'success-outline': (color() == 'success' && type() =='outline'),\r\n 'warning-outline': (color() == 'warning' && type() =='outline'),\r\n 'danger-outline': (color() == 'danger' && type() =='outline'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': isDisabled(),\r\n 'cursor-wait': isLoading()\r\n }\"\r\n [ngStyle]=\"{\r\n 'width': width(),\r\n 'min-width': minWidth(),\r\n 'height': height(),\r\n 'min-height': minHeight()\r\n }\">\r\n <span class=\"slot\" *ngIf=\"!isLoading(); else loading\" >\r\n <span *ngIf=\"(iconPosition() == 'left')\">\r\n <i [class]=\"_icon()\"></i>\r\n </span>\r\n\r\n <span [ngClass]=\"{ 'ms-2': (iconPosition() == 'left'), 'me-2': (iconPosition() == 'right') }\">\r\n <ng-content></ng-content>\r\n </span>\r\n\r\n <span *ngIf=\"(iconPosition() == 'right')\">\r\n <i [class]=\"_icon()\"></i>\r\n </span>\r\n </span>\r\n\r\n <ng-template #loading>\r\n <span class=\"slot fa-fade\">\r\n <span class=\"me-2\"> Loading </span>\r\n <i class=\"spinner-border\"></i>\r\n </span>\r\n </ng-template>\r\n </button>\r\n }\r\n\r\n @else {\r\n @if (type() == 'icon') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-filled': (color() == 'primary'),\r\n 'secondary-filled': (color() == 'secondary'),\r\n 'success-filled': (color() == 'success'),\r\n 'warning-filled': (color() == 'warning'),\r\n 'danger-filled': (color() == 'danger'),\r\n 'navigation-filled': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'cursor-wait': isLoading()\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n\r\n @else if (type() == 'icon-outline') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-outline': (color() == 'primary'),\r\n 'secondary-outline': (color() == 'secondary'),\r\n 'success-outline': (color() == 'success'),\r\n 'warning-outline': (color() == 'warning'),\r\n 'danger-outline': (color() == 'danger'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'cursor-wait': isLoading()\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n\r\n @else if (type() == 'icon-no-border') {\r\n <button mat-icon-button\r\n [id]=\"_id + '-inner-button'\"\r\n (click)=\"Click($event)\"\r\n [ngClass]=\"{\r\n 'primary-outline': (color() == 'primary'),\r\n 'secondary-outline': (color() == 'secondary'),\r\n 'success-outline': (color() == 'success'),\r\n 'warning-outline': (color() == 'warning'),\r\n 'danger-outline': (color() == 'danger'),\r\n 'navigation-outline': (color() == 'navigation'),\r\n 'readonly': (isDisabled() || isLoading()),\r\n 'icon-no-border': true\r\n }\">\r\n <i [class]=\"_icon()\"></i>\r\n </button>\r\n }\r\n }\r\n </a>\r\n</div>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.border-blue{border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.border-gray{border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.border-green{border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.border-yellow{border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.border-red{border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.border-white{border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.border-black{border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}.border-orange{border-color:#fd6031!important}coer-button{display:contents!important}div.coer-button{display:contents!important}div.coer-button a{display:inline-block!important}div.coer-button a.animate__disabled{animation-duration:0s!important}div.coer-button button{font-size:17px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}div.coer-button .slot{width:100px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-overflow:ellipsis!important;overflow:hidden!important}div.coer-button button.primary-filled{background-color:#0d6efd!important;color:#f5f5f5!important}div.coer-button button.secondary-filled{background-color:#6c757d!important;color:#f5f5f5!important}div.coer-button button.success-filled{background-color:#198754!important;color:#f5f5f5!important}div.coer-button button.warning-filled{background-color:#ffc107!important;color:#252525!important}div.coer-button button.danger-filled{background-color:#dc3545!important;color:#f5f5f5!important}div.coer-button button.navigation-filled{background-color:#fd6031!important;color:#f5f5f5!important}div.coer-button button.primary-outline{background-color:#fff!important;border:1px solid #0d6efd!important;color:#0d6efd!important}div.coer-button button.secondary-outline{background-color:#fff!important;border:1px solid #6c757d!important;color:#6c757d!important}div.coer-button button.success-outline{background-color:#fff!important;border:1px solid #198754!important;color:#198754!important}div.coer-button button.warning-outline{background-color:#fff!important;border:1px solid #ffc107!important;color:#ffc107!important}div.coer-button button.danger-outline{background-color:#fff!important;border:1px solid #dc3545!important;color:#dc3545!important}div.coer-button button.navigation-outline{background-color:#fff!important;border:1px solid #fd6031!important;color:#fd6031!important}div.coer-button button.primary-filled:not(.readonly):hover,div.coer-button button.primary-filled:not(.readonly):focus,div.coer-button button.primary-outline:not(.readonly):hover,div.coer-button button.primary-outline:not(.readonly):focus,div.coer-button button.secondary-filled:not(.readonly):hover,div.coer-button button.secondary-filled:not(.readonly):focus,div.coer-button button.secondary-outline:not(.readonly):hover,div.coer-button button.secondary-outline:not(.readonly):focus,div.coer-button button.success-filled:not(.readonly):hover,div.coer-button button.success-filled:not(.readonly):focus,div.coer-button button.success-outline:not(.readonly):hover,div.coer-button button.success-outline:not(.readonly):focus,div.coer-button button.warning-filled:not(.readonly):hover,div.coer-button button.warning-filled:not(.readonly):focus,div.coer-button button.warning-outline:not(.readonly):hover,div.coer-button button.warning-outline:not(.readonly):focus,div.coer-button button.danger-filled:not(.readonly):hover,div.coer-button button.danger-filled:not(.readonly):focus,div.coer-button button.danger-outline:not(.readonly):hover,div.coer-button button.danger-outline:not(.readonly):focus{filter:brightness(1.1)!important}div.coer-button button.primary-filled:not(.readonly):focus,div.coer-button button.primary-outline:not(.readonly):focus{box-shadow:0 0 20px #0d6efd!important}div.coer-button button.secondary-filled:not(.readonly):focus,div.coer-button button.secondary-outline:not(.readonly):focus{box-shadow:0 0 20px #6c757d!important}div.coer-button button.success-filled:not(.readonly):focus,div.coer-button button.success-outline:not(.readonly):focus{box-shadow:0 0 20px #198754!important}div.coer-button button.warning-filled:not(.readonly):focus,div.coer-button button.warning-outline:not(.readonly):focus{box-shadow:0 0 20px #ffc107!important}div.coer-button button.danger-filled:not(.readonly):focus,div.coer-button button.danger-outline:not(.readonly):focus{box-shadow:0 0 20px #dc3545!important}div.coer-button button.navigation-filled:not(.readonly):focus,div.coer-button button.navigation-outline:not(.readonly):focus{box-shadow:0 0 20px #fd6031!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button{width:40px!important;height:40px!important;padding:0!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border{width:25px!important;height:25px!important;background-color:transparent!important;border:none!important;overflow:visible!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border *{font-size:medium!important}div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border i.bi-box-arrow-left,div.coer-button button.mdc-icon-button.mat-mdc-icon-button.icon-no-border i.bi-box-arrow-in-right{font-size:20px!important}div.coer-button button.readonly,div.coer-button button.readonly:hover,div.coer-button button.readonly:focus{background-color:#dfdede!important;border-color:#dfdede!important;color:#fff!important}div.coer-button coer-button[ishidden=true],div.coer-button coer-button[ng-reflect-invisible=true]{position:relative!important;top:10000vh;left:10000vw}div.coer-button a.loading{cursor:wait!important}div.coer-button i{vertical-align:middle!important}div.coer-button i.spinner-border{width:15px!important;height:15px!important;font-size:16px!important}div.coer-button span{font-weight:700!important}div#coer-tool-bar coer-button *{color:#fd6031!important}\n"] }]
|
1039
|
-
}], propDecorators: { id: [{
|
1040
|
-
type: Input
|
1041
|
-
}], tooltip: [{
|
1042
|
-
type: Input
|
1043
|
-
}], onClick: [{
|
1044
|
-
type: Output
|
1045
|
-
}] } });
|
1046
|
-
|
1047
|
-
//import { CoerCheckbox } from './coer-checkbox/coer-checkbox.component';
|
1048
|
-
//import { CoerFilebox } from './coer-filebox/coer-filebox.component';
|
1049
|
-
//import { CoerForm } from './coer-form/coer-form.component';
|
1050
|
-
//import { CoerGrid } from './coer-grid/coer-grid.component';
|
1051
|
-
//import { CoerModal } from './coer-modal/coer-modal.component';
|
1052
|
-
//import { CoerNumberBox } from './coer-numberbox/coer-numberbox.component';
|
1053
|
-
//import { CoerPageTitle } from './coer-page-title/coer-page-title.component';
|
1054
|
-
//import { CoerSelectbox } from './coer-selectbox/coer-selectbox.component';
|
1055
|
-
//import { CoerSwitch } from './coer-switch/coer-switch.component';
|
1056
|
-
//import { CoerTab } from './coer-tab/coer-tab.component';
|
1057
|
-
//import { CoerTextarea } from './coer-textarea/coer-textarea.component';
|
1058
|
-
//import { CoerTextBox } from './coer-textbox/coer-textbox.component';
|
1059
|
-
class ComponentsModule {
|
1060
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1061
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, declarations: [CoerAlert,
|
1062
|
-
CoerButton], imports: [CommonModule,
|
1063
|
-
RouterModule,
|
1064
|
-
FormsModule,
|
1065
|
-
ReactiveFormsModule,
|
1066
|
-
//PipesModule,
|
1067
|
-
MatButtonModule], exports: [CoerAlert,
|
1068
|
-
CoerButton] }); }
|
1069
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, imports: [CommonModule,
|
1070
|
-
RouterModule,
|
1071
|
-
FormsModule,
|
1072
|
-
ReactiveFormsModule,
|
1073
|
-
//PipesModule,
|
1074
|
-
MatButtonModule] }); }
|
1075
|
-
}
|
1076
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, decorators: [{
|
1077
|
-
type: NgModule,
|
1078
|
-
args: [{
|
1079
|
-
imports: [
|
1080
|
-
CommonModule,
|
1081
|
-
RouterModule,
|
1082
|
-
FormsModule,
|
1083
|
-
ReactiveFormsModule,
|
1084
|
-
//PipesModule,
|
1085
|
-
MatButtonModule,
|
1086
|
-
//MatCheckboxModule,
|
1087
|
-
//MatInputModule,
|
1088
|
-
//MatFormFieldModule,
|
1089
|
-
//MatSlideToggleModule,
|
1090
|
-
//MatTabsModule,
|
1091
|
-
//DirectivesModule
|
1092
|
-
],
|
1093
|
-
declarations: [
|
1094
|
-
CoerAlert,
|
1095
|
-
CoerButton,
|
1096
|
-
//CoerCheckbox,
|
1097
|
-
//CoerFilebox,
|
1098
|
-
//CoerForm,
|
1099
|
-
//CoerGrid,
|
1100
|
-
//CoerModal,
|
1101
|
-
//CoerNumberBox,
|
1102
|
-
//CoerPageTitle,
|
1103
|
-
//CoerSelectbox,
|
1104
|
-
//CoerSwitch,
|
1105
|
-
//CoerTextarea,
|
1106
|
-
//CoerTab,
|
1107
|
-
//CoerTextBox,
|
1108
|
-
],
|
1109
|
-
exports: [
|
1110
|
-
CoerAlert,
|
1111
|
-
CoerButton,
|
1112
|
-
//CoerCheckbox,
|
1113
|
-
//CoerFilebox,
|
1114
|
-
//CoerForm,
|
1115
|
-
//CoerGrid,
|
1116
|
-
//CoerModal,
|
1117
|
-
//CoerNumberBox,
|
1118
|
-
//CoerPageTitle,
|
1119
|
-
//CoerSelectbox,
|
1120
|
-
//CoerSwitch,
|
1121
|
-
//CoerTextarea,
|
1122
|
-
//CoerTab,
|
1123
|
-
//CoerTextBox,
|
1124
|
-
]
|
1125
|
-
}]
|
1126
|
-
}] });
|
1127
|
-
|
1128
|
-
const breakpointSIGNAL = signal(Screen?.BREAKPOINT || 'xs');
|
1129
|
-
|
1130
|
-
const isLoadingSIG = signal(false);
|
1131
|
-
|
1132
|
-
const isModalOpenSIG = signal(false);
|
1133
|
-
|
1134
3797
|
/**
|
1135
3798
|
* Generated bundle index. Do not edit.
|
1136
3799
|
*/
|
1137
3800
|
|
1138
|
-
export { Breadcrumbs, CONTROL_VALUE, CoerAlert, CoerButton, ComponentsModule, ControlValue, DateTime, Files, Page, Screen, Source, Tools, breakpointSIGNAL,
|
3801
|
+
export { Breadcrumbs, CONTROL_VALUE, CoerAlert, CoerButton, CoerCheckbox, CoerFilebox, CoerForm, CoerGrid, CoerModal, CoerNumberBox, CoerPageTitle, CoerRefDirective, CoerSelectbox, CoerSwitch, CoerTab, CoerTextBox, CoerTextarea, ComponentsModule, ControlValue, DateTime, DirectivesModule, Files, HtmlPipe, LifeCycleDirective, Menu, NoImagePipe, NumericFormatPipe, Page, PipesModule, Screen, Source, Tools, breakpointSIGNAL, isLoadingSIGNAL, isModalOpenSIGNAL };
|
1139
3802
|
//# sourceMappingURL=coer-elements.mjs.map
|